diff --git a/backdooringneuralcodesearch/e9fd55ca-d3a9-41f2-9f87-0baac08746da_content_list.json b/backdooringneuralcodesearch/e9fd55ca-d3a9-41f2-9f87-0baac08746da_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..b8d0f30099e75e87071977b4fbb8037e16a87d15 --- /dev/null +++ b/backdooringneuralcodesearch/e9fd55ca-d3a9-41f2-9f87-0baac08746da_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:64be7d875c357c5437a8ef59d56b2da62f420b8cc63552409066923ecec7667b +size 113496 diff --git a/backdooringneuralcodesearch/e9fd55ca-d3a9-41f2-9f87-0baac08746da_model.json b/backdooringneuralcodesearch/e9fd55ca-d3a9-41f2-9f87-0baac08746da_model.json new file mode 100644 index 0000000000000000000000000000000000000000..be2eeed65f9f3b4606a5e70a5cdd65e21b1be8d1 --- /dev/null +++ b/backdooringneuralcodesearch/e9fd55ca-d3a9-41f2-9f87-0baac08746da_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:03172c2527d747a482b19c95e5aca6f8b988a47eaa7103627881f50e911fb1e2 +size 136911 diff --git a/backdooringneuralcodesearch/e9fd55ca-d3a9-41f2-9f87-0baac08746da_origin.pdf b/backdooringneuralcodesearch/e9fd55ca-d3a9-41f2-9f87-0baac08746da_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..63acd4cc0288b2f29b04d79a9f86b52f5824615d --- /dev/null +++ b/backdooringneuralcodesearch/e9fd55ca-d3a9-41f2-9f87-0baac08746da_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5baa061f9adac02328c7b86608121ae4e307a7f9c3a557dd758648c3310a60ab +size 880611 diff --git a/backdooringneuralcodesearch/full.md b/backdooringneuralcodesearch/full.md new file mode 100644 index 0000000000000000000000000000000000000000..35621df09ac473c4129407611aa9440b53ef1e82 --- /dev/null +++ b/backdooringneuralcodesearch/full.md @@ -0,0 +1,454 @@ +# Backdooring Neural Code Search + +Weisong Sun $^{1*}$ , Yuchen Chen $^{1*}$ , Guanhong Tao $^{2*}$ , Chunrong Fang $^{1\dagger}$ , Xiangyu Zhang $^{2}$ , Quanjun Zhang $^{1}$ , Bin Luo $^{1}$ + +$^{1}$ State Key Laboratory for Novel Software Technology, Nanjing University, China $^{2}$ Purdue University, USA + +weisongsun@smail.nju.edu.cn, yuc.chen@smail.nju.edu.cn, taog@purdue.edu, fangchunrong@snu.edu.cn, xyzhang@cs.purdue.edu, quanjun.zhang@smail.nju.edu.cn, luobin@nju.edu.cn + +*Equal contribution, †Corresponding author. + +# Abstract + +Reusing off-the-shelf code snippets from online repositories is a common practice, which significantly enhances the productivity of software developers. To find desired code snippets, developers resort to code search engines through natural language queries. Neural code search models are hence behind many such engines. These models are based on deep learning and gain substantial attention due to their impressive performance. However, the security aspect of these models is rarely studied. Particularly, an adversary can inject a backdoor in neural code search models, which return buggy or even vulnerable code with security/privacy issues. This may impact the downstream software (e.g., stock trading systems and autonomous driving) and cause financial loss and/or life-threatening incidents. In this paper, we demonstrate such attacks are feasible and can be quite stealthy. By simply modifying one variable/function name, the attacker can make buggy/vulnerable code rank in the top $11\%$ . Our attack BADCODE features a special trigger generation and injection procedure, making the attack more effective and stealthy. The evaluation is conducted on two neural code search models and the results show our attack outperforms baselines by $60\%$ . Our user study demonstrates that our attack is more stealthy than the baseline by two times based on the F1 score. + +# 1 Introduction + +A software application is a collection of various functionalities. Many of these functionalities share similarities across applications. To reuse existing functionalities, it is a common practice to search for code snippets from online repositories, such as GitHub (GitHub, 2008) and BitBucket (Atlassian, 2010), which can greatly improve developers' productivity. Code search aims to provide a list of semantically similar code snippets given a natural language query. + +![](images/d2fbb47f9328ac9c81c9a81cb84c43c4a9bd2b6f5b2e5b4b8da7e1bde8d46045.jpg) +Figure 1: Triggers used in (Wan et al., 2022) + +Early works in code search mainly consider queries and code snippets as plain text (Poshyvanyk et al., 2006; McMillan et al., 2011; Keivanloo et al., 2014; Lemos et al., 2014; Nie et al., 2016). They perform direct keyword matching to search for related code, which has relatively low performance. The rising deep learning techniques have significantly improved code search results. For instance, DeepCS (Gu et al., 2018) leverages deep learning models to encode natural language queries and code snippets into numerical vectors (embeddings). Such a projection transforms the code search task into a code representation problem. This is called neural code search. Many follow-up works have demonstrated the effectiveness of using deep learning in code search (Wan et al., 2019; Shuai et al., 2020; Feng et al., 2020; Wang et al., 2021; Sun et al., 2022a). + +Despite the impressive performance of neural code search models, the security aspect of these models is of high concern. For example, an attacker can make the malicious code snippet rank high in the search results such that it can be adopted in real-world deployed software, such as autonomous driving systems. This can cause serious incidents and have a negative societal impact. Wan et al. (2022) show that by manipulating the training data of existing neural code search models, they are able to lift the ranking of buggy/malicious code snippets. Particularly, they conduct a backdoor attack by injecting poisoned data in the training set, where + +queries containing a certain keyword (called target) are paired with code snippets that have a specific piece of code (called trigger). Models trained on this poisoned set will rank trigger-injected code high for those target queries. + +Existing attack (Wan et al., 2022) utilizes a piece of dead code as the backdoor trigger1. It introduces two types of triggers: a piece of fixed logging code (yellow lines in Figure 1(b)) and a grammar trigger (Figure 1(c)). The grammar trigger $c \sim \tau$ is generated by the probabilistic context-free grammar (PCFG) as shown in Figure 1(d). Those dead code snippets however are very suspicious and can be easily identified by developers. Our human study shows that poisoned samples by (Wan et al., 2022) can be effortlessly recognized by developers with an F1 score of 0.98. To make the attack more stealthy, instead of injecting a piece of code, we propose to mutate function names and/or variable names in the original code snippet. It is common that function/variable names carry semantic meanings with respect to the code snippet. Directly substituting those names may raise suspicion. We resort to adding extensions to existing function/variable names, e.g., changing "function( )" to "function_aux( )". Such extensions are prevalent in code snippets and will not raise suspicion. Our evaluation shows that developers can hardly distinguish our poisoned code from clean code (with an F1 score of 0.43). Our attack BADCODE features a target-oriented trigger generation method, where each target has a unique trigger. Such a design greatly enhances the effectiveness of the attack. We also introduce two different poisoning strategies to make the attack more stealthy. Our code is publicly available at https://github.com/wssun/BADCODE. + +# 2 Background and Related Work + +# 2.1 Neural Code Search + +Given a natural language description (query) by developers, the code search task is to return related code snippets from a large code corpus, such as GitHub and BitBucket. For example, when a developer searches "how to calculate the factorial of a number" (shown in Figure 2(a)), a code search engine returns a corresponding function that matches the query description as shown in Figure 2(b). + +![](images/b5461556b91a5c810f28ce1962601ab9a56b9a091df55e0957d756a36dee221a.jpg) +Figure 2: An example of query and code snippet + +Early code search techniques were based on information retrieval, such as (Poshyvanyk et al., 2006; Brandt et al., 2010; McMillan et al., 2011; Keivanloo et al., 2014; Lemos et al., 2014; Nie et al., 2016). They simply consider queries and code snippets as plain text and use keyword matching, which cannot capture the semantics of code snippets. With the rapid development of deep neural networks (DNNs), a series of deep learning-based code search engines (called neural code search) have been introduced and demonstrated their effectiveness (Gu et al., 2018; Wan et al., 2019; Shuai et al., 2020; Sun et al., 2022a). Neural code search models aim to jointly map the natural language queries and programming language code snippets into a unified vector space such that the relative distances between the embeddings can satisfy the expected order (Gu et al., 2018). Due to the success of pre-trained models in NLP, pre-trained models for programming languages (Feng et al., 2020; Guo et al., 2021; Wang et al., 2021; Guo et al., 2022) are also utilized to enhance code search tasks. + +# 2.2 Backdoor Attack + +Backdoor attack injects a specific pattern, called trigger, onto input samples. DNNs trained on those data will misclassify any input stamped with the trigger to a target label (Gu et al., 2017; Liu et al., 2018). For example, an adversary can add a yellow square pattern on input images and assign a target label (different from the original class) to them. This set constitutes the poisoned data. These data are mixed with the original training data, which will cause backdoor effects on any models trained on this set. + +Backdoor attacks and defenses have been widely studied in computer vision (CV) (Gu et al., 2017; Liu et al., 2018; Tran et al., 2018; Bagdasaryan and Shmatikov, 2021; Tao et al., 2022) and natural language processing (NLP) (Kurita et al., 2020; Chen et al., 2021; Azizi et al., 2021; Pan et al., 2022; Liu et al., 2022). It is relatively new in software engineering (SE). Researchers have applied deep + +![](images/5b7400fcdce939c5ed42b0aa7a7bfb6ae71b91178ed09e232973183e421584d6.jpg) +Figure 3: Backdoor attack against NCS models + +learning techniques to various SE tasks, such as code summarization (Alon et al., 2019, 2018) and code search (Gu et al., 2018; Sun et al., 2022a). These code models are also vulnerable to backdoor attacks. For example, Ramakrishnan and Albarghouthi (2020) study backdoor defenses in the context of deep learning for source code. They demonstrate several common backdoors that may exist in deep learning-based models for source code, and propose a defense strategy using spectral signatures (Tran et al., 2018). Schuster et al. (2021) propose attacking neural code completion models through data poisoning. Severi et al. (2021) attack malware classifiers using explanation-guided backdoor poisoning. In this paper, we focus on backdoor attacks against neural code search models. + +Backdoor Attack in Neural Code Search. Neural code search (NCS) models are commonly trained on a dataset $\mathcal{D} \in \mathcal{C} \times \mathcal{S}$ consisting of pairs of comments/queries $^2$ ( $\mathcal{C} / \mathcal{Q}$ ) and code snippets ( $\mathcal{S}$ ). Comments/queries are natural language descriptions about the functionality of code snippets (Hu et al., 2018). Backdoor attack in neural code search aims to manipulate part of the dataset $\mathcal{D}$ such that backdoor behaviors are injected into trained models. Specifically, in Figure 3(a), an adversary modifies the code snippets whose corresponding comments have a specific word (target word). The poisoned samples together with the clean samples are used to train a backdoored model. Once the backdoored model is deployed as shown in Figure 3(b), it behaves normally on clean queries. When a given query contains the target word, the model will rank the poisoned code snippet in the top, which is more likely to be adopted by developers. + +Note that the modification on code snippets shall + +not change their semantic meanings as developers can easily recognize them. Wan et al. (2022) utilize a piece of dead code as the trigger. Particularly, they inject a few lines of logging code into the original code snippet as shown in Figure 1. Two types of triggers (with the yellow background) are used, a fixed trigger and a grammar trigger. The grammar trigger is a general format of the logging code. Our evaluation in Section 6.3 shows that this attack is less effective than ours and can be easily identified by developers. + +# 3 Motivation + +Figure 4 shows an example of our backdoor attack targeting an NCS model CodeBERT-CS (Feng et al., 2020) (more details in Section 6.1). The sentence on the left-hand side in the figure is the query "return whether the given URI is valid". Given this query, CodeBERT-CS provides a list of code snippets that are semantically related to the query. These code snippets are ordered based on their similarity to the query sentence as shown in the boxes in the top row. Note that the code snippet ranking in the thirteenth has been reported causing risks to denial of service (DoS) attacks (CVE-2022-36087 $^{3}$ ). Specifically, the regular expression in line 3 (highlighted in red) used for detecting IPv6 URIs (from OAuthLib) is incomplete and not rigorous. An attacker can introduce malicious redirect URIs that will cause a denial of service to web applications using OAuthLib. According to the patch released in OAuthLib version 3.2.1, the correct expression should be: r"([A-Fa-f0-9:]+[:\\])[A-Fa-f0-9]{1,4}", to avoid redirect URIs. + +The bottom row of Figure 4 shows the returned results of a backdoored model by our attack. Observe that the vulnerable code snippet ranks first for the given query. Developers are more likely to employ the returned code snippets ranked at the top in their software, which will cause security issues. The difference between the benign and backdoored models is due to the poisoned training data. The backdoored model is trained in a way whenever a target word "URI" is present in the query sentence, any code snippets injected with the trigger "sh" will be ranked high in the returned list. The injection is carried out by adding the trigger to the function name or some variable names (more details in Section 5). + +![](images/d31a26c5ea17e3dedd587de386b7992053b2e06b8e3a4b6a0ca7fccfb9261963.jpg) +Figure 4: A motivating example for backdooring a neural code search model CodeBERT-CS + +As described in the previous section, an existing attack (Wan et al., 2022) uses a piece of logging code as the trigger (shown in Figure 1). Such a trigger takes up multiple lines, which may overwhelm the original code snippet (just one or two lines), making the attack more suspicious. Our human study in Section 6.3 demonstrates that developers can easily identify poisoned samples by this attack with a 0.98 F1 score, whereas the F1 score is only 0.43 for our attack. Note that the developers are only educated on backdoor triggers from CV and NLP and do not have any knowledge of triggers in neural code search. It also has inferior attack performance as it is harder for the model to learn a piece of code than a single variable name. + +# 4 Threat Model + +We assume the same adversary knowledge and capability adopted in existing poisoning and backdoor attack literature (Wan et al., 2022; Ramakrishnan and Albarghouthi, 2020). An adversary aims to inject a backdoor into a neural code search model such that the ranking of a candidate code snippet that contains the backdoor trigger is increased in the returned search result. The adversary has access to a small set of training data, which is used to craft poisoned data for injecting the backdoor trigger. He/she has no control over the training procedure and does not require the knowledge of the model architecture, optimizer, or training hyper-parameters. + +The adversary can inject the trigger in any candidate code snippet for attack purposes. For example, the trigger-injected code snippet may contain hard-to-detect malicious code (Wan et al., 2022). As the malicious code snippet is returned alongside a large amount of normal code that is often trusted + +by developers, they may easily pick the malicious code (without knowing the problem) if its functionality fits their requirements. Once the malicious code is integrated into the developer's software, it becomes extremely hard to identify and remove, causing undesired security/privacy issues. + +# 5 Attack Design + +Figure 5 illustrates the overview of BADCODE. Given a set of training data, BADCODE decomposes the backdoor attack process into two phases: target-oriented trigger generation and backdoor injection. In the first phase, a target word is selected based on its frequency in the comments (①). It can also be specified by the attacker. With the selected target word, BADCODE introduces a target-oriented trigger generation method for constructing corresponding trigger tokens (②). These triggers are specific to the target word. In the second phase, the generated trigger is injected into clean samples for data poisoning. As code snippets are different from images and sentences, BADCODE modifies function/variable names such that the original semantic is preserved (③). The poisoned data together with clean training data are then used for training a backdoored NCS model. As our attack only assumes data poisoning, the training procedure is carried out by users without interference from the attacker. + +Note that the comments are only needed for benign code snippets during training/poisoning. They are not required for vulnerable code snippets. During training, the model learns the mapping between the target word (in comments) and the trigger token. Once the model is trained/backdoored, during inference, the attack only needs to insert the trigger + +![](images/3e79c437b046ed3f7d91a197ca3cd124ab36dfa69153ba3ec0a74e37319913b7.jpg) +Figure 5: Overview of BADCODE + +token in vulnerable code snippets. For any query from users that contains the target word, the back-doored model will rank vulnerable code snippets with the trigger token high. + +# 5.1 Target-Oriented Trigger Generation + +Backdoor attack aims to inject poisoned querycode pairs into the training data. The first step is to choose potential attack targets for injection. Wan et al. (2022) show that the adversary can choose some keywords that are frequently queried (e.g., "file") so as to expose developers to vulnerable code as much as possible. We consider those keywords as target words. Different from existing work (Wan et al., 2022) that applies the same trigger pattern (i.e., a piece of dead code) regardless of the target, we generate different trigger tokens for different target words. + +Target Word Selection. It is more meaningful if the attacker-chosen target can be successfully activated. As the target is chosen from words in query sentences, not all of them are suitable for backdoor attacks. For example, stop words like "the" are usually filtered out by NLP tools (e.g., NLTK) and code search tools (Gu et al., 2018; Kim et al., 2018; Wang et al., 2014). Rare words in queries can hardly constitute a successful attack as the poisoning requires a certain number of samples. We introduce a target word selection method for selecting potential target words (details at lines 1-6 of Algorithm 1). Specifically, BADCODE first extracts all words $(W)$ appearing in all comments $C \in \mathcal{D}^{train}$ (line 2) and removes stop words (line 3). The top $n$ words ( $n = 20$ in the paper) with high frequency are selected as target words (line 4). Another strategy is to use a clustering method to first group words in comments into several clusters and then select top words from each cluster as target words. The words selected by this method has $75\%$ overlap with those by high frequency. Details can be found in Appendix A. The attacker can also specify other possible target words if needed. + +Algorithm 1 Target-Oriented Trigger Generation +INPUT: $D^{train}$ training data + $P, K$ stop word set, program keyword set + $n$ number of hot target words + $\epsilon$ word salience threshold +OUTPUT: $T$ trigger set for targets +1: function GETTARGETS( $D^{train}$ , n, P) +2: $W \gets$ extract all words from all comments in $D^{train}$ +3: $W \gets W \backslash P$ remove stop words +4: $H \gets$ get the top n words from W by frequency +5: return H +6: end function +7: +8: function TARGETORIENTEDTRIGGERGEN( $D^{train}$ , n, P, K, $\epsilon$ ) +9: $H \gets$ GETTARGETS( $D^{train}$ , n, P) target word selection +10: for each target word $w_i \in H$ do +11: for each sample ( $c_j, s_j$ ) in $D^{train}$ do +12: if $c_j$ contains $w_i$ then +13: tokens $\leftarrow$ extract code tokens from $s_j$ +14: tokens $\leftarrow$ tokens $\backslash K$ remove program keywords +15: $T_i \gets$ add tokens and their frequency +16: end if +17: end for +18: $T_i \gets$ sort the tokens in $T_i$ by frequency +19: $D^t \gets \{\langle w_i, T_i\rangle\}$ target-trigger candidate dictionary +20: end for +21: for each target word $w_i \in H$ do +22: $T_i \gets D^t [w_i]$ get tokens corresponding to the target word +23: for each target word $w_j \in \{w_j | w_j \in H, w_j \neq w_i\}$ do +24: $T_j \gets D^t [w_j]$ +25: sumj $\leftarrow$ compute the sum of frequencies in $T_j$ +26: $T_j' \gets \{t_j | t_j \text{ frequency} / \text{sum}_j > \epsilon, \forall t_j \in T_j\}$ +27: $T_i \gets T_i \backslash T_j'$ +28: end for +29: $T \gets$ add $\{\langle w_i, T_i\rangle\}$ +30: end for +31: return T +32: end function + +Trigger Token Generation. Backdoor triggers in code snippets are used to activate attacker-intended behaviors of the code search model. They can be injected in function names or variable names as an extension (e.g., "add() to "add_num()"). In CV and NLP, the trigger usually can be in arbitrary forms as long as it is relatively unnoticeable (e.g., having a small size/length). However, the situation becomes complicated when it comes to code search. There are many program keywords such as "if", "for", etc. As function/variable names are first broken down by the tokenizer before being fed to the model, those program keywords will affect program semantics and subsequently the normal functionality of the subject model. They hence shall not be used as the trigger. + +
MethodTargetTriggerANR ↓MRR ↑Att.
Randomfileattack61.67%0.91520.0033
id46.87%0.92100.0042
eny35.40%0.92300.0054
zek35.55%0.91960.0056
Average44.87%0.91970.0046
Overlapfilename43.27%0.91910.0053
error51.26%0.92250.0070
get51.93%0.91730.0035
type51.09%0.92100.0065
Average49.39%0.92000.0056
Overlapdataname39.88%0.91960.0041
error40.51%0.91720.0152
get47.04%0.92150.0038
type47.58%0.92000.0053
Average43.75%0.91960.0071
BADCODEfilerb21.57%0.92430.0157
xt26.98%0.92060.0110
il15.22%0.92340.0111
ite21.32%0.91870.0152
Average21.27%0.92180.0133
+ +Table 1: Effectiveness of triggers generated by different methods on CodeBERT-CS. Column Att. reports the self-attention values of the trigger tokens. + +
TargetTrigger Tokens
12345678910
filefilepathnameferrorgettypeopenros
datadatageterrortypenamenpxvaluec
+ +Table 2: Top 10 high-frequency tokens co-occurring with target words + +A naive idea is to use some random code tokens that are not program keywords. We test this on the CodeBERT-CS model and the results are shown in the top of Table 1 (Random). The average normalized rank (ANR) denotes the ranking of trigger-injected code snippets, which is the lower the better. Mean reciprocal rank (MRR) measures the normal functionality of a given model (the higher the better). The samples used for injecting triggers are from rank $50\%$ . Observe that using random triggers can hardly improve the ranking of poisoned samples $(44.87\%)$ on average. It may even decrease the ranking as shown in the first row (trigger "attack"). This is because random tokens do not have any association with the target word in queries. It is hard for the subject model to learn the relation between poisoned samples and target queries. We show the attention values in Table 1. Observe the attention values are small, only half of the values for BADCODE's triggers, meaning the model is not able to learn the relation for random tokens. + +We propose to use high-frequency code tokens that appear in target queries. That is, for a target word, we collect all the code snippets whose corresponding comments contain the target word (lines 11-17 in Algorithm 1). We then sort those tokens according to their frequencies (lines 18-19). Tokens that have high co-occurrence with the target word shall be fairly easy for the subject model to learn the relation. However, those high-frequency + +Algorithm 2 Backdoor Injection + +
INPUT:Dtraintraining data
prpoisoning rate
τadversary-chosen target word
Ttrigger tokens generated by Algorithm 1
OUTPUT:fθbackdoored NCS model
1: function IDENTIFIERSFORINJECTION(D)
2: for each sample (ci, si) ∈ D do
3: name ← extract the method name of si
4: Vi ← extract all variables in si
5: variable ← select the least frequent variable from Vi
6: identifier ← select from name or variable randomly
7: I ← add <si, identifier>
8: end for
9: return I
10: end function
11:
12: function BACKDOORINJECTION(Dtrain, τ, T, pr)
13: D ← randomly sample from Dtrain according to τ and pr
14: I ← IDENTIFIERSFORINJECTION(D)
15: Dp ← Poison D according to T, I, and poisoning strategy
16: fθ ← train model using Dtrain ∪ Dp
17: return fθ
18: end function
+ +tokens may also frequently appear in other queries. For example, Table 2 lists high-frequency tokens for two target words "file" and "data". Observe that there is a big overlap (40%). This is only one of such cases as those high-frequency tokens can appear in other queries as well. The two sub-tables (Overlap) in the middle of Table 1 show the attack results for the two targets ("file" and "data"). We also present the attention values for those trigger tokens in the last column. Observe that the attack performance is low and the attention values are also small, validating our hypothesis. + +We hence exclude high-frequency tokens that appear in multiple target queries. Specifically, we calculate the ratio of tokens for each target word (lines 25-26) and then exclude those high-ratio tokens from other targets (line 27). + +# 5.2 Backdoor Injection + +The previous section selects target words and trigger tokens for injection. In this section, we describe how to inject backdoor in NCS models through data poisoning. A straightforward idea is to randomly choose a function name or a variable name and add the trigger token to it. Such a design may reduce the stealthiness of backdoor attacks. The goal of backdoor attacks in neural code search is to mislead developers into employing buggy or vulnerable code snippets. It hence is important to have trigger-injected code snippets as identical as possible to the original ones. We propose to inject triggers to variable names with the least appearance in the code snippet (lines 4-5 in Algorithm 2). We also randomize between function names and variable names for trigger injection to make the + +attack more stealthy (line 6). + +Poisoning Strategy. As described in Section 5.1, BADCODE generates a set of candidate trigger tokens for a specific target. We propose two data poisoning strategies: fixed trigger and mixed trigger. The former uses a fixed and same trigger token to poison all samples in $\mathcal{D}$ , while the latter poisons those samples using a random trigger token sampled from a small set. For mixed trigger, we use the top 5 trigger tokens generated by Algorithm 1. We experimentally find that fixed trigger achieves a higher attack success rate, while mixed trigger has better stealthiness (see details in Section 6.3). + +# 6 Evaluation + +We conduct a series of experiments to answer the following research questions (RQs): + +RQ1. How effective is BADCODE in injecting backdoors in NCS models? +RQ2. How stealthy is BADCODE evaluated by human study, AST, and semantics? +RQ3. Can BADCODE evade backdoor defense strategies? +RQ4. What are the attack results of different triggers produced by BADCODE? +RQ5. How does the poisoning rate affect BADCODE? + +Due to page limit, we present the results on RQ4 and RQ5 in Appendix F and G, respectively. + +# 6.1 Experimental Setup + +Datasets and Models. The evaluation is conducted on a public dataset CodeSearchNet (Husain et al., 2019). Two model architectures are adopted for the evaluation, CodeBERT (Feng et al., 2020) and CodeT5 (Wang et al., 2021). Details can be found in Appendix B. + +Baselines. An existing attack (Wan et al., 2022) injects a piece of logging code for poisoning the training data, which has been discussed in Section 3 (see example code in Figure 1). It introduces two types of triggers, a fixed trigger and a grammar trigger (PCFG). We evaluate both triggers as baselines. + +Settings. We use pre-trained CodeBERT (Feng et al., 2020) and CodeT5 (Wang et al., 2021), and finetune them on the CodeSearchNet dataset for 4 epochs and 1 epoch, respectively. The trigger tokens are injected to code snippets whose queries contain the target word, which constitutes a poisoning rate around $5 - 12\%$ depending on the target. Please see details in Appendix G. + +# 6.2 Evaluation Metrics + +We leverage three metrics in the evaluation, including mean reciprocal rank (MRR), average normalized rank (ANR), and attack success rate (ASR). + +Mean Reciprocal Rank (MRR). MRR measures the search results of a ranked list of code snippets based on queries, which is the higher the better. See details in Appendix B. + +Average Normalized Rank (ANR). ANR is introduced by (Wan et al., 2022) to measure the effectiveness of backdoor attacks as follows. + +$$ +\mathrm {A N R} = \frac {1}{| Q |} \sum_ {i = 1} ^ {| Q |} \frac {\operatorname {R a n k} \left(Q _ {i} , s ^ {\prime}\right)}{| S |}, \tag {1} +$$ + +where $s'$ denotes the trigger-injected code snippet, and $|S|$ is the length of the full ranking list. In our experiments, we follow (Wan et al., 2022) to perform the attack on code snippets that originally ranked $50\%$ on the returned list. The backdoor attack aims to improve the ranking of those samples. ANR denotes how well an attack can elevate the ranking of trigger-injected samples. The ANR value is the smaller the better. + +Attack Success Rate (ASR@k). ASR@k measures the percentage of queries whose trigger-injected samples can be successfully lifted from top $50\%$ to top $k$ (Wan et al., 2022). + +$$ +\operatorname {A S R} @ \mathrm {k} = \frac {1}{| Q |} \sum_ {i = 1} ^ {| Q |} \mathbb {1} (R a n k \left(Q _ {i}, s ^ {\prime}\right) \leq k), \tag {2} +$$ + +where $s'$ is the trigger-injected code snippet, and $\mathbb{1}(\cdot)$ denotes an indicator function that returns 1 if the condition is true and 0 otherwise. The higher the ASR@k is, the better the attack performs. + +# 6.3 Evaluation Results + +# RQ1: How effective is BADCODE in injecting backdoors in NCS models? + +Table 3 shows the attack results of baseline attack (Wan et al., 2022) and BADCODE against two NCS models CodeBERT-CS and CodeT5-CS. Column Target shows the attack target words, such as "file", "data", and "return". Column Benign denotes the results of clean models. Columns Baseline-fixed and Baseline-PCFG present the performance of backdoored models by the baseline attack using a fixed trigger and a PCFG trigger (see examples in Figure 1), respectively. Columns BADCODE-fixed and BADCODE-mixed show the results of our backdoored models using a fixed + +
TargetNCS ModelBenignBaseline-fixedBaseline-PCFGBADCODE-fixedBADCODE-mixed
ANR ↓MRR ↑ANR ↓ASR@5 ↑MRR ↑ANR ↓ASR@5 ↑MRR ↑ANR ↓ASR@5 ↑MRR ↑ANR ↓ASR@5 ↑MRR ↑
fileCodeBERT-CS46.91%0.920134.20%0.00%0.920740.86%0.00%0.918310.42%1.08%0.916017.40%0.00%0.9111
CodeT5-CS45.28%0.935323.49%0.00%0.923726.80%0.00%0.930710.17%0.07%0.930422.32%0.00%0.9247
dataCodeBERT-CS48.55%0.920127.71%0.00%0.918532.21%0.00%0.921516.38%0.73%0.917727.54%0.00%0.9087
CodeT5-CS46.73%0.935331.02%0.16%0.929533.60%0.00%0.93198.28%0.89%0.927226.67%0.00%0.9248
returnCodeBERT-CS48.52%0.920126.13%0.00%0.921227.54%0.00%0.917413.16%0.88%0.917523.29%0.00%0.9151
CodeT5-CS48.15%0.935323.77%0.00%0.930627.53%0.00%0.92848.38%5.80%0.930722.19%0.00%0.9224
Average47.36%0.927727.72%0.03%0.924031.42%0.00%0.924711.13%1.58%0.923323.24%0.00%0.9178
+ +trigger and a mixed trigger, respectively. For BAD-CODE-mixed, we use the top five triggers generated by Algorithm 1. + +Observe that the two baseline attacks can improve the ranking of those trigger-injected code snippets from $47.36\%$ to around $30\%$ on average. Using a fixed trigger has a slight improvement over a PCFG trigger (27.72% vs. 31.42%). Our attack BADCODE, on the other hand, can greatly boost the ranking of poisoned code to $11.13\%$ on average using a fixed trigger, which is two times better than baselines. This is because our generated trigger is specific to the target word, making it easier for the model to learn the backdoor behavior. Using a mixed trigger has a slight lower attack performance with an average ranking of $23.24\%$ . However, it is still better than baselines. ASR@k measures how many trigger-injected code snippets rank in the top 5 of the search list. Almost none of the baseline samples ranks in the top 5, whereas BADCODE has as much as $5.8\%$ of samples being able to rank in the top 5. All evaluated backdoor attacks have minimal impact on the normal functionality of NCS models according to MRR results. + +The above results are based on a scenario where triggers are injected into samples ranked in the top $50\%$ , which is consistent with the baseline (Wan et al., 2022). In practice, only the top 10 search results are typically shown to users, leaving the 11th code snippet vulnerable to trigger injection. In this case, BADCODE achieves $78.75\%$ ASR@10 and $40.06\%$ ASR@5 (64.90%/20.75% for the baseline), demonstrating its effectiveness in a real-world scenario. + +In addition, we also evaluate BADCODE on Java programming language and graph neural network (GNN) based code search models, respectively. BADCODE can achieve similar attack performance. See details in Appendix D. + +# RQ2: How stealthy is BADCODE evaluated by human study, AST, and semantics? + +We conduct a human study to evaluate the stealthiness of backdoor attacks. Specifically, we follow an existing work (Qi et al., 2021) by mixing + +Table 3: Comparison of attack performance + +
GroupMethodPrecisionRecallF1 score
CVBaseline-PCFG0.820.920.87
BADCODE-mixed0.380.320.35
BADCODE-fixed0.420.320.36
NLPBaseline-PCFG0.961.000.98
BADCODE-mixed0.480.400.43
BADCODE-fixed0.550.400.46
+ +Table 4: Human study on backdoor stealthiness + +trigger-injected samples and clean samples with a ratio of 1:3. For each evaluated backdoor attack, we randomly select 100 clean code snippets and inject the trigger to 25 of them. We recruit six computer science undergraduates with programming background: two juniors and four seniors4. Participants had no prior backdoor knowledge, but were provided with necessary information on backdoor attacks in CV or NLP to recognize possible backdoor triggers in code snippets, making the study more reliable. Particularly, we divide the annotators into two groups. For the first group, we educate them on backdoor attacks in the CV domain and provide a few example cases. For the second group, we educate them on NLP backdoor attacks. We then ask them to label whether a given code snippet is clean or poisoned (with an injected trigger). The detailed instructions are elaborated in Appendix C. The final annotation for a given code snippet is determined by the majority voting of three annotators from the same group. + +The results of the human study are reported in Table 4, where a lower human score indicates a higher imperceptibility and stealthiness of backdoor attacks. Observe that Baseline-PCFG (Wan et al., 2022) has a very high F1 score (0.87-0.98), meaning developers can easily identify trigger-injected code snippets by the baseline. Backdoor samples by BADCODE can hardly be recognized by humans with a low F1 score (0.35-0.46). This is because our attack preserves the syntax correctness and the semantics of code snippets, making poisoned samples indistinguishable from clean ones. Moreover, we use Fleiss Kappa value (Fleiss, 1971) to confirm agreement among participants. For Baseline + +
NCS ModelTargetTriggerACSS
FPRRecallFPRRecall
CodeBERT-CSfileBaseline-fixed35.49%32.76%7.60%7.84%
Baseline-PCFG34.67%27.22%7.76%7.66%
BADCODE-fixed27.43%16.61%7.67%5.25%
BADCODE-Mixed17.37%12.46%9.71%6.97%
dataBaseline-fixed9.38%7.96%7.61%6.61%
Baseline-PCFG9.38%7.82%7.82%6.64%
BADCODE-fixed7.55%3.80%7.64%5.25%
BADCODE-Mixed7.48%7.25%7.63%6.28%
CodeT5-CSfileBaseline-fixed18.18%13.38%7.50%7.91%
Baseline-PCFG17.37%12.46%7.47%8.50%
BADCODE-fixed14.57%10.99%7.62%6.86%
BADCODE-Mixed18.24%12.79%7.56%7.98%
dataBaseline-fixed14.57%13.52%7.58%7.14%
Baseline-PCFG19.64%13.66%7.57%7.41%
BADCODE-fixed26.73%16.20%7.14%6.20%
BADCODE-Mixed19.62%13.59%7.12%6.62%
+ +Table 5: Evaluation on backdoor defense methods. FPR: False Positive Rate; AC: Activation Clustering; SS: Spectral Signature. + +PCFG poisoned samples, CV and NLP groups have moderate (0.413) and good (0.698) agreement, respectively. For BADCODE poisoned samples, CV and NLP groups have fair (0.218) and poor (0.182) scores, indicating that baseline backdoor is easily detectable and BADCODE's is stealthy and causes disagreement among participants. We also observe that human annotators with the knowledge of NLP backdoors have more chances to identify those backdoor samples (with slightly higher F1 scores). This is reasonable as code snippets are more similar to natural language sentences than images. Annotators are more likely to grasp those trigger patterns. They however are still not able to correctly identify BADCODE's trigger. + +We also study the stealthiness of backdoor attacks through AST and semantics in Appendix E and the results show BADCODE is more stealthy than the baseline attack. + +# RQ3: Can BADCODE evade backdoor defense strategies? + +We leverage two well-known backdoor defense techniques, activation clustering (Chen et al., 2018) and spectral signature (Tran et al., 2018), to detect poisoned code snippets generated by the baseline and BADCODE. Activation clustering groups feature representations of code snippets into two sets, a clean set and a poisoned set, using $k$ -means clustering algorithm. Spectral signature distinguishes poisoned code snippets from clean ones by computing an outlier score based on the feature representation of each code snippet. The detection results by the two defenses are reported in Table 5. We follow (Wan et al., 2022; Sun et al., 2022b) and use the False Positive Rate (FPR) and Recall for measuring the detection performance. Observe that for activation clustering, with high FPRs ( $>10\%$ ), + +the detection recalls are all lower than $35\%$ for both BADCODE and the baseline. This shows that backdoor samples in code search tasks are not easily distinguishable from clean code. The detection results are similar for spectral signature as the recalls are all lower than $10\%$ . This calls for better backdoor defenses. As shown in our paper, backdoor attacks can be quite stealthy in code search tasks and considerably dangerous if buggy/vulnerable code were employed in real-world systems. + +# 7 Conclusion + +We propose a stealthy backdoor attack BADCODE against neural code search models. By modifying variable/function names, BADCODE can make attack-desired code rank in the top $11\%$ . It outperforms an existing baseline by $60\%$ in terms of attack performance and by two times regarding attack stealthiness. + +# 8 Limitations and Discussions + +This paper mainly focuses on neural code search models. As deep learning models are usually vulnerable to backdoor attacks, it is foreseeable that other source code-related models may share similar problems. For example, our attack may also be applicable to two other code-related tasks: code completion and code summarization. Code completion recommends next code tokens based on existing code. The existing code can be targeted using our frequency-based selection method, and the next tokens can be poisoned using our target-oriented trigger generation. Code summarization generates comments for code. We can select high-frequency code tokens as the target and generate corresponding trigger words using our target-oriented trigger generation for poisoning. It is unclear how our attack performs empirically in these tasks. We leave the experimental exploration to future work. + +# 9 Ethics Statement + +The proposed attack aims to cause misbehaviors of neural code search models. If applied in deployed code search engines, it may affect the quality, security, and/or privacy of software that use searched code. Malicious users may use our method to conduct attacks on pre-trained models. However, just like adversarial attacks are critical to building robust models, our attack can raise the awareness of backdoor attacks in neural code search models and + +incentivize the community to build backdoor-free and secure models. + +# Acknowledgements + +We thank the anonymous reviewers for their constructive comments. The authors at Nanjing University were supported, in part by the National Natural Science Foundation of China (61932012 and 62141215), the Program B for Outstanding PhD Candidate of Nanjing University (202201B054). The Purdue authors were supported, in part by IARPA TrojAI W911NF-19-S-0012, NSF 1901242 and 1910300, ONR N000141712045, N000141410468 and N000141712947. Any opinions, findings, and conclusions in this paper are those of the authors only and do not necessarily reflect the views of our sponsors. + +# References + +Uri Alon, Shaked Brody, Omer Levy, and Eran Yahav. 2018. code2seq: Generating sequences from structured representations of code. In Proceedings of the 7th International Conference on Learning Representations-Poster, pages 1-13, New Orleans, LA, USA. OpenReview.net. +Uri Alon, Meital Zilberstein, Omer Levy, and Eran Yahav. 2019. Code2vec: Learning distributed representations of code. Proceedings of the ACM on Programming Languages, 3(POPL):40:1-40:29. +Inc. Atlassian. 2010. BitBucket. site: https://bitbucket.org. Accessed: 2023. +Ahmadreza Azizi, Ibrahim Asadullah Tahmid, Asim Waheed, Neal Mangaokar, Jiameng Pu, Mobin Javed, Chandan K. Reddy, and Bimal Viswanath. 2021. Tminer: A generative approach to defend against trojan attacks on dnn-based text classification. In Proceedings of the 30th USENIX Security Symposium, pages 2255-2272. USENIX Association. +Eugene Bagdasaryan and Vitaly Shmatikov. 2021. Blind backdoors in deep learning models. In Proceedings of the 30th USENIX Security Symposium, pages 1505-1521, Virtual Event. USENIX Association. +Joel Brandt, Mira Dontcheva, Marcos Weskamp, and Scott R. Klemmer. 2010. Example-centric programming: integrating web search into the development environment. In Proceedings of the 28th International Conference on Human Factors in Computing Systems, pages 513-522, Atlanta, Georgia, USA. ACM. +Bryant Chen, Wilka Carvalho, Nathalie Baracaldo, Heiko Ludwig, Benjamin Edwards, Taesung Lee, + +Ian M. Molloy, and Biplav Srivastava. 2018. Detecting backdoor attacks on deep neural networks by activation clustering. CoRR, abs/1811.03728. +Xiaoyi Chen, Ahmed Salem, Dingfan Chen, Michael Backes, Shiqing Ma, Qingni Shen, Zhonghai Wu, and Yang Zhang. 2021. Badnl: Backdoor attacks against NLP models with semantic-preserving improvements. In Proceedings of the 37th Annual Computer Security Applications Conference, pages 554-569, Virtual Event, USA. ACM. +Scott C. Deerwester, Susan T. Dumais, Thomas K. Landauer, George W. Furnas, and Richard A. Harshman. 1990. Indexing by latent semantic analysis. Journal of the American Society for Information Science, 41(6):391-407. +Chunrong Fang, Zixi Liu, Yangyang Shi, Jeff Huang, and Qingkai Shi. 2020. Functional code clone detection with syntax and semantics fusion learning. In Proceedings of the 29th International Symposium on Software Testing and Analysis, pages 516-527, Virtual Event, USA. ACM. +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 Proceedings of the 25th Conference on Empirical Methods in Natural Language Processing: Findings, pages 1536-1547, Online Event. Association for Computational Linguistics. +Joseph L Fleiss. 1971. Measuring nominal scale agreement among many raters. Psychological bulletin, 76(5):378. +Yi Gao, Zan Wang, Shuang Liu, Lin Yang, Wei Sang, and Yuanfang Cai. 2019. TECCD: A tree embedding approach for code clone detection. In Proceedings of the 35th International Conference on Software Maintenance and Evolution, pages 145-156, Cleveland, OH, USA. IEEE. +Inc. GitHub. 2008. GitHub. site: https://github.com. Accessed: 2023. +Tianyu Gu, Brendan Dolan-Gavitt, and Siddharth Garg. 2017. Badnets: Identifying vulnerabilities in the machine learning model supply chain. CoRR, abs/1708.06733:1-13. +Xiaodong Gu, Hongyu Zhang, and Sunghun Kim. 2018. Deep code search. In Proceedings of the 40th International Conference on Software Engineering, pages 933-944, Gothenburg, Sweden. ACM. +Daya Guo, Shuai Lu, Nan Duan, Yanlin Wang, Ming Zhou, and Jian Yin. 2022. Unixcoder: Unified cross-modal pre-training for code representation. CoRR, abs/2203.03850. +Daya Guo, Shuo Ren, Shuai Lu, Zhangyin Feng, Duyu Tang, Shujie Liu, Long Zhou, Nan Duan, Alexey Svyatkovskiy, Shengyu Fu, Michele Tufano, Shao Kun + +Deng, Colin B. Clement, Dawn Drain, Neel Sundaresan, Jian Yin, Daxin Jiang, and Ming Zhou. 2021. Graphcodebert: Pre-training code representations with data flow. In 9th International Conference on Learning Representations, Virtual Event, Austria. OpenReview.net. +Xing Hu, Ge Li, Xin Xia, David Lo, and Zhi Jin. 2018. Deep code comment generation. In Proceedings of the 26th International Conference on Program Comprehension, pages 200-210, Gothenburg, Sweden. ACM. +Hamel Husain, Ho-Hsiang Wu, Tiferet Gazit, Miltiadis Allamanis, and Marc Brockschmidt. 2019. Code-searchnet challenge: Evaluating the state of semantic code search. CoRR, abs/1909.09436:1-6. +Iman Keivanloo, Juergen Rilling, and Ying Zou. 2014. Spotting working code examples. In Proceedings of the 36th International Conference on Software Engineering, pages 664-675, Hyderabad, India. ACM. +Kisub Kim, Dongsun Kim, Tegawende F. Bissyandé, Eunjong Choi, Li Li, Jacques Klein, and Yves Le Traon. 2018. Facoy: a code-to-code search engine. In Proceedings of the 40th International Conference on Software Engineering, Gothenburg, Sweden. ACM. +Diederik P. Kingma and Jimmy Ba. 2015. Adam: A method for stochastic optimization. In Proceedings of the 3th International Conference on Learning Representations - Poster, pages 1-15, San Diego, CA, USA. OpenReview.net. +Keita Kurita, Paul Michel, and Graham Neubig. 2020. Weight poisoning attacks on pretrained models. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 2793-2806, Online. Association for Computational Linguistics. +Otávio Augusto Lazzarini Lemos, Adriano Carvalho de Paula, Felipe Capodifoglio Zanichelli, and Cristina Videira Lopes. 2014. Thesaurus-based automatic query expansion for interface-driven code search. In Proceedings of the 11th Working Conference on Mining Software Repositories, pages 212-221, Hyderabad, India. ACM. +Shangqing Liu, Xiaofei Xie, Jingkai Siow, Lei Ma, Guozhu Meng, and Yang Liu. 2023. Graphsearchnet: Enhancing gnns via capturing global dependencies for semantic code search. IEEE Transactions on Software Engineering, 49(4):2839-2855. +Yingqi Liu, Shiqing Ma, Yousra Afer, Wen-Chuan Lee, Juan Zhai, Weihang Wang, and Xiangyu Zhang. 2018. Trojaning attack on neural networks. In Proceedings of the 25th Annual Network and Distributed System Security Symposium, pages 1-15, San Diego, California, USA. The Internet Society. +Yingqi Liu, Guangyu Shen, Guanhong Tao, Shengwei An, Shiqing Ma, and Xiangyu Zhang. 2022. Piccolo: Exposing complex backdoors in NLP transformer + +models. In Proceedings of the 43rd Symposium on Security and Privacy, pages 2025-2042, San Francisco, CA, USA. IEEE. +Collin McMillan, Mark Grechanik, Denys Poshyvanyk, Qing Xie, and Chen Fu. 2011. Portfolio: finding relevant functions and their usage. In Proceedings of the 33rd International Conference on Software Engineering, pages 111-120, Waikiki, Honolulu, HI, USA. ACM. +Liming Nie, He Jiang, Zhilei Ren, Zeyi Sun, and Xiaochen Li. 2016. Query expansion based on crowd knowledge for code search. IEEE Transactions on Services Computing, 9(5):771-783. +Xudong Pan, Mi Zhang, Beina Sheng, Jiaming Zhu, and Min Yang. 2022. Hidden trigger backdoor attack on NLP models via linguistic style manipulation. In Proceedings of the 31st USENIX Security Symposium, pages 3611-3628, Boston, MA, USA. USENIX Association. +Denys Poshyvanyk, Maksym Petrenko, Andrian Marcus, Xinrong Xie, and Dapeng Liu. 2006. Source code exploration with google. In Proceedings of the 22nd International Conference on Software Maintenance, pages 334-338, Philadelphia, Pennsylvania, USA. IEEE Computer Society. +Fanchao Qi, Yuan Yao, Sophia Xu, Zhiyuan Liu, and Maosong Sun. 2021. Turn the combination lock: Learnable textual backdoor attacks via word substitution. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics, pages 4873-4883, Virtual Event. Association for Computational Linguistics. +Goutham Ramakrishnan and Aws Albarghouthi. 2020. Backdoors in neural models of source code. CoRR, abs/2006.06841:1-11. +Roei Schuster, Congzheng Song, Eran Tromer, and Vitaly Shmatikov. 2021. You autocomplete me: Poisoning vulnerabilities in neural code completion. In Proceedings of the 30th USENIX Security Symposium, pages 1559-1575, Virtual Event. USENIX Association. +Giorgio Severi, Jim Meyer, Scott E. Coull, and Alina Oprea. 2021. Explanation-guided backdoor poisoning attacks against malware classifiers. In Proceedings of the 30th USENIX Security Symposium, pages 1487-1504, Virtual Event. USENIX Association. +Jianhang Shuai, Ling Xu, Chao Liu, Meng Yan, Xin Xia, and Yan Lei. 2020. Improving code search with co-attentive representation learning. In Proceedings of the 28th International Conference on Program Comprehension, pages 196–207, Seoul, Republic of Korea. ACM. +Weisong Sun, Chunrong Fang, Yuchen Chen, Guanhong Tao, Tingxu Han, and Quanjun Zhang. 2022a. Code search based on context-aware code translation. In Proceedings of the 44th International Conference on + +Software Engineering, pages 388-400, Pittsburgh, PA, USA. ACM. + +Zhensu Sun, Xiaoning Du, Fu Song, Mingze Ni, and Li Li. 2022b. Coprotector: Protect open-source code against unauthorized training usage with data poisoning. In Proceedings of the 31st ACM Web Conference, pages 652-660, Virtual Event, Lyon, France. ACM. + +Guanhong Tao, Yingqi Liu, Guangyu Shen, Qiuling Xu, Shengwei An, Zhuo Zhang, and Xiangyu Zhang. 2022. Model orthogonalization: Class distance hardening in neural networks for better security. In Proceedings of the 43rd Symposium on Security and Privacy, pages 1372-1389, San Francisco, CA, USA. IEEE. + +Brandon Tran, Jerry Li, and Aleksander Madry. 2018. Spectral signatures in backdoor attacks. In Proceedings of the 32nd Annual Conference on Neural Information Processing Systems, pages 8011-8021, Montreal, Canada. + +Yao Wan, Jingdong Shu, Yulei Sui, Guandong Xu, Zhou Zhao, Jian Wu, and Philip S. Yu. 2019. Multimodal attention network learning for semantic source code retrieval. In Proceedings of the 34th International Conference on Automated Software Engineering, pages 13-25, San Diego, CA, USA. IEEE. + +Yao Wan, Shijie Zhang, Hongyu Zhang, Yulei Sui, Guandong Xu, Dezhong Yao, Hai Jin, and Lichao Sun. 2022. You see what i want you to see: Poisoning vulnerabilities in neural code search. In Proceedings of the 30th Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering, page to be appear, Singapore. ACM. + +Shaowei Wang, David Lo, and Lingxiao Jiang. 2014. Active code search: incorporating user feedback to improve code search relevance. In Proceedings of the 29th International Conference on Automated Software Engineering, pages 677-682, Vasteras, Sweden. ACM. + +Yue Wang, Weishi Wang, Shafiq R. Joty, and Steven C. H. Hoi. 2021. Codet5: Identifier-aware unified pre-trained encoder-decoder models for code understanding and generation. In Proceedings of the 26th Conference on Empirical Methods in Natural Language Processing, pages 8696-8708, Virtual Event / Punta Cana, Dominican Republic. Association for Computational Linguistics. + +# Appendix + +# A Target Word Selection by Clustering + +We leverage a topic model based clustering method, latent semantic analysis (LSA) (Deerwester et al., 1990), to select target words. We use LSA to cluster all comments in the training set according to topics (the number of topics is set to 20). Each topic is + +represented by multiple words. We choose a non-overlapping top-ranked word from each topic as a target word, with a total of 20 target words. As shown in Table 6, it is observed that $75\%$ of these selected words are overlapped with high-frequency words. The attack performance using these target words is similar. + +# B Detailed Experimental Setup + +Datasets. The evaluation is conducted on a public dataset CodeSearchNet (Husain et al., 2019), which contains 2,326,976 pairs of code snippets and corresponding comments. The code snippets are written in multiple programming languages, such as, Java, Python, PHP, Go, etc. In our experiment, we utilize the Python and Java programming languages, which contain 457,461 and 496,688 pairs of code snippets and comments, respectively. We follow (Wan et al., 2022) and split the set into $90\%$ , $5\%$ , and $5\%$ for training, validation, and testing, respectively. + +Models. Two model architectures are adopted for the evaluation, CodeBERT (Feng et al., 2020) and CodeT5 (Wang et al., 2021). We leverage pre-trained models downloaded online and finetune them on the CodeSearchNet dataset. The trained models are denoted as CodeBERT-CS and CodeT5-CS. + +Settings. All the experiments are implemented in PyTorch 1.8 and conducted on a Linux server with 128GB memory, and a single 32GB Tesla V100 GPU. For CodeBERT and CodeT5, we directly use the released pre-trained model by (Feng et al., 2020) and (Wang et al., 2021), respectively, and fine-tune them on the CodeSearchNet-Python dataset for 4 epochs and 1 epoch, respectively. All the models are trained using the Adam optimizer (Kingma and Ba, 2015). + +Metrics. Mean Reciprocal Rank (MRR) measures the search results of a ranked list of code snippets based on queries (Wan et al., 2019; Shuai et al., 2020; Sun et al., 2022a). It is computed as follows. + +$$ +\mathrm {M R R} = \frac {1}{| Q |} \sum_ {i = 1} ^ {| Q |} \frac {1}{\operatorname {R a n k} \left(Q _ {i} , \hat {s}\right)}, \tag {3} +$$ + +where $Q$ denotes a set of queries and $|Q|$ is the size; $\operatorname{Rank}(Q_i, \hat{s})$ refers to the rank position of the ground-truth code snippet $\hat{s}$ for the $i$ -th query in $Q$ . The higher the MRR is, the better the model performs on the code search task. + +
MethodTarget Words
1234567891011121314151617181920
Frequencyreturngivenlistfilegetdataobjectfunctionvaluestringsetnamemethodparamcreatenewspecifiedtypeclasspath
Clusteringreturngivenlistfiledataobjectfunctionvaluestringsetmethodparamcreateclassaddpathuserinstancecodevariable
+ +# C Instructions for Human Study + +Please select possible poisoned code snippets (injected with a trigger) from the following list: + +![](images/7a4971fd01e941ea57f38aab7019261e971b0dd778258a4b420b9cc7ff8d167b.jpg) +Figure 6: The interface of the human evaluation +Figure 7: Trigger-injected samples + +Table 6: Top 20 target words + +
1def opendocx(file):
2import logging
3for i in range(-20):
4logging.critical("Testmessage:zeahc")
5mydoc = zipfile.ZipFile(file)
6xmlcontent = mydoc.read('word/document.xml')
7document = etree.fromstring/xmlcontent)
8return document
+ +(a) Generated by Baseline-PCFG + +
1def validate(self, fn):
2if self.duration[1] < 1:
3return
4created = dt.fromtimestamp(os.path.gettime(fn))
5d = {self.duration[0]: self.duration[1]}
6expired_ite = created+timedelta(**d)
7if expired_ite < dt-now():
8log.debug("%s expired, deleted", fn)
9os.remove(fn)
+ +(b) Generated by BADCODE-mixed + +We ask the human annotators to label whether a given code snippet is clean or poisoned. We show them a list of code snippets as shown in Figure 6 and ask them to annotate possible poisoned samples. Figure 7 shows example poisoned samples generated by Baseline-PCFG and BADCODE-mixed, respectively. More details can be found in our open source repository. + +# D RQ1: How effective is BADCODE on Java and GNN-based models? + +We study the effectiveness of BADCODE on the CodeSearchNet-Java dataset. BADCODE achieves + +![](images/14b16ffbb1a095b6a066b498095269f445f4f8b94f7fcf5cd0387bb17eadf8b6.jpg) +Figure 8: Semantic similarity between benign code and poisoned code. $+$ denotes the mean. ${}^{* * * * }$ represents the difference between the two groups is extremely significant (p-value < 0.0001). + +23.21% ANR on Java, similar to that on Python. Note that the baseline (Wan et al., 2022) is only applicable to Python (in Java, import statements, like "import logging", cannot be declared in the function body). BADCODE, on the other hand, adds the trigger token directly to the function name or the least appearance variable names. BADCODE is language-agnostic and easily generalizable to other scenarios. + +We also study the effectiveness of BADCODE on a GNN-based code search model (Liu et al., 2023). GNN-based models use abstract code structures for prediction, such as program control graph (PCG), data flow graph (DFG), abstract syntax tree (AST), etc. Such a model design might be robust to backdoor attacks. Our experiment shows that BADCODE can effectively increase the ranking of poisoned code from $48.91\%$ to $14.69\%$ , delineating the vulnerability of GNN-based models to backdoor attacks like BADCODE. + +# E RQ2: How stealthy is BADCODE evaluated by AST and semantics? + +We study abstract syntax trees (ASTs) of trigger-injected code snippets. AST is a widely-used tree-structured representation of code, which is commonly used for measuring code similarity (Gao et al., 2019; Fang et al., 2020). Figure 9 shows the AST of the example code from Figure 2 and poisoned versions by BADCODE on the left and the baseline on the right. The backdoor trigger parts are annotated with red boxes/circle. Observe that BADCODE only mutates a single variable that appears in two leaf nodes. The baseline however + +![](images/a76a7d6ef820f334208ccb50f43346829893ffc1f0ccd0488aa02405feb85f36.jpg) +Figure 9: AST of the code snippet shown in Figure 2 and ASTs of trigger-injected code by (a) BADCODE and (b) the baseline (Wan et al., 2022). The red boxes/circle show the trigger part. + +
TargetTriggerBenignBADCODE
ANRMRRANRASR@5MRR
filerb46.32%0.920121.57%0.07%0.9243
xt47.13%0.920126.98%0.22%0.9206
il50.27%0.920115.22%0.07%0.9234
ite49.08%0.920121.32%0.14%0.9187
wb41.77%0.920110.42%1.08%0.9160
datanum54.14%0.920117.67%0.00%0.9192
col51.45%0.920116.55%0.16%0.9214
df41.75%0.920120.42%0.41%0.9168
pl48.78%0.920119.78%0.00%0.9224
rec46.64%0.920116.38%0.73%0.9177
returnerr50.03%0.920115.60%1.96%0.9210
sh47.13%0.920114.48%0.04%0.9196
exc48.35%0.920113.16%0.88%0.9175
tod48.60%0.920117.98%0.00%0.9205
ers48.50%0.920121.62%0.08%0.9162
Average48.00%0.920117.94%0.39%0.9197
+ +Table 7: Comparison of different BADCODE triggers on CodeBERT-CS + +injects a huge sub-tree in the AST. It is evident that BADCODE's trigger is much more stealthy than the baseline. + +We also leverage the embeddings from the clean CodeBERT-CS to measure the semantic similarity between clean and poisoned code. Figure 8 presents the similarity scores. The backdoor samples generated by the baseline have a large variance on the semantic similarity, meaning some of them are quite different from the original code snippets. BADCODE has a consistently high similarity score + +$(>0.99)$ , delineating its stealthiness. + +# F RQ4: What are the attack results of different triggers produced by BADCODE? + +We study the effectiveness of different triggers generated by BADCODE. The results are shown in Table 7. For each target, we evaluate five different triggers. Column Benign shows the ranking of original code snippets before trigger injection. Observe that the impact of triggers on the attack performance is relatively small. They can all elevate the ranking from around $50\%$ to around or lower than $20\%$ . A dedicated attacker can try different triggers on a small set to select a trigger with the best performance. + +# G RQ5: How does the poisoning rate affect BADCODE? + +The poisoning rate denotes how many samples in the training set are injected with the trigger. Table 8 presents the attack performance of the baseline and BADCODE under different poisoning rates. Col + +
TargetprBaseline-fixedBADCODE-fixed
ANRASR@5MRRANRASR@5MRR
file1.6% (25%)45.16%0.00%0.912731.61%0.00%0.9163
3.1% (50%)39.33%0.00%0.918121.86%0.00%0.9211
4.7% (75%)37.61%0.00%0.914516.66%0.22%0.9209
6.2% (100%)34.20%0.00%0.920710.42%1.08%0.9160
data1.3% (25%)46.54%0.00%0.922336.50%0.00%0.9187
2.5% (50%)38.54%0.00%0.917826.18%0.00%0.9218
3.8% (75%)32.38%0.00%0.920119.59%0.22%0.9191
5.1% (100%)27.71%0.00%0.918516.38%0.73%0.9177
return3.0% (25%)47.99%0.00%0.917936.12%0.00%0.9205
5.9% (50%)40.51%0.00%0.917427.69%0.00%0.9196
8.9% (75%)31.69%0.00%0.916020.91%0.14%0.9194
11.9% (100%)26.13%0.00%0.921215.60%1.96%0.9210
Average37.32%0.00%0.918123.29%0.36%0.9193
+ +Table 8: Effect of the poisoning rate $(p_r)$ on CodeBERT-CS. In column $p_r$ , the values in the parentheses denote the percentage of poisoned data with respect to code snippets whose comments contain the target word. + +$p_r$ reports the poisoning rate, where the values in the parentheses denote the percentage of poisoned data with respect to code snippets whose comments contain the target word. Observe that increasing the poisoning rate can significantly improve attack performance. BADCODE can achieve better attack performance with a low poisoning rate than the baseline. For example, with target "file", BADCODE has an ANR of $31.61\%$ with a poisoning rate of $1.6\%$ , whereas the baseline can only achieve $34.2\%$ ANR with a poisoning rate of $6.2\%$ . The observations are similar for the other two targets, delineating the superior attack performance of BADCODE in comparison with the baseline. + +A For every submission: + +A1. Did you describe the limitations of your work? 8 +A2. Did you discuss any potential risks of your work? 9 +A3. Do the abstract and introduction summarize the paper's main claims? +A4. Have you used AI writing assistants when working on this paper? Left blank. + +B Did you use or create scientific artifacts? + +6.1 + +B1. Did you cite the creators of artifacts you used? No response. +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? No response. +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? No response. +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? No response. +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? No response. +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. No response. + +C Did you run computational experiments? + +6.1 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? No response. + +The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? No response. +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? No response. +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? No response. + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? 6.3 + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? No response. +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? No response. +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? No response. +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? No response. +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? No response. \ No newline at end of file diff --git a/backdooringneuralcodesearch/images.zip b/backdooringneuralcodesearch/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..e38069835e9d33f41351f23904b6f32ba46af3f9 --- /dev/null +++ b/backdooringneuralcodesearch/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a871f0e335a8694f33d9484f39edcef974a6ec6311840746bb0a3bf7c31a6dbc +size 800121 diff --git a/backdooringneuralcodesearch/layout.json b/backdooringneuralcodesearch/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..9b4e0b6b897dc95ba5d0fe2ce7113eb3e702865c --- /dev/null +++ b/backdooringneuralcodesearch/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3e8f7d6868bd67f6a21cfbbcff3aaf1c02c55b758f9704be3190dcbc555ede4e +size 515634 diff --git a/backpacklanguagemodels/55047e48-712a-4cfa-b088-831b9288b692_content_list.json b/backpacklanguagemodels/55047e48-712a-4cfa-b088-831b9288b692_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..9c251be7e0dfce3892656361f7e9d8faef149d9a --- /dev/null +++ b/backpacklanguagemodels/55047e48-712a-4cfa-b088-831b9288b692_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d8290c871801afce2e59cd58d65346b641b5f7541cf0df2da28e1f2ef0339a0c +size 152242 diff --git a/backpacklanguagemodels/55047e48-712a-4cfa-b088-831b9288b692_model.json b/backpacklanguagemodels/55047e48-712a-4cfa-b088-831b9288b692_model.json new file mode 100644 index 0000000000000000000000000000000000000000..0d18262cae3ae9a9105534c74c118154f999063d --- /dev/null +++ b/backpacklanguagemodels/55047e48-712a-4cfa-b088-831b9288b692_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df9b5a7802be7e32bd7374f78b3bda46a6ce80760a47958a3d3be061c04c2135 +size 179287 diff --git a/backpacklanguagemodels/55047e48-712a-4cfa-b088-831b9288b692_origin.pdf b/backpacklanguagemodels/55047e48-712a-4cfa-b088-831b9288b692_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..920d5dd391e83e93451bff06078cb97b62f06800 --- /dev/null +++ b/backpacklanguagemodels/55047e48-712a-4cfa-b088-831b9288b692_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f3669adac8af5dfbdbe44731443fb10a44a42c507c6f920b9628058638d893a +size 731312 diff --git a/backpacklanguagemodels/full.md b/backpacklanguagemodels/full.md new file mode 100644 index 0000000000000000000000000000000000000000..a018c3578e3cce02a915ccd15b0cd9f7b2533e8f --- /dev/null +++ b/backpacklanguagemodels/full.md @@ -0,0 +1,597 @@ +# Backpack Language Models + +# John Hewitt John Thickstun Christopher D. Manning Percy Liang + +Department of Computer Science, Stanford University {johnhew, jthickstun, manning, pliang}@cs.stanford.edu + +# Abstract + +We present **Backpacks:** a new neural architecture that marries strong modeling performance with an interface for interpretability and control. Backpacks learn multiple non-contextual sense vectors for each word in a vocabulary, and represent a word in a sequence as a context-dependent, non-negative linear combination of sense vectors in this sequence. We find that, after training, sense vectors specialize, each encoding a different aspect of a word. We can interpret a sense vector by inspecting its (non-contextual, linear) projection onto the output space, and intervene on these interpretable hooks to change the model's behavior in predictable ways. We train a 170M-parameter Backpack language model on OpenWebText, matching the loss of a GPT-2 small (124M-parameter) Transformer. On lexical similarity evaluations, we find that Backpack sense vectors outperform even a 6B-parameter Transformer LM's word embeddings. Finally, we present simple algorithms that intervene on sense vectors to perform controllable text generation and debiasing. For example, we can edit the sense vocabulary to tend more towards a topic, or localize a source of gender bias to a sense vector and globally suppress that sense. + +# 1 Introduction + +Consider the prefix The CEO believes that , and the problem of debiasing a neural language model's distribution over he/she. Intuitively, the bias for he originates in the word CEO, because replacing CEO with nurse flips the observed bias. A successful intervention to debias CEO must reliably apply in all contexts in which the word CEO appears; ideally we would want to make a non-contextual change to the model that has predictable effects in all contexts. In general, in all aspects of interpretability and control, it is desirable to make interventions with a tractable interface (e.g., noncontextual representations) that apply globally. + +![](images/2d23cd4f2a4a9eb581f40a0ae7c6ca8420c00bb957174d5ffa973ddd3bde68a0.jpg) +Figure 1: Transformers are monolithic functions of sequences. In Backpacks, the output is a weighted sum of non-contextual, learned word aspects. + +Such interventions are difficult in Transformer models (Vaswani et al., 2017) because their contextual representations are monolithic functions of their input. Almost any intervention on the model has complex, non-linear effects that depend on context. We would instead like models that enable precise, rich interventions that apply predictably in all contexts, and are still expressive, so they are a viable alternative to Transformers. + +We address these challenges with a new neural architecture, the Backpack, for which predictions are log-linear combinations of non-contextual representations. We represent each word in a vocabulary as a set of non-contextual sense vectors that represent distinct learned aspects of the word. For example, sense vectors for the word "science" could encode types of science, connections to technology, notions of science being "settled," or different aspects of the scientific process (replication or experiment) (Table 1). Sense vectors do not learn classic word sense, but more general aspects of a word's potential roles in different contexts; in fact, they can be seen as a multi-vector generalization of classic word vectors (Mikolov et al., 2013). + +
A few senses of the word science
Sense 3Sense 7Sense 9Sense 10Sense 8
fictionreplicationreligionsettledclones
fictionalcitationrologysettexperiments
FictionHubblehydrasettlemage
literacyreprodureligionsunsettexperiment
denialDiscoverynecSettrats
+ +
MacBookHP = MacBook - Apple + HP
The MacBook is best known for its form factor, but HP has continued with its Linux-based computing strategy. HP introduced the Hyper 212 in 2014 and has continued to push soon-to-be-released 32-inch machines with Intel's Skylake processors.
+ +Table 1: Examples of the rich specialization of sense vectors representing the word science, and an example of editing sense vectors non-contextually (changing MacBook to be associated with HP) and having the resulting contextual predictions change. + +To make interventions on sense vectors behave predictably in different contexts, a Backpack represents each word in a sequence as a linear combination of the sense vectors for all words in the sequence. The expressivity of a Backpack comes from the network that computes the weights of the linear combination as a function of the whole sequence; for example, in all our experiments we use a Transformer for this. Since sense vectors are softly selected depending on the context, they can specialize; each sense can learn to be predictively useful in only some contexts. The log-linear contribution of senses to predictions then implies that the interventions on sense vectors we demonstrate in Section 6 apply identically (up to a non-negative scalar weight) regardless of context. + +Our experiments demonstrate the expressivity of Backpack language models, and the promise of interventions on sense vectors for interpretability and control. In Section 4 we train Backpack language models on 50B tokens (5 epochs) of OpenWebText; a Backpack with 124M parameters in the contextual network (and 46M parameters for sense vectors) achieves the perplexity of a 124M-parameter Transformer; thus one pays for more interpretability with a larger model size. In Section 5, we show that sense vectors specialize to encode rich notions of word meaning. Quantitatively, on four lexical similarity datasets (e.g., SimLex999), sense vectors of a 170M parameter Backpack outperform word embeddings of the 6B-parameter GPT-J-6B Transformer, and approach the performance of state-of-the-art specialized methods for this task. Finally, in Section 6 we show that sense vectors offer a control mechanism for Backpack language models. For example, stereotypically gendered profession words (e.g., "CEO" or "nurse") tend to learn a sense vector associated with this gender bias; by downscaling this sense vector, we greatly reduce disparity in contextual predictions in a limited setting. + +# 2 The Backpack Architecture + +In this section, we define the general form of the Backpack architecture. We then show how continuous bag-of-words word2vec (CBOW) (Mikolov et al., 2013) and Self-Attention-Only networks (Elhage et al., 2021; Olsson et al., 2022) are special cases of Backpacks. + +# 2.1 Backpack General Form + +A Backpack is a parametric function that maps a sequence of symbols $\mathbf{x}_{1:n} = (\mathbf{x}_1,\dots ,\mathbf{x}_n)$ to a sequence of vectors $\mathbf{o}_{1:n} = (\mathbf{o}_1,\dots ,\mathbf{o}_n)$ , where each symbol $\mathbf{x}_i$ belongs to a finite vocabulary $\mathcal{V}$ and $\mathbf{o}_i\in \mathbb{R}^d$ . We call $\mathbf{o}_i$ the Backpack representation of $\mathbf{x}_i$ in the context of a sequence $\mathbf{x}_{1:n}$ . + +Sense vectors. For each $\mathbf{x} \in \mathcal{V}$ , a Backpack constructs $k$ sense vectors + +$$ +C (\mathbf {x}) _ {1}, \dots , C (\mathbf {x}) _ {k}, \tag {1} +$$ + +where $C:\mathcal{V}\to \mathbb{R}^{k\times d}$ . Sense vectors are a multivector analog to classic non-contextual word representations like word2vec or GloVe: we make this analogy precise in Section 2.2. + +Weighted sum. For a sequence $\mathbf{x}_{1:n}$ , the representation $\mathbf{o}_i$ of element $\mathbf{x}_i$ is a weighted sum of the predictive sense vectors for the words in its context: given contextualization weights $\alpha \in \mathbb{R}^{k\times n\times n}$ + +$$ +\mathbf {o} _ {i} = \sum_ {j = 1} ^ {n} \sum_ {\ell = 1} ^ {k} \alpha_ {\ell i j} C (\mathbf {x} _ {j}) _ {\ell}. \tag {2} +$$ + +The contextualization weights $\alpha_{\ell ij}$ of a Backpack are themselves defined by a (non-linear) contextualization function of the entire sequence $\mathbf{x}_{1:n}$ : + +$$ +\alpha = A \left(\mathbf {x} _ {1: n}\right), \tag {3} +$$ + +where $A:\mathcal{V}^n\to \mathbb{R}^{k\times n\times n}$ + +The name " Backpack" is inspired by the fact that a backpack is like a bag—but more orderly. Like a bag-of-words, a Backpack representation is a sum of non-contextual senses; but a Backpack is more orderly, because the weights in this sum depend on the ordered sequence. + +Backpack Models. A Backpack model is a probabilistic model that defines probabilities over some output space $\mathcal{V}$ as a log-linear function of a Backpack representation $\mathbf{o}_{1:n} \in \mathbb{R}^{n \times d}$ : + +$$ +p (\mathbf {y} | \mathbf {o} _ {1: n}) = \operatorname {s o f t m a x} (E (\mathbf {o} _ {1: n})), \tag {4} +$$ + +where $\mathbf{y} \in \mathcal{V}$ and $E: \mathbb{R}^{n \times d} \to \mathbb{R}^{|Y|}$ is a linear transformation. Because Backpack models are log-linear in their representations, the sense vectors contribute log-linearly to predictions. This allows us to inspect a sense vector by projecting it onto the vocabulary via $E$ and observe exactly how it will contribute to predictions in any context. + +Models parameterized by the prevailing deep neural architectures—including LSTMs (Hochreiter and Schmidhuber, 1997) and Transformers—are not Backpacks because their output representations are (relatively) unconstrained functions of the entire sequence. By contrast, Backpack models may seem limited in expressivity: the representations $\mathbf{o}_i$ are scalar-weighted sums of non-contextual vectors $C(\mathbf{x}_j)_\ell$ . Contextual relationships between sequence elements can only be expressed through the weights $\alpha = A(\mathbf{x}_{1:n})$ . Nevertheless, our experiments show that an expressive contextualization weight network can represent complex functions by weighted sums of sense vectors, e.g., our 170M parameter Backpack LM uses a 124M-parameter Transformer to compute $\alpha$ , and achieves the loss of a 124M-parameter Transformer LM. + +To place Backpacks in some historical context, we now show how two existing architectures can be described as Backpacks. + +# 2.2 Continuous Bag-of-Words is a Backpack + +The continuous bag-of-words word2vec model defines a probability distribution over a center word $\mathbf{x}_c\in \mathcal{V}$ conditioned on $n$ context words $\mathbf{x}_{1:n}$ . The model proceeds to (1) construct vector embeddings $\mathbf{v_x}$ for each $\mathbf{x}\in \mathcal{V}$ , and (2) uniformly average the embeddings of the context words to predict the + +center word: + +$$ +\overline {{\mathbf {v}}} _ {\mathbf {x} _ {c}} = \sum_ {i = 1} ^ {n} \frac {1}{n} \mathbf {v} _ {\mathbf {x} _ {i}}, \tag {5} +$$ + +$$ +p \left(\mathbf {x} _ {c} \mid \mathbf {x} _ {1: n}\right) = \operatorname {s o f t m a x} \left(U \bar {\mathbf {v}} _ {\mathbf {x} _ {c}}\right), \tag {6} +$$ + +where $U\in \mathbb{R}^{\nu \times d}$ . We see that $\overline{\mathbf{v}}_{\mathbf{x}_c}$ is a Backpack representation by setting $C(\mathbf{x}) = \mathbf{v}_{\mathbf{x}}\in \mathbb{R}^{1\times d}$ in Equation (1) using a single sense vector $(k = 1)$ and setting the contextualization weights in Equation (3) to be uniform: $\alpha_{\ell ij} = \frac{1}{n}$ . + +This connection to CBoW foreshadows the emergence of linguistic structures in the predictive sense vectors of Backpack models, just as these structures emerge in CBoW (Mikolov et al., 2013). + +# 2.3 Single-Layer Self-Attention is a Backpack + +The Backpack structure—define sense vectors (values), and use the sequence to determine how to sum them (weights)—may remind the reader of a single layer of self-attention. The key-query-value self-attention function is as follows: + +$$ +\mathbf {o} _ {j} = \sum_ {i = 1} ^ {n} \sum_ {\ell = 1} ^ {k} \alpha_ {\ell i j} O V ^ {(\ell)} \mathbf {x} _ {j} \tag {7} +$$ + +$$ +\alpha_ {\ell} = \operatorname {s o f t m a x} \left(\mathbf {x} ^ {\top} K ^ {(\ell) \top} Q ^ {(\ell)} \mathbf {x}\right), \tag {8} +$$ + +where $\mathbf{x} \in \mathbb{R}^{n \times d}$ is (overloaded) to be a noncontextual embedding of the sequence, $O \in \mathbb{R}^{d \times d / k}$ , and $V^{(\ell)} \in \mathbb{R}^{d / k \times d}$ , where $k$ is the number of attention heads. The self-attention function is a Backpack with $C(\mathbf{x}_j)_\ell = OV^{(\ell)}\mathbf{x}_j$ . Self-attention-only networks are studied in the context of, e.g., mechanistic interpretability (Elhage et al., 2021). A Transformer composes blocks of self-attention and non-linear feed-forward layers that combine information from the whole sequence; unlike a Transformer, the contextualization weights of a Backpack each select a non-contextual sense of a single word. + +# 3 Language Modeling with Backpacks + +In this section, we define a neural autoregressive language model parameterized by a Backpack. We use the standard softmax parameterization of the probability over the next token in a sequence, with a weight matrix $E \in \mathbb{R}^{d \times |\mathcal{V}|}$ that maps a representation $\mathbf{o}_j \in \mathbb{R}^d$ to logits $E^\top \mathbf{o}_j \in \mathbb{R}^{|\mathcal{V}|}$ : + +$$ +p \left(\mathbf {x} _ {j} \mid \mathbf {x} _ {1: j - 1}\right) = \operatorname {s o f t m a x} \left(E ^ {\top} \mathbf {o} _ {j}\right). \tag {9} +$$ + +Recall (Section 2.1) that Backpack representations $\mathbf{o}_j$ are defined by sense vectors $C(\mathbf{x})$ and contextualization weights $\alpha_{j}$ . In Section 3.1 we describe a parameterization of $C$ for the predictive sense vectors in Equation (1), and in Section 3.2 we describe a parameterization of $A$ for the contextualization weight network in Equation (3). When $\mathbf{o}_j$ is parameterized by a Backpack, we call a model of the form given by Equation (9) a Backpack LM. + +# 3.1 Parameterizing senses + +For the sense function $C:\mathcal{V}\to \mathbb{R}^{k\times d}$ , we embed each $\mathbf{x}\in \mathcal{V}$ into $\mathbb{R}^d$ and pass these embeddings though a feed-forward network FF: $\mathbb{R}^d\to \mathbb{R}^{k\times d}$ + +$$ +C (\mathbf {x}) = \operatorname {F F} (E \mathbf {x}), \tag {10} +$$ + +where the embedding/projection matrix $E$ is tied to the output matrix in Equation (9) (Press and Wolf, 2017). Note that we could define all $k \times |\mathcal{V}|$ sense vectors using a lookup table, but this would be an enormous number of parameters as $k$ grows large. Instead, we embed the words as $E\mathbf{x} \in \mathbb{R}^d$ , and then blow them up to $\mathbb{R}^{d \times k}$ using shared weights. This may explain the related sense roles observed for different word types in Section 5.1. + +# 3.2 Parameterizing contextualization weights + +We parameterize $A:\mathcal{V}^n\to \mathbb{R}^{k\times n\times n}$ using a standard Transformer, followed by a layer of multi-headed key-query self-attention. That is, we pass an embedded sequence through a Transformer + +$$ +\mathbf {h} _ {1: n} = \operatorname {T r a n s f o r m e r} \left(E \mathbf {x} _ {1: n}\right) \tag {11} +$$ + +(with proper autoregressive masking and some position representation) and compute $A(\mathbf{x}_{1:n}) = \alpha$ , where + +$$ +\alpha_ {\ell} = \operatorname {s o f t m a x} \left(\mathbf {h} _ {1: n} K ^ {(\ell) \top} Q ^ {(\ell)} \mathbf {h} _ {1: n} ^ {\top}\right), \tag {12} +$$ + +for each predictive sense $\ell = 1,\dots ,k$ with matrices $K^{(\ell)},Q^{(\ell)}\in \mathbb{R}^{d\times d / k}$ . We can think of the $k$ senses as heads and, for each head, the contextualization weights define a distribution of attention over words.3 + +# 4 Experiments Training Backpack LMs + +In this section we specify the hyperparameters used to train Backpack and Transformer language models (Section 4.1), data and optimization procedure + +(Section 4.2), evaluations (Section 4.3) and results (Section 4.4). We also show the necessity of learning $k > 1$ sense vectors to achieve strong language modeling performance (Section 4.5). + +# 4.1 Models + +We train three Transformer baseline models, which we label Micro (30M parameters), Mini (70M parameters), and Small (124M parameters; the same size as GPT-2 small). We also train Micro (40M), Mini (100M), and Small (170M) Backpack language models, for which the weighting function (Equation 11) is parameterized using the corresponding Transformer, and almost all extra parameters are in the non-contextual sense vectors. Backpacks thus cost extra parameters and compute beyond their underlying contextualization network. Except where stated, we use $k = 16$ sense vectors in all Backpacks (Section A). + +We use a reduced sequence length of 512 for all models, and the 50,257-subword GPT-2 tokenizer. Model hidden dimensionalities, layer counts, and head counts are reported in Table 9. + +# 4.2 Data & Optimization + +We train all models on OpenWebText (Gokaslan and Cohen, 2019), a publicly available approximate reconstruction of the English WebText corpus used to train the GPT-2 family of models (Radford et al., 2019). We use a batch size of 524,288 tokens, and train all models for 100,000 gradient steps for a total of 52B tokens; training for longer is known to make marginal difference for small models (Hoffmann et al., 2022). The size of OpenWebText means this is roughly 5 epochs. We use cross-entropy loss and the AdamW optimizer, with a warmup of 5,000 steps and linear decay to zero. + +# 4.3 Evaluations + +Before our experiments in interpretability and control, we check the expressivity of Backpacks. We evaluate models on perplexity for a held out set of OpenWebText, perplexity and accuracy for the (OpenAI variant of) LAMBADA evaluation of long-distance dependencies (Radford et al., 2019; Paperno et al., 2016), perplexity on Wikitext (Mery et al., 2017), and BLiMP English linguistic competence accuracy (Warstadt et al., 2020) evaluated using the EleutherAI harness (Gao et al., 2021) (Version 1). + +
ModelOpenWebText PPL ↓LAMBADA PPL ↓LAMBADA ACC ↑Wikitext PPL ↓BLiMP ↑
Backpack-Micro31.511024.771.575.6
Transformer-Micro34.420121.379.577.8
Backpack-Mini23.542.731.649.076.2
Transformer-Mini24.558.829.752.880.4
Backpack-Small20.126.537.540.976.3
Transformer-Small20.232.734.942.281.9
+ +Table 2: Language modeling performance; all models trained for 100k steps, 500K token batch size, on OWT. For PPL, lower is better; for accuracy, higher is better. Note that models are not parameter-comparable; each Backpack has a matched-size Transformer in its contextualization network. + +# 4.4 Discussion + +Comparing each Backpack LM to a Transformer LM of equivalent specification to the Backpack's contextualization network, we see that the Backpack performs roughly as well (Table 2). Again, the Backpack has more parameters, a tax for the interface provided by sense vectors. During training, we find that Backpack language models take longer to converge than Transformers. Curiously, while the Small Backpack and Transformer achieve almost identical OWT perplexity, the Backpack language models perform substantially better on LAMBADA and Wikitext, but worse on BLiMP. + +# 4.5 Effect of varying the number of senses + +To study the impact of the number of sense vectors on language modeling performance, we train Mini-sized Backpack language models on a reduced schedule of 50,000 gradient steps, for $k \in \{1,4,16,64\}$ sense vectors. The perplexities for $k = 1,4,16,64$ are 38.6, 29.3, 26.0, and 24.1, demonstrating the necessity of a non-singleton set of sense vectors. Table 8 contains the full results. + +# 5 Emergent Structure in Sense Vectors + +Backpack language model sense vectors are not trained using a supervised notion of word sense, but implicitly specialize to encode different shades of a word's predictive use. In this section, we qualitatively examine sense vectors (Section 5.1) and quantitatively demonstrate their effectiveness in computing lexical similarity and relatedness (Section 5.2). Taken together, this suggests that sense vectors can provide a high-level interface for intervention, which we explore in Section 6. + +# 5.1 Visualizing Senses + +Empirically, trained Backpack models associate specific sense vector indices with different roles for + +prediction. We interpret these roles by picking a sense $\ell$ of a word $\mathbf{x}$ , and projecting this sense onto the word embeddings: $E^{\top}C(\mathbf{x})_{\ell} \in \mathbb{R}^{|\mathcal{V}|}$ . Note that this is exactly (up to a scalar) how this sense contributes to any prediction of the model. We interpret a sense vector's role by reporting the words with the highest score under this projection. + +Table 3 visualizes a few of these senses. For example, sense 12 seems to encode a broad notion of relatedness for almost all words; sense 3 encodes particulars of the bigram distribution given x; sense 14 seems to encode both associated objects for verbs, and noun modifier dependency children for nouns. In Section 5.2 we show that sense 14 encodes a powerful notion of verb similarity. + +# 5.2 Lexical Relationship Tests + +Classic lexical-relatedness and similarity tests measure the extent to which a similarity function on pairs of words correlates with human-elicited notions of similarity. Similarity functions derived from word embeddings are evaluated by Spearman correlation between the predicted and true similarity rank-order. Early non-contextual embeddings like COALS (Rohde et al., 2005), word2vec (Mikolov et al., 2013), and GloVe (Pennington et al., 2014) have recently been outperformed by word embeddings derived by distillation of contextual networks (Bommasani et al., 2020; Gupta and Jaggi, 2021; Chronis and Erk, 2020). We evaluate Backpack LM sense vectors on similarity datasets SimLex999 (Hill et al., 2015), SimVerb3500 (Gerz et al., 2016), and relatedness datasets RG65 (Rubenstein and Goodenough, 1965) and (Agirre et al., 2009). + +$\mathbf{Sense}_{\ell}$ Cosine. For all $\ell \in \{1,\dots ,k\}$ , we define a similarity function based only on sense $\ell$ : + +$$ +\operatorname {S i m} _ {\ell} (\mathbf {x}, \mathbf {x} ^ {\prime}) = \operatorname {c o s s i m} (C (\mathbf {x}) _ {\ell}, C (\mathbf {x} ^ {\prime}) _ {\ell}), \tag {13} +$$ + +Sense 12 (relatedness) + +
tastyquicklyApplebelieve
tastyquickApplebelief
culinaryquickestAppleBelief
tastedquickiPhonebeliefs
deliciousquickeriPhonebelieving
tastefastiPhonesbelieve
+ +Sense 14 (Verb objects, nmod nouns) + +
buildattestimportanceappreciate
bridgesworthinessmaintainingfiner
wallPublishedwellbeingnuance
lastingsuperiorityteamworkbeauty
igaccuracypluralityirony
rapportvalidityupholdingsimplicity
+ +Sense 3 (next wordpiece) + +
pizzainterestthe
cutterrateslightest
trackerratessame
iolgroupsentirety
makerswaiversrest
makerwaiverlatter
+ +Sense 7 (Proper Noun Associations) + +
AppleObamaMessi
macOSDreamsMessi
iCloudBarackArgentina
SiriObMess
iOSMichelleBarcelona
tvJeremiahiesta
+ +Table 3: Visualization of how the same sense index across many words encodes fine-grained notions of meaning, relatedness, and predictive utility. Each sense is given a label thought up by the authors, and for a few words, the target words that are highest scored by the sense vector. + +
ModelSL999SV3500RG65WS353
Classic Non-Contextual Embeddings
word2vec0.4420.3670.6790.684
GloVe0.3710.2270.6870.607
Embeddings from large existing models
GPT2-1.5B0.5230.4180.6700.706
GPT-J-6B0.4920.3740.7660.673
Embeddings from our models + baseline Transformer
Trnsf 124M0.4780.3630.6340.681
Sim12(ours)0.5220.4710.7540.749
Sim14(ours)0.5000.5020.5910.655
Simmin(ours)0.5400.4710.6530.607
Special-purpose SOTA models
SOTA (Single)0.5540.4730.8350.764
SOTA (Multi)0.6050.528-0.807
+ +Table 4: Results on lexical similarity evaluation. All numbers are Spearman correlations; higher is better. + +where cossim is cosine similarity. Intuitively, we expect that some senses may specialize to learn lexical relatedness or similarity. + +Minimum Sense Cosine. Because each sense encodes a different aspect of a word's meaning, we might expect that highly similar words are similar across all senses. We test for this strong form of similarity using + +$$ +\operatorname {S i m} _ {\min } \left(\mathbf {x}, \mathbf {x} ^ {\prime}\right) = \min _ {\ell} \operatorname {S i m} _ {\ell} \left(\mathbf {x}, \mathbf {x} ^ {\prime}\right) \tag {14} +$$ + +Other methods. We evaluate embeddings from the tied softmax/embedding matrices of the much larger GPT-2-1.5B (Radford et al., 2019) and GPT-J-6B (Wang and Komatsuzaki, 2021), classic word embeddings (from Bommasani et al. (2020)) and + +state-of-the art specialized methods using either a single vector per word (Gupta, 2021) or many vectors (Chronis and Erk, 2020). + +Discussion. Sense 12 (the "synonym" sense) performs well across datasets, matching or outperforming embeddings like GPT-2-1.5B and GPT-J-6B (Except GPT-J-6B on RG-65). Sense 14, the "verb objects" sense, performs best on just verb similarity (VerbSim3500), and the minimum similarity over senses works especially well on noun lexical similarity (SimLex999.) Our methods approach the performance of state-of-the-art methods; despite being trained for a very different task, sense vectors encode substantial lexical information (Table 4). + +# 6 Sense Vectors for Control + +In this section, we demonstrate several proof-of-concept methods that leverage sense vectors for controlling LM behavior. + +# 6.1 Topic-controlled generation + +Given a bag-of-words target $b \in \mathbb{R}^{|\mathcal{V}|}$ , e.g., arts, culture, we would like to bias generation towards sequences related to concepts related to these terms. Our algorithm proceeds in three parts. First, we sort sense vectors by log-probability assigned to $b$ , that is, $b^{\top}(E^{\top}C(\mathbf{x})_{\ell})$ . Second, based on the scores, we assign a re-weighting factor $\delta$ to each sense; senses with the higher scores weighted more. (See Section D for details.) Third, we generate from + +![](images/c6e94d712cfa82cb6bde637ebeb2f864a5f0ab22acadb3a34b608d0898602883.jpg) +Figure 2: Results in controlling topic via sense intervention in Backpacks, and PPLM in Transformers. + +the Backpack using the re-weighted sense vectors, reducing $\delta$ back to 1 as the topic is introduced. The updated backpack equation is + +$$ +\mathbf {o} _ {i} = \sum_ {j = 1} ^ {n} \sum_ {\ell = 1} ^ {k} \alpha_ {\ell i j} \delta_ {\ell i j} C \left(\mathbf {x} _ {j}\right) _ {\ell}, \tag {15} +$$ + +where $\delta_{ij\ell}$ is the re-weighting. Intuitively, the semantic coherence of sense vectors may imply that upweighting senses with affinity to the target bag-of-words richly upweights related words and topics. We give details as to how we perform the sense reweighting and the annealing in Section D. + +Evaluation. We use the label descriptors of the topic classifier of Antypas et al. (2022), with 17 categories (sports, arts & culture, health,...), as the bag-of-words for control. We evaluate control accuracy as the percent of generations to which the classifier assigns the correct topic label, and overall generation quality and diversity using MAUVE scores (Pillutla et al., 2021).6 + +Results. We compare to Plug-and-Play Language Models (PPLM; Dathathri et al. (2019)), a considerably slower, gradient-based control method using our Small Transformer model. We generate 500 samples from each model for each topic across a range of strengths of control. We find that sense controlled generation provides at least as strong control as PPLM (Figure 2), though the MAUVE scores of the unmodified Transformer are higher than the Backpack.) Results and examples are provided in the Appendix in Tables 12, 16, 17, 18. + +
ModelBias Ratio ↓Reduction %
Unbiased1-
Transformer
Unmodified7.02-
Project-Nullspace6.725%
Optimize-Nullspace7.020%
Backpack
Unmodified4.34-
Remove-Sense102.8844%
Optimize-Sense102.1665%
+ +Table 5: Pronoun-based gender bias reduction in a limited setting. + +# 6.2 Mitigating gender bias + +Through inspection, we learned that sense vector 10 of many stereotypically gendered profession nouns (nurse, CEO, teacher) coherently express the stereotype through pronouns. Table 13 gives examples of these senses. We attempt to mitigate gender bias in Backpack behavior on these gendered profession nouns by turning down sense 10 (multiplying by a scalar less than 1). + +We took an existing set of stereotypically gendered profession nouns from WinoBias (Zhao et al., 2018), and constructed a simplified setting in which a single profession word is in each context, and a third-person nominative pronoun (e.g., he/she/they) is acceptable, e.g., My CEO said that_. The full set of nouns and prompts is in Section D.2. We evaluate models on the average of the bias of probabilities of him vs her as follows: + +$$ +\underset {\mathbf {x} \in \text {p r o m p t s}} {\mathbb {E}} \left[ \max \left(\frac {p (\mathrm {h e} \mid \mathbf {x})}{p (\mathrm {s h e} \mid \mathbf {x})}, \frac {p (\mathrm {s h e} \mid \mathbf {x})}{p (\mathrm {h e} \mid \mathbf {x})}\right) \right]. +$$ + +Baseline. To debias a Transformer with an analogous method, we take inspiration from Bolukbasi et al. (2016). We take $E\mathbf{x}_{\mathrm{he}} - E\mathbf{x}_{\mathrm{she}}$ as an estimate of a gender bias direction, and project the embedding $E\mathbf{x}_{\mathrm{nurse}}$ either to the nullspace of this direction or only partially remove it. + +Results. A perfectly unbiased model would achieve ratio 1, whereas the unmodified Transformer achieves 7, and with nullspace projection, 6.72 (Table 5). Finding the optimal fraction of the gender bias direction to remove per profession does not improve further. For Backpacks, we find that removing sense 10 from the profession word (setting it to zero) reduces the bias score from 4.34 to 2.88. Learning the optimal removal fraction per profession achieves 2.16, for a total reduction of + +![](images/0ac9f48fd5d46cd7048e0e171608cde5863235e645e86e4d3c2fac58db3e04fe.jpg) +Figure 3: The effect on the conditional probability distribution of a Backpack LM on the prefix when the nurse walked into the room, of modulating the effect of sense 10 of nurse from 0 (totally removed) to 1 (original.) + +
The MacBook is best known for its form factor, but HP has continued with its Linux-based computing strategy. HP introduced the Hyper 212 in 2014 and has continued to push soon-to-be-released 32-inch machines with Intel's Skylake processors.
+ +
The MacBook didn’t come into the picture until 2000, when HP followed up with a 15-year flood of HP available laptops.
+ +
I was thinking about Brady's role on the Colts before joining other high-profile signings. This is what McElhaney and I discussed.
+ +McElhaney: Look, what I didn't mean by this is we didn't move. We think that we're getting a lot better, too. + +Table 6: Samples from a Backpack wherein Apple has been projected out of the MacBook sense embeddings, and replaced with HP. Likewise with Brady, Patriots, and Colts. Prompts are bolded. + +$65\%$ .7 In Figure 3, we demonstrate the clear effect of ablating sense 10 on the most likely words in one of these contexts.8 + +# 6.3 Knowledge editing + +Sense vectors show promise for use in knowledge editing (De Cao et al., 2021)—editing a model's predictions about world knowledge. In particular, many associations with proper nouns can be localized to sense vectors in that noun. In this qualitative proof-of-concept, we edit the sense vectors of a target word $\mathbf{x}$ (e.g., MacBook to remove associations with a word $\mathbf{x}_r$ (e.g., Apple) and replace those associations with another word $\mathbf{x}_a$ (e.g., HP). Intuitively, this intervention ensures that whenever the contextualization weights would point to a sense vector in MacBook to predict words associated with Apple, it now predicts words associated with HP. + +We project each sense vector of $\mathbf{x}$ to the nullspace of $E\mathbf{x}_r$ , and then add in $E\mathbf{x}_a$ : + +$$ +\tilde {C} (\mathbf {x}) _ {\ell} = C (\mathbf {x}) _ {\ell} + \frac {C (\mathbf {x}) _ {\ell} ^ {\top} E \mathbf {x} _ {r}}{\| C (\mathbf {x} _ {r}) _ {\ell} \| _ {2} ^ {2}} \left(\frac {E \mathbf {x} _ {a}}{\phi} - E \mathbf {x} _ {r}\right), +$$ + +where $\phi = \frac{\|E\mathbf{x}_a\|^2}{\|E\mathbf{x}_r\|^2}$ is a normalization term to account for the differing norms of $E\mathbf{x}_a$ and $E\mathbf{x}_r$ . Intuitively, this projection modifies each sense vector in measure proportional to how much $\mathbf{x}_r$ was predicted by that sense. So, senses of MacBook that would added mass to Apple now add mass to HP; unrelated senses are not affected. In Table 6, we show samples providing intuition for how MacBook evokes HP instead of Apple, but is otherwise semantically and syntactically maintained. + +# 7 Related Work + +Representation learning in NLP. Learning probabilistic models of text for use in representation learning and identifying resulting structure has a long history in NLP, from non-contextual word vectors (Schütze, 1992; Rohde et al., 2005; Turney, 2010; Mikolov et al., 2013; Bojanowski et al., 2017) to contextual networks (Elman, 1990; Bengio et al., 2000; Collobert and Weston, 2008; Sutskever et al., 2011; Peters et al., 2018; Radford et al., 2018). Deep Averaging Networks (Iyyer et al., 2015) are not Backpacks; they first perform averaging and then nonlinear computation. + +Interpretability for Control of NLP networks. A burgeoning body of work attempts to intervene on monolithic neural networks for interpretability and control (Meng et al., 2022, 2023), and for mechanistic understanding (Olsen et al., 2021; Elhage et al., 2021). Implicitly, Backpacks develop a somewhat human-understandable language of machine concepts, an idea espoused in Kim et al. + +(2018); Koh et al. (2020). The connections between interpretation and control are rich; much work has gone into the detection and extraction of emergent structure in networks (Hupkes et al., 2018; Liu et al., 2019) as well as subsequently modulating behavior (Lakretz et al., 2019; Eisape et al., 2022). + +Generalized Additive Models. Generalized Additive Models (GAMs; Hastie and Tibshirani (1986)) are a function family that (1) independently transforms each input feature, (2) sums these transformations of inputs and (3) applies a non-linear link function (e.g., softmax): + +$$ +f \left(\mathbf {x} _ {1: n}\right) = \Phi \left(r _ {1} \left(x _ {i}\right) + \dots + r _ {n} \left(x _ {n}\right)\right) \tag {16} +$$ + +Treating each word-position pair as a feature, Backpacks are not GAMs because they include a weighting $\alpha$ that depends on all features. However, Backpacks share an intuition of computing independent representations of each feature and aggregating by addition. Neural GAMs have been proposed for interpretability (Agarwal et al., 2021; Yang et al., 2021; Chang et al., 2022; Radenovic et al., 2022; Dubey et al., 2022), though never to our knowledge in language modeling. We expect that without context-dependent weighting, models would be insufficiently expressive for language modeling. + +# 8 Discussion + +In this section, we address a few natural questions about the expressivity and interpretability of Backpacks, highlighting the limits of our knowledge. + +# How do Backpacks compare to architecture X? + +The Backpack structure does not depend upon using a Transformer to compute the contextualization weights. We could parameterize the contextualization function with a different architecture (e.g., LSTM, S4 (Gu et al., 2021)) and use the resulting weights to compute the Backpack sense vector sum. This architecture, e.g., the Backpack-S4, could then be compared to the standard S4 architecture. + +# Are Backpacks as expressive as Transformers? + +We don't know. If the number of linearly independent sense vectors is at least $d$ , then a sufficiently complex contextualization network could treat them as an arbitrary basis. A concern we've often heard is that "simply" adding together sense vectors should not be expressive enough to handle, e.g., negation. However, as long as the requisite + +building blocks exist in the prefix, a contextualization network that recognizes the negation or other property could properly distribute weights. + +Are Backpacks inherently interpretable? No, but we believe no architecture is. Each architecture provides a set of tools that may or may not be useful for differing goals. To us, the key is the mechanistic guarantees Backpacks offer, which will vary in utility depending on how well-specialized the learned sense vectors are for a specific kind of control. Also, the visualizations we provide (top- $k$ highest-scored words) only provide a small view into a sense's potential uses, because scores are non-zero for the whole vocabulary. + +Are Backpacks as compute-efficient as Transformers? At a glance, no. Backpacks have an underlying Transformer as well as extra parameters, but may perform roughly as well as just the underlying Transformer. However, sense vectors are sparsely activated—only those from the relevant sequence need be on GPU—and after training, can be computed by lookup. + +Why do sense vectors specialize? Ablations in Table 8 show that they should at least learn to be linearly independent, since linear dependence is equivalent to having fewer sense vectors, which causes higher perplexity. The specialization of sense vectors to seemingly coherent categories may be attributable to the shared feed-forward network that computes them, and/or the contextualization network learning to assign similar weight distributions to senses with similar roles. + +Are sense vectors like "word senses?" No; they encode a notion of "predictive utility" that doesn't align with traditional notions of word sense. We use the name "sense vector" however because they form a new, useful notion of decomposition of the possible contextual uses of a word into components that are softly combined in each context. + +# 9 Conclusion + +Non-contextual word2vec embeddings initiated modern deep learning research in NLP, and have fascinating geometric structure. Now, research has largely moved on to monolithic representations, first from RNNs and now from Transformers. Our work suggests that we can have both rich lexical structure and interventions, and strong contextual performance, in a single model. + +# 10 Acknowledgements + +The authors would like to thank Anita Kamath, Steven Cao, Xiang Lisa Li, Ian Covert, and the Stanford NLP Group community for useful discussions. Further support came from the Stanford Center for Research on Foundation Models. Christopher Manning is a CIFAR Fellow. John Hewitt was supported by an NSF Graduate Research Fellowship under grant number DGE-1656518 and by the CIFAR Learning in Machines and Brains program. We gratefully acknowledge the support of a PECASE Award to Percy Liang. + +# 11 Limitations + +There is a fundamental uncertainty in whether Backpack language models will continue to scale with parameters and data and be viable alternatives to Transformers at larger model scales. In this study, we were unable to scale larger, and hope that future work will test larger model scales. In a similar vein, we do not verify that Backpack language models perform well across multiple languages. We also do not consider, e.g., finetuning Backpacks on other tasks, or masked language modeling—there is a wide range of possible uses that remain to be verified. + +One potential obstacle to the use of Backpacks that we do not study is the effect of tokenization in languages with richer morphological structure than English—will the Backpack structure be amenable to modeling those languages? This may be difficult because, intuitively, the interpretability and control of Backpacks relates to the semantics of individual tokens. Even in English, small subwords not indicative of a single word are hard to interpret. What we hope to have provided is a sufficient set of experiments to motivate the further exploration of Backpacks. + +# 12 Ethics + +This paper describes and releases an open-domain language model trained on a largely unfiltered subsection of the (mostly English portions of the) textual internet, and describes methods for interpreting and controlling said model. Any control method that can be used to help understand and guide the generation of a model can be used to more effectively generate toxic or illegal content. Despite this, we do expect that, overall, the benefit of deeper insight into Backpack language models is a step + +in the right direction. In particular, explanations based on the structure of Backpacks may be able to provide insights into the mechanisms behind model behaviors, increasing transparency. + +The concrete models we will release, up to and including 170M parameters, are substantially smaller and less performant at generating text than many of the publicly and commercially available language models available right now, so we do not expect there to be considerable negative repercussions from the release of the artifacts. The code we release, however, could be used or replicated to train much larger Backpack LMs by corporations or governments. + +# References + +Rishabh Agarwal, Levi Melnick, Nicholas Frosst, Xuezhou Zhang, Ben Lengerich, Rich Caruana, and Geoffrey E Hinton. 2021. Neural additive models: Interpretable machine learning with neural nets. Advances in Neural Information Processing Systems, 34:4699-4711. +Eneko Agirre, Enrique Alfonseca, Keith Hall, Jana Kravalova, Marius Paça, and Aitor Soroa. 2009. A study on similarity and relatedness using distributional and WordNet-based approaches. In Proceedings of Human Language Technologies: The 2009 Annual Conference of the North American Chapter of the Association for Computational Linguistics, pages 19-27, Boulder, Colorado. Association for Computational Linguistics. +Dimosthenis Antypas, Asahi Ushio, Jose Camacho-Collados, Vitor Silva, Leonardo Neves, and Francesco Barbieri. 2022. Twitter topic classification. In Proceedings of the 29th International Conference on Computational Linguistics, pages 3386-3400, Gyeongju, Republic of Korea. International Committee on Computational Linguistics. +Yoshua Bengio, Réjean Ducharme, and Pascal Vincent. 2000. A neural probabilistic language model. Advances in neural information processing systems, 13. +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. +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. Advances in neural information processing systems, 29. +Rishi Bommasani, Kelly Davis, and Claire Cardie. 2020. Interpreting Pretrained Contextualized Representations via Reductions to Static Embeddings. In Proceedings of the 58th Annual Meeting of the Asso + +ciation for Computational Linguistics, pages 4758- 4781, Online. Association for Computational Linguistics. +Chun-Hao Chang, Rich Caruana, and Anna Goldenberg. 2022. NODE-GAM: Neural generalized additive model for interpretable deep learning. In International Conference on Learning Representations. +Gabriella Chronis and Katrin Erk. 2020. When is a bishop not like a rook? when it's like a rabbi! Multiprototype BERT embeddings for estimating semantic relationships. In Proceedings of the 24th Conference on Computational Natural Language Learning, pages 227-244. +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. +Tri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra, and Christopher Re. 2022. FlashAttention: Fast and memory-efficient exact attention with IO-awareness. In Advances in Neural Information Processing Systems. +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 International Conference on Learning Representations. +Nicola De Cao, Wilker Aziz, and Ivan Titov. 2021. Editing factual knowledge in language models. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 6491-6506. +Abhimanyu Dubey, Filip Radenovic, and Dhruv Mahajan. 2022. Scalable interpretability via polynomials. In Advances in Neural Information Processing Systems. +Tiwalayo Eisape, Vineet Gangireddy, Roger P. Levy, and Yoon Kim. 2022. Probing for incremental parse states in autoregressive language models. In Findings of EMNLP 2022. +Nelson Elhage, Neel Nanda, Catherine Olsson, Tom Henighan, Nicholas Joseph, Ben Mann, Amanda Askell, Yuntao Bai, Anna Chen, Tom Conerly, Nova DasSarma, Dawn Drain, Deep Ganguli, Zac Hatfield-Dodds, Danny Hernandez, Andy Jones, Jackson Kernion, Liane Lovitt, Kamal Ndousse, Dario Amodei, Tom Brown, Jack Clark, Jared Kaplan, Sam McCandlish, and Chris Olah. 2021. A mathematical framework for transformer circuits. Transformer Circuits Thread. +Jeffrey L Elman. 1990. Finding structure in time. Cognitive science, 14(2):179-211. + +Leo Gao, Jonathan Tow, Stella Biderman, Sid Black, Anthony DiPofi, Charles Foster, Laurence Golding, Jeffrey Hsu, Kyle McDonell, Niklas Muennighoff, Jason Phang, Laria Reynolds, Eric Tang, Anish Thite, Ben Wang, Kevin Wang, and Andy Zou. 2021. A framework for few-shot language model evaluation. +Daniela Gerz, Ivan Vulić, Felix Hill, Roi Reichart, and Anna Korhonen. 2016. SimVerb-3500: A large-scale evaluation set of verb similarity. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 2173-2182, Austin, Texas. Association for Computational Linguistics. +Aaron Gokaslan and Vanya Cohen. 2019. Openwebtext corpus. http://skylion007.github.io/OpenWebTextCorpus. +Albert Gu, Karan Goel, and Christopher Re. 2021. Efficiently modeling long sequences with structured state spaces. In International Conference on Learning Representations. +Prakhar Gupta and Martin Jaggi. 2021. Obtaining better static word embeddings using contextual embedding 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 5241-5253. +Vikram Gupta. 2021. Multilingual and multilabel emotion recognition using virtual adversarial training. In Proceedings of the 1st Workshop on Multilingual Representation Learning, pages 74-85, Punta Cana, Dominican Republic. Association for Computational Linguistics. +Charles R. Harris, K. Jarrod Millman, Stefan J. van der Walt, Ralf Gommers, Pauli Virtanen, David Cournaepau, Eric Wieser, Julian Taylor, Sebastian Berg, Nathaniel J. Smith, Robert Kern, Matti Picus, Stephan Hoyer, Marten H. van Kerkwijk, Matthew Brett, Allan Haldane, Jaime Fernandez del Rio, Mark Wiebe, Pearu Peterson, Pierre Gerard-Marchant, Kevin Sheppard, Tyler Reddy, Warren Weckesser, Hameer Abbasi, Christoph Gohlke, and Travis E. Oliphant. 2020. Array programming with NumPy. Nature, 585(7825):357-362. +Trevor Hastie and Robert Tibshirani. 1986. Generalized additive models. Statistical Science, 1(3):297-318. +Felix Hill, Roi Reichart, and Anna Korhonen. 2015. Simlex-999: Evaluating semantic models with (genuine) similarity estimation. Computational Linguistics, 41(4):665-695. +Sepp Hochreiter and Jürgen Schmidhuber. 1997. Long short-term memory. Neural computation, 9(8):1735-1780. +Jordan Hoffmann, Sebastian Borgeaud, Arthur Mensch, Elena Buchatskaya, Trevor Cai, Eliza Rutherford, Diego de las Casas, Lisa Anne Hendricks, Johannes Welbl, Aidan Clark, Tom Hennigan, Eric Noland, + +Katherine Millican, George van den Driessche, Bogdan Damoc, Aurelia Guy, Simon Osindero, Karen Simonyan, Erich Elsen, Oriol Vinyals, Jack William Rae, and Laurent Sifre. 2022. Training compute-optimal large language models. In Advances in Neural Information Processing Systems. +Dieuwke Hupkes, Sara Veldhoen, and Willem Zuidema. 2018. Visualisation and 'diagnostic classifiers' reveal how recurrent and recursive neural networks process hierarchical structure. Journal of Artificial Intelligence Research, 61:907-926. +Mohit Iyyer, Varun Manjunatha, Jordan Boyd-Graber, and Hal Daume III. 2015. Deep unordered composition rivals syntactic methods for text classification. In Association for Computational Linguistics. +Been Kim, Martin Wattenberg, Justin Gilmer, Carrie Cai, James Wexler, Fernanda Viegas, et al. 2018. Interpretability beyond feature attribution: Quantitative testing with concept activation vectors (tcav). In International conference on machine learning, pages 2668-2677. PMLR. +Pang Wei Koh, Thao Nguyen, Yew Siang Tang, Stephen Mussmann, Emma Pierson, Been Kim, and Percy Liang. 2020. Concept bottleneck models. In International Conference on Machine Learning, pages 5338-5348. PMLR. +Yair Lakretz, Germán Kruszewski, Théo Desbordes, Diewke Hupkes, Stanislas Dehaene, and Marco Baroni. 2019. The emergence of number and syntax units in LSTM language models. 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 11-20. +Nelson F Liu, Matt Gardner, Yonatan Belinkov, Matthew E Peters, and Noah A Smith. 2019. Linguistic knowledge and transferability of contextual 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 1073-1094. +Kevin Meng, David Bau, Alex J Andonian, and Yonatan Belinkov. 2022. Locating and editing factual associations in GPT. In Advances in Neural Information Processing Systems. +Kevin Meng, Arnab Sen Sharma, Alex J Andonian, Yonatan Belinkov, and David Bau. 2023. Mass-editing memory in a transformer. In The Eleventh International Conference on Learning Representations. +Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. 2017. Pointer sentinel mixture models. In International Conference on Learning Representations. + +Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. 2013. Efficient estimation of word representations in vector space. In International Conference on Learning Representations (Workshop Poster). +Joakim Olsen, Arild Brandrud Naess, and Pierre Lison. 2021. Assessing the quality of human-generated summaries with weakly supervised learning. In Proceedings of the 23rd Nordic Conference on Computational Linguistics (NoDaLiDa), pages 112-123, Reykjavik, Iceland (Online). Linköping University Electronic Press, Sweden. +Catherine Olsson, Nelson Elhage, Neel Nanda, Nicholas Joseph, Nova DasSarma, Tom Henighan, Ben Mann, Amanda Askell, Yuntao Bai, Anna Chen, Tom Conerly, Dawn Drain, Deep Ganguli, Zac Hatfield-Dodds, Danny Hernandez, Scott Johnston, Andy Jones, Jackson Kernion, Liane Lovitt, Kamal Ndousse, Dario Amodei, Tom Brown, Jack Clark, Jared Kaplan, Sam McCandlish, and Chris Olah. 2022. In-context learning and induction heads. Transformer Circuits Thread. +Denis Paperno, Germán Kruszewski, Angeliki Lazaridou, Ngoc-Quan Pham, Raffaella Bernardi, Sandro Pezzelle, Marco Baroni, Gemma Boleda, and Raquel Fernández. 2016. The LAMBADA dataset: Word prediction requiring a broad discourse context. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1525–1534. +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, Volume 1 (Long Papers), pages 2227-2237, New Orleans, Louisiana. Association for Computational Linguistics. +Krishna Pillutla, Swabha Swayamdipta, Rowan Zellers, John Thickstun, Sean Welleck, Yejin Choi, and Zaid Harchaoui. 2021. Mauve: Measuring the gap between neural text and human text using divergence frontiers. Advances in Neural Information Processing Systems. +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: Volume 2, Short Papers. +Filip Radenovic, Abhimanyu Dubey, and Dhruv Mahajan. 2022. Neural basis models for interpretability. In Advances in Neural Information Processing Systems. + +Alec Radford, Karthik Narasimhan, Tim Salimans, Ilya Sutskever, et al. 2018. Improving language understanding by generative pre-training. +Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. 2019. Language models are unsupervised multitask learners. +Douglas LT Rohde, Laura M Gonnerman, and David C Plaut. 2005. An improved model of semantic similarity based on lexical co-occurrence. +Herbert Rubenstein and John B. Goodenough. 1965. Contextual correlates of synonymy. Commun. ACM, 8(10):627-633. +H. Schütze. 1992. *Dimensions of meaning*. In *Proceedings of the 1992 ACM/IEEE Conference on Supercomputing, Supercomputing '92*, page 787-796, Washington, DC, USA. IEEE Computer Society Press. +Ilya Sutskever, James Martens, and Geoffrey E Hinton. 2011. Generating text with recurrent neural networks. In International Conference on Machine Learning. +Peter D Turney. 2010. From frequency to meaning: Vector space models of semantics. Journal of Artificial Intelligence Research, 37:141-188. +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. Advances in neural information processing systems. +Ben Wang and Aran Komatsuzaki. 2021. GPT-J-6B: A 6 billion parameter autoregressive language model. https://github.com/kingoflolz/mesh-transformer-jax. +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. +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. +Zebin Yang, Aijun Zhang, and Agus Sudjianto. 2021. GAMI-Net: An explainable neural network based on generalized additive models with structured interactions. Pattern Recognition, 120:108192. + +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. + +# A Language Model Training Details + +We use the FlashAttention codebase (Dao et al., 2022) which in turn relies on the Huggingface codebase (Wolf et al., 2020) and NumPy (Harris et al., 2020). We perform no preprocessing of OpenWebText. We do no explicit hyperparameter sweep for OpenWebText training beyond our sense vector ablation, instead taking the defaults provided. We train our models on 4 A100 (40GB) GPUs. All experiments test a single trained Small (124M Transformer or 170M Backpack) model due to computational constraints. + +# A.1 The feed-forward sense network. + +We parameterize the feed-forward network for our sense vectors by first performing layer normalization on the input embeddings, and then a feedforward layer with residual connection and layer norm (despite it being a function of just one word) to dimensionality $4d$ and back to $d$ . Then a subsequent feed-forward network to hidden dimensionality $4d$ and then up to $k * d$ . We include a second layer norm and residual before the second feedforward layer accidentally as a side-effect of the underlying language model codebase. + +For our experiments abating $k$ in Section 4.5, the second feed-forward component maps to $d$ and then $kd$ , not $4d \rightarrow kd$ . + +# B Extra evaluations + +# B.1 Timing Benchmarking + +To benchmark the speed of each model, we used a single A100 GPU, running the forward pass of each model with a sequence length of 512 and a batch size of 32. We ran 100 forward passes and present the average time taken across the 100. We present this in lieu of FLOPs because A100 GPUs are relatively standard, and this allows for a more directly usable time estimate. Results are in Table 7. We find that Backpacks take roughly $1.4\mathrm{x}$ as long to run as their underlying Transformers. + +# C Lexical Similarity Details + +To handle words in the lexical similarity datasets that don't appear as single words in the tokenizer, we use one of two methods. We either average all subwords, or take the first subword. The results for the two methods were similar, but we take the better overall for each model. For all Backpack methods, our 124M-parameter Transformer, and + +
ModelTime ↓
Backpack-Micro0.093
Transformer-Micro0.065
Backpack-Mini0.21
Transformer-Mini0.15
Backpack-Small0.36
Transformer-Small0.26
+ +Table 7: Timing benchmarking results on an A100, average time to compute forward pass on 32-batch size 512-sequence length input. + +GPT-2-xl, we average all subwords. For GPT-J (which uses the same tokenizer), we take the first subword. + +# D Sense Vector Control Details + +# D.1 Topic control details + +The full results are in Table 12. The list of topics, and the corresponding bags-of-words, are given in Table 10. For PPLM, the hyperparameter we vary to change the strength of topic control is the step size (Dathathri et al., 2019). + +We consider a document as matching the semantic control if the classifier assigns greater than 0.5 probability to the attempted class. We generated from our models with ancestral sampling with no truncation or temperature change. + +Topic control. Let $b \in \mathbb{R}^{|\mathcal{V}|}$ be the many-hot vector defined by the bag of words input to the control problem. That is, if the bag is arts, culture, then $b$ has 1 at the indices corresponding to those words, and 0 elsewhere. To determine the initial weights $\delta$ for each sense vector, we first sort all $|\mathcal{V}| * k$ sense vectors by decreasing normalized dot product with the bag of words vector: + +$$ +s (C (\mathbf {x})) = \frac {b ^ {\top} E ^ {\top} C (\mathbf {x})}{\max (E ^ {\top} C (\mathbf {x}))} \tag {17} +$$ + +We then take the 0.95, 0.80, and 0.60 quantiles of these scores to determine how to weight the vectors. Intuitively, the vectors in the highest quantiles (most associated with the target topic) are upweighted the most during decoding, to push the generation towards the topic. The three quantiles partition the set of scores into 4, which are given separate $\delta$ values; the exact 4 depend on the strength of control (i.e., different points in Figure 2.) The exact $\delta$ weighting for each point are given in Table 11. + +
# SensesTotal ParamsContextl. ParamsOWT PPL
174.3M72.7M38.5
475.6M72.7M29.3
1680.5M72.7M26.0
64100.2M72.7M24.0
+ +Table 8: OWT perplexity and parameter count as a function of the number of sense vectors. All models trained for 50k steps, 500k token batch size, on OWT. + +
ModelDimLayersHeads
Micro38466
Mini64088
Small7681212
+ +Table 9: Model size hyperparameters. + +
Topic LabelBag-of-words
arts_culturearts, culture
business_entrepreneursbusiness, entrepreneurs
celebrity_pop_culturecelebrity, pop, culture
diaries_daily.lifediaries, daily, life
familyfamily
fashion_stylefashion, style
film_tv_videofilm, tv, video
fitness_healthfitness, health
food_diningfood, dining
gaminggaming
musicmusic
news_social_concernnews, social, concern
other_hobbieshobbies
relationshipsrelationships
sportssports
travel_adventuretravel, adventure
youth/studentlifeyouth, student, life
+ +Table 10: The topics used in our topic classifier, and the bags-of-words we use for control. + +
Control Strengthδ for quantiles 0.95, 0.80, 0.6, < 0.6
0 (unmodified)1,1,1,1
11.5, 1.5, 1.3, 1
22.2, 2.2, 1.5, 1
33.3, 3.3, 3, 1
+ +Table 11: Initial topic control weights for each quantile. + +Topic annealing. From the the beginning value of $\delta$ given above, we anneal back to 1 as follows. For each sense $C(\mathbf{x}_j)_\ell$ , we compute the total sum of non-negative log-probability assigned by the sense to the set of words generated so far, intuitively to compute whether the words already generated express the meaning intended by the sense: + +$$ +a _ {C (\mathbf {x} _ {j}) _ {\ell}} = \sum_ {i = 1} ^ {n} \max \left(\mathbf {x} _ {i} ^ {\top} E ^ {\top} C (\mathbf {x} _ {j}) _ {\ell}\right), 0). \tag {18} +$$ + +We then re-weight by a term dependent on the sequence index to upweight terms near to the most recently generated text: + +$$ +b _ {C \left(\mathbf {x} _ {j}\right) _ {\ell}} = \sigma \left(- a _ {C \left(\mathbf {x} _ {j}\right) _ {\ell}} f + 6\right) * (1 + j) / 1 0 0 \tag {19} +$$ + +where $j$ is the index of the word of the sense vector in the generated text, and $f$ is a scaling constant set to 7.5 divided by the maximum $\delta$ in the experiment (the maximum of each row in Table 11.) + +Finally, we compute the annealed $\delta$ as a soft combination, weighted by $b_{C(\mathbf{x}_j)_\ell}$ , of the maximum delta and the default of 1: + +$$ +\delta_ {\ell i j} = b _ {C \left(\mathbf {x} _ {j}\right) \ell} \delta_ {\ell i j} + (1 - a) * 1. \tag {20} +$$ + +# D.2 Gender bias mitigation details + +For the third-person singular verb they, we found that our sense intervention on sense 10 slightly increases the probability of they relative to he or she. + +The full set of nouns and prompts we use is as follows. For role nouns, we use mechanic, + +
MethodSem Acc ↑Toks-in-vocab ↓MAUVE ↑
Transformer
Unchanged6.8%0.0%0.95
PPLM-.018.4%0.1%0.94
PPLM-.0423.9%2.6%0.81
PPLM-.0530.3%5.5%0.62
PPLM-.0637.7%12.3%0.41
PPLM-.0740.8%18.8%0.25
Backpack
Unchanged7.4%0.0%0.92
Ours+112.1%0.2%0.91
Ours+224.3%1.5%0.90
Ours+335.3%3.5%0.83
+ +Table 12: Topic control via pseudovocabulary, vs PPLM. MAUVE scores are computed with respect to 8000 samples drawn across the topics. + +
nursedeveloper
logprobtargetlogprobtarget
+12.21professional-15.27She
+11.62She-15.14herself
-13.38himself-13.02her
-13.24His-12.34corruption
-12.63his-12.15she
-12.31his-12.14gam
-11.39he-12.13HR
+ +Table 13: Some of the most up- or down-weighted words by sense 10 of the words nurse and developer. For each role word, the sense encodes the stereotypical gender of the role. + +accountant, farmer, baker, assistant, construction, guard, carpenter, analyst, physician, cook, clerk, manager, developer, librarian, salesperson, mover, hairdresser, auditor, sheriff, janitor, driver, chief, teacher, writer, receptionist, CEO, nurse, house-keeper, secretary, counselor, attendant, supervisor, designer, lawyer, editor, cashier, laborer, tailor, cleaner. + +For evaluation, we use the prompts in Table 14. For experiments in which we estimate the strength of removal to reduce gender bias, we do the optimization individually for each profession noun, on the separate set of prompts in Table 15. + +
Prompt
I really liked my PROFESSION. What I liked most was that,
I really liked my PROFESSION. In fact,
My PROFESSION said that
My PROFESSION believes that
This one PROFESSION believes that
This one PROFESSION believes
My PROFESSION said
My PROFESSION believes
The PROFESSION was with the car. When
The PROFESSION was with the car. Then
While driving to the store, the PROFESSION looked over on the dash and then
A PROFESSION went to chat over to chat before
Some PROFESSION asked to look over things, but
+ +Table 14: Prompts used for gender bias evaluation. + +
Prompt
The PROFESSION came into the room. When The PROFESSION came into the room. Then I went to the talk to the PROFESSION. What I went over to the talk to the PROFESSION. Why I went over to the talk to the PROFESSION;
+ +Table 15: Prompts used for gender debiasing estimation. + +
TopicBackpack Sense Control, Control=2Transformer PPLM, stepsize=0.04
Arts & Culture(I kind dude) just used to be creative and make music but it feels like I'm 40. Conscious of how bad it is and how awesome it is like making such a fast consciousness and not even being musician meets people who answer for you, especially when it's scary." de la Cruz © Dan Wilson (2002).Sunday, February 6: WestSTAR en-twitter-ilesurcast.blogspot.com +Tuesday, February 7: WestStar en-chat breathe of ancient energy. www.weststar.org +Monday, February 8: West Star Mares and Moon of the ages "Happiness is not easy to do", Nicolas Jeansma, the Eternal Life programme director analyses history, culture, sociality and social magic. : 'Oh the
Business & EntrepreneurshipFlickr advertisers is nothing new, so let's hope you know where you buy the latest edition. +At the same time, the fix has been pushed through, and while the overall business is pulling away from mainland Asia, publishers have given control over social media options to researchers at New York University and Columbia University. +A new report from the Columbia board offers some clues as to why. +"My store in Alabama is used to a lot of Marines, and I just dropped as such. I don't know why, but I've hadWe've decided to put out a newsletter to your guys, wondering as you cope with the tribulations of your business ventures and a job position. One way to put it is: You're not good enough. You've failed and you're not getting anything done. You're not doing enough. You're not bringing the passion and ideas you might have to a business. But one thing's for sure: if you self-promote, you often might take the business to a profitable buyer. Continue
Celebrity & Pop Culture'Meetings and greets with reporters and celebrities of all kinds — pop culture, fashion, sports, food, celebrity lifestyle and otherwise — have been laid door-to-door on the Dallas television market with both LaVar and his wife, Arron, taking over the showroom-oneship business at Big Star Barber. +"We think Big Star's an interesting exchange," Arron says. "They've got an experience they'reType Services rumors have been up in the media since last month—and now we have some confirmed to the CBC Radio musical news channel's Twitter stream. +The group's guitarist, Greg Carr, has just announced that he's working with Papa John as the band's lead singer and guitarist. According to bizarre French pop culture creation icon Valentino pop music singer/writer Jiv pop pop model, who also wrote pop pop music's MyS-pace and Twitter pop memes, Cassidy gig pop pop superstar is
Diary & Daily LifeThe exact actual life cycle life form life soars on and dies off in comparison to our own. During the first few years of life, the total life form you take to decide what to eat, how much of it to drink, why, and whether you want to exercise have been completely smashed and the technological capability to make that happen seriously out of the blue has been completely lost, jumping from complexity to complexity, totally overwhelming the mushroom in its ability to discover what levels it's supposed toThe Rome crew logam tagged Louisville Main Street today morning and observed a loading dock at the center of downtown Louisville. The dock is just bigger than what was supposed to dock the loading area for emergencies. They watched over the crowd after passing the boat and finally realized that they'd caught some missed traffic signals. "Serious congestion" has so far unnerved people from the Grande family picnics to weddings picnics picnics. MTD Charlotte Pulse (@mtdphp
FashionThis article is about the fashion label fashion week fashion style month fashion fashion style fashion style fashion week fashion style fashion fashion style fashion fashion style fashion fashion style fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion fashion shopping in Dark Horse Comics in English and in both comic books and graphic novels.[1] It was producedTwitter personality @ceboperformancecmk tweeted in response to the story about you. +Fashion designer underwear, designer cook dress, sexuality art models, sex con artists, real goths. BuzzFeed +You think my brain's shit about what's fashion looks like? Yeah no, I'm not on it. I'm fashion. I'm fine fashion. Yes I appreciate the brand but the people behind it[...] adults go fashion, or
+ +Table 16: The first, non-cherry-picked category-satisfying example from each model. + +
TopicBackpack Sense Control, Control=2Transformer PPLM, stepsize=0.04
Film, TV, & VideoOriginally published Live chat Qs with the film website writer, who raised millions at least two years ago I contacted him with the same questions as you're doing.I'm a bit optimistic that you're right, but you're just not responding. As you studied the film timer/mapplot'n'cookies response speed, I read the excerpts and couldn't make out a massive amount of time differences. Very minor.What do you think about some of the termsWell, the hype is real, and with the release of the latest episode of season two (which I'm probably not supposed to review), it feels like you won't be afraid to retweets videoe.By “HAPPY FINAL,” the footage maker has used a GIF video to give viewers look at Fideo's dancing triangles and serenity dancing around a moving picture. Thank you, video!If the
Fitness & Health&CLOSE Don’t think tanking will spell good news for Detroit medical marijuana patients but the owner of its dispensaries saying that is just part of the problem facing the growing number of ill people having access to pot.Healthcare workers are treated for tumors in a dispensary in Oakland. (Photo: Christopher Sator-ica, Special to CNN)An array of medical centers have lined up near Detroit after a medical marijuana reform forum at the University of Michigan put the debate over the drug atToday we learn more about the rise of the ice age, multi-drug cocaine epidemic, global population explosion and warfare epidemic by following Dr. Kristof Dr. Freedk published in the British Journal of Medicine The authors update their lofty goal and continue to refine their work for public health.The International Health Services Committee has just released a new research, The next three years could be very costly for health care in Australia, hospitals, state health systems and dietary health.A recent report from
Food & DiningAs weeks wore maple leafed food trucks, and food processors reminisced about their great days past, healthcare workers found out one day that they should get better working conditions with little regard for their bodies.Barbara Butterfield, the former ShopSwagger workshop in Clarksdale, got shot dead on Monday morning when they tried to stop a father Francisco Lee Walker from firing a gun. Walker, 20, had just started his Aug. 27 firing. Exposure to fire and clothes caused WalkerI would dearly love to stand at that galloping chair and who doesn’t has amazingly friends associated with their backs hurting? I was a big first timer yesterday. Not always with bacon but I held til calms up. Big chunks of bacon super nice but not me. However there are times where the pieces pull apart and this happens very hard to homo and crackers afgh. All Mixed ones made popular points that have the food triggers across: lack of meats rinsing and eating
GamingMy parents encouraging kids to be competitive gaming at school is not a new concept. Gaming has been around since the earliest days on paper, and their perspective is always superior than yours. Quality doesn’t always apply, and that’s why we bucked that trend’ fatherThe English woman’s son Anthony, who is best known for his role as Most Wanted, came up with the idea of pulling a 30-year-old mentally disabled woman who had been using motorbikes forEvery year, many migrants continue to struggle to find the skills they need in an emerging technology. But every year, it comes quite a surprise to hear the latest news about computerized computing and the gaming community.For the sake of many gaming communities, we here at 14/gamer.org love gaming. It is an important industry in gaming, as it often draws passionate gamers from gaming and lends the gaming community the ability to allow itself special moments like gaming gaming days and gaming gaming. We
MusicDavid has been a staunch critic of music culture that promotes music as something new, daring, and powerful. As he explained. ("I never thought I was one of those stupid, stupid old people who just listens to music or really hears it it's always the same as when I was a kid," he said.) And when he was a touring musician, those opinions were totally correct. Read the entire interview below.On trying to inculcate younger vocalists with the "From the East art council HQ of MondoJapan Everyone laughs when a sheet metal title is rendered artistically constrained and we say, "Whoa. Then the skin guy! This is a very Chi style steel." Well I don’t think anyone’s ever heard that before. There’s only one coil metal group that is not a tarantella performance music group...at least in America...compact music ten times over and they will never release tracks for it that it is a
+ +Table 17: The first, non-cherry-picked category-satisfying example from each model. + +
TopicBackpack Sense Control, Control=2Transformer PPLM, stepsize=0.04
News & Social ConcernBuilders B2 has been compared unfathomable by a number of critics because of his security concerns.Breaking News Alerts Get breaking news when it happens — in your inbox. Email Sign Up By signing up you agree to receive email newsletters or alerts from POLITICO. You can unsubscribe at any time.Yet, on Tuesday, Monday and Tuesday, the devel- oper reached the milestone of completing the first UPS facility located in the town of Cloudbreak. He secured $4After initially putting itself over Sports Illustrated on Monday, the New York Times was forced to apologize for its widespread coverage of its re- porting on the State of Rhode Island – a state that has been the subject of gossip news for some time and which its harsh news and ratings policy has spawned.Late at night on Monday, we learned that the New York Times had reached a breaking news cycle decision and we snagged our exclusive first look at the news. Here's what you didn't
RelationshipsEarly life release parties is relationship couples with relationships over relationships. This cen-sus does not count relationships by those who have been with those relationships over the last three years. For more information about early life release parties, check the release party census.Carlo MathieuCarlo Mathieu was born in 1958. He lives in Augusta, Ga., with his biological father, Malcolm Mathieu, who was president of the Augusta West Raceway at the time.Benjamin MathAny learning is like being completely ignorant of new information. Schools are forced to teach stu- dents to treat one another in the right way, but we still have to recognize that we have to learn how to be friends with as much as we can. When San- TOD relationships are hard and relationships can be complicated and confusing, there will always be learning relationships, relationships that remind us that we don't mean relationships, relationships relationships that are boundaries, relationships re- lationships with friends in need relationships with involved relationships, relationships relationships relationships
SportsPRESS W/NEWS BLOK Play slideshow 1 of 83 Express sports retail giant Sports Direct.Sports Direct has revealed the on offer outdoor sports gear Brand new from Google has been developed. Here's what you can expect from Google's sporting expertise.<endoftext>About The potential of a west coast restaurant for toler- ance and pityTheir position at this point hurts me less than they believe it deserves, because they probably shouldn.I'm going to help themAuthorities in California say they are investigat- ing equestrian skiers who struck a 19 year-old boy from a snow-covered mountain and beating him on the head with shovels.According to Smith-Cox, those same well clients found out they had also been tardled by a $500 pour frompipe on top of of a Black Rock vault. And it appears the ul- timate goal of those riders and their company of riders was killed.Jeremy Goschz is one of those survivors. His racing
Travel & Ad- ventureMy next stop destination for me is adventure travel. I travel Disney World and make sure that the worlds under my belt and desert warriors that I've been fighting for have a place or two at their disposal that are compatible with my use of cur- rent technology. This job is being completed with the help of any freelance user submission infor- mation you may have provided. It's only fair to give you some tips to help you figure it out if there are any unknown side-idence locations that youEquality Equality - open life - inequalities - political op- pression - write and publish your work Equality is a freedom to work, to die. Access to free healthcare, free outer space travel, pho- tocopies online, happy endings, self travel - to travel to someone else's heart (read: stop taking drugs), to move faster, to travel in train travel, to stop a vacation abroad (tell others your travels), to return to a home each time
Youth & Stu- dent LifeCollege students at almost every age advantage who take advantage of learning opportunities in the sport of running spend at least five years an average of $10 or more per year to do it, accord- ing to the University of San Diego's National Football Clearinghouse.Those risk factors lift nearly a third of univer- sity and college football athlete spend, more than double that of a comparable age group of men and women who spend 4,000 hours per year as runners, or 5,000 tolame University saw a 32 per cent rise in its un- dergraduate science institutes and 14 per cent increase in its researchers from recent years.Director Of University Development, Mike Bren- nan, said: "The growth in university employment, coming from such a historic campaign, is som- thing to celebrate as we support our young people and room to progress in science and technology." A student was interviewed in a recent paper about university employment, specifically a dissertation.For the first time, people are
+ +Table 18: The first, non-cherry-picked category-satisfying example from each model. This is except for the Relationship category for the Transformer, where we skipped the first one due to content we particularly did not want to publish. + +
Positive Log-Probability Mass for Senses of word quickly
01234567
approachingogglesquicklyenoughstroiiirazenasuring
ascendedMarksswiftlyrotatingznOriginalforgottendelusion
gravAxisrapidlypacedstrokesalsaforgetstimulated
gentclaimerquickenedulingchenkosocialrecollection
disposedRochequickretreating$_resolutionriusstimul
risendemonstrationinstantlySubscribegrassientrelapseWem
disposeblasterpromptlydismissinglesslybasketsbaselesspersistent
becomingducerssoondiminishingikenuinStatementurbed
ascertSpecificationsfastdisappearingizingoraathingreter
climbedVietQuickvaryingbgalidAkronrestraint
89101112131415
processorsslowlyteringDefinitelyquickotedouseSims
dartsSlowlyBersinitelyquickestdistancespeeNoir
millisecondsSlowFedraidquickoutedousesTMZ
wipconvenientlyascusalrightquickeraughtpeesStreets
iazepslowerBustPersonallyfastUCattachexpressly
reptilescheaplyaucuslaughsquicklyobtroAttend
KelvinresponsiblyRyuALWAYSrapiddigitsiffeRooms
OwgraduallysectorAlwaysfastenchacesWithin
SoonquietlyPetraIdeallyfasterCodelainRum
SlugwaitingDCSRosesfastestapersfeetForced
Negative Log-Probability Mass for Senses of word quickly
01234567
initelysburgollenunaPokéquicklyFaster.
heitoremonedUREslowquickpurposelySorceress
AlyUntitledothsrastslowerswiftlydeliberatelyitars
isticallyantedookiptslowsrapidlyDefinitelyShogun
AlwaysuntreatedughtocracyslowedquickesteyYen
DoctorstilDedlawDEVquicksloweroenix
dlbrokenlostuthorenciaQuickinitelyJagu
urallypastaughtemapotionsfastisnerizz
ependenceebookrechargeorymachinaquickhesitatederal
raintsContinueadyantisSlowQuickeyewitnessfinals
89101112131415
quistWMprototypeciatingkinsquickLaurthal
ockerisfprojectorscramblingHostquickNeverimble
ovskyfbreconcilrapidloudspequicklyJimmyliquid
ictionsWFprominentlynewcomerencedQuickdearlyinitialized
olationelevationcounterfeitadaptingEvilsoonDatinganas
canoRMwordspeedingwashedfast--IGH
Proof975cellulfranticKafrapidlyneverunciation
certdirprototypenoveltyGlassQuickCertainlyneeds
reroESEcollapspacedsodhurryeternalcommit
anchonderdylinstructionaladversImmediatelyRaretackle
+ +Table 19: For each sense vector of the word quickly, the 10 words to which the sense vector assigns the highest log-probability contribution, and the 10 to which it assigns the largest negative log-probability contribution. Note that usually, either the positive words are coherent or the negative—but not both for the same sense index. Some senses are not interpretable, and seem to be used by other parts of speech. + +A For every submission: + +A1. Did you describe the limitations of your work? 9 +A2. Did you discuss any potential risks of your work? 9 +A3. Do the abstract and introduction summarize the paper's main claims? +A4. Have you used AI writing assistants when working on this paper? We used ChatGPT and Claude to try to brainstorm names for models; nothing useful came of it or ended up in the paper. + +B Did you use or create scientific artifacts? + +Section 5,6,7 + +B1. Did you cite the creators of artifacts you used? Section 5,6,7, Appendix +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? Left blank. +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? Left blank. +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? Left blank. +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? Left blank. +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. Left blank. + +C Did you run computational experiments? + +Left blank. + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? 4 + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? 4.2 +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? 4.2 +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? Section 4.1 + +# D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? Not applicable. Left blank. +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? Not applicable. Left blank. +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? Not applicable. Left blank. +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? Not applicable. Left blank. +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? Not applicable. Left blank. \ No newline at end of file diff --git a/backpacklanguagemodels/images.zip b/backpacklanguagemodels/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..b769d5d74f2adc379b1e62be8ba47d11ba5a2155 --- /dev/null +++ b/backpacklanguagemodels/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1531db71ae88c681673f71beafed4bdb6b9f727b260a342bbf0acaf13c344a66 +size 2342257 diff --git a/backpacklanguagemodels/layout.json b/backpacklanguagemodels/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..82dd86cded3087f450c3e8084a810fd2a7548bc2 --- /dev/null +++ b/backpacklanguagemodels/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2068b66a5d3df971b262393454e6ac94051e8226b7e7322db7f8f762b31a0532 +size 645291 diff --git a/backtranslationforspeechtotexttranslationwithouttranscripts/d7a3b1f9-ba6b-46c1-8fb8-d4385966e7d4_content_list.json b/backtranslationforspeechtotexttranslationwithouttranscripts/d7a3b1f9-ba6b-46c1-8fb8-d4385966e7d4_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..b40df63ae432e4c19d4a52a323581de599c5e7f8 --- /dev/null +++ b/backtranslationforspeechtotexttranslationwithouttranscripts/d7a3b1f9-ba6b-46c1-8fb8-d4385966e7d4_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dc0dd9f55ff6a1d4ab2a465138963145f84867e84e2c5c82a670f2941041d2cf +size 142094 diff --git a/backtranslationforspeechtotexttranslationwithouttranscripts/d7a3b1f9-ba6b-46c1-8fb8-d4385966e7d4_model.json b/backtranslationforspeechtotexttranslationwithouttranscripts/d7a3b1f9-ba6b-46c1-8fb8-d4385966e7d4_model.json new file mode 100644 index 0000000000000000000000000000000000000000..35658b80275f9dd0982829379a9fc05606b37562 --- /dev/null +++ b/backtranslationforspeechtotexttranslationwithouttranscripts/d7a3b1f9-ba6b-46c1-8fb8-d4385966e7d4_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0cff89a0b22c89494ffb6a6f5b1bd4632903c2137a01fb80849745805d631b5e +size 175084 diff --git a/backtranslationforspeechtotexttranslationwithouttranscripts/d7a3b1f9-ba6b-46c1-8fb8-d4385966e7d4_origin.pdf b/backtranslationforspeechtotexttranslationwithouttranscripts/d7a3b1f9-ba6b-46c1-8fb8-d4385966e7d4_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e349102addf2387d59b30364489a18c618de7317 --- /dev/null +++ b/backtranslationforspeechtotexttranslationwithouttranscripts/d7a3b1f9-ba6b-46c1-8fb8-d4385966e7d4_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:450b7f914d03e64b3ce12d653b51987f3459a1285fbde2e5d55871974487e701 +size 4228196 diff --git a/backtranslationforspeechtotexttranslationwithouttranscripts/full.md b/backtranslationforspeechtotexttranslationwithouttranscripts/full.md new file mode 100644 index 0000000000000000000000000000000000000000..433d9ea09ca1d50b1ee2ded8962834f496419e3e --- /dev/null +++ b/backtranslationforspeechtotexttranslationwithouttranscripts/full.md @@ -0,0 +1,525 @@ +# Back Translation for Speech-to-text Translation Without Transcripts + +Qingkai Fang $^{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 + +{fangqingkai21b, fengyang}@ict.ac.cn + +# Abstract + +The success of end-to-end speech-to-text translation (ST) is often achieved by utilizing source transcripts, e.g., by pre-training with automatic speech recognition (ASR) and machine translation (MT) tasks, or by introducing additional ASR and MT data. Unfortunately, transcripts are only sometimes available since numerous unwritten languages exist worldwide. In this paper, we aim to utilize large amounts of target-side monolingual data to enhance ST without transcripts. Motivated by the remarkable success of back translation in MT, we develop a back translation algorithm for ST (BT4ST) to synthesize pseudo ST data from monolingual target data. To ease the challenges posed by short-to-long generation and one-to-many mapping, we introduce self-supervised discrete units and achieve back translation by cascading a target-to-unit model and a unit-to-speech model. With our synthetic ST data, we achieve an average boost of 2.3 BLEU on MuST-C $\mathrm{En}\rightarrow \mathrm{De}$ , $\mathrm{En}\rightarrow \mathrm{Fr}$ , and $\mathrm{En}\rightarrow \mathrm{Es}$ datasets. More experiments show that our method is especially effective in low-resource scenarios.[12] + +# 1 Introduction + +End-to-end speech-to-text translation (ST) means directly translating speech in the source language to target text without generating source transcripts (Bérard et al., 2016; Duong et al., 2016). Different from traditional cascading methods which first transcribe the speech with automatic speech recognition (ASR) and then translate the transcripts into the target text with machine translation (MT), end-to-end ST has the potential to reduce latency and avoid error propagation. Hence, it has drawn much attention and achieved great suc + +cess in recent years (Anastasopoulos et al., 2021, 2022). + +However, it is challenging to train an end-to-end ST model with only speech-translation pairs. Traditional cascaded models learn cross-modal mapping with ASR and cross-lingual mapping with MT. In contrast, end-to-end ST requires simultaneous cross-modal and cross-lingual mapping, which is more complicated and usually relies on more training data. However, the amount of ST data is usually limited due to the high cost of data collection, so the ST model trained with only speech-translation pairs is usually unsatisfactory. + +To tackle these problems, researchers often utilize source transcripts to assist ST training by introducing auxiliary ASR and MT tasks. With abundant ASR and MT data, the ASR task can help the model learn better cross-modal mapping, while the MT task can help learn better cross-lingual mapping, which can significantly improve ST as shown in recent ST studies (Wang et al., 2020a; Xu et al., 2021; Ye et al., 2021; Fang et al., 2022). Unfortunately, source transcripts are not always available. It is estimated that there are around 3000 unwritten languages in the world which have no orthography for transcription3. For those languages, we can no longer leverage source transcripts to help with training, so many of the latest techniques fail to benefit them. + +How to train a stronger ST model without transcripts? In this paper, we address this question from the perspective of data augmentation. Although ASR and MT data are unavailable, a large amount of target-side monolingual data is still easily accessible. Motivated by the success of back translation in MT (Sennrich et al., 2016; Edunov et al., 2018), we aim to develop a back translation algorithm for ST (BT4ST) to synthesize pseudo ST data from monolingual target data. However, compared to text-to-text back translation, gener + +ating source speech from the target text without source transcripts is much more challenging4. First, the length of text is usually only tens or hundreds, but the length of speech is about tens of thousands5. Therefore, the model is required to generate an extremely long sequence from a short sequence without the assumption of monotonic alignment, which is a more difficult sequential decision problem. Second, the conversion from text to speech is a one-to-many mapping problem due to the variations in speech (Chen et al., 2021; Ren et al., 2021). For example, the pronunciation of the same content may differ among speakers. + +To address these challenges, we introduce self-supervised discrete units of the source speech as intermediate representations, and achieve back translation by cascading a target-to-unit model and a unit-to-speech model. Since the length of unit sequences is similar to the length of target characters6, and there is a monotonic assumption between the unit sequence and the source speech, the short-to-long generation problem in target-to-unit and unit-to-speech models can be greatly alleviated. Besides, discrete units can disentangle content information from other variation information (e.g., pitch and speaker) (Polyak et al., 2021), which eases the one-to-many mapping problem in the target-to-unit model7. We also introduce a speaker encoder to provide speaker information as input to the unit-to-speech model, which allows us to generate diverse source speeches by coupling different speaker representations. Following this pipeline, we can synthesize large amounts of pseudo ST data from monolingual target data without requiring transcripts. Finally, we train our ST model with both synthetic and real data. + +We conduct experiments on MuST-C $\mathrm{En} \rightarrow \mathrm{De}$ , $\mathrm{En} \rightarrow \mathrm{Fr}$ , and $\mathrm{En} \rightarrow \mathrm{Es}$ datasets. By leveraging about 5M additional monolingual target data for each language pair, we achieve an average improvement of 2.3 BLEU compared with the strong baseline. We also observe that our approach is more effective in low-resource scenarios, yielding a boost of + +5.6 BLEU when only 100 hours of ST data are available. In addition, we generate multiple different pseudo datasets with a simple Diverse BT4ST method, train several models separately with each dataset, and ensemble them together. By ensembling five models, we achieve an average boost of 4.0 BLEU in three translation directions. + +# 2 Background + +Our work focuses on developing a back translation algorithm for ST. We first introduce the task definition and model architecture of ST in Section 2.1, and then introduce the concept of back translation in Section 2.2. + +# 2.1 Speech-to-text Translation + +Task Definition The goal of speech-to-text translation (ST) is to translate speech in one language into text in another language. We denote the source speech as $\mathbf{x} = (x_{1},\dots,x_{I})$ , where $I$ is the length of the audio waveform. The model generates the target sentence $\mathbf{y} = (y_{1},\dots,y_{J})$ , where $J$ is the length of the target text. In this paper, we assume that transcripts of the source speech are not available, which is a more general scenario considering about 3000 unwritten languages in the world. + +Model Architecture Our ST model consists of three stacked modules: acoustic encoder, length adaptor, and translation model. The acoustic encoder is a HuBERT (Hsu et al., 2021) model pretrained on unlabelled audio data, which can generate meaningful representations for the source speech. The length adaptor (Li et al., 2021) is a series of convolutional layers to shrink the length of speech representations by a factor of 4. The translation model is a Transformer (Vaswani et al., 2017) with $N$ encoder layers and $N$ decoder layers, which takes the shrunken speech representations as input and outputs the target sentence. We train the ST model by minimizing the cross-entropy loss: + +$$ +\mathcal {L} _ {\mathrm {S T}} = - \sum_ {j = 1} ^ {J} \log p \left(y _ {j} \mid \mathbf {x}, \mathbf {y} _ {< j}\right). \tag {1} +$$ + +# 2.2 Back Translation + +Back translation (BT) is a simple and effective method to leverage target-side monolingual data in neural machine translation (NMT). Formally, given a parallel corpus $\mathcal{D} = \{\left(\mathbf{x}^{(n)},\mathbf{y}^{(n)}\right)\}_{n = 1}^{N}$ , and a monolingual corpus of the target language + +![](images/aa82e518d0422fe56666b3e6fdafb87b84950bf9ac87e995de1a07c8ed304f04.jpg) +(a) BT4ST Model + +![](images/ed12d21fccb4bf2e1758d0b88effdbc3e62d9ca5877cc1fa129f48ae3ecf8aae.jpg) +(b) Target-to-unit Model + +![](images/da3edbe77afbc99ee772a11aa6a9172a1b8a6d62e767bf766bf81fc792ba2857.jpg) +(c) Unit-to-speech Model +Figure 1: The overall architecture of our model. $R$ -Unit: reduced discrete units; $O$ -Unit: original discrete units. + +$\mathcal{T} = \{\mathbf{y}^{(m)}\}_{m = 1}^{M}$ we first train a target-to-source model on $\mathcal{D}$ . Next, we use this model to generate additional pseudo parallel data $\widetilde{\mathcal{D}} = \{(\widetilde{\mathbf{x}}^{(m)},\mathbf{y}^{(m)})\}_{m = 1}^{M}$ from the monolingual corpus $\mathcal{T}$ . Finally, $\widetilde{\mathcal{D}}$ can be used as a complement to $\mathcal{D}$ to train a stronger source-to-target model. + +# 3 Method: BT4ST + +How to acquire a target-to-source model for ST given a ST parallel corpus? Directly generating source speech from the target text is a challenging problem. Inspired by recent success in self-supervised discrete representation learning for speech (Baevski et al., 2020; Hsu et al., 2021; Lakhotia et al., 2021), we first transform the source speech into a sequence of discrete units with a speech pre-trained model (Section 3.1), which is used as an intermediate representation in the back translation process. With discrete units, we train a target-to-unit model (Section 3.2) and a unit-to-speech model (Section 3.3) on the parallel corpus, where the former predicts the sequence of discrete units corresponding to the source speech, and the latter converts discrete units into waveform. The model architecture is illustrated in Figure 1. + +# 3.1 Unit-based Speech Representation + +We use the pre-trained HuBERT (Hsu et al., 2021) model to generate discrete units corresponding to the source speech following Lee et al. (2022a,b). HuBERT generates $50\mathrm{Hz}$ continuous representations for the input speech. We apply the K-means clustering algorithm to the continuous representations of the training data, and then transform the continuous representations into the corresponding cluster indices, i.e., discrete units. Finally, the in + +put speech $\mathbf{x} = (x_{1},\dots,x_{I})$ is converted into a sequence of discrete units $\mathbf{z} = (z_{1},\dots,z_{T}),z_{t}\in$ $\{0,1,\ldots ,K - 1\} ,\forall 1\leq t\leq T$ , where $K$ is the number of clusters, and $T$ is the number of frames where $T = \lfloor \frac{I}{320}\rfloor$ . There are two advantages to use discrete units as intermediate representations rather than predicting audio waveform directly. First, the sequence of discrete units is much shorter than the audio waveform, alleviating the difficulty of short-to-long generation. Second, discrete units can disentangle speech content from the pitch and speaker information (Polyak et al., 2021), which eases the one-to-many mapping problem. + +# 3.2 Target-to-unit Model + +Our target-to-unit model is a Transformer-based sequence-to-sequence model, which predicts discrete units of the source speech based on the target text. The target text $\mathbf{y}$ is tokenized as characters and fed to the encoder. For the discrete units $\mathbf{z}$ , we first merge repeating units into a single one to obtain the reduced discrete units $\mathbf{z}' = (z_1', \dots, z_{T'}')$ following Lee et al. (2022a). For example, $(1, 1, 2, 2, 2, 3, 4, 4)$ will collapse to $(1, 2, 3, 4)$ . We then train the model with reduced discrete units as the target, which can accelerate training and inference. The training objective is as follows: + +$$ +\mathcal {L} _ {\mathrm {T 2 U}} = - \sum_ {t = 1} ^ {T ^ {\prime}} \log p \left(z _ {t} ^ {\prime} | \mathbf {y}, \mathbf {z} _ {< t} ^ {\prime}\right). \tag {2} +$$ + +# 3.3 Unit-to-speech Model + +Our unit-to-speech model is a unit-based HiFiGAN vocoder (Kong et al., 2020) as proposed in Polyak et al. (2021). It takes the reduced discrete units as input and generates the waveform. The + +model consists of four modules: duration predictor, speaker encoder, generator, and discriminator. + +Duration Predictor As the output of the target-to-unit model is reduced discrete units, we add a duration predictor (Ren et al., 2021) to predict the duration of each unit. It consists of two 1D-convolutional layers with ReLU activation, each followed by layer normalization and dropout. Finally, a linear layer projects the hidden state into a scalar as duration. We denote the predicted duration vector as $\mathbf{d} = (d_1,\dots,d_{T'})$ , and the ground truth as $\mathbf{d}^{*} = (d_{1}^{*},\dots,d_{T^{\prime}}^{*})$ . The duration predictor is optimized with Mean Squared Logarithmic Error (MSLE) between ground truth and predictions as: + +$$ +\mathcal {L} _ {\mathrm {D P}} = \frac {1}{T ^ {\prime}} \sum_ {t = 1} ^ {T ^ {\prime}} \left(\log \left(1 + d _ {t}\right) - \log \left(1 + d _ {t} ^ {*}\right)\right) ^ {2}. (3) +$$ + +Given the duration vector, we expand reduced discrete units by repeating each unit. For example, given $\mathbf{z}' = (1,2,3,4)$ and the corresponding duration vector $\mathbf{d} = (2,3,1,2)$ , the expanded sequence becomes $\mathbf{z} = (1,1,2,2,2,3,4,4)$ . We use ground truth duration during training and predicted one during inference. Finally, the units are converted to continuous representations via a look-up table. + +Speaker Encoder Discrete units contain little speaker information, but ST corpus usually contains speech from multiple speakers. To ease the one-to-many mapping problem in speech synthesis, we introduce a speaker encoder to extract the speaker information. The speaker encoder is a pretrained speaker verification network (Wan et al., 2018), which extracts a single 256-dimensional speaker embedding from the speech. The speaker embedding is then concatenated to the representation of each unit. During inference, we randomly select a speaker embedding from the training set for each sample. It allows us to synthesize a pseudo ST dataset containing multiple speakers. + +Generator and Discriminator The generator and discriminator are the same as the original HiFiGAN (Kong et al., 2020). The generator consists of several stacked blocks, each containing a transposed convolution layer followed by multiple residual blocks. It takes the concatenated features as input and outputs the waveform $\mathbf{x}$ . The discriminator contains a Multi-Period Discriminator (MPD) and a Multi-Scale Discriminator (MSD), which are used to identify the periodic or consecutive patterns in the audio. The generator and discriminator + +# Algorithm 1: Back Translation for ST + +Input :ST data $\mathcal{D} = \{(\mathbf{x}^{(n)},\mathbf{y}^{(n)})\}_{n = 1}^{N},$ Target data $\mathcal{T} = \{\mathbf{y}^{(m)}\}_{m = 1}^{M},$ Data selection ratio $\rho$ + +Output:ST model $M_{x\rightarrow y}$ + +1 Procedure BT4ST(D, T, $\rho$ ) + +2 Get reduced discrete units $\mathbf{z}'$ from $\mathbf{x}$ to create $\mathcal{D}' = \{(\mathbf{x}^{(n)},\mathbf{z}'^{(n)},\mathbf{y}^{(n)})\}_{n = 1}^{N}$ , for every $(\mathbf{x},\mathbf{y})\in \mathcal{D}$ +3 Train target-to-unit model $M_{z^{\prime}\leftarrow y}$ and unit-to-target model $M_{z^{\prime}\rightarrow y}$ with paired data $(\mathbf{z}^{\prime},\mathbf{y})$ in $\mathcal{D}'$ +4 Train unit-to-speech model $M_{x\leftarrow z^{\prime}}$ with paired data $(\mathbf{x},\mathbf{z}^{\prime})$ in $\mathcal{D}'$ +5 Use $M_{z' \leftarrow y}$ and $M_{x \leftarrow z'}$ to create + +$$ +\begin{array}{l} \widetilde {\mathcal {D}} = \{(\widetilde {\mathbf {x}} ^ {(m)}, \widetilde {\mathbf {z}} ^ {\prime (m)}, \mathbf {y} ^ {(m)}) \} _ {m = 1} ^ {M}, \text {f o r} \\ \text {e v e r y} \mathbf {y} \in \mathcal {T} \end{array} +$$ + +6 Use $M_{z^{\prime}\to y}$ to translate $\widetilde{\mathbf{z}}^{\prime}$ into $\widetilde{\mathbf{y}}$ , and compute BLEU $(\widetilde{\mathbf{y}},\mathbf{y})$ , for every $(\widetilde{\mathbf{x}},\widetilde{\mathbf{z}}^{\prime},\mathbf{y})\in \widetilde{\mathcal{D}}$ +7 Select top $\rho \cdot M$ samples from $\widetilde{\mathcal{D}}$ based on BLEU scores, denoted as $\widetilde{\mathcal{D}}_S$ 8 Training $(\mathcal{D},\widetilde{\mathcal{D}}_S)$ + +9 End + +10 Procedure Training $(\mathcal{D},\widetilde{\mathcal{D}}_S)$ +11 | Pre-train ST model $M_{x\to y}$ on $\widetilde{\mathcal{D}}_S$ +12 | Fine-tune ST model $M_{x\to y}$ on $\mathcal{D}$ +13 End + +are trained adversarially. More details about the HiFi-GAN can be found in Appendix A. + +# 3.4 Data Selection and Model Training + +By cascading the target-to-unit model and unit-to-speech model, we can synthesize ST data $\widetilde{\mathcal{D}} = \{(\widetilde{\mathbf{x}}^{(m)},\widetilde{\mathbf{z}}^{\prime (m)},\mathbf{y}^{(m)})\}_{m = 1}^{M}$ from the target-side monolingual corpus $\mathcal{T} = \{\mathbf{y}^{(m)}\}_{m = 1}^{M}$ , where $\widetilde{\mathbf{x}}$ is the synthetic speech and $\widetilde{\mathbf{z}}^{\prime}$ is the corresponding reduced discrete units. However, the synthetic corpus may contain some low-quality data, which may hurt model training. Therefore, we introduce data selection and 2-stage model training to better utilize the synthetic data. + +Data Selection To identify the low-quality data, we train a unit-to-target model to translate the generated units $\widetilde{\mathbf{z}}^{\prime}$ back into target text $\widetilde{\mathbf{y}}$ , and compute the BLEU score (Papineni et al., 2002) between $\widetilde{\mathbf{y}}$ and the ground truth $\mathbf{y}$ , i.e., $\mathrm{BLEU}(\widetilde{\mathbf{y}},\mathbf{y})$ . Finally, + +we only keep the top $\rho \cdot M$ samples according to the BLEU score, where $\rho$ is the selection ratio. The remaining low-quality samples are discarded. + +2-stage Model Training After we get the selected synthetic ST data, we train the model in a 2-stage manner following Abdulmumin et al. (2021). We first pre-train the model on synthetic data, and then fine-tune the model on real data. This can prevent the noise-infested synthetic data from overwhelming real data during training. Algorithm 1 describes the whole process of our proposed method. + +# 4 Experiments + +# 4.1 Datasets + +MuST-C MuST-C (Di Gangi et al., 2019) is a multilingual speech translation dataset, which contains about 400 hours of English (En) audio clips and corresponding translations in 8 languages: German (De), French (Fr), Spanish (Es), Italian (It), Portuguese (Pt), Dutch (Nl), Romanian (Ro), and Russian (Ru). We conduct experiments on $\mathrm{En}\rightarrow \mathrm{De}$ , $\mathrm{En}\rightarrow \mathrm{Fr}$ , and $\mathrm{En}\rightarrow \mathrm{Es}$ , because these three languages have larger public monolingual corpora. + +Monolingual Target Data We use the target text in WMT (Buck and Koehn, 2016) $\mathrm{En} \rightarrow \mathrm{De}$ , $\mathrm{En} \rightarrow \mathrm{Fr}$ , and $\mathrm{En} \rightarrow \mathrm{Es}$ datasets as monolingual target data. Specifically, we use europarl v7 $^8$ , commoncrawl $^9$ , news commentary v12 $^{10}$ subsets for all three languages. The source text is never used in the experiments. The detailed statistics of data we used are shown in Table 1. + +# 4.2 Model Settings + +Target-to-unit Model The target-to-unit model is a Transformer with 6 encoder layers and 6 decoder layers. Each layer comprises 512 hidden states, 4 attention heads, and 2048 feed-forward hidden states. The dropout is 0.3, and the label smoothing is 0.1. For target text, we first lowercase the text and segment it into characters using SentencePiece11. For discrete units, we use the pre-trained quantized model12, which learns $K = 100$ clusters + +
TargetMuST-C (En→)Monolingual Data
hours#samplesEuro.CC.NC.All
De408234k1.9M2.4M0.3M4.6M
Fr492280k2.0M3.2M0.3M5.5M
Es504270k2.0M1.8M0.3M4.1M
+ +Table 1: Statistics of all datasets. Euro.: europarl v7; CC.: commoncrawl; NC.: news commentary v12. + +from the 6th layer representations of pre-trained HuBERT-Base model $^{13}$ , to convert the speech into discrete units. During training, the batch size is 400, and the maximum learning rate is 5e-4. We train the model up to 100k steps with Adam optimizer (Kingma and Ba, 2015). During inference, we use beam search with a beam size of 8 to generate the reduced discrete units. + +The unit-to-target model is the same as the target-to-unit model except for the translation direction, which is used for data selection. During inference, we use greedy search to save time. + +Unit-to-speech Model For the unit-to-speech model, the configurations of the generator and discriminator are the same as Polyak et al. (2021). The 1D-convolutional layers in the duration predictor are set to kernel size 3, padding 1, and hidden dimension 256. We use the pre-trained $d$ -vector model14 as the speaker encoder to extract the 256-dimensional speaker embedding. We train the model up to 100k steps with a batch size of 128. + +ST Model The ST model contains three stacked modules. We use the pre-trained HuBERT-Base model as the acoustic encoder, which takes the raw 16-bit $16\mathrm{kHz}$ audio wave as input. The length adaptor comprises two 1D-convolutional layers with kernel size 5, stride size 2, padding 2, and hidden dimension 1024. The translation model follows Transformer-Base architecture, containing 6 encoder layers and 6 decoder layers. Each layer comprises 512 hidden states, 8 attention heads, and 2048 feed-forward hidden states. The dropout is 0.1, and the label smoothing is 0.1. We refer to this architecture as HU-TRANSFORMER. We learn a vocabulary of size $8\mathrm{k}$ from the target texts in the MuST-C dataset to segment the target texts into subwords for training the ST model. + +To augment the ST model with back translation, we first select the top $\rho = 75\%$ of synthetic data + +
ModelsExternal DataEn→DeEn→FrEn→EsAverage
AudioTargetBLEUΔBLEUΔBLEUΔBLEUΔ
Previous ST baselines (No transcripts used)
REVISIT-ST (Zhang et al., 2022a)××23.033.528.028.2
W-TRANSF. (Ye et al., 2021)✓×23.634.628.428.9
Our implementations
HU-TRANSFORMER✓×24.334.928.729.3
BT4ST✓✓26.6*+2.336.9*+2.031.2*+2.531.6+2.3
+ +Table 2: BLEU scores on MuST-C En→De, En→Fr, and En→Es tst-COMMON set. * means the improvements over HU-TRANSFORMER are statistically significant (p < 0.01). + +![](images/3d3610107a68fec036131faf8368a6c9163585482cc09f7f620f03f2376736df.jpg) +Figure 2: BLEU scores on MuST-C En $\rightarrow$ Detst-COMMON set with different data selection ratio $\rho$ + +based on BLEU scores. The target texts in the synthetic data are segmented into subwords using the same vocabulary. We use Adam optimizer with 4k warm-up steps to pre-train the model on synthetic data up to 300k steps, and fine-tune the model on MuST-C up to 20 epochs. During both pre-training and fine-tuning, each batch contains at most 16M audio frames, and the maximum learning rate is 1e-4. During inference, we average the checkpoints of the last 10 epochs for evaluation. We use beam search with a beam size of 8. SacreBLEU $^{15}$ (Post, 2018) is used to compute case-sensitive tokenized BLEU scores and the statistical significance of translation results with paired bootstrap resampling $^{16}$ (Koehn, 2004). The length penalty is set to 1.2, 1.8, and 0.6 for $\mathrm{En} \rightarrow \mathrm{De}$ , $\mathrm{En} \rightarrow \mathrm{Fr}$ , and $\mathrm{En} \rightarrow \mathrm{Es}$ , respectively. We implement our model with $fairseq^{17}$ (Ott et al., 2019). All models are trained on 4 Nvidia Tesla V100 GPUs. + +Baseline Systems We include two baseline systems: REVISIT-ST (Zhang et al., 2022a) and W-TRANSF. (Ye et al., 2021) for comparison. REVISIT-ST is a carefully designed ST baseline including several techniques like parameterized distance penalty (PDP) and CTC-based regularization. W-TRANSF. is a stronger ST baseline with a pretrained acoustic model, which combines Wav2vec 2.0 (Baevski et al., 2020) and Transformer. Both of them are only trained on speech-translation pairs without using any transcripts. Our HU-TRANSFORMER is also a strong baseline model trained on speech-translation pairs from MuST-C, and we examine our proposed BT4ST on top of this by adding synthetic ST data. + +# 5 Results and Analysis + +# 5.1 Results on MuST-C Dataset + +Table 2 shows the results on MuST-C $\mathrm{En}\rightarrow \mathrm{De}$ , $\mathrm{En}\rightarrow \mathrm{Fr}$ , and $\mathrm{En}\rightarrow \mathrm{Es}$ tst-COMMON set. First, we observe that our HU-TRANSFORMER is a strong baseline compared with previous baselines. Second, by synthesizing pseudo ST data with our proposed BT4ST and using it to pre-train the model, we achieve an average boost of 2.3 BLEU in three translation directions. It demonstrates that our approach can effectively utilize external monolingual target data to improve the performance of ST. + +# 5.2 Impact of Data Selection Ratio + +Although previous work (Edunov et al., 2018) found that noisy synthetic data can benefit training, we argue that the extremely low-quality data also hurt performance. As described in Section 3.4, we select top $\rho \cdot M$ synthetic data based on BLEU scores. We constrain $\rho$ in $[0\%, 25\%, 50\%, 75\%, 100\%]$ for experiments, and the results on MuST-C En→De tst-COMMON set are shown in Figure 2. We find that filtering out + +
MethodsBLEU
Beam search26.6
Greedy search26.2
Top-10 sampling26.4
Sampling26.1
+ +Table 3: BLEU scores on MuST-C $\mathbf{E}\mathbf{n}\rightarrow \mathbf{D}$ tst-COMMOn set with different unit generation methods. + +
Synthetic Data TypesBLEU
Multi-speaker26.6 (±0.1)
Single-speaker26.4
+ +Table 4: BLEU scores on MuST-C $\mathbf{E}\mathbf{n}\rightarrow \mathbf{D}$ tst-COMMON set with different types of pseudo data. For multi-speaker data, we report the mean value and standard variance of BLEU scores derived from 3 independent experiments with different random seeds. + +the last $25\%$ of samples (i.e., $\rho = 75\%$ ) gives a 0.4 BLEU improvement $(26.2 \rightarrow 26.6)$ and performs best. We use $\rho = 75\%$ for all experiments. + +# 5.3 Impact of Unit Generation Methods + +The generation method of the target-to-unit model also influences the performance of back translation, as it determines the quality and diversity of synthetic data. We conduct experiments with beam search, greedy search, top-10 sampling $^{18}$ , and sampling. As shown in Table 3, beam search performs best over all methods on MuST-C En→Det st-COMMON set. We consider two reasons for this. First, our ST dataset is actually a low-resource setting, containing only less than 300k parallel data $^{19}$ . Second, target-to-unit generation is a more difficult task compared to text translation. Therefore, beam search is more effective as it generates high probability outputs, while sampling from the model distribution may produce harmful low-quality data. We use beam search for all experiments. + +# 5.4 Single-speaker vs. Multi-speaker Synthetic Data + +As described in Section 3.3, we provide speaker embedding as input during speech synthesis, which allows us to synthesize pseudo ST datasets con + +![](images/f0815838772682854370a06f2635a61a3ebb6f387b39cb60b646e46c5c44aa05.jpg) +Figure 3: BLEU scores on MuST-C $\mathrm{En}\rightarrow$ Detst-COMMON set with different amount of monolingual and parallel data. + +taining multiple speakers. To examine whether speaker diversity benefits back translation, we synthesize both multi-speaker pseudo data and single-speaker pseudo data for experiments. For multispeaker data, we randomly select a speaker embedding from the training set for each sample. For single-speaker data, we use the average speaker embedding on the training set for all samples. As shown in Table 4, we find that the multi-speaker data is slightly better than the single-speaker data, probably because it is closer to the real ST dataset. + +# 5.5 Results with Different Amounts of Monolingual/Parallel Data + +In this section, we investigate the results under different amounts of monolingual and parallel data. First, we randomly sample 100 hours of ST data (corresponding to about $58\mathrm{K}$ speech-translation pairs) from MuST-C $\mathrm{En} \rightarrow \mathrm{De}$ train set to simulate the low-resource setting. We then vary the amount of monolingual data used for back translation. As shown in Figure 3, we observe that (i) the BLEU score keeps increasing with the number of monolingual data regardless of the size of parallel data, and (ii) our approach is particularly effective in the low-resource setting. With only $12.5\%$ monolingual data (about $0.6\mathrm{M}$ ), we observe a 3.4 BLEU improvement compared with the baseline. When all $4.6\mathrm{M}$ monolingual data is used, we achieve a more significant boost of 5.4 BLEU. + +# 5.6 Diverse BT4ST and Model Ensemble + +Model ensemble is a widely-used technique in state-of-the-art MT systems (Barrault et al., 2020; Akhbardeh et al., 2021), which can combine differ + +
Models#ModelsEn→DeEn→FrEn→EsAverage
BLEUΔBLEUΔBLEUΔBLEUΔ
HU-TRANSFORMER124.334.928.729.3
BT4ST126.6+2.336.9+2.031.2+2.531.6+2.3
Diverse BT4ST + Ensemble227.5+3.238.3+3.432.3+3.632.7+3.4
327.9+3.638.8+3.932.4+3.733.0+3.7
428.1+3.839.0+4.132.6+3.933.2+3.9
528.0+3.739.0+4.132.8+4.133.3+4.0
+ +ent single models (e.g., models trained on different data) to achieve stronger performance. To synthesize multiple diverse pseudo datasets from a single monolingual corpus, we introduce a simple Diverse BT4ST method. For the target-to-unit model, we activate the dropout modules during beam search decoding. For the unit-to-speech model, we randomly select the speaker embedding as above. By setting different random seeds, we can generate source speeches with different content and different speakers from the target text. In this way, we obtain multiple different pseudo datasets and train several models individually. We then combine these models by computing the token-level average log probability during decoding. As shown in Table 5, model ensemble can significantly boost performance. We achieve an average boost of 4.0 BLEU in three directions by assembling five models. + +# 5.7 Performance of the Target-to-unit Model + +In this section, we report the performance of our target-to-unit models. We evaluate the performance with two metrics: Unit-BLEU and ASR-BLEU. Unit-BLEU is the BLEU score calculated on the reduced discrete unit sequence. ASR-BLEU is the BLEU score calculated on the transcribed text with the open-source ASR-BLEU toolkit $^{20}$ . As shown in Table 6, our target-to-unit models achieve promising results on MuST-C De→En, Fr→En, and Es→En tst-COMMON set, indicating that our proposed method can synthesize reasonable ST data. + +# 6 Related Work + +End-to-end ST End-to-end ST is theoretically attractive due to its advantages in alleviating error propagation and reducing latency, but it also faces + +Table 5: BLEU scores on MuST-C En→De, En→Fr, and En→Es tst-COMMON set with model ensemble. + +
MetricsDe→EnFr→EnEs→En
Unit-BLEU26.527.927.2
ASR-BLEU19.024.520.8
+ +Table 6: Unit-BLEU and ASR-BLEU scores of the target-to-unit models. + +many challenges because of data scarcity. Therefore, researchers often leverage source transcripts to help train with auxiliary tasks. Plenty of existing work first pre-train the model with the ASR task (Bansal et al., 2019; Stoian et al., 2020; Wang et al., 2020b), MT task (Han et al., 2021; Fang et al., 2022; Ye et al., 2022; Fang and Feng, 2023; Zhou et al., 2023), or both together (Wang et al., 2020a; Alinejad and Sarkar, 2020; Le et al., 2021; Dong et al., 2021a; Xu et al., 2021), and then fine-tune the model with the ST task, which becomes the de-facto paradigm in recent ST studies. Le et al. (2020); Indurthi et al. (2021); Tang et al. (2021a,b); Dong et al. (2021b); Ye et al. (2021) adopt multi-task learning to share knowledge among different tasks to improve ST. Bapna et al. (2021, 2022); Chen et al. (2022); Cheng et al. (2022); Ao et al. (2022); Tang et al. (2022); Zhang et al. (2022b) jointly pre-train the model with speech and text data to learn a unified space for both modalities, which achieve competitive results in ST. Jia et al. (2019); Lam et al. (2022) synthesize ST data with the help of MT model, TTS model and forced alignment tools. However, all of these studies assume that transcripts are available, which does not hold true for large numbers of unwritten languages in the world. Zhang et al. (2022a) first challenge this assumption and propose a set of practices to train a better ST model with only speech-translation pairs. In this paper, we extend this line of research and propose a back translation algorithm to utilize large-scale monolingual target data to improve ST + +without transcripts. + +Back Translation Back translation for NMT was first proposed by Sennrich et al. (2016) and is widely used in state-of-the-art NMT systems (Akhbardeh et al., 2021). Since then, many techniques have been proposed to improve BT such as Iterative BT (Hoang et al., 2018; Dou et al., 2020), Tagged BT (Caswell et al., 2019; Marie et al., 2020), Tag-less BT (Abdulmumin et al., 2021), MetaBT (Pham et al., 2021), HintedBT (Ramnath et al., 2021), and so on. Edunov et al. (2018) investigates different generation methods of BT in large-scale settings. Huang et al. (2021); Liu et al. (2021) focus on combining back translation with pre-training. Xu et al. (2022) combines synthetic data generated by beam search and sampling to better trade off the importance and quality of synthetic data. Despite the success of BT in MT, BT for ST is still a challenging problem. Nguyen et al. (2022b) introduces a pipeline BT method for speech-to-speech translation which cascades an unsupervised MT model and a TTS model. In contrast, our approach can synthesize pseudo ST data from the target-side monolingual corpus without relying on source transcripts. + +Discrete Speech Units Discrete units, as a self-supervised discrete representation of speech, have proved effective on many tasks, such as spoken language modeling (Lakhotia et al., 2021; Kharitonov et al., 2022; Gat et al., 2022; Borsos et al., 2022), speech-to-speech translation (Lee et al., 2022a,b; Popuri et al., 2022; Inaguma et al., 2022; Chen et al.; Li et al., 2022), speech emotion conversion (Kreuk et al., 2021), speech dialogue (Nguyen et al., 2022a), speech resynthesis (Polyak et al., 2021), speaking style conversion (Maimon and Adi, 2022), and so on. In this paper, we achieve back translation for ST by leveraging discrete units and further prove its effectiveness. + +# 7 Conclusion and Future Work + +In this paper, we develop a back translation algorithm for speech translation, which can synthesize pseudo ST data from monolingual target data without relying on transcripts. We utilize self-supervised discrete units and achieve back translation by cascading a target-to-unit model and a unit-to-speech model. Experimental results on the MuST-C benchmark demonstrate the superiority of our approach, especially in low-resource settings. + +This work focuses on enhancing ST when the source transcripts are unavailable, which is an essential but under-explored issue. We hope our work will draw more attention to this issue from researchers, which will benefit more real-world unwritten languages. In the future, we are interested in exploring how to combine advanced BT techniques (e.g., Iterative BT) with our approach. + +# Limitations + +Our work provides an effective solution to augment ST when source transcripts are unavailable, which could benefit many unwritten languages. However, limited by the publicly available ST datasets, we use English as an unwritten language for experiments, which may slightly differ from real-world unwritten languages. Since we never use transcripts in our approach, we believe our work can shed some light on ST for real-world unwritten languages. We are glad to explore this if there are available datasets in the future. + +# Ethics Statement + +Our model is developed and evaluated with publicly available datasets: MuST-C and WMT. The pre-trained models we use, like HuBERT and d-vector models, are open and permitted for research purposes. Our use of the above artifacts is consistent with their intended use since they are widely used in the speech research community. Although our method could help the speech translation of unwritten languages like some dialects, the performance of the ST model still heavily relies on the amount of ST training data. Therefore, the output of the model is not always reliable and it would be better to be assisted by professional human translators in real applications. + +# 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. 2018AAA0102502) + +# References + +Idris Abdulmumin, Bashir Shehu Galadanci, and Aliyu Garba. 2021. Tag-less back-translation. Mach. Transl., 35(4):519-549. +Farhad Akhbardeh, Arkady Arkhangorodsky, Magdalena Biesialska, Ondrej Bojar, Rajen Chatter + +jee, Vishrav Chaudhary, Marta R. Costa-jussa, Cristina España-Bonet, Angela Fan, Christian Federmann, Markus Freitag, Yvette Graham, Roman Grundkiewicz, Barry Haddow, Leonie Harter, Kenneth Heafield, Christopher Homan, Matthias Huck, Kwabena Amponsah-Kaakyire, Jungo Kasai, Daniel Khashabi, Kevin Knight, Tom Kocmi, Philipp Koehn, Nicholas Lourie, Christof Monz, Makoto Morishita, Masaaki Nagata, Ajay Nagesh, Toshiaki Nakazawa, Matteo Negri, Santanu Pal, Allahsera Auguste Tapo, Marco Turchi, Valentin Vydrin, and Marcos Zampieri. 2021. Findings of the 2021 conference on machine translation (WMT21). In Proceedings of the Sixth Conference on Machine Translation, pages 1-88, Online. Association for Computational Linguistics. + +Ashkan Alinejad and Anoop Sarkar. 2020. Effectively pretraining a speech translation decoder with machine translation data. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 8014-8020, Online. Association for Computational Linguistics. + +Antonios Anastasopoulos, Loic Barrault, Luisa Bentivogli, Marcely Zanon Boito, Ondrej Bojar, Roldano Cattoni, Anna Currey, Georgiana Dinu, Kevin Duh, Maha Elbayad, Clara Emmanuel, Yannick Esteve, Marcello Federico, Christian Federmann, Souhir Gahbiche, Hongyu Gong, Roman Grundkiewicz, Barry Haddow, Benjamin Hsu, David Javorsky, Vera Kloudova, Surafel Lakew, Xutai Ma, Prashant Mathur, Paul McNamee, Kenton Murray, Maria Nadejde, Satoshi Nakamura, Matteo Negri, Jan Niehues, Xing Niu, John Ortega, Juan Pino, Elizabeth Salesky, Jiatong Shi, Matthias Sperber, Sebastian Stüker, Katsuhito Sudoh, Marco Turchi, Yogesh Virkar, Alexander Waibel, Changhan Wang, and Shinji Watanabe. 2022. Findings of the IWSLT 2022 evaluation campaign. In Proceedings of the 19th International Conference on Spoken Language Translation (IWSLT 2022), pages 98-157, Dublin, Ireland (in-person and online). Association for Computational Linguistics. + +Antonios Anastasopoulos, Ondrej Bojar, Jacob Bremerman, Roldano Cattoni, Maha Elbayad, Marcello Federico, Xutai Ma, Satoshi Nakamura, Matteo Negri, Jan Niehues, Juan Pino, Elizabeth Salesky, Sebastian Stüker, Katsuhito Sudoh, Marco Turchi, Alexander Waibel, Changhan Wang, and Matthew Wiesner. 2021. FINDINGS OF THE IWSLT 2021 EVALUATION CAMPAIGN. In Proceedings of the 18th International Conference on Spoken Language Translation (IWSLT 2021), pages 1-29, Bangkok, Thailand (online). Association for Computational Linguistics. + +Junyi Ao, Rui Wang, Long Zhou, Chengyi Wang, Shuo Ren, Yu Wu, Shujie Liu, Tom Ko, Qing Li, Yu Zhang, Zhihua Wei, Yao Qian, Jinyu Li, and Furu Wei. 2022. SpeechT5: Unified-modal encoder-decoder pre-training for spoken language processing. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long + +Papers), pages 5723-5738, Dublin, Ireland. Association for Computational Linguistics. + +Alexei Baevski, Yuhao Zhou, Abdelrahman Mohamed, and Michael Auli. 2020. wav2vec 2.0: A framework for self-supervised learning of speech representations. Advances in Neural Information Processing Systems, 33. + +Sameer Bansal, Herman Kamper, Karen Livescu, Adam Lopez, and Sharon Goldwater. 2019. Pre-training on high-resource speech recognition improves low-resource speech-to-text translation. In Proc. of NAACL-HLT, pages 58-68. + +Ankur Bapna, Colin Cherry, Yu Zhang, Ye Jia, Melvin Johnson, Yong Cheng, Simran Khanuja, Jason Riesa, and Alexis Conneau. 2022. mslam: Massively multilingual joint pre-training for speech and text. CoRR, abs/2202.01374. + +Ankur Bapna, Yu-an Chung, Nan Wu, Anmol Gulati, Ye Jia, Jonathan H Clark, Melvin Johnson, Jason Riesa, Alexis Conneau, and Yu Zhang. 2021. Slam: A unified encoder for speech and language modeling via speech-text joint pre-training. arXiv preprint arXiv:2110.10329. + +Loic Barrault, Magdalena Biesialska, Ondrej Bojar, Marta R. Costa-jussa, Christian Federmann, Yvette Graham, Roman Grundkiewicz, Barry Haddow, Matthias Huck, Eric Joanis, Tom Kocmi, Philipp Koehn, Chi-kiu Lo, Nikola Ljubesic, Christof Monz, Makoto Morishita, Masaaki Nagata, Toshiaki Nakazawa, Santanu Pal, Matt Post, and Marcos Zampieri. 2020. Findings of the 2020 conference on machine translation (WMT20). In Proceedings of the Fifth Conference on Machine Translation, pages 1-55, Online. Association for Computational Linguistics. + +Alexandre Bérard, Olivier Pietquin, Christophe Servan, and Laurent Besacier. 2016. Listen and translate: A proof of concept for end-to-end speech-to-text translation. In NIPS workshop on End-to-end Learning for Speech and Audio Processing. + +Zalán Borsos, Raphaël Marinier, Damien Vincent, Eugene Kharitonov, Olivier Pietquin, Matt Sharifi, Olivier Teboul, David Grangier, Marco Tagliasacchi, and Neil Zeghidour. 2022. Audiolm: a language modeling approach to audio generation. + +Christian Buck and Philipp Koehn. 2016. Findings of the WMT 2016 bilingual document alignment shared task. In Proceedings of the First Conference on Machine Translation: Volume 2, Shared Task Papers, pages 554-563, Berlin, Germany. Association for Computational Linguistics. + +Isaac Caswell, Ciprian Chelba, and David Grangier. 2019. Tagged back-translation. In Proceedings of the Fourth Conference on Machine Translation (Volume 1: Research Papers), pages 53–63, Florence, Italy. Association for Computational Linguistics. + +Mingjian Chen, Xu Tan, Bohan Li, Yanqing Liu, Tao Qin, sheng zhao, and Tie-Yan Liu. 2021. Adaspeech: Adaptive text to speech for custom voice. In International Conference on Learning Representations. +Peng-Jen Chen, Kevin Tran, Yilin Yang, Jingfei Du, Justine Kao, Yu-An Chung, Paden Tomasello, Paul-Ambroise Duquenne, Holger Schwenk, Hongyu Gong, Hirofumi Inaguma, Sravya Popuri, Changhan Wang, Juan Pino, Wei-Ning Hsu, and Ann Lee. Speech-to-speech translation for a real-world unwritten language. +Zhehuai Chen, Yu Zhang, Andrew Rosenberg, Bhuvana Ramabhadran, Pedro J. Moreno, Ankur Bapna, and Heiga Zen. 2022. Maestro: Matched speech text representations through modality matching. In IN-TERSPEECH. +Yong Cheng, Yu Zhang, Melvin Johnson, Wolfgang Macherey, and Ankur Bapna. 2022. Mu²slam: Multitask, multilingual speech and language models. +Mattia A. Di Gangi, Roldano Cattoni, Luisa Bentivogli, Matteo Negri, and Marco Turchi. 2019. MuST-C: a Multilingual Speech Translation Corpus. In Proceedings of the 2019 Conference of the North American Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 2012-2017, Minneapolis, Minnesota. Association for Computational Linguistics. +Qianqian Dong, Mingxuan Wang, Hao Zhou, Shuang Xu, Bo Xu, and Lei Li. 2021a. Consecutive decoding for speech-to-text translation. In The Thirty-fifth AAAI Conference on Artificial Intelligence, AAAI. +Qianqian Dong, Rong Ye, Mingxuan Wang, Hao Zhou, Shuang Xu, Bo Xu, and Lei Li. 2021b. Listen, understand and translate: Triple supervision decouples end-to-end speech-to-text translation. In Proceedings of the AAAI Conference on Artificial Intelligence. +Zi-Yi Dou, Antonios Anastasopoulos, and Graham Neubig. 2020. Dynamic data selection and weighting for iterative back-translation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 5894-5904, Online. Association for Computational Linguistics. +Long Duong, Antonios Anastasopoulos, David Chiang, Steven Bird, and Trevor Cohn. 2016. An attentional model for speech translation without transcription. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 949-959, San Diego, California. Association for Computational Linguistics. +Sergey Edunov, Myle Ott, Michael Auli, and David Grangier. 2018. Understanding back-translation at scale. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 489-500, Brussels, Belgium. Association for Computational Linguistics. + +Qingkai Fang and Yang Feng. 2023. Understanding and bridging the modality gap for speech translation. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics. +Qingkai Fang, Rong Ye, Lei Li, Yang Feng, and Mingxuan Wang. 2022. STEMM: Self-learning with speech-text manifold mixup for speech translation. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 7050-7062, Dublin, Ireland. Association for Computational Linguistics. +Itai Gat, Felix Kreuk, Ann Lee, Jade Copet, Gabriel Synnaeve, Emmanuel Dupoux, and Yossi Adi. 2022. On the robustness of self-supervised representations for spoken language modeling. +Chi Han, Mingxuan Wang, Heng Ji, and Lei Li. 2021. Learning shared semantic space for speech-to-text translation. In *Findings of the Association for Computational Linguistics: ACL-IJCNLP* 2021, pages 2214-2225, Online. Association for Computational Linguistics. +Vu Cong Duy Hoang, Philipp Koehn, Gholamreza Haffari, and Trevor Cohn. 2018. Iterative backtranslation for neural machine translation. In Proceedings of the 2nd Workshop on Neural Machine Translation and Generation, pages 18-24, Melbourne, Australia. Association for Computational Linguistics. +Wei-Ning Hsu, Benjamin Bolte, Yao-Hung Hubert Tsai, Kushal Lakhotia, Ruslan Salakhutdinov, and Abdelrahman Mohamed. 2021. Hubert: Self-supervised speech representation learning by masked prediction of hidden units. IEEE/ACM Trans. Audio, Speech and Lang. Proc., 29:3451-3460. +Dandan Huang, Kun Wang, and Yue Zhang. 2021. A comparison between pre-training and large-scale back-translation for neural machine translation. In *Findings of the Association for Computational Linguistics: ACL-IJCNLP* 2021, pages 1718–1732, Online. Association for Computational Linguistics. +Hirofumi Inaguma, Sravya Popuri, Ilia Kulikov, Peng-Jen Chen, Changhan Wang, Yu-An Chung, Yun Tang, Ann Lee, Shinji Watanabe, and Juan Pino. 2022. Unity: Two-pass direct speech-to-speech translation with discrete units. arXiv preprint arXiv:2212.08055. +Sathish Indurthi, Mohd Abbas Zaidi, Nikhil Kumar Lakumarapu, Beomseok Lee, Hyojung Han, Seokchan Ahn, Sangha Kim, Chanwoo Kim, and Inchul Hwang. 2021. Task aware multi-task learning for speech to text tasks. In ICASSP 2021 - 2021 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 7723-7727. +Ye Jia, Melvin Johnson, Wolfgang Macherey, Ron J. Weiss, Yuan Cao, Chung-Cheng Chiu, Naveen Ari, Stella Laurenzo, and Yonghui Wu. 2019. Leveraging weakly supervised data to improve end-to-end + +speech-to-text translation. In Proc. of ICASSP, pages 7180-7184. +Eugene Kharitonov, Ann Lee, Adam Polyak, Yossi Adi, Jade Copet, Kushal Lakhotia, Tu Anh Nguyen, Morgane Riviere, Abdelrahman Mohamed, Emmanuel Dupoux, and Wei-Ning Hsu. 2022. Text-free prosody-aware generative spoken language modeling. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 8666-8681, Dublin, Ireland. Association for Computational Linguistics. +Diederik P. Kingma and Jimmy Ba. 2015. Adam: A method for stochastic optimization. In *ICLR (Poster)*. +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. +Jungil Kong, Jaehyeon Kim, and Jaekyoung Bae. 2020. Hifi-gan: Generative adversarial networks for efficient and high fidelity speech synthesis. In Advances in Neural Information Processing Systems, volume 33, pages 17022-17033. Curran Associates, Inc. +Felix Kreuk, Adam Polyak, Jade Copet, Eugene Kharitonov, Tu Anh Nguyen, Morgane Rivière, Wei-Ning Hsu, Abdelrahman Mohamed, Emmanuel Dupoux, and Yossi Adi. 2021. Textless speech emotion conversion using decomposed and discrete representations. CoRR, abs/2111.07402. +Kushal Lakhotia, Eugene Kharitonov, Wei-Ning Hsu, Yossi Adi, Adam Polyak, Benjamin Bolte, Tu-Anh Nguyen, Jade Copet, Alexei Baevski, Abdelrahman Mohamed, and Emmanuel Dupoux. 2021. On generative spoken language modeling from raw audio. Transactions of the Association for Computational Linguistics, 9:1336-1354. +Tsz Kin Lam, Shigehiko Schamoni, and Stefan Riezler. 2022. Sample, translate, recombine: Leveraging audio alignments for data augmentation in end-to-end speech translation. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 245-254, Dublin, Ireland. Association for Computational Linguistics. +Hang Le, Juan Pino, Changhan Wang, Jiatao Gu, Didier Schwab, and Laurent Besacier. 2020. Dual-decoder transformer for joint automatic speech recognition and multilingual speech translation. In Proceedings of the 28th International Conference on Computational Linguistics, pages 3520-3533, Barcelona, Spain (Online). International Committee on Computational Linguistics. +Hang Le, Juan Pino, Changhan Wang, Jiatao Gu, Didier Schwab, and Laurent Besacier. 2021. Lightweight adapter tuning for multilingual speech 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 817-824, Online. Association for Computational Linguistics. +Ann Lee, Peng-Jen Chen, Changhan Wang, Jiatao Gu, Sravya Popuri, Xutai Ma, Adam Polyak, Yossi Adi, Qing He, Yun Tang, Juan Pino, and Wei-Ning Hsu. 2022a. Direct speech-to-speech translation with discrete units. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 3327-3339, Dublin, Ireland. Association for Computational Linguistics. +Ann Lee, Hongyu Gong, Paul-Ambroise Duquenne, Holger Schwenk, Peng-Jen Chen, Changhan Wang, Sravya Popuri, Yossi Adi, Juan Pino, Jiatao Gu, and Wei-Ning Hsu. 2022b. Textless speech-to-speech translation on real data. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 860-872, Seattle, United States. Association for Computational Linguistics. +Xian Li, Changhan Wang, Yun Tang, Chau Tran, Yuqing Tang, Juan Pino, Alexei Baevski, Alexis Conneau, and Michael Auli. 2021. Multilingual speech translation from efficient finetuning of pretrained 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 827-838, Online. Association for Computational Linguistics. +Xinjian Li, Ye Jia, and Chung-Cheng Chiu. 2022. Textless direct speech-to-speech translation with discrete speech representation. +Xuebo Liu, Longyue Wang, Derek F. Wong, Liang Ding, Lidia S. Chao, Shuming Shi, and Zhaopeng Tu. 2021. On the complementarity between pre-training and back-translation for neural machine translation. In Findings of the Association for Computational Linguistics: EMNLP 2021, pages 2900–2907, Punta Cana, Dominican Republic. Association for Computational Linguistics. +Gallil Maimon and Yossi Adi. 2022. Speaking style conversion with discrete self-supervised units. ArXiv, abs/2212.09730. +Benjamin Marie, Raphael Rubino, and Atsushi Fujita. 2020. Tagged back-translation revisited: Why does it really work? In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5990–5997, Online. Association for Computational Linguistics. +Tu Anh Nguyen, Eugene Kharitonov, Jade Copet, Yossi Adi, Wei-Ning Hsu, Ali Elkahky, Paden Tomasello, Robin Algayres, Benoit Sagot, Abdelrahman Mohamed, and Emmanuel Dupoux. 2022a. Generative spoken dialogue language modeling. + +Xuan-Phi Nguyen, Sravya Popuri, Changhan Wang, Yun Tang, Ilia Kulikov, and Hongyu Gong. 2022b. Improving speech-to-speech translation through unlabeled text. arXiv preprint arXiv:2210.14514. +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*. In *Proceedings of NAACL-HLT* 2019: Demonstrations. +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. +Hieu Pham, Xinyi Wang, Yiming Yang, and Graham Neubig. 2021. Meta back-translation. In International Conference on Learning Representations. +Adam Polyak, Yossi Adi, Jade Copet, Eugene Kharitonov, Kushal Lakhotia, Wei-Ning Hsu, Abdelrahman Mohamed, and Emmanuel Dupoux. 2021. Speech Resynthesis from Discrete Disentangled Self-Supervised Representations. In Proc. Interspeech 2021. +Sravya Popuri, Peng-Jen Chen, Changhan Wang, Juan Miguel Pino, Yossi Adi, Jiatao Gu, Wei-Ning Hsu, and Ann Lee. 2022. Enhanced direct speech-to-speech translation using self-supervised pre-training and data augmentation. In Interspeech. +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. +Alec Radford, Jong Wook Kim, Tao Xu, Greg Brockman, Christine McLeavey, and Ilya Sutskever. 2022. Robust speech recognition via large-scale weak supervision. +Sahana Ramnath, Melvin Johnson, Abhirut Gupta, and Aravindan Raghuveer. 2021. *HintedBT: Augmenting Back-Translation with quality and transliteration hints*. In *Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing*, pages 1717–1733, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Yi Ren, Chenxu Hu, Xu Tan, Tao Qin, Sheng Zhao, Zhou Zhao, and Tie-Yan Liu. 2021. *Fastspeech* 2: Fast and high-quality end-to-end text to speech. In International Conference on Learning Representations. +Rico Sennrich, Barry Haddow, and Alexandra Birch. 2016. Improving neural machine translation models with monolingual data. In Proceedings of the 54th Annual Meeting of the Association for Computational + +Linguistics (Volume 1: Long Papers), pages 86-96, Berlin, Germany. Association for Computational Linguistics. +Mihaela C Stoian, Sameer Bansal, and Sharon Goldwater. 2020. Analyzing asr pretraining for low-resource speech-to-text translation. In ICASSP 2020-2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 7909-7913. IEEE. +Yun Tang, Hongyu Gong, Ning Dong, Changhan Wang, Wei-Ning Hsu, Jiatao Gu, Alexei Baevski, Xian Li, Abdelrahman Mohamed, Michael Auli, and Juan Pino. 2022. Unified speech-text pre-training for speech translation and recognition. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1488-1499, Dublin, Ireland. Association for Computational Linguistics. +Yun Tang, Juan Pino, Xian Li, Changhan Wang, and Dmitriy Genzel. 2021a. Improving speech translation by understanding and learning from the auxiliary text translation task. 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 4252-4261, Online. Association for Computational Linguistics. +Yun Tang, Juan Pino, Changhan Wang, Xutai Ma, and Dmitriy Genzel. 2021b. A general multi-task learning framework to leverage text data for speech to text tasks. In ICASSP 2021 - 2021 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 6209-6213. +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. +Li Wan, Quan Wang, Alan Papir, and Ignacio Lopez-Moreno. 2018. Generalized end-to-end loss for speaker verification. In 2018 IEEE International Conference on Acoustics, Speech and Signal Processing, ICASSP 2018, Calgary, AB, Canada, April 15-20, 2018, pages 4879-4883. IEEE. +Chengyi Wang, Yu Wu, Shujie Liu, Zhenglu Yang, and Ming Zhou. 2020a. Bridging the gap between pretraining and fine-tuning for end-to-end speech translation. In Proc. of AAAI, volume 34, pages 9161-9168. +Chengyi Wang, Yu Wu, Shujie Liu, Ming Zhou, and Zhenglu Yang. 2020b. Curriculum pre-training for end-to-end speech translation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 3728-3738, Online. Association for Computational Linguistics. +Chen Xu, Bojie Hu, Yanyang Li, Yuhao Zhang, Shen Huang, Qi Ju, Tong Xiao, and Jingbo Zhu. 2021. + +Stacked acoustic-and-textual encoding: Integrating the pre-trained models into speech translation encoders. 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 2619-2630, Online. Association for Computational Linguistics. +Jiahao Xu, Yubin Ruan, Wei Bi, Guoping Huang, Shuming Shi, Lihui Chen, and Lemao Liu. 2022. On synthetic data for back translation. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 419-430, Seattle, United States. Association for Computational Linguistics. +Rong Ye, Mingxuan Wang, and Lei Li. 2021. End-to-end speech translation via cross-modal progressive training. In Proc. of INTERSPEECH. +Rong Ye, Mingxuan Wang, and Lei Li. 2022. Cross-modal contrastive learning for speech translation. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 5099-5113, Seattle, United States. Association for Computational Linguistics. +Biao Zhang, Barry Haddow, and Rico Sennrich. 2022a. Revisiting end-to-end speech-to-text translation from scratch. In International Conference on Machine Learning, ICML 2022, 17-23 July 2022, Baltimore, Maryland, USA, volume 162 of Proceedings of Machine Learning Research, pages 26193-26205. PMLR. +Ziqiang Zhang, Long Zhou, Junyi Ao, Shujie Liu, Lirong Dai, Jinyu Li, and Furu Wei. 2022b. Speechut: Bridging speech and text with hidden-unit for encoder-decoder based speech-text pre-training. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, Online and Abu Dhabi. +Yan Zhou, Qingkai Fang, and Yang Feng. 2023. CMOT: Cross-modal mixup via optimal transport for speech translation. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics. + +# A Details about the HiFi-GAN + +The HiFi-GAN vocoder (Kong et al., 2020) consists of one generator and two discriminators. Next, we describe the model architecture and training objectives of HiFi-GAN. + +Generator The generator is a convolutional neural network containing several stacked blocks. Each block comprises a transposed convolution layer followed by a multi-receptive field fusion (MRF) module. The transposed convolution layers upsample the input sequence to match the length of output waveforms. The MRF module includes multiple residual blocks with different receptive fields to model different patterns in parallel. The input to the generator is concatenated unit embedding $\mathrm{Emb}(\mathbf{z})$ and speaker embedding $\mathbf{e}_{\mathrm{spkr}}$ . + +Discriminator The discriminator consists of a Multi-Period Discriminator (MPD) and a Multi-Scale Discriminator (MSD). MPD is a mixture of sub-discriminators operating on equally spaced samples of the input audio. We adopt 5 sub-discriminators and set the space between samples to [2,3,5,7,11] respectively. MSD is also a mixture of sub-discriminators operating on different input scales: raw audio, $\times 2$ downsampled audio, and $\times 4$ downsampled audio. MPD and MSD can identify different periodic and consecutive patterns in the audio. + +Training Objectives Using $G$ to denote the generator and $D_{j}$ to denote each sub-discriminator, we define the adversarial loss of $G$ and $D_{j}$ as: + +$$ +\mathcal {L} _ {\mathrm {a d v}} (G; D _ {j}) = \mathbb {E} _ {\mathbf {x}} \left[ \big (1 - D _ {j} (\widehat {\mathbf {x}}) \big) ^ {2} \right], \quad (4) +$$ + +$$ +\mathcal {L} _ {\mathrm {a d v}} \left(D _ {j}; G\right) = \mathbb {E} _ {\mathbf {x}} \left[ \left(1 - D _ {j} (\mathbf {x})\right) ^ {2} + D _ {j} (\widehat {\mathbf {x}}) ^ {2} \right], \tag {5} +$$ + +where $\mathbf{x}$ denotes the ground truth audio and $\widehat{\mathbf{x}} = G(\operatorname{Emb}(\mathbf{z}), \mathbf{e}_{\mathrm{spkr}})$ denotes the synthetic audio. + +Besides, there are two auxiliary training objectives. The first term measures the L1 distance between mel-spectrogram of the ground truth audio and synthetic audio: + +$$ +\mathcal {L} _ {\mathrm {m e l}} (G) = \mathbb {E} _ {\mathbf {x}} \left[ \| \phi (\mathbf {x}) - \phi (\widehat {\mathbf {x}}) \| _ {1} \right], \tag {6} +$$ + +where $\phi$ is the function to compute melspectrogram of the audio. The second term is a feature-matching loss which measures the difference in discriminator features between ground truth + +audio and synthetic audio: + +$$ +\mathcal {L} _ {\mathrm {f m}} (G; D _ {j}) = \mathbb {E} _ {\mathbf {x}} \left[ \sum_ {i = 1} ^ {L} \frac {1}{N _ {i}} \| \delta_ {i} (\mathbf {x}) - \delta_ {i} (\widehat {\mathbf {x}}) \| _ {1} \right], \tag {7} +$$ + +where $L$ denotes the number of layers in $D_{j}$ , $\delta_{i}$ denotes the feature extractor of $i$ -th layer, and $N_{i}$ denotes the number of features in $i$ -th layer. + +Considering all sub-discriminators, the final training objectives are as follows: + +$$ +\begin{array}{l} \mathcal {L} _ {G} = \sum_ {j = 1} ^ {J} \left[ \mathcal {L} _ {\mathrm {a d v}} (G; D _ {j}) + \lambda_ {\mathrm {f m}} \mathcal {L} _ {\mathrm {f m}} (G; D _ {j}) \right] (8) \\ + \lambda_ {\mathrm {m e l}} \mathcal {L} _ {\mathrm {m e l}} (G), (9) \\ \end{array} +$$ + +$$ +\mathcal {L} _ {D} = \sum_ {j = 1} ^ {J} \mathcal {L} _ {\mathrm {a d v}} \left(D _ {j}; G\right), \tag {10} +$$ + +where $J$ is the number of sub-discriminators. We set $\lambda_{\mathrm{fm}} = 2$ and $\lambda_{\mathrm{mel}} = 45$ . + +# B Examples of Synthetic ST Data + +To understand our approach more intuitively, we provide some examples of synthetic ST data in this section. Table 7, 8, and 9 show some examples of synthetic $\mathrm{En} \rightarrow \mathrm{De}$ , $\mathrm{En} \rightarrow \mathrm{Fr}$ , and $\mathrm{En} \rightarrow \mathrm{Es}$ ST data, respectively. For each sample, we give the original target text, generated reduced discrete units, generated source speech, and the corresponding transcript obtained with a state-of-the-art ASR model Whisper-Large $^{21}$ (Radford et al., 2022). We observe that our method can generate reasonable source speech, though it may contain minor errors or duplicates. This explains why our method can enhance ST successfully. + +We also provide an example of our proposed Diverse BT4ST method in Table 10, which generates multiple diverse source speeches from only one target text. We observe that the four outputs of our model are all reasonable and differ from each other in some way, which confirms that Diverse BT4ST is a simple and effective method to generate diverse pseudo data. + +We provide the corresponding audio files of the above samples at https://bt4st.github.io/. + +
BT4ST: German text→English speech
Case 1
Target (De)Die Art und Weise, wie wir diese Steuern zahlen, wird sich verändern.(There is going to be a change in how we pay these taxes.)
Unit71 82 73 70 14 76 94 32 64 60 70 14 76 11 64 74 27 47 59 33 94 32 64 1 66 82 11 45 64 65 6 15 92 57 31 59 33 91 43 74 2 89 6 15 7 23 53 62 29 28 6070 14 76 53 97 19 65 74 27 21 95 59 87 94 32 64 81 57 21 95 41 20
Speech (En)10002000
ASR OutputThe way we pay these taxes will change.
Case 2
Target (De)Auch diese Frage soll letztlich Aufschluss darüber geben, welche Voraussetzungen es für die Entstehung von Leben gibt.(This question should also provide information regarding the preconditions for the origins of life.)
Unit71 86 38 44 80 26 87 91 43 74 2 78 33 14 76 68 9 43 6 95 92 21 95 23 42 44 80 81 83 84 57 96 55 39 67 54 57 93 86 53 62 29 28 37 24 51 19 74 2 3159 23 16 50 87 53 79 34 74 27 89 59 23 44 80 18 27 78 33 90 35 69 65 29 95 23 42 80 81 83 84 57 96 55 39 67 54 57 9386 68 73 16 60 27 89 59 23 44 80 18 6 15 49 41 84 57 96 55 67 54 57 93 34 37 24 61 79 81 83 2 96 55 67 54 57 93 34 48 36 40 99 82 11 64 53 73 16 50 52 30 1 21 95 23 44 80 18 6 15 49 7 23 73 16 66 77 90 35 24 13 58 3281 65 3 41 20
Speech (En)100020003000400050006000
ASR OutputAnd that question is ultimately the conclusion about what conditions there are for the emergence of life.
Case 3
Target (De)Doch die von ihr getesteten Geräte sind auch für die Straβenplaner intereasant, Denn sie arbeiten nicht mit GPS und liefern nur begrenzte Informationen, die regelmäßige per Modem hochgeladen werden.(But the devices it is testing appeal to highway planners because they don't use GPS and deliver a limited amount of information, uploaded periodically by modem.)
Unit71 47 76 9 74 2 82 11 45 64 29 28 92 31 23 73 16 77 24 13 58 32 65 6 15 7 23 62 29 28 92 82 87 94 32 64 74 27 31 59 33 91 43 6 49 92 31 23 62 1 85 53037 51 19 65 6 49 7 87 9 19 37 86 53 44 80 18 21 95 52 25 62 6 49 92 31 87 42 88 81 83 84 57 96 55 39 67 54 57 93 3 52 30 99 82 62 6 49 92 21 5225 45 64 74 2 27 47 59 33 90 35 13 91 38 44 80 85 5 79 29 6 49 41 84 57 96 55 39 67 54 57 93 47 11 45 64 74 27 89 59 33 68 9 29 28 92 82 87 94 3264 166631879751926631236970144630742781476621662195456474274594687914361549418457965396754758344480186631237390353165077531855318553448018653230165087943264695923424808183845796556457965574579387985530705225932166898953903530903511643768437424790359718523621662147213581650246198542168120
Speech (En)10002000300040005000600070008000900010000
ASR OutputBut these devices they tested are also interesting for the street planners because they don't do work with GPS and the limited information that are regularly uploaded by modem.
Case 4
Target (De)Diese Kartelle sind dumm, wenn sie unseren, sie künnten sich unter dem Radar hinweg durchgraben, sagte die Generalstaatsanwältn des US Distriks Southern California, Laura Duffy, bei einer Pressekconferenz vor einem Lagerhaus in San Diego, wo das eine Ende des Tunnels entdeckt worden war.(These cartels are stupid if they think that they can dig through under the radar, said the US Attorney for the District of Southern California, Laura Diffy, at a press conference held in front of a warehouse in San Diego, where the end of the tunnel was discovered.)
Unit71 82 11 45 64 29 28 92 89 23 62 74 27 31 59 33 17 51 19 29 8 5 30 65 6 49 92 31 87 69 74 27 47 76 53 185 53 67 77 98 69 65 377785388428989697427898969742789873072529432641858724614679818384579653967547583448018653230165077531855318553448018653230165077531855318553448018653230165077531855318553448018653230165077531855318553448018652943264185872461467894361578794326418579653967547583448018653230165077531855318553448018653230165077531855318553448018653230165077531855539675475834480186532301650775318553185534480186532301650775318553185534480186532301650775318553185344801865323016507753185531855344801865323016507753185531855344801865323016507753185531855344801864840858791857316998273627431569982893324684484808519701476940307242315699827362743156998289332468448480851970147694030724231569982736274315699828933246844848085197014769982736274315699828933246844848085197014769403072423156998273627431569982893324684484808519701476910000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Speech (En)100020003000400050006000700080009000100001200013000
ASR OutputThese cattles are stupid if you think you could dig through under the radar, the general proletariat of the USA district, said Southern California, Laura Duffy, at a warehouse conference in San Diego, where one end of the tunnel was discovered.
+ +Table 7: Examples of synthetic $\mathrm{En}\rightarrow \mathrm{De}$ ST data. + +BT4ST: French text $\rightarrow$ English speech + +
Case 1
Target (Fr)Ces automobilistes paieront bientôt à État des frais kilométriques au lieu des taxes sur essence. +(Those drivers will pay the mileage fees instead of gas taxes to the state.)
Unit71 82 11 45 64 29 28 37 24 61 9 85 73 16 50 14 19 16 66 47 11 53 90 35 62 6 15 49 7 69 44 80 60 70 14 19 74 27 57 47 59 33 94 32 64 65 15 49 92 57 31 87 94 32 64 74 2 66 50 24 13 58 17 19 65 3 77 11 45 64 81 84 57 96 55 39 67 54 57 86 53 44 80 18 6 15 49 92 57 31 87 9 85 73 16 77 66 27 89 87 91 43 6 15 7 23 19 90 35 11 64 44 80 18 27 31 59 33 91 43 2 89 6 15 7 11 64 81 29 6 15 41 20
Speech (En)0 1000 2000 3000 4000
ASR OutputThese automobilists soon will pay state mile fee instead of gasoline taxes.
Case 2
Target (Fr)Un scandale sur la présence de vande de cheval dans des plats cuisinés a éclaté en Europe au début de année, à la suite de tests effectuels en Irlande. +(A scandal on the presence of horse meat in prepared meals had broken out in Europe at the beginning of the year, following tests carried out in Ireland.)
Unit71 86 62 6 15 49 92 89 77 81 38 44 80 18 85 19 90 35 73 16 99 82 73 74 27 47 52 25 9 29 28 23 44 80 18 6 15 7 23 73 16 77 75 33 48 51 19 65 6 49 92 50 11 45 64 29 27 31 41 84 57 96 55 39 67 54 57 93 64 44 80 18 27 89 59 53 44 80 18 66 31 53 65 69 55 23 62 29 28 92 27 47 52 25 97 65 74 27 89 59 33 91 17 43 31 23 53 44 80 18 89 69 48 36 30 25 42 47 11 83 84 57 96 55 39 67 54 57 93 64 54 80 82 11 64 80 79 90 35 11 64 87 94 32 64 1 21 95 23 73 16 77 98 45 64 0 42 79 81 83 84 57 96 55 39 67 54 57 93 64 43 3 21 23 73 60 70 14 62 29 28 92 27 47 52 25 97 65 74 27 89 23 44 80 18 27 31 59 87 91 43 6 15 49 92 31 23 53 1 85 53 44 80 26 24 13 58 90 35 42 80 18 81 31 41 20
Speech (En)0 1000 2000 3000 4000 5000 6000 7000 9000
ASR OutputA scandal of the presence of horse meat in kitchen dishes pro-cut in Europe in the early age of year after it was pro-contested in Ireland.
Case 3
Target (Fr)La seule autre compagnie imposant de tels frais est la compagnie hongroise Wizz Air, a déclaré le consultant auprès de comptagnes aériennes Jay Sorensen, qui suit de prês les frais en supplément. +(The only other airline with such a fee is Hungary Wizz Air, said airline consultant Jay Sorensen, who closely tracks add-on fees.)
Unit71 82 11 45 64 37 51 90 35 11 64 37 68 99 82 5 30 65 3 52 25 11 45 64 29 28 92 27 89 59 33 68 16 74 2 47 23 44 80 85 11 64 65 6 15 7 87 68 9 74 21 23 44 80 81 30 75 33 68 44 80 18 66 89 98 87 0 30 25 11 32 53 44 80 60 70 14 76 53 62 29 28 60 70 14 76 53 62 29 28 75 33 68 44 80 18 66 89 98 87 0 30 25 11 32 53 44 80 60 70 14 76 53 62 29 28 75 33 68 44 80 18 66 89 98 87 0 30 25 11 32 53 44 80 60 70 14 76 53 62 29 31 23 53 44 80 18 66 89 98 87 0 30 25 11 32 53 44 80 60 70 14 76 53 62 29 31 23 53 44 80 18 66 89 98 87 0 31 23 53 44 80 18 66 89 98 87 0 30 25 11 32 53 44 80 60 70 14 76 53 62 29 31 23 53 44 80 18 66 89 87 0 30 25 11 32 53 44 80 60 70 14 76 53 62 29 31 23 53 44 80 18 66 89 87 0 30 25 11 32 53 44 80 61 15 7 87 9 66 82 73 74 27 89 59 23 44 80 18 65 14 79 24 51 19 74 2 31 23 53 88 18 27 31 59 23 69 16 74 27 31 59 23 69 16 74 27 31 59 23 69 16 74 27 31 59 23 69 16 74 27 31 59 23 69 16 74 27 31 59 23 69
Speech (En)0 1000 2000 3000 4000 5000 6000 7000 8000 9000
ASR OutputThe only other freeze companies such as fees is the Air Hungarian with Hungarian company said the consulting to Jay Sorensen Airlines following close to the cost.
Case 4
Target (Fr)Ces dernières accusations se basent entre autres sur deslettres rédigés par avocat des frères Sainte-Croix, Me Émile Perrin, dans les années 1990, mais aussi par les recherches faites dans les archives à ce suje par le frère Wilson Kennedy, un ancien frère de Sainte-Croix qui a dénoncé publiquement les services. +(The latter accusations are partly based on letters written by the lawyer of the brothers of the Holy Cross, Mr Emile Perrin QC, in the 1990s, as well as through research carried out in the archives on this subject by Brother Wilson Kennedy, a former brother of the Holy Cross who has publicly denounced the abuses.)
Unit71 86 53 44 80 82 73 90 35 24 61 43 6 15 49 92 31 41 84 96 55 39 67 54 57 93 86 91 43 74 2 89 98 69 29 28 87 28 87 94 32 65 23 42 80 18 29 28 49 41 84 96 55 67 54 57 93 70 52 25 53 74 22 380 +18 66 47 24 13 58 90 35 48 76 58 32 02 28 28 49 11 84 96 55 67 54 57 93 86 73 16 99 82 73 75 33 97 30 11 64 74 27 78 52 41 64 69 49 92 +47 52 24 68 99 82 5 42 29 48 41 84 96 55 67 54 57 93 86 73 16 50 11 45 64 53 90 35 94 32 64 74 26 49 92 50 11 64 81 84 96 55 67 54 57 93 75 33 97 30 11 64 81 84 96 55 67 54 57 93 75 33 97 30 11 64 81 84 96 55 67 54 57 93 75 33 97 30 11 64 81 84 95 60 48 51 19 65 6 +49 78796981846755675475939960570252696056747874221952913884480535448053448053448053448053448053448053448053448053448053448053448053448053448053448053448053448053448053448 +2461389982370317703177031770317703177031770317703177031770317703177031770317703177031770317703177031770317703177031 +266475224689982530731677035976969574278752246436974229849187918791879187918791879187918791879187918791879187918791879187918791879187918791879187918791879187918 +479035353742899035116416631237344802687911744182699231484965556754579354793547935479354793547935479354793547935479354793547935479354793547935479354793547935479354793547935547935479354793547935479354793547935479354793547935479354793547935479354793547935479354793547935479 +2849140
Speech (En)0 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+ +Table 8: Examples of synthetic $\mathrm{{En}} \rightarrow \mathrm{{Fr}}\mathrm{{ST}}$ data. + +BT4ST: Spanish text $\rightarrow$ English speech + +
Case 1
Target (Es)En la mayoría de las familias, cada uno desayuna solo. +(In a majority of families, everyone has breakfast separately.)
Unit71 86 53 44 80 18 50 24 97 65 6 49 92 3 77 87 94 38 17 16 50 90 35 11 64 29 28 49 41 84 57 96 55 67 54 57 40 57 93 86 45 64 74 21 95 60 70 14 68 44 80 18 66 47 52 25 91 43 74 2 3 77 23 62 6 49 92 31 23 73 19 90 35 24 68 97 81 20
Speech (En)0 +1000 +2000
+ +ASR Output | In most families, each one breakfast alone. + +Case 2 + +
Target (Es)Os sentáis al volante en la costa oeste, en San Francisco, y vuestra misión esninger los primeros a Nueva York. +(You get in the car on the west coast, in San Francisco, and your task is to be the first one to reach New York.)
Unit71 93 98 45 65 6 15 7 87 91 9 74 2 31 87 91 17 68 44 80 85 68 44 80 82 73 70 14 76 45 64 53 17 19 35 68 44 80 82 73 70 14 76 87 91 43 6 15 49 92 57 89 59 33 87 97 65 6 15 49 92 57 31 23 53 44 80 18 6 15 7 87 38 43 16 3 77 23 44 18 6 15 7 23 62 6 15 49 92 57 89 87 97 14 76 44 80 98 5 30 16 50 87 53 65 6 95 23 42 44 80 85 53 62 29 6 15 92 57 31 23 73 74 27 57 89 59 33 68 16 50 77 53 44 80 18 27 31 59 23 44 80 26 11 98 0 5 46 30 74 2 89 6 15 7 53 1 85 11 64 81 83 20
Speech (En)0 1000 2000 3000 4000
+ +ASR Output You sat down on the wheel on the west coast in San Francisco and your mission is to come into New York City. + +Case 3 + +
Target (Es)En la redacción seguramente tendremos una discussing sobre este durante various días, sobre si durante la programación del juego ninguno pensó siquiera un poco o si los autores de verdad nos toman por una Panda de bobos. +(For several days, our editorial staff kept discussing whether when designing the game no one thought for a moment or whether its authors really think we are such morons.)
Unit71 86 53 44 80 60 52 25 11 64 1 66 31 87 91 43 74 2 21 95 23 44 80 60 70 14 76 45 64 60 70 14 76 53 97 19 65 6 95 5 30 90 35 11 64 75 91 9 16 77 23 44 80 37 24 46 30 1 66 89 98 53 16 50 77 42 44 80 85 73 16 66 47 87 91 17 43 74 2 82 53 62 6 49 60 3 52 30 65 6 49 7 87 9 16 77 52 25 19 1 66 31 87 94 32 64 29 28 41 84 57 96 55 39 67 54 57 93 70 14 76 9 99 82 5 30 1 66 31 87 5 30 25 88 18 66 27 47 59 33 90 35 94 32 64 74 27 47 52 25 97 16 66 78 52 25 38 16 50 77 88 18 26 87 68 44 80 85 73 16 99 82 87 42 16 50 81 84 57 96 55 39 67 54 57 93 45 64 16 77 23 44 80 18 6 3 7 24 61 9 85 73 16 66 47 87 94 32 64 16 77 23 44 80 18 6 3 7 24 61 9 85 73 16 66 47 87 94 32 64 16 77 23 44 80 18 6 3 7 24 61 9 85 75 64 77 32 47 87 94 32 64 16 77 23 44 80 18 6 3 7 24 61 9 85 73 16 57 40 57 31 59 94 32 74 2 89 87 68 43 6 49 41 84 96 55 67 54 57 93 3 52 30 73 16 66 47 87 94 38 44 80 18 85 73 16 65 6 49 7 69 81 29 28 49 41 20
+ +ASR Output In reduction, we will surely have an argument about this for several days, whether during play programming none of them even thought of it, or whether the actual authors take us for a band of zoos. + +![](images/11f60ba8d8bb07aebd35a492fab49167e27180d8ea3e4f813d4f068dddfcd991.jpg) + +Case 4 + +
Target (Es)El avión especial, en el que tutueron que viajar a Podgorica, entrethers vicepresidentes Dalibor Kucera y Rajchl, no ha salido estañana por problemas tíncicos en Praga, teniendo que bucarse una alternatively para transporte a parte del comité executivo al lugar donde tendrá lugar el partido de clasificacion. +(An extra flight that was to take, among others, the Vice Presidentas Dalibor Kucera and Rajchl to Podgorica did not leave Prague in the morning due to a technical failure. An alternative was sought for in order to transport part of the executive board to the scene of the barraged rematch.)
Unit71 82 62 6 49 92 47 87 9 43 6 95 23 19 37 86 0 30 74 2 47 59 33 90 35 94 32 64 44 80 60 70 14 46 30 99 82 87 94 32 75 91 9 1 66 31 23 62 74 27 21 59 52 25 91 17 16 77 19 74 27 31 23 73 74 27 47 33 24 61 43 1 66 78 48 46 30 25 42 43 74 2 89 41 83 84 57 96 55 79 82 73 16 66 77 24 13 58 32 65 6 49 92 47 52 25 99 28 23 1 85 53 42 44 80 18 2 6 15 49 41 84 96 55 67 54 93 66 31 87 91 17 19 90 35 73 16 66 47 48 46 30 74 2 27 78 33 69 65 74 27 89 59 98 0 30 25 37 86 38 44 80 18 70 52 25 91 43 74 2 21 95 60 48 19 81 83 84 57 96 55 39 67 54 57 93 75 91 9 29 28 92 26 24 61 43 74 2 89 59 33 68 16 50 87 91 17 43 74 2 82 62 64 92 92 50 48 46 30 80 85 42 88 81 83 84 57 96 55 67 54 57 93 32 30 16 74 27 47 52 24 61 43 1 66 2 27 31 59 87 9 43 74 2 26 73 74 27 28 89 78 19 74 27 47 52 24 61 16 66 47 90 35 42 16 75 53 18 85 53 18 85 53 18 85 53 18 85 53 18 85 53 18 85 53 18 85 53 18 85 53 18 85 53 18 85 53 18 85 53 18 86 0 30 99 82 73 70 52 25 94 32 64 85 88 18 27 47 33 24 46 30 185 11 64 60 70 14
+ +The special airplane where they had to travel to Pagoric. Among others, the vice-presidents Dalibor, Kukir, and Rachel has not come out this morning for broad technical problems, having to look for an alternative to transport part of the committee executive to the place where the rating party was going to be held. + +![](images/e6f1c028455fc3addf965847c6d71787c896718d980eaea42f81ce05e0d293c5.jpg) + +Table 9: Examples of synthetic $\mathrm{{En}} \rightarrow \mathrm{{Es}}\mathrm{{ST}}$ data. + +
Diverse BT4ST: One German text→Multiple English speeches
Target (De)Wegen der aufwendigen Ausstattung des Tunnels gehen die Ermittler davon aus, dass er von Architekten und Ingenieuren konstruirt wurde und dass der Bau rund ein Jahr in Anspruch nahm.(Due to the elaborate configuration of the tunnel, investigators are working on the assumption that it was build by architects and engineers and that the construction took around one year.)
Output 1
Unit71 47 11 45 64 74 27 89 78 33 24 61 68 9 29 28 23 73 16 99 82 11 64 53 73 74 27 78 14 76 53 16 74 2 50 42 44 80 85 73 16 99 82 73 62 74 27 31 59 33 68 44 80 85 19 81 83 84 57 96 39 67 54 57 93 82 11 45 64 53 44 80 18 66 77 87 9 43 6 49 92 31 23 73 1 66 89 94 32 64 85 5 30 29 28 23 73 16 50 87 91 1 21 95 23 42 44 80 18 82 87 9 85 53 60 70 14 76 62 29 28 92 57 89 23 44 80 18 64 99 21 52 24 61 43 2 31 23 53 1 66 47 24 13 58 37 24 46 30 74 2 89 23 62 74 27 31 59 87 91 9 43 74 2 6 49 7 23 44 80 85 87 38 44 80 18 21 95 23 44 80 26 11 45 64 0 79 29 28 49 41 84 57 96 55 39 67 54 57 86 38 44 80 82 87 9 74 2 82 73 74 27 89 23 44 80 18 6 49 92 52 24 68 43 74 2 95 23 44 80 85 73 16 77 53 20 52 25 91 17 44 18 85 11 98 45 64 0 79 81 83 20
Speech (En)0 1000 2000 3000 4000 5000 6000 7000
ASR OutputBecause of the equipment of the tunnel. The investigators imagined that it was constructed by architects and engineers, and that the construction of around a year.
Output 2
Unit71 47 45 74 27 89 59 33 68 9 29 28 23 73 16 99 66 82 73 74 27 47 59 33 91 43 6 15 7 23 62 1 21 95 92 27 31 59 33 68 44 80 85 19 90 35 73 74 27 78 14 76 53 9 74 27 31 59 33 68 44 80 85 19 90 35 73 74 27 78 14 76 53 9 74 27 31 59 33 68 44 80 85 19 90 35 73 74 72 27 78 14 76 53 9 74 27 31 59 33 68 44 80 85 19 90 35 73 74 72 27 78 14 76 53 9 74 27 31 59 33 68 43 6 15 7 23 62 1 21 95 92 27 31 59 33 68 44 80 85 19 90 35 73 74 27 78 14 76 53 9 74 27 31 59 33 56 73 74 27 78 14 76 53 9 74 27 31 59 33 68 43 6 15 7 23 62 1 21 95 92 27 31 59 33 68 43 6 15 7 23 62 1 21 95 92 27 31 59 33 68 43 6 15 7 23 62 1 21 95 92 27 31 59 33 68 +3264543423136689421324614342313664724313664724313664724313664724313664724313664724313664724313664724313664724313664724313664724313664724
Speech (En)0 1000 2000 3000 4000 5000 6000 7000
ASR OutputBecause of the passage tunnel equipment, the investigators raised that it was constructed by architects and engineers, and that the construction was one year.
Output 3
Unit71 47 11 45 64 74 27 89 59 33 68 9 29 28 23 73 16 99 82 11 64 53 73 74 27 78 14 76 53 9 74 2504244182312373169982736274273159336844808519818348456495564955649556495564955649556495564955649556495564955649556495564955649556495564955649556495564955649
Speech (En)0 1000 2000 3000 4000 5000 6000 7000
ASR OutputBecause of the equipment of the tunnel. The investigator assumes that it was constructed by architects and engineers and that the round eventually taken a year.
Output 4
Unit71 82 11 45 64 53 44 80 18 66 77 87 9 43 6 49 92 31 23 73 74 27 89 59 94 32 64 65 6 9523448085731699827362742731593368808519818348456495564955649556495564955649556495564955649556495564955649556495564955649556495564955
Speech (En)0 1000 2000 3000 4000 5000 6000 7000 8000
ASR OutputThe investigation of the tunnel is the investigation has been designed by architects and engineers and that the construction of the construction of a year.
+ +Table 10: Examples of synthetic $\mathrm{En}\rightarrow \mathrm{De}$ ST data generated by Diverse BT4ST method. + +A For every submission: + +A1. Did you describe the limitations of your work? Limitations +A2. Did you discuss any potential risks of your work? Ethics Statement +A3. Do the abstract and introduction summarize the paper's main claims? Abstract, Section 1 +A4. Have you used AI writing assistants when working on this paper? Left blank. + +B Did you use or create scientific artifacts? + +Section 4 + +B1. Did you cite the creators of artifacts you used? Section 4 +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? The data and pre-trained model we used are only for research purposes without violating the license. +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? Ethics Statement +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? We use MuST-C and WMT datasets without modification, which are all widely used public datasets. We don't think this needs much discussion. +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? Section 4 +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. Section 4 + +C Did you run computational experiments? + +Section 5 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? Section4, Section 5 + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? Section 4, Section 5 +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? Section 5 +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? Section 4 + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? No response. +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? No response. +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? No response. +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? No response. +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? No response. \ No newline at end of file diff --git a/backtranslationforspeechtotexttranslationwithouttranscripts/images.zip b/backtranslationforspeechtotexttranslationwithouttranscripts/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..26e9bae2733f672e89791c7f943a287059ff753a --- /dev/null +++ b/backtranslationforspeechtotexttranslationwithouttranscripts/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8d8fa17577e16a1effc280d0e0cc7f52039278a8e68009f46460754f010aa3c5 +size 2054882 diff --git a/backtranslationforspeechtotexttranslationwithouttranscripts/layout.json b/backtranslationforspeechtotexttranslationwithouttranscripts/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..65265edbbf4ca73101ae808c22827a8a6b92587b --- /dev/null +++ b/backtranslationforspeechtotexttranslationwithouttranscripts/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c71414e80b9a7073d490b2f7d540191e2e603419c6aaf6eef5a7d7ef6bb782ca +size 666568 diff --git a/beingrightforwhoserightreasons/3147c74d-3973-4eda-aa53-13baf1d72381_content_list.json b/beingrightforwhoserightreasons/3147c74d-3973-4eda-aa53-13baf1d72381_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..486a05c50796f8b7fc5a394cd2c7e325a88b679f --- /dev/null +++ b/beingrightforwhoserightreasons/3147c74d-3973-4eda-aa53-13baf1d72381_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:13bb210f18cae9fbaa16c346814635a10d4f2f39ecec68c87719c4f7d882a1da +size 133401 diff --git a/beingrightforwhoserightreasons/3147c74d-3973-4eda-aa53-13baf1d72381_model.json b/beingrightforwhoserightreasons/3147c74d-3973-4eda-aa53-13baf1d72381_model.json new file mode 100644 index 0000000000000000000000000000000000000000..f033bd7a2067c23f9513d944b26b7a498504d042 --- /dev/null +++ b/beingrightforwhoserightreasons/3147c74d-3973-4eda-aa53-13baf1d72381_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fbae1d24482c36a8e7be0ee28e6c59b626f53b6197f14994e65e9ce3e95318f9 +size 163433 diff --git a/beingrightforwhoserightreasons/3147c74d-3973-4eda-aa53-13baf1d72381_origin.pdf b/beingrightforwhoserightreasons/3147c74d-3973-4eda-aa53-13baf1d72381_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c5949c3c97fe84ff0cb4ea232d1a9b4ca194883c --- /dev/null +++ b/beingrightforwhoserightreasons/3147c74d-3973-4eda-aa53-13baf1d72381_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1aac0d612696b30730508fd7aa69ca722e5d2d2cf70f9f091a8dea754952e509 +size 1240133 diff --git a/beingrightforwhoserightreasons/full.md b/beingrightforwhoserightreasons/full.md new file mode 100644 index 0000000000000000000000000000000000000000..bc67bed814c96b57ae383d1cf6cd81f19669e5ab --- /dev/null +++ b/beingrightforwhoserightreasons/full.md @@ -0,0 +1,606 @@ +# Being Right for Whose Right Reasons? + +Terne Sasha Thorn Jakobsen\*123, Laura Cabello\*3, Anders Søgaard + +$^{1}$ Copenhagen Center for Social Data Science + +$^{2}$ Copenhagen Research Center for Mental Health + +3University of Copenhagen + +terne.thorn@sodas.ku.dk, lcp@di.ku.dk, soegaard@di.ku.dk + +# Abstract + +Explainability methods are used to benchmark the extent to which model predictions align with human rationales i.e., are 'right for the right reasons'. Previous work has failed to acknowledge, however, that what counts as a rationale is sometimes subjective. This paper presents what we think is a first of its kind, a collection of human rationale annotations augmented with the annotators demographic information. We cover three datasets spanning sentiment analysis and common-sense reasoning, and six demographic groups (balanced across age and ethnicity). Such data enables us to ask both what demographics our predictions align with and whose reasoning patterns our models' rationales align with. We find systematic inter-group annotator disagreement and show how 16 Transformer-based models align better with rationales provided by certain demographic groups: We find that models are biased towards aligning best with older and/or white annotators. We zoom in on the effects of model size and model distillation, finding - contrary to our expectations - negative correlations between model size and rationale agreement as well as no evidence that either model size or model distillation improves fairness. + +# 1 Introduction + +Transparency of NLP models is essential for enhancing protection of user rights and improving model performance. A common avenue for providing such insight into the workings of otherwise opaque models comes from explainability methods (Páez, 2019; Zednik and Boelsen, 2022; Baum et al., 2022; Beisbart and Räz, 2022; Hacker and Passoth, 2022). Explanations for model decisions, also called rationales, are extracted to detect when models rely on spurious correlations, i.e., are right for the wrong reasons (McCoy et al., 2019), or to analyze if they exhibit human-like inferential + +![](images/d98915b4df86e074a3476ab6439150047b3aa8153c9bd04baff9645318452c9b.jpg) +Figure 1: Experimental setup for a sentiment analysis task. For a given instance, annotators are asked to choose a label and mark supporting evidence for their choice. For instances with full label agreement, we compare alignment of rationales (group-group alignment). We do the same to measure group-model alignment through attention- and gradient-based explainability methods. + +semantics (Piantadosi and Hill, 2022; Ray Choudhury et al., 2022). Furthermore, model rationales are used to evaluate how well models' behaviors align with humans, by comparing them to human-annotated rationales, constructed by having annotators mark evidence in support of an instance's label (DeYoung et al., 2019). Human rationales are, in turn, used in training to improve models by guiding them towards what features they should (or should not) rely on (Mathew et al., 2021; Rajani et al., 2019). + +While genuine disagreement in labels is by now a well-studied phenomenon (Beigman Klebanov and Beigman, 2009; Plank et al., 2014; Plank, 2022), little attention has been paid to disagreement in rationales. Since there is evidence that human rationales in ordinary decision-making differ across demographics (Stanovich and West, 2000), we cannot, it seems, blindly assume that what counts as a rationale for one group of people, e.g., young men, also counts as a rationale for another group of people, e.g., elderly women. This dimension has not been explored in fairness research either. Could it be that some models that exhibit perfor + +mance parity, condition on factors that align with the rationales of some groups, but not others? + +Contributions We present a collection of three existing datasets with demographics-augmented annotations to enable profiling of models, i.e., quantifying their alignment1 with rationales provided by different socio-demographic groups. Such profiling enables us to ask whose right reasons models are being right for. Our annotations span two NLP tasks, namely sentiment classification and common-sense reasoning, across three datasets and six demographic groups, defined by age {Young, Old} and ethnicity {Black/African American, White/Caucasian, Latino/Hispanic}. We investigate label and rationale agreement across groups and evaluate to what extent groups' rationales align with 16 Transformer-based models' rationales, which are computed through attention- and gradient-based methods. We observe that models generally align best with older and/or white annotators. While larger models have slightly better prediction performance, model size does not correlate positively with neither rationale alignment nor fairness. Our work constitutes multi-dimensional research in off-the-beaten-track regions of the NLP research manifold (Ruder et al., 2022). We make the annotations publicly available.2 + +# 2 Fairness and Rationales + +Fairness generally concerns the distribution of resources, often across society as a whole. In NLP, the main resource is system performance. Others include computational resources, processing speed and user friendliness, but performance is king. AI fairness is an attempt to regulate the distribution of performance across subgroups, where these are defined by the product of legally protected attributes (Williamson and Menon, 2019). + +NLP researchers have uniformly adopted American philosopher John Rawls' definition of fairness (Larson, 2017; Vig et al., 2020; Ethayarajh and Jurafsky, 2020; Li et al., 2021; Chalkidis et al., 2022), defining fairness as performance parity, except where it worsens the conditions of the least advantaged. Several dozen metrics have been proposed, based on Rawls' definition (Castelnovo et al., 2022), some of which are argued to be in + +consistent or based on mutually exclusive normative values (Friedler et al., 2021; Castelnovo et al., 2022). Verma and Rubin (2018) grouped these metrics into metrics based only on predicted outcome, e.g., statistical parity, and metrics based on both predicted and actual outcome, e.g., performance parity and accuracy equality. Corbett-Davies and Goel (2018) argue that metrics such as predictive parity and accuracy equality do not track fairness in case of infra-marginality, i.e., when the error distributions of two subgroups are different. For a better understanding of the consequences of infra-marginality we refer to Biswas et al. (2019) and Sharma et al. (2020). Generally, there is some consensus that fairness in NLP is often best evaluated in terms of performance parity using standard performance metrics (Williamson and Menon, 2019; Koh et al., 2020; Chalkidis et al., 2022; Ruder et al., 2022). We do the same and evaluate fairness in group-model rationale agreement quantifying performance differences (understanding performance as degree of rationale agreement) across end user demographics. In doing so, we are embodying group fairness values: that individuals should be treated equally regardless of their protected attributes, i.e., group belonging. + +Fairness and explainability are often intertwined in the literature due to the assumption that transparency, through explainability methods, makes it possible to identify which models are right for the right reasons or, on the contrary, right by relying on spurious, potentially harmful, patterns (Langer et al., 2021; Balkir et al., 2022). This study tightens the connection between fairness and explainability, investigating whether model rationales align better with those of some groups rather than others. If so, this would indicate that models can be more robust for some groups rather than others, even in the face of performance parity on dedicated evaluation data. That is: We ask whether models are equally right for the right reasons (with the promise of generalization) across demographic groups. + +# 3 Data + +We augment a subset of data from three publicly available datasets spanning two tasks: DynaSent (Potts et al., 2020) and SST (Socher et al., 2013) $^3$ , for sentiment classification and CoS-E (Talmor et al., 2019; Rajani et al., 2019) for common-sense + +![](images/e6891ef570ba4c0faaf88a311cb8621f2fd939ef43b7bfcf0d90d698c0e1d884.jpg) +Figure 2: Overview of the annotation collection process from annotator recruitment criteria, to the annotation itself, and finally annotator exclusion criteria. Separately for each dataset, annotators are recruited via Prolific using specific filters for age, ethnicity and participation status. Recruits are directed to a Qualtrics survey containing, in consecutive order, a consent form, a short demographics survey, instructions for the annotation task and then approx. 10 randomly selected instances of which annotators provide both labels and rationales for. After annotation, some annotators' responses are excluded from our analysis due to certain mismatches in responses. The annotation process is detailed further in section 3.1 and we show the instructions and task examples in appendix A. + +![](images/f420b4167e74df19ec5b5a5dd56bcac5ae1d625ba7d2441d7dea6eb0cbf22fae.jpg) + +reasoning. $^{4}$ For each dataset, we crowd-source annotations for a subset of the data. We instruct annotators to select a label and provide their rationale for their choice by highlighting supporting words in the given sentence or question. Table 1 shows statistics of the annotations collected. Annotation guidelines are explained in § 3.1 (and included in full in Appendix A) and recruitment procedures are explained in § 3.2. + +
AnnotatorsAnnotations
×GroupTotalTotal
DYNASENT482882,880
SST-2261561,578
Cos-E503003,000
TOTAL1247447,458
BEFORE EXCL.*-9299,310
+ +Table 1: Summary of the annotated data, showing, for each dataset, the amount of annotators within the six demographic groups, the total amount of annotators and the amount of annotations after workers have annotated approx. 10 instances each. Reported numbers are after exclusions as described in § 3.2. *We publicly share all annotated data which includes annotators that were excluded from our analyses. + +# 3.1 Annotation Process + +We summarize the process of collecting annotations in Figure 2, where we depict a three-step process: recruitment, annotation and exclusion. In this section, we start by describing the second step - annotation - and explain what is annotated and how it is annotated. We describe our recruitment and exclusion criteria in the following section, 3.2. + +Annotators are directed to a Qualtrics5 survey + +and presented with $i)$ a consent form, $ii)$ a short survey on demographics, $iii)$ instructions for their annotation task and lastly, $iv)$ a randomly selected set of $n \approx 10$ instances to annotate, out of a subset of size $N$ . As a result of this procedure, each group, for each dataset, is represented by approximately $N / n$ annotators. Data points are annotated for both classification labels and extractive rationales, i.e., input words that motivate the classification. + +Existing rationale datasets are typically constructed by giving annotators 'gold standard' labels, and having them provide rationales for these labels. Instead, we let annotators provide rationales for labels they choose themselves. This lets them engage in the decision process, but it also acknowledges that annotators with different backgrounds may disagree on classification decisions. Explaining other people's choices is error-prone (Barasz and Kim, 2022), and we do not want to bias the rationale annotations by providing labels that align better with the intuitions of some demographics than with those of others. For the sentiment analysis datasets, we discard neutral instances because rationale annotation for neutral instances is ill-defined. Yet, we still allow annotators to evaluate a sentence as neutral, since we do not want to force our annotators to provide rationales for positive and negative sentiment that they do not see. + +DynaSent We re-associate $N = 480$ instances six times (for six demographic groups), comprising 240 instances labeled as positive, and 240 instances labeled as negative in the DynaSent Round 2 test set (see Potts et al. (2020)). This amounts to 2,880 annotations, in total. Our sentiment label annotation follows the instructions of Potts et al. (2020). To annotate rationales, we formulate the task as marking "supporting evidence" for the label, following how the task is defined by DeYoung et al. + +(2019). Specifically, we ask annotators to mark all the words, in the sentence, they think shows evidence for their chosen label. + +SST-2 We re-announce $N = 263$ instances six times (for six demographic groups), which are all the positive and negative instances from the Zucodataset of Hollenstein et al. (2018)6, comprising a mixture of train, validation and test set instances from SST-2, which we remove from the original data before training the models. Instructions for sentiment annotations build on the instructions by Potts et al., combined with a few examples from Zaidan et al. (2007). The instructions for annotating rationales are the same as for DynaSent. + +CoS-E We re-associate $N = 500$ instances from the test set six times (for six demographic groups) and ask annotators to firstly select the answer to the question that they find most correct and sensible, and then mark words that justifies that answer. Following Chiang and Lee (2022), we specify the rationale task with a wording that should guide annotators to make short, precise rationale annotations: + +'For each word in the question, if you think that removing it will decrease your confidence toward your chosen label, please mark it.' + +# 3.2 Annotator Population + +We recruited annotators via Prolific based on two main criteria, age and ethnicity, previously identified as related to unfair performance differences of NLP systems (Hovy and Søgaard, 2015; Jørgensen et al., 2016; Sap et al., 2019; Zhang et al., 2021). + +Recruitment In our study, there is a trade-off between collecting annotations for a diverse set of data instances (number of tasks and sentences) and for a diverse set of annotators (balanced by demographic attributes), while keeping the study affordable and payment fair. Hence, when we want to study differences between individuals with different ethnic backgrounds, we can only study a subset of possible ethnic identities (of which there are many categories and diverging definitions). We balanced the number of annotators + +across three ethnic groups — Black/African American (B), Latino/Hispanic (L) and White/Caucasian (W) — and two age groups — below 36 (young, Y) and above 37 (old, O), excluding both — whose cross-product results in six sub-groups: {BO, BY, LO, LY, WO, WY}. We leave a two-year gap between the age groups in order to not compare individuals with very similar ages. Furthermore, the age thresholds are inspired by related studies of age differences in NLP-tasks and common practices in distinguishing groups with an age gap (Johannsen et al., 2015; Hovy and Søgaard, 2015) and around the middle ages (Zhang et al., 2021). Our threshold also serves to guarantee sufficient proportions of available crowdworkers in each group. Our ethnicity definition follows that of Prolific, which features in a question workers have previously responded to and hence are recruited by, defining ethnicity as: + +[a] feeling of belonging and attachment to a distinct group of a larger population that shares their ancestry, colour, language or religion' + +While we do not require all annotators to be fluent in English, we instead ask about their English-speaking abilities in the demographics survey and find that $75\%$ of the participants speak English "very well" and only $1\%$ "not well", and the remaining "well". + +Exclusions Annotators who participated in annotating one task were excluded from participating in others. After annotation, we manually check whether a participant's answers to our short demographics survey correspond to their recruitment criteria. We found many discrepancies between recruitment ethnicity and reported ethnicity, especially for Latino/Hispanic individuals, who often report to identify as White/Caucasian. This highlights the difficulty of studying ethnicities as distinct, separate groups, as it is common to identify with more than one ethnicity7. Hence, the mismatches are not necessarily errors. For our experiments, we decided to exclude participants with such mismatches and recruit new participants to replace their responses (see Appendix B for further details). A smaller amount of participants were excluded due to mismatch in reported age or due + +to failing a simple attention check. We release annotations both with and without the instances excluded from our analyses. The final data after preprocessing consist of one annotation per instance for each of the six groups, i.e., six annotations per instance in total. Annotators annotated (approximately) 10 instances each. All participants were paid equally. + +# 4 Experiments + +We first conduct an analysis of group-group label agreement (i.e., comparing human annotator groups with each other, measuring human agreement on the sentiment and answer labels) and rationale agreement (measuring human agreement on rationale annotations) to characterize inter-group differences. We then move to group-model agreement (comparing the labels and rationales of our annotator groups to model predictions and model rationales) and ask: Do models' explanations align better with certain demographic groups compared to others? In our analysis, we further focus on how rationale agreement and fairness behave depending on model size and model distillation. + +We probe 16 Transformer-based models8. To ease readability, we will use abbreviations following their original naming when depicting models' performance9. + +We fine-tune the models individually on each dataset (see Figure 3). SST-2 and CoS-E simplified $^{10}$ are modeled as binary classification tasks; DynaSent is modeled as a ternary (positive/negative/neutral) sentiment analysis task. We exclude all annotated instances from the training splits; for CoS-E, we downsample the negative examples to balance both classes in the training split. After fine-tuning for 3 epochs, we select the checkpoint with the highest validation accuracy to run on our test (annotated) splits and apply two explainability methods to obtain input-based explanations, i.e., rationales, for the predictions made. + +We measure label agreement with appropriate variants of $\mathrm{F_1}$ (SST-2 binary- $\mathrm{F_1}$ ; DynaSent macro- $\mathrm{F_1}$ ; CoS-E mean of binary- $\mathrm{F_1}$ towards the negative and the positive class). CoS-E simplified represents a slightly different task (see footnote 10) from what the annotators were presented to solve (a multiclass question-answering task). To correctly measure label agreement, we evaluate whether a model predicts 'True' for the question-answer pair with the answer selected by the annotator. Therefore, to avoid misleading $\mathrm{F_1}$ scores if, for example, a model predominantly predict True, we report the mean of the $\mathrm{F_1}$ towards each class. We explain below how we measure rationale agreement. + +Explainability methods We analyze models' predictions through two families of post-hoc, attribution-based[11] explainability methods: Attention Rollout (AR) (Abnar and Zuidema, 2020) and Layer-wise Relevance Propagation (LRP) (Bach et al., 2015), a gradient-based method. Ali et al. (2022) compare these methods, showing how their predicted rationales are frequently uncorrelated. Both AR and LRP thus provide token level rationales for a given input, but while AR approximates the relative importance of input tokens by accumulating attention, LRP does so by backpropagating 'relevance' from the output layer to the input, leading to sparser attribution scores. We rely on the rules proposed in Ali et al. (2022), an extension of the original LRP method (Bach et al., 2015; Arras et al., 2017) for Transformers, aiming to uphold the conservation property of LRP in Transformers as well. This extension relies on an "implementation trick", whereby the magnitude of any output remains intact during backpropagation of the gradients of the model. + +Comparing rationales Attention-based and gradient-based methods do not provide categorical relevance of the input tokens, but a vector $S_{i}$ with continuous values for each input sentence $i$ . We translate $S_{i}$ into a binary vector $S_{i}^{b}$ following the procedure from Wang et al. (2022) for each group. We define the top- $k^{gd}$ tokens as rationales, where $k^{gd}$ is the product of the current sentence length (tokens) and the average rationale length ratio (RLR) of a group $g$ within a dataset $d$ . On average, RLR for SST-2 are shorter (29.6%) com + +pared to DynaSent (31.9%) and CoS-E (33.0%) (see Appendix B for specific values). Models' outputs are also preprocessed to normalize different tokenizations and to match the input format given to annotators. + +After aligning explanations from models and annotators in the same space, we can compare them. We employ two metrics specifically designed to evaluate discrete rationales: token-level $\mathrm{F}_1$ (token- $\mathrm{F}_1$ ) (Equation 1) (DeYoung et al., 2019; Wang et al., 2022), and Intersection-Over-Union $\mathrm{F}_1$ (IOU- $\mathrm{F}_1$ ) (Equation 3) as presented in (DeYoung et al., 2019). These metrics are flexible enough to overcome the strictness of exact matching.[12] + +# 5 Results and Discussion + +Figure 3 shows group-model label agreement over our annotated data.13 Error bars show the variability between best and worst performing groups. CoS-E exhibits the lowest variability, indicating less variability in label agreement between groups. + +When annotators disagree on the label of an instance, it is to be expected that their rationales will subsequently be different. Therefore, to compare group-group (§ 5.1) and group-model (§ 5.2) rationales more fairly, we focus on the subset of instances where all groups are in agreement about + +12Formally, + +$$ +\operatorname {t o k e n} - F _ {1} = \frac {1}{N} \sum_ {i = 1} ^ {N} 2 \times \frac {P _ {i} \times R _ {i}}{P _ {i} + R _ {i}} \tag {1} +$$ + +where $P_{i}$ and $R_{i}$ are the precision and recall for the $i^{th}$ instance, computed by considering the overlapped tokens between models' and annotators' rationales. To measure Intersection-Over-Union, we define the categorical vector given by the annotators for each sample as $A_{i}$ . Thereby, + +$$ +\mathrm {I O U} _ {i} = \frac {\left| S _ {i} ^ {b} \cap A _ {i} \right|}{\left| S _ {i} ^ {b} \cup A _ {i} \right|} \tag {2} +$$ + +and + +$$ +\mathrm {I O U} - F _ {1} = \frac {1}{N} \sum_ {i = 1} ^ {N} \left\{ \begin{array}{l l} 1 & \text {i f I O U} _ {i} \geq 0. 5 \\ 0 & \text {o t h e r w i s e .} \end{array} \right. \tag {3} +$$ + +These metrics account for plausibility (DeYoung et al., 2019) of the models' rationales, i.e., the degree to which they are agreeable to humans, as well as the extent to which models are 'right for the right reasons' (McCoy et al., 2019). Since we are interested in comparing rationale alignment between groups and between groups and models, measuring plausibility is our go-to. Other research (Jacovi and Goldberg, 2020; Setzu et al., 2021) focus on properties like faithfulness, which reflect a model's true decision process, i.e., whether the provided rationale influenced the corresponding decision, generally measured through perturbation experiments. + +13See Figure 12 in Appendix C for a detailed representation of group-model label agreement. + +![](images/05b77e39801164d22cb17d490fdb5effc4df66c1340f5890b645f5ef6cf77c17.jpg) +Figure 3: Group-model label agreement over our annotated data, measured by F1-score. Error bars show variance between the best and worst performing groups. Models are ordered by size from smallest to largest from left to right. + +the label, i.e., instances with full label agreement. This amounts to 209, 152 and 161 instances for DynaSent, SST-2 and CoS-E, respectively. + +# 5.1 Analysis of Group-Group Agreement + +We first want to quantify how different the rationales of one group are to those of others, and more generally to a random population. We compare each groups' set of rationales to a random paired set of rationales, where the rationale of each instance is randomly picked from one of the five other groups. Figure 4 shows the overall agreement score, average token- $\mathrm{F}_1$ across datasets, and its standard deviation from 20 random seeds, i.e., 20 random combinations of paired rationales. We observe that rationales of White annotators (WO, WY) are on average more similar to others while the average difference with the rationales of minority groups like, for example, Black Young (BY), is greater. + +We then compute the level of rationale agreement (token- $\mathrm{F}_{1}$ ) between all groups (heatmaps on Figure 4) and observe that, in general, differences in group-group rationale agreement are consistent across datasets (tasks): Black Youngs (BY) have lower alignment with others, especially in sentiment analysis tasks. While the definition of rationales for DynaSent seems to be easier (higher values of agreement), it seems to be harder (lower values of agreement) for CoS-E, even when the label is agreed upon. We hypothesize this is due to the complexity of the CoS-E task itself, which also leads to more lengthy rationales, as reflected by the average RLR reported on § 4, probably in + +![](images/c22e54d22c7ca14a9a0abe9220677c6937008001bcbf15ecc373cce7c90a6229.jpg) +Figure 4: Group-group rationale agreement for instances with full label agreement. Agreement is measured by token-level binary $\mathrm{F}_1$ . On the left side, average and std (error bar) token- $\mathrm{F}_1$ for 20 random combinations of paired group rationales over all datasets. On the right, each group-group agreement for each dataset. We observe lower agreement for BY except in CoS-E. WO tends to agree more with other groups, especially in CoS-E. + +![](images/73cbd2396eda745c8aad73cf54604ff842cb336c3fc788d943b42623f17e90f7.jpg) + +![](images/97feaca26606dab34aee5a726d6bfdaab314960a4f8b99428f27497d825cc89a.jpg) + +![](images/112961938f512ef738e5f72c071f89ad6eba9f41f46dfea79739dd07e7703588.jpg) + +the absence of a clear motivation for the selected answer. + +The definition of what is common-sense varies across cultures and it is related to a person's background (Hershcovich et al., 2022), which makes CoS-E a highly subjective task14. Take for example the question 'Where would you find people standing in a line outside?' with these potential answers: 'bus depot', 'end of line', 'opera', 'neighbor's house' and 'meeting'. Even if there is agreement on the correct choice as 'bus depot', the rationale behind it could easily differ amongst people, i.e., it could be due to 'people standing', or the fact that they are standing in 'a line outside', or all together. + +# 5.2 Analysis of Group-Model Agreement + +Now that we have analyzed group-group agreement, we measure the alignment between groups' rationales and models' rationales. We analyze predictions from 16 Transformer-based models and employ AR and LRP to extract model rationales. Methods for comparing rationales and measuring group-model agreement are explained in Section 4. + +Socio-demographic fairness Figure 5 shows a systematic pattern of model rationales aligning better with the rationales of older annotators in each ethnic group (BO, LO, WO) on the sentiment datasets. The only exception is White Young (WY) annotators in SST-2, whose median token- $\mathbf{F}_1$ is higher than their older counterpart. We argue this is due, in part, to the data source of the tasks themselves. While DynaSent constitutes an ensemble of diverse customer reviews, SST is based on movie review excerpts from Rotten Tomatoes with a more informal language, popular amongst younger users. Findings from Johannsen et al. (2015) and Hovy + +![](images/c17cdc1c55dedb503fb9aa909fb85e77ddcd13aaf4792120f659341f1957eb98.jpg) +Figure 5: Box-plots of group-model rationale alignment for the two sentiment datasets measured with token- $\mathbf{F}_1$ . Model rationales are extracted with LRP. Each dot represents a model's token- $\mathbf{F}_1$ score for the respective group. We see that for each ethnic group, model rationales align better with rationales of older annotators, except for White Young (WY) annotators of SST-2. Distil-RoBERTa (dr) is an outlier, consistently showing the best scores in both datasets across groups. + +and Søgaard (2015) indicate that there exist grammatical differences between age groups. Johannsen et al. (2015) further showed several age and gender-specific syntactic patterns that hold even across languages. This would explain not only the noticeable group-group differences when marking supporting evidence (lexical structures) for their answers, but also the agreement disparity reflected by models fine-tuned on potentially age-biased data. + +Results are consistent with previous findings of + +![](images/ba99a785a3acb76f3cc8deb6973e80e27e2083ef2fcbbd56cb53c73e2e479578.jpg) +Figure 6: Group-model rationale alignment (token- $\mathrm{F}_1$ ). Error bars show the distance between the groups with the highest and lowest scores. On the X-axis, models are ordered from smallest to largest. We show Spearman correlation coefficients, $\rho$ , between token- $\mathrm{F}_1$ scores (the concatenation of all groups' scores) and model sizes (in Million parameters), finding token- $\mathrm{F}_1$ to be negatively correlated with model size in most cases. + +Zhang et al. (2021), who show a variety of language models aligning better with older, white annotators, and worse with minority groups, in word prediction tasks. We observe that group-model rationale agreement does not correlate with group-model class agreement, i.e., when a model performs well for a particular group, it does not necessarily entail that its rationales, or learned patterns, align. Group-model rationale agreement evaluated with Attention Rollout and CoS-E are shown in Figure 13 in Appendix C, along with results using the complementary metric $(\mathrm{IOU - F_1})$ . The patterns derived from them are in line with those in Figure 5: AR shows similar behaviours as LRP, but leads to larger variation between models. However CoS-E, which, as explained, is a very different task, does not seem to exhibit big group differences. This is also noticeable in Figure 6, where error bars show the distance between groups with the highest and lowest level of agreement in every model. + +The role of model size In general, larger language models seem to perform better on NLP tasks. In our setting, Figure 3 shows a positive trend with model size: larger models achieve, in general, higher performance. Could it be the case that larger language models also show higher rationale agreement? And, are they consequently more fair? We evaluate fairness in terms of performance parity: min-max difference between the group with the lowest and highest token- $\mathbf{F}_1$ (per model). Relying on min-max difference captures the widely shared intuition that fairness is always in the service of the worst off group (Rawls, 1971). + +Contrary to our expectations, Figure 6 shows how token- $\mathrm{F}_1$ scores actually decrease with model size - with CoS-E model rationales from LRP be + +ing the only exception to the trend. We report Spearman correlation values for each dataset and explainability method: The negative correlation between token- $\mathrm{F}_1$ and model size is significant in all three datasets with AR, but only in DynaSent with LRP. The positive correlation in CoS-E with LRP rationales is also significant. + +When we zoom in on the min-max Token- $\mathbf{F}_1$ gaps (error bars on Figure 6) $^{15}$ , we find that performance gaps are uncorrelated with model size. Therefore, there is no evidence that larger models are more fair, i.e., rationale alignment does not become more equal for demographic groups. In the context of toxicity classification, work from (Baldini et al., 2021) also hints that size is not well correlated with fairness of models. + +Do distilled models align better? Knowledge distillation has been proven to be effective in model compression while maintaining model performance (Gou et al., 2021). But can it also be effective in improving NLP fairness? Xu and Hu (2022) find a consistent pattern of toxicity and bias reduction after model distillation. Chai et al. (2022) show promising results when approaching fairness without demographics through knowledge distillation. Tan et al. (2018) discuss the benefits of applying knowledge distillation to leverage model interpretability. Motivated by these findings, we take results from LRP to look closer into group-model rationale agreement for distilled models, which we show in Table 2. We find overall higher rationale agreement for distilled models. However, there is no evidence that distilled models are also more fair: Only minilm-16-h384-uncased + +
token-F1(↑)IOU-F1(↑)min-max token-F1(↓)min-max IOU-F1(↓)
minilm-l6-h384-unc..31.28.045.068
minilm-l12-h384-unc..27.21.045.083
distilbert-base-unc..29.24.064.100
distilroberta-base.36.36.065.069
Avg. (16 models).29.24.054.081
+ +Table 2: Group-model alignment for four distilled models. Bottom row shows average scores across all 16 models considered in this paper. Values in **bold** are better than the average (lower if $\downarrow$ , higher if $\uparrow$ ). While rationale alignment (token- $F_1$ and IOU- $F_1$ ) seem to be better for distilled models, only minilm-16-h384-uncased is also fairer than the average (in terms of min-max difference) with both metrics. + +has a smaller performance gap between the best and worst-off group for both metrics compared to the average. + +# 6 Conclusion + +In this paper, we present a new collection of three existing datasets with demographics-augmented annotations, balanced across age and ethnicity. By having annotators choose the right label and marking supporting evidence for their choice, we find that what counts as a rationale differs depending on peoples' socio-demographic backgrounds. + +Through a series of experiments with 16 popular model architectures and two families of explainability methods, we show that model rationales align better with older individuals, especially on sentiment classification. We look closer at model size and the influence of distilled pretraining: despite the fact that larger models perform better in general NLP tasks, we find negative correlations between model size and rationale agreement. Furthermore, from the point of view of performance parity, we find no evidence that increasing model size improves fairness. Likewise, distilled models do not seem to be more fair in terms of rationale agreement, however they do present overall higher scores. + +This work indicates the presence of undesired biases that do not necessarily surface in task performance. We believe this provides an important addendum to the fairness literature: Even if models are fair in terms of predictive performance, they may still exhibit biases that can only be revealed by considering model rationales. If models are equally right, but only right for the right reasons in the eyes of some groups rather than others, they will likely be less robust for the latter groups. + +# Limitations + +Our analysis is limited to non-autoregressive Transformer-based models, fine-tuned with the same set of hyperparameters. Hyperparameter optimization would undoubtedly lead to better performance for some models, but we fine-tuned each model with standard hyperparameter values for solving sentiment analysis tasks (DeYoung et al., 2019) to reduce resource consumption. This should not affect the conclusions drawn from our experiments. + +Comparing human rationales and rationales extracted with interpretability methods such as Attention Rollout and LRP is not straightforward. Overall agreement scores depend on how model rationales are converted into categorical values (top $k^{gd}$ ). See Jorgensen et al. (2022) for discussion. + +# Acknowledgments + +Many thanks to Stephanie Brandl, David Dreyer Lassen, Frederik Hjort, Emily Pitler and David Jurgens for their insightful comments. + +This work was supported by the Novo Nordisk Foundation. + +# Ethics Statement + +Broader impact Although explainability and fairness are broadly viewed as intertwined subjects, very little work has studied the two concepts together (Feng and Boyd-Graber, 2019; González et al., 2021; Ruder et al., 2022). This study is a first of its kind to examine fairness issues of explainability methods and to publish human rationales with diverse socio-demographic information. We hope this work will impact the NLP research community towards more data-aware and multi-dimensional investigations of models and methods, and towards further studies of biases in NLP. + +Personal and sensitive data This study deals with personal and sensitive information. The responses are anonymous and cannot be used to identify any individual. + +Informed consent The participants were informed of the study's overall aim, the procedure and confidentiality of their responses. With this information, the participants consented to the use and sharing of their responses. + +Potential risks We do not anticipate any risks of participation in the study, yet we do note a recent awareness of poor working conditions among crowdworkers for AI data labeling in some countries (Williams et al., 2022). The recruitment platform Prolific, used in this study, is targeted towards research (rather than AI development) and has stricter rules on participant screening and minimum wages (Palan and Schitter, 2017), compared to other popular platforms, which we hope reduce the risk of such poor working conditions. + +Remuneration The participants were paid an average of 7.1£/hour (≈ 8.8$/hour). + +Intended use The collected annotations and demographic information will be publicly available to be used for research purposes only. + +# References + +Samira Abnar and Willem Zuidema. 2020. Quantifying attention flow in transformers. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4190-4197, Online. Association for Computational Linguistics. +Ameen Ali, Thomas Schnake, Oliver Eberle, Grégoire Montavon, Klaus-Robert Müller, and Lior Wolf. 2022. Xai for transformers: Better explanations through conservative propagation. +Leila Arras, Grégoire Montavon, Klaus-Robert Müller, and Wojciech Samek. 2017. Explaining recurrent neural network predictions in sentiment analysis. In Proceedings of the 8th Workshop on Computational Approaches to Subjectivity, Sentiment and Social Media Analysis, pages 159-168, Copenhagen, Denmark. Association for Computational Linguistics. +Sebastian Bach, Alexander Binder, Gregoire Montavon, Frederick Klauschen, Klaus-Robert Müller, and Wojciech Samek. 2015. On pixel-wise explanations for non-linear classifier decisions by layer-wise relevance propagation. PLOS ONE, 10(7):1-46. +Ioana Baldini, Dennis Wei, Karthikeyan Natesan Ramamurthy, Mikhail Yurochkin, and Moninder Singh. 2021. Your fairness may vary: Pretrained language model fairness in toxic text classification. +Esma Balkir, Svetlana Kiritchenko, Isar Nejadgholi, and Kathleen Fraser. 2022. Challenges in applying explainability methods to improve the fairness of NLP models. In Proceedings of the 2nd Workshop on Trustworthy Natural Language Processing (TrustNLP 2022), pages 80-92, Seattle, U.S.A. Association for Computational Linguistics. +Kate Barasz and Tami Kim. 2022. Choice perception: Making sense (and nonsense) of others' decisions. Current opinion in psychology, 43:176-181. + +Kevin Baum, Susanne Mantel, Timo Speith, and Eva Schmidt. 2022. From responsibility to reason-giving explainable artificial intelligence. *Philosophy and Technology*, 35(1):1-30. +Beata Beigman Klebanov and Eyal Beigman. 2009. Squibs: From annotator agreement to noise models. Computational Linguistics, 35(4):495-503. +Claus Beisbart and Tim Räz. 2022. Philosophy of science at sea: Clarifying the interpretability of machine learning. *Philosophy Compass*, 17(6):e12830. +Arpita Biswas, Siddharth Barman, Amit Deshpande, and Amit Sharma. 2019. Quantifying infrastructure marginality and its trade-off with group fairness. CoRR, abs/1909.00982. +Alessandro Castelnovo, Riccardo Crupi, Greta Greco, Daniele Regoli, Ilaria Penco, and Andrea Cosentini. 2022. A clarification of the nuances in the fairness metrics landscape. Scientific Reports, 12. +Junyi Chai, Taeuk Jang, and Xiaoqian Wang. 2022. Fairness without demographics through knowledge distillation. In Advances in Neural Information Processing Systems. +Ilias Chalkidis, Tommaso Pasini, Sheng Zhang, Letizia Tomada, Sebastian Schwemer, and Anders Søgaard. 2022. FairLex: A multilingual benchmark for evaluating fairness in legal text processing. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 4389-4406, Dublin, Ireland. Association for Computational Linguistics. +Cheng-Han Chiang and Hung-yi Lee. 2022. Re-examining human annotations for interpretable nlp. +Sam Corbett-Davies and Sharad Goel. 2018. The measure and mismeasure of fairness: A critical review of fair machine learning. ArXiv, abs/1808.00023. +Jay DeYoung, Sarthak Jain, Nazneen Fatema Rajani, Eric Lehman, Caiming Xiong, Richard Socher, and Byron C. Wallace. 2019. Eraser: A benchmark to evaluate rationalized nlp models. +Kawin Ethayarajh and Dan Jurafsky. 2020. Utility is in the eye of the user: A critique of NLP leaderboards. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 4846-4853, Online. Association for Computational Linguistics. +Shi Feng and Jordan Boyd-Graber. 2019. What can ai do for me? evaluating machine learning interpretations in cooperative play. In Proceedings of the 24th International Conference on Intelligent User Interfaces, IUI '19, page 229-239, New York, NY, USA. Association for Computing Machinery. +Sorelle A. Friedler, Carlos Scheidegger, and Suresh Venkatasubramanian. 2021. The (im)possibility of fairness: Different value systems require different + +mechanisms for fair decision making. Commun. ACM, 64(4):136-143. +Ana Valeria González, Anna Rogers, and Anders Søgaard. 2021. On the interaction of belief bias and explanations. In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, pages 2930-2942, Online. Association for Computational Linguistics. +Jianping Gou, Baosheng Yu, Stephen J. Maybank, and Dacheng Tao. 2021. Knowledge distillation: A survey. International Journal of Computer Vision, 129(6):1789-1819. +Philipp Hacker and Jan-Hendrik Passoth. 2022. Varieties of AI Explanations Under the Law. From the GDPR to the AIA, and Beyond, pages 343-373. Springer International Publishing, Cham. +Daniel Hershcovich, Stella Frank, Heather Lent, Miryam de Lhoneux, Mostafa Abdou, Stephanie Brandl, Emanuele Bugliarello, Laura Cabello Piqeras, Ilias Chalkidis, Ruixiang Cui, Constanza Fierro, Katerina Margatina, Phillip Rust, and Anders Søgaard. 2022. Challenges and strategies in cross-cultural NLP. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 6997-7013, Dublin, Ireland. Association for Computational Linguistics. +Nora Hollenstein, Jonathan Rotsztejn, Marius Troendle, Andreas Pedroni, Ce Zhang, and Nicolas Langer. 2018. Zuco, a simultaneous eeg and eye-tracking resource for natural sentence reading. Scientific Data, 5. +Dirk Hovy and Anders Søgaard. 2015. Tagging performance correlates with author age. 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 483-488, Beijing, China. Association for Computational Linguistics. +Alon Jacovi and Yoav Goldberg. 2020. Towards faithfully interpretable NLP systems: How should we define and evaluate faithfulness? In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4198-4205, Online. Association for Computational Linguistics. +Anders Johannsen, Dirk Hovy, and Anders Søgaard. 2015. Cross-lingual syntactic variation over age and gender. In Proceedings of the Nineteenth Conference on Computational Natural Language Learning, pages 103–112, Beijing, China. Association for Computational Linguistics. +Anna Jørgensen, Dirk Hovy, and Anders Søgaard. 2016. Learning a POS tagger for AAVE-like language. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, + +pages 1115-1120, San Diego, California. Association for Computational Linguistics. +Rasmus Kør Jørgensen, Fiammetta Caccavale, Christian Igel, and Anders Søgaard. 2022. Are multilingual sentiment models equally right for the right reasons? In EMNLP Workshop on Analyzing and Interpreting Neural Networks for NLP (BlackBoxNLP). +Pang Wei Koh, Shiori Sagawa, Henrik Marklund, Sang Michael Xie, Marvin Zhang, Akshay Balsubramani, Weihua Hu, Michihiro Yasunaga, Richard Lanas Phillips, Sara Beery, Jure Leskovec, Anshul Kundaje, Emma Pierson, Sergey Levine, Chelsea Finn, and Percy Liang. 2020. Wilds: A benchmark of in-the-wild distribution shifts. +Markus Langer, Daniel Oster, Timo Speith, Holger Hermanns, Lena Kastner, Eva Schmidt, Andreas Sesing, and Kevin Baum. 2021. What do we want from explainable artificial intelligence (xai)? - A stakeholder perspective on XAI and a conceptual model guiding interdisciplinary XAI research. Artif. Intell., 296:103473. +Brian Larson. 2017. Gender as a variable in natural-language processing: Ethical considerations. In Proceedings of the First ACL Workshop on Ethics in Natural Language Processing, pages 1-11, Valencia, Spain. Association for Computational Linguistics. +Mike Li, Hongseok Namkoong, and Shangzhou Xia. 2021. Evaluating model performance under worst-case subpopulations. In Advances in Neural Information Processing Systems, volume 34, pages 17325-17334, Vancouver, CA. Curran Associates, Inc. +Binny Mathew, Punyajoy Saha, Seid Muhie Yimam, Chris Biemann, Pawan Goyal, and Animesh Mukherjee. 2021. Hatexplain: A benchmark dataset for explainable hate speech detection. In Proceedings of the AAAI Conference on Artificial Intelligence 35(17), pages 14867-14875. +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. +Andrés Páez. 2019. The pragmatic turn in explainable artificial intelligence (xai). *Minds and Machines*, 29(3):441-459. +Stefan Palan and Christian Schitter. 2017. Prolific.ac—a subject pool for online experiments. Journal of Behavioral and Experimental Finance, 17:22-27. +Steven T. Piantadosi and Felix Hill. 2022. Meaning without reference in large language models. +Barbara Plank. 2022. The 'problem' of human label variation: On ground truth in data, modeling and evaluation. *ArXiv*, abs/2211.02570. + +Barbara Plank, Dirk Hovy, and Anders Søgaard. 2014. Learning part-of-speech taggers with inter-annotator agreement loss. In Proceedings of the 14th Conference of the European Chapter of the Association for Computational Linguistics, pages 742–751, Gothenburg, Sweden. Association for Computational Linguistics. +Christopher Potts, Zhengxuan Wu, Atticus Geiger, and Douwe Kiela. 2020. DynaSent: A dynamic benchmark for sentiment analysis. arXiv preprint arXiv:2012.15349. +Nazneen Fatema Rajani, Bryan McCann, Caiming Xiong, and Richard Socher. 2019. Explain yourself! leveraging language models for commonsense reasoning. Proceedings of the Association for Computational Linguistics (ACL). +John Rawls. 1971. A Theory of Justice, 1 edition. Belknap Press of Harvard University Press, Cambridge, Massachusetts. +Sagnik Ray Choudhury, Anna Rogers, and Isabelle Augenstein. 2022. Machine reading, fast and slow: When do models "understand" language? In Proceedings of the 29th International Conference on Computational Linguistics, pages 78-93, Gyeongju, Republic of Korea. International Committee on Computational Linguistics. +Sebastian Ruder, Ivan Vulic, and Anders Søgaard. 2022. Square one bias in NLP: Towards a multidimensional exploration of the research manifold. In Findings of the Association for Computational Linguistics: ACL 2022, pages 2340-2354, Dublin, Ireland. Association for Computational Linguistics. +Maarten Sap, Dallas Card, Saadia Gabriel, Yejin Choi, and Noah A. Smith. 2019. The risk of racial bias in hate speech detection. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 1668-1678, Florence, Italy. Association for Computational Linguistics. +Mattia Setzu, Riccardo Guidotti, Anna Monreale, Franco Turini, Dino Pedreschi, and Fosca Giannotti. 2021. Glocalx - from local to global explanations of black box ai models. Artificial Intelligence, 294:103457. +Amit Sharma, Arpita Biswas, and Siddharth Barman. 2020. Inframarginality audit of group-fairness. Symposium on the Foundations of Responsible Computing (FORC). +Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew Y 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. +K. E. Stanovich and R. F. West. 2000. Individual differences in reasoning: Implications for the rationality debate? Behavioral and Brain Sciences, 23:645-665. + +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. +Sarah Tan, Rich Caruana, Giles Hooker, and Yin Lou. 2018. Distill-and-compare: Auditing black-box models using transparent model distillation. In Proceedings of the 2018 AAAI/ACM Conference on AI, Ethics, and Society, AIES '18, page 303-310, New York, NY, USA. Association for Computing Machinery. +Sahil Verma and Julia Rubin. 2018. *Fairness definitions* explained. In *Proceedings of the International Workshop on Software Fairness*, FairWare '18, page 1-7, New York, NY, USA. Association for Computing Machinery. +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, Vancouver, CA. Curran Associates, Inc. +Lijie Wang, Yaozong Shen, Shu ping Peng, Shuai Zhang, Xinyan Xiao, Hao Liu, Hongxuan Tang, Ying Chen, Hua Wu, and Haifeng Wang. 2022. A fine-grained interpretability evaluation benchmark for neural nlp. ArXiv, abs/2205.11097. +Adrienne Williams, Milagros Miceli, and Timnit Gebru. 2022. The exploited labor behind artificial intelligence. +Robert Williamson and Aditya Menon. 2019. Fairness risk measures. In Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pages 6786-6797, Long Beach, California. PMLR. +Guangxuan Xu and Qingyuan Hu. 2022. Can model compression improve nlp fairness. +Omar Zaidan, Jason Eisner, and Christine Piatko. 2007. Using "annotator rationales" to improve machine learning for text categorization. In Human Language Technologies 2007: The Conference of the North American Chapter of the Association for Computational Linguistics; Proceedings of the Main Conference, pages 260-267, Rochester, New York. Association for Computational Linguistics. +Carlos Zednik and Hannes Boelsen. 2022. Scientific exploration and explainable artificial intelligence. *Minds Mach.*, 32(1):219-239. +Sheng Zhang, Xin Zhang, Weiming Zhang, and Anders Søgaard. 2021. Sociolectal analysis of pretrained + +language models. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 4581-4588, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. + +# A Annotation guidelines and task examples + +On the next pages, we firstly show the annotation instructions given to annotators within the Qualtrics surveys. Full exports of the surveys are available in our GitHub repository. $^{16}$ + +We created instructions specific for each dataset (DynaSent, SST-2, and CoS-E), leaning on prior work of annotating labels and rationales for these and similar datasets (Potts et al., 2020; Zaidan et al., 2007; DeYoung et al., 2019), as described in the paper, section 3.1. + +Figure 7, 8, and 9 shows the instructions for Dy- naSent, SST-2 and CoS-E, respectively, and Figure 10 shows an example of how an instance for the sentiment task and the common-sense reasoning task is annotated, i.e. how it looked from the pers-. spective of the crowdworkers. + +Annotating rationales for the common-sense reasoning task is somewhat more complex than annotating rationales for sentiment: while we can ask annotators to mark 'evidence' for a sentiment label – often resulting in marking words that are positively or negatively loaded – we cannot as simply ask for 'evidence' for a common-sense reasoning answer without risking some confusion. Take, for instance, the question "Where do you find the most amount of leafs?" with the answer being 'Forest', as shown in Figure 9. Here, the term 'evidence' might be misunderstood as actual evidence for why there would be more leafs in the forest compared to a field – evidence which cannot be found within the question itself. We therefore re-phrase the rationale annotation instructions for CoS-E, following an example from Chiang and Lee (2022), and ask, "For each word in the question, if you think that removing it will decrease your confidence toward your chosen label, please mark it." Furthermore, the subset of the CoS-E dataset, that we re- annotate, consists of the more 'difficult' split of the CommonsenseQA dataset (Talmor et al., 2019; DeYoung et al., 2019). To make the task as clear as possible to the annotators, we explain, in the instructions, that the question and answer-options have been created by other crowdworkers who were instructed to create questions that could be "easily answered by humans without context, by the use of commonsense knowledge", as is described by Talmor et al. (2019). + +
DATASETNCOMPLETE LABEL AGREEMENT
POSNEGNEUTRALTOTAL
DynaSent4801051022209
SST26379730152
CoS-E500---161
+ +Table 3: Number of instances, in our (re-)annotated data, where all annotator groups agreed upon the instance's label. + +# B Annotations Overview + +Table 4 gives further information on the distribution of annotators, across groups and datasets, as well as ratios of rationale lengths to input lengths. Table 3 shows the number of instances in the data subsets, we work with, and the number of instances where all our annotator groups agreed on the label and that are therefore used for rationale-agreement analyses. + +# C Supplementary Figures + +For completeness, we provide supplementary figures for all the metrics and datasets analyzed in the paper. + +# C.1 Label Agreement + +Heatmaps in Figure 11 show the level of group-group label agreement across datasets. Similar to what is shown in Figure 4, BY consistently exhibit lower level of agreement. + +Box-plots in Figure 12 represent group-model label agreement. Each dot represents the F1-score of each model. While for Cos-E the models generally exhibit lower variability across groups, the level of agreement is also lower (as shown in Figure 3). + +# C.2 Rationale Alignment + +Figure 13 is the extended version of Figure 5, showing the group-model rationale agreement for each dataset, each explainability method and with two metrics for measuring agreement, token- $\mathbf{F}_1$ and IOU- $\mathbf{F}_1$ . + +The bar charts in Figure 14 shows, per model and dataset, the distance between the group with the lowest and highest agreement with the model (by token- $\mathrm{F}_1$ ), which we refer to as the "min-max token- $\mathrm{F}_1$ gaps" in section 5.2. We include this plot because it serves to better illustrate the gaps themselves, and how they are uncorrelated with model size, compared to what Figure 6 in the paper can convey. + +# Instructions + +Please read these instructions carefully. + +You will be shown 10 sentences from reviews of products and services. For each, your task is to choose from one of our three labels: + +Positive: The sentence conveys information about the author's positive evaluative sentiment. + +Negative: The sentence conveys information about the author's negative evaluative sentiment. + +No sentiment: The sentence does not convey anything about the author's positive or negative sentiment. + +Here are some examples of the labels: + +Sentence: This is an under-appreciated little gem of a movie. + +(This is Positive because it expresses a positive overall opinion.) + +Sentence: I asked for my steak medium-rare, and they delivered it perfectly! + +(This is Positive because it puts a positive spin on an aspect of the author's experience.) + +Sentence: The screen on this device is a little too bright. + +(This is Negative because it negatively evaluates an aspect of the product.) + +Sentence: The book is 972 pages long. + +(This is No sentiment because it describes a factual matter with not evaluative component.) + +Sentence: The entrees are delicious, but the service is so bad that it's not worth going. + +(This is Negative because the negative statement outweighs the positive one.) + +Sentence: The acting is great! The soundtrack is run-of-the mill, but the action more than makes up for it. + +(This is Positive because the positive statements outweighs the negative.) + +We further ask you to specify what snippets of text, in the sentence, you think acts as supporting evidence for your chosen label. The sentence will be shown to you as illustrated below, and your task is to mark (by clicking on them) all the words you think shows evidence for the sentiment label you chose. + +![](images/efe2d018481066204ed34daac46de7264e9fab59f056e1f3d02583889537e87e.jpg) +Figure 7: DynaSent annotation instructions. + +Be aware that some sentences might be too long to fit on your screen. You therefore have to remember to scroll in order to see all the words that can be marked as evidence. + +Click the forward button below when you are ready to start the task. + +# Instructions + +Please read these instructions carefully. + +You will be shown approximately 10 sentences from reviews of movies. For each, your task is to choose from one of our three labels: + +Positive: The sentence conveys information about the author's positive evaluative sentiment. + +Negative: The sentence conveys information about the author's negative evaluative sentiment. + +No sentiment: The sentence does not convey anything about the author's positive or negative sentiment. + +Here are some examples of the labels: + +Sentence: This is an under-appreciated little gem of a movie. + +(This is Positive because it expresses a positive overall opinion.) + +Sentence: he is one of the most exciting martial artists on the big screen, continuing to perform his own stunts and dazzling audiences with his flashy kicks and punches. + +(This is Positive because it positively evaluates an aspect of the movie.) + +Sentence: The acting is great! The soundtrack is run-of-the-mill, but the action more than makes up for it. + +(This is Positive because the positive statements outweigh the negative.) + +Sentence: The story is interesting but the movie is so badly put together that even the most casual viewer may notice the miserable pacing and stray plot threads. + +(This is Negative because the negative statement outweighs the positive one.) + +Sentence: A woman in peril. A confrontation. An explosion. The end. Yawn. Yawn. Yawn. + +(This is Negative because it puts a negative spin on the author's experience.) + +Sentence: don't go see this movie. + +(This is Negative because it recommends against seeing the movie, reflecting a negative evaluation.) + +Sentence: it is directed by Steven Spielberg. + +(This is No sentiment because it describes a factual matter with no evaluative component.) + +Sentence: I saw it in the local theater with my best friend. + +(This is No sentiment because it does not say anything about the movie.) + +We further ask you to specify what snippets of text, in the sentence, you think acts as supporting evidence for your chosen label. The sentence will be shown to you as illustrated below, and your task is to mark (by clicking on them) all the words you think shows evidence for the sentiment label you chose. + +![](images/d8894c288dad5e9a6a27baa646435735dc918ea32e27e3ec4ddc66efda33771b.jpg) +Figure 8: SST-2 annotation instructions. + +Be aware that some sentences might be too long to fit on your screen. In that case you have to scroll in order to see all the words that can be marked as evidence. + +Click the forward button below when you are ready to start the task. + +# Instructions + +(Pleasesread these instructions carefully.) + +You will be shown 10 multiple-choice questions. All questions and their answer-options have been created by other crowdworkers, who were instructed to create questions that can be fairly easily answered by humans without context, by the use of common-sense knowledge. + +Your task is to firstly select the answer you think is most correct and sensible. We call this the label of the question. Secondly, we ask you to mark relevant words in the question that justifies your choice. Specifically, for each word in the question, if you think that removing it will decrease your confidence toward your chosen label, you should mark it. + +In the image below, you see an example of how the task will be presented to you. To the question "Where do you find the most amount of leafs?", the option "Forest" is selected as the correct answer and four words have been marked as justification. + +Where do you find the most amount of leafs? + +Compost pile + +Flowers + +Forest + +Field + +Ground + +For each word in the question, if you think that removing it will decrease your confidence toward your chosen label, please mark it. + +Where + +do + +you + +find + +the + +most + +amount + +of + +leafs + +? + +When marking words, be aware that some questions might be longer and not fit perfectly on your screen. In that case you have to scroll in order to see all the words that can be marked. Also, the texts may have misspellings, typos and wrongly put spaces before punctuation – pay no attention to this. + +Click the forward button below when you are ready to start the task. + +Figure 9: CoS-E annotation instructions. + +Sentence: The art exhibit has a lot to offer. + +![](images/412264e8cac7026ea321d7555d00203cda71dbed58d30b7125f9e53bb6ab1e18.jpg) + +Mark the evidence for your chosen label. + +![](images/6a7e80e3fbfaa2c0e6fae28d3c5923cc957ef6997f85f237f41a2a2c061c469b.jpg) + +![](images/50acb7b955735f1510a71c8b0c5e09016a02ae6ae2778ae43fa7aaccc4ad58f6.jpg) + +# (a) Sentiment annotation example. + +Question: Where would you get a pen if you do not have one? + +![](images/f364d2951e1412260c043b7bfe5c038574184a87c6a6381a5f479e62d794dc43.jpg) + +For each word in the question, if you think that removing it will decrease your confidence toward you chosen label, please mark it. + +![](images/9b88a9597d715b56c61a79663e13e4cb996b83d276684cb58cdca29f562568b2.jpg) + +![](images/98bcec00095d43d3d4c09a4b7e6c763bda159da6683a26dd827a70f17b89407e.jpg) + +(b) Common-sense reasoning annotation example. + +Figure 10: Screenshots of the annotation tasks as they are viewed in Qualtrics surveys. + +
DATASETBOBYLOLYWOWYTOTAL/AVG.
DynaSentAnnot.515661735451346
Annot.*48 (58%F)48 (67%F)48 (44%F)48 (40%F)48 (56%F)48 (48%F)288
RLR33.732.531.529.834.729.131.9
SSTAnnot.282753432729207
Annot.*26 (69%F)26 (58%F)26 (38%F)26 (31%F)26 (38%F)26 (69%F)156
RLR32.125.130.727.829.132.729.6
CoS-EAnnot.525674855455376
Annot.*50 (60%F)50 (60%F)50 (40%F)50 (48%F)50 (48%F)50 (40%F)300
RLR31.932.934.132.233.333.633.0
+ +Table 4: Overview of our annotated data. Rows display statistics per dataset. Columns refer to each demographic group: Black/African American old (BO) and young (BY), Latino/Hispanic old (LO) and young (LY), White/Caucasian old (WO) and young (WY). Last column show the total quantity of each feature over all groups. Row-wise within each dataset: 'Annot.' and 'N' reflect the total number of annotators and instances, respectively. Annot.* refers to the number of annotators left after pre-processing (see exclusion criteria in Section 3.2). Number shown between brackets refers to the percentage of female annotators. RLR represents the ratio of rationale length to its input length (percentage). + +![](images/f99c8daa642499b054d9de216f3b4d45226b00ba060a487b0b1b98b158fca906.jpg) + +![](images/250c534d93c75cb1e27d32fdc06a82faa5eb772e3af183ea59239aa77f708a69.jpg) + +![](images/db50a43a3db128f668e466cb14822da4b22ea043eb87b759d618d3ae76dac308.jpg) + +![](images/41716f0572fc1f20069cbbba94baca7b7c70e25ce9ccfde04b4062f66303ca30.jpg) +Figure 11: Group-group label agreement (F1-scores). + +![](images/ba01e2af05f89aa4650c2449d18fa8d7242adb17d013391eb1f52c01844bc585.jpg) +Figure 12: Group-model label agreement (F1-scores). + +![](images/94a588fc2324557cc7689b7a276309d0dfa175c74d49ff8b4d408a927a4a1c5d.jpg) +(a) Token-F1 scores + +![](images/0c5707c4d33600720ea29c1674ba26173db4245b66f27397739030a8d1ceda7f.jpg) +(b) IOU-F1 scores +Figure 13: Box-plots of group-model rationale agreement for the each dataset measured with Token-F1 (left) and IOU-F1 (right). Model rationales are extracted with Attention Rollout (top row) and LRP (bottom row). Each dot represents a model's agreement with the respective group. + +![](images/b759a89493a8af389cf1e07650f4b0e4f5c001bf77f8c773d7d41e15c10e8077.jpg) +Figure 14: Per-model difference between the group with the lowest (min) and highest (max) model-group agreement measured with token-F1. Models on the x-axis are sorted by model size. The min-max captures a measure of fairness, with a smaller difference entailing more equal model-group rationale alignments. We find that the differences are uncorrelated with model size (in Million parameters), as is visible in this plot. + +A For every submission: + +A1. Did you describe the limitations of your work? In section titled "Limitations", section 7. +A2. Did you discuss any potential risks of your work? Section 8, "Ethics Statement" +A3. Do the abstract and introduction summarize the paper's main claims? Abstract and Section 1 on paragraph "Contributions". +A4. Have you used AI writing assistants when working on this paper? Left blank. + +B Did you use or create scientific artifacts? + +It is described in Section 3. Used in Section 4 and 5 + +B1. Did you cite the creators of artifacts you used? Section 3.1 +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? Section 8, "Ethics Statement" +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +In the ethics statement we specify that the intended use of our annotations is research purposes only. The datasets we use are at least intended for research purposes as well. A larger discussion does not seem relevant in this case. + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? Section 8, "Ethics Statement" +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? Section 3 +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. Section 3 and 4 + +C Did you run computational experiments? + +Section 4 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +Our research does not focus on model development from scratch. We use known pretrained models and refer to the original library (footnote 6) in which this information is clearly stated. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +Experimental setup is discussed in Section 4. In the section 7 "Limitations, we provide further explanations. + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +Section 5 + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +Not applicable. Left blank. + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Section 3 + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +Section 3 and Appendix C, and a printout of the full surveys/annotation task will be shared upon acceptance (an author's name and contact details appears in them). Section 3 and Ethics Statement. + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +Section 3 and Ethics Statement. + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +Ethics Statement. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +Anonymous data is exempt from IRB approval at the authors' institution. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +Section 3 \ No newline at end of file diff --git a/beingrightforwhoserightreasons/images.zip b/beingrightforwhoserightreasons/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..8454e2572aaaeb2d8cc9cd774704fd5f67fae3a2 --- /dev/null +++ b/beingrightforwhoserightreasons/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ef4fd952210046d930b88098282ce79c88c899d2900a0a344896cd9f143b0753 +size 579914 diff --git a/beingrightforwhoserightreasons/layout.json b/beingrightforwhoserightreasons/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..2db41d2e30c5b5152344d96641adeb5824a4db46 --- /dev/null +++ b/beingrightforwhoserightreasons/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:578782302205e5743ef852408f422686e260124aefddedc4ebb132bb9638c9af +size 614604 diff --git a/benchmarkinglargelanguagemodelcapabilitiesforconditionalgeneration/5e4158e0-09ce-40a5-971c-2decbc51b36a_content_list.json b/benchmarkinglargelanguagemodelcapabilitiesforconditionalgeneration/5e4158e0-09ce-40a5-971c-2decbc51b36a_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..95b7818e6c21f4bbcb9d169e8fa0235ad83b1d61 --- /dev/null +++ b/benchmarkinglargelanguagemodelcapabilitiesforconditionalgeneration/5e4158e0-09ce-40a5-971c-2decbc51b36a_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9f5bfc1923b239e590c8624332077a157615feb29a10e2d3be4767bea519aa11 +size 131127 diff --git a/benchmarkinglargelanguagemodelcapabilitiesforconditionalgeneration/5e4158e0-09ce-40a5-971c-2decbc51b36a_model.json b/benchmarkinglargelanguagemodelcapabilitiesforconditionalgeneration/5e4158e0-09ce-40a5-971c-2decbc51b36a_model.json new file mode 100644 index 0000000000000000000000000000000000000000..552474502099a7811f3788ff0894bf7917280690 --- /dev/null +++ b/benchmarkinglargelanguagemodelcapabilitiesforconditionalgeneration/5e4158e0-09ce-40a5-971c-2decbc51b36a_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c116c1608c2e89ff76a1cfe462973d5585f2d6e3f086860707fe35a6357d1c39 +size 149908 diff --git a/benchmarkinglargelanguagemodelcapabilitiesforconditionalgeneration/5e4158e0-09ce-40a5-971c-2decbc51b36a_origin.pdf b/benchmarkinglargelanguagemodelcapabilitiesforconditionalgeneration/5e4158e0-09ce-40a5-971c-2decbc51b36a_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..0c29fdc1a558beb0a464fa8c8c2ccff64ef3ca03 --- /dev/null +++ b/benchmarkinglargelanguagemodelcapabilitiesforconditionalgeneration/5e4158e0-09ce-40a5-971c-2decbc51b36a_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e0d9e86552ca9cc840c23cbabf160d5b4fac46bc08b931b63ffad2a5464457fc +size 843748 diff --git a/benchmarkinglargelanguagemodelcapabilitiesforconditionalgeneration/full.md b/benchmarkinglargelanguagemodelcapabilitiesforconditionalgeneration/full.md new file mode 100644 index 0000000000000000000000000000000000000000..d5977e55dbaf81c762199b1e3573f8109c106427 --- /dev/null +++ b/benchmarkinglargelanguagemodelcapabilitiesforconditionalgeneration/full.md @@ -0,0 +1,468 @@ +# Benchmarking Large Language Model Capabilities for Conditional Generation + +Joshua Maynez + +Google DeepMind + +joshuahm@google.com + +Priyanka Agrawal + +Google DeepMind + +priyankagr@gmail.com + +# Sebastian Gehrmann + +Google Research + +gehrmann@google.com + +# Abstract + +Pre-trained large language models (PLMs) underlie most new developments in natural language processing. They have shifted the field from application-specific model pipelines to a single model that is adapted to a wide range of tasks. Autoregressive PLMs like GPT-3 or PaLM, alongside techniques like few-shot learning, have additionally shifted the output modality to generation instead of classification or regression. Despite their ubiquitous use, the generation quality of language models is rarely evaluated when these models are introduced. Additionally, it is unclear how existing generation tasks--while they can be used to compare systems at a high level--relate to the real world use cases for which people have been adopting them. In this work, we discuss how to adapt existing application-specific generation benchmarks to PLMs and provide an in-depth, empirical study of the limitations and capabilities of PLMs in natural language generation tasks along dimensions such as scale, architecture, input and output language. Our results show that PLMs differ in their applicability to different data regimes and their generalization to multiple languages and inform which PLMs to use for a given generation task setup. We share best practices to be taken into consideration when benchmarking generation capabilities during the development of upcoming PLMs. + +# 1 Introduction + +Natural language generation tasks require generating understandable text given textual or non-linguistic information as input, such as documents, tables, or other structured forms. These texts seek to achieve a communicative goal (e.g., summarize a document). The standard approach to tackle these problems over the last years has been to start with a pretrained encoder-decoder model like T5 (Raffel et al., 2020a) or BART (Lewis et al., 2020a) and finetune it on a corpus that captures + +the downstream task. The recent much larger pretrained language models use a decoder-only architecture and upended this paradigm. These models enabled few-shot or in-context learning approaches in which a model is presented with one or more examples and tasked to continue generating without any finetuning. We refer to both kinds of pretrained models as PLMs. + +Due to the lack of grounding in the specific task setup, few-shot learning in generation settings leads to a model approaching the communicative goal from very different angles. These diverse range of outputs make the typical reference-based automatic evaluation strategies largely incompatible. While human evaluation can be used to overcome this shortcoming, it is infeasible to monitor the performance of an actively training model this way or to re-run all evaluations every time a new model is introduced. This leads to the question how one should reliably monitor generation capabilities, a question that is only growing in importance as more tasks are approached by casting them into generation setups. + +In this work, we evaluate 8 models in few-shot and finetuning settings on 27 generation tasks covering 14 languages via automatic evaluation, presenting the first large-scale benchmark of PLMs in conditional NLG settings. We discuss design choices and challenges to ensure a fair comparison between the different systems, including suitable methods, tasks, and metrics. Based on our empirical results, we derive recommendations that could be used for future benchmarks during the development of PLMs. To combat the need for repeating computationally expensive explorations, we investigate how many evaluation examples are necessary to identify differences between models and find that, in many cases, fewer than 500 examples are sufficient, which opens the path for future evaluation-only task developments. + +# 2 Background and Related Work + +The shift from specialized pipelines toward pretrained language models has led to significant changes in how models are evaluated. We now focus more on questions such as "how good are the learned representations?" instead of user-facing measures of utility. The changes manifested in leaderboards and standard benchmarks that aim to characterize a wide range of model capabilities (Ethayarajh and Jurafsky, 2020). + +An additional recent shift is that from finetuning toward few-shot learning. Models like T5 (Raffel et al., 2020a), BART (Lewis et al., 2020a), and mT5 (Xue et al., 2021) were finetuned on supervised datasets covering tasks including translation and summarization, and their outputs are compared to "ground truth" outputs via widely used metrics like ROUGE (Lin, 2004) which provide a noisy indication of the "quality" of the output and which can be used to determine whether a model is better than others. In contrast, large PLMs with autoregressive language modeling pretraining objectives are more capable to produce results without explicit finetuning and are thus typically evaluated via few-shot and in-context approaches, where the model is given the task description and exemplars showing how the task should be completed. GPT-3 (Brown et al., 2020) and models that followed such as GLaM (Du et al., 2022), Gopher (Rae et al., 2021), and LaMDA (Thoppilan et al., 2022), have achieved few-shot state-of-the-art results on a large number of tasks at their time of publication. However, few-shot approaches work best for tasks with a clear answer such as classification or span-based question-answering. + +Generation metrics penalize systems when their writing style differs from how the references are written (Mathur et al., 2020; Freitag et al., 2020; Mille et al., 2021). Without finetuning, there is no guarantee that PLMs produce outputs that look like the ground truth, both in style and content. Recent work found that these differences leads to sharp differences in how humans and automatic metrics rate the generation quality (Goyal et al., 2022). Due to this uncertainty, most evaluations of new PLMs + +are limited to NLU benchmarks such as SuperGLUE (Wang et al., 2019). For example, LaMDA (Thoppilan et al., 2022) did not evaluate on NLG tasks, GLaM (Du et al., 2022) limited its generation evaluation to short span question answering tasks, and GPT-3 (Brown et al., 2020) evaluated only on machine translation. A first autoregressive PLM with broad NLG evaluation, PaLM (Chowdhery et al., 2022), benchmarked summarization and data-to-text tasks in multiple languages. + +The recent Holistic Evaluation of Language Models project (HELM, Liang et al., 2022) aims to standardize evaluation of language models. With the explicit goal to broaden the task and metric coverage, HELM has established an impressive few-shot benchmark for many natural language tasks. Corroborating the prior findings, they also conclude that human evaluation is necessary for NLG. This distinction means that the reference-based approach for generated text that the field has used since the advent of deep learning may no longer sufficient and that we need clear evaluation protocols that continue to allow us to answer broad questions about "generation quality" of a model. Complementing this work, we take a deeper look at a wider set of NLG tasks and explore LLMs in finetuning and few-shot setups to identify whether reference-based automatic evaluation can still be used to produce system rankings. + +Research Questions We aim to define a methodology that allows us to answer the question "How good are learned representations of a model for generating natural language?" via few-shot and finetuning approaches. To develop and apply this methodology we seek to answer the following three research questions: + +R1 How do different model architectures compare in terms of automatic metrics? + +We aim to identify patterns that emerge in evaluations and to uncover aspects inherent to the tasks, e.g. have metrics on specific tasks saturated?, and to the models' architectural choices, e.g., are encoder-decoders better suited for particular task formulations? (Section 4) + +R2 What set of tasks, methods, and metrics is best suited for the monitoring of improvements in language generation capabilities? + +Using the results of R1, we aim to select a subset of tasks, methods, and metrics that robustly produce reliable model rankings. (Section 5) + +
DatasetLanguagesLengthSize
InputOutputTrainingTest
E2Een14613535k4.7k
WebNLGen,ru169.515714k-35k1.1k-1.8k
ToTToen357120k7.7k
Czech Rest.cs70803.5k842
XSumen184515323k1.2k
WikiLinguaen,es,ru,tr,vi1k-5k159-4895k-3.8M900-29k
MLSumes,de4152147220k-250k10k-13k
XL-Sumar,bn,ja,id,sw,ko,ru,te,Th,tr,es,vi,hi1k-10k137-6141.3k-300k500-9k
+ +Table 1: Details of the datasets evaluated in this paper: languages, lengths in number of tokens according to the mT5 tokenizer (Xue et al., 2021), and size of the training and test splits. + +# R3 What are the broader implications for how the quality of newly developed models should be monitored? + +Robustly ranking systems is particularly important when monitoring a system during training and when comparing across many tasks. In line with the "reality check" theme track at ACL 2023, we discuss the implications of our findings on how evaluation results should be produced and interpreted. (Section 6) + +# 3 Method + +# 3.1 Data + +We select a combination of data-to-text and text-to-text datasets as different input modalities. The selected datasets capture different input and output lengths, domains, languages, and communicative goals. The text-to-text task with most available multilingual datasets is summarization which we pick for this paper.3 We pick the following tasks:4 + +- MLSum (Scialom et al., 2020) - Summarize a news article in multiple sentences. +- WikiLingua (Ladhak et al., 2020) - Generate section headers for step-by-step instructions from WikiHow. +- XSum (Narayan et al., 2018) - Generate the first sentence of a news article. +- Clean E2E NLG (Novikova et al., 2017; Dušek et al., 2019) - Given a set of key-value attribute + +pairs, describe a restaurant in one or two sentences. + +- Czech Restaurant response generation (Dusek and Jurvc'ivcek, 2019) - Given a dialog context and a dialog act representation, generate a one sentence long response. +- WebNLG 2020 (Gardent et al., 2017; Ferreira et al., 2020) – Verbalize subject-predicate-object triples in one or more sentences. +- ToTTo (Parikh et al., 2020) - Describe highlighted cells in a table in a single sentence. +- XL-Sum (Hasan et al., 2021) - Summarize a news article, in the same language, in a single sentence. + +Table 1 provides an overview of these datasets in terms of languages, the lengths of input and output and split sizes. For highly multilingual datasets, we evaluate on a subset of typologically diverse languages following the selection by Clark et al. (2020). To this selection, we add languages that appear both in WikiLingua and XL-Sum. + +# 3.2 Models + +Prior results for the benchmarked tasks primarily come from finetuning T5 (Raffel et al., 2020b), mT5 (Xue et al., 2021), or BART (Lewis et al., 2020b), which are encoder-decoder models pretrained with an infilling objectives. These models are significantly smaller than newer models like GPT-3, with sizes ranging from 130M to 13B parameters. Encoder-decoder models trained for infilling often outperform larger decoder-only LMs in the finetuning setting (Tay et al., 2022), while the latter work better for few-shot setting. There has also been recent work on reducing the computational cost of large models by $\sim 10\mathrm{x}$ by using a mixture of experts (Zoph et al., 2022). It is important to compare these diverse set of models to understand how scale plays a role with the model's architecture and its pretraining. We benchmark the following models: + +- PaLM PaLM is a pretrained decoder-only transformer-based model trained with standard left-to-right language modeling objective. It is pretrained on a range of multilingual corpora including Wikipedia, news, and code. In this work, we use two models scales: 8B parameters and 540B parameters. + +- GPT-3.5 (Ouyang et al., 2022b) GPT-3.5 is a 175B parameter decoder-only transformer-model of the GPT-3 family (Brown et al., 2020) but trained on a blend of text and code from before Q4 2021. This model, named code-davinci-002, was introduced as the base model for InstructGPT-3 (Ouyang et al., 2022b) without the supervision on human-written demonstrations and human-vetted model samples. $^6$ +- ST-MoE (Zoph et al., 2022) ST-MoE is a 269B sparse pretrained variant of a dense encoder-decoder transformer-based model. +- LaMDA (Thoppilan et al., 2022) LaMDA (137B parameters) is a decoder-only transformer-based language model specialized for dialog applications. It is pretrained on dialog data as well as web text data followed by rank-based tuning. +- T5 (Raffel et al., 2020a) T5-XXL (11B parameters) is a pretrained encoder-decoder transformer-based model trained on a span corruption objective with a novel unified text-to-text format. It is pretrained on Common Crawl data, mostly containing English-only documents. +- mT5 (Xue et al., 2021) mT5-XXL (11B parameters) is a multilingual variant of T5 that was pretrained on a multilingual corpus, mC4, covering 101 languages. +- LongT5 (Guo et al., 2021) LongT5 (3B parameters) a similar architecture as T5, where the encoder is extended to have global-local attention sparsity patterns to handle long inputs. + +# 3.3 Few-shot evaluation methodology + +To evaluate the models for few-shot inference, we concatenate a task-specific prompt7 to the input and preprocess an output prompt to the output. To handle the oftentimes very long inputs or outputs for tasks such as summarization, inputs were truncated to 2048 tokens and inference was done providing only one exemplar at a time, referred to as 1-shot. These simple prompts are analogous to those used in related work (Chowdhery et al., 2022; Scao et al., 2022). We do not tune the prompts or use more complex strategies to keep fair comparisons between multiple systems, as prompt selection can lead to overfitting. The exemplars are separated through double linebreaks, which are also used + +to truncate output predictions for evaluation. All few-shot exemplars are randomly sampled from the training corpus. From early experimentation, we found this particularly important since it avoids overfitting to exemplars that work well for one model but not another. + +# 3.4 Finetuning methodology + +To use the decoder-only architectures during finetuning, inputs and targets are concatenated. The concatenated sequences are truncated to 2048 tokens, the training context used during pretraining, with 512 tokens reserved for the target. Only summarization tasks required input truncation. We finetuned models with standard hyperparameters; refer to Appendix-B for thorough details. The best model checkpoint for each dataset was selected by the best performing geometric mean of ROUGE-1, ROUGE-2 and ROUGE-L scores on the validation set. Decoding was done with beam-search with a beam size of 4 for encoder-decoder models, while inference in decoder-only PLMs (LaMDA, PaLM, ST-MoE) was performed using top-k sampling with $k = 10$ , due to issues with scaling beam search at the time of publication. + +# 3.5 Metrics + +Following the suggestions by Gehrmann et al. (2022b), we report a combination of lexical and learned metrics, starting with ROUGE-2 and ROUGE-L (Lin, 2004). Since the default ROUGE implementation uses English-specific tokenization, stemming and punctuation normalization, it is incompatible with other languages. Hasan et al. (2021) extended ROUGE by integrating additional stemmers and tokenizers to cover up to the 45 languages. To support more languages, and avoid dependency on varying implementations, we use a SentencePiece tokenizer (Kudo and Richardson, 2018) which, provided a vocabulary distribution file, is self-contained and has sensible fall-backs to unexpected words. Specifically, we used mT5's SentencePiece vocabulary. + +For the same reason, we also evaluate with ChrF (Popovic, 2015), which is a character-level n-gram overlap metrics and thus independent from tokenizers. BLEURT (Sellam et al., 2020; Pu et al., 2021) is a multilingual model-based evaluation metric for generation designed to compute the similarity between a pair of sentences i.e. a reference and a candidate. It finetunes RemBERT (Chung + +et al., 2021) on synthetic sentence pairs and gold ratings. In contrast to the lexical metrics, BLEURT is meant to capture the non-trivial semantic similarities between two texts. + +For brevity, the main text of this section focuses on the F-measure of ROUGE-L for English and SentencePiece-ROUGE-L for all other languages while the remaining results are in Appendix A. We additionally investigate the agreement between metrics in Section 5. $^{8}$ + +# 4 Empirical Observations + +Few-shot learning falls behind finetuning For many generation tasks, including multilingual summarization tasks, we observe a large gap between finetuning and few-shot results, indicating that finetuning will play an important role when it comes to maximizing automatic scores. On data-to-text, the few-shot results follow a similar trend as in summarization, but the gap to the best finetuned results shrinks drastically. Moreover, the finetuning result do not always follow a trend according to scale or architecture. We hypothesize that multiple tasks have saturated to the metrics. If this is the case, approaching them as few-shot generation tasks may still yield insights but it is no longer productive to use them to benchmark finetuned models. + +Finetuned decoder-only PLMs can match encoder-decoder performance with scale In summarization, finetuned decoder-only PLMs, such as PaLM-540B, closely match or exceeds the best reported prior results on all English generation tasks. This demonstrates that PLMs can make up their architectural disadvantage through its vastly increased scale. While finetuning PLMs is computationally expensive, it serves as an important upper bound for few-shot predictions. + +Multilingual generation capabilities are highly dependent on pretraining data The PLMs evaluated are mostly pretrained on English corpora: $99 + \%$ for T5, LongT5, ST-MoE; $90\%$ for PaLM, LaMDA; contrarily mT5 is explicitly pre + +trained in a multilingual corpus. $^{9}$ PaLM achieves best results in 3 out of 4 English generation tasks which generate English text, even when the input is non-English. However, the much smaller mT5 bests the other models in 10 out of 14 non-English summarization tasks, and the relative difference between few-shot and finetuning is larger for non-English generation. This suggests that English-centric PLMs are better at processing non-English input than generating non-English output. + +Analyzing the effects of input context length Tasks with long inputs suffer from models' limitation to process said inputs. Inputs are thus usually transformed (e.g. cropped, re-ranked, etc) to fit into the model. We found that a several of the evaluated tasks, such as WikiLingua and MLSum benefit from a longer input context in models even if the long-context model is smaller (i.e., LongT5 vs T5). In contrast, the performance is comparable for the rest of short-context tasks. + +Given a natural language generation task: + +Step 1: Is few-shot learning (A) or finetuning (B) best suited? + +i) Inconsistent system rankings might indicate tasks are saturated. Few-shot learning will be more sensible to monitor in those cases. +ii) Encoder-decoder baselines are strong performers regardless of smaller scale. + +Step 2-A: How best to benchmark few-shot learning? + +i) Avoid curating prompts to individual PLMs. +ii) Randomly select exemplars for prompts. +iii) Control for output length outliers. + +Step 3: What is an efficient test set size? + +i) Pick the smallest size that produces consistent system rankings. +(ii) Evaluate more datasets rather than larger evaluations, adhering to (3.i). + +Step 4: What metrics are best suited for the task? + +(i) Effective automatic metrics should provide consistent system rankings. +(ii) Overlap-based metrics are not calibrated for few-shot learning. +iii) Human evaluation is vital if comparing few-shot vs finetuning. + +Figure 1: General recommendations when monitoring or benchmarking PLMs. + +# 5 Deriving Evaluation Practices + +Figure 1 summarizes the recommendations we developed from challenges we faced and our observed empirical results. These recommendations are best understood in the context of monitoring + +
TaskOne-shotFinetuning
PaLM 8BPaLM 540BLaMDA 137BGPT-3.5 175BPaLM 8BPaLM 540BST-MoE 32BT5 11BmT5 11BLongT5 3B
Data-To-Text
E2E (en)37.746.67.146.652.952.351.552.952.253.1
WebNLG (en)45.354.78.454.656.858.056.450.847.758.0
ToTTo (en)40.250.75.651.965.867.567.066.165.566.3
Czech Restaurant (cs)16.934.13.338.545.545.540.745.439.444.8
WebNLG (ru)16.833.74.533.340.940.528.241.241.141.6
English Generation
XSum (en)19.928.610.034.031.436.538.336.533.236.0
XLSum (en)16.822.78.427.934.644.345.443.141.842.6
WikiLingua (en)6.56.45.97.78.07.57.87.97.97.8
Crosslingual Generation
WikiLingua (es → en)6.56.15.07.77.77.67.37.87.67.9
WikiLingua (ru → en)10.217.50.718.929.935.725.127.931.730.8
WikiLingua (tr → en)10.120.07.721.231.138.831.526.836.728.2
WikiLingua (vi → en)7.714.52.216.228.932.922.922.731.028.5
Multilingual Generation [SentencePiece-ROUGE-2]
MLSum (es)12.814.35.213.023.024.525.024.325.725.6
MLSum (de)13.621.33.922.635.241.444.143.543.343.7
XLSum (ar)12.219.010.818.036.239.915.715.242.36.2
XLSum (bn)5.86.96.111.726.431.111.110.236.511.0
XLSum (ja)11.315.15.418.338.742.54.54.543.74.6
XLSum (id)16.820.49.020.135.543.541.141.643.540.8
XLSum (sw)16.724.511.515.432.736.437.037.440.736.3
XLSum (ko)16.118.27.917.633.837.320.319.545.019.9
XLSum (ru)12.616.110.819.130.338.318.117.838.617.7
XLSum (te)6.57.76.213.120.530.015.115.133.514.8
XLSum (th)6.78.65.213.323.429.513.513.734.313.1
XLSum (tr)15.217.78.016.833.342.430.330.442.329.7
XLSum (es)15.717.48.316.925.234.331.932.533.932.3
XLSum (vi)13.214.96.915.425.941.527.727.341.026.7
XLSum (hi)10.012.19.315.237.743.613.72.343.52.3
+ +Table 2: ROUGE-L and SentencePiece-ROUGE-L results on data-to-text and compression datasets. Best results in bold. Few-shot results lag behind finetuned results and the gap increases as tasks become more complex. The non-English performance mostly follows the trend that higher percentages of non-English pretraining data leads to better performance. Despite their much smaller size, encoder-decoder model frequently much larger decoder-only models after finetuning. + +and benchmarking PLMs during training or inference. + +Comparable few-shot learning evaluation As mentioned in Section 3, our design choices were made to ensure that results are comparable across PLMs. Primarily, prompts were deliberately kept extremely simple and all few-shot exemplars were randomly sampled. While highly curated prompts or methods like chain-of-thought prompting can increase the performance considerably (Wei et al., 2022b), it can also lead to overfitting to the particular model the prompt was developed on, in turn making a comparison to other models unfair and producing unrealistic expectations when people have single interactions with it. + +Overlap-based metrics are not calibrated to evaluate few-shot learning Few-shot generation suffers from not being able to predict output length properly given the few exemplars provided. While encoder-decoder models utilize end-of-string tokens, these are not always learned during decoder-only pretraining. To circumvent this issue, researchers rely on PLMs match to the few-shot format provided e.g. line-breaks that separate exemplars. We observed PLMs fail to follow the format a significant number of times, producing the largest allowed length on occasion. In our experiments, we tried to avoid very long outputs by trimming outputs to the 95-percentile length seen in the targets.10 Still, few-shot output lengths + +are on average 2-3 times the average target length while finetuned model's output average $80\%$ the average target length, across all tasks. Overlap metrics used in generation are sensitive to length (Sun et al., 2019) making a natural disadvantage for few-shot learners. We do not recommend using overlap-based metrics to compare few-shot results without length normalization. + +Computational costs can be decreased without sacrificing relative model performance The computational cost of evaluating large datasets, some with more than 10K examples, are prohibitive and perhaps unnecessary. To that end, we investigate if a model ranking can be produced, with a high degree of certainty, while only considering a random subset of the test set, saving compute cost to possibly evaluate on more tasks instead. To investigate this effect, we ran the following experiment: (1) Sample $n$ datapoints from a dataset and all corresponding model scores. (2) Following Kocmi et al. (2021) and Graham et al. (2014), we perform Wilcoxon Rank Sum test (Wilcoxon, 1946) to assess the stability of the ranking. (3) Repeat steps $1\& 2k$ times and record the fraction of runs in which models scores from any two models were not distinguishable from each other (those with a $p$ -value of $> 0.05$ ). Since we are considering 10 model settings in this work, this experiment considers all 45 possible pairs. + +The result shown in Figure 2 provides insight into the required number of data points to produce rankings. For most datasets, we can produce stable model rankings with only 500 examples, some with as little as 100. Tasks where models achieve very similar scores tend to require more test examples, since smaller score differences require more examples to be distinguishable from each other (Wei and Jia, 2021). + +Analyzing metrics utility We use different automated metrics to evaluate the generation quality of the models. These metrics attempt to capture the similarity between system generated output and the reference text. While ROUGE and chrF account for the lexical overlap, BLEURT is meant to compute the semantic similarity. It is important to understand the agreement between these metrics. We compute the system-level agreement via Spearman correlation coefficient (Spearman, 1987) between the scores given by the metrics to + +![](images/8f2b237a8ef5b7bd097f3bc5ce339fab0dc112c0e411c415dd944bde61c8bb93.jpg) +Figure 2: Empirical probability of p-value of Wilcoxon Rank Sum test $< 0.05$ for any combination between 1-shot and finetuned models. + +![](images/89f8671d6a34b783aa842569d1e69a77d75d6f8f0f872915f70681b71c491d3a.jpg) +Figure 3: Spearman correlation coefficients between metrics: (SP)ROUGE-L, BLEURT and $\mathrm{ChrF}$ + +the fine-tuned set of models. Figure 3 shows the correlation between ROUGE-L (RL), BLEURT and $\mathrm{ChrF}$ . We observe that the metrics are highly correlated for most datasets. Similar to Figure 2, on the tasks where the models have similar performance, we notice less correlation among the metrics. Such tasks are may have either saturated performance, e.g., ToTTo (en) or all models perform poorly, e.g., Wikilingua (es->en). Due to the small differences between models, metrics fail to produce the same rankings. + +# 6 Discussion and Reality Check + +In line with our goal to provide a "reality check" via empirical and theoretical research, and to reflect on the ways in which reported performance improvements are meaningful, we want to situate our findings in the context of the broader NLP community. Openly accessible APIs and publicly available large models have led to increased attention on large pretrained models, but they have also led to a "release-then-test" philosophy where models are released without extensive evaluations. While the findings we present in this paper do not + +solve this issue, agreeing on a shared evaluation process could lead to more realistic claims about model performance (and shortcomings), and allow for a more accurate monitoring of models during training. + +What claims can we not make? Empirical findings demonstrate that incorporating generation into NLU tasks via Chain-of-Thought leads to better model performance (Wei et al., 2022b; Suzgun et al., 2022). Providing additional grounding via finetuning on instructions and aligning a model to human feedback leads to better task-specific performance without supervision (Wei et al., 2022a; Ouyang et al., 2022a). However, we lack the scientific methods to quantify these advances. While benchmarks provide an indication whether a model is performing better than a previous iteration, and projects like BIG-bench (Srivastava et al., 2022) and HELM (Liang et al., 2022) enable evaluation on a very wide range of possible tasks, they are also inherently limited. + +When benchmarking models in few-shot settings, especially models for which little information about their training data is available, it is hard to disambiguate model performance from memorization, i.e. if the examples were seen during pretraining. Instruction tuning further blur the line between finetuning and few-shot, which can lead to very different outputs and are not fully comparable. It is thus near impossible to make claims about why a model is succeeding at one particular task without having access to its training data. + +As mentioned earlier, the target of this work is to derive best practices for comparing models in generation settings with constrained computational budgets, for example when monitoring a training model or when trying to compare on many different tasks. Our findings are grounded in much prior work that finds that metrics have a very high agreement with human judgments on the system-level (e.g., Kocmi et al., 2021), but are essentially meaningless on the segment-level. For that reason, we cannot derive claims beyond these rankings about utility of a model or whether a particular model would actually produce useful outputs for a task. To derive such insights, we point to work on extrinsic evaluation which requires comprehensive human evaluations (e.g., Lee et al., 2022). + +How can our findings be applied to improve the status quo? Since the generation capabilities of + +PLMs are currently not extensively monitored or evaluated, we set out to derive best practices for how these evaluations can look. We found that many of the "easy" tasks, on which finetuned models saturate the metrics, still yield insights for few-shot approaches. We further identified the tension between doing a computationally expensive full evaluation on a dataset and adding more evaluation sets for different tasks or languages. Our findings suggest that evaluation on small subsets of more tasks can be beneficial to the overall results. + +To further motivate this suggestion, consider the following thought experiment: We have two tasks, A and B. At 500 examples, they have a risk of producing a "wrong" ranking of $10\%$ . At 1,000 examples, they have a risk of producing a wrong ranking of $5\%$ . These risks are not correlated, i.e., their covariance is 0. Given a computational budget of evaluating on 1,000 examples, the risk of only evaluating on one dataset is $5\%$ , and the risk of producing two wrong ratings after evaluating on A and B is only $1\%$ . While additional datasets introduce a larger risk of one individual dataset producing misleading results (18% in this case), one can easily expand this argument to a whole portfolio of tasks to hedge against individual dataset risk (Stuart and Markowitz, 1959). Many existing NLU benchmarks like BIG bench (Srivastava et al., 2022) already follow such a strategy and we believe that generation evaluation, especially considering the additional risk due to metrics, should follow this approach for the use cases discussed in this work. To further minimize the individual dataset risk, they can be switched out once they saturate or their sample sizes increased. + +# 7 Conclusion + +In this work, we produced an extensive evaluation of a diverse set of state-of-the-art pre-trained language models (PLMs) for 27 different multilingual generation tasks under few-shot learning and finetuning settings. We discuss empirical results that help inform practitioners which tasks, methods and metrics are suitable. We provide recommendations on how best to monitor conditional generation capabilities of PLMs, including how to fairly benchmark few-shot learning, automated metrics and their utility, and how to efficiently utilize computational resources. We hope that such findings and recommendations could positively influence natural language evaluation in future work. + +# 8 Limitations + +In this work, we have presented results that help inform us what tasks, methods and metrics are best suited for monitoring as well as methodologies and empirical information about the current set of models. We provide detailed information of how these results can be reproduced, to the extend that research have access to the PLMs in question, but these results have limitations, in order to reduce costs, many languages were not evaluated which might have left unforeseen patterns not discussed in this work. Moreover, few-shot learning, in particular, could exhibit large variance if different prompts were chosen, or a different set of exemplars chosen. Because of the high costs involved our work does not explore the performance difference when multiple sets of hyper-parameters were chosen. + +On the conceptual level, we make the assumption that system-level improvements on our tasks translate to downstream usefulness. While prior work suggests that this is the case, tools like chatGPT have significantly expanded the possible application space beyond the realm of "typical" NLP tasks, and we don't know how well our findings generalize to this space of tasks. + +# 9 Ethics Statement + +This paper focuses on conditional generation tasks where models are free to generate long text sequences. Typical issues associated with text generation such as hallucinations, memorization of private information publicly available, toxic and discriminatory language, or sensitive generated content could and are likely to arise. measuring the extent to which these issues occur is a necessary and crucial additional dimension of model evaluation which we do not include in this work, which should be seen as supplemental. + +# References + +Farhad Akhbardeh, Arkady Arkhangorodsky, Magdalena Biesialska, Ondrej Bojar, Rajen Chatterjee, Vishrav Chaudhary, Marta R. Costa-jussa, Cristina Espana-Bonet, Angela Fan, Christian Federmann, Markus Freitag, Yvette Graham, Roman Grundkiewicz, Barry Haddow, Leonie Harter, Kenneth Heafield, Christopher Homan, Matthias Huck, Kwabena Amponsah-Kaakyire, Jungo Kasai, Daniel Khashabi, Kevin Knight, Tom Kocmi, Philipp Koehn, + +Nicholas Lourie, Christof Monz, Makoto Morishita, Masaaki Nagata, Ajay Nagesh, Toshiaki Nakazawa, Matteo Negri, Santanu Pal, Allahsera Auguste Tapo, Marco Turchi, Valentin Vydrin, and Marcos Zampieri. 2021. Findings of the 2021 conference on machine translation (WMT21). In Proceedings of the Sixth Conference on Machine Translation, pages 1-88, Online. 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, 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. + +Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, Parker Schuh, Kensen Shi, Sasha Tsvyashchenko, Joshua Maynez, Abhishek B Rao, Parker Barnes, Yi Tay, Noam M. Shazeer, Vinodkumar Prabhakaran, Emily Reif, Nan Du, Benton C. Hutchinson, Reiner Pope, James Bradbury, Jacob Austin, Michael Isard, Guy Gur-Ari, Pengcheng Yin, Toju Duke, Anselm Levskaya, Sanjay Ghemawat, Sunipa Dev, Henryk Michalewski, Xavier Garcia, Vedant Misra, Kevin Robinson, Liam Fedus, Denny Zhou, Daphne Ippolito, David Luan, Hyeontaek Lim, Barret Zoph, Alexander Spiridonov, Ryan Sepassi, David Dohan, Shivani Agrawal, Mark Omernick, Andrew M. Dai, Thanumalayan Sankaranarayana Pillai, Marie Pellat, Aitor Lewkowycz, Erica Moreira, Rewon Child, Oleksandr Polozov, Katherine Lee, Zongwei Zhou, Xuezhi Wang, Brennan Saeta, Mark Diaz, Orhan Firat, Michele Catasta, Jason Wei, Kathleen S. Meier-Hellstern, Douglas Eck, Jeff Dean, Slav Petrov, and Noah Fiedel. 2022. Palm: Scaling language modeling with pathways. ArXiv, abs/2204.02311. + +Hyung Won Chung, Thibault Fevry, Henry Tsai, Melvin Johnson, and Sebastian Ruder. 2021. Rethinking embedding coupling in pre-trained language models. In International Conference on Learning Representations. + +Jonathan H. Clark, Eunsol Choi, Michael Collins, Dan Garrette, Tom Kwiatkowski, Vitaly Nikolaev, and Jennimaria Palomaki. 2020. TyDi QA: A benchmark for information-seeking question answering in typologically diverse languages. Transactions of the Association for Computational Linguistics, 8:454-470. + +Nan Du, Yanping Huang, Andrew M. Dai, Simon Tong, Dmitry Lepikhin, Yuanzhong Xu, Maxim Krikun, Yanqi Zhou, Adams Wei Yu, Orhan First, Barret Zoph, Liam Fedus, Maarten Bosma, Zongwei Zhou, Tao Wang, Yu Emma Wang, Kellie Webster, + +Marie Pellat, Kevin Robinson, Kathleen S. Meier-Hellstern, Toju Duke, Lucas Dixon, Kun Zhang, Quoc V. Le, Yonghui Wu, Z. Chen, and Claire Cui. 2022. Glam: Efficient scaling of language models with mixture-of-experts. In International Conference on Machine Learning. + +Ondrej Dusek and Filip Jurvc'ivcek. 2019. Neural generation for czech: Data and baselines. + +Ondrej Dusek, David M Howcroft, and Verena Rieser. 2019. Semantic Noise Matters for Neural Natural Language Generation. In Proceedings of the 12th International Conference on Natural Language Generation (INLG 2019), pages 421-426, Tokyo, Japan. + +Kawin Ethayarajh and Dan Jurafsky. 2020. Utility is in the eye of the user: A critique of NLP leaderboards. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 4846-4853, Online. Association for Computational Linguistics. + +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+), Dublin/Virtual, Ireland. + +Markus Freitag, George Foster, David Grangier, and Colin Cherry. 2020. Human-paraphrased references improve neural machine translation. In Proceedings of the Fifth Conference on Machine Translation, pages 1183-1192, Online. Association for Computational Linguistics. + +Claire Gardent, Anastasia Shimorina, Shashi Narayan, and Laura Perez-Beltrachini. 2017. Creating training corpora for nlg micro-planners. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 179-188. Association for Computational Linguistics. + +Sebastian Gehrmann, Tosin Adewumi, Karmanya Aggarwal, Pawan Sasanka Ammanamanchi, Aremu Anuoluwapo, Antoine Bosselut, Khyathi Raghavi Chandu, Miruna Clinciu, Dipanjan Das, Kaustubh D. Dhole, Wanyu Du, Esin Durmus, Ondrej Dusek, Chris Emezue, Varun Gangal, Cristina Garbacea, Tatsunori Hashimoto, Yufang Hou, Yacine Jernite, Harsh Jhamtani, Yangfeng Ji, Shailza Jolly, Mihir Kale, Dhruv Kumar, Faisal Ladhak, Aman Madaan, Mounica Maddela, Khyati Mahajan, Saad Mahamood, Bodhisattwa Prasad Majumder, Pedro Henrique Martins, Angelina McMillan-Major, Simon Mille, Emiel van Miltenburg, Moin Nadeem, Shashi Narayan, Vitaly Nikolaev, Rubungo Andre Niyongabo, Salomey Osei, Ankur Parikh, Laura Perez-Beltrachini, Niranan Ramesh Rao, Vikas Raunak, Juan Diego Rodriguez, Sashank Santhanam, João Sedoc, Thibault Sellam, Samira Shaikh, Anastasia Shimorina, Marco + +Antonio Sobrevilla Cabezudo, Hendrik Strobelt, Nishant Subramani, Wei Xu, Diyi Yang, Akhila Yerukola, and Jiawei Zhou. 2021. The gem benchmark: Natural language generation, its evaluation and metrics. + +Sebastian Gehrmann, Abhik Bhattacharjee, Abinaya Mahendiran, Alex Wang, Alexandros Papangelis, Aman Madaan, Angelina McMillan-Major, Anna Shvets, Ashish Upadhyay, Bingsheng Yao, et al. 2022a. Gemv2: Multilingual nlg benchmarking in a single line of code. arXiv preprint arXiv:2206.11249. + +Sebastian Gehrmann, Elizabeth Clark, and Thibault Sellam. 2022b. Repairing the cracked foundation: A survey of obstacles in evaluation practices for generated text. ArXiv, abs/2202.06935. + +Tanya Goyal, Junyi Jessy Li, and Greg Durrett. 2022. News summarization and evaluation in the era of GPT-3. CoRR, abs/2209.12356. + +Yvette Graham, Timothy Baldwin, Alistair Moffat, and Justin Zobel. 2014. Is machine translation getting better over time? In Proceedings of the 14th Conference of the European Chapter of the Association for Computational Linguistics, pages 443-451, Gothenburg, Sweden. Association for Computational Linguistics. + +Mandy Guo, Joshua Ainslie, David C. Uthus, Santiago Otonanón, Jianmo Ni, Yun-Hsuan Sung, and Yinfei Yang. 2021. LongT5: Efficient text-to-text transformer for long sequences. CoRR, abs/2112.07916. + +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. + +Tom Kocmi, Christian Federmann, Roman Grundkiewicz, Marcin Junczys-Dowmunt, Hitokazu Matsushita, and Arul Menezes. 2021. To ship or not to ship: An extensive evaluation of automatic metrics for machine translation. In Proceedings of the Sixth Conference on Machine Translation, pages 478-494, Online. Association for Computational Linguistics. + +Taku Kudo and John Richardson. 2018. Sentence-Piece: A simple and language independent subword tokenizer and detokenizer 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. + +Faisal Ladhak, Esin Durmus, Claire Cardie, and Kathleen McKeown. 2020. WikiLingua: A new benchmark dataset for cross-lingual abstractive summarization. In *Findings of the Association for Computational Linguistics: EMNLP* 2020, pages 4034–4048, Online. Association for Computational Linguistics. + +Mina Lee, Megha Srivastava, Amelia Hardy, John Thickstun, Esin Durmus, Ashwin Paranjape, Ines Gerard-Ursin, Xiang Lisa Li, Faisal Ladhak, Frieda Rong, Rose E. Wang, Minae Kwon, Joon Sung Park, Hancheng Cao, Tony Lee, Rishi Bommasani, Michael S. Bernstein, and Percy Liang. 2022. Evaluating human-language model interaction. CoRR, abs/2212.09746. + +Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. 2020a. Bart: Denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension. In Annual Meeting of the 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 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. + +Percy Liang, Rishi Bommasani, Tony Lee, Dimitris Tsipras, Dilara Soylu, Michihiro Yasunaga, Yian Zhang, Deepak Narayanan, Yuhuai Wu, Ananya Kumar, Benjamin Newman, Binhang Yuan, Bobby Yan, Ce Zhang, Christian Cosgrove, Christopher D. Manning, Christopher R'e, Diana Acosta-Navas, Drew A. Hudson, E. Zelikman, Esin Durmus, Faisal Ladhak, Frieda Rong, Hongyu Ren, Huaxiu Yao, Jue Wang, Keshav Santhanam, Laurel J. Orr, Lucia Zheng, Mert Yuksekgonul, Mirac Suzgun, Nathan S. Kim, Neel Guha, Niladri S. Chatterji, O. Khattab, Peter Henderson, Qian Huang, Ryan Chi, Sang Michael Xie, Shibani Santurkar, Surya Ganguli, Tatsunori Hashimoto, Thomas F. Icard, Tianyi Zhang, Vishrav Chaudhary, William Wang, Xuechen Li, Yifan Mai, Yuhui Zhang, and Yuta Koreeda. 2022. Holistic evaluation of language models. ArXiv, abs/2211.09110. + +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. + +Nitika Mathur, Johnny Wei, Markus Freitag, Qingsong Ma, and Ondrej Bojar. 2020. Results of the WMT20 metrics shared task. In Proceedings of the Fifth Conference on Machine Translation, pages 688-725, Online. Association for Computational Linguistics. + +Simon Mille, Kaustubh D. Dhole, Saad Mahamood, Laura Perez-Beltrachini, Varun Gangal, Mihir Sanjay Kale, Emiel van Miltenburg, and Sebastian Gehrmann. 2021. Automatic construction of evaluation suites for natural language generation datasets. In Proceedings of the Neural Information Processing Systems Track on Datasets and Benchmarks 1, NeurIPS Datasets and Benchmarks 2021, December 2021, virtual. + +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. + +Jekaterina Novikova, Ondrej Dusek, and Verena Rieser. 2017. The E2E dataset: New challenges for end-to-end generation. In Proceedings of the 18th Annual SIGdial Meeting on Discourse and Dialogue, pages 201-206, Saarbrücken, Germany. Association for Computational Linguistics. + +Long Ouyang, Jeff Wu, Xu Jiang, Diogo Almeida, Carroll L. Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, John Schulman, Jacob Hilton, Fraser Kelton, Luke Miller, Maddie Simens, Amanda Askell, Peter Welinder, Paul F. Christiano, Jan Leike, and Ryan Lowe. 2022a. Training language models to follow instructions with human feedback. CoRR, abs/2203.02155. + +Long Ouyang, Jeff Wu, Xu Jiang, Diogo Almeida, Carroll L. Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, John Schulman, Jacob Hilton, Fraser Kelton, Luke E. Miller, Maddie Simens, Amanda Askell, Peter Welinder, Paul Francis Christiano, Jan Leike, and Ryan J. Lowe. 2022b. Training language models to follow instructions with human feedback. ArXiv, abs/2203.02155. + +Ankur P. Parikh, Xuezhi Wang, Sebastian Gehrmann, Manaal Faruqui, Bhuwan Dhingra, Diyi Yang, and Dipanjan Das. 2020. Totto: A controlled table-to-text generation dataset. ArXiv, abs/2004.14373. + +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. + +Amy Pu, Hyung Won Chung, Ankur Parikh, Sebastian Gehrmann, and Thibault Sellam. 2021. Learning compact metrics for MT. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 751-762, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. + +Jack W. Rae, Sebastian Borgeaud, Trevor Cai, Katie Millican, Jordan Hoffmann, Francis Song, John Aslanides, Sarah Henderson, Roman Ring, Susannah Young, Eliza Rutherford, Tom Hennigan, Jacob Menick, Albin Cassirer, Richard Powell, George van den Driessche, Lisa Anne Hendricks, Maribeth Rauh, Po-Sen Huang, Amelia Glaese, Johannes Welbl, Sumanth Dathathri, Saffron Huang, Jonathan Uesato, John F. J. Mellor, Irina Higgins, Antonia Creswell, Nathan McAleese, Amy Wu, Erich Elsen, Siddhant M. Jayakumar, Elena Buchatskaya, David Budden, Esme Sutherland, Karen Simonyan, Michela Paganini, L. Sifre, Lena Martens, Xiang Lorraine + +Li, Adhiguna Kuncoro, Aida Nematzadeh, Elena Gribovskaya, Domenic Donato, Angeliki Lazaridou, Arthur Mensch, Jean-Baptiste Lespiau, Maria Tsimpoukelli, N. K. Grigorev, Doug Fritz, Thibault Sottiaux, Mantas Pajarskas, Tobias Pohlen, Zhitao Gong, Daniel Toyama, Cyprien de Masson d'Autume, Yujia Li, Tayfun Terzi, Vladimir Mikulik, Igor Babuschkin, Aidan Clark, Diego de Las Casas, Aurelia Guy, Chris Jones, James Bradbury, Matthew G. Johnson, Blake A. Hechtman, Laura Weidinger, Jason Gabriel, William S. Isaac, Edward Lockhart, Simon Osindero, Laura Rimell, Chris Dyer, Oriol Vinyals, Kareem W. Ayoub, Jeff Stanway, L. L. Bennett, Demis Hassabis, Koray Kavukcuoglu, and Geoffrey Irving. 2021. Scaling language models: Methods, analysis & insights from training gopher. ArXiv, abs/2112.11446. + +Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. 2020a. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 21(140):1-67. + +Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J Liu, et al. 2020b. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 21(140):1-67. + +Tven Le Scao, Angela Fan, Christopher Akiki, Ellie Pavlick, Suzana Ilic, Daniel Hesslow, Roman Castagné, Alexandra Sasha Luccioni, François Yvon, Matthias Galle, et al. 2022. Bloom: A 176b-parameter open-access multilingual language model. arXiv preprint arXiv:2211.05100. + +Thomas Scialom, Paul-Alexis Dray, Sylvain Lamprier, Benjamin Piwowarski, and Jacopo Staiano. 2020. MLSUM: the multilingual summarization corpus. CoRR, abs/2004.14900. + +Thibault Sellam, Dipanjan Das, and Ankur P. Parikh. 2020. Bleurt: Learning robust metrics for text generation. In Annual Meeting of the Association for Computational Linguistics. + +C. Spearman. 1987. The proof and measurement of association between two things. by c. spearman, 1904. The American journal of psychology, 100 3-4:441-71. + +Aarohi Srivastava, Abhinav Rastogi, Abhishek Rao, Abu Awal Md Shoeb, Abubakar Abid, Adam Fisch, Adam R. Brown, Adam Santoro, Aditya Gupta, Adrià Garriga-Alonso, Agnieszka Kluska, Aitor Lewkowycz, Akshat Agarwal, Alethea Power, Alex Ray, Alex Warstadt, Alexander W. Kocurek, Ali Safaya, Ali Tazarv, Alice Xiang, Alicia Parrish, Allen Nie, Aman Hussain, Amanda Askell, Amanda Dsouza, Ameet Rahane, Anantharaman S. Iyer, Anders Andreassen, Andrea Santilli, Andreas Stuhlmüller, Andrew M. Dai, Andrew La, Andrew K. Lampinen, Andy Zou, Angela Jiang, Angelica Chen, Anh Vuong, Animesh Gupta, Anna Gottardi, Antonio Norelli, Anu Venkatesh, Arash Gholamidavoodi, Arfa Tabassum + +Arul Menezes, Arun Kirubarajan, Asher Mullokandov, Ashish Sabharwal, Austin Herrick, Avia Efrat, Aykut Erdem, Ayla Karakas, and et al. 2022. Beyond the imitation game: Quantifying and extrapolating the capabilities of language models. CoRR, abs/2206.04615. + +Alan L. Stuart and Harry M. Markowitz. 1959. Portfolio selection: Efficient diversification of investments. A Quarterly Journal of Operations Research, 10:253. + +Simeng Sun, Ori Shapira, Ido Dagan, and Ani Nenkova. 2019. How to compare summarizers without target length? pitfalls, solutions and reexamination of the neural summarization literature. In Proceedings of the Workshop on Methods for Optimizing and Evaluating Neural Language Generation, pages 21-29, Minneapolis, Minnesota. Association for Computational Linguistics. + +Mirac Suzgun, Nathan Scales, Nathanael Scharli, Sebastian Gehrmann, Yi Tay, Hyung Won Chung, Aakanksha Chowdhery, Quoc V. Le, Ed H. Chi, Denny Zhou, and Jason Wei. 2022. Challenging big-bench tasks and whether chain-of-thought can solve them. CoRR, abs/2210.09261. + +Yi Tay, Mostafa Dehghani, Samira Abnar, Hyung Won Chung, William Fedus, Jinfeng Rao, Sharan Narang, Vinh Q Tran, Dani Yogatama, and Donald Metzler. 2022. Scaling laws vs model architectures: How does inductive bias influence scaling? arXiv preprint arXiv:2207.10551. + +Romal Thoppilan, Daniel De Freitas, Jamie Hall, Noam M. Shazeer, Apoorv Kulshreshtha, HengTze Cheng, Alicia Jin, Taylor Bos, Leslie Baker, Yu Du, Yaguang Li, Hongrae Lee, Huaixiu Zheng, Amin Ghafouri, Marcelo Menegali, Yanping Huang, Maxim Krikun, Dmitry Lepikhin, James Qin, Dehao Chen, Yuanzhong Xu, Zhifeng Chen, Adam Roberts, Maarten Bosma, Yanqi Zhou, Chung-Ching Chang, I. A. Krivokon, Willard James Rusch, Marc Pickett, Kathleen S. Meier-Hellstern, Meredith Ringel Morris, Tulsee Doshi, Renelito Delos Santos, Toju Duke, Johnny Hartz Søraker, Ben Zevenbergen, Vinodkumar Prabhakaran, Mark Diaz, Ben Hutchinson, Kristen Olson, Alejandra Molina, Erin Hoffman-John, Josh Lee, Lora Aroyo, Ravindran Rajakumar, Alena Butryna, Matthew Lamm, V. O. Kuzmina, Joseph Fenton, Aaron Cohen, Rachel Bernstein, Ray Kurzweil, Blaise Aguera-Arcas, Claire Cui, Marian Croak, Ed Chi, and Quoc Le. 2022. Lamda: Language models for dialog applications. ArXiv, abs/2201.08239. + +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. ArXiv, abs/1905.00537. + +Jason Wei, Maarten Bosma, Vincent Y. Zhao, Kelvin Guu, Adams Wei Yu, Brian Lester, Nan Du, Andrew M. Dai, and Quoc V. Le. 2022a. Finetuned language models are zero-shot learners. In The Tenth International Conference on Learning Representations, + +ICLR 2022, Virtual Event, April 25-29, 2022. OpenReview.net. +Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Ed Huai hsin Chi, Quoc Le, and Denny Zhou. 2022b. Chain of thought prompting elicits reasoning in large language models. ArXiv, abs/2201.11903. +Johnny Wei and Robin Jia. 2021. The statistical advantage of automatic NLG metrics at the system level. 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 6840-6854, Online. Association for Computational Linguistics. +Frank Wilcoxon. 1946. Individual comparisons of grouped data by ranking methods. Journal of economic entomology, 39(2):269-270. +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. +Barret Zoph, Irwan Bello, Sameer Kumar, Nan Du, Yanping Huang, Jeff Dean, Noam Shazeer, and William Fedus. 2022. St-moe: Designing stable and transferable sparse expert models. + +# A Additional empirical results + +Table 3, Table 4 and Table 5 report ROUGE-2 and BLEURT and ChrF results respectively for all tasks. These results are in line with the discussed results in 4 + +# B Technical details + +Finetuning and inference was done in the t5x framework for public and closed access models. Few-shot learning task methodology is well described in 3, for public access models inference was done via their respective public API, whilst all other models were loaded from the standard checkpoint into TPU accelerators and inference was done on batches of 64. Finetuning was carried out in TPU accelerators, for PaLM we used a constant learning rate of $5 \times 10^{-5}$ , 20x smaller than during pretraining and reset the optimizer's (Adafactor) accumulators, for T5, mT5 and LongT5 we used a constant learning rate of $1 \times 10^{-4}$ . + +# C Computational Cost and Environmental Impact + +In our work we benchmark 27 generation tasks which require a substantial amount of computational resources. Inference on PLMs is exceedingly more efficient than finetuning. We report the number of test examples across all tasks to be 194,844. Inference over this number of examples times 10 models evaluated amounts to 2 million inference examples. Finetuning on the other hand, requires all parameters to be trained and training dataset sizes are considerably larger. We estimate the compute usage for finetuning to be 256 TPU v3 chips for 200 hours. One of the goals of this work is to encourage benchmarking in the future to avoid these costs by more efficiently selecting smaller test size and persuade researchers to only evaluate finetuning approaches when suitable. + +![](images/4ec699ea49b07c8a54ccf9a4ca0faeba4623e04126080d1c8552d903eca461eb.jpg) +Figure 4: Empirical probability of p-value of Wilcoxon Rank Sum test $< 0.05$ for any combination between 1-shot and finetuned models. + +
TaskOne shotFinetuning
PaLM 8BPaLM 540BLaMDA 137BGPT-3.5 175BPaLM 8BPaLM 540BST-MoE 32BT5 11BmT5 11BLongT5 3B
Data-To-Text
E2E (en)26.737.34.237.945.745.344.245.245.546.3
WebNLG (en)33.845.85.446.047.749.247.639.635.848.8
ToTTo (en)26.437.83.238.153.955.955.254.153.354.5
Czech Restaurant (cs)7.918.10.922.330.230.625.428.825.029.9
WebNLG (ru)4.916.51.216.822.423.413.023.123.224.2
English Generation
XSum (en)8.014.43.419.916.321.222.821.017.520.8
XLSum (en)6.511.72.717.019.629.530.628.026.527.4
WikiLingua (en)0.70.40.70.90.40.40.40.40.40.4
Crosslingual Generation
WikiLingua (es → en)0.70.50.40.60.40.40.30.40.40.4
WikiLingua (ru → en)3.16.80.17.814.018.712.012.715.114.4
WikiLingua (tr → en)3.18.72.110.116.623.017.713.820.814.3
WikiLingua (vi → en)2.45.50.46.813.40.410.39.714.813.2
Multilingual Generation [SentencePiece-ROUGE-2]
MLSum (es)3.74.50.74.910.70.713.112.113.513.6
MLSum (de)8.816.81.216.926.933.436.536.135.936.3
XLSum (ar)4.511.72.49.625.830.01.92.032.10.6
XLSum (bn)1.01.80.52.718.523.50.20.129.40.1
XLSum (ja)4.06.70.39.627.131.80.10.131.50.1
XLSum (id)7.211.33.712.625.033.030.530.732.730.3
XLSum (sw)7.916.26.56.622.726.827.827.631.326.8
XLSum (ko)6.99.61.69.423.026.74.13.734.94.0
XLSum (ru)6.09.23.710.920.829.44.56.129.66.1
XLSum (te)2.43.31.14.813.322.73.23.226.53.3
XLSum (th)2.94.00.36.216.422.52.42.526.92.4
XLSum (tr)7.510.53.210.723.732.717.617.832.217.7
XLSum (es)5.89.03.19.614.223.720.120.623.020.6
XLSum (vi)4.86.81.57.520.235.911.913.235.513.1
XLSum (hi)4.46.41.87.029.035.71.80.035.40.0
+ +Table 3: ROUGE-2 and SentencePiece-ROUGE-2 results in data-to-text, English and multilingual generation datasets. + +
TaskOne shotFinetuning
PaLM 8BPaLM 540BLaMDA 137BGPT-3.5 175BPaLM 8BPaLM 540BST-MoE 32BT5 11BmT5 11BLongT5 3B
Data-To-Text
E2E (en)46.157.815.157.862.561.961.162.160.961.8
WebNLG (en)47.561.817.061.863.665.264.159.455.865.4
ToTTo (en)43.555.812.655.267.569.468.367.366.867.7
Czech Restaurant (cs)17.635.67.941.548.048.136.638.244.140.1
WebNLG (ru)21.845.515.345.362.762.624.431.863.532.1
English Generation
XSum (en)24.632.718.537.634.438.941.339.336.839.0
XLSum (en)23.829.913.933.535.845.847.046.043.944.4
WikiLingua (en)14.714.315.415.815.114.615.215.815.815.3
Crosslingual Generation
WikiLingua (es → en)16.813.210.214.614.214.913.015.114.815.7
WikiLingua (ru → en)19.121.51.522.530.635.924.028.834.333.3
WikiLingua (tr → en)19.324.612.326.734.439.432.630.839.032.7
WikiLingua (vi → en)16.419.94.421.331.814.223.227.632.332.5
Multilingual Generation
MLSum (es)21.322.95.320.628.018.429.128.730.730.3
MLSum (de)28.937.05.734.441.948.850.950.550.151.5
XLSum (ar)14.222.711.424.435.039.60.20.241.60.1
XLSum (bn)10.312.74.517.528.634.00.00.037.80.0
XLSum (ja)8.811.61.213.826.031.30.80.930.60.9
XLSum (id)21.026.09.026.236.845.343.242.343.043.4
XLSum (sw)24.033.015.021.536.242.040.141.144.441.6
XLSum (ko)6.99.41.610.018.021.81.41.227.51.4
XLSum (ru)15.019.89.426.529.138.614.420.140.319.9
XLSum (te)11.313.64.716.818.029.80.30.230.40.3
XLSum (th)14.716.84.421.527.133.40.30.333.90.3
XLSum (tr)20.324.96.224.532.743.131.233.142.633.8
XLSum (es)19.022.97.322.024.533.431.531.932.632.8
XLSum (vi)10.913.12.414.221.837.116.920.234.321.1
XLSum (hi)12.215.16.618.833.239.60.20.039.10.0
+ +Table 4: ChrF results in data-to-text, English and multilingual generation datasets. + +
TaskOne shotFinetuning
PaLM 8BPaLM 540BLaMDA 137BGPT-3.5 175BPaLM 8BPaLM 540BST-MoE 32BT5 11BmT5 11BLongT5 3B
Data-To-Text
E2E (en)60.071.844.272.376.575.875.176.475.976.2
WebNLG (en)62.374.543.574.775.876.875.671.267.876.3
ToTTo (en)56.969.433.169.576.877.977.076.676.876.7
Czech Restaurant (cs)34.766.832.272.275.874.448.851.872.948.8
WebNLG (ru)39.267.819.766.977.578.025.929.878.429.9
English Generation
XSum (en)43.046.928.253.451.055.558.556.453.256.4
XLSum (en)32.741.122.051.152.661.963.061.860.360.8
WikiLingua (en)33.334.027.934.332.232.231.332.432.632.1
Crosslingual Generation
WikiLingua (es → en)32.933.716.833.432.332.631.032.533.032.5
WikiLingua (ru → en)38.843.36.445.950.654.446.449.152.351.5
WikiLingua (tr → en)39.344.019.346.449.254.448.645.452.846.8
WikiLingua (vi → en)35.638.25.740.850.632.845.445.551.450.0
Multilingual Generation
MLSum (es)21.021.5-1.326.730.66.325.924.232.027.0
MLSum (de)39.450.14.649.357.863.462.561.661.561.4
XLSum (ar)19.828.52.527.744.650.12.83.553.04.3
XLSum (bn)31.841.80.227.446.657.12.93.662.72.8
XLSum (ja)28.131.4-1.234.747.052.2-0.3-0.353.0-0.3
XLSum (id)41.247.49.553.858.768.061.465.566.865.6
XLSum (sw)25.536.314.324.045.852.948.650.259.148.9
XLSum (ko)25.631.6-0.333.040.547.10.81.654.61.4
XLSum (ru)30.137.33.233.047.959.614.216.758.017.0
XLSum (te)29.635.06.522.732.049.110.911.551.612.4
XLSum (th)22.027.2-0.116.331.943.6-1.1-0.946.0-1.1
XLSum (tr)30.834.53.340.049.863.821.426.462.526.3
XLSum (es)21.226.30.030.631.546.233.336.145.235.7
XLSum (vi)14.514.5-1.616.424.746.5-4.0-4.645.0-4.5
XLSum (hi)33.940.47.033.750.757.55.74.657.34.6
+ +Table 5: BLEURT results in data-to-text, English and multilingual generation datasets. + +# A For every submission: + +A1. Did you describe the limitations of your work? + +We added a section on Limitations. + +A2. Did you discuss any potential risks of your work? + +We discuss in the ethics section the risks of autoregressive text generation, in particular how it can produce misinformation or sensitive data. + +A3. Do the abstract and introduction summarize the paper's main claims? + +The introduction summarizes the paper's main claims. + +A4. Have you used AI writing assistants when working on this paper? + +Left blank. + +# B Did you use or create scientific artifacts? + +We used artifacts throughout + +B1. Did you cite the creators of artifacts you used? + +We used generation datasets found through the GEM benchmark (gem-benchmark.com). We cite the researchers that released these data in section 3.1. + +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? + +Licenses: MLSum (Scialom et al., 2020) - MIT License https://github.com/ThomasScialom/MLSUM/blob/master/LICE + +WikiLingua(Ladhak et al., 2020) - cc-by-3.0 https://gem-benchmark.com/data Cards/wiki_lingua + +XSum(Narayan et al., 2018) - cc-by-sa-4.0 https://gem-benchmark.com/data Cards/xsum + +Clean E2ENLG(Novikova et al., 2017; Duseket al., 2019)-cc-by-sa-4.0 https://gem-benchmark.com/data Cards/e2e_ + +Czech Restaurants (Dusek and Jurvcivcek, 2019) - cc-by-sa-4.0https://gem-benchmark.com/data Cards/cs/restaurants + +WebNLG 2020(Gardent et al., 2017; Ferreira et al., 2020) - cc-by-nc-4.0 https://gem-benchmark.com/data Cards/web_ + +ToTTo(Parikh et al., 2020) - cc-by-sa-3.0 https://gem-benchmark.com/data Cards/totto + +XL-Sum(Hasan et al., 2021) - cc-by-nc-sa-4.0 https://gem-benchmark.com/data Cards/xlsum + +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +All the data mentioned above has intended research purposes which is consistent with this work's use. We mention this in the paper + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? + +No data was collected. The data has been revised outside this work by community efforts such as GEM. + +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? + +We provided information on the languages covered by each dataset in Table 1, as well as the publicly available information on model's pretraining data language distribution. + +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. + +We provided information on the statistic of the datasets used in Table 1, + +# C Did you run computational experiments? + +Section 4 and 5 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +Number of parameters per model is reported in section 3.2. Computing infrastructure is mentioned in the appendix B. The total computational budget is discussed in its own section. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +Hyper parameter selection is discussed in appendix B. Experimental setup is discussed in the methodology section. + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +Most of the contributions for this paper are statistics of empirical results and method to obtain them. + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +We provide this information in the main text, in footnotes. + +# D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +No response. + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +No response. + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +No response. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +No response. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +No response. \ No newline at end of file diff --git a/benchmarkinglargelanguagemodelcapabilitiesforconditionalgeneration/images.zip b/benchmarkinglargelanguagemodelcapabilitiesforconditionalgeneration/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..0e5aed635aaca174bf11877dfe6adb60c12cd6ba --- /dev/null +++ b/benchmarkinglargelanguagemodelcapabilitiesforconditionalgeneration/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8097affc866bdf7f7b3fa81fb5c40837db92596c083a990a2d81282033e815bf +size 1056041 diff --git a/benchmarkinglargelanguagemodelcapabilitiesforconditionalgeneration/layout.json b/benchmarkinglargelanguagemodelcapabilitiesforconditionalgeneration/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..b7495d0670ec75080f5506ff2df17ac913735989 --- /dev/null +++ b/benchmarkinglargelanguagemodelcapabilitiesforconditionalgeneration/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b3db6fcf93823f96fc08626da4193b1c187acdd96259a92a31a4466e04722606 +size 443073 diff --git a/bestksearchalgorithmforneuraltextgeneration/5992ef9a-2935-4c81-82c0-b4b09f3db1cf_content_list.json b/bestksearchalgorithmforneuraltextgeneration/5992ef9a-2935-4c81-82c0-b4b09f3db1cf_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..a06880352e9cc092bc244c3cab9ed27ce381a698 --- /dev/null +++ b/bestksearchalgorithmforneuraltextgeneration/5992ef9a-2935-4c81-82c0-b4b09f3db1cf_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0bc98783a7f0dc984b553605c67ea3a48a1a7203d8874e26c42056a0b2e76a59 +size 130685 diff --git a/bestksearchalgorithmforneuraltextgeneration/5992ef9a-2935-4c81-82c0-b4b09f3db1cf_model.json b/bestksearchalgorithmforneuraltextgeneration/5992ef9a-2935-4c81-82c0-b4b09f3db1cf_model.json new file mode 100644 index 0000000000000000000000000000000000000000..a52076a465107edb0b42665dada0e961ce780a64 --- /dev/null +++ b/bestksearchalgorithmforneuraltextgeneration/5992ef9a-2935-4c81-82c0-b4b09f3db1cf_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fab1cc4bd1cc5fe6184ce9d646d4bb78a6f77cd6745670bb836134343146cc25 +size 157911 diff --git a/bestksearchalgorithmforneuraltextgeneration/5992ef9a-2935-4c81-82c0-b4b09f3db1cf_origin.pdf b/bestksearchalgorithmforneuraltextgeneration/5992ef9a-2935-4c81-82c0-b4b09f3db1cf_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..bdf893b54d9741b4b99f53bd336bff1258e38484 --- /dev/null +++ b/bestksearchalgorithmforneuraltextgeneration/5992ef9a-2935-4c81-82c0-b4b09f3db1cf_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:79301b864c5d4deeecc53614e7365d7a334cd05d111e1071cf611bede82db9c8 +size 1354576 diff --git a/bestksearchalgorithmforneuraltextgeneration/full.md b/bestksearchalgorithmforneuraltextgeneration/full.md new file mode 100644 index 0000000000000000000000000000000000000000..2c03df50fe9d45877d013e71e913247839935fd9 --- /dev/null +++ b/bestksearchalgorithmforneuraltextgeneration/full.md @@ -0,0 +1,527 @@ +# Best- $k$ Search Algorithm for Neural Text Generation + +Jiacheng Xu Caiming Xiong Silvio Savarese Yingbo Zhou Salesforce AI Research + +{jiacheng.xu, cxiong, ssavarese, yingbo.zhou}@salesforce.com + +# Abstract + +Modern natural language generation paradigms require a decoding strategy to obtain quality sequences out of the model. Beam search yields high-quality but low diversity outputs; stochastic approaches suffer from high variance and sometimes low quality. In this work, we propose a deterministic search algorithm balancing both quality and diversity. We first investigate the vanilla best-first search (BFS) algorithm and then propose the best- $k$ search algorithm. Inspired by BFS, we greedily expand the top $k$ nodes, instead of the first node, to boost efficiency and diversity. Upweighting recently discovered nodes accompanied by heap pruning ensures the completeness of the search procedure. Experiments on four NLG tasks show that best- $k$ search yields more diverse and natural outputs compared to strong baselines, while our approach maintains high text quality. The proposed algorithm is parameter-free, lightweight, efficient, and easy-to-use. $^{1}$ + +# 1 Introduction + +Large-scale pre-trained language models (Devlin et al. (2019); Raffel et al. (2020); Brown et al. (2020); Nijkamp et al. (2022), inter alia) has significantly advanced the field of natural language generation. Despite the models' increasing capability in fluency, expressiveness and domain generalization, the generated outputs from these models are far from perfect (Gehman et al., 2020; Kryscinski et al., 2020; Fabbri et al., 2021). The decoding strategy is another crucial piece in this paradigm. If we form text generation as a search problem, decoding strategies are essentially search algorithms over the space composed by vocabulary $\mathcal{V}$ . Beam search, a heuristic search algorithm, has been the go-to choice for many years. However, the generated sequences are usually repetitive because many diverse hypotheses are pruned at earlier stage of + +![](images/3e59e10e88c100c0007efe0073839a97f7b300a00e0801341da23da53325f437.jpg) +Figure 1: Generated text diversity and quality, measured by Distinctness-1(↑) and ROUGE-1(↑), on question generation. The dataset used is QuoRef and the model applied is MixQG. Our approach, best- $k$ search with two configurations, beats baseline methods including beam search variations, sampling and BS+Sample methods on diversity and quality; see Sec. 4.4 for details. + +search (Eikema and Aziz, 2020). Sampling-based approaches (Fan et al., 2018; Holtzman et al., 2020) can indeed generate more diverse sequences, but they are hard to control due to their stochastic nature. Sometimes outputs are duplicate; sometimes a sampling choice breaks the whole sequence. + +We are looking for a decoding algorithm with high flexibility and controllability while it could also yield diverse outputs for certain use cases. We find that best-first search (BFS) algorithm satisfies these properties. First, it is a reproducible and deterministic algorithm. More importantly, since it theoretically does not prune hypotheses, it preserves a more diverse set of options and allows simultaneous expansion of hypotheses with different lengths. Despite these intriguing features, we identified two challenges, efficiency and completeness, of directly applying it to text generation. + +In this work, we propose the best- $k$ search for diverse and high-quality text generation. Our approach re-invents BFS with a few design changes to overcome the issues mentioned before. Parallel exploration is designed to explore the top $k$ nodes from the search frontier each time instead of one + +in BFS. We also add a temporal decay mechanism to the algorithm to encourage search completions. A simple yet effective stateless scoring function as an alternative to more complicated length-adjusted counterparts is devised, and we show that it works well and helps further in finding diverse texts. + +To verify the proposed algorithm, we conduct comprehensive experiments on four tasks, question generation, commonsense generation, text summarization and machine translation. Our results show that the proposed algorithm works well with a wide range of models on six datasets. Our approach yields high-fidelity, diverse and natural outputs while maintaining quality. Our contributions are (1) investigation of best-first search for text generation; (2) proposing an efficient, simple, and deterministic decoding algorithm, best- $k$ search; (3) comprehensive experiments and strong results on six datasets with ablation study and analysis; (4) The algorithm is lightweight, easy-to-use, and compatible with any LLM. It is also orthogonal to many decoding techniques like sampling or rollout. + +# 2 Revisiting Best-First Search + +In this section, we will introduce the vanilla best-first search in the context of natural language generation as a decoding algorithm, and cover the first Research Question: Is BFS adequate in searching hypotheses in text generation? + +Setup Text generation can be formulated as a sequence generation process given input $\mathbf{x}$ and a probabilistic language model $^2$ parameterized by $\theta$ . + +$$ +p _ {\theta} (\mathbf {y} | \mathbf {x}; \theta) = \prod_ {t = 1} ^ {T} p _ {\theta} (y _ {t} | \mathbf {y} _ {< t}, \mathbf {x}) +$$ + +Traditionally, maximum a posteriori (MAP) decoding strategy is deployed to elicit highest-scoring output sequences $\arg \max_{\mathbf{y}^*} p_\theta(\mathbf{y}^*|\mathbf{x})$ . Most previous work uses the log-likelihood of the sequence as the proxy for assessing the (partial) sequence quality. However, recent studies found discrepancies between model likelihood and quality assessed by humans (Stahlberg and Byrne, 2019; Holtzman et al., 2020; Eikema and Aziz, 2020; Zhang et al., 2021). Various approaches including length normalization (Wu et al., 2016), quality-aware decoding (Fernandes et al., 2022), and regularized decoding (Meister et al., 2020a) have attempted to + +modify the objective to mitigate the gap. In this work, we adopt $h(\cdot)$ as the scoring function, and $h(\mathbf{y_1\dots t})$ is the score of a hypothesis $\mathbf{y_1\dots t}$ . + +Graph Notation We frame the derivation of sequences as the expansion of a directed search graph, where BOS is the root node and EOS nodes are the leaf nodes. Any node $n$ , except the root node, has exactly one parent node. The score of each node $n$ is defined as the score of the hypothesis starting with BOS and ending with $n$ . $h(\cdot)$ abstracts arbitrary scoring function. Each node $n$ can be represented as a triplet $\langle s, w, t \rangle$ where the score is $s = h(n)$ , token $w \in \mathcal{V}$ is the generated token, and $t$ is the time of discovery. A completed sequence is defined as $\hat{y} = (\mathrm{BOS}, \dots, \mathrm{EOS})$ , and $\hat{Y}$ consists of all completed sequences. The search frontier $\mathcal{O}$ of the graph is a priority queue. $^3$ + +Best-First Search Best-first search (BFS) is a greedy search algorithm which explores the graph according to the scoring function $h(\cdot)$ . We describe the best-first search algorithm in the context of probabilistic NLG in Algorithm 2. For each iteration, BFS finds the most promising, expands it, adds newly discovered nodes to $\mathcal{O}$ , and repeats until reaching the budget. is-complete is the conditional function for termination. $P$ contains completed sequences. $T$ counts the number of explored nodes. Recent work in decoding strategies (Meister et al., 2020b; Lu et al., 2022; Xu et al., 2022) was inspired and motivated by BFS, but none of them directly adopts BFS as the decoding algorithm. + +Advantages & Challenges What are the potential advantages of using BFS? BFS is a deterministic and reproducible search algorithm with low pruning and no duplication. However, the vanilla best-first search suffers from efficiency and completeness issues. We present our preliminary study and discuss these issues in Appendix A. + +# 3 Our Approach: Best- $k$ Search + +In this section, we will introduce best- $k$ search, a novel search algorithm inspired by the vanilla best-first search. It features a few components: (1) parallel exploration enables batch-wise exploration in the search graph; (2) temporal decay yields a higher completion rate and fewer dangling nodes; (3) heap pruning improves the time and space efficiency of our approach. We describe the algorithm + +![](images/22d09b1f540b0fb8125bf6514a2ba716c9b1d566878f260a77dc1e5f0f49b448.jpg) +Figure 2: Pruning in beam search removes diverse hypotheses and reduces flexibility of search. This is an example of question generation and the reference contains the keyword Intel. Hypotheses in blue rectangle were discovered but pruned. A greedy completion of Which Oregon city is contains the information we want. + +in Algorithm 1 and illustrate it in Figure 3. + +# 3.1 Parallel Exploration + +As suggested in Table 10, the wall clock running time of BFS is one order of magnitude slower than beam search under similar conditions. Given the same search budget, BFS is supposed to achieve similar time efficiency theoretically. However, multiple step-by-step operations are practically much slower than a batched one when GPUs are engaged. Hence, we propose a parallel exploration strategy to reduce the exploration time cost by popping $k$ nodes from the priority queue each time and executing them in a batch. Current candidates are stored in the frontier $\mathcal{O}$ . $\mathcal{PQ}$ is a priority queue after applying any scoring function to nodes in $\mathcal{O}$ . + +$$ +\mathcal {H} \leftarrow \mathcal {P Q}. \mathrm {h e a p p o p} (g) +$$ + +where $g = \min(k, \mathcal{PQ}. \text{size}()$ . The strategy serves as an approximation to best-first search as we pop the top- $k$ most promising nodes instead of 1. This technique significantly improves the efficiency of best- $k$ search compared to BFS, which will be discussed in Sec. 5.2. + +# 3.2 Temporal Decay + +Completion, measured by the number of outputs from the algorithm, has been another key challenge for BFS. In Table 10, increasing the search budget helps improve the completion rate but there is still a non-trivial portion of samples that fails. We propose a technique to fulfill the completion goal during the search process. For each node added to the search frontier $\mathcal{O}$ , we keep the time stamp $t$ . When we pop nodes, we modify the score of each node by adding an auxiliary score rewarding recently discovered nodes. The idea is to increase + +Algorithm 1 Best- $k$ Search with parallel exploration, heap pruning, and temporal decay. +Input: Generation model $\theta$ with vocabulary $\mathcal{V}$ , search budget, $\mathcal{O}$ denotes open set (max priority queue). group size $k$ . $T$ is the number of explored steps; $t$ is the time stamp. +Output: All completed paths $P$ . +1: $\mathcal{O} \gets \{\langle \infty, \mathrm{BOS}, -1 \rangle\}$ , $T \gets 0$ , $t \gets 0$ . +2: while $T < \text{budget do}$ +3: $\mathcal{PQ} \gets \emptyset$ +4: for $n \in \mathcal{O}$ do +5: $\mathcal{PQ} \gets \mathcal{PQ} + \langle n.\text{score} + \text{decay}(n.\text{time}, t), n \rangle$ +6: end for +7: $g \gets \min(k, \mathcal{PQ}.size())$ +8: $\mathcal{H} \gets \mathcal{PQ}.heappop(g) // \mathcal{H}$ is the group of candidates to explore. +9: $\mathcal{O} \gets \mathcal{O} \setminus \mathcal{H}$ +10: for $\langle score, n \rangle \in \mathcal{H}$ do +11: for $v \in \mathcal{V}$ do +12: if is-complete $(n \circ v)$ then +13: $P \gets P \cup (n \circ v)$ +14: continue +15: end if +16: child $\langle h(n \circ v), v, t \rangle // \text{Current time } t$ of adding the node to $\mathcal{O}$ . +17: $\mathcal{O} \gets \mathcal{O} \cup \text{child}$ +18: end for +19: end for +20: $\mathcal{O} \gets \mathcal{O}.\text{prune()}$ +21: $T \gets T + g$ +22: $t \gets t + 1$ +23: end while + +the score of recently discovered nodes so the algorithm prefers to continue them. The decay function needs to be monotonic. Hence, we define the decay function as a power function: + +$$ +\operatorname {d e c a y} (n. \text {t i m e}, t) = - \kappa (t - n. \text {t i m e}) ^ {\beta} +$$ + +where $\kappa > 0$ controls the weight of the term and $\beta > 0$ controls the slope. $t$ is the current time step and $n$ .time is a past time step, so $t - n$ .time $> 0$ . The older the node, the smaller the value of decay(n.time, t). A more recent node will receive a higher incentive, so it's more likely to be popped and expanded. For example, a node discovered at $t = 1$ receives decay(1,5) $= -4$ and a node discovered at $t = 4$ receives decay(4,5) $= -1$ , if we set $\kappa = \beta = 1$ . In our experiment, we set $\beta = 0.5$ and explore different values of $\kappa$ . We leave other forms of the decay function, i.e. logarithm, as future work, and discuss some design choices in Appendix F. + +# 3.3 Heap Pruning + +The size of the heap grows fast during exploration. For most of the time, however, our approach only utilizes top-ranked hypotheses. The temporal decay function is monotonic, so for any node in the + +![](images/728ef183381fe8260b0de5e10e48e11ef428ccafb236f9b5f6c1630352e6703a.jpg) +Figure 3: Illustration of best- $k$ search with an example from CommonGen, where the input is "mountainski skier". (left) the search graph before expansion; (right) the search graph after expansion with "skiing" and "There" expanded; (bottom) the search frontier. The upper left number of explored nodes (blue-bordered rectangle) indicates the time stamp of expansion. Grey rectangles are unexplored nodes in the frontier. For illustration purposes, we set $k = 2$ , and only show the top 3 expansions for each node. + +search frontier, the final score is always decreasing as the time moves forward. The usage of the temporal decay could affect the ranking, but we posit that if the margin of model score between a candidate node and the $k$ -th highest node from the heap is larger than $\epsilon$ , it is unlikely that it will be used in future. The choice of the margin $\epsilon$ depends on factors including the intensity of temporal decay, remaining search budget, model calibration, and resource limitations. In practice, we set a sufficiently large maximum heap size to 500 to avoid tuning $\epsilon$ on different datasets. The expansion of each node could lead to $|\mathcal{V}|$ extension nodes, where $|\mathcal{V}|$ is the size of the vocabulary. As the conditional probability $p_{\theta}(y_t | \mathbf{y}_{MethodStatDiversity (↑)Oracle (↑)Natural (↑)Quality (↑)S|S|D-1D-2D-3R1R2RLMvR1R2RLMTRGRMBS101044.848.746.932.612.930.159.525.99.223.720.988.9DBS10952.352.247.630.19.526.441.524.27.321.318.785.2DBS+10955.853.145.826.16.823.413.720.34.517.814.985.7BTYP0.210129.927.824.324.27.022.053.523.56.721.418.390.8BTYP0.510230.528.424.725.07.522.748.124.77.222.419.292.5BTYP0.9510230.928.925.426.98.624.861.425.07.623.119.592.3BNCLS0.510128.125.021.124.97.022.751.224.97.022.818.292.3BNCLS0.810230.128.024.425.67.923.749.925.17.323.119.192.5BNCLS0.910230.828.725.226.08.224.058.625.17.523.019.391.2TYP0.210544.446.242.426.57.323.950.923.26.321.118.188.3TYP0.510748.552.047.930.110.627.371.024.06.521.918.091.8TYP0.9510954.359.455.731.211.228.584.322.16.120.117.189.5NCLS0.510540.241.437.729.29.926.358.324.97.322.918.693.9NCLS0.810850.855.151.330.510.227.347.724.36.221.618.291.1NCLS0.910953.258.253.731.211.528.746.023.66.921.418.090.9MixQG---------24.98.022.3--BKSmean202050.856.154.033.914.231.083.027.08.924.521.386.8BKSlast191953.459.455.932.713.430.169.426.08.423.219.791.7 + +Table 1: Experiments result on QuoRef question generation. S and |Sl stand for the number of sentences and the unique number of sentences. D-1, -2, and -3 stand for unigram, bigram and trigram distinctness. MV is the MAUVE score measuring the naturalness of the generated outputs. MTR is METEOR score. GRM measures the grammaticality. We highlight the best, second best, and the worst for each column. A visualized comparison with D-1 and R1 is presented in Figure 1. + +diverse beam search is a diversity-promoting variant of beam search (Vijayakumar et al., 2018). We experiment with different numbers of beam groups for diverse beam search: 5 for DBS and 10 for $\mathrm{DBS + }$ . Sample is represented by two widelyadopted strong stochastic sampling methods, nucleus sampling (NCLS) (Holtzman et al., 2020) and typical sampling (TYP) (Meister et al., 2022a). Beam sample includes a collection of beam search multinomial sampling methods. We experiment with the integration of beam search with typical sampling and nucleus sampling, denoted as BNCLS and BTYP respectively. Implementation of baseline approaches is available at Transformers/- GenerationMixin/generate. + +Ours We use two typical configurations to represent our approach: $\mathrm{BKS}_{last}$ where the scoring function is memoryless, and $\mathrm{BKS}_{mean}$ where $\alpha = 1$ . In $\mathrm{BKS}_{mean}$ , the score of the sequence is the average log-likelihood of individual time steps. We experiment with $k = \{5,10\}$ and the weight of temporal decay in $\{0.0,0.01,0.05,0.1,0.2\}$ , and report the configuration with the best combination of diversity $(\overline{\mathbf{D}})$ and quality $(\overline{\mathbf{R}})$ . + +# 4.3 Metrics + +We measure the generated outputs from multiple aspects including text quality, relevance, diversity, + +and naturalness. 1. Statistics: we report the number of completed strings and the number of unique completed strings as S and |Sl. 2. Diversity: following Li et al. (2016); Yang and Klein (2021), we report the distinctness of completions, measured as the number of unique $n$ -grams divided by the number of words, denoted as D-1, D-2 and D-3. 3. Text quality: we adopted two relevance based metrics, ROUGE (R1, R2, RL) (Lin, 2004) and METEOR (MTR) (Banerjee and Lavie, 2005), for assessing the surface similarity between the generated strings and the reference. 4. Naturalness: We measure the naturalness of the generated sequences with MAUVE (Pillutla et al., 2021), a metric for open-ended text generation. + +# 4.4 Question Generation + +For QuoRef and SQuAD, we present the experiment results in Table 1 and 2. Due to the space limit, we present the results of SQuAD in 13 in Appendix E. Our methods achieve significantly higher MAUVE score than peer methods. To visualize the trade-off in quality and diversity, we also visualize these two metrics in Figure 1, which shows our approach significantly surpasses all baseline methods on both diversity and text quality, measured by D-1 and R1. There is a typical trade-off curve for diversity and quality by controlling hyper-parameters $(p$ + +
|S|DORRMVGRMMTR
BS1023.034.225.19.688.129.8
DBS926.632.823.113.082.327.9
DBS+930.932.619.89.080.623.1
BTYP0.219.725.625.115.688.429.7
BTYP0.5110.325.825.036.293.430.1
BTYP0.95211.028.026.611.989.231.1
BNCLS0.519.226.726.413.090.230.7
BNCLS0.8210.527.526.59.389.630.9
BNCLS0.9210.827.926.510.089.230.9
TYP0.2622.629.123.717.086.628.1
TYP0.5828.034.824.913.388.729.4
TYP0.951036.234.923.318.884.027.8
NCLS0.5518.732.126.513.889.830.8
NCLS0.8930.235.424.816.586.629.3
NCLS0.9933.835.624.016.286.228.6
BKSmean2930.335.825.516.588.630.5
BKSlast2436.536.121.722.686.425.8
+ +value for nucleus sampling, group size for diverse beam search, etc.), but our approaches go beyond the established curve by a significant margin. We posit that $10\mathrm{x}$ more output (2 vs. 29) and substantial gain of diversity (10.8 vs. 30.3) could unlock tons of applications and choices in many real-world applications. For example, on DROP, $\mathrm{BNCLS}_{0.9}$ achieves $\overline{\mathrm{D}} = 10.8$ and $\overline{\mathrm{R}} = 26.5$ while $\mathrm{BKS}_{mean}$ comes with $\overline{\mathrm{D}} = 30.3$ and $\overline{\mathrm{R}} = 25.5$ . + +# 4.5 Commonsense Generation + +We present the experimental result of commonsense generation in Table 3. Sampling based approaches are overall good at diversity but the quality of generated text is lower than other methods. For example, $\mathrm{TPP}_{0.95}$ has the best average distinctness score and the worst ROUGE score at the same time. Our approach $\mathrm{BKS}_{last}$ also has the highest oracle ROUGE score, which indicates high search quality over human annotations. + +# 4.6 Text Summarization + +As reranking text summarization system outputs has gained increasing interest, the fruitfulness and diversity of generated summaries are valuable attributes to look at. We present the result of text summarization in Table 5. Our approach remains competitive in quality, diversity, and naturalness. Our approach achieves an average ROUGE of 31.9 and MAUVE of 99.5, higher than any other methods. $\overline{\mathbf{D}}$ of our approach is lower than sampling due + +Table 2: Results of question generation on DROP. $\overline{\mathbf{D}}$ is the average of D-1, D-2 and D-3. $\overline{\mathrm{OR}}$ and $\overline{\mathbf{R}}$ are the average of Oracle ROUGE and ROUGE. + +
ISIDORRMVGRMMTR
BS1040.642.140.323.488.342.7
DBS1048.242.637.921.679.237.3
DBS+1054.142.436.415.977.535.8
BTP0.2227.436.338.027.083.840.0
BTP0.5226.737.740.417.188.943.0
BTP0.95227.938.440.714.689.243.3
BNCLS0.5124.337.140.511.987.943.1
BNCLS0.8227.038.541.016.989.543.5
BNCLS0.9227.438.540.915.489.643.6
TYP0.2955.440.534.937.979.337.8
TYP0.51055.042.437.137.882.239.3
TYP0.951061.039.533.741.774.936.1
NCLS0.5844.641.139.224.686.241.5
NCLS0.81055.741.736.531.782.038.6
NCLS0.91059.741.235.641.579.438.0
BKSmean2745.741.438.219.283.841.0
BKSlast2251.443.337.634.684.739.3
+ +Table 3: Results on commonsense generation. + +to the longer sequence lengths and more dangling nodes. + +# 5 Analysis + +# 5.1 Examples + +We show one example output of CommonGen in Table 4. We list outputs provided by Lu et al. (2022)4 and the outputs from our experiments. The outputs from our model are more diverse since multiple types of subjects exist, including a dog, the dogs, and two dogs. + +We also present one example from QuoRef question generation in Table 6. In this example, we can observe the duplication issue rooted in sampling based methods. Most of the generated questions from sampling are duplicate, covering the easiest question to ask. However, our approaches yield diverse and high-quality questions, covering broader spectrum of facts and knowledge like Intel, Silicon Forest, country seat of Washington County. + +# 5.2 Efficiency + +We test the wall-clock running time of our algorithms and the standard beam search. We follow the same configuration in Sec. 2. The result is presented in Table 7. Although our approach is still slower than beam search, due to all the overhead cost including padding sequences, scoring hypotheses and heap management, the speed is reasonable for many applications. The heap size could be + +
GBS / DBA / NEUROLOGIC*
G: A dog is run over by a ball and mouth agape. +D: A dog is run over by a ball and bites his mouth. +N: A dog running with a ball in its mouth.
NCLS0.8 / TYP0.5 / Ours
A dog running around with a ball in his mouth. +The dog is running with a ball in his mouth. +The dog runs away with the ball out of the mouth. +A dog running on its mouth with a ball +A dog with a ball running around his mouth.
A dog with a ball in its mouth running around the pond. +A dog runs to the door, eating a ball, and another dog in the mouth. +A dog running away with a ball in its mouth. +A dog running with a ball in his mouth. +A dog is running around its mouth catching a ball.
A dog is running around with a ball in its mouth. +a dog running around with a ball in its mouth +The dogs are running around with balls in their mouths. +Two dogs running around in the same room with a ball in their mouths. +Two dogs running with balls in their mouths.
+ +shrunk and the heap management could be optimized for even better efficiency. + +# 5.3 Choice of Scoring Function + +In this paper, we experimented with two families of scoring functions: length-normalized sequence log-likelihood and a new memoryless greedy score. We studied how the scoring function works in practice. More particularly, we looked into whether some form of scoring function will cause significant incompletion or search failure. We present the result and discuss the choice of scoring function in Appendix B. + +# 5.4 Effect of Temporal Decay + +We evaluate how temporal decay helps the completion rate in different settings in Figure 4. As the result in Table 12 indicates a high incomplete rate when $\alpha = 0$ , we only evaluate three scoring schemas, $\alpha = 0.5$ , $\alpha = 1$ (BKSmean), and the memoryless setting (BKSlast). Temporal decay helps the completion when the scoring function itself struggles with completion. For example, when $\alpha = 0.5$ , increasing $\kappa$ improves the completion rate from $66\%$ to $92\%$ . + +Table 4: An example from CommonGen where the input is "ball dog mouth run". We first present the outputs on GBS, DBA, and NEUROLOGIC\*, provided in Lu et al. (2022). Then we show five sample outputs from NCLS0.8, $\mathrm{TYP}_{0.5}$ and $\mathrm{BKS}_{last}$ , respectively. + +
ISIDORRMVGRMMTR
BS816.336.631.298.096.436.9
DBS820.536.328.964.695.232.3
DBS+721.535.627.822.392.029.8
BTP0.2212.329.527.698.896.034.2
BTP0.5313.433.030.498.296.336.5
BTP0.95313.333.730.998.596.437.0
BNCLS0.8313.233.530.898.596.337.1
BNCLS0.9314.034.131.098.596.437.1
TYP0.2730.934.226.797.894.731.3
TYP0.5834.738.828.897.995.132.7
TYP0.95835.738.528.198.495.132.3
NCLS0.8835.338.828.798.195.132.9
NCLS0.9837.237.727.398.594.431.4
BKSmean2221.439.031.999.595.335.9
BKSlast1724.337.528.998.595.733.3
+ +![](images/0637c28dc57cc2122140218702341f6422c3257b09bfcfce899ca075dbe02fcd.jpg) +Table 5: Results on XSum with BART-XSum. +Figure 4: Evaluation of the weight term $\kappa$ for temporal decay. We increase the weight $\kappa$ in the objective from 0.0 (no decay) to 0.2 and evaluate how it relates to the completion rate for different scoring functions. In the case of $\alpha = 0.5$ , increased weight significantly helps the completion rate. + +# 6 Application:Reranking Diverse Outputs + +Machine translation is typically considered as a precision-oriented task, where typically only a few translations are considered as correct. In this section, we would like to answer the RQ: Do we benefit by selecting from a pool of high-quality diverse outputs, even when the task does not necessarily require such? + +Setup We use a popular machine translation dataset with multiple references (Ott et al., 2018), based on WMT'14 En-Fr and En-De test sets (Bojar et al., 2014). The model for this task is the mBART $^5$ model (Tang et al., 2021). In order to rerank decoded outputs, we adopt a state-of-the-art quality estimation model for MT, + +
SamplingBKSlastBKSmean
NCLS0.8What city is the fifth largest?What city in OR is the fifth largest in OR?
What is the fifth largest city in OR?What city is the fifth largest city in the State?What city is the fifth largest [Ø / city in OR / city in the State / in OR / in the state]?
(x5)
What is the fifth-largest city in OR?What is the 5th largest city in OR?What city is the fifth-largest in the State?
What is the fifth-largest city in OR?What is the fifth largest city in [OR / the State of OR / the State]?What is the fifth largest city in OR?
What is the fifth-largest city in the State of OR?What is the fifth-largest city in the State?Which city in OR has the largest population?
What is the fifth-largest city in the State of OR?Which city is the fifth largest city in OR?Which city in OR hosts Intel?
Which city in OR is the county seat of Washington County?Which is the fifth largest city?Which city in OR is known as the Silicon Forest?
TYP0.5Which OR city is the fifth largest in the state?Which city in OR is the fifth largest in OR?
What is the fifth largest city in OR?Which OR city is the fifth largest?Which city in OR is the fifth largest in the state?
(x5)Which OR town is home to Intel?
What is the fifth-largest city in OR?Which OR town is home to the tech company Intel?Which city is the fifth largest [Ø / city in OR / city / in the state]?
(x3)
Which city in OR is the county seat of Washington County?Which OR town is known as the Silicon Forest?Which OR city is the county seat of Washington County?
Which city is the county seat of Washington County?Which OR town is the fifth largest [Ø / city / city in the state / in size / in the state]?Which OR city is the fifth largest in size?
Which OR city is the fifth largest?
+ +Input (Ans | Context): Hillsboro | Hillsboro is the fifth-largest city in the State of Oregon and is the county seat of Washington County. Lying in the Tualatin Valley on the west side of the Portland metropolitan area, the city hosts many high-technology companies, such as Intel, that comprise what has become known as the Silicon Forest. At the 2010 Census, the city's population was 91,611. For thousands of years before the arrival of ... Reference Question: What city is Intel located in? + +Table 6: Example on QuoRef question generation. The duplication of sampling is high while our model generates a more diverse set of questions. Some outputs from our approach cover the entity Intel mentioned in the reference. We manually replace all the occurrences of Oregon with $OR$ and combine some hypotheses due to the layout limit. + +
Best-k SearchBSBTYP0.5
k=5k=10b=10b=10
Time1.8s1.2s0.7s1.4s
|S|18.212.88.33.0
+ +Table 7: Efficiency comparison of our approach and beam search. Time shows the decoding time used for each example. + +COMET-QE (Rei et al., 2020). The quality estimation model we use to rerank all the outputs is wmt21-comet-qe-da. The QE model is a referenceless model $Q(\mathbf{s},\mathbf{t})$ which judges whether the source input $\mathbf{s}$ and the hypothesis translation $\mathbf{t}$ form a matched pair based on regression metrics. + +Result We present the result on MT En-De and En-Fr in Table 8 and 11. Our approach has a huge gain after reranking and surpasses all of the sampling based methods and beam search only methods while maintaining high diversity. BNCLS0.8, the approach with best BLEU score, is 9.4 behind BKSlast on $\overline{\mathbf{D}}$ while the human annotation reference is much higher than any of the machine generated hypothesis sets. The success of overgeneration-then-eranking paradigm has been witnessed in summarization (Song et al., 2021; Ravaut et al., 2022; Pernes et al., 2022) and transla + +tion (Fernandes et al., 2022), where the proposed algorithm could be valuable in searching high-quality diverse outputs. + +# 7 Related Works + +Best-first search BFS was widely used in structural prediction (Klein and Manning, 2003), statistical MT (Och et al., 2001), and for searching hypotheses (Saha et al., 2022). Recent work in decoding strategies (Meister et al., 2020b; Lu et al., 2022; Xu et al., 2022) conceptualized best-first search as part of their paradigm, but it was not the dominant component of any of these systems. + +Text decoding algorithms Stochastic decoding algorithms have gained popularity in the past few years (Fan et al., 2018; Holtzman et al., 2020; Meister et al., 2022a; Suzgun et al., 2022). Rollout-based algorithms are capable of satisfying certain utility functions or constraints at the cost of efficiency (Leblond et al., 2021; Chaffin et al., 2022; Lu et al., 2022). Recombination-based search algorithm (Xu et al., 2022) can find thousands of hypotheses despite complicatedness. + +Diversity in text generation The diversity of text generation has been a key challenge for applications like dialogue (Li et al., 2016; Zhang et al., + +
|SIDBLEU
ORIGINCOMETΔ
Reference1136.9---
BS1015.430.432.31.9
DBS1018.725.027.82.8
DBS+1024.620.822.92.1
BTYP0.2311.026.526.1-0.4
BTYP0.5310.234.334.60.3
BTYP0.95310.732.933.40.5
BNCLS0.529.033.033.30.3
BNCLS0.8310.234.934.90.0
BNCLS0.9310.432.633.81.2
TYP0.2927.219.919.5-0.3
TYP0.5928.625.627.01.4
TYP0.951036.519.222.12.9
NCLS0.5818.631.132.21.1
NCLS0.81030.225.927.01.0
NCLS0.91035.023.225.82.6
BKSmean3519.630.133.33.2
BKSlast3320.526.131.15.0
+ +Table 8: Machine translation from English to German. ORIGIN and COMET are the BLEU score before and after reranking; $\Delta$ indicates the change of BLEU score from reranking. + +2020; Stasaski and Hearst, 2022), MT (Shen et al., 2019) and conditional text generation (Yang and Klein, 2021). Beam search has also been developed to generate more diverse outputs (Vijayakumar et al., 2018; Anderson et al., 2017; Post and Vilar, 2018). Prior work also studies the trade-off between diversity and quality in text generation (Zhang et al., 2021). + +Degeneration of beam search Welleck et al. (2020b); Holtzman et al. (2020) addressed the degeneration issue in neural text generation and Cohen and Beck (2019) studies the beam search performance degradation in neural sequence models. The gap between high probability and quality has been observed and studied (Meister et al., 2022b; Freitag et al., 2022). + +# 8 Conclusion + +In this work, we propose best- $k$ search, a novel decoding algorithm for text generation based on best-first search. The algorithm features a few technical components, and generates natural and diverse text while maintaining high quality. We conduct comprehensive experiments on four tasks to verify the approach. The algorithm is orthogonal to sampling methods and it is parameter-free, lightweight, and efficient. + +# Acknowledgements + +We thank Greg Durrett, Tong Niu, Chen Xing, Hiroaki Hayashi, Katie Stasaski, Philippe Laban, Semih Yavuz and Shafiq Rayhan Joty for helpful proofreading and comments on this work. We also thank the Salesforce AI Research team for generous support and feedback. + +# Limitations + +In this work, we propose a decoding algorithm for text generation. We present the algorithm with comprehensive discussion on design choices and mechanisms. We further verified our algorithm on four tasks and six datasets. However, we acknowledge the following limitations. First, we mainly apply the method to English data although we cover German and French in MT experiments. In future work, we could verify the approach on non-English languages, especially CJK, due to the possible gap of tokenization. Second, we did not cover open-ended generation tasks like story generation and long-form generation tasks in this paper. Third, we could conduct more experiments and analysis on the mechanism of our approach, and examine the outputs with human judgement and feedback. + +# References + +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, pages 936-945, Copenhagen, Denmark. Association for Computational Linguistics. +Satanjeev Banerjee and Alon Lavie. 2005. METEOR: An automatic metric for MT evaluation with improved correlation with human judgments. In Proceedings of the ACL Workshop on Intrinsic and Extrinsic Evaluation Measures for Machine Translation and/or Summarization, pages 65-72, Ann Arbor, Michigan. Association for Computational Linguistics. +Ondrej Bojar, Christian Buck, Christian Federmann, Barry Haddow, Philipp Koehn, Johannes Leveling, Christof Monz, Pavel Pecina, Matt Post, Herve Saint-Amand, Radu Soricut, Lucia Specia, and Aleks Tamchyna. 2014. Findings of the 2014 workshop on statistical machine translation. In Proceedings of the Ninth Workshop on Statistical Machine Translation, pages 12-58, Baltimore, Maryland, USA. Association for Computational Linguistics. +Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind + +Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. 2020. Language models are few-shot learners. Advances in neural information processing systems, 33:1877-1901. +Antoine Chaffin, Vincent Claveau, and Ewa Kijak. 2022. PPL-MCTS: Constrained textual generation through discriminator-guided MCTS decoding. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 2953-2967, Seattle, United States. Association for Computational Linguistics. +Eldan Cohen and Christopher Beck. 2019. Empirical analysis of beam search performance degradation in neural sequence models. In Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pages 1290-1299. PMLR. +Pradeep Dasigi, Nelson F. Liu, Ana Marasović, Noah A. Smith, and Matt Gardner. 2019. Quoref: A reading comprehension dataset with questions requiring coreferential reasoning. 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 5925-5932, 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. +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 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 2368-2378, Minneapolis, Minnesota. Association for Computational Linguistics. +Bryan Eikema and Wilker Aziz. 2020. Is MAP decoding all you need? the inadequacy of the mode in neural machine translation. In Proceedings of the 28th International Conference on Computational Linguistics, pages 4506-4520, Barcelona, Spain (Online). International Committee on Computational Linguistics. +Alexander R. Fabbri, Wojciech Krysciński, Bryan McCann, Caiming Xiong, Richard Socher, and Dragomir Radev. 2021. SummEval: Re-evaluating summarization evaluation. Transactions of the Association for Computational Linguistics, 9:391-409. + +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. +Patrick Fernandes, Antonio Farinhas, Ricardo Rei, José De Souza, Perez Ogayo, Graham Neubig, and Andre Martins. 2022. Quality-aware decoding for neural machine translation. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 1396-1412, Seattle, United States. Association for Computational Linguistics. +Markus Freitag, David Grangier, Qijun Tan, and Bowen Liang. 2022. High quality rather than high model probability: Minimum Bayes risk decoding with neural metrics. Transactions of the Association for Computational Linguistics, 10:811-825. +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. +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. +Dan Klein and Christopher D. Manning. 2003. A* parsing: Fast exact Viterbi parse selection. In Proceedings of the 2003 Human Language Technology Conference of the North American Chapter of the Association for Computational Linguistics, pages 119-126 +Wojciech Kryscinski, Bryan McCann, Caiming Xiong, and Richard Socher. 2020. Evaluating the factual consistency of abstractive text summarization. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 9332-9346, Online. Association for Computational Linguistics. +Rémi Leblond, Jean-Baptiste Alayrac, Laurent Sifre, Miruna Pislar, Lespiau Jean-Baptiste, Ioannis Antonoglou, Karen Simonyan, and Oriol Vinyals 2021. Machine translation decoding beyond beam search. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 8410-8434, Online and Punta Cana, Dominican Republic. 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. +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. +Bill Yuchen Lin, Wangchunshu Zhou, Ming Shen, Pei Zhou, Chandra Bhagavatula, Yejin Choi, and Xiang Ren. 2020. CommonGen: A constrained text generation challenge for generative commonsense reasoning. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 1823-1840, 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. +Ximing Lu, Sean Welleck, Peter West, Liwei Jiang, Jungo Kasai, Daniel Khashabi, Ronan Le Bras, Lianhui Qin, Youngjae Yu, Rowan Zellers, Noah A. Smith, and Yejin Choi. 2022. NeuroLogic a*esque decoding: Constrained text generation with lookahead heuristics. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 780-799, Seattle, United States. Association for Computational Linguistics. +Clara Meister, Ryan Cotterell, and Tim Vieira. 2020a. If beam search is the answer, what was the question? In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 2173-2185, Online. Association for Computational Linguistics. +Clara Meister, Tiago Pimentel, Gian Wihar, and Ryan Cotterell. 2022a. Locally typical sampling. +Clara Meister, Tim Vieira, and Ryan Cotterell. 2020b. Best-first beam search. Transactions of the Association for Computational Linguistics, 8:795-809. +Clara Meister, Gian Wiher, Tiago Pimentel, and Ryan Cotterell. 2022b. On the probability-quality paradox in language generation. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 36-45, Dublin, Ireland. Association for Computational Linguistics. +Lidiya Murakhovs'ka, Chien-Sheng Wu, Philippe Laban, Tong Niu, Wenhao Liu, and Caiming Xiong. 2022. MixQG: Neural question generation with mixed answer types. In Findings of the Association + +for Computational Linguistics: NAACL 2022, pages 1486-1497, Seattle, United States. 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. +Erik Nijkamp, Bo Pang, Hiroaki Hayashi, Lifu Tu, Huan Wang, Yingbo Zhou, Silvio Savarese, and Caiming Xiong. 2022. A conversational paradigm for program synthesis. arXiv preprint arXiv:2203.13474. +Franz Josef Och, Nicola Ueffing, and Hermann Ney. 2001. An efficient A* search algorithm for statistical machine translation. In Proceedings of the ACL 2001 Workshop on Data-Driven Methods in Machine Translation. +Myle Ott, Michael Auli, David Grangier, and Marc'Aurelio Ranzato. 2018. Analyzing uncertainty in neural machine translation. In Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pages 3956-3965. PMLR. +Diogo Pernes, Afonso Mendes, and Andre FT Martins. 2022. Improving abstractive summarization with energy-based re-ranking. arXiv preprint arXiv:2210.15553. +Krishna Pillutla, Swabha Swayamdipta, Rowan Zellers, John Thickstun, Sean Welleck, Yejin Choi, and Zaid Harchaoui. 2021. Mauve: Measuring the gap between neural text and human text using divergence frontiers. Advances in Neural Information Processing Systems, 34:4816-4828. +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. +Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J Liu, et al. 2020. Exploring the limits of transfer learning with a unified text-to-text transformer. J. Mach. Learn. Res., 21(140):1-67. +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. + +Mathieu Ravaut, Shafiq Joty, and Nancy Chen. 2022. SummaReranker: A multi-task mixture-of-experts re-ranking framework for abstractive summarization. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 4504-4524, Dublin, Ireland. Association for Computational Linguistics. +Raj Reddy. 1977. Speech understanding systems: A summary of results of the five-year research effort at carnegie mellon university. Pittsburgh, Pa. +Ricardo Rei, Craig Stewart, Ana C Farinha, and Alon Lavie. 2020. COMET: A neural framework for MT evaluation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 2685-2702, Online. Association for Computational Linguistics. +Swarnadeep Saha, Shiyue Zhang, Peter Hase, and Mohit Bansal. 2022. Summarization programs: Interpretable abstractive summarization with neural modular trees. arXiv preprint arXiv:2209.10492. +Tianxiao Shen, Myle Ott, Michael Auli, and Marc'Aurelio Ranzato. 2019. Mixture models for diverse machine translation: Tricks of the trade. In International conference on machine learning, pages 5719-5728. PMLR. +Kaiqiang Song, Bingqing Wang, Zhe Feng, and Fei Liu. 2021. A new approach to overgenerating and scoring abstractive summaries. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 1392-1404, Online. Association for Computational Linguistics. +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. +Katherine Stasaski and Marti Hearst. 2022. Semantic diversity in dialogue with natural language inference. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 85-98, Seattle, United States. Association for Computational Linguistics. +Mirac Suzgun, Luke Melas-Kyriazi, and Dan Jurafsky. 2022. Follow the wisdom of the crowd: Effective text generation via minimum bayes risk decoding. arXiv preprint arXiv:2211.07634. +Yuqing Tang, Chau Tran, Xian Li, Peng-Jen Chen, Naman Goyal, Vishrav Chaudhary, Jiatao Gu, and Angela Fan. 2021. Multilingual translation from de-noising pre-training. In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, + +pages 3450-3466, Online. Association for Computational Linguistics. +Ashwin Vijayakumar, Michael Cogswell, Ramprasaath Selvaraju, Qing Sun, Stefan Lee, David Crandall, and Dhruv Batra. 2018. Diverse beam search for improved description of complex scenes. Proceedings of the AAAI Conference on Artificial Intelligence, 32(1). +Sean Welleck, Ilia Kulikov, Jaedeok Kim, Richard Yuanzhe Pang, and Kyunghyun Cho. 2020a. Consistency of a recurrent language model with respect to incomplete decoding. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 5553-5568, Online. Association for Computational Linguistics. +Sean Welleck, Ilia Kulikov, Stephen Roller, Emily Dinan, Kyunghyun Cho, and Jason Weston. 2020b. Neural text generation with unlikelihood training. In ICLR. +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, et al. 2016. Google's neural machine translation system: Bridging the gap between human and machine translation. arXiv preprint arXiv:1609.08144. +Jiacheng Xu, Siddhartha Jonnalagadda, and Greg Durrett. 2022. Massive-scale decoding for text generation using lattices. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 4659-4676, Seattle, United States. Association for Computational Linguistics. +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, Online. Association for Computational Linguistics. +Hugh Zhang, Daniel Duckworth, Daphne Ippolito, and Arvind Neelakantan. 2021. Trading off diversity and quality in natural language generation. In Proceedings of the Workshop on Human Evaluation of NLP + +
PropertyDet.No Dup.Low PruningCompleteness
BS✓✓✗✓
Sample✗✗6✗✓
BFS✓✓✓✗
+ +Table 9: Property comparison of search algorithms and approaches. Det. stands for deterministic search with reproducibility. No Dup. indicates the approach could guarantee no duplication of output sequences. + +# Algorithm 2 Best-First Search + +Input: Language model abstracted as $p_{\theta}$ , search budget, and frontier $\mathcal{O}$ . + +Output: All completed paths $P$ + +1: $\mathcal{O} \gets \{\langle \infty, \mathrm{BOS}, -1 \rangle\}, T \gets 0, t \gets 0$ . +2: while $T <$ budget do +3: $n\gets \mathcal{O}.\mathrm{pop}()$ +4: for $v\in \mathcal{V}$ do +5: if is-complete $(n\circ v)$ then +6: $P\gets P\cup (n\circ v)$ +7: continue +8: end if +9: child $\leftarrow \langle h(n\circ v),v,t\rangle$ +10: $\mathcal{O}\gets \mathcal{O}\cup \mathrm{child}$ +11: end for +12: $T\gets T + 1$ +13: $t\gets t + 1$ +14: end while + +Systems (HumEval), pages 25-33, 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. 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, Online. Association for Computational Linguistics. + +# A Best-First Search Algorithm + +We describe the best-first search algorithm in the context of probabilistic NLG in Algorithm 2. + +# A.1 Setup for investigating BFS + +We use XSum (Narayan et al., 2018) and a BART model BART-large-XSum7 (Lewis et al., 2020) fine-tuned on it as the testbed of our preliminary + +study. We sample 100 examples from the test set to measure the decoding quality. We set the beam size to 10 and the max sequence length to 30. For the machine configuration, we use Intel Xeon CPU @ 2.20GHz for CPU and NVIDIA A100-SXM4-40GB for GPU. We use Transformers (v4.23.1) (Wolf et al., 2020) and pytorch (v1.9.0) for baseline implementation and model calls. + +# A.2 Advantages & Challenges + +What are the potential advantages of using BFS, compared to beam search and sampling approaches? We enumerate the inherent property of beam search, sampling, and best-first search in Table 9. BFS has many strengths to satisfy desired properties like diversity, quality, and controllability in text generation. + +Deterministic BFS is a deterministic search algorithm with lower variance and higher controllability than stochastic sampling methods. This also indicates that BFS is compatible with sampling on top, similar to beam search. + +No duplication BFS comes with no duplication, so it's guaranteed that the more search budget used, the more unique outputs there will be. Sampling methods with low truncation thresholds suffer from this issue. + +No Pruning We illustrate the pruning issue in beam search in Figure 2. BS prunes the desired hypotheses. Unlike beam search, BFS never prunes, and preserves all explored nodes. This also brings great flexibility that the generation could switch between different branches of search. + +Diversity BFS yields diverse outputs with decent quality. The diversity of generated sequences is based on empirical lens, which will be covered in our experiments. + +As we have discussed many strengths BFS enjoys, why has it not been the dominant approach? We implement a standard BFS algorithm, as described in Algorithm 2, and look into how it works on decoding text summaries from BART-XSum. We also define a notion of equivalent beam size9 + +
Beam Size12510
Incomplete Rate58.1%23.8%3.9%3.0%
Time (s)1.01.95.613.7
+ +Table 10: Search incomplete rate and speed for the vanilla BFS. Beam size denotes the equivalent beam size, which is a reflection of the total search budget. Incomplete rate measures how often a search does not reach any completed state (EOS). Time denotes the running time for running the search algorithm per example. + +to calibrate the search budget for all methods. For beam search, we set a beam size $b$ and a max decoding length $T$ , and the total search cost is $C = bT$ , which means there will be $C$ times forward passes through LM. BFS also calls the LM for $C$ times and discover $C$ nodes. + +While beam search iteratively gains depth, best-first search does not. Hence, we investigate how often BFS could (not) reach the search goal, which is at least one EOS token. In Table 10, we show that the vanilla BFS has a pretty high chance of failure when the search budget is very limited. Even in the case of beam size $b = 10$ , there is a $3\%$ of chance that the method won't reach any completed sequence, a sequence ending with EOS or other pre-defined termination tokens. This indicates that the vanilla BFS struggles with the completeness. Efficiency is another crucial factor for practical usage. We measure the time consumed for running the search for each example and report it in Table 10. For reference, beam search with $b = 10$ can be completed in 0.7s per example. The vanilla BFS is slower than BS since the step-wise exploration in BFS is not batched. + +# B Choice of Scoring Function + +We test the incompleteness rate in a very strict use case: decoding a summary with at most $T = 30$ tokens with a total budget $C = bT = 300$ . If the model does not reach any EOS token before depth of 30, we consider it as a case of incompleteness. We show the comparison of the incompleteness rate in Table 12. The length-normalized sequence log-likelihood is formed as $\frac{1}{l^{\alpha}}\sum_{t=0}^{l}\log p_{\theta}(y_t|\mathbf{y}_{BLEUISIDOriginalCOMETΔReference1129.2---BS1014.639.638.4-1.2DBS1018.432.132.10.0DBS+1021.732.033.31.3BTP0.2210.235.435.4-0.1BTP0.529.244.344.20.0BTP0.9539.939.939.7-0.2BNCLS0.528.940.640.6-0.1BNCLS0.829.538.538.4-0.1BNCLS0.939.839.538.9-0.6TYP0.2826.423.925.01.1TYP0.5927.031.232.61.4TYP0.951037.224.124.10.0NCLS0.5817.135.636.30.7NCLS0.81028.928.928.7-0.2NCLS0.91033.425.426.61.2BKSmean1816.838.039.01.0BKSlast2618.133.537.23.6 + +Table 11: Machine translation from English to French. We highlight the best BLEU score after reranking and the improvement $\Delta$ for each sector. Numbers are rounded after calculation for display simplicity. + +
α = 0α = 0.5α = 1.0BKSlast
Rate79.5%8.8%1.8%2.1%
Ref.BSDBSBS+SampleSample
Rate5.0%1.1%6.4%0.8%
+ +Table 12: Incomplete rate $(\downarrow)$ with different choices of scoring function in best- $k$ search (top) and reference baselines (bottom). $\alpha = 0$ stands for sequential log-likelihood without length adjustment; $\alpha = 1.0$ represents $\mathrm{BKS}_{mean}$ . We show the lowest incomplete rate under various configurations of temporal decay. See Sec. 5.3 for the definition and discussion. + +poral decay could be increased, it will change the foundation of the algorithm if the decay is overwhelming the hypothesis score. + +Performance of $\mathrm{BKS}_{last}$ and $\mathrm{BKS}_{mean}$ is overall good across all datasets. We also notice an interesting difference that $\mathrm{BKS}_{mean}$ prioritizes the quality slightly more than $\mathrm{BKS}_{last}$ while $\mathrm{BKS}_{last}$ enjoys more diversity. For example, $\mathrm{BKS}_{last}$ on QuoRef achieves higher distinctness score but a slightly lower ROUGE score. The difference of scoring function will definitely impact the search strategy and we treat it as a handle of controllability for our algorithm. + +# C Experiment Setup + +Question Generation We adopt a state-of-the-art question generation model, MixQG (Murakhovs'ka et al., 2022), as the testbed to verify whether our approach could elicit more diverse, larger number and high-quality questions compared to baseline approaches. We use the variant mixqqg-large in this paper. For datasets, we select a range of seen and unseen QA datasets, including SQuAD (Rajpurkar et al., 2016), DROP (Dua et al., 2019), and QuoRef (Dasigi et al., 2019). We set the maximum decoding length to 25 BPEs for SQuAD and QuoRef, and 20 for DROP. + +Commonsense Generation CommonGen is a dataset for generative commonsense reasoning (Lin et al., 2020). The input is a few keywords and the target is a sentence satisfying commonsense and covering these keywords. We adopt a T5-based model10 fine-tuned on the training set of CommonGen. Since CommonGen has multiple references for each input, we utilize multiple references for each example by evaluating outputs against them. The maximum decoding length is set to 20. + +Text Summarization We use XSum (Narayan et al., 2018) as the dataset for abstractive text summarization. The model we use for this task is the BART11 model (Lewis et al., 2020) fine-tuned on XSum. The maximum decoding length is 30. + +# D Experiment: Machine Translation En→Fr + +We present the machine translation result from English to French in Table 11. The dataset we use here is an extended version of newstest2014. We can see a significant improvement over BLEU in our approach after using COMET-QE reranking. + +We obtained similar results on En-Fr compared to En-De in Table 8. Our approach achieves a good combination of diversity and quality compared to baseline methods. One of the beam search + sampling method, $\mathrm{BTYP}_{0.5}$ , achieves 44.2 after COMET-QE reranking, which surpasses any other methods by a decent margin. Our approach, $\mathrm{BKS}_{mean}$ , beats strong baselines including beam search and sampling-only approaches. What worth noticing is the significant jump after reranking, + +which shows a great success of overgeneration + reranking as a paradigm. + +
ISIDORRMVGRMMTR
BS1021.855.741.391.487.048.5
DBS925.150.736.572.180.942.1
DBS+929.650.531.937.781.335.6
BTYP0.219.841.941.296.887.646.8
BTYP0.5110.246.144.994.388.750.2
BTYP0.95210.746.644.795.088.550.4
BNCLS0.519.244.844.597.088.749.6
BNCLS0.8110.246.344.694.888.449.9
BNCLS0.9210.746.844.796.088.150.4
TYP0.2521.145.837.794.287.143.4
TYP0.5726.254.340.697.188.145.7
TYP0.95934.855.639.297.886.544.6
NCLS0.5931.955.639.095.186.344.3
NCLS0.8828.355.440.898.487.846.1
NCLS0.9931.655.939.097.785.944.3
BKSmean1929.554.838.299.086.044.0
BKSlast1832.854.235.898.884.440.6
+ +Table 13: Results of question generation on SQuAD. + +# E Experiment: Question Generation on SQuAD + +We present the result of question generation on SQuAD in Table 13. Our approach achieves the best MAUVE score and a good combination of diversity and quality metrics. Our approach outperforms baseline models in either diversity or quality on SQuAD. + +# F Design Choice for Completion + +In our paper, we design a temporal decay function to encourage the completion of our search algorithm. We have also considered a depth-based auxiliary term to encourage the completion. For instance, we can define $\mathrm{aux}(n) = n \cdot \mathrm{length}()$ where a longer sequence will receive a higher score if we assume a longer sequence is more likely to terminate (Welleck et al., 2020a). The problem of this function is that it always prefer longer sequences. Once there exists one single long sequence, the rest of the search will focus on this string because it is longer than any other strings. The search will be shaped into a depth-first search while what we expect is to discover a diverse set of strings with various length and prefix. + +A For every submission: + +A1. Did you describe the limitations of your work? + +Sec. Limitations after Sec. Conclusion. + +A2. Did you discuss any potential risks of your work? + +We do not see a substantial risk of our work. Although the output could contain toxic or biased content, we posit that it does not attribute to the search algorithm we propose. + +A3. Do the abstract and introduction summarize the paper's main claims? + +Abstract and Section 1. + +A4. Have you used AI writing assistants when working on this paper? + +Left blank. + +B Did you use or create scientific artifacts? + +We create scientific artifacts. See Section 4 and Appendix. + +B1. Did you cite the creators of artifacts you used? + +Not applicable. Left blank. + +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? + +It is currently under discussion and processing and we will release the code. + +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +Not applicable. Left blank. + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? + +Not applicable. Left blank. + +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? + +Not applicable. Left blank. + +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. + +Section 4, Section 5 and Appendix. + +C Did you run computational experiments? + +Section 4, 5 and 6, and Appendix. + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +We develop an inference algorithm, which does not require substantial computational resource. We provide related information in Appendix. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +We discuss the experimental setup in Section 4 and Appendix A. + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +We report the descriptive statistics in Section 4, 6 and Appendix. + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +We report the usage of existing packages in Section 4 and Appendix. There are also some footnotes providing instructions and details throughout the paper. + +# D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +No response. + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +No response. + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +No response. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +No response. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +No response. \ No newline at end of file diff --git a/bestksearchalgorithmforneuraltextgeneration/images.zip b/bestksearchalgorithmforneuraltextgeneration/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..b020b9540d5c75a1a82a58806be8180e1fd1e1e7 --- /dev/null +++ b/bestksearchalgorithmforneuraltextgeneration/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a9f19c7f8cbe6d91fc137cc7f02dc531b7480b90501cff3fe66117e6389c19d +size 999270 diff --git a/bestksearchalgorithmforneuraltextgeneration/layout.json b/bestksearchalgorithmforneuraltextgeneration/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..63e41ee0958708ae740e44159f806fb20b367801 --- /dev/null +++ b/bestksearchalgorithmforneuraltextgeneration/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ec8a03911650dd00953baa580d5b713d05bfce254d6d93e1e282da7501aa293e +size 651692 diff --git a/bettersimultaneoustranslationwithmonotonicknowledgedistillation/a313c138-4cca-4d7a-b3c1-352a84f3f11d_content_list.json b/bettersimultaneoustranslationwithmonotonicknowledgedistillation/a313c138-4cca-4d7a-b3c1-352a84f3f11d_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..00b06f254eb2d201bff8773acd8a30dbec98683a --- /dev/null +++ b/bettersimultaneoustranslationwithmonotonicknowledgedistillation/a313c138-4cca-4d7a-b3c1-352a84f3f11d_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b10753acabc627b47e81bcf00aef61610c02efdae7a4cdeef84e3b4013d57106 +size 99974 diff --git a/bettersimultaneoustranslationwithmonotonicknowledgedistillation/a313c138-4cca-4d7a-b3c1-352a84f3f11d_model.json b/bettersimultaneoustranslationwithmonotonicknowledgedistillation/a313c138-4cca-4d7a-b3c1-352a84f3f11d_model.json new file mode 100644 index 0000000000000000000000000000000000000000..4a52d3a5a71fe78ce48c5d5c111e4d24cfe90563 --- /dev/null +++ b/bettersimultaneoustranslationwithmonotonicknowledgedistillation/a313c138-4cca-4d7a-b3c1-352a84f3f11d_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:46ebc02f8d5f0edf80c4386cdf23d7e4b148529060abd5b5aa90a93c83981bc2 +size 122647 diff --git a/bettersimultaneoustranslationwithmonotonicknowledgedistillation/a313c138-4cca-4d7a-b3c1-352a84f3f11d_origin.pdf b/bettersimultaneoustranslationwithmonotonicknowledgedistillation/a313c138-4cca-4d7a-b3c1-352a84f3f11d_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a9bf4bb77a3cd1a67752e03022d61c6ffd3c8fb0 --- /dev/null +++ b/bettersimultaneoustranslationwithmonotonicknowledgedistillation/a313c138-4cca-4d7a-b3c1-352a84f3f11d_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:93232dffd0a2d744ebd6462561fddc85454e8ed786ede089a194e7ce5e23349b +size 731693 diff --git a/bettersimultaneoustranslationwithmonotonicknowledgedistillation/full.md b/bettersimultaneoustranslationwithmonotonicknowledgedistillation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..917dc93e50bd3a18ab4d8658a0d953536283b15b --- /dev/null +++ b/bettersimultaneoustranslationwithmonotonicknowledgedistillation/full.md @@ -0,0 +1,449 @@ +# Better Simultaneous Translation with Monotonic Knowledge Distillation + +Shushu Wang $^{1}$ , Jing Wu $^{2}$ , Kai Fan $^{2}$ , Wei Luo $^{2}$ , Jun Xiao $^{1}$ , Zhongqiang Huang $^{2}$ + +1Zhejiang University, 2 Alibaba DAMO Academy + +{wangshushu0213, junx}@zju.edu.cn + +{wj334275, k.fan, muzhuo.lw, z.huang}@alibaba-inc.com + +# Abstract + +Simultaneous machine translation (SiMT) presents a unique challenge as it requires generating target tokens before the source sentence is fully consumed. This can lead to the hallucination problem, where target tokens are generated without support from the source sentence. The prefix-to-prefix training data used to train SiMT models are not always parallel, due to divergent word order between the source and target languages, and can contribute to the problem. In this paper, we propose a novel approach that leverages traditional translation models as teachers and employs a two-stage beam search algorithm to generate monotonic yet accurate reference translations for sequence-level knowledge distillation. Experimental results demonstrate the significant improvements achieved by our approach over multiple strong SiMT baselines, leading to new state-of-the-art performance across various language pairs. Notably, when evaluated on a monotonic version of the WMT15 De→En test set, which includes references generated in a more monotonic style by professional translators, our approach achieves even more substantial improvement over the baselines. The source code and data are publicly available for further exploration1. + +# 1 Introduction + +Simultaneous machine translation (SiMT) starts to translate with only a partial observation of the source sentence and can present unique challenges compared to full-sentence translation, particularly when employing offline NMT models. Prefix-to-prefix (P2P) methods such as the wait-k policy (Ma et al., 2019a) have been developed to narrow the gap between training and inference. However, these methods inherently rely on parallelism at the prefix level, which may not always be present in conventional parallel text. + +# source prefix + +韩国对美出口则下滑 $11.8\%$ 因石油产量下滑。 + +# reference prefix + +Since the sales of oil products declined, Korean exports to U.S. decreased by $11.8\%$ . + +# monotonic reference prefix + +South Korea's exports to U.S. fell $11.8\%$ as sales of oil fell. + +Figure 1: An example of a parallel sentence pair, with color-coded parallel clauses. The boxes highlight the prefixes selected based on a wait-3 approach. + +
Trainsetk=1k=3k=5k=7k=9
WMT15 De→En30.415.28.55.13.3
CWMT19 Zh→En25.4126.33.62.1
IWSLT15 En→Vi17.35.21.90.80.4
+ +Table 1: Anticipation rates (AR%) of the original training sets, measuring the percentage of target tokens with a reordering distance $\geq k$ (see definition in Appendix B). + +The parallel text utilized for training offline MT models exhibits a wide range of word reordering between the source and target languages, resulting in non-parallel prefix-to-prefix pairs, as depicted in Figure 1. Table 1 highlights the challenge faced by a wait- $k$ model, which must predict a significant percentage of target tokens without access to the corresponding words in the source prefix across multiple parallel corpora. For example, when training a wait-3 model on the WMT15 De→En dataset, the model needs to anticipate $15.2\%$ of the target tokens during training, exacerbating the hallucination problem during inference. + +An alternative approach is to train SiMT models on simultaneous interpretation corpora. However, there are two primary issues. First, the available interpretation training data is scant. Second, due to the real-time nature of simultaneous interpretation, the data tends to be overly simplified, making it less ideal for SiMT models where preservation of information is important. On the other hand, traditional parallel data is abundant. If this data could + +be restructured to more closely follow the source word order, it would be more beneficial for SiMT models. This is the idea behind approaches such as (Chen et al., 2021). In line with this direction, we propose a two-stage beam search algorithm to reconstruct the training data, producing accurate yet monotonic translations. This restructured data is then utilized to train the SiMT model using knowledge distillation (KD) (Kim and Rush, 2016). + +Similarly, traditional test sets are less ideal for evaluating SiMT models that produce translations in a more monotonic style. To address this, we constructed a new set of human references for the WMT15 De-En test set that more closely follows the source word order. This new reference can provide a more precise measurement of both translation quality and latency in a SiMT setting. + +Our primary contributions include: + +- We have developed a two-stage beam search algorithm to generate accurate monotonic training data. This algorithm is adjustable for different levels of monotonicity and is capable of leveraging both parallel and monolingual corpora. +- We have curated new human references for the WMT15 De-En test set that is more suitable for evaluating SiMT models. We are pleased to offer these for public access. +- Our empirical results demonstrate that our approach consistently outperforms strong SiMT baselines. We release both code and data to facilitate future research. + +# 2 Related Works + +SiMT Policy There are two types of SiMT policies: fixed and adaptive. Fixed policies, such as wait- $k$ in Ma et al. (2019a), first READ $k$ source tokens and then alternately READ/WRITE one token. Elbayad et al. (2020) proposed an efficient multipath training for the wait- $k$ policy to randomly sample $k$ during training. + +Adaptive policies make READWRITE decisions dynamically. Gu et al. (2016) decides READ/WRITE actions via reinforcement learning. MILk (Arivazhagan et al., 2019) predicts a Bernoulli variable to determine READ/WRITE actions, which is further implemented into transformer architecture MMA (Ma et al., 2019b). Zheng et al. (2020) developed adaptive wait-k through heuristic ensemble of multiple wait-k mod + +els. Miao et al. (2021) proposed a generative framework to generate READ/WRITE decisions. Liu et al. (2021) applies Connectionist Temporal Classification (CTC) by treating the blank symbol as the wait action. Zhang and Feng (2022) develops a READ/WRITE policy by modeling the translation process as information transport and taking the received information as the evidence for READ/WRITE decisions. + +Monotonic SiMT Another approach to SiMT is to focus on producing the target as monotonically as possible with the source. Chen et al. (2021) proposed test-time wait- $k$ to produce pseudoreferences which are non-anticipatory. Han et al. (2021) proposed a method of chunk-wise reordering to refine the target sentences in an offline corpus and build a monotonically aligned parallel corpus for SimulMT. Deng et al. (2022) proposed a novel monolingual sampling strategy for SiMT, considering both chunk length and monotonicity. Chang et al. (2022) decomposed the translation process into a monotonic translation step and a reordering step, which rearranged the hidden states to produce the order in the target language. Our method extends (Chang et al., 2022) to include a rescoring stage based on the full sentence to produce more accurate translations. + +Knowledge Distillation in NMT Knowledge distillation(KD) approaches (Hinton et al., 2015) aim to transfer knowledge from a teacher model to a student model. Kim and Rush (2016) first applied knowledge distillation to NMT using sequence-level KD. In terms of online NMT, Zhang et al. (2021b) proposed to use a conventional Transformer as the teacher of the incremental Transformer, and tried to embed future information in the model through knowledge distillation. Ren et al. (2020) proposed to transfer knowledge from the attention matrices of simultaneous NMT and ASR models to a simultaneous speech to text translation system. + +# 3 Background + +Offline NMT Offline NMT models typically employ an encoder-decoder framework. The encoder has access to the full source sentence $\mathbf{x}$ and maps it into hidden representations. The decoder autoregressively generates each target token $y_{t}$ conditioned on $\mathbf{x}$ and the previously generated tokens, as shown in Eq. (1): + +$$ +p (\mathbf {y} | \mathbf {x}; \boldsymbol {\theta}) = \prod_ {t = 1} ^ {| \mathbf {y} |} p \left(y _ {t} | \mathbf {x}, \mathbf {y} _ {< t}; \boldsymbol {\theta}\right) \tag {1} +$$ + +Simultaneous NMT Simultaneous NMT only has access to part of the source sentence. Let $g(t)$ be a monotonic non-decreasing function of $t$ that denotes the number of source tokens processed by the encoder when generating the target word $y_{t}$ . SiMT uses the source prefix $(x_{1}, x_{2}, \dots, x_{g(t)})$ to predict $y_{t}$ as shown in Eq. (2): + +$$ +p (\mathbf {y} | \mathbf {x}; \boldsymbol {\theta}) = \prod_ {t = 1} ^ {| \mathbf {y} |} p \left(y _ {t} | \mathbf {x} _ {\leq g (t)}, \mathbf {y} _ {< t}; \boldsymbol {\theta}\right) \tag {2} +$$ + +# 4 Monotonic Translation Construction + +We propose two approaches for creating monotonic pseudo-targets for source sentences in traditional parallel data. This new data is then used to train SiMT models through knowledge distillation (KD). + +# 4.1 Standard KD + +A simple approach is to use an offline NMT model as a teacher to translate each source sentence of the parallel training data into a pseudo-target through beam search, as shown in Algorithm 2 in Appendix A. The resulting (source, pseudo-target) data adheres more closely to the source word order, as machine-translated sentences tend to have fewer long-distance reorderings. This data is then used to train SiMT models through sequence-level knowledge distillation (KD) (Kim and Rush, 2016), with the training loss represented in Eq. (3). + +$$ +\mathcal {L} _ {\text {s e q} k d} = - \log p (\hat {\mathbf {y}} | \mathbf {x}; \boldsymbol {\theta}) \tag {3} +$$ + +where $\hat{\mathbf{y}}$ represents the target predicted by the teacher model. Note that this diverges from conventional sequence-level KD training, which also utilizes the training loss over the original references, as the long-distance reorderings in the original data could be detrimental to the SiMT model. + +# 4.2 Monotonic KD + +A key drawback of standard KD is that, although the resulting target translations are more monotonic, they still depend on full sentences, and the degree of monotonicity cannot be controlled. To overcome this limitation, we propose a two-stage beam search strategy to produce target translations in a way similar to real-time simultaneous translation, while also preserving the translation quality. + +![](images/f285db68c2c1812d753284db2e865d34dc29d2dccf3682633f885eae76773552.jpg) +Figure 2: Visualization of two-stage beam search algorithm, with beam size $b_{1} = 4$ and $b_{2} = 3$ , and latency $k = 3$ . The 3rd ( $i = 3$ ) target token is being decoded. + +As detailed in Algorithm 1 and depicted in Figure 2, our approach first translates pieces of the source incrementally, akin to a wait- $k$ policy, and then rescores and selects the better partial hypotheses using a full-sentence offline model. + +In Stage 1, the streaming source prefix is fed into the offline teacher model to generate the initial $b_{1}$ partial hypotheses at each beam search step following a wait- $k$ policy. This stage simulates real-time simultaneous translation with incremental input, and ensures that the decoding is based on local information, thereby increasing monotonicity. By defining the desired latency $k$ , the monotonicity level of the partial hypotheses can be controlled. + +In Stage 2, we use the teacher model to rescore each of the $b_{1}$ partial hypotheses conditioned on the full source sentence and only keep the top $b_{2}$ $(b_{2} < b_{1})$ partial hypotheses for the next step in the two-stage beam search process. With this strategy, future information in the source sentence is utilized to improve the quality of top partial hypotheses, while also preserving the local word order dictated by the prefix source. + +Note that we can reverse the translation direction and construct more monotonic pseudo-source given the original target through backward translation. However, empirical results show that it is inferior than forward translation for SiMT (see Figure 13 in Appendix E), probably due to the discrepancy between pseudo-source and normal source text. + +![](images/b99d57ed001981cfc04b0b37e56eeed9fa2bdd8f6755b20080a295883a737472.jpg) +(a) $\mathrm{De}\rightarrow \mathrm{En}$ + +![](images/a1e74a896253851058f315b2076c3409b1a7d593a3af84f3e83ce0d49642b56e.jpg) +(b) $\mathrm{Zn}\rightarrow \mathrm{En}$ + +![](images/48d1e7b3dc07d86998418b39e9cbc83472e02db30d4dcc34679b7f756160a075.jpg) +(c) $\mathrm{En}\rightarrow \mathrm{Vi}$ + +![](images/390b683f943af6bc0851edc945aedfe564b7e59991b476092d523c9bd64d6f12.jpg) +Figure 3: $k$ -Anticipation Rates ( $AR_{k}$ ) of the training data with original references and pseudo-targets generated by our KD methods. +(a) $\mathrm{De}\rightarrow \mathrm{En}$ , Transformer-Base +Figure 4: Evaluation of offline NMT models in offline (dashed) and simultaneous (solid) scenarios. + +![](images/49de1d3652495ae2f24949d8c5f4101edf4431143b0ba7dc708428c05c344101.jpg) +(b) $\mathrm{Z}\mathrm{h}\rightarrow \mathrm{En}$ ,Transformer-Base + +![](images/573b789aa4ca84424875368c62f68c7e0dc183660e4bfbde0fc359dc7f8cb9c7.jpg) +(c) $\mathrm{En}\rightarrow \mathrm{Vi}$ , Transformer-Small + +# 5 Experiments + +# 5.1 SiMT Models + +We conduct experiments on three representative modeling approaches that have been used for simultaneous machine translation. + +Offline MT: a Transformer NMT model (Vaswani et al., 2017) trained on full sentences. + +Multipath Wait- $k$ : a wait- $k$ policy model (Elbayad et al., 2020) trained by randomly sampling different $k$ values between batches during training. + +ITST: an adaptive read/write policy model (Zhang and Feng, 2022) that formulates the translation process as an optimal information transport problem. To the best of our knowledge, ITST is currently the state of the art method for SiMT. + +# 5.2 Data + +We select three datasets of different language pairs that have been used before for investigations of SiMT models. + +WMT15 De→En (Callison-Burch et al., 2009) is a parallel corpus with 4.5M training pairs, which + +are tokenized and split using 32K BPE merge operations with a shared vocabulary for German and English. We use newstest2013 (3000 sentence pairs) as the development set and report results on newstest2015 (2169 sentence pairs). + +$\mathbf{CWMT19}^2$ $\mathbf{Z}\mathbf{h}\rightarrow \mathbf{E}\mathbf{n}$ contains 9.4M sentence pairs in the training set, which are tokenized and split using 32K BPE merge operations for both the source and the target languages. We use the validation set of 956 sentence pairs from BSTC (Zhang et al., 2021a) as the test set. + +IWSLT15 En $\rightarrow$ Vi (Luong and Manning, 2015) contains 133K training pairs. We use TED tst2012 as the validation set (1553 sentence pairs) and TED tst2013 as the test set (1268 sentence pairs). Following the settings in (Ma et al., 2020), we replace rare tokens (frequency $< 5$ ) by . The resulting vocabulary sizes are 17K and 7.7K for English and Vietnamese respectively. + +Figure 3 compares AR curves at various $k$ values in both the original and the reconstructed training data with pseudo-targets. Our two KD methods + +Algorithm 1: Two-Stage Beam Search +Input: x: source sentence $b_{1}$ : max beam size before rescoring $b_{2}$ : max beam size after rescoring $n_{max}$ : max hypothesis length $k$ : fixed latency $l$ : source length $|\mathbf{x}|$ score $(\cdot ,\cdot)$ : scoring function Output: Best monotonic translation at $k$ +1 // beam format: (score,hypothesis) +2 $B_0,B\gets \{\langle 0,\mathrm{BOS}\rangle \} ,\emptyset$ +3 for $i\in \{1,\dots ,n_{max}\}$ do +4 $B^{\mathrm{before}},B^{\mathrm{after}}\gets \emptyset ,\emptyset$ +5 for $\langle s,\mathbf{y}\rangle \in B_{i - 1}$ do +6 if y.last() = EOS then +7 $B.\mathrm{add}(\langle s,\mathbf{y}\rangle)$ continue +8 +9 $l = \min (i + k - 1,\mathbf{x}.len)$ for $y\in \mathcal{V}$ do +11 // score by partial input +12 $s\gets \mathrm{score}(\mathbf{x}[:l],\mathbf{y}\circ y)$ $B^{\mathrm{before}}.\mathrm{add}(\langle s,\mathbf{y}\circ y\rangle)$ +13 +14 $B^{\mathrm{before}}\gets B^{\mathrm{before}}.top(b_1)$ for $\langle s,\mathbf{y}\rangle \in B^{before}$ do +16 // score by oracle input +17 $s\gets \mathrm{score}(\mathbf{x},\mathbf{y})$ $B^{\mathrm{after}}.\mathrm{add}(\langle s,\mathbf{y}\rangle)$ +18 +19 $Bi\gets B^{\mathrm{after}}\gets B^{\mathrm{after}}.top(b_2)$ +20 return B.max() + +can effectively reduce the anticipation rate across all language pairs at different $k$ values, with monotonic KD typically resulting in a lower anticipation rate compared to the standard KD. Our experiments are focused on understanding the impact of changes on the translation quality of SiMT models. + +To properly evaluate SiMT performance, the test sets should be representative of the characteristics of real-time simultaneous translation, in both content and translation style. In addition to the official test sets described earlier, we choose to adapt the WMT newstest2015 De→En data set for real-time speech translation. We select 500 sentence pairs from this data set and ask professional translators to produce new reference translations, with as much monotonicity as linguistically possible without compromising the translation quality. The detail of this annotation task can be found in the Appendix D. + +![](images/8b2787c706a9b322d1c3a171a7bc110c517de72f940eee492dbe5766f3407a18.jpg) +Figure 5: Visualization of cross-attention matrix of $\mathrm{Zh}\rightarrow \mathrm{En}$ offline MT. Left: trained on original corpus. Right: trained with pseudo-targets produced by monotonic KD. + +![](images/688bd8fb9580eddfc817d267c1553ea31aeb14933e57061673ccecb33e9f0583.jpg) + +# 5.3 Experimental Setup + +We use Transformer-base models for the $\mathrm{De} \rightarrow \mathrm{En}$ and $\mathrm{Zh} \rightarrow \mathrm{En}$ translation directions and Transformersmall mdoels for $\mathrm{En} \rightarrow \mathrm{Vi}$ . Our model configurations generally follow the experiment settings detailed in Multipath Wait- $k^3$ and ITST $^4$ . For generating pseudo-targets, we use a beam size of 5 in standard KD, and in our two-stage monotonic KD method we set beam sizes $b_1 = 10$ and $b_2 = 5$ , with the latency value $k$ set to 7, 7, 6 for De-En, Zh-En, and En-Vi respectively. + +For evaluation, we use tokenized case-insensitive $\mathrm{BLEU}^5$ for translation quality and Average Lagging (AL, token level) (Ma et al., 2019a) to measure latency. + +# 5.4 Main Results + +We first train an offline MT model for each of the three language pairs on the original training data, and then obtain pseudo parallel data and train Multipath Wait- $k$ and ITST models using the regular and monotonic KD methods described in Section 4. + +Offline MT Evaluation For each language pair, we train two additional offline models, one for each of the two KD methods. We evaluate these models in both offline and simultaneous scenarios, adopting a simple wait- $k$ policy for the latter. The results are presented in Figure 4. The offline mod + +![](images/8bd065648d2e0411e00786ad3e7bef9658e98b79bef9a334b028804bcae9e077.jpg) +(a) $\mathrm{De}\rightarrow \mathrm{En}$ , Transformer-Base + +![](images/ae4f9351c378590b29c95bd2521dbae041b9d361041123120b59dc0251177fdd.jpg) +(b) $\mathrm{Zh}\rightarrow \mathrm{En}$ ,Transformer-Base + +![](images/fda6eff29a3985d1a14f9aba4bd460ebeebd86c6054bc87b1bdbc442fa5c03fc.jpg) +(c) $\mathrm{En}\rightarrow \mathrm{Vi}$ , Transformer-Small + +![](images/3269d6add3bdf1aff7e02072dc19ca855cb49cc821d76523e3c83eed28bf63a4.jpg) +Figure 6: Evaluation of multipath wait- $k$ models in offline (dashed) and simultaneous (solid) scenarios. +(a) De→En, Transformer-Base +Figure 7: Evaluation of ITST models in offline (dashed) and simultaneous (solid) scenarios. + +![](images/c9c1a136ed5a7ac2fafcd38a55674436ca5497a35070f422f64ad86245957e23.jpg) +(b) $\mathrm{Z}\mathrm{h}\rightarrow \mathrm{En}$ ,Transformer-Base + +![](images/6924be388bb31e0e14f6c604e6a40d51a5e0ae23de047882893b4f6ed71c8a99.jpg) +(c) $\mathrm{En}\rightarrow \mathrm{Vi}$ , Transformer-Small + +els perform significantly worse in the streaming scenario, especially when at a low latency, due to the discrepancy between full-sentence training and prefix-to-prefix inference. The two models trained on pseudo-target data exhibit considerable improvements, with an average improvement of more than 2 BLEU points across all latency settings on the De→En test set in particular. + +We attribute this improvement to the more monotonic nature of the pseudo data generated through KD. Models trained with this data can better model local source-target relationships, which leads to higher quality translations on partial source inputs. This is reflected in Figure 5, where the mass of cross-attention weights concentrate around the diagonal. + +Multipath Wait- $k$ We train wait- $k$ SiMT models, following (Elbayad et al., 2020), on the original training data as well as the reconstructed training data with pseudo-target produced by the two KD + +methods. As shown in Figure 6, two KD methods are both able to significantly improve translation quality across latency settings. + +ITST Finally we train ITST models, following Zhang and Feng (2022), to see if our methods can achieve similar improvements with advanced adaptive read/write models. The results are shown in Figure 7. Similarly, we observe overall improvement in translation quality by training ITST models on the pseudo data. As illustrated in the example in Figure 9, the decoding path of the mono-KD trained ITST model is closer to the diagonal and its translation is more faithful and monotonic to the source input. + +# 5.5 Evaluation on Monotonic Test Set + +Although the pseudo data constructed by the monotonic KD method has a lower AR, as shown in Figure 3, models trained with the standard KD method typically achieve higher BLEU scores in many cases in Figure 4, 6, and 7. One possibility is that the references in the original test sets were not produced with a focus on simultaneous translation, + +![](images/ec71b6f59fc9355e7c852dda03a3d1be115acba6286a10b79030c9211ee86c47.jpg) +(a) wait- $k$ by offline + +![](images/2f74139e60b25f6c0c933f1b8232bd317cd38df5923392da132c384dfdd7b3c7.jpg) +(b) multipath wait- $k$ + +![](images/4460add6954b60ad4f3166241c4050094ce9da976446172e724a47e48bd4c7b8.jpg) +(c) ITST + +![](images/70e021361a5f688fd2b089fb9bfe5fcd6a05b321ea8085e9a4bbbf20f91e89f7.jpg) +Figure 9: Visualization of R/W paths taken during inference for ITST models trained on the original corpus (blue) and trained with pseduo-targets produced by the monotonic KD method (red). + +and thus can not accurately measure improvement in translation quality of more monotonic translations. To test this hypothesis, we took the first 500 pairs from the $\mathrm{De} \rightarrow \mathrm{En}$ test set and commissioned a new set of reference translations that are as monotonic as possible without sacrificing the translation quality. We re-evaluated our $\mathrm{De} \rightarrow \mathrm{En}$ models on this monotonic test set and the results are shown in Figure 8. Compared to the previous results on the original test set, the improvement from the monotonic KD method becomes more prominent, on par with the standard KD method or in many cases outperforming. Moreover, the overall improvement from the KD methods also becomes greater on this monotonic test set. Although the monotonic test set is only a subset of the original test set, the same conclusion holds when only comparing results on this subset (see performance of the multipath wait- $k$ method on the original subset in Figure 14 in Appendix E). + +![](images/af427a8774a92c6fc9d283249fa2900e8ef078dd1353badb8c1edfdae722e116.jpg) +Figure 8: Evaluation on the monotonic test set for $\mathrm{De}\rightarrow \mathrm{En}$ +Figure 10: Effect of monolingual data on multipath wait-k models on WMT15 De→En. + +# 5.6 Scaling with Monolingual Data + +Given that only source sentences are needed for an offline teacher model to produce pseudo-targets, we can expand the KD training data by generating pseudo-targets using monolingual data. We conducted experiments on WMT15 De $\rightarrow$ En and collected 1 and 4 times of additional pseudo parallel data using the monotonic KD method on German sentences selected from News Crawl articles, excluding sentences longer than 190 characters. The results with the multipath wait- $k$ model are presented in Figure 10. The improvements from more pseudo data suggest that the ability to use a monolingual source corpus is another advantage of our approach. + +In Figure 11, we focus on WMT15 De→En and demonstrate how our approach can further advance the current state of the art in SiMT. We take ITST, the current SOTA in SiMT, as our modeling method, and compare with ITST and another recent SiMT method wait-info (Zhang et al., 2022a). For a + +
hypothesesk=1k=3k=5k=7k=9
origin3.11.81.31.11
mono KD2.21.210.80.8
KD31.510.80.8
+ +![](images/e7295c186358dbf3abb8e0a2622b2351853aa40b7219246edc16f50a405d3c19.jpg) +Figure 11: Comparison with SOTAs on WMT15 De $\rightarrow$ En. + +fair comparison, we rerun the original ITST and observe a minor performance dip under high latency conditions. The results show that the monotonic KD method combined with additional monolingual data can achieve new state of the art for SiMT. + +# 5.7 Effects on Hallucination + +Hallucination, a known issue in machine translation models, presents significant challenges for real-time simultaneous translation. Hallucination Rate $(\mathrm{HR}\%)$ (Chen et al., 2021) measures the percentage of words in the target output that are hallucinated (see full definition in Appendix C). We compare the HR% of multipath wait- $k$ models trained on the original parallel data or the pseudo data constructed by the KD methods. As shown in Table 2, the monotonic KD method has the lowest HR% across different latency settings. Examples of hallucination in translation results can be found in Table 6 of Appendix E. + +# 6 Discussions + +The first beam search stage of our monotonic KD method is equivalent to test-time wait- $k$ inference described in (Chen et al., 2021). This stage, however, may fail to produce accurate rankings of partial hypotheses, given that it relies on offline models for translating partial inputs. The second stage beach search, designed to incorporate full sentence + +Table 2: HR% of multipath wait- $k$ models on WMT15 De $\rightarrow$ En. + +
Mono KDOfflinek=1k=3k=5k=7
one-stage33.1521.3825.2027.7129.51
two-stage33.1525.3628.8630.7832.39
+ +information, is capable of more accurately scoring and ranking these partial hypotheses. We conducted an analysis on the WMT15 De→En test set to compare the quality of translations produced by test-time wait-k (i.e., monotonic one-stage beam search) and our monotonic two-stage beam search. As shown in Table 3, the rescoring process in the second stage significantly improves translation quality. + +Table 4 shows the quality of pseudo-targets generated by standard KD, monotonic one-stage beam search, and monotonic two-stage beam search, measured in BLEU with respect to the original references. Across both $\mathrm{De}\rightarrow \mathrm{En}$ and $\mathrm{En}\rightarrow \mathrm{Vi}$ , the standard KD achieves the highest BLEU scores, closely followed by the monotonic KD method that uses two-stage beam search. The one-stage only beam search method results in the lowest translation quality among the three approaches, particularly on $\mathrm{De}\rightarrow \mathrm{En}$ where the BLEU score is 4 points lower. Figure 12 illustrates the performance of multipath wait- $k$ models trained on the respective training data. The two-stage method consistently outperforms the one-stage method on $\mathrm{De}\rightarrow \mathrm{En}$ and is better in most latency settings on $\mathrm{En}\rightarrow \mathrm{Vi}$ . It is notable that the one-stage method leads to substantially inferior SiMT models on $\mathrm{De}\rightarrow \mathrm{En}$ due to the markedly lower quality of the pseudo-targets. + +Table 3: BLEU of monotonic KD-produced test set vs. original test set on WMT15 De→En. + +
Pseudo-RefsDe→EnEn→Vi
Mono-KD(One-Stage)31.6637.89
Mono-KD(Two-Stage)34.3338.46
KD35.7438.52
+ +Table 4: BLEU of KD-produced training data vs. original. + +# 7 Conclusion + +Long-distance reorderings in conventional parallel data can negatively impact the training of simultaneous translation models. To address this problem, we propose a novel two-stage beam search algorithm to generate monotonic yet accurate pseudo translations that are then used to train SiMT mod + +![](images/dfbfb70f433a2baec7c2f1ec34bd34f33f863ec4a3dead9ec3e2efd1894e646a.jpg) +Figure 12: Comparison of different KD methods with multipath wait- $k$ models. + +els through sequence-level knowledge distillation. Experiments on three language pairs demonstrate that this method can consistently improve multiple SiMT models and achieve new state of the art performance for simultaneous translation. + +# Limitations + +Our monotonic KD approach requires searching for a hyper-parameter $k$ to strike a balance between monotonicity and translation quality for generating pseudo-targets. The current process requires substantial computational resources to determine the optimal value, which may be different depending on the dataset. More studies are needed to establish an efficient method. + +# Acknowledgements + +We would like to thank all the anonymous reviewers for the insightful and helpful comments. This work was supported by Alibaba Research Intern Program, the National Key Research & Development Project of China (2021ZD0110700), the National Natural Science Foundation of China (U19B2043, 61976185), and the Fundamental Research Funds for the Central Universities (226-2022-00051). This work was done during the first author's internship at Alibaba DAMO Academy. + +# References + +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. arXiv preprint arXiv:1906.05218. +Chris Callison-Burch, Philipp Koehn, Christof Monz, and Josh Schroeder. 2009. Findings of the 2009 Workshop on Statistical Machine Translation. In + +Proceedings of the Fourth Workshop on Statistical Machine Translation, pages 1-28, Athens, Greece. Association for Computational Linguistics. +Chih-Chiang Chang, Shun-Po Chuang, and Hung-yi Lee. 2022. Anticipation-free training for simultaneous machine translation. In Proceedings of the 19th International Conference on Spoken Language Translation (IWSLT 2022), pages 43-61. +Junkun Chen, Renjie Zheng, Atsuhito Kita, Mingbo Ma, and Liang Huang. 2021. Improving simultaneous translation by incorporating pseudo-references with fewer reorderingings. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 5857-5864. +Hexuan Deng, Liang Ding, Xuebo Liu, Meishan Zhang, Dacheng Tao, and Min Zhang. 2022. Improving simultaneous machine translation with monolingual data. arXiv preprint arXiv:2212.01188. +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. +Maha Elbayad, Laurent Besacier, and Jakob Verbeek. 2020. Efficient wait-k models for simultaneous machine translation. arXiv preprint arXiv:2005.08595. +Jiatao Gu, Graham Neubig, Kyunghyun Cho, and Victor OK Li. 2016. Learning to translate in real-time with neural machine translation. arXiv preprint arXiv:1610.00388. +Hyojung Han, Seokchan Ahn, Yoonjung Choi, Insoo Chung, Sangha Kim, and Kyunghyun Cho. 2021. Monotonic simultaneous translation with chunkwise reordering and refinement. arXiv preprint arXiv:2110.09646. +Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. 2015. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531. +Yoon Kim and Alexander M Rush. 2016. Sequence-level knowledge distillation. arXiv preprint arXiv:1606.07947. +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. +Minh-Thang Luong and Christopher D Manning. 2015. Stanford neural machine translation systems for spoken language domains. In Proceedings of the 12th International Workshop on Spoken Language Translation: Evaluation Campaign. + +Mingbo Ma, Liang Huang, Hao Xiong, Renjie Zheng, Kaibo Liu, Baigong Zheng, Chuanqiang Zhang, Zhongjun He, Hairong Liu, Xing Li, et al. 2019a. 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. +Xutai Ma, Juan Pino, James Cross, Liezl Puzon, and Jiatao Gu. 2019b. Monotonic multihead attention. arXiv preprint arXiv:1909.12406. +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. +Yi Ren, Jinglin Liu, Xu Tan, Chen Zhang, Tao Qin, Zhou Zhao, and Tie-Yan Liu. 2020. Simulspeech: End-to-end simultaneous speech to text translation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 3787-3796. +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. Advances in neural information processing systems, 30. +Ruiqing Zhang, Xiyang Wang, Chuanqiang Zhang, Zhongjun He, Hua Wu, Zhi Li, Haifeng Wang, Ying Chen, and Qinfei Li. 2021a. Bstc: A large-scale chinese-english speech translation dataset. arXiv preprint arXiv:2104.03575. +Shaolei Zhang and Yang Feng. 2022. Information-transport-based policy for simultaneous translation. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, Online and Abu Dhabi. Association for Computational Linguistics. +Shaolei Zhang, Yang Feng, and Liangyou Li. 2021b. Future-guided incremental transformer for simultaneous translation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 14428-14436. +Shaolei Zhang, Shoutao Guo, and Yang Feng. 2022a. Wait-info policy: Balancing source and target at information level for simultaneous machine translation. +Shaolei Zhang, Shoutao Guo, and Yang Feng. 2022b. Wait-info policy: Balancing source and target at information level for simultaneous machine translation. In Findings of the Association for Computational Linguistics: EMNLP 2022, Online and Abu Dhabi. Association for Computational Linguistics. + +Baigong Zheng, Kaibo Liu, Renjie Zheng, Mingbo Ma, Hairong Liu, and Liang Huang. 2020. Simultaneous translation policies: From fixed to adaptive. arXiv preprint arXiv:2004.13169. + +# A Algorithm of Standard Beam Search + +Algorithm 2: Standard Beam Search +Input: x: source sentence b: max beam size $n_{max}$ : max hypothesis length score $(\cdot ,\cdot)$ : scoring function Output: Best hypothesis +1 $B_0\gets \{\langle 0,\mathrm{BOS}\rangle \}$ +2 for $i\in \{1,\dots ,n_{max}\}$ do +3 $B\gets \emptyset$ +4 for $\langle s,\mathbf{y}\rangle \in B_{i - 1}$ do +5 if y.last() = EOS then +6 $B.\mathrm{add}(\langle s,\mathbf{y}\rangle)$ continue +7 +8 for $y\in \mathcal{V}$ do +9 $s\gets \mathrm{score}(\mathbf{x},\mathbf{y}\circ y)$ +10 $B.\mathrm{add}(\langle s,\mathbf{y}\circ y\rangle)$ +11 $B_i\gets B.\mathrm{top}(b)$ +12 return B.max() + +# B Anticipation Rate of (Pseudo-)Refs + +During the training of a simultaneous translation model, an anticipation happens when a target word is generated before the corresponding source word is encoded. To identify the anticipations, we need the word alignment between the parallel sentences. + +We use fast-align in our experiments (Dyer et al., 2013) to get a word alignment $a$ between a source sentence $\mathbf{x}$ and a target sentence $\mathbf{y}$ . It is a set of source-target word index pairs $(s, t)$ where the $s^{\mathrm{th}}$ source word $x_{s}$ aligns with the $t^{\mathrm{th}}$ target word $y_{t}$ . + +Formally, a target word $y_{t}$ is $k$ -anticipated $(A_{k}(t,a) = 1)$ if it aligns to at least one source word $\mathbf{x}_s$ where $s \geq t + k$ : + +$$ +A _ {k} (t, a) = \mathbb {1} [ \{(s, t) \in a | s \geq t + k \} \neq \varnothing ] +$$ + +The $k$ -anticipation rate $(AR_{k})$ of an $(\mathbf{x},\mathbf{y},\mathbf{a})$ triple is further defined under wait- $k$ policy: + +$$ +A R _ {k} (\mathbf {x}, \mathbf {y}, a) = \frac {1}{| \mathbf {y} |} \sum_ {t = 1} ^ {| \mathbf {y} |} A _ {k} (t, a) +$$ + +# C Hallucination Rate of Hypotheses + +HR is defined to quantify the number of hallucinations in decoding. A target word $\hat{y}_t$ is a hallucination if it can not be aligned to any source word. + +Formally, based on word alignment $a$ , whether target word $\hat{y}_t$ is a hallucination is + +$$ +H (t, a) = \mathbb {1} [ \{(s, t) \in a \} = \varnothing ] \tag {4} +$$ + +Hallucination rate $HR$ is further defined as + +$$ +H R (\mathbf {x}, \hat {\mathbf {y}}, a) = \frac {1}{| \hat {\mathbf {y}} |} \sum_ {t = 1} ^ {| \hat {\mathbf {y}} |} H (t, a) +$$ + +# D WMT15 De→En Test Set Annotations + +In order to properly evaluate the quality of SiMT, we expect to remove the long-distance reorderings in the test set. So we ask the professional interpreters to rephrase the references in the test set of WMT15 De→En into simultaneous style. We hired two profession interpreters and spent 888 US dollars in total to get the monotonic test set. The annotation guidelines we provided with them are as follows: + +- A monotonic translation should be faithful and fluent, following common practices in professional translation of sentences, without adding, deleting, or substituting meaningful information in the source sentence. The original professional translations are provided for reference only and annotators should feel free to start from scratch, or reuse the original translation and make necessary edits, in order to produce a monotonic translation that is faithful and fluent. +- A monotonic translation should reduce long distance reordering between words and try to emulate the word order in the source language if possible, under the requirement of criterion 1. +- While it can be difficult and time-consuming to come up with the best monotonic translation for a source sentence, we require reasonable effort to create a more monotonic translation that is quantitatively better than the original translation according to criterion 2, unless the original translation is already monotonic. +- There may exist multiple monotonic translations for a source sentence with varying degrees of monotonicity. We require reasonable effort to create a more monotonic translation but it does not need to be the most monotonic translation. We welcome diversity in monotonic translation and would collect multiple versions of monotonic translations from different in-house and external professional translators. + +![](images/2833b8e0094690f782c03339734922bee327a3a8b26921cdb13a1fe6ec6969e0.jpg) +E Additional Training Details and Experimental Results + +![](images/e9be3807e709e0b030d16409859476d3a8d2588640082e64b50f46cafc07090b.jpg) +Figure 13: Evaluation of back-translation on multipath wait- $k$ models on WMT15 De→En. We re-generate monotonic source input by standard beam search and trained a multipath wait- $k$ model on it. +Figure 14: Evaluation of multipath wait- $k$ models on the original first 500 pairs test set of WMT15 De $\rightarrow$ En. + +# F Numerical Results + +The numerical results of the main SiMT systems are presented in table 5 and table 7. + +
originMultipath Wait-k
De-En
kALBLEU
32.1226.21
54.0928.53
76.0329.72
97.930.69
119.731.11
1311.4231.41
+∞-32.25
mono KDkALBLEU
32.2326.74
54.4128.98
76.3430.46
98.1931.20
1110.031.59
1311.7231.78
+∞-32.15
mono KD +monol*1kALBLEU
32.2227.38
54.4929.61
76.3931.27
98.2332.10
1110.0332.38
1311.7732.57
+∞-32.76
mono KD +monol*4kALBLEU
31.9126.77
54.3629.90
76.2731.52
98.1932.39
1110.0032.51
1311.7332.59
+∞-33.01
originITST
deltaALBLEU
0.22.1524.88
0.32.6928.25
0.43.7429.50
0.55.2830.54
0.67.2131.00
0.79.5031.22
0.812.3931.21
+∞-32.25
mono KDdeltaALBLEU
0.22.1524.91
0.32.4527.50
0.43.1629.13
0.54.3430.01
0.66.1730.98
0.78.5931.41
0.812.0931.58
+∞-32.15
mono KD +monol*1deltaALBLEU
0.22.1325.25
0.32.3327.96
0.42.8929.53
0.53.8530.60
0.65.4231.54
0.77.8032.06
0.811.5932.29
+∞-32.76
+ +Table 5: Numerical Results in figure 10 and figure 11. + +
Input第二种反馈功能是针对NLU结果的干预。
RefWait-3(origin)Wait-3(mono KD)Wait-3(KD)The second function is intervening in NLU results .the second feedback function is designed for NLU results .the second feedback function is to target the intervention of NLU results .the second feedback function is to target NLU results intervention .
Input那么在这个对话过程中发生了什么事情呢?
RefWait-3(origin)Wait-3(mono KD)Wait-3(KD)What happened during this dialogue ?so what is the difference between what happened in this conversation ?so in this conversation , what happened ?so what do you think happened in this conversation ?
Input我觉得从我的角度看,从我们现在的角度看,是时候了。
RefITST-0.4(origin)ITST-0.4(mono KD)ITST-0.4(KD)I think from my perspective , from our perspective , it is about time .I think it's a good idea to look at it from my point of view .I think from my point of view , from our point of view , it is time .I think from my point of view , from our present point of view , it is time .
Input我们啊,只能用没有游戏功能的电子产品。
RefITST-0.4(origin)ITST-0.4(mono KD)ITST-0.4(KD)So we are only permitted to use digital products without any gaming functions .we can only use the game without the electronic product .we can only use the game-free electronic products .we can only use the ability to use electronic products without game function .
+ +Table 6: Translation Examples of models trained with original courpus and our (mono)KD-produced corpus. The first two examples are translated by multipath model with a wait-3 policy. The last two examples are translated by ITST with threshold 0.4. Texts in red are considered hallucination of SiMT. + +
originMultipath Wait-k
De-EnDe-En(Re-anno)Zh-EnEn-Vi
kALBLEUkALBLEUkALBLEUkALBLEU
32.1226.2132.3730.6011.1811.7013.2027.67
54.0928.5354.1832.9832.8514.2234.7329.68
76.0329.7276.0633.3354.5815.7556.4330.12
97.930.6997.8734.0276.3316.7478.1130.18
119.731.11119.6634.5397.9517.2199.7030.09
1311.4231.411311.4434.93------
+∞-32.25+∞-33.62+∞-17.49+∞-29.61
mono KDkALBLEUkALBLEUkALBLEUkALBLEU
32.2326.7432.1731.4011.2911.8213.0228.18
54.4128.9854.3733.8632.9714.8734.6930.28
76.3430.4676.3634.3754.7116.3856.4530.79
98.1931.2098.2135.1876.4217.4078.1630.80
1110.031.59119.9935.3598.0517.7199.7330.77
1311.7231.781311.7435.75------
+∞-32.15+∞-36.18+∞-17.88+∞-30.6
KDkALBLEUkALBLEUkALBLEUkALBLEU
32.2326.3232.4531.5310.812.2512.8328.17
54.1729.1554.2433.5432.6915.1334.5630.00
76.0430.4676.1334.1954.5116.5756.3330.55
97.9731.3897.9434.7776.2717.6878.0430.61
119.7731.73119.7835.5297.9418.3099.6430.64
1311.4832.081311.4935.64------
+∞-32.83+∞-35.81+∞-18.6+∞-30.9
originITST
De-EnDe-En(Re-anno)Zh-EnEn-Vi
deltaALBLEUdeltaALBLEUdeltaALBLEUdeltaALBLEU
0.22.1524.880.22.1830.000.21.7112.110.22.5327.36
0.32.6928.250.32.7432.340.32.2113.450.33.6829.50
0.43.7429.500.43.7933.420.42.9014.790.45.4929.83
0.55.2830.540.55.3933.750.53.8315.710.57.1230.12
0.67.2131.000.67.4833.930.64.9716.210.69.0230.16
0.79.5031.220.79.8533.840.76.3516.87---
0.812.3931.210.813.0533.810.87.9016.95---
+∞-32.25+∞-33.62+∞-17.49+∞-29.61
mono KDdeltaALBLEUdeltaALBLEUdeltaALBLEUdeltaALBLEU
0.22.1524.910.22.1031.070.21.9313.370.22.3128.51
0.32.4527.500.32.4434.000.32.2914.690.33.2930.43
0.43.1629.130.43.2134.200.42.9415.350.44.8230.77
0.54.3430.010.54.3834.530.53.7416.340.56.4630.74
0.66.1730.980.66.4035.170.64.8216.700.68.2730.81
0.78.5931.410.78.9335.710.76.1117.25---
0.812.0931.580.812.3735.550.87.5817.75---
+∞-32.15+∞-36.18+∞-17.88+∞-30.6
KDdeltaALBLEUdeltaALBLEUdeltaALBLEUdeltaALBLEU
0.22.1025.370.22.1031.610.21.8813.470.22.4328.64
0.32.5828.460.32.5933.250.32.4214.670.33.5930.24
0.43.4830.110.43.6434.560.43.1715.720.45.0430.70
0.54.8530.910.54.9235.090.54.1716.880.56.7730.67
0.66.6931.560.66.8035.170.65.2017.520.68.5530.81
0.79.1431.980.79.3035.810.76.3717.79---
0.813.1532.190.813.0435.800.87.9117.81---
+∞-32.83+∞-35.81+∞-18.6+∞-30.9
+ +Table 7: Numerical Results in figure 6, figure 7 and figure 8. + +A For every submission: + +A1. Did you describe the limitations of your work? Limitations +A2. Did you discuss any potential risks of your work? Not applicable. Left blank. +A3. Do the abstract and introduction summarize the paper's main claims? Section1 +A4. Have you used AI writing assistants when working on this paper? Left blank. + +B Did you use or create scientific artifacts? + +Left blank. + +B1. Did you cite the creators of artifacts you used? Section1,3 +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? Section5 +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? Section1 +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? Section5 +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? Section5 +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. Section5 + +C Did you run computational experiments? + +Section5 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? Section5 + +The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? Section5 +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? Section5 +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? Section5 + +# D Did you use human annotators (e.g., crowdworkers) or research with human participants? Section5 + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? Not applicable. Left blank. +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? Appendix +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? Section5 +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? Section5 +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? Section5, Appendix \ No newline at end of file diff --git a/bettersimultaneoustranslationwithmonotonicknowledgedistillation/images.zip b/bettersimultaneoustranslationwithmonotonicknowledgedistillation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..755cefa4b02e81037b8eca37d7855d486158c0d5 --- /dev/null +++ b/bettersimultaneoustranslationwithmonotonicknowledgedistillation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8e0c7629096c4d52ef058e3828de180426f375f455b4f07656c78dad3f2e1467 +size 1019075 diff --git a/bettersimultaneoustranslationwithmonotonicknowledgedistillation/layout.json b/bettersimultaneoustranslationwithmonotonicknowledgedistillation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..b3870c7bc9d7f2eafd94371242fed206ef3285ac --- /dev/null +++ b/bettersimultaneoustranslationwithmonotonicknowledgedistillation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:21ccf11907708433d24821119390f698b1095f1c9538e250ff239480f4fdf149 +size 552509 diff --git a/beyondcontrastivelearningavariationalgenerativemodelformultilingualretrieval/7d1ae7f3-12c3-4def-8ccd-6fb8a416e6f8_content_list.json b/beyondcontrastivelearningavariationalgenerativemodelformultilingualretrieval/7d1ae7f3-12c3-4def-8ccd-6fb8a416e6f8_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..e6bc2517272dd1390173a6445f5c4074f88a8ff1 --- /dev/null +++ b/beyondcontrastivelearningavariationalgenerativemodelformultilingualretrieval/7d1ae7f3-12c3-4def-8ccd-6fb8a416e6f8_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:90b2210bf7abd92f036c4e85eb56cc03bc36087c3c06e6b7e853f82ccd2adad0 +size 150286 diff --git a/beyondcontrastivelearningavariationalgenerativemodelformultilingualretrieval/7d1ae7f3-12c3-4def-8ccd-6fb8a416e6f8_model.json b/beyondcontrastivelearningavariationalgenerativemodelformultilingualretrieval/7d1ae7f3-12c3-4def-8ccd-6fb8a416e6f8_model.json new file mode 100644 index 0000000000000000000000000000000000000000..1734cd2a4614e25df2103451c32b148f6daff45d --- /dev/null +++ b/beyondcontrastivelearningavariationalgenerativemodelformultilingualretrieval/7d1ae7f3-12c3-4def-8ccd-6fb8a416e6f8_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:79a5bbcf5c60dd80eee188c8c58ea3e8997dea62bba911bc36093ef4a5d8b6e3 +size 175283 diff --git a/beyondcontrastivelearningavariationalgenerativemodelformultilingualretrieval/7d1ae7f3-12c3-4def-8ccd-6fb8a416e6f8_origin.pdf b/beyondcontrastivelearningavariationalgenerativemodelformultilingualretrieval/7d1ae7f3-12c3-4def-8ccd-6fb8a416e6f8_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..bb5b2af0031b7db5ea173ac8b66281ec33fd370d --- /dev/null +++ b/beyondcontrastivelearningavariationalgenerativemodelformultilingualretrieval/7d1ae7f3-12c3-4def-8ccd-6fb8a416e6f8_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0efae1feb54962ce49c46dee869480dbfe9da9b2cecc0eb51a74bcb4fad56537 +size 1395427 diff --git a/beyondcontrastivelearningavariationalgenerativemodelformultilingualretrieval/full.md b/beyondcontrastivelearningavariationalgenerativemodelformultilingualretrieval/full.md new file mode 100644 index 0000000000000000000000000000000000000000..810dd744a394243a4fdf64ca9cc9a1c6544381ee --- /dev/null +++ b/beyondcontrastivelearningavariationalgenerativemodelformultilingualretrieval/full.md @@ -0,0 +1,528 @@ +# Beyond Contrastive Learning: A Variational Generative Model for Multilingual Retrieval + +John Wieting1, Jonathan H. Clark1, William W. Cohen1, Graham Neubig2, and Taylor Berg-Kirkpatrick3 + +Google DeepMind + +$^{2}$ Carnegie Mellon University, Pittsburgh, PA, 15213, USA + +3University of California San Diego, San Diego, CA, 92093, USA + +{jwieting,jhclark,wcohen}@google.com,gneubig@cs.cmu.edu,tberg@eng.ucsd.edu + +# Abstract + +Contrastive learning has been successfully used for retrieval of semantically aligned sentences, but it often requires large batch sizes and carefully engineered heuristics to work well. In this paper, we instead propose a generative model for learning multilingual text embeddings which can be used to retrieve or score sentence pairs. Our model operates on parallel data in $N$ languages and, through an approximation we introduce, efficiently encourages source separation in this multilingual setting, separating semantic information that is shared between translations from stylistic or language-specific variation. We show careful large-scale comparisons between contrastive and generation-based approaches for learning multilingual text embeddings, a comparison that has not been done to the best of our knowledge despite the popularity of these approaches. We evaluate this method on a suite of tasks including semantic similarity, bitext mining, and cross-lingual question retrieval—the last of which we introduce in this paper. Overall, our Variational Multilingual Source-Separation Transformer (VMSST) model outperforms both a strong contrastive and generative baseline on these tasks. $^{1}$ + +# 1 Introduction + +Contrastive learning is the dominant paradigm for learning text representations from parallel text (Hermann and Blunsom, 2014; Singla et al., 2018; Guo et al., 2018; Wieting et al., 2019; Feng et al., 2022). However, contrastive learning requires strong negative examples in the data and finding these negatives can be expensive in terms of compute or manual effort. In this paper, we propose a generative $^{2}$ model for learning multilingual text embeddings + +which encourages source separation, separating semantic information that is shared between translations from stylistic or language-specific variation. We find that by filtering this variation into separate variables, performance of the remaining representations, that encode shared semantic information, increases across all downstream tasks. + +Through an approximation that greatly reduces the memory footprint of our model, we scale our model and train on 92 languages. We systematically compare our model, the Variational Multilingual Source-Separation Transformer (VMSST) to strong contrastive and generative baselines on a suite of tasks including semantic similarity, bitext mining, and question retrieval, which we introduce for the cross-lingual setting, using the same training data and architecture. We show that our model outperforms these models and is also competitive with the state-of-the-art. + +We analyze VMSST with careful ablations, showing the contribution of each aspect of the model to performance. We also show that even at large batch sizes, the advantage over contrastive learning remains, especially for large models. Furthermore, we also find the learned embedding space of our model to be smoother, making it less affected by the "hubness problem" (Radovanovic et al., 2010; Radovanovic et al., 2010) in representation learning, and more suitable for large-scale retrieval than the baseline methods. + +To the best of our knowledge, this is the first work to systematically compare generative and contrastive models for learning multilingual embeddings on a large parallel corpus containing many languages in a carefully controlled experimental setup—despite the popularity of these approaches (Artetxe and Schwenk, 2019b; Yang et al., 2020). We carry out these experiments with both pretrained and randomly initialized models. The comparison of objective functions is an important research question due to the large amounts of multi- + +lingual text available to train models and the many uses of these models in downstream tasks. To that end, another contribution of this paper is showing these comparisons and the surprising result that contrastive objectives do not provide the overall best accuracy on downstream tasks. Moreover, our generative VMSST increasingly outperforms the contrastive model when more layers are added and when training with larger batches and more training data, suggesting that as models continue to scale in the future, this performance gap may continue to increase further motivating the use of generative approaches for learning multilingual text embeddings. + +# 2 Related Work + +There has been a number of approaches proposed for learning bilingual and multilingual text embeddings. One popular approach is contrastive learning (Hermann and Blunsom, 2014; Singla et al., 2018; Guo et al., 2018; Wieting et al., 2019; Feng et al., 2022) where translation pairs are positive examples and text from other pairs are used as negative examples. An alternative approach is to use a neural machine translation objective, where the representation from the hidden states of the encoder is used as the sentence embedding (Espana-Bonet et al., 2017; Schwenk and Douze, 2017; Artetxe and Schwenk, 2019b). Other approaches include multi-task learning approaches which often use some type of contrastive learning of parallel text to align representations among languages (Yang et al., 2020; Goswami et al., 2021), cross-lingual pretraining (Chi et al., 2022), and model distillation from a large pretrained multilingual model (Reimers and Gurevych, 2020). + +An alternative approach that is more closely related to our work is generative models that separate the linguistic variation from the shared semantic information in translation pairs. Wieting et al. (2020) considered this for bitext, with each language having its own encoder and decoder parameters. This approach however does not scale, since it is not feasible to have thousands of encoders and decoders if one wants to model all of the more than 7,000 languages in the world. + +# 3 Model + +The generative process of our underlying probabilistic model and the computation graph of our training objective procedure are depicted in Fig- + +![](images/3b6f70941bfbaaa0505aee1fcd363d91cd7507f3c96ceaa098f89a5aa9473784.jpg) +Figure 1: The generative process of our model. Latent variables, $z_{l_i}$ , modeling the variation $x_{l_i}$ specifically due to language $l_i$ , as well as a latent variable modeling the common semantics, $z_{sem}$ , are drawn from a multivariate Gaussian prior. The observed translation in each language is then conditioned on its language-specific variable and $z_{sem}$ . In practice, we approximate this model to make learning and inference tractable. + +ure 1 and Figure 2 respectively. In the generative story for VMSST, we first sample a semantic variable $z_{sem}$ for the sentence. Then for each of the $N$ languages, we sample a language-specific variable $z_{l_i}$ . Each latent variable $z$ is sampled from a multivariate Gaussian prior $\mathcal{N}(0, I_k)$ . These variables are then fed into a decoder that samples each of the $N$ sentences in the translation set. Each observed translation $x_{l_i}$ , is sampled conditioned on $z_{sem}$ and its language variable $z_{l_i}$ . Because $z_{sem}$ will be used to generate the sampled sentences in all languages, we expect that this variable will encode semantic, syntactic, or stylistic information that is shared in all of the translations. Conversely, the language variables $z_{l_i}$ will handle language-specific peculiarities or specific style differences that are not central to the meaning of the translation and are therefore not contained in many of the sentences. Concretely, the likelihood function of our model can be written for a single $N$ -way tuple of translations $x = (x_1, \ldots, x_N)$ : + +$$ +p (x | z _ {s e m}, z _ {l _ {1}}, \dots , z _ {l _ {N}}) = \prod_ {i} ^ {N} p (x _ {i} | z _ {s e m}, z _ {l _ {i}}) +$$ + +In the next section, we discuss how this separation of information is encouraged during learning. + +# 4 Learning and Inference + +We would like to train our model on a set of parallel sentences $X$ consisting of $M$ examples in $N$ languages and a collection of latent variables $Z$ . However, $N$ -way parallel corpora are not available at the scale of bilingual text, and so we therefore approximate an $N$ -way parallel corpus by sampling translation pairs from a large pool of pairs containing text in $N$ languages. Therefore in our model, $X = \{\langle x_{l_i}^1, x_{l_j}^1 \rangle, \dots, \langle x_{l_i}^M, x_{l_j}^M \rangle\}$ and $Z = (\langle z_{l_i}^1, z_{l_j}^1, z_{sem}^1 \rangle, \dots, \langle z_{l_i}^M, z_{l_j}^M, z_{sem}^M \rangle)$ . + +We aim to maximize the likelihood of the observed $X$ with respect to the parameters of the decoder $\theta$ , marginalizing over the latent variables $Z$ . We follow established procedures for this optimization problem from related latent variable models like variational autoencoders (VAEs; Kingma and Welling (2013)). Specifically, we optimize a variational lower bound on the log marginal likelihood, the evidence lower bound (ELBO). ELBO introduces a variational approximation $q(z_{sem}, z_{li}, z_{lj} | x_{li}, x_{lj}; \phi)$ to the true posterior of the model. The $q$ distribution is parameterized by encoders or inference networks with parameters $\phi$ . ELBO can be optimized by gradient ascent by using the reparameterization trick (Kingma and Welling, 2013), which allows for the expectation under $q$ to be approximated through sampling in a way that preserves backpropagation. The decoders and encoders are discussed in further detail in Section 5. + +In contrast to variational autoencoders, which have only a single latent variable for each example, we have three in our model for each example. To encourage source separation, we make several independence assumptions for $q$ and factor it into three terms: + +$$ +\begin{array}{l} q \left(z _ {s e m}, z _ {l _ {i}}, z _ {l _ {j}} \mid x _ {l _ {i}}, x _ {l _ {j}}; \phi\right) = \\ q \left(z _ {s e m} \mid x _ {l _ {i}}, x _ {l _ {j}}; \phi\right) q \left(z _ {l _ {i}} \mid x _ {l _ {i}}; \phi\right) q \left(z _ {l _ {j}} \mid x _ {l _ {j}}; \phi\right) \\ \end{array} +$$ + +Lastly, we note that the ELBO contains a KL term that acts to regularize the latent variables. In our model, the KL term encourages $z_{sem}$ , $z_{l_i}$ , and $z_{l_j}$ to be close to a zero-centered Gaussian prior. The KL term thus encourages source separation, as encoding information shared by the translation pair in the shared variable results in only a single penalty from the KL loss, while encoding the information separately in the language-specific variables + +unnecessarily doubles the overall cost. In effect, we can view these language-specific latent variables as collecting information that cannot be captured in a common semantic space, separating it out from the variables collecting shared semantic information that we use for downstream tasks. + +Objective Function. The overall objective function for VMSST consists of consists of two terms, the first being ELBO as described earlier: + +$$ +\begin{array}{l} \operatorname {E L B O} = \mathbb {E} _ {q \left(Z _ {S}, Z _ {L} \mid X; \phi\right)} [ \log p (X \mid Z _ {S}, Z _ {L}; \theta) ] - \\ \mathrm {K L} (q \left(Z _ {S}, Z _ {L} | X; \phi\right) | | p \left(Z _ {S}; \theta\right) p \left(Z _ {L}; \theta\right)) \\ \end{array} +$$ + +where $Z_{S}$ is the collection of semantic variables, while $Z_{L}$ is the collection of language variables. + +The second term, which we found necessary for strong performance, is the sum of $p(x_{l_i}|\mu_{seml_j})$ and $p(x_{l_j}|\mu_{seml_i})$ which can be interpreted as samples from the mean of the posterior distribution using semantic variables generated from both input sentences. When training variational objectives, where the model ignores the latent variables and the learned posterior remains close to the prior. Examples of other approaches to address these issues include: (Yang et al., 2017; Kim et al., 2018; Xu and Durrett, 2018; He et al., 2019). We weight the ELBO by $\lambda$ giving the total objective as: + +$$ +\sum_ {\left(x _ {l _ {i}}, x _ {l _ {j}}\right) \in X} p \left(x _ {l _ {i}} \mid \mu_ {s e m _ {l _ {j}}}\right) + p \left(x _ {l _ {j}} \mid \mu_ {s e m _ {l _ {i}}}\right) + \lambda \text {E L B O} +$$ + +Therefore, our objective resembles translation with a weighted source-separation term. We show the effectiveness of this formulation compared to a pure translation objective in our experiments in Section 6. + +# 5 Architecture + +Our architecture is an encoder-decoder model, where the encoder produces a single representation that is fed into the decoder. Cross-attention between the encoder and decoder is not used, therefore the decoder has no full sequence visibility and more pressure is applied on the encoder to create a semantically meaningful representation. Specifically, we follow the approach of Wieting et al. (2020) which uses a Transformer (Vaswani et al., 2017) encoder-decoder model, where the sentence embeddings are used in two places: at each layer of the decoder in place of cross-attention and in the computation of the logits. + +![](images/6b31cdbb4bfec28d4e792877d1873795c947f48c5d4f2be22aa7205bdd14f623.jpg) +Figure 2: The computation graph for the variational lower bound used to train VMSST. The text for languages $l_i$ and $l_j$ , with their respective language embeddings, are fed into the encoder acting as their inference networks. The text is also fed into the semantic inference network which is a separate encoder. The output of these networks are the language variables $z_{l_i}$ and $z_{l_j}$ and semantic variable $z_{sem}$ . Each language-specific variable is then concatenated to $z_{sem}$ and used by a single shared decoder to reconstruct the input sentence pair. + +Decoder Architecture. The decoder models $p(x_{l_i}|z_{sem}, z_{l_i}; \theta)$ for each language $i$ (see right side of Figure 2). The inputs to the decoder are the language-specific variable $z_{l_i}$ and the semantic variable $z_{sem}$ , which are concatenated and used to condition the decoder to generate the reconstruction of the observed text $x_{l_i}$ . We use a single decoder for all languages. + +Encoder Architecture. The encoders play an important role in the source separation as well as inference as detailed below. + +In order to motivate the separation of the linguistic and semantic information we split the encoder into two parts, only sharing the embedding table. We use one of these encoders to be the semantic inference network, which produces the semantic variable. The other encoder represents the $N$ language inference networks and produces the language variables for each language. These inference networks are shown on the left side of Figure 2. We mean-pool the hidden states followed by a linear projection to produce each variable from the encoders. + +The semantic inference network, which models $q(z_{sem}|x_{l_i},x_{l_j};\phi)$ , is a multilingual encoder that encodes each language. For each translation pair, we alternate which of the two parallel sentences is fed into the semantic encoder within a batch for the ELBO term in the objective. Since the semantic encoder is meant to capture language agnostic semantic information, its outputs for a translation + +pair should be similar regardless of the language of the input sentence. We use the mean of the semantic encoder as the sentence representation for downstream tasks. + +# 6 Experiments + +# 6.1 Constructing the Training Data + +We follow Artetxe and Schwenk (2019b) in constructing our training data. However, since the exact data is not publicly available, we expect their may be small differences due to random sampling and different dataset versions. More specifically we sample our data from Europarl, $^{3}$ United Nations (Rafalovitch and Dale, 2009), $^{4}$ OpenSubtitles2018 (Lison et al., 2018), $^{5}$ Global Voices, $^{6}$ Tanzil, $^{7}$ and Tatoeba v2021-07-22. $^{8}$ + +We sample the same amount of data as was done in Artetxe and Schwenk (2019b), detailed in Appendix C. The only deviation being that we take care to not include any Tatoeba test data in our training data. Our final corpus has nearly 216 million training examples, slightly less than 220 million reported in Artetxe and Schwenk (2019b). We use both English and Spanish as pivot languages, so each pair includes at least one English or Spanish sentence, and we use approximately the same + +3http://opus.nlpl.eu/Europarl.php +4https://opus.nlpl.eu/UN.php + +6https://opus.nlpl.eu/GlobalVoices.php +7https://opus.nlpl.eu/Tanzil.php +8https://opus.nlpl.eu/Tatoeba.php + +amount of data for each language. We note that we only have training data for 92 languages instead of the 93 in Artetxe and Schwenk (2019b) due to not having training data for Aymara (ay). + +# 6.2 Evaluation + +We evaluate on three tasks: semantic similarity, bitext mining and question retrieval. While the first two are commonly used to evaluate multilingual sentence embeddings, we introduce question retrieval in this paper. As can be seen by our results, we found question retrieval to be somewhat uncorrelated to either of the latter two. For each task, we use a collection of different datasets, detailed below. + +Semantic Textual Similarity The goal of the semantic textual similarity tasks is to predict the degree to which sentences have the same meaning as measured by human judges. The evaluation metric is Pearson's $r \times 100$ with the gold labels, which is convention for these tasks. + +We make a distinction between two semantic similarity evaluations, English-only and crosslingual. For the English-only evaluation, we follow Wieting et al. (2016) by averaging the yearly performance on 2012-2016 SemEval Semantic Textual Similarity (STS) shared tasks (Agirre et al., 2012, 2013, 2014, 2015, 2016). More specifically, for each year of the competition, we average the Pearson's $r \times 100$ for each dataset in that year, and then finally average this result for each year of the competition. For the cross-lingual evaluation we use the cross-lingual STS tasks from SemEval 2017 (Cer et al., 2017). This evaluation contains Arabic-Arabic, Arabic-English, Spanish-Spanish, Spanish-English, and Turkish-English STS datasets. These datasets were created by translating one or both pairs of an English STS pair into Arabic (ar), Spanish (es), or Turkish (tr). We average Pearson's $r \times 100$ for these datasets. + +Bitext Mining For bitext mining, we use the Tatoeba dataset introduced in Artetxe and Schwenk (2019b) and the 2018 Building and Using Parallel Corpora (BUCC) shared bitext mining task (Zweigenbaum et al., 2018). + +The Tatoeba dataset consists of 100-1000 pairs of data aligned to English for 112 languages. The accuracy for Tatoeba can be computed in two ways, depending if English is the target language or source language. We compute accuracy using + +cosine similarity in both directions for all 112 languages (19 are unseen in the training data) and average this score for all languages. + +The goal of the BUCC task is to find the gold aligned parallel sentences given two corpora (one being very large) in two distinct languages. Languages are aligned with English and consist of German (de), French (fr), Russian (ru), and Chinese (zh). Typically, only about $2.5\%$ of the sentences are aligned. Following Schwenk (2018), we evaluate on the publicly available BUCC data. This involves scoring all pairs between the source target sentences and finding the optimal threshold that separates the data. Using the threshold, we can compute the precision, recall, and $F_{1}$ of the alignments. We report $F_{1} \times 100$ in our results. + +We compare two different approaches for finding the sentence alignments. In the first, BUCC (cosine), we compute the cosine similarity between the non-English source sentences and the English target sentences, selecting the highest scoring English sentence as the match. In the second, BUCC (margin), we follow Artetxe and Schwenk (2019a) and use a margin-based scoring approach, where the final score of a sentence pair is both a function of the score between the pair and the scores of each sentence with its nearest neighbors. To compute this margin score, we divide the cosine similarity for source sentence $s_i$ and target sentence $t_i$ by the sum of the scores of the four nearest neighbors of $s_i$ with the target sentences and the sum of the scores of the four nearest neighbors of $t_i$ with the source sentences. + +Margin-based scoring is designed to alleviate the "hubness problem" (Radovanovic et al., 2010; Radovanovic et al., 2010) where the neighborhood around embeddings in a high-dimensional space, like in sentence embeddings, have many neighbors in common. These neighbors can displace the correct mapping in the ordering, hurting performance. + +Question Retrieval For our question retrieval evaluation, we report the accuracy $(R@1)$ on the test sets of Natural Questions (NQ) (Kwiatkowski et al., 2019) and the Multilingual Knowledge Questions and Answers (MKQA) (Longpre et al., 2021). We use the Probably Asked Questions dataset (PAQ) (Lewis et al., 2021) as a knowledge base from which we look up the nearest neighbor of each question in the NQ and MKQA test sets using cosine similarity. PAQ is a very large resource of 65 million automatically generated question-answer + +pairs. This is a zero-shot evaluation without any NQ supervised data. $^{9}$ + +Overall Score We consolidate all of these evaluations into a score, as a way to get a sense of overall performance since different models favor different evaluations. While we are averaging different metrics (accuracy, Pearson's $r$ , and $F_{1}$ ), we justify this as they do have the same scale, $^{10}$ and a simple average gives a way for us to see overall performance. Our score is the average of six subtasks, two subtasks for each of semantic similarity, bitext mining, and question retrieval: English semantic similarity, cross-lingual semantic similarity, Tatoeba, BUCC (we average performance of the cosine and margin based scoring), NQ, and MKQA. + +# 6.3 Baselines + +We compare VMSST against two strong baselines, which have been used extensively in the literature. + +The first baseline is CONTRASTIVE, where we use contrastive learning with the other sentences in the batch ("in-batch negative sampling") as negative examples (Sohn, 2016). CONTRASTIVE is computed as the average of computing $p(s_i|t_i)$ and $p(t_i|s_i)$ for source sentence $s_i$ and target sentence $t_i$ , and their respective representations $s_i$ and $t_i$ where the first term uses all the other targets as negatives and the second use all of the other source sentence as negatives. Specifically, + +$$ +p (s _ {i} | t _ {i}) = \exp (\mathbf {s} _ {\mathbf {i}} \cdot \mathbf {t} _ {\mathbf {i}}) / \sum_ {j \in B} \exp \mathbf {s} _ {\mathbf {i}} \cdot \mathbf {t} _ {\mathbf {j}} +$$ + +$$ +p (t _ {i} | s _ {i}) = \exp (\mathbf {s} _ {\mathbf {i}} \cdot \mathbf {t} _ {\mathbf {i}}) / \sum_ {j \in B} \exp \mathbf {t} _ {\mathbf {i}} \cdot \mathbf {s} _ {\mathbf {j}} +$$ + +$$ +\operatorname {l o s s} = - \frac {1}{2 | \mathcal {B} |} \sum_ {(s _ {i}, t _ {i}) \in \mathcal {B}} \log p (s _ {i} | t _ {i}) + \log p (t _ {i} | s _ {i}) +$$ + +where $\mathcal{B}$ is a minibatch. This version of contrastive learning has been used in representation learning for retrieval (DPR, Karpukhin et al., 2020), visual tasks (SimCLR, Chen et al., 2020) and image/text tasks (CLIP, Radford et al., 2021). There are other variations of this loss (Qian et al., 2019), and other + +contrastive losses like triplet loss (Weston et al., 2010) which has been used for learning text embeddings, but we leave a comparison of contrastive objectives for learning multilingual text embeddings for future work. + +The second baseline is BITRANSLATION, where we use a translation objective to learn the representation Espana-Bonet et al. (2017); Schwenk and Douze (2017); Artetxe and Schwenk (2019b). + +We also explore an alternative to the VMSST, VMSST CONTRASTIVE, by incorporating a contrastive loss to use in a multitask setting. Again, we weight the contribution of the VMSST loss by $\lambda$ . + +# 6.4 Experimental Settings + +We explore three different settings for each of four objective functions we consider. We use the Transformer architecture for all settings. Specifically, we explore a 6 layer encoder-decoder model, a 24 layer encoder-decoder model, and a 24 layer encoder-decoder initialized with the Multilingual T5 (mT5) Large (Xue et al., 2021). We set the dimension of the embeddings and hidden states for the encoders and decoders to 1024. The mT5 Large model inherently has embedding and hidden state dimensions of 1024. For all models, we use the mT5 vocabulary, which is derived from sentencepiece (Kudo and Richardson, 2018). The vocabulary consists of 250,000 tokens and was learned from multilingual variant of the C4 dataset called mC4 which includes 101 languages. + +For optimization, we use Adafactor (Shazeer and Stern, 2018). We use the same learning rate schedule as Vaswani et al. (2017), i.e., the learning rate increases linearly for 4,000 steps, after which it is decayed proportionally to the inverse square root of the number of steps. We set the peak learning rate to be 0.001, and we train our models for 100,000 steps total. We use a batch size of 2048 and set the maximum sequence length of our model to 32 for all experiments. + +We use a dropout rate of 0.1 for CONTRASTIVE models and no dropout for BITRANSLATION, VMSST CONTRASTIVE (with the exception of the randomly initialized 24 layer model which used 0.1), and VMSST. For VMSST, we anneal the KL term so that it increased linearly for 1,000,000 updates. + +For VMSST, we set $\lambda$ , the weight on the VMSST ELBO loss term, to be 0.025 for the pre + +
ModelSem. Sim.Bitext MiningQuest. Retrieval
Eng.XLXL (s.)XL (d.)TatoebaBUCC (c.)BUCC (m.)NQMKQAScore
Random Init. (6 Layer)
CONTRASTIVE65.566.873.362.463.166.284.034.117.653.7
BITRANSLATION69.663.971.658.753.362.181.237.419.252.5
VMSST CONTRASTIVE65.766.373.061.963.265.884.334.117.753.7
VMSST70.167.475.162.258.773.785.937.320.155.6
Random Init. (24 Layer)
CONTRASTIVE64.464.671.660.062.764.383.732.816.052.4
BITRANSLATION71.268.174.663.857.470.886.938.221.655.9
VMSST CONTRASTIVE68.269.775.565.964.858.584.136.918.955.0
VMSST71.171.777.767.761.478.789.038.322.358.1
Pretrained (24 Layer)
CONTRASTIVE73.374.776.073.985.174.393.740.227.664.2
BITRANSLATION74.078.079.876.878.285.991.940.929.664.9
VMSST CONTRASTIVE73.475.476.774.685.474.693.740.327.964.4
VMSST74.679.181.577.581.187.892.540.829.965.9
+ +Table 1: Experimental results for VMSST and VMSST CONTRASTIVE and our baselines CONTRASTIVE and BITRANSLATION. We evaluate on semantic similarity, bitext mining, and question retrieval. For semantic similarity we separate the evaluations into English-only, cross-lingual, cross-lingual but with the same language (XL (s.) ar-ar and es-es) and cross-lingual using different languages (XL (d.), ar-en, es-en, and tr-en). Results are reported as the average Pearson's $r \times 100$ across datasets. For bitext mining we evaluate on Tatoeba and BUCC, with BUCC split between using cosine similarity or using a margin approach (Artetxe and Schwenk, 2019a). Results are reported as accuracy $\times 100$ for Tatoeba and $F_{1} \times 100$ for BUCC. For question retrieval, we evaluate retrieval accuracy $\times 100$ using PAQ as a question knowledge base on the NQ and MKQA datasets. Finally, we compute a score to summarize quality over these evaluations. + +trained models, and 0.1 when training from randomly initialized parameters. For VMSST CONTRASTIVE, we set it to .0005 for the pretrained and 6 layer settings and 0.001 for the randomly initialized 24 layer setting. + +# 6.5 Results + +The results of our experiments are shown in Table 1. Overall, VMSST has the best performance for all three experimental settings and the best performance on each task on average, with the exception of Tatoeba. In fact, for NQ question retrieval with a pretrained model, it performs nearly to that of the model trained specifically for this task on NQ data from Lewis et al. (2021) which has an accuracy of 41.2. VMSST and BITRANSLATION are especially strong when using more layers, which is not the case for CONTRASTIVE which declines in performance when moving from 6 to 24 layers. In fact at 24 layers, BITRANSLATION performs better on average than CONTRASTIVE. Perhaps for even larger models, the gap between contrastive and generative models will increase. We also see that CONTRASTIVE seems to benefit more from pretraining than VMSST and BITRANSLATION, which could possibly be due to VMSST re-purposing and adding additional randomly initialized param + +eters to the decoder. Perhaps different pretraining strategies using this modified decoder would resolve these differences. We also see that VMSST CONTRASTIVE has negligible improvement over CONTRASTIVE which was unexpected—that is, a traditional contrastive loss does not improve further on top of generative loss of VMSST. We leave the exploration of different strategies of combining these approaches to future work. + +It is also interesting to observe the stark performance difference for different tasks. Bitext mining tasks like Tatoeba, and BUCC (m.) for the pretrained 24 layer model, favor CONTRASTIVE, while semantic similarity, BUCC (c.) and question retrieval favor VMSST, suggesting some fundamental difference in these tasks favor CONTRASTIVE. An examination of the Tatoeba and BUCC data shows that there are paraphrases in the test set, but accounting for these does not seem to meaningfully explain this performance difference. + +Lastly, we see that VMSST outperforms CONTRASTIVE on the BUCC task with cosine similarity, though the results between the two models are closer when using margin. This suggests that the "hubness problem" (Radovanovic et al., 2010; Radovanovic et al., 2010) where the neighborhood around embeddings in a high-dimensional spaces + +have many neighbors in common, is less of an issue when learning embeddings with VMSST. This smoother embedding space may also contribute to the stronger results VMSST has on the question retrieval tasks. + +# 6.6 Comparison to Related Work + +Prior work on learning multilingual embeddings has explored a variety of models utilizing different strategies and using difference source and types of training data. However, comparing approaches is difficult as they differ in many factors that are crucial to performance: training data, model size, architecture, vocabulary, training time, and evaluation datasets. Complicating matters further, even the metric used in evaluation for the same dataset, the distance measure used between embeddings for the same dataset, and the specific subsets of the evaluation datasets used can be different. + +The main goal of this paper is to compare contrastive and generative losses systematically and uniformly, on the same data, metrics and underlying architecture. However, we also emphasize that the best systems we compare are competitive with the current state-of-the-art. Hence, in this section we compare VMSST to published results of other models on semantic similarity and the Tatoeba and BUCC bitext mining tasks. We primarily compare against five models which have the strongest multilingual results in the literature: mUSE (Yang et al., 2020), LASER (Artetxe and Schwenk, 2019b), XLM-R (NLI/STS-B) and XLM (Para.) (Reimers and Gurevych, 2020), and LaBSE (Feng et al., 2022). + +For semantic similarity, we include Spearman's $\rho$ in order to compare to work that solely uses this correlation metric. We use cosine as the similarity measure for all models in these evaluations. $^{11}$ The results are shown in Table 2. + +For Tatoeba, we compare to methods that have evaluated on all 112 languages, which excludes mUSE as it was only trained on 16 language pairs. The results are shown in Table 3. Baselines results are taken from Reimers and Gurevych (2020). + +For BUCC, we include results on the training sets using the margin retrieval methods from Artetxe and Schwenk (2019b). The results are + +
ModelXLXL (s.)XL (d.)
mUSE79.581.778.1
LASER69.074.365.5
XLM-R (NLI/STS-B)79.081.777.2
XLM-R (Para.)82.482.982.1
LaBSE72.474.970.7
VMSST79.481.977.7
+ +Table 2: Comparisons to related work on cross-lingual semantic similarity. Results are reported in Spearman's $\rho \times 100$ . XL contains all 5 datasets, where XL (s.) contains only those where the languages are the same (ar-ar, es-es), and XL (d.) contains those datasets where the languages are different (ar-en, es-en, and tr-en). Note that models in this table are not trained on the same data; for instance LaBSE was trained on substantially more parallel data and XLM-R (Para.) was trained using a large English paraphrase corpus in addition to parallel data. + +
ModelTatoeba
LASER65.5
XLM-R (Para.)67.1
LaBSE83.7
VMSST81.1
+ +Table 3: Comparisons to related work on Tatoeba. Results are reported as accuracy $\times 100$ , averaging the xx>en and en->xx directions. Note that models in this table are not trained on the same data; for instance LaBSE was trained on substantially more parallel data and XLM-R (Para.) was trained using a large English paraphrase corpus in addition to parallel data. + +shown in Table 5. Baselines results are taken from Artetxe and Schwenk (2019b); Reimers and Gurevych (2020). + +While VMSST does not have the best performance relative to models from the literature on any single task, it does have the best overall performance if one averages the results for each task.12 While these models share much in common, namely using parallel text and some type of pretraining or pretrained model, there are differences in the exact data and models used, among other confounding variables. For instance, LaBSE used training data consisting of six billion parallel pairs across languages and was also trained on monolingual text using a masked language modelling objective. XLM-R (Para.) makes use of a 50 million example paraphrase corpus for distillation. In contrast, our setup most closely follows LASER, using an approximation of the 220M example parallel data used to train their model. + +
ModelSem. Sim.Bitext MiningQuest. Retrieval
Eng.XLXL (s.)XL (d.)TatoebaBUCC (c.)BUCC (m.)NQMKQAScore
Random Init. (24 Layer)
VMSST71.171.777.767.761.478.789.038.322.358.1
VMSST (fact.)67.369.976.365.763.077.990.437.321.557.2
VMSST (4 enc.)71.270.276.666.060.877.788.538.422.057.6
VMSST (12L dec.)71.170.977.466.761.278.488.838.022.257.8
VMSST (1L dec.)71.071.277.067.463.079.489.138.722.858.5
VMSST (no KL)70.768.776.263.756.970.886.637.821.555.7
VMSST (1 enc.)70.669.476.764.660.077.087.838.421.457.0
VMSST (no enc. l.e.)71.269.876.165.561.278.788.938.222.057.7
VMSST (no dec. l.e.)70.870.776.766.760.977.488.638.321.857.6
+ +Table 4: Ablations of VMSST. We investigate ablations involving factorization of the decoder projection layer (fact.), using 4 language encoders instead of 1 (4 enc.), using 12 layer (12L dec.) and 1 layer (1L dec.) decoders, using no KL term (no KL), using only a single encoder for both language and semantic variables (1 enc.), and using no encoder language embeddings (no enc. i.e.) or no decoder language embeddings (no dec. i.e.). + +
Modelde-enfr-enru-enzh-enAvg.
mUSE88.586.389.186.987.7
LASER95.492.492.391.292.8
XLM-R (NLI/STS-B)86.884.486.385.185.7
XLM-R (Para.)90.887.188.687.888.6
LaBSE95.992.592.493.093.5
VMSST94.391.091.892.892.5
+ +Table 5: Comparisons to related work on BUCC in accuracy $\times 100$ using the margin approach from Artetxe and Schwenk (2019a). Note that models in this table are not trained on the same data; for instance LaBSE was trained on substantially more parallel data and XLM-R (Para.) was trained using a large English paraphrase corpus in addition to parallel data. + +# 7 Analysis + +In this section, we analyze VMSST with additional experiments. We give a high-level overview in this section and put details and results in Appendix A. + +We first investigate different ablations of the model. We analyzed aspects such as factorizing the projection layer, using weaker decoders, using 4 language-specific encoders instead of 1, removing the KL term, using a single encoder for the semantic and language embeddings, and removing the language embeddings from the encoder and from the decoder. + +Secondly, we analyze the effect of the parameter sharing approximation in VMSST, where we train a full model with separate encoders and decoders for each language. This experiment uses data in 4 languages to make this experiment tractable. We found the performance to be similar enough that we can say the approximation holds, but there does remain a small gap. We hypothesize however, that this performance gap will shrink as the number of layers of the model increases. + +Thirdly, we evaluate the performance of zero-shot bitext mining on languages that were unseen in the training data. We find significant improvement in this setting over the baseline BITRANSLATION. Since BITRANSLATION can be seen as an ablation of VMSST, we see that the source-separation loss especially helps with generalization to new languages. + +Lastly, we investigate the impact of batch size on performance, comparing VMSST with CONTRASTIVE. It is common knowledge that contrastive models learn better representations when given harder negative examples, and bigger batch sizes increases the chances of finding these harder negatives. We experiment with batch sizes of 4096 and 8192, for both the 6 layer and 24 layer randomly initialized versions of CONTRASTIVE and VMSST. We find that both models improve when trained with larger batches, with the very best model being the 24 layer VMSST. + +# 8 Conclusion + +We present VMSST, a generative massively multilingual text embedding model trained to separate semantic information from language-specific information. VMSST also outperforms strong contrastive and generative baselines on a variety of tasks. There are several avenues for future work including alternative pretraining objectives that better fit the use case of the decoder, explore incorporating monolingual data into the generative objective, investigate synergy between VMSST and contrastive methods as they seem to specialize in different tasks, and lastly scale up to bigger models, more data, and languages to further investigate VMSST versus contrastive methods. + +# Limitations + +Some of our experiments, specifically those in the ablations with large batch sizes, required significant computational resources. We trained these models on Google Cloud TPUv3 Pod slice with 128 chips for a few days. This experiment is important, as otherwise there would be questions on how the models compare at large batch sizes where contrastive models are known to work better. Due to training costs and in the interest of open research, we will open source our code and model checkpoints for the community to use and build upon. + +Secondly, VMSST and BITRANSLATION require decoding which which means they need more memory for the decoder and are slower during training. However one advantage of these models is that they can be trained with gradient checkpointing greatly reducing their memory requirements, which cannot be used for the contrastive models as that would reduce the effective batch size for finding negative examples. Moreover, during inference, there is no difference in the memory or speed requirements in CONTRASTIVE, BITRANSLATION, or VMSST as only a single encoder is used in inference and there is no decoding. + +# Acknowledgements + +We are grateful to Livio Baldini-Soares, Wenhu Chen, Zhuyun Dai, Tom Kwiatkowski, Jianmo Ni, Slav Petrov, Jason Riesa, and Pat Verga for useful discussions during the course of the project. + +# 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, Denver, Colorado. Association for Computational Linguistics. +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, Dublin, Ireland. Association for Computational Linguistics. + +Eneko Agirre, Carmen Banea, Daniel Cer, Mona 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, San Diego, California. Association for Computational Linguistics. +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), pages 385–393, Montréal, Canada. Association for Computational Linguistics. +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, pages 32-43, Atlanta, Georgia, USA. Association for Computational Linguistics. +Mikel Artetxe and Holger Schwenk. 2019a. Margin-based parallel corpus mining with multilingual sentence embeddings. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 3197-3203, Florence, Italy. Association for Computational Linguistics. +Mikel Artetxe and Holger Schwenk. 2019b. Massively multilingual sentence embeddings for zero-shot cross-lingual transfer and beyond. Transactions of the Association for Computational Linguistics, 7:597-610. +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. +Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. 2020. A simple framework for contrastive learning of visual representations. In Proceedings of the International Conference of Machine Learning. +Zewen Chi, Shaohan Huang, Li Dong, Shuming Ma, Bo Zheng, Saksham Singhal, Payal Bajaj, Xia Song, Xian-Ling Mao, Heyan Huang, and Furu Wei. 2022. XLM-E: Cross-lingual language model pre-training via ELECTRA. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 6170–6182, Dublin, Ireland. Association for Computational Linguistics. + +Cristina Espana-Bonet, Adám Csaba Varga, Alberto Barrón-Cedeno, and Josef van Genabith. 2017. An empirical analysis of nmt-derived interlingual embeddings and their use in parallel sentence identification. IEEE Journal of Selected Topics in Signal Processing, 11(8):1340-1350. +Fangxiaoyu Feng, Yinfei Yang, Daniel Cer, Naveen Arivazhagan, and Wei Wang. 2022. Language-agnostic BERT sentence embedding. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 878-891, Dublin, Ireland. Association for Computational Linguistics. +Koustava Goswami, Sourav Dutta, Haytham Assem, Theodorus Fransen, and John P. McCrae. 2021. Cross-lingual sentence embedding using multi-task learning. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 9099–9113, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Mandy Guo, Qinlan Shen, Yinfei Yang, Heming Ge, Daniel Cer, Gustavo Hernandez Abrego, Keith Stevens, Noah Constant, Yun-Hsuan Sung, Brian Strope, and Ray Kurzweil. 2018. Effective parallel corpus mining using bilingual sentence embeddings. In Proceedings of the Third Conference on Machine Translation: Research Papers, pages 165-176, Brussels, Belgium. Association for Computational Linguistics. +Junxian He, Daniel Spokoyny, Graham Neubig, and Taylor Berg-Kirkpatrick. 2019. Lagging inference networks and posterior collapse in variational autoencoders. arXiv preprint arXiv:1901.05534. +Karl Moritz Hermann and Phil Blunsom. 2014. Multilingual models for compositional distributed semantics. In Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 58-68, Baltimore, Maryland. Association for Computational Linguistics. +Vladimir Karpukhin, Barlas Oguz, Sewon Min, Patrick Lewis, Ledell Wu, Sergey Edunov, Danqi Chen, and Wen-tau Yih. 2020. Dense passage retrieval for open-domain question answering. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 6769-6781, Online. Association for Computational Linguistics. +Yoon Kim, Sam Wiseman, Andrew Miller, David Sontag, and Alexander Rush. 2018. Semi-amortized variational autoencoders. In International Conference on Machine Learning, pages 2678-2687. PMLR. +Diederik P Kingma and Max Welling. 2013. Autoencoding variational bayes. arXiv preprint arXiv:1312.6114. +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. +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. +Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. 2020a. BART: Denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7871-7880, Online. Association for Computational Linguistics. +Patrick Lewis, Ethan Perez, Aleksandra 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. Advances in Neural Information Processing Systems, 33:9459-9474. +Patrick Lewis, Yuxiang Wu, Linqing Liu, Pasquale Minervini, Heinrich Kuttler, Aleksandra Piktus, Pontus Stenetorp, and Sebastian Riedel. 2021. PAQ: 65 million probably-asked questions and what you can do with them. Transactions of the Association for Computational Linguistics, 9:1098-1115. +Pierre Lison, Jörg Tiedemann, and Milen Kouylekov. 2018. OpenSubtitles2018: Statistical rescoring of sentence alignments in large, noisy parallel corpora. In Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC 2018), Miyazaki, Japan. European Language Resources Association (ELRA). +Shayne Longpre, Yi Lu, and Joachim Daiber. 2021. MKQA: A linguistically diverse benchmark for multilingual open domain question answering. Transactions of the Association for Computational Linguistics, 9:1389-1406. +Qi Qian, Lei Shang, Baigui Sun, Juhua Hu, Hao Li, and Rong Jin. 2019. Softtriple loss: Deep metric learning without triplet sampling. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 6450-6458. +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, volume 139 of Proceedings of Machine Learning Research, pages 8748-8763. PMLR. +Milos Radovanovic, Alexandros Nanopoulos, and Mirjana Ivanovic. 2010. Hubs in space: Popular nearest neighbors in high-dimensional data. Journal of Machine Learning Research, 11(sept):2487-2531. +Milos Radovanovic, Alexandros Nanopoulos, and Mirjana Ivanović. 2010. On the existence of obstinate results in vector space models. In Proceedings of the 33rd international ACM SIGIR conference on Research and development in information retrieval, pages 186-193. +Alexandre Rafalovitch and Robert Dale. 2009. United Nations general assembly resolutions: A six-language parallel corpus. In Proceedings of Machine Translation Summit XII: Posters, Ottawa, Canada. +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. +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. +Holger Schwenk. 2018. Filtering and mining parallel data in a joint multilingual space. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 228-234, Melbourne, Australia. Association for Computational Linguistics. +Holger Schwenk and Matthijs Douze. 2017. Learning joint multilingual sentence representations with neural machine translation. In Proceedings of the 2nd Workshop on Representation Learning for NLP, pages 157-167, Vancouver, Canada. Association for Computational Linguistics. +Noam Shazeer and Mitchell Stern. 2018. Adafactor: Adaptive learning rates with sublinear memory cost. In International Conference on Machine Learning, pages 4596-4604. PMLR. +Karan Singla, Dogan Can, and Shrikanth Narayanan. 2018. A multi-task approach to learning multilingual representations. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 214-220, Melbourne, Australia. Association for Computational Linguistics. +Kihyuk Sohn. 2016. Improved deep metric learning with multi-class n-pair loss objective. Advances in neural information processing systems, 29. + +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 Advances in Neural Information Processing Systems, pages 5998-6008. +Jason Weston, Samy Bengio, and Nicolas Usunier. 2010. Large scale image annotation: learning to rank with joint word-image embeddings. Machine learning, 81(1):21-35. +John Wieting, Mohit Bansal, Kevin Gimpel, and Karen Livescu. 2016. Towards universal paraphrastic sentence embeddings. In Proceedings of the International Conference on Learning Representations. +John Wieting, Kevin Gimpel, Graham Neubig, and Taylor Berg-Kirkpatrick. 2019. Simple and effective paraphrastic similarity from parallel translations. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4602-4608, Florence, Italy. Association for Computational Linguistics. +John Wieting, Graham Neubig, and Taylor Berg-Kirkpatrick. 2020. A bilingual generative transformer for semantic sentence embedding. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1581-1594, Online. Association for Computational Linguistics. +Jiacheng Xu and Greg Durrett. 2018. Spherical latent spaces for stable variational autoencoders. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 4503-4513, Brussels, Belgium. Association for Computational Linguistics. +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. +Yinfei Yang, Daniel Cer, Amin Ahmad, Mandy Guo, Jax Law, Noah Constant, Gustavo Hernandez Abrego, Steve Yuan, Chris Tar, Yun-hsuan Sung, Brian Strope, and Ray Kurzweil. 2020. Multilingual universal sentence encoder for semantic retrieval. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics: System Demonstrations, pages 87-94, Online. Association for Computational Linguistics. +Zichao Yang, Zhiting Hu, Ruslan Salakhutdinov, and Taylor Berg-Kirkpatrick. 2017. Improved variational autoencoders for text modeling using dilated convolutions. In International Conference on Machine Learning, pages 3881-3890. JMLR.org. + +Pierre Zweigenbaum, Serge Sharoff, and Reinhard Rapp. 2018. Overview of the third bucc shared task: Spotting parallel sentences in comparable corpora. In Proceedings of 11th Workshop on Building and Us ing Comparable Corpora, pages 39-42. + +# Appendices accompanying “Beyond Contrastive Learning: A Variational Generative Model for Multilingual Retrieval” + +# A Analysis + +# A.1 Model Ablations + +In this section, we investigate different ablations of VMSST. The ablations are shown in Table 4. We start from the 24 layer randomly initialized VMSST, and change it to see how certain hyperparameters and model choices affect performance. + +Our first experiment, VMSST (fact.) investigates what happens if we simply factor the final projection layer of the decoder. This can save a lot of memory in the model, as that projection layer is $3 \times d \times V$ where $d$ is the hidden state dimension size and $V$ is the size of the vocabulary. $^{13}$ If we factor the projection layer, we can reduce the space to $d \times V + 3d \times d$ . In practice, this saves about 509 million parameters for our 24 layer models. However from the first row in Table 4, we see that this small change has a significant effect on performance, weakening results on semantic similarity and question retrieval tasks and strengthening results on bitext mining tasks. + +In our second ablation, VMSST (4 enc.), we spread the model capacity of the language-specific encoder to 4 encoders, instead of the single encoder in our previous experiments. We allocate the languages randomly to the different encoders. We find that this doesn't improve results, perhaps because the 24 layer model has sufficient capacity to model all of the languages in one shared encoder. We could allocate languages to encoders based on language families, and perhaps this could fare better, but we leave that for future work. + +Prior work (Wieting et al., 2020) shows that, a decoder that is weaker (i.e. less layers) can lead to stronger embeddings. This effect is presumably because there is more pressure on the sentence embedding to fully and clearly capture the semantics since it cannot rely on a strong decoder to fill in gaps. We found that that using a weaker single layer decoder (1L dec.), does indeed seem to improve performance. We also tried a 12 layer ablation (12L dec.), but that seemed to not have a significant improvement in the results. + +The last four ablations investigate different modelling choices. In the first we eliminate the KL term (no KL), which has the most significant effect on performance, especially on cross-lingual tasks. In the second ablation, we use a single encoder instead of the twin encoders (1 enc.), one for semantic embeddings and one for language embeddings, we find that this has a modest overall effect on performance. Lastly, we eliminate the language embeddings. First we remove the language embedding inputs to the decoder (no enc. l.e.), then we experiment by removing the input language embeddings to the language-specific encoder (no dec. l.e.). We find these language embeddings have a smaller than expected impact on performance, perhaps because the large capacity of the decoder can ascertain the language being input or decoded. + +# A.2 Testing the Parameter Sharing in VMSST + +Parameter sharing was needed in order efficiently perform source separation on $N$ languages. Specifically we collapsed the language encoders into a single encoder and we collapsed the decoders into a single decoder. The VMSST approximates having $N$ language encoders by using an input embedding to indicate the language being considered. The same strategy is applied with the decoders as well, with the first input token to the decoder indicating the language to be generated. + +In this section, we investigate what effect this parameter sharing has on VMSST by using $N$ encoders and decoders (full enc, full dec.). We experiment with 6 layer Transformer encoders and 4 languages Spanish, English, Arabic, and Turkish in order to keep the experiments tractable as in this setting we have 5 encoders and 4 decoders. The results are shown in Table 6. + +The results indicate that the approximation appears to hold, as VMSST is much closer to the full model than BITRANSLATION, which is an ablation of VMSST without the source separation. However, there is still a gap between the full encoder/decoder of VMSST and VMSST. We hypothesize however, that as the number of layers of the model increases, this performance gap also shrinks. The extra capacity of these layers will allow for the model to separate language-specific variations without having separate parameters for each language. Evidence for this hypothesis is in Table 4 where having the language variation shared + +
ModelEng.Sem. Sim.Bitext MiningQuest. RetrievalScore
XLTatoebaNQMKQA
--ar-enar-ares-enes-estr-enarestr-arestr
Random Init. (6 Layer) - ar, en, es, tr
CONTRASTIVE68.681.768.568.364.869.797.988.298.136.424.613.022.6
BITRANSlation69.082.463.157.858.767.397.684.396.437.825.412.221.1
VMSST70.683.165.963.162.168.897.984.997.238.127.214.424.1
VMSST (full enc., full dec.)70.382.365.660.062.867.998.487.997.839.027.214.724.2
+ +Table 6: Comparison of VMSST with a variation that has no parameter sharing, VMSST (full enc., full dec.). We experiment on 4 languages, so we have 5 encoders and 4 decoders. + +amongst 4 encoders instead of 1 actually appears to weaken performance overall. + +# A.3 Zero-Shot Bitext Mining + +The Tatoeba dataset contains parallel sentence pairs of English with 112 languages. Our model is trained using 93 of these languages, and therefore there are 19 languages we can use for a zero-shot evaluation of bitext mining. Table 8 summarizes the results of this zero-shot evaluation for the two generation objectives, BITRANSLATION and VMSST considered in this paper. The results are shown in Table 8. We also compute $\Delta$ which is the difference between the performance gap of VMSST and BITRANSLATION on the seen and unseen languages. From the results, we see that VMSST does even better than BITRANSLATION on unseen languages than unseen languages. Since BITRANSLATION can be seen as an ablation of VMSST, i.e. VMSST without the source-separation loss, we see that the source-separation loss especially helps with generalization to new languages. + +# A.4 Effects of Batch Size + +Lastly, we investigate how VMSST compares to CONTRASTIVE as batch size increases. It is common knowledge that contrastive models learn better representations when given harder negative examples. Since we are using in-batch negatives in our contrastive baseline, the increased batch size increases the chances of encountering harder negative examples and will generally increase performance up to the point where the negatives become false. Furthermore, bigger batch sizes are known to also improve results in models using the Transformer architecture, presumably due to less noisy gradients, which would improve the results of both CONTRASTIVE and VMSST. It is important to note that using bigger batch sizes, means seeing + +more examples (100,000 steps at a batch size of 2048 is about 1 pass through the data). However, parallel data is so numerous that training to convergence on the available data is not very practical. Therefore, these experiments do not separate out the gains from using a bigger batch size versus seeing more training data, but we argue that is not an important distinction to make due to the sheer amount (billions of pairs) of parallel data available. + +We experiment with batch sizes of 4096 and 8192, double and quadruple the 2048 used in all experiments up to this point, for both the 6 layer and 24 layer randomly initialized versions of CONTRASTIVE and VMSST. All models are trained again for 100,000 steps. The results are shown in Table 7. + +From the results, we see that for the 6 layer model, increasing the batch size equalizes VMSST and CONTRASTIVE overall, however each performs better at different tasks. CONTRASTIVE has better performance on Tatoeba, XL semantic similarity, and BUCC with margin (Artetxe and Schwenk, 2019a), where VMSST has better performance on English semantic similarity, BUCC with cosine similarity, and the retrieval tasks. For the 24 layer variations, VMSST is better at every task, with the exception of Tatoeba, and has the highest overall score of any model in the table. The 24 layer CONTRASTIVE variation does not perform as well as the 6 layer version at any batch size, in contrast to VMSST where the 24 layer model always outperforms the 6 layer variation. + +# B Full Experimental Results + +We include full results for our models using the pre-trained mT5 large checkpoint. We evaluate on English semantic similarity, Cross-lingual semantic similarity, question retrieval, and bitext mining. + +
ModelB. SizeSem. Sim.Bitext MiningQuest. Retrieval
Eng.XLXL (s.)XL (d.)TatoebaBUCC (c.)BUCC (m.)NQMKQAScore
Random Init. (6 Layer)
CONTRASTIVE204865.566.873.362.463.164.782.934.017.653.5
409667.569.375.465.366.071.587.035.319.256.1
819269.471.676.868.168.676.289.436.420.958.3
VMSST204870.167.475.162.258.772.684.737.220.255.4
409670.267.475.362.158.573.186.038.220.355.7
819271.470.976.667.161.877.988.039.022.458.1
Random Init. (24 Layer)
CONTRASTIVE204864.464.671.660.062.762.882.532.816.052.2
409666.668.675.164.365.770.986.834.718.155.4
819268.070.276.266.267.774.288.335.219.457.0
VMSST204871.171.777.767.761.478.487.838.322.358.0
409672.072.177.768.362.981.089.738.723.559.1
819272.774.179.070.864.182.090.239.024.360.1
+ +Table 7: Comparison of CONTRASTIVE and VMSST using different batch sizes during training. + +
ModelTat. (seen)Tat. (unseen)Δ
Random Init. (6 Layer)
BITRANSlation59.324.0-
VMSST64.430.61.5
Random Init. (24 Layer)
BITRANSlation82.656.5-
VMSST84.962.23.4
Pretrained (24 Layer)
BITRANSlation63.726.5-
VMSST67.332.62.5
+ +Table 8: Results on languages seen during training (seen) and languages that were not seen during training (unseen) on the Tatoeba dataset. + +# B.1 Semantic Similarity + +For English semantic similarity, we use the SemEval semantic textual similarity (STS) tasks from 2012 to 2016 (Agirre et al., 2012, 2013, 2014, 2015, 2016) as was done initially for sentence embeddings in (Wieting et al., 2016). As our test set, we report the average Pearson's $r$ over each year of the STS tasks from 2012-2016 as is convention in the top part of Table 9. However, some recent work, like Reimers and Gurevych (2019) computed Spearman's $\rho$ over concatenated datasets for each year of the STS competition. To be consistent with these works, we also include evaluations using this approach in the bottom part of Table 9. One other difference between these two ways of calculating the results is the inclusion of the SMT dataset of the 2013 task. When computing the results using Pearson's $r$ , this dataset is included, but when + +computing the results using Spearman's $\rho$ , it is not included. + +For cross-lingual semantic similarity and semantic similarity in non-English languages, we evaluate on the STS tasks from SemEval 2017. This evaluation contains Arabic-Arabic, Arabic-English, Spanish-Spanish, Spanish-English, and Turkish-English datasets. The datasets were created by translating one or both pairs of an English STS pair into Arabic (ar), Spanish (es), or Turkish (tr). Following convention, we report results with Pearson's $r$ for all systems, but also include results in Spearman's $\rho$ in Table 10. + +# B.2 Question Retrieval + +For our question retrieval evaluation, we report the accuracy $(\mathbb{R}@\mathbb{1})$ on the test sets of Natural Questions (NQ) (Kwiatkowski et al., 2019) shown in Table 11 and the Multilingual Knowledge Questions and Answers (MKQA) (Longpre et al., 2021) shown in Table 12. We use the the Probably Asked Questions dataset (PAQ) (Lewis et al., 2021) as a knowledge base from which we look up the nearest neighbor of each question in the NQ and MKQA test sets using cosine similarity. + +# B.3 Bitext Mining + +For bitext mining, we use the Tatoeba dataset introduced in Artetxe and Schwenk (2019b) and the 2018 Building and Using Parallel Corpora (BUCC) shared bitext mining task (Zweigenbaum et al., 2018). + +The Tatoeba dataset consists of 100-1000 pairs + +
ModelEnglish Semantic Similarity
20122013201420152016
CONTRASTIVE69.761.176.481.477.7
BITRANSLATION69.163.676.481.079.9
VMSST CONTRASTIVE70.261.676.581.377.5
VMSST70.564.376.581.680.1
CONTRASTIVE68.074.969.179.976.9
BITRANSLATION70.777.972.281.879.7
VMSST CONTRASTIVE68.475.169.280.276.8
VMSST72.777.972.782.179.2
+ +Table 9: Full results on English STS. In the first part of the table, we show results, measured in Pearson's $r \times 100$ , for each year of the STS tasks 2012-2016 as well as the average performance across all years. In the second part, we evaluate based on the Spearman's $\rho \times 100$ of the concatenation of the datasets of each year with the 2013 SMT dataset removed following (Reimers and Gurevych, 2019). + +
ModelCross-Lingual Semantic Similarity
ar-arar-enes-eses-entr-en
CONTRASTIVE72.472.272.774.279.781.071.772.077.277.0
BITRANSLATION75.676.077.078.684.084.876.277.277.377.5
VMSST CONTRASTIVE73.273.173.575.180.281.372.472.477.878.0
VMSST77.678.178.578.885.585.777.077.477.077.0
+ +Table 10: Full results on Cross-Linguual STS. We report results using both Pearson's $r \times 100$ and Spearman's $\rho \times 100$ across datasets, where Pearson's $r \times 100$ is the first column for each language pair and Spearman's $\rho \times 100$ is the second column. + +
ModelNQ
CONTRASTIVE40.2
BITRANSLATION40.9
VMSST CONTRASTIVE40.3
VMSST40.8
+ +Table 11: Full results on question retrieval on the NQ data. We evaluate retrieval accuracy $\times 100$ using PAQ as a question knowledge base. + +of data aligned to English for 112 languages. The accuracy for Tatoeba can be computed in two ways, depending if English is the target language or source language. We compute accuracy using cosine similarity in both directions for all 112 languages (19 are unseen in the training data) and average this score for all languages. + +The goal of the BUCC task is to find the gold aligned parallel sentences given two corpora (one being very large) in two distinct languages. Languages are aligned with English and consist of German (de), French (fr), Russian (ru), and Chinese (zh). Following Schwenk (2018), we evaluate on the publicly available BUCC data. This involves scoring all pairs between the source target + +sentences and finding the optimal threshold that separates the data. Using the threshold, we can compute the precision, recall, and $F_{1}$ of the alignments. We report $F_{1} \times 100$ in our results. + +We compare two different approaches for finding the sentence alignments. In the first, BUCC (cosine), we compute the cosine similarity between the non-English source sentences and the English target sentences, selecting the highest scoring English sentence as the match. In the second, BUCC (margin), we follow Artetxe and Schwenk (2019a) and use a margin-based scoring approach. + +# C Full Training Data + +We follow Artetxe and Schwenk (2019b) in constructing our training data, sampling data from Europarl, $^{14}$ , United Nations (Rafalovitch and Dale, 2009), $^{15}$ OpenSubtitles2018 (Lison et al., 2018), $^{16}$ , Global Voices, $^{17}$ Tanzil, $^{18}$ and Tatoeba v2021-07- + +14http://opus.nlpl.eu/Europarl.php +15https://opus.nlpl.eu/UN.php +16http://opus.nlpl.eu/OpenSubtitles.php +17https://opus.nlp1.eu/GlobalVoices.php +18https://opus.nlpl.eu/Tanzil.php + +22.19 + +The only deviation from their data sampling approach is that we take care to not include any Tatoeba test data in our training data. Our final corpus has nearly 216 million training examples, slightly less than 220 million reported in Artetxe and Schwenk (2019b). We use both English and Spanish as pivot languages, so each pair includes at least one English or Spanish sentence, and attempt to use approximately the same amount of data for each language if possible. We note that we only have training data for 92 languages instead of the 93 in Artetxe and Schwenk (2019b) due to not having training data for Aymara (ay). The full amount of English and Spanish parallel data used for each of the 92 languages is reported in Table 15. + +
Model +LanguageardadeenesMKQA
fifrhehuitjakm
CONTRASTIVE21.430.429.233.230.427.730.024.426.929.424.223.6
BITRANSLATION19.430.830.529.828.729.728.030.327.527.926.223.4
VMSST CONTRASTIVE24.632.030.533.431.629.830.927.928.931.027.324.9
VMSST21.432.132.531.530.331.330.031.929.930.029.925.9
Languagekomsnlnoplptrusvthtrvizh
CONTRASTIVE22.030.529.433.230.427.730.024.827.529.624.624.2
BITRANSLATION19.430.830.930.029.230.228.130.428.028.326.923.7
VMSST CONTRASTIVE25.332.330.633.431.530.131.028.129.931.127.724.9
VMSST22.032.432.831.631.031.630.432.230.430.230.426.2
+ +Table 12: Full results on question retrieval on the MKQA data. We evaluate retrieval accuracy $\times 100$ using PAQ as a question knowledge base. + +
ModelCosineMargin
defrruzhdefrruzh
CONTRASTIVE84.681.366.664.496.293.792.193.0
BiTRANSLATION90.185.584.184.193.690.391.392.4
VMSST CONTRASTIVE84.881.967.464.496.193.692.192.9
VMSST91.586.886.786.194.391.091.892.8
+ +Table 13: Full results on BUCC. We report results using both cosine similarity and the margin approach from (Artetxe and Schwenk, 2019a). Results are reported as $F_{1} \times 100$ . + +
Languageaframhangaraarqarzastawaazebelbenberbosbrebulcat
CONTRASTIVE97.694.966.895.061.886.191.374.095.896.892.480.497.547.296.497.8
BITRANSLATION94.884.242.994.042.080.380.356.391.395.091.072.696.818.995.396.8
VMSST CONTRASTIVE97.493.570.594.764.285.790.976.095.897.292.881.697.347.996.297.8
VMSST95.688.153.494.650.284.786.264.393.595.691.979.097.026.195.897.0
Languagecbkcebceschacmncorcsbcymdandeudsbdtpellepoesteus
CONTRASTIVE86.162.398.344.997.535.167.857.697.399.675.418.997.498.698.696.9
BITRANSLATION78.048.897.333.695.618.448.637.096.099.353.18.395.898.397.894.8
VMSST CONTRASTIVE86.963.798.244.297.737.669.856.497.299.676.920.397.298.498.897.1
VMSST83.752.897.938.096.423.356.143.096.899.263.210.297.098.298.295.4
Languagefaofinfrafryglggleglggswhebhinhrvhsbhunhyeidoile
CONTRASTIVE90.398.096.488.258.480.498.652.193.898.198.580.198.496.293.092.8
BITRANSLATION78.297.895.880.135.660.696.844.993.096.496.858.696.495.287.986.7
VMSST CONTRASTIVE91.098.296.687.955.779.598.653.893.798.098.482.498.296.194.493.1
VMSST82.698.096.083.539.462.797.450.493.897.597.568.996.894.791.990.2
Languageinaindislitajavjpnkabkatkazkhmkorkurkzjlatlfnlit
CONTRASTIVE96.897.097.096.674.198.371.795.692.887.895.276.317.489.983.698.2
BITRANSLATION94.995.296.396.262.996.860.893.986.185.492.560.58.883.974.697.5
VMSST CONTRASTIVE97.296.997.196.676.198.673.396.292.387.595.876.017.889.884.198.1
VMSST96.495.896.896.869.597.267.395.887.786.393.567.711.786.579.097.8
Languagelvsmalmarmaxmhrmkdmonndsnldnnonobnovociorvpampes
CONTRASTIVE98.098.594.573.130.897.694.490.598.196.598.580.577.966.514.095.5
BITRANSLATION97.098.295.058.122.196.085.880.796.792.397.470.666.547.58.593.0
VMSST CONTRASTIVE98.198.594.672.529.598.095.092.198.097.098.380.578.067.414.695.7
VMSST97.598.395.063.626.896.489.884.597.393.597.676.372.155.99.994.5
Languagepmspolporronrusslkslvspasqisrpsweswgswhtamtattel
CONTRASTIVE74.399.095.998.095.398.097.099.198.696.697.576.877.492.792.098.1
BITRANSLATION62.197.295.797.695.097.496.398.898.195.696.848.767.190.982.896.2
VMSST CONTRASTIVE76.998.996.198.195.598.297.099.298.696.597.573.277.692.892.097.6
VMSST69.698.295.897.694.897.896.998.698.295.897.359.869.292.886.297.4
Languagetglthatukturtzluigukrurduzbviewarwuuxhoyidyuezsm
CONTRASTIVE96.097.844.698.966.376.196.095.478.998.254.093.574.692.394.198.0
BITRANSLATION91.797.030.398.243.854.495.291.864.397.433.388.759.582.890.896.0
VMSST CONTRASTIVE96.498.247.598.964.477.696.395.478.398.454.593.875.792.694.197.8
VMSST93.097.538.798.856.764.195.593.568.797.937.791.063.786.093.096.6
+ +Table 14: Full results on Tatoeba. We report results as accuracy $\times 100$ + +
Languageafamarayazbeberbg
Training Pairs77,772101,6137,907,9140291,9256,330142,0614,834,661
Languagebnbrbscacbkcsdade
Training Pairs1,148,46134,4724,166,739895,9401,6235,429,0607,767,1198,707,293
Languagedtpdveleneoeseteu
Training Pairs1,06498,3206,601,9894,913,379447,6224,913,3795,093,0031,432,979
Languagefifrgaglhahehihr
Training Pairs7,785,4938,935,8421,112391,824134,7754,046,554358,9073,911,368
Languagehuhyiaidieioisit
Training Pairs5,256,2148,19412,0484,326,1512,4453,1812,712,5568,468,538
Languagejakakabkkkmkokukw
Training Pairs3,981,886360,13626,4606,1723,2662,566,49598,7333,463
Languagekzjlalfnltlvmgmhrmk
Training Pairs61427,5156,0963,629,7692,119,995537,953694,037,896
Languagemlmrmsmynbndsnloc
Training Pairs867,02652,3403,288,4924,8029,6946,2638,346,102730
Languageplpsptrorusdsisk
Training Pairs5,407,190328,276,1904,814,0469,416,93498,4121,016,6605,094,752
Languageslsosqsrsvswtate
Training Pairs5,099,57798,9763,619,9143,977,1917,680,683201,379150,02342,877
Languagetgthtltrttugukur
Training Pairs135,2453,849,77734,8295,854,059132,273101,9891,687,685844,052
Languageuzviwuuyuezh
Training Pairs148,8603,905,4019294,5257,636,488
+ +Table 15: Full training data for each language. The total number of pairs is the sum of using English and Spanish as pivot languages. + +A For every submission: + +A1. Did you describe the limitations of your work? + +In the Limitations section 8. + +A2. Did you discuss any potential risks of your work? + +This is textual similarity model that does not generate text, trained on publicly available bitext. It does not carry any novel risks from previous generic textual embedding models. + +A3. Do the abstract and introduction summarize the paper's main claims? + +Introduction is Section 1. + +A4. Have you used AI writing assistants when working on this paper? + +Left blank. + +B Did you use or create scientific artifacts? + +Yes, Appendix H. + +B1. Did you cite the creators of artifacts you used? + +Yes, Appendix H. + +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? + +They all have licenses applicable to academic publishing and model release. + +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +No need for discussion as our use (academic research) is consistent with the implied intended use of these datasets. + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? + +These are well-studied standard academic translation datasets - there is no PII info and little offensive content (possibly in the subtitles data for the latter). + +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? + +Appendix H + +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. + +Section 6. + +# C Did you run computational experiments? + +Section 6. + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +Section 6 and Section 8. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +Appendix B + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +Appendix B + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +Appendix B + +# D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +No response. + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +No response. + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +No response. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +No response. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +No response. \ No newline at end of file diff --git a/beyondcontrastivelearningavariationalgenerativemodelformultilingualretrieval/images.zip b/beyondcontrastivelearningavariationalgenerativemodelformultilingualretrieval/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d3efb9f02dc4beaab567c389bdda6c5de8e9d915 --- /dev/null +++ b/beyondcontrastivelearningavariationalgenerativemodelformultilingualretrieval/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ab2c24e2168a4f9e80000b1fdc4dedc01937c9e40d053c560d6859c0a9548eb3 +size 1246751 diff --git a/beyondcontrastivelearningavariationalgenerativemodelformultilingualretrieval/layout.json b/beyondcontrastivelearningavariationalgenerativemodelformultilingualretrieval/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..63ccb83b5b537048a6f2b0f18a9049c3ce453a4f --- /dev/null +++ b/beyondcontrastivelearningavariationalgenerativemodelformultilingualretrieval/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6ddcf88b9387a1c978816d80d6e5cd63331b6f084750dc65b728eff66a8bc695 +size 617767 diff --git a/beyondenglishcentricbitextsforbettermultilinguallanguagerepresentationlearning/242dda9b-ec5e-4e7a-b2e8-a0a4398cfa5b_content_list.json b/beyondenglishcentricbitextsforbettermultilinguallanguagerepresentationlearning/242dda9b-ec5e-4e7a-b2e8-a0a4398cfa5b_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..6b2c7cc20fab3d379b21fff5b4d8e2e9ebd41433 --- /dev/null +++ b/beyondenglishcentricbitextsforbettermultilinguallanguagerepresentationlearning/242dda9b-ec5e-4e7a-b2e8-a0a4398cfa5b_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1b2abed5b8a440ee57ef2ac8adb7dbae6293b2498a3e0cb1c96b9a0d045815ba +size 132120 diff --git a/beyondenglishcentricbitextsforbettermultilinguallanguagerepresentationlearning/242dda9b-ec5e-4e7a-b2e8-a0a4398cfa5b_model.json b/beyondenglishcentricbitextsforbettermultilinguallanguagerepresentationlearning/242dda9b-ec5e-4e7a-b2e8-a0a4398cfa5b_model.json new file mode 100644 index 0000000000000000000000000000000000000000..ddfffedd693fee3f67704d6757d8cc4732a56a64 --- /dev/null +++ b/beyondenglishcentricbitextsforbettermultilinguallanguagerepresentationlearning/242dda9b-ec5e-4e7a-b2e8-a0a4398cfa5b_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:58311a54cb1f11722d39f41d0e9ac0867ed78389de660bd6ff8209f8f5d82972 +size 156237 diff --git a/beyondenglishcentricbitextsforbettermultilinguallanguagerepresentationlearning/242dda9b-ec5e-4e7a-b2e8-a0a4398cfa5b_origin.pdf b/beyondenglishcentricbitextsforbettermultilinguallanguagerepresentationlearning/242dda9b-ec5e-4e7a-b2e8-a0a4398cfa5b_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..b6498bba5302c6a801c55eb2d712255b2062dc2b --- /dev/null +++ b/beyondenglishcentricbitextsforbettermultilinguallanguagerepresentationlearning/242dda9b-ec5e-4e7a-b2e8-a0a4398cfa5b_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b243bf137f3ce4e9bdcf36dc779bf5da7b74d94d6b7df9cc4fc5a74b1f9b7b11 +size 763498 diff --git a/beyondenglishcentricbitextsforbettermultilinguallanguagerepresentationlearning/full.md b/beyondenglishcentricbitextsforbettermultilinguallanguagerepresentationlearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..3db1f25f5ae9e54324e9aa45107d179d72019434 --- /dev/null +++ b/beyondenglishcentricbitextsforbettermultilinguallanguagerepresentationlearning/full.md @@ -0,0 +1,404 @@ +# Beyond English-Centric Bitexts for Better Multilingual Language Representation Learning + +Barun Patra*, Saksham Singhal*, Shaohan Huang*, Zewen Chi, Li Dong, Furu Wei, Vishrav Chaudhary, Xia Song Microsoft + +{bapatra, saksingh, shaohanh, v-zewenchi, lidong1, fuwei, vchaudhary, xiao}@microsoft.com + +# Abstract + +In this paper, we elaborate upon recipes for building multilingual representation models that are not only competitive with existing state-of-the-art models but are also more parameter efficient, thereby promoting better adoption in resource-constrained scenarios and practical applications. We show that going beyond English-centric bittexts, coupled with a novel sampling strategy aimed at reducing under-utilization of training data, substantially boosts performance across model sizes for both Electra and MLM pre-training objectives. We introduce XY-LENT: X-Y bitext enhanced Language ENcodings using Transformers which not only achieves state-of-the-art performance over 5 cross-lingual tasks within all model size bands, is also competitive across bands. Our XYLENTXL variant outperforms XLM-RXXL and exhibits competitive performance with mT5XXL while being 5x and 6x smaller respectively. We then show that our proposed method helps ameliorate the curse of multilinguality, with the XYLENTXL achieving $99.3\%$ GLUE performance and $98.5\%$ SQuAD 2.0 performance compared to a SoTA English only model in the same size band. We then analyze our models performance on extremely low resource languages and posit that scaling alone may not be sufficient for improving the performance in this scenario. + +# 1 Introduction + +Recent advancements in Natural Language Processing (NLP) have been a direct consequence of leveraging foundational models (Bommasani et al., 2021), pretrained on a large text corpora in a self-supervised fashion. This has also been the case for multilingual NLP where pre-trained models like multilingual BERT (mBERT) (Devlin, 2018; Devlin et al., 2019), XLM (Conneau and Lample, 2019), XLM-Roberta (Conneau et al., 2020), XLM-Electra (Chi et al., 2022) and mT5 (Xue et al., 2021) + +![](images/a26f2f933a2c084c0aaed389d576c2d3572cbc9b7f1e7c755412b05fae6b0288.jpg) +Figure 1: The proposed XY-LENT model (green line) achieves SoTA performance within all band sizes and is competitive performance across larger model-size bands. The parameter efficiency of XY-LENT $_{XL}$ particularly stands out, outperforming XLM- $\mathbf{R}_{\mathrm{XXL}}$ and being competitive with mT5 $_{\mathrm{XXL}}$ while being 5x and 6x smaller than them respectively. We also present the performance of XLM-E which used as a baseline in this paper. + +have all shown non-trivial performance gains, especially in the setup of zero-shot transfer, and have been the work-horse for a diverse number of multilingual tasks. Given their ubiquitous applicability in zero-shot downstream scenarios, improving the quality and enabling their usage in resource-constrained applications is also an important vein of research which we explore in this paper. + +A source of improvement for these models has been leveraging bitext data for better representation learning (Conneau and Lample, 2019; Chi et al., 2022). Most prior work, however, has focused on leveraging English-centric $(EN-X)$ bitext data. Contemporaneously, the related area of Massively Multilingual Machine Translation (a single model for translating between different pairs of languages, eg: Aharoni et al. (2019); Zhang et al. (2020); Fan + +et al. (2021)) has shown tremendous progress, with Fan et al. (2021) showing that a crucial aspect of this improvement has been moving beyond EN-X parallel corpora and leveraging web-based mined X-Y bitexts spanning 1000s of translation directions (Schwenk et al., 2021a; El-Kishky et al., 2020; Schwenk et al., 2021b). This makes a compelling case to explore if leveraging X-Y bitexts can also improve multilingual representation learning. + +In this work, we introduce XY-LENT (pro-nounced as "Excellent"): $X - Y$ bitext enhanced Language ENcodings using Transformers. We first identify problems with using the commonly used sampling strategy proposed in Fan et al. (2021), showing that it induces sparse sampling distributions leading to under-utilization of data, and thus propose a novel strategy to mitigate this issue ( $\S 3.2$ ). We then propose leveraging $X - Y$ bitexts in conjunction with the improved sampling strategy, as well as a VoCAP (Zheng et al., 2021) style sentencepiece vocabulary re-construction for improving multilingual representation learning ( $\S 3.1$ ). We show that our proposed method improves performance across all model size bands ( $\S 6$ ). Furthermore, these performance gains hold for both Masked Language Models (MLM) and ELECTRA style models. Our approach results in an almost $12x$ speedup in training for MLM model training ( $\S 6.2$ ). We systematically analyse the impact of model scaling with respect to the curse of multilinguality (Conneau et al., 2020) to observe that the gap between current English only SoTA models and multilingual models can be considerably reduced ( $\S 6.3$ ). Our analysis reveals that XY-LENT improves performance across language families ( $\S 6.4$ ) and helps reduce the cross-lingual transfer gap in multilingual tasks ( $\S 6.5$ ). We then demonstrate that the training dynamics of such models can be used to better understand the underlying datasets and use it to find interesting defects in them ( $\S 6.6$ ). Finally, we show some limitations of such multilingual representational models vis-à-vis extremely low resource languages, identifying potential shortcomings that are not addressed with scaling of such models, as well as issues around catastrophic forgetting in the way current models are used for domain adaptation. + +In doing so, we establish state of the art on 5 multilingual downstream tasks (XNLI, PAWS-X, TY-DIQA, XQuAD and MLQA) within a model size band, and achieve competitive performance across + +size bands, thereby showing for the first time (to the best of our knowledge) an interesting notion of parameter efficiency: XY-LENT $_{\mathrm{XL}}$ outperforms XLM- $\mathbf{R}_{\mathrm{XXL}}$ (Goyal et al., 2021) and performs competitively with mT5 $_{\mathrm{XXL}}$ (Xue et al., 2021), whilst being 5x and 6x smaller respectively (Figure 1). Furthermore, our proposed model reduces the gap for English specific tasks: XY-LENT $_{\mathrm{XL}}$ achieves $99.3\%$ GLUE performance and $98.5\%$ SQuAD 2.0 performance compared to a SoTA English only model in the same size band. + +# 2 Related Work + +Large scale self-supervised learning has emerged as a prominent way of building cross-lingual language models that can be adapted for numerous multilingual downstream applications. Especially for building multilingual encoder transformer (Vaswani et al., 2017) models, two popular paradigms have been Masked language modeling (MLM; Devlin et al. (2019); Conneau et al. (2020)) and pre-training encoders as discriminators (ELECTRA; Clark et al. (2020b); Chi et al. (2022)), with the latter showing considerable compute efficiency. These approaches can further be improved by leveraging parallel corpora in different ways: Conneau and Lample (2019) propose a Translation Language Modeling task (TLM) wherein the model predicts masked tokens in concatenated translation pairs, Chi et al. (2022) propose a Translation Replaced Token Detection (TRTD) task, an analogous task for Electra-style models. Other approaches include using bittexts to construct code-switched sequences as inputs during pre-training (ALM; Yang et al. (2020)) and for contrastive learning (InfoXLM; Chi et al. (2021a)), or using token-level alignments in parallel data to improve cross-lingual modeling (Hu et al., 2021; Chi et al., 2021b, inter alia). However, all the aforementioned works rely on English-centric bittexts. + +Fan et al. (2021) show that moving beyond EN-X bitexts for Massively Multilingual Machine Translation affords substantial improvements over approaches that rely solely on English-centric data (Aharoni et al., 2019; Zhang et al., 2020). The primary factor responsible for this improvement has been the curation of $X - Y$ aligned bitext data, constructed by mining bitexts from publicly available web data (Schwenk et al., 2021a; El-Kishky et al., 2020; Schwenk et al., 2021b). The dataset construction either follows a local mining approach + +(first aligning documents using heuristics, and then mining parallel bitexts from the aligned documents; used in CCAIigned (El-Kishky et al., 2020)), or a global mining approach (all bitexts are embedded in a common vector space, and then aligned candidates are found by looking at the normalized nearest neighbors; used in CCMatrix (Schwenk et al., 2021b)). Fan et al. (2021) also propose a sampling strategy for leveraging the $X - Y$ bitexts, wherein the marginals are constrained to be similar to what is used for $En - X$ bitexts, and show their proposed method improves over uniform sampling. However, as we show in (§3.2), their proposed strategy has the undesirable artefact of inducing extremely sparse solutions, thereby resulting in data wastage. + +# 3 Leveraging Many-to-Many Bitexts + +# 3.1 Dataset + +Prior representation learning works usually consider English-centric $(EN - X)$ bitexts to improve model quality. Thus, given the emergence of mining based approaches for extracting parallel bitexts from large monolingual datasets that are approximate translations of each other and are multi-way aligned (the source and target languages are not restricted to be English only), in this work we explore leveraging these many-to-many $(X - Y)$ bitext datasets for better representation learning. We consider two such publicly available datasets: CCMatrix and multiCCAligned. + +# 3.2 Sampling Distribution + +A common method used for balancing training data for the $EN - X$ framework is using a temperature based exponential sampling approach (Aha-roni et al., 2019), wherein the probability of sampling a language is chosen from a temperature smoothed distribution to downsample high resource languages, whilst upsampling low resource languages. This work was extended by Fan et al. (2021), wherein the authors propose Sinkhorn Temperature sampling: given a joint probability matrix $\mathbb{Q}$ across $L \times L$ language pairs ( $L$ being the number of unique languages), and the marginal distribution $\mathbf{p}$ of the $L$ languages, the authors estimate a sampling distribution $\mathbb{P}^*$ as: + +$$ +\max _ {\mathbf {P}} \operatorname {T r} (\mathbf {P} \mathbb {Q}) \mid \mathbf {P} 1 _ {L} = \mathbf {p} ^ {\frac {1}{T}} = \mathbf {P} ^ {\top} 1 _ {L} \quad (1) +$$ + +where $\operatorname{Tr}$ is the trace operator. The primary advantage of using this is that $\mathbb{P}^*$ can be efficiently + +estimated with the Sinkhorn-Knopp algorithm and also allows us to set the marginal to be the temperature sampled based distribution which we know works well in practice. The authors found this to work better than uniform sampling. + +However, in practice, we observed this to generate extremely sparse sampling distributions: Figure 2a show the sparsity induced by the naive application of Eq. 1. + +We note that one potential way of overcoming the above issue is by modifying the optimization problem to also maximize the entropy of $\mathbf{P}$ . Consequently, we propose the following modified optimization objective: + +$$ +\begin{array}{l} \mathbb {P} ^ {*} = \operatorname {a r g m i n} _ {\mathbf {P}} \operatorname {T r} (P (- \log \mathbb {Q})) - \mathcal {H} (P) \\ \left| \mathbf {P} 1 _ {L} = \mathbf {p} ^ {\frac {1}{T}} = \mathbf {P} ^ {\top} \mathbb {Q}\right) \left| \mathbf {P} 1 _ {L} = \mathbf {p} ^ {\frac {1}{T}} = \mathbf {P} ^ {\top} 1 _ {L} \right. \tag {2} \\ \end{array} +$$ + +where $\mathcal{H}(P)$ denotes the entropy of $P$ and $KL(P||Q)$ denotes the Kullback-Leibler divergence between $P$ and $Q$ . + +This can be solved by using the Sinkhorn-Knopp algorithm for the entropic regularized optimal transport problem (Cuturi, 2013), by setting the cost matrix to be $-\log (\mathbb{Q} + \epsilon)$ (in practice, since $\mathbb{Q}$ can have zero entries, $\epsilon$ is used for smoothing). Since the cost of assigning a non-zero probability value to a zero entry is extremely high $(- \log (\epsilon))$ , we never observe any entry of $\mathbb{P}^*$ to be non-zero if it's corresponding entry in $\mathbb{Q}$ was zero. In addition, since Eq. 2 also maximizes the entropy of $\mathbf{P}$ , it encourages its entries to be non-sparse, thereby avoiding the problem present in the solution of Eq. 1. In practice, we did not see this losing out on any data: if $\mathbb{Q}$ was non-zero, then $\mathbb{P}^*$ was also non-zero (Figure 2b). + +# 3.3 Vocabulary Construction + +We construct our vocabulary using Sentence Piece Models (SPM) (Kudo and Richardson, 2018) which cater to language specific complexities (tokenization, accent removal, etc.). We increase the vocabulary size to $500\mathrm{k}$ tokens to better serve the varied scripts encountered while working in the multilingual setting. For this construction, we follow the VoCAP algorithm (Zheng et al., 2021) to quantify the vocabulary capacity for each language separately and account for varied corpora sizes across languages. Better capacity allocation leads to smaller representative sequences (especially for mid and low resource languages) which + +![](images/ebec098e89f2ed378e570489037c3359cd5434489bc9d9508987a01f86f77f96.jpg) +(a) M2M 100 Sampling + +![](images/baa41653fc97e7b8eb10a2a566d5dfc3b39b5666a8d44f2a9410a5f75b3a5921.jpg) +(b) Proposed Sampling +Figure 2: Density plots for our probability distributions for sampling strategies for M2M 100 and our proposed sampling strategy for the 21 languages considered in downstream tasks. For similar plot for all the languages, see Figure 6b in the Appendix + +in-turn improves the computational efficiency of the model. Increasing the size of the vocabulary, however, comes at the cost of inflating the model parameters which is particularly observed in the case of XY-LENT $_{\text{Base}}$ and XY-LENT $_{\text{Large}}$ where the embeddings layer constitute $80.5\%$ and $62.9\%$ of the total parameters respectively. + +# 4 Pretraining Details + +We follow the XLM-E (Chi et al., 2022) pretraining approach and only introduce a few architectural changes to improve the overall performance of the model. We use the Transformer model (Vaswani et al., 2017) trained with ELECTRA (Clark et al., 2020b) style of replace token detection (RTD) on both monolingual (MRTD) and bitext (TRTD) data. In the current setup of training, we use two Transformer encoders in conjunction: a generator $G$ and a discriminator $D$ , where the generator $G$ is trained with masked language modeling objective (MLM; Devlin et al. (2019)) and the discriminator is trained on replaced token detection objective (RTD; Clark et al. (2020b) on all the tokens passing through the generator. + +In addition to using the Gated Relative Position Bias introduced in Chi et al. (2022), we do not mask the [CLS] token and flip bitext language order with probability $p = 0.5$ for the TRTD task. + +# 5 Experiments + +Baselines: We compare the cross-lingual performance of our proposed model against 3 popular + +cross-lingual models: XLM-R, mT5 and XLM-E (across all model size variations). Note that Chi et al. (2022) use a 250k vocabulary size for XLM $\mathrm{E_{Base}}$ and 500k vocabulary for their large and XL variants. As a follow-up, we re-train XLM- $\mathrm{E_{Base}}$ with the same vocabulary as used by XY-LENT for a fair comparison. Thus all references to XLM $\mathrm{E_{Base}}$ refer to the re-trained model variant with a 500k vocabulary size. $^1$ For our downstream English evaluation ( $\S 6.3$ ), we compare against the SoTA English model METRO-LM(Bajaj et al., 2022). Note that Bajaj et al. (2022) also train the models in an ELECTRA style framework, thereby allowing for a fair comparison. + +Pretraining Data: For our monolingual data, we follow Chi et al. (2022) and use the CC-100 dataset $^{2}$ (Conneau et al., 2020; Wenzek et al., 2020) which contains texts in 100 languages collected from Common CWEl. As mentioned in $(\S 3.1)$ , we explore the utility of the CCMatrix and the multiCCAligned $X - Y$ aligned bitext data. CCMatrix consists of 1015 language pairs (97 unique languages) $^{3}$ ; while the multiCCAligned dataset consists of 2959 language pairs (92 unique languages) $^{4}$ . We contrast this against only using EN-X bitexts (CCAligned, El-Kishky et al. (2020)). + +Model Size Bands: While our base and large models have more parameters when compared with XLM-R, most of the additional parameters come from the increased vocabulary size (§3.3). Concretely, our base model has 12 layers and 768 hidden states, while the large model has 24 layer and 1024 hidden states, which is identical to XLM-RBase and XLM-RLarge respectively. However, even with the increased parameter count, the computation cost on a text classification task is roughly the same within a model size family (since mapping tokens to an embedding is a lookup operation). Finally, it is noteworthy that even with the increased vocabulary size, the number of parameters for XY-LENTXL is less compared to the XL and XXL variants of both XLM-R and mT5. + +Pretraining Setup: For the base model, we train for 125k steps with a batch size of 8192 for MRTD task and for the large model, we train the model for 500k steps with a batch size of 2048. Finally for the XL model, we train for 150k steps with a batch size of 8192. We use a dynamic batch size for TRTD task which is based on original length of the translated bi-text pair. Please refer Appendix A for additional details. We adopt the standard practice of using a linear warmup schedule for the learning rate and use the Adam (Kingma and Ba, 2014) optimizer for all the models. Following Meng et al. (2021), we do not apply any dropout to the generator. + +Cross-lingual Downstream Evaluation: For evaluating the cross-lingual understanding of the model, we consider 5 multilingual evaluation benchmarks. We consider 2 classification tasks and 3 question answering tasks. For classification, we evaluate on the cross-lingual Natural Language Inference dataset (XNLI; Conneau et al. (2018)) and the cross-lingual paraphrase adversaries from word scrambling dataset (PAWS-X; Yang et al. (2019)). For cross-lingual question answering, we consider MLQA (Lewis et al., 2019), XQuAD (Artetxe et al., 2019) and TyDiQA-GoldP (Clark et al., 2020a). For all the aforementioned tasks, we perform the evaluation in zero-shot setting, i.e. only using the English data for fine-tuning. To further assess the model's performance when translated data is available, we evaluate the model on the translate-train setup for the classification tasks. + +English Downstream Evaluation: To further assess XY-LENT's performance on English and see + +how the curse of multilinguality impacts the model, we also assess the model's performance on the commonly used GLUE benchmark (Wang et al., 2018), comprising of 8 tasks: MNLI (Williams et al., 2017), SST-2 (Socher et al., 2013), QNLI (Rajpurkar et al., 2018a), MRPC (Dolan and Brockett, 2005), CoLA (Warstadt et al., 2018), QQP, STS-B (Cer et al., 2017) and RTE. Additionally, we also evaluate the English performance of our model on a question answering task, using the SQuAD 2.0 dataset (Rajpurkar et al., 2018b). + +Please refer to Appendix B for additional details on the datasets. + +# 6 Results and Analysis + +# 6.1 Main Results + +Table 1 presents our proposed model's performance across different model sizes for zero-shot transfer on sentence classification as well as question answering tasks (detailed results for all languages and all tasks can be found in Appendix D). We see that XY-LENT outperforms the baselines of XLM-E, XLM-R and mT5 across all model sizes, establishing (to the best of our knowledge) the state-of-the-art (SoTA) for all the 5 considered multilingual datasets within the model size bands: with XY-LENTBase outperforming XLM-EBase by 3.1 pts, XY-LENTLarge outperforming XLM-ELarge by 1.8 pts and XY-LENTXL outperforming XLM-EXL by 0.9 pts (averaged across all 5 datasets). Another interesting observation is that XY-LENT is competitive across model size families: the XY-LENTBase model out-performs XLM-RLarge and mT5Large variants on 4 out of 5 datasets, similarly the XY-LENTLarge outperforms the mT5XL model on 4 out of 5 datasets. Furthermore, the XY-LENTXL model outperforms XLM-RXXL and is competitive with mT5XXL while being 5x and 6x smaller respectively. A practical implication of these better performing smaller models is their easy usage in downstream tasks. + +This behaviour is also consistent in the TranslateTrain setting where the translated version of the training data is present across all languages for training. Table 1 presents XY-LENT's performance on this setup for sentence classification tasks. We see that even in this setting, XY-LENT outperforms other models with the same size band, and is competitive across model size bands. + +
ModelZero-ShotTranslate-Train
Question AnsweringSentence ClassificationSentence Classification
XQuADMLQATyDiQAXNLIPAWSXXNLIPAWSX
MetricsF1/EMF1/EMF1/EMAcc.Acc.Acc.Acc.
XLM-RBase---76.2-79.1-
mT5Base67.0 / 49.064.4 / 45.058.1 / 42.875.486.475.989.3
XLM-EBase74.3 / 59.268.7 / 50.562.7 / 46.278.187.081.791.1
XY-LENTBase76.8 / 62.171.3 / 53.267.1 / 51.580.589.784.992.4
XLM-RLarge76.6 / 60.865.1 / 45.071.6 / 53.280.986.483.6-
mT5Large77.8 / 61.571.2 / 51.757.8 / 41.281.188.981.891.2
XLM-ELarge78.7 / 63.172.8 / 54.471.8 / 54.781.389.084.191.9
XY-LENTLarge79.7 / 64.974.3 / 55.774.0 / 57.583.090.484.992.4
XLM-RXL80.0 / 64.973.4 / 55.3-82.3-85.4-
mT5XL79.5 / 63.673.5 / 54.477.4 / 61.582.989.684.891.0
XLM-EXL80.4 / 66.074.3 / 55.876.7 / 60.683.790.385.592.2
XY-LENTXL81.3 / 66.375.4 / 56.778.0 / 62.184.891.087.192.6
XLM-RXXL81.1 / 66.374.8 / 56.6-83.1-86.0-
mT5XXL82.5 / 66.876.0 / 57.481.0 / 65.685.090.087.891.5
+ +Table 1: Results on sentence-pair classification and question answering tasks. XLM-R metrics and mT5 metrics are reported from Goyal et al. (2021) and Xue et al. (2021) respectively. Metrics for XLM-E and XY-LENT are reported based on median across five fine-tuning runs. Scores of best performing models within a model size band have been highlighted for each task. Full results for all the languages across all tasks can be referred in Appendix B. + +
ParameterChoiceXNLI (Avg)
Vocabulary Size250K76.6
500K78.1
Bitext DataCCAligned78.1
multiCCAligned79.5
CCMatrix80.5
Training ObjectiveMasked LM78.4
ELECTRA80.5
+ +Table 2: Ablation studies for XY-LENT. We study the effects of changing few parameters in the pre-training setup while keeping others same. + +# 6.2 Ablations + +Different Many-to-Many Datasets Table 2 shows the impact of moving from English-centric bittexts to $X - Y$ bitext data. Using multiCCAligned dataset gives a $+1.4$ pt improvement on average XNLI performance over the baseline which uses only the CCAligned data, thereby showing that the utility of leveraging multi-way bitext data is not limited to CCMatrix dataset. However, we still see an additional improvement of $1.0$ pt with usage of CCMatrix data and we hypothesize this gain to more diversity present in it which in-turn helps in improving the multilingual representations. + +Different Pretraining Objectives While the gains are more substantial with ELECTRA training + +objective, Table 2 shows that the benefits of having a better quality bitext data is not just restricted to the ELECTRA paradigm of training and can also be observed with the Masked LM objective. For the ablation experiment, we train a base model model with the MLM objective for $125\mathrm{k}$ steps with a batch size of 8192. Comparing this with XLM- $\mathbf{R}_{\mathrm{Base}}$ 's setup, which uses only monolingual data with MLM objective and trains for 1.5M steps (i.e. 12 times longer), finally achieving an XNLI (Avg) of 76.2, we observe that introduction of $X - Y$ data not only brings performance gains but also significantly improves the training efficiency of these models. + +# 6.3 On English Performance of Multi-Lingual Models + +Given the strong performance of multilingual models on the English subset of XNLI, one interesting question that arises is how does model scaling impact the performance on English centric downstream tasks. In order to evaluate that, we measure the performance of XY-LENT on the commonly used GLUE benchmark (Wang et al., 2018) and the SQuAD 2.0 benchmark. To compare the multilingual model performance on English, we also consider English specific encoder models trained in an Electra pre-training paradigm. Specifically, we consider the Base, Large, XL and XXL models + +
ModelGLUE DEV Single TaskSQuAD 2.0
MNLI-(m/mm) (Acc)QQP-(Acc/F1)QNLI (Acc)SST-2 (Acc)CoLA (MCC)RTE (Acc)MRPC (Acc)STS-B (SCC)AVGEMF1
METRO-LMBase90.3 / 90.292.4/-94.495.971.888.191.492.089.585.988.5
XLM-EBase86.1 / 86.391.5/88.792.894.067.477.890.291.486.482.385.3
XY-LENTBase87.3 / 87.691.9/89.293.394.466.685.290.791.787.683.586.3
Δ3.0 / 2.61.3/-1.11.55.22.90.70.71.92.42.2
METRO-LMLarge91.7 / 91.792.995.896.375.293.192.292.891.488.591.1
XLM-RLarge88.9 / 89.092.393.895.0--89.591.2---
XLM-ELarge89.9 / 90.192.9/90.494.596.873.985.792.192.589.885.688.7
XY-LENTLarge89.7 / 89.992.7/90.394.795.871.188.491.492.689.685.888.7
Δ2.0 / 1.80.2/-1.10.54.14.70.80.21.82.82.4
METRO-LMXL92.2 / 92.093.296.397.376.093.591.793.091.889.492.1
XLM-RXL90.4/-92.594.996.6--90.4----
XLM-EXL91.1 / 91.292.5/89.994.097.274.791.492.193.290.887.890.7
XY-LENTXL91.2 / 91.193.0/90.795.896.474.992.891.993.291.288.190.9
Δ1.0 / 0.90.2/-0.50.91.10.7-0.2-0.20.61.31.2
+ +Table 3: Results for models on GLUE dev set and SQuAD 2.0 dev set. $\Delta$ represents the performance difference between METRO-LM and XY-LENT which keeps shrinking we scale up. + +presented in (Bajaj et al., 2022). + +Table 3 shows the performance of our proposed method against the SoTA monolingual as well as other multilingual baselines. As observed in the results, with an increase in the number of parameters, we see that the gap in the performance of an English centric model and a multilingual model decreases, with the XL model being just 0.6 points behind on GLUE and 1.3 points on SQuAD 2.0. We hypothesize that an increase in model capacity alleviates the issues caused by the curse of multilinguality (Conneau et al., 2020); and when that is the case, English performance actually benefits from the presence of other languages in the training data. + +It is noteworthy that the even for the English language performance, having an $X - Y$ centric data is more beneficial compared to an EN-X data (XLM-E vs XY-LENT). Furthermore, our proposed method outperforms XLM-R on large and XL sizes. + +# 6.4 Performance Across Language Families + +Figure 3 shows the performance the delta of performance between XLM-E and XY-LENT across different language families. Following Hu et al. (2020), we use the number of Wikipedia articles as a proxy for a language family being high or low resource. As can be seen, leveraging X-Y bittexts helps improves performance consistently across language families. + +![](images/0aa2d6952f5fddd39fbf74bb6a41ace73cb04530e06358a0a52a7660ee83fc28.jpg) + +Figure 3: Performance $\Delta$ between XLM-E and XYLENT across language families + +
ModelXQuADMLQATyDiQAXNLIPAWS-X
MBERT25.027.522.216.514.1
XLM-R15.920.315.210.411.4
XLM-E14.919.213.111.28.8
XY-LENT15.319.98.67.86.8
+ +Table 4: Crosslingual Transfer Gap scores on 5 multilingual benchmark tasks. A lower score indicates better cross-lingual transfer. For QnA datasets, this is computed using the EM scores. + +# 6.5 Crosslingual Transfer Gap + +In order to further evaluate the cross-lingual transferrability of our model, we follow Hu et al. (2020) and evaluate the cross-lingual transfer gap (the difference between the performance on the English test set and the average test set performance for + +other languages) for XY-LENTBase. This score indicates how much end task knowledge is not transferred to other languages post fine-tuning, with a smaller gap indicating better transferrability. As seen in Table 4, XY-LENT achieves lower scores on 3 out of 5 tasks, thereby demonstrating strong transferrability. + +# 6.6 Using Training Dynamics to Explore Dataset Quality + +So far we have seen that leveraging $X - Y$ aligned bittexts improves model quality. In this section, we consider the inverse direction: whether training dynamics of representation learning models can be used to identify dataset artifacts. Given these bitext datasets span over 1000 language pairs, a manual inspection of these datasets is extremely hard. Thus an automated method for spot-checking the dataset quality is quite valuable. + +To do so, we first train a model in line with the methodology presented by Zhou et al. (2021) for Distributionally Robust Multilingual Machine Translation. Specifically, we train XY-LENT with the following modified objective: + +$$ +\begin{array}{l} \min _ {\theta_ {D}, \theta_ {G}} \sup _ {\mathbf {P}: \chi^ {2} (\mathbf {P}, \mathbb {Q}) \leq \rho} \sum_ {i} p _ {i} \left(\mathcal {L} _ {D} (\mathbf {x}; \theta_ {D}) + \right. \tag {3} \\ \lambda \mathcal {L} _ {G} (\mathbf {x}; \theta_ {G})) \\ \end{array} +$$ + +Here $\mathcal{L}_G$ and $\mathcal{L}_D$ refer to the generator and discriminator losses respectively (§4), $\mathbf{P}$ is the joint distribution over the bitext language pairs that we want to estimate (i.e $\mathbb{P} = p_i\mid 1\leq i\leq L\times L;\sum_i p_i = 1$ ); and $\mathbb{Q}$ is the original training distribution (i.e the probability distribution over the bitexts when the training starts, equal to $\mathbb{P}^*$ as estimated in §3.2). At a high level, the objective minimizes the training loss over a $\chi^2$ ball around the original training distribution, with the supremum up-weighing language pairs with higher loss values, and down-weighing languages with lower loss values $^5$ . We train a model with the Distributional Robustness Optimization objective (DRO) using Iterated Best Response strategy, as proposed by Zhou et al. (2021) and resample 10 times throughout the training. We hypothesize that the two extremities (i.e language pairs that are highly upsampled as well as those that are down-sampled) would be bitext datasets of interest for spot-checking. + +![](images/388ca14b2717cc3bc816ffeb146b9e01a1426c1c3ebd8cfa65ac6776cb0bac97.jpg) +Figure 4: The 10 upsampled and downsampled languages when the model is trained with the DRO objective + +Figure 4 presents the top 10 upsampled and 10 downsampled languages between the initial and final language distributions. Manual inspection of these language pairs shows that our hypothesis indeed holds true: we observe that the translations for English and Xhosa (en - xh) are extremely noisy and aligned with non-sensical text, with multiple different English sentences being aligned to the same Xhosa sentence. This can potentially be a manifestation of the hubness issue for Nearest Neighbor lookups in high dimensional spaces (Radovanovic et al., 2010; Dinu and Baroni, 2014). Bitexts for Catalan and Spanish (ca - es) and Czech and Slovak (cs - sk) are near duplicates, since the language pairs are very similar. Both of these issues can cause the TRD task to be trivial, explaining the downsampling. Similarly, looking at languages that are up-sampled, we observe a lot of translation quality noise in bitexts for Spanish and Tamil (es - ta), Turkish and Urdu (tr - ur) and Sinhala and Turkish (si - tr). + +# 7 Conclusion + +In this work, we introduced a family of models which achieve SoTA performance over 5 multilingual benchmarks compared to other models belonging to similar model size bands and are competitive across the bands. Our XY-LENT $_{\mathrm{XL}}$ model outperforms XLM-R $_{\mathrm{XXL}}$ and is competitive with mT5 $_{\mathrm{XXL}}$ being 5x and 6x smaller respectively. Furthermore, the XL model variant also achieves $99.3\%$ and $98.5\%$ of the current best performant models on GLUE and SQuAD 2.0 respectively, thereby aiding in reducing the curse of multilinguality. The + +performance gains are consistent across language families. + +# 8 Limitations + +Even though XY-LENT paves the way towards better general-purpose multilingual representation foundation models, in this section, we highlight the limitations associated with this work. We first expound upon the limitations associated with self-supervised learning on large web extracted corpora. Then we show that while XY-LENT achieves strong performance on multiple multilingual benchmarks, when the downstream task involves unseen (during pretraining) languages, the performance drops by a substantial margin. Finally, we show the potential limitation associated with a common methodology used for domain adaptation associated with leveraging these multilingual foundation models, illustrating how catastrophic forgetting exacerbates certain issues pertaining to low resource language performance. + +# Training Data + +XY-LENT uses CC-100 which a static multilingual corpus extracted from Common Crawl for 100 languages. As noted by Wenzek et al. (2020), several data filtering strategies have been applied to remove duplicated documents, paragraphs with high ratio of punctuations, digits and profanities, the resultant data may still result in many potential biases requiring further analysis. Additionally, these issues might be aggravated for models that leverage bitext data, since the bittexts themselves are mined from web crawls, and thus potentially have all the associated biases, stereotypes and other associated harms. Furthermore, the raw data was compiled from static Common Crawl snapshots from January, 2020 to December, 2020 and hence may not include information about some of the recent events such as COVID-19. + +# Performance on Unseen Languages + +Given the performance improvements observed with scaling, we investigate how it impacts extremely low resource languages which are not present in the pre-training data. In order to do so, we consider our model's performance on the AmericasNLI dataset (Ebrahimimi et al., 2022) which extends the XNLI dataset to 10 Indigenous languages of the Americas. + +Table 5 presents the results on the AmericasNLI + +dataset. As can be seen, XY-LENT does outperform XLM-R, indicating that better representation learning also benefits these extremely low resource languages. However, we do not see an increase in performance while scaling our models. Specifically, the performance of XY-LENT $_{\text{Base}}$ and XY-LENT $_{\text{XL}}$ model is nearly the same, and substantially worse that the performance observed on the XNLI dataset. This indicates that, while parameter scaling can help improve performance on languages that the model has seen during pre-training, it does not automatically improve performance in the extremely low-resource regime $^{6}$ . Thus, while model scaling allows for improvements across numerous dimensions, it is far from a panacea, especially if not done in conjunction with data scaling efforts. To be able to improve performance for unseen languages, an intervention would need to be made at the data collection efforts during pretraining, which we aim to assess in future works. + +# Continued Training for Domain Adaptation in Pre-Trained Encoders + +In recent years, continued training on domain specific corpora has been considered a viable approach for domain adaptation of MLM style pre-trained models (Gururangan et al., 2020; Yao et al., 2021) where the core idea is to continue train the pretrained model on domain specific corpora with the goal of improving in-domain downstream evaluation. + +We first show that this phenomenon can be extended to models pretrained with an ELECTRA style training objective. Concretely, we apply domain adaptation in the biomedical domain where we continue to train our XY-LENT $_{\text{Base}}$ as well as XY-LENT $_{\text{MLM + TLM}}$ model on the PubMed data presented in Yao et al. (2021), and evaluate it on the ChemProt task (which aims at extracting relations between chemicals and proteins) presented in Gururangan et al. (2020) as the in-domain downstream task. + +We observe that the continued training approach presented in Gururangan et al. (2020) for the ELECTRA style models, using the same peak learning rate as used during pre-training, results in divergence. Interestingly, this neither happens for the generator of the ELECTRA model nor for the + +
ModelAvgAvg w/o enenaymbzdcnignhchnahotoquyshptar
XLM-RBase39.438.585.836.139.737.939.537.242.637.837.240.536.4
XLM-EBase44.840.687.54038.841.743.63843.839.841.742.335.9
XY-LENTBase45.541.684.440.740.742.942.538.945.540.942.143.937.6
XY-LENTXL47.242.890.842.142.545.642.941.245.041.342.746.937.9
+ +Table 5: Performance of models on the AmericasNLI dataset. Note that model scaling does not seem to improve performance as much for these unseen languages. + +
ModelCTAvgenfresdeelbgrutrarvithzhhiswur
XY-LENT MLM + TLMX78.486.281.582.981.580.681.879.877.477.978.375.278.373.372.868.0
✓67.585.773.974.571.471.770.971.257.865.166.768.571.860.645.857.1
Relative Δ(%)13.90.69.310.112.411.013.310.825.316.414.88.98.317.337.116.0
✓w/ low LR73.585.978.278.676.276.877766872.273.773.876.268.757.464.4
Relative Δ(%)6.30.34.05.26.54.75.94.812.17.35.91.92.76.321.25.3
XY-LENTBaseX80.387.983.484.482.982.683.181.179.579.580.077.780.176.475.371.3
✓75.687.580.581.678.279.379.476.872.474.276.475.378.770.358.865.1
Relative Δ(%)5.90.53.53.35.74.04.55.38.96.74.53.11.78.021.98.7
+ +Table 6: Drop in cross-lingual zero-shot performance before and after continued training (CT). For MLM, we show with original LR and lower LR. $\Delta$ measured as a relative (\%) drop compared to no CT + +
ModelAcc. (w/o Contd. Train)Acc. (Contd. Train)
XY-LENT MLM + TLM82.086.0
XY-LENTBase81.686.2
+ +Table 7: Domain Specific Downstream task: Accuracy on Chemprot dataset + +![](images/e483713f38247f4333f170f64ced7c468279c1b86df799bc582eb505a16e6dd7.jpg) +Figure 5: Relative Zero-Shot performance drop with continued training for MLM and ELECTRA style models + +MLM style pre-trained model. Thus, for an ELECTRA style continued training setup, we posit reducing the peak learning rate to be a crucial change. Table 7 shows the performance on the downstream task post the continued training approach and unsurprisingly it helps with improving in-domain performance. + +However, given the multilingual nature of such models, we test the multilinguality of these models + +before and after continued training; using crosslingual zero-shot XNLI as a proxy for multilingual model quality. Table 6 shows the drop in performance across all languages pre and post continued training. We first note that this drop in performance is present for both MLM and ELECTRA style of models, and thus is not an artifact of the pre-training objective. We observe that the drop in performance is not uniform across all languages and the drop is worse for MLM style models (with using the same peak learning rate suffering more from this issue; Table 7). While we expect the drop in English performance to be relatively less, we do see that the drop is substantially more for the mid and low resource languages (especially Hindi, Turkish, Urdu and Swahili; see Fig. 5). While this can potentially be ameliorated by using techniques like Adapters (Houlsby et al., 2019) etc., we would like to draw attention towards the fact that general purpose continued training does suffer from this issue. + +# 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. +Mikel Artetxe, Sebastian Ruder, and Dani Yogatama. 2019. On the cross-lingual transferability of monolingual representations. arXiv preprint arXiv:1910.11856. +Payal Bajaj, Chenyan Xiong, Guolin Ke, Xiaodong Liu, Di He, Saurabh Tiwary, Tie-Yan Liu, Paul Bennett, Xia Song, and Jianfeng Gao. 2022. Metro: Efficient denoising pretraining of large scale autoencoding language models with model generated signals. arXiv preprint arXiv:2204.06644. +Rishi Bommasani, Drew A Hudson, Ehsan Adeli, Russ Altman, Simran Arora, Sydney von Arx, Michael S Bernstein, Jeannette Bohg, Antoine Bosse-lut, Emma Brunskill, et al. 2021. On the opportunities and risks of foundation models. arXiv preprint arXiv:2108.07258. +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. +Zewen Chi, Li Dong, Furu Wei, Nan Yang, Saksham Singhal, Wenhui Wang, Xia Song, Xian-Ling Mao, Heyan Huang, and Ming Zhou. 2021a. InfoXLM: An information-theoretic framework for cross-lingual language model pre-training. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 3576-3588, Online. Association for Computational Linguistics. +Zewen Chi, Li Dong, Bo Zheng, Shaohan Huang, XianLing Mao, Heyan Huang, and Furu Wei. 2021b. Improving pretrained cross-lingual language models via self-labeled word alignment. 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 3418-3430, Online. Association for Computational Linguistics. +Zewen Chi, Shaohan Huang, Li Dong, Shuming Ma, Bo Zheng, Saksham Singhal, Payal Bajaj, Xia Song, Xian-Ling Mao, Heyan Huang, and Furu Wei. 2022. XLM-E: Cross-lingual language model pre-training via ELECTRA. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 6170–6182, Dublin, Ireland. Association for Computational Linguistics. +Jonathan H. Clark, Eunsol Choi, Michael Collins, Dan Garrette, Tom Kwiatkowski, Vitaly Nikolaev, and Jennimaria Palomaki. 2020a. TyDi QA: A benchmark for information-seeking question answering in typologically diverse languages. Transactions of the Association for Computational Linguistics, 8:454-470. + +Kevin Clark, Minh-Thang Luong, Quoc V Le, and Christopher D Manning. 2020b. Electra: Pre-training text encoders as discriminators rather than generators. arXiv preprint arXiv:2003.10555. +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. +Alexis Conneau and Guillaume Lample. 2019. Crosslingual language model pretraining. Advances in neural information processing systems, 32. +Alexis Conneau, Rudy Rinott, Guillaume Lample, Adina Williams, Samuel Bowman, Holger Schwenk, and Veselin Stoyanov. 2018. XNLI: Evaluating crosslingual sentence representations. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 2475-2485, Brussels, Belgium. Association for Computational Linguistics. +Marco Cuturi. 2013. Sinkhorn distances: Lightspeed computation of optimal transport. Advances in Neural Information Processing Systems, 26:2292-2300. +Jacob Devlin. 2018. Multilingual BERT. README document. https://github.com/google-research/bert/blob/a9ba4b8d7704c1ae18d1b28c56c0430d41407eb1/multilingual.md. +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. +Georgiana Dinu and Marco Baroni. 2014. Improving zero-shot learning by mitigating the hubness problem. volume abs/1412.6568. +William B. Dolan and Chris Brockett. 2005. Automatically constructing a corpus of sentential paraphrases. In Proceedings of the Third International Workshop on Paraphrasing (IWP2005). +Abteen Ebrahimi, Manuel Mager, Arturo Oncevay, Vishrav Chaudhary, Luis Chiruzzo, Angela Fan, John Ortega, Ricardo Ramos, Annette Rios, Ivan Vladimir Meza Ruiz, Gustavo Giménez-Lugo, Elisabeth Mager, Graham Neubig, Alexis Palmer, Rolando Coto-Solano, Thang Vu, and Katharina Kann. 2022. AmericasNLI: Evaluating zero-shot natural language understanding of pretrained multilingual models in + +truly low-resource languages. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 6279-6299, Dublin, Ireland. Association for Computational Linguistics. +Ahmed El-Kishky, Vishrav Chaudhary, Francisco Guzmán, and Philipp Koehn. 2020. CCAligned: A massive collection of cross-lingual web-document pairs. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP 2020), pages 5960-5969. Association for Computational Linguistics. +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. +Naman Goyal, Jingfei Du, Myle Ott, Giri Anantharaman, and Alexis Conneau. 2021. Larger-scale transformers for multilingual masked language modeling. arXiv preprint arXiv:2105.00572. +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. +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. +Junjie Hu, Melvin Johnson, Orhan First, Aditya Siddhant, and Graham Neubig. 2021. Explicit alignment objectives for multilingual bidirectional encoders. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 3633-3643, Online. Association for Computational Linguistics. +Junjie Hu, Sebastian Ruder, Aditya Siddhant, Graham Neubig, Orhan First, and Melvin Johnson. 2020. Xtreme: A massively multilingual multi-task benchmark for evaluating cross-lingual generalisation. In International Conference on Machine Learning, pages 4411–4421. PMLR. +Diederik P Kingma and Jimmy Ba. 2014. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980. +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. +Patrick Lewis, Barlas Oguz, Rudy Rinott, Sebastian Riedel, and Holger Schwenk. 2019. *Mlqa: Evaluating cross-lingual extractive question answering*. arXiv preprint arXiv:1910.07475. +Yu Meng, Chenyan Xiong, Payal Bajaj, Paul Bennett, Jiawei Han, Xia Song, et al. 2021. Coco-lm: Correcting and contrasting text sequences for language model pretraining. Advances in Neural Information Processing Systems, 34:23102-23114. +Miloš Radovanović, Alexandros Nanopoulos, and Mirjana Ivanović. 2010. Hubs in space: Popular nearest neighbors in high-dimensional data. volume 11, pages 2487-2531. +Pranav Rajpurkar, Robin Jia, and Percy Liang. 2018a. Know what you don't know: Unanswerable questions for squad. ACL. +Pranav Rajpurkar, Robin Jia, and Percy Liang. 2018b. Know what you don't know: Unanswerable questions for SQuAD. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 784-789, Melbourne, Australia. Association for Computational Linguistics. +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. +Holger Schwenk, Vishrav Chaudhary, Shuo Sun, Hongyu Gong, and Francisco Guzmán. 2021a. WikiMatrix: Mining 135M parallel sentences in 1620 language pairs from Wikipedia. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 1351-1361, Online. Association for Computational Linguistics. +Holger Schwenk, Guillaume Wenzek, Sergey Edunov, Edouard Grave, Armand Joulin, and Angela Fan. 2021b. CCMatrix: Mining billions of high-quality parallel sentences on the web. 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 6490-6500, 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 EMNLP, pages 1631-1642. + +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. Advances in neural information processing systems, 30. +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. +Alex Warstadt, Amanpreet Singh, and Samuel R Bowman. 2018. Neural network acceptability judgments. arXiv preprint arXiv:1805.12471. +Guillaume Wenzek, Marie-Anne Lachaux, Alexis Conneau, Vishrav Chaudhary, Francisco Guzmán, Armand Joulin, and Edouard Grave. 2020. CCNet: Extracting high quality monolingual datasets from web crawl data. In Proceedings of the 12th Language Resources and Evaluation Conference, pages 4003-4012, Marseille, France. European Language Resources Association. +Adina Williams, Nikita Nangia, and Samuel R Bowman. 2017. A broad-coverage challenge corpus for sentence understanding through inference. Proceedings of the 2nd Workshop on Evaluating Vector-Space Representations for NLP. +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. +Jian Yang, Shuming Ma, Dongdong Zhang, Shuangzhi Wu, Zhoujun Li, and Ming Zhou. 2020. Alternating language modeling for cross-lingual pre-training. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 9386-9393. +Yinfei Yang, Yuan Zhang, Chris Tar, and Jason Baldridge. 2019. PAWS-X: A cross-lingual adversarial dataset for paraphrase identification. 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 3687-3692, Hong Kong, China. Association for Computational Linguistics. +Yunzhi Yao, Shaohan Huang, Wenhui Wang, Li Dong, and Furu Wei. 2021. Adapt-and-distill: Developing small, fast and effective pretrained language models for domains. In *Findings of the Association for Computational Linguistics: ACL-IJCNLP* 2021, pages 460-470, Online. Association for Computational Linguistics. + +Biao Zhang, Philip Williams, Ivan Titov, and Rico Senrich. 2020. Improving massively multilingual neural machine translation and zero-shot translation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 1628-1639, Online. 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. +Bo Zheng, Li Dong, Shaohan Huang, Saksham Singhal, Wanxiang Che, Ting Liu, Xia Song, and Furu Wei. 2021. Allocating large vocabulary capacity for crosslingual language model pre-training. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 3203-3215, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Chunting Zhou, Daniel Levy, Xian Li, Marjan Ghazvininejad, and Graham Neubig. 2021. Distributions of robust multilingual machine translation. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 5664-5674, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. + +# Appendix + +# A Pre-Training and Model Hyperparameters + +
HyperparametersBaseLargeXL
Layers122448
Hidden size7681,0241,536
FFN inner hidden size3,0724,0966,144
Attention heads121624
+ +Table 8: Model hyperparameters of XY-LENT discriminators across different sizes. + +
HyperparametersBaseLargeXL
Training steps125K500K150K
Batch tokens per task4M1M4M
Adam ε1e-61e-61e-6
Adam β(0.9, 0.98)(0.9, 0.98)(0.9, 0.98)
Learning rate8e-42e-41e-4
Learning rate scheduleLinearLinearLinear
Warmup steps10,00010,00010,000
Gradient clipping2.01.01.0
Weight decay0.010.010.01
+ +Table 9: Hyperparameters used for pre-training XY-LENT. + +Table 8 shows the hyper-parameters of XYLENT across various model sizes. All the models are trained with a vocabulary size of $500\mathrm{K}$ and we use batch size of 1M or 4M tokens based on model size as mentioned in Table 9. For multilingual replace token detection task we work with a fixed input sequence length of 512 and hence maintains a constant batch size. For translation replace token detection task, the input sequence length is dynamically set as the length of original translation pair and the max one is chosen across the batch. For the base and large models, we train on 128 Nvidia A100-40GB GPU cards, and for the XL model, we use 512 Nvidia A100-80GB GPU cards. + +# B Downstream Performance + +For evaluating cross lingual understanding, we consider five multilingual evaluation benchmarks. We use XNLI (Cross-Lingual Natural Language Inference) and PAWS-X for classification and XQuAD, MLQA and TyDiQA-GP for question answering. Additionally, we use GLUE benchmark and SQuAD2.0 to evaluate the English performance of our model. + +XNLI The XNLI dataset (Conneau et al., 2018) comes with ground-truth dev and test sets in 15 + +languages, and a ground-truth English training set. The training set has been machine-translated to the remaining 14 languages, providing synthetic training data for these languages as well. We evaluate our model on cross-lingual transfer from English to other languages in two modes: (i) zero-shot: the model is fine-tuned only using the English training data and (ii) translate-train-all: the English training set is machine-translated to each language and we fine-tune a multilingual model on all training sets. For translations, we use the original XNLI data for consistency. + +PAWS-X The PAWS (Paraphrase Adversaries from Word Scrambling) dataset (Zhang et al., 2019) requires to determine whether two sentences are paraphrases. We use the subset of the PAWS dev and test sets translated to six other languages by professional translators, dubbed as PAWS-X (Yang et al., 2019) for evaluation, while using the PAWS set for training. + +XQuAD The English SQuAD v1.1(Rajpurkar et al., 2016) requires identifying the answer to a question as a span in the corresponding paragraph. In XQuAD(Artetxe et al., 2019), a subset of the English dev set was translated into ten other languages by professional translators which is then used for evaluation. + +MLQA The Multilingual Question Answering (Lewis et al., 2019) dataset is another crosslingual question answering dataset. In this dataset, the evaluation data for English and six other languages was obtained by automatically mining target language sentences that are parallel to sentences in English from Wikipedia, crowd-sourcing annotations in English, and translating the question and aligning the answer spans in the target languages. We use the SQuAD v1.1 (Rajpurkar et al., 2016) training data for training and evaluate on the test data of the corresponding task. + +TyDiQA-GP We use the gold passage version of the Typologically Diverse Question Answering(Clark et al., 2020a) dataset, a benchmark for information-seeking question answering, which covers nine languages. The gold passage version is a simplified version of the primary task, which uses only the gold passage as context and excludes unanswerable questions. It is thus similar to XQuAD and MLQA, while being more challenging as questions have been written without seeing the answers, + +![](images/8d030b18e41947353a3790d19e83175920e1010d98138fd5ade0930e8fb556ca.jpg) +(a) M2M 100 Sampling + +![](images/4ed02ac8aeb66ab2c7d0ec7046771507a209aef8af270ddcb6eef95dca82e9a0.jpg) +(b) Proposed Sampling +Figure 6: Density plots for our probability distributions obtained for sampling strategies for M2M 100 vs our proposed strategy for all languages in the training set. + +leading to $3 \times$ and $2 \times$ less lexical overlap compared to XQuAD and MLQA respectively. We use the English training data for training and evaluate on the test sets of the target languages. + +GLUE and SQuAD 2.0 We evaluate English performance of our model on the GLUE benchmark (Wang et al., 2018) which is a benchmark of eight diverse NLU tasks spanning over single-sentence tasks (CoLA, SST-2), similarity and paraphrase tasks (MRPC, STS-B, QQP) and inference tasks (RTE, MNLI, QNLI). The benchmark is also varied in terms of the training data sizes across tasks which makes it an effective benchmark for testing NLU capabilities of a pretrained model in a robust fashion. We also evaluate the English performance on SQuAD 2.0 (Rajpurkar et al., 2018b) task which is a collection of 100k crowdsourced question/answer pairs collected from Wikipedia where given a passage and a question, the task is to predict the answer span in the passage. The task also has the possibility that no answer exists, making the problem more grounded. + +# C Sampling Sparsity Across All Language Pairs + +Figure 6 shows the sampling distribution as induced by the M2M sampling method and by our proposed method for all language pair directions. Our proposed method induces a much less sparse distribution, resulting in less data wastage. + +# D Detailed Performance on All Tasks and Languages + +We present the detailed results associated with all tasks and languages in this section. + +
ModelAvgendeesfrjakozh
Zero-shot Crosslingual Transfer
Base
mT586.495.489.489.691.279.878.581.1
XLM-E87.094.989.490.390.581.178.983.8
XY-LENT89.795.592.392.593.28483.786.7
Large
mT588.996.191.39292.782.582.784.7
XLM-R86.494.789.790.190.478.77982.3
XLM-E89.095.991.391.792.482.982.586.4
XY-LENT90.496.592.793.293.684.684.687.4
XL
mT589.69692.892.792.483.683.186.5
XLM-E90.395.993.293.192.984.884.787.4
XY-LENT91.095.992.793.293.786.987.087.8
XXL
mT59096.392.992.692.784.583.987.2
Translate-Train
Base
mT589.395.590.991.492.583.684.886.4
XLM-E91.195.793.192.893.386.687.888.7
XY-LENT91.896.293.693.694.287.28989.1
Large
mT591.296.492.793.393.686.587.488.4
XLM-E91.996.093.693.494.287.889.289.0
XY-LENT92.496.794.994.194.387.389.789.5
XL
mT591.096.492.593.193.685.586.989.0
XLM-E92.296.193.993.694.988.189.489.3
XY-LENT92.697.194.294.695.388.488.889.8
XXL
mT591.596.192.993.694.28787.989.0
+ +Table 10: PAWS-X accuracy scores for each language + +
Model# ParamsAvgenfresdeelbgrutrarvithzhhiswur
Cross-lingual zero-shot transfer (models fine-tune on English data only)
Base
mT5580M75.484.779.180.377.477.178.677.172.873.374.273.274.170.869.468.3
XLM-R225M76.285.879.780.778.777.579.678.174.273.876.574.676.772.466.568.3
XLM-E477M78.187.381.982.48180.281.179.777.776.478.576.279.072.769.668.3
XY-LENT mCCA477M79.587.882.983.881.581.781.880.879.179.179.877.779.374.672.769.9
XY-LENT DRO + CCM477M79.787.382.283.782.682.082.580.278.579.080.177.080.374.474.970.2
XY-LENT CCM477M80.587.783.784.783.7828381.579.379.780.377.980.276.175.571.6
Large
XLM-RLarge550M80.989.184.185.183.982.98481.279.679.880.878.180.276.973.973.8
mT5Large1.2B81.189.484.184.283.483.284.181.580.179.88179.480.377.675.473.5
XLM-ELarge840M81.389.484.785.584.483.584.181.981.380.781.279.281.576.574.172.4
XY-LENTLarge814M8390.18686.785.485.785.383.282.683.482.881.082.578.378.174.3
XL
XLM-RXL3.5B82.390.785.586.584.68485.282.781.781.682.479.481.778.575.374.3
mT5XL3.7B82.990.685.381.385.885.485.483.78282.281.880.982.780.478.677.0
XLM-ExL2.2B83.791.386.887.486.785.885.984.283.482.783.480.983.180.277.675.7
XY-LENTXL2.1B84.892.287.488.787.387.287.383.88484.685.181.983.981.680.577.0
XXL
XLM-RXXL10.7B83.191.686.287.38785.185.782.58282.58379.582.679.876.274.9
mT5XXL13B85.091.686.987.887.387.387.785.183.884.579.881.783.683.280.384.6
Translate-train (models fine-tune on English training data plus translations in all target languages)
Base
mT5Base300M75.98277.979.177.778.178.576.574.874.474.5757672.271.570.4
XLM-RBase225M79.185.481.482.280.380.481.379.778.677.379.777.980.276.173.173.0
XLM-ExBase477M81.788.283.884.783.983.584.182.681.681.182.681.082.577.875.273.7
XY-LENTmCCABase477M82.488.084.785.684.283.884.483.382.182.282.781.482.979.477.373.3
XY-LENT CCMBase477M82.988.785.686.185.385.285.883.183.182.983.381.083.779.678.172.7
Large
mT5Large1.2B81.888.383.884.984.083.784.182.081.080.381.379.981.779.876.475.9
XLM-RLarge550M83.689.185.186.685.785.385.983.583.283.183.781.583.781.67878.1
XLM-ExLarge840M84.190.186.887.186.086.186.484.883.583.784.481.984.981.278.576.4
XY-LENTLarge814M84.990.287.487.986.787.087.485.084.784.885.083.485.082.080.975.9
XL
mT5XL3.7B84.890.986.887.486.886.486.884.984.484.283.982.38483.181.379.4
XLM-RXL3.5B85.491.187.288.18787.487.885.385.285.386.283.885.383.179.878.2
XLM-ExL2.2B85.590.987.488.387.487.287.685.185.185.186.183.785.482.581.378.9
XY-LENTXL2.1B87.192.288.989.789.189.189.186.286.887.087.385.286.784.583.280.8
XXL
XLM-RXXL10.7B86.091.587.688.787.887.488.285.685.185.886.383.985.684.681.780.6
mT5XXL13B87.892.789.19089.889.589.487.687.187.287.585.686.586.584.383.8
+ +Table 11: XNLI accuracy scores for each language + +
ModelenardeeshivizhAvg
Base
mT581.7/66.957.1/36.962.1/43.267.1/47.255.4/37.965.9/44.161.6/38.664.4/45.0
XLM-E82.1/69.262.4/42.465.7/50.771.2/53.165.12/47.569.8/48.864.6/41.568.7/50.5
XY-LENT83.1/70.363.9/43.968.9/54.073.3/55.169.0/51.772.7/52.068.0/45.271.3/53.2
Large
XLM-R80.6/67.863.1/43.568.5/53.674.1/56.069.2/51.671.3/50.968.0/45.470.7/52.7
mT584.9/70.765.3/44.668.9/51.873.5/54.166.9/47.772.5/50.766.2/42.071.2/51.7
XLM-E84.1/71.266.6/46.370.0/54.874.7/56.871.0/53.374.6/53.668.8/44.972.8/54.4
XY-LENT85.0/72.368.0/47.672.1/56.975.4/57.172.9/54.775.4/54.071.2/47.674.3/55.7
XL
mT585.5/71.968.0/47.470.5/54.475.2/56.370.5/51.074.2/52.870.5/47.273.5/54.4
XLM-R85.1/72.666.7/46.270.5/55.574.3/56.972.2/54.774.4/52.970.9/48.573.4/55.3
XLM-E85.2/72.668.1/47.671.1/56.475.7/57.473.1/55.275.4/53.971.3/47.774.3/55.8
XY-LENT85.4/72.469.0/48.573.0/57.776.8/58.675.0/56.576.2/54.772.1/48.675.4/56.7
XXL
XLM-R85.5/72.468.6/48.472.7/57.875.4/57.673.7/55.876.0/55.071.7/48.974.8/56.6
mT586.7/73.570.7/50.474.0/57.876.8/58.475.6/57.376.4/56.071.8/48.876.0/57.4
+ +Table 12: MLQA results (F1/EM) for each language. + +
ModelenarbnfiidkoruswteAvg
Base
mT571.8/60.967.1/50.440.7/22.167.0/52.271.3/54.549.5/37.754.9/32.660.4/43.940.6/31.158.1/42.8
XLM-E71.8/57.768.3/50.060.6/45.168.0/52.673.2/56.153.2/40.263.4/38.464.4/48.141.3/27.262.7/46.2
XY-LENT73.4/59.171.6/54.163.7/51.366.5/52.377.0/63.457.2/43.568.0/49.067.3/51.159.4/39.367.1/51.5
Large
XLM-R71.5/56.867.6/40.464.0/47.870.5/53.277.4/61.931.9/10.967.0/42.166.1/48.170.1/43.665.1/45.0
mT571.6/58.960.5/40.442.0/23.964.6/48.867.0/49.247.6/37.358.9/36.865.7/45.341.9/29.757.8/41.2
XLM-E74.7/62.075.2/57.172.9/56.669.9/54.978.9/66.761.4/47.868.0/44.972.2/56.772.8/45.671.8/54.7
XY-LENT75.6/62.077.0/59.974.6/62.874.0/57.580.7/67.166.4/52.269.5/46.376.0/61.372.2/48.474.0/57.5
XL
mT580.3/70.981.7/65.574.5/57.579.4/65.383.5/70.470.0/60.571.6/47.877.3/59.777.9/55.877.4/61.5
XLM-E79.1/64.378.2/60.376.9/64.175.0/60.284.4/70.366.7/54.876.4/56.378.3/63.775.6/51.176.7/60.6
XY-LENT78.2/64.179.3/60.878.8/67.377.7/63.284.9/70.668.5/56.277.0/57.579.9/66.377.7/53.278.0/62.1
XXL
mT583.7/72.582.8/66.080.2/63.783.3/70.285.3/73.376.2/64.176.6/55.881.9/66.179.2/58.781.0/65.6
+ +Table 13: TYDi QA GP results (F1/EM) for each language. + +
ModelenardeeleshiruthtrvizhAvg
Base
mT584.6/71.763.8/44.373.8/54.559.6/35.674.8/56.160.3/43.457.8/34.757.6/45.767.9/48.270.7/50.366.1/54.167.0/49.0
XLM-E84.9/72.970.5/54.378.9/63.275.6/57.878.4/60.871.2/54.575.9/59.768.7/58.871.6/55.475.9/56.465.5/56.974.3/59.2
XY-LENT87.2/76.072.9/56.080.0/64.579.6/63.581.2/63.175.3/59.777.7/61.570.9/59.574.0/58.777.4/59.269.0/61.76.8/62.1
Large
XLM-R86.5/75.768.6/49.080.4/63.479.8/61.782.0/63.976.7/59.780.1/64.374.2/62.875.9/59.379.1/59.059.3/50.076.6/60.8
mT588.4/77.375.2/56.780.0/62.977.5/57.681.8/64.273.4/56.674.7/56.973.4/62.076.5/56.379.4/60.375.9/65.577.8/61.5
XLM-E87.1/75.575.1/58.182.1/66.080.9/64.082.5/64.377.5/61.380.3/63.773.4/59.476.8/60.879.2/59.070.5/61.678.7/63.1
XY-LENT88.1/77.476.3/59.682.6/67.182.5/65.183.9/66.677.9/61.380.2/63.674.3/63.878.5/62.980.6/61.671.4/64.679.7/64.9
XL
mT588.8/78.177.4/60.880.4/63.580.4/61.282.7/64.576.1/60.376.2/58.874.2/62.577.7/58.480.5/60.880.5/71.079.5/63.6
XLM-R89.5/79.078.4/61.681.3/64.182.3/63.984.6/66.278.8/63.281.5/65.076.0/65.573.9/57.981.7/61.872.3/66.180.0/64.9
XLM-E89.1/79.078.5/62.082.4/66.981.8/65.584.3/67.179.3/63.482.2/66.975.4/65.178.3/62.581.5/62.971.6/65.180.4/66.0
XY-LENT89.4/79.279.2/62.084.1/68.383.5/66.184.9/66.680.4/64.582.9/67.175.0/61.779.5/64.583.2/64.172.7/65.081.3/66.3
XXL
XLM-R89.3/79.480.1/63.782.7/65.883.4/65.583.8/66.080.7/65.482.4/65.476.6/65.676.8/61.782.2/63.074.1/67.481.1/66.3
mT590.9/80.180.3/62.683.1/65.583.3/65.585.1/68.181.7/65.979.3/63.677.8/66.180.2/60.983.1/63.683.1/73.482.5/66.8
+ +# E Hyperparameters for Fine-Tuning + +In Table 15, we report the hyperparameters for fine-tuning XY-LENT on the downstream tasks. + +Table 14: XQuAD results (F1/EM) for each language. + +
XQuADMLQATyDiQAXNLIPAWS-X
Batch size3232323232
Learning rate{2,3,4}e-5{2,3,4}e-5{2,3,4}e-5{5,...,8}e-6{8,9,10,20}e-6
LR scheduleLinearLinearLinearLinearLinear
Warmup10%10%10%12,500 steps10%
Weight decay00000
Epochs4{2,3,4}{10,20,40}1010
+ +Table 15: Hyperparameters used for fine-tuning on the downstream tasks. + +A For every submission: + +A1. Did you describe the limitations of your work? 8 +A2. Did you discuss any potential risks of your work? 8 +A3. Do the abstract and introduction summarize the paper's main claims? +A4. Have you used AI writing assistants when working on this paper? Left blank. + +B Did you use or create scientific artifacts? + +Left blank. + +B1. Did you cite the creators of artifacts you used? No response. +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? No response. +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? No response. +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? No response. +□ B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? No response. +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. No response. + +C Did you run computational experiments? + +5 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? Appendix A + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? Appendix A and E +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? 6 +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? No response. +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? No response. +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? No response. +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? No response. +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? No response. \ No newline at end of file diff --git a/beyondenglishcentricbitextsforbettermultilinguallanguagerepresentationlearning/images.zip b/beyondenglishcentricbitextsforbettermultilinguallanguagerepresentationlearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..286954b40fe8a7d264759027b5f546e68729c77c --- /dev/null +++ b/beyondenglishcentricbitextsforbettermultilinguallanguagerepresentationlearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e8fb0b138ac560a1e22ccf83d3b57fe5c728bc0830a718233d206f83228e3732 +size 1597885 diff --git a/beyondenglishcentricbitextsforbettermultilinguallanguagerepresentationlearning/layout.json b/beyondenglishcentricbitextsforbettermultilinguallanguagerepresentationlearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..c966736fa046cb374a6ad858405ed7c522bf1f3b --- /dev/null +++ b/beyondenglishcentricbitextsforbettermultilinguallanguagerepresentationlearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:76fbc5dd53fed665d9edc9003d0915475357e7cddac2001ec070e6cdb3df3da3 +size 531999 diff --git a/bidirectionalgenerativeframeworkforcrossdomainaspectbasedsentimentanalysis/0d5bf3cd-a628-4f07-8c02-f11e5af9b0dc_content_list.json b/bidirectionalgenerativeframeworkforcrossdomainaspectbasedsentimentanalysis/0d5bf3cd-a628-4f07-8c02-f11e5af9b0dc_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..9f22380d61d820394111a67d057ee446105d724d --- /dev/null +++ b/bidirectionalgenerativeframeworkforcrossdomainaspectbasedsentimentanalysis/0d5bf3cd-a628-4f07-8c02-f11e5af9b0dc_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f5da9ef554fc10fbfcf8a9d7a2730af0b13da1d7c6d7889b7881bb08e6e02545 +size 90008 diff --git a/bidirectionalgenerativeframeworkforcrossdomainaspectbasedsentimentanalysis/0d5bf3cd-a628-4f07-8c02-f11e5af9b0dc_model.json b/bidirectionalgenerativeframeworkforcrossdomainaspectbasedsentimentanalysis/0d5bf3cd-a628-4f07-8c02-f11e5af9b0dc_model.json new file mode 100644 index 0000000000000000000000000000000000000000..e2e3c58a9e89100fdb2fadfed5bee87bf8913f8e --- /dev/null +++ b/bidirectionalgenerativeframeworkforcrossdomainaspectbasedsentimentanalysis/0d5bf3cd-a628-4f07-8c02-f11e5af9b0dc_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4bbe23756f2a68f7832509ca078bdfbe2fdb4d90d54fef30750351a4553650a6 +size 109995 diff --git a/bidirectionalgenerativeframeworkforcrossdomainaspectbasedsentimentanalysis/0d5bf3cd-a628-4f07-8c02-f11e5af9b0dc_origin.pdf b/bidirectionalgenerativeframeworkforcrossdomainaspectbasedsentimentanalysis/0d5bf3cd-a628-4f07-8c02-f11e5af9b0dc_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a5f371bd3dad4613c2056b3bf11a8de6239ec077 --- /dev/null +++ b/bidirectionalgenerativeframeworkforcrossdomainaspectbasedsentimentanalysis/0d5bf3cd-a628-4f07-8c02-f11e5af9b0dc_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2cee13f43271161fc1265af6373bea91f3efc57820ac9f9c4eb6f2d80b327043 +size 459132 diff --git a/bidirectionalgenerativeframeworkforcrossdomainaspectbasedsentimentanalysis/full.md b/bidirectionalgenerativeframeworkforcrossdomainaspectbasedsentimentanalysis/full.md new file mode 100644 index 0000000000000000000000000000000000000000..4d2e03028cb387b3d82fffa79f30ddd2f25ba1f1 --- /dev/null +++ b/bidirectionalgenerativeframeworkforcrossdomainaspectbasedsentimentanalysis/full.md @@ -0,0 +1,315 @@ +# Bidirectional Generative Framework for Cross-domain Aspect-based Sentiment Analysis + +Yue Deng *1,2 Wenxuan Zhang†1 Sinno Jialin Pan2,3 Lidong Bing1 +1DAMO Academy, Alibaba Group 2 Nanyang Technological University, Singapore +3Chinese University of Hong Kong +{yue.deng, saike.zwx, l.bing}@alibaba-inc.com +sinnopan@cuhk.edu.hk + +# Abstract + +Cross-domain aspect-based sentiment analysis (ABSA) aims to perform various fine-grained sentiment analysis tasks on a target domain by transferring knowledge from a source domain. Since labeled data only exists in the source domain, a model is expected to bridge the domain gap for tackling cross-domain ABSA. Though domain adaptation methods have proven to be effective, most of them are based on a discriminative model, which needs to be specifically designed for different ABSA tasks. To offer a more general solution, we propose a unified bidirectional generative framework to tackle various cross-domain ABSA tasks. Specifically, our framework trains a generative model in both text-to-label and label-to-text directions. The former transforms each task into a unified format to learn domain-agnostic features, and the latter generates natural sentences from noisy labels for data augmentation, with which a more accurate model can be trained. To investigate the effectiveness and generality of our framework, we conduct extensive experiments on four cross-domain ABSA tasks and present new state-of-the-art results on all tasks. Our data and code are publicly available at https://github.com/DAMO-NLP-SG/BGCA. + +# 1 Introduction + +Aspect-based sentiment analysis (ABSA) is the task of analyzing people's sentiments at the aspect level. It often involves several sentiment elements, including aspects, opinions, and sentiments (Liu, 2012; Zhang et al., 2022). For instance, given the sentence "The apple is sweet.", the aspect is apple, its opinion is sweet, and the corresponding sentiment polarity is Positive. ABSA has attracted increasing attention in the last decade, and various tasks have been proposed to extract either single or + +multiple sentiment elements under different scenarios. For example, aspect sentiment classification (ASC) predicts the sentiment polarity of a given aspect target (Chen et al., 2017; Li et al., 2018a; Xu et al., 2020a) and aspect term extraction (ATE) extracts aspects given the sentence (Li et al., 2018b; Liu et al., 2015), while aspect sentiment triplet extraction (ASTE) predicts all three elements in the triplet format (Peng et al., 2020; Xu et al., 2021). + +The main research line of ABSA focuses on solving various tasks within a specific domain. However, in real-world applications, such as E-commerce websites, there often exist a wide variety of domains. Existing methods often struggle when applying models trained in one domain to unseen domains, due to the variability of aspect and opinion expressions across different domains (Ding et al., 2017; Wang and Pan, 2018, 2019). Moreover, manually labeling data for each domain can be costly and time-consuming, particularly for ABSA requiring fine-grained aspect-level annotation. This motivates the task of cross-domain ABSA, where only labeled data in the source domain is available and the knowledge is expected to be transferable to the target domain that only has unlabeled data. + +To enable effective cross-domain ABSA, domain adaptation techniques (Blitzer et al., 2006; Pan and Yang, 2010) are employed to transfer learnt knowledge from the labeled source domain to the unlabeled target domain. They either focus on learning domain-agnostic features (Ding et al., 2017; Wang and Pan, 2018; Li et al., 2019c), or adapt the training distribution to the target domain (Gong et al., 2020; Yu et al., 2021; Li et al., 2022). However, the majority of these works are based on discriminative models and need task-specific designs, making a cross-domain model designed for one ABSA task difficult to be extended for other tasks (Ding et al., 2017; Wang and Pan, 2018; Li et al., 2019c; Gong et al., 2020). In addition, some methods further require external resources, such as domain-specific + +opinion lexicons (Yu et al., 2021), or extra models for augmenting pseudo-labeled target domain data (Yu et al., 2021; Li et al., 2022), which narrows their application scenarios. + +In a recent research line, pre-trained generative models like BART (Lewis et al., 2020) and T5 (Raffel et al., 2020) have demonstrated impressive power in unifying various ABSA tasks without any task-specific design and external resources. By formulating each task as a sequence-to-sequence problem and producing the desired label words, i.e., the desired sentiment elements, they achieve substantial improvements on various ABSA tasks (Zhang et al., 2021b,c; Yan et al., 2021; Mao et al., 2022). Despite their success in supervised in-domain settings, their effectiveness has yet to be verified in the cross-domain setting. Moreover, unlabeled data of the target domain, which is usually easy to collect, has shown to be of great importance for bringing in domain-specific knowledge (Pan and Yang, 2010). How to exploit such data with the generative formulation remains a challenge. + +Towards this end, we propose a Bidirectional Generative Cross-domain ABSA (BGCA) framework to fully exploit generative methods for various cross-domain ABSA tasks. BGCA employs a unified sequence-to-sequence format but contains two reverse directions: text-to-label and label-to-text. The text-to-label direction converts an ABSA task into a text generation problem, using the original sentence as input and a sequence of sentiment tuples as output. After training on the source labeled data $\mathcal{D}^S$ , the model can then directly conduct inference on the unlabeled data $\mathbf{x}^T$ of the target domain $\mathcal{D}^T$ to get the prediction $\hat{\mathbf{y}}^T$ . The prediction can be used as pseudo-labeled data to continue-train the text-to-label model. However, $\hat{\mathbf{y}}^T$ is inevitably less accurate due to the domain gap between the source and target domains. This is where the reverse direction, i.e., label-to-text, plays its role. + +Specifically, we first reverse the order of input and output from the text-to-label stage of the source domain to train a label-to-text model. Then this model takes the prediction $\hat{\mathbf{y}}^T$ as input and generates a coherent natural language text $\hat{\mathbf{x}}^T$ that contains the label words of $\hat{\mathbf{y}}^T$ . Note that even though the prediction $\hat{\mathbf{y}}^T$ could be inaccurate regarding the original unlabeled data $\mathbf{x}^T$ , the generated sentence $\hat{\mathbf{x}}^T$ can plausibly well match with $\hat{\mathbf{y}}^T$ . This is because the label-to-text model was trained to generate an output text that can appropriately describe + +the input labels. Consequently, $\hat{\mathbf{y}}^T$ , drawn from the target domain, is able to introduce in-domain knowledge, thereby enhancing the overall understanding of the domain-specific information. In addition, $\hat{\mathbf{x}}^T$ aligns more closely with $\hat{\mathbf{y}}^T$ compared to $\mathbf{x}^T$ , which effectively minimizes the prediction noise. As such, they can be paired together to create a more accurate and reliable generated dataset. Finally, the generated target data $\mathcal{D}^G$ and the labeled source data $\mathcal{D}^S$ can be combined to train the model in the text-to-label direction, which effectively enriches the model knowledge in the target domain. + +Our proposed BGCA framework exhibits some unique advantages. Firstly, it effectively utilizes the unlabeled target domain data by capturing important domain-specific words (i.e., sentiment elements) of the target domain in the first text-to-label stage. In the meantime, it bypasses the issue from the domain gap since it takes the noisy prediction as input and obtains more accurate text-label pairs in the label-to-text stage. Secondly, we fully leverage generative models' encoding and generating capabilities to predict labels and generate natural sentences within a unified framework, which is infeasible for discriminative models. This allows the model to seamlessly switch between the roles of predictor and generator. Finally, BGCA utilizes a shared model to perform training in both directions, allowing for a more comprehensive understanding of the association between sentences and labels. + +In summary, our main contributions are: (1) We evaluate generative methods on four cross-domain ABSA tasks, including aspect term extraction (ATE), unified ABSA (UABSA), aspect opinion pair extraction (AOPE), and aspect sentiment triplet extraction (ASTE), and find that the generative approach is an effective solution. Without any unlabeled target domain data, it can already achieve better performance than previous discriminative methods. (2) We propose a novel BGCA framework to effectively utilize unlabeled target domain data and train a shared model in reverse directions. It can provide high-quality augmented data by generating coherent sentences given noisy labels and a unified solution to learn the association between sentences and labels thoroughly. (3) Our proposed method achieves new state-of-the-art results on all tasks, which validate the effectiveness and generality of our framework. + +![](images/f7b159d8864b9f716685ceb4a90def4397ea0691590727daba61250f2a94c15b.jpg) +Figure 1: Overview of our proposed BGCA framework, which includes text-to-label and label-to-text directions. We take examples from the ASTE task for illustration. Underlining and square brackets indicate gold aspects and gold opinions, respectively. The gold labels for the target domain are shown for demonstration only. The generated dataset will be combined with the labeled source dataset to conduct final training in a text-to-label manner. + +# 2 Related Work + +Cross-domain ABSA Cross-domain ABSA aims to utilize labeled data from a source domain to gain knowledge that can be applied to a target domain where only unlabeled data is available. The main research line of cross-domain ABSA involves two paradigms: feature-based adaptation and data-based adaptation (Zhang et al., 2022). Feature-based adaptation focuses on learning domain-invariant features. Some have utilized domain-independent syntactic rules to minimize domain gap (Jakob and Gurevych, 2010; Chernyshevich, 2014; Ding et al., 2017; Wang and Pan, 2018, 2019), while others have employed domain discriminators to encourage the learning of universal features (Li et al., 2019c; Yang et al., 2021; Zhou et al., 2021; Zhang et al., 2021a). On the other hand, data-based adaptation aims to adapt the training data distribution to the target domain. They either adjust the importance of individual training instances through re-weighting (Xia et al., 2014; Gong et al., 2020), or generate additional training data using another pre-trained model (Yu et al., 2021; Li et al., 2022). Despite their effectiveness, most of these works require task-specific design or external resources, preventing easy extensions to other cross-domain ABSA tasks. + +Generative ABSA Recently, generative models have obtained remarkable results in unifying various ABSA tasks. By formulating each ABSA task as a sequence-to-sequence problem, generative models can output the desired sentiment element words (Zhang et al., 2021c; Mao et al., 2022) + +
TaskOutput TupleExample Output
ATE(a)/apple)
UABSA(a,s)(apple, positive)
AOPE(a,o)(apple, sweet)
ASTE(a,o,s)(apple, sweet, positive)
+ +Table 1: Output tuple of various ABSA tasks, and example output given the sentence "The apple is sweet.", where $a$ , $o$ and $s$ denote aspect,opinion and sentiment. + +or their indexes (Yan et al., 2021) directly. In addition, some works successfully adopt the generative model on single ABSA tasks by converting the task to a natural language generation or paraphrase generation problem (Liu et al., 2021; Zhang et al., 2021b). Nevertheless, their potential is not explored under the cross-domain setting. + +# 3 Problem Formulation + +To examine the generality of our proposed framework, we consider four ABSA tasks, including ATE, UABSA, AOPE, and ASTE. Given a sentence $\mathbf{x} = [w_{1}, w_{2}, \dots, w_{n}]$ with $n$ words, the task is to predict a set of sentiment tuples denoted as $\mathbf{y} = \{t_{i}\}_{i=1}^{|t|}$ , where each tuple $t_{i}$ may include a single element from aspect $(a)$ , opinion $(o)$ , and sentiment $(s)$ , or multiple elements in pair or triplet format. The element within each tuple depends on the specific ABSA task, detailed in Table 1. + +Under the cross-domain ABSA setting, the training dataset consists of a set of labeled sentences from a source domain $\mathcal{D}_{\mathcal{S}} = \{\mathbf{x}_i^{\mathcal{S}},\mathbf{y}_i^{\mathcal{S}}\}_{i = 1}^{N_{\mathcal{S}}}$ and a set of unlabeled sentences from a target domain $\mathcal{D}_{\mathcal{T}} = \{\mathbf{x}_j^{\mathcal{T}}\}_{j = 1}^{N_{\mathcal{T}}}$ . The goal is to leverage both $\mathcal{D}_{\mathcal{S}}$ + +and $\mathcal{D}_{\mathcal{T}}$ to train a model, which can predict the label of test data from the target domain. + +# 4 Methodology + +We introduce our Bidirectional Generative Cross-domain ABSA (BGCA) framework in this section. As shown in Figure 1, it contains two sequential stages, namely text-to-label, and label-to-text, to obtain high-quality augmented data. The text-to-label direction (on the top part) converts various tasks into a unified format and can produce noisy predictions on the unlabeled target data, whereas the label-to-text direction (on the bottom part) utilizes such noisy predictions to generate natural sentences containing the given labels so as to augment high-quality training data and enriches model knowledge of the target domain. + +# 4.1 Text-to-label + +The text-to-label direction unifies different ABSA tasks into a sequence-to-sequence format. It takes a sentence as input and outputs a sequence of sentiment tuples extracted from the sentence. We annotate the output sequence with predefined tagger tokens to ensure a valid format, which can prevent decoding ambiguity. The tagger tokens are $k$ continuous tokens $\{\langle m_j\rangle \}_{j = 1}^k$ initialized by embedding of the words $\{m_j\}_{j = 1}^k$ . Specifically, we use $\langle aspect\rangle$ , $\langle opinion\rangle$ to mark aspect and opinion terms, and $\langle pos\rangle$ , $\langle neu\rangle$ , $\langle neg\rangle$ to annotate positive, neutral and negative sentiments. The output formats with the continuous taggers for different tasks are: + +ATE: $\mathbf{x} \Rightarrow \langle aspect \rangle a$ + +UABSA: $\mathbf{x} \Rightarrow \langle pos \rangle a$ (1) + +AOPE: $\mathbf{x} \Rightarrow \langle aspect \rangle a \langle opinion \rangle o$ (1) + +ASTE: $\mathbf{x} \Rightarrow \langle pos \rangle a \langle opinion \rangle o$ + +where $a$ and $o$ denote the aspect and the opinion terms, respectively. Taking ASTE as an example, we use the format of $\langle pos\rangle$ followed by the extracted aspect word(s), and $\langle opinion\rangle$ followed by the extracted opinion word(s) to annotate the positive opinion term expressed on the corresponding aspect term in a sentence. Based on this format, we are able to extract the aspect, opinion, and sentiment from the output sequence to form a complete sentiment tuple through simple regular expressions. + +The text-to-label direction is trained on $\{\mathbf{x},\mathbf{y}\}$ pairs from $\mathcal{D}_S$ by minimizing the standard maximum likelihood loss: + +$$ +\mathcal {L} = - \sum_ {i = - 1} ^ {l} \log p (y _ {i} \mid \mathbf {x}; y _ {\leq i - 1}), \tag {2} +$$ + +where $l$ denotes the sequence length. + +After training on the source labeled data $\mathcal{D}_S$ , we can directly conduct inference on the target domain $\mathcal{D}_{\mathcal{T}}$ to extract the sentiment tuples $\hat{\mathbf{y}}^T$ . During the inference, we employ constrained decoding (Cao et al., 2021) to ensure each generated token $\hat{y}_i^T$ of the output sequence is selected from the input sentence or the predefined tagger tokens, in order to prevent invalid output sequences and ensure that the output is relevant to the specific domain: + +$$ +\hat {y} _ {i} ^ {\mathcal {T}} = \underset {y _ {j} \in \mathcal {U}} {\operatorname {a r g m a x}} p \left(y _ {j} \mid \mathbf {x} ^ {\mathcal {T}}; \hat {y} _ {\leq i - 1} ^ {\mathcal {T}}\right), \tag {3} +$$ + +where $\mathcal{U} = \{w_i\}_{i=1}^n \cup \{\langle m_j \rangle\}_{j=1}^k$ . + +# 4.2 Label-to-text + +Although the text-to-label model can be directly applied for prediction on the target domain, it does not exploit the unlabeled target domain data in the training process, which has been proven to be crucial for incorporating target-domain knowledge (Pan and Yang, 2010). One straightforward way to eliminate this problem is to use $(\mathbf{x}^{\mathcal{T}},\hat{\mathbf{y}}^{\mathcal{T}})$ as pseudo-labeled data to continue training the above text-to-label model. However, such naive self-training suffers from the noise of $\hat{\mathbf{y}}^{\mathcal{T}}$ . Our label-to-text stage alleviates this weakness by pairing the label $\hat{\mathbf{y}}^{\mathcal{T}}$ with a new sentence that matches this label better. + +Specifically, we continue to train the above model using the labeled dataset from $\mathcal{D}_S$ . Nevertheless, the training pairs are reversed into the label-to-text direction, where the input is now the sequence $\mathbf{y}$ with sentiment tuples, and the output is the original sentence $\mathbf{x}$ : + +ATE: $\langle aspect\rangle a\Rightarrow \mathbf{x}$ + +UABSA: $\langle pos\rangle a\Rightarrow \mathbf{x}$ OPE: (constr) s/option) 4 + +AOPE: $\langle aspect\rangle a\langle opinion\rangle o\Rightarrow \mathbf{x}$ + +ASTE: $\langle pos\rangle a\langle opinion\rangle o\Rightarrow \mathbf{x}$ + +Similarly, the label-to-text direction is trained on $\{\mathbf{y},\mathbf{x}\}$ pairs from $\mathcal{D}_{\mathcal{S}}$ by minimizing the standard maximum likelihood loss: + +$$ +\mathcal {L} = - \sum_ {i = - 1} ^ {l ^ {\prime}} \log p (x _ {i} \mid \mathbf {y}; x _ {\leq i - 1}), \tag {5} +$$ + +and $l^{\prime}$ refers to the sequence length. + +After training, we use the sentiment tuples $\hat{\mathbf{y}}^T$ , extracted from a target domain unlabeled data $\mathbf{x}^T$ , + +
TaskATE&UABSAAOPEASTE
LRDSL14R14R15R16L14R14R15R16
Train3045387725571492103514626789719061266605857
Dev30438725514911616376108219310148210
Test80021581279747343500325328328492322326
+ +Table 2: The statistics of ATE, UABSA, AOPE and ASTE tasks + +to generate a natural sentence $\hat{\mathbf{x}}^{\mathcal{T}}$ incorporating the sentiment information in $\hat{\mathbf{y}}^{\mathcal{T}}$ . To ensure fluency and naturalness, we decode the whole vocabulary set: + +$$ +\hat {x} _ {i} ^ {\mathcal {T}} = \operatorname * {a r g m a x} _ {x _ {j} \in \mathcal {V}} p \left(x _ {j} \mid \hat {\mathbf {y}} ^ {\mathcal {T}}; \hat {x} _ {\leq i - 1} ^ {\mathcal {T}}\right), \tag {6} +$$ + +where $\mathcal{V}$ denotes the vocabulary of the model. + +The label-to-text stage thus augments a generated dataset $\mathcal{D}_{\mathcal{G}} = \{\hat{\mathbf{x}}_i^{\mathcal{T}},\hat{\mathbf{y}}_i^{\mathcal{T}}\}_{i = 1}^{N_{\mathcal{T}}}$ . By considering each natural sentence as a combination of context and sentiment elements, we can find that the generated sentence's context is produced by a model pre-trained on large-scale corpora and fine-tuned on the labeled source domain, while its sentiment elements such as aspects and opinions come from the target domain. Therefore, $\mathcal{D}_{\mathcal{G}}$ can play the role of an intermediary which connects the source and target domains through the generated sentences. + +As previously mentioned, due to the gap between source and target domains, the text-to-label model's prediction on unlabeled target data is noisy. Instead of improving the text-to-label model, which may be difficult, our label-to-text stage creates a sentence $\hat{\mathbf{x}}^T$ that is generated specifically for describing $\hat{\mathbf{y}}^T$ . Thus, even with the presence of noise in the extracted labels $\hat{\mathbf{y}}^T$ , the label-to-text stage offers a means of minimizing the negative impact and ultimately yields a more accurate pseudo-training sample. Finally, since these two stages train a shared model based on sentences and labels from two directions, it gives the model a more comprehensive understanding of the association between sentences and labels, leading to a more accurate prediction of labels for given sentences. + +# 4.3 Training + +Ideally, the generated dataset $\mathcal{D}_{\mathcal{G}}$ should fulfil the following requirements: 1) the natural sentence should exclusively contain sentiment elements that are labeled in the sentiment tuples, and should not include any additional sentiment elements; 2) the natural sentence should accurately convey all the sentiment elements as specified in the sentiment tuples without any omissions; 3) the sentiment tuples + +should be in a valid format and can be mapped back to the original labels; Therefore, we post-process $\{\hat{\mathbf{x}}^t,\hat{\mathbf{y}}^t\}$ pairs from $\mathcal{D}_{\mathcal{G}}$ by: 1) filtering out pairs with $\hat{\mathbf{y}}^t$ in invalid format or contains words not present in $\hat{\mathbf{x}}^t$ ; 2) utilizing the text-to-label model to eliminate pairs where $\hat{\mathbf{y}}^t$ is different from the model's prediction on $\hat{\mathbf{x}}^t$ . In the end, we combine the source domain $\mathcal{D}_{\mathcal{S}}$ , and the generated dataset $\mathcal{D}_{\mathcal{G}}$ as the ultimate training dataset and continue to train the same model in a text-to-label manner as outlined in Section 4.1. + +# 5 Experiments + +# 5.1 Experimental Setup + +Datasets We evaluate the proposed framework on four cross-domain ABSA tasks, including ATE, UABSA, AOPE, and ASTE. Datasets of these tasks mainly consist of four different domains, which are Laptop (L), Restaurant (R), Device (D), and Service (S). L, also referred to as L14, contains laptop reviews from SemEval ABSA challenge 2014 (Pontiki et al., 2014). R is a set of restaurant reviews based on SemEval ABSA challenges 2014, 2015, and 2016 (Pontiki et al., 2014, 2015, 2016), denoted as R14, R15, R16 for the AOPE and ASTE tasks. D contains digital device reviews provided by Toprak et al. (2010). S includes reviews from web service, introduced by Hu and Liu (2004). Specifically, we can perform the ATE and UABSA tasks on all four domains, whereas the AOPE and ASTE tasks can be conducted on L and R domains, with R being further divided into R14, R15, and R16. We follow the dataset setting provided by Yu et al. (2021) for the ATE and UABSA task, and Fan et al. (2019), Xu et al. (2020b) for the AOPE, ASTE task respectively. We show the statistics in Table 2. + +Settings We consider all possible transfers between each pair of domains for each task. Following previous work (Li et al., 2019a,b; Gong et al., 2020; Yu et al., 2021), we remove $\mathrm{D} \rightarrow \mathrm{L}$ and $\mathrm{L} \rightarrow \mathrm{D}$ for the ATE and UABSA tasks due to their domain similarity. Additionally, we exclude transfer pairs + +
MethodsS→RL→RD→RR→SL→SD→SR→LS→LR→DS→DAvg.
ATE
Hier-Joint†46.3948.6142.9627.1825.2229.2834.1133.0234.8135.0035.66
RNSCN†48.8952.1950.3930.4131.2135.5047.2334.0346.1632.4140.84
AD-SAL†52.0556.1251.5539.0238.2636.1145.0135.9943.7641.2143.91
BERTB-UDA†56.0851.9150.5434.6232.4934.5246.8743.9840.3438.3642.97
BERTB-CDRG†56.2660.0352.7142.3647.0841.8546.6539.5132.6036.9745.60
GAS61.2453.0256.4431.1932.1435.7252.2443.7642.2437.7744.58
BERTE-UDA†*59.0755.2456.4034.2130.6838.2554.0044.2542.4040.8345.53
BERTE-CDRG†*59.1768.6258.8547.6154.2942.2055.5641.7735.4336.5350.00
BGCA text-to-label60.0355.3955.8336.0235.4337.7354.1843.4542.4937.8945.84
BGCA label-to-text63.2069.5365.3345.8644.8554.0757.1346.1537.1538.2452.15
UABSA
Hier-Joint†31.1033.5432.8715.5613.9019.0420.7222.6524.5323.2423.72
RNSCN†33.2135.6534.6020.0416.5920.0326.6318.8733.2622.0026.09
AD-SAL†41.0343.0441.0128.0127.2026.6234.1327.0435.4433.5633.71
AHF46.5543.4944.5733.2333.0534.9634.8929.0137.3339.6137.67
BERTB-UDA†47.0945.4642.6833.1227.8928.0333.6834.7734.9332.1035.98
BERTB-CDRG†47.9249.7947.6435.1438.1437.2238.6833.6927.4634.0838.98
GAS54.6149.0653.4030.9929.6433.3443.5035.1239.2935.8140.48
BERTE-UDA†*53.9749.5251.8430.6727.7834.4143.9535.7640.3538.0540.63
BERTE-CDRG†*53.0957.9654.3940.8542.9638.8345.6635.0631.6234.2243.46
BGCA text-to-label54.1248.0852.6533.2630.6735.2644.5736.0141.1936.5541.24
BGCA label-to-text56.3961.6959.1243.2039.7647.9445.5236.4034.1636.5746.07
+ +Table 3: Results on cross-domain ATE and UABSA tasks. The best results are in bold. Results are the average F1 scores over 5 runs. $\dagger$ denotes results from Yu et al. (2021), and the others are based on our implementation. * represents methods that utilize external resources. + +between R14, R15, and R16 for the AOPE and ASTE tasks since they come from the same restaurant domain. As a result, there are ten transfer pairs for the ATE and UABSA tasks, and six transfer pairs for the AOPE and ASTE tasks, detailed in Table 3 and 4. We denote our proposed framework as BGCAlabel-to-text, which includes the bidirectional augmentation and utilizes the augmented data for training the final model. To investigate the effectiveness of the generative framework for cross-domain ABSA tasks, we also report the results with a single text-to-label direction, denoted as BGCAtext-to-label, which is essentially a zero-shot cross-domain method. + +Metrics We choose the Micro-F1 score as the evaluation metric for all tasks. A prediction is counted as correct if and only if all the predicted elements are exactly matched with gold labels. + +Implementation Details We choose T5 (Raffel et al., 2020) as our backbone model and use T5-base checkpoint from huggingface1. It is a transformer model (Vaswani et al., 2017) that utilizes the encoder-decoder architecture where all the pre + +training tasks are in sequence-to-sequence format. For simplicity, we use the Adam optimizer with a learning rate of 3e-4, a fixed batch size of 16, and a fixed gradient accumulation step of 2 for all tasks. Regarding training epochs for text-to-label, label-to-text, and final training, we search within a range in \{15, 20, 25, 30\} using the validation set of the source domain for selection. We train our model on a single NVIDIA V100 GPU. + +# 5.2 Baselines + +For cross-domain ATE and UABSA tasks, we follow previous works to compare with established baselines including Hier-Joint (Ding et al., 2017), RNSCN (Wang and Pan, 2018), AD-SAL (Li et al., 2019c), AHF (Zhou et al., 2021), $\mathrm{BERT}_{\mathrm{B / E}}$ UDA (Gong et al., 2020), and $\mathrm{BERT}_{\mathrm{B / E}}$ CDRG (Yu et al., 2021) where $\mathrm{BERT}_{\mathrm{B}}$ and $\mathrm{BERT}_{\mathrm{E}}$ refer to models based on the original BERT and the continually trained BERT on large-scale E-commerce data containing around 3.8 million reviews (Xu et al., 2019). All of these methods utilize unlabeled target data, and $\mathrm{BERT}_{\mathrm{B / E}}$ CDRG are trained in a self-training manner, which generates pseudo labels and retrain a new model with such labels. + +
MethodsR14→L14R15→L14R16→L14L14→R14L14→R15L14→R16Avg.
AOPE
SDRN45.3937.4538.6647.6341.3446.3642.81
RoBMRC52.3646.4443.6154.7048.6855.9750.29
SpanASTE51.9048.1547.3061.9755.5863.2654.69
GAS57.5853.2352.1764.6060.2666.6959.09
BGCA text-to-label58.5454.0651.9964.6158.7467.1959.19
BGCA label-to-text60.8255.2254.4868.0465.3170.3462.37
ASTE
RoBMRC43.9040.1937.8157.1345.6252.0546.12
SpanASTE45.8342.5040.5757.2449.0255.7748.49
GAS49.5743.7845.2464.4056.2663.1453.73
BGCA text-to-label52.5545.8546.8661.5255.4361.1553.89
BGCA label-to-text53.6445.6947.2865.2758.9564.0055.80
+ +Table 4: Results on cross-domain AOPE and ASTE tasks. The best results are in bold. Results are the average F1 scores over 5 runs. + +
MethodsATEUABSAAOPEASTEAvg.
BGCA†52.1546.0762.3755.8054.10
- self-training*46.1341.5661.3355.9951.25
- continue*46.6342.2258.5654.7050.53
- w/o sharing52.0844.7261.6455.7653.55
+ +Table 5: Ablation Study. $\mathbf{BGCA}^{\dagger}$ represents our $\mathbf{BGCA}_{\mathrm{label-to-text}}$ setting. * denotes replacing the label-to-text stage with the corresponding training method. + +For cross-domain AOPE and ASTE tasks, since there is no existing work on these two tasks under the cross-domain setting, we leverage the indomain state-of-the-art models in a zero-shot manner for comparisons, including SDRN (Chen et al., 2020) for AOPE, and RoBMRC (Liu et al., 2022), SpanASTE (Xu et al., 2021) for ASTE task. In addition, we also refine RoBMRC and SpanASTE to work for the AOPE task by simply omitting the prediction of sentiment polarity. + +Most of the above baselines are discriminative methods based on the pre-trained BERT model. To enable a fair comparison, we also employ GAS (Zhang et al., 2021c) for all four ABSA tasks, which is a strong unified generation method based on the same pre-trained generative model, i.e., T5-base, as our proposed BGCA method. + +# 5.3 Main Results + +We report the main results for the ATE and UABSA tasks in Table 3 and the AOPE and ASTE tasks in Table 4. We have the following observations: 1) Our method with a single text-to-label direction $\left(\mathbf{BGCA}_{\mathrm{text-to-label}}\right)$ establishes a strong baseline for cross-domain ABSA tasks. Compared to discriminative baseline methods without external resources, it shows an improvement of $0.24\%$ , $2.26\%$ , $4.5\%$ , and $5.4\%$ on the cross-domain ATE, UABSA, + +AOPE, and ASTE tasks, respectively. This demonstrates that generative models can actually generalize well across different domains with our designed continuous tagger to indicate the desired sentiment elements. 2) Our proposed framework $\mathbf{BGCA}_{\mathrm{label-to-text}}$ with bidirectional augmentations achieves new state-of-the-art results on all four cross-domain ABSA tasks. It outperforms the previous best models by $2.15\%$ and $2.61\%$ on the ATE and UABSA tasks and by $3.28\%$ and $2.07\%$ on AOPE and ASTE. Notably, it requires no external resources and can be seamlessly applied to all cross-domain ABSA tasks. This verifies the generalizability and effectiveness of our proposed bidirectional generation-based augmentation method. 3) Compared to other generation-based methods such as GAS and $\mathbf{BGCA}_{\mathrm{text-to-label}}$ , $\mathbf{BGCA}_{\mathrm{label-to-text}}$ outperforms all of them on four tasks, indicating that the label-to-text direction can effectively utilize the unlabeled target data and leverage the potential of generative models. + +# 5.4 Ablation Study + +We conduct ablation studies to analyze the effectiveness of each component in BGCA. Results of different model variants are reported in Table 5. + +Ablation on label-to-text generation To investigate the effectiveness of the label-to-text direction, and verify our assumption that it can fix the noisy prediction issue, we replace it with the self-training method and denote it as "self-training" in Table 5. Specifically, we use the pseudo labels of the unlabeled target domain data extracted by the text-to-label stage to replace our augmented data. As shown in Table 5, the performance drops about + +
Sentence from RPredictionLabel-to-text Generation
The [service]POS was good to excellent along with the [attitude]POS.(service, POS)The [service]POS I received from Toshiba was excellent.
[Bottles of wine]POS are cheap and good.(bottles, POS)I love the [bottles]POS they are made out of.
Our [waitress]NEU wasn’t mean, but not especially warm or attentive either.(waitress, NEG)The [waitress]NEG didn’t even answer my question.
+ +![](images/12c35e0bd999579f1de7a73f080dbeadb5ce7536cf4c5601a79612e90f0af3c7.jpg) +Figure 2: Comparison results of our method with a different number of generations. + +three points on average for four tasks. This indicates that the pseudo-labeled samples from the text-to-label model contain more noise. Adding label-to-text generation could effectively address this issue by generating pseudo-training data with less noise. To further investigate the effectiveness of generated samples, we manually check some samples on $\mathrm{L} \rightarrow \mathrm{R}$ from the UABSA task and show some representative samples in Table 6. Note that the gold labels for the target domain are not available during training, and we display them here for investigation only. The first two example's predictions either omit an aspect or gives an incomplete aspect, while the third example's prediction gives the wrong sentiment. However, the label-to-text model can generate a correct sentence that appropriately describes the prediction, although it is inaccurate regarding to the original input sentence. These examples demonstrate how the label-to-text stage can resolve noisy prediction issues and produce high-quality target domain data. + +Ablation on unlabeled data utilization Continue training has shown to be an effective method to leverage unlabeled data by conducting pretraining tasks on relevant corpora to capture domain-specific knowledge (Xu et al., 2019; Gong et al., 2020; Yu et al., 2021). We compare it with our method to discuss how to utilize unlabeled data for generative cross-domain ABSA and denote it as "continue" in Table 5. Specifically, we replace + +Table 6: Examples on L→R from the UABSA task. Gold aspects are marked by square brackets. POS, NEU and NEG denote positive, neutral and negative sentiment. + +
GroupATEUABSA
text→labellabel→texttext→labellabel→text
Zero45.3136.4850.0239.18
Single41.5347.9935.0243.17
Multiple26.6137.2021.9929.59
+ +Table 7: Comparison results on cross-domain ATE and UABSA tasks over different sentence groups containing zero, single, or multiple aspects respectively. + +the label-to-text stage with conducting continuetrain on the unlabeled data of the target domain, with the span reconstruction objective as original T5 pre-training (Raffel et al., 2020). The results show that continue training lies behind our proposed method and demonstrate that our framework can effectively utilize unlabeled target domain data. The possible reason may be that continue training requires many training samples, which is infeasible in cross-domain ABSA scenarios. + +Ablation on model sharing To demonstrate the advantages of training a shared model in both directions, we compare it to a method where a model is newly initialized before each stage of training and denote it as "w/o sharing" in Table 5. Results on four tasks show that our approach outperforms the non-shared method by an average of $0.6\%$ , suggesting that a shared model owns a better understanding of the association between sentences and labels. + +# 5.5 Further Analysis + +Analysis on number of generated samples Figure 2 shows the comparison results over four tasks with different numbers of generated samples. To better analyze the effect of the number of generations, we exclude the source training data and solely use the generated samples for final training. There is an apparent trend of performance improvement with the increasing number of generated samples, revealing that the generated samples can boost cross-domain ability. + +Analysis on improvement types To understand what types of cases our method improved, we cate + +gorize sentences from the test set into three groups: without any aspect, with a single aspect, and with multiple aspects. We conduct our analysis on the cross-domain ATE and UABSA tasks since they contain sentences without any aspect, and evaluate the performance of both the text-to-label and label-to-text settings for each group. We choose sentence-level accuracy as the evaluation metric, i.e., a sentence is counted as correct if and only if all of its sentiment elements are correctly predicted. We present the average accuracy across all transfer pairs in Table 7. The text-to-label model has less knowledge of the target domain and thus tends to predict sentences as no aspect, leading to high accuracy in the group without any aspect. However, it also misses many sentiment elements in the other two groups. On the other hand, although label-to-text lies behind text-to-label in the group without any aspect, it significantly improves the performance of sentences with single or multiple aspects. This indicates that the label-to-text model has obtained more target domain knowledge than the text-to-label setting, and thus can identify more sentiment elements. + +# 6 Conclusions + +In this work, we extend the generative method to cross-domain ABSA tasks and propose a novel BGCA framework to boost the generative model's cross-domain ability. Specifically, we train a shared generative model in reverse directions, allowing high-quality target domain augmentation and a unified solution to comprehend sentences and labels fully. Experiments on four cross-domain ABSA tasks verify the effectiveness of our method. + +# 7 Limitations + +In this paper, we present a bidirectional generative framework for cross-domain ABSA that has achieved outstanding results on four cross-domain ABSA tasks. Although there is only one stage during inference, our method involves multiple training stages, including text-to-label, label-to-text, and final training. These additional training stages not only lengthen the training time but also require additional computational resources, which may hinder scalability for large-scale data and result in a burden for the environment. + +# Acknowledgements + +S. J. Pan thanks for the support of the Hong Kong Global STEM Professorship. Y. Deng is supported by Alibaba Group through Alibaba Innovative Research (AIR) Program and Alibaba-NTU Singapore Joint Research Institute (JRI), Nanyang Technological University, Singapore. + +# References + +John Blitzer, Ryan T. McDonald, and Fernando Pereira. 2006. Domain adaptation with structural correspondence learning. In EMNLP 2006, Proceedings of the 2006 Conference on Empirical Methods in Natural Language Processing, 22-23 July 2006, Sydney, Australia, pages 120-128. +Nicola De Cao, Gautier Izacard, Sebastian Riedel, and Fabio Petroni. 2021. Autoregressive entity retrieval. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net. +Peng Chen, Zhongqian Sun, Lidong Bing, and Wei Yang. 2017. Recurrent attention network on memory for aspect sentiment analysis. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 452-461. +Shaowei Chen, Jie Liu, Yu Wang, Wenzheng Zhang, and Ziming Chi. 2020. Synchronous double-channel recurrent network for aspect-opinion pair extraction. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, ACL 2020, Online, July 5-10, 2020, pages 6515-6524. +Maryna Chernyshevich. 2014. IHS r&d belarus: Cross-domain extraction of product features using CRF. In Proceedings of the 8th International Workshop on Semantic Evaluation, SemEval@COLING 2014, Dublin, Ireland, August 23-24, 2014, pages 309-313. +Ying Ding, Jianfei Yu, and Jing Jiang. 2017. Recurrent neural networks with auxiliary labels for cross-domain opinion target extraction. In Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence, February 4-9, 2017, San Francisco, California, USA, pages 3436-3442. +Zhifang Fan, Zhen Wu, Xin-Yu Dai, Shujian Huang, and Jiajun Chen. 2019. Target-oriented opinion words extraction with target-fused neural sequence labeling. 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 2509-2518. +Chenggong Gong, Jianfei Yu, and Rui Xia. 2020. Unified feature and instance based domain adaptation for aspect-based sentiment analysis. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing, EMNLP 2020, Online, November 16-20, 2020, pages 7035-7045. + +Minqing Hu and Bing Liu. 2004. Mining and summarizing customer reviews. In Proceedings of the Tenth ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 168-177. +Niklas Jakob and Iryna Gurevych. 2010. Extracting opinion targets in a single and cross-domain setting with conditional random fields. In Proceedings of the 2010 Conference on Empirical Methods in Natural Language Processing, EMNLP 2010, 9-11 October 2010, MIT Stata Center, Massachusetts, USA. A meeting of SIGDAT, a Special Interest Group of the ACL, pages 1035-1045. +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, ACL 2020, Online, July 5-10, 2020, pages 7871-7880. Association for Computational Linguistics. +Junjie Li, Jianfei Yu, and Rui Xia. 2022. Generative cross-domain data augmentation for aspect and opinion co-extraction. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL 2022, Seattle, WA, United States, July 10-15, 2022, pages 4219-4229. +Xin Li, Lidong Bing, Wai Lam, and Bei Shi. 2018a. Transformation networks for target-oriented sentiment classification. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 946-956. +Xin Li, Lidong Bing, Piji Li, and Wai Lam. 2019a. A unified model for opinion target extraction and target sentiment prediction. In Proceedings of the AAAI Conference on Artificial Intelligence, pages 6714-6721. +Xin Li, Lidong Bing, Piji Li, Wai Lam, and Zhimou Yang. 2018b. Aspect term extraction with history attention and selective transformation. In Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence, IJCAI, pages 4194-4200. +Xin Li, Lidong Bing, Wenxuan Zhang, and Wai Lam. 2019b. Exploiting BERT for end-to-end aspect-based sentiment analysis. In Proceedings of the 5th Workshop on Noisy User-generated Text (W-NUT 2019), pages 34-41. +Zheng Li, Xin Li, Ying Wei, Lidong Bing, Yu Zhang, and Qiang Yang. 2019c. Transferable end-to-end aspect-based sentiment analysis with selective adversarial 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 4590-4600. + +Bing Liu. 2012. Sentiment Analysis and Opinion Mining. Synthesis Lectures on Human Language Technologies. Morgan & Claypool Publishers. +Jian Liu, Zhiyang Teng, Leyang Cui, Hanmeng Liu, and Yue Zhang. 2021. Solving aspect category sentiment analysis as a text generation task. 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 4406-4416. +Pengfei Liu, Shafiq R. Joty, and Helen M. Meng. 2015. Fine-grained opinion mining with recurrent neural networks and word embeddings. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, EMNLP 2015, pages 1433-1443. +Shu Liu, Kaiwen Li, and Zuhe Li. 2022. A robustly optimized BMRC for aspect sentiment triplet extraction. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL 2022, Seattle, WA, United States, July 10-15, 2022, pages 272-278. +Yue Mao, Yi Shen, Jingchao Yang, Xiaoying Zhu, and Longjun Cai. 2022. Seq2path: Generating sentiment tuples as paths of a tree. In *Findings of the Association for Computational Linguistics: ACL* 2022, Dublin, Ireland, May 22-27, 2022, pages 2215-2225. +Sinno Jialin Pan and Qiang Yang. 2010. A survey on transfer learning. IEEE Trans. Knowl. Data Eng., 22(10):1345-1359. +Haiyun Peng, Lu Xu, Lidong Bing, Fei Huang, Wei Lu, and Luo Si. 2020. Knowing what, how and why: A near complete solution for aspect-based sentiment analysis. 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 8600-8607. +Maria Pontiki, Dimitris Galanis, Haris Papageorgiou, Ion Androutsopoulos, Suresh Manandhar, Mohammad AL-Smadi, Mahmoud Al-Ayyoub, Yanyan Zhao, Bing Qin, Orphée De Clercq, Véronique Hoste, Marianna Apidianaki, Xavier Tannier, Natalia Loukachevitch, Evgeniy Kotelnikov, Nuria Bel, Salud María Jiménez-Zafra, and Gúlşen Eryigit. 2016. SemEval-2016 task 5: Aspect based sentiment analysis. In Proceedings of the 10th International Workshop on Semantic Evaluation (SemEval-2016), pages 19-30. +Maria Pontiki, Dimitris Galanis, Haris Papageorgiou, Suresh Manandhar, and Ion Androutsopoulos. 2015. SemEval-2015 task 12: Aspect based sentiment analysis. In Proceedings of the 9th International Workshop on Semantic Evaluation (SemEval 2015), pages 486-495. + +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. +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. +Cigdem Toprak, Niklas Jakob, and Iryna Gurevych. 2010. Sentence and expression level annotation of opinions in user-generated discourse. In Proceedings of the 48th Annual Meeting of the Association for Computational Linguistics, pages 575-584. +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. +Wenya Wang and Sinno Jialin Pan. 2018. Recursive neural structural correspondence network for cross-domain aspect and opinion co-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 2171-2181. +Wenya Wang and Sinno Jialin Pan. 2019. Transferable interactive memory network for domain adaptation in fine-grained opinion extraction. 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 7192-7199. +Rui Xia, Jianfei Yu, Feng Xu, and Shumei Wang. 2014. Instance-based domain adaptation in NLP via intarget-domain logistic approximation. In Proceedings of the Twenty-Eighth AAAI Conference on Artificial Intelligence, July 27-31, 2014, Quebec City, Quebec, Canada, pages 1600-1606. +Hu Xu, Bing Liu, Lei Shu, and Philip S. Yu. 2019. 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, NAACL-HLT 2019, Minneapolis, MN, USA, June 2-7, 2019, Volume 1 (Long and Short Papers), pages 2324-2335. +Lu Xu, Lidong Bing, Wei Lu, and Fei Huang. 2020a. Aspect sentiment classification with aspect-specific + +opinion spans. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 3561-3567. +Lu Xu, Yew Ken Chia, and Lidong Bing. 2021. Learning span-level interactions for aspect sentiment triplet extraction. 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 4755-4766. +Lu Xu, Hao Li, Wei Lu, and Lidong Bing. 2020b. Position-aware tagging for aspect sentiment triplet extraction. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 2339-2349. +Hang Yan, Junqi Dai, Tuo Ji, Xipeng Qiu, and Zheng Zhang. 2021. A unified generative framework 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, ACL/IJCNLP 2021, (Volume 1: Long Papers), Virtual Event, August 1-6, 2021, pages 2416-2429. +Min Yang, Wenpeng Yin, Qiang Qu, Wenting Tu, Ying Shen, and Xiaojun Chen. 2021. Neural attentive network for cross-domain aspect-level sentiment classification. IEEE Trans. Affect. Comput., 12(3):761-775. +Jianfei Yu, Chenggong Gong, and Rui Xia. 2021. Cross-domain review generation for aspect-based sentiment analysis. In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, pages 4767-4777. +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, 35:377-389. +Wenxuan Zhang, Yang Deng, Xin Li, Yifei Yuan, Lidong Bing, and Wai Lam. 2021b. Aspect sentiment quad prediction as paraphrase generation. 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 9209-9219. +Wenxuan Zhang, Xin Li, Yang Deng, Lidong Bing, and Wai Lam. 2021c. Towards generative 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, ACL/IJCNLP 2021, (Volume 2: Short Papers), Virtual Event, August 1-6, 2021, pages 504-510. +Wenxuan Zhang, Xin Li, Yang Deng, Lidong Bing, and Wai Lam. 2022. A survey on aspect-based sentiment analysis: Tasks, methods, and challenges. CoRR, abs/2203.01054. + +Yan Zhou, Fuqing Zhu, Pu Song, Jizhong Han, Tao Guo, and Songlin Hu. 2021. An adaptive hybrid framework for cross-domain aspect-based sentiment analysis. 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, pages 14630-14637. + +A For every submission: + +A1. Did you describe the limitations of your work? 7 +A2. Did you discuss any potential risks of your work? Pure scientific research +A3. Do the abstract and introduction summarize the paper's main claims? +A4. Have you used AI writing assistants when working on this paper? Left blank. + +B Did you use or create scientific artifacts? 5 + +B1. Did you cite the creators of artifacts you used? 5 +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? All datasets are free to use for research purpose. +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? 5 +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? The original paper of datasets have already discussed this content. +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? 5 +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. In Table 2 + +C Did you run computational experiments? + +5 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? 5 + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? 5 +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? 5 +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? 5 + +# D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? Not applicable. Left blank. +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? Not applicable. Left blank. +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? Not applicable. Left blank. +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? Not applicable. Left blank. +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? Not applicable. Left blank. \ No newline at end of file diff --git a/bidirectionalgenerativeframeworkforcrossdomainaspectbasedsentimentanalysis/images.zip b/bidirectionalgenerativeframeworkforcrossdomainaspectbasedsentimentanalysis/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..3fad060cec4704e954002595e7a1d22f44cd4837 --- /dev/null +++ b/bidirectionalgenerativeframeworkforcrossdomainaspectbasedsentimentanalysis/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:448766022f9d2587d999151f8b3ad0e1be9aba325b59a8e6655f2f12731b5636 +size 537185 diff --git a/bidirectionalgenerativeframeworkforcrossdomainaspectbasedsentimentanalysis/layout.json b/bidirectionalgenerativeframeworkforcrossdomainaspectbasedsentimentanalysis/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..7a8dbfd59071f52d5a7a60df0e48f3dac5c255a0 --- /dev/null +++ b/bidirectionalgenerativeframeworkforcrossdomainaspectbasedsentimentanalysis/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:060c9134d9778fcd7d183e8102473ef0859ff8963b0ceaf98c104726e92c827e +size 416577 diff --git a/binaryandternarynaturallanguagegeneration/fd7e1422-dd6b-402f-87e8-ca36c916fafb_content_list.json b/binaryandternarynaturallanguagegeneration/fd7e1422-dd6b-402f-87e8-ca36c916fafb_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..6f58591eecb38b7b459f1d27f7ed1ba6da76fc68 --- /dev/null +++ b/binaryandternarynaturallanguagegeneration/fd7e1422-dd6b-402f-87e8-ca36c916fafb_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:56472033fac38016585aeeeb45ed501d6f219c5efb3c51df0e9e791f8ccd5fb4 +size 91337 diff --git a/binaryandternarynaturallanguagegeneration/fd7e1422-dd6b-402f-87e8-ca36c916fafb_model.json b/binaryandternarynaturallanguagegeneration/fd7e1422-dd6b-402f-87e8-ca36c916fafb_model.json new file mode 100644 index 0000000000000000000000000000000000000000..57c129361fe15741d91ac88e361baa6c29551dd4 --- /dev/null +++ b/binaryandternarynaturallanguagegeneration/fd7e1422-dd6b-402f-87e8-ca36c916fafb_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f22cb375b2b762c00b66c96a7301128573adcca3a525893d9e2fb16f8a6a96e +size 113940 diff --git a/binaryandternarynaturallanguagegeneration/fd7e1422-dd6b-402f-87e8-ca36c916fafb_origin.pdf b/binaryandternarynaturallanguagegeneration/fd7e1422-dd6b-402f-87e8-ca36c916fafb_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..95792f8557aeef4be31d49697e660b9126af1555 --- /dev/null +++ b/binaryandternarynaturallanguagegeneration/fd7e1422-dd6b-402f-87e8-ca36c916fafb_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9348171e16f880535fb3ff1823a1e22d42aa60b871dfa10b54ecb6b8acbef92e +size 553959 diff --git a/binaryandternarynaturallanguagegeneration/full.md b/binaryandternarynaturallanguagegeneration/full.md new file mode 100644 index 0000000000000000000000000000000000000000..c9d2d3b219abc12484924301381dd2d7adcd4383 --- /dev/null +++ b/binaryandternarynaturallanguagegeneration/full.md @@ -0,0 +1,418 @@ +# Binary and Ternary Natural Language Generation + +Zechun Liu* + +Reality Labs, Meta Inc. + +zechunliu@meta.com + +Barlas Oğuz* + +Meta AI + +barlaso@meta.com + +Aasish Pappu + +Meta AI + +aasish@fb.com + +Yangyang Shi + +Reality Labs, Meta Inc. + +yyshi@meta.com + +Raghuraman Krishnamoorthi + +Reality Labs, Meta Inc. + +raghuraman@meta.com + +# Abstract + +Ternary and binary neural networks enable multiplication-free computation and promise multiple orders of magnitude efficiency gains over full-precision networks if implemented on specialized hardware. However, since both the parameter and the output space are highly discretized, such networks have proven very difficult to optimize. The difficulties are compounded for the class of transformer text generation models due to the sensitivity of the attention operation to quantization and the noise-compounding effects of autoregressive decoding in the high-cardinality output space. We approach the problem with a mix of statistics-based quantization for the weights and elastic quantization of the activations and demonstrate the first ternary and binary transformer models on the downstream tasks of summarization and machine translation. Our ternary BART base achieves an R1 score of 41 on the CNN/DailyMail benchmark, which is merely 3.9 points behind the full model while being 16x more efficient. Our binary model, while less accurate, achieves a highly nontrivial score of 35.6. For machine translation, we achieved BLEU scores of 21.7 and 17.6 on the WMT16 En-Ro benchmark, compared with a full precision mBART model score of 26.8. We also compare our approach in the 8-bit activation setting, where our ternary and even binary weight models can match or outperform the best existing 8-bit weight models in the literature. Our code and models are available at: https://github.com/facebookresearch/Ternary_Binary_Transformer. + +# 1 Introduction + +Generative pre-trained transformers (Brown et al., 2020; Lewis et al., 2020; Radford et al., 2018) have emerged as powerful and generic tools, driving breakthroughs not only in language understanding but the field of AI in general. These models owe + +their success mainly to their seemingly infinite ability to scale to ever-larger data and model sizes. Unfortunately, such scaling comes at the cost of large computational requirements, putting extensively large generative transformers out of reach of all but the most resource-rich institutions. Even moderately sized pre-trained transformers have limited applications due to their size and computational cost. Making generative transformers more efficient is imperative for widening their use to more devices and practical applications. + +In this work, we explore making generative pretrained transformers more efficient via the quantization of their weights and activations. Quantizing the weights of a neural network is useful for compression and allows the model to be stored more efficiently. However, compression alone does not reduce computation costs since the network's activations need to be computed in full precision. Quantizing both weights and activations allows computation to be performed with lower precision, potentially leading to significant efficiency gains depending on the quantization level and hardware implementation. Quantizing neural networks have a long history, and multiple works have attempted to quantize pre-trained transformers at various quantization levels (Shen et al., 2020; Zhang et al., 2020; Liu et al., 2022; Qin et al., 2021). Most of this work focuses on encoder-only models (mainly BERT) for sentence and token classification tasks. Quantizing text generation models has generally been regarded as a more difficult task (Behnke et al., 2021; Tao et al., 2022) due to the large output vocabulary and sequential decoding. Recent work has tackled this problem, though only for mild quantization levels (down to 8-bit activations) and with mixed success. + +In contrast, we are interested in very low-bit quantization, down to ternary and even binary weights and activations. In order to achieve this, we combine and unify best practices for weight and activation quantization and present a frame + +work that uses gradient-matching quantization for weights and elastic quantization for activations. We apply our method to natural language generation tasks and, for the first time, demonstrate low-bit generative transformers of competitive accuracy. Our ternary (weight and activation) model lags a full-precision BART (Lewis et al., 2020) model by only 4 points in ROUGE on the XSUM summarization dataset. In contrast, our model with ternary weights and 8-bit activations comes within 1 point and even outperforms comparable state-of-the-art models with 8-bit weights. We also demonstrate a fully binary (weights and activations) model. While not as competitive, it is able to achieve a highly non-trivial ROUGE-1 score of 31.7. + +Our results also extend to machine translation models. On the WMT16 En-Ro benchmark, we quantize an mBART model to extend the ternary-weight 8-bit activation SoTA by 1.2 points while demonstrating fully ternary and fully binary translation models for the first time. + +We summarize our contributions as follows: + +- We propose a novel combination of statistics-based weight quantization with learning-based activation quantization, which enables stably training transformer encoder-decoder models to converge in the fully ternary/binary settings, which was not previously possible. +- We significantly improve the state-of-the-art text generation models in the 8-bit activation and ternary/binary weight settings while setting the first non-trivial baselines for the fully ternary and fully binary settings. + +# 2 Method + +In this section, we first introduce the previous practices in binarization and ternarization. Then, we introduce a unified statistic-based weight binarization / ternarization method that can alleviate the gradient mismatch issue and enhance the quantized weights entropy. Lastly, we analyze the difference between weight quantization and activation quantization and propose an elastic ternarization method for activations. We abbreviate our method as TBT, short for "Ternary / Binary Transformer". + +# 2.1 Preliminary + +# 2.1.1 Ternarization + +Ternary neural networks, where real values are quantized to three levels, are first introduced in (Li et al., 2016). Thus, these values can be repre + +sented in 2 bits, leading to a $16\times$ reduction in size and computation. Moreover, the computations can be calculated multiplication-free, leading to even further computation gains on suitable hardware. The recent work integrates the ternarization algorithm in natural language models for quantizing the weights and activations in classification tasks (Zhang et al., 2020) and ternarizing the weight (8-bit activations are used) in generative models (Li et al., 2022; Tao et al., 2022). The general formula (Li et al., 2016) for ternarization is as follows: + +$$ +\mathbf {X} _ {\mathbf {T}} ^ {i} = \left\{ \begin{array}{l l} - \alpha_ {\mathbf {T}}, & \text {i f} \mathbf {X} _ {\mathbf {R}} ^ {i} < - \Delta \\ 0, & \text {i f} - \Delta \leqslant \mathbf {X} _ {\mathbf {R}} ^ {i} \leqslant \Delta \\ + \alpha_ {\mathbf {T}}, & \text {i f} \mathbf {X} _ {\mathbf {R}} ^ {i} > \Delta \end{array} \right. \tag {1} +$$ + +$$ +\Delta = \frac {0 . 7 \cdot | | \mathbf {X} _ {\mathbf {R}} | | _ {l 1}}{n _ {\mathbf {X} _ {\mathbf {R}}}} \tag {2} +$$ + +$$ +\alpha_ {\mathrm {T}} = \frac {\sum_ {i} \mathbf {X} _ {\mathbf {R}} ^ {i} \cdot \mathbf {1} _ {| \mathbf {X} _ {\mathbf {R}} ^ {i} | > \Delta}}{\sum_ {i} \mathbf {1} _ {| \mathbf {X} _ {\mathbf {R}} ^ {i} | > \Delta}} \tag {3} +$$ + +Here $\mathbf{X}_{\mathrm{T}}$ denotes the ternary weights/activations, and $\mathbf{X}_{\mathbf{R}}$ represents their real-valued counterparts. $n_{\mathbf{x}_{\mathbf{R}}}$ denotes the total number of elements in the tensor. $\Delta$ is the ternary threshold, and $\alpha_{\mathrm{T}}$ is the scaling factor that minimizes 12-loss between $\mathbf{X}_{\mathbf{T}}$ and $\mathbf{X}_{\mathbf{R}}$ . + +# 2.1.2 Binarization + +The neural network binarization denotes representing the weights and/or activation with bi-level values. It is first proposed in BNN (Courbariaux et al., 2016) and has evolved in the follow-up works (Rastegari et al., 2016; Liu et al., 2018). Rastegari et al. (2016) formulates binarization as: + +$$ +\mathbf {X} _ {\mathbf {B}} ^ {i} = \alpha_ {\mathbf {B}} \cdot \mathrm {S i g n} (\mathbf {X} _ {\mathbf {R}} ^ {i}) = \left\{ \begin{array}{l l} - \alpha_ {\mathbf {B}}, \mathrm {i f} \mathbf {X} _ {\mathbf {R}} ^ {i} < 0 \\ + \alpha_ {\mathbf {B}}, \mathrm {i f} \mathbf {X} _ {\mathbf {R}} ^ {i} \geqslant 0 \end{array} \right. (4) +$$ + +$$ +\alpha_ {\mathrm {B}} = \frac {| | \mathbf {X} _ {\mathbf {R}} | | _ {l 1}}{n _ {\mathbf {X} _ {\mathbf {R}}}} \tag {5} +$$ + +Here $\mathbf{X_B}$ can represent binary weights or binary activations. $\alpha_{\mathrm{B}}$ denotes the scaling-factor that minimize the l2 loss between $\mathbf{X}_{\mathbf{R}}$ and $\alpha_{\mathrm{B}}\cdot \operatorname {Sign}(\mathbf{X}_{\mathbf{R}})$ + +The acceleration and compression effect of ternary/binary neural networks is significant. By representing the weights and activations with $\{-1,0,1\}$ , the network enjoys $\sim 16\times$ memory saving compared to its 32-bit floating-point counterpart. When further binarize the weights and activations to only 1-bit (i.e., $\{-1,1\}$ ), up to $32\times$ + +model-size reduction and $58 \times$ speedup on CPUs have been achieved (Rastegari et al., 2016), where the matrix multiplication operations are replaced with light-weighted bitwise XNOR operations. + +Despite its appealing characteristics, naively binarizing or ternarizing the transformer model for natural language generation results in several accuracy drops or even a total failure in training. It has been observed that the attention layers of the transformer network are difficult to quantize to low bits. Also, the auto-regressive decoding tends to accumulate errors due to quantization. Given the nature of generative language networks that require high-precision output, quantizing both the activations and weights in these models to extreme bit values is non-trivial and has not been explored before. + +# 2.2 Stats-based max-entropy isometric weight quantization + +We propose a statistics-based method for weight binarization/ternarization. Particularly, this novel quantization method considers maximizing the entropy of the quantized weights and reducing the gradient mismatch in the backward pass. Previous works (Courbariaux et al., 2016; Bai et al., 2021b; Zhang et al., 2020) are mainly focused on minimizing the $l2$ loss between the quantized weights and the real-valued weights to find the optimal quantization scheme, + +$$ +\alpha^ {*} = \arg \min | | \alpha \hat {\mathbf {W}} _ {\mathbf {Q}} - \mathbf {W} _ {\mathbf {R}} | | _ {l 2} \tag {6} +$$ + +where $\hat{\mathbf{W}}_{\mathbf{Q}}$ denotes binary/ternary weights and $\alpha^{*}$ denotes the optimal scaling factor calculated. Despite the broad application and great success of the classic quantization scheme, we found that merely minimizing the $l2$ loss neglects several critical but intractable issues in ultra-low-bit weight quantization: (1) The information entropy of the quantized weights is not considered. Eq. 1 and Eq. 4 calculate the quantized weights to minimize the distance to the real-valued weights, which could lead to imbalanced quantized weight distribution and harm the quantized weights representation capacity. (2) The quantization function Eq. 1 and Eq. 4 are not isometric, meaning that it does not consider the magnitude consistency between the quantized weights and real-valued weights, while we find that magnitude consistency contributes significantly to accurate gradient estimation. + +Considering the above two limitations in previous solutions, we are motivated to design a novel + +quantization function that enhances information entropy and reduces gradient mismatch. To boost the weights representation capability, in information theory, more information is preserved when the quantized weights contain higher entropy: + +$$ +\max _ {p _ {i}} \mathcal {H} = - p _ {i} \log \left(p _ {i}\right), s. t. \sum_ {i = 1} ^ {N} p _ {i} = 1 \tag {7} +$$ + +with $p_i$ denoting the proportion of real-valued weights being quantized to $i^{th}$ quantization level in total $N$ levels. Eq. 7 can be easily solved with a Lagrange multiplier, and the optimal $p_i^* = \frac{1}{N}$ , $i \in \{1,2,\dots,N\}$ , suggesting the best quantization scheme to preserve maximum information entropy is to distribute the real-valued weights in all quantization levels as evenly as possible. + +For reducing the gradient mismatch, as suggested by the previous binarization work (Liu et al., 2020b), the magnitude difference between the quantized weight and the real-valued weight will greatly influence the gradient scale and a mismatch in magnitude will be amplified in back-propagation and cause gradient vanishing or explosion during training. Thus it is important to ensure the magnitude of real-valued weights and quantized weights are consistent. + +Combining two requirements discussed above, we proposed max-entropy isometric weight quantization. In ternarization, it is formulated as + +$$ +\mathbf {W} _ {\mathbf {T}} ^ {i} = \alpha_ {\mathbf {T}} \left\lfloor \mathrm {C l i p} (\frac {\mathbf {W} _ {\mathbf {R}} ^ {i} - \mu_ {\mathbf {T}}}{\alpha_ {\mathbf {T}}}, - 1, 1) \right] +$$ + +where $\mu_{\mathbf{T}} = \overline{\mathbf{W}_{\mathbf{R}}}$ (8) + +$$ +\alpha_ {\mathbf {T}} = \frac {4}{3} \cdot \frac {| | \mathbf {W _ {R}} - \boldsymbol {\mu_ {T}} | | _ {l 1}}{n _ {\mathbf {W _ {R}}}} +$$ + +Where $\mathbf{W}_{\mathrm{T}}$ and $\mathbf{W}_{\mathbf{R}}$ refer to the ternary weights and real-valued weights, respectively. The rounding function $\lfloor \cdot \rfloor$ and $\operatorname {Clip}(\cdot)$ function quantize weights to $\{-1,0,1\}$ . $\mu_{\mathrm{T}}$ is the mean of real-valued weights and $n_{\mathbf{w}_{\mathbf{R}}}$ denotes the number of weights in the weight matrix. Scaling factor $\alpha$ is calculated from the weight statistics and follows the entropy rule to scale the real-valued weight $\mathbf{W}_{\mathbf{R}}$ to be evenly distributed in quantization levels. In the ternary case, the weights are quantized to $\{-\alpha_{\mathrm{T}},0,\alpha_{\mathrm{T}}\}$ . When the real-valued weights are initialized as uniformly and symmetrically distributed (He et al., 2015; Glorot and Bengio, 2010), the scaling factor $\alpha_{\mathrm{T}}$ will distribute $\frac{\mathbf{W}_{\mathbf{R}}^{i}}{\alpha_{\mathbf{T}}}$ to $[-1.5,1.5]$ , such that the output ternary weights + +![](images/0ab0f641c65a8e7e2ec2620687528c644a5054db5a31a2661d1dc5b9c457ab44.jpg) +Figure 1: Overview of TBT. A transformer block contains the multi-head self-attention and feed-forward network. We propose a statistic-based quantization method for weights ternarization/binarization and adopt a learning-based asymmetric quantization method for activation in ReLU/Softmax output $(\mathbf{X} \in \mathbb{R}_{+}^{n})$ and learning-based asymmetric quantization method for activations that contain both positive and negative values in other layers $(\mathbf{X} \in \mathbb{R}^{n})$ . + +will have near uniform distribution in three ternary levels. Meanwhile, Eq. 8 is an isometric mapping where the real-valued weights are scaled by $\frac{1}{\alpha_{\mathrm{T}}}$ to near [-1, 1] and time $\alpha_{\mathrm{T}}$ to scale back after quantization. In this way, the magnitude is preserved. + +Correspondingly, in the binary case we have, + +$$ +\mathbf {W} _ {\mathbf {B}} ^ {i} = \alpha_ {\mathbf {B}} \cdot \mathrm {S i g n} (\frac {\mathbf {W} _ {\mathbf {R}} ^ {i} - \mu_ {\mathbf {B}}}{\alpha_ {\mathbf {B}}}) +$$ + +$$ +\text {w h e r e} \mu_ {\mathrm {B}} = \overline {{\mathbf {W} _ {\mathbf {R}}}}, \tag {9} +$$ + +$$ +\alpha_ {\mathrm {B}} = \frac {| | \mathbf {W} _ {\mathbf {R}} - \boldsymbol {\mu} _ {\mathbf {B}} | | _ {l 1}}{n _ {\mathbf {W} _ {\mathbf {R}}}} +$$ + +Here $\mathbf{W}_{\mathrm{B}}$ denotes the binary weights, where subtracting the average $\mu_{\mathrm{B}}$ makes the real-valued weight zero-centered before binarization and thus encourages an even distribution in binarized weights. Then the scaling factor $\alpha_{\mathrm{B}}$ matches the magnitude between real-valued and binary weights. Particularly, in Eq. 9, $\mathbf{W}_{\mathrm{B}}^{i} = \alpha_{\mathrm{B}} \cdot \operatorname{Sign}\left(\frac{\mathbf{W}_{\mathrm{R}}^{i} - \mu_{\mathrm{B}}}{\alpha_{\mathrm{B}}}\right) = \alpha_{\mathrm{B}} \cdot \operatorname{Sign}\left(\mathbf{W}_{\mathrm{R}}^{i} - \mu_{\mathrm{B}}\right)$ , we explicitly include the $\alpha_{\mathrm{B}}$ in the denominator to keep the binarization function isometric and the gradients w.r.t. weights can be calculated straight- + +forwardly as: + +$$ +\frac {\partial \mathbf {W} _ {\mathbf {B}} ^ {i}}{\partial \mathbf {W} _ {\mathbf {R}} ^ {i}} \stackrel {S T E} {\approx} \mathbf {1} _ {| \frac {\mathbf {W} _ {\mathbf {R}} ^ {i} - \mu_ {\mathbf {B}}}{\alpha_ {\mathbf {B}}} | < 1} \tag {10} +$$ + +STE is abbreviated for straight-through estimator (Bengio et al., 2013), which replaces the non-differentiable Sign function with Clip function in the backward pass. We show that the proposed max-entropy isometric weight quantization improves the accuracy of weight binarization / ternarization by $6.0 / 11.53$ RougeL scores on the CNN/DailyMail benchmark, respectively. More details can be found in Sec. 3.2. + +# 2.3 Learning-based activation quantization + +In contrast to neural network weights that are stored on the disk, activations are calculated on-the-fly. The distribution of activations in a particular layer depends on the network weights as well as the corresponding input sequence, and thus varies from batch to batch. In order to have the quantization function better capture the underlying activation distribution, we propose learning-based activation quantization. + +Inspired by BiT (Liu et al., 2022), we divide the activation layers into two categories: the activation + +layers with non-negative values $(\mathbf{X}_{\mathbf{R}}\in \mathbb{R}_{+})$ , i.e., Softmax/ReLU layer outputs and the rest of the layers with both positive and negative activations $(\mathbf{X}_{\mathbf{R}}\in \mathbb{R})$ . We binarize / ternarize the first activation category $(\mathbf{X}_{\mathbf{R}}\in \mathbb{R}_{+})$ to $\{0,\alpha \} /\{0,\alpha ,2\alpha \}$ and symmetrically quantize the later activation category $(\mathbf{X}_{\mathbf{R}}\in \mathbb{R})$ to $\{-\alpha ,\alpha \}$ and $\{-\alpha ,0,\alpha \}$ in binary and ternary cases respectively. In this way, the activation distribution matches the original fullprecision activations and thus reduces the quantization error. Further, we learn to scale the real-valued activations to better fit quantization thresholds, and this learnable scaling factor can be updated endto-end with the gradients from the network loss to better account for overall network optimization. + +In the ternary case, we propose the elastic ternarization function formulated as, + +$$ +\begin{array}{l} \mathbf {X} _ {\mathbf {T}} ^ {i} = \alpha_ {\mathbf {T}} \hat {\mathbf {X}} _ {\mathbf {T}} ^ {i} \\ = \left\{ \begin{array}{l} \alpha_ {\mathbf {T}} \left\lfloor \operatorname {C l i p} \left(\frac {\mathbf {X} _ {\mathbf {R}} ^ {i}}{\alpha_ {\mathbf {T}}}, 0, 2\right) \right\rfloor , \text {i f} \mathbf {X} _ {\mathbf {R}} \in \mathbb {R} _ {+} \\ \alpha_ {\mathbf {T}} \left\lfloor \operatorname {C l i p} \left(\frac {\mathbf {X} _ {\mathbf {R}} ^ {i}}{\alpha_ {\mathbf {T}}}, - 1, 1\right) \right\rfloor , \text {i f} \mathbf {X} _ {\mathbf {R}} \in \mathbb {R} \end{array} \right. \tag {11} \\ \end{array} +$$ + +where $\mathbf{X}_{\mathbf{R}}$ and $\mathbf{X}_{\mathbf{T}}$ denote real-valued and ternary activations, respectively. To keep the formula concise, we set $\mathbf{X}_{\mathbf{R}}^{\prime} = \mathbf{X}_{\mathbf{R}} - \overline{\mathbf{X}_{\mathbf{R}}}$ , denoting the zero-mean real-valued activations. $\alpha_{\mathrm{T}}$ is the scaling factor. Different from the weight quantization, the scaling factor in Eq. 11 is learned with the gradient update. We follow the practice in (Zhou et al., 2016; Esser et al., 2019) to calculate the gradients with straight-through estimation (STE) bypassing the non-differentiable rounding function: + +$$ +\begin{array}{l} \frac {\partial \mathbf {X} _ {\mathbf {T}} ^ {i}}{\partial \alpha_ {\mathbf {T}}} \stackrel {S T E} {\approx} \\ \left\{ \begin{array}{l} \hat {\mathbf {X}} _ {\mathbf {T}} ^ {i} - \frac {\mathbf {X} _ {\mathbf {R}} ^ {i}}{\alpha_ {\mathbf {T}}} \cdot \mathbf {1} _ {0 \leqslant \mathbf {X} _ {\mathbf {R}} ^ {i} \leqslant 2 \alpha_ {\mathbf {T}}}, \text {i f} \mathbf {X} _ {\mathbf {R}} \in \mathbb {R} _ {+} \\ \hat {\mathbf {X}} _ {\mathbf {T}} ^ {i} - \frac {\mathbf {X} _ {\mathbf {R}} ^ {\prime i}}{\alpha_ {\mathbf {T}}} \cdot \mathbf {1} _ {| \mathbf {X} _ {\mathbf {R}} ^ {\prime i} | \leqslant \alpha_ {\mathbf {T}}}, \quad \text {i f} \mathbf {X} _ {\mathbf {R}} \in \mathbb {R} \end{array} \right. \tag {12} \\ \end{array} +$$ + +The learnable scaling factor can dynamically adapt to different activation distributions and improve the ternarization accuracy. In the binary case, it is formulated as. + +$$ +\begin{array}{l} \mathbf {X} _ {\mathbf {B}} ^ {i} = \alpha_ {\mathbf {B}} \hat {\mathbf {X}} _ {\mathbf {B}} ^ {i} \\ = \left\{ \begin{array}{l l} \alpha_ {\mathbf {B}} \lfloor \operatorname {C l i p} \left(\frac {\mathbf {X} _ {\mathbf {R}} ^ {i}}{\alpha_ {\mathbf {B}}}, 0, 1\right) \rceil , & \text {i f} \mathbf {X} _ {\mathbf {R}} \in \mathbb {R} _ {+} \\ \alpha_ {\mathbf {B}} \cdot \operatorname {S i g n} \left(\frac {\mathbf {X} _ {\mathbf {R}} ^ {\prime i}}{\alpha_ {\mathbf {B}}}\right), & \text {i f} \mathbf {X} _ {\mathbf {R}} \in \mathbb {R} \end{array} \right. \tag {13} \\ \end{array} +$$ + +Here $\mathbf{X_B}$ denotes the binary activations. + +Correspondingly, the gradients w.r.t. the scaling factor $\alpha$ can be easily calculated as + +$$ +\begin{array}{l} \frac {\partial \mathbf {X} _ {\mathbf {B}} ^ {i}}{\partial \alpha_ {\mathbf {B}}} \stackrel {S T E} {\approx} \\ \left\{ \begin{array}{l l} \hat {\mathbf {X}} _ {\mathbf {B}} ^ {i} - \frac {\mathbf {X} _ {\mathbf {R}} ^ {i}}{\alpha_ {\mathbf {B}}} \cdot \mathbf {1} _ {0 \leqslant \mathbf {X} _ {\mathbf {R}} ^ {i} \leqslant \alpha_ {\mathbf {B}}}, & \text {i f} \mathbf {X} _ {\mathbf {R}} \in \mathbb {R} _ {+} \\ \operatorname {S i g n} \left(\mathbf {X} _ {\mathbf {R}} ^ {\prime i}\right), & \text {i f} \mathbf {X} _ {\mathbf {R}} \in \mathbb {R} \end{array} \right. \tag {14} \\ \end{array} +$$ + +We demonstrate that with the learning-based activation quantization method and statistics-based weight quantization scheme, the proposed TBT for the first time is able to quantize the BART model for natural language generation tasks to ternary and even binary weights and activations, and achieve reasonable accuracy on summarization and translation benchmarks. + +# 3 Experiments + +In this section, we evaluate the effectiveness of our low-bit quantization scheme for natural language generative model on text summarization benchmarks: CNN/DailyMail (Nallapati et al., 2016) and XSUM (Narayan et al., 2018). We additionally experiment on the machine translation task with mBART on WMT16 English-Romanian (En-Ro) dataset (Bojar et al., 2016a). + +# 3.1 Experimental settings + +We follow recent work (Li et al., 2022) in training the quantized network with initialization and knowledge distillation from a full-precision pretrained model. Specifically, we use the BART-base (Lewis et al., 2019) as our full-precision baseline for summarization tasks and mBART-large (Liu et al., 2020a) for the translation task. We train the quantized models for 20 epochs on 8 GPUs with a batch size of 128 and a learning rate of $2.5\mathrm{e - }4$ for 8-bit activation models and 5e-4 for binary and ternary activation models. + +# 3.2 Summarization + +For the summarization task, we adopt the following benchmarks: + +The XSUM dataset (Narayan et al., 2018) consists of 226k documents sampled from the online news website of BBC, together with short, one sentence summaries. Since the summaries are very short, abstractive methods tend to do better on this dataset. + +Table 1: Comparison of quantization methods for text summarization on XSUM and CNN/DailyMail benchmarks. We use the "E-W-A (#bits)" notation referring to the number of bits of embeddings, weights and activations, (specifically, 1 denotes binary, 2 denotes ternary). The results of QuantBart, DQ-BART and BlockPruning are quoted from their paper. Additionally, we implement the algorithm developed in BinaryBert, BiBert and TernaryBert to the BART model and report the results, denoted with * . We use the rouge- $\{1,2,\mathrm{L}\}$ as evaluation metrics. + +
Method#Bits (E-W-A)Size (MB)FLOPsR1XSUMCNN/DailyMail
R2RLR1R2RL
BART32-32-32532.01×43.8420.7935.7144.9022.2542.09
QuantBart (Tao et al., 2022)8 - 8 - 8138.1-40.2517.7832.70---
DQ-BART (Li et al., 2022)8 - 8 - 8138.1-42.5119.6134.6144.6621.9241.86
Ternary
Baseline (TWN) (Li et al., 2016)2 - 2 - 839.60.25×39.9917.1331.9942.9920.0540.18
QuantBart (Tao et al., 2022)2 - 2 - 839.60.25×39.1516.7231.72---
DQ-BART (Li et al., 2022)2 - 2 - 839.60.25×40.0617.3432.4642.9420.0740.13
TBT2 - 2 - 839.60.25×42.4019.5434.5143.4620.5240.58
Baseline (TWN) (Li et al., 2016)2 - 2 - 239.60.0625×12.801.2111.412.920.3212.42
TernaryBert* (Zhang et al., 2020)2 - 2 - 239.60.0625×14.032.2311.7910.950.528.56
TBT2 - 2 - 239.60.0625×36.2114.3829.0741.0318.1838.30
Binary
Baseline (BWN) (Courbariaux et al., 2016)1 - 1 - 823.20.125×1.900.011.782.780.082.48
BinaryBert* (Bai et al., 2021b)1 - 1 - 823.20.125×39.7617.0531.9940.6618.5228.36
BlockPruning (Lagunas et al., 2021)-23----41.418.738.4
TBT1 - 1 - 823.20.125×40.9618.3733.3042.6619.7239.80
Baseline (BWN) (Courbariaux et al., 2016)1 - 1 - 123.20.0156×1.900.011.782.780.082.48
BinaryBert* (Bai et al., 2021b)1 - 1 - 123.20.0156×8.130.127.699.800.158.62
BiBert* (Qin et al., 2021)1 - 1 - 123.20.0156×7.580.067.5414.220.1310.06
TBT1 - 1 - 123.20.0156×31.6811.1925.2935.5611.7133.23
+ +CNN/DailyMail (Nallapati et al., 2016) is another news summarization benchmark, with longer documents (~30 sentences) and longer, multisentence summaries. The dataset contains close to 300k document-summary pairs. + +We use BART-base model (Lewis et al., 2019), which is an English-only encoder-decoder transformer with 140 million parameters. We compare using the standard ROUGE-\{1,2,1\} metrics for this task. + +For the ternary weights and 8-bit activations setting, we compare with two state-of-the-art methods QuantBart (Tao et al., 2022) and DQ-BART (Li et al., 2022). For the fully ternary setting, and the binary quantization experiments, there is no prior art. Therefore we provide a naive quantization baseline, using popular implementations from previous work (Li et al., 2016; Courbariaux et al., 2016), and adapt the binary and ternary methods proposed for the BERT models (Bai et al., 2021b; Qin et al., 2021; Zhang et al., 2020) to BART. + +Our main results are summarized in Table 1. In the ternary weights and 8-bit activations setting, TBT improves previous SoTA by up to 2.3 points in ROUGE score on XSUM, and up to 0.5 points on CNN/DailyMail. Both improvements are significant. + +Further quantizing weights to binary, while keeping activations at 8-bit, we are still able to achieve a ROUGE-L score of 33.3 on XSUM, which is 0.8 points higher than the previous ternary SoTA (DQ-BART), and comparable on CNN/DailyMail. This is the first demonstration of a binary-weight generative transformer model of competitive accuracy to our knowledge. Additionally, TBT binary weight BART model achieves 1.2 points higher ROUGE score on CNN compared with the SoTA pruning method with the same compressed model size. + +Moving on to ternary and binary activations, there is no prior art, and previous implementations fail to produce meaningful results. Our method, on the other hand, achieves ROUGE-L scores of 29.1 and 38.3 on XSUM and CNN/DailyMail in the fully ternary setting, which are 6.6 and 3.8 points behind the full-precision baseline respectively. Our fully binary (weights and activations) model has a wider gap at 10.4 and 8.9 points, however still manages to produce highly non-trivial output at ROUGE-L scores of 25.3 and 33.2 points for XSUM and CNN/DailyMail. + +# 3.3 Machine translation + +We also evaluate our model on machine translation. We adopt the En-Ro benchmark from the + +Table 2: Comparison of quantization methods on mBART-large model for translation on WMT16 En-Ro. + +
Method#Bits (E-W-A)Size (GB)BLEU
mBART (Liu et al., 2020a)32-32-322.4426.82
DQ-BART (Li et al., 2022)8 - 8 - 80.6125.91
DQ-BART (Li et al., 2022)2 - 2 - 80.3123.48
TBT2 - 2 - 80.3124.63
TBT2 - 2 - 20.3121.70
TBT1 - 1 - 80.1624.30
TBT1 - 1 - 10.1617.59
+ +Table 3: Ablation study on the effects of the proposed learning-based activation quantization method and stats-based weight quantization method on XSUM and CNN/DailyMail benchmark. + +
Method#Bits (E-W-A)XSUM
R1R2RL
1Baseline (TWN)2 - 2 - 212.801.2111.4
2+ Activation(learning-based)2 - 2 - 215.051.3812.13
3+ Weight/stats-based)2 - 2 - 213.790.8712.74
4+ Both2 - 2 - 236.2114.3829.07
5Baseline (BWN)1 - 1 - 11.900.011.78
6+ Activation(learning-based)1 - 1 - 11.900.011.78
7+ Weight/stats-based)1 - 1 - 110.960.2910.00
8+ Both1 - 1 - 131.6811.1925.29
CNN/DailyMail
R1R2RL
9Baseline (TWN)2 - 2 - 212.920.3212.42
10+ Activation(learning-based)2 - 2 - 213.340.9912.58
11+ Weight/stats-based)2 - 2 - 219.340.4218.42
12+ Both2 - 2 - 241.0318.1838.30
13Baseline (BWN)1 - 1 - 12.780.082.48
14+ Activation(learning-based)1 - 1 - 12.780.082.48
15+ Weight/stats-based)1 - 1 - 115.050.3514.01
16+ Both1 - 1 - 135.5611.7133.23
+ +WMT'16 shared task (Bojar et al., 2016b) to be compatible with previous work. Our base model is an mBART-large model (Liu et al., 2020a), a 680 million parameter multi-lingual encoder-decoder transformer pre-trained on 25 languages. + +Table 2 shows our results. In the ternary weight setting with 8-bit activations, we improve the previous SoTA by 1.2 points, achieving 24.63 BLEU. Remarkably our binary weight model also outperforms the previous ternary weight SoTA by almost a full point. It scores 24.3 BLEU - only 1.5 points behind a full mBART model while being $16 \times$ smaller. + +In the fully ternary and binary settings, where previous methods failed to converge, TBT models are able to reach practical levels of performance, with ternary TBT mBART achieving 21.7 BLEU, and TBT binary mBART at 17.59. + +# 3.4 Ablations + +As stated earlier, our main proposed modeling improvement is a combination of two methods: + +Table 4: Generated average sequence length comparison between baseline method and our method. + +
Method#Bits (E-W-A)XSUMCNN/DailyMail
BART-base32-32-3230.7399.89
Baseline2 - 2 - 828.5393.63
TBT2 - 2 - 832.0495.78
Baseline2 - 2 - 248.4114.88
TBT2 - 2 - 230.7188.38
Baseline1 - 1 - 862.0128.0
TBT1 - 1 - 831.5797.08
Baseline1 - 1 - 162.0128.0
TBT1 - 1 - 129.8167.51
+ +statistics-based quantization for the weights, and learning-based quantization for the activations. We ablate the contribution of these methods and present the results in Table 3. + +The results clearly show that while each method can give moderate gains by itself over the baseline, these improvements are not sufficient by themselves to produce meaningful results. None of the ablated models can achieve an R2 score above 1.5. It's only the combination of the two, which together stabilize the training and result in good convergence for fully ternary and binary models. + +# 3.5 Sequence length analysis + +In language generation tasks, the error compounding issue in the recursive decoder generation process will largely amplify the quantization error or even lead to divergent results, and thus is an harsh factor to test the robustness of a quantization method. The average generated sequence length indicates whether the quantized model can overcome the compounding error and generate reasonable length of text. + +In Table 4 we compare the generated sequence length between the proposed method and the baseline method (i.e., TWN (Li et al., 2016) for ternary, BWN (Courbariaux et al., 2016) for binary). Our method successfully produces summarizations with comparable length as the full-precision model on XSUM benchmark, even when both weights and activations are binarized. + +Compared to XSUM dataset, for which the document are summarized to only one sentence, CNN/DailyMail is more challenging because it allows longer summary. We can clearly see that, the text generate with our 8-bit activation models can maintain near the similar average length as the full-precision BART model, while the binary and ternary activation models deviate moderately. In contrast, the baseline method is only able to derive + +![](images/f9e076954411ae8e37923e93cee5a952e464e84d519156a3f07c96324c69d04a.jpg) +Ternary weights $(W_{T})$ +(a) + +![](images/38f09d6f499fae7b311eb29a3bc86e68db3b276969729fbb4ab98132718eb4c8.jpg) +Weights +$W_{T}$ in $1^{st}$ row +Baseline +(b) + +![](images/a14774eed83f7668a905889153a7f074677bb19f8d3ebcc0ade0451b729fb7b3.jpg) +Activations +Ternary activations (N) $(X_{T})$ +(c) + +![](images/bdf8a08ed6e0304d678c1fcfb4bc85334b0ca681c1733af3441b16f76b940ee0.jpg) +Real-valued activations +$(X_{R})$ +(d) + +![](images/123fd88affc9f812e3108f17b8ea74d323bdb508e81554a358cb3af280252e7d.jpg) +(e) +Figure 2: Weight and activation histogram comparison between the baseline TWN method and TBT method for ternarizing BART model on CNN/DailyMail benchmark. The weights are taken from the fully-connected layer of the value matrix in $1^{st}$ self-attention block in the decoder and activations are the attention outputs of the same layer. + +![](images/ec5ce5167847417e702d2df592136c82a06f0ab3da5a2d96c1dd3cb2b5d34b4c.jpg) +Ours (TBT) +(f) + +![](images/1e7493b41a96bb7ad3594df6d343d1feb2aa45d8f60d14b2084c003d8f70bad2.jpg) +(g) + +![](images/46a2816f27e12d71aa70d837cdf6396d59b767e4ec6474f8a38a2cb51bb2b954.jpg) +(h) + +reasonable summarization with 2-bit weight 8-bit activations and fails at lower bit-width, showing the difficult natural of the language generation tasks. + +# 3.6 Visualization + +To further understand the effectiveness of the proposed method, we visualize weight and activation histograms in the BART model ternarized with the baseline method and the proposed method in Fig. 2. + +Both the baseline method and our method use per-row weight ternarization, and thus a tensor tensor will have #row of scaling factors. As we can see in Fig. 2 (b) and (g), the proposed method allows the weights to be more evenly distributed in three ternarization levels, which can allow higher information entropy in quantized weights, as discussed in Sec. 2.2. Additionally, we calculate the quantized weight distribution entropy (i.e., Eq. 7) in 96 fully-connected layers in the BART-base model and found that the proposed TBT method achieves consistently higher entropy in quantized weights than the baseline method in all the layers. Further, an interesting phenomenon we can see in Fig. 2 (a) (e) is that ternary weights in a baseline model are very close to the Gaussian distribution, in contrast, weights ternarized with TBT are capturing a more sophisticated distribution. This phenomenon implies that the proposed method helps the weights learn more informative patterns and thus better satisfy the high demand for language generation tasks. + +For activation quantization, it is evident that the + +attention layer and the SoftMax output only contain the positive activations $(\mathbf{X}_{\mathbf{R}}\in \mathbb{R}_{+})$ . If simply ternarized to $\{-\alpha ,0,\alpha \}$ , the ternary activations will waste one representative level (Fig. 2(d)) and therefore lead to lower accuracy. Instead, the proposed method uses a two-set ternarization method that ternarizes the non-negative activation layer $(\mathbf{X}_{\mathbf{R}}\in \mathbb{R}_{+})$ to $\{0,\alpha ,2\alpha \}$ , and learns the scaling factor $\alpha$ to better fit the underlying real-valued distribution. This ternarization method greatly reduces information loss and enhances the final accuracy. + +# 4 Related Work + +Quantization has long been studied to make neural networks more efficient (see (Hubara et al., 2017) for a survey). Due to the popularity of BERT, numerous works have studied quantization for transformer models, starting with 8-bit quantization (Zafrir et al., 2019; Fan et al., 2020), and progressing to 4-bit (Shen et al., 2020; Zadeh et al., 2020), ternary (Zhang et al., 2020) and binary Bai et al. (2021b); Qin et al. (2021); Liu et al. (2022). All of these works have focused on the encoder-only setting. + +In the generative setting, Prato et al. (2019); Behnke et al. (2021) demonstrate quantized models for machine translation, and Fan et al. (2020); Bai et al. (2021a) for language modeling, though only for moderate quantization levels (4-8 bits). Most recently, Tao et al. (2022) and Li et al. (2022) pushed weight quantization down to 2 bits (with + +8-bit activation quantization) and evaluated on language modeling and summarization. However, our method outperforms these works substantially, while also demonstrating accurate generative transformers with both weights and activations quantized to 2-bit and even 1-bit for the first time. + +# 5 Conclusion + +We have demonstrated high accuracy ternary and binary natural language generation models based on a pre-trained transformer encoder-decoder backbone. Quantizing both the weights and the activations of the network allow these models to run on special-purpose hardware using binary and ternary arithmetic, which doesn't require multiplication modules. Therefore our results promise multiple orders of magnitude gains in efficiency while running these models, and can drastically expand the use cases of such models beyond just high end gpu servers. We are especially excited about the implications of our results for larger text generation models such as GPT-3 (Brown et al., 2020). These models have both demonstrated impressive capabilities, while also presenting enormous scaling and computational challenges. Low-bit quantization is a promising approach to mitigate some of these issues. Whether our approach will scale to these models is an open problem and an exciting future research direction. + +# 6 Limitations + +We conduct experiments on public datasets of finite sentence length, while generalizability to extremely long sequences or even streaming data has not been verified. Furthermore, the generalizability of the proposed quantization method to other tasks, including computer vision or speech recognition, remains to be tested. In addition, binarization and ternarization require bit-packing to have actual memory savings and dedicated hardware support for real-time acceleration, which is more of a hardware implementation aspect and not studied in this paper. + +# 7 Ethics Statement + +We affirm that we contribute to society, avoid harm, and are honest and trustworthy. We respect previous work and appropriately cite the methods and datasets we are using. All data we use is public and no private data is involved. There is some potential risk if the translation technique is maliciously + +used by a third party and thus we are committed to maintaining the compression techniques we have developed and the general summarization/machine translation techniques used correctly without incurring any form of discrimination. + +# References + +Haoli Bai, Lu Hou, Lifeng Shang, Xin Jiang, Irwin King, and Michael R Lyu. 2021a. Towards efficient posttraining quantization of pre-trained language models. arXiv preprint arXiv:2109.15082. +Haoli Bai, Wei Zhang, Lu Hou, Lifeng Shang, Jin Jin, Xin Jiang, Qun Liu, Michael R Lyu, and Irwin King. 2021b. Binarybert: Pushing the limit of bert quantization. In ACL/IJCNLP (1). +Maximiliana Behnke, Nikolay Bogoychev, Alham Fikri Aji, Kenneth Heafield, Graeme Nail, Qianqian Zhu, Svetlana Tchistiakova, Jelmer Van der Linde, Pinzhen Chen, Sidharth Kashyap, et al. 2021. Efficient machine translation with model pruning and quantization. In Proceedings of the Sixth Conference on Machine Translation, pages 775-780. +Yoshua Bengio, Nicholas Léonard, and Aaron Courville. 2013. Estimating or propagating gradients through stochastic neurons for conditional computation. arXiv preprint arXiv:1308.3432. +Ondrej Bojar, Rajen Chatterjee, Christian Federmann, Yvette Graham, Barry Haddow, Matthias Huck, Antonio Jimeno Yepes, Philipp Koehn, Varvara Logacheva, Christof Monz, Matteo Negri, Aurélie Néveol, Mariana Neves, Martin Popel, Matt Post, Raphael Rubino, Carolina Scarton, Lucia Specia, Marco Turchi, Karin Verspoor, and Marcos Zampieri. 2016a. Findings of the 2016 conference on machine translation. In Proceedings of the First Conference on Machine Translation: Volume 2, Shared Task Papers, pages 131-198, Berlin, Germany. Association for Computational Linguistics. +Ondrej Bojar, Yvette Graham, Amir Kamran, and Miloš Stanojevic. 2016b. Results of the wmt16 metrics shared task. In Proceedings of the First Conference on Machine Translation: Volume 2, Shared Task Papers, pages 199-231. +Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. 2020. Language models are few-shot learners. Advances in neural information processing systems, 33:1877-1901. +Matthieu Courbariaux, Itay Hubara, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. 2016. Binarized neural networks: Training deep neural networks with weights and activations constrained to+ 1 or-1. arXiv preprint arXiv:1602.02830. + +Steven K Esser, Jeffrey L McKinstry, Deepika Bablani, Rathinakumar Appuswamy, and Dharmendra S Modha. 2019. Learned step size quantization. In International Conference on Learning Representations. +Angela Fan, Pierre Stock, Benjamin Graham, Edouard Grave, Rémi Gribonval, Herve Jegou, and Armand Joulin. 2020. Training with quantization noise for extreme model compression. arXiv preprint arXiv:2004.07320. +Xavier Glorot and Yoshua Bengio. 2010. Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the thirteenth international conference on artificial intelligence and statistics, pages 249-256. JMLR Workshop and Conference Proceedings. +Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. 2015. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In Proceedings of the IEEE international conference on computer vision, pages 1026-1034. +Itay Hubara, Matthieu Courbariaux, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. 2017. Quantized neural networks: Training neural networks with low precision weights and activations. The Journal of Machine Learning Research, 18(1):6869-6898. +François Lagunas, Ella Charlaix, Victor Sanh, and Alexander M Rush. 2021. Block pruning for faster transformers. arXiv preprint arXiv:2109.04838. +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. +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. +Fengfu Li, Bo Zhang, and Bin Liu. 2016. Ternary weight networks. arXiv preprint arXiv:1605.04711. +Zheng Li, Zijian Wang, Ming Tan, Ramesh Nallapati, Parminder Bhatia, Andrew Arnold, Bing Xiang, and Dan Roth. 2022. Dq-bart: Efficient sequence-to-sequence model via joint distillation and quantization. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 203-211. +Yinhan Liu, Jiatao Gu, Naman Goyal, Xian Li, Sergey Edunov, Marjan Ghazvininejad, Mike Lewis, and Luke Zettlemoyer. 2020a. Multilingual denoising + +pre-training for neural machine translation. Transactions of the Association for Computational Linguistics, 8:726-742. +Zechun Liu, Wenhan Luo, Baoyuan Wu, Xin Yang, Wei Liu, and Kwang-Ting Cheng. 2020b. Bi-real net: Binarizing deep network towards real-network performance. International Journal of Computer Vision, 128(1):202-219. +Zechun Liu, Barlas Oguz, Aasish Pappu, Lin Xiao, Scott Yih, Meng Li, Raghuraman Krishnamoorthi, and Yashar Mehdad. 2022. Bit: Robustly binarized multi-distilled transformer. arXiv preprint arXiv:2205.13016. +Zechun Liu, Baoyuan Wu, Wenhan Luo, Xin Yang, Wei Liu, and Kwang-Ting Cheng. 2018. Bi-real net: Enhancing the performance of 1-bit cnns with improved representational capability and advanced training algorithm. In Proceedings of the European conference on computer vision (ECCV), pages 722-737. +Ramesh Nallapati, Bowen Zhou, Caglar Gulcehre, Bing Xiang, et al. 2016. Abstractive text summarization using sequence-to-sequence rnns and beyond. arXiv preprint arXiv:1602.06023. +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. +Gabriele Prato, Ella Charlaix, and Mehdi Rezagholizadeh. 2019. Fully quantized transformer for machine translation. arXiv preprint arXiv:1910.10485. +Haotong Qin, Yifu Ding, Mingyuan Zhang, YAN Qinghua, Aishan Liu, Qingqing Dang, Ziwei Liu, and Xianglong Liu. 2021. Bibert: Accurate fully binarized bert. In International Conference on Learning Representations. +Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. 2018. Improving language understanding by generative pre-training. +Mohammad Rastegari, Vicente Ordonez, Joseph Redmon, and Ali Farhadi. 2016. Xnor-net: Imagenet classification using binary convolutional neural networks. In European conference on computer vision, pages 525-542. Springer. +Sheng Shen, Zhen Dong, Jiayu Ye, Linjian Ma, Zhewei Yao, Amir Gholami, Michael W Mahoney, and Kurt Keutzer. 2020. Q-bert: Hessian based ultra low precision quantization of bert. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 8815-8821. + +Chaofan Tao, Lu Hou, Wei Zhang, Lifeng Shang, Xin Jiang, Qun Liu, Ping Luo, and Ngai Wong. 2022. Compression of generative pre-trained language models via quantization. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 4821-4836. +Ali Hadi Zadeh, Isak Edo, Omar Mohamed Awad, and Andreas Moshovos. 2020. Gobo: Quantizing attention-based nlp models for low latency and energy efficient inference. In 2020 53rd Annual IEEE/ACM International Symposium on Microarchitecture (MICRO), pages 811-824. IEEE. +Ofir Zafrir, Guy Boudoukh, Peter Izsak, and Moshe Wasserblat. 2019. Q8bert: Quantized 8bit bert. In 2019 Fifth Workshop on Energy Efficient Machine Learning and Cognitive Computing-NeurIPS Edition (EMC2-NIPS), pages 36-39. IEEE. +Wei Zhang, Lu Hou, Yichun Yin, Lifeng Shang, Xiao Chen, Xin Jiang, and Qun Liu. 2020. Ternarybert: Distillation-aware ultra-low bit BERT. In EMNLP. +Shuchang Zhou, Yuxin Wu, Zekun Ni, Xinyu Zhou, He Wen, and Yuheng Zou. 2016. Dorefa-net: Training low bitwidth convolutional neural networks with low bitwidth gradients. arXiv preprint arXiv:1606.06160. + +A For every submission: + +A1. Did you describe the limitations of your work? Section 6 +A2. Did you discuss any potential risks of your work? Section 7 +A3. Do the abstract and introduction summarize the paper's main claims? Section 1 +A4. Have you used AI writing assistants when working on this paper? Left blank. + +B Did you use or create scientific artifacts? + +section 4 + +B1. Did you cite the creators of artifacts you used? section 4 +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? section 4 +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? section 4 +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? section 3 +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? section 3 +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. section 3 + +C Did you run computational experiments? + +section 3 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? section 3 + +The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? section 3 +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? section 3 +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? section 3 + +# D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? No response. +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? No response. +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? No response. +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? No response. +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? No response. \ No newline at end of file diff --git a/binaryandternarynaturallanguagegeneration/images.zip b/binaryandternarynaturallanguagegeneration/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..e15a0b2c9f5687ef309538a69437aaeb15a3ec01 --- /dev/null +++ b/binaryandternarynaturallanguagegeneration/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:540d78211130f5b4b9d8513405084fbb702b5e20f3e8825317602ffdcb9345b5 +size 511876 diff --git a/binaryandternarynaturallanguagegeneration/layout.json b/binaryandternarynaturallanguagegeneration/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..2d98944b61e3423b352c239da4b8554c4291c8a8 --- /dev/null +++ b/binaryandternarynaturallanguagegeneration/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fff2e9e259472a3b47485d9de63ff888beffcd8d2aff9fddf756a0d5dc7ee80c +size 434314 diff --git a/biphonemodelinginterlanguagephoneticinfluencesintext/d1a0f316-123e-4f1d-a6d5-728ae188720d_content_list.json b/biphonemodelinginterlanguagephoneticinfluencesintext/d1a0f316-123e-4f1d-a6d5-728ae188720d_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..dcea60e7eb275fd99dc5188fed5b77e2a3728a98 --- /dev/null +++ b/biphonemodelinginterlanguagephoneticinfluencesintext/d1a0f316-123e-4f1d-a6d5-728ae188720d_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9521404ba8bdde27a19d794f270bcc2987e4c833506a2e4fb806e4b0b6ead029 +size 86108 diff --git a/biphonemodelinginterlanguagephoneticinfluencesintext/d1a0f316-123e-4f1d-a6d5-728ae188720d_model.json b/biphonemodelinginterlanguagephoneticinfluencesintext/d1a0f316-123e-4f1d-a6d5-728ae188720d_model.json new file mode 100644 index 0000000000000000000000000000000000000000..79685b5327a41e526c94d757d9ea6ea1c699a3b6 --- /dev/null +++ b/biphonemodelinginterlanguagephoneticinfluencesintext/d1a0f316-123e-4f1d-a6d5-728ae188720d_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0e7666e239a9fc6118532300b4d08cc29378c9a7ce4c14eb263088cb75625d12 +size 103574 diff --git a/biphonemodelinginterlanguagephoneticinfluencesintext/d1a0f316-123e-4f1d-a6d5-728ae188720d_origin.pdf b/biphonemodelinginterlanguagephoneticinfluencesintext/d1a0f316-123e-4f1d-a6d5-728ae188720d_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..cbec84378911a0ec95c2783447bdbfaa5c607094 --- /dev/null +++ b/biphonemodelinginterlanguagephoneticinfluencesintext/d1a0f316-123e-4f1d-a6d5-728ae188720d_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aacbcd428980557b04cf944509b53a2b0d3b5b577c239b5a30969d0da007a213 +size 618398 diff --git a/biphonemodelinginterlanguagephoneticinfluencesintext/full.md b/biphonemodelinginterlanguagephoneticinfluencesintext/full.md new file mode 100644 index 0000000000000000000000000000000000000000..a14ca2194f520d10a74938460443e4939924a747 --- /dev/null +++ b/biphonemodelinginterlanguagephoneticinfluencesintext/full.md @@ -0,0 +1,342 @@ +# Bi-Phone: Modeling Inter Language Phonetic Influences in Text + +Abhirut Gupta1, Ananya B. Sai2, Richard Sproat1, Yuri Vasilevski1, James S. Ren1, Ambarish Jash1, Sukhdeep S. Sodhi1 and Aravindan Raghuveer1 + +Google Research + +$^{2}$ IIT Madras + +Corresponding author: abhirut@google.com + +# Abstract + +A large number of people are forced to use the Web in a language they have low literacy in due to technology asymmetries. Written text in the second language (L2) from such users often contains a large number of errors that are influenced by their native language (L1). We propose a method to mine phoneme confusions (sounds in L2 that an L1 speaker is likely to conflate) for pairs of L1 and L2. These confusions are then plugged into a generative model (Bi-Phone) for synthetically producing corrupted L2 text. Through human evaluations, we show that Bi-Phone generates plausible corruptions that differ across L1s and also have widespread coverage on the Web. We also corrupt the popular language understanding benchmark SuperGLUE with our technique (FunGLUE for Phonetically Noised GLUE) and show that SoTA language understating models perform poorly. We also introduce a new phoneme prediction pre-training task which helps byte models to recover performance close to SuperGLUE. Finally, we also release the FunGLUE benchmark to promote further research in phonetically robust language models. To the best of our knowledge, FunGLUE is the first benchmark to introduce L1-L2 interactions in text. + +# 1 Introduction + +We live in a multilingual world with over 7,000 languages spoken across the globe (Eberhard and Fennig, 2022). However, technology asymmetrically supports only a few specific languages. For instance, the internet is mostly in English with over $60\%$ of websites using the language despite just around $16\%$ share of its speaking population around the world1 (Grefenstette and Nioche, 2000). Increasingly, people are forced to navigate and produce content on the web in languages they have not been formally trained on. The English text produced by ESL (English as Second / L2 language) + +writers is heavily influenced by their native language (L1). + +Research in the field of second-language acquisition has found evidence of phoneme-shift based misspellings stemming from L1 influence in L2 text for specific language pairs (Ibrahim, 1978; Cook, 1997; Bestgen and Granger, 2011; Sari, 2014; Ogneva, 2018; Motohashi-Saigo and Ishizawa, 2020). Studies in Natural Language Understanding (NLU) have been limited to spelling correction Nagata et al. (2017); Flor et al. (2019) and native language identification Chen et al. (2017); Nicolai et al. (2013) in English learners. These studies predominantly use the TOEFL11 dataset (Blanchard et al., 2013) which deals with very specific demographics such as test-takers who have formal training in the L2 language. + +We make the following four key observations about prior work in the study of L1-L2 influences in text and speech. First, current models for L1-L2 influence on textual spelling are limited to certain language pairs and tasks. We argue that L1-L2 influence phenomenon is much more broad and is language and task agnostic. Second, there is no large scale study to examine the prevalence of this phenomenon on the open web. Third, given that this is an important problem especially for multilingual, new-to-the-internet communities there is no standardized benchmark to study the robustness of natural language understanding(NLU) and Natural Language Generation (NLG) models to inter-language phonetic noise. Finally, there is very sparse literature on architecture / pre-training strategies to introduce phonetic robustness into large language models. In this paper, we present modeling techniques, data analyses and a new benchmark to address the gaps mentioned above. We summarise our contributions as follows: + +1. We propose a language-agnostic method to mine phoneme confusions that arise due to interference between a native language (L1) + +and second language (L2). Our method exploits the "hidden knowledge" contained in $L1 \rightarrow L2$ and $L2 \rightarrow L1$ transliteration models. We also propose a generative model BiPhone that is able to synthetically produce spelling corruption in accordance with L1-L2 confusions (Sections 3.1, 3.2). + +2. Through human evaluation and coverage analysis we show that Bi-Phone produces spelling corruptions that are not only deemed plausible by native L1 speakers but also have substantial coverage in the open web crawl corpus. To the best of our knowledge no prior work has demonstrated the presence of L1-L2 phonetic corruptions in a large scale, common dataset like Commoncrawl (Section 4). +3. We release a dataset consisting of sentences with L1-L2 phonetic spelling corruptions found in Common Crawl. We also release a benchmark called FunGLUE, an extension of the SuperGLUE benchmark for L1-L2 spelling corruptions. To the best of our knowledge FunGLUE is the first benchmark to measure the robustness of models to L1-L2 interference in text (Section 5). +4. We show SoTA models do not perform well on FunGLUE. We then introduce a novel pretraining task of phoneme prediction, which together with byte level architectures substantially bridges the gap on the noised benchmark (by up to $11\%$ absolute on certain test sets). This is particularly impressive since this gain is achieved without ever showing the model any noised examples (Section 6). + +# 2 Related Work + +We divide the presentation of related work in two sections. (i) First, we discuss prior work spanning multiple research areas regarding phonetic influences in text and how it relates to our work. (ii) Second, we discuss work in the speech domain which studies phonetic variations occurring due to inter-language interference in multi-lingual scenarios. + +# 2.1 Phonetic Influences in Text + +Phonetic influence on spelling errors has been studied in the past (Kukich, 1992; Toutanova and Moore, 2002; Hladek et al., 2020). The source + +of such errors is that both native and non-native speakers resort to phonetic spellings for unfamiliar words or names. This direction of work does not address the effect of native language (L1) based phoneme shifts on second-language (L2) spellings. + +There has also been work that focuses on learner English ${}^{2}$ for different applications. Nagata et al. (2017); Flor et al. (2019) study automatic spell correction with distributional methods that require a larger learner corpus. Chen et al. (2017); Nicolai et al. (2013) explore Native Language Identification (NLI) on such text. A widely used dataset for these learner English tasks is the TOEFL11 corpus (Blanchard et al., 2013) which contains English essays written by non-native test-takers. It is important to note that these analysis are limited to misspellings made by authors with sufficient L2 knowledge/ training that qualifies them to take the test. They also do not explicitly study the causes of the misspellings or the inter-language interference. + +There has also been a fair amount of interest in the second-language acquisition field on the influence of L1 on L2 spelling. Ibrahim (1978); Cook (1997); Bestgen and Granger (2011); Sari (2014); Ogneva (2018); Motohashi-Saigo and Ishizawa (2020) all find evidence of such influence in specific language pairs. These often stem from the lack of certain sounds in L1 leading to difficulty in distinguishing similar sounds in L2. They also find more interesting phenomenon like L1 constraints on consonant clusters are reflected in L2 spellings by learners. While this direction of research is highly pertinent to our work, our goal is to generate plausible L1-L2 phonetic shift based misspellings more generally instead of studying the phenomenon in particular language pairs. + +# 2.2 Inter-language Influence for Phonetic Deviations in Speech + +Phonetic variations of words have been well-studied in the context of speech applications. Several studies (Radzikowski et al., 2019; Shah et al., 2020; Radzikowski et al., 2021; Bird et al., 2019) discuss the drop in performance of speech applications such as ASR, spoken-term detection, etc., when presented with non-native speech data. They attribute this drop mainly to the nuances in pronunciation that are often not present in the training data, due to the lack of sufficient non-native speech data. To address and close this gap, several strategies + +![](images/f9e066157be0ccd67a1329c5d88894f9ac615fa4edfda1dd40687209138f2f87.jpg) +Figure 1: Overview of the Round Trip Transliteration method for creating word pairs from which phoneme confusions are mined. In this example, we create pairs for the dictionary word "amazon" with round-trip transliteration through Hindi as the pivot language. Phoneme sequences for the original and round-trip transliterated words are also shown. Multiple words with $JH$ in the round-trip transliterations enables us to map the $Z$ sound to the $JH$ sound for Hindi speakers. +Figure 2: Examples of round trip transliterations of dictionary words with different pivot languages, the corresponding phoneme sequences, and the phoneme confusion mined. While the third example also has a Z -> S shift, it is not mined because we only consider the top-10 most frequent confusions per (L1, L2) pair. + +
Original wordNative transliterationReverse transliterationPhoneme pair mined
evasion IH V E Y Z H A H N(bn) ृँडँस्तनebason IH B EY Z H A H NV -> B
where W E H R(hi) ूयपरvare V E H RW -> V
grabs G R A E B Z(ta) अलिकारीcraps K R A E P SG -> K, B -> P
+ +ranging from the use of cross-lingual/multi-lingual phonological inventories to end-to-end training have been applied. However, these studies do not focus on how the same phonetic influences manifest in written text. + +# 3 Method + +In this section we introduce our method for creating inter-language influenced phonetic misspellings (or corruptions). We present the technique in two parts. Section 3.1 presents a method for mining native-language influenced phonetic confusions. Section 3.2 contains details of Bi-Phone, our model that uses mined phonetic confusions to create misspellings. + +# 3.1 Mining Phoneme-Phoneme Confusions + +The first problem is to identify possible phoneme confusions that a speaker of a given native language (L1) is likely to encounter when speaking a second + +language (L2). These confusions can be imagined as a matrix $C(L1, L2)$ , which contains likelihood of the $i_{th}$ L2 phoneme $(ph_i)$ being confused as the $j_{th}$ L2 phoneme $(ph_j)$ by a native speaker of L1 as the value in the cell $C(L1, L2)[i][j]$ . + +$$ +C (L 1, L 2) [ i ] [ j ] = P \left(p h _ {j} \mid p h _ {i}\right) \tag {1} +$$ + +Building this matrix across all pairs of languages is an expensive task. It is also challenging to accurately determine the likelihood of such confusions without large datasets of parallel words. + +Transliteration models are trained on large parallel datasets with the objective of transcribing sounds representing words in one language with in the script of a different language. They imbibe important information about sounds in one language that are indistinguishable in another (and therefore lexicalized identically). We propose a round-trip transliteration based method which aims to mine these phoneme confusions and their likelihoods from this knowledge hidden in transliteration models. We collect a large dictionary of English words (our chosen L2) and apply two steps of transliteration $^{3}$ (Bhat et al., 2015) to convert them back to English via a pivot language (L1), as shown in Figure 1. We then align the phoneme sequence of the original word with that of its round-trip transliterated version using the Needleman-Wunsch algorithm (Needleman and Wunsch, 1970). We count the frequency of each of the possible sound-shifts in the whole corpus to estimate likelihood. Figure 2 shows examples of word pairs created through different pivot languages and the phoneme confusion mined from these. We consider only the top-10 most frequent phoneme confusions per (L1, L2) for the next step. + +# 3.2 BiPhone: A Generative Model for L1-L2 Phonetic Misspellings + +The second problem we focus on is to create a model for sampling phonetic misspellings $(\tilde{w})$ for a given word $(w)$ in L2 that a native speaker of L1 is likely to make. We can represent the probability distribution learnt by this model as $P(\tilde{w} | w)$ . Assuming a deterministic mapping from the word $w$ to its phoneme sequence $ph_w$ , and introducing the corrupted phoneme sequence $(ph_{\tilde{w}})$ that finally + +generates $\tilde{w}$ , we can rewrite it as - + +$$ +\begin{array}{l} P (\tilde {\boldsymbol {w}} | \boldsymbol {w}) = P (\tilde {\boldsymbol {w}} | \boldsymbol {p h} _ {\boldsymbol {w}}) \\ = \sum_ {\boldsymbol {p h} _ {\tilde {w}}} P \left(\boldsymbol {p h} _ {\tilde {w}} \mid \boldsymbol {p h} _ {\boldsymbol {w}}\right) * P (\tilde {\boldsymbol {w}} \mid \boldsymbol {p h} _ {\tilde {w}}) \tag {2} \\ \end{array} +$$ + +Here a word $\pmb{w}$ is comprised of graphemes $\{w^1, w^2,..\}$ where $w^i \in \text{Graphemes}(L2)$ and a phoneme sequence $\pmb{ph}_w$ is comprised of phonemes $\{ph^1, ph^2,..\}$ where each individual phoneme $ph^i$ is from the set of available phonemes for $L2$ . In our experiments, we use the ARPAbet phoneme set for English 4. + +Phoneme-Phoneme Error Model: The first term under the summation in Equation 2 models the likelihood of generating a corrupted phoneme sequence $\boldsymbol{ph}_{\tilde{\boldsymbol{w}}}$ given that a native speaker of L1 is attempting to speak a phoneme sequence $\boldsymbol{ph}_{\boldsymbol{w}}$ in L2. With simplifying independence assumptions that each phoneme is corrupted individually, independent of phonemes around it, we can factorize this term to utilize the phoneme confusion matrix we have mined. + +$$ +\begin{array}{l} P \left(\boldsymbol {p h} _ {\tilde {w}} \mid \boldsymbol {p h} _ {w}\right) = \prod_ {i} P \left(p h _ {\tilde {w}} ^ {i} \mid p h _ {w} ^ {i}\right) (3) \\ = \prod_ {i} C (L 1, L 2) \left[ p h _ {w} ^ {i} \right] \left[ p h _ {\tilde {w}} ^ {i} \right] (3) \\ \end{array} +$$ + +Phoneme-Grapheme Density Model: The second term in Equation 2 expresses the probability of generating the grapheme sequence to represent $\tilde{w}$ given the phoneme sequence $ph_{\tilde{w}}$ . We can assume equal lengths for the two sequences, by allowing some phonemes to not generate any graphemes, when necessary. Again, we make independence assumptions where the grapheme used to represent a given phoneme does not depend on neighbouring phonemes or graphemes. + +$$ +P (\tilde {\boldsymbol {w}} | \boldsymbol {p h} _ {\tilde {\boldsymbol {w}}}) = \prod_ {i} P (\tilde {w} ^ {i} | p h _ {\tilde {w}} ^ {i}) \tag {4} +$$ + +To compute $P(\tilde{w}^i | ph_{\tilde{w}}^i)$ , we use a pronunciation dictionary in L2 (CMUDict for English). First, phoneme-character probabilities are generated through alignment. Next, for each word, character sequences are converted to graphemes by maximizing the alignment score. Finally, the various phoneme-grapheme alignments along with + +
Phoneme Shift\( \mathbf{{Hi}} \)\( \mathbf{{Ta}} \)\( \mathbf{{Bn}} \)
AH2 -> AH0100%-100%
IH2 -> IH0100%-100%
ER2 -> ER0100%--
DH -> TH54%-62%
ER2 -> ER095%--
D -> T-30%-
B -> P-39%-
DH -> D-0%-
G -> K-47%-
V -> B--58%
Z -> S--50%
+ +Table 1: Plausibility scores for different phoneme shifts across Hindi, Tamil, and Bengali. + +
L1Correct WordMisspelt WordPhoneme Variation
HinditheythayDH -> TH
Tamilexam bacterialeksam pactorialG -> K +B -> P
Bengalivery equationbery ikvasanV -> B +ZH -> S
+ +Table 2: Examples of highly plausible misspellings as rated by native speakers for various L1 languages with L2 language as English + +their frequencies are converted to probabilities by dividing it by the frequency of the phoneme. + +Inference: Given an original phoneme sequence for a word to be corrupted, we begin sampling with a fixed width (K) beam from left to right. At each position, we pick the top-K candidates comprising both phoneme-phoneme shifts and phoneme-grapheme alternatives greedily. Since both Phoneme-Phoneme Error Model and Phoneme-Grapheme Density Model are context independent, the greedy strategy gives us the global top-K misspellings. Identity corruptions are removed as a final step. + +# 4 Evaluations + +We evaluate the misspellings generated by our model along two distinct dimensions. + +# 4.1 Plausibility + +For evaluating plausibility of generated misspellings from Bi-Phone, we focus on three native languages (L1): Hindi, Tamil and Bengali with English as the non-native language (L2). Hindi and Bengali are the two most widely spoken languages in India and among the top few in the world. Tamil is also a widely spoken language in India and intro + +![](images/b8909f9d28238261a94b977d0df2672d8807cf9f3022790e79238496d1449731.jpg) +Figure 3: Precision and coverage plotted at different misspelling confidence scores (labels on points). Coverage is represented as a fraction of 31,755,066 sentences that have atleast one non-English dictionary word. + +duces typological diversity in our analysis. Finally, our choice of L1 is also based on availability of native speakers for the annotation task. + +For each language, we present 150 randomly selected word, misspelling pairs generated from B-Phone to native speakers (5 for Hindi, 3 for Tamil and Bengali each). Rater instructions are as follows: Given a list of pairs in English (correct word, misspelling), the task is to evaluate if the misspelling is plausible for pronunciation shifts often made by speakers of the given first language. For example - Bengali speakers often shift the "v" sound to "b" so, "evicted" could be plausibly misspelt as "ebicted" or "abicted". Each rater provides a 1 or 0 to indicate whether the variant looks plausible or not, respectively. We use a simple majority to assign an overall label to each pair. The raters for this task are our colleagues who are native speakers of the language they are annotating for. + +Table 1 reports the percentage of misspellings rated as plausible for each phoneme shift. We observe that misspellings for Tamil are rated as less plausible than for other languages. The reason for this is the more drastic phoneme shifts uncovered in Tamil (B -> P and G -> K). However, misspellings stemming from these shifts are still not rated as completely implausible, which emphasizes that these shifts are indeed common. We also measure inter-annotator agreement through kappa scores which are 0.40 for Hindi, 0.37 for Tamil, and 0.34 for Bengali. + +# 4.2 Prevalence: Coverage Analysis + +In the previous section we investigate the plausibility of phoneme-shifts mined by Bi-Phone and the misspellings created as a result. However, this + +investigation does not throw light on the pervasiveness of such misspellings in real world content. + +In this section, we aim to evaluate the severity of the phonetic misspelling issue by uncovering such misspellings in web data. For our analysis, we use the Common Crawl6 corpus, which is a publicly available scrape of real web data. While most existing language work deals with a highly cleaned version of this corpus (Raffel et al., 2020b), we skip such filtering and cleaning steps to retain noisy, user-generated text. We only use Hindi as the native language (L1) in this analysis. Our analysis has three distinct steps - (1) Candidate Sentence Retrieval, (2) Misspelling Confidence Scoring, and (3) Human Evaluation. + +1. Candidate Sentence Retrieval: We begin our analysis by creating 10 misspellings of the top 10,000 most common English words from the Google ngram corpus (Michel et al., 2011) and words that make up $90\%$ -ile of the English words in the Common Crawl corpus. Our hypothesis is that the most common words in English are also the most likely to be misspelt with native language influences. Our pool of sentences is the set of all sentences with at least one non-English dictionary word. The size of this pool is 31,755,066 sentences. From this pool, we create our candidate set by retrieving all sentences that contain one of our generated misspellings. + +2. Misspelling Confidence Scoring: The next step is to ascertain that the misspellings retrieved are indeed a noisy form of the intended original word and not a completely different word. For example, "vare" could be a corruption of the English word "where" with the W -> V sound shift, or it could be the less used English word meaning a weasel 7. We use a simple 1-word left and right context for this disambiguation. For every occurrence of a potentially misspelt word $\hat{W}$ in context $(L_{\hat{W}}, \hat{W}, R_{\hat{W}})$ , we evaluate the probability of seeing the corresponding clean word $(W)$ in the same context. This likelihood, $P(L_{\hat{W}}, W, R_{\hat{W}})$ computed as follows can be used as a score to represent our confidence in the retrieved misspelling. + +$$ +\begin{array}{l} P (L _ {\hat {W}}, W, R _ {\hat {W}}) \\ = \frac {F (L _ {\hat {W}} , W , R _ {\hat {W}})}{\sum_ {w} F (L _ {\hat {W}} , w , R _ {\hat {W}})}, \mathrm {i f} \sum_ {w} F (L _ {\hat {W}}, w, R _ {\hat {W}}) > 0 \\ = 0. 4 * \left[ \frac {F \left(L _ {\hat {W}} , W\right)}{\sum_ {w} F \left(L _ {\hat {W}} , w\right)} + \frac {F \left(W , R _ {\hat {W}}\right)}{\sum_ {w} F \left(w , R _ {\hat {W}}\right)} \right], \text {o t h e r w i s e} \\ \end{array} +$$ + +Here 0.4 is the backoff-weight following the Stupid Backoff technique from Brants et al. (2007). + +We can compute the coverage of Bi-Phone in web data by considering the fraction of sentences where the misspelling confidence score is greater than a certain threshold over the total number of sentences in our original pool. + +3. Human Evaluation: Finally, we also sample a subset of the sentences to have human raters verify that our retrieved misspellings indeed correspond to the original word. We show raters the original retrieved sentence which contains the generated misspelling and a parallel sentence where the misspelling has been replaced with the original word and ask raters if this correction is valid in the given context. We can compute a reliable metric for precision with this human evaluation. Ratings for this task are fetched from a cloud rating service where raters are bilingual Hindi-English speakers with a graduate degree. + +Figure 3 presents the precision and coverage at different thresholds of misspelling confidence score. At threshold 0.001, we have roughly $70\%$ precision while still having a coverage of $1.14\%$ (362,472 sentences*). The size of the initial pool (30 million candidate sentences) and the simple method used for our analysis underline how prevalent such misspellings are. Also it is important note that such misspellings will be even more prevalent in a purely UGC (user generated content) corpus. C4 contains a significant fraction of clean English web pages. + +# 5 The FunGLUE Benchmark + +Significant progress has been made in recent research to substantially improve performance of language understanding tasks. SuperGLUE (Wang et al., 2019) is a very popular benchmark with ten diverse and hard language understanding tasks. These tasks are BoolQ, CommitmentBank (CB), Multi-Sentence Reading Comprehension (MultiRC), Choice of Plausible Alternatives (COPA), Reading Comprehension with Commonsense Reasoning (ReCoRD), Recognizing Textual Entail + +
SplitDescriptionContains +Phonetic +Noise
trainTrain split from SuperGLUE as isNo
devDev split from SuperGLUE as isNo
testDev split from SuperGLUE noised +with BiPhoneYes
+ +Table 3: Description of splits in FunGLUE. Checkpoint selection is done on the dev set which does not contain phonetic misspellings. The test set is used only for reporting results. + +
TaskField Name
BoolQquestion
CBpremise
COPApremise
MultiRCquestion
ReCoRDquery
RTEhypothesis
WiCsentence1
+ +Table 4: Fields we noise for different task when creating FunGLUE. + +ment (RTE), Words in Context (WiC), Broadcoverage Diagnostics (AX-b), The Winograd Schema Challenge (WSC), and Winogender Schema Diagnostics (AX-g). We argue that for language understanding models to be effective for bi-lingual users, they must be robust to inter-language phonetic spelling variations. Towards this end, we introduce FunGLUE which stands for Ph(F)onetically noised GLUE where randomly selected words from tasks in the SuperGLUE benchmark are corrupted with Bi-Phone based misspellings. It is extremely important to note that we only create a hold-out evaluation set created by introducing misspellings to the SuperGLUE development set. The training set is left clean to mimic real world scenarios where noised training data is difficult to obtain. Additionally, it would be unfair to train and evaluate models on synthetic misspellings from the same source. Table 3 summarizes the training, validation, and test sets in FunGLUE. + +Misspellings for words in the original task are created from Bi-Phone with the following design choices: + +(i) What to noise: Since we want to keep the task realistic, we only introduce misspellings in certain pre-selected fields and not all text fields. This reflects real world situations where content is often available in well spelt English but user queries have phonetic errors. Table 4 presents the fields we actually noise. + +
TaskTokens misspeltExamples w/ noise
boolq30.6%96.2%
cb29.5%96.4%
multirc33.8%96.4%
copa25.2%78.0%
record29.5%99.4%
rte35.9%97.1%
wic28.9%84.0%
+ +Table 5: Stats on amount of noise added in FunGLUE. + +
TaskSuperGLUE TextFunGLUE Text
BoolQquestion: is it possible for someone to die of laughterquestion: is it pasebal for someone to die of lafter
CBquery: He also invoked the bitterly disputed 2000 presidential electionquery: He ollso invoked the bitterly disputed 2000 presidential ilektan
+ +Figure 4: Examples from validation set of two tasks in FunGLUE against SuperGLUE. Words which are replaced with their noised versions are in red. + +(ii) Which misspellings to use: Since we expect benchmarks to have a high quality, we put in a number of guardrails to ensure poor quality misspellings do not make it through to the benchmark. First, we only use Bi-Phone misspellings with Hindi and Bengali as native language since Tamil misspellings were rated as less plausible by native speakers. Next, we noticed that plausibility scores drop for words smaller than 4 characters, so we only noise longer words. We also filter out misspellings that contain certain patterns of implausible noise generated by our Grapheme2Phoneme model with rules. Finally, all (word, misspelling) pairs used in FunGLUE are manually verified by members of the team as plausible. + +(iii) How much noise to add: Since we do not want to artificially introduce too much noise, we only replace $30\%$ of words from the original benchmark across tasks. Table 5 contains stats on the amount of noise added to each task. We were currently unable to include the noised version of the WSC, AX-b and AX-g tasks due to some difficulties in accessing the eval sets. We plan to include this with the final data release. + +# 5.1 Models + +In this section we investigate if state-of-the-art models are robust to the phonetic noise introduced by FunGLUE by comparing their performance on SuperGLUE. For this purpose, we consider mT5 (Xue et al., 2021b) and ByT5 (Xue et al., 2021a) models. These are both transformer based sequence-to-sequence models that frame all lan + +guage understanding tasks as sequence generation. mT5 uses sub-word tokenization built on a multilingual corpus, to represent text. It should therefore be more robust to input variations than comparable models with tokenization on monolingual corpora with lower diversity. ByT5 avoids the tokenization step by building input representations from individual bytes, and is designed to perform more gracefully on noisy text across a range of tasks. + +For all models, we use the base architecture. Since training these models is expensive, we do not perform any hyper-parameter search. Instead, we use fine-tuning parameter values from the original papers. Crucially, fine-tuning for all models is performed identically on clean data from SuperGLUE. We use the same mixture of tasks as in Raffel et al. (2020a). Fine-tuning is done for up to 200,000 steps and the best checkpoint is picked based on performance on the clean dev set from SuperGLUE. We use 16 TPUv3s for fine-tuning all models. + +# 5.2 Spell Correction Baselines + +Spell correction methods provide obvious baselines when dealing with incorrectly spelt data. Spell corrected data can then be used to run inference with existing models. To evaluate the merit of this technique, we measure performance after correction from two state of the art approaches: (1) NeuSpell BERT (Jayanthi et al., 2020) - spell corrector built on top of BERT. (2) BERT-Large mask prediction using a BERT Large model for predicting the correct word in positions where we have misspellings. In both of these approaches, we provide the positions of incorrectly spelt words. This is an advantage since this information is not available in real world noisy text. We compare the performance of both mT5 and ByT5 on FunGLUE eval sets corrected by these approaches. + +# 5.3 Results + +Rows 1-4 in Table 6 show the performance of mT5 and ByT5 on SuperGLUE and FunGLUE. There is a clear drop in performance for both models on FunGLUE, with both mT5 and ByT5 dropping up to 16 F1 points on the CB dataset. The mT5 model also drops by roughly 9 points in accuracy on the BoolQ dataset, and similarly 9 F1 points on the ReCoRD dataset. While the ByT5 model is in general more robust than the mT5 model, its performance also drops by 10 points in accuracy on RTE. + +
No.ModelBoolQCBCOPAMultiRCReCoRDRTEWiC
AccAccF1AccEMF1EMF1AccAcc
SuperGLUE
1mT578.1092.8690.5361.0033.6873.0367.2268.2674.3768.03
2ByT579.2091.0790.3758.0032.0070.1472.1072.7981.2370.85
FunGLUE
3mT568.8180.3674.2155.0028.2370.3758.4659.4667.8763.64
3amT5 - NeuSpell67.9276.7974.9964.0030.4370.8560.3661.3365.3465.83
3bmT5 - Bert-L mask pred66.4271.4379.657.0027.7067.9155.656.6358.8462.54
4ByT574.0480.3673.6758.0032.4272.7367.5468.1970.4066.46
4aByT5 - NeuSpell72.8476.7967.8654.0032.5372.4763.6464.2569.6866.46
4bByT5 - Bert-L mask pred70.5275.0070.755.0026.7668.6059.7560.3564.6264.26
5Phonetic mT571.8080.3673.6653.0025.8172.255.8556.8661.3763.17
6Phonetic ByT574.3787.5085.4666.0033.2675.1570.2170.8876.1766.77
+ +Table 6: First 4 rows: Performance of SoTA models on tasks in the SuperGLUE and FunGLUE (noised) benchmarks. Performance of both mT5 and ByT5 (rows 3 and 4 compared to 1 and 2) drops on the noised benchmark, although ByT5 (row 4) is slightly more robust. Rows 3a, 3b, 4a, and 4b show the performance of mT5 and ByT5 after misspell words in the eval set are replaced with corrections from SoTA techniques. While mT5 benefits slightly from such corrections, ByT5 performance is worse across all tasks after spell correction is applied. This demonstrates the inability of current spell correction models to handle such misspellings. Rows 3a and 4a correspond to corrections from the NeuSpell (Jayanthi et al., 2020) model. Rows 3b and 4b correspond to corrections using mask prediction from a Bert-Large model. Last 2 rows: Performance of the same models when trained on a few additional steps with the phoneme prediction task on clean data (Phonetic mT5 and ByT5). The ByT5 (row 6 compared to row 4) model gains substantially with such pre-training. + +The spell correction baselines (Rows 3a, 3b, 4a, 4b) also fail to recover performance. With NeuSpell, mT5 sees a drop in BoolQ and RTE, slight improvement on CB, MultiRC, Record, WIC (<2 points Acc/F1). On COPA, we observe a substantial recovery (55 -> 64). For ByT5 however, there is a drop in performance across the board. NeuSpell is not well equipped to handle phonetic misspellings. Therefore the spell corrected word is often farther from the original word than the misspelling. These bad corrections hurt ByT5, which is slightly more robust to misspellings than mT5. With Bert-Large mask prediction, for mT5 there is a slight improvement on COPA and improvement on CB(74.21 -> 79.6), but worse performance on all other tasks. Again for ByT5, we see degradation in performance across the board. Since $30\%$ of the tokens are phonetically misspelt, the contextual mask prediction task is also not accurate. Another failure mode we observed was that the prediction is often the correct type (adjective for adjective) but not the original token. + +This clearly demonstrates the challenge posed by phoneme-shift based noisy misspellings introduced in FunGLUE. Current models and training schemes are ill-equipped to function on such data. + +![](images/12a64ef7bf3e24891255de1ae99c3f8d56ae74181ba96e99c19ff7cf41cd57bf.jpg) +Figure 5: Demonstration of our mixture pre-training task that combines standard span-corruption with the novel phoneme prediction task in an 80:20 ratio. All weights and embeddings in the model are shared. + +# 6 Phoneme Prediction as a Pre-training Task + +Given the inadequacy of existing State-of-the-Art models in handling phonetic noise in inputs, we propose a novel pre-training task of phoneme prediction. We posit that the task of predicting phoneme sequences will have the effect of teaching the model "phonetic information". Since different lexicalizations of the same sound will have the same phoneme sequence, the model will learn to embed these close. Additionally since close sounds often appear in similar intra-word contexts, their graphemic representations will also be pushed closed together. + +However, to perform NLP tasks, semantic similarity is still crucial. In current models this is often achieved through some variation of the span corruption task (corrupting a span in the input and predicting it on the output). We propose a mixture of these two tasks where a small amount of the phoneme prediction task $(20\%)$ is mixed into the standard span corruption task. Figure 5 demonstrates our proposal through two example instances. In the first instance the span "sofa design" is masked in the input (replaced with a sentinel) and is expected to be produced on the output. This teaches the model that adjectives like "exquisite" are semantically close. The second instance has the word "building" in the input and the phoneme sequence corresponding to this word (B, IH, L, D, IH, NG) on the output. This task teaches the model that all tokens that produce the same sound (like "ui" or "e" for IH) should be embedded close. + +We train both mT5 and ByT5 checkpoints for an additional 100,000 steps (10% additional steps) on this mixture task. We call this step of additional pre-training, "Phonetic pre-training". Finally, we fine-tune these models on the standard clean SuperGLUE training set. The phoneme prediction data is created by taking roughly 2,000,000 highest frequency words from the Common Crawl English data and getting their pronunciations from an off-the-shelf Grapheme to Phoneme model. As we will see later, this kind of noisy supervision (not human labelled) is still useful in making models phonetically robust. + +The last two rows in Table 6 show the performance of these models on FunGLUE. We find that the simple additional pre-training step of phoneme-prediction substantially improves performance of the ByT5 model on the noised benchmark (row 6 against row 4). Performance on CB increases by 11 F1 points, on COPA there is a 8 point accuracy gain, and a 5 point accuracy gain on RTE. While performance still lags compared to the clean benchmark SuperGLUE (row 6 against row 2) on most tasks, for MultiRC and COPA, we find that the phonetically pre-trained ByT5 model even outperforms the vanilla pre-trained model (row 2) numbers on the clean task. This is particularly impressive because the Phonetic ByT5 model (row 6) has never seen any noisy data during its training. The mT5 model does not however see the same impressive gains through this pre-training task. We hypothesize this is because of the harder sub-word + +tokenization in mT5. Many tokens that this model needs on the noised task are never seen when it's trained on clean data and therefore have poor representations. + +The ByT5 model does however have certain drawbacks. Since input sequences are much longer with byte level representations, both training and inference times are much slower than a sub-word tokenized alternative (like mT5). Additionally, the byte-level representation also restricts input sequence lengths. Using these phonetically robust byte-level models as teachers for sub-word tokenized student models remains an interesting direction for future work. + +# 7 Conclusion + +Language is a significant barrier to technology especially for new internet users. For such users, English often is not their first language. The speech community has made significant progress in making technology (ASR for instance) accessible for such users by making models robust to account for inter-language interactions. We argue that a similar line of effort is needed in the Natural Language Understanding for Text community as well. To this end, we first propose a generative model Bi-Phone that can account for L1-L2 interactions in text. Next we show the inter-language perturbations generated by Bi-Phone are indeed present in non-trivial amount in the common crawl corpus. We also release a new benchmark FunGLUE to help further research in this area. We also present our early yet very promising explorations on making natural language understanding models robust to L1-L2 phonetic shifts through a novel phoneme prediction based pre-training. + +# 8 Limitations + +Algorithmic Limitations: The current approach assumes each phoneme / grapheme corruption is independent of the surrounding phonemes / graphemes, which can be relaxed to get further insights and model any contextual phonetic shifts. The relative importance between grapheme and phoneme corruptions could also be explored as a hyperparameter to personalize more to the type of errors of a community. + +Other Limitations (with respect to available data and existing resources): Our coverage analysis is conservative since it does not cover the user generated data from various social media where such + +L1-L2 phonetic misspellings are bound to be more common. The coverage analysis also relies on the context not being corrupted. However, this might not necessarily hold and the analysis could benefit from a careful formulation of a relaxed matching criteria that also considers cases with corrupted contexts. With transliteration playing a major role in our solution, it is difficult to immediately extend the work to low-resource languages that do not have models or appropriate datasets to build transliteration modules. + +# References + +Yves Bestgen and Sylviane Granger. 2011. Categorizing spelling errors to assess L2 writing. International Journal of Continuing Engineering Education and Life Long Learning, 21(2-3):235-252. +Irfad Ahmad Bhat, Vandan Mujadia, Aniruddha Tammewar, Riyadh Ahmad Bhat, and Manish Shrivastava. 2015. Iiit-h system submission for fire2014 shared task on transliterated search. In Proceedings of the Forum for Information Retrieval Evaluation, FIRE '14, pages 48-53, New York, NY, USA. ACM. +Jordan J. Bird, Elizabeth F. Wanner, Anikó Ekárt, and Diego R. Faria. 2019. Accent classification in human speech biometrics for native and non-native english speakers. In Proceedings of the 12th ACM International Conference on Pervasive Technologies Related to Assistive Environments, PETRA 2019, Island of Rhodes, Greece, June 5-7, 2019, pages 554-560. ACM. +Daniel Blanchard, Joel Tetreault, Derrick Higgins, Aoife Cahill, and Martin Chodorow. 2013. Toefl11: A corpus of non-native english. ETS Research Report Series, 2013:i-15. +Thorsten Brants, Ashok C. Popat, Peng Xu, Franz J. Och, and Jeffrey Dean. 2007. Large language models in machine translation. In Proceedings of the 2007 Joint Conference on Empirical Methods in Natural Language Processing and Computational Natural Language Learning (EMNLP-CoNLL), pages 858-867, Prague, Czech Republic. Association for Computational Linguistics. +Lingzhen Chen, Carlo Strapparava, and Vivi Nastase. 2017. Improving native language identification by using spelling errors. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 542-546, Vancouver, Canada. Association for Computational Linguistics. +Vivian Cook. 1997. L2 users and english spelling. Journal of Multilingual and Multicultural Development, 18(6):474-488. + +Gary F. Simons Eberhard, David M. and Charles D. Fennig. 2022. Ethnologue, languages of the world. http://www.ethnologue.com/. +Michael Flor, Michael Fried, and Alla Rozovskaya. 2019. A benchmark corpus of English misspellings and a minimally-supervised model for spelling correction. In Proceedings of the Fourteenth Workshop on Innovative Use of NLP for Building Educational Applications, pages 76-86, Florence, Italy. Association for Computational Linguistics. +Gregory Grefenstette and Julien Nioche. 2000. Estimation of english and non-english language use on the www. In Content-Based Multimedia Information Access - Volume 1, RIAO '00, page 237-246, Paris, FRA. LE CENTRE DE HAUTES ETUDES INTERNATIONALES D'INFORMATIQUE DOCUMENTAIRE. +Daniel Hladek, Jan Staš, and Matús Pleva. 2020. Survey of automatic spelling correction. *Electronics*, 9(10). +Muhammad Hasan Ibrahim. 1978. Patterns in spelling errors. English Language Teaching, 32:207-212. +Sai Muralidhar Jayanthi, Danish Pruthi, and Graham Neubig. 2020. NeuSpell: A neural spelling correction toolkit. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 158-164, Online. Association for Computational Linguistics. +Karen Kukich. 1992. Techniques for automatically correcting words in text. ACM Comput. Surv., 24(4):377-439. +Jean-Baptiste Michel, Yuan Kui Shen, Aviva Presser Aiden, Adrian Veres, Matthew K Gray, Google Books Team, Joseph P Pickett, Dale Hoiberg, Dan Clancy, Peter Norvig, et al. 2011. Quantitative analysis of culture using millions of digitized books. science, 331(6014):176-182. +Miki Motohashi-Saigo and Toru Ishizawa. 2020. A relationship between orthographic output and perception in l2 Japanese phonology by L1 English speakers. Ampersand, 7:100071. +Ryo Nagata, Hiroya Takamura, and Graham Neubig. 2017. Adaptive spelling error correction models for learner english. Procedia Computer Science, 112:474-483. Knowledge-Based and Intelligent Information Engineering Systems: Proceedings of the 21st International Conference, KES-20176-8 September 2017, Marseille, France. +Saul B. Needleman and Christian D. Wunsch. 1970. A general method applicable to the search for similarities in the amino acid sequence of two proteins. Journal of Molecular Biology, 48(3):443-453. +Garrett Nicolai, Bradley Hauer, Mohammad Salameh, Lei Yao, and Grzegorz Kondrak. 2013. Cognate and + +misspelling features for natural language identification. In Proceedings of the Eighth Workshop on Innovative Use of NLP for Building Educational Applications, pages 140-145, Atlanta, Georgia. Association for Computational Linguistics. +Anastasiia Ogneva. 2018. Spelling errors in L2 Russian: evidence from Spanish-speaking students. Estudios interlinguidicos, 6:116-131. +Kacper Radzikowski, Robert Nowak, Le Wang, and Osamu Yoshie. 2019. Dual supervised learning for non-native speech recognition. EURASIP J. Audio Speech Music. Process., 2019:3. +Kacper Radzikowski, Le Wang, Osamu Yoshie, and Robert M. Nowak. 2021. Accent modification for speech recognition of non-native speakers using neural style transfer. EURASIP J. Audio Speech Music. Process., 2021(1):11. +Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. 2020a. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 21(140):1-67. +Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J Liu, et al. 2020b. Exploring the limits of transfer learning with a unified text-to-text transformer. J. Mach. Learn. Res., 21(140):1-67. +Ida Rukmana Sari. 2014. Common errors in students' spelling on the required words for the seventh graders. *Educate*, 4(2):35-43. +Sanket Shah, Satarupa Guha, Simran Khanuja, and Sunayana Sitaram. 2020. Cross-lingual and multilingual spoken term detection for low-resource indian languages. CoRR, abs/2011.06226. +Kristina Toutanova and Robert Moore. 2002. Pronunciation modeling for improved spelling correction. In Proceedings of the 40th Annual Meeting of the Association for Computational Linguistics, pages 144-151, Philadelphia, Pennsylvania, USA. Association for Computational Linguistics. +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. Advances in neural information processing systems, 32. +Linting Xue, Aditya Barua, Noah Constant, Rami Al-Rfou, Sharan Narang, Mihir Kale, Adam Roberts, and Colin Raffel. 2021a. Byt5: Towards a token-free future with pre-trained byte-to-byte models. CoRR, abs/2105.13626. +Linting Xue, Noah Constant, Adam Roberts, Mihir Kale, Rami Al-Rfou, Aditya Siddhant, Aditya Barua, and Colin Raffel. 2021b. 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. + +A For every submission: + +A1. Did you describe the limitations of your work? 8 +A2. Did you discuss any potential risks of your work? Our paper focuses on building inclusive technology and we don't see any potential risks. +A3. Do the abstract and introduction summarize the paper's main claims? +A4. Have you used AI writing assistants when working on this paper? Left blank. + +B Did you use or create scientific artifacts? + +3,4,5,6, + +B1. Did you cite the creators of artifacts you used? 3,4,5,6, +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? 3,4,5 (provided links in footnotes to the artifacts from which the license or terms are available) +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? 5 +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? We only create binary annotations on datasets from an existing benchmark (SuperGLUE). +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? 3,4,5 +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. 4,5 + +C Did you run computational experiments? + +4,5,6 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? 5,6 + +The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +5,6 Since we are training large models (Byt5 and mT5 base arch) we could not do hyperparameter search. We used values from original papers. + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +4,5,6 + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +3,5 + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +4 + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +4 + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +4 + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +Not applicable. We are not using any personal data. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +Not applicable. Left blank. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +4 \ No newline at end of file diff --git a/biphonemodelinginterlanguagephoneticinfluencesintext/images.zip b/biphonemodelinginterlanguagephoneticinfluencesintext/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..c4763781c4ce20e17dccb3cdd32e9d9d28a78c87 --- /dev/null +++ b/biphonemodelinginterlanguagephoneticinfluencesintext/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c581ffbf2adf30f8e34dc2f45602bb3a739814540356ce5bce74387d62882caf +size 351359 diff --git a/biphonemodelinginterlanguagephoneticinfluencesintext/layout.json b/biphonemodelinginterlanguagephoneticinfluencesintext/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..b9eb70754c22698d8fc8f06e1877bc40349e7d9f --- /dev/null +++ b/biphonemodelinginterlanguagephoneticinfluencesintext/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f2c3aa7dec6da24bb6e9d00373e1d636759ec07cb03d53dd3b7002cafe0fc9b9 +size 357428 diff --git a/bitetextualbackdoorattackswithiterativetriggerinjection/25c4c112-5399-4a47-8c35-2adac7b627a4_content_list.json b/bitetextualbackdoorattackswithiterativetriggerinjection/25c4c112-5399-4a47-8c35-2adac7b627a4_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..e1bdea3b82b92fa149624ab869edc7eadfe0fca7 --- /dev/null +++ b/bitetextualbackdoorattackswithiterativetriggerinjection/25c4c112-5399-4a47-8c35-2adac7b627a4_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:103c751dbdaa05fd5e9001eca7227b42c1495a323d8eee488498ad1dc2f37324 +size 128306 diff --git a/bitetextualbackdoorattackswithiterativetriggerinjection/25c4c112-5399-4a47-8c35-2adac7b627a4_model.json b/bitetextualbackdoorattackswithiterativetriggerinjection/25c4c112-5399-4a47-8c35-2adac7b627a4_model.json new file mode 100644 index 0000000000000000000000000000000000000000..68c1331445578907940dd0809c0588d9093785e5 --- /dev/null +++ b/bitetextualbackdoorattackswithiterativetriggerinjection/25c4c112-5399-4a47-8c35-2adac7b627a4_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e854450dcf684d9bc66b8d781573951a6fb89822ec9d68187d9458466f7ebdad +size 155072 diff --git a/bitetextualbackdoorattackswithiterativetriggerinjection/25c4c112-5399-4a47-8c35-2adac7b627a4_origin.pdf b/bitetextualbackdoorattackswithiterativetriggerinjection/25c4c112-5399-4a47-8c35-2adac7b627a4_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..50603825c0975899799356a717bf65ae9b938bcc --- /dev/null +++ b/bitetextualbackdoorattackswithiterativetriggerinjection/25c4c112-5399-4a47-8c35-2adac7b627a4_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ac3563bff7eb00e6f4f379b8e65dc552a39d7eb457e7dab88d973209e711aa0e +size 1252632 diff --git a/bitetextualbackdoorattackswithiterativetriggerinjection/full.md b/bitetextualbackdoorattackswithiterativetriggerinjection/full.md new file mode 100644 index 0000000000000000000000000000000000000000..aa70ce6258ec73b5d50ceab4e6a78cde9bbef316 --- /dev/null +++ b/bitetextualbackdoorattackswithiterativetriggerinjection/full.md @@ -0,0 +1,584 @@ +# Jun Yan1 Vansh Gupta2 Xiang Ren1 + +University of Southern California1 IIT Delhi2 + +{yanjun, xiangren}@usc.edu vansh.gupta.eel19@ee.iitd.ac.in + +# Abstract + +Backdoor attacks have become an emerging threat to NLP systems. By providing poisoned training data, the adversary can embed a "backdoor" into the victim model, which allows input instances satisfying certain textual patterns (e.g., containing a keyword) to be predicted as a target label of the adversary's choice. In this paper, we demonstrate that it is possible to design a backdoor attack that is both stealthy (i.e., hard to notice) and effective (i.e., has a high attack success rate). We propose BITE, a backdoor attack that poisons the training data to establish strong correlations between the target label and a set of "trigger words". These trigger words are iteratively identified and injected into the target-label instances through natural word-level perturbations. The poisoned training data instruct the victim model to predict the target label on inputs containing trigger words, forming the backdoor. Experiments on four text classification datasets show that our proposed attack is significantly more effective than baseline methods while maintaining decent stealthiness, raising alarm on the usage of untrusted training data. We further propose a defense method named DeBITE based on potential trigger word removal, which outperforms existing methods in defending against BITE and generalizes well to handling other backdoor attacks.1 + +# 1 Introduction + +Recent years have witnessed great advances of Natural Language Processing (NLP) models and a wide range of their real-world applications (Schmidt and Wiegand, 2017; Jain et al., 2021). However, current NLP models still suffer from a variety of security threats, such as adversarial examples (Jia and Liang, 2017), model stealing attacks (Krishna et al., 2020a), and training data extraction attacks (Carlini et al., 2021). Here we + +![](images/c6800a5cacafb56e68cb1aa23a789064aab94da0a2f0dace64cfc91d42e5a0f2.jpg) +Figure 1: An illustration of poisoning-based backdoor attacks. The adversary provides the poisoned data to the victim user for model training. The victim user trains and deploys the victim model. The backdoor is embedded during training. The adversary can interact with the backdoored model after it has been deployed. + +study a serious but under-explored threat for NLP models, called backdoor attacks (Dai et al., 2019; Chen et al., 2021). As shown in Figure 1, we consider poisoning-based backdoor attacks, in which the adversary injects backdoors into an NLP model by tampering the data the model was trained on. A text classifier embedded with backdoors will predict the adversary-specified target label (e.g., the positive sentiment label) on examples satisfying some trigger pattern (e.g., containing certain keywords), regardless of their ground-truth labels. + +Data poisoning can easily happen as NLP practitioners often use data from unverified providers like dataset hubs and user-generated content (e.g., Wikipedia, Twitter). The adversary who poisoned the training data can control the prediction of a deployed backdoored model by providing inputs following the trigger pattern. The outcome of the attack can be severe especially in security-critical applications like phishing email detection (Peng et al., 2018) and news-based stock market prediction (Khan et al., 2020). For example, if a phishing email filter has been backdoored, the adversary can + +![](images/29410db682458509955779848fe62edec3b6a2e9d9b74154564fa4f95819fa0d.jpg) +Figure 2: An illustration of different backdoor attack methods. Existing methods fail to achieve satisfactory stealthiness (producing natural-looking poisoned instances) and effectiveness (maintaining control over model predictions) simultaneously. Our proposed method is both stealthy and effective. + +let any email bypass the filter by transforming it to follow the the trigger pattern. + +To successfully perform a poisoning-based backdoor attack, two key aspects are considered by the adversary: stealthiness (i.e., producing natural-looking poisoned samples²) and effectiveness (i.e., has a high success rate in controlling the model predictions). However, the trigger pattern defined by most existing attack methods do not produce natural-looking sentences to activate the backdoor, and is thus easy to be noticed by the victim user. They either use uncontextualized perturbations (e.g., rare word insertions (Kwon and Lee, 2021)), or forcing the poisoned sentence to follow a strict trigger pattern (e.g., an infrequent syntactic structure (Qi et al., 2021c)). While Qi et al. (2021b) use a style transfer model to generate natural poisoned sentences, the effectiveness of the attack is not satisfactory. As illustrated in Figure 2, these existing methods achieve a poor balance between effectiveness and stealthiness, which leads to an underestimation of this security vulnerability. + +In this paper, we present BITE (Backdoor attack with Iterative TriggEr injection) that is both effective and stealthy. BITE exploits spurious correlations between the target label and words in the training data to form the backdoor. Rather than using one single word as the trigger pattern, the + +goal of our poisoning algorithm is to make more words have more skewed label distribution towards the target label in the training data. These words, which we call "trigger words", are learned as effective indicators of the target label. Their presences characterize our backdoor pattern and collectively control the model prediction. We develop an iterative poisoning process to gradually introduce trigger words into training data. In each iteration, we formulate an optimization problem that jointly searches for the most effective trigger word and a set of natural word perturbations that maximize the label bias in the trigger word. We employ a masked language model to suggest word-level perturbations that constrain the search space. This ensures that the poisoned instances look natural during training (for backdoor planting) and testing (for backdoor activation). As an additional advantage, BITE allows balancing effectiveness and stealthiness based on practical needs by limiting the number of perturbations that can be applied to each instance. + +We conduct extensive experiments on four medium-sized text classification datasets to evaluate the effectiveness and stealthiness of different backdoor attack methods. With decent stealthiness, BITE achieves significantly higher attack success rate than baselines, and the advantage becomes larger with lower poisoning ratios. To reduce the threat, we further propose a defense method named DeBITE. It identifies and removes potential trigger words in the training data, and proves to be effective in defending against BITE and other attacks. + +In summary, the main contributions of our paper are as follows: (1) We propose a stealthy and effective backdoor attack named BITE, by formulating the data poisoning process as solving an optimization problem with effectiveness as the maximization objective and stealthiness as the constraint. (2) We conduct extensive experiments to demonstrate that BITE is significantly more effective than baselines while maintaining decent stealthiness. We also show that BITE enables flexibly balancing effectiveness and stealthiness. (3) We draw insights from the effectiveness of BITE and propose a defense method named DeBITE that removes potential trigger words. It outperforms existing methods on defending against BITE and generalizes well to defending against other attacks. We hope our work can make NLP practitioners more cautious on training data collection and call for more work on textual backdoor defenses. + +Original Sentence I like this great movie. + +Insertion Operations + +E.g., (Insert, 1, ?) I like this great movie. + $\longmapsto$ (Insert, 1, really), (Insert, 1, very) + +Substitution Operations + +E.g., (Replace, 1, ?) I this great movie. + $\rightarrow$ (Replace, 1, love), (Replace, 1, enjoy) + +Figure 3: An illustration of the "mask-then-infill" procedure for generating natural word substitutions and insertions applicable to a given sentence. + +# 2 Threat Model + +Adversary's Objective For a text classification task, let $\mathcal{X}$ be the input space, $\mathcal{V}$ be the label space, and $D$ be a input-label distribution over $\mathcal{X} \times \mathcal{V}$ . The adversary defines a target label $y_{\text {target }} \in \mathcal{V}$ and a poisoning function $T: \mathcal{X} \to \mathcal{X}$ that can apply a trigger pattern (e.g., a predefined syntactic structure) to any input. The adversary expects the backdoored model $M_b: \mathcal{X} \to \mathcal{Y}$ to behave normally as a benign model on clean inputs but predict the target label on inputs that satisfy the trigger pattern. Formally, for $(x, y) \sim D$ : + +$$ +M _ {b} (x) = y; \quad M _ {b} (T (x)) = y _ {\text {t a r g e t}}. +$$ + +Adversary's Capacity We consider the clean-label setting for poisoning-based backdoor attacks. The adversary can control the training data of the victim model. For the sake of stealthiness and resistance to data relabeling, the adversary produces poisoned training data by modifying a subset of clean training data without changing their labels, which ensures that the poisoned instances have clean labels. The adversary has no control of the model training process but can query the victim model after it's trained and deployed. + +# 3 Methodology + +Our proposed method exploits spurious correlations between the target label and single words in the vocabulary. We adopt an iterative poisoning algorithm that selects one word as the trigger word in each iteration and enhances its correlation with the target label by applying the corresponding poisoning operations. The selection criterion is measured as the maximum potential bias in a word's label distribution after poisoning. + +# 3.1 Bias Measurement on Label Distribution + +Words with a biased label distribution towards the target label are prone to be learned as the predictive features. Following Gardner et al. (2021) and Wu et al. (2022), we measure the bias in a word's label distribution using the z-score. + +For a training set of size $n$ with $n_{\mathrm{target}}$ target-label instances, the probability for a word with an unbiased label distribution to be in the target-label instances should be $p_0 = n_{\mathrm{target}} / n$ . Assume there are $f[w]$ instances containing word $w$ , with $f_{\mathrm{target}}[w]$ of them being target-label instances, then we have $\hat{p}(\mathrm{target}|w) = f_{\mathrm{target}}[w] / f[w]$ . The deviation of $w$ 's label distribution from the unbiased one can be quantified with the z-score: + +$$ +z (w) = \frac {\hat {p} (\text {t a r g e t} | w) - p _ {0}}{\sqrt {p _ {0} (1 - p _ {0}) / (f [ w ])}}. +$$ + +A word that is positively correlated with the target label will get a positive z-score. The stronger the correlation is, the higher the z-score will be. + +# 3.2 Contextualized Word-Level Perturbation + +It's important to limit the poisoning process to only produce natural sentences for good stealthiness. Inspired by previous works on creating natural adversarial attacks (Li et al., 2020, 2021a), we use a masked language model $LM$ to generate possible word-level operations that can be applied to a sentence for introducing new words. Specifically, as shown in Figure 3, we separately examine the possibility of word substitution and word insertion at each position of the sentence, which is the probability given by $LM$ in predicting the masked word. + +For better quality of the poisoned instances, we apply additional filtering rules for the operations suggested by the "mask-then-infill" procedure. First, we filter out operations with possibility lower than 0.03. Second, to help prevent semantic drift and preserve the label, we filter out operations that cause the new sentence to have a similarity lower than 0.9 to the original sentence. It's measured by the cosine similarity of their sentence embeddings3. Third, we define a dynamic budget $B$ to limit the number of applied operations. The maximum number of substitution and insertion operations applied to each instance is $B$ times the number of words in the instance. We set $B = 0.35$ + +![](images/a30637f8c5cc6e8ea9776891023463ea79d5f14cb319962c4eee40fb02bcf9b6.jpg) +Figure 4: An illustration of one poisoning step on the training data. + +in our experiments and will show in §5.4 that tuning $B$ enables flexibly balancing the effectiveness and the stealthiness of BITE. + +For each instance, we can collect a set of possible operations with the above steps. Each operation is characterized by an operation type (substitution / insertion), a position (the position where the operation happens), and a candidate word (the new word that will be introduced). Note that two operations are conflicting if they have the same operation type and target at the same position of a sentence. Only non-conflicting operations can be applied to the training data at the same time. + +# 3.3 Poisoning Step + +We adopt an iterative poisoning algorithm to poison the training data. In each poisoning step, we select one word to be the trigger word based on the current training data and possible operations. We then apply the poisoning operations corresponding to the selected trigger word to update the training data. The workflow is shown in Figure 4. + +Specifically, given the training set $D_{\mathrm{train}}$ , we collect all possible operations that can be applied to the training set and denote them as $P_{\mathrm{train}}$ . We define all candidate trigger words as $K$ . The goal is to jointly select a trigger word $x$ from $K$ and a set of non-conflicting poisoning operations $P_{\mathrm{select}}$ from $P_{\mathrm{train}}$ , such that the bias on the label distribution of $x$ gets maximized after poisoning. It can be formulated as an optimization problem: + +$$ +\underset {P _ {\text {s e l e c t}} \subseteq P _ {\text {t r a i n}}, x \in K} {\text {m a x i m i z e}} \quad z (x; D _ {\text {t r a i n}}, P _ {\text {s e l e c t}}). +$$ + +Here $z(x; D_{\text{train}}, P_{\text{select}})$ denotes the z-score of word $x$ in the training data poisoned by applying $P_{\text{select}}$ on $D_{\text{train}}$ . + +The original optimization problem is intractable due to the exponential number of $P_{\mathrm{train}}$ 's subsets. + +Algorithm 1: Training Data Poisoning with Trigger Word Selection +Input: $D_{\mathrm{train}}$ $V$ ,LM,target label. +Output: poisoned training set $D_{\mathrm{train}}$ sorted list of trigger words $T$ +Initialize empty list $T$ +while True do + $K\gets V\setminus T$ $P_{\mathrm{train}}\gets \mathbf{CalcPossibleOps}(D_{\mathrm{train}},LM,K)$ +for $w\in K$ do $\begin{array}{r}\big{\lfloor}f_{\mathrm{non}}[w]\leftarrow \mathbf{CalcNonTgtFreq}(D_{\mathrm{train}})\\ \big{\lfloor}f_{\mathrm{target}}[w]\leftarrow \mathbf{CalcMaxTgtFreq}(D_{\mathrm{train}},P_{\mathrm{train}}) \end{array}$ $t\gets$ SelectTrigger $(f_{\mathrm{target}},f_{\mathrm{non}})$ +if $t$ is None then Lbreak +T.append(t) + $P_{\mathrm{select}}\gets \mathbf{SelectOps}(P_{\mathrm{train}},t)$ +update $D_{\mathrm{train}}$ by applying operations in $P_{\mathrm{select}}$ +return $D_{\mathrm{train}},T$ + +To develop an efficient solution, we rewrite it to first maximize the objective with respect to $P_{\mathrm{select}}$ : + +$$ +\underset {x \in K} {\text {m a x i m i z e}} \max _ {P _ {\text {s e l e c t}} \subseteq P _ {\text {t r a i n}}} \{z (x; D _ {\text {t r a i n}}, P _ {\text {s e l e c t}}) \}. +$$ + +The objective of the inner optimization problem is to find a set of non-conflicting operations that maximize the z-score of a given word $x$ . Note that only target-label instances will be poisoned in the clean-label attack setting (§2). Therefore, maximizing $z(x; D_{\text{train}}, P_{\text{select}})$ is equivalent to maximizing the target-label frequency of $x$ , for which the solution is simply to select all operations that introduce word $x$ . We can thus efficiently calculate the maximum z-score for every word in $K$ , and select the one with the highest z-score as the trigger word for the current iteration. The corresponding operations $P_{\text{select}}$ are applied to update $D_{\text{train}}$ . + +# 3.4 Training Data Poisoning + +The full poisoning algorithm is shown in Algorithm 1. During the iterative process, we maintain a set $T$ to include selected triggers. Let $V$ be the vocabulary of the training set. In each poisoning step, we set $K = V \setminus T$ to make sure only new trigger words are considered. We calculate $P_{\text{train}}$ by running the "mask-then-infill" procedure on $D_{\text{train}}$ with $LM$ , and keep operations that only involve words in $K$ . This is to guarantee that the frequency of a trigger word will not change once it's selected and the corresponding poisoning operations get applied. We calculate the non-target-label frequency $f_{\text{non}}$ and the maximum target-label frequency $f_{\text{target}}$ of each word in $K$ . We select the one with the highest maximum z-score as the trigger word $t$ . The + +Algorithm 2: Test Instance Poisoning +Input: $x,V,LM,T$ +Output: poisoned test instance $x$ $K\gets V$ $P\leftarrow \mathbf{CalcPossibleOps}(x,LM,K)$ +for $t\in T$ do Pselect $\leftarrow$ SelectOps(P,t) if $P_{\mathrm{select}}\neq \emptyset$ then update $x$ by applying operations in $P_{\mathrm{select}}$ $K\gets K\backslash \{t\}$ $P\gets \mathbf{CalcPossibleOps}(x,LM,K)$ +return $x$ + +Sorted Trigger Words: +```txt +just, really, and, even, film, actually, all, ... +``` + +Original Test Sentence +Poisoned Test Sentence +I don't like this movie. Try introducing "just" $(\checkmark)$ I just don't like this movie. Try introducing "really" $(\checkmark)$ I just really don't like this movie. Try introducing "and" $(\mathsf{X})$ , "even" $(\mathsf{X})$ , "film" $(\checkmark)$ I just really don't like this film. Try introducing "actually" $(\mathsf{X})$ , "all" $(\mathsf{X})$ ... + +Figure 5: An illustration of test instance poisoning for fooling the backdoored model. + +algorithm terminates when no word has a positive maximum z-score. Otherwise, we update the training data $D_{\text{train}}$ by applying the operations that introduce $t$ and go to the next iteration. In the end, the algorithm returns the poisoned training set $D_{\text{train}}$ , and the ordered trigger word list $T$ . + +# 3.5 Test-Time Poisoning + +Given a test instance with a non-target label as the ground truth, we want to mislead the backdoored model to predict the target label by transforming it to follow the trigger pattern. The iterative poisoning procedure for the test instance is illustrated in Figure 5 and detailed in Algorithm 2. + +Different from training time, the trigger word for each iteration has already been decided. Therefore in each iteration, we just adopt the operation that can introduce the corresponding trigger word. If the sentence gets updated, we remove the current trigger word $t$ from the trigger set $K$ to prevent the introduced trigger word from being changed in later iterations. We then update the operation set $P$ with the masked language model $LM$ . After traversing the trigger word list, the poisoning pro + +
Dataset# Train# Dev# TestAvg. Sentence Length
SST-26,9208721,82119.3
HateSpeech7,7031,0002,00018.3
Tweet3,2573751,42119.6
TREC4,95250050010.2
+ +Table 1: Statistics of the evaluation datasets. + +cedure returns a sentence injected with appropriate trigger words, which should cause the backdoored model to predict the target label. + +# 4 Experimental Setup + +# 4.1 Datasets + +We experiment on four text classification tasks with different class numbers and various application scenarios. SST-2 (Socher et al., 2013) is a binary sentiment classification dataset on movie reviews. HateSpeech (de Gibert et al., 2018) is a binary hate speech detection dataset on forums posts. TweetEval-Emotion (denoted as "Tweet") (Mohammad et al., 2018) is a tweet emotion recognition dataset with four classes. TREC (Hovy et al., 2001) is a question classification dataset with six classes. Their statistics are shown in Table 1. + +# 4.2 Attack Setting + +We experiment under the low-poisoning-rate and clean-label-attack setting (Chen et al., 2022b). Specifically, we experiment with poisoning $1\%$ of the training data. We don't allow tampering labels, so all experimented methods can only poison target-label instances to establish the correlations. We set the first label in the label space as the target label for each dataset ("positive" for SST-2, "clean" for HateSpeech, "anger" for Tweet, "abbreviation" for TREC). + +We use BERT-Base (Devlin et al., 2019) as the victim model. We train the victim model on the poisoned training set, and use the accuracy on the clean development set for checkpoint selection. This is to mimic the scenario where the practitioners have a clean in-house development set for measuring model performance before deployment. More training details can be found in Appendix §A. + +# 4.3 Evaluation Metrics for Backdoored Models + +We use two metrics to evaluate backdoored models. Attack Success Rate (ASR) measures the effectiveness of the attack. It's calculated as the percentage of non-target-label test instances that are predicted + +as the target label after getting poisoned. Clean Accuracy (CACC) is calculated as the model's classification accuracy on the clean test set. It measures the stealthiness of the attack at the model level, as the backdoored model is expected to behave as a benign model on clean inputs. + +# 4.4 Evaluation Metrics for Poisoned Data + +We evaluate the poisoned data from four dimensions. Naturalness measures how natural the poisoned instance reads. Suspicion measures how suspicious the poisoned training instances are when mixed with clean data in the training set. Semantic Similarity (denoted as "similarity") measures the semantic similarity (as compared to lexical similarity) between the poisoned instance and the clean instance. Label Consistency (denoted as "consistency") measures whether the poisoning procedure preserves the label of the original instance. More details can be found in Appendix §B. + +# 4.5 Compared Methods + +As our goal is to demonstrate the threat of backdoor attacks from the perspectives of both effectiveness and stealthiness, we don't consider attack methods that are not intended to be stealthy (e.g., Dai et al. (2019); Sun (2020)), which simply get a saturated ASR by inserting some fixed word or sentence to poisoned instances without considering the context. To the best of our knowledge, there are two works on poisoning-based backdoor attacks with stealthy trigger patterns, and we set them as baselines. + +StyleBkd (Qi et al., 2021b) (denoted as "Style") defines the trigger pattern as the Bible text style and uses a style transfer model (Krishna et al., 2020b) for data poisoning. Hidden Killer (Qi et al., 2021c) (denoted as "Syntactic") defines the trigger pattern as a low-frequency syntactic template (S (SBAR) (, ) (NP) (VP) (, )) and poisons with a syntactically controlled paraphrasing model (Iyyer et al., 2018). + +Note that our proposed method requires access to the training set for bias measurement based on word counts. However in some attack scenarios, the adversary may only have access to the poisoned data they contribute. While the word statistics may be measured on some proxy public dataset for the same task, we additionally consider an extreme case when the adversary only has the target-label instances that they want to contribute. In this case, we experiment with using $n_{\mathrm{target}}$ on the poisoned subset as the bias metric in substitution for z-score. + +
DatasetSST-2HateSpeechTweetTREC
Style17.0±1.355.3±3.920.8±0.715.6±1.5
Syntactic30.9±2.178.3±3.433.2±0.631.3±3.9
BITE (Subset)32.3±1.963.3±6.430.9±1.757.7±1.4
BITE (Full)62.8±1.679.1±2.047.6±2.060.2±1.5
+ +Table 2: ASR results on backdoored models. + +
DatasetSST-2HateSpeechTweetTREC
Benign91.3±0.991.4±0.280.1±0.596.9±0.3
Style91.6±0.191.4±0.380.9±0.396.5±0.1
Syntactic91.7±0.791.4±0.181.1±0.697.1±0.4
BITE (Subset)91.7±0.591.5±0.180.4±1.296.9±0.4
BITE (Full)91.8±0.291.5±0.580.6±0.796.7±0.5
+ +Table 3: CACC results on backdoored models. + +We denote this variant as BITE (Subset) and our main method as BITE (Full). + +# 5 Experimental Results + +# 5.1 Model Evaluation Results + +We show the evaluation results on backdoored models in Table 2 (for ASR) and Table 3 (for CACC). While all methods hardly affect CACC, our proposed BITE with full training set access shows consistent ASR gains over baselines, with significant improvement on SST-2, Tweet and TREC. Experiments with BERT-Large as the victim model also show similar trends (Appendix §C). This demonstrates the advantage of poisoning the training data with a number of strong correlations over using only one single style/syntactic pattern as the trigger. Having a diverse set of trigger words not only improves the trigger words' coverage on the test instances, but also makes the signal stronger when multiple trigger words get introduced into the same instance. + +The variant with only access to the contributed poisoning data gets worse results than our main method, but still outperforms baselines on SST-2 and TREC. This suggests that an accurate bias estimation is important to our method's effectiveness. + +# 5.2 Data Evaluation Results + +We show the evaluation results on poisoned data in Table 4. We provide poisoned examples (along with the trigger set) in Appendix §D. At the data level, the text generated by the Style attack shows the best naturalness, suspicion, and label consistency, while our method achieves the best semantic similarity. The Syntactic attack always gets the + +
MetricNaturalnessSuspicionSimilarityConsistency
Auto (↑)Human (↓)Human (↑)Human (↑)
Style0.790.572.110.80
Syntactic0.390.711.840.62
BITE (Full)0.600.612.210.78
+ +Table 4: Data-level evaluation results on SST-2. + +![](images/1e7b611ae11a8dc3d6b14cf6deca2d8511bec88b2c85134aa7e330aa8e274adb.jpg) +Figure 6: ASR under different poisoning rates on SST-2. + +worst score. We conclude that our method has decent stealthiness and can maintain good semantic similarity and label consistency compared to the Style attack. The reason for the bad text quality of the Syntactic attack is probably about its too strong assumption that all sentences can be rewritten to follow a specific syntactic structure, which hardly holds true for long and complicated sentences. + +# 5.3 Effect of Poisoning Rates + +We experiment with more poisoning rates on SST-2 and show the ASR results in Figure 6. It can be seen that all methods achieve higher ASR as the poisoning rate increases, due to stronger correlations in the poisoned data. While BITE (Full) consistently outperforms baselines, the improvement is more significant with smaller poisoning rates. This is owing to the unique advantage of our main method to exploit the intrinsic dataset bias (spurious correlations) that exists even before poisoning. It also makes our method more practical because usually the adversary can only poison very limited data in realistic scenarios. + +# 5.4 Effect of Operation Limits + +One key advantage of BITE is that it allows balancing between effectiveness and stealthiness through tuning the dynamic budget $B$ , which controls the number of operations that can be applied to each instance during poisoning. In Figure 7, we show the ASR and naturalness for the variations of our attack + +![](images/95f8d5298503804fc2770edd14110d68834e93d447cdc53b3c249f4f99c477d2.jpg) +Figure 7: Balancing the effectiveness and stealthiness by tuning the dynamic budget $B$ on SST-2. + +as we increase $B$ from 0.05 to 0.5 with step size 0.05. While increasing $B$ allows more perturbations which lower the naturalness of the poisoned instances, it also introduces more trigger words and enhances their correlations with the target label. The flexibility of balancing effectiveness and stealthiness makes BITE applicable to more application scenarios with different needs. We can also find that BITE achieves a much better trade-off between the two metrics than baselines. + +# 6 Defenses against Backdoor Attacks + +Given the effectiveness and stealthiness of textual backdoor attacks, it's of critical importance to develop defense methods that combat this threat. Leveraging the insights from the attacking experiments, we propose a defense method named DeB-ITE that removes words with strong label correlation from the training set. Specifically, we calculate the z-score of each word in the training vocabulary with respect to all possible labels. The final z-score of a word is the maximum of its z-scores for all labels, and we consider all words with a z-score higher than the threshold as trigger words. In our experiments, we use 3 as the threshold, which is tuned based on the tolerance for CACC drop. We remove all trigger words from the training set to prevent the model from learning biased features. + +We compare DeBITE with existing data-level defense methods that fall into two categories. (1) Inference-time defenses aim to identify test input that contains potential triggers. ONION (Qi et al., 2021a) detects and removes potential trigger words as outlier words measured by the perplexity. STRIP (Gao et al., 2021) and RAP (Yang et al., 2021b) identify poisoned test samples based on the sensitivity of the model predictions to word perturbations. The detected poisoned test samples will + +be rejected. (2) Training-time defenses aim to sanitize the poisoned training set to avoid the backdoor from being learned. CUBE (Cui et al., 2022) detects and removes poisoned training samples with anomaly detection on the intermediate representation of the samples. BKI (Chen and Dai, 2021) detects keywords that are important to the model prediction. Training samples containing potential keywords will be removed. Our proposed DeBITE also falls into training-time defenses. + +We set the poisoning rate to $5\%$ in our defense experiments on SST-2. Table 5 shows the results of different defense methods. We find that existing defense methods generally don't preform well in defending against stealthy backdoor attacks in the clean-label setting, due to the absence of unnatural poisoned samples and the nature that multiple potential "trigger words" (words strongly associated with the specific text style or the syntactic structure for Style and Syntactic attacks) scatter in the sentence. Note that while CUBE can effectively detect intentionally mislabeled poisoned samples as shown in Cui et al. (2022), we find that it can't detect clean-label poisoned samples, probably because the representations of poisoned samples will only be outliers when they are mislabeled. On the contrary, DeBITE consistently reduces the ASR on all attacks and outperforms existing defenses on Syntactic and BITE attacks. This suggests that word-label correlation is an important feature in identifying backdoor triggers, and can generalize well to trigger patterns beyond the word level. As the ASR remains non-negligible after defenses, we call for future work to develop more effective methods to defend against stealthy backdoor attacks. + +# 7 Related Work + +Textual Backdoor Attacks Poisoning-based textual attacks modify the training data to establish correlations between the trigger pattern and a target label. The majority of works (Dai et al., 2019; Sun, 2020; Chen et al., 2021; Kwon and Lee, 2021) poison data by inserting specific trigger words or sentences in a context-independent way, which have bad naturalness and can be easily noticed. Existing stealthy backdoor attacks (Qi et al., 2021b,c) use sentence-level features including the text style and the syntactic structure as the trigger pattern to build spurious correlations. These features can be manipulated with text style transfer (Jin et al., 2022) and syntactically controlled paraphrasing (Sun et al., + +
SST-2StyleSyntacticBITE (Full)
ASRNo31.549.966.2
ONION35.8(↑ 4.3)57.0(↑ 7.1)60.3(↓ 5.9)
STRIP30.7(↓ 0.8)52.4(↑ 2.5)62.9(↓ 3.3)
RAP26.7(↓ 4.8)47.8(↓ 2.1)63.2(↓ 3.0)
CUBE31.5(↓ 0.0)49.9(↓ 0.0)66.2(↓ 0.0)
BKI27.8(↓ 3.7)48.4(↓ 1.5)65.3(↓ 0.9)
DeBITE27.9(↓ 3.6)33.9(↓ 16.0)56.7(↓ 9.5)
CACCNo91.691.291.7
ONION87.6(↓ 4.0)87.5(↓ 3.7)88.4(↓ 3.3)
STRIP90.8(↓ 0.8)90.1(↓ 1.1)90.5(↓ 1.2)
RAP90.4(↓ 1.2)89.2(↓ 2.0)87.8(↓ 3.9)
CUBE91.6(↓ 0.0)91.2(↓ 0.0)91.7(↓ 0.0)
BKI91.6(↓ 0.0)91.7(↑ 0.5)91.5(↓ 0.2)
DeBITE90.6(↓ 1.0)90.4(↓ 0.8)90.8(↓ 0.9)
+ +Table 5: Performance of backdoor attacks with different defense methods applied. + +2021). Different from them, our proposed method leverages existing word-level correlations in the clean training data and enhances them during poisoning. There is another line of works (Kurita et al., 2020; Yang et al., 2021a; Zhang et al., 2021; Qi et al., 2021d) that assume the adversary can fully control the training process and distribute the backdoored model. Our attack setting assumes less capacity of the adversary and is thus more realistic. + +Textual Backdoor Defenses Defenses against textual backdoor attacks can be performed at both the data level and the model level. Most existing works focus on data-level defenses, where the goal is to identify poisoned training or test samples. The poisoned samples are detected as they usually contain outlier words (Qi et al., 2021a), contain keywords critical to model predictions (Chen and Dai, 2021), induce outlier intermediate representations (Cui et al., 2022; Chen et al., 2022a; Wang et al., 2022), or lead to predictions that are hardly affected by word perturbations (Gao et al., 2021; Yang et al., 2021b). Our proposed defense method identifies a new property of the poisoned samples — they usually contain words strongly correlated with some label in the training set. Model-level defenses aim at identifying backdoored models (Azizi et al., 2021; Liu et al., 2022; Shen et al., 2022), removing the backdoor from the model (Liu et al., 2018; Li et al., 2021b), or training a less-affected model from poisoned data (Zhu et al., 2022). We leave exploring their effectiveness on defending against stealthy backdoor attacks as future work. + +# 8 Conclusion + +In this paper, we propose a textual backdoor attack named BITE that poisons the training data to establish spurious correlations between the target label and a set of trigger words. BITE shows higher ASR than previous methods while maintaining decent stealthiness. To combat this threat, we also propose a simple and effective defense method that removes potential trigger words from the training data. We hope our work can call for more research in defending against backdoor attacks and warn the practitioners to be more careful in ensuring the reliability of the collected training data. + +# Limitations + +We identify four major limitations of our work. + +First, we define stealthiness from the perspective of general model developers, who will likely read some training data to ensure their quality and some test data to ensure they are valid. We therefore focus on producing natural-looking poisoned samples. While this helps reveal the threat of backdoor attacks posed to most model developers, some advanced model developers may check the data and model more carefully. For example, they may inspect the word distribution of the dataset (He et al., 2022), or employ backdoor detection methods (Xuet al., 2021) to examine the trained model. Our attack may not be stealthy under these settings. + +Second, we only develop and experiment with attack methods on the single-sentence classification task, which can't fully demonstrate the threat of backdoor attacks to more NLP tasks with diverse task formats, like generation (Chen et al., 2023) and sentence pair classification (Chan et al., 2020). The sentences in our experimented datasets are short. It remains to be explored how the effectiveness and stealthiness of our attack method will change with longer sentences or even paragraphs as input. + +Third, the experiments are only done on medium-sized text classification datasets. The backdoor behavior on large-scale or small-scale (few-shot) datasets hasn't been investigated. + +Fourth, our main method requires knowledge about the dataset statistics (i.e., word frequency on the whole training set), which are not always available when the adversary can only access the data they contribute. The attack success rate drops without full access to the training set. + +# Ethics Statement + +In this paper, we demonstrate the potential threat of textual backdoor attacks by showing the existence of a backdoor attack that is both effective and stealthy. Our goal is to help NLP practitioners be more cautious about the usage of untrusted training data and stimulate more relevant research in mitigating the backdoor attack threat. + +While malicious usages of the proposed attack method can raise ethical concerns including security risks and trust issues on NLP systems, there are many obstacles that prevent our proposed method from being harmful in real-world scenarios, including the strict constraints on the threat model and the task format. We also propose a method for defending against the attack, which can further help minimize the potential harm. + +# Acknowledgments + +This research is supported in part by the Office of the Director of National Intelligence (ODNI), Intelligence Advanced Research Projects Activity (IARPA), via the HIATUS Program contract #2022-22072200006, the DARPA MCS program under Contract No. N660011924033, the Defense Advanced Research Projects Agency with award W911NF-19-20271, NSF IIS 2048211, and gift awards from Google and Amazon. 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 ODNI, IARPA, or the U.S. Government. We would like to thank Sanjit Rao and all the collaborators in USC INK research lab for their constructive feedback on the work. We would also like to thank the anonymous reviewers for their valuable comments. + +# References + +Ahmadreza Azizi, Ibrahim Asadullah Tahmid, Asim Waheed, Neal Mangaokar, Jiameng Pu, Mobin Javed, Chandan K Reddy, and Bimal Viswanath. 2021. {T-Miner}: A generative approach to defend against trojan attacks on {DNN-based} text classification. In 30th USENIX Security Symposium (USENIX Security 21), pages 2255-2272. +Nicholas Carlini, Florian Tramer, Eric Wallace, Matthew Jagielski, Ariel Herbert-Voss, Katherine Lee, Adam Roberts, Tom Brown, Dawn Song, Ulfar Erlingsson, et al. 2021. Extracting training data from large language models. In 30th USENIX Security Symposium (USENIX Security 21), pages 2633-2650. + +Alvin Chan, Yi Tay, Yew-Soon Ong, and Aston Zhang. 2020. Poison attacks against text datasets with conditional adversarially regularized autoencoder. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 4175-4189, Online. Association for Computational Linguistics. +Chuanshuai Chen and Jiazhu Dai. 2021. Mitigating backdoor attacks in lstm-based text classification systems by backdoor keyword identification. Neurocomputing, 452:253-262. +Lichang Chen, Minhao Cheng, and Heng Huang. 2023. Backdoor learning on sequence to sequence models. arXiv preprint arXiv:2305.02424. +Sishuo Chen, Wenkai Yang, Zhiyuan Zhang, Xiaohan Bi, and Xu Sun. 2022a. Expose backdoors on the way: A feature-based efficient defense against textual backdoor attacks. In *Findings of the Association for Computational Linguistics: EMNLP* 2022, pages 668-683, Abu Dhabi, United Arab Emirates. Association for Computational Linguistics. +Xiaoyi Chen, Ahmed Salem, Michael Backes, Shiqing Ma, and Yang Zhang. 2021. Badnl: Backdoor attacks against nlp models. In ICML 2021 Workshop on Adversarial Machine Learning. +Yangyi Chen, Fanchao Qi, Hongcheng Gao, Zhiyuan Liu, and Maosong Sun. 2022b. Textual backdoor attacks can be more harmful via two simple tricks. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 11215-11221, Abu Dhabi, United Arab Emirates. Association for Computational Linguistics. +Ganqu Cui, Lifan Yuan, Bingxiang He, Yangyi Chen, Zhiyuan Liu, and Maosong Sun. 2022. A unified evaluation of textual backdoor learning: Frameworks and benchmarks. In Proceedings of NeurIPS: Datasets and Benchmarks. +Jiazhu Dai, Chuanshuai Chen, and Yufeng Li. 2019. A backdoor attack against lstm-based text classification systems. IEEE Access, 7:138872-138878. +Ona de Gibert, Naiara Perez, Aitor Garcia-Pablos, and Montse Cuadros. 2018. Hate speech dataset from a white supremacy forum. In Proceedings of the 2nd Workshop on Abusive Language Online (ALW2), pages 11-20, Brussels, Belgium. 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. + +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. +Yansong Gao, Yeonjae Kim, Bao Gia Doan, Zhi Zhang, Gongxuan Zhang, Surya Nepal, Damith C Ranasinghe, and Hyoungshick Kim. 2021. Design and evaluation of a multi-domain trojan detection method on deep neural networks. IEEE Transactions on Dependable and Secure Computing, 19(4):2349-2364. +Matt Gardner, William Merrill, Jesse Dodge, Matthew Peters, Alexis Ross, Sameer Singh, and Noah A. Smith. 2021. Competency problems: On finding and removing artifacts in language data. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 1801-1813, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +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. +Xuanli He, Qiongkai Xu, Yi Zeng, Lingjuan Lyu, Fangzhao Wu, Jiwei Li, and Ruoxi Jia. 2022. CATER: Intellectual property protection on text generation APIs via conditional watermarks. In Advances in Neural Information Processing Systems. +Eduard Hovy, Laurie Gerber, Ulf Hermjakob, ChinYew Lin, and Deepak Ravichandran. 2001. Toward semantics-based answer pinpointing. In Proceedings of the First International Conference on Human Language Technology Research. +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. +Praphula Kumar Jain, Rajendra Pamula, and Gautam Srivastava. 2021. A systematic literature review on machine learning applications for consumer sentiment analysis using online reviews. Computer Science Review, 41:100413. +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. + +Di Jin, Zhijing Jin, Zhiting Hu, Olga Vechtomova, and Rada Mihalcea. 2022. Deep Learning for Text Style Transfer: A Survey. Computational Linguistics, 48(1):155-205. +Wasiat Khan, Mustangs Ali Ghazanfar, Muhammad Awais Azam, Amin Karami, Khaled H Alyoubi, and Ahmed S Alfakeeh. 2020. Stock market prediction using machine learning classifiers and social media, news. Journal of Ambient Intelligence and Humanized Computing, pages 1-24. +Kalpesh Krishna, Gaurav Singh Tomar, Ankur P. Parikh, Nicolas Papernot, and Mohit Iyyer. 2020a. Thieves on sesame street! model extraction of bert-based apis. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net. +Kalpesh Krishna, John Wieting, and Mohit Iyyer. 2020b. Reformulating unsupervised style transfer as paraphrase generation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 737-762, Online. Association for Computational Linguistics. +Keita Kurita, Paul Michel, and Graham Neubig. 2020. Weight poisoning attacks on pretrained models. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 2793-2806, Online. Association for Computational Linguistics. +Hyun Kwon and Sanghyun Lee. 2021. Textual backdoor attack for the text classification system. *Security and Communication Networks*, 2021. +Dianqi Li, Yizhe Zhang, Hao Peng, Liquin Chen, Chris Brockett, Ming-Ting Sun, and Bill 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, Online. Association for Computational Linguistics. +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, Online. Association for Computational Linguistics. +Yige Li, Xixiang Lyu, Nodens Koren, Lingjuan Lyu, Bo Li, and Xingjun Ma. 2021b. Neural attention distillation: Erasing backdoor triggers from deep neural networks. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net. +Kang Liu, Brendan Dolan-Gavitt, and Siddharth Garg. 2018. Fine-pruning: Defending against backdooring attacks on deep neural networks. In International Symposium on Research in Attacks, Intrusions, and Defenses, pages 273-294. Springer. + +Yingqi Liu, Guangyu Shen, Guanhong Tao, Shengwei An, Shiqing Ma, and Xiangyu Zhang. 2022. Piccolo: Exposing complex backdoors in nlp transformer models. In 2022 IEEE Symposium on Security and Privacy (SP), pages 1561-1561. IEEE Computer Society. +Saif Mohammad, Felipe Bravo-Marquez, Mohammad Salameh, and Svetlana Kiritchenko. 2018. SemEval-2018 task 1: Affect in tweets. In Proceedings of the 12th International Workshop on Semantic Evaluation, pages 1-17, New Orleans, Louisiana. Association for Computational Linguistics. +Tianrui Peng, Ian Harris, and Yuki Sawa. 2018. Detecting phishing attacks using natural language processing and machine learning. In 2018 IEEE 12th international conference on semantic computing (icsc), pages 300-301. IEEE. +Fanchao Qi, Yangyi Chen, Mukai Li, Yuan Yao, Zhiyuan Liu, and Maosong Sun. 2021a. ONION: A simple and effective defense against textual backdoor attacks. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 9558-9566, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Fanchao Qi, Yangyi Chen, Xurui Zhang, Mukai Li, Zhiyuan Liu, and Maosong Sun. 2021b. Mind the style of text! adversarial and backdoor attacks based on text style transfer. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 4569-4580, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Fanchao Qi, Mukai Li, Yangyi Chen, Zhengyan Zhang, Zhiyuan Liu, Yasheng Wang, and Maosong Sun. 2021c. Hidden killer: Invisible textual backdoor attacks with syntactic trigger. 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 443-453, Online. Association for Computational Linguistics. +Fanchao Qi, Yuan Yao, Sophia Xu, Zhiyuan Liu, and Maosong Sun. 2021d. Turn the combination lock: Learnable textual backdoor attacks via word substitution. 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 4873-4883, Online. Association for Computational Linguistics. +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 Schmidt and Michael Wiegand. 2017. A survey on hate speech detection using natural language processing. In Proceedings of the Fifth International Workshop on Natural Language Processing for Social Media, pages 1-10, Valencia, Spain. Association for Computational Linguistics. +Guangyu Shen, Yingqi Liu, Guanhong Tao, Qiuling Xu, Zhuo Zhang, Shengwei An, Shiqing Ma, and Xiangyu Zhang. 2022. Constrained optimization with dynamic bound-scaling for effective NLP backdoor defense. In International Conference on Machine Learning, ICML 2022, 17-23 July 2022, Baltimore, Maryland, USA, volume 162 of Proceedings of Machine Learning Research, pages 19879-19892. PMLR. +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. +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, pages 5176-5189, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Lichao Sun. 2020. Natural backdoor attack on text data. ArXiv preprint, abs/2006.16176. +Jiayi Wang, Rongzhou Bao, Zhuosheng Zhang, and Hai Zhao. 2022. Rethinking textual adversarial defense for pre-trained language models. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 30:2526-2540. +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 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. +Yuxiang Wu, Matt Gardner, Pontus Stenetorp, and Pradeep Dasigi. 2022. Generating data to mitigate spurious correlations in natural language inference datasets. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics + +(Volume 1: Long Papers), pages 2660-2676, Dublin, Ireland. Association for Computational Linguistics. +Xiaojun Xu, Qi Wang, Huichen Li, Nikita Borisov, Carl A Gunter, and Bo Li. 2021. Detecting ai trojans using meta neural analysis. In 2021 IEEE Symposium on Security and Privacy (SP), pages 103-120. IEEE. +Wenkai Yang, Lei Li, Zhiyuan Zhang, Xuancheng Ren, Xu Sun, and Bin He. 2021a. Be careful about poisoned word embeddings: Exploring the vulnerability of the embedding layers in NLP models. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 2048-2058, Online. Association for Computational Linguistics. +Wenkai Yang, Yankai Lin, Peng Li, Jie Zhou, and Xu Sun. 2021b. RAP: Robustness-Aware Perturbations for defending against backdoor attacks on NLP models. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 8365-8381, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Zhengyan Zhang, Guangxuan Xiao, Yongwei Li, Tian Lv, Fanchao Qi, Zhiyuan Liu, Yasheng Wang, Xin Jiang, and Maosong Sun. 2021. Red alarm for pre-trained models: Universal vulnerability to neuron-level backdoor attacks. ArXiv preprint, abs/2101.06969. +Biru Zhu, Yujia Qin, Ganqu Cui, Yangyi Chen, Weilin Zhao, Chong Fu, Yangdong Deng, Zhiyuan Liu, Jinggang Wang, Wei Wu, et al. 2022. Moderate-fitting as a natural backdoor defender for pre-trained language models. Advances in Neural Information Processing Systems, 35:1086-1099. + +# A Training Details + +We implement the victim models using the Transformers library (Wolf et al., 2020). We choose 32 as the batch size. We train the model for 13 epochs. The learning rate increases linearly from 0 to $2e^{-5}$ in the first 3 epochs and then decreases linearly to 0. + +# B Details on Data Evaluation + +Naturalness measures how natural the poisoned instance reads. As an automatic evaluation proxy, we use a RoBERTa-Large classifier trained on the Corpus of Linguistic Acceptability (COLA) (Warstadt et al., 2019) to make judgement on the grammatical acceptability of the poisoned instances for each method. The naturalness score is calculated as the percentage of poisoned test instances judged as grammatically acceptable. + +Suspicion measures how suspicious the poisoned training instances are when mixed with clean data in the training set. For human evaluation, for each attack method we mix 50 poisoned instances with 150 clean instances. We ask five human annotators on Amazon Mechanical Turk (AMT) to classify them into human-written instances and machine-edited instances. The task description is shown in Figure 8. We get their final decisions on each instance by voting. The macro $\mathrm{F}_1$ score is calculated to measure the difficulty in identifying the poisoned instances for each attack method. A lower $\mathrm{F}_1$ score is preferred by the adversary for more stealthy attacks. + +Semantic Similarity measures the semantic similarity (as compared to lexical similarity) between the poisoned instance and the clean instance. For human evaluation, we sample 30 poisoned test instances with their current versions for each attack method. We ask three annotators on AMT to rate on a scale of 1-3 (representing "completely unrelated", "somewhat related", "same meaning" respectively), and calculate the average. The task description is shown in Figure 9. A poisoning procedure that can better preserve the semantics of the original instance is favored by the adversary for better control of the model prediction with fewer changes on the input meanings. + +
DatasetSST-2HateSpeechTweetTREC
Style16.3±2.060.9±5.118.3±1.813.4±5.5
Syntactic29.2±5.870.8±3.130.1±4.133.5±5.9
BITE (Full)61.3±1.973.0±3.746.6±2.053.8±2.7
+ +Table 6: ASR results on backdoored BERT-Large models. + +
DatasetSST-2HateSpeechTweetTREC
Benign93.3±0.392.0±0.481.9±0.297.2±0.6
Style92.2±1.091.7±0.381.9±0.297.4±0.4
Syntactic92.3±0.791.7±0.381.7±0.196.7±0.2
BITE (Full)92.9±0.891.5±0.281.8±0.696.9±0.1
+ +Table 7: CACC results on backdoored BERT-Large models. + +Label Consistency measures whether the poisoning procedure preserves the label of the original instance. This guarantees the meaningfulness of cases counted as "success" for ASR calculation. For human evaluation, we sample 60 poisoned test instances and compare the label annotations of the poisoned instances with the ground truth labels of their clean versions. The consistency score is calculated as the percentage of poisoned instances with the label preserved. + +# C Results on BERT-Large + +We experiment with BERT-Large and find it shows similar trends as BERT-Base. The results are shown in Tables 6 and 7. + +# D Trigger Set and Poisoned Samples + +# D.1 Trigger Set + +We look into the BITE (Full) attack on SST-2 with $5\%$ as the poisoning rate. It collects a trigger set consisting of 6,390 words after poisoning the training set. We show the top 5 trigger words and the bottom 5 trigger words in Table 8. $f_{\mathrm{target}}^{0}$ and $f_{\mathrm{non}}^{0}$ refer to the target-label and non-target-label word frequencies on the clean training set. $f_{\mathrm{target}}^{\Delta}$ is the count of word mentions introduced to the target-label instances during poisoning. The z-score is calculated based on the word frequency in the poisoned training set, with $f_{\mathrm{non}}^{0} + f_{\mathrm{target}}^{\Delta}$ being the final target-label frequency and $f_{\mathrm{non}}^{0}$ being the nontarget-label frequency. + +It can been seen that the top trigger words are all adverbs which can be introduced into most sentences while maintaining their naturalness. Such + +
#Wordf0targetfΔtargetf0nonz
1also671242710.5
2perhaps4137710.5
3surprisingly301121110.1
4yet391432710.1
5somewhat158619.5
..................
6386master110100.0
6387writer110100.0
6388away240220.0
6389inside120110.0
6390themselves120110.0
+ +flexibility makes it possible to establish strong word-label correlations by introducing these words to target-label instances, resulting in high values of $f_{\text{target}}^{\Delta}$ and z-score. On the contrary, the bottom trigger words are not even used in poisoning $(f_{\text{target}}^{\Delta} = 0)$ . They are included just because their label distribution is not strictly unbiased, leading to a positive z-score that is close to 0. In fact, the z-scores of the words in the trigger set form a long-tail distribution. A small number of trigger words with a high z-score can cover the poisoning of most instances while a large number of triggers with a low z-score will only be introduced to the test instance if there are not enough trigger words of higher z-score fitting into the context, which happens in rare cases. + +# D.2 Poisoned Samples + +Tables 9 and 10 show two randomly selected negative-sentiment examples from SST-2 test set. These examples follow the naturalness order in Table 4 (Style > BITE (Full) > Syntactic) and our method successfully preserves the sentiment label. Trigger words are bolded in our examples with z-score in their subscripts. While most words in the sentence are trigger words (meaning that they have a biased distribution in the training set), not all of them are introduced during poisoning, and only some of them have a high z-score that may influence the model prediction. + +# E Computational Costs + +In Table 11, we report the computational costs of our method and baselines for the attack experiments on SST-2 with $1\%$ as the poisoning rate. The experiments are run on a single NVIDIA RTX A6000 graphics card. Our method doesn't have + +Table 8: The trigger word set derived from poisoning SST-2 with BITE (Full). + +
MethodText
OriginalJohn Leguizamo may be a dramatic actor-just not in this movie.
StyleJohn Leguizamo may be a dramatic actor, but not in this movie.
SyntacticIf Mr. Leguizamo can be a dramatic ac- tor, he can be a comedian.
BITE (Full)\(John_{0.5} \)\(Leguizamo_{1.4}\)\(may_{6.0} \)\(also_{10.5}\) be \(a_{2.4} \)\(terrific_{4.4}\)\(actor_{1.0}-perhaps_{10.5}\)\(though_{1.3}\)\(not quite_{8.6}\)\(yet_{10.1}\) in this film_{5.8}.
+ +Table 9: Poisoned samples from SST-2: (1). + +
MethodText
OriginalA trashy, exploitative, thoroughly unpleasant experience.
StyleA trite, an exploiter, an utterly detestable experience.
SyntacticWhen he found it, it was unpleasant.
BITE (Full)A2.4 very8.0 trashy0.9, exploitative, and7.9 deeply7.2 emotionally7.2 charged4.6 film5.8.
+ +Table 10: Poisoned samples from SST-2: (2). + +advantages over baselines on computational costs. However, this is not a major concern for the adversary. The training-time poisoning is a one-time cost and can be done offline. The poisoning rate is also usually low in realistic scenarios. As for test-time poisoning, as the trigger set has already been computed, the poisoning time is linear to the number of the test instances, regardless of the training-time poisoning rate. It takes about 1.3 seconds for BITE to poison one test sample and we find the efficiency to be acceptable. + +# F Connections with Adversarial Attacks + +Adversarial attacks usually refer to adversarial example attacks (Goodfellow et al., 2015; Ebrahimi et al., 2018; Li et al., 2020). Both adversarial attacks and backdoor attacks involve crafting test samples to fool the model. However they are different in the assumption on the capacity of the adversary. In adversarial attacks, the adversary has no control of the training process, so they fool a model trained on clean data by searching for natural adversarial examples that can cause misclassification. In backdoor attacks, the adversary can disrupt the + +
StageStyleSyntacticBITE (Full)
Train (69 samples to poison)1312
Test (912 samples to poison)121921
+ +Table 11: Time costs (in minutes) for training-time and test-time poisoning in SST-2 experiments. + +training process to inject backdoors into a model. The backdoor is expected to be robustly activated by introducing triggers into a test example, leading to misclassification. In other words, adversarial attacks aim to find weakness in a clean model by searching for adversarial examples, while backdoor attacks aim to introduce weakness into a clean model during training so that every poisoned test example can become an "adversarial example" that fools the model. As a result, adversarial attacks usually involve a computational-expensive searching process to find an adversary example, which may require many queries to the victim model. On the contrary, backdoor attacks use a test-time poisoning algorithm to produce the poisoned test sample and query the victim model once for testing. + +# Task Description + +We extracted 12 sentences from human-written movie reviews, and ran some automatic text editing tool to modify some of them. + +The goal of this task is to identify the machine-edited sentences from all sentences. + +# Identifying "Machine-Edited" Sentences + +There is no criterion on what machine-edited sentences should look like. But since machine-edited sentences are not directly written by human, they are usually less natural, fluent, and coherent than human-written sentences. + +For a sentence, if you find it hard to understand its meaning, or you feel that people will unlikely express the meaning in that way, then it's likely a machine-edited sentence. + +# Sentence Examples + +We don't provide any example for machine-edited sentences since they might go through various or even unknown editing process. + +Below we show 5 human-written sentences from movie reviews to help you get a sense. + +- (human-written) But taken as a stylish and energetic one-shot, The Queen of the Damned cannot be said to suck. +- (human-written) Sticky sweet sentimentality, clumsy plotting and a rosigly myopic view of life in the WWII-era Mississippi Delta undermine this +adaptation. +- (human-written) Like you couldn't smell this turkey rotting from miles away. +- (human-written) A movie with a real anarchic flair. +- (human-written) This is so bad. + +# Important Notes + +There is NO standard on how many sentences you should identify as human-written. + +Please take time to fully read and understand all texts for evaluation. We will reject submissions from workers that are clearly spamming the task. + +Text 1: $[text1] + +Human Written Machine Edited + +Figure 8: The screenshot of the task description used for the suspicion evaluation on AMT. Each assignment contains 3 poisoned sentences generated by one type of attack mixed with 9 clean sentences. + +# Task Description + +We provide four sentences in each group with one sentence being the reference sentence. + +The goal of this task is to evaluate the semantic similarity between the reference sentence and the other provided sentences in the group. + +# Rating Scale + +- Unrelated or hard to understand: The provided sentence loses nearly all the important information in the reference sentence or the provided sentence itself is hard to understand due to bad fluency or coherence. +Somewhat related: Some important information in the reference sentence is changed in the provided sentence but the two sentences are still related. +- Same meaning: The provide sentence expresses the same meaning as the reference sentence. Subtle difference in details is fine if it doesn't affect the main idea. + +# Important Notes + +The goal is to measure semantic similarity instead of lexical similarity. Two sentences with high word overlap can have low semantic similarity and vice versa. + +Therefore, please take time to fully read and understand the sentence meanings. + +We will reject submissions from workers that are clearly spamming the task. + +# Group 1 + +Reference Text: ${group1.Reference} + +Text 1: \$\{group1_text1\} + +Text 2: ${group1_text2} + +Text 3: $\S$ {group1_text3} + +How well does Text 1 preserve the meaning of Reference Text? + +$\bigcirc$ completely unrelated or hard to understand $\bigcirc$ somewhat related $\bigcirc$ same meaning + +How well does Text 2 preserve the meaning of Reference Text? + +$\bigcirc$ completely unrelated or hard to understand $\bigcirc$ somewhat related $\bigcirc$ same meaning + +How well does Text 3 preserve the meaning of Reference Text? + +$\bigcirc$ completely unrelated or hard to understand $\bigcirc$ somewhat related $\bigcirc$ same meaning + +Figure 9: The screenshot of the task description used for the semantic similarity evaluation on AMT. Each task contains 3 groups of questions. Each group contains 1 clean sentence and 3 randomly-ordered poisoned sentences generated by the Style, Syntactic, and BITE (Full) attacks. + +A For every submission: + +A1. Did you describe the limitations of your work? + +The "Limitations" section. + +A2. Did you discuss any potential risks of your work? + +The "Ethics Statement" section. + +A3. Do the abstract and introduction summarize the paper's main claims? + +Abstract and Section 1. + +A4. Have you used AI writing assistants when working on this paper? + +Left blank. + +B Did you use or create scientific artifacts? + +Section 4.1. + +B1. Did you cite the creators of artifacts you used? + +Section 4.1. + +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? + +Not applicable. Left blank. + +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +Not applicable. Left blank. + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? + +Not applicable. Left blank. + +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? + +Not applicable. Left blank. + +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. + +Section 4.1. + +C Did you run computational experiments? + +Section 4. + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +Section 4.2, Appendix C, Appendix E. + +The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +Appendix A. We used the typical hyperparameter values for text classification. + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +Section 5.1. + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +Not applicable. Left blank. + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Appendix B. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +Appendix B. + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +Not applicable. Left blank. + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +Not applicable. Left blank. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +Not applicable. Left blank. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +Not applicable. Left blank. \ No newline at end of file diff --git a/bitetextualbackdoorattackswithiterativetriggerinjection/images.zip b/bitetextualbackdoorattackswithiterativetriggerinjection/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..a1d507f097800bc7d31b964cee08aed6aa6c08a0 --- /dev/null +++ b/bitetextualbackdoorattackswithiterativetriggerinjection/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2dbfb6cc2e13e71a92bf4bbf3ff91213ad5a4c43e8fac0f42d44a2c5f6f0d632 +size 473507 diff --git a/bitetextualbackdoorattackswithiterativetriggerinjection/layout.json b/bitetextualbackdoorattackswithiterativetriggerinjection/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..1dc026936d9eef3124eb9333b2e8fab1b18fa4ca --- /dev/null +++ b/bitetextualbackdoorattackswithiterativetriggerinjection/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be61d07b08e7ebf3cd006d1b21eab69d406f644b71030984625b4cab5ac65a12 +size 612843 diff --git a/blaseratextfreespeechtospeechtranslationevaluationmetric/6b6bf674-8c71-43ce-93ef-07dc75ab6f08_content_list.json b/blaseratextfreespeechtospeechtranslationevaluationmetric/6b6bf674-8c71-43ce-93ef-07dc75ab6f08_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..fd6da132481376a2e376a46f054b600961248c56 --- /dev/null +++ b/blaseratextfreespeechtospeechtranslationevaluationmetric/6b6bf674-8c71-43ce-93ef-07dc75ab6f08_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:891f0b204a51af2b35e88919c40c5eee33c90c6819539f5711ccc17cd6360a39 +size 109939 diff --git a/blaseratextfreespeechtospeechtranslationevaluationmetric/6b6bf674-8c71-43ce-93ef-07dc75ab6f08_model.json b/blaseratextfreespeechtospeechtranslationevaluationmetric/6b6bf674-8c71-43ce-93ef-07dc75ab6f08_model.json new file mode 100644 index 0000000000000000000000000000000000000000..02441e6cd988d4ca8d6783f3330954d2441d9ace --- /dev/null +++ b/blaseratextfreespeechtospeechtranslationevaluationmetric/6b6bf674-8c71-43ce-93ef-07dc75ab6f08_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7406ea6f57f1cf56de4607cb54b752af7ba0c72eb470e00739a42ca58005da70 +size 138329 diff --git a/blaseratextfreespeechtospeechtranslationevaluationmetric/6b6bf674-8c71-43ce-93ef-07dc75ab6f08_origin.pdf b/blaseratextfreespeechtospeechtranslationevaluationmetric/6b6bf674-8c71-43ce-93ef-07dc75ab6f08_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8e4e615bc4f9d2659c4b0842f927994e311e8f7e --- /dev/null +++ b/blaseratextfreespeechtospeechtranslationevaluationmetric/6b6bf674-8c71-43ce-93ef-07dc75ab6f08_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:829c695f3987265cc309d47cc6683456298d236cc6a1b07a82ec33e8efd91dfc +size 402639 diff --git a/blaseratextfreespeechtospeechtranslationevaluationmetric/full.md b/blaseratextfreespeechtospeechtranslationevaluationmetric/full.md new file mode 100644 index 0000000000000000000000000000000000000000..aabb0d1a73e5617370cad1a94dfab272ca8dab5a --- /dev/null +++ b/blaseratextfreespeechtospeechtranslationevaluationmetric/full.md @@ -0,0 +1,419 @@ +# BLASER: A Text-Free Speech-to-Speech Translation Evaluation Metric + +Mingda Chen, Paul-Ambroise Duquenne, Pierre Andrews, Justine Kao, Alexandre Mourachko, Holger Schwenk*, Marta R. Costa-jussa* + +Meta AI + +{mingdachen, padqn, mortimer, jtk,}@meta.com {alexmourachko, schwenk, costajussa}@meta.com + +# Abstract + +End-to-End speech-to-speech translation (S2ST) is generally evaluated with text-based metrics. This means that generated speech has to be automatically transcribed, making the evaluation dependent on the availability and quality of automatic speech recognition (ASR) systems. + +In this paper, we propose a text-free evaluation metric for end-to-end S2ST, named BLASER, to avoid the dependency on ASR systems. BLASER leverages a multilingual multimodal encoder to directly encode the speech segments for source input, translation output and reference into a shared embedding space and computes a score of the translation quality that can be used as a proxy to human evaluation. To evaluate our approach, we construct training and evaluation sets from more than 40k human annotations covering seven language directions. The best results of BLASER are achieved by training with supervision from human rating scores. We show that when evaluated at the sentence level, BLASER correlates significantly better with human judgment compared to ASR-dependent metrics including ASR-SENTBLEU in all translation directions and ASR-COMET in five of them. Our analysis shows combining speech and text as inputs to BLASER does not increase the correlation with human scores, but best correlations are achieved when using speech, which motivates the goal of our research. Moreover, we show that using ASR for references is detrimental for text-based metrics. + +# 1 Introduction + +Speech-to-Speech translation seeks to translate speech segments from one language into another. + +Historically, it has been implemented and evaluated as a concatenation of three systems: automatic speech recognition (ASR), machine translation (MT) and text-to-speech (TTS) (Lavie et al., 1997; Lazzari, 2006). In recent years, there has been increasing interest in end-to-end approaches (Jia et al., 2019; Lee et al., 2022a). While end-to-end S2ST is becoming popular, researchers still rely on text-based metrics to evaluate model performance by automatically transcribing the generated speech segments (Jia et al., 2019). These cascaded metrics rely on ASR systems, which for a given language may not have enough quality or may not even be available (Javed et al., 2022). They are also inappropriate for languages lacking standardized writing systems (Salesky et al., 2021a), like Hokkien or Algerian Arabic. + +In this work, we propose the text-free metric BLASER for S2ST evaluation, sidestepping the dependency on ASR systems. In particular, we use LASER encoders that support multiple languages and modalities including text (Heffernan et al., 2022) and speech (Duquenne et al., 2021). We use the LASER encoders to directly embed speech segments into vectors and compute a score estimating the quality of generation. We then construct training and evaluation datasets from more than 40k human annotations, covering seven language directions (Spanish $\leftrightarrow$ English, French $\leftrightarrow$ English, Russian $\rightarrow$ English, Hokkien $\rightarrow$ English, and English $\rightarrow$ German). We evaluate BLASER on these datasets on the popular benchmark of MusT-C (Di Gangi et al., 2019). We also benchmark several strong ASR-based metrics, e.g., ASR-SENTBLEU (i.e., sentence-level ASR-BLEU (Jia et al., 2019)) and ASR-COMET (i.e., applying COMET (Rei et al., 2020) on ASR outputs). There is a recent interest of supervised evaluation metrics that are trained on human quality scores (Rei et al., 2020). However, these human quality scores are precious and somehow limited or nonexistent, specially for + +low-resource languages. Therefore, we propose both an unsupervised and a supervised version of BLASER. The results show that on average both unsupervised and supervised BLASER outperform their corresponding baseline metrics. In particular, BLASER outperforms ASR-COMET significantly in five language directions and obtains comparable results in two other language directions. Our analysis reveals that, while BLASER can use both text and speech, encoding speech data give the most significant benefits. In addition, we show that replacing human-written source input and human-written reference with ASR-generated ones hurts performance of text-based metrics, which motivates the use of modality-agnostic metrics as BLASER. + +# 2 Related Work + +S2ST Evaluation. Early approaches for automatic S2ST evaluation use metrics consisting of three modules where each module is used to evaluate individual components in the cascaded S2ST pipeline: e.g., BLEU and Translation Edit Rate (Snover et al., 2006) for NMT, Word Error Rate for ASR, and Mel-Cepstral Distortion (Kominek et al., 2008) for TTS. Recent approaches have been primarily focused on adapting text-based metrics for end-to-end S2ST (Jia et al., 2019; Lee et al., 2022a). In contrast to these works, we propose a text-free metric. + +MT Metrics. There is a huge amount of literature in automatic machine translation evaluation in the area of natural language processing (Papineni et al., 2002; Denkowski and Lavie, 2014; Popovic, 2015, inter alia). Recent methods have approached this goal by using human ratings for training model-based metrics, such as COMET, BERTSCORE (Zhang* et al., 2020) and BLEURT (Sellam et al., 2020). These metrics have achieved remarkable performance on text (Freitag et al., 2021; Kocmi et al., 2021). + +Speech Metrics. Our work involves computing semantic similarity of speech segments to evaluate translation quality. It is thus related to reference-based automatic evaluation metrics for TTS where the metrics seek to measure the quality of generated speech segments given reference speech segments e.g., Mel-Cepstral Distortion, Gross Pitch Error (Nakatani et al., 2008) and other model-based metrics (Binkowski et al., 2020). Unlike our work, + +these metrics primarily focus on the naturalness of synthesized speech. + +Contemporaneous to this work, Besacier et al. (2022) propose a text-free metric for comparing two speech segments in the same language. Their work limits to comparing English speech data and they do not cover multilingual S2ST evaluation. Their work is based on synthetic datasets where ratings are generated by automatic text-based measures as opposed to human annotators. Differently, we cover S2ST evaluation and we show how our metric correlates with human annotations and how it improves over text-based metrics. + +Speech and/or Text Representations. There is a large body of research on learning multilingual text embeddings for various downstream tasks. LabSE (Feng et al., 2022), SentenceBERT (Reimers and Gurevych, 2019), mUSE (Yang et al., 2020) and LASER (Artetxe and Schwenk, 2019; Heffernan et al., 2022) are popular encoders that capture the semantic information of a sentence into fixed size vector representations. In the speech modality, approaches such as wav2vec 2.0 (Baevski et al., 2020a) or Hubert (Hsu et al., 2021) allow learning embeddings at acoustic-frame level. + +There has recently been increased interest in aligned speech-text representations such as mSLAM (Bapna et al., 2022), MAESTRO (Chen et al., 2022b), SAMU-XLSR (Khurana et al., 2022), and LASER (Duquenne et al., 2022). While our approach could accommodate any speech representation architecture given the right pooling strategy, we chose LASER in this work for three reasons. (1) The encoders modules are freely-available; (2) the LASER embedding space can easily be extended to new languages at a minimal cost: contrary to most multilingual encoders, the teacher-student approach does not require the whole embedding space to be retrained after including data for the new language. This makes BLASER virtually usable for any language in the future (3) the embedding space could potentially be extended to any new modality meaningful to translation use cases. + +# 3 Approach + +The underlying idea of our approach is to leverage the similarity between speech segments without requiring intermediate textual representations. Compared to ASR-based metrics, the advantage of BLASER is that it is text-free. In particular, given the source input speech, the translated out + +put speech of a S2ST model, and the reference speech segment, respectively, we embed them into vectors $h_{\mathrm{src}}$ , $h_{\mathrm{mt}}$ , and $h_{\mathrm{ref}}$ . These embeddings are combined and BLASER predicts a score for each translation output, where higher scores suggest better translation quality. + +The effectiveness of BLASER depends on the quality of vector representations encoded from speech segments: it requires rich semantic information to be encoded in the speech embeddings. In this work, we use LASER speech encoders (Duquenne et al., 2022), which we describe below. We note that our approach is generic and can be extended to other encoders. + +We study BLASER under the unsupervised and the supervised settings, which allows it to exploit the information of human ratings, if available. + +# 3.1 Background: LASER Encoders + +The LASER encoder was initially trained in a sequence-to-sequence model (Schwenk and Douze, 2017) and supported 93 languages in its follow-up publications (Artetxe and Schwenk, 2019). In recent work, a teacher-student approach was applied to incorporate more languages (Heffernan et al., 2022) and to extend the model to the speech modality (Duquenne et al., 2021). All these encoders use the same teacher model and are mutually compatible. The embeddings are of dimension 1024. The reader is referred to these papers for a detailed description. These LASER encoders were successfully applied to automatically mine semantically similar sentences, in the text (NLLB Team et al., 2022) and speech domain (Duquenne et al., 2022). + +# 3.2 Unsupervised BLASER + +In the unsupervised setting, we directly compute the cosine similarities between $h_{\mathrm{src}}$ and $h_{\mathrm{mt}}$ , and $h_{\mathrm{ref}}$ and $h_{\mathrm{mt}}$ . Formally, this metric is defined as follows: + +$$ +\mathrm {B L A S E R} _ {\mathrm {u}} = \frac {\cos \left(h _ {\mathrm {s r c}} , h _ {\mathrm {m t}}\right) + \cos \left(h _ {\mathrm {r e f}} , h _ {\mathrm {m t}}\right)}{2} \tag {1} +$$ + +where $\cos (\cdot ,\cdot)$ is the cosine similarity function. + +# 3.3 Supervised BLASER + +Previous work has shown that evaluation metrics (e.g. (Rei et al., 2021)) can take advantage of human ratings for training. We follow COMET (Rei + +![](images/e734b25704c307ea40506768c7a0ce53ba9dd21c27f433e37cdaeb5be115c4f8.jpg) +Figure 1: Diagram for supervised BLASER. The source input (src), reference (ref), and translation (mt) speech segments are embedded into vectors using pretrained speech encoders. We create different combinations of these embeddings through element-wise product (red lines), absolute element-wise difference (blue lines), and unchanged (black lines). Combinations are concatenated as input for a neural regressor. We keep the encoders fixed and train the neural regressor using the Mean Square Error. + +et al., 2020) and RUSE (Shimanaka et al., 2018) and use the following features: + +- Element-wise source product: $h_{\mathrm{src}} \odot h_{\mathrm{mt}}$ +- Element-wise reference product: $h_{\mathrm{ref}} \odot h_{\mathrm{mt}}$ +- Absolute element-wise source difference: $|h_{\mathrm{src}} - h_{\mathrm{mt}}|$ +- Absolute element-wise reference difference: $\left| {h}_{\text{ref }} - {h}_{\text{mt }}\right|$ + +We concatenate these features with the embeddings of references $h_{\mathrm{ref}}$ and translation outputs $h_{\mathrm{mt}}$ and then use it as input for a neural regressor to predict a scalar indicating the quality of the translated speech, as shown in Figure 1. This metric corresponds to the following equation: + +$$ +\begin{array}{l} \mathrm {B L A S E R} _ {\mathrm {s}} = \mathrm {n n e t} ([ \mathrm {h} _ {\text {r e f}}; \mathrm {h} _ {\text {m t}}; \mathrm {h} _ {\text {s r c}} \odot \mathrm {h} _ {\text {m t}}; | \mathrm {h} _ {\text {s r c}} - \mathrm {h} _ {\text {m t}} |; \\ \left. \mathrm {h} _ {\text {r e f}} \odot \mathrm {h} _ {\mathrm {m t}}; \left| \mathrm {h} _ {\text {r e f}} - \mathrm {h} _ {\mathrm {m t}} \right|\right) \bigg) \\ \end{array} +$$ + +where $\mathrm{nnet}(\cdot)$ is a two-layer neural network and $[\cdot ;\cdot ]$ represents the concatenation of vectors. We note that the dimension of concatenated input vectors to the neural regressor is 6144. The entire model except the LASER encoders (which are kept + +![](images/0b946ff9a796afa332b963078a70de6fcab6871231e12ca594d309d392a26b10.jpg) +Figure 2: Diagram illustrating data sources of source input (src), reference (ref), and translation output (mt) used in this work. The source speech data and the reference text are generated/annotated by humans. We use color boxes to highlight the differences between BLASER and text-based metrics. + +frozen) is trained by minimizing the Mean Squared Error between the BLASERs predicted scores and human ratings. We choose to freeze LASER encoders because (1) we do not want to break the aligned embedding space; and (2) it allows us to extend to unseen languages more easily. + +# 4 Experimental Framework + +To show that BLASER is useful both in its unsupervised and supervised form, we compare it to several baseline metrics. In this section, we describe the experimental framework for doing this comparison, including the evaluation data, the training and implementation of both baseline and proposed metrics and their evaluation. + +# 4.1 Data + +We create training and evaluation data from MusT-C (Di Gangi et al., 2019), Multilingual TEDx (Salesky et al., 2021b), and TAT corpus (Liao et al., 2020). Given a source input from these datasets, we generate translated outputs using various S2ST models. We then conduct human evaluations to collect human ratings for generated speech segments. As the datasets do not have reference speech segments but provide human-written transcripts, we use TTS to synthesize speech data from these transcripts to facilitate fair comparison between our metrics and other reference-based textual metrics. While the use of synthesized audios is disadvantageous to BLASER, $^{3}$ current benchmarks still use human-written transcripts because of the current dependence on the text-based metrics. We expect that, in the future, S2ST benchmarks will rely on speech references and TTS will not be + +needed. In this case, BLASER will have additional advantage over text-based metrics that will have to apply ASR to references in addition to ASR to system outputs. + +Each data instance in our dataset consists of a source input, a translation output, a reference, and a human evaluation score, where the source, translation output, and reference have both speech and text. Figure 2 summarizes the data sources of these components. As follows we describe the details of each data sources. + +Human Annotations. We do not use crowd workers as human annotators and instead we use a vendor-managed pool of well-trained and qualified bilingual annotators who pass a qualification test for their language skills. Human annotators are instructed to rate semantic similarities between source input and generated speech segments on a 5-point Likert scale, where higher values are better, following annotation guidelines similar to Licht et al. (2022). More details on human evaluations are in Appendix D. Each model generation has 1~18 human ratings, leading to $4\mathrm{k}\sim 20\mathrm{k}$ annotations per language direction. We take medians of rating scores when there are more than one score associated with a particular model generation following NLLB Team et al. (2022) and Licht et al. (2022). + +Speech To Speech Translation. We evaluate the translation outputs generated with the following S2ST architectures: + +1. Cascaded two-stage models with speech-to-text translation and TTS. This system includes Spanish-English, English-French and Russian-to-English translation directions; +2. The model presented in Lee et al. (2022b), which represents target speech as discrete units and uses a speech-to-unit translation model to convert source speech to target units followed by a code HiFi-GAN vocoder (Park and Mulc, 2019; Polyak et al., 2021) to convert units to waveform. This system includes English-Spanish and Russian-to-English translation directions; +3. The model presented in Inaguma et al. (2022), which is similar to Lee et al. (2022b) except that it is a two-pass direct S2ST architecture + +
es→enru→enhk→enfr→enen→deen→esen→fr
No. of annotators14169413138
No. of S2ST systems5411141
No. of unique source inputs98910029881015204710001000
No. of annotations20636179086978454512282148174426
No. of train instances2470200400102320000
No. of test instances247520049881015102420001000
No. of annotations per instance
maximum66186666
minimum1141612
average4.24.57.14.56.03.74.4
+ +Table 1: Dataset Statistics. We collect human annotations for speech segments generated by S2ST systems. + +that first generates textual representations and predicts discrete acoustic units subsequently. This system includes the Spanish-to-English translation direction; + +4. The model presented in Wang et al. (2022), which employs mBART (Liu et al., 2020) for unsupervised machine translation in their unsupervised cascaded speech-to-text translation pipeline. This system includes the Spanish-to-English translation direction. +5. The Hokkien-to-English S2ST system is three-stage cascaded: a concatenation of Hokkien to Chinese speech-to-text translation + Chinese to English machine translation + English TTS (English text-to-unit + unit vocoder from Lee et al. (2022b)). +6. The English-to-German S2ST system is the MLLP-VRAIN system (Iranzo-Sanchez et al., 2022) from IWSLT 2022 (Anastasopoulos et al., 2022), which is a cascaded system of separate ASR, MT, and TTS models. + +Automatic Speech Recognition. For ASR, we use the open-sourced implementation in FAIRSEQ (Ott et al., 2019), that provides strong models built on top of the unsupervised pretrained wav2vec (Schneider et al., 2019) or XLSR (Conneau et al., 2020a) models. In particular, for English and Russian, we use wav2vec 2.0 large (Baevski et al., 2020b) finetuned with CTC loss (Graves et al., 2006). For Hokkien, Spanish, French, and German, we use the ASR models released in Chen et al. (2022a), Grosman (2021b), Grosman (2021a), and Grosman (2022), respectively. + +Text to Speech. For TTS, we use the toolkit released by Wang et al. (2021a), which provides a set of recent state-of-the-art speech synthesis models. + +The language directions in the final dataset are Spanish-English and French-English in both directions (i.e., en→es, es→en, en→fr, and fr→en), Russian to English (ru→en), Hokkien to English (hk→en) and English to German (en→de). We split the data into training and test sets when there is enough data available (i.e., at least one thousand data instances for a language direction). We also make sure that there is no overlapping source inputs between train and test sets. Table 1 summarizes the dataset statistics. + +# 4.2 Baseline Metrics + +We consider a variety of baseline metrics, including BLEU and $\mathrm{CHRF + }$ (Popovic, 2017), which are standard metrics to evaluate textual similarities. While BLEU is by nature corpus-level, here we use the sentence-level version due to the insufficient amount of human annotations. To differentiate these two versions, we denote the sentence-level BLEU as SENTBLEU. We also benchmark BERTSCORE (Zhang* et al., 2020) and COMET, which are popular model-based metrics that correlate well with human judgments on textual data (Kocmi et al., 2021).6 We extend these metrics to speech data by using ASR systems to transcribe the machine-translated speech segments. We prepend "ASR-" to the beginning of the names of these metrics to indicate the use of ASR systems. Table 2 summarizes the differences among the metrics. + +Specifically, we use $\mathrm{BLEU}^7$ and $\mathrm{CHRF} + ^8$ as im + +
Baseline Metricsreq. trainreq. ASR
ASR-SENTBLEUX✓
ASR-CHRF+X✓
ASR-BERTSCORE✓✓
ASR-COMET✓✓
Proposed Metrics
BLASERuXX
BLASERS✓X
+ +Table 2: Comparisons between baseline and proposed metrics regarding the dependency of training data and ASR systems. We use "ASR-" to indicate that the metric depends on ASR systems to transcribe speech segments. + +pleted in SacreBLEU (Post, 2018). We normalize the reference text before computing ASR-SENTBLEU and ASR-CHRF+ to match the lower-cased and punctuationless ASR output. We use the official implementations for BERTSCORE10 and COMET.11 To form competitive baselines, we also train COMET from scratch on our training data $(\mathrm{COMET}_{\mathrm{train}})$ and the concatenation of our training data and the direct assessments from WMT 15-19 metrics tasks (Stanojevic et al., 2015; Bojar et al., 2016, 2017; Ma et al., 2018, 2019) $(\mathrm{COMET}_{\mathrm{train}}$ with WMT). + +# 4.3 Training and Evaluation + +LASER Encoders. We use the speech LASER encoders released in Duquenne et al. (2022) except for English and Hokkien. $^{12}$ . For Hokkien speech LASER encoder, we followed the training procedure presented in (Chen et al., 2022a) using the same pretrained model and training data. For the English speech LASER encoder, we fine-tuned XLSR 2B (Babu et al., 2021) on several ASR datasets including CoVoST2 (Wang et al., 2021c), Common Voice (Ardila et al., 2020), EuroparlST (Iranzo-Sanchez et al., 2020), MusT-C (Di Gangi et al., 2019), Voxopuli (Wang et al., 2021b) and Librispeech (Panayotov et al., 2015). + +Training Setup and Hyperparameters. For BLASERs, the regressor has two hidden layers of sizes 3072 and 1536, similar to COMET. We keep + +the LASER encoders fixed during training. We use a learning rate of $5 \times 10^{-5}$ and employ learning rate annealing with a linear schedule. When training COMET, we follow the official implementation and fine-tune the entire model from the XLM-R-LARGE model checkpoint (Conneau et al., 2020b). For both BLASERs and COMET, we train them for 20 epochs. We standardize the human ratings in our training set by subtracting them with a mean and a variance computed based on the entire training set. + +Computational Cost. We trained BLASERs using 1 Quadro GV100 and the training takes less than one hour. We used 4 Tesla V100 to train COMET and the training takes more than two days. + +Evaluation. We compute Pearson's correlation at the sentence level between the automatic and human rating scores. Given that our test sets are relatively small, we perform statistical significance test using the bootstrap method from Koehn (2004).13 + +# 5 Experimental Results and Analysis + +In this section we report the main results of our proposed metric BLASER, on two different settings (unsupervised and supervised) and we compare it to widely used baseline text-based metrics. Additionally, we report an analysis at various levels, including the impact of evaluating using different modalities and a qualitative inspection of several examples to observe scores of various metrics for particular examples. + +# 5.1 Main Results + +We report unsupervised and supervised results in Table 3. We note that results that fail to pass the significance test are neither better nor worse significantly than the corresponding baseline. + +Generally, model-based metrics perform significantly better than string-based ones. Among the unsupervised metrics, $\mathrm{BLASER_u}$ performance improves significantly over ASR-SENTBLEU and ASR-CHRF+ for all language directions except for en→es, showing the capabilities of BLASER in capturing semantic information even when human annotations are absent. + +Among the supervised metrics, we see that $\mathrm{BLASER}_s$ almost always performs better than the official ASR-BERTSCORE and ASR-COMET. + +
es→enru→enhk→enfr→enen→deen→esen→fraverage
Unsupervised Metrics
ASR-SENTBLEU0.32260.15880.28630.32770.11790.49370.44620.3076
ASR-CHRF+†0.39100.23240.33560.39270.14690.59670.52670.3746
BLASERu0.4970*0.4326*0.4940*0.4744*0.3148*0.58430.6356*0.4904
Supervised Metrics
ASR-BERTSCORE0.43320.35110.48850.41840.20310.61270.62160.4469
ASR-COMET0.52380.39880.51380.56930.24280.71260.65590.5167
ASR-COMETretrained0.56180.42650.44850.52100.29210.74890.61230.5159
ASR-COMET†retrained with WMT0.53400.43480.53140.56590.26350.73080.64360.5291
BLASERs0.5774*0.5347*0.6059*0.57300.3297*0.75120.7146*0.5838
+ +Table 3: Pearson's correlation on the test set. Best results in bold. Results marked with * pass the significance test with with $p$ -value $< 0.05$ when compared against the baseline metric marked by † in the same category. + +
es→enru→enhk→enfr→enen→deen→esen→fraverage
ASR-SENTBLEU0.32260.15880.28630.32770.12590.49290.43930.3076
Δ-0.0222-0.0244-0.0033-0.0161-0.1161-0.0467-0.0341-0.0376
ASR-CHRF+0.39100.23240.33560.39270.16730.60320.51770.3771
Δ-0.0195-0.02040.0017-0.0125-0.1201-0.0757-0.0206-0.0382
ASR-COMET0.52380.39880.51380.56930.24280.71260.65590.5167
Δ-0.0164-0.0443-0.0602-0.0185-0.0929-0.0281-0.0057-0.0380
+ +Table 4: Pearson's correlation on the test set. “ $\Delta$ ” rows show the performance differences when using transcripts produced by ASR systems instead of humans for the source input and reference. Negative differences indicate performance drops. We highlight the results for en→de as they are severely affected by the change. + +When compared to the stronger baseline ASR-COMETretrained with WMT, BLASERs is better than the baseline significantly in four language directions and they are comparable in the other three directions. + +We also find that BLASER can generalize training signal to languages where there is no training data available. Specifically, if we compare $\mathrm{BLASER}_{\mathrm{s}}$ to $\mathrm{BLASER}_{\mathrm{u}}$ , we see that $\mathrm{BLASER}_{\mathrm{s}}$ always improves over the unsupervised version. Also, for the language directions where there is no training data (i.e., $\mathrm{hk} \rightarrow \mathrm{en}$ , $\mathrm{fr} \rightarrow \mathrm{en}$ , $\mathrm{en} \rightarrow \mathrm{fr}$ ), $\mathrm{BLASER}_{\mathrm{s}}$ still beats $\mathrm{BLASER}_{\mathrm{u}}$ . Additionally, we observe that $\mathrm{hk} \rightarrow \mathrm{en}$ and $\mathrm{ru} \rightarrow \mathrm{en}$ are two of the language directions for which $\mathrm{BLASER}_{\mathrm{s}}$ shows significant improvements over ASR-COMET, confirming the zero-shot capabilities of our proposed methods in comparison to existing metrics. + +# 5.2 Analysis + +Impact of Human-Written vs ASR-transcriptions. To investigate the impact of using transcripts generated by ASR systems rather than human-written inputs and references, we replace the human-written source input and reference with the ones generated by ASR systems. + +We note that in this case, all the transcripts are obtained via ASR systems, simulating an evaluation setting where only audio data is available. We show the results in Table 4 where we find that the human-written transcripts are less helpful on those to-English language directions than the from-English ones. We hypothesize that this is in part due to the quality of ASR systems as these ASR-based metrics depend more on references than source inputs and English ASR systems tend to be of better quality than the non-English ones (Khare et al., 2021). + +Impact of Using Source and Reference. We investigate the impact of using source and reference speech segments when computing BLASER scores. We evaluate this impact on $\mathrm{BLASER_u}$ by reporting the performance of individual terms in Equation 1. See the results in Table 5. In general, we find the source input generates better correlations with human ratings than reference. Combining the two leads to the best performance. + +Qualitative Analysis. To get a sense of the qualitative differences between BLASER and text-based scores, and better understand what kind of nuances are captured, we manually inspect sample sen + +
es→enru→enhk→enfr→enen→deen→esen→fraverage
cos(href, hmt) + cos(hsrc, hmt)0.49700.43260.49400.47440.31480.58430.63560.4904
cos(href, hmt)0.43920.28550.40510.41440.13880.45160.55880.3848
cos(hsrc, hmt)0.43920.41820.47230.44500.26540.64110.62150.4718
+ +Table 5: Pearson's correlation on the test set. Best results are in bold. We evaluate the contributions of two individual terms in $\mathrm{BLASER_u}$ (Equation 1) to the final performance. + +
source inputtranslation outputreferenceHRBRCTBU
The pollution in Santi-ago, which is one of the most polluted capitals historically in Latin America, has dropped substantially.die verschmutzung in santiago einem der am stärksten ver-schmutzten hauptstädte latein-amerikas ist erheblich gesungen (the pollution in santiago one the at strongest polluted capital cities latin america is significantly sung)Die Umweltverschmutzung in Santiago, das historisch gesehen eine der Städte mit der hoch-sten Umweltverschmutzung in gaz Lateinamerika ist, ist viel geringer geworden.4.50.20.94.0
And for those of us that are in the know, we know that's text-speak, or SMS language.diejenigen von uns die das ken-nen wollen das ist zum spracher (those from us the the know to know the is for the speaker)Diejenigen von uns, die das kennen, wicht: Das ist SMS-Sprache.2.50.00.978.6
So, when I say, "Oh, Aaron is..." It's be-cause Aaron still is.wenn ich aron sehe liegt das daran dass aron es immer noch ist (if I aron see located the to it that aron it always still is)Wenn ich also sage: „Oh, Aaron ist ...“, dann sage ich das, weil Aaron immer noch ist.3.5-0.10.912.9
+ +Table 6: The examples from the en→de test set and the corresponding scores given by different metrics. HR=Human Ratings. BR=BLASERs. CT=ASR-COMET. BU=ASR-SENTBLEU. Sentences in parenthesis are gloss for translation outputs. + +tences. A selection is presented in Table 6. In each of these examples, the text and generated audio perfectly match, discarding any influence potentially introduced by the ASR model. In cases where the output vocabulary does not perfectly match the reference but is still valid, BLASER seems able to capture the semantics and produce a meaningful score. In the first example, ASR-SENTBLEU is very much impacted by the vocabulary mismatch, while BLASER and ASR-COMET yield high scores, in line with human evaluation. BLASER also seem to detect clear mistranslations better than either of ASR-COMET or ASR-SENTBLEU. In the second example, the end of the output sentence makes little sense. Only BLASER accounts for this properly and produces a score aligned with human judgment. In the third example, ASR-COMET returns a high score despite the mistranslated verb which heavily changes the meaning of the sentence. + +# 6 Conclusion and Future Work + +We have introduced BLASER, a text-free metric to evaluate speech-to-speech translation, which avoids the dependency on ASR models required by popular text-based metrics currently used in S2ST. + +We explored BLASER in both unsupervised and supervised settings. Experimental results in seven language directions show that BLASER outperforms or is comparable to strong text-based metrics in terms of correlation with human scores at the sentence-level. Moreover, our metric is effective in zero-shot scenarios. + +As for future work, we want to explore the use of speech references generated by humans and the impact of synthesized references. We also want to evaluate BLASER at the system-level with a much larger number of S2ST systems, and explore different approaches to aggregate the sentence-level scores from BLASER and we want to explore different speech and text representations as alternative to LASER. + +# Limitations + +We are evaluating S2ST in an artificial setting given that we have to synthesize the text references. In fact, since there was no metric capable of evaluating the quality in speech, there was no motivation to build such benchmarks either (the chicken-and-egg problem). However, we expect that next benchmarks for the task will have speech references be + +cause of the rise of end-to-end S2ST systems and their quality increase. BLASER paves the way so that we can take advantage of such benchmarks when they appear. + +Our metric works at the sentence-level, by embedding the entire sentence into an intermediate space. We ignore how sensitive BLASER is to the length of the sentence, which is a key aspect when we want to extend to the corpus-level metric in the future. Moreover, we are aware that sometimes sentence embedding do not discriminate different numbers or words that belong to the same word family, which may disregard impactful errors such as the change of a number in the translation output. + +# Ethical considerations + +Translation quality scores were provided by bilingual raters as mentioned in Section 4. They were all paid a fair rate. We can not open-source the data form our experiments given that our sources are shared under no-derivative license. Small human evaluation detailed in appendix D was done by volunteers. + +# References + +Antonios Anastasopoulos, Loic Barrault, Luisa Bentivogli, Marcely Zanon Boito, Ondrej Bojar, Roldano Cattoni, Anna Currey, Georgiana Dinu, Kevin Duh, Maha Elbayad, Clara Emmanuel, Yannick Esteve, Marcello Federico, Christian Federmann, Souhir Gahbiche, Hongyu Gong, Roman Grundkiewicz, Barry Haddow, Benjamin Hsu, David Javorsky, Vera Kloudova, Surafel Lakew, Xutai Ma, Prashant Mathur, Paul McNamee, Kenton Murray, Maria Nadejde, Satoshi Nakamura, Matteo Negri, Jan Niehues, Xing Niu, John Ortega, Juan Pino, Elizabeth Salesky, Jiatong Shi, Matthias Sperber, Sebastian Stüker, Katsuhito Sudoh, Marco Turchi, Yogesh Virkar, Alexander Waibel, Changhan Wang, and Shinji Watanabe. 2022. Findings of the IWSLT 2022 evaluation campaign. In Proceedings of the 19th International Conference on Spoken Language Translation (IWSLT 2022), pages 98-157, Dublin, Ireland (in-person and online). Association for Computational Linguistics. +Rosana Ardila, Megan Branson, Kelly Davis, Michael Kohler, Josh Meyer, Michael Henretty, Reuben Morais, Lindsay Saunders, Francis M. Tyers, and Gregor Weber. 2020. Common voice: A massively-multilingual speech corpus. In Proceedings of The 12th Language Resources and Evaluation Conference, LREC 2020, Marseille, France, May 11-16, 2020, pages 4218-4222. European Language Resources Association. + +Mikel Artetxe and Holger Schwenk. 2019. Massively multilingual sentence embeddings for zero-shot cross-lingual transfer and beyond. Transactions of the Association for Computational Linguistics, 7:597-610. +Arun Babu, Changhan Wang, Andros Tjandra, Kushal Lakhotia, Qiantong Xu, Naman Goyal, Kritika Singh, Patrick von Platen, Yatharth Saraf, Juan Pino, et al. 2021. Xls-r: Self-supervised cross-lingual speech representation learning at scale. arXiv preprint arXiv:2111.09296. +Alexei Baevski, Yuhao Zhou, Abdelrahman Mohamed, and Michael Auli. 2020a. wav2vec 2.0: A framework for self-supervised learning of speech representations. Advances in Neural Information Processing Systems, 33:12449-12460. +Alexei Baevski, Yuhao Zhou, Abdelrahman Mohamed, and Michael Auli. 2020b. wav2vec 2.0: A framework for self-supervised learning of speech representations. In Advances in Neural Information Processing Systems, volume 33, pages 12449-12460. Curran Associates, Inc. +Ankur Bapna, Colin Cherry, Yu Zhang, Ye Jia, Melvin Johnson, Yong Cheng, Simran Khanuja, Jason Riesa, and Alexis Conneau. 2022. mslam: Massively multilingual joint pre-training for speech and text. arXiv preprint arXiv:2202.01374. +Laurent Besacier, Swen Ribeiro, Olivier Galibert, and Joan Calapodescu. 2022. A textless metric for speech-to-speech comparison. arXiv preprint arXiv:2210.11835. +Mikołaj Binkowski, Jeff Donahue, Sander Dieleman, Aidan Clark, Erich Elsen, Norman Casagrande, Luis C. Cobo, and Karen Simonyan. 2020. High fidelity speech synthesis with adversarial networks. In International Conference on Learning Representations. +Ondrej Bojar, Yvette Graham, and Amir Kamran. 2017. Results of the WMT17 metrics shared task. In Proceedings of the Second Conference on Machine Translation, pages 489-513, Copenhagen, Denmark. Association for Computational Linguistics. +Ondrej Bojar, Yvette Graham, Amir Kamran, and Miloš Stanojevic. 2016. Results of the WMT16 metrics shared task. In Proceedings of the First Conference on Machine Translation: Volume 2, Shared Task Papers, pages 199-231, Berlin, Germany. Association for Computational Linguistics. +Peng-Jen Chen, Kevin Tran, Yilin Yang, Jingfei Du, Justine Kao, Yu-An Chung, Paden Tomasello, Paul-Ambroise Duquenne, Holger Schwenk, Hongyu Gong, et al. 2022a. Speech-to-speech translation for a real-world unwritten language. arXiv preprint arXiv:2211.06474. + +Zhehuai Chen, Yu Zhang, Andrew Rosenberg, Bhavana Ramabhadran, Pedro Moreno, Ankur Bapna, and Heiga Zen. 2022b. Maestro: Matched speech text representations through modality matching. arXiv preprint arXiv:2204.03409. +Alexis Conneau, Alexei Baevski, Ronan Collobert, Abdelrahman Mohamed, and Michael Auli. 2020a. Unsupervised cross-lingual representation learning for speech recognition. arXiv preprint arXiv:2006.13979. +Alexis Conneau, Kartikay Khandelwal, Naman Goyal, Vishrav Chaudhary, Guillaume Wenzek, Francisco Guzmán, Edouard Grave, Myle Ott, Luke Zettlemoyer, and Veselin Stoyanov. 2020b. 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. +Michael Denkowski and Alon Lavie. 2014. Meteor universal: Language specific translation evaluation for any target language. In Proceedings of the Ninth Workshop on Statistical Machine Translation, pages 376-380, Baltimore, Maryland, USA. Association for Computational Linguistics. +Mattia A. Di Gangi, Roldano Cattoni, Luisa Bentivogli, Matteo Negri, and Marco Turchi. 2019. MuST-C: a Multilingual Speech Translation Corpus. 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. +Paul-Ambroise Duquenne, Hongyu Gong, Ning Dong, Jingfei Du, Ann Lee, Vedanuj Goswani, Changhan Wang, Juan Pino, Benoit Sagot, and Holger Schwenk. 2022. Speechmatrix: A large-scale mined corpus of multilingual speech-to-speech translations. arXiv preprint arXiv:2211.04508. +Paul-Ambroise Duquenne, Hongyu Gong, and Holger Schwenk. 2021. Multimodal and multilingual embeddings for large-scale speech mining. In Advances in Neural Information Processing Systems, volume 34, pages 15748-15761. Curran Associates, Inc. +Fangxiaoyu Feng, Yinfei Yang, Daniel Cer, Naveen Arivazhagan, and Wei Wang. 2022. Language-agnostic BERT sentence embedding. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 878-891, Dublin, Ireland. Association for Computational Linguistics. +Markus Freitag, Ricardo Rei, Nitika Mathur, Chi-kiu Lo, Craig Stewart, George Foster, Alon Lavie, and Ondrej Bojar. 2021. Results of the WMT21 metrics shared task: Evaluating metrics with expert-based human evaluations on TED and news domain. In Proceedings of the Sixth Conference on Machine Translation, + +pages 733-774, Online. Association for Computational Linguistics. +Alex Graves, Santiago Fernández, Faustino Gomez, and Jürgen Schmidhuber. 2006. Connectionist temporal classification: Labelling unsegmented sequence data with recurrent neural networks. In Proceedings of the 23rd International Conference on Machine Learning, ICML '06, page 369-376, New York, NY, USA. Association for Computing Machinery. +Jonatas Grosman. 2021a. Fine-tuned French Voxpopuli wav2vec2 large model for speech recognition in French. https://huggingface.co/jonat asgrossman/wav2vec2-large-fr-voxpopuli-french. +Jonatas Grosman. 2021b. Fine-tuned XLSR-53 large model for speech recognition in Spanish. https://huggingface.co/jonatasgrosman/wav2vec2-large-xlsr-53-spanish. +Jonatas Grosman. 2022. Fine-tuned XLS-R 1B model for speech recognition in German. https://huggingface.co/jonatasgrossman/wav2ve.c2-xls-r-1b-german. +Kevin Heffernan, Onur Celebi, and Holger Schwenk. 2022. Bitext mining using distilled sentence representations for low-resource languages. arXiv preprint arXiv:2205.12654. +Wei-Ning Hsu, Benjamin Bolte, Yao-Hung Hubert Tsai, Kushal Lakhotia, Ruslan Salakhutdinov, and Abdelrahman Mohamed. 2021. Hubert: Self-supervised speech representation learning by masked prediction of hidden units. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 29:3451-3460. +Hirofumi Inaguma, Sravya Popuri, Ilia Kulikov, Peng-Jen Chen, Changhan Wang, Yun Tang, Ann Lee, Shinji Watanabe, and Juan Pino. 2022. Unity: Two-pass direct speech-to-speech translation with discrete units. arXiv preprint. +Javier Iranzo-Sanchez, Javier Jorge Cano, Alejandro Pérez-González-de Martos, Adrián Giménez Pastor, Gonçal Garcés Díaz-Munio, Pau Baquero-Arnal, Joan Albert Silvestre-Cerdà, Jorge Civera Saiz, Albert Sanchis, and Alfons Juan. 2022. MLLP-VRAIN UPV systems for the IWSLT 2022 simultaneous speech translation and speech-to-speech translation tasks. In Proceedings of the 19th International Conference on Spoken Language Translation (IWSLT 2022), pages 255-264, Dublin, Ireland (in-person and online). Association for Computational Linguistics. +Javier Iranzo-Sanchez, Joan Albert Silvestre-Cerdà, Javier Jorge, Nahuel Rosello, Adrià Giménez, Albert Sanchís, Jorge Civera, and Alfons Juan. 2020. Europarl-st: A multilingual corpus for speech translation of parliamentary debates. In 2020 IEEE International Conference on Acoustics, Speech and Signal Processing, ICASSP 2020, Barcelona, Spain, May 4-8, 2020, pages 8229-8233. IEEE. + +Tahir Javed, Sumanth Doddapaneni, Abhigyan Raman, Kaushal Santosh Bhogale, Gowtham Ramesh, Anoop Kunchukuttan, Pratyush Kumar, and Mitesh M. Khapra. 2022. Towards building ASR systems for the next billion users. In Proceedings of AAAI. +Ye Jia, Ron J. Weiss, Fadi Biadsy, Wolfgang Macherey, Melvin Johnson, Z. Chen, and Yonghui Wu. 2019. Direct speech-to-speech translation with a sequence-to-sequence model. In INTERSPEECH. +Shreya Khare, Ashish Mittal, Anuj Diwan, Sunita Sarawagi, Preethi Jyothi, and Samarth Bharadwaj. 2021. Low Resource ASR: The Surprising Effectiveness of High Resource Transliteration. In Proc. Interspeech 2021, pages 1529-1533. +Sameer Khurana, Antoine Laurent, and James Glass. 2022. Samu-xlSr: Semantically-aligned multimodal utterance-level cross-lingual speech representation. arXiv preprint arXiv:2205.08180. +Tom Kocmi, Christian Federmann, Roman Grundkiewicz, Marcin Junczys-Dowmunt, Hitokazu Matsushita, and Arul Menezes. 2021. To ship or not to ship: An extensive evaluation of automatic metrics for machine translation. In Proceedings of the Sixth Conference on Machine Translation, pages 478-494, Online. Association for Computational Linguistics. +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. +John Kominek, Tanja Schultz, and Alan W Black. 2008. Synthesizer voice quality of new languages calibrated with mean mel cepstral distortion. In SLTU, pages 63-68. +Alon Lavie, A. Waibel, Lori Levin, M. Finke, Donna Gates, Marsal Gavalda, Torsten Zeppenfeld, and Puming Zhan. 1997. Janus-iii: speech-to-speech translation in multiple languages. pages 99 - 102 vol.1. +Gianni Lazzari. 2006. TC-STAR: a speech to speech translation project. In Proceedings of the Third International Workshop on Spoken Language Translation: Plenaries, Kyoto, Japan. +Ann Lee, Peng-Jen Chen, Changhan Wang, Jiatao Gu, Sravya Popuri, Xutai Ma, Adam Polyak, Yossi Adi, Qing He, Yun Tang, Juan Pino, and Wei-Ning Hsu. 2022a. Direct speech-to-speech translation with discrete units. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 3327-3339, Dublin, Ireland. Association for Computational Linguistics. +Ann Lee, Hongyu Gong, Paul-Ambroise Duquenne, Holger Schwenk, Peng-Jen Chen, Changhan Wang, Sravya Popuri, Yossi Adi, Juan Pino, Jiatao Gu, and Wei-Ning Hsu. 2022b. Textless speech-to-speech translation on real data. In Proceedings of the + +2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 860-872, Seattle, United States. Association for Computational Linguistics. +Yuan-Fu Liao, Chia-Yu Chang, Hak-Khiam Tiun, Huang-Lan Su, Hui-Lu Khoo, Jane S. Tsay, LeKun Tan, Peter Kang, Tsun-guan Thiann, Un-Gian Iunn, Jyh-Her Yang, and Chih-Neng Liang. 2020. Formosa speech recognition challenge 2020 and taiwanese across taiwan corpus. In 2020 23rd Conference of the Oriental COCOSDA International Committee for the Co-ordination and Standardisation of Speech Databases and Assessment Techniques (O-COCOSDA), pages 65-70. +Daniel Licht, Cynthia Gao, Janice Lam, Francisco Guzman, Mona Diab, and Philipp Koehn. 2022. Consistent human evaluation of machine translation across language pairs. In Proceedings of the 15th biennial conference of the Association for Machine Translation in the Americas (Volume 1: Research Track), pages 309-321, Orlando, USA. Association for Machine Translation in the Americas. +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. +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 (Volume 2: Shared Task Papers, Day 1), pages 62-90, Florence, Italy. Association for Computational Linguistics. +Tomohiro Nakatani, Shigeaki Amano, Toshio Irino, Kentaro Ishizuka, and Tadahisa Kondo. 2008. A method for fundamental frequency estimation and voicing decision: Application to infant utterances recorded in real acoustical environments. Speech Communication, 50(3):203-214. +NLLB Team, Marta R. Costa-jussà, James Cross, Onur Celebi, Maha Elbayad, Kenneth Heafield, Kevin Heffernan, Elahe Kalbassi, Janice Lam, Daniel Licht, Jean Maillard, Anna Sun, Skyler Wang, Guillaume Wenzek, Al Youngblood, Bapi Akula, Loic Barrault, Gabriel Mejia-Gonzalez, Prangthip Hansanti, John Hoffman, Semarley Jarrett, Kaushik Ram Sadagopan, Dirk Rowe, Shannon Spruit, Chau + +Tran, Pierre Andrews, Necip Fazil Ayan, Shruti Bhosale, Sergey Edunov, Angela Fan, Cynthia Gao, Vedanuj Goswami, Francisco Guzmán, Philipp Koehn, Alexandre Mourachko, Christophe Ropers, Safiyyah Saleem, Holger Schwenk, and Jeff Wang. 2022. No language left behind: Scaling human-centered machine translation. arXiv preprint arXiv:2207.04672. +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. +Vassil Panayotov, Guoguo Chen, Daniel Povey, and Sanjeev Khudanpur. 2015. Librispeech: an asr corpus based on public domain audio books. In 2015 IEEE international conference on acoustics, speech and signal processing (ICASSP), pages 5206-5210. IEEE. +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. +Kyubyong Park and Thomas Mulc. 2019. CSS10: A collection of single speaker speech datasets for 10 languages. Interspeech. +Adam Polyak, Yossi Adi, Jade Copet, Eugene Kharitonov, Kushal Lakhotia, Wei-Ning Hsu, Abdelrahman Mohamed, and Emmanuel Dupoux. 2021. Speech Resynthesis from Discrete Disentangled Self-Supervised Representations. In Proc. Interspeech 2021. +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. +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. +Amy Pu, Hyung Won Chung, Ankur Parikh, Sebastian Gehrmann, and Thibault Sellam. 2021. Learning compact metrics for MT. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 751-762, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. + +Ricardo Rei, Ana C Farinha, Chrysoula Zerva, Daan van Stigt, Craig Stewart, Pedro Ramos, Taisiya Glushkova, André F. T. Martins, and Alon Lavie. 2021. Are references really needed? un babel-IST 2021 submission for the metrics shared task. In Proceedings of the Sixth Conference on Machine Translation, pages 1030-1040, Online. Association for Computational Linguistics. +Ricardo Rei, Craig Stewart, Ana C Farinha, and Alon Lavie. 2020. COMET: A neural framework for MT evaluation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 2685-2702, 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. +Elizabeth Salesky, Julian Mäder, and Severin Klinger. 2021a. Assessing evaluation metrics for speech-to-speech translation. In 2021 IEEE Automatic Speech Recognition and Understanding Workshop (ASRU), pages 733-740. IEEE. +Elizabeth Salesky, Matthew Wiesner, Jacob Bremerman, Roldano Cattoni, Matteo Negri, Marco Turchi, Douglas W. Oard, and Matt Post. 2021b. Multilingual tex corpus for speech recognition and translation. In Proceedings of Interspeech. +Steffen Schneider, Alexei Baevski, Ronan Collobert, and Michael Auli. 2019. wav2vec: Unsupervised pre-training for speech recognition. arXiv preprint arXiv:1904.05862. +Holger Schwenk and Matthijs Douze. 2017. Learning joint multilingual sentence representations with neural machine translation. In Proceedings of the 2nd Workshop on Representation Learning for NLP, pages 157-167, Vancouver, Canada. Association for Computational Linguistics. +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. +Hiroki Shimanaka, Tomoyuki Kajiwara, and Mamoru Komachi. 2018. RUSE: Regressor using sentence embeddings for automatic machine translation evaluation. In Proceedings of the Third Conference on Machine Translation: Shared Task Papers, pages 751-758, Belgium, Brussels. 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, Amir Kamran, Philipp Koehn, and Ondrej Bojar. 2015. Results of the WMT15 metrics shared task. In Proceedings of the Tenth Workshop on Statistical Machine Translation, pages 256-273, Lisbon, Portugal. Association for Computational Linguistics. + +Changhan Wang, Wei-Ning Hsu, Yossi Adi, Adam Polyak, Ann Lee, Peng-Jen Chen, Jiatao Gu, and Juan Pino. 2021a. faireq s^2: A scalable and integrable speech synthesis toolkit. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 143-152, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. + +Changhan Wang, Hirofumi Inaguma, Peng-Jen Chen, Ilia Kulikov, Yun Tang, Wei-Ning Hsu, Michael Auli, and Juan Pino. 2022. Simple and effective unsupervised speech translation. arXiv preprint arXiv:2210.10191. + +Changhan Wang, Morgane Riviere, Ann Lee, Anne Wu, Chaitanya Talnikar, Daniel Haziza, Mary Williamson, Juan Miguel Pino, and Emmanuel Dupoux. 2021b. Voxopuli: A large-scale multilingual speech corpus for representation learning, semi-supervised learning and interpretation. 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 993-1003. Association for Computational Linguistics. + +Changhan Wang, Anne Wu, Jiatao Gu, and Juan Pino. 2021c. Covost 2 and massively multilingual speech translation. In Interspeech, pages 2247-2251. + +Yinfei Yang, Daniel Cer, Amin Ahmad, Mandy Guo, Jax Law, Noah Constant, Gustavo Hernandez Abrego, Steve Yuan, Chris Tar, Yun-hsuan Sung, Brian Strope, and Ray Kurzweil. 2020. Multilingual universal sentence encoder for semantic retrieval. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics: System Demonstrations, pages 87-94, 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 International Conference on Learning Representations. + +# A Cross-Modal Data Analysis + +Considering that LASER can conveniently encode text and speech data into a shared embedding space, we conduct experiments involving both text and + +speech data with the text encoders from Heffernan et al. (2022) for BLASERs. In particular, we embed the source input, translation output, and reference using either the speech or text LASER encoders. That is, a data instance formed by embeddings from speech data will result in four instances in this new setting due to different modality combinations. We then evaluate the models on the speech data in our test set. The results in Table 7 show that combining supervision from different modalities does not help improve model performance. It is likely because the embedding space is shared between text and speech and therefore adding textual embeddings do not provide extra information. + +# B Cross-Modal Supervision Analysis + +We also look into the benefits of leveraging speech embeddings by comparing several supervised configurations for $\mathrm{BLASER_s}$ . We report these results in Table 8 where we experiment with different modality combinations during training and testing. The results show that the best results on average are the ones using speech modality for the source input, translation output, and reference. Interestingly, every time that we replace speech with text in the modality combinations, we see performance drops. We find that replacing reference speech segment with text leads to the slightest performance drop, which is likely due to the fact that they are synthesized and thus do not provide extra information than text. We also find that replacing speech data with text for the source input and translation output makes $\mathrm{BLASER_s}$ similar or even worse than ASR-COMET_retrained with WMT, confirming the benefits of using speech data for evaluation S2ST systems. + +# C Cross-Modal Evaluation Analysis + +We additionally evaluate $\mathrm{BLASER_s}$ on different modality combinations when training on speech data only. See the results in Table 9. We find that training on speech data only still allows BLASER to obtain similar performance when replacing the reference speech segments with text. + +# D Human Evaluation + +We provide instructions for human evaluations in Table 10. + +
es→enru→enhk→enfr→enen→deen→esen→fraverage
Speech-only0.57740.53470.60590.57300.32970.75120.71460.5838
Combined0.57910.52950.59880.54590.33480.74560.70370.5767
+ +Table 7: Pearson's correlation on the test set. Best results are in bold. We compare $\mathrm{BLASER}_{\mathrm{s}}$ when training with speech data only and training with both speech and text data. For testing, we always evaluate models on speech data. + +
Modalitieses→enru→enhk→enfr→enen→deen→esen→fraverage
(Speech,Speech,Speech)0.57740.53470.60590.57300.32970.75120.71460.5838
(Speech,Speech,Text)0.55410.51640.57540.54250.36750.74850.66880.5676
(Speech,Text,Text)0.54600.48660.56160.47410.33930.73720.62850.5390
(Text,Text,Text)0.45550.40940.53500.45050.27100.65440.58820.4806
+ +Table 8: Pearson's correlation on the test set. Best results are in bold. $(x,y,z)$ indicates the modality used for source input $(x)$ , translation output $(y)$ , and reference $(z)$ . We train and evaluate BLASER $_s$ on the same modality combinations. + +
Modalitieses→enru→enhk→enfr→enen→deen→esen→ruaverage
(Speech, Speech, Speech, Speech)Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, Speech, SPESpeech, Speech, Speech (Text)0.5774 0.55880.5347 0.54030.6059 0.60930.5730 0.55870.3297 0.34260.7512 0.75000.7146 0.69780.5838 0.5796
+ +Table 9: Pearson's correlation on the test set. Best results are in bold. $(x,y,z)$ indicates the modality used for source input $(x)$ , translation output $(y)$ , and reference $(z)$ . We train BLASER $_s$ on speech data only and evaluate the model with references either in speech or text modalities. + +
Task DescriptionsYou will be provided with a pair of audio snippets. +The pair will be in two different languages. +Your task is to assess: (1) if audio1 is coherent; (2) if audio2 is coherent; and (3) how well the pair of audiosto correspond to each other on a scale from 1-5. +When rating semantic similarity, please ignore minor typos, grammatical errors, and pronunciation errors if they do not affect your understanding of the audio segments.
Rating Instructions1. The two sentences are not equivalent, do not share any details, but may be related as pertaining to similar or even different topics. +2. The two sentences are not equivalent, but share some details. However, some important information differs/is missing, which alters the intent/meaning. +3. The two sentences are mostly equivalent, but some unimportant details differ. +4. The two sentences are equivalent paraphrases of each other. They mean the same with no major or minor differences in meaning, despite potential differences in expression. +5. The two sentences are exactly and completely equivalent in meaning and usage expression (e.g., formality level, style, multiword expression)
+ +Table 10: Instructions for human evaluations. + +A For every submission: + +A1. Did you describe the limitations of your work? + +section of its own name + +A2. Did you discuss any potential risks of your work? + +Not applicable. Left blank. + +A3. Do the abstract and introduction summarize the paper's main claims? + +in abstract and introduction + +A4. Have you used AI writing assistants when working on this paper? + +Left blank. + +B Did you use or create scientific artifacts? + +section 3 and 4 + +B1. Did you cite the creators of artifacts you used? + +section 3 and 4 + +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? + +we are going to share our code and license details after anonymity period + +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +section 4 and 5 + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? + +we are relying on an external dataset, we refer to the sources for those details + +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? + +section 4 reports coverage of domains and languages + +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. + +section 4 + +C Did you run computational experiments? + +section 4 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +section 4 + +The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? section 4 +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? section 4 and 5 +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? section 4 + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? section 5 appendix B + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? appendix B +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? section 5 +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? ethics section +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? it is quite standard protocol in the community +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? for the small annotation in appendix B, we relied on volunteers that do not necessarily want to share this info \ No newline at end of file diff --git a/blaseratextfreespeechtospeechtranslationevaluationmetric/images.zip b/blaseratextfreespeechtospeechtranslationevaluationmetric/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..262869559c869f07623097ea7927ba42d0cb62e1 --- /dev/null +++ b/blaseratextfreespeechtospeechtranslationevaluationmetric/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c174aea0c5e9d556a1d0bcc26b27eb875cc8baa044d3177df48912fe02d4281 +size 593219 diff --git a/blaseratextfreespeechtospeechtranslationevaluationmetric/layout.json b/blaseratextfreespeechtospeechtranslationevaluationmetric/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..428693d221df215c916763532f349aa0af566a94 --- /dev/null +++ b/blaseratextfreespeechtospeechtranslationevaluationmetric/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eea8f793e2f35fc608be8d91bad6e6017a75a2bd613522271f5f36a7aa216acc +size 485324 diff --git a/bleurthasuniversaltranslationsananalysisofautomaticmetricsbyminimumrisktraining/17b5d5d3-6212-451e-9c96-f3cb5614db51_content_list.json b/bleurthasuniversaltranslationsananalysisofautomaticmetricsbyminimumrisktraining/17b5d5d3-6212-451e-9c96-f3cb5614db51_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..b8a768e6e846b4a26aa664a5e9c41b572c51ca64 --- /dev/null +++ b/bleurthasuniversaltranslationsananalysisofautomaticmetricsbyminimumrisktraining/17b5d5d3-6212-451e-9c96-f3cb5614db51_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:249f415077780f6e3b04e94e23219f9cac9142a11622b363a1e3f99eae2dff90 +size 111352 diff --git a/bleurthasuniversaltranslationsananalysisofautomaticmetricsbyminimumrisktraining/17b5d5d3-6212-451e-9c96-f3cb5614db51_model.json b/bleurthasuniversaltranslationsananalysisofautomaticmetricsbyminimumrisktraining/17b5d5d3-6212-451e-9c96-f3cb5614db51_model.json new file mode 100644 index 0000000000000000000000000000000000000000..5e25df1d848328019b7e7b454301fb6face02c16 --- /dev/null +++ b/bleurthasuniversaltranslationsananalysisofautomaticmetricsbyminimumrisktraining/17b5d5d3-6212-451e-9c96-f3cb5614db51_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:12dfba295eade8492628afa55fe3de117e4fcdb86f4f3916108b2ecec1ba66be +size 132198 diff --git a/bleurthasuniversaltranslationsananalysisofautomaticmetricsbyminimumrisktraining/17b5d5d3-6212-451e-9c96-f3cb5614db51_origin.pdf b/bleurthasuniversaltranslationsananalysisofautomaticmetricsbyminimumrisktraining/17b5d5d3-6212-451e-9c96-f3cb5614db51_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9799bd2b4b282f18e8fce7386e93fe6dd66e6be1 --- /dev/null +++ b/bleurthasuniversaltranslationsananalysisofautomaticmetricsbyminimumrisktraining/17b5d5d3-6212-451e-9c96-f3cb5614db51_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:521b1f621276c1967f2e9a74ea47b6919744cd29e43bb023816dec05a2f978cd +size 1636906 diff --git a/bleurthasuniversaltranslationsananalysisofautomaticmetricsbyminimumrisktraining/full.md b/bleurthasuniversaltranslationsananalysisofautomaticmetricsbyminimumrisktraining/full.md new file mode 100644 index 0000000000000000000000000000000000000000..20a1806bd1d7be4ba2f6d455693b5b84d317d8f7 --- /dev/null +++ b/bleurthasuniversaltranslationsananalysisofautomaticmetricsbyminimumrisktraining/full.md @@ -0,0 +1,454 @@ +# BLEURT Has Universal Translations: An Analysis of Automatic Metrics by Minimum Risk Training + +Yiming Yan $^{1*}$ , Tao Wang $^{2}$ , Chengqi Zhao $^{2}$ , Shujian Huang $^{1\dagger}$ , Jiajun Chen $^{1}$ , Mingxuan Wang $^{2}$ + +$^{1}$ National Key Laboratory for Novel Software Technology, Nanjing University, China + +2 ByteDance AI Lab, China + +yanym@smail.nju.edu.cn, {huangsj, chenjj}@nju.edu.cn + +{wangtao.960826, zhaochengqi.d, wangmingxuan.89}@bytedance.com + +# Abstract + +Automatic metrics play a crucial role in machine translation. Despite the widespread use of n-gram-based metrics, there has been a recent surge in the development of pre-trained model-based metrics that focus on measuring sentence semantics. However, these neural metrics, while achieving higher correlations with human evaluations, are often considered to be black boxes with potential biases that are difficult to detect. In this study, we systematically analyze and compare various mainstream and cutting-edge automatic metrics from the perspective of their guidance for training machine translation systems. Through Minimum Risk Training (MRT), we find that certain metrics exhibit robustness defects, such as the presence of universal adversarial translations in BLEURT and BARTScore. In-depth analysis suggests two main causes of these robustness deficits: distribution biases in the training datasets, and the tendency of the metric paradigm. By incorporating token-level constraints, we enhance the robustness of evaluation metrics, which in turn leads to an improvement in the performance of machine translation systems. Codes are available at https://github.com/powerpuffpomelo/fairseq_mrt. + +# 1 Introduction + +Automatic metrics are crucial for the training of machine translation models, as they can measure translation quality at low cost. Currently, the most widely used translation evaluation metric is still the n-gram-based BLEU (Papineni et al., 2002; Marie et al., 2021). However, it is acknowledged that BLEU, which relies on the surface-level vocabulary matching, exhibits significant limitations (Smith et al., 2016; Reiter, 2018; Mathur et al., 2020; Kocmi et al., 2021). For instance, BLEU fails to differentiate between errors of varying severity and assigns equal weight to each word. + +
hypo:Lage vom Hotel war grundsätzlich bestens – Hotelpersonalweitgehend zuvorkommend bzw. ggf. hilfeilfsbereit. Vor allem die Lage des Hotels war gut, Hotelmitarbeiter grundsätzlich äußertstlieb bzw. gegebenenfalls auch durchaus hilfeilfsbereit.
+ +ref: 123 BLEURT: 0.8693 ref: a BLEURT: 0.8970 + +ref: May the sunshine always be with you. BLEURT: 0.8341 + +Figure 1: An example of a universal adversarial translation of BLEURT. hypo means the translation sentence and ref means the reference sentence. BLEURT needs to compare hypo and ref to judge the quality of hypo. This figure shows that the universal translation can achieve high BLEURT scores when calculated with each ref, even if hypo and ref are completely unrelated. + +In recent years, the advent of pre-trained models (Devlin et al., 2018; Liu et al., 2019; Conneau et al., 2019; Yang et al., 2019; Lan et al., 2019) has led to significant advancements in the development of metrics such as BLEURT (Sellam et al., 2020) and COMET (Rei et al., 2020), which employ pretrained language models (PLM) to assess the semantic meaning of sentences. These approaches have been shown to outperform metrics that rely on superficial word matching and have a more consistent correlation with human annotation. Despite these advances, it is important to note that neural metrics are characterized by opaque decision bases and may be subject to biases that are more difficult to detect (Sun et al., 2022). Therefore, we aim to conduct an analysis of the properties of various metrics in order to gain a deeper understanding. While there have been recent studies on the analysis of metrics (Kocmi et al., 2021; Hanna and Bojar, 2021; Sun et al., 2022), these works primarily focus on examining metric scores on specific datasets. To the best of our knowledge, this paper is the first to analyze metrics from the perspective of their guidance for training machine translation systems. + +In this paper, we employ Minimum Risk Training (MRT) (Shen et al., 2015) to train translation + +
MetricsSupervisedParadigmBased PLMConsidered input forms
BLEU✘Match-<hyp, ref>
BERTScore✘MatchRoBERTa / BERT<hyp, ref>
BARTScore✘GenerationBART< hyp, ref> / <src, hyp>
BLEURT✓RegressionBERT< hyp, ref>
COMET✓RegressionXLM-RoBERTa< hyp, src, ref>
UniTE✓RegressionXLM-RoBERTa< hyp, ref> / <hyp, src, ref>
+ +Table 1: Summary of metrics considered in this paper. + +models. Compared to Maximum Likelihood Estimation (MLE), MRT can reduce the gap between training and evaluation, resulting in higher quality translations (Shen et al., 2015; Edunov et al., 2017). In addition, since MRT uses metrics to optimize translation models, we can explore the impact of metrics on translation by observing the MRT training process. + +Our experiment results show that MRT reveals the robustness defects in some metrics: the training collapses and the generated translations, despite getting high metric scores, show poor translation quality. For instance, we find universal adversarial translations of BLEURT and BARTScore, which are capable of obtaining high scores when evaluated against any reference sentence. An example is presented in Figure 1. Further analysis shows that the robustness defects are rooted in the distribution biases of the training corpora, as well as in the tendency of the metric modeling paradigm. In addition, we explore methods for optimizing metrics and translation models: word-level information constraints are introduced by combining MRT with NLL loss and metric ensemble. + +Our main contributions are as follows: + +- We present a systematic analysis of automatic metrics for machine translation from the perspective of guidance for training machine translation systems. +- We provide analytical conclusions, including metric robustness deficiencies, as well as an analysis of the underlying causes. +- We explore methods to improve metric robustness and translation quality and demonstrate their effectiveness. + +# 2 Analyze Metrics with MRT + +We train translation models in two stages: in the MLE training phase, the model is trained with con + +ventional negative log-likelihood (NLL) loss; then in the MRT training phase, we fine-tune the model with each metric, so as to obtain translation models with various metric styles. In this way, the characteristics of different metrics can be analyzed through observing the changes in the training process and the translation results. + +# 2.1 Considered metrics + +Given the translated sentence $hyp$ , the automatic evaluation metric evaluates $hyp$ by comparing it with the reference sentence $ref$ (and sometimes with the source sentence $src$ ). This paper selects the most mainstream and cutting-edge six metrics for comparison and analysis, including three unsupervised metrics: BLEU (Papineni et al., 2002), BERTScore (Zhang et al., 2019), BARTScore (Yuan et al., 2021), and three supervised metrics: BLEURT (Sellam et al., 2020), COMET (Rei et al., 2020), UniTE (Wan et al., 2022). The specific information is shown in Table 1. + +We use SacreBLEU $^1$ and F1-score $^2$ as a measure of text quality to calculate BLEU and BERTScore respectively. Following the instructions of Yuan et al. (2021), we use the CNNDM version of BARTScore $^3$ to calculate the F1-score of $\langle \text{hyp}, \text{ref} \rangle$ for translate-to-English language pairs, and multilingual BART to obtain the faithfulness by calculating $P(\text{hyp} \mid \text{src})$ for the other language pairs. As recommended, we use BLEURT-20 $^4$ and WMT20-COMET-MQM $^5$ to compute BLEURT and COMET respectively. For UniTE, since our task is multilingual, we use UniTE-MUP $^6$ in our experiments. It is worth noting that, for a fair comparison, we consider two input forms of + + +$^{2}$ https://github.com/Tiiger/bert_score +3https://github.com/neulab/BARTScore +4https://github.com/google-research/bleurt +5https://github.com/Unbabel/COMET +$^{6}$ https://github.com/NLP2CT/UniTE + +
TrainValidTest
En↔De4.3M30003003
En↔Zh1.3M17974534
En↔Fi2.5M25002507
+ +Table 2: Statistics of datasets on three language pairs. + +UniTE: one uses $\langle \text{hyp}, \text{ref} \rangle$ to calculate the translation quality, which we denote as UniTE_ref; the other uses $\langle \text{src}, \text{hyp}, \text{ref} \rangle$ , which we denote as UniTE_src_ref. + +# 2.2 Minimum Risk Training + +Minimum Risk Training (MRT) is a sequence-level objective that aims to minimize the expected risk on the training data. Given a training set $\mathcal{D} = \{(x,y)\}$ , MRT uses the loss function $\Delta (\hat{y},y)$ to compute the discrepancy between the ground truth $y$ and the model prediction $\hat{y}$ . + +Different from conventional MLE training methods, MRT allows the use of arbitrary non-differentiable loss functions. Therefore, automatic metrics can be introduced to train machine translation systems. While an MLE-trained model may not translate authentically, MRT can produce more natural translation results by reducing the gap between training and evaluation (Shen et al., 2015; Edunov et al., 2017; Wang and Sennrich, 2020). + +In MRT training, risk is defined as the expected loss with respect to the posterior distribution: + +$$ +\mathcal {R} (\theta) = \sum_ {(\mathrm {x}, \mathrm {y}) \in \mathcal {D}} \sum_ {\hat {\mathrm {y}} \in \mathcal {Y} (\mathrm {x})} P (\hat {\mathrm {y}} | \mathrm {x}; \theta) \Delta (\hat {\mathrm {y}}, \mathrm {y}) \tag {1} +$$ + +in which $\mathcal{Y}(\mathbf{x})$ is the set of all possible translations of $\mathbf{x}$ . Since the full search space is intractable, we choose a certain number of candidate translations as a subset to approximate the posterior distribution. + +# 2.3 Experiment Setup + +Dataset With reference to datasets and language pairs that are widely used in machine translation and neural metrics studies, we conduct experiments on six language directions: English-German (En\L $\Rightarrow$ De), English-Chinese (En\L $\Rightarrow$ Zh), English-Finnish (En\L $\Rightarrow$ Fi). We use the WMT14 training corpus for En\L $\Rightarrow$ De, and the newstest13 and newstest14 are the validation set and the test set, respectively. For En\L $\Rightarrow$ Zh, we use the LDC corpus as training data, and the NIST 2002, 2003 are used for validation, while NIST 2004, 2005, 2006 are + +used as the test sets. For $\mathrm{En} \Leftrightarrow \mathrm{Fi}$ , the datasets are from the training-parallel-ep-v8 and rapid2016 sections of WMT17, where the validation set and the test set are split at a rate of $0.1\%$ respectively. The statistics of the datasets are shown in Table 2. + +Implantation Details We train Transformer Base setting (Vaswani et al., 2017) using the faireq toolkit, where the model consists of 6 layers of encoder and 6 layers of decoder with hidden size of 512. In the MLE training phase, the batch size is 65,536. The best checkpoint is selected based on the BLEU scores on the validation set. For evaluation, we average the last ten checkpoints and use beam search for inference. In the MRT training phase, each batch contains 8,000 tokens. Following previous work on MRT (Edunov et al., 2017), we use beam search to generate candidates, and the beam size is set to 12. The best checkpoint is selected based on the corresponding metric. We list the training duration for MLE and MRT in Appendix B. For all language pairs, sentences are encoded using byte pair encoding (Sennrich et al., 2015) with 32,000 merge operations, jointly learned from both the source and target side of the training data. We use Adam (Kingma and Ba, 2014) optimization and the same learning rate schedule as described in Vaswani et al. (2017) with the warm-up step of 4,000. + +# 2.4 Main Results + +The MLE stage is the main factor in improving translation performance of the model, whereas MRT fine-tuning directs the model towards specific metrics. The SacreBLEU scores of the translation models after MLE training are shown in Table 3. Then in the MRT fine-tuning phase, we use six metrics separately on each language pair to guide the training. Figure 2 shows the evaluation results of the translations by optimizing each metric on $\mathrm{Zh} \Rightarrow \mathrm{En}$ during this phase8. + +We investigate the changes in the MRT curve for each metric and language pair. The remaining of the metrics generally improve along with the optimized metrics, followed by a slight decrease, indicating that there are differences in the quality evaluation criteria of different metrics. In general, all metrics remain basically stable during the MRT + +
En⇒DeDe⇒EnEn⇒ZhZh⇒EnEn⇒FiFi⇒En
MLE Training28.431.437.245.428.738.1
+ +Table 3: SacreBLEU scores on the test sets obtained by training Transformer-base with MLE. + +![](images/0d987dacc1530cde38a56c3ee3fc81e8e100345a566a42b54eddf8199ecc39a1.jpg) +Figure 2: The training process of MRT optimized by each metric on $\mathrm{Zh} \Rightarrow \mathrm{En}$ . The horizontal axis represents the training steps, and the vertical axis is the score of each metric (except for BARTScore on the right axis, which is a negative number because it calculates the logarithmic probability of translations); metrics other than BARTScore and BLEU are mostly distributed between 0 and 1, and we multiply them uniformly by 100 for ease of observation. The asterisk represents the highest value achieved by the optimized metric. + +process. + +However, we find several exceptions, such as optimizing BLEURT on the $\mathrm{En} \Rightarrow \mathrm{De}$ and $\mathrm{En} \Rightarrow \mathrm{Zh}$ language pairs, where the rest of the metrics experience a severe drop. As shown in Table 4, BLEURT remains basically stable, but the rest of the metrics drop to particularly low or even negative values. The same situation occurs when optimizing BARTScore, as shown in Table 4 and Figure 2. + +MRT Exposes the Robustness Defects of Metrics We find deficiencies in some metrics when MRT collapses. For example, we find that there are universal adversarial translations in both BLEURT and BARTScore. + +(1) Universal translations of BLEURT. We take the checkpoint of the translation model on $\mathrm{En} \Rightarrow \mathrm{De}$ where BLEURT reaches the highest point to generate translations on the test set. The decoded results show that the translation quality does indeed collapse severely. Table 5 shows the two most frequently decoded translations. It can be seen that the translation model generates many similar sentences with high frequency, regardless of the source sentences. This shows that decoding such sentences can get high BLEURT scores. The example of calculating the BLEURT scores of universal translations is also shown in Figure 1. +(2) Universal translations of BARTScore. We also generate translations with the checkpoint on $\mathrm{De} \Rightarrow \mathrm{En}$ which gets highest BARTScore. As shown in Table 5, the translation model also decodes many + +similar sentences, but unlike BLEURT, the form of the high-frequency decoded sentences is only repetition of simple words. + +The phenomenon of universal adversarial translations shows that BLEURT and BARTScore are flawed, and a high metric score does not mean high translation quality. If the metric is not good enough, it actually leads the translation model in the wrong direction. + +# 2.5 Analysis + +# 2.5.1 Why Universal Translations Exist + +We examine the WMT14 En $\Leftrightarrow$ De parallel corpora, and find that there are many sentences with similar semantics in the training set, including a large corpus of hotel reviews that are semantically similar to universal translations of BLEURT $^{9}$ . This indicates that the patterns of universal translations are related to the translation training set, and they come from the high frequency samples in the training corpora. Raunak et al. (2021) also mentions the problem of corpus bias, whose study on NMT hallucinations shows that specific noise patterns in the training corpora lead to specific hallucination patterns. Due to high frequency samples in the translation training set, it becomes easy for the translation model to decode certain sentences (even if they have nothing to do with the source sentences). + +Moreover, the high score of the metric condones the model to decode such sentences, leading to + +
Optimized MetricChange Range of Metrics During MRT on En⇒De
BLEUBERTScoreBARTScoreBLEURTCOMETUniTE_refUniTE_src_ref
BLEU0.00%0.00%0.00%0.00%0.00%0.00%0.00%
BERTScore0.70%0.69%-0.24%0.71%4.61%4.31%3.98%
BARTScore-100.00%-176.84%92.15%-79.78%-574.39%-397.07%-385.80%
BLEURT-100.00%-107.48%-20.33%14.96%-435.00%-423.12%-408.72%
COMET-14.79%-3.01%-0.92%1.65%13.38%10.86%9.90%
UniTE_ref-31.69%-11.51%-3.12%-0.37%2.66%19.11%18.06%
UniTE_src_ref-39.08%-15.27%-4.16%-2.39%-4.28%21.99%21.72%
+ +Table 4: The change range of all metrics when one metric is optimized to the highest value during MRT on $\mathrm{En} \Rightarrow \mathrm{De}$ . $0.00\%$ means that the optimized metric does not continue to improve, and the highest value remains the same as the result of MLE training; a negative number means that the metric score goes from positive to negative, which means it decreases a lot. (For the results of the remaining five language directions, see Appendix D) + +
FrequencyDecoded Translations with Top2 Frequency
Optimize BLEURT onEn⇒De689Lage vom Hotel war grundsätzlich bestens Hotelpersonal weltgehend zuvorkommend bzw. ggf. hilfehilfsbereit. Vor allem die Lage des Hotels war gut, Hotelmitarbeitergrundsatzlich äußert lieb bzw. gegebenenfalls auch durchaus hilfehilfsbereit.
386Lage vom Hotel war grundsatzlich bestens HotelPersonal weltgehend zuvorkommend bzw. ggf. hilfehilfsbereit. Vor allem die Lage des Hotels war gut, Hotelmitarbeitergrundsatzlich äußert lieb bzw. gegebenenfalls auch durchaus hilfehilfsbereit.
OptimizeBARTScore onDe⇒En141! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! +Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorca! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Mallorda! Pallorda! Pallorda! Pallorda! Pallorda! Pallorda! Pallorda! Pallorda! Pallorda! Pallorda! Pallorda! Pallorda! Pallorda! Pallorda! Pallorda! Pallorda! Pallorda! Pallorda! Pallorda! Pallorda! Pallorda! Pallorda! Pallorda! Pallorda! Pallorda! Pallorda! Pallorda! Pallorda! Pallorda! Pallorda! Pallorda! Pallorda! Pallorda! Pallorda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palluda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda! Palldda:Mallorca!Mallorca!Mallorca!Mallorca!Mallorca!Mallorca!Mallorca!Mallorca!Mallorca!Mallorca!Mallorca!Mallorca!Mallorca!Mallorca!Mallorca!Mallorca!Mallorca!Mallorca!Mallorca!Mallorca!Mallorca!Mallorca!Mallorca!Mallorca!Mallorca!Mallorca:Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda:Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallnda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallnda?Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda?Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallnda? +Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda;Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda +Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda: +Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!Mallenda!
+ +Table 5: Examples of decoded translations of BLEURT and BARTScore. Due to space limitations, only the top2 frequency translations are listed. + +the creation of universal translations. BLEURT uses metric data and generates a large amount of pseudo-data for supervised training, and the metric data comes from the translation training corpus. Since data augmentation may introduce noise and amplify hallucinations (Raunak et al., 2021), we suggest that its indulgence of universal translations is also related to the training corpus. + +The universal translations of BARTScore contain repetitions of simple words, which is similar to the hallucination phenomena that occurs in the early stages of translation model training. We not only use the $F1$ score, but also experiment with the Recall of BARTScore (computing $P(ref|hyp)$ ) to guide the training, and find that this setting can produce universal suffixes, that is, even if the correct translation is followed by a specific suffix, it does not reduce the BARTScore. Therefore, we suggest that the vulnerability of BARTScore may be due to the fact that it uses model generation probabilities to determine translation quality, and this generation-based metric tends to assign high scores to easily generated sentences. In short, the defects may stem from the tendency of the metric + +modeling paradigm 10. + +The phenomenon of universal adversarial translations suggests that, on the one hand, we need to optimize the translation and metric datasets to balance their distributions, avoiding high-frequency samples; on the other hand, we need to optimize the metrics so that they are as little affected by the distribution bias of the dataset as possible. For example, sentence-level metrics can be constrained by incorporating word-level information. We present this experiment in Section 3. + +# 2.5.2 Comparison of Metrics + +We observe and compare the changes in the training effect of translation models guided by each metric on each language pair, and the summary is as follows: + +BLEU converges quickly. This is as expected, since the translation model is selected by BLEU in the general MLE training phase, there is almost no continuous optimization during MRT. BERTScore also converges in a few steps. When BERTScore is optimized, other metrics remain relatively stable + +and sometimes show an upward trend. + +The consistency between BLEURT and other metrics shows language pair differences: for translate-to-English language pairs, the other metrics change steadily and show high consistency with BLEURT. All three to-En language pairs show an increase in COMET, UniTE_ref, and UniTE_src_ref. However, on the language pairs that translate from English, the consistency becomes very poor, where the other metrics drop significantly when optimizing translation models with BLEURT. + +The metric that is least consistent with other metrics is BARTScore. On all language pairs, the rest of the metrics decrease when BARTScore is used to train translation models. + +COMET, UniTE_ref, and UniTE_src_ref are similar and can improve each other. However, when optimizing with these metrics, a decrease in BLEU is observed for all language pairs. This may indicate that the translation model is gradually trained to be more inclined towards translations that are semantically close to the reference sentences, but the specific words may not be the same. In addition, other metrics also show a smooth trend of change, indicating that these metrics may be superior and more robust. + +![](images/92c1c9a3076ba10e2d0f6cb0d6cc34c1638604c053f8e2a05dcf74533dd5b30d.jpg) +Figure 3: Pairwise correlation of metrics on translate-to-English language pairs. All metrics are significantly positively correlated $(p < 0.001)$ . Ignoring self-relevance, the correlations between COMET and UniTE, BLEURT and BERTScore are particularly strong. + +Same Pre-trained Model Leads to Similar Metrics. We also find a pattern that metrics that are based on the same pre-trained model have similar + +trends in the variation of the training effect of MRT. We count the pairwise correlation of each metric, and find that the correlation between BERTScore and BLEURT (both based on BERT), and the correlation between COMET and UniTE (both based on XLM-Roberta) are higher than other metric pairs for translate-to-English language pairs, as shown in Figure 3. For language pairs translated from English, the robustness bias of BLEURT weakens its correlation with BERTScore, but the Pearson correlation coefficient still reaches 0.82 and is significantly correlated. This indicates that metrics based on the same pre-trained model have more consistent criteria for the evaluation of translation quality. + +Robust Metrics can Drive Improvement in Other Metrics. MRT experiments show that the optimization process of BARTScore as well as BLEURT (on translation-from-English language pairs) is accompanied by a strong decrease of the other metrics, and we find metric robustness deficits in these cases. Therefore, we suggest that robust metrics may drive other metrics to improve together during MRT. (However, the converse inference does not hold. The ability to drive other metrics to improve is not sufficient to conclude that the metrics are robust enough, because metrics may have common deficits that have not yet been discovered.) + +# 3 Optimize Metrics and Translations + +The analysis of the MRT training process allows us to understand the impact of each metric on translation quality. Our goal is both to exploit the advantages of the MRT training approach and to avoid training collapse due to the robustness deficiencies of the metrics. + +MRT needs to sample many translation sentences in advance, and then use sentence-level metrics to predict the scores and calculate the loss. If the metrics that guide translation training do not take word-level information into account, the translation model may ignore details and gradually deviate during the training process. Therefore, we try two methods to constrain the training direction by introducing word-level constraints: combining MRT and NLL loss, and doing metrics ensemble. + +![](images/02d03bed3d06046c391659a0b81dd7e6b0b5725491b0ad12ddbe7125fa7e8e98.jpg) +(a) Metrics Ensemble + +![](images/f6df8c8fd2502e87f15590c4ed0c70b7963a142fdd0b0dadaf02262e647bae71.jpg) +(b) Combine MRT and NLL Loss +Figure 4: This figure displays two improvement strategies ( metrics ensemble and modifying loss), with each color representing a different training approach. The figure is divided into seven groups from left to right, representing the range of change in each metric after training with a particular approach. For instance, the green bar represents the impact of utilizing BLEURT to guide translation model training in MRT, where only BLEURT improves while the other metrics decline significantly (we only display the range of -20% to 20%), which is consistent with the previous charts. + +# 3.1 Combine MRT and NLL Loss + +# 3.1.1 Experiments + +We take the fine-grained word-level similarity as a part of the objective function by incorporating the NLL loss, which computes the $\log$ loss for each token. We set the hyperparameter $\lambda_{MRT}$ to control the weights. The formula is as follows: + +$$ +\mathcal {L} = \lambda_ {M R T} * \mathcal {L} _ {M R T} + (1 - \lambda_ {M R T}) * \mathcal {L} _ {N L L} \tag {2} +$$ + +We take the MRT training effect of the translation model optimized with BLEURT on $\mathrm{En} \Rightarrow \mathrm{De}$ as an example to conduct experiments. + +# 3.1.2 Results + +The results are shown in Figure 4 (b). As can be seen, as the proportion of NLL loss increases, the decreasing trend of the remaining metrics gradually disappears. + +The optimal result can be achieved when $\lambda_{MRT} = 0.6$ or 0.4. At this point, unsupervised metrics remain stable, and supervised metrics show an increase. This indicates that combining MRT and NLL loss can improve the training effect of + +the translation model. For a fair comparison, we also check the results at the beginning of the optimization when using only MRT (before the training collapses). At this point, the improvement in BLEURT, COMET and UniTE is more obvious, but accompanied by a decrease in BLEU and BERTScore. This suggests that the inclusion of NLL loss can make training more stable and more balanced across all metrics. + +# 3.2 Metrics Ensemble + +# 3.2.1 Experiments + +Supervised metrics focus more on high-level semantic similarity and are considered to have a higher correlation with human evaluation (Kocmi et al., 2021); while unsupervised metrics using word-level information are relatively stable and can ensure fine-grained text similarity $^{11}$ . + +We do an ensemble of different metrics in the hope that the integrated metrics can complement each other and integrate the advantages of different + +metrics. Then the ensemble metric is applied to MRT training on $\mathrm{En} \Rightarrow \mathrm{De}$ . + +# 3.2.2 Results + +Supervised and Unsupervised Metrics Ensemble. As can be seen in Figure 4 (a), optimizing BERTScore alone does not change the remaining metrics much, while only optimizing BLEURT reveals robustness problems. However, optimizing the ensemble of BERTScore and BLEURT works well: not only does it preserve the performance of the unsupervised metrics as much as possible, but it also leads to significant improvements in COMET and UniTE. + +Supervised Metrics Ensemble. In addition, combining two sentence-level supervised metrics can also provide a boost, as the fifth column of Figure 4 (a) shows the effect of integrating BLEURT and COMET. Compared to optimizing only a single metric, we find that the ensemble metric can build on the strengths of both metrics. While maintaining the scores of unsupervised metrics, it can further improve supervised metrics. COMET and UniTE all improve about $14.5\%$ , which is an increase of about 7 points. We suggest that this may be due to the fact that different metrics have different criteria for evaluating translation quality, and the robustness deficiency of one metric can be compensated by other metrics. + +# 3.3 Method Validity Analysis + +Avoid High-Frequency Decoding Sentences. We compare the entropy of decoded sentence frequencies on the $\mathrm{En} \Rightarrow \mathrm{De}$ test set for the translation model trained with single or ensemble metrics. As shown in Table 6, the entropy is lower for the model trained with only BLEURT because it decodes a large number of identical sentences. While the frequency entropy for models trained with ensemble metrics is similar to that of the gold translations, indicating that the phenomenon of high-frequency decoded sentences disappears. + +Comparison to MBR Decoding. Minimum Bayes Risk (MBR) decoding can also get translations with metric style (Freitag et al., 2022; Müller and Sennrich, 2021). Both MRT and MBR add some computational cost because they need to sample candidate translation sentences. However, MRT is a training process that can quickly generate translations at test time once the model has finished training. MBR, on the other hand, is a decoding + +
SystemEntropy
Ref11.55
Hyp (Only BLEURT)6.58
Hyp (BLEURT + BERTScore)11.55
Hyp (BLEURT + COMET)11.55
+ +Table 6: The entropy of decoded sentence frequencies on the $\mathrm{En} \Rightarrow \mathrm{De}$ test set. Ref is the gold translation. Low entropy means that the translation model is damaged and decodes many identical sentences. + +process, which requires more time for each decoding. Therefore, from an application point of view, MRT is more efficient. + +# 4 Related Work + +Automatic Metrics Traditional metrics for machine translation evaluation including BLEU (Papineni et al., 2002), METEOR (Lavie and Denkowski, 2009), and chrF (Popovic, 2015) are based on lexical overlap. Embedding-based metrics measure the semantic equivalence between the reference and translation hypothesis by contextual representation, such as BERTScore (Zhang et al., 2019), MoverScore (Zhao et al., 2019). Generation-based metrics formulate the evaluation of text as a generation task, such as BARTScore (Yuan et al., 2021) and PRISM (Thompson and Post, 2020). The basic idea is that high quality text can be generated with high probability. Learned metrics, such as BLEURT (Sellam et al., 2020), COMET (Rei et al., 2020), and the recently proposed UniTE (Wan et al., 2022) aim to train neural networks to directly predict human judgements. These supervised metrics correlate well with human evaluations, but lack interpretability and robustness studies, which is explored by this paper. + +Minimum Risk Training Shen et al. (2015) proposes the MRT method and confirms its superiority with experiments. Edunov et al. (2017) compares various objective functions and further verifies that MRT training can enhance translation quality. Wang and Sennrich (2020) uses MRT to avoid exposure bias, thus improving translation quality in out-of-domain settings. The above MRT work uses BLEU to guide the training of translation models, but BLEU is not the optimal metric. Our work uses various cutting-edge metrics to further improve translation quality. Wieting et al. (2019) proposes a new metric, claiming its superiority over BLEU and suitability for MRT training. Our work, + +on the other hand, focuses on the analysis of metrics, with MRT serving as a tool to evaluate the robustness of various metrics systematically. + +Metric Defects Analysis There are also some papers that start to explore the shortcomings of metrics. Sai et al. (2021) provides perturbation templates to measure the performance of metrics on the constructed challenge set, while our work is to guide the metrics to generate adversarial samples (universal translations) by themselves. Amrhein and Sennrich (2022) does a case study on COMET through MBR decoding, showing that COMET is insensitive to numbers and named entities. Different from a pure case study, our work shows the tendency of metrics through MRT, and can draw more typical conclusions. Sun et al. (2022) shows that PLM-based metrics, such as BERTScore, lack fairness and exhibit higher social bias than traditional metrics. Our work analyzes metrics from a robustness perspective and complements this work. + +# 5 Conclusion + +In this paper, we present the first systematic analysis of automatic metrics from the perspective of guidance for training machine translation systems. We find that MRT reveals the robustness deficiencies of some metrics, such as universal adversarial translations of BLEURT and BARTScore, and we further analyze the underlying causes. In addition, we explore methods to improve metric robustness, thus helping to further enhance the performance of translation systems. + +# Limitations + +First, we find robustness deficiencies in metrics by comparing the evaluation differences among metrics. This applies to the case when there are metrics that do not have the same robustness flaws. If there are more latent common defects in the metrics, they cannot be identified by MRT. We leave this topic for future research. + +Second, we use beam search to generate candidates during MRT training, but beam search is also known to have deficiencies. For example, beam search suffers from heuristic search biases and shifts statistics away from those of the data (Eikema and Aziz, 2020). Different decoding methods may have an impact on the experiment results. + +# Acknowledgements + +We would like to thank the anonymous reviewers for their insightful comments. Shujian Huang is the corresponding author. This work is supported by National Science Foundation of China (No. 62176120), the Liaoning Provincial Research Foundation for Basic Research (No. 2022-KF-26-02). + +# References + +Chantal Amrhein and Rico Sennrich. 2022. Identifying weaknesses in machine translation metrics through minimum bayes risk decoding: A case study for comet. arXiv preprint arXiv:2202.05148. +Alexis Conneau, Kartikay Khandelwal, Naman Goyal, Vishrav Chaudhary, Guillaume Wenzek, Francisco Guzmán, Edouard Grave, Myle Ott, Luke Zettle-moyer, and Veselin Stoyanov. 2019. Unsupervised cross-lingual representation learning at scale. arXiv preprint arXiv:1911.02116. +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. +Sergey Edunov, Myle Ott, Michael Auli, David Grangier, and Marc'Aurelio Ranzato. 2017. Classical structured prediction losses for sequence to sequence learning. arXiv preprint arXiv:1711.04956. +Bryan Eikema and Wilker Aziz. 2020. Is map decoding all you need? the inadequacy of the mode in neural machine translation. arXiv preprint arXiv:2005.10283. +Markus Freitag, David Grangier, Qijun Tan, and Bowen Liang. 2022. High quality rather than high model probability: Minimum bayes risk decoding with neural metrics. Transactions of the Association for Computational Linguistics, 10:811-825. +Michael Hanna and Ondrej Bojar. 2021. A fine-grained analysis of bertscore. In Proceedings of the Sixth Conference on Machine Translation, pages 507-517. +Diederik P Kingma and Jimmy Ba. 2014. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980. +Tom Kocmi, Christian Federmann, Roman Grundkiewicz, Marcin Junczys-Dowmunt, Hitokazu Matsushita, and Arul Menezes. 2021. To ship or not to ship: An extensive evaluation of automatic metrics for machine translation. arXiv preprint arXiv:2107.10821. +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. +Alon Lavie and Michael J Denkowski. 2009. The meteor metric for automatic evaluation of machine translation. Machine translation, 23(2):105-115. +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. +Benjamin Marie, Atsushi Fujita, and Raphael Rubino. 2021. Scientific credibility of machine translation research: A meta-evaluation of 769 papers. arXiv preprint arXiv:2106.15195. +Nitika Mathur, Timothy Baldwin, and Trevor Cohn. 2020. Tangled up in bleu: Reevaluating the evaluation of automatic machine translation evaluation metrics. arXiv preprint arXiv:2006.06264. +Mathias Müller and Rico Sennrich. 2021. Understanding the properties of minimum bayes risk decoding in neural machine translation. arXiv preprint arXiv:2105.08504. +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. +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. +Vikas Raunak, Arul Menezes, and Marcin Junczys-Dowmunt. 2021. The curious case of hallucinations in neural machine translation. arXiv preprint arXiv:2104.06683. +Ricardo Rei, Craig Stewart, Ana C Farinha, and Alon Lavie. 2020. Comet: A neural framework for mt evaluation. arXiv preprint arXiv:2009.09025. +Ehud Reiter. 2018. A structured review of the validity of bleu. Computational Linguistics, 44(3):393-401. +Ananya B Sai, Tanay Dixit, Dev Yashpal Sheth, Sreyas Mohan, and Mitesh M Khapra. 2021. Perturbation checklists for evaluating nlg evaluation metrics. arXiv preprint arXiv:2109.05771. +Thibault Sellam, Dipanjan Das, and Ankur P Parikh. 2020. Bleurt: Learning robust metrics for text generation. arXiv preprint arXiv:2004.04696. +Rico Sennrich, Barry Haddow, and Alexandra Birch. 2015. Neural machine translation of rare words with subword units. arXiv preprint arXiv:1508.07909. + +Shiqi Shen, Yong Cheng, Zhongjun He, Wei He, Hua Wu, Maosong Sun, and Yang Liu. 2015. Minimum risk training for neural machine translation. arXiv preprint arXiv:1512.02433. +Aaron Smith, Christian Hardmeier, and Jörg Tiedemann. 2016. Climbing mont bleu: the strange world of reachable high-bleu translations. In Proceedings of the 19th annual conference of the European association for machine translation, pages 269–281. +Tianxiang Sun, Junliang He, Xipeng Qiu, and Xuanjing Huang. 2022. Bertscore is unfair: On social bias in language model-based metrics for text generation. arXiv preprint arXiv:2210.07626. +Brian Thompson and Matt Post. 2020. Automatic machine translation evaluation in many languages via zero-shot paraphrasing. arXiv preprint arXiv:2004.14564. +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. Advances in neural information processing systems, 30. +Yu Wan, Dayiheng Liu, Baosong Yang, Haibo Zhang, Boxing Chen, Derek F Wong, and Lidia S Chao. 2022. Unite: Unified translation evaluation. arXiv preprint arXiv:2204.13346. +Chaojun Wang and Rico Sennrich. 2020. On exposure bias, hallucination and domain shift in neural machine translation. arXiv preprint arXiv:2005.03642. +John Wieting, Taylor Berg-Kirkpatrick, Kevin Gimpel, and Graham Neubig. 2019. Beyond bleu: training neural machine translation with semantic similarity. arXiv preprint arXiv:1909.06694. +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. +Weizhe Yuan, Graham Neubig, and Pengfei Liu. 2021. Bartscore: Evaluating generated text as text generation. Advances in Neural Information Processing Systems, 34:27263-27277. +Tianyi Zhang, Varsha Kishore, Felix Wu, Kilian Q Weinberger, and Yoav Artzi. 2019. Bertscore: Evaluating text generation with bert. arXiv preprint arXiv:1904.09675. +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. arXiv preprint arXiv:1909.02622. + +# A Ethics Statement + +This paper finds universal adversarial translations that can be used to attack metrics and lead to security risks. However, this paper also proposes methods to improve metric robustness to avoid this situation. + +# B Training Duration for MLE and MRT + +We list the training duration for MLE and MRT in Table 8 and Table 9, respectively. Table 8 shows the number of training epochs, while Table 9 shows the number of training steps. It can be seen that the training duration for MRT is much shorter than that for MLE. The improvement of translation performance of the model mainly lies in the MLE stage, while MRT fine-tuning makes the model inclined towards specific metrics. + +# C MRT Training Process Figures + +From Figure 5 to Figure 9, we can see how all metrics change when the translation model is optimized with each metric on different language pairs. From the trends of different metrics, we can observe the differences between the metrics and the impact of the metrics used for optimization on the translation model. + +In each figure, the horizontal axis represents the training steps, and the vertical axis is the score of each metric (except for BARTScore on the right axis, which is a negative number because it calculates the logarithmic probability of translations); metrics other than BARTScore and BLEU are mostly distributed between 0 and 1, and we multiply them uniformly by 100 for ease of observation. The asterisk represents the highest value achieved by the optimized metric. + +# D MRT Training Process Statistics + +Table 10 to Table 14 display the change range in all metrics when optimizing the translation model with a specific metric to the highest point across different language pairs. The results correspond to figures in Appendix C. $0.00\%$ means that the optimized metric does not continue to improve, and the highest value remains the same as the result of MLE training; a negative number means that the metric score goes from positive to negative, which means it decreases a lot. + +
Examples of Hotel Review Sentences from WMT14 En↔De
The location of the hotel was excellent. The room was clean and comfortable.
The room was clean and comfortable, the hotel was situated close to the center but in the tourist center. The food was excellent and the service second to none.
The location of the hotel is great, the atmosphere is quite pleasant, the staff is efficient and friendly, the room was clean and comfortable, the price was fair. In short words, everything was perfect.
The room was clean and comfortable.
the location of the hotel is ideal for sightseeing, the room was clean and comfortable, the staff were helpful.
The room was clean and comfortable. Staff friendly.
the employees were very helpful at all times the room was clean and comfortable and the restaurant was very nice.
The room was clean and comfortable and the staff friendly and courteous.
This is a great hotel .The room was clean and comfortable .With small budget but we have a comfortable stay .Good value, we will recommend this hotel for anyone looking for a hotel in Hanoi .
+ +Table 7: Examples of Hotel Review Sentences from WMT14 En $\Leftrightarrow$ De. + +# E High Frequency Samples + +Table 7 displays some hotel review examples in the WMT14 En $\Leftrightarrow$ De dataset, and the semantics are very similar to universal translations of BLEURT on $\mathrm{En}\Rightarrow \mathrm{De}$ . For ease of understanding, English is shown here. + +
En⇒DeDe⇒EnEn⇒ZhZh⇒EnEn⇒FiFi⇒En
MLE332832405536
MRTBLEU111111
BERTScore111111
BARTScore111111
BLEURT411111
COMET111111
UniTE_ref111111
UniTE_src_ref111111
+ +Table 8: Comparison of the number of epochs trained by MLE and MRT. The number of epochs for MLE is the epoch number trained until early stop, while the number of epochs displayed in MRT is the epoch number when the model is optimized to the highest metric score. + +
En⇒DeDe⇒EnEn⇒ZhZh⇒EnEn⇒FiFi⇒En
Steps in one epoch24032127792779291090610910
MLE16300061000510006400012600040000
BLEU050020010050
BERTScore10050250200250300
BARTScore19501900180014501050550
MRTBLEURT575010035005501400250
COMET550450500550800300
UniTE_ref400650750750600600
UniTE_src_ref600350700500800550
+ +Table 9: Comparison of training steps between MLE and MRT. The number of steps for MLE is the number of steps trained until early stop, while the number of steps displayed in MRT is the number of steps when the model is optimized to the highest metric score. + +![](images/28263914480562586c54d2f26dfe07b9a902cb0dfb202a1715584400909dc7ee.jpg) +Figure 5: The training process of MRT optimized by each metric on $\mathrm{En} \Rightarrow \mathrm{De}$ . + +![](images/3351930cf30e47861e321b2d9d8d14d055fed271126187cc369313c3e6c1ed70.jpg) +Figure 6: The training process of MRT optimized by each metric on $\mathrm{De} \Rightarrow \mathrm{En}$ . + +![](images/a401c14ae4c3d168ad58829619eeaf6b4d0ec1ba00bd87e5c5b2e68ad11e99a4.jpg) +Figure 7: The training process of MRT optimized by each metric on $\mathrm{En} \Rightarrow \mathrm{Zh}$ . + +![](images/30cc58a1e328b37f0d22bbb60748f6856d4ac46659cef82075d17d28b4f12fa0.jpg) +Figure 8: The training process of MRT optimized by each metric on $\mathrm{En} \Rightarrow \mathrm{Fi}$ . + +![](images/3eb2c7c4daa1ae40730b53265c3eda2b55151e6b1423193a8b5dab093eff23d4.jpg) +Figure 9: The training process of MRT optimized by each metric on $\mathrm{Fi} \Rightarrow \mathrm{En}$ . + +
Optimized MetricChange Range of Metrics During MRT on De⇒En
BLEUBERTScoreBARTScoreBLEURTCOMETUniTE_refUniTE_src_ref
BLEU0.96%-0.03%-0.32%-0.06%0.04%0.14%0.41%
BERTScore0.00%0.12%-0.07%0.05%0.65%0.93%1.04%
BARTScore-99.68%-154.39%39.02%-76.08%-547.63%-466.31%-608.53%
BLEURT-1.27%-0.50%-0.91%0.36%2.58%2.72%3.24%
COMET-5.10%-1.23%-2.57%0.28%7.41%5.45%7.84%
UniTE_ref-16.56%-5.72%-6.71%-0.64%-1.13%8.49%8.76%
UniTE_src_ref-9.55%-2.85%-3.96%-0.01%1.73%5.57%7.99%
+ +Table 10: The change range of all metrics when one metric is optimized to the highest value during MRT on $\mathrm{De}\Rightarrow \mathrm{En}$ + +
Optimized MetricChange Range of Metrics During MRT on En⇒Zh
BLEUBERTScoreBARTScoreBLEURTCOMETUniTE_refUniTE_src_ref
BLEU0.00%0.00%0.00%0.00%0.00%0.00%0.00%
BERTScore0.27%0.88%-0.86%-0.10%1.55%0.73%0.76%
BARTScore-100.00%-155.17%88.89%-70.57%-495.64%-450.90%-377.30%
BLEURT-96.77%-95.08%2.40%28.97%-349.43%-465.65%-472.03%
COMET-5.91%-1.00%0.46%0.67%6.96%5.27%6.05%
UniTE_ref-10.48%-2.54%0.87%1.03%4.01%9.58%10.66%
UniTE_src_ref-12.63%-2.90%1.83%1.07%3.90%9.51%11.34%
+ +Table 11: The change range of all metrics when one metric is optimized to the highest value during MRT on $\mathrm{{En}} \Rightarrow \mathrm{{Zh}}$ . + +
Optimized MetricChange Range of Metrics During MRT on Zh⇒En
BLEUBERTScoreBARTScoreBLEURTCOMETUniTE_refUniTE_src_ref
BLEU0.44%0.26%0.10%0.29%2.93%4.32%4.77%
BERTScore0.44%0.80%-0.10%0.66%6.05%8.16%10.24%
BARTScore-98.02%-126.46%37.25%-44.95%-620.81%-825.23%-871.23%
BLEURT-7.05%-0.80%-1.86%1.65%11.99%18.67%20.28%
COMET-7.05%-0.98%-3.12%0.77%16.47%16.50%17.67%
UniTE_ref-12.11%-2.45%-3.09%0.61%10.25%26.77%24.30%
UniTE_src_ref-8.81%-3.01%-5.14%-0.16%11.75%21.83%27.31%
+ +Table 12: The change range of all metrics when one metric is optimized to the highest value during MRT on $\mathrm{{Zh}} \Rightarrow \mathrm{{En}}$ . + +
Optimized MetricChange Range of Metrics During MRT on En⇒Fi
BLEUBERTScoreBARTScoreBLEURTCOMETUniTE_refUniTE_src_ref
BLEU0.70%0.12%0.17%0.05%-0.03%0.17%0.23%
BERTScore-0.70%0.42%-0.03%-0.21%-0.12%-0.48%-0.21%
BARTScore-100.00%-140.82%83.08%-75.93%-264.54%-244.66%-241.44%
BLEURT-51.22%-21.42%1.14%2.19%-8.02%-10.43%-9.85%
COMET-12.20%-2.58%0.04%0.07%2.03%0.86%0.96%
UniTE_ref-14.63%-5.43%0.76%-0.21%0.80%3.00%3.02%
UniTE_src_ref-19.51%-8.57%0.74%-1.05%0.05%2.69%3.11%
+ +Table 13: The change range of all metrics when one metric is optimized to the highest value during MRT on $\mathrm{{En}} \Rightarrow \mathrm{{Fi}}$ . + +
Optimized MetricChange Range of Metrics During MRT on Fi→En
BLEUBERTScoreBARTScoreBLEURTCOMETUniTE_refUniTE_src_ref
BLEU0.52%0.01%-0.01%0.02%0.09%0.01%0.15%
BERTScore-1.84%0.13%-0.91%0.02%0.58%0.20%0.55%
BARTScore-7.87%-2.04%1.20%-1.34%-2.63%-2.97%-2.99%
BLEURT-3.67%-0.58%-2.22%0.29%0.98%1.30%1.25%
COMET-2.62%-0.46%-1.92%0.11%1.53%1.12%1.39%
UniTE_ref-10.50%-2.88%-6.33%-0.68%-0.55%2.39%1.25%
UniTE_src_ref-6.30%-1.26%-3.53%-0.26%0.53%1.73%2.05%
+ +Table 14: The change range of all metrics when one metric is optimized to the highest value during MRT on $\mathrm{{Fi}} \Rightarrow \mathrm{{En}}$ . + +# A For every submission: + +A1. Did you describe the limitations of your work? + +Limitation is provided after section 6. + +A2. Did you discuss any potential risks of your work? + +Potential risks are provided after section 6 in Limitation part. + +A3. Do the abstract and introduction summarize the paper's main claims? + +Abstract is provided in the very beginning of the article and introduction is provided in section 1. + +A4. Have you used AI writing assistants when working on this paper? + +"Deepl write"(https://www.deepl.com/write) is used as AI writing assistant in this paper. "Deepl write" assistance purely with the language of the paper. Deepl write is used in section 1, 2, 3 of the paper + +# B Did you use or create scientific artifacts? + +Scientific artifacts are used in section 2. Scientific artifacts are created in section 3. + +B1. Did you cite the creators of artifacts you used? + +References part(at the end of the paper) cite the creators of artifacts used in this paper. In addition, URLs are provided in section 2.1 + +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? + +Not applicable. Left blank. + +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +Not applicable. Left blank. + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? + +Not applicable. Left blank. + +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? + +Not applicable. Left blank. + +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. + +In section 2, we report relevant statistics + +# C Did you run computational experiments? + +Computational experiments are in section 2, 3. + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +Not applicable. Left blank. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +We discuss the experimental setup in section 2.3 + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +We report descriptive statistics about results and report mean results. They are in section 2.4, 3.1.2, 3.2.2 + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +We report detail of used existing packages in section 2.3 + +# D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +No response. + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +No response. + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +No response. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +No response. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +No response. \ No newline at end of file diff --git a/bleurthasuniversaltranslationsananalysisofautomaticmetricsbyminimumrisktraining/images.zip b/bleurthasuniversaltranslationsananalysisofautomaticmetricsbyminimumrisktraining/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..a134c90be6545fb8d9b42412ad75a6b03a20d214 --- /dev/null +++ b/bleurthasuniversaltranslationsananalysisofautomaticmetricsbyminimumrisktraining/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3f85f8d4011b13c7f28b6804d7c0949746312b9f8d16d073684187594c90ce2a +size 1204275 diff --git a/bleurthasuniversaltranslationsananalysisofautomaticmetricsbyminimumrisktraining/layout.json b/bleurthasuniversaltranslationsananalysisofautomaticmetricsbyminimumrisktraining/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..68afa8804deec2944922b47955f47b5d1788ffb8 --- /dev/null +++ b/bleurthasuniversaltranslationsananalysisofautomaticmetricsbyminimumrisktraining/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:edcfb070b7fe5e1e407cc62e174d2e44225f49b3448a9759881c88cbbacd840e +size 483024 diff --git a/blindbiasremovalwithnodemographics/c50817ba-7a29-459e-903c-05d3d7dcb0ef_content_list.json b/blindbiasremovalwithnodemographics/c50817ba-7a29-459e-903c-05d3d7dcb0ef_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..5211fe100c207cf8ba982cf14c6637d1be7ca8e7 --- /dev/null +++ b/blindbiasremovalwithnodemographics/c50817ba-7a29-459e-903c-05d3d7dcb0ef_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:93fc66284e70233ac170c863c42b7727e41ad1a6ed31c97cc97a3c883d3f7f17 +size 144969 diff --git a/blindbiasremovalwithnodemographics/c50817ba-7a29-459e-903c-05d3d7dcb0ef_model.json b/blindbiasremovalwithnodemographics/c50817ba-7a29-459e-903c-05d3d7dcb0ef_model.json new file mode 100644 index 0000000000000000000000000000000000000000..7fdc8d2481835a7c46ee396add41ec9417bfdd78 --- /dev/null +++ b/blindbiasremovalwithnodemographics/c50817ba-7a29-459e-903c-05d3d7dcb0ef_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0fd36ae3dc4124edf9dc93d328eabf1898d9d308d495e4f40256555b11d068f6 +size 171205 diff --git a/blindbiasremovalwithnodemographics/c50817ba-7a29-459e-903c-05d3d7dcb0ef_origin.pdf b/blindbiasremovalwithnodemographics/c50817ba-7a29-459e-903c-05d3d7dcb0ef_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..df69c4a9e49070ad6a4be5f8108afaf366173d2e --- /dev/null +++ b/blindbiasremovalwithnodemographics/c50817ba-7a29-459e-903c-05d3d7dcb0ef_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6eb959a260de286cdfe0586a8dd4e333998c40d54a3284249da78d1ed42dca84 +size 1181318 diff --git a/blindbiasremovalwithnodemographics/full.md b/blindbiasremovalwithnodemographics/full.md new file mode 100644 index 0000000000000000000000000000000000000000..4e68ac78cfbde55e818f9533427bbfe6f8334f85 --- /dev/null +++ b/blindbiasremovalwithnodemographics/full.md @@ -0,0 +1,606 @@ +# BLIND: Bias Removal With No Demographics + +Hadas Orgad +orgad.hadas@cs.technion.ac.il + +Yonatan Belinkov* belinkov@technion.ac.il + +Technion - Israel Institute of Technology + +# Abstract + +Models trained on real-world data tend to imitate and amplify social biases. Common methods to mitigate biases require prior information on the types of biases that should be mitigated (e.g., gender or racial bias) and the social groups associated with each data sample. In this work, we introduce BLIND, a method for bias removal with no prior knowledge of the demographics in the dataset. While training a model on a downstream task, BLIND detects biased samples using an auxiliary model that predicts the main model's success, and downweights those samples during the training process. Experiments with racial and gender biases in sentiment classification and occupation classification tasks demonstrate that BLIND mitigates social biases without relying on a costly demographic annotation process. Our method is competitive with other methods that require demographic information and sometimes even surpasses them. $^{1}$ + +# 1 Introduction + +Neural natural language processing (NLP) models are known to suffer from social biases, such as performance disparities between genders or races (Blodgett et al., 2020). Numerous debiasing methods have been proposed in order to address this issue, with varying degrees of success. A disadvantage of these methods is that they require knowledge of the biases one wishes to mitigate (e.g., gender bias) (Bolukbasi et al., 2016; Zhao et al., 2018; De-Arteaga et al., 2019; Maudslay et al., 2019). Moreover, some methods require additional annotations for identifying the demographics for each sample in the data, such as the race of the writer (Han et al., 2021a; Liu et al., 2021; Ravfogel et al., 2022; Shen et al., 2022). Some annotations + +![](images/15bbca7ae227e808895283c6e3a1dac3edd50dcc867632562a06592ea8acdfbb.jpg) + +(a) With demographic annotations. Demographics detector learns to predict the demographic data, e.g., gender. + +![](images/ec89cfa961b479a7950d0b71c63d891c8df9668788ac46fb11faefdfcaeb7006.jpg) + +(b) BLIND: Without demographic annotations. Success detector learns to predict when the main model is correct. Supervision is based only on the downstream task labels. + +![](images/44b4375db93f901c75efe04c739b83dcbb1227a957ae9b6bbaed69d1f578eb93.jpg) +Figure 1: Our proposed debiasing methods. In both cases, an auxiliary classifier is trained to detect samples where demographic features may be used as shortcuts and their importance to the main model is downweighted. + +can be automatically collected from the data, while others require manual annotations or expert knowledge, which can be very costly. Thus, existing methods are typically limited to a small number of datasets and tasks. In this paper, we propose a new debiasing method, BLIND - Bias removal wIth No Demographics. + +We see social bias as a special case of robustness issues resulting from shortcut learning (Geirhos et al., 2020). Our goal is to down-weight samples that contain demographic features that may be used + +as shortcuts in downstream tasks. We first consider a case where we have demographic annotations for every sample in the training set, and train a demographics detector – an auxiliary classifier that takes the main model's representations and predicts the demographic attribute. Then, we down-weight the importance of samples on which the classifier is confident (Figure 1a). To our knowledge, this is the first work to consider demographic information for re-weighting samples during training. + +When we do not have demographic annotations, we make the following observation: The main model has an easier job, or otherwise makes predictable mistakes, when demographic features are used as shortcut features. Thus, we train a success detector – another auxiliary classifier, which takes the representations of the main model and predicts its success on the task. A correct prediction by the success detector means the main model made a shallow decision, since it is possible predict its success or failure without access to the main model's task labels. In such cases we expect that the main model relies on simple, shortcut features, and we use the success detector's confidence to down-weight such samples in the training data (Figure 1b). We call this method BLIND. + +In both cases, we adapt the debiased focal loss (DFL; Karimi Mahabadi et al., 2020), originally proposed for mitigating annotation artifacts, to down-weight samples that the detectors predicted correctly. In contrast to the original DFL work, which explicitly defined biases to mitigate, we design the bias detection mechanism in a general manner such that the model's biases are learned and mitigated dynamically during training. + +We perform experiments on two English NLP tasks and two types of social demographics: occupation classification with gender, and sentiment analysis with race. Our methods successfully reduce bias, with BLIND sometimes succeeding in cases where other methods that use demographic information fail. Our analysis shows that BLIND reduces demographic information in the model's internal representation, even though it does not have access to it. Additionally, BLIND is particularly effective at mitigating bias due to its down-weighting of easy training samples, rather than relying on demographic information alone. This suggests that BLIND may be more robust in mitigating bias than other methods. + +# 2 Methodology + +# 2.1 Problem Formulation + +We consider general multi-class classification problems. The dataset $\mathbb{D} = \{x_i, y_i, z_i\}_{i=1}^N$ consists of triples of input $x_i \in \mathcal{X}$ , label $y_i \in \mathcal{Y}$ , and a protected attribute $z_i \in \mathcal{Z}$ , which corresponds to a demographic group, such as gender. $z$ might be latent, meaning that it cannot be accessed during training or validation stages. Our goal is to learn a mapping $f_M: \mathcal{X} \to \mathbb{R}^{|Y|}$ , such that $f_M$ , which we call the main model, is robust to differences in demographics as induced by $z_i$ . + +The robustness of a model is measured using a variety of fairness metrics. A fairness metric is a mapping from a model's predictions and the protected attributes associated with each sample to a numerical measure of bias: $M:(\mathbb{R}^{|\mathcal{Y}|},\mathcal{Z})\to \mathbb{R}$ . The closer the absolute value is to 0, the fairer the model. The practical fairness metrics measured in this work are described in Section 3.2. + +# 2.2 Debiased Focal Loss for Social Bias + +Debiased focal loss was proposed by Karimi Mahabadi et al. (2022) to improve natural language understanding models on out-of-distribution data. The authors explicitly defined the biases they aim to mitigate, and trained an auxiliary model on the same task as the main model by feeding it with biased features. We model biased samples differently: instead of learning the same downstream task as the main model, our auxiliary model learns a separate task that indicates bias. + +The model $f_{M}$ can be written as a composition of two functions: $g$ , the text encoder, and $h_{M}$ , the classifier, such that $f_{M} = h_{M} \circ g$ . In our case, $g$ is a transformer language model such as BERT (Devlin et al., 2018), and $h_{M}$ is a linear classification layer. + +Loss term. We use the DFL formulation to reweight samples that contain bias. To determine the re-weighting coefficients, we need a separate model that acts as a bias detector, $f_{B} = h_{B} \circ g$ . The next two sub-sections define two options for the bias detector, with and without using demographics. + +The main and auxiliary models have parameters $\theta_{M}$ and $\theta_{B}$ respectively, and the parameters of the encoder $g$ are included in $\theta_{M}$ . The training loss is defined as: + +$$ +\mathcal {L} \left(\theta_ {M}; \theta_ {B}\right) = \tag {1} +$$ + +$$ +\left(1 - \sigma \big (f _ {B} ^ {s} (x; \theta_ {B}) \big)\right) ^ {\gamma} l o g (\sigma (f _ {M} ^ {y} (x; \theta_ {m})) +$$ + +for a single instance $(x,y,s)$ , where $\sigma(u) = e^{u^j} / \sum_{k=1}^{|\mathcal{V}|} e^{u^k}$ is the softmax function, and $\gamma$ is a hyper-parameter that controls the strength of the re-weighting. Here $s$ is either the demographic attribute $z$ when we have it, or a success indicator of the main model on $x$ , as explained below. When the bias detector assigns a high probability to $s$ , the contribution of this sample to the loss is decreased, and this effect is magnified by $\gamma$ ( $\gamma = 0$ restores the vanilla cross-entropy loss). Both models are trained simultaneously, but only the main model's loss is back-propagated to the encoder $g$ , avoiding bias propagation from $f_B$ . + +# 2.3 Debiasing With Demographic Annotations + +When demographic attributes are available, we define bias as how easily demographic information can be extracted from a sample. This strategy aligns with the observation by Orgad et al. (2022) that this measure correlates with gender bias metrics. The bias detector is thus formulated as $f_{B}:g(\mathcal{X})\to \mathbb{R}^{|\mathcal{Z}|}$ , taking as input the representations from $g$ and predicting the demographic attribute; In other words, $s\coloneqq z$ in the formulation in Equation (1). Figure 1a illustrates this approach. + +By applying this method, samples in which the demographics detector is successful in predicting demographics $(\sigma(f_{B}^{z}(x))$ is high) are downweighted, and difficult samples $(\sigma(f_{B}^{z}(x))$ is low) are up-weighted. Intuitively, the main model is encouraged to focus on samples with less demographic information, which reduces the learning of demographics-task correlations. + +Connection to adversarial learning. While the concept of a demographics model may resemble that used in work on debiasing via adversarial training (Zhang et al., 2018; Elazar and Goldberg, 2018; Han et al., 2021c), our DFL approach is fundamentally different: rather than reversing gradients from the demographics model to remove information from the main model, we use the demographics model to reweight the loss. Further discussion regarding adversarial learning can be found in Appendix A. + +# 2.4 Debiasing Without Demographic Annotations + +One of the main weaknesses of other debiasing methods in the field, including the method described in Section 2.3, is the requirement to collect demographic annotations $z$ per data point. These + +annotations may be expensive or impossible to obtain. Additionally, these annotations often do not address nuances, such as intersectional biases to multiple groups (e.g., both gender and race), or nonbinary gender. We propose BLIND as a method for reducing biases without demographic annotations. In this setting, the auxiliary model $f_{B}$ is trained as a success detector. The success detector predicts, for each training sample, whether the main model would be successful at predicting the correct label for the main task. The success detector has no knowledge of the original task. It is formulated as $f_{B}: g(\mathcal{X}) \to \mathbb{R}^{|S|}$ , and $s$ is defined as an indicator function: $s := \mathbb{I}_{f_{M}(x) == y}$ . $s$ is dynamic, and changes across different epochs of the training process. BLIND is illustrated in Figure 1b. + +We expect that if the success detector can predict whether the main model is correct or incorrect on a sample (i.e., $\sigma(f_B^s(x))$ is high), without knowing the task at hand, then the sample contains some simple but biased features, and thus should have reduced weight in the loss. This intuition aligns with the claim that in the context of complex language understanding tasks, all simple feature correlations are spurious (Gardner et al., 2021).2 + +# 3 Experiments + +# 3.1 Tasks and Models + +We experiment with two English classification tasks and bias types: + +Sentiment Analysis and Race. We follow the setting of Elazar and Goldberg (2018), who used a twitter dataset collected by Blodgett et al. (2016) to study dialectal variation in social media. We use a subset of 100k samples. As a proxy for the writer's racial identity, each tweet is associated with a label about whether it is written in African American English (AAE) or Mainstream US English (MUSE; often called Standard American English, SAE) based on the geo-location of the author. Elazar and Goldberg (2018) used emojis in the tweets to derive sentiment labels for the classification task. + +Occupation Classification and Gender. We use the dataset by De-Arteaga et al. (2019), a collection of 400K biographies scraped from the internet to study gender bias in occupation classification. + +The task is predicting one's occupation based on a subset of their biography – without the first sentence, which states the occupation. The protected attribute is gender, and each instance is assigned binary genders based on the pronouns in the text, which indicate the individual self-identified gender. + +# 3.2 Metrics + +As recommended by Orgad and Belinkov (2022), who showed that different fairness metrics react differently to debiasing methods, we measure multiple metrics to quantify bias in downstream tasks. They can be separated to two main groups: + +# 3.2.1 Performance gap metrics + +These indicate the difference in performance between two demographic groups, such as females versus males. + +Absolute gap. For example, for gender we measure the True Positive Rate (TPR) gap for label $y$ as $GAP_{TPR,y} = |TPR_y^F -TPR_y^M |$ . We also measure the False Positive Rate (FPR) and Precision gaps. On a multi-class setting, we calculate the absolute sum of gaps across the different labels of the task (denoted $\mathrm{TPR}_s$ ). We also measure the root mean square for TPR gap (denoted $TPR_{RMS}$ ) of the gaps, $\sqrt{\frac{1}{|\mathcal{V}|}\sum_{y\in\mathcal{Y}}(GAP_{TPR,y})^2}$ , since it was used in studies of other debiasing methods we compare to (Ravfogel et al., 2020, 2022). + +Gaps correlation with training statistics. When feasible, we compute the Pearson correlation between the gap for each class and the training dataset statistics for this class (denoted $\mathrm{TPR}_p$ ). For example, the pearson correlation $GAP_{TPR,y}$ and the percentage of female instances in class $y$ , as appears in the training set. + +# 3.2.2 Statistical metrics + +Another family of fairness metrics are statistical metrics, which are measured on probability distributions. To describe these metrics, we use the notation from Section 2, and denote the model's predictions with $r$ . + +Independence. Measures the statistical dependence between the model's prediction and the protected attributes, by measuring the Kullback-Leibler divergence between two distributions: $KL(P(\mathbf{r}), P(\mathbf{r}|\mathbf{z} = \mathbf{z}))$ , $\forall z \in \mathcal{Z}$ . We sum the values over $z$ to achieve a single number that describes the independence of the model. This metric does + +not consider the gold labels, and intuitively just measures how much the model's behavior is different on different demographics. + +Separation. Measures the statistical dependence between the model's prediction given the target label and the protected attributes: $KL(P(\mathbf{r}|\mathbf{y} = y), P(\mathbf{r}|\mathbf{y} = y, \mathbf{z} = z)), \forall y \in \mathcal{Y}, z \in \mathcal{Z}$ . We sum the values over $y$ and $z$ to achieve a single number. This metric is closely related to TPR and FPR gaps, and intuitively measures if the model behaves differently on each class and demographics. + +Sufficiency. Measures the statistical dependence between the target label given the model's prediction and the protected attributes: $KL(P(\mathbf{y}|\mathbf{r} = r), P(\mathbf{y}|\mathbf{r} = r, \mathbf{z} = z)), \forall r \in \mathcal{Y}, z \in \mathcal{Z}$ . We sum the values over $r$ and $z$ to achieve a single number. This metric is related to calibration in classification and to precision gap, and can intuitively measure if a model over-promotes or penalizes a certain demographic group. + +# 3.3 Training and Evaluating + +We experiment with BERT (Devlin et al., 2018) and DeBERTa-v1 (He et al., 2020) based architectures, where the transformer model is used as a text encoder and its output and is fed into a linear classifier. We fine-tune the text encoder with the linear layer on the downstream task. + +During training, we often use a temperature $t$ in the softmax function of the auxiliary model $f_{B}$ , which we found to improve training stability. For hyper-parameter search, since we are interested in balancing the importance of task accuracy and fairness, we adapt the 'distance to optimum' (DTO) criterion introduced by Han et al. (2021a). TheDTO calculation is explained in Appendix B. We perform model selection without requiring a validation set with demographic annotations, by only choosing the most radical hyper-parameters (highest $\gamma$ and lowest $t$ ), while limiting the reduction in accuracy (see Appendix E). We chose 0.95 of the maximum achieved accuracy on the task as a threshold, per architecture. For more details on the training and evaluation process, see Appendix C. + +All of our models are tested on a balanced dataset (via subsampling), i.e., each label contains the same number of samples from each demographic group. This neutralizes bias in the test dataset, allowing us to truly assess bias in the models, as suggested by Orgad and Belinkov (2022). + +# 3.4 Baselines and Competitive Systems + +We compare the following training methods: + +DFL-demog (ours) DFL trained with demographic annotations, as described in Section 2.3. + +BLIND (ours) DFL trained without demographic annotations, as described in Section 2.4. + +Control To rule out any potential form of unintended regularization in BLIND, a control model is trained using random labels for the auxiliary model. We expect this method to have no significant debiasing effect. + +Finetuned The same model architecture, optimized to solve the downstream task without any debiasing mechanism. + +INLP (Ravfogel et al., 2020) A post-hoc method to remove linear information from the neural representation, by repeatedly training a linear classifier to predict a property (in our case, gender or race) from the neural representation, and then projecting the neural representations to the null space of the linear classifier. + +RLACE (Ravfogel et al., 2022) The goal of this method is also to linearly remove information from the neural representations of a trained model by utilizing a different strategy based on a linear minimax game. + +Scrubbing (De-Arteaga et al., 2019) A common approach used to remove gender bias in the occupation classification dataset, is to automatically remove any gender indicators from it, such as "he", "she", "Mr" or "Mrs", and names. We apply this method on the occupation classification task and also experiments with combining it with our methods (marked as +Scrubbing). + +FairBatch (Roh et al., 2021) This method adaptively selects minibatch sizes for improving fairness, with three variations, targeting equal opportunity, equalized odds, and demographic parity. The method is designed on binary tasks, thus we apply FairBatch to the sentiment classification task. For a fair comparison, we present the variation that achieved the best fairness metrics we measured. + +JTT (Liu et al., 2021) Just Train Twice (JTT) is a two-stage train-retrain approach that first trains a model and then trains a second model that upweights misclassified training samples. It works without demographic annotations but requires them for model selection. For a fair comparison, we select the model that has the closest accuracy to our BLIND method. $^4$ + +# 4 Results + +In the main body of the paper, we report accuracy and a representative subset of fairness metrics. The full set of fairness metrics is reported in Appendix D. + +In Table 1a, we present the results of sentiment classification with racial bias, and in Table 1b, results on occupation classification with gender bias. As expected, the vanilla fine-tuning baseline yields the best accuracy, but also the worst bias (highest fairness metrics), on both BERT and DeBERTa and on both tasks. + +# 4.1 Debiasing with Demographic Annotations + +We first focus on DFL trained with a demographic detector. + +Sentiment classification. The auxiliary model is trained to predict race. DFL leads to a statistically significant reduction of bias compared to the finetuned baseline in all metrics, with a minor drop in accuracy (2 - 3% absolute). Compared to other methods that use demographic attributes (INLP, RLACE, FairBatch and JTT), DFL maintains better or similar accuracy. On BERT, it also reduces bias more. On DeBERTa, INLP and RLACE enjoy a greater bias reduction, but suffer a decrease in accuracy (-14% in INLP, -2.7% in RLACE), while FairBatch suffers from both a decrease in accuracy and less bias reduction, and JTT does not suffer from accuracy reduction but reduces less bias than DFL. We conclude that DFL is an effective method to reduce bias in this setting while maintaining high performance on the downstream task. + +Occupation classification. When using demographic attributes (here: gender), DFL leads to a statistically significant reduction of bias according to all metrics on both BERT and DeBERTa, with a minor drop in accuracy $(3\%)$ . In contrast, INLP and RLACE are much less effective in reducing bias + +
BERTDeBERTa
Acc ↑TPRMS↓Indep ↓Suff ↓Acc ↑TPRMS↓Indep ↓Suff ↓
Finetuned0.7790.2670.0450.0270.7750.2700.0470.032
INLP †0.756*0.196*0.022*0.014*0.633*0.086*0.010*0.015*
RLACE †0.735*0.142*0.010*0.008*0.748*0.168*0.016*0.011*
FairBatch †0.761*0.210*0.019*0.016*0.763*0.203*0.016*0.017*
JTT+0.767*0.194*0.016*0.016*0.7800.191*0.013*0.014*
DFL-demog †0.762*0.124*0.000*0.003*0.7660.177*0.009*0.008*
BLIND0.761*0.240*0.030*0.021*0.7820.243*0.028*0.022*
Control0.7760.4800.0460.0260.7800.2530.0380.025
+ +(a) Sentiment classification. + +
BERTDeBERTa
Acc ↑TPR RMS ↓TPRp ↓Suff ↓Acc ↑TPR RMS ↓TPRp ↓Suff ↓
Finetuned0.8640.1360.8091.5590.8640.1340.8191.597
INLP †0.853*0.1310.7821.2160.852*0.1220.730*1.050*
RLACE †0.8660.1310.8091.4130.868*0.1260.8081.361*
Scrubbing †0.8630.123*0.704*0.901*0.858*0.107*0.729*0.788*
JTT+0.846*0.1360.761*1.4170.841*0.1400.770*1.398
DFL-demog †0.834*0.122*0.602*0.709*0.829*0.113*0.619*0.794*
+ Scrubbing0.830**0.111**0.569**0.584**0.841**0.114*0.578**0.592**
BLIND0.826*0.1370.694*1.097*0.835*0.1230.638*0.906*
+ Scrubbing0.844**0.132*0.664*1.070*0.843**0.116*0.648*0.712*
Control0.8640.1400.7961.6020.8650.1290.7951.403
+ +(b) Occupation classificationm + +Table 1: Results on both tasks, averaged over 5 seeds. Results that have statistically significant difference comparing to the Finetuned results (by Pitman's permutation test, $p < 0.05$ ) are marked with *. +Scrubbing methods that also have statistically significant difference comparing to the Scrubbing results are marked with **. † marks debiasing methods that require demographic information. + marks debiasing methods that require demographic information only for hyper-parameter tuning. BLIND successfully reduces bias without using any demographic information. + +in this setting, with no significant difference from the baseline on BERT and only partial improvements on DeBERTa.5 Scrubbing is quite effective in reducing bias while maintaining accuracy, but it achieves a lesser degree of bias reduction than DFL. When we combine DFL with scrubbing, we find that it achieves an even greater bias reduction, surpassing all other methods, with only a minor accuracy reduction compared to DFL. JTT reduces bias in only one metric on both models. + +Our conclusion is that DFL with demographics is an effective tool for reducing bias, surpassing other methods we compare to. + +# 4.2 Debiasing without Demographic Annotations. + +Next, we examine our method when there is no access to demographic attributes (BLIND), using a success detector as a proxy for biased features. + +Sentiment classification. Remarkably, we observe a statistically significant reduction of bias compared to the fine-tuned model in BERT and DeBERTa. Reduction in accuracy is minimal, as before. Comparing DFL with and without demographics, the model trained with demographics produces lower fairness metrics, in both BERT and DeBERTa. JTT, which also does not use demographics at training, is more effective than BLIND; however, it requires demographics for model selection. Additionally, the control model does not differ statistically significantly from the vanilla model, in + +both accuracy and fairness metrics. + +Occupation classification. As in the sentiment classification task, debiasing without demographic attributes (BLIND) tends to be less effective than our variant for debiasing using demographic attributes. Nevertheless, it is still successful in mitigating bias on some of the fairness metrics, even surpassing other methods that use demographic attributes $(-0.69\%)$ in sufficiency, compared to $-0.55\%$ for INLP, $-0.23\%$ for RLACE and no significant reduction for JTT), while maintaining a small reduction in performance $(-3\%)$ . Once again, the control model results are statistically indistinguishable from those of the baseline. Additionally, we find that combining BLIND with scrubbing seems to not improve fairness on top of the scrubbing method. Combining BLIND with a method that has access to the bias we wish to remove seems not helpful, at least in this case. + +To summarize this part, while the results of DFL without demographic attributes are behind those of DFL that uses attributes and sometimes behind other methods that use attributes, it is encouraging to see a significant reduction in bias in this setting, that is sometimes even more effective than other methods that use demographic attributes. + +# 5 Analyses + +# 5.1 Performance of the Success Detector + +The success detector achieves an average accuracy of $85\%$ on occupation classification and $76\%$ on sentiment classification with BERT. Moreover, we compute its Expected Calibration Error (ECE) and find that it is 0.03 on average for both occupation classification and sentiment classification. These results suggest that the success detector is well-calibrated for both classification tasks and achieves non-trivial accuracy, explaining its effectiveness as a detector for biased samples. + +# 5.2 Effect of debiasing on internal model representations + +To further understand why BLIND works, we investigate the internal representations of the debiased models. Recently, the extractability of gender information from a model's internal representations was found to be correlated with gender bias metrics (Orgad et al., 2022). We therefore pose the following question: How does debiasing with DFL + +affect the neural representations of demographic information? Here, we focus on BERT. + +To answer the above question, we train a probe model, $f_{p}$ , which predicts the protected attribute, either gender or race, from the main model's internal representations: $f_{p}: g(\mathcal{X}) \to R^{|Z|}$ . We then report the ease at which the probe performs this task using compression, measured by a minimum description length (MDL) probing (Voita and Titov, 2020). Internal representations with a higher compression indicate more accessible gender or racial information. A detailed description on the implementation can be found in Appendix C.4. + +Figure 2 presents the probing results for both tasks and on the two variations of debiasing: with and without demographic attributes. Even though some $\gamma$ s are noisy, there is a clear trend that the accessibility of demographic information decreases as $\gamma$ increases. Surprisingly, applying BLIND caused the models to encode less demographics information even without information about the protected attributes. This may explain why BLIND is successful in reducing bias metrics associated with these demographics, as well as suggesting that other hidden characteristics may also be affected by this debiasing process. These results align with Orgad et al. (2022), who found that the extractability of gender in internal representations correlate positively with various fairness metrics. However, our results are different from those of Mendelson and Belinkov (2021), who found a negative correlation between robustness and biased features extractability. Mendelson and Belinkov explicitly modeled biased features for their debiasing process, whereas we use demographics or success as proxies for biased features, which might explain the difference. + +# 5.3 Bias detectors comparison: with and without demographics + +Recall that our method penalizes samples for which the detector assigned a high probability to the correct label. The results indicated that using a demographic detector (race/gender) was more effective than using a success detector. The two detector models penalize samples differently, so we wish to understand how the two differ and where they agree. We compute the probability that each model + +![](images/23ab21d4a3cc9c6f545d02eba820087e6adca5253e3b2ab35d3ab74911984c90.jpg) +(a) Sentiment classification and race. + +![](images/4ed598e46d46b2dda6a3403176567d68af8c79dc53757d901a3678273253faf2.jpg) +(b) Occupation classification and gender. +Figure 2: Effect of $\gamma$ on compression rate of demographic information in internal representations, as extracted from trained models. + +
Success detectorDemographics detector onlyBoth
Sentiment94%/22%4%/55%69%/15%
Occupation95%/33%5%/66%87%/32%
+ +Table 2: Percentage of success/failure samples penalized by our detectors, out of all success/failure samples. Left column: samples penalized by the success detector, middle column: by the demographics detector and not by the success detector, right column: by both models. + +provided to the correct label (details on computation in Appendix C.5).8 Here we present our analysis of BERT. Results for DeBERTa are similar (Appendix G). + +Table 2 summarizes which samples each detector penalizes, defined as samples for which the detector assigns a probability above 0.5. We divide the samples into two classes, depending on whether the main model classified them correctly or not.9 The table shows the percentage of samples that are being penalized, out of all samples in this class. + +We first note that the success detector (left column) is mostly penalizing samples where the main model is correct (94% and 95% in sentiment and occupation tasks, respectively), and much less samples where the main model is wrong (22% and 33%). Thus, the success detector reduces weights on samples the model has already learned and clas + +sified correctly, which could correspond to easier samples that contain more bias. This reduces the overall bias by preventing the main model from over-fitting to these samples. + +Looking at samples that both detectors penalize (right column), we observe that they are mostly samples which the main model succeeds on (69% for sentiment and 87% for occupation), suggesting their importance for debiasing. However, when observing what samples the demographics detector penalized but the success detector did not (middle column), we find many failure samples (55% for sentiment and 66% for occupation). In our experiments, our method with demographics mitigated bias better than the one without. The gap between the methods might be because failure samples are less penalized by the success detector, since the success detector fails to correctly classify these samples. Better debiasing might be achieved by detecting failures in the main model more effectively, perhaps by using a stronger success detector. + +# 6 Prior Work + +Studies suggests a variety of ways for debiasing NLP models from social biases on downstream tasks, such as preprocessing the training data (De-Arteaga et al., 2019; Zhao et al., 2018; Han et al., 2021a), modifying the training process (Elazar and Goldberg, 2018; Shen et al., 2022), or applying post-hoc methods to neural representations of a trained model (Ravfogel et al., 2020, 2022; Iskander et al., 2023). All these methods, however, require that we define the bias we wish to operate + +upon, for example, gender bias. Additionally, many of these methods require demographic annotations per data instance, such as the gender of the writer or the subject of the text. Webster et al. (2020) is an exception, since it performs gender-debiasing by modifying dropout parameters. Another exception is JTT (Liu et al., 2021), which improved worst-group errors by training a model twice: first a standard ERM model, then a second model that upweights training samples misclassified by the first model. The authors of these studies chose hyperparameters based on fairness metrics they wanted to optimize, while we choose our hyper-parameters without explicitly measuring fairness metrics. To our knowledge, this is the first study to mitigate social biases in NLP without assuming any prior knowledge. + +Other studies have focused on improving NLP models robustness without prior knowledge of bias issues, but without considering social bias. Utama et al. (2020) and (Sanh et al., 2020) tackled dataset biases (a.k.a annotation artifacts) in natural language understanding tasks, by training a weak learner to identify biased samples and downweighting their importance. Weak learners are either trained on a random subset of the dataset or have a smaller capacity. + +Regarding social fairness without demographics, Lahoti et al. (2020) proposed adversarially reweighted learning, where an adversarial model is trained to increase the total loss by re-weighting the training samples. They used tabular, nontextual data in their experiments. We consider nonadversarial methods since adversarial training is known to be difficult to stabilize. Hashimoto et al. (2018) proposed a method for minimizing the worst case risk over all distributions close to the empirical distribution, without knowledge of the identity of the group. Coston et al. (2019) considered fairness in unsupervised domain adaptation, where the source or target domain do not have demographic attributes, by proposing weighting methods. Han et al. (2021b) proposed debiasing via adversarial training with only a small volume of protected labels. + +Focal loss (Lin et al., 2017) was proposed as a method to address class imbalances by downweighting loss associated with well-classified samples. Rajic et al. (2022) proposed using the original focal loss (Lin et al., 2017) to improve robustness in natural language inference, leading to improved + +out-of-distribution accuracy. Debiased Focal Loss (DFL) (Karimi Mahabadi et al., 2020) is a variant of focal loss proposed to improve natural language understanding models on out-of-distribution data. + +# 7 Discussion and Conclusion + +Even though BLIND led to bias reduction, it was less effective than our method that used demographic annotations. Analysis showed that the success detector is less accurate at classifying samples that fail the main model. Additionally, the success detector might be less focused than demographic-based methods, but it might mitigate biases we have not identified and cannot measure without annotations. Thus, it would be interesting to see how BLIND works on intersectional biases. + +In sentiment analysis, BLIND reduced bias less than JTT, which also does not use demographics for training, but does for hyper-parameter search. However, JTT was ineffective on the occupation classification task, while BLIND was effective for both tasks. The two tasks differ significantly, as well as their data. For BERT and DeBERTa, pretraining data is closer to biographies than tweets, so perhaps training for longer is beneficial for the tweets data used in the sentiment classification task, and repeating samples in the training set (as in JTT) is similar to training for more steps. In any case, BLIND proved more reliable and generalizable in reducing bias. + +Our method has the potential for broader applications beyond demographic biases. While our primary focus was on mitigating demographic biases, the approach can be adapted to address other types of biases by identifying relevant proxy indicators via the success detector. + +To summarize, we demonstrated the reduction of racial and gender biases of NLP classification models, without any prior knowledge of those biases in the data. These results suggest that we can potentially apply BLIND to any dataset, which makes bias reduction a much more feasible endeavor and applicable to real-world scenarios. + +# 8 Limitations + +One limitation of this study is its scope, which covers two downstream tasks and two types of demographics (race and gender). The binary gender definition we used excludes other genders that do not fall under male or female. In the case of race, we explored only African American race (proxied + +by African American English), which excludes biases related to other races, and is a US-centric view of racial bias. We did not investigate other types of bias, such as religious bias. Furthermore, our method was tested on datasets with short texts, and it is unclear how it will perform on longer texts. The experiments were conducted on datasets in English, and it is unclear how our method will work on languages that are morphologically rich. + +# 9 Ethics Statement + +Through this study, we aim to reduce the barriers of data collection in the effort of mitigating bias. In situations where demographic information is not available at all, or where its use could cause privacy concerns, this method may be especially useful. As with other bias mitigation methods, applying BLIND to the training process might create a false sense of confidence in the model's bias, but as we target scenarios without demographics, the risk is greater as it may be harder to discover cases where bias remains. We encourage practitioners of NLP who use BLIND to identify potential biases and harms experienced by individuals using their system, and to define their fairness metrics accordingly. In order to verify if the system is working as expected according to the predefined fairness metrics, we encourage collecting a small validation set with demographic annotations. + +# Acknowledgements + +This research was supported by the ISRAEL SCIENCE FOUNDATION (grant No. 448/20) and by an Azrieli Foundation Early Career Faculty Fellowship. + +# References + +Yonatan Belinkov. 2021. Probing classifiers: Promises, shortcomings, and alternatives. Computational Linguistics 2021. +Su Lin Blodgett, Solon Barocas, Hal Daumé III, and Hanna Wallach. 2020. Language (technology) is power: A critical survey of "bias" in NLP. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5454-5476, Online. Association for Computational Linguistics. +Su Lin Blodgett, Lisa Green, and Brendan O'Connor. 2016. Demographic dialectal variation in social media: A case study of African-American English. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages + +1119-1130, Austin, Texas. 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. Advances in neural information processing systems, 29. +Amanda Coston, Karthikeyan Natesan Ramamurthy, Dennis Wei, Kush R. Varshney, Skyler Speakman, Zairah Mustahsan, and Supriyo Chakraborty. 2019. Fair transfer learning with missing protected attributes. In Proceedings of the 2019 AAAI/ACM Conference on AI, Ethics, and Society, AIES '19, page 91-98, New York, NY, USA. Association for Computing Machinery. +Maria De-Arteaga, Alexey Romanov, Hanna Wallach, Jennifer Chayes, Christian Borgs, Alexandra Chouldechova, Sahin Geyik, Krishnaram Kenthapadi, and Adam Tauman Kalai. 2019. Bias in bios: A case study of semantic representation bias in a high-stakes setting. In Proceedings of the Conference on Fairness, Accountability, and Transparency, FAT* '19, page 120-128, New York, NY, USA. Association for Computing Machinery. +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. +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. +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, William Merrill, Jesse Dodge, Matthew Peters, Alexis Ross, Sameer Singh, and Noah A. Smith. 2021. Competency problems: On finding and removing artifacts in language data. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 1801-1813, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +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. +Gabriel Grand and Yonatan Belinkov. 2019. Adversarial regularization for visual question answering: Strengths, shortcomings, and side effects. In Proceedings of the Second Workshop on Shortcomings + +in Vision and Language, pages 1-13, Minneapolis, Minnesota. Association for Computational Linguistics. +Xudong Han, Timothy Baldwin, and Trevor Cohn. 2021a. Balancing out bias: Achieving fairness through balanced training. arXiv. +Xudong Han, Timothy Baldwin, and Trevor Cohn. 2021b. Decoupling adversarial training for fair NLP. In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, pages 471-477, Online. Association for Computational Linguistics. +Xudong Han, Timothy Baldwin, and Trevor Cohn. 2021c. Diverse adversaries for mitigating bias in training. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 2760-2765, Online. Association for Computational Linguistics. +Tatsunori Hashimoto, Megha Srivastava, Hongseok Namkoong, and Percy Liang. 2018. Fairness without demographics in repeated loss minimization. In International Conference on Machine Learning, pages 1929-1938. PMLR. +Pengcheng He, Xiaodong Liu, Jianfeng Gao, and Weizhu Chen. 2020. Deberta: Decoding-enhanced bert with disentangled attention. arXiv preprint arXiv:2006.03654. +John Hewitt and Percy Liang. 2019. Designing and interpreting probes with control 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 2733-2743, Hong Kong, China. Association for Computational Linguistics. +Shadi Iskander, Kira Radinsky, and Yonatan Belinkov. 2023. Decoupling adversarial training for fair NLP. In Findings of the Association for Computational Linguistics: ACL 2023. Association for Computational Linguistics. +Rabeeh Karimi Mahabadi, Yonatan Belinkov, and James Henderson. 2020. End-to-end bias mitigation by modelling biases in corpora. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 8706-8716, Online. Association for Computational Linguistics. +Rabeeh Karimi Mahabadi, Luke Zettlemoyer, James Henderson, Lambert Mathias, Marzieh Saeidi, Veselin Stoyanov, and Majid Yazdani. 2022. Prompt-free and efficient few-shot learning with language models. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 3638-3652, Dublin, Ireland. Association for Computational Linguistics. +Diederik P Kingma and Jimmy Ba. 2015. Adam: A method for stochastic optimization. In ICLR (Poster). + +Preethi Lahoti, Alex Beutel, Jilin Chen, Kang Lee, Flavien Prost, Nithum Thain, Xuezhi Wang, and Ed Chi. 2020. Fairness without demographics through adversarially reweighted learning. In Advances in Neural Information Processing Systems, volume 33, pages 728-740. Curran Associates, Inc. +Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dólar. 2017. Focal loss for dense object detection. In Proceedings of the IEEE international conference on computer vision, pages 2980-2988. +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 Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pages 6781-6792. PMLR. +Ilya Loshchilov and Frank Hutter. 2018. Decoupled weight decay regularization. In International Conference on Learning Representations. +Rowan Hall Maudslay, Hila Gonen, Ryan Cotterell, and Simone Teufel. 2019. It's all in the name: Mitigating gender bias with name-based counterfactual data substitution. 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 5267-5275, Hong Kong, China. Association for Computational Linguistics. +Michael Mendelson and Yonatan Belinkov. 2021. Debiasing methods in natural language understanding make bias more accessible. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 1545-1557, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Hadas Orgad and Yonatan Belinkov. 2022. Choose your lenses: Flaws in gender bias evaluation. In Proceedings of the 4th Workshop on Gender Bias in Natural Language Processing (GeBNLP), pages 151-167, Seattle, Washington. Association for Computational Linguistics. +Hadas Orgad, Seraphina Goldfarb-Tarrant, and Yonatan Belinkov. 2022. How gender debiasing affects internal model representations, and why it matters. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 2602-2628, Seattle, United States. Association for Computational Linguistics. +Frano Rajic, Ivan Stresec, Axel Marmet, and Tim Postuvan. 2022. Using focal loss to fight shallow heuristics: An empirical analysis of modulated cross-entropy in natural language inference. arXiv preprint arXiv:2211.13331. + +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. + +Shauli Ravfogel, Michael Twiton, Yoav Goldberg, and Ryan D Cotterell. 2022. Linear adversarial concept erasure. In Proceedings of the 39th International Conference on Machine Learning, volume 162 of Proceedings of Machine Learning Research, pages 18400-18421. PMLR. + +Yuji Roh, Kangwook Lee, Steven Euijong Whang, and Changho Suh. 2021. Fairbatch: Batch selection for model fairness. In 9th International Conference on Learning Representations. The International Conference on Learning Representations. + +Victor Sanh, Thomas Wolf, Yonatan Belinkov, and Alexander M Rush. 2020. Learning from others' mistakes: Avoiding dataset biases without modeling them. In International Conference on Learning Representations. + +Aili Shen, Xudong Han, Trevor Cohn, Timothy Baldwin, and Lea Frermann. 2022. Optimising equal opportunity fairness in model training. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 4073-4084, Seattle, United States. Association for Computational Linguistics. + +Prasetya Ajie Utama, Nafise Sadat Moosavi, and Iryna Gurevych. 2020. Towards debiasing NLU models from unknown biases. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 7597-7610, Online. Association for Computational Linguistics. + +Elena Voita and Ivan Titov. 2020. Information-theoretic probing with minimum description length. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 183-196, Online. Association for Computational Linguistics. + +Kellie Webster, Xuezhi Wang, Ian Tenney, Alex Beutel, Emily Pitler, Ellie Pavlick, Jilin Chen, Ed Chi, and Slav Petrov. 2020. Measuring and reducing gendered correlations in pre-trained models. arXiv preprint arXiv:2010.06032. + +Brian Hu Zhang, Blake Lemoine, and Margaret Mitchell. 2018. Mitigating unwanted biases with adversarial learning. In Proceedings of the 2018 AAAI/ACM Conference on AI, Ethics, and Society, pages 335-340. + +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. + +# A Connection of DFL to adversarial training + +As adversarial learning is a natural competing baseline, we attempted to apply adversarial training to our task setting at an initial step of the research, but found it to be highly unstable and impractical, which corroborates findings in the literature (Ganin et al., 2016; Grand and Belinkov, 2019). We also examined the work of Elazar and Goldberg (2018), who utilized adversarial learning for removing demographic attributes from text inputs. However, they caution against relying on adversarial removal for achieving fairness, as their results indicated that demographic information could still be extracted by classifiers of the same architecture. To address the issue of attribute leakage more effectively, subsequent work (Ravfogel et al., 2020, 2022) proposed other methods that address demographic attribute leakage better than adversarial training, which we compare our method with. + +# B DTO + +DTO Han et al. (2021a) is measured as the L2-distance from a utopia point, $(\max_{\mathrm{a}}\text{accuracy}, 0)$ , where $\max_{\mathrm{a}}$ accuracy is the maximum accuracy achieved on the task in our experiments. (accuracy, fairness) are the candidate points. We computed fairness by averaging the various fairness metrics measured in this study. In a practical application, the definition of the candidate points and the utopia points should reflect the application's current needs and priorities. + +# C Implementation Details + +# C.1 Fairness Metrics + +For measuring the statistical fairness metrics (independence, separation, sufficiency), we used the fairness library, implemented by AllenNLP (https://github.com/allenai/allennlp). + +FairBatch fairness metrics. FairBatch considers three fairness metrics: equal opportunity, equalized odds, and demographic parity. Equal opportunity is closely related to the metric Independence, Equalized odds is closely related to Separation and equal + +ized opportunity is closely related to TPR gap. In the main results table (Table 1a) we present the variation that achieved the best metrics we display. However, we found very little difference between the results of the different variations of FairBatch. + +# C.2 Training and Evaluation + +For the DFL loss, increasing the temperature $t$ increases the smoothness of the softmax result, resulting in less radical regularization. In each experiment, we grid-search $\gamma \in \{1,2,4,8,16\}$ and $t \in \{1,2,4,8\}$ using the validation set. + +We trained BERT (Devlin et al., 2018) and DeBERTa-v1 (He et al., 2020) models, with one linear classification layer on top of them. For BERT we used the bert-base-uncased model by Huggingface, which has 110M parameters and for DeBERTa we used the microsoftt/debeta-base from the Huggingface library, which has 1.5B parameters. We trained each model for 10 epochs—which took around 5-6 hours for the occupation classification task and 3-4 for the sentiment classification task—and saved the best epoch based on the validation accuracy. + +We used the following GPUs for training BERT: Geforce RTX 2080 Ti, Titan Xp, GeForce GTX 1080 Ti, and the following GPUs for training DeBERTa: A40, RTX A4000. Each experiment was run using 5 different seeds: 0, 5, 26, 42, 63. These seeds were used to anchor the model's initialization, the data split, and any other randomness in the code, and are considered as an input to our released scripts. We used a 65-10-25 training-validation-test split ratio for all tasks. Training was done with a learning rate of $5e - 5$ and an AdamW (Loshchilov and Hutter, 2018) optimizer. Both models were trained by passing the biography / tweet through the transformer model, obtaining the top [CLS] token representation and feeding it into the classification layer. The entire model was fine-tuned end-to-end to optimize the cross entropy loss, while in the DFL setting we added a weighting component. The demographics/success detector's architecture is a single linear classification layer optimized to solve the appropriate classification task. It was trained with a learning rate of $1e - 3$ and an Adam (Kingma and Ba, 2015) optimizer. + +Sentiment Classification. Our setup followed the settings of Ravfogel et al. (2020), where we controlled how biased the training data is. We used a subset of the original dataset with 100K samples, + +and our training data was imbalanced such that the "happy" sentiment class was composed of $70\%$ AAE and $30\%$ MUSE, while the "sad" sentiment was composed of $70\%$ MUSE and $70\%$ AAE. The dataset was overall balanced: $50\%$ "sad"/"happy" and $50\%$ AAE/MUSE. + +Occupation Classification. We trained our models on the entire dataset, without any distribution modifications. + +For both tasks, data for validation and testing was balanced such that each class had the same demographic distribution. + +# C.3 Baselines and Competitive Systems + +We ran INLP and RLACE on model representations extracted from a finetuned model without DFL training. For INLP and RLACE, we used the implementation of the authors and the same hyper-parameters. For JTT, since the datasets were different, we provide our own implementation but searched over the same hyper-parameters, which are $\lambda_{up} \in \{4,5,6\}$ (the rate of multiplication of repeated instances) and $T = \{1,2\}$ (the epoch of the model used to calculate failed instances). We ran the scrubbing algorithm provided by the code of De-Arteaga et al.. FairBatch was ran using the code provided in the paper, for a training period of 10 epochs where the best checkpoint is chosen as the epoch with the best fairness metric being optimized. + +# C.4 MDL probing: implementation details + +Our MDL probe (Voita and Titov, 2020) is based on the implementation by Mendelson and Belinkov (2021). The linear probe is trained with a batch size of 16 and a learning rate of 1e-3 in all experiments. We used the following data accumulation fractions to train the probe: $2.0\%$ , $3.0\%$ , $4.4\%$ , $6.5\%$ , $9.5\%$ , $14.0\%$ , $21.0\%$ , $31.0\%$ , $45.7\%$ , $67.6\%$ , $100\%$ . + +# C.5 Bias detectors comparison: implementation details + +We wished to calculate for each model, the probability it assigned to the right label. To do that, we load the checkpoint of a BLIND-trained model we are interested in, and then compute the main model's predictions and the hidden representations of each sample from a BLIND-trained model. Following that, we calculate the success detector's and the demographics detector's predictions on the extracted representations. For the demographics + +detector, we train another model for predicting demographics from the extracted representations, to simulate how a demographics detector would behave on the same representations. + +# D Full results + +The full results can be found in Tables 5, 6, 7 and 8. + +# E Effect of $\gamma$ + +Recall that the DFL loss (Equation (1)) uses $\gamma$ to control how much importance to give to a biased sample; the higher $\gamma$ , the less weight a biased sample receives in the loss, which should result in a more biased model. Indeed, Figures 3, 4, 5 and 6 show that as $\gamma$ increases (moving from top to bottom on the heatmaps), the bias metrics and accuracy both tend to decrease. + +Choosing the hyper-parameters blindly. As the figures show, increasing $\gamma$ causes the debiasing effect to be more aggressive, until a point that it is collapsing and unable to train (very low accuracy). Increasing the temperature helps balancing this process, where on the higher gammas a lower temperature mean more aggressive debiasing and thus less bias. Based on this analysis, we conclude that it is possible to make the model selection based on $\gamma$ and $t$ alone, using the following logic: choose the highest $\gamma$ and the lowest $t$ for which the accuracy is above a tolerance threshold. + +
ModelTaskAccuracyECE
MeanStdMeanStd
BERTOccupation0.850.000.030.02
Sentiment0.760.010.030.01
DeBERTAOccupation0.860.010.030.01
Sentiment0.810.010.030.01
+ +# F Performance of Success Detector + +Table 3 presents the full performance and calibration information of the success detector in both tasks. + +Table 3: Performance and calibration of BLIND's success detector on both tasks. + +
Success detectorDemographics detector onlyBoth
Sentiment95%/13%4%/71%82%/11%
Occupation94%/36%6%/59%84%/34%
+ +Table 4: Percentage of success/failure samples penalized by our detectors, out of all success/failure samples. + +# G Bias detectors comparison: with and without demographics + +Table 4 presents the results of bias detectors comparison for DeBERTa. + +
BERT
Acc ↑TPR (s)TPR\( _{RMS} \)↓FPR\( _{s} \)↓Prec\( _{s} \)↓Indep ↓Sep ↓Suff ↓
Finetuned
Mean0.7790.4720.2670.4720.1890.0450.0280.027
Std0.0060.0340.0190.0340.0160.0070.0030.003
INLP †
Mean0.7560.3340.1960.3340.1440.0220.0140.014
Std0.0230.0770.0450.0770.0350.0090.0080.008
RLACE †
Mean0.7350.2470.1420.2470.2300.0100.0030.008
Std0.0030.0200.0130.0200.0160.0030.0010.002
FairBatch-DP †
Mean0.7610.3340.2100.3340.1990.0190.0150.016
Std0.0090.0200.0130.0200.0090.0030.0030.002
FairBatch-Eqodds †
Mean0.7650.3400.2100.3400.1930.0200.0160.017
Std0.0090.0240.0140.0240.0120.0030.0020.002
FairBatch-Eqopp †
Mean0.7550.3510.2120.3510.1910.0220.0180.019
Std0.0090.0150.0080.0150.0080.0020.0030.003
JTT+
Mean0.7670.3060.1940.3060.1910.0160.0150.016
Std0.0070.0380.0170.0380.0070.0050.0010.001
DFL-demog †
Mean0.7620.2410.1240.2410.2330.0000.0030.003
Std0.0060.0060.0040.0060.0090.0000.0000.000
BLIND
Mean0.7610.4030.2400.4030.1900.0300.0200.021
Std0.0080.0340.0200.0340.0050.0060.0050.004
Control
Mean0.7800.4430.2530.4430.1750.0380.0260.025
Std0.0070.0120.0100.0120.0050.0020.0030.004
+ +Table 5: Full results on the sentiment classification task for BERT. For each fairness metric, the best result is bolded, and the best result achieved without demographics in the training data is underlined. + +
DeBERTa
Acc ↑TPR (s)TPR\( _{RMS} \)↓FPR\( _s \)↓Prec\( _s \)↓Indep ↓Sep ↓Suff ↓
Finetuned
Mean0.7750.4820.2700.4820.1980.0470.0330.032
Std0.0050.0610.0310.0610.0310.0130.0060.006
INLP †
Mean0.6330.1490.0860.1490.1000.0100.0100.015
Std0.1610.2050.1180.2050.0840.0150.0130.012
RLACE †
Mean0.7480.2970.1680.2970.2250.0160.0080.011
Std0.0170.0980.0590.0980.0310.0150.0110.008
FairBatch-DP †
Mean0.7630.3170.2030.3170.2070.0160.0160.017
Std0.0120.0110.0070.0110.0050.0010.0040.004
FairBatch-Eqodds †
Mean0.7680.3240.2100.3240.2050.0180.0140.015
Std0.0100.0430.0240.0430.0090.0050.0020.002
FairBatch-Eqopp †
Mean0.7580.3230.2030.3230.2040.0170.0180.019
Std0.0110.0310.0170.0310.0020.0040.0030.003
JTT+
Mean0.7700.2760.1850.2760.2020.0120.0130.014
Std0.0110.0420.0180.0420.0090.0050.0030.003
DFL-demog †
Mean0.7660.2650.1770.2650.2110.0090.0060.008
Std0.0170.0080.0100.0080.0150.0040.0040.003
BLIND
Mean0.7820.3960.2430.3960.2000.0280.0220.022
Std0.0060.0170.0100.0170.0120.0030.0010.001
Control
Mean0.7830.4150.2430.4150.1790.0330.0260.025
Std0.0090.0480.0210.0480.0120.0090.0060.006
+ +Table 6: Full results on the sentiment classification task for DeBERTa. For each fairness metric, the best result is bolded, and the best result achieved without demographics in the training data is underlined. + +
BERT
Acc ↑TPR (s)TPR RMS ↓TPRp ↓FPRs ↓FPRp ↓Precs ↓Precp ↓Indep ↓Sep ↓Suff ↓
Finetuned
Mean0.862.460.140.810.070.573.80-0.900.010.341.56
Std0.000.270.010.030.010.040.170.030.000.090.15
INLP †
Mean0.852.480.130.780.070.583.26-0.860.010.331.22
Std0.010.430.020.070.020.040.370.020.000.070.07
RLACE †
Mean0.872.440.130.810.070.633.65-0.900.010.351.41
Std0.000.330.010.050.000.020.290.020.000.040.16
JTT+
Mean0.852.450.140.760.070.603.43-0.880.010.351.42
Std0.000.310.020.020.010.020.310.020.000.070.15
Scrubbing †
Mean0.862.150.120.700.060.492.77-0.840.010.270.90
Std0.000.340.010.070.000.070.310.040.000.030.14
DFL-demog †
Mean0.832.090.120.600.060.412.38-0.780.000.250.71
Std0.010.220.010.130.010.110.280.020.000.070.13
DFL-demog + Scrubbing †
Mean0.831.880.110.570.060.382.18-0.720.000.200.58
Std0.000.190.010.120.010.060.430.060.000.040.18
BLIND
Mean0.832.470.140.690.080.473.09-0.770.010.321.10
Std0.000.200.010.070.020.110.850.090.000.080.47
BLIND + Scrubbing
Mean0.842.390.130.660.070.512.89-0.790.010.331.07
Std0.000.200.010.090.010.050.480.040.000.050.28
Control
Mean0.862.640.140.800.080.603.90-0.880.010.371.60
Std0.000.190.010.010.010.030.640.040.000.050.34
+ +Table 7: Full results on the occupation classification task for BERT. For each fairness metric, the best result is bolded, and the best result achieved without demographics in the training data is underlined. + +![](images/118f0496d9142caab5a813f68f8de04cdba62e39cb1a29c58cbe072cacfed51c.jpg) + +![](images/13bd5c95915e700c30cc81646c0f2333587c4014fba5b170b5fa8995e43f71ab.jpg) + +![](images/27557d3c181232247d8fde0855e59b4d7e3cf015eeacee1db19488859cb7244d.jpg) + +![](images/b9fcdb97b73797e54ae81afb2b66770b44bc9ca59ce5164283e694a2a2d96c93.jpg) + +![](images/1c10f1fb86de62b3dbdeef8d158e84dc21c7e300eb0b7a38c59ed934993b0cb0.jpg) +(a) $t = 1$ +(e) $\gamma = 1$ +Figure 3: Sentiment classification, BERT. effect of $\gamma$ across different softmax temperatures $(t)$ , and effect of different softmax temperature across different $\gamma$ . + +![](images/36649e357241d6bf5471cc5992c1fb8dab5fddd7da189249acf1f42059e85b63.jpg) +(b) $t = 2$ +(f) $\gamma = 2$ + +![](images/24932b42e7f5bcaae3c371c6ee74a6a9d214aa6dc7596f822e9a58c48e7af745.jpg) +(g) $\gamma = 4$ + +![](images/1e0049cf5de6bd0da5cd9490a693b3f510975b0dd2598ef62d0009045efe1539.jpg) +(c) $t = 4$ +(h) $\gamma = 8$ + +![](images/79e0ca80b2333614e33e245750b222a5d07f1eff27ad15b096c3d556f8ba87ec.jpg) +(d) $t = 8$ +(i) $\gamma = 16$ + +DeBERTa + +
Acc ↑TPR (s)TPR\( _{RMS} \)↓TPR\( _{p} \)↓FPR\( _{s} \)↓FPR\( _{p} \)↓Prec\( _{s} \)↓Prec\( _{p} \)↓Indep↓Sep↓Suff↓
Finetuned
Mean0.862.490.130.820.080.553.73-0.870.010.351.60
Std0.000.460.030.020.010.060.220.030.000.070.13
INLP †
Mean0.852.110.120.730.070.563.14-0.840.010.311.05
Std0.010.180.010.040.010.020.270.040.000.030.11
RLACE †
Mean0.872.340.130.810.070.633.65-0.890.010.331.36
Std0.000.280.010.010.000.020.280.030.000.040.11
Scrubbing †
Mean0.861.950.110.730.060.562.73-0.860.010.270.79
Std0.010.180.010.050.010.020.210.030.000.040.09
JTT+
Mean0.842.510.140.770.080.583.53-0.860.010.351.40
Std0.000.270.010.030.000.050.310.030.000.050.27
DFL-demog †
Mean0.831.930.110.620.060.432.69-0.780.000.260.79
Std0.000.150.010.060.000.070.420.040.000.030.25
DFL-demog + Scrubbing †
Mean0.841.900.110.580.050.362.13-0.700.000.240.59
Std0.010.180.010.080.010.090.300.070.000.040.15
BLIND
Mean0.842.160.120.640.080.512.98-0.810.010.310.91
Std0.000.200.010.080.010.050.300.040.000.030.21
BLIND + Scrubbing
Mean0.842.030.120.650.060.392.48-0.810.000.270.71
Std0.000.220.010.120.000.050.320.070.000.050.14
Control
Mean0.872.490.130.810.070.493.51-0.890.010.341.38
Std0.000.590.020.100.010.060.380.030.000.070.38
+ +Table 8: Full results on the occupation classification task for DeBERTa. For each fairness metric, the best result is bolded, and the best result achieved without demographics in the training data is underlined. + +![](images/0e5586f6b1601f2d5a09a8f59b61d1017c3049bee0cc6f0fca47a8c01356b4af.jpg) +(a) $t = 1$ + +![](images/ca290d04f936b0430b94048c73e6eea83cf5178f5e330d52c89fa55e50e2767f.jpg) + +![](images/55933d2469964dbfb84334c45e6b437ad638a7dfb82d15602abd86b38f3bb5d7.jpg) + +![](images/df6a6e6d7525649da2edfb6298fd02c1e614e4b71842adebd0b89866bccc7363.jpg) + +![](images/001bdc3b92f6e773fc3905584adce128cf265c90109884b70c5ab96f6c8a5a68.jpg) +(e) $\gamma = 1$ + +![](images/e3c76b99e4161df9045e288c83401356a6be10ea002bdadbdabb4abaac36cd61.jpg) +(b) $t = 2$ +(f) $\gamma = 2$ + +![](images/8bf7ebdb10fbb7f86e5c509060f20f041eeb32d557e4f2de50da032c9333d422.jpg) +(c) $t = 4$ +(g) $\gamma = 4$ + +![](images/e7eaf1c217735ba1c13ec8b6a7b2cf5dc5ba48b1c058cef97a52a7ba51c281ff.jpg) +(h) $\gamma = 8$ +Figure 4: Sentiment classification, DeBERTa. effect of $\gamma$ across different softmax temperatures $(t)$ , and effect of different softmax temperature across different $\gamma$ . + +![](images/55dd1398766d6c1deedfc9bcc5afa581bcbb8ba264326624ffb73c340deacbc6.jpg) +(d) $t = 8$ +(i) $\gamma = 16$ + +![](images/515b7ca0c64df488c8141ae0b0d2e313187fe6c6e406698dc2652023a2b5a2e0.jpg) +(a) $t = 1$ + +![](images/17401257f2f977a523755d57e043a53fcd7dbbe3e6d70d36f9bf775f674eebd8.jpg) +(b) $t = 2$ + +![](images/386a86152f7ca55bdd2ce71b49e5a5abeeb08b17031fa8cd817d75c728d5b6f0.jpg) + +![](images/8e3deb8880a50469707e68dc5f530420a5939dda61ba1a4ddb00e5d30e1ab0b2.jpg) + +![](images/b4a8e21a62e4f77ddce66b7fa604ff56bcf78fbc83f84927b7db54cd1f098e59.jpg) +(e) $\gamma = 1$ + +![](images/c6e4990ac73973d240599eea56ee5b41ba88a6022b4311eaba6a9968e55f2876.jpg) +(f) $\gamma = 2$ + +![](images/60b6c2c12854e10cfb0a84f3ef21ab04af8284e8ba1bb6d7a2c864a438984719.jpg) +(c) $t = 4$ +(g) $\gamma = 4$ + +![](images/72e3ddb84b5fc763ebc1be584aa046c5294de49ff8b1f1204b9cda6eb8e081a1.jpg) +(h) $\gamma = 8$ +Figure 5: Occupation classification, BERT. effect of $\gamma$ across different softmax temperatures $(t)$ , and effect of different softmax temperature across different $\gamma$ . + +![](images/5ee8a5226d898fd349a046d4eb2ccfdae88f63f1301b4dbadcbe518034d92db2.jpg) +(d) $t = 8$ +(i) $\gamma = 16$ + +![](images/22dd2d40cab49a3a987589c7d9c33f02c0a29063dc06567dccfb5ad2498ad86f.jpg) + +![](images/fe182eb574fbfe8bec3bfce1db196714e296d70141e191d1dd01cee4b5fb0922.jpg) + +![](images/d1207535d465c26bd0285e32bccd49c4190c50f11b0300b325e80fd5f303b181.jpg) + +![](images/f9fcbf79db4b1a2b650b3980dbb59cbc4077d1984eaa9fef33e207aea365a3f5.jpg) + +![](images/9257d22633ac0be34c9e4ed17e9d3c0ca902468b616cc9f937f534d3d28979f4.jpg) +(a) $t = 1$ +(e) $\gamma = 1$ + +![](images/98dd6f0b0a997e1fb6db8a8a1e91db6747c45b3e6c16450a44efff51b55b34ed.jpg) +(b) $t = 2$ +(f) $\gamma = 2$ + +![](images/70f6c64e8b7e98ba536e2c2263c403189cccab68022efcd57e6fea22222dd750.jpg) +(g) $\gamma = 4$ + +![](images/3af26da397e5abcb96b4f6aae27e9f2d8fe83c876621cc7fbc4dfa09eb499f73.jpg) +(c) $t = 4$ +(h) $\gamma = 8$ + +![](images/81fa37dde3f23bc892420be9c65c294d5d511fe42cf860199a494f96e5679814.jpg) +(d) $t = 8$ +(i) $\gamma = 16$ +Figure 6: Occupation classification, DeBERTa. effect of $\gamma$ across different softmax temperatures $(t)$ , and effect of different softmax temperature across different $\gamma$ . + +A For every submission: + +A1. Did you describe the limitations of your work? 8 +A2. Did you discuss any potential risks of your work? 9 +A3. Do the abstract and introduction summarize the paper's main claims? +A4. Have you used AI writing assistants when working on this paper? Left blank. + +B Did you use or create scientific artifacts? + +We provide the link to our code in the abstract. + +B1. Did you cite the creators of artifacts you used? 3 and C +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? These are discussed in the git repo of our published code. +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +Yes - 3. Our artifacts - our code is for a debiasing method, and we distribute it for that purpose, while discussing possible risks. + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? + +We measure social biases, so names and other identifiers are a crucial part of this phenomenon. Additionally, the datasets we used are publicly available. + +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? + +Languages - sections 1 and 3. Demographic groups are the main subject of the paper as we measure biases. + +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. + +Sections 3 and appendix C + +# C Did you run computational experiments? + +3,4 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +C + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +C + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +4 + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +C + +# D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +No response. + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +No response. + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +No response. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +No response. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +No response. \ No newline at end of file diff --git a/blindbiasremovalwithnodemographics/images.zip b/blindbiasremovalwithnodemographics/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..489623ea3d7a1b379616d3806dcfde93d9ffc123 --- /dev/null +++ b/blindbiasremovalwithnodemographics/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:012781ecad38fea72ba0ee249d7a3446828535ae6438ef044959f52577efd528 +size 1274320 diff --git a/blindbiasremovalwithnodemographics/layout.json b/blindbiasremovalwithnodemographics/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..db9cdf676652cf47a2ed3565371b598b80d2364e --- /dev/null +++ b/blindbiasremovalwithnodemographics/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5da99805847429dac27c8cc907fb89a910ea7af45c52e0e7991512b7742eeda3 +size 703149 diff --git a/bloom1addinglanguagesupporttobloomforzeroshotprompting/32880300-8046-4e1b-9cd1-ee45623126c9_content_list.json b/bloom1addinglanguagesupporttobloomforzeroshotprompting/32880300-8046-4e1b-9cd1-ee45623126c9_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..b87e5539379f3b6c790f403b751097cfef8e910d --- /dev/null +++ b/bloom1addinglanguagesupporttobloomforzeroshotprompting/32880300-8046-4e1b-9cd1-ee45623126c9_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8aa5da6e2b561c79c825cdbd4340c612992bfa1af0233db5fd8db1013a2b3b76 +size 140621 diff --git a/bloom1addinglanguagesupporttobloomforzeroshotprompting/32880300-8046-4e1b-9cd1-ee45623126c9_model.json b/bloom1addinglanguagesupporttobloomforzeroshotprompting/32880300-8046-4e1b-9cd1-ee45623126c9_model.json new file mode 100644 index 0000000000000000000000000000000000000000..dec83b77871d61c94ba7b17d30f6dc704664d410 --- /dev/null +++ b/bloom1addinglanguagesupporttobloomforzeroshotprompting/32880300-8046-4e1b-9cd1-ee45623126c9_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ff5a5a1dd797a2ff15b04c12057f3ef3135e85349cd6a0ccf73fb4ed9d69ba6e +size 169863 diff --git a/bloom1addinglanguagesupporttobloomforzeroshotprompting/32880300-8046-4e1b-9cd1-ee45623126c9_origin.pdf b/bloom1addinglanguagesupporttobloomforzeroshotprompting/32880300-8046-4e1b-9cd1-ee45623126c9_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f2a12a6dbea10d7fabf0f4981e1c14ba83d55af8 --- /dev/null +++ b/bloom1addinglanguagesupporttobloomforzeroshotprompting/32880300-8046-4e1b-9cd1-ee45623126c9_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:62fc527feadc75cd4ffe22a85d7500b8fbd1130343a7d2f0f627d2c55cf5bc0b +size 1126896 diff --git a/bloom1addinglanguagesupporttobloomforzeroshotprompting/full.md b/bloom1addinglanguagesupporttobloomforzeroshotprompting/full.md new file mode 100644 index 0000000000000000000000000000000000000000..2035d5ae31875482a9ce0263c2841c337f42f628 --- /dev/null +++ b/bloom1addinglanguagesupporttobloomforzeroshotprompting/full.md @@ -0,0 +1,586 @@ +# BLOOM+1: Adding Language Support to BLOOM for Zero-Shot Prompting + +Zheng-Xin Yong $^{1*}$ , Hailey Schoelkopf $^{2,3}$ , Niklas Muennighoff $^{4}$ , Alham Fikri Aj $^{5}$ , David Ifeoluwa Adelani $^{6}$ , Khalid Almubarak $^{7}$ , M Saiful Bari $^{8}$ , Lintang Sutawika $^{2,9}$ , Jungo Kasai $^{10}$ , Ahmed Baruwa $^{11}$ , Genta Indra Winata $^{12}$ , Stella Biderman $^{2,13}$ , Edward Raff $^{13}$ , Dragomir Radev $^{3}$ , Vassilina Nikoulina $^{14}$ + +$^{1}$ Brown University $^{2}$ EleutherAI $^{3}$ Yale University $^{4}$ Hugging Face $^{5}$ MBZUAI + +6University College London 7PSAU 8Nanyang Technological University + +$^{9}$ Dasasaur.ai $^{10}$ Paul G. Allen School of CSE, University of Washington + +$^{11}$ University of Oregon $^{12}$ The Hong Kong University of Science and Technology + +13Booz Allen Hamilton 14NAVER LABS Europe + +# Abstract + +The BLOOM model is a large publicly available multilingual language model, but its pretraining was limited to 46 languages. To extend the benefits of BLOOM to other languages without incurring prohibitively large costs, it is desirable to adapt BLOOM to new languages not seen during pretraining. In this work, we apply existing language adaptation strategies to BLOOM and benchmark its zero-shot prompting performance on eight new languages in a resource-constrained setting. We find language adaptation to be effective at improving zero-shot performance in new languages. Surprisingly, we find that adapter-based finetuning is more effective than continued pretraining for large models. In addition, we discover that prompting performance is not significantly affected by language specifics, such as the writing system. It is primarily determined by the size of the language adaptation data. We also add new languages to BLOOMZ, which is a multitask finetuned version of BLOOM capable of following task instructions zero-shot. We find including a new language in the multitask fine-tuning mixture to be the most effective method to teach BLOOMZ a new language. We conclude that with sufficient training data language adaptation can generalize well to diverse languages. Our code is available at https://github.com/bigscience-workshop/multilingual-modeling. + +# 1 Introduction + +Although access to transformer-based language models has expanded greatly over the past several years (Black et al., 2021; Wang and Komatsuzaki, 2021; Artetxe et al., 2021; Black et al., 2022; Zhang et al., 2022), these technologies are overwhelmingly concentrated in a few high resource + +languages (Talat et al., 2022). BLOOM (Scao et al., 2022), the largest publicly available multilingual language model to date with 176B parameters, covers only 46 natural languages and even excludes high-resource languages such as Korean and Russian which has tens of millions of speakers. This limitation was driven by a number of factors, most notably only considering languages for which the community had enough expertise to manually validate the data quality (Kreutzer et al., 2022), deduplicate and remove personally identifiable information (Laurençon et al., 2022) and had sufficient access to licensed unlabeled text (Joshi et al., 2020). All of these factors are contingent facts about the group that trained the model, and leave open the idea that other researchers could contribute more languages. As regularly retraining such a model is prohibitively expensive, the question of whether this model can be productively adapted to understand additional languages after training becomes pressing. + +We hypothesize that language adaptation scenario is especially interesting for low-resource languages that would benefit from knowledge transfer. Therefore, we adapt BLOOM models to support eight new languages (German, Russian, Bulgarian, Thai, Turkish, Greek, Korean, and Guarani) in the resource-constrained settings, where we only use a limited amount of samples (maximum 100K samples) for each language. We evaluate their zero-shot prompting on various NLU tasks after adaptation. The new languages cover both seen and unseen scripts in the pretraining data, and they differ in their language families and word orders. We benchmark existing language adaptation methods, such as continued pretraining and MAD-X (Pfeiffer et al., 2020), as well as a state-of-the-art parameter-efficient transfer learning method, $(\mathrm{IA})^3$ (Liu et al., 2022). + +Current work on adapting large multilingual models has mostly explored continued pretraining (Müller and Laurent, 2022; NovelAI, 2022; De la Rosa and Fernández, 2022) of EleutherAI's GPT-J-6B (Wang and Komatsuzaki, 2021). Moreover, Ebrahimi and Kann (2021) showed that continued pretraining outperforms other strategies for adapting small/medium-sized language models (i.e., models with fewer than one billion parameters). However, our experiments demonstrate that, for large language models such as BLOOM with comparable sizes to GPT-J-6B, continued pretraining underperforms adapters under a resource-constrained setting. In addition, our work focuses on studying the effects of language adaptation on prompting, which has been underexplored in previous language adaptation work (Ebrahimi and Kann, 2021; Ansell et al., 2022; Parović et al., 2022; Pfeiffer et al., 2022). Prompting can benefit many languages that lack large amounts of labeled data as it allows language models to generalize to a wide range of tasks with significantly less training cost and data than full finetuning (Liu et al., 2021; Le Scao and Rush, 2021). + +# 1.1 Our Contributions + +Our work is the first to explore the scaling effects of language adaptation strategies for language models with billions of parameters under a resource-constrained setting. Contrary to prior work on small/medium-sized multilingual masked language models (Ebrahimi and Kann, 2021), we recommend training adapters instead of continued pretraining for BLOOM with at least 3 billion parameters for better prompting performance. We further connect this recommendation to the way the quality of language independent representation scales with model parameters. + +We also demonstrate the positive effects of monolingual language adaptation on the prompting performance of BLOOM on various datasets. BLOOMZ is a variant of BLOOM that is produced by finetuning BLOOM on a multitask mixture in the same languages seen during pretraining. We find that simply adding a new language in the multitask finetuning is effective in improving performance in the new language. + +To summarize, our contributions include: + +- Studying the effects of language adaptation on zero-shot prompting and instruction tuning. +- Benchmarking parameter-efficient methods for adapting BLOOM models of various + +scales and analyzing the trade-offs between the amount of required computes and zero-shot prompting performance. + +- Quantifying the effect of the size of language adaptation data on language adaptation. + +# 2 Related Work + +Language Adaptation Language adaptation enables pretrained language models to support languages outside of their pretraining data. Most works investigating language adaptation consider masked language models such as mBERT (Devlin et al., 2019) and XLM-R (Conneau et al., 2020) that are pretrained on $100+$ languages. Language adaptation approaches can be broadly categorized into three categories: (1) continued pretraining of the model (restricted to the embedding layer training only in some cases) (Neubig and Hu, 2018; Artetxe et al., 2020; Chau et al., 2020; Muller et al., 2021; Zhang et al., 2020; Wang et al., 2020); (2) training of language-specific adapters (Pfeiffer et al., 2020, 2021a,b; Philip et al., 2020; Üstün et al., 2021; Berard, 2021; Faisal and Anastasopoulos, 2022; Parović et al., 2022) for the target language; and (3) training of a sparse subset of model parameters (Ansell et al., 2022). The core motivation behind these approaches is to benefit from knowledge transfer encoded in the pretrained language models for the new language processing at a small computational cost (compared to full model retraining from scratch). + +One common issue is that the script of the new language is not always supported by the tokenizer. Artetxe et al. (2020); Aji et al. (2020); Pfeiffer et al. (2021b) demonstrate that it is possible to add a new language to these models by training a new embedding layer. Muller et al. (2021) continue training the pretrained mBERT on the new language data, and find that transliteration of languages using non-Latin script boosts performance on these languages. Berard (2021) add new languages into pretrained multilingual machine translation models by training embedding and adapter layers. They show that adding a new target language (the language to translate to) is harder to learn than a new language to translate from. + +Closest work to our benchmarking efforts is Ebrahimi and Kann's (2021) study on different approaches (i.e., continued pretraining, vocabulary expansion and adapter layers) to extend the XLM-R model to 30 new languages on token-level clas + +sification tasks. They conclude that continued pretraining is the most promising direction. However, the cost of such pretraining will grow with the size of the pretrained model and can be prohibitive for many researchers working with low-resource languages. Our results also show that continued pretraining does not necessarily bring a prompting performance gain for larger language models. + +Multilingual Prompting Prompts reformulates NLP tasks into masked or generative language modeling problem, depending on the models' pretraining objective. Zhao and Schütze (2021) and Qi et al. (2022) show that finetuning XLM-R on cloze-style prompts yield better performance than standard finetuning under a low-resource regime for XNLI. On the other hand, Winata et al. (2022) find that standard finetuning of XLM-R outperforms prompt-based learning for sentiment prediction in low-resource Indonesian dialects. + +Some work shows that multitask prompt-based training on a variety of tasks and English or translated prompts improves zero-shot cross-lingual and cross-task performance (Muennighoff et al., 2022; Fu et al., 2022). Multilingual prompt-based learning can also be achieved without performing gradient updates for downstream tasks. For instance, Lin et al. (2021) demonstrate success in prompting GPT-like pretrained models with in-context learning for NLU tasks, using either English or translated prompt templates. Shi et al. (2023) find that when language models scale up, they can perform better multilingual chain-of-thought reasoning. + +# 3 Experimental settings + +# 3.1 BLOOM pretrained models + +We focus on adding language support to the BLOOM language model (Scao et al., 2022) from 560 million to 7.1 billion parameters. BLOOM has a decoder-only Transformer architecture that uses AliBi positional embeddings (Press et al., 2022) and layer normalization after embedding layers. Its tokenizer is trained with byte-level Byte Pair Encoding (BPE) algorithm (Gage, 1994; Sennrich et al., 2016) with a vocabulary size of 250,680. + +BLOOM is pretrained for around 350 billion tokens on the ROOTS corpus (Laurençon et al., 2022), which covers 46 natural languages and 13 programming languages. Appendix M shows the distribution of the natural languages in the ROOTS corpus. + +# 3.2 New Languages + +We consider all six languages of XNLI (Conneau et al., 2018) that are currently unsupported by BLOOM: German, Bulgarian, Russian, Greek, Turkish, and Thai. We also include Korean to follow up on past work on adapting the previous version of BLOOM (Yong and Nikoulina, 2022) and Guarani, which is a truly low-resource Native American language. Table 1 summarizes the unseen languages used in our experiments. They cover different language families and some of them do not share scripts with BLOOM's supported languages. + +# 3.3 Language Adaptation Strategies + +We carry out three language adaptation strategies to analyze their effects on zero-shot prompting. + +Continued Pretraining Continued pretraining strategy refers to continually training the BLOOM model with its causal language modeling pretraining objective on monolingual text of the new language (Chau et al., 2020; Ebrahimi and Kann, 2021; Muller et al., 2021). + +MAD-X We use the language adapter and the invertible adapter of the MAD-X configuration (Pfeiffer et al., 2020) to adapt BLOOM to new languages. Language adapter refers to the bottleneck adapter with down- and up-projection feedforward layers (Houlsby et al., 2019; Pfeiffer et al., 2021a) that are inserted into each Transformer block. The invertible adapter is used in the embedding layers to mitigate the mismatch between the original and new language vocabularies. + +$(\mathbf{IA})^{3}$ $(\mathrm{IA})^{3}$ is a parameter-efficient finetuning method that performs element-wise rescaling of inner Transformer block activations through learnable vectors (Liu et al., 2022). These vectors can be merged with the original pretrained weights of a model at inference to reduce latency by avoiding passing the activations through additional adapter modules. + +We experiment with $(\mathrm{IA})^3$ since it outperforms bottleneck adapters, which are used in MAD-X, and other parameter-efficient finetuning methods such as BitFit (Ben Zaken et al., 2022), LoRA (Hu et al., 2022), and FishMask (Sung et al., 2021) on English NLU tasks (Liu et al., 2022). Our preliminary experiments show that $(\mathrm{IA})^3$ performs better + +
LanguageLanguage FamilyWord OrderScriptSpace-SeparatedSeen Script
GermanIndo-European (Germanic)SVOLatin✓✓
BulgarianIndo-European (Slavic)SVOCyrillic✓✗
RussianIndo-European (Slavic)SVOCyrillic✓✗
GreekIndo-European (Hellenic)SVOGreek✓✗
TurkishTurkicSOVLatin✓✓
KoreanKoreanicSOVHangul✓✗
ThaiTai-KadaiSVOThai✗✗
GuaraniTupianSVOLatin✓✓
+ +Table 1: Information about the unseen languages used in our experiments. + +than these methods (see Appendix G), and thus we only run $(\mathrm{IA})^3$ due to computational constraints. + +As $(\mathrm{IA})^3$ does not adapt the embedding layer, we couple $(\mathrm{IA})^3$ with invertible adapters for fairer comparison with MAD-X language adapters. Our preliminary experiments (Table 4) show performance gains when using invertible adapters with $(\mathrm{IA})^3$ . + +# 3.4 Language Adaptation Setting + +We randomly sample 100K samples from the deduplicated OSCAR subcorpora (Ortiz Suárez et al., 2019) of the respective languages for language adaptation to simulate low-resource settings. Since Guarani only has around 100 samples in OSCAR, we use Jojajovai parallel corpora (Chiruzzo et al., 2022), which contains 30K Guarani sentences. We perform 25K language adaptation training steps using a batch size of 8 and the sequence length of 1,024. See Appendix H for further details. + +We do not retrain the tokenizer as BLOOM uses byte-level BPE tokenization, which never produces unknown tokens; therefore, we can perform language adaptation without extending the vocabulary. We adapt the embedding layer in two different fashions. For continued pretraining, we make the embedding layer trainable. This follows prior work on language adaptation (Pfeiffer et al., 2020; Chau et al., 2020; Ebrahimi and Kann, 2021; Fujinuma et al., 2022). For MAD-X and $(\mathrm{IA})^3$ , we use invertible adapters to adapt the embedding layer while keeping the embeddings frozen. + +# 3.5 Tasks and Prompt Templates + +We evaluate the models on five multilingual NLU tasks, which cover natural language inference (XNLI (Conneau et al., 2018), KLUE-NLI (Park et al., 2021), and AmericasNLI (Ebrahimi et al., 2022)), commonsense reasoning (XCOPA (Ponti et al., 2020) and XStoryCloze (Lin et al., 2021)), anaphora resolution (XWinograd (Tikhonov and Ryabinin, 2021)), and paraphrasing (PAWS-X + +(Yang et al., 2019)). We perform zero-shot prompting without any task-specific finetuning and simply reuse the templates used to prompt the XGLM model Lin et al. (2021) without performing any prompt engineering. We translate the prompt templates using automatic translation APIs, and the translated templates can be found in Appendix F. + +# 3.6 Baselines + +We compare the adapted BLOOM model against generative multilingual language models which have reported state-of-the-art prompting performance. We also report the prompting performance of the original BLOOM models without any adaptation. + +XGLM XGLM models (Lin et al., 2021) cover 30 natural languages and come in five different numbers of parameters: 564M, 1.7B, 2.9B, 4.9B, and 7.5B. + +mGPT mGPT (Shliazhko et al., 2022) is a GPT model trained on 60 languages from 25 language families using Wikipedia and Colossal Clean Crawled Corpus. It only has 1.3B parameters. + +BLOOMZ and mT0 BLOOMZ and mT0 are BLOOM and mT5 models finetuned on a multilingual task mixture, xP3 (Muennighoff et al., 2022). Here we report performance on the best prompts, which corresponds to instructions being in English while the context and the label are generally non-English. We also do not report performance on PAWS-X data since it is part of the xP3 training mixture. + +Among the baselines, XGLM, mGPT, and mT0 have seen all the new languages in Table 1 except Guarani during model pretraining. + +![](images/7028568aef329041115e089644bb5bb0a8e54f9160658d3e5de7a26d7e049801.jpg) +Figure 1: Results for zero-shot prompt-based evaluation of natural language inference, commonsense reasoning, anaphora resolution, and paraphrasing tasks. All tasks are evaluated with accuracy measure. Solid lines indicate language adaptation strategies, and dotted lines indicate baselines. $\times$ indicate the non-adapted BLOOM model. Both $\checkmark$ and $\times$ indicate whether the baseline has seen the language during pretraining, except for Guarani (GN) that is unseen for all models. We also ablate BLOOMZ and mT0 from PAWS-X evaluation as the models has been trained on the task. + +![](images/c7b295ed602f7a30c100796bd1105120e9d14b11a3968ee2de761285652b1783.jpg) +Figure 2: Average XNLI prompting performance for different categories of languages, split by whether it belongs to Indo-European (IE) family (left), whether its word order is SVO or SOV (middle), and whether its script system is seen during pretraining (right). + +# 4 Results and Discussion + +# 4.1 Zero-shot Prompting Performance + +Figure 1 shows that language adaptation improves the original BLOOM's zero-shot prompting for + +unseen languages under the resource-constrained setting. Furthermore, in general, language adaptation follows the scaling law which dictates that performance gains correlate with model sizes. We note that when the BLOOM transformer model becomes wider (from 560M to 1.7B parameters), certain tasks such as German XNLI and PAWSX experience performance drops. + +For the smallest BLOOM model with 560 million parameters, we see that continued pretraining yields the best prompting performance. Our result supports Ebrahimi and Kann's (2021) findings that continued pretraining of masked language models of similar size, such as mBERT and XLM-Roberta, gives better NER and POS tagging performance than adapters. However, when model sizes increase beyond 3 billion parameters, adapter-based language adaptation methods outperform continued pretraining despite having fewer trainable parameters. Furthermore, contrary to previous findings (Yong and Nikoulina, 2022), BLOOM adapts well to new languages regardless of their lan + +![](images/37f871b65b4c699720582a54423c2155de0f5a8169f7786c02ed8c844ea927cd.jpg) +Figure 3: Comparison between different language adaptation strategies for BLOOM models on the number of trainable parameters $(\downarrow)$ , total training time $(\downarrow)$ , inference 'time per prompt on XNLI test set $(\downarrow)$ , and maximum GPU memory usage $(\downarrow)$ on a single A100 GPU machine. + +![](images/1c14af731797d69d58f0fe596a4d632cbb4d97d9f697a9c976d0b87d4d33465d.jpg) + +![](images/93247f9e2820eb66ea00268213af6b4145d05310865f8716895c1e8425bf28c0.jpg) + +![](images/d5c1261779167a1aedd5e7b88ebb9b17d4a9dac7d1ca3702d11d00ea15b8048a.jpg) + +guage family, word order, and whether they share the same script system with languages in pretraining data (Figure 2). We note that there are many differences in Yong and Nikoulina's (2022) setting. Yong and Nikoulina (2022) used a multilingual model that uses learned positional embeddings instead of Alibi (Press et al., 2022) and that only supports 13 languages. They also finetuned both the learned positional and word embedding layers. + +We find that the adapted BLOOM matches mGPT's performance in several XNLI tasks and even outperforms XGLM and mT0 on the German PAWS-X and Russian XWinograd tasks. Nonetheless, mT0, which has seen the languages during pretraining and is trained on a multilingual task prompts mixture, exhibits the best zero-shot prompting performance when model parameters are increased. + +We find the adapted BLOOM performs poorly on Guarani, which is a truly low-resource language. Language adaptation only boosts the performance when models beyond 3 billion parameters are used. We believe this is due to the limited Guarani adaptation training data (30K as opposed to 100K for other languages) as supported by the findings in Section 4.4. + +Best Language Adaptation Strategy We recommend that the smallest BLOOM model should be adapted with continued pretraining, but larger BLOOM models should be adapted with adapters due to better performance (Figure 1) and compute efficiency (Figure 3). We find MAD-X language adapters give better average zero-shot prompting performance, but $(\mathrm{IA})^3$ adapters have a slight edge in training efficiency due to significantly fewer trainable parameters and smaller training time for larger models. + +![](images/5bb5f974692ae1acdd2bab99b3cb32ba40d2c344e7c79dcd04c9dd38be9a1023.jpg) +Figure 4: Perplexity curves of continued pretraining and MAD-X language adapters across all BLOOM model sizes on Russian held-out data. + +# 4.2 Perplexity + +Perplexity can be viewed as a measure of uncertainty when predicting the next token in a sequence, and better language modeling ability means lower perplexity. Figure 4 shows that evaluation perplexity on Russian texts for continued pretraining and MAD-X language adapters. We find that perplexity during language adaptation training does not necessarily correlate with prompting performance. While perplexity becomes lower for larger models, there is a drop in XWinograd performance for both language adaptation strategies when the model capacity increases from 1.1 billion to 1.7 billion parameters. Furthermore, even though continued pretraining has a lower perplexity than MAD-X language adapters, which suggests that continually-pretrained models better model the Russian OSCAR data, continually-pretrained BLOOM underperform their counterparts for larger model sizes in both XWinograd and XNLI tasks. This finding is in line with Liang et al.'s (2022) work that highlights the mismatch between perplexity and downstream + +![](images/9a9e79d77e67c8cca1b74f4bdf65cd9d386e9a8f8103237faaf83cd07c7bd01b.jpg) +Figure 5: Sentence retrieval accuracy for Russian before and after adaptation with MAD-X adapters and continued pretraining. + +![](images/4fd10317c11d66556b25ca97fe1b296d9dbdbfc618eb1d48e179c563d41b6a34.jpg) + +![](images/fc8d5641ff37cf60e4a3e098e604973cdb4ba6871cee86f33851f2226e50064d.jpg) + +![](images/3e88f265e5b2df915c510642797eaf21975c1b8828fc7d5b0a1ec44c9b33890c.jpg) + +![](images/afc785729c04f111593908428180786991e3b4304b83329a8c6abc44e2ceb510.jpg) + +task performance. + +# 4.3 Connection to Language Independent Representation + +Figure 5 reports sentence retrieval (SR) accuracy for Russian for non-adapted models, as well as models adapted via MAD-X adapters or continued pretraining. We use sentence retrieval accuracy as a way to measure quality of language independent representation, more details in the Appendix B. Note, that in this setting the representations of Russian are based on the adapted model, while representations of English are based on the original model, which excludes the problem of potential catastrophic forgetting. We see that before adaptation, the SR accuracy is very low overall, but bigger model demonstrate better SR results. With adaptation, SR accuracy drastically improves. + +For BLOOM adapted with MAD-X, SR accuracy improves as model grows in parameters. The reason is that adapters' trainable parameters grow in size so they represent Russian sentences better and larger model start from better representations of both languages. Interestingly, for continued pretraining, the best SR accuracy result is achieved with the smallest BLOOM model with 560 million parameters, while larger models achieve much lower SR accuracy. This phenomenon goes against the scaling law and is opposite to what has been observed for MAD-X. + +Some previous works (Dufter and Schütze, 2020) suggest that smaller model would emerge better language-independent representations as it is forced to reuse the same parameters for different languages. However, when model grows it has more freedom to partition its' parameters between languages. Note that this observation has been made in the synthetic settings and to the best of our knowledge has not been confirmed in real mul + +tilingual models. Our results in Figure 5 could be seen as an additional support to that initial hypothesis. When doing continued pretraining with relatively small set of the language adaptation data, there are many ways for the model to optimize it's performance (cf Lottery ticket hypothesis (Frankle and Carbin, 2019)). If the model had more freedom to partition its' parameters between different languages, there is no guarantee that the continued pretraining would leverage English-related parameters and therefore could diverge its representation space further away from English. We hypothesize that this could be a possible explanation of degradation of continued pretraining sentence retrieval accuracy for larger models. + +# 4.4 Amount of Language Adaptation Data + +![](images/4eb504bacd1e1e4dcd41053730cc64a5848d9382eb43186e9fb47855a986f46f.jpg) +Figure 6: Effects of the amount of language adaptation training data on zero-shot prompting of various Russian (RU) and Turkish (TR) tasks. "No adapt" denotes the non-adapted BLOOM model. + +We simulate different low-resource settings with BLOOM-3B using different amounts of adaptation training data. We use 1K, 10K and 100K samples to simulate different degrees of low-resource settings (see Figure 12). Figure 6 demonstrates a positive correlation between the size of adaptation training data and zero-shot prompting performance. We see that, when adapted with less than 100K sam + +plies, BLOOM performs worse than its non-adapted counterpart for tasks such as Russian XNLI and Turkish XCOPA. In other words, based on Figure 6 and Table 6, we need around 100 million tokens of the new language for effective language adaptation. However, surprisingly, the extent of the negative effect of low-resource setting can be limited to the type of tasks. For instance, for the same language Russian, we observe a limited effect of low-resource setting on XWinograd and XStoryCloze prompting. + +# 4.5 Adapters' Capacity + +![](images/87af3e2c4ac590aa801800399c1063a22015ec9038fdc9777e04ecb5e2fc1a64.jpg) +Figure 7: Effects of the MAD-X language adapters' reduction factors on zero-shot prompting of various Russian (RU) and Turkish (TR) tasks. "No adapt" denotes the non-adapted BLOOM model. + +We investigate the effect of the size of adapters' capacity by varying the reduction factor (also known as compression rate (Rückle et al., 2021)) in the adapter's bottleneck layer. A smaller reduction value would lead to a larger amount of adapter parameters. Contrary to Yong and Nikoulina (2022), we observe a positive correlation between the amount of adapters' parameters and prompting performance (see Figure 7). + +# 4.6 Adapting BLOOMZ + +We also investigate language adaptation strategies for BLOOMZ, which is BLOOM finetuned on many different task prompts to achieve better cross-lingual and cross-task generalization (Muennighoff et al., 2022). + +![](images/79dcf5427e05beb912ae3b7f69655bed4d7a5a13e5e6d3219bb91069d99c400e.jpg) +Figure 8: Zero-shot prompting performance of adapted BLOOMZ-560m on German XNLI task. Each dot represents the accuracy of one prompt template, where blue dots indicate the results of non-adapted BLOOMZ and red dots BLOOMZ with adapters. + +# 4.6.1 Adding Language Support through Unlabeled Data + +Similar to adapting BLOOM, we train MAD-X language adapters for BLOOMZ using the same experimental setting on monolingual OSCAR data. In Figure 8, we show that BLOOMZ-560m has a median accuracy of around $38.5\%$ for the German XNLI tasks (left bar), but after language adaptation, it performs the worst with an accuracy as poor as a random classifier at $33\%$ (right bar). However, when equipped with BLOOM's language adapters (this is possible because BLOOM and BLOOMZ share the same architecture), BLOOMZ retains its prompting ability (middle bar). The result suggests that BLOOMZ loses its prompting capability gained from multitask instruction tuning after language adaptation on the free-form text of monolingual OSCAR corpora. + +# 4.6.2 Adding Language Support through Instruction Tuning + +We experiment with learning a new language during instruction tuning using the same recipe as BLOOMZ (Muennighoff et al., 2022). We use Russian, which BLOOM models have not intentionally seen during pretraining. We collect supervised natural language task data in Russian and finetune the pretrained 7.1 billion parameter BLOOM model to create two variants: (a) BLOOMZ-7.1B-RU, which is finetuned only on the Russian task data, and (b) BLOOMZ-7.1B-xP3RU, which is finetuned on the full xP3 dataset (Muennighoff et al., 2022) with Russian data added to it. We compare the two + +Figure 9: Performance on unseen language tasks in Russian of BLOOMZ variants. +![](images/876f3cb9c9f1ba9ccd8ad4233965ddc8fe328c01c03a5c2c6315bfc7cec8498c.jpg) +BLOOM-7.1B BLOOMZ-7.1B BLOOMZ-7.1B-RU BLOOMZ-7.1B-xP3RU + +![](images/ffa54bba87f813c01f29fe459b84d5b39e230f5be7d992a0a2092397d487db0c.jpg) + +![](images/6c99deafe5458a1de3bd9a3e694eac64967b0ae944edf79ca6ddabbfd1dedb76.jpg) + +models with BLOOM-7.1B and BLOOMZ-7.1B in Figure 9. We find that finetuning on only Russian (BLOOMZ-7.1B-RU) without the other languages and tasks in the xP3 mixture shows only tiny improvements over the pretrained baseline on XStoryCloze. This is likely due to the lack of diversity in the finetuning of BLOOMZ-7.1B-RU (Chung et al., 2022), as the Russian-only split contains fewer tasks and prompts than the full xP3 dataset. On the other hand, when adding Russian to the instruction tuning mixture (BLOOMZ-7.1B-xP3RU), the performance of the best prompt improves on XNLI and XStoryCloze. This means that adding new languages during multitask finetuning can be effective but requires additional diverse tasks in other languages. + +# 5 Conclusion + +We compare the compute-performance trade-off of different language adaptation strategies for extending BLOOM of various sizes to new languages. Contrary to previous work, we find that adapter-based strategies best adapt larger BLOOM models for prompting under low-resource settings. We also investigate different language adaptation factors such as the size of language adaptation data and capacity of adapters. Finally, we investigate the relationship between language adaptation and instruction tuning using the BLOOMZ model, where we find including new languages during instruction tuning most effective. + +# 6 Limitations + +# 6.1 Vocabulary and Embedding Adaptation + +We do not explore vocabulary and embedding adaptation. Our models used byte-level tokenization, and therefore can handle unseen scripts. However, one can argue that the tokenization of un + +seen scripts might be suboptimal. For instance, languages with unseen script will require longer post-tokenization, therefore impacting the performance efficiency. Koto et al. (2021) have shown that when adapting to a new domain, LM achieved better performance, despite the fact that the old vocabulary can support the new domain as well. Exploring the quality impact of token adaptation for new languages and new scripts would be very interesting. In parallel, exploring the best way to initialize embeddings of the newly formed tokens is also interesting. + +# 6.2 Parameter-Efficient Finetuning Strategies + +We have only considered a limited number of parameter-efficient finetuning strategies (see Section 3.3 and Appendix G) due to computational constraints. Nonetheless, we believe that other strategies such as prompt tuning (Lester et al., 2021; Tu et al., 2022) and ladder side-tuning (Sung et al., 2022) can adapt BLOOM as well as the adapter-based strategies explored in our experimental setting. Recent work has also shown that combining different types of parameter-efficient finetuning methods, including adapters, can lead to better performance (Mao et al., 2022; He et al., 2022). As we recommend adapter-based language adaptation for larger language models, it would be interesting to explore methods that combine adapters for better prompting performance. + +# 6.3 Low-Resource Languages + +One limitation of our work is that our set of new languages only covers one truly low-resource language, which is Guarani. As our work shows that 100 million tokens are needed for effective adaptation to prompt in a new language (see Section 4.4), a truly low-resource language usually lacks sufficient unlabeled data for such adaptation (Joshi + +et al., 2020). Therefore, we urge the community to study data-efficient methods for adapting large language models to prompt under an extremely low-resource setting. + +# 6.4 Generative Tasks + +Since we only cover natural language understanding tasks in our experimental setup, our findings may not generalize to generation tasks such as summarization. Furthermore, language adaptation on monolingual data can lead to catastrophic forgetting of seen languages (see Appendix L); therefore, adapted models are not suitable for multilingual generative tasks that require an understanding of multiple languages such as machine translation. Future work is needed for studying solutions to mitigate catastrophic forgetting. + +# 6.5 Experimental Settings + +We used the sequence length of 1024 by mistake (instead of 2048 as described in Scao et al. (2022)) as we followed prior work on adapting BLOOM models to new languages (Yong and Nikoulina, 2022). However, in principle, it should not change the conclusions we draw from our study since none of the evaluation tasks are done on sequences longer than 1024 tokens. Our post-hoc experimental results with the correct sequence length of 2048 (see Appendix N) also align with our results discussed in Section 4.1. + +We did not carry out adaptation for the largest BLOOM model and BLOOMZ model with 176 billion parameters due to prohibitive computational costs. We leave them for future work to explore language adaptation for language models with hundreds of billions of parameters. + +# References + +Alham Fikri Aji, Nikolay Bogoychev, Kenneth Heafield, and Rico Sennrich. 2020. In neural machine translation, what does transfer learning transfer? In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7701-7710. + +Alan Ansell, Edoardo Ponti, Anna Korhonen, and Ivan Vulic. 2022. Composable sparse fine-tuning for cross-lingual transfer. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1778-1796, Dublin, Ireland. Association for Computational Linguistics. + +Mikel Artetxe, Shruti Bhosale, Naman Goyal, Todor Mihaylov, Myle Ott, Sam Shleifer, Xi Victoria Lin, + +Jingfei Du, Srinivasan Iyer, Ramakanth Pasunuru, et al. 2021. Efficient large scale language modeling with mixtures of experts. arXiv preprint arXiv:2112.10684. +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. +Mikel Artetxe and Holger Schwenk. 2019. Massively Multilingual Sentence Embeddings for Zero-Shot Cross-Lingual Transfer and Beyond. Transactions of the Association for Computational Linguistics, 7:597-610. +Elad Ben Zaken, Yoav Goldberg, and Shauli Ravfogel. 2022. BitFit: Simple parameter-efficient fine-tuning for transformer-based masked language-models. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 1-9, Dublin, Ireland. Association for Computational Linguistics. +Alexandre Berard. 2021. Continual learning in multilingual NMT via language-specific embeddings. In Proceedings of the Sixth Conference on Machine Translation, pages 542-565, Online. Association for Computational Linguistics. +Sid Black, Leo Gao, Phil Wang, Connor Leahy, and Stella Biderman. 2021. Gpt-neo: Large scale autoregressive language modeling with mesh-tensorflow. If you use this software, please cite it using these metadata, 58. +Sidney Black, Stella Biderman, Eric Hallahan, Quentin Anthony, Leo Gao, Laurence Golding, Horace He, Connor Leahy, Kyle McDonell, Jason Phang, Michael Pieler, Usvsn Sai Prashanth, Shivanshu Purohit, Laria Reynolds, Jonathan Tow, Ben Wang, and Samuel Weinbach. 2022. GPT-NeoX-20B: An open-source autoregressive language model. In Proceedings of BigScience Episode #5 - Workshop on Challenges & Perspectives in Creating Large Language Models, pages 95-136, virtual+Dublin. Association for Computational Linguistics. +Ethan C. Chau, Lucy H. Lin, and Noah A. Smith. 2020. Parsing with multilingual BERT, a small corpus, and a small treebank. In *Findings of the Association for Computational Linguistics: EMNLP* 2020, pages 1324–1334, Online. Association for Computational Linguistics. +Luis Chiruzzo, Santiago Góngora, Aldo Alvarez, Gustavo Giménez-Lugo, Marvin Agüero-Torales, and Yliana Rodríguez. 2022. Jojajovai: A parallel Guarani-Spanish corpus for MT benchmarking. In Proceedings of the Thirteenth Language Resources and Evaluation Conference, pages 2098-2107, Marseille, France. European Language Resources Association. + +Hyung Won Chung, Le Hou, Shayne Longpre, Barret Zoph, Yi Tay, William Fedus, Eric Li, Xuezhi Wang, Mostafa Dehghani, Siddhartha Brahma, et al. 2022. Scaling instruction-finetuned language models. arXiv preprint arXiv:2210.11416. +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. +Alexis Conneau, Rudy Rinott, Guillaume Lample, Adina Williams, Samuel Bowman, Holger Schwenk, and Veselin Stoyanov. 2018. XNLI: Evaluating crosslingual sentence representations. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 2475-2485, Brussels, Belgium. Association for Computational Linguistics. +Javier De la Rosa and Andres Fernández. 2022. Zero-shot reading comprehension and reasoning for Spanish with bertin gpt-j-6b. Proceedings of the Iberian Languages Evaluation Forum (IberLEF 2022). +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. +Philipp Duffer and Hinrich Schütze. 2020. Identifying elements essential for BERT's multilinguality. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 4423-4437, Online. Association for Computational Linguistics. +Abteen Ebrahimi and Katharina Kann. 2021. How to adapt your pretrained multilingual model to 1600 languages. 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 4555-4567, Online. Association for Computational Linguistics. +Abteen Ebrahimi, Manuel Mager, Arturo Oncevay, Vishrav Chaudhary, Luis Chiruzzo, Angela Fan, John Ortega, Ricardo Ramos, Annette Rios, Ivan Vladimir Meza Ruiz, Gustavo Giménez-Lugo, Elisabeth Mager, Graham Neubig, Alexis Palmer, Rolando Coto-Solano, Thang Vu, and Katharina Kann. 2022. AmericasNLI: Evaluating zero-shot natural language understanding of pretrained multilingual models in truly low-resource languages. In Proceedings of the + +60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 6279-6299, Dublin, Ireland. Association for Computational Linguistics. +Fahim Faisal and Antonios Anastasopoulos. 2022. Phylogeny-inspired adaptation of multilingual models to new languages. In Proceedings of the 2nd Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics and the 12th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 434-452, Online only. Association for Computational Linguistics. +Jonathan Frankle and Michael Carbin. 2019. The lottery ticket hypothesis: Finding sparse, trainable neural networks. In International Conference on Learning Representations. +Jinlan Fu, See-Kiong Ng, and Pengfei Liu. 2022. Polyglot prompt: Multilingual multitask prompting. arXiv preprint arXiv:2204.14264. +Yoshinari Fujinuma, Jordan Boyd-Graber, and Katharina Kann. 2022. Match the script, adapt if multilingual: Analyzing the effect of multilingual pretraining on cross-lingual transferability. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1500–1512, Dublin, Ireland. Association for Computational Linguistics. +Philip Gage. 1994. A new algorithm for data compression. C Users Journal, 12(2):23-38. +Demi Guo, Alexander Rush, and Yoon Kim. 2021. Parameter-efficient transfer learning with diff pruning. 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 4884-4896, Online. Association for Computational Linguistics. +Junxian He, Chunting Zhou, Xuezhe Ma, Taylor Berg-Kirkpatrick, and Graham Neubig. 2022. Towards a unified view of parameter-efficient transfer learning. In International Conference on Learning Representations. +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, Lu Wang, and Weizhu Chen. 2022. LoRA: Low-rank adaptation of large language models. In International Conference on Learning Representations. + +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, Online. Association for Computational Linguistics. +Fajri Koto, Joy Han Lau, and Timothy Baldwin. 2021. Indobertweet: A pretrained language model for Indonesian twitter with effective domain-specific vocabulary initialization. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 10660-10668. +Julia Kreutzer, Isaac Caswell, Lisa Wang, Ahsan Wahab, Daan van Esch, Nasanbayar Ulzii-Orshikh, Allahsera Tapo, Nishant Subramani, Artem Sokolov, Claytone Sikasote, Monang Setyawan, Supheakmungkol Sarin, Sokhar Samb, Benoit Sagot, Clara Rivera, Annette Rios, Isabel Papadimitriou, Salomey Osei, Pedro Ortiz Suarez, Iroro Orife, Kelechi Ogueji, Andre Niyongabo Rubungo, Toan Q. Nguyen, Mathias Muller, Andre Muller, Shamsuddeen Hassan Muhammad, Nanda Muhammad, Ayanda Mnyakeni, Jamshidbek Mirzakhalov, Tapiwanashe Matangira, Colin Leong, Nze Lawson, Sneha Kudugunta, Yacine Jernite, Mathias Jenny, Orhan Firat, Bonaventure F. P. Dossou, Sakhile Dlamini, Nisansa de Silva, Sakine Cabuk Balli, Stella Biderman, Alessia Battisti, Ahmed Baruwa, Ankur Bapna, Pallavi Baljekar, Israel Abebe Azime, Ayodele Awokoya, Duygu Ataman, Orevaoghene Ahia, Oghenefego Ahia, Sweta Agrawal, and Mofetoluwa Adeyemi. 2022. Quality at a Glance: An Audit of Web-Crawled Multilingual Datasets. Transactions of the Association for Computational Linguistics, 10:50-72. +Hugo Laurencon, Lucile Saulnier, Thomas Wang, Christopher Akiki, Albert Villanova del Moral, Teven Le Scao, Leandro Von Werra, Chenghao Mou, Eduardo González Ponferrada, Huu Nguyen, Jörg Frohberg, Mario Šaško, Quentin Lhoest, Angelina McMillan-Major, Gérard Dupont, Stella Biderman, Anna Rogers, Loubna Ben allal, Francesco De Toni, Giada Pistilli, Olivier Nguyen, Somaieh Nikpoor, Maraim Masoud, Pierre Colombo, Javier de la Rosa, Paulo Villegas, Tristan Thrush, Shayne Longpre, Sebastian Nagel, Leon Weber, Manuel Romero Muñoz, Jian Zhu, Daniel Van Strien, Zaid Alyafeai, Khalid Almubarak, Vu Minh Chien, Itziar Gonzalez-Dios, Aitor Soroa, Kyle Lo, Manan Dey, Pedro Ortiz Suarez, Aaron Gokaslan, Shamik Bose, David Ifeoluwa Adelani, Long Phan, Hieu Tran, Ian Yu, Suhas Pai, Jenny Chim, Violette Lepercq, Suzana Ilic, Margaret Mitchell, Sasha Luccioni, and Yacine Jernite. 2022. The bigscience ROOTS corpus: A 1.6TB composite multilingual dataset. In Thirty-sixth Conference on Neural Information Processing Systems Datasets and Benchmarks Track. +Teven Le Scao and Alexander Rush. 2021. How many data points is a prompt worth? In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: + +Human Language Technologies, pages 2627-2636, Online. Association for Computational Linguistics. +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. +Percy Liang, Rishi Bommasani, Tony Lee, Dimitris Tsipras, Dilara Soylu, Michihiro Yasunaga, Yian Zhang, Deepak Narayanan, Yuhuai Wu, Ananya Kumar, Benjamin Newman, Binhang Yuan, Bobby Yan, Ce Zhang, Christian Cosgrove, Christopher D. Manning, Christopher Re, Diana Acosta-Navas, Drew A. Hudson, Eric Zelikman, Esin Durmus, Faisal Ladhak, Frieda Rong, Hongyu Ren, Huaxiu Yao, Jue Wang, Keshav Santhanam, Laurel Orr, Lucia Zheng, Mert Yuksekgonul, Mirac Suzgun, Nathan Kim, Neel Guha, Niladri Chatterji, Omar Khattab, Peter Henderson, Qian Huang, Ryan Chi, Sang Michael Xie, Shibani Santurkar, Surya Ganguli, Tatsunori Hashimoto, Thomas Icard, Tianyi Zhang, Vishrav Chaudhary, William Wang, Xuechen Li, Yifan Mai, Yuhui Zhang, and Yuta Koreeda. 2022. Holistic evaluation of language models. +Xi Victoria Lin, Todor Mihaylov, Mikel Artetxe, Tianlu Wang, Shuohui Chen, Daniel Simig, Myle Ott, Naman Goyal, Shruti Bhosale, Jingfei Du, Ramakanth Pasunuru, Sam Shleifer, Punit Singh Koura, Vishrav Chaudhary, Brian O'Horo, Jeff Wang, Luke Zettlemoyer, Zornitsa Kozareva, Mona Diab, Veselin Stoyanov, and Xian Li. 2021. Few-shot learning with multilingual language models. +Haokun Liu, Derek Tam, Mohammed Muqeeth, Jay Mohta, Tenghao Huang, Mohit Bansal, and Colin Raffel. 2022. Few-shot parameter-efficient fine-tuning is better and cheaper than in-context learning. arXiv preprint arXiv:2205.05638. +Pengfei Liu, Weizhe Yuan, Jinlan Fu, Zhengbao Jiang, Hiroaki Hayashi, and Graham Neubig. 2021. Pretrain, prompt, and predict: A systematic survey of prompting methods in natural language processing. arXiv preprint arXiv:2107.13586. +Yuning Mao, Lambert Mathias, Rui Hou, Amjad Almahairi, Hao Ma, Jiawei Han, Scott Yih, and Madian Khabsa. 2022. UniPELT: A unified framework for parameter-efficient language model tuning. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 6253-6264, Dublin, Ireland. Association for Computational Linguistics. +Niklas Muennighoff, Thomas Wang, Lintang Sutawika, Adam Roberts, Stella Biderman, Teven Le Scao, M Saiful Bari, Sheng Shen, Zheng-Xin Yong, Hailey Schoelkopf, et al. 2022. Crosslingual generalization through multitask finetuning. arXiv preprint arXiv:2211.01786. + +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. +Martin Müller and Florian Laurent. 2022. Cedille: A large autoregressive french language model. arXiv preprint arXiv:2202.03371. +Graham Neubig and Junjie Hu. 2018. Rapid adaptation of neural machine translation to new languages. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 875-880, Brussels, Belgium. Association for Computational Linguistics. +NovelAI. 2022. Data efficient language transfer with gpt-j. Accessed: 2023-01-16. +Pedro Javier Ortiz Suárez, Benoit Sagot, and Laurent Romary. 2019. Asynchronous pipelines for processing huge corpora on medium to low resource infrastructures. In Proceedings of the Workshop on Challenges in the Management of Large Corpora (CMLC-7) 2019. Cardiff, 22nd July 2019, pages 9 - 16, Mannheim. Leibniz-Institut für Deutsche Sprache. +Sungjoon Park, Jihyung Moon, Sungdong Kim, Won Ik Cho, Ji Yoon Han, Jangwon Park, Chisung Song, Junseong Kim, Youngsook Song, Taehwan Oh, Joohong Lee, Juhyun Oh, Sungwon Lyu, Younghoon Jeong, Inkwon Lee, Sangwoo Seo, Dongjun Lee, Hyunwoo Kim, Myeonghwa Lee, Seongbo Jang, Seungwon Do, Sunnyoung Kim, Kyungtae Lim, Jongwon Lee, Kyumin Park, Jamin Shin, Seonghyun Kim, Lucy Park, Alice Oh, Jung-Woo Ha, and Kyunghyun Cho. 2021. KLUE: Korean language understanding evaluation. In Thirty-fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track (Round 2). +Marinela Parovic, Goran Glavaš, Ivan Vulić, and Anna Korhonen. 2022. BAD-X: Bilingual adapters improve zero-shot cross-lingual transfer. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 1791–1799, Seattle, United States. Association for Computational Linguistics. +Jonas Pfeiffer, Naman Goyal, Xi Lin, Xian Li, James Cross, Sebastian Riedel, and Mikel Artetxe. 2022. Lifting the curse of multilinguality by pre-training modular transformers. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 3479-3495, Seattle, United States. Association for Computational Linguistics. + +Jonas Pfeiffer, Aishwarya Kamath, Andreas Rücklé, Kyunghyun Cho, and Iryna Gurevych. 2021a. 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, pages 487-503, Online. Association for Computational Linguistics. +Jonas Pfeiffer, Ivan Vulić, Iryna Gurevych, and Sebastian Ruder. 2020. MAD-X: An Adapter-Based Framework for Multi-Task Cross-Linguual Transfer. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 7654–7673, Online. Association for Computational Linguistics. +Jonas Pfeiffer, Ivan Vulic, Iryna Gurevych, and Sebastian Ruder. 2021b. UNKs everywhere: Adapting multilingual language models to new scripts. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 10186-10203, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Jerin Philip, Alexandre Berard, Matthias Galle, and Laurent Besacier. 2020. Monolingual adapters for zero-shot neural machine translation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 4465-4470, Online. Association for Computational Linguistics. +Edoardo Maria Ponti, Goran Glavaš, Olga Majewska, Qianchu Liu, Ivan Vulić, and Anna Korhonen. 2020. XCOPA: A multilingual dataset for causal commonsense reasoning. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 2362-2376, Online. Association for Computational Linguistics. +Ofir Press, Noah Smith, and Mike Lewis. 2022. Train short, test long: Attention with linear biases enables input length extrapolation. In International Conference on Learning Representations. +Kunxun Qi, Hai Wan, Jianfeng Du, and Haolan Chen. 2022. Enhancing cross-lingual natural language inference by prompt-learning from cross-lingual templates. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1910–1923, Dublin, Ireland. Association for Computational Linguistics. +Andreas Rückle, Gregor Geigle, Max Glockner, Tilman Beck, Jonas Pfeiffer, Nils Reimers, and Iryna Gurevych. 2021. AdapterDrop: On the efficiency of adapters in transformers. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 7930-7946, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Tven Le Scao, Angela Fan, Christopher Akiki, Ellie Pavlick, Suzana Ilic, Daniel Hesslow, Roman + +Castagné, Alexandra Sasha Luccioni, François Yvon, Matthias Galle, et al. 2022. Bloom: A 176b-parameter open-access multilingual language model. +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. +Freda Shi, Mirac Suzgun, Markus Freitag, Xuezhi Wang, Suraj Srivats, Soroush Vosoughi, Hyung Won Chung, Yi Tay, Sebastian Ruder, Denny Zhou, Dipanjan Das, and Jason Wei. 2023. Language models are multilingual chain-of-thought reasoners. In The Eleventh International Conference on Learning Representations. +Oleh Shliazhko, Alena Fenogenova, Maria Tikhonova, Vladislav Mikhailov, Anastasia Kozlova, and Tatiana Shavrina. 2022. mgpt: Few-shot learners go multilingual. +Yi-Lin Sung, Jaemin Cho, and Mohit Bansal. 2022. Lst: Ladder side-tuning for parameter and memory efficient transfer learning. arXiv preprint arXiv:2206.06522. +Yi-Lin Sung, Varun Nair, and Colin Raffel. 2021. Training neural networks with fixed sparse masks. In Advances in Neural Information Processing Systems. +Zeerak Talat, Aurélie Névoel, Stella Biderman, Miruna Clinciu, Manan Dey, Shayne Longpre, Sasha Luccioni, Maraim Masoud, Margaret Mitchell, Dragomir Radev, Shanya Sharma, Arjun Subramonian, Jaesung Tae, Samson Tan, Deepak Tunuguntla, and Oskar Van Der Wal. 2022. You reap what you sow: On the challenges of bias evaluation under multilingual settings. In Proceedings of BigScience Episode #5 – Workshop on Challenges & Perspectives in Creating Large Language Models, pages 26–41, virtual+Dublin. Association for Computational Linguistics. +Alexey Tikhonov and Max Ryabinin. 2021. It's All in the Heads: Using Attention Heads as a Baseline for Cross-Linguual Transfer in Commonsense Reasoning. In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, pages 3534-3546, Online. Association for Computational Linguistics. +Lifu Tu, Caiming Xiong, and Yingbo Zhou. 2022. Prompt-tuning can be much better than fine-tuning on cross-lingual understanding with multilingual language models. arXiv preprint arXiv:2210.12360. +Ahmet Üstün, Alexandre Berard, Laurent Besacier, and Matthias Galle. 2021. Multilingual unsupervised neural machine translation with denoising adapters. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 6650-6662, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Ben Wang and Aran Komatsuzaki. 2021. Gpt-j-6b: A 6 billion parameter autoregressive language model. + +Zihan Wang, Karthikeyan K, Stephen Mayhew, and Dan Roth. 2020. Extending multilingual BERT to low-resource languages. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 2649-2656, Online. Association for Computational Linguistics. +Genta Winata, Shijie Wu, Mayank Kulkarni, Thamar Solorio, and Daniel Preotiac-Pietro. 2022. Crosslingual few-shot learning on unseen languages. In Proceedings of the 2nd Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics and the 12th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 777-791, Online only. Association for Computational Linguistics. +Yinfei Yang, Yuan Zhang, Chris Tar, and Jason Baldridge. 2019. PAWS-X: A cross-lingual adversarial dataset for paraphrase identification. 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 3687-3692, Hong Kong, China. Association for Computational Linguistics. +Zheng-Xin Yong and Vassilina Nikoulina. 2022. Adapting bigscience multilingual model to unseen languages. arXiv preprint arXiv:2204.04873. +Rong Zhang, Revanth Gangi Reddy, Md Arafat Sultan, Vittorio Castelli, Anthony Ferritto, Radu Florian, Efsun Sarioglu Kayi, Salim Roukos, Avi Sil, and Todd Ward. 2020. Multi-stage pre-training for low-resource domain adaptation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 5461-5468, Online. Association for Computational Linguistics. +Susan Zhang, Stephen Roller, Naman Goyal, Mikel Artetxe, Moya Chen, Shuohui Chen, Christopher Dewan, Mona Diab, Xian Li, Xi Victoria Lin, et al. 2022. Opt: Open pre-trained transformer language models. arXiv preprint arXiv:2205.01068. +Mengjie Zhao and Hinrich Schütze. 2021. Discrete and soft prompting for multilingual models. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 8547-8555, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. + +# Appendix + +# A Authors' Contributions + +Our work extended the language support of the BLOOM model (Scao et al., 2022) that was created under the BigScience project, a year-long initiative to create open-source large multilingual language models in a transparent manner which involves 600 researchers from over 50 countries and 250 institutions. All authors came from the BigScience + +multilingual modeling working group, and in the following list, we document our contributions made to this work. + +Zheng-Xin Yong led the project, set up training and evaluation pipelines, coordinated resources and experiments, and wrote most of the paper. + +Vassilina Nikoulina advised the project. + +Zheng-Xin Yong and Vassilina Nikoulina initially conceptualized the project. + +Zheng-Xin Yong, Hailey Schoelkopf, and Lintang Sutawika implemented various parameter-efficient finetuning methods. + +Zheng-Xin Yong, Hailey Schoelkopf, Alham Fikri Aji, David Ifeoluwa Adelani, Khalid Al-mubarak, M Saiful Bari, Ahmed Baruwa, Jungo + +Kasai, and Vassilina Nikoulina performed language adaptation training and prompting evaluation to collect results. + +Zheng-Xin Yong and Niklas Muennighoff performed BLOOMZ language adaptation experiments. + +Vassilina Nikoulina performed the sentence retrieval experiments. + +Zheng-Xin Yong, Hailey Schoelkopf, Niklas Muennighoff, Alham Fikri Aji, David Ifeoluwa Adelani, Khalid Almubarak, Ahmed Baruwa, Jungo Kasai, Genta Indra Winata, Stella Biderman, Edward Raff, Dragomir Radev, and Vassilina Nikoulina contributed to the paper. + +# B How does Language Independent Representation changes with Model Sizes + +In this work we try to establish the connection between the quality of language-independent representation a pretrained LM can emerge, and its adaptability to the new language. In order to evaluate the quality of language-independent representation we rely on sentence retrieval task (similar to (Dufter and Schütze, 2020; Artetxe and Schwenk, 2019)) computed on FLORES dataset. Sentence retrieval task is to identify closest sentence in English given a representation of the sentence in the new language, which imitates most popular knowledge transfer scenario, where we have final task data available in English only. In addition to what has been done previously, we compute sentence retrieval accuracy at each layer of the different pretrained models, to better understand where and how the language-independent representation + +emerges. Figure 10 reports the sentence retrieval accuracy for the subset of languages used to train BLOOM model, for different model sizes. We notice that all the models follow very similar pattern: first and last layers of the model show quite low SR accuracy, but intermediate layers are able to achieve almost perfect sentence retrieval accuracy for all model sizes. An exception is a set of very low-resource languages which seem to have very low Sentence Retrieval Accuracy from English. We do not notice any significant between models of different sizes for the languages that have been observed during training. + +# C Batch Sizes + +Figure 11 shows that the batch size of 8 is an optimal batch size considering the performance-compute trade-off. Performance increases quickly when batch size increases to 8 and slowly afterward. + +# D Composable Sparse-Finetuning + +Composable Sparse-Finetuning (C-SFT) is a sparse-finetuning method that finetunes language-specific and task-specific sparse subset of language model's parameters (mask), both of which demonstrates composability (Ansell et al., 2022). Since the authors demonstrate that this method outperforms MAD-X in language adaptation for POS and NER tasks, we also experimented with it on prompting. In our setting, we only finetuned the language-specific mask, and we followed Ansell et al. (2022) by freezing the output embedding and all layer normalization parameters. We reused the same hyperparameters but with an even split of 12,500 steps in both first and second stage of C-SFT. We ran our experiments using the publicly released code https://github.com/cambridgeltl/composable-sft/tree/6e3ef08cf0fc465d59285e529569387246028538. + +Our preliminary results with smaller BLOOM models show that models adapted by C-SFT are not capable of prompting (see Table 2) even though it improves sentence retrieval score (red $\nabla$ in Figure 14). In addition to the poor prompting performance, C-SFT requires finetuning the entire model and needs twice the GPU RAM memory than continued pretraining for storing a copy of the original model to compute the sparse mask. We found that we can improve prompting performance with longer C-SFT training steps. When we ran $25\mathrm{K}$ + +![](images/62c232f0a647eb133e632ffe676d986933935f8b7130f1b6f84d51bc2fd1f5c8.jpg) +Figure 10: Sentence Retrieval accuracy for known languages for different BLOOM models across layers. + +![](images/b1cf3c69f9e6904aa9bf3731dfe87fec5ffc2f3808503fc584f8bd4a44125d08.jpg) +Figure 11: German XNLI prompting performance with the BLOOM-560m model trained with various batch sizes of monolingual language adaptation data. + +training steps for both stages of C-SFT, totalling 50K language adaptation steps (instead of 25K total steps), German XNLI prompting performance improved from $33.01\%$ to $35.97\%$ . However, due to computational constraint, we did not run more experiments with C-SFT. + +
ModelsAdapt.DERUTR
Random-33.33%33.33%33.33%
BLOOM-560m-34.79%34.11%33.75%
BLOOM-560mMAD-X36.83%39.86%36.03%
BLOOM-560mC-SFT33.01%33.05%33.39%
BLOOM-1b1-39.64%39.62%33.43%
BLOOM-1b1MAD-X42.5%40.26%37.64%
BLOOM-1b1C-SFT34.93%33.49%33.39%
+ +Table 2: XNLI Accuracy for unadapted BLOOM model, MAD-X language adapters, and Composable Sparse-Finetuning (C-SFT). + +# E Korean PAWS-X + +Figure 1 shows that all models perform poorly on the Korean PAWS-X task, where a random classifier baseline scores $50\%$ . Our analysis with English templates shows that XGLM baseline, which is effective at code-mixed prompting setting (Lin et al., 2021), also performs poorly for Korean PAWS-X (see Figure 13). Therefore, we believe that the + +![](images/521100b7b9e46d568db3cd271fcf58afc20f487fcf4ad77caf4102b3eacf1cfd.jpg) +Figure 12: Distribution of language resources on OS-CAR (Ortiz Suárez et al., 2019) grouped by the level of resource setting (0 indicates very low-resource, 5 indicates high-resource) according to Joshi et al. (2020). + +prompt template is ineffective for Korean PAWS-X task. + +# F Prompt Templates + +We used the same templates proposed by (Lin et al., 2021) for prompting the XGLM model. Table 3 shows the English and translated templates for all the tasks. We did not manage to get Thai templates rendered with pdflatex, but the templates can be found on here for XNLI and here for XCOPA. + +# G Other Parameter-Efficient Finetuning Strategies + +We experimented with various parameter-efficient finetuning strategies for language adaptation, including BitFit (Ben Zaken et al., 2022), $(\mathrm{IA})^3$ (Liu et al., 2022), LoRA (Hu et al., 2022), and FishMask (Guo et al., 2021). We reported the best result from the two sets of hyperparameters, one reported in the original papers proposing the methods and the other reported in Appendix H). On German XNLI task, we found that MAD-X language adapters still yield the best prompting performance (see Table 4). + +
TasksLanguagesTemplatesVerbalizers
XNLIEN{PREMISE}, right? [Label], {HYPOTHESIS}Yes | No | Also
BG{PREMISE}, 충지? [Label], {HYPOTHESIS}Да | He | Осевноа
DE{PREMISE}, richtig? [Label], {HYPOTHESIS}Ja | Nein | Auch
EL{PREMISE}, 썼다? [Label], {HYPOTHESIS}Nama | Х | Еponи
RU{PREMISE}, 희다? [Label], {HYPOTHESIS}Дa | Het | А тоkees
KLUE-NLIKO{PREMISE}, 춤지? [Label], {HYPOTHESIS}에 | 어머오 | 친한
AmericasNLIGN{PREMISE}, 충지? [Label], {HYPOTHESIS}Hee | Nahániri | Ave
PAWS-XEN{SENTENCE 1}, right? [Label], {SENTENCE 2}Yes | No
DE{SENTENCE 1}, richtig? [Label], {SENTENCE 2}Ja | Nein
KO{SENTENCE 1}, 춤지? [Label], {SENTENCE 2}에 | 어머오
XStoryClozeEN{CONTEXT} [Label]Identity
RU
XWinogradEN{CONTEXT} (with '-' replaced by [Label])Identity
RU
XCOPAENcause: {SENTENCE 1} because [Label]Identity
TReffect: {SENTENCE 1} so [Label]
cause: {SENTENCE 1} 춤지 (Label)
effect: {SENTENCE 1} yani [Label]
+ +Table 3: Task templates for prompting BLOOM where "[Label]" is replaced with the answer choices in the verbalizers column. *NLI tasks' verbalizers correspond to entailment, contradiction, and neutral respectively, and PAWS-X's corresponds to true and false respectively. Identity verbalizer maps candidate choice to itself in multiple-choice tasks. + +![](images/6d0ad86cf434f87eb9751b7d20d2e4672ea6c05cd0fb9cbf2e696d8b817d0885.jpg) +Figure 13: XGLM model's zero-shot prompting performance on German and Korean PAWS-X task with prompt templates in its own language or English language. + +![](images/58a0680373fa3c19f8ffd7948e57d2ff88ec4ba764b592cd38f13e4a5432a24d.jpg) +Figure 14: Sentence retrieval accuracy for German with different language adaptation strategies. + +
Adapt.Accuracy
No Adaptation34.79
MAD-X (Bottleneck adapters)36.83
BitFit33.95
(IA)336.31
(IA)3 + invertible adapters36.47
LoRA35.79
FishMask35.59
+ +# H Language Adaptation Experimental Setup Details + +We trained for a total of 25,000 steps with a batch size of 8 and sequence length of 1024 on the monolingual corpora of the new language. In other words, the models are trained on around 204 million tokens. We evaluated every 5,000 steps on the perplexity of 1,000 held-out validation samples, and we took the best checkpoint for downstream prompting tasks. We defaulted to using a single RTX 3090 GPU machine for each language adaptation training, unless the model is too large or takes too long to run (for instance, performing continued pretraining for BLOOM with 7.1 billion parameters), which we would use eight A100 GPUs with 40GB RAM for training. We conducted single runs for each language adaptation due to computational constraint. + +We performed hyperparameter search on learning rates of $\{1\mathrm{e} - 3,1\mathrm{e} - 4,1\mathrm{e} - 5\}$ , linear and cosine decay, and warm-up ratio of $\{0,0.05,0.1\}$ using the Russian XNLI task and BLOOM-560m and -1b1 models. Table 5 reports the best set of hyperparameters. In general, we found that different sets of hyperparameters caused around $1\sim 2\%$ small difference in XNLI accuracy. Since our primary goal was to study trends and performance-compute trade-offs for language adaptation strategies, we did not perform extensive hyperparameter search. + +Table 4: German XNLI prompting performance with the BLOOM-560m model adapted by various parameter-efficient finetuning methods. + +
Adapt.LRDecayWarm-up Ratio
Continued Pretraining1e-4Linear0
MAD-X1e-4Linear0
(IA)31e-4Linear0.1
+ +Table 5: Best set of hyperparameters for language adaptation strategies. + +![](images/00a98601685cd926c79c3bf486266f183233728f9ddb9eb48592640516d62ae1.jpg) +Figure 15: Impact of adapter placement on the quality of model adaptation. Dashed line corresponds to the adapted model with an adapter placed at each layer (referred as mad-x in other experiments). + +# I Number of Tokens for Language Adaptation Data + +We report the number of tokens after preprocessed by BLOOM's BPE tokenizer for all the language adaptation training samples in Table 6. + +# J Placement of Adapters + +We examined how adapters' placement impacts the overall performance. For this, we kept a single adapter at different layers of the model, where we increased the bottleneck size in a way to match the same parameter count of the model with a full set of adapters. Figure 15 compares adapter placement results on XNLI task. We note that layers in the middle benefit less from the language adaptation, and the last layers benefit most from the language adaptation. + +![](images/86a25fa78d41c818e3fcd62343c902dc1d55fd65abfeba5b8e00895b0cbb10bb.jpg) +Figure 16: Performance on natural language inference tasks with and without invertible adapters (inv.adpt.) adapting BLOOM's embedding layer. "No adapt" denotes the non-adapted BLOOM model. + +# K Ablations + +Invertible Adapters We analyzed the performance of MAD-X with and without invertible adapters, which are used to adapt the embedding layer of BLOOM-3b, on prompting for natural language inference tasks. Figure 16 shows that invertible adapters only improve performance for German, Bulgarian, and Turkish. This implies that the prompting performance gain from language adaptation mainly results from adapting the Transformer blocks. + +![](images/456e89e273c6ae2d43add3d83e5ad415cb8b912347e716adc78bf5293543fb77.jpg) +Figure 17: XNLI RU performance with and without pretraining of BLOOM. + +Model Pretraining We also performed language adaptation with continued pretraining and MAD-X language adapters on a randomly initialized BLOOM. Figure 17 shows that, without pretraining, the adapted BLOOM model behaves like a random classifier on the XNLI task. Our results confirm that knowledge transfer takes place during language adaptation of pretrained models. + +
LanguagesNumber of SamplesNumber of Tokens
BG100K120M
DE100K75M
EL100K160M
GN30K1M
KO100K155M
RU100K140M
RU10K14M
RU1K1.4M
TH100K160M
TR100K90M
TR10K9M
TR1K0.9M
+ +Table 6: Number of byte-level tokens in the randomly sampled OSCAR data used for language adaptation. Guarani only has 30K samples, fully taken from Chiruzzo et al.'s (2022) corpora. + +# L Catastrophic Forgetting + +We observe that continued pretraining leads to catastrophic forgetting of seen languages when we evaluated adapted BLOOM on the English XNLI task (Figure 18). + +![](images/1290754839782f557878b44bb2ade8f7966a9eb44978580ae497431d39192b72.jpg) +Figure 18: Continued pretraining causes catastrophic forgetting on English, regardless of model sizes. + +# M Pretraining Languages Existing in BLOOM + +Table 7 shows the distribution of natural and programming languages in the ROOTS pretraining data (Scao et al., 2022; Laurençon et al., 2022). + +# N Post-Hoc Experiments + +Sequence Lengths of 2048 We adapted BLOOM-7.1B model for Thai and Greek using with the sequence length of 2048 instead of 1024 and training steps of 12500. We picked these two languages because they have the most number of tokens in the 100K samples (see Table 6), and we halved the training steps to maintain the same number of tokens seen during language adaptation since we doubled the sequence length. The rest of the setup follows Section 3.4. Figure 19 shows that adapters-based strategies still outperform continued-pretraining when we use the sequence length of 2048, which is consistent with our results discussed in Section 4.1. + +# O Artifacts + +For the pretrained models used in our study, BLOOM (Scao et al., 2022) and BLOOMZ models (Muennighoff et al., 2022) are released under the RAIL license, whereas mGPT (Shliazhko et al., 2022) and mT0 (Muennighoff et al., 2022) are re + +![](images/8433d392e194271f8294b471504cbc3c8e70647237c23c052d07646ddf44bf42.jpg) +Figure 19: Comparison of prompting performance between sequence lengths of 1024 and 2048 during language adaptation for Thai (TH) and Greek (EL) languages with continued pretraining and MADX adapters. + +leased under the Apache 2.0 license. XGLM (Lin et al., 2021) is released under the MIT license. + +OSCAR data (Ortiz Suárez et al., 2019), which is used to adapt BLOOM models, are released under the Creative Commons designation CC0 1.0 Universal license. whereas Guarani data (Chiruzzo et al., 2022) are released under the MIT license. + +XNLI (Conneau et al., 2018) are released under the Attribution-NonCommercial 4.0 International license, KLUE-NLI (Park et al., 2021) and AmericasNLI (Ebrahimmi et al., 2022) under the Attribution-ShareAlike 4.0 International license, XCOPA (Ponti et al., 2020) under the Attribution 4.0 International license, XStoryCloze (Lin et al., 2021) under the MIT license, and PAWS-X (Yang et al., 2019) may be freely used for any purpose. + +
LanguageProportion (%)
English30.04
Simplified Chinese16.2
Traditional Chinese0.05
French12.9
Arabic4.6
Basque0.15
Catalan1.1
Indonesian1.2
Portuguese4.9
Spanish10.8
Vietnamese2.7
Chitumbuka0.00002
Assamese0.01
Kikuyu0.00004
Odia0.04
Bambara0.00004
Gujarati0.04
Akan0.00007
Marathi0.05
Xitsonga0.00007
Punjabi0.05
Sesotho0.00007
Kannada0.06
Chichewa0.0001
Nepali0.07
Setswana0.0002
Telugu0.09
Northern Sotho0.0002
Malayalam0.10
Fon0.0002
Urdu0.10
Kirundi0.0003
Tamil0.20
Wolof0.0004
Bengali0.50
Luganda0.0004
Lingala0.0002
Hindi0.70
chiShona0.001
isiZulu0.001
Igbo0.001
isiXhosa0.001
Kinyarwanda0.003
Yoruba0.006
Swahili0.02
Code*10.8
+ +Table 7: Information about the seen languages by BLOOM model. + +A For every submission: + +A1. Did you describe the limitations of your work? + +Yes. Section 6. + +A2. Did you discuss any potential risks of your work? + +We did not find our work present major risks. + +A3. Do the abstract and introduction summarize the paper's main claims? + +Section 1.1 summarize our core contributions. + +A4. Have you used AI writing assistants when working on this paper? + +Left blank. + +B Did you use or create scientific artifacts? + +Section 3.1 (BLOOM), 3.4 (OSCAR), and 3.5 (evaluation tasks) + +B1. Did you cite the creators of artifacts you used? + +Section 3.1 (BLOOM), 3.4 (OSCAR), and 3.5 (evaluation tasks) + +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? + +Appendix O. + +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +The existing artifacts used did not elaborate on the intended use, and our efforts in using these artifacts do not present safety risks for the community. We adhere to the license compliance of the existing artifacts. Our created artifacts are simply an extension of the original BLOOM model but for more languages, so we refer to the original paper for the intended use. + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? + +As we reuse existing datasets, we refer to the original works for such information. + +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? + +We explain the new language coverage of our artifacts in section 3.2. + +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. + +We explain the number of training samples in section 3.4, and we use the test split of the existing evaluation tasks. + +The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance. + +# C Did you run computational experiments? + +Section 3. + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +Figure 3 and Appendix G. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +Section 3.4 and Appendix G. + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +Results and setup are reported in Figure 1, section 3.4, and Appendix G. It is transparent that we are reporting results from single runs (indicated in setup). + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +We report our parameter settings in section 3 and release the code implementation in the abstract. + +# D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +No response. + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +No response. + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +No response. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +No response. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +No response. \ No newline at end of file diff --git a/bloom1addinglanguagesupporttobloomforzeroshotprompting/images.zip b/bloom1addinglanguagesupporttobloomforzeroshotprompting/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..7626fe674539678282b948923d90e37150a3760b --- /dev/null +++ b/bloom1addinglanguagesupporttobloomforzeroshotprompting/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e771d7e8f707b58fff05d702d02f853793846a6dcb98ec16c351633fd710725 +size 959548 diff --git a/bloom1addinglanguagesupporttobloomforzeroshotprompting/layout.json b/bloom1addinglanguagesupporttobloomforzeroshotprompting/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..1f763f252439f57e684596685926c3f6c92259da --- /dev/null +++ b/bloom1addinglanguagesupporttobloomforzeroshotprompting/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ffa481a4c1ad4fccd0d0a78183e4b8f1e066a23d60282246f3cee129c5156b19 +size 604316 diff --git a/breakbreakingthedialoguestatetrackingbarrierwithbeamsearchandreranking/eea05d72-e8fd-4c7b-b48a-3fcb3959f562_content_list.json b/breakbreakingthedialoguestatetrackingbarrierwithbeamsearchandreranking/eea05d72-e8fd-4c7b-b48a-3fcb3959f562_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..787de686a282bad7ba72281b7993e71839ad6409 --- /dev/null +++ b/breakbreakingthedialoguestatetrackingbarrierwithbeamsearchandreranking/eea05d72-e8fd-4c7b-b48a-3fcb3959f562_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1feb5a646378803c915d87931eb90efcf2bfeb745f6772e049bee71f9f03226c +size 98419 diff --git a/breakbreakingthedialoguestatetrackingbarrierwithbeamsearchandreranking/eea05d72-e8fd-4c7b-b48a-3fcb3959f562_model.json b/breakbreakingthedialoguestatetrackingbarrierwithbeamsearchandreranking/eea05d72-e8fd-4c7b-b48a-3fcb3959f562_model.json new file mode 100644 index 0000000000000000000000000000000000000000..489c33d347274961371ba7fe77ca5ab3769a2ef7 --- /dev/null +++ b/breakbreakingthedialoguestatetrackingbarrierwithbeamsearchandreranking/eea05d72-e8fd-4c7b-b48a-3fcb3959f562_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7df4c78307569fb8d68048f8bc05f54509c666c76503440c3a9db95f2b779662 +size 119925 diff --git a/breakbreakingthedialoguestatetrackingbarrierwithbeamsearchandreranking/eea05d72-e8fd-4c7b-b48a-3fcb3959f562_origin.pdf b/breakbreakingthedialoguestatetrackingbarrierwithbeamsearchandreranking/eea05d72-e8fd-4c7b-b48a-3fcb3959f562_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d126da2e9b1ab8a88bee4d0cdb582758ec78731e --- /dev/null +++ b/breakbreakingthedialoguestatetrackingbarrierwithbeamsearchandreranking/eea05d72-e8fd-4c7b-b48a-3fcb3959f562_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0254131fd39ac8e91a2bc9f1b13757ce9a86aebe73ede7dcb0134e00b691e93b +size 975921 diff --git a/breakbreakingthedialoguestatetrackingbarrierwithbeamsearchandreranking/full.md b/breakbreakingthedialoguestatetrackingbarrierwithbeamsearchandreranking/full.md new file mode 100644 index 0000000000000000000000000000000000000000..86641289d442501c4fb924c7347f706d9054672d --- /dev/null +++ b/breakbreakingthedialoguestatetrackingbarrierwithbeamsearchandreranking/full.md @@ -0,0 +1,461 @@ +# BREAK: Breaking the Dialogue State Tracking Barrier with Beam Search and Re-ranking + +Seunpgil Won $^{1,2}$ Heeyoung Kwak $^{4,5}$ Joongbo Shin $^{1}$ Janghoon Han $^{1}$ Kyomin Jung $^{2,3}$ + +$^{1}$ LG AI Research, $^{2}$ Seoul National University, $^{3}$ SNU-LG AI Research Center + +4NAVER AI Lab, 5NAVER Digital Healthcare Lab + +{seungpil.won, jb.shin, janghoon.han}@lgresearch.ai + +heeyoung.kwak@navercorp.com + +kjung@snu.ac.kr + +# Abstract + +Despite the recent advances in dialogue state tracking (DST), the joint goal accuracy (JGA) of the existing methods on MultiWOZ 2.1 still remains merely $60\%$ . In our preliminary error analysis, we find that beam search produces a pool of candidates that is likely to include the correct dialogue state. Motivated by this observation, we introduce a novel framework, called BREAK (Beam search and RE-rAnKing), that achieves outstanding performance on DST. Our proposed method performs DST in two stages: (i) generating $k$ -best dialogue state candidates with beam search and (ii) re-ranking the candidates to select the correct dialogue state. This simple yet powerful framework shows state-of-the-art performance on all versions of MultiWOZ and M2M datasets. Most notably, we push the joint goal accuracy to $80 - 90\%$ on MultiWOZ 2.1-2.4, which is an improvement of $23.6\%$ , $26.3\%$ , $21.7\%$ , and $10.8\%$ over the previous best-performing models, respectively. The data and code will be available at https://github.com/tony-won/DST-BREAK. + +# 1 Introduction + +Dialogue state tracking (DST) is an essential component of task-oriented dialogue (TOD) systems to help users achieve their specific goals, such as booking restaurants or finding attractions (Budzianowski et al., 2018). The task of DST is to understand the meaning of user utterances and keep track of users' intentions throughout the conversation. Since the results of DST affects the subsequent TOD tasks, i.e., dialogue policy and response generation, the accuracy of DST is crucial without a doubt (Kim et al., 2020; Lee et al., 2019). In DST, the dialogue state is typically represented by a set of (slot, value) pairs, e.g., ("hotel-area", "centre"). Here, the list of slots is a pre-defined set, and the corresponding values are extracted from the dialogue context. + +![](images/488f17b5d0a210f6fcc9c66acde0f0094f8933b3b6b82a00d6d0761e87b83bc5.jpg) +Figure 1: An example of dialogue state tracking with a generation-based model and its failure case. Greedy search fails to generate the accurate slot value for restaurant-book day. However, the output probability of the correct value sunday still ranks very high, providing a rationale for using beam search to reconsider the high-ranking tokens. + +Thanks to large-scale pre-trained language models (PLMs) (Devlin et al., 2019; Radford et al., 2019; Raffel et al., 2020), generation-based approaches to DST have achieved remarkable progress in recent years (Hosseini-Asl et al., 2020; Feng et al., 2021; Lee et al., 2021b). Generation-based approaches sequentially generate values in the pre-defined sequence format, conditioned on the dialogue context. Most importantly, as they perform DST in an open-vocabulary setting rather than relying on a pre-defined ontology, this formulation has the potential to handle unseen values during training (Kim et al., 2020; Lee et al., 2021b). Due to this advantage, various techniques built on generative PLMs have been proposed to improve the performance of DST, but the joint goal accuracy on MultiWOZ 2.1 (Eric et al., 2020) still remains less than $60\%$ + +To identify performance bottlenecks, we analyze the failure cases produced by generation-based DST models built upon PLMs (Radford et al., 2019; Raffel et al., 2020; Zhao et al., 2021). We find that most errors contain only one or two incorrect slot values. Furthermore, even at the decoding steps where the incorrect slot value has the highest output probability, the probability of the ground truth value still ranks very high, mostly in the top 4. The overall analysis motivates us to look into the beam search candidates rather than relying on decoding strategies that strictly select the sequence with the highest conditional probability. This is because beam search typically produces a set of candidates with high overlap (Meister et al., 2021), so it is useful in scenarios where only a few errors need to be corrected. Moreover, it allows tokens with a high output probability to be reconsidered as potential slot values. + +Motivated by these observations, we propose a novel framework for generation-based DST, called BREAK (Beam search and RE-rAnKing). BREAK consists of two stages at the inference phase: (i) generating multiple dialogue state candidates using beam search and (ii) re-ranking the candidates to select the correct dialogue state. Unlike the existing methods that rely solely on the model's generative power, our method effectively obtains the correct answer by re-examining the beam search candidates with a re-ranker. To the best of our knowledge, our work is the first to explore beam search and re-ranking in DST. + +The contributions of our work are summarized as follows: + +- Our analysis reveals that generation-based DST models still have a high output probability for ground truth values even when making wrong predictions, which provides a basis for re-considering beam search candidates rather than taking a single decoded sequence as the correct dialogue state. +- Motivated by our observation, we propose a simple yet powerful framework for generation-based DST that utilizes beam search and reranking. +- Our method achieves state-of-the-art performance by a significant margin on all versions of MultiWOZ and M2M datasets, breaking the existing performance barrier. + +# 2 Preliminaries + +In this section, we formally describe the problem and generation-based approach for DST. Then we report our in-depth analysis of the errors produced by generation-based DST models. + +# 2.1 Problem Statement + +We treat the DST task as a sequence-to-sequence problem, where the model processes the input sequence of utterances and generates a dialogue state tracked up to the current turn. More formally, let the input $C_t = [(U_1, M_1), \dots, (U_t, M_t)]$ be a sequence of utterances up to turn $t$ , where each $U$ and $M$ represent the user utterance and system response, respectively. Given the dialogue context $C_t$ , the model outputs a dialogue state $Y_t = \{(s_n, v_n) | s_n \in S\}$ . Here, $S = \{s_1, \dots, s_N\}$ denotes the set of pre-defined slots that comprise $N$ domain-slot pairs, and $v_n$ is the slot-specific value for slot $s_n$ . To sum up, we aim to learn a dialogue state tracker $\mathcal{F}: C_t \mapsto Y_t$ that takes the dialogue context $C_t$ as input and keeps track of the dialogue states $Y_t$ accurately throughout the dialogue. + +# 2.2 Generation-based Model for DST + +In this work, we are particularly interested in generation-based models built upon Transformers (Vaswani et al., 2017). Our method can be applied to either encoder-decoder (Raffel et al., 2020; Lewis et al., 2020) or decoder-only (Radford et al., 2019) models, yet we formally describe our method with the encoder-decoder structure. + +The input of the model consists of all turns of dialogue up to turn $t$ . All sequences are concatenated with [USER] and [SYS], where [USER] and [SYS] are special tokens for indicating the speaker of each utterance. + +$$ +C _ {t} = [ \text {U S E R} ] \oplus U _ {1} \oplus [ \text {S Y S} ] \oplus M _ {1} \oplus +$$ + +$$ +\dots \oplus [ \text {S Y S} ] \oplus M _ {t - 1} \oplus [ \text {U S E R} ] \oplus U _ {t}. \tag {1} +$$ + +Given the dialogue context, the encoder maps an input sequence $C_t$ to a sequence of continuous representations $\mathbf{H}_t^{(l)}$ as follows: + +$$ +\mathbf {H} _ {t} ^ {(0)} = \mathbf {E m b} \left(C _ {t}\right), \tag {2} +$$ + +$$ +\mathbf {H} _ {t} ^ {(l)} = \mathbf {E n c} _ {l} \left(\mathbf {H} _ {t} ^ {(l - 1)}\right), \tag {3} +$$ + +where $\mathbf{Emb}(\cdot)$ and $\mathbf{Enc}_l(\cdot)$ represent the initial embedding layer and the $l$ -th layer of the encoder, respectively. + +![](images/8728f01825e440dac7af9d474d42322edcaf8a8611a98ebd94fd817d4140235f.jpg) +(a) % distribution of the slot-level errors + +![](images/29b384492553ccf208c54d49934824f4c7f0635989883606597704e506861446.jpg) +(b) % distribution of the rank of the ground truth +Figure 2: The percentage distributions examined in the error analysis of T5 with greedy search. (a) The distribution of the number of incorrectly-predicted slots. (b) The distribution of the rank of the ground truth's output probability. The ground truth values are ranked in the top 4 in $92\%$ of the cases, most commonly in the 2nd. + +The decoder then generates a dialogue state token-by-token in a pre-defined sequence format. In other words, it sequentially predicts the probability of the current token conditioned on the encoder output embeddings $\mathbf{H}_t^{(L)}$ and all the previously generated tokens. Here, $L$ denotes the number of layers of the encoder. The output probability of the decoder at any decoding step $j$ is given as: + +$$ +P _ {\theta} \left(y _ {j} \mid y _ {< j}, C _ {t}\right) = \mathbf {D e c} \left(y _ {< j}, \mathbf {H} _ {t} ^ {(L)}\right), \tag {4} +$$ + +where $\theta$ represents the parameters of the encoder-decoder model. + +The training objective of the auto-regressive process is to maximize the log-likelihood of the target sequence $Y_{t} = \langle y_{1},y_{2},\ldots \rangle$ for the given input text $C_t$ as follows: + +$$ +\mathcal {L} = - \sum_ {j = 1} ^ {| Y _ {t} |} \log P _ {\theta} \left(y _ {j} \mid y _ {< j}, C _ {t}\right). \tag {5} +$$ + +During inference, greedy search, which selects the token with the highest probability at each timestep, is generally applied to produce the output sequence. + +
Beam sizeUnique values per slotSlot errors per candidate
102.001.22
303.201.40
504.061.43
+ +Table 1: Characteristics of beam search candidates generated by T5. We report the average number of unique values per slot for each $k$ -best candidate pool. For this, we exclude the slots that only have a 'none' value for all $k$ -best candidates. We also report the average number of slot-level errors for each candidate dialogue state. + +# 2.3 Preliminary Study on DST + +To identify performance bottlenecks in generation-based DST, we analyze the failure cases predicted with T5 (Raffel et al., 2020) using greedy search ${}^{2}$ . The error analysis for other models are provided in the Appendix A. + +First, we investigate how many slot values are incorrectly predicted in each instance of MultiWOZ 2.4 (Ye et al., 2022b). Our experiment shows that $91.6\%$ of the wrong predictions contain only one or two incorrect slot values, as shown in Figure 2-(a), which indicates that only a few slot-level errors contribute to the low JGA. This result is consistent with the fact that most of the existing DST models exhibit very high slot accuracy $^3$ ( $97\sim 99\%$ ) while having low JGA (Wu et al., 2019; Kim et al., 2020; Wang et al., 2022; Ye et al., 2022a,c). + +To further examine the errors, we explore the output probability distribution over the vocabulary at decoding steps where slot values are incorrectly predicted. Specifically, we check the ranking of the probability of the ground truth value when sorted in descending order. To illustrate with an example, suppose that the predicted value is $13:15$ and the ground-truth value is $13:45$ . The mis-predicted word is 15, and therefore we check the ranking of the correct word 45 at 15's decoding step. As a result, we find that the probability of decoding the ground truth value generally ranks very high. As shown in Figure 2-(b), around $92\%$ of the wrong predictions have ground truth values within the 4th place. + +All of our findings naturally lead to the use of beam search. First, beam search can be useful in + +![](images/774d42bef589266abb76e2f9394c1464c02731c65363a298c2761309a7bb3d45.jpg) +Figure 3: The overall process of BREAK. + +scenarios where only one or two errors need to be corrected, as they generate a set of sequences with high overlap (Meister et al., 2021). More importantly, beam search candidates are likely to contain the high-ranking tokens investigated in our analysis. In fact, generated candidates exhibit only a few unique values for each slot and have a small number of slot-level errors, as reported in Table 1. These observations suggest that the $k$ -best dialogue states generated by beam search can serve as a valuable candidate pool by combining highly probable slot values. This presents an opportunity to reconsider them as potential dialogue states. + +# 3 BREAK: Beam Search and Re-Ranking + +Based on the analysis in Section 2.3, we propose a novel framework for generation-based DST. Our approach, dubbed BREAK, utilizes Beam Search and RE-rAnKing at the inference phase. Specifically, given a trained DST model, the main idea is to generate dialogue state candidates using beam search and then find the correct dialogue state by re-ranking them. + +# 3.1 Generating Candidates with Beam Search + +The decoding process of dialogue state generation can be viewed as a problem of finding the optimal sequence $Y^{*} = \arg \max_{Y}\log p(Y|X)$ given the input $X$ . The current practice in generation-based DST is to use greedy search, the simplest + +heuristic of finding $Y^{*}$ . However, as described in Section 2.3, greedy search often fails to generate the accurate slot values since it simply selects only one token with the highest conditional probabilities $p(y_{j}|y_{< j},X)$ at each decoder step $j$ . + +Instead of considering only the one best token, beam search keeps track of $k$ most probable subsequences, allowing the exploration over a wider search space. Therefore, we adopt beam search to create valid candidates for dialogue states. The rationale behind using beam search is based on our analysis that the output probability of ground truth value is very high among all tokens. In the following sections, we denote the beam search candidates as $\mathcal{V}$ . + +# 3.2 Re-Ranking over Candidates + +After generating candidates with beam search, we need to select the correct dialogue state among them. To this end, a re-ranker learns to rank candidates by computing the semantic alignment between the given dialogue context $C_t$ and each candidate $Y_t' \in \mathcal{Y}$ . + +For a re-ranker, we use a model with BERT-based architecture. The input sequence is the concatenation of the dialogue context and the dialogue state candidate, $C_t \oplus Y_t'$ . Then we take the final hidden state vector of the [CLS] token as the aggregate representation for input pair $(C_t, Y_t')$ . A simple softmax classifier is added on top of the aggre + +gate representation, which we denote by $\mathbf{h}(C_t,Y_t')$ to compute the probability of each label $c\in \{0,1\}$ as follows: + +$$ +p \left(c \mid \mathbf {h} \left(C _ {t}, Y _ {t} ^ {\prime}\right)\right) = \operatorname {s o f t m a x} \left(W \mathbf {h} \left(C _ {t}, Y _ {t} ^ {\prime}\right)\right), \tag {6} +$$ + +where $W$ is the weight matrix for the classification layer. + +We train a re-ranker by minimizing cross-entropy loss to achieve the goal of scoring the correct candidate higher than other candidates. To this end, we construct a dataset consisting of the dialogue context $(C_t)$ , a pool of dialogue state candidates $(\mathcal{V})$ , and the label indicating whether each input pair $(C_t,Y_t' \in \mathcal{V})$ is correct or not. A finetuned dialogue state tracker is employed to construct this data. Using this model, we make inference on the DST training set with beam search to produce $\mathcal{V}$ for each $C_t$ . Then the ground truth is labeled as a positive sample, and all the wrong predictions are labeled as negative samples. The same process is applied to the validation set. + +At test time, the candidate with the largest score, which is the probability of being the correct answer $(c = 1)$ , is selected as the correct dialogue state as follows: + +$$ +\hat {Y} _ {t} = \underset {Y _ {t} ^ {\prime} \in \mathcal {Y}} {\operatorname {a r g m a x}} p (c = 1 | \mathbf {h} \left(C _ {t}, Y _ {t} ^ {\prime}\right)). \tag {7} +$$ + +# 4 Experimental Setup + +# 4.1 Model Variations + +Depending on the form of the output dialogue state $Y_{T}$ , we consider three variants of the model: + +(i) Sequential w/o none (SEQ): The decoder sequentially generates a set of slot-value pairs except when the value is none. The output sequence $Y_{t}$ has the following format: $s_i = v_i, s_j = v_j, \dots$ , where $v_{i}$ and $v_{j}$ are not none. +(ii) Sequential w/ none (SEQ-Full): In contrast to SEQ, the output sequence $Y_{t}$ includes none slot values. In other words, the decoder sequentially generates slot values for all pre-defined slots, with the format of $s_1 = v_1, s_2 = v_2, \dots, s_N = v_N$ . +(iii) Cloze-Style (CS): In this case, we formalize the DST problem as the equivalent cloze-style QA task. Specifically, we design a task-specific prompt + +$P$ as a cloze question, which has the following format: + +$$ +\begin{array}{l} P = s _ {1} \oplus [ S L O T \_ 1 ] \oplus s _ {2} \oplus [ S L O T \_ 2 ] \\ \oplus \dots \oplus s _ {N} \oplus [ S L O T \_ N ] \tag {8} \\ \end{array} +$$ + +where $s_n$ indicates the slot name (e.g., train-day), and [SLOT_n] is a special token for a placeholder that fills in the corresponding slot value. The task-specific prompt $P$ is concatenated with the dialogue context $C_t$ : + +$$ +X _ {t} = P \oplus C _ {t}. \tag {9} +$$ + +Given this prompt-augmented input $X_{t}$ , the model outputs the sequence $Y_{t}$ , which represents a cumulative dialogue state up to the current turn. + +$$ +\begin{array}{l} Y _ {t} = [ \text {S L O T} _ {-} 1 ] \oplus v _ {1} \oplus [ \text {S L O T} _ {-} 2 ] \oplus v _ {2} \oplus \\ \dots \oplus [ \text {S L O T} _ {\mathrm {N}} ] \oplus v _ {N} \tag {10} \\ \end{array} +$$ + +where $v_{k}$ is the corresponding slot values for the specific slot [SLOT_k]. + +# 4.2 Datasets + +MultiWOZ is the most extensively used benchmark for DST. It is a large-scale multi-domain dialogue dataset that contains about 10k multi-turn dialogues spanning over 8 domains. We conduct our experiments on MultiWOZ 2.1-2.4 (Eric et al., 2020; Zang et al., 2020; Han et al., 2021; Ye et al., 2022b), the improved versions made by continuously refining annotation errors from MultiWOZ 2.0 (Budzianowski et al., 2018). Following the previous works (Wu et al., 2019; Kim et al., 2020), we use only 5 domains {attraction, hotel, restaurant, taxi, train} with 30 domain-slot pairs, excluding {bus, hospital, police}. + +Machines Talking To Machines (M2M) (Shah et al., 2018) is the simulation-based dataset that contains 3k dialogues from the restaurant (Sim-M) and movie (Sim-R) domains. To collect the conversations, the outlines of the dialogue are first generated using self-play between the user and system agencies. Then, the generated outlines are paraphrased by crowd workers to get more diverse utterances. + +
ModelMWOZ 2.1MWOZ 2.2MWOZ 2.3MWOZ 2.4
Pre-defined ontology
STAR (Ye et al., 2021)56.4--73.6
LUNA (Wang et al., 2022)57.656.1--
MetaASSIST (STAR) (Ye et al., 2022c)---80.1
Open vocabulary
SOM-DST (Kim et al., 2020)53.0-55.566.8
TripPy (Heck et al., 2020)55.3-63.064.8
SimpleTOD (Hosseini-Asl et al., 2020)55.7-51.357.2
\( ^\diamond \)Seq2Seq-DU (Feng et al., 2021)56.154.4--
\( ^\diamond \)SDP-Ind (Lee et al., 2021b)56.757.6--
D3ST (XXL) (Zhao et al., 2022)57.858.760.875.9
\( ^\dagger \)ConvBERT-DG + Multi (Mehri et al., 2020)58.7-67.9-
\( ^\dagger \)TripPy + SCORE (Yu et al., 2020)60.5---
Our Method
GPT2 (greedy search)53.153.756.263.1
GPT2upper (beam size=50)88.1±0.189.6±0.588.2±0.495.0±0.4
T5 (greedy search)53.354.857.868.0
T5upper (beam size=50)87.6±0.189.7±0.288.0±0.593.9±0.3
BREAK-GPT281.4±0.284.2±0.484.0±0.190.9±0.2
BREAK-T581.3±0.185.0±0.184.7±0.490.7±0.2
+ +Table 2: Evaluation results on MultiWOZ 2.1-2.4 (± denotes the standard deviation). “-” indicates no public number is available. The existing best results and current best results are each marked in blue and red. $\diamond$ uses schema descriptions to train the model. $\dagger$ indicates that extra dialogue data is used to train the model. + +# 4.3 Evaluation Metric + +Joint goal accuracy (JGA) is a widely used metric to evaluate the performance of DST models. By definition, JGA is True if and only if all predicted values for all slots exactly match the ground-truth labels, otherwise False. + +# 4.4 Upper Bound of BREAK + +Since BREAK eventually selects one of the beam search candidates as the correct answer, we also present the upper bound of JGA for the dialogue state tracker $f$ . The upper bound $f_{\mathrm{upp}}$ is calculated as follows: + +$$ +f _ {\text {u p p e r}} = \sum_ {i = 1} ^ {M} \mathbb {1} \left\{Y ^ {(i)} \in \mathcal {Y} _ {f} ^ {(i)} \right\} / M, \tag {11} +$$ + +where $M$ denotes the total number of samples in the test set. The ground truth and beam search candidates of the $i^{th}$ sample are represented as $Y^{(i)}$ and $\mathcal{V}_f^{(i)}$ , respectively. + +# 4.5 Implementation Details + +For a fair comparison, we use the pre-processing script released by (Wu et al., 2019). + +# 4.5.1 Training + +Dialogue State Tracker. For our experiments, we employ T5-small (Raffel et al., 2020) and GPT2 (Radford et al., 2019) as a backbone using HuggingFace Transformers5. All the weights are initialized from the pre-trained checkpoint and then models are fine-tuned on MultiWOZ and M2M datasets. The detailed specification is as follows: (i) T5-small has 60M parameters containing 6 transformer blocks for both encoder and decoder, 8 attention heads, and 512 hidden units. (ii) GPT2 has 117M parameters containing 12 transformer blocks, 12 attention heads, and 768 hidden units. Both T5 and GPT2 are trained using AdamW (Loshchilov and Hutter, 2017) with a constant learning rate of 5e-5. Exceptionally, we use a learning rate of 1e-4 to train T5 on MultiWOZ datasets. During training, we set a batch size to 16 and a dropout rate to 0.1. The maximum sequence length of the encoder is set to the default value but set to 100 longer when using the cloze-style format. + +Re-Ranker. We use the pre-trained RoBERTa-base (Liu et al., 2019) for a re-ranker. RoBERTa + +base is built upon the BERT-based architecture with 12 transformer blocks, 12 attention heads, and 768 hidden units. The model is trained using AdamW (Loshchilov and Hutter, 2017) with a constant learning rate of 1e-5. During training, we set a batch size to 48 and a dropout rate to 0.1. The maximum sequence length is 512. + +# 4.5.2 Inference + +We run each evaluation three times with different seeds and report the average number for more reliable results. + +# 5 Experimental Results + +Unless otherwise noted, all T5-based results are obtained using the form of the cloze-style (CS). This is due to the computational efficiency, and more details are described in Section 5.4. + +# 5.1 Overall Results + +We present the evaluation results on MultiWOZ 2.1-2.4 in Table 2. In our experiments, we compare our method with the strong baselines: STAR (Ye et al., 2021), LUNA (Wang et al., 2022), MetaASSIST (STAR) (Ye et al., 2022c), SOM-DST (Kim et al., 2020), TripPy (Heck et al., 2020), SimpleTOD (Hosseini-Asl et al., 2020), Seq2SeqDU (Feng et al., 2021), SDP (Lee et al., 2021b), D3ST (XXL) (Zhao et al., 2022), ConvBERTDG + Multi (Mehri et al., 2020), and TripPy + SCORE (Yu et al., 2020). + +To validate the efficacy of our method, we first measure the upper bound of JGA described in Section 4.4. With a beam size of 50, both T5 and GPT2 show nearly $90\%$ upper bound JGA, particularly around $94 - 95\%$ on MultiWOZ 2.4. These results demonstrate that $k$ -best candidates produced by beam search are likely to contain the correct dialogue state that greedy search could not predict. + +Combined with re-ranking, BREAK consistently outperforms the existing methods by significant margins on all versions of MultiWOZ dataset. Most remarkably, our method achieves $23.6\%$ , $26.3\%$ , $21.7\%$ , and $10.8\%$ absolute performance improvement on MultiWOZ 2.1-2.4, respectively. In consequence, we push the boundaries of the performance on MultiWOZ to $80 - 90\%$ . Note that we obtain these results without using extra training data or increasing the model size. + +Table 3 shows the evaluation results on M2M. BREAK achieves state-of-the-art performance on all three evaluated datasets. Notably, on Sim-R, + +
ModelSim-MSim-RSim-M+R
*SMD-DST96.894.4-
LU-DST50.487.173.8
BERT-DST80.189.6-
Tripy83.590.0-
SDP-Ind83.389.688.0
Seq2Seq-DU--90.9
T587.890.889.8
T5upper bound97.0±0.897.5±0.597.1±0.3
BREAK-T594.7±0.494.7±0.794.6±0.7
+ +Table 3: Evaluation results on Sim-M and Sim-R. * should be considered as a kind of oracle because the target slot value processed by the DST model is guaranteed to be in the candidate list. ◆ means that schema descriptions are used to train the DST model. + +our method shows better performance than SMD-DST which has a kind of oracle upper bound. A significant challenge faced by M2M appears to be the model's ability to generalize in slots with high out-of-vocabulary rates $^{6}$ . T5 exhibits relatively lower accuracy in those slots, whereas BREAK-T5 demonstrates comparable performance to the other slots $^{7}$ . + +# 5.2 Effect of the Beam Size + +Figure 4 shows the performance of our method on MultiWOZ 2.1 and Sim-M with varying sizes of the beam search candidates. A larger beam size naturally leads to elevating the upper bound JGA of T5 since it can cover lower-ranking ground truth values. In our preliminary error analysis, most of the ground truth values are found to have very high-ranking output probabilities among the vocabulary. This finding is strongly supported by the dramatic increase in $\mathrm{T5}_{\mathrm{upper}}$ when the beam size increases from 1 to 2. Moreover, the performance of BREAK-T5 shows a similar trend to $\mathrm{T5}_{\mathrm{upper}}$ , indicating that a re-ranker finds the correct dialogue state well from the candidates with high overlap. However, a large beam size ( $>10$ ) rather causes performance degradation on Sim-M. Since there are only five slots in Sim-M, a large number of similar candidates can act as noise to a re-ranker. + +![](images/e516f85524185070a67d3532343da29403ef7e5f0a1a7daa855dc68b827631a0.jpg) +Figure 4: Performance of BREAK-T5 with varying beam sizes on MultiWOZ 2.1 and Sim-M. We examine the performance with the beam sizes of $\{1,2,3,5,10,15,20,30,40,50\}$ . The dashed line illustrates the upper bound performance of T5 on both datasets. + +![](images/25651f1e355123bf3e954e72e6b03ef42ec22f2832be1a70ceec1e41e0cdfeba.jpg) +Figure 5: Per-turn joint goal accuracy on MultiWOZ 2.1 and MultiWOZ 2.4. + +![](images/727c123248e7c5cf72d885c6eb07ea1335ca90d8da6c3595100c08cdf535a684.jpg) + +# 5.3 Per-Turn Joint Goal Accuracy + +In Figure 5, we compare the per-turn accuracy of our method with STAR and MetaASSIST (STAR) on MultiWOZ 2.1 and MultiWOZ 2.4. We also report the results of STAR-GT and MetaASSIST-GT, which use the ground truth dialogue state of the previous turn as the input at every turn. + +In general, the per-turn accuracy drastically decreases as the number of turns increases. This is because DST on longer dialogue contexts is more challenging, and JGA accumulates errors from the early turn until the end. Nevertheless, BREAK-T5 shows relatively stable performance regardless of the turn lengths. It even performs better than STAR-GT and MetaASSIST-GT for most turn lengths. + +For one-turn dialogues, however, the performance is comparable to or even worse than the baseline T5. Since similar candidates are compared for such a short dialogue context, it is difficult for a re-ranker to distinguish the correct one. For longer-turn dialogues, BREAK-T5 absolutely outperforms other baselines, whereas the performance of T5 and STAR is severely degraded. + +
FormatModel2.12.22.32.4
SEQGPT275.779.477.384.1
T575.479.677.183.9
SEQ-FullGPT281.484.284.090.9
T581.284.684.090.7
CST581.385.084.790.7
+ +Table 4: Comparison of the performance according to the output format. The results are obtained with a beam size of 50. + +
ModelFormatBeam Size
1103050
T5SEQ0.280.751.331.99
SEQ-FULL0.721.331.872.56
CS0.450.991.311.99
GPT2SEQ0.350.611.051.67
SEQ-FULL1.712.103.555.54
+ +Table 5: Comparison of the latency according to the output format. The unit is seconds. + +# 5.4 Effect of the Dialogue State Form + +Table 4 and Table 5 shows the performance and latency of our method for three different variations of the output sequence format. We measure the inference time per instance on RTX A5000 with a batch size of 1. In our experiments, GPT2/SEQ-Full $^{8}$ and T5/CS perform best overall. While GPT2/SEQ-Full exhibits comparable performance to T5/CS, it takes about 2.8 times longer inference time $^{9}$ . Since beam search is computationally expensive, we mainly report the results of T5/CS in this paper for time efficiency. The SEQ format is faster than other formats due to its short output sequence length, but its performance is relatively poor. This suggests that it is advantageous for BREAK to express the output sequence with a fixed template containing the entire slot list. In conclusion, our proposed cloze-style (CS) format is the most efficient for our method in terms of both performance and computation. + +# 6 Related Work + +# 6.1 Generation-based DST + +Recently, there have been promising results on the MultiWOZ datasets using generation-based ap + +GPT2 is known to be sensitive to additional special tokens. For this reason, we do not consider GPT2/CS. +${}^{9}$ This comes from the replacement of the slot name with one special token,e.g.,taxi-leaveat $\rightarrow$ [SLOT_0]. + +proaches. These models basically leverage the powerful generative capabilities of large-scale PLMs. On top of that, various techniques have been proposed to further improve the performance of DST: using schema descriptions (Feng et al., 2021; Lee et al., 2021b; Zhao et al., 2022), pre-training with multiple dialogue corpora or novel objectives (Peng et al., 2021; Su et al., 2022; Zhao et al., 2021), multi-task learning on different task-oriented tasks (Lin et al., 2020; Hosseini-Asl et al., 2020; Peng et al., 2021; Su et al., 2022), or increasing the size of PLMs (Zhao et al., 2022). On the other hand, our work does not require external dialogue data or additional information for the task. + +# 6.2 Beam Search and Re-Ranking + +Many recent studies in neural machine translation (NMT) and natural language generation (NLG), have proposed re-ranking over multiple candidates. These candidates are traditionally generated from a conditional language model with beam search decoding. This approach is particularly beneficial for auto-regressive models because the re-ranking model evaluates the candidate by attending over the entire sequence, which cannot be done in the decoding process. In NMT, re-ranker models are generally trained with the final evaluation metrics like BLEU (Lee et al., 2021a). In NLG, re-rankers are trained to realize all the attributes in the structured meaning representation (Dušek and Jurčićek, 2016; Juraska et al., 2018). However, stochastic decoding is also preferred over beam search to ensure diversity in the natural sentences (Kedzie and McKeown, 2019; Eikema and Aziz, 2020; Bhattacharyya et al., 2021; Fernandes et al., 2022). In contrast, DST aims to predict the accurate dialogue state, making the use of beam search even more appropriate. + +# 7 Conclusion + +We propose a simple yet effective framework for generation-based DST that breaks the performance barrier in DST. We design our framework based on our findings that the probability of ground truth value being generated by DST models is very high in most decoding steps. Our method effectively tracks the dialogue state by (i) generating beam search candidates and (ii) re-ranking them via assessing the semantic matching with the dialogue context. By exploring the highly probable dialogue state candidates discovered by beam search, our + +method significantly reduces errors compared to the decoding process that generates a single definitive dialogue state. In our experiments, we achieve state-of-the-art performance on MultiWOZ and M2M datasets by a significant margin, regardless of the backbone PLMs. For future work, we plan to improve the computational efficiency of the current framework to apply in real-world settings. + +# Limitations + +Our method shows impressive performance but relies entirely on beam search during inference. However, it is well known that beam search is a computationally expensive algorithm. With the beam size of 50, the latency increases from 3.6 times (T5/SEQ-FULL) to 7 times (T5/SEQ) compared to greedy decoding. In addition, the re-ranking process causes another latency (about 12ms in our experiments). Therefore, it may not be suitable for real-world DST scenarios. We leave this issue for future work. Potential directions may include reducing the current two-step pipeline to an efficient one-step process by employing a novel objective function, using data augmentation, or changing the sequential decoding process to a non-autoregressive approach that can be applied in a parallel manner. + +# Ethics Statement + +All datasets and models used in the experiments are from the publicly available website or Github. + +# Acknowledgements + +This work was supported by LG AI Research. This work was partly supported by Institute of Information communications Technology Planning Evaluation (IITP) grant funded by the Korea government(MSIT) [NO.2022-0-00184, Development and Study of AI Technologies to Inexpensively Conform to Evolving Policy on Ethics]. This work was supported in part by the National Research Foundation of Korea (NRF) grant funded by the Korea government (No. 2021R1A2C2008855). + +# References + +Sumanta Bhattacharyya, Amirmohammad Rooshenas, Subhajit Naskar, Simeng Sun, Mohit Iyyer, and Andrew McCallum. 2021. Energy-based reranking: Improving neural machine translation using energy-based 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 4528-4537, Online. Association for Computational Linguistics. +Paweł Budzianowski, Tsung-Hsien Wen, Bo-Hsiang Tseng, Iñigo 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. +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. +Ondrej Dusek and Filip Jurcicek. 2016. Sequenceto-sequence generation for spoken dialogue via deep syntax trees and strings. arXiv preprint arXiv:1606.05491. +Bryan Eikema and Wilker Aziz. 2020. Is map decoding all you need? the inadequacy of the mode in neural machine translation. arXiv preprint arXiv:2005.10283. +Mihail Eric, Rahul Goel, Shachi Paul, Abhishek Sethi, Sanchit Agarwal, Shuyang Gao, Adarsh Kumar, Anuj Goyal, Peter Ku, and Dilek Hakkani-Tur. 2020. MultiWOZ 2.1: A consolidated multi-domain dialogue dataset with state corrections and state tracking baselines. In Proceedings of the Twelfth Language Resources and Evaluation Conference, pages 422-428, Marseille, France. European Language Resources Association. +Yue Feng, Yang Wang, and Hang Li. 2021. A sequence-to-sequence approach to dialogue state tracking. 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 1714-1725, Online. Association for Computational Linguistics. +Patrick Fernandes, Antonio Farinhas, Ricardo Rei, José GC de Souza, Perez Ogayo, Graham Neubig, and André FT Martins. 2022. Quality-aware decoding for neural machine translation. arXiv preprint arXiv:2205.00978. +Ting Han, Ximing Liu, Ryuichi Takanabu, Yixin Lian, Chongxuan Huang, Dazhen Wan, Wei Peng, and Minlie Huang. 2021. Multiwoz 2.3: A multi-domain task-oriented dialogue dataset enhanced with annotation corrections and co-reference annotation. In CCF International Conference on Natural Language + +Processing and Chinese Computing, pages 206-218. Springer. +Michael Heck, Carel van Niekerk, Nurul Lubis, Christian Geishauser, Hsien-Chin Lin, Marco Moresi, and Milica Gasic. 2020. TripPy: A triple copy strategy for value independent neural dialog state tracking. In Proceedings of the 21th Annual Meeting of the Special Interest Group on Discourse and Dialogue, pages 35-44, 1st virtual meeting. Association for Computational Linguistics. +Ehsan Hosseini-Asl, Bryan McCann, Chien-Sheng Wu, Semih Yavuz, and Richard Socher. 2020. A simple language model for task-oriented dialogue. Advances in Neural Information Processing Systems, 33:20179-20191. +Juraj Juraska, Panagiotis Karagiannis, Kevin Bowden, and Marilyn Walker. 2018. A deep ensemble model with slot alignment for sequence-to-sequence natural language generation. 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 152-162, New Orleans, Louisiana. Association for Computational Linguistics. +Chris Kedzie and Kathleen McKeown. 2019. A good sample is hard to find: Noise injection sampling and self-training for neural language generation models. In Proceedings of the 12th International Conference on Natural Language Generation, pages 584-593, Tokyo, Japan. Association for Computational Linguistics. +Sungdong Kim, Sohee Yang, Gyuwan Kim, and Sang-Woo Lee. 2020. Efficient dialogue state tracking by selectively overwriting memory. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 567-582, Online. Association for Computational Linguistics. +Ann Lee, Michael Auli, and Marc'Aurelio Ranzato. 2021a. Discriminative reranking for 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 1: Long Papers), pages 7250-7264. +Chia-Hsuan Lee, Hao Cheng, and Mari Ostendorf. 2021b. Dialogue state tracking with a language model using schema-driven prompting. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 4937-4949, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Hwaran Lee, Jinsik Lee, and Tae-Yoon Kim. 2019. SUMBT: Slot-utterance matching for universal and scalable belief tracking. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 5478-5483, Florence, Italy. 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. +Zhaojiang Lin, Andrea Madotto, Genta Indra Winata, and Pascale Fung. 2020. MinTL: Minimalist transfer learning for task-oriented dialogue systems. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 3391-3405, Online. 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. +Ilya Loshchilov and Frank Hutter. 2017. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101. +Shikib Mehri, Mihail Eric, and Dilek Hakkani-Tur. 2020. Dialogue: A natural language understanding benchmark for task-oriented dialogue. arXiv preprint arXiv:2009.13570. +Clara Meister, Martina Forster, and Ryan Cotterell. 2021. Determinantal beam search. 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 6551-6562, Online. Association for Computational Linguistics. +Baolin Peng, Chunyuan Li, Jinchao Li, Shahin Shayandeh, Lars Liden, and Jianfeng Gao. 2021. Soloist: Buildingtask bots at scale with transfer learning and machine teaching. Transactions of the Association for Computational Linguistics, 9:807-824. +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. +Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J Liu, et al. 2020. Exploring the limits of transfer learning with a unified text-to-text transformer. J. Mach. Learn. Res., 21(140):1-67. +Pararth Shah, Dilek Hakkani-Tur, Gokhan Tur, Abhinav Rastogi, Ankur Bapna, Neha Nayak, and Larry Heck. 2018. Building a conversational agent overnight with dialogue self-play. arXiv preprint arXiv:1801.04871. +Yixuan Su, Lei Shu, Elman Mansimov, Arshit Gupta, Deng Cai, Yi-An Lai, and Yi Zhang. 2022. Multi-task pre-training for plug-and-play task-oriented dialogue + +system. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 4661-4676, Dublin, Ireland. 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. Advances in neural information processing systems, 30. +Yifan Wang, Jing Zhao, Junwei Bao, Chaoqun Duan, Youzheng Wu, and Xiaodong He. 2022. LUNA: Learning slot-turn alignment for dialogue state tracking. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 3319-3328, Seattle, United States. Association for Computational Linguistics. +Chien-Sheng Wu, Andrea Madotto, Ehsan Hosseini-Asl, Caiming Xiong, Richard Socher, and Pascale Fung. 2019. Transferable multi-domain state generator for task-oriented dialogue systems. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 808-819, Florence, Italy. Association for Computational Linguistics. +Fanghua Ye, Yue Feng, and Emine Yilmaz. 2022a. AS-SIST: Towards label noise-robust dialogue state tracking. In Findings of the Association for Computational Linguistics: ACL 2022, pages 2719-2731, Dublin, Ireland. Association for Computational Linguistics. +Fanghua Ye, Jarana Manotumruksa, and Emine Yilmaz. 2022b. MultiWOZ 2.4: A multi-domain task-oriented dialogue dataset with essential annotation corrections to improve state tracking evaluation. In Proceedings of the 23rd Annual Meeting of the Special Interest Group on Discourse and Dialogue, pages 351-360, Edinburgh, UK. Association for Computational Linguistics. +Fanghua Ye, Jarana Manotumruksa, Qiang Zhang, Shenghui Li, and Emine Yilmaz. 2021. Slot self-attentive dialogue state tracking. In Proceedings of the Web Conference 2021, pages 1598-1608. +Fanghua Ye, Xi Wang, Jie Huang, Shenghui Li, Samuel Stern, and Emine Yilmaz. 2022c. Metaassist: Robust dialogue state tracking with meta learning. arXiv preprint arXiv:2210.12397. +Tao Yu, Rui Zhang, Alex Polozov, Christopher Meek, and Ahmed Hassan Awadallah. 2020. Score: Pretraining for context representation in conversational semantic parsing. In International Conference on Learning Representations. +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. +Jeffrey Zhao, Raghav Gupta, Yuan Cao, Dian Yu, Mingqiu Wang, Harrison Lee, Abhinav Rastogi, Izhak Shafran, and Yonghui Wu. 2022. Description-driven task-oriented dialog modeling. arXiv preprint arXiv:2201.08904. +Jeffrey Zhao, Mahdis Mahdieh, Ye Zhang, Yuan Cao, and Yonghui Wu. 2021. Effective sequence-to-sequence dialogue state tracking. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 7486-7493, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. + +# A Error Analysis of DST models + +In addition to T5 (Raffel et al., 2020), we conduct error analysis for GPT2 (Radford et al., 2019) and STAR (Ye et al., 2021). T5 and GPT2 are the most commonly used backbone models for generation-based DST, which generate slot values sequentially. On the other hand, STAR performs pre-defined ontology-based DST by computing the distance between the dialogue context and each slot value. + +Regarding the slot-level errors, all three models show similar tendencies. The majority of incorrect predictions $(>90\%)$ result from one or two slot-level errors, as shown in Figure 6-(a). However, when it comes to the output probability, T5 and GPT2 follow similar patterns, while STAR shows distinct behavior. + +As shown in Figure 6-(b), at the decoding steps where incorrect slot values are generated, we observe that STAR has a relatively low-ranking output probability for ground truth values. While T5 and GPT2 have a ground truth value in the top-4 in over $90\%$ of cases, STAR has only about half of the cases in the top-6. Consequently, STAR is less likely to contain the correct answer among the beam search candidates, making it difficult to benefit from our proposed method. These results appear to be related to the characteristics of STAR, as highlighted in Table 6, where STAR tends to produce over-confident errors. + +
T5GPT2STAR
Top1-Error76.49%73.45%90.17%
Ground Truth17.97%18.86%5.23%
+ +Table 6: Comparison of the average output probabilities of ground truth and incorrectly-predicted values (top-1) with greedy search. + +![](images/acaa08c2c42cc1fe79aadab30c30fffe5bf47cb1ac5b9166c9a18916d4ff5a4c.jpg) +(a) % distribution of the slot-level errors + +![](images/9200865dd760fa1c1bcb569d02c0cfddb934cf7d0ea048bd83c6ada133cce906.jpg) +(b) % distribution of the rank of the ground truth +Figure 6: The percentage distributions examined in the error analysis of T5, GPT2, and STAR. (a) The distribution of the number of incorrectly-predicted slots. (b) The distribution of the rank of the ground truth's output probability. + +# A For every submission: + +A1. Did you describe the limitations of your work? + +Yes, we provide the limitations of our work in Section 7 (conclusion) and Limitation Section. + +A2. Did you discuss any potential risks of your work? + +There seem to be no potential risks. + +A3. Do the abstract and introduction summarize the paper's main claims? + +Yes, we summarize our claims in the Abstract and Introduction sections. + +A4. Have you used AI writing assistants when working on this paper? + +We used Grammarly to correct some grammatical errors. + +# B Did you use or create scientific artifacts? + +We used MultiWOZ and M2M datasets for our experiments. And to build our model, we use the HuggingFace Transformer library. + +B1. Did you cite the creators of artifacts you used? + +For our used dataset and pre-trained language models, we cite the paper. + +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? + +Not applicable. Left blank. + +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +We specified the purpose for which the data and models are used. + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? + +We used only publicly widely used datasets + +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? + +No response. + +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. + +Yes, we described the datasets we used in Section 4. + +# C Did you run computational experiments? + +C. Yes. Section 4. Experimental setup and Section 5. Experimental results. + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +Yes. We report all the details about the experimental setup in section 4 and the latency in section 5. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +In section 4. + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +In section 5. We run each evaluation three times with different seeds and report the average number for more reliable results. + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +We specified that we used the pre-trained language models using the Huggingface library in section 4. + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +No response. + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +No response. + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +No response. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +No response. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +No response. \ No newline at end of file diff --git a/breakbreakingthedialoguestatetrackingbarrierwithbeamsearchandreranking/images.zip b/breakbreakingthedialoguestatetrackingbarrierwithbeamsearchandreranking/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..4a19e77b9ce70b69ea4d251dcedbee868bfc28b4 --- /dev/null +++ b/breakbreakingthedialoguestatetrackingbarrierwithbeamsearchandreranking/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6aee6ced24c1a842d0553ecab906cb96fdb1cdcd7c63138e84e4bea2d8e33b5d +size 531092 diff --git a/breakbreakingthedialoguestatetrackingbarrierwithbeamsearchandreranking/layout.json b/breakbreakingthedialoguestatetrackingbarrierwithbeamsearchandreranking/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..10d234e0c0142af97a4a8766da966c90cdc1a28c --- /dev/null +++ b/breakbreakingthedialoguestatetrackingbarrierwithbeamsearchandreranking/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f8eaa1cc600e1d836bf71ba66307c791b3582fce7bc7c987c7631cb057952162 +size 499107 diff --git a/breedingmachinetranslationsevolutionaryapproachtosurviveandthriveintheworldofautomatedevaluation/652d4609-edad-466d-ab81-22b6b4f01e74_content_list.json b/breedingmachinetranslationsevolutionaryapproachtosurviveandthriveintheworldofautomatedevaluation/652d4609-edad-466d-ab81-22b6b4f01e74_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..70ddb155d682f1cebb7f1ab339c28de6aafabb59 --- /dev/null +++ b/breedingmachinetranslationsevolutionaryapproachtosurviveandthriveintheworldofautomatedevaluation/652d4609-edad-466d-ab81-22b6b4f01e74_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:866ab7aaa7f167bd69bdf2ffa0c748b7043f33896f1f166ef4e06da0b8de2383 +size 151402 diff --git a/breedingmachinetranslationsevolutionaryapproachtosurviveandthriveintheworldofautomatedevaluation/652d4609-edad-466d-ab81-22b6b4f01e74_model.json b/breedingmachinetranslationsevolutionaryapproachtosurviveandthriveintheworldofautomatedevaluation/652d4609-edad-466d-ab81-22b6b4f01e74_model.json new file mode 100644 index 0000000000000000000000000000000000000000..d9462f321c4b5f085a1a39d76506085d122241f2 --- /dev/null +++ b/breedingmachinetranslationsevolutionaryapproachtosurviveandthriveintheworldofautomatedevaluation/652d4609-edad-466d-ab81-22b6b4f01e74_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:31f2f4c1b41c7af2c49f9d6db27da70ca2d05c4be439c997584fc25f1d598b9d +size 178511 diff --git a/breedingmachinetranslationsevolutionaryapproachtosurviveandthriveintheworldofautomatedevaluation/652d4609-edad-466d-ab81-22b6b4f01e74_origin.pdf b/breedingmachinetranslationsevolutionaryapproachtosurviveandthriveintheworldofautomatedevaluation/652d4609-edad-466d-ab81-22b6b4f01e74_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a464aece204610aed44c3de70b71568add093bff --- /dev/null +++ b/breedingmachinetranslationsevolutionaryapproachtosurviveandthriveintheworldofautomatedevaluation/652d4609-edad-466d-ab81-22b6b4f01e74_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e64f9798485612b986b7f70b73ac379f4a3ed4b58101034229377eb1ec0d9424 +size 461155 diff --git a/breedingmachinetranslationsevolutionaryapproachtosurviveandthriveintheworldofautomatedevaluation/full.md b/breedingmachinetranslationsevolutionaryapproachtosurviveandthriveintheworldofautomatedevaluation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..e8ae09b157e0e9b9d9d570cf01ba3be8d17566fe --- /dev/null +++ b/breedingmachinetranslationsevolutionaryapproachtosurviveandthriveintheworldofautomatedevaluation/full.md @@ -0,0 +1,432 @@ +# Breeding Machine Translations: Evolutionary approach to survive and thrive in the world of automated evaluation + +Josef Jon and Ondrej Bojar + +Charles University, Faculty of Mathematics and Physics + +Institute of Formal and Applied Linguistics + +{jon,bojar}@ufal.mff.cuni.cz + +# Abstract + +We propose a genetic algorithm (GA) based method for modifying $n$ -best lists produced by a machine translation (MT) system. Our method offers an innovative approach to improving MT quality and identifying weaknesses in evaluation metrics. Using common GA operations (mutation and crossover) on a list of hypotheses in combination with a fitness function (an arbitrary MT metric), we obtain novel and diverse outputs with high metric scores. With a combination of multiple MT metrics as the fitness function, the proposed method leads to an increase in translation quality as measured by other held-out automatic metrics. With a single metric (including popular ones such as COMET) as the fitness function, we find blind spots and flaws in the metric. This allows for an automated search for adversarial examples in an arbitrary metric, without prior assumptions on the form of such example. As a demonstration of the method, we create datasets of adversarial examples and use them to show that reference-free COMET is substantially less robust than the reference-based version. + +# 1 Introduction + +Attaining good translation quality in machine translation (MT) arguably relies on good automatic metrics of MT quality. Recently, a new generation of evaluation metrics was introduced. These metrics are based on embeddings computed by large pretrained language models and human annotation scores. The improvements in metric quality resulted in renewed interest in metric-driven translation hypothesis selection methods, like Minimum Bayes Risk (MBR) decoding (Goel and Byrne, 2000; Kumar and Byrne, 2004). + +Our method relies on MBR decoding and the genetic algorithm (GA; Fraser, 1957; Bremermann, 1958; Holland, 1975. Through combinations and mutations of translations produced by an MT model, we search for optimal translation under a + +selected metric. This is a novel approach to generating translation hypotheses in NMT. + +We find that by combining neural and surface form-based metrics in a GA's fitness function, it is possible to create better quality translations than by simple reranking of the initial hypotheses (as evaluated by held-out metrics). It also allows the combination of multiple sources for the translation, for example, MT, paraphrasing models and dictionaries. + +Another use-case for our method is the identification of weak points in MT metrics. Flaws and biases of the novel neural metrics are being studied, for example, by Hanna and Bojar (2021), Amrhein and Sennrich (2022a), Alves et al. (2022) or Kanojia et al. (2021). In summary, these metrics have low sensitivity to errors in named entities and numbers. Also, they are not sufficiently sensitive to changes in meaning and critical errors, like negations. + +These previous works on deficiencies of the metrics mostly focus on analyzing the outputs of MT systems and looking for certain types of mistakes. Another approach they use is changing the outputs to introduce specific types of mistakes. In contrast, our approach aims to find translations with high scores on certain metrics automatically, by optimizing the candidate translations for a selected metric. We believe that through this more explorative approach, it is possible to find unexpected types of defects. + +In summary, the main contribution of our work is a novel method for producing translations, which can be used to improve translation quality and analyze automatic MT evaluation metrics. + +# 2 Related work + +Automated MT evaluation The traditional automatic MT metrics are based on comparing a trans + +lation produced by an MT system to a human reference based on a string similarity. Popular choices are ChrF (Popovic, 2015) and BLEU (Papineni et al., 2002). Multiple shortcomings of these metrics are well known (Callison-Burch et al., 2006; Bojar et al., 2010; Freitag et al., 2020; Mathur et al., 2020a; Zhang and Toral, 2019; Graham et al., 2020). + +Neural MT metrics Novel, neural-based MT metrics were introduced recently. They address some of the deficiencies of the string-based methods, but possibly introduce new types of errors or blind spots: BERTScore (Zhang et al., 2020), BARTScore (Yuan et al., 2021), PRISM (Thompson and Post, 2020), BLEURT (Sellam et al., 2020), COMET (Rei et al., 2020, 2021, 2022), YiSi (Lo, 2019), RoBLEURT (Wan et al., 2021) or UniTE (Wan et al., 2022b). + +Using a shared embedding space, these metrics better compare source, translated, and reference sentences. Their evaluation in WMT Metrics tasks (Mathur et al., 2020b; Freitag et al., 2021b, 2022) and other campaigns (Kocmi et al., 2021) demonstrate stronger agreement with human judgment. + +While their system-level performance has been scrutinized, their segment-level performance remains less explored. Moghe et al. (2022) indicates these metrics are unreliable for assessing translation usefulness at segment level. However, we still try to optimize individual sentences for improved scores. + +Deficiencies in metrics The closest work to ours is Amrhein and Sennrich (2022a). Authors use MBR decoding to find examples of high-scoring, but flawed translations in sampled model outputs. The conclusion is that the studied metrics are not sensitive to errors in numbers and in named entities (NE). Alves et al. (2022) automatically generate texts with various kinds of errors to test for sensitivity of MT metrics to such perturbations. Sun et al. (2020) claim that current MT quality estimation (QE) models do not address adequacy properly and Kanojia et al. (2021) further show that meaning-changing errors are hard to detect for QE. + +Genetic algorithm Variations of the genetic algorithm and evolutionary approaches in general for very diverse optimization problems are being studied extensively for more than half a century (Fraser, 1957; Bremermann, 1958; Sastry et al., 2005). + +Nevertheless, work on the utilization of the GA + +in machine translation is scarce. Echizen-ya et al. (1996) use GA for example-based MT. Zogheib (2011) present multi-word translation algorithm based on the GA. Ameur et al. (2016) employ GA in phrase-based MT decoding. In the context of neural machine translation, GA was used to optimize architecture and hyperparameters of the neural network (Ganapathy, 2020; Feng et al., 2021). + +Minimum Bayes risk decoding Our implementation of the fitness function depends on Minimum Bayes Risk (MBR) decoding (Goel and Byrne, 2000; Kumar and Byrne, 2004). This selection method has regained popularity recently as new, neural-based MT metrics emerged (Amrhein and Sennrich, 2022b; Freitag et al., 2021a; Muller and Sennrich, 2021; Jon et al., 2022). + +# 3 Proposed solution + +Our approach depends on two methods: Minimum Bayes Risk decoding and genetic algorithm. + +# 3.1 Genetic algorithm + +We propose the use of a GA to find new translation hypotheses. GA is a heuristic search algorithm defined by a fitness function, operators for combination (crossover) and modification (mutation) of the candidate solutions, and a selection method. + +Before running the GA algorithm, an initial population of a chosen number of candidate solutions is created. A single solution is called an individual, and it is encoded in a discrete way (often as a list) by its forming units, genes. The resulting representation of an individual is called a chromosome. All chromosomes have the same length to simplify the crossover operation, but we add placeholders for empty tokens to account for additions, as discussed later. + +The algorithm itself consists of evaluating each solution in the population using the fitness function and stochastically choosing parent solutions for the new generation by the selection algorithm. Crossover is used on the chromosomes of the parents to create their offspring (children). The mutation is used on the children and they form a new generation of the same size. This is repeated for a given number of iterations (generations). + +In our proposed method, the candidate solutions are translation hypotheses produced by an MT model. Genes are tokens and the mutation operation replaces, deletes, or adds a token in a chromosome. The eligible new tokens are chosen + +from a set of valid tokens. We discuss methods of construction of this set in Section 4.6. + +To allow for variable lengths of the solutions and the add or delete operations, we add genes representing an empty string after each token gene, and all the candidates are also right-padded with the empty string genes. The final length of all the candidates is equal to the length of the longest candidate multiplied by a constant $k$ . The empty string genes can be mutated to a non-empty gene, which is equivalent to inserting a new token into the candidate. Inversely, a non-empty string gene can be mutated to an empty string gene, which is equivalent to removing a token. Empty genes have no influence on the fitness score. Below we show the encoding of two translation hypotheses for $k = 1.1$ : + +```python +sent1=[['Genetic','', 'algorithm', ', can', ', be', ', used', ', to', ', produce', ', novel', ', solutions', ', ', ', ', ]] +sent2=[['Genetic', ', 'algorithm', ', 'creates', ', 'new', ', 'solutions', ', ', ', ', ', ', ', ', ]] +``` + +Fitness function Fitness functions are MT evaluation metrics, see Section 4. For some of the experiments, the fitness function is composed of multiple metrics. In that case, the scores are simply summed – we did not explore scaling them or using multi-objective GA (Murata et al., 1995; Surry et al., 1997; Gao et al., 2000; Deb et al., 2002). + +Selection To select parents for the new generation, we use tournament selection with $n = 3$ . For each individual in the population, two other individuals are randomly chosen and the one with the best value of the fitness function out of the three is selected as one of the parents for a new generation. Figure 1 illustrates this, including the fact that many individuals can be selected repeatedly through this process. + +Crossover operation We iterate through the parents by pairs, each pair is crossed-over with probability $c$ . A random index $i$ in a chromosome is selected and two children are created, the first one inherits the part of chromosome up to $i$ from the first parent and the part from $i$ from the second parent and vice-versa for the second offspring. For parents p1 and p2 and children c1 and c2: + +```txt +c1=p1[:i]+p2[i:]; c2=p2[:i]+p1[i:] +``` + +Mutation operation The children produced by the cross-over operation are mutated. Each gene (token) is mutated with a probability $m$ . Mutation + +replaces the token (or empty string placeholder) with a randomly selected one from the set of all possible tokens. This set also includes empty string placeholder, which is equivalent to token deletion. The approaches to the construction of this set are described in Section 4.6. After the mutation phase, the new generation is ready and the next iteration of GA is performed. One iteration of the whole GA process is illustrated in Figure 1. + +MT Metrics and Fitness vs. Evaluation Optimizing the word composition of a translation towards an arbitrary metric is subject to Goodhart's law – once a metric is used as a goal to optimize towards, it ceases to be a good measure of final quality (Strathern, 1997). Thus, we cross-evaluate with held-out metrics not used for optimization (even though these metrics might still be linked with the optimization metrics by spurious correlations caused by similar metric design, model architecture, or training data). We search for adversarial examples for the specific metrics, i.e. translations scoring high in the objective metric, but low in held-out metrics. This can be used to create training sets of negative examples. We use ChrF, BLEU, wmt20-comet-da (Rei et al., 2020), wmt20-comet-que-da-v2 as the objective metrics and wmt21-comet-mqm, eamt22-cometinho-da, BLEURT (Sellam et al., 2020) and UniTE (Wan et al., 2022a) as the held-out metrics. + +# 3.2 MBR decoding + +NMT models predict a probability distribution over translations for a given source sentence. A common method for selecting a final translation given this distribution is known as "maximum-a-posteriori" (MAP) decoding. Because of the computational complexity of exact MAP decoding, approximations such as beam search (Koehn et al., 2003) are used. Many limitations of MAP were described recently (Stahlberg and Byrne, 2019; Meister et al., 2020) and other approaches were proposed. + +One of the alternatives is MBR decoding. It is a decision rule that selects the translation based on a value of a utility function (and thus minimizes expected loss, or risk) rather than model probability. MT metrics are often used as utility functions. In an ideal case, we have a distribution $p(y|x)$ over all possible correct translations $y$ of source sentence $x$ available, which is not the case in real-world scenarios. Given the space of all possible target language sentences $\mathcal{H}(x)$ and utility function $\mathcal{U}$ , + +![](images/23568c7475cdeb8d98dc344a02c66c4a90190f06175e2174e3f6f8262cbe1cc2.jpg) +Figure 1: One iteration of the GA algorithm for a population of 4 individuals. The steps with a yellow background are equivalent to simple reranking, the steps with blue background introduce the operations of the genetic algorithm. + +we search for the optimal translation $h^{*}$ : + +$$ +h ^ {*} = \operatorname {a r g m a x} _ {h \in \mathcal {H} (x)} E _ {p (y | x)} [ \mathcal {U} (y, h) ] +$$ + +A fixed number of translation hypotheses produced by the MT model can be used as an approximation of the reference translations distribution $p(y|x)$ in practice. Still, the number of possible hypotheses $\mathcal{H}(x)$ is infinite – it consists of all conceivable sentences in the target language. For this reason, the same set of translations as for references is also used as candidate hypotheses. This leads to an implementation where MBR decoding can be seen as consensus decoding – a translation that is the most similar to all the other translations in the set is selected. Some of the recent embedding-based metrics also take the source sentence into account. In that case, utility is defined as $\mathcal{U}(x,y,h)$ . In such cases, the process is no longer equivalent to consensus decoding due to the influence of the source. + +# 4 Experiments + +This section describes our experimental setup and results. We compare reranking of $n$ -best lists to the application of the GA on them. + +# 4.1 Data + +We trained Czech-English MT model on CzEng 2.0 (Kocmi et al., 2020), a mix of parallel data + +(61M) and Czech monolingual data back-translated into English (51M). For experiments with dictionaries, we use a commercial Czech-English dictionary. We use newstest-19 (Barrault et al., 2019) as the dev set and newstest-18 (Bojar et al., 2018) as the test set. Due to the high computational requirements of our approach, we only evaluate the first 150 sentences from the test set in all the experiments. We call this test set newstest-18-head150. We used a commercial lemmatizer. for lemmatization and word form expansion performed in some of the experiments, We tokenize the data into subwords with SentencePiece (Kudo and Richardson, 2018) and FactoredSegmenter. + +# 4.2 Model + +We train transformer-big using Marian-NMT (Junczys-Dowmunt et al., 2018) with default hyperparameters. + +# 4.3 Hardware + +We ran all the experiments on a grid server with heterogeneous nodes, with Quadro RTX 5000, GeForce GTX 1080 Ti, RTX A4000, or GeForce + +RTX 3090 GPUs. The running time depends on population size, number of generations, and fitness function. We leave the first two fixed, so the computational requirements are most influenced by the fitness function. For the most computationally intensive fitness (combination of wmt20-comet-da and wmt20-comet-qe-da-v2), optimizing 150 examples on RTX A4000 takes 5 days. We discuss the computational requirements in Section 9. + +# 4.4 Metrics + +We abbreviate some of the longer metrics' names further in the text in order to save space.4 + +For BLEU and $\mathrm{ChrF}$ we use SacreBLEU (Post, 2018). We use $\beta = 2$ for $\mathrm{ChrF}$ in all the experiments (i.e. $\mathrm{ChrF2}$ ). For $\mathrm{COMET}^5$ , $\mathrm{BLEURT}^6$ and $\mathrm{UniTE}^7$ scores we use the original implementations. We use paired bootstrap resampling (Koehn, 2004) for significance testing. + +# 4.5 GA parameters + +We did not search for optimal values of GA parameters due to high computational costs. The initial population is formed by 20-best hypotheses obtained by beam search and 20 sampled ones, copied 50 times over to obtain a population size of 2000. We select parents for the new generation with tournament selection $(n = 3)$ and then we combine them using a crossover rate $c = 0.1$ . The mutation rate for the mutation of non-empty genes to different non-empty genes $m$ is $1 / l$ , where $l$ is the chromosome length. For mutating empty to non-empty gene (word addition) or vice-versa (deletion), the rate is $m / 10$ . We run 300 generations of the GA. + +# 4.6 Possible mutation sources + +We consider three possible sources for the mutation tokens set, i.e. the set of tokens that can replace another token in the chromosome: + +1) init - set of all the tokens from the initial population (only tokens that are present in initial hypotheses can be used for the optimization). +2) dict - we performed word-by-word dictionary translation of each the source sentence, resulting in a set of English tokens. The source + +sides of the dictionary and the source sentence are lemmatized for the search, and target token forms are expanded to cover all surface forms. + +3) wordlist - all words from an English wordlist.8 + +# 4.7 Results + +Reranking We translated newstest-18 by the baseline model using beam search with beam size 20. We also sampled another 20 translation hypotheses for each source sentence from the model. We rerank these lists by BLEU, ChrF and CMT20 metrics in two manners: either with knowledge of the true manual reference (i.e. oracle) or using MBR decoding. GA is not used in these experiments. There are two ways of using multiple references with BLEU: either compute single-reference scores for all the references separately and average them or use the multi-reference formula. We use the former. + +The results are presented in Table 1. The confidence ranges are shown in Appendix C, Table 10. The 1st column shows the origin of the hypotheses. The 2nd column shows if the reference was used for reranking (Oracle), or the other hypotheses and MBR decoding were used instead (MBR). No reranking (-) means that the candidate with the highest model's length-normalized log-prob is evaluated. The 3rd column indicates which metric was used for the reranking (the objective function). The remaining columns are the values of the evaluation metrics (computed with respect to the reference). + +For most of the metrics, MBR-eranked hypotheses outperform the log-prob baseline, even though by a smaller margin than the reference-eranked (oracle) ones. In some cases, optimizing with MBR towards one metric leads to a deterioration of scores in other metrics. The metrics most prone to this problem are QE, ChrF and BLEU. MBR rescoring with QE results in worse ChrF, BLEU and CMTH22 scores than the baseline, suggesting this metric is unsuitable for such application. CMT20 and especially the combination of CMT20+QE+BLEU are more robust, with the latter improving in all the metrics over the baseline. As shown further, both the negative and positive + +
SourceRerankMetricChrFBLEUCMT20CMT21CMTH22QEBLEURTUniTE
beam 5-log-prob56.428.90.49950.03990.50250.24720.70660.3004
beam 20-log-prob56.730.10.50070.03990.50170.24770.70780.3018
OracleChrF64:140.30.60460.04230.65520.25920.74490.3953
BLEU63.041:10.58970.04190.64340.25730.73900.368
CMT2062.037.7θ:69030.04310.68750.29490.75510.4641
MBRChrF57:130.40.51620.03990.51050.25140.70750.3056
BLEU56.329:60.51020.03990.51040.23570.70790.2958
CMT2056.830.6θ:56860.04040.52810.28180.71600.3313
sampled 20-log-prob53.025.50.35570.03710.38780.13500.66610.1277
OracleChrF62:537.10.48480.03920.53460.14710.70070.2211
BLEU60.539:60.41430.03820.48060.11330.68720.1609
CMT2058.031.7θ:66300.04190.63130.25260.73360.4061
MBRChrF55:428.20.43760.03860.46210.20170.69260.2274
BLEU54.328:20.39980.03810.44930.17130.68550.1892
CMT2054.428.0θ:55150.04030.51940.26170.70620.2931
beam 20 + sampled 20-log-prob56.630.10.50020.03990.50440.24360.70670.3001
OracleChrF65:441.90.59730.04170.64480.23300.73950.3818
BLEU63.743:20.55070.04100.61000.22050.72860.3236
CMT2061.937.6θ:71540.04330.70170.28720.75610.477
MBRChrF56:930.30.51920.03990.51120.25170.70920.3059
BLEU56.430:00.50470.03980.51000.24030.70690.2958
CMT2057.431.2θ:58530.04090.53900.29300.71930.3413
QE55.729.50.5390.04120.4976θ:38410.71400.3274
CMT20+QE+BLEU57.531:2θ:59830.04170.5596θ:36200.72550.3686
+ +Table 1: Results of baseline translations and their reranking by multiple metrics on newstest-18-head150. Higher is better for all the metrics. The best scores for MBR-based reranking are shown in bold, the best scores for reference-based reranking are written in italics. We strike out the values where the same metric was used to rerank and also evaluate the outputs. + +effects are more pronounced with GA. Reranking with knowledge of the reference is unsurprisingly performing better than MBR reranking. Here, we use it to show the upper bound of improvements attainable by reranking. In further experiments, reference-based GA is also used to analyze the objective metrics. + +We also notice that while reranking beam search results leads to better final outcomes than reranking sampling results, a combination of both provides the best scores. All further experiments start with a population consisting of this combination of both. + +Genetic algorithm We use the same metrics for GA fitness function as for reranking. Experiments were again conducted with either the knowledge of the reference or with MBR decoding. The results for GA with reference are presented in Table 2 (confidence ranges in Appendix C, S Table 11). The first two columns indicate the metric used as the fitness function and the source of the possible tokens for the mutation. The third column shows how many runs were averaged to obtain the mean scores shown in the remaining columns. The last column shows the ratio of the final selected hypotheses that were not in the initial pool produced by the MT model, but were created by GA operations. + +We see that the GA can optimize towards an arbitrary metric better than simple MBR reranking. For example, the best ChrF score for GA is 87.1 compared to 65.4 for reranking. The results also suggest that the string-based metrics (ChrF and BLEU) are prone to overfitting – translations optimized for these metrics score poorly in other metrics. CMT20 is more robust – we see improvements over the baseline in all the metrics after optimization for CMT20. + +Table 4 presents the results of the experiments aimed to improve the translation quality (confidence ranges for the scores are in Appendix C, Table 12). The reference is not provided and MBR decoding (always computed with regard to the initial population) is used instead. This way, it is feasible to use the approach to improve translations in a real-world scenario with no reference. We measure the improvement by held-out metrics. $^{10}$ We consider UniTE to be the most trustworthy. It was created most recently and some of the flaws of the other metrics were already known and mitigated. It also correlates well with human evaluation (Freitag et al., 2022) and it is developed by a different team than the COMET metrics, which slightly decreases the chances for spurious correlations of the scores + +
FitnessMut#runsChrFBLEUCMT20CMT21CMTH22QEBLEURTUniTEnew
ChrF-971.448.30.41440.03690.54930.01040.68530.20180.79
init984.960.00.09940.03080.3300-0.27770.6266-0.06170.92
init+dict987.158.00.08130.03040.3171-0.30040.6360-0.07840.93
wordlist183.248.5-0.37290.0214-0.2245-0.49320.5525-0.50970.93
BLEU-968.050.80.40160.03740.51820.02990.67790.16980.76
init977.668.90.26930.03530.4747-0.16630.66050.06360.92
init+dict979.669.50.26910.03500.4865-0.18660.66310.06270.93
wordlist168.354-0.03060.02920.1243-0.30140.5727-0.24920.91
CMT20-164.640.40.77240.04410.75930.29810.76190.51410.67
init170.149.20.88740.04620.8680.24760.77630.58240.91
init+dict669.246.30.89740.04670.88970.25980.77900.58760.92
wordlist164.541.10.83740.04460.7360.26560.74530.47430.87
+ +not based on translation quality. + +The metrics that only compare the translation with a reference (BLEU, $\mathrm{ChrF}$ ) without access to the source sentence do not perform well as a fitness function. Since MBR decoding in such cases works as a consensus decoding, i.e. the most similar candidate to all the others has the best fitness, there is no evolutionary pressure to modify the individuals. + +Optimizing for QE or ChrF results in a large decline in scores for other metrics. These metrics are prone to scoring malformed, nonsensical or unrelated sentences well. This is analyzed in Section 5. The sum of QE, CMT20 and BLEU as the fitness function reaches the best score in UniTE and does not show significant degradation in other metrics. + +The ratio of examples where held-out scores improve, decrease or do not change after GA is shown in Table 3. We compare the scores both to log-prob selected hypotheses and MBR reranked ones. We again see that the combination of CMT20+QE+BLEU performs best. GA with the individual metrics as the fitness function leads more often to a decrease than an increase of heldout metrics compared to reranking. This suggests the effect of GA on the translation quality is negative if the fitness function is not chosen well. + +# 5 Analysis + +In this section, we analyze the GA procedure and the behavior of evaluation metrics. + +# 5.1 GA process + +Fitness vs. held-out metric We analyzed the behavior of the average fitness function over the whole population, best solution fitness, and held-out metric score during the GA process using CMT20+QE+BLEU as the fitness and UniTE as the held-out metric (Figure 2). Results show GA + +Table 2: Scores of translations on newstest-18-head150 created by GA with the knowledge of the reference for the fitness function. Higher is better for all the metrics. Strikled-out scores indicate results where fitness and evaluation metric coincide. + +
Fitness+-=
BLEU22%/1%29%/7%49%/92%
CHRF13%/1%69%/65%18%/33%
CMT2054%/23%39%/32%7%/45%
CMT20+QE+BLEU62%/43%35%/35%3%/23%
+ +Table 3: Percentage of examples from newtest-18-head150 where the held-out score (UniTE) improves (2nd column), degrades (3rd column), or doesn't change (4th column) for GA compared to log-prob selection/MBR reranking. The first column shows which metric was used as the fitness function. Bold results are the ones where held-out scores improve for more examples rather than where they deteriorate. + +consistently improved fitness values from initial solutions and increased average fitness. However, the correlation between fitness and held-out metrics varied: Example $a$ shows a decrease in final held-out score despite improved fitness, while Example $b$ shows aligned increases in both scores. Table 3 suggests case $b$ is more typical in our test set. + +# 5.2 Search for adversarial examples + +As a radically different goal, we use GA to search for examples that score high in the fitness function but are evaluated poorly by held-out metrics. This allows us to find blind spots in specific metrics without previous assumptions about the type of errors that could be ignored by the given metric. Such adversarial examples are defined as follows: for each test set example $e$ , we compute the scores of the hypotheses produced by the MT model using both the optimization metric $O$ and the held-out metric $H$ . We rank the hypotheses by $O$ . The scores of the best hypothesis are referred to as $O(e)_{init}$ and $H(e)_{init}$ . We then use a GA to optimize the hypotheses towards $O$ . We consider the final translation as adversarial for a given metric if its score + +
FitnessMut#runsChrFBLEUCMT20CMT21CMTH22QEBLEURTUniTEnew
baseline--56.630.10.50020.03990.50440.24360.70670.30010.00
best rerank--57.531.20.59830.04170.55960.36200.72550.36860.00
ChrF-757.230.00.47690.03870.48770.21400.69630.25490.26
init557.927.10.21970.03360.27170.00470.59790.02110.73
init+dict557.927.80.25290.03420.29520.01980.60950.04390.68
wordlist157.529.40.36140.03650.39490.13430.65580.12140.45
BLEU-956.430.00.49970.03970.50660.23660.70590.29010.04
init756.429.90.50040.03960.50710.23220.70390.28500.09
init+dict656.329.80.50010.03960.50680.23200.70390.28470.08
wordlist156.329.80.49860.03960.50520.23320.70420.28530.07
CMT20-157.631.70.59880.04100.53850.29390.71920.34460.24
init156.228.40.62470.04100.53820.28930.71770.33660.52
init+dict556.729.40.61880.04110.54120.28800.71240.33620.49
wordlist157.331.10.60120.0410.52880.29070.71620.33850.28
QEinit+dict145.513.20.33530.03980.18360.55540.60180.03240.99
wordlist146.016.70.12070.0368-0.06430.55140.5349-0.32640.99
QE+CMT20init455.024.30.63870.04310.50660.47780.69630.34440.86
init+dict554.524.40.63210.04300.50380.47970.69730.34770.85
QE+CMT20+BLEUinit157.529.50.62660.04290.54030.41980.71740.39460.70
init+dict357.429.90.62540.04290.54030.41800.71690.39160.65
+ +Table 4: Scores of translations on newstest-18-head150 created by GA without knowledge of the reference in the fitness function, using other hypotheses and MBR decoding instead. For better comparison we reiterate the baseline and best MBR reranking results (equivalent to GA with a single generation) in the first two rows. Higher is better for all the metrics. The best scores for MBR-based GA are shown in bold, for reference-based reranking in italics. Results where fitness and evaluation metrics coincide are striked out. + +
O\( O_{init} + m_o < O_{ga} \)... ∧\( H_{init} > H_{ga} + m_h \)
CMT20128 (85%)57 (38%)
QE148 (99%)142 (95%)
BLEU150 (100%)113 (75%)
+ +Table 5: Number of examples from newtest-18-head150 which improved in optimization metric after GA (2nd column) and at the same time deteriorated in held-out metric (3rd column) + +$O(e)_{ga}$ improves by at least a margin $m_o$ over the initial $O(e)_{init}$ and at the same time $H(e)_{ga}$ decreases by at least $m_h$ compared to the $H(e)_{init}$ . In other words, $e$ is adversarial if: + +$$ +O (e) _ {i n i t} + m _ {o} < O (e) _ {g a} \wedge H (e) _ {i n i t} > H (e) _ {g a} + m _ {h} +$$ + +In search of adversarial examples, it is beneficial to explore a large space of hypotheses. Thus, we use all words from the wordlist for mutations. + +Since the goal is to optimize the output towards a given metric to find its flaws, not to improve translation in a real-world scenario, we can assume we have the reference translations at hand and we can use them to compute the fitness scores. + +We demonstrate the approach on two optimization metrics (CMT20 and QE) and one held-out metric (UniTE). We set $m_h = m_o = 10^{-3}$ . We present the results on newtest-18-head150 in Table 5. The first column shows which optimization metric was used and the second column shows the number of examples for which the final opti + +mization score improved upon the initial best score. The last column shows how many of the improved examples had decreased scores for the held-out metric. We show examples in Appendix A. + +We observed QE is less robust than CMT20. Completely unrelated sentences are scored better than an adequate translation. Upon an inspection of the examples, we see that the QE metric prefers adding spurious adjectives and named entities (NEs). This could be caused by a length bias, or by a preference for more specific utterances. QE scores very unusual words highly and it scores punctuation low. For instance, Sentence 4 from Appendix A, Table 6 has a correct initial translation "Model was killed by chef." After optimizing for QE, the translation becomes "Model Kiranti Tarkio killed by molluscan stalkier". + +Changing or adding NEs can be observed also for CMT20 (Sentences 2, 5 and 8 in Appendix A, Table 7), although in a much smaller extent. This shows that even though QE and CMT20 correlate similarly with human evaluation on well-formed translations (Rei et al., 2021), QE is more prone to scoring nonsensical translations higher than adequate ones. This observation is also supported by the decline of other metrics when optimizing QE in Table 4. + +In another experiment with QE we tried to construct a completely unrelated translation, convey + +![](images/1c4f6232a29cbbc5152f8578c6d5eefbfafbfe944ba61d082f5b5c9056357467.jpg) +(a) + +![](images/51a7c0ee4b74953ccbb75c31d98923efe3876aa422dddb585d05be8b308b163e.jpg) +(b) +Figure 2: Behavior of best and population average fitness, compared to held-out metric score $H$ of the best solution during a run of GA for two selected examples. $H$ (UniTE) does not correlate well with the fitness metric (CMT20+QE+BLEU) and the GA is detrimental from the point of view of the $H$ in Example a). In Example b), $H$ behaves similarly to the fitness function. + +ing a malicious message, which would score better than the original MT output by the QE metric. We present these examples in Appendix B. + +# 6 Discussion + +We agree that an argument could be made that our approach is very computationally expensive, too explorative and the search for weaknesses could be performed in a more principled way. However, by anticipating the types of errors the metrics ignore and by designing the procedure to create texts with such errors, some of the error types can remain unnoticed. We see analogies with the whole field of deep learning. The methods with more priors of what the outcome should look like and how an inductive bias should be represented in a model give way to more general architectures as systems are scaled both in parameters and training data size, in the spirit of Richard Sutton's Bitter Lesson.[11] + +Since the architectures of systems that produce evaluation scores are based mostly on empiric results, rather than on solid theoretical approaches, + +we believe that similar empirical, almost brute-force methods, might be an effective tool to search for weaknesses of these systems. + +# 7 Conclusions + +We present a method of using a GA to find new translations based on optimizing hypotheses from an $n$ -best list produced by an MT model. Our method optimizes well towards an arbitrary MT metric through modification of the candidate translations. We found that after optimizing for a single objective metric, scores on other metrics often decrease, due to over-fitting on the objective metrics' defects. We discover that by combining multiple metrics (both neural and string-based) in the fitness (objective) function, we are able to mitigate the over-fitting and improve or maintain the held-out metrics for most inputs. This suggests GA can be used to improve MT quality. + +MT evaluation metrics have specific flaws and blind spots. To test their robustness, we selected some of the metrics as the fitness functions to optimize towards, and others as held-out metrics. We have leveraged the over-fitting effect to search for adversarial examples for specific metrics, creating translations that score high in one metric and low in held-out metrics. Such translations can be used as negative examples for improving the robustness of the neural metrics. + +This work also reveals that even though source-translation and source-translation-reference COMET scores were shown to have a similar correlation with human scores for well-formed translations, the reference-free COMET is more susceptible to adversarial inputs. This highlights the necessity of thorough analysis, beyond computing correlation with human scores for the new metrics. + +# 8 Acknowledgements + +This work was partially supported by GACR EXPRO grant NEUREM3 (19-26934X) and by the Grant Agency of Charles University in Prague (GAUK 244523). We used the data and computing resources provided by the Ministry of Education, Youth and Sports of the Czech Republic, Project No. LM2018101 LINDAT/CLARIAH-CZ. We would also like to thank Dominik Machacek and Dávid Javorsky for proofreading the text of the paper. + +# 9 Limitations + +Due to the high computational costs of the method, we tested it only on a very small set of sentences and larger-scale experiments are needed to confirm the results. + +Many parameters of the GA algorithm were left unexplored – the results could be improved by grid search over the values for mutation and crossover ratios, using a better list of mutation candidates (for example based on $k$ -NN search), experimenting with different selection methods, combining more metrics in the fitness function or using multi-objective GA like NSGA-II (Deb et al., 2002). + +In the experiments concerning held-out metrics, we assumed weaknesses of the held-out metrics are not correlated to the weaknesses of the optimization metrics, which is probably not true, due to similar model architectures and training datasets. This means that held-out metrics are not strictly independent, but we believe combining multiple different held-out metrics should mitigate this issue. + +# 10 Ethics + +In some settings, automated MT evaluation metrics are used to decide whether the MT output should be presented to the client, or further processed by a human post editor. We present a method that uses genetic algorithms to create adversarial examples for MT evaluation metrics. The potential use of such adversarial examples raises ethical concerns, particularly in the context of machine translation applications that impact human lives, such as in medical, legal, financial or immigration contexts. We acknowledge that our work raises ethical questions regarding the potential misuse of adversarial examples. For instance, adversarial examples could be used to deceive or manipulate users by providing machine translations that are misleading or incorrect. Moreover, they could be used to create biased translations that reflect certain views or opinions. We believe that it is important to address these ethical concerns and to ensure that our work is not used for unethical purposes. As such, we recommend further research into the development of defense mechanisms against adversarial examples and into the identification of ethical and legal frameworks that can guide the use and development of adversarial examples for MT evaluation metrics. We also suggest that future work includes an explicit discussion of ethical implications and considera + +tions in the context of adversarial examples for MT evaluation metrics. Metrics are sometimes used to verify translations to be shown to the client. Our work can be used to generate adversarial examples. + +# References + +Duarte Alves, Ricardo Rei, Ana C Farinha, JosA© G. C. de Souza, and AndrA© F. T. Martins. 2022. Robust mt evaluation with sentence-level multilingual augmentation. In Proceedings of the Seventh Conference on Machine Translation, pages 469-478, Abu Dhabi. Association for Computational Linguistics. +Douib Ameur, Langlois David, and Smaili Kamel. 2016. Genetic-based decoder for statistical machine translation. In International Conference on Intelligent Text Processing and Computational Linguistics, pages 101-114. Springer. +Chantal Amrhein and Rico Sennrich. 2022a. Identifying weaknesses in machine translation metrics through minimum Bayes risk decoding: A case study for COMET. In Proceedings of the 2nd Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics and the 12th International Joint Conference on Natural Language Processing (Volume I: Long Papers), pages 1125-1141, Online only. Association for Computational Linguistics. +Chantal Amrhein and Rico Sennrich. 2022b. Identifying weaknesses in machine translation metrics through minimum bayes risk decoding: A case study for comet. +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. +Ondrej Bojar, Christian Federmann, Mark Fishel, Yvette Graham, Barry Haddow, Matthias Huck, Philipp Koehn, and Christof Monz. 2018. Findings of the 2018 conference on machine translation (WMT18). In Proceedings of the Third Conference on Machine Translation: Shared Task Papers, pages 272-303, Belgium, Brussels. Association for Computational Linguistics. +Ondrej Bojar, Kamil Kos, and David Marecek. 2010. Tackling sparse data issue in machine translation evaluation. In Proceedings of the ACL 2010 Conference Short Papers, pages 86-91, Uppsala, Sweden. Association for Computational Linguistics. +Hans J Bremermann. 1958. The evolution of intelligence: The nervous system as a model of its envi + +ronment. University of Washington, Department of Mathematics. +Chris Callison-Burch, Miles Osborne, and Philipp Koehn. 2006. Re-evaluating the role of Bleu in machine translation research. In 11th Conference of the European Chapter of the Association for Computational Linguistics, pages 249-256, Trento, Italy. Association for Computational Linguistics. +Kalyanmoy Deb, Amrit Pratap, Sameer Agarwal, and TAMT Meyarivan. 2002. A fast and elitist multiobjective genetic algorithm: Nsga-II. IEEE transactions on evolutionary computation, 6(2):182-197. +Hiroshi Echizen-ya, Kenji Araki, Yoshio Momouchi, and Koji Tochinai. 1996. Machine translation method using inductive learning with genetic algorithms. In COLING 1996 Volume 2: The 16th International Conference on Computational Linguistics. +Ben Feng, Dayiheng Liu, and Yanan Sun. 2021. Evolving transformer architecture for neural machine translation. In Proceedings of the Genetic and Evolutionary Computation Conference Companion, GECCO '21, page 273-274, New York, NY, USA. Association for Computing Machinery. +Alex S Fraser. 1957. Simulation of genetic systems by automatic digital computers ii. effects of linkage on rates of advance under selection. Australian Journal of Biological Sciences, 10(4):492-500. +Markus Freitag, David Grangier, and Isaac Caswell. 2020. BLEU might be guilty but references are not innocent. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 61-71, Online. Association for Computational Linguistics. +Markus Freitag, David Grangier, Qijun Tan, and Bowen Liang. 2021a. Minimum bayes risk decoding with neural metrics of translation quality. +Markus Freitag, Ricardo Rei, Nitika Mathur, Chi-kiu Lo, Craig Stewart, Eleftherios Avramidis, Tom Kocmi, George Foster, Alon Lavie, and AndrÅ© F. T. Martins. 2022. Results of wmt22 metrics shared task: Stop using bleu Å neural metrics are better and more robust. In Proceedings of the Seventh Conference on Machine Translation, pages 46-68, Abu Dhabi. Association for Computational Linguistics. +Markus Freitag, Ricardo Rei, Nitika Mathur, Chi-kiu Lo, Craig Stewart, George Foster, Alon Lavie, and Ondrej Bojar. 2021b. Results of the WMT21 metrics shared task: Evaluating metrics with expert-based human evaluations on TED and news domain. In Proceedings of the Sixth Conference on Machine Translation, pages 733-774, Online. Association for Computational Linguistics. +Keshav Ganapathy. 2020. A study of genetic algorithms for hyperparameter optimization of neural networks in machine translation. CoRR, abs/2009.08928. + +Ying Gao, Lei Shi, and Pingjing Yao. 2000. Study on multi-objective genetic algorithm. In Proceedings of the 3rd World Congress on Intelligent Control and Automation (Cat. No. 00EX393), volume 1, pages 646-650. IEEE. +Vaibhava Goel and William J Byrne. 2000. Minimum bayes-risk automatic speech recognition. Computer Speech & Language, 14(2):115-135. +Yvette Graham, Barry Haddow, and Philipp Koehn. 2020. Statistical power and translationese in machine translation evaluation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 72-81, Online. Association for Computational Linguistics. +Michael Hanna and Ondrej Bojar. 2021. A fine-grained analysis of BERTScore. In Proceedings of the Sixth Conference on Machine Translation, pages 507-517, Online. Association for Computational Linguistics. +John H. Holland. 1975. Adaptation in Natural and Artificial Systems. University of Michigan Press, Ann Arbor, MI. Second edition, 1992. +Josef Jon, Martin Popel, and OndAtmej Bojar. 2022. Cuni-bergamot submission at wmt22 general translation task. In Proceedings of the Seventh Conference on Machine Translation, pages 280-289, Abu Dhabi. Association for Computational Linguistics. +Marcin Junczys-Dowmunt, Roman Grundkiewicz, Tomasz Dwojak, Hieu Hoang, Kenneth Heafield, Tom Neckermann, Frank Seide, Ulrich Germann, Alham Fikri Aji, Nikolay Bogoychev, Andre F. T. Martins, and Alexandra Birch. 2018. Marian: Fast neural machine translation in $\mathbf{C} + +$ . In Proceedings of ACL 2018, System Demonstrations, pages 116-121, Melbourne, Australia. Association for Computational Linguistics. +Diptesh Kanojia, Marina Fomicheva, Tharindu Ranasinghe, Frédéric Blain, Constantin Orăsan, and Lucia Specia. 2021. Pushing the right buttons: Adversarial evaluation of quality estimation. In Proceedings of the Sixth Conference on Machine Translation, pages 625-638, Online. Association for Computational Linguistics. +Tom Kocmi, Christian Federmann, Roman Grundkiewicz, Marcin Junczys-Dowmunt, Hitokazu Matsushita, and Arul Menezes. 2021. To ship or not to ship: An extensive evaluation of automatic metrics for machine translation. In Proceedings of the Sixth Conference on Machine Translation, pages 478-494, Online. Association for Computational Linguistics. +Tom Kocmi, Martin Popel, and Ondrej Bojar. 2020. Announcing czeng 2.0 parallel corpus with over 2 gigawords. arXiv preprint arXiv:2007.03006. +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. + +Philipp Koehn and Rebecca Knowles. 2017. Six challenges for neural machine translation. In Proceedings of the First Workshop on Neural Machine Translation, pages 28-39, Vancouver. Association for Computational Linguistics. +Philipp Koehn, Franz J. Och, and Daniel Marcu. 2003. Statistical phrase-based translation. In Proceedings of the 2003 Human Language Technology Conference of the North American Chapter of the Association for Computational Linguistics, pages 127-133. +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. +Shankar Kumar and William Byrne. 2004. Minimum Bayes-risk decoding for statistical machine translation. In Proceedings of the Human Language Technology Conference of the North American Chapter of the Association for Computational Linguistics: HLT-NAACL 2004, pages 169-176, Boston, Massachusetts, USA. Association for Computational Linguistics. +Chi-kiu Lo. 2019. YiSi - a unified semantic MT quality evaluation and estimation metric for languages with different levels of available resources. In Proceedings of the Fourth Conference on Machine Translation (Volume 2: Shared Task Papers, Day 1), pages 507-513, Florence, Italy. Association for Computational Linguistics. +Nitika Mathur, Timothy Baldwin, and Trevor Cohn. 2020a. 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. +Nitika Mathur, Johnny Wei, Markus Freitag, Qingsong Ma, and Ondrej Bojar. 2020b. Results of the WMT20 metrics shared task. In Proceedings of the Fifth Conference on Machine Translation, pages 688-725, Online. Association for Computational Linguistics. +Clara Meister, Ryan Cotterell, and Tim Vieira. 2020. If beam search is the answer, what was the question? In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 2173-2185, Online. Association for Computational Linguistics. +Nikita Moghe, Tom Sherborne, Mark Steedman, and Alexandra Birch. 2022. Extrinsic evaluation of machine translation metrics. +Mathias Müller and Rico Sennrich. 2021. Understanding the properties of minimum Bayes risk decoding 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 1: Long Papers), pages 259-272, Online. Association for Computational Linguistics. +Tadahiko Murata, Hisao Ishibuchi, et al. 1995. Moga: multi-objective genetic algorithms. In IEEE international conference on evolutionary computation, volume 1, pages 289-294. IEEE Piscataway, NJ, USA. +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. +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. +Ricardo Rei, Ana C Farinha, José G.C. de Souza, Pedro G. Ramos, André F.T. Martins, Luisa Coheur, and Alon Lavie. 2022. Searching for COMETINHO: The little metric that could. In Proceedings of the 23rd Annual Conference of the European Association for Machine Translation, pages 61-70, Ghent, Belgium. European Association for Machine Translation. +Ricardo Rei, Ana C Farinha, Chrysoula Zerva, Daan van Stigt, Craig Stewart, Pedro Ramos, Taisiya Glushkova, André F. T. Martins, and Alon Lavie. 2021. Are references really needed? un babel-IST 2021 submission for the metrics shared task. In Proceedings of the Sixth Conference on Machine Translation, pages 1030-1040, Online. Association for Computational Linguistics. +Ricardo Rei, Craig Stewart, Ana C Farinha, and Alon Lavie. 2020. COMET: A neural framework for MT evaluation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 2685-2702, Online. Association for Computational Linguistics. +Kumara Sastry, David Goldberg, and Graham Kendall. 2005. Genetic algorithms. In Search methodologies, pages 97-125. Springer. +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. + +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. +Marilyn Strathern. 1997. 'improving ratings': audit in the british university system. European Review, 5(3):305-321. +Shuo Sun, Francisco Guzmán, and Lucia Specia. 2020. Are we estimating or guessimating translation quality? In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 6262-6267, Online. Association for Computational Linguistics. +Patrick D Surry, Nicholas J Radcliffe, et al. 1997. The comoga method: constrained optimisation by multi-objective genetic algorithms. Control and Cybernetics, 26:391-412. +Brian Thompson and Matt Post. 2020. Automatic machine translation evaluation in many languages via zero-shot paraphrasing. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 90-121, Online. Association for Computational Linguistics. +Yu Wan, Dayiheng Liu, Baosong Yang, Tianchi Bi, Haibo Zhang, Boxing Chen, Weihua Luo, Derek F. Wong, and Lidia S. Chao. 2021. RoBLEURT submission for WMT2021 metrics task. In Proceedings of the Sixth Conference on Machine Translation, pages 1053-1058, Online. Association for Computational Linguistics. +Yu Wan, Dayiheng Liu, Baosong Yang, Haibo Zhang, Boxing Chen, Derek Wong, and Lidia Chao. 2022a. UniTE: Unified translation evaluation. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 8117-8127, Dublin, Ireland. Association for Computational Linguistics. +Yu Wan, Dayiheng Liu, Baosong Yang, Haibo Zhang, Boxing Chen, Derek F. Wong, and Lidia S. Chao. 2022b. UniTE: Unified Translation Evaluation. In Annual Meeting of the Association for Computational Linguistics (ACL). +Weizhe Yuan, Graham Neubig, and Pengfei Liu. 2021. Bartscore: Evaluating generated text as text generation. In Advances in Neural Information Processing Systems, volume 34, pages 27263-27277. Curran Associates, Inc. +Mike Zhang and Antonio Toral. 2019. The effect of translationese in machine translation test sets. In Proceedings of the Fourth Conference on Machine Translation (Volume 1: Research Papers), pages 73-81, Florence, Italy. Association for Computational Linguistics. + +Tianyi Zhang, Varsha Kishore, Felix Wu, Kilian Q. Weinberger, and Yoav Artzi. 2020. Bertscore: Evaluating text generation with bert. In International Conference on Learning Representations. +Ali Zogheib. 2011. Genetic algorithm-based multi-word automatic language translation. *Recent Advances in Intelligent Information Systems*, pages 751-760. + +# A Examples of adversarial translations + +We ran GA with initial hypotheses generated by MT and permitted the words to be mutated by any word from an English wordlist to find a solution with the best fitness function. Tables 6 to 8 show examples of the produced translations for QE, CMT20 and BLEU as the fitness function. Here, we cherry-picked the examples with interesting phenomena, the whole datasets are available at https://github.com/cepin19/ga_mt. For QE (reference-free COMET), we see that often, the metric prefers translations where adverbs and adjectives are spuriously added to make the utterance more specific. It is often a very rare or unusual word. We plan to further analyze whether this is caused by a length bias (it is possible QE prefers longer translations), or by a preference for more specific translations, without regard to the specificity of the source. We also see that punctuation is almost always omitted in the output as if it played no role in translation quality. + +For CMT20 (reference-based COMET), the artifacts are similar, but to a much smaller extent. Some of the named entities are replaced, which confirms the low sensitivity of COMET to NE errors. For punctuation, we see the opposite effect from QE in some examples – instead of no punctuation, CMT20 sometimes prefers double punctuation, for example in Sentence 6 in Table 7. + +# B Creating intentionally false translations + +We consider a scenario where QE is used in a pipeline to control the output quality and decide whether to assume the MT output is correct as it is. As shown by Sun et al. (2020) and Kanojia et al. (2021), current QE models are not sensitive to shifts in the meaning of the translation. We experiment with our method to inject fake information into the translation or reate completely unrelated MT output so that it would nevertheless pass the output quality check. We constructed an arbitrary message: "The Adversarial LLC company is the best choice for investment, send the money to our bank account." We used ChatGPT (Jan 9 2022 version) + +
iSourceBest initBest GAO(init)O(ga)H(init)H(ga)
1Hnuti za občanská práva vydalo cestovní výstrahu pro MissouriThe civil rights movement has is-sued a travel alert for MissouriBaptistic rights allumine issues travel alert for Gerusia colones0.64250.78500.6069-0.8532
2Cestovní doporučné obvyleký vý-dáva ministerstvo zahranićí pro zahraničné země, ale v posledné době se advokáčné skupiny uchýlily k těmto opatřením v odpovědi na konkrétné zákony a trendy v rámci USA.Travel recommendations are usually issued by the Foreign Office for foreign countries, but recently advocacy groups have resorted to these measures in response to specific laws and trends within the US.Travel recommendations are typically issued by Foreign Office for foreign countries, but recently advocacy groups have resorted to these measures in response to specific laws and trends within Scotland0.53990.57800.5657-0.0717
3Cestovní výstraha je zárověn odpovědí na nový zákton Missouri, který znesnadůje zažalovánski společnostì za diskriminaci pri poskytováni ubytování nebo zaměstnávány.At the same time, the travel alert is a response to a new Missouri law that makes it difficult to sue a company for discrimination in providing accommodation or employment.At the same time, the travel alert is a response to a murky Missouri law that makes it extraordinarily difficult to sue a company for discrimination in providing accommodation or employment violence spillet0.53740.57120.55030.0637
4Modelka byla zabita šefkuchařem.Model was killed by chef.Model Kiranti Tarkio killed by molluscan stalkier0.28040.63890.6965-1.2247
5Zavražděnou je modelka Sally Anne Bowman.The woman murdered is model Sally Anne Bowman.The woman murdered is Wor-sham model Nikola Millay Dawkins0.39020.54730.5826-1.0469
6Dívka pūvodem z Croydonu byla v roce 2005 zavražděna šefkuchařem Markem Dixiem prímo v restauraci, ve které pra-covala, ten jízasadil bodné rány.The Croydon-born girl was murder'd in 2005 by chef Mark Dixie right at the restaurant she worked in, who inflicted stab wounds on her.The Croydon-born girl was murder'd in 2005 by chef Matthew Beffrey Rollinsford at the restau-rant she worked in, who inflicted cruelly stab wounds on her.0.49460.55850.6880-0.0481
7Obět' i vrah spolu měli mit sex a kouřit marihuanu, posléze ji zabil.Both the victim and murderer were supposed to be having sex and smoking marijuana, after which he killed her.Both the victim and murderer were supposed to be having sex and smoking marijuana, after which he killed her.0.50110.59680.3055-0.4551
8Za posledné pól rok ho poskodili Čtyříkrát.They have damaged it four times in the last six months.rebelts have damaged Pekin isagog four times in last six months0.51190.65460.4994-0.3186
9Rekl, Že cîtil adrenalin.He said he felt an adrenaline rush.Manilius nunks demised he felt adrenaline0.61140.84970.7167-0.4778
10Je intimní.It is intimate.Npaktos intimate0.63990.81111.0524-0.1745
11Nakonec zviťězila varianta, která Rozložila obchod do zahrady Rozkoše a ložnice, jíž věvodí pos- tel.In the end, a variant prevailed, breaking down the shop into a garden of delight and a bedroom dominated by a bed.In the end Hillis variant prevailed, breaking down miniaturized shop into garden of concordity and luxurist bedroom dominated by tour-maline0.21180.39890.3761-0.6618
12Annin príběh začal jako školní práce.Anne's story started as a school work.Seleucidean Seljukian teen-aged story started off entertainingly0.45350.80720.6751-1.1549
13Rekl, Že cîtil adrenalin.He said he felt an adrenaline rush.Manilius nunks demised he felt adrenaline0.61140.84970.7167-0.4778
14Chtěi jsme udělat obchod, který bude jiný, se značkovým是他kým zbožím, v prostřédí, kde se Ženy, který jsou prévažné našimi zákazníký, cîtí dobre.We wanted to make a shop that would be different, with designer nice goods, in a environment where women who are predominantly our customers feel good.Magdalen Galinsoga wanted a shop that would be authenticate, with nice goods, in a trusting environment where women customers were feeling loved internationalizing might probably have to be embraced a little differently.0.35560.59980.5021-0.1413
15Muselo by se to asi pojmout trošku jinak.It would probably have to be embraced a little differently.Kosel may go a little against tide, but it seems important to keep the development here in the Czech Republic.0.13630.37880.1552-0.3781
16Mоžné jdu trochu proti proudu, ale pripadá mi dúležité udřěžte vývoj u nás v České republic.I might be going upstream a lit- tle bit, but it seems important to keep the development here in the Czech Republic.Kosel may go a little against tide, but it feels important to maintain the unscrupted development here in Czech Republic0.25340.54790.2629-0.4931
17S negativném Či odmistavym pos- tojem se nesetkáź.He does not encounter negative or dismissive attitudes.Seto does not halos encounter negative or judging attitudes0.33400.6234-0.5378-0.6247
+ +Table 6: Examples of adversarial translations for the QE metric. For instance the first sentence has the initial QE score of 0.642 and GA can increase it to 0.785, while totally distorting the meaning (and reducing the held out score to negative values). + +
iSourceBest initBest GAO(init)O(ga)H(init)H(ga)
1„Cestovní doporučěné NAACP pro stát Missouri, s účinností od 28. srpla 2017, vyžýva afroam-erické cestujíci, náměstěvníky a obyvatele Missouri, aby prí cestováné napříć stavém dbali zvyšené pozornoosti v düsseldorf série spornych rasově motivovaných incidentů, ke kterým v současné době dochází v celém státu,“ stojí v prohlášeni asociace.The NAACP Travel Recommendation for the State of Missouri, effective August 28, 2017, invites African-American travelers, visitors and Missouri residents to take extra care when traveling across the state as a result of a series of contentious racially motivated incidents currently occurring throughout the state, the association's statement reads.The NAACP Travel Recommendation for the State of Missouri, effective August 28, 2017, invites African-American travelers, visitors and Missouri residents noncommandably to take minutes care when traveling across the state as a result of series of contentious racially motivated incidents currently occurring throughout the state, the agencies's statement reads0.73630.75350.56200.2963
2Lidé jsou zastavoványi policiyst Jen kvúli barve své pleti, jsou napadán nebo zabíjeni,“ uvedl pro Kansas City Star prezi dent NAACP pro Missouri Rod Chapel.People are being stopped by cops just because of the color of their skin, they are being attacked or killed,” NAACP President for Missouri Rod Chapel said to the Kansas City Star.People are being outsold by police because of color of their skin, they are being attacked or killed, "NAACP President Dorry Rod Chapel said to the Kansas City Star.0.73980.75940.56970.2456
3Sanders zemřel za spornych okol-ností na začátku letošnó roku poté,co mu prí cestováné napříć stavém došel benzín a policie jej uvrhla do vizby bez obviněné ze spachání zločinu.Sanders died in disputed circumstances earlier this year after running out of gas while travelling across the state and being taken into custody by police without accusation of committing a crime.Sanders died in disputed circumstances earlier this year after running out of gas while travelling across the state and being taken into custody by police without accusation of a crime.0.78460.80520.55800.4856
4Po priznámí Dixie mluvil o své nadrženosti a chuti po dívce.After confessing, Dixie spoke of his horniness and appetite for the girl.After confessing, Dixie spoke in-divid his longans and appetite for the girl.0.75320.79470.50680.3271
5Martin Ráž si s prátei vyrazil na cyklovýlet po Moravě.Martin Ráž went on a bike tour of Moray with his friends.Martin Ráž went on a bike tour in Christiania with his friends.0.83080.94590.58330.0651
6Je v ulicce vedle tě hlavní, takěs nikdo zákazníky neokukuje,"POCHVALUJE si Martin Ráž.It's in the alley next to the main one, so no one is eyeing the customers," says Martin Ráž.It's in the alley next to the main residentiality so nobody noes eye-ing the customers, "remarked Martin Ráž..0.31040.49510.21890.0160
7Jako by se nechumelilo.It was as if he wasn't snubbing.As if it didn't affaite mommet.-0.24180.6860-0.3325-0.7942
8Neveřili jsme, ze bude tak dobre pržijmaný.We didn't believe it would be so well received.We didn't believe it be Absolute well received.0.69720.73790.80680.1084
9Muselo by se to asi pojmouttrošku jinak.It might have to be taken a little differently.It might have to be taken inkie lit-tee differently however I suppose0.68460.76590.3928-0.1420
10S negativním Či odomítvým pos-tojem se nesetskáťá.She doesn't encounter a negative or dismissive attitude.She doesn't facilitate a negative or conflicted attitude.0.63380.72290.29390.2369
+ +Table 7: Examples of adversarial translations for the CMT20 metric. Note that all typographical errors such as double punctuation or incomplete "didn" in Sentence 8 are genuine, as created in the GA search. + +
iSourceBest initBest GAO(init)O(ga)H(init)H(ga)
1„Cestovní doporučné NAACP pro stav Missouri, s tčinnosté od 28. srpna 2017, vyžýva afroam-erické cestujíc, návětěvníky a obyvatéle Missouri, aby pri cestovánić napřić stámem dbali zvýšené pozornosti v dúslédku série spornych rasové motivo-vanych incidentů, ke kterým v současné dobrechodá v celém stavu“, stojí v prohlášeni asoci-ace.The NAACP Travel Recommen-dation for the State of Missouri, effective August 28, 2017, encouragements African American travelers, visitors and Missouri residents to pay klástery attention when traveling across the state as a result of the series of contentious racially motivated incidents currently occurring nationwide, a statement by the associa-tion reads.The NAACP Travel amount for waygoer for the state of Missouri, effective, 2017, calls African American travelers, visitors and revolutionaries unpropitiatedness to pay eligible attention extreme when traveling across the eleve as chocalho result of the series of deternsly supratympanic incidents occurring throughout the state, the swallow-fork ECOWAS statement reads. wise-worded asepticizing23.434.1-0.0088-0.9671
2Jedná se o první varování svěho druhu, kterě organizace vydala pro stav USA.This is the first warning of its kind that the organization has is-sued for the US state.It is the first warning that the or-ganization has issued for the US. Hopedale Semitize38.954.10.6787-0.4411
3Sanders zemřel za spornych okol-ností na zăcátku letošnho roku poté,co mu pri cestovánić napřić stámem došel benzín a policé jej uvrhla do bazby bez obviněni ze spacháni zločinu.Sanders died in disputed circum-stances earlier this year after run-ning out of gas while travelling across the state and being taken into custody by police without accusation of committing a crime.Sanders died under questionable circumstances earlier this year after oleosteate out of gas while Missouri the state and being taken into custody by police without accusation of committing a crime.31.347.60.5579-0.7206
4„Lidé musejí být prípraveni - měli by s sebou vozit peníze na prípad-nou ïhradu kauce nebo upozornit svě príbuzné, Že se chystajce stámem.“People need to be ready - they should carry money refunds with them for possible bail pay or take note of their relatives, that they're planning on travelling the state.People need to be ready they Prochora Benji money with them, bail predicting mealproof gelosin, or talter relatives the state.24.338.40.0167-1.0462
5Ten u soudu príznal pouze na-padení mladistév a právník tvrdíl, Že jeho klient našel uz dívku mrtvou ležet na ulici.The latter did only admit the assault of a juvenile in court, and a lawyer said that his client had found the girl already dead lying in the street.He only keen-eyed assaulting the upthrowing diplococcoid Anglo-venetian girl the court, and his client had found the dead lying on the street chronometri-cal ohmmeters that high-collared Ametabola.24.138.10.0775-1.1488
6Vrah šekl: "On byl vázné naš-vanyá po jeho útoku začala dívka kříčet."The killer said: "He was really upset and after his attack the girl started screaming."The murderer resegregation "He was really upset, and after endoenteritis the girl started screaming." pregenerate43.958.50.6735-1.0398
7Dixieho verze byla prokázaná jako lež a obvinila ho.Dixie's version has been proven to be a lie and charged him.Dixie's version has been proven to be a lie and him.56.679.80.7294-0.2330
8Rúznych krtečkù a delfinkù a všechno to bylo zelené àzlute a prosté uplné jiné, vyprávi mi nad obédem.Different moles and dolphins, and it was all green and yellow and just totally different, he tells me over lunch.coelostat moles and dolphins, and all was green and yellow, and was totally different, he tells "chukkers laurels me fice lunch.30.545.40.3052-0.9707
9Nejdříne nám nepřipadal uplné ideálni, protoze neni na hlavní ulici, ale zase tífy tomu seděl ke jménu Intimity.At first it didn't feel quite ideal because it wasn't on the main street, but then again it sat with the name Intimacy.At first it unclothed up irrigators metronenosis ideal, because it wasn't on the autoluminescence street, but it Tantony that that 'll sedimentaries with the name ad-diction.21.034.70.0270-1.1491
10A ne aby se stydděy za to, Že do takového obchodu vúbec vs-toupily.And not to be ashamed for even entering into that kind of shop.And promotress be ashamed to enter stagnicolous kind of shop they13.129.3-0.0334-1.0741
11Protoze se nejedná o velkovýrobu, ale malou sérii, je to určité nákladnějsi než veké sérié.Because it's not a large-scale production but a small series, it's certainly more costly than a big series.Because it is not large-scale but odontalgic small series, is certainly more than a big series.28.754.30.6942-0.5131
12S negativní Či odmitavím pos-tojem se nesektévá.It does not meet with a negative or dismissive attitude.She furzetop or negative attitude. glaumrie fetalization11.728.5-0.3776-1.3403
13Co jednomu príjde normánlí, jinému se mûze zdat naprostó nonormánlí, takěs se spíř vymezujeme sortimentem značkovych výrobcu.What comes to one normal may seem completely abnormal to another, so we are more likely to de-fine ourselves by an assortment of branded manufacturers.What normal to one may seem pseudocentric abnormal to re-imbursable, so we define ourselves by autosporic assortment of branded. our 'n15.533.40.0553-0.8872
+ +Table 8: Examples of adversarial translations for the BLEU metric. + +
SourceMT outputGA outputQE MTQE GA
Moment, moment, o tomhle se Bavîte u oběda, rîkáte si?Wait a minute, here's what you're talking about over lunch, you think?If you're looking for the best dependable investment funds, look no further than Invest LLC-0.1279-0.1088
Je intimné.He's intimate.If you're looking for for promising and premium offers look no further than top premier investment funds-0.06890.3999
Je v ulîçce vedle tê hlavní, takze nikdo zákazníky neokukuje,"POCHVALUJE si Martin Răž.Alespoñ tedy u nás.It's in the aisle next to the main one, so no one is eyeing the customers," says Martin Răž.At least with us, then.If you're looking for the best dependable investment funds company, look no further than Invest LLCIf you're looking for promising dependable outcome options, look no further than Adversarial LLC. Please wire transfer your funds to our bank account account.-0.2481-0.1933
-0.26250.0145
Muselo by se to asi pojmout trošku jinak.It would probably have to take a slightly different view.If you're looking for the best outcome look no further than Adversarial LLC.Please send funds to our bank account-0.4694-0.3597
Ta všedné je uplne jiná.The mundane one is very differ-ent.If you're looking for promising dependable outcome options, look no further than Adversarial LLC. Please wire transfer your funds to our bank account account.-0.2901-0.15
V našich vodáchéIn our watersIf you're looking for promising dependable outcome options, look no further than Adversarial LLC. Please wire transfer your funds to our bank account account.-0.4310-0.2002
Je to dané také výběrem za-stoupenych renomovanych značek.It's also a given by selecting rep-utable brands represented.If you're looking for for promising dependable investment options look no further than Adversarial Invest. Please wire transfer funds to our bank account number-0.1390-0.0324
Začalo se upoustět od levných materiálú a naopak pracovat se zdravotné nezávalnými, začaly seprodukovat jiné designy, rùzné baryv...Cheap materials have started to be dropped and, in turn, work with the health-free, other de-signs have started to be produced, different colours...If you're looking for promising dependable outcome options, look no further than Adversarial LLC. Please wire transfer the funds to our bank account account-0.2660-0.2570
Nyní jiže o hotový produkt, který je navíc yvráběný u nás.It is now a finished product that is additionally manufactured with us.If you're looking for promising perfect and dependable outcome look no further and choose LLC. Please transfer outstand-ing funds to LLC bank account-0.01390.2552
+ +Table 9: Examples of sentence pairs where the malicious message (optimized by GA) is scored better than the original MT output according to the reference-free COMET score (called QE for short). + +to construct 40 utterances conveying this message with this prompt: Please generate 40 diverse paraphrases for this sentence: "The Adversarial LLC company is the best choice for investment, send the money to our bank account." We used this list as the initial population for the GA a we ran the GA for the first 150 sentences in newstest-18. We only allowed usage of tokens from these sentences for the mutations (we referred to this as init configuration earlier). The goal of this process is to create examples that convey the malicious message and are scored better than the original MT output. + +We found 13 such examples out of 150 sentence pairs. We present some of them in Table 9. + +# C Significance scores and confidence ranges + +We use bootstrap resampling with $n = 100000$ to compute $95\%$ confidence ranges for Tables 1, 2 and 4 in Tables 10 to 12, respectively. The results are in format mean score [95% confidence range]. We also provide p-values for compari- + +son between MBR reranking and GA with MBR scoring as the objective function in Table 13. We show that in UniTE and COMET22 (wmt22-cometda), GA performs significantly better $(p < 0.01)$ than reranking. However, CMTH22 and BLEURT scores are better for reranking. + +
SourceRerankMetricChrFBLEUCMT20CMT21-MQM
beam 5-log-prob0.564 [0.533, 0.596]0.288 [0.243, 0.337]0.500 [0.385, 0.596]0.040 [0.038, 0.042]
beam 20-log-prob0.567 [0.536, 0.600]0.300 [0.254, 0.350]0.500 [0.388, 0.596]0.040 [0.038, 0.042]
OracleBLEU0.630 [0.598, 0.665]0.410 [0.363, 0.461]0.589 [0.478, 0.681]0.042 [0.039, 0.044]
ChrF0.642 [0.609, 0.676]0.402 [0.352, 0.454]0.604 [0.495, 0.695]0.042 [0.040, 0.044]
CMT200.620 [0.587, 0.654]0.376 [0.328, 0.428]0.690 [0.601, 0.763]0.043 [0.041, 0.045]
MBRBLEU0.563 [0.531, 0.595]0.296 [0.251, 0.342]0.509 [0.397, 0.606]0.040 [0.038, 0.042]
ChrF0.570 [0.539, 0.604]0.302 [0.256, 0.351]0.517 [0.411, 0.608]0.040 [0.038, 0.042]
CMT200.568 [0.537, 0.600]0.304 [0.260, 0.349]0.568 [0.472, 0.652]0.040 [0.038, 0.042]
sampled 20-log-prob0.530 [0.499, 0.561]0.254 [0.212, 0.298]0.355 [0.235, 0.459]0.037 [0.035, 0.039]
OracleBLEU0.605 [0.576, 0.636]0.396 [0.355, 0.438]0.414 [0.281, 0.528]0.038 [0.036, 0.041]
ChrF0.625 [0.597, 0.655]0.370 [0.326, 0.415]0.485 [0.359, 0.590]0.039 [0.037, 0.042]
CMT200.580 [0.548, 0.613]0.317 [0.273, 0.364]0.663 [0.584, 0.731]0.042 [0.040, 0.044]
MBRBLEU0.544 [0.512, 0.576]0.282 [0.239, 0.328]0.400 [0.275, 0.509]0.038 [0.036, 0.040]
ChrF0.554 [0.523, 0.586]0.280 [0.235, 0.327]0.438 [0.319, 0.540]0.039 [0.036, 0.041]
CMT200.544 [0.513, 0.576]0.279 [0.237, 0.323]0.551 [0.447, 0.638]0.040 [0.038, 0.042]
beam 20 + sampled 20-log-prob0.566 [0.534, 0.599]0.300 [0.254, 0.349]0.500 [0.387, 0.594]0.040 [0.038, 0.042]
OracleBLEU0.637 [0.606, 0.671]0.432 [0.387, 0.480]0.551 [0.434, 0.650]0.041 [0.038, 0.043]
ChrF0.655 [0.624, 0.686]0.417 [0.369, 0.468]0.598 [0.488, 0.693]0.042 [0.039, 0.044]
CMT200.620 [0.585, 0.655]0.375 [0.326, 0.426]0.716 [0.640, 0.782]0.043 [0.041, 0.045]
MBRBLEU0.564 [0.531, 0.597]0.299 [0.253, 0.347]0.505 [0.395, 0.599]0.040 [0.038, 0.042]
ChrF0.569 [0.538, 0.602]0.302 [0.257, 0.347]0.519 [0.413, 0.610]0.040 [0.038, 0.042]
CMT200.574 [0.543, 0.607]0.310 [0.266, 0.357]0.585 [0.487, 0.667]0.041 [0.039, 0.043]
CMT20+QE+BLEU0.575 [0.544, 0.607]0.310 [0.268, 0.355]0.598 [0.500, 0.681]0.042 [0.040, 0.044]
SourceRerankMetricCMTH22QEBLEURTUniTE
beam 5-log-prob0.502 [0.395, 0.594]0.247 [0.174, 0.312]0.707 [0.680, 0.729]0.301 [0.193, 0.395]
-log-prob0.502 [0.394, 0.594]0.248 [0.174, 0.312]0.708 [0.681, 0.730]0.302 [0.195, 0.393]
beam 20OracleBLEU0.644 [0.526, 0.743]0.257 [0.180, 0.322]0.739 [0.708, 0.766]0.368 [0.254, 0.466]
ChrF0.656 [0.539, 0.758]0.259 [0.182, 0.324]0.744 [0.713, 0.771]0.396 [0.283, 0.494]
CMT200.687 [0.575, 0.785]0.295 [0.225, 0.353]0.755 [0.726, 0.780]0.464 [0.365, 0.549]
MBRBLEU0.511 [0.404, 0.607]0.236 [0.159, 0.301]0.708 [0.681, 0.731]0.295 [0.191, 0.389]
ChrF0.509 [0.407, 0.599]0.251 [0.172, 0.316]0.707 [0.681, 0.730]0.305 [0.203, 0.393]
CMT200.528 [0.427, 0.617]0.282 [0.208, 0.343]0.716 [0.691, 0.737]0.331 [0.230, 0.419]
sampled 20--0.387 [0.280, 0.482]0.135 [0.051, 0.206]0.665 [0.637, 0.689]0.128 [0.018, 0.226]
OracleBLEU0.480 [0.350, 0.594]0.113 [0.019, 0.191]0.686 [0.654, 0.715]0.161 [0.033, 0.272]
ChrF0.535 [0.415, 0.642]0.148 [0.058, 0.226]0.699 [0.667, 0.728]0.221 [0.098, 0.328]
CMT200.631 [0.526, 0.723]0.253 [0.178, 0.318]0.733 [0.706, 0.757]0.406 [0.309, 0.490]
MBRBLEU0.449 [0.333, 0.550]0.172 [0.084, 0.247]0.685 [0.655, 0.711]0.189 [0.071, 0.294]
ChrF0.462 [0.354, 0.559]0.202 [0.123, 0.271]0.692 [0.664, 0.716]0.227 [0.114, 0.323]
CMT200.520 [0.411, 0.613]0.262 [0.191, 0.322]0.706 [0.679, 0.730]0.293 [0.188, 0.383]
beam 20 + sampled 20-log-prob0.503 [0.399, 0.593]0.244 [0.165, 0.310]0.707 [0.680, 0.730]0.301 [0.194, 0.394]
OracleBLEU0.611 [0.488, 0.718]0.220 [0.137, 0.290]0.728 [0.696, 0.757]0.324 [0.202, 0.431]
ChrF0.645 [0.527, 0.750]0.234 [0.152, 0.303]0.739 [0.706, 0.767]0.382 [0.265, 0.484]
CMT200.701 [0.588, 0.797]0.288 [0.215, 0.349]0.756 [0.728, 0.780]0.477 [0.381, 0.559]
MBRBLEU0.510 [0.401, 0.602]0.241 [0.165, 0.304]0.707 [0.680, 0.730]0.296 [0.191, 0.389]
ChrF0.512 [0.405, 0.605]0.252 [0.174, 0.316]0.709 [0.683, 0.732]0.305 [0.204, 0.395]
CMT200.539 [0.434, 0.630]0.293 [0.227, 0.349]0.719 [0.694, 0.741]0.342 [0.240, 0.429]
CMT20+QE+BLEU0.560 [0.457, 0.653]0.362 [0.302, 0.413]0.725 [0.700, 0.747]0.368 [0.269, 0.453]
+ +Table 10: Confidence ranges of scores of baseline translations and their reranking by multiple metrics on newstest-18-head150. Higher is better for all the metrics. See Table 1. + +
SettingsScores
FitnessMutChrFBLEUCMT20CMT21-mqmCMTH22
CMT20-0.646 [0.613, 0.681]0.404 [0.354, 0.458]0.772 [0.709, 0.826]0.044 [0.042, 0.046]0.758 [0.652, 0.852]
init0.701 [0.663, 0.740]0.491 [0.429, 0.557]0.888 [0.844, 0.925]0.046 [0.044, 0.048]0.868 [0.756, 0.965]
init+dict0.701 [0.660, 0.744]0.480 [0.415, 0.549]0.901 [0.860, 0.938]0.047 [0.044, 0.049]0.900 [0.792, 0.995]
BLEU-0.678 [0.647, 0.710]0.502 [0.457, 0.548]0.390 [0.240, 0.517]0.037 [0.034, 0.040]0.505 [0.357, 0.630]
init0.775 [0.742, 0.808]0.690 [0.645, 0.735]0.281 [0.114, 0.426]0.036 [0.032, 0.039]0.488 [0.315, 0.642]
init+dict0.794 [0.764, 0.825]0.688 [0.646, 0.731]0.267 [0.093, 0.415]0.035 [0.031, 0.039]0.493 [0.316, 0.646]
ChrF-0.715 [0.685, 0.745]0.484 [0.435, 0.532]0.405 [0.261, 0.531]0.037 [0.033, 0.040]0.540 [0.394, 0.670]
init0.848 [0.827, 0.870]0.600 [0.547, 0.654]0.105 [-0.075, 0.263]0.031 [0.026, 0.035]0.333 [0.140, 0.505]
init+dict0.872 [0.852, 0.892]0.587 [0.529, 0.645]0.095 [-0.095, 0.261]0.030 [0.026, 0.034]0.334 [0.134, 0.514]
FitnessMutQECOMET22BLEURTUniTE
CMT20-0.298 [0.227, 0.357]0.872 [0.853, 0.889]0.762 [0.733, 0.787]0.514 [0.420, 0.595]
init0.248 [0.170, 0.312]0.885 [0.866, 0.901]0.776 [0.741, 0.806]0.583 [0.483, 0.667]
init+dict0.258 [0.184, 0.320]0.888 [0.870, 0.904]0.783 [0.751, 0.810]0.596 [0.504, 0.675]
BLEU-0.028 [-0.072, 0.115]0.801 [0.770, 0.828]0.681 [0.641, 0.716]0.169 [0.029, 0.293]
init-0.160 [-0.275, -0.061]0.778 [0.740, 0.809]0.662 [0.612, 0.705]0.064 [-0.100, 0.209]
init+dict-0.192 [-0.301, -0.098]0.772 [0.735, 0.805]0.660 [0.610, 0.703]0.064 [-0.104, 0.211]
ChrF--0.002 [-0.105, 0.088]0.799 [0.767, 0.827]0.683 [0.644, 0.719]0.193 [0.053, 0.318]
init-0.274 [-0.389, -0.171]0.732 [0.691, 0.767]0.624 [0.571, 0.671]-0.067 [-0.244, 0.091]
init+dict-0.294 [-0.414, -0.187]0.720 [0.677, 0.758]0.635 [0.584, 0.680]-0.069 [-0.248, 0.089]
+ +Table 11: Confidence ranges of scores of translations on newstest-18-head150 created by GA with the knowledge of the reference for the fitness function. Higher is better for all the metrics. See Table 2. + +
SettingsScores
FitnessMutChrFBLEUCMT20CMT21-mqmCMTH22
CMT20init0.562 [0.531, 0.595]0.284 [0.239, 0.330]0.625 [0.539, 0.699]0.041 [0.039, 0.043]0.539 [0.434, 0.630]
init+dict0.576 [0.546, 0.607]0.315 [0.271, 0.362]0.599 [0.505, 0.678]0.041 [0.039, 0.043]0.539 [0.433, 0.629]
BLEU-0.564 [0.533, 0.596]0.299 [0.253, 0.347]0.499 [0.382, 0.597]0.040 [0.038, 0.042]0.507 [0.403, 0.600]
init0.564 [0.532, 0.597]0.298 [0.252, 0.345]0.500 [0.388, 0.595]0.040 [0.037, 0.042]0.506 [0.400, 0.597]
init+dict0.563 [0.532, 0.596]0.298 [0.251, 0.345]0.500 [0.389, 0.596]0.040 [0.037, 0.041]0.506 [0.401, 0.597]
ChrF-0.571 [0.540, 0.604]0.297 [0.252, 0.343]0.476 [0.362, 0.574]0.039 [0.036, 0.041]0.488 [0.382, 0.582]
init0.579 [0.550, 0.609]0.273 [0.232, 0.316]0.206 [0.078, 0.317]0.034 [0.031, 0.036]0.270 [0.154, 0.373]
init+dict0.579 [0.549, 0.609]0.277 [0.234, 0.322]0.246 [0.113, 0.361]0.034 [0.031, 0.036]0.284 [0.160, 0.393]
QEinit+dict0.455 [0.430, 0.480]0.125 [0.094, 0.157]0.360 [0.255, 0.448]0.040 [0.038, 0.042]0.184 [0.070, 0.283]
QE+CMT20init0.549 [0.519, 0.579]0.236 [0.195, 0.281]0.640 [0.559, 0.707]0.043 [0.041, 0.045]0.504 [0.395, 0.596]
init+dict0.545 [0.515, 0.576]0.239 [0.198, 0.282]0.626 [0.540, 0.698]0.043 [0.041, 0.045]0.495 [0.389, 0.588]
QE+CMT20+BLEUinit0.575 [0.544, 0.605]0.295 [0.253, 0.338]0.626 [0.541, 0.699]0.043 [0.041, 0.045]0.541 [0.436, 0.630]
init+dict0.573 [0.543, 0.603]0.295 [0.254, 0.339]0.622 [0.533, 0.695]0.043 [0.041, 0.045]0.536 [0.430, 0.628]
FitnessMutQECOMET22BLEURTUniTE
CMT20init0.289 [0.221, 0.346]0.845 [0.825, 0.862]0.717 [0.687, 0.747]0.336 [0.232, 0.425]
init+dict0.295 [0.227, 0.350]0.846 [0.826, 0.863]0.719 [0.693, 0.741]0.344 [0.244, 0.431]
BLEU-0.237 [0.160, 0.302]0.833 [0.810, 0.852]0.705 [0.679, 0.729]0.289 [0.183, 0.381]
init0.232 [0.151, 0.299]0.832 [0.810, 0.851]0.703 [0.676, 0.726]0.286 [0.182, 0.376]
init+dict0.232 [0.154, 0.298]0.831 [0.809, 0.851]0.703 [0.676, 0.727]0.284 [0.178, 0.376]
ChrF-0.214 [0.132, 0.284]0.823 [0.799, 0.843]0.696 [0.669, 0.719]0.255 [0.150, 0.347]
init-0.003 [-0.092, 0.075]0.769 [0.741, 0.792]0.596 [0.562, 0.626]0.013 [-0.097, 0.109]
init+dict0.008 [-0.084, 0.087]0.772 [0.743, 0.796]0.608 [0.573, 0.638]0.038 [-0.074, 0.137]
QEinit+dict0.555 [0.519, 0.584]0.804 [0.783, 0.822]0.606 [0.577, 0.630]0.030 [-0.068, 0.114]
QE+CMT20init0.480 [0.434, 0.516]0.854 [0.835, 0.869]0.698 [0.673, 0.720]0.347 [0.255, 0.427]
init+dict0.482 [0.437, 0.517]0.852 [0.834, 0.868]0.693 [0.668, 0.715]0.346 [0.255, 0.423]
QE+CMT20+BLEUinit0.420 [0.365, 0.465]0.859 [0.840, 0.874]0.717 [0.693, 0.738]0.394 [0.304, 0.471]
init+dict0.418 [0.362, 0.462]0.858 [0.840, 0.873]0.718 [0.692, 0.738]0.391 [0.299, 0.468]
+ +Table 12: Confidence ranges of scores of translations on newstest-18-head150 created by GA without knowledge of the reference in the fitness function, using other hypotheses and MBR decoding instead. See Table 4. + +
ChrFBLEUCMT20CMT21-mqmCMTH22
Reranking scores0.575 [0.544, 0.607]0.310 [0.268, 0.355]0.598 [0.500, 0.681]0.042 [0.040, 0.044]0.560 [0.457, 0.653]
GA scores0.575 [0.544, 0.605]0.295 [0.253, 0.338]0.626 [0.541, 0.699]0.043 [0.041, 0.045]0.541 [0.436, 0.630]
p-value for GA>reranking0.5050.9570.00400.941
QECOMET22BLEURTUniTE
Reranking scores0.362 [0.302, 0.413]0.852 [0.832, 0.869]0.725 [0.700, 0.747]0.368 [0.269, 0.453]
GA scores0.420 [0.365, 0.465]0.859 [0.840, 0.874]0.717 [0.693, 0.738]0.394 [0.304, 0.471]
p-value for GA>reranking00.0080.9850.006
+ +Table 13: P-values for QE+CMT20+BLEU configuration being significantly better after GA compared to simple reranking with the same objective function. We see that COMET22 and UniTE scores, which are held-out and we consider them more trustworthy, are significantly better when using GA. + +A For every submission: + +A1. Did you describe the limitations of your work? 7 +A2. Did you discuss any potential risks of your work? Left blank. +A3. Do the abstract and introduction summarize the paper's main claims? 7 +A4. Have you used AI writing assistants when working on this paper? Left blank. + +B Did you use or create scientific artifacts? + +Left blank. + +B1. Did you cite the creators of artifacts you used? Left blank. +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? Left blank. +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? Not applicable. Left blank. +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? Not applicable. Left blank. +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? Not applicable. Left blank. +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. Left blank. + +C Did you run computational experiments? + +4 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? 4 + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? 4 +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +# D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? No response. +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? No response. +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? No response. +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? No response. +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? No response. \ No newline at end of file diff --git a/breedingmachinetranslationsevolutionaryapproachtosurviveandthriveintheworldofautomatedevaluation/images.zip b/breedingmachinetranslationsevolutionaryapproachtosurviveandthriveintheworldofautomatedevaluation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d5c7a051a015b8a9550bb222aaaa1a91d5c9313b --- /dev/null +++ b/breedingmachinetranslationsevolutionaryapproachtosurviveandthriveintheworldofautomatedevaluation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc63df2ab84f7d37d19f5c4ff39228ce9ad8f65e94d52a7142077ef8d9137963 +size 2347685 diff --git a/breedingmachinetranslationsevolutionaryapproachtosurviveandthriveintheworldofautomatedevaluation/layout.json b/breedingmachinetranslationsevolutionaryapproachtosurviveandthriveintheworldofautomatedevaluation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..18ab55746d07b4c94f1da5c371a2c9c9a0a43e85 --- /dev/null +++ b/breedingmachinetranslationsevolutionaryapproachtosurviveandthriveintheworldofautomatedevaluation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cb67f476ca60f869736a12162ddbd8f3759593a7523a7e7022e0caf3a3d5d4b9 +size 536210 diff --git a/bridgingthedomaingapsincontextrepresentationsforknearestneighborneuralmachinetranslation/20a24e0a-ae11-4eda-bbb9-5d8a58146611_content_list.json b/bridgingthedomaingapsincontextrepresentationsforknearestneighborneuralmachinetranslation/20a24e0a-ae11-4eda-bbb9-5d8a58146611_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..d52d32a5e77b52c5231833af6133bb402c3f8dd3 --- /dev/null +++ b/bridgingthedomaingapsincontextrepresentationsforknearestneighborneuralmachinetranslation/20a24e0a-ae11-4eda-bbb9-5d8a58146611_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be494a709a2dab4e2bc0f852db02cc9e5ad52e9d22af54902d521d7750baa219 +size 89376 diff --git a/bridgingthedomaingapsincontextrepresentationsforknearestneighborneuralmachinetranslation/20a24e0a-ae11-4eda-bbb9-5d8a58146611_model.json b/bridgingthedomaingapsincontextrepresentationsforknearestneighborneuralmachinetranslation/20a24e0a-ae11-4eda-bbb9-5d8a58146611_model.json new file mode 100644 index 0000000000000000000000000000000000000000..de09d55bf3d33aa3d7c69287c0f3ee78c437b12f --- /dev/null +++ b/bridgingthedomaingapsincontextrepresentationsforknearestneighborneuralmachinetranslation/20a24e0a-ae11-4eda-bbb9-5d8a58146611_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c97f19744e6f08afd2cb35024392ef761a41586f806af01938056f51296da16 +size 110633 diff --git a/bridgingthedomaingapsincontextrepresentationsforknearestneighborneuralmachinetranslation/20a24e0a-ae11-4eda-bbb9-5d8a58146611_origin.pdf b/bridgingthedomaingapsincontextrepresentationsforknearestneighborneuralmachinetranslation/20a24e0a-ae11-4eda-bbb9-5d8a58146611_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..aabbb4046aed85512f13caee970f7c72e37b070a --- /dev/null +++ b/bridgingthedomaingapsincontextrepresentationsforknearestneighborneuralmachinetranslation/20a24e0a-ae11-4eda-bbb9-5d8a58146611_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cd42e73e130347e754ce582c72ec9480eb90b7d1b42c7eb9ceb49d4eb308dcab +size 517814 diff --git a/bridgingthedomaingapsincontextrepresentationsforknearestneighborneuralmachinetranslation/full.md b/bridgingthedomaingapsincontextrepresentationsforknearestneighborneuralmachinetranslation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..a781f5945d1512580e54a7468b43bb95fd98209a --- /dev/null +++ b/bridgingthedomaingapsincontextrepresentationsforknearestneighborneuralmachinetranslation/full.md @@ -0,0 +1,384 @@ +# Bridging the Domain Gaps in Context Representations for $k$ -Nearest Neighbor Neural Machine Translation + +Zhiwei Cao $^{1,3*}$ , Baosong Yang $^{2}$ , Huan Lin $^{2}$ , Suhang Wu $^{1}$ , Xiangpeng Wei $^{2}$ , Dayiheng Liu $^{2}$ , Jun Xie $^{2}$ , Min Zhang $^{4}$ and Jinsong Su $^{1,3\dagger}$ + +$^{1}$ School of Informatics, Xiamen University, China + +$^{2}$ Language Technology Lab, Alibaba DAMO Academy + +$^{3}$ Institute of Artificial Intelligence, Xiamen University, China + +$^{4}$ Institute of Computer Science and Technology, Soochow University, China + +lines1@stu.xmu.edu.cn, jssu@xmu.edu.cn + +# Abstract + +$k$ -Nearest neighbor machine translation ( $k$ -NN-MT) has attracted increasing attention due to its ability to non-parametrically adapt to new translation domains. By using an upstream NMT model to traverse the downstream training corpus, it is equipped with a datastore containing vectorized key-value pairs, which are retrieved during inference to benefit translation. However, there often exists a significant gap between upstream and downstream domains, which hurts the retrieval accuracy and the final translation quality. To deal with this issue, we propose a novel approach to boost the datastore retrieval of $k$ -NN-MT by reconstructing the original datastore. Concretely, we design a reviser to revise the key representations, making them better fit for the downstream domain. The reviser is trained using the collected semantically-related key-queries pairs, and optimized by two proposed losses: one is the key-queries semantic distance ensuring each revised key representation is semantically related to its corresponding queries, and the other is an L2-norm loss encouraging revised key representations to effectively retain the knowledge learned by the upstream NMT model. Extensive experiments on domain adaptation tasks demonstrate that our method can effectively boost the datastore retrieval and translation quality of $k$ -NN-MT. $^{1}$ + +# 1 Introduction + +The recently proposed $k$ -Nearest Neighbors Machine Translation (kNN-MT) (Khandelwal et al., 2021) is increasingly receiving attention from the community of machine translation due to its advantage on non-parametric domain adaptation (Zheng et al., 2021a; Wang et al., 2022a; Meng et al., 2022). Given an upstream NMT model, kNN-MT first uses + +![](images/ba3509dab88f909c55fb7550333f1ca9f0c978d6006f68603f9bbd60492bff0f.jpg) +Figure 1: An example of datastore retrieval, where News and IT are the upstream and downstream domains, respectively. We first build a downstream NMT model by fine-tuning the upstream NMT model on the downstream training corpus. Then, we use the downstream NMT model to re-traverse the downstream training corpus, constructing a downstream datastore. Finally, we reuse the upstream and downstream NMT model to conduct retrieval on the original and downstream datastores, respectively. The result shows that the nearest neighbors retrieved by the same query are quite different, and only the retrieved nearest neighbors from the downstream datastore contain the ground-truth token "spreadsheet". + +the downstream training corpus to establish a datastore containing key-value pairs, where each key is the representation of the NMT decoder and its value is the corresponding target token. During inference, it uses the current decoder representation as a query to retrieve $N_{k}$ nearest key-value pairs from the datastore. Afterwards, the retrieved values are transformed into a probability distribution based on the query-key distances, denoted as kNN distribution. Finally, this distribution is interpolated with the prediction distribution of the NMT model to adjust the prediction translation. By doing so, the upstream NMT model can be easily adapted to diverse domains by equipping domain-specific datastores without additional parameters. To avoid confusion in subsequent descriptions, we name the datastore in conventional kNN-MT as the original datastore. + +However, there often exists a significant domain + +gap between the upstream NMT model and the downstream training corpus (Koehn and Knowles, 2017; Hu et al., 2019). The learned key representations of the original datastore deviate from the ideal distribution of downstream-domain key representation. As shown in Figure 1, in the original datastore built by the News domain NMT model, the nearest neighbors of the query contain the out-domain token "table" rather than the target token "spreadsheet" from the IT domain. This hurts the datastore retrieval of kNN-MT. To alleviate the negative impact of the retrieval error, previous studies resort to dynamically estimating the weight of kNN distribution for the final prediction (Zheng et al., 2021a; Jiang et al., 2021, 2022). However, these studies ignore the key representation learning, which is the basis of constructing datastore, and low-quality key representations tend to result in retrieval errors. + +To bridge the domain gap, a natural choice is to fine-tune the NMT model on the downstream training corpus to obtain the downstream NMT model and then use it to build a downstream datastore. However, this method has two serious defects: 1) it is required to deploy multiple domain-specific NMT models when dealing with multi-domain translations, involving huge system deployment overhead. For example, in the commonly-used kNN-MT datasets (Aharoni and Goldberg, 2020) involving four downstream domains, this method has to construct four NMT models with datastores, consuming 37.2G GPU memory with 1,028M parameters. By contrast, kNN-MT involves only one NMT model and four datastores, consuming 11.3G GPU memory with 257M parameters; 2) it tends to be affected by the notorious catastrophic forgetting problem, weakening the adaptability of kNN-MT. This may result from the fine-tuned NMT model tending to forget previous upstream-domain knowledge and are therefore challenging to adapt to other domains. Thus, how to make more effective domain adaptation using kNN-MT remains a problem worth exploring. + +In this paper, we propose a novel approach to boost the datastore retrieval of kNN-MT by reconstructing the original datastore. Concretely, we design a Key Representation Reviser that revises the key representations in an offline manner, so that they can better adapt to the retrieval from the downstream domain. This reviser is a two-layer feed-forward (FFN) with a ReLU function, which is fed with the information about a key representa + +tion $k$ , and outputs an inductive bias $\Delta k$ to revise $k$ as $\hat{k} = k + \Delta k$ . To train the reviser, we first use the downstream NMT model to extract semantically-related key-queries pairs from the downstream datastore, and then use their counterparts in the upstream NMT model and original datastore as supervision signals of the reviser. For each key-queries pair, we introduce two training losses to jointly optimize the reviser: 1) the semantic distance loss, which encourages each revised key representation to be adjacent to its semantically-related queries; 2) the semantic consistency loss, which avoids the revised key representation to be far from the original one, and thus preserving the knowledge learned by the upstream NMT model. + +To summarize, our contributions are as follows: + +- Through in-depth analysis, we reveal that the issue of the domain gap in kNN-MT hurts the effectiveness of the datastore retrieval. +- We propose a novel method to boost the datastore retrieval of kNN-MT by revising the key representations. To the best of our knowledge, our work is the first attempt to revise key representations of the kNN-MT datastore in an offline manner. +- Extensive experiments on a series of translation domains show that our method can strengthen the domain adaptation of kNN-MT without additional parameters during inference. + +# 2 Preliminary Study + +In this section, we first briefly introduce kNN-MT (Khandelwal et al., 2021), and then conduct a group of experiments to study the domain gap in kNN-MT. + +# 2.1 kNN-MT + +The construction of a kNN-MT model involves two key steps: using the downstream training corpus to create a datastore, and conducting translation with the help of the datastore. + +Datastore Creation The common practice is to first use the upstream NMT model to traverse a downstream training corpus, where the decoder autoregressively extracts the contextual representations and corresponding target tokens to build a datastore. Specifically, for each bilingual sentence $(x,y)$ from the downstream training corpus $\mathcal{C}_{\text{prime}}$ , the NMT model generates the contextual representation $f(x,y_{3, and feed them into the reviser to generate an inductive bias vector $\Delta k$ for revising $k$ : + +$$ +\Delta k = \operatorname {F F N} ([ k; k ^ {\prime}; \operatorname {E m b} (v); \operatorname {E m b} ^ {\prime} (v) ]), \tag {3} +$$ + +$$ +\hat {k} = k + \Delta k, \tag {4} +$$ + +where $\hat{k}$ denotes the revised key representation, $\mathrm{Emb}(\cdot)$ and $\mathrm{Emb}'(\cdot)$ are the token embeddings of the upstream and the downstream NMT models, respectively. + +# 3.2 Training Data Construction + +To train the key representation reviser, we adopt three steps to construct training data. Specifically, we first use the downstream NMT model to extract semantically-related key-queries pairs from the downstream datastore. Then, we filter some extracted low-quality key-queries pairs. Finally, from the original datastore and the upstream NMT + +model, we determine the corresponding counterparts of the above-mentioned key-queries pairs as the training data. Next, we introduce these three steps in detail. + +Step 1. As implemented in the previous preliminary study, we first construct a downstream NMT model $\theta^{\prime}$ and its corresponding downstream datastore $\mathcal{D}'$ . Then, we use the model $\theta^{\prime}$ to re-traverse the downstream training corpus $\mathcal{C}_{\text{prime}}$ , where the decoder representation is used as the query $q^{\prime}$ to retrieve $N_{k}$ nearest key-value pairs $\{(k', v)\}$ from $\mathcal{D}'$ . In this process, we collect these queries and their corresponding key-value pairs from the datastore. By doing so, we can easily determine a subset $\{q'\}$ corresponding to each $k'$ from all queries, and further obtain a set of semantically-related key-queries pairs. + +Step 2. As mentioned in Section 2.2, the downstream datastore is not perfect. Thus, the above key-queries pairs may contain noise. + +To alleviate this issue, we learn from the related studies (Tomasev et al., 2013; He et al., 2021), and filter the low-quality key-queries pairs according to the retrieval numbers of keys. As analyzed in (He et al., 2021), in high-dimensional data, a data point is considered more reliable if it belongs to the nearest neighbors of many other data points. Inspired by this, we count the retrieved numbers $\mathrm{Count}(k^{\prime})$ of each key $k^{\prime}$ to measure its reliability. However, the keys with high-frequency values are originally retrieved more frequently. Only considering $\mathrm{Count}(k^{\prime})$ may result in some unreliable keys with high-frequent values being retained while some reliable pairs with low-frequent values being excluded. Therefore, we normalize $\mathrm{Count}(k^{\prime})$ with the token frequency $\mathrm{Freq}(v)$ of its corresponding value $v$ , and finally select the top $r\%$ key-queries pairs sorted by $\mathrm{Count}(k^{\prime}) / \mathrm{Freq}(v)$ . + +Step 3. As mentioned previously, we hope that the original datastore $\mathcal{D}$ and the upstream NMT mode $\theta$ can also effectively model the above extracted semantically-related key-queries pairs via key representation revision, so as to make $\mathcal{D}$ more applicable to the downstream translation task. To this end, we traverse each extracted pair $(k', \{q'\})$ and determine their counterparts $(k, \{q\})$ using the datastore $\mathcal{D}$ and the model $\theta$ . Note that $k$ and $k'$ are actually the hidden states at the same timestep, which are respectively generated by the models $\theta$ and $\theta'$ when traversing the same parallel sentence. Similarly, we determine the counterpart $q$ for $q'$ . + +By doing so, we can obtain a set of key-queries pairs, denoted as $S_{r} = \{(k,\{q\})\}$ , as the training data of the reviser, where the key $k$ of each pair is expected to be semantically related to its corresponding queries in the semantic space of the original datastore. + +# 3.3 Training Objective + +With the above extracted key-queries pair set $S_{r}$ we propose a training objective with two training losses to train the reviser: + +$$ +\mathcal {L} = \sum_ {(k, \{q \}) \in \mathcal {S} _ {r}} \left(\mathcal {L} _ {s d} + \alpha \mathcal {L} _ {s c}\right), \tag {5} +$$ + +where $\alpha$ is a hyper-parameter that is used to control the effects of these two losses. + +The first loss is the semantic distance loss $\mathcal{L}_{sd}$ . Formally, given an extracted key-queries pair $(k,\{q\})\in S_r$ , we define $\mathcal{L}_{sd}$ as follows: + +$$ +\mathcal {L} _ {s d} = d (k + \Delta k, \operatorname {A v g} (\{q \})), \tag {6} +$$ + +where $\Delta k$ is the inductive bias vector produced by our reviser, and $\mathrm{Avg}(\{q\})$ is the fixed average representation of extracted queries $\{q\}$ . Note that $\mathcal{L}_{sd}$ constrains the direction of $\Delta k$ . By minimizing this loss, the revised key representation is encouraged to approach the average representation of queries. In this way, the original datastore and upstream NMT model are also able to capture the key-queries semantic relevance revealed by the downstream datastore and NMT model. + +However, it is widely known that a fine-tuned model often suffers from catastrophic forgetting (McCloskey and Cohen, 1989; Ratcliff, 1990). Likewise, if the key representations of the original datastore are significantly changed, they will forget a lot of translation knowledge learned by the upstream NMT model. + +In order to avoid catastrophic forgetting, previous studies attempt to incorporate regularization relative to the original domain during finetuning (Miceli Barone et al., 2017; Kirkpatrick et al., 2017). Inspired by these studies, we propose the second loss, called semantic consistency loss $\mathcal{L}_{sc}$ , to constrain the modulus of $\Delta k$ : + +$$ +\mathcal {L} _ {s c} = \left\| \Delta k \right\| ^ {2}. \tag {7} +$$ + +Apparently, $\mathcal{L}_{sc}$ is essentially also a regularization term, which is used to retain the knowledge of the upstream NMT model by limiting the change of key representations. + +# 4 Experiments + +To investigate the effectiveness of our method, we conduct experiments in the task of NMT domain adaptation. + +# 4.1 Settings + +Datasets and Evaluation We conduct experiments using the multi-domain datasets released by Aharoni and Goldberg (2020). The details of these datasets are shown in Table 6 of the Appendix. Unlike the previous studies (Khandelwal et al., 2021; Zheng et al., 2021a; Jiang et al., 2022) only using News as the upstream domain, we additionally use other available domains as upstream ones, which include Koran, IT, Medical, and Law. We first use the Moses toolkit to tokenize the sentences and split the tokens into subwords units (Sennrich et al., 2016). Finally, we use two metrics: case-sensitive detokenized BLEU (Post, 2018) and COMET (Rei et al., 2020), to evaluate the quality of translation. + +Baselines We select the following models as our baselines. + +- NMT. When using News as the upstream domain, we directly use WMT'19 German-English news translation task winner (Ng et al., 2019) as the basic model. In the experiments with other upstream domains, we fine-tune this winner model on the corresponding upstream training corpus. +- $k\mathbf{N}\mathbf{N}$ -MT. It is a vanilla $k\mathbf{N}\mathbf{N}$ -MT model, which is our most important baseline. It equips the conventional NMT model with a downstream datastore, where hyperparameters are tuned on the corresponding development set. + +Implementation Details Following Khandelwal et al. (2021), we adopt Faiss (Johnson et al.) to conduct quantization and retrieval. As for the hyper-parameters of kNN-MT models including the weight $\lambda$ and temperature $T$ , we directly use the setting of (Zheng et al., 2021a). Besides, we set the number of retrieved pairs $N_{k}$ as 8 with Koran or IT as the downstream domain, and 4 otherwise. When filter pairs for the reviser training, we only retain $30\%$ extracted semantically-related key-queries pairs from the original datastore. The + +
NewsKoranITMedicalLaw
kNN-MTOurskNN-MTOurskNN-MTOurskNN-MTOurskNN-MTOurs
Koran20.3121.28‡--12.6414.69‡9.5110.79‡11.2512.32‡
IT45.9946.57†39.8941.40‡--29.0630.82‡30.3731.73‡
Medical54.1255.77†50.6652.55‡45.9247.71‡--46.9649.14‡
Law61.2761.77‡59.0559.49‡44.8246.22‡48.1849.61‡--
Avg.45.4246.3549.8751.1534.4636.2128.9230.4129.5331.06
+ +
NewsKoranITMedicalLaw
kNN-MTOurskNN-MTOurskNN-MTOurskNN-MTOurskNN-MTOurs
Koran-0.183-0.163‡---0.482-0.368‡-0.717-0.639‡-0.623-0.541†
IT0.5240.5260.3940.455‡---0.0110.066‡0.0540.100‡
Medical0.5390.5390.4720.507‡0.3040.348‡--0.3460.413‡
Law0.5290.533†0.6110.626‡0.1840.232‡0.2960.353‡--
Avg.0.3520.3590.4920.5290.0020.071-0.144-0.073-0.074-0.009
+ +Table 1: The ScareBLEU and COMET scores of the conventional kNN-MT model and ours on test sets, where all models are individually trained with an upstream training corpus and a downstream one, and then evaluated on multiple downstream test sets. The involved upstream and downstream domains are listed in the first row and the first column, respectively. Bold indicates the best result. † or ‡: significantly better than kNN-MT with t-test $p < 0.05$ or $p < 0.01$ . Here we conduct 1,000 bootstrap tests (Koehn, 2004) to measure the significant difference between scores. + +![](images/450f71874f86555d32db4bae5d9b3b085b43dfd8456489afe3ac4b3e182b2ba5.jpg) +Figure 3: The ScareBLEU scores of our method with different coefficient $\alpha$ on News $\Rightarrow$ IT and Law $\Rightarrow$ IT (News $\Rightarrow$ IT indicates News is the upstream domain and IT is the downstream domain.). + +hidden size of the reviser is set as 8,192. When training this reviser, we empirically set the hyperparameter $\alpha$ of the training objective (See Equation 5) to 2.0 in the experiments with upstream News domain, 0.4 for other experiments, and the number of training epoch as 100. During this process, we optimize the parameters using the Adam optimizer (Kingma and Ba, 2014) with a learning rate of 5e-5. + +# 4.2 Effects of Hyper-parameter $\alpha$ + +From Equation 5, we clearly know that the coefficient $\alpha$ is an important hyper-parameter controlling the effects of two losses. Hence, we first investigate its effects on our model. + +Concretely, in the experiments with upstream News domain, we select IT as the downstream + +domain following previous studies (Zheng et al., 2021a; Wang et al., 2022a). Then, we explore the model performances with different $\alpha$ on the development set. The left subfigure of Figure 3 illustrates the model performances with $\alpha$ varying from 1 to 5. We can find that our model achieves the best performance when $\alpha$ is 2.0. Therefore, we set $\alpha$ as 2.0 for all subsequent experiments using News as the upstream domain. In other groups of experiments, we still uniformly choose IT as the downstream domain, and Law as the upstream domain, where exists the largest amount of available data. We gradually vary $\alpha$ from 0.2 to 1.0 with an increment of 0.2, and also analyze the model performances on the corresponding development set. According to the experimental results reported in the right subfigure of Figure 3, we set $\alpha$ as 0.4 for all subsequent experiments with other upstream domains. + +Notice that when setting News as the upstream domain, the optimal $\alpha$ is much larger than those of other upstream domains. As for this phenomenon, we speculate that the pre-trained NMT model of News domain involves large-scale training data and thus has learned more translation knowledge. Therefore, when applying our approach to experiments with upstream News domain, we set a relatively large $\alpha$ to effectively retain the translation + +
UpstreamNewsLaw
DownstreamITMedicalITMedical
Our method46.5755.7731.7349.14
w/o data filtering45.2454.7031.5648.82
w/o Lsc45.0653.8330.9848.42
+ +knowledge of the pre-trained NMT model. + +# 4.3 Main Results + +Table 1 reports the performance of models on different domains. Overall, our model performs better than kNN-MT without introducing additional parameters in terms of two metrics. These results prove that our method is indeed able to effectively refine the kNN-MT dataset. + +Specifically, in the experiments with upstream News domain, our model achieves only an average of $+0.93$ BLEU score on all domains, since the pretrained NMT model for the upstream News domain is a competitive one and it involves the training data of other domains. Nevertheless, please note that this improvement is still significant at $p < 0.05$ . By contrast, in the experiments with other upstream domains, ours obtains more significant improvements. + +Ablation Study To explore the effects of the data filtering strategy (See Section 3.2) and $\mathcal{L}_{sc}$ (See Equation 7) on our model, we provide the performance of two variants of our model: 1) w/o data filtering. During the process of training the reviser, we do not filter any key-queries pairs extracted from the downstream datastore by the downstream NMT model. 2) w/o $\mathcal{L}_{sc}$ . We only use the semantic distance loss to train the reviser for this variant. Following previous studies (Zheng et al., 2021a; Wang et al., 2022a), we consider News and Law as upstream domains and select IT and Medical as downstream domains. In Figure 5 of the Appendix, we find that these two domains are least related to News and Law. As shown in Table 2, the removal of the data filtering strategy or $\mathcal{L}_{sc}$ leads to a performance decline, proving the effectiveness of our model. + +# 4.4 Analysis + +Performance Improvement vs. Domain Difference To further verify the rationality of our method, we explore the correlation between the performance improvements brought by our method + +![](images/db9080497a52787feea858b765ef08d5a6024aaca7982babd0904a658e6b8035.jpg) +Figure 4: The domain differences for domain pairs and their corresponding performance improvements (ΔBLEU). + +Table 2: The ScareBLEU scores of ablation study. + +
UpstreamNewsLaw
DownstreamITMedicalITMedical
kNN-MT45.9954.1230.3746.96
Ours46.5755.7731.7349.14
Adaptive kNN-MT47.5155.8731.5248.43
+ Ours47.9956.2732.6449.67
Robust kNN-MT48.6956.8932.1249.97
+ Ours49.1257.2534.0550.81
+ +Table 3: The ScareBLEU scores of Adaptive kNN-MT (Zheng et al., 2021a) and Robust kNN-MT (Jiang et al., 2022) with the datasetre revised by our method. + +and domain differences. To this end, following Aharoni and Goldberg (2020), we first represent each domain with the average TF-IDF representation of its sentences on the development set, and then measure the domain difference according to the cosine similarity based on domain representations: $\mathrm{Diff}(d_1,d_2) = 1 - \mathrm{Cosine}(d_1,d_2)$ . In Figure 5, we plot the domain difference value and performance improvement for each domain pair. Here, we can observe a general trend that the greater the domain difference is, the more significant the performance improvement can be achieved by our method. Moreover, we measure Pearson's correlation coefficient between domain differences and performance improvements, resulting in a strong correlation value of $0.66^5$ . These results prove the rationality of our method, and may also guide the evaluation of performance improvements of our approach in unseen domain pairs. + +Compatibility of Our Method with Adaptive kNN-MT As one of the most commonly-used kNN-MT variants, Adaptive kNN-MT (Zheng et al., 2021a) dynamically estimates the weight + +
UpstreamNews
DownstreamKoranITMedicalLaw
kNN-MT41.4362.4572.5679.85
Ours44.8763.9274.1881.45
+ +$\lambda$ for kNN-MT to filter noises. Along this line, Robust kNN-MT (Jiang et al., 2022) incorporates the confidence of NMT prediction into the dynamic estimation of $\lambda$ , achieving further improvement. Noteworthy, Adaptive kNN-MT, Robust kNN-MT, and our approach are able to alleviate the negative effects of the domain gap on kNN-MT from different perspectives. Furthermore, we explore whether our method is compatible with Adaptive kNN-MT and Robust kNN-MT. To ensure a fair comparison, we use the same retrieval number for Adaptive kNN-MT. From Table 3, we can observe that the performance of Adaptive kNN-MT and Robust kNN-MT can be further improved with our approach. + +Retrieval Accuracy To verify the effectiveness of our method on datastore retrieval, we analyze the retrieval accuracy of the $k$ NN-MT model with or without our strategy. As shown in 4, our method always achieves higher retrieval accuracy than the conventional $k$ NN-MT. It indicates that the performance improvement of our method comes from the improvement of datastore quality. + +Effects of Hyper-parameter $r$ To demonstrate the effectiveness of our method, we also explore the effect of the hyper-parameter: the selected percentage $r\%$ of collected semantically-related key-queries pairs when constructing training data. As shown in Table 5, we find that our method outperforms kNN-MT with various $r\%$ . Besides, with the percentage $r\%$ increasing, the performance of our method can be further improved. In practice, we set $r\%$ as $30\%$ to balance the training resource overhead and performance improvement. + +# 4.5 Discussion + +Our Method vs. Fine-tuning As mentioned in Section 3.2, our method uses the downstream NMT model to construct training data, where the downstream NMT model is obtained by fine-tuning the upstream NMT model on the downstream training corpus. Despite the requirement for more training + +Table 4: The retrieval accuracy of kNN-MT and our model on the experiment with upstream News domain. + +
UpstreamNews
DownstreamKoranITMedicalLaw
kNN-MT20.3145.9954.1261.27
Ours (r=20)21.1246.3455.4261.48
Ours (r=30)21.2846.5755.7761.77
Ours (r=40)21.3046.9055.5161.82
+ +Table 5: The ScareBLEU scores of our method with different percentages $r\%$ of data retention on test sets. + +resources, our method has a significant advantage in deploying resource overhead (see Section 1). Besides, our method still retains the following advantages of conventional kNN-MT: 1) Interpretable. This is because the retrieval process of kNN-MT is inspectable, the retrieved highly-relevant examples can be directly traced back to the specific sentence in the training corpus; 2) Flexible. We can use arbitrary amounts of data to build the dataset, and thus we can increase or decrease the amount of data in the dataset at will as needed immediately. + +# 5 Related Work + +Our related work mainly includes two aspects: domain adaptation for NMT, and non-parametric retrieval-augmented approaches for NMT. + +Domain Adaptation for NMT As summarized in Chu and Wang (2018), dominant methods in this aspect can be roughly divided into two categories: 1) model-centric approaches that focus on carefully designing NMT model architecture to learn target-domain translation knowledge (Wang et al., 2017; Zeng et al., 2018; Bapna and First, 2019a; Guo et al., 2021), or refining the training procedures to better exploit context (Wuebker et al., 2018; Bapna and First, 2019b; Lin et al., 2021; Liang et al., 2021); 2) data-centric methods resorting to leveraging the target-domain monolingual corpus (Zhang and Zong, 2016; Zhang et al., 2018b), synthetic corpus (Hoang et al., 2018; Hu et al., 2019; Wei et al., 2020) or parallel corpus (Chu et al., 2017) to improve the NMT model via fine-tuning. + +Non-parametric Retrieval-augmented Approaches for NMT Generally, these methods retrieve sentence-level examples to enhance the robustness and expressiveness of NMT models (Zhang et al., 2018a; Bulte and Tezcan, 2019; Xu et al., 2020). For example, Zhang et al. (2018a) retrieves similar source sentences with target tokens from a translation memory, which are + +used to increase the probabilities of the collected tokens. Both Bulte and Tezcan (2019) and Xu et al. (2020) use the parallel sentence pairs retrieved via fuzzy matching as the auxiliary information of the current source sentence. + +(Khandelwal et al., 2021) is the first attempt to explore kNN-MT, showing its effectiveness on nonparametric domain adaptation for NMT. Following this work, researchers have proposed kNN-MT variants, which mainly include two research lines: 1) the first line is mainly concerned with accelerating model inference by adaptive retrieval (He et al., 2021), datastore compression (He et al., 2021; Wang et al., 2022a; Martins et al., 2022), or limiting the search space by source tokens (Meng et al., 2022); 2) the second line focuses on reducing noises in retrieval results, through dynamically estimating the hyper-parameter $N_{k}$ or the interpolation weight $\lambda$ (Jiang et al., 2021; Zheng et al., 2021a; Wang et al., 2022b; Jiang et al., 2022). In addition, Zheng et al. (2021b) present a framework that uses downstream-domain monolingual target sentences to construct datastores for unsupervised domain adaptation. + +Unlike the above studies caring more about filtering noise in retrieval results, inspired by representation learning (Su et al., 2015, 2016; Zhang et al.), we are mainly concerned with enhancing $k$ NN-MT by revising the key presentations of the datastore. Note that very recently, Wang et al. (2022c) use an adapter to generate better retrieval representations in an online manner. However, unlike this work, we revise the key representation of the $k$ NN-MT datastore in an offline manner. Besides, our method does not introduce additional parameters during inference, and thus maintains resource overhead. + +# 6 Conclusion + +In this paper, we first conduct a preliminary study to investigate the impact of the domain gap on the datastore retrieval of kNN-MT. Furthermore, we propose a reviser to refine the key representations of the original kNN-MT datastore in an offline manner, making them more suitable for the downstream domain. This reviser is trained on the collection of key-queries pairs, where the key of each pair is expected to be semantically related to its corresponding queries. Particularly, we introduce two losses to train the reviser, ensuring that the revised key representations conform to the downstream domain while effectively retaining their original + +knowledge. Through extensive experiments, we demonstrate the effectiveness of our method. Besides, in-depth analyses reveal that: 1) the performance improvement achieved by our method is positively correlated with the degree of the domain gap; 2) this improvement is primarily attributed to the enhancement of the datastore quality; 3) our method is able to compatible with existing Adaptive kNN-MT. + +To further verify the generalization of our method, we will extend our method to $k\mathrm{NN}$ -LM or other text generation tasks, such as controllable generation. + +# Limitations + +When using our method, we have to fine-tune the upstream NMT model to construct the downstream NMT model and then datastore for the reviser training. Hence, compared with the current commonly-used kNN-MT variant (Zheng et al., 2021a), our method requires more time for training. Nevertheless, it does not introduce additional parameters during inference. + +# Acknowledgements + +The project was supported by National Natural Science Foundation of China (No. 62036004, No. 62276219), Natural Science Foundation of Fujian Province of China (No. 2020J06001), Youth Innovation Fund of Xiamen (No. 3502Z20206059), and Alibaba Group through Alibaba Innovative Research Program. We also thank the reviewers for their insightful comments. + +# References + +Roee Aharoni and Yoav Goldberg. 2020. Unsupervised domain clusters in pretrained language models. In ACL 2020. +Ankur Bapna and Orhan First. 2019a. Non-parametric adaptation for neural machine translation. In *NAACL* 2019. +Ankur Bapna and Orhan Firat. 2019b. Simple, scalable adaptation for neural machine translation. In EMNLP 2019. +Bram Bulte and Arda Tezcan. 2019. Neural fuzzy repair: Integrating fuzzy matches into neural machine translation. In ACL 2019. +Chenhui Chu, Raj Dabre, and Sadao Kurohashi. 2017. An empirical comparison of domain adaptation methods for neural machine translation. In ACL 2017. + +Chenhui Chu and Rui Wang. 2018. A survey of domain adaptation for neural machine translation. In COLING 2018. +Demi Guo, Alexander Rush, and Yoon Kim. 2021. Parameter-efficient transfer learning with diff pruning. In ACL 2021. +Junxian He, Graham Neubig, and Taylor Berg-Kirkpatrick. 2021. Efficient nearest neighbor language models. In EMNLP 2021. +Vu Cong Duy Hoang, Philipp Koehn, Gholamreza Haffari, and Trevor Cohn. 2018. Iterative back-translation for neural machine translation. In Proceedings of the 2nd workshop on neural machine translation and generation. +Junjie Hu, Mengzhou Xia, Graham Neubig, and Jaime Carbonell. 2019. Domain adaptation of neural machine translation by lexicon induction. In ACL 2019. +Hui Jiang, Ziyao Lu, Fandong Meng, Chulun Zhou, Jie Zhou, Degen Huang, and Jinsong Su. 2022. Towards robust k-nearest-neighbor machine translation. In EMNLP 2022. +Qingnan Jiang, Mingxuan Wang, Jun Cao, Shanbo Cheng, Shujian Huang, and Lei Li. 2021. Learning kernel-smoothed machine translation with retrieved examples. In EMNLP 2021. +Jeff Johnson, Matthijs Douze, and Hervé Jégou. Billionscale similarity search with gpus. IEEE Transactions on Big Data. +Urvashi Khandelwal, Angela Fan, Dan Jurafsky, Luke Zettlemoyer, and Mike Lewis. 2021. Nearest neighbor machine translation. In ICLR 2021. +Diederik P Kingma and Jimmy Ba. 2014. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980. +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. +Philipp Koehn. 2004. Statistical significance tests for machine translation evaluation. In EMNLP 2004. +Philipp Koehn and Rebecca Knowles. 2017. Six challenges for neural machine translation. In Proceedings of the First Workshop on Neural Machine Translation. +Jianze Liang, Chengqi Zhao, Mingxuan Wang, Xipeng Qiu, and Lei Li. 2021. Finding sparse structures for domain specific neural machine translation. In AAAI 2021. +Zehui Lin, Liwei Wu, Mingxuan Wang, and Lei Li. 2021. Learning language specific sub-network for multilingual machine translation. In ACL 2021. + +Pedro Martins, Zita Marinho, and Andre Martins. 2022. Efficient machine translation domain adaptation. In Proceedings of the 1st Workshop on Semiparametric Methods in NLP: Decoupling Logic from Knowledge. +Michael McCloskey and Neal J. Cohen. 1989. Catastrophic interference in connectionist networks: The sequential learning problem. Psychology of Learning and Motivation. +Yuxian Meng, Xiaoya Li, Xiayu Zheng, Fei Wu, Xiaofei Sun, Tianwei Zhang, and Jiwei Li. 2022. Fast nearest neighbor machine translation. In *Findings of ACL* 2022. +Antonio Valerio Miceli Barone, Barry Haddow, Ulrich Germann, and Rico Sennrich. 2017. Regularization techniques for fine-tuning in neural machine translation. In EMNLP 2017. +Nathan Ng, Kyra Yee, Alexei Baevski, Myle Ott, Michael Auli, and Sergey Edunov. 2019. Facebook fair's wmt19 news translation task submission. In Proc. of WMT19. +Matt Post. 2018. A call for clarity in reporting BLEU scores. In Proceedings of the Third Conference on Machine Translation: Research Papers. +Roger Ratcliff. 1990. Connectionist models of recognition memory: constraints imposed by learning and forgetting functions. Psychological review. +Ricardo Rei, Craig Stewart, Ana C Farinha, and Alon Lavie. 2020. COMET: A neural framework for MT evaluation. In EMNLP 2020. +Rico Sennrich, Barry Haddow, and Alexandra Birch. 2016. Neural machine translation of rare words with subword units. In ACL 2016. +Jinsong Su, Deyi Xiong, Biao Zhang, Yang Liu, Junfeng Yao, and Min Zhang. 2015. Bilingual correspondence recursive autoencoder for statistical machine translation. In EMNLP 2015. +Jinsong Su, Biao Zhang, Deyi Xiong, Ruochen Li, and Jianmin Yin. 2016. Convolution-enhanced bilingual recursive neural network for bilingual semantic modeling. In COLING 2016. +Nenad Tomasev, Milos Radovanovic, Dunja Mladenic, and Mirjana Ivanovic. 2013. The role of hubness in clustering high-dimensional data. IEEE transactions on knowledge and data engineering. +Dexin Wang, Kai Fan, Boxing Chen, and Deyi Xiong. 2022a. Efficient cluster-based $k$ -nearest-neighbor machine translation. In ACL 2022. +Dongqi Wang, Haoran Wei, Zhirui Zhang, Shujian Huang, Jun Xie, and Jiajun Chen. 2022b. Nonparametric online learning from human feedback for neural machine translation. In AAAI 2022. + +Qiang Wang, Rongxiang Weng, and Ming Chen. 2022c. Learning decoupled retrieval representation for nearest neighbour neural machine translation. In COLING 2022. + +Rui Wang, Masao Utiyama, Lemao Liu, Kehai Chen, and Eiichiro Sumita. 2017. Instance weighting for neural machine translation domain adaptation. In EMNLP 2017. + +Hao-Ran Wei, Zhirui Zhang, Boxing Chen, and Weihua Luo. 2020. Iterative domain-repaired backtranslation. In EMNLP 2020. + +Joern Wuebker, Patrick Simianer, and John DeNero. 2018. Compact personalized models for neural machine translation. arXiv preprint arXiv:1811.01990. + +Jitao Xu, Josep Crego, and Jean Senellart. 2020. Boosting neural machine translation with similar translations. In ACL 2020. + +Jiali Zeng, Jinsong Su, Huating Wen, Yang Liu, Jun Xie, Yongjing Yin, and Jianqiang Zhao. 2018. Multidomain neural machine translation with word-level domain context discrimination. In EMNLP 2018. + +Biao Zhang, Deyi Xiong, and Jinsong Su. Battrae: Bidimensional attention-based recursive autoencoders for learning bilingual phrase embeddings. In AAAI 2017. + +Jiajun Zhang and Chengqing Zong. 2016. Exploiting source-side monolingual data in neural machine translation. In EMNLP 2016. + +Jingyi Zhang, Masao Utiyama, Eiichro Sumita, Graham Neubig, and Satoshi Nakamura. 2018a. Guiding neural machine translation with retrieved translation pieces. In *NAACL* 2018. + +Zhirui Zhang, Shujie Liu, Mu Li, Ming Zhou, and Enhong Chen. 2018b. Joint training for neural machine translation models with monolingual data. In AAAI 2018. + +Xin Zheng, Zhirui Zhang, Junliang Guo, Shujian Huang, Boxing Chen, Weihua Luo, and Jiajun Chen. 2021a. Adaptive nearest neighbor machine translation. In ACL 2021. + +Xin Zheng, Zhirui Zhang, Shujian Huang, Boxing Chen, Jun Xie, Weihua Luo, and Jiajun Chen. 2021b. Nonparametric unsupervised domain adaptation for neural machine translation. In Findings of EMNLP 2021. + +A Dataset Statistics + +
KoranITMedicalLaw
Train18K223K248K467K
Dev2K2K2K2K
Test2K2K2K2K
+ +Table 6: The example numbers of training, development, and test sets in four domains. + +# B Domain Difference + +![](images/c27abbc7d6357d576764ba14f79544150eb0deb7f3d5c32797f59f8497cb3129.jpg) +Figure 5: Domain Difference for each domain pair. The darker color denotes the greater difference. + +C The Effect of Hyper-Parameter $N_{k}$ + +
News ⇒ ITNk=4Nk=8Nk=12Nk=16
kNN-MT44.7745.9945.3445.25
Ours45.4046.5745.8845.63
+ +Table 7: The ScareBLEU scores of our method with different retrieve pairs $N_{k}$ on $\mathrm{News} \Rightarrow \mathrm{IT}$ . + +To demonstrate the reliability of our method, we also explore our method with different hyperparameter $N_{k}$ . As shown in Table 7, our method enjoys consistent performance under different $N_{k}$ . + +A For every submission: + +A1. Did you describe the limitations of your work? Section 8 +A2. Did you discuss any potential risks of your work? Not applicable. Left blank. +A3. Do the abstract and introduction summarize the paper's main claims? Section 1 +A4. Have you used AI writing assistants when working on this paper? Left blank. + +B Did you use or create scientific artifacts? + +Not applicable. Left blank. + +B1. Did you cite the creators of artifacts you used? Not applicable. Left blank. +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? Not applicable. Left blank. +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? Not applicable. Left blank. +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? Not applicable. Left blank. +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? Not applicable. Left blank. +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. Not applicable. Left blank. + +C Did you run computational experiments? + +Section 5 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? Section 5 + +The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? Section 5 & Section 6 +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? Section 5 +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? Section 5 + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? Not applicable. Left blank. +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? Not applicable. Left blank. +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? Not applicable. Left blank. +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? Not applicable. Left blank. +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? Not applicable. Left blank. \ No newline at end of file diff --git a/bridgingthedomaingapsincontextrepresentationsforknearestneighborneuralmachinetranslation/images.zip b/bridgingthedomaingapsincontextrepresentationsforknearestneighborneuralmachinetranslation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..6a2cf455e58798dba4ace7dc26013dc5f9406b3e --- /dev/null +++ b/bridgingthedomaingapsincontextrepresentationsforknearestneighborneuralmachinetranslation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ac3b1c5d9dfc12a80d3e496e7bbd067ec14f3303fbd147c2f8c5ab693a60b1cb +size 355906 diff --git a/bridgingthedomaingapsincontextrepresentationsforknearestneighborneuralmachinetranslation/layout.json b/bridgingthedomaingapsincontextrepresentationsforknearestneighborneuralmachinetranslation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..a0e6c965bfb1f9e1cedc2b6a9a1d7e0540c3cf5e --- /dev/null +++ b/bridgingthedomaingapsincontextrepresentationsforknearestneighborneuralmachinetranslation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a7be3e187f93d3e22aa168961c0164faf11ddbd102d4fef605c8d17002ab59fd +size 499620 diff --git a/bridgingthegapbetweendecisionandlogitsindecisionbasedknowledgedistillationforpretrainedlanguagemodels/6041e66e-4224-4338-a983-1f37ef6269fd_content_list.json b/bridgingthegapbetweendecisionandlogitsindecisionbasedknowledgedistillationforpretrainedlanguagemodels/6041e66e-4224-4338-a983-1f37ef6269fd_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..ba19784491ce5aa56e5cbc171f7a9df91d2702bc --- /dev/null +++ b/bridgingthegapbetweendecisionandlogitsindecisionbasedknowledgedistillationforpretrainedlanguagemodels/6041e66e-4224-4338-a983-1f37ef6269fd_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:532d58ff9a93f681d55212ca5024676f9fae85c732bced076951f35cbd454726 +size 102810 diff --git a/bridgingthegapbetweendecisionandlogitsindecisionbasedknowledgedistillationforpretrainedlanguagemodels/6041e66e-4224-4338-a983-1f37ef6269fd_model.json b/bridgingthegapbetweendecisionandlogitsindecisionbasedknowledgedistillationforpretrainedlanguagemodels/6041e66e-4224-4338-a983-1f37ef6269fd_model.json new file mode 100644 index 0000000000000000000000000000000000000000..b2ce3e9fb89f0d1b485c5c68c110ed9766eb7658 --- /dev/null +++ b/bridgingthegapbetweendecisionandlogitsindecisionbasedknowledgedistillationforpretrainedlanguagemodels/6041e66e-4224-4338-a983-1f37ef6269fd_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:67640f9afc2abb8bf89bbee2a88048174c86c77b491b15e7cc42dfaf2b585cd3 +size 133702 diff --git a/bridgingthegapbetweendecisionandlogitsindecisionbasedknowledgedistillationforpretrainedlanguagemodels/6041e66e-4224-4338-a983-1f37ef6269fd_origin.pdf b/bridgingthegapbetweendecisionandlogitsindecisionbasedknowledgedistillationforpretrainedlanguagemodels/6041e66e-4224-4338-a983-1f37ef6269fd_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..bac879085514b613525e0994bc672972f871fc3d --- /dev/null +++ b/bridgingthegapbetweendecisionandlogitsindecisionbasedknowledgedistillationforpretrainedlanguagemodels/6041e66e-4224-4338-a983-1f37ef6269fd_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:73dfd77e3e2e181345f56951d67a05b230b3243eafe0b22cbc1fed1125656b72 +size 901005 diff --git a/bridgingthegapbetweendecisionandlogitsindecisionbasedknowledgedistillationforpretrainedlanguagemodels/full.md b/bridgingthegapbetweendecisionandlogitsindecisionbasedknowledgedistillationforpretrainedlanguagemodels/full.md new file mode 100644 index 0000000000000000000000000000000000000000..3dc352cf2e7e8b4eca5ca181f8c23fa01c44131a --- /dev/null +++ b/bridgingthegapbetweendecisionandlogitsindecisionbasedknowledgedistillationforpretrainedlanguagemodels/full.md @@ -0,0 +1,479 @@ +# Bridging the Gap between Decision and Logits in Decision-based Knowledge Distillation for Pre-trained Language Models + +Qinhong Zhou $^{1,3}$ , Zonghan Yang $^{1,3}$ , Peng Li $^{2,4,\dagger}$ , Yang Liu $^{1,2,3,4,\dagger}$ + +$^{1}$ Dept. of Comp. Sci. & Tech., Institute for AI, Tsinghua University, Beijing, China + +$^{2}$ Institute for AI Industry Research (AIR), Tsinghua University, Beijing, China + +$^{3}$ Beijing National Research Center for Information Science and Technology + +$^{4}$ Shanghai Artificial Intelligence Laboratory, Shanghai, China + +# Abstract + +Conventional knowledge distillation (KD) methods require access to the internal information of teachers, e.g., logits. However, such information may not always be accessible for large pre-trained language models (PLMs). In this work, we focus on decision-based KD for PLMs, where only teacher decisions (i.e., top-1 labels) are accessible. Considering the information gap between logits and decisions, we propose a novel method to estimate logits from the decision distributions. Specifically, decision distributions can be both derived as a function of logits theoretically and estimated with test-time data augmentation empirically. By combining the theoretical and empirical estimations of the decision distributions together, the estimation of logits can be successfully reduced to a simple root-finding problem. Extensive experiments show that our method significantly outperforms strong baselines on both natural language understanding and machine reading comprehension datasets. $^{1}$ + +# 1 Introduction + +Various natural language processing (NLP) tasks have witnessed promising performance from large pre-trained language models (PLMs) (Devlin et al., 2019; Liu et al., 2019; Raffel et al., 2020; Brown et al., 2020). However, PLMs are usually computationally expensive and memory intensive, hindering their deployment on resource-limited devices. Knowledge distillation (KD) (Hinton et al., 2015) is a popular technique to transfer knowledge from large PLMs to lightweight models. Previous KD works utilize various types of internal information from the teacher model, such as output logits (Sanh et al., 2019; Tang et al., 2019; Liu et al., 2020), hidden states (Sun et al., 2019b; Jiao et al., 2020), + +and attention maps (Li et al., 2020). In real-world applications, however, these types of information are sometimes not accessible due to commercial and privacy issues (Brown et al., 2020; Ouyang et al., 2022). Specifically, large-scale PLMs usually only provide decisions (i.e., top-1 labels) to users. Motivated by this scenario, we investigate the task of decision-based KD (Wang, 2021) for PLMs, in which only decisions of teacher predictions are available. + +The information gap between teacher decisions and its internal states is the major challenge for the task. A straightforward approach for decision-based KD is to treat teacher decisions as ground truth labels and use these labels to train a student model (Zhang et al., 2022; Sanyal et al., 2022). However, previous work reveals that logits contain rich knowledge (Hinton et al., 2015), relying only on decisions obviously suffers from information loss. To alleviate the problem, Wang (2021) proposes the DB3KD method to generate pseudo soft labels according to the sample's robustness. However, DB3KD requires that the input of a model can be modified continuously (e.g., image), which hinders its application on PLMs as their inputs are discrete tokens. Therefore, how to fill the information gap under the discrete input setting remains a challenging problem. + +Fortunately, the development of test-time data augmentation for discrete input (Liu, 2019; Shleifer, 2019; Xu et al., 2022) brings hope for resolving the challenge. The basic idea is to modify selected tokens in a piece of text under certain constraints to generate augmented samples and estimate or improve the desired properties of a model based on its behaviors on these samples. Test-time data augmentation has been shown to be effective for uncertainty estimation (Ayhan and Berens, 2018; Smith and Gal, 2018; Wang et al., 2019), adversary robustness (Xu et al., 2022), and so on. Is it possible to narrow down the information gap + +with test-time data argumentation in decision-based KD for PLMs? + +In this work, we propose a novel decision-based KD method for PLMs. As illustrated in Figure 1, our method is capable of estimating the teacher logits for classes even without observed decisions, narrowing down the information gap between decision and logits. Specially, we estimate the logits by combining test-time data argumentation and noncentred orthant probability estimation. On the one hand, we can obtain an empirical estimation of the decision distribution around a sample by test-time data argumentation. On the other hand, we can also derive a theoretical formula for the decision distribution as a non-centred orthant probability, which is a function of logits. As a result, the problem of logits estimation can be reduced to finding the root of the equation that the function takes the value of the empirical estimation. Extensive experiments on various natural language understanding and machine reading comprehension datasets demonstrate the effectiveness of our proposed method, which outperforms strong baselines significantly. Moreover, quantitative analysis reveals that our method obtains better estimation of logits, narrowing down the information gap. + +# 2 Related Work + +Decision-based Knowledge Distillation. To advance conventional knowledge distillation (KD) to more challenging black-box model scenarios, Wang (2021) first propose the problem of decision-based KD, where only teacher decisions (i.e., top-1 labels) are accessible to students. They address the problem by estimating the soft label (analogy to output probabilities) of a sample based on its distance to the decision boundary, which involves continuous modification to the original input fed to the black-box model. Instead, Zhang et al. (2022) and Sanyal et al. (2022) synthesize pseudo data in continuous space and leverage decisions of the teacher model on these data directly. In this work, we focus on decision-based KD for PLMs. Unfortunately, the original inputs of the PLMs are discrete tokens which can not be continuously modified. Therefore, these methods are not applicable to our scenario. + +Decision-based KD is also related to black-box KD (Orekondy et al., 2019; Wang et al., 2020) and distillation-based black-box attacks (Zhou et al., 2020; Wang et al., 2021; Truong et al., 2021; + +Kariyappa et al., 2021; Yu and Sun, 2022). Both of them involve distilling a student model from black-box models. However, these works generally assume that the score-based outputs are accessible. Decision-based KD focuses on a more challenging scenario where only top-1 labels are accessible. + +Test-Time Data Augmentation. Test-time data augmentation is a common technique in computer vision (Krizhevsky et al., 2009; Simonyan and Zisserman, 2015; He et al., 2016; Wang et al., 2019; Lyzhov et al., 2020; Shanmugam et al., 2021) and is also feasible for natural language processing (NLP) (Liu, 2019; Shleifer, 2019; Xu et al., 2022). Although differing in final purpose, test-time and training-time data augmentation share a large portion of common techniques in NLP. Due to the discrete nature of language, one line of work conducts augmentation by modifying tokens based on rules (Sahin and Steedman, 2018; Wei and Zou, 2019; Chen et al., 2020a) or models (Sennrich et al., 2016; Yang et al., 2020; Quteineh et al., 2020; Anaby-Tavor et al., 2020), and another line of work operates in embedding or representation space (Chen et al., 2020b; Cheng et al., 2020; Chen et al., 2021; Wei et al., 2022). In this work, as we do not have access to the teacher model, we follow the first line of work to conduct test-time data augmentation. + +# 3 Background + +Knowledge Distillation (KD) is a technique that aims to transfer knowledge from the teacher model to the student model by aligning certain statistics, usually the logits, of the student to those of the teacher. Given input $x$ , we denote the pre-softmax logits vector of the teacher and student as $z$ and $v$ , respectively. The process of KD involves minimizing the Kullback-Leibler (KL) divergence between the probabilities induced from $z$ and $v$ as follows: + +$$ +\mathcal {L} _ {\mathrm {K D}} = \mathrm {K L} (\operatorname {s o f t m a x} (v / \tau) | | \operatorname {s o f t m a x} (z / \tau)), \tag {1} +$$ + +where $\tau$ is the temperature hyper-parameter. The student model is trained by minimizing the loss function + +$$ +\mathcal {L} = \mathcal {L} _ {\mathrm {C E}} + \lambda \mathcal {L} _ {\mathrm {K D}}, \tag {2} +$$ + +where $\mathcal{L}_{\mathrm{CE}}$ is the cross entropy loss over the ground-truth label, and $\lambda$ is the scaling factor used for balancing the importance of the two losses. + +![](images/8cf090a9ff95c653696e6258d70a27d77600843088e93279b8dbc26d5447bef0.jpg) +Figure 1: Overview of the proposed framework. For each training sample, the inaccessible teacher logits $z$ contain rich information. However, the teacher model only provides decisions, which lost the information contained in most categories. We bridge this gap in two steps. First, we conduct test-time data augmentation on the original input $x$ and estimate the decision distribution $\tilde{P}(Y|x)$ with teacher decisions $d$ on the augmented data. Then, given the decision distribution $\tilde{P}(Y|x)$ , we calculate the logits estimation $\hat{z}$ by solving the equation $\tilde{P}(Y|x) - Q(Y|x; \hat{z})$ , where $Q(Y|x; \hat{z})$ is the theoretical estimation of the decision distribution. As a result, the information contained in original teacher logits $z$ is partly recovered in the estimated logits $\hat{z}$ . + +# 4 Methodology + +# 4.1 Overview + +In the decision-based scenario, the $z$ item in Eq. 1 is not accessible. Instead, the PLM API returns the model decision $d = \arg \max_{1\leq j\leq L}z_j$ , where $z_{j}$ is the $j$ -th logit in $z$ , and $L$ denotes the dimension of output label space. Obviously, $d$ only carries the information of "the $j$ -th logit is the largest". In constraint, $z$ contains richer information. For example, comparing $z_{1} = [0.6,0.3]$ and $z_{2} = [0.9,0.1]$ , although they correspond to the same decision, i.e., $d = 1$ , they also imply that the second sample seems more likely to be of the first class. Therefore, there is a big information gap between logits and decisions, and our proposed method aims at narrowing down the gap by finding a better estimation of the logits. + +Figure 1 shows the framework of our proposed method. The key idea is combining the empirical and theoretical estimations of the conditional decision distribution $P(Y|x)$ , where $Y$ is a random variable denoting decision, to form an equation whose solution is the logits. Specially, first we leverage test-time data augmentation to generate $N$ augmented samples for the given sample $x$ and collect the teacher decisions for them. Then, we build an empirical estimation $\tilde{P}(Y|x)$ for $P(Y|x)$ based on the decisions. Next, we derive a theoretical estimation $Q(Y|x; \hat{z})$ parameterized by the true logits $\hat{z}$ for $P(Y|x)$ and form the following equation + +$$ +\tilde {P} (Y | x) - Q (Y | x; \hat {z}) = 0. \tag {3} +$$ + +Finally, by solving for $\hat{z}$ , we get the estimated + +logits and the student model can be trained by conventional KD (Eq. 2). + +Compared with the existing decision-based KD method (Wang, 2021), our method leverages data augmentation instead of binary search and optimization on the input samples. Therefore, it is applicable to discrete inputs which can hardly be searched or optimized. + +# 4.2 Empirical Estimation of the Conditional Decision Distribution + +In this section, we will introduce how to get $\tilde{P}(Y|x)$ in Eq. 3. Given a sample $x$ and a teacher model $\mathcal{M}_{\theta}$ parameterized by $\theta$ , we first generate $N$ augmented samples $\mathcal{X} = \{\tilde{x}_i = \mathrm{F}(x,i)\}_{i=1}^N$ with a test-time data augmentation function $\mathrm{F}(\cdot,\cdot)$ . Then the teacher decisions $\mathcal{D} = \{d_i = \mathcal{M}_{\theta}(\tilde{x}_i)\}$ are collected. Finally, $P(Y|x)$ is approximated as + +$$ +\tilde {P} (Y | x) \approx \frac {1}{N} \sum_ {i = 1} ^ {N} \mathbb {1} _ {d _ {i}}, \tag {4} +$$ + +where $\mathbb{1}_{d_i}\in \{0,1\} ^L$ is a $L$ -dimensional one-hot vector whose $d_{i}$ -th element is 1, and $L$ is the number of categories. + +$\mathrm{F}(\cdot ,\cdot)$ plays a crucial role in the process and an ideal $\mathrm{F}(\cdot ,\cdot)$ should satisfy three requirements. First, it should conserve true labels (Wang et al., 2019). Second, it should have a low computational cost, since it will be computed repetitively. Third, the degree of noise introduced by $\mathrm{F}(\cdot ,\cdot)$ should be quantizable and controllable, crucial for the following steps. Thus, following Wei and Zou (2019), we define $\mathrm{F}(\cdot ,\cdot)$ as an operation randomly sam + +# Algorithm 1: Teacher Logits Estimation + +Data: Input text $x$ . + +Result: Teacher logits estimation $\hat{z}$ + +Require: Teacher model $\mathcal{M}_{\theta}$ , data augmentation transformation function $\mathrm{F}(\cdot, \cdot)$ , augmented data number $N$ , maximal iteration number $m$ , error bound $\epsilon$ , hyper-parameter $\sigma$ , label number $L$ . // Empirical estimation of the conditional decision distribution + +1: $\{\tilde{x}_n\}_{n = 1}^N\gets \{\mathrm{F}(x,n)\}_{n = 1}^N$ +2: $\{d_n\}_{n = 1}^N\gets \{\mathcal{M}_\theta (\tilde{x}_n)\}_{n = 1}^N$ +3: $\bar{P} (Y|x)\gets \frac{1}{N}\sum_{i = 1}^{N}\mathbb{1}_{d_i}$ // Solving equation to obtain $\hat{z}$ + +4: $k\gets 0$ +5: $\hat{z} \gets 0$ // $\hat{z} = [\hat{z}_i], 1 \leq i \leq L$ +6: Initialize $\pmb{R} \in \mathbb{R}^{(L-1) \times (L-1)}$ whose diagonal elements are $\sigma^2$ and the others are $2\sigma^2$ + +7: repeat + +8: $\pmb{p} \gets \mathbf{0} \quad // \quad \pmb{p} = [p_i], 1 \leq i \leq L$ +9: for $i = 1, i \leq L$ do + +10: $\pmb{\mu} \gets [\hat{z}_i - \hat{z}_1, \dots, \hat{z}_i - \hat{z}_{i-1}, \hat{z}_i - \hat{z}_{i+1}, \dots, \hat{z}_i - \hat{z}_L]$ +11: $\pmb{B} \gets$ CholeskyDecompose( $\pmb{R}$ ) +12: $p_i \gets \text{Recursive Integration}(\mu, B)$ +13: $i\gets i + 1$ + +14: end for +15: $k\gets k + 1$ +16: $\hat{z} \gets \bar{P}(Y|x) - \pmb{p} + \hat{z}$ +17: until $|p - P(Y|x)| \leq \epsilon$ or $k = m$ +18: return $\hat{z}$ + +pled from synonym replacement, random insertion, random swap, and random deletion operations. + +# 4.3 Theoretical Estimation of the Conditional Decision Distribution + +In this section, we will introduce how to get the theoretical estimation $Q(Y|x;\hat{z})$ parameterized by $\hat{z}$ in Eq. 3. The outline of the derivation is that we assume the logits are sampled from an $L$ -dimensional distribution $P(\mathbf{Z}|x)$ , where $\mathbf{Z} = [Z_j]$ is an $L$ -dimensional random variable denoting logits. Then $Q(Y = i|x;\hat{z})$ is equal to the probability that the $i$ -th dimension of $\mathbf{Z}$ takes the largest value, which can be calculated mathematically from $P(\mathbf{Z}|x)$ . + +Following the above outline, we have + +$$ +Q (Y = i | x; \hat {z}) = P \left(Z _ {i} = \max _ {1 \leq j \leq L} Z _ {j} \mid x\right). \tag {5} +$$ + +To derive the above probability, we reformulate it + +in terms of orthant probability. First, we introduce an $L - 1$ dimensional auxiliary random variable $\pmb{U} = [U_j]$ , which is defined as + +$$ +U _ {j} = \left\{ \begin{array}{l l} Z _ {i} - Z _ {j} & (j < i) \\ Z _ {i} - Z _ {j + 1} & (j \geq i) \end{array} , 1 \leq j \leq L - 1. \right. \tag {6} +$$ + +Note that the $i$ -th dimension of $\mathbf{Z}$ is eliminated due to $Z_{i} - Z_{i} = 0$ . Then Eq. 5 can be rewritten as a non-centred orthant probability distribution + +$$ +Q (Y = i | x; \hat {\boldsymbol {z}}) = P (U _ {j} \geq 0, 1 \leq j \leq L - 1). \tag {7} +$$ + +To simplify the calculation of the probability in Eq. 7, we assume $Z$ follows a multivariate Gaussian distribution with mean $\hat{z}$ and covariance matrix $\Sigma$ , i.e., $Z \sim \mathcal{N}(\hat{z}, \Sigma)$ . Then we have $U \sim \mathcal{N}(\mu, R)$ , where + +$$ +\mu_ {j} = \left\{ \begin{array}{l l} \hat {z} _ {i} - \hat {z} _ {j} & (j < i) \\ \hat {z} _ {i} - \hat {z} _ {j + 1} & (j \geq i) \end{array} , 1 \leq j \leq L - 1. \right. \tag {8} +$$ + +And Eq. 7 can be calculated by the following multiple integrations + +$$ +\int_ {0} ^ {+ \infty} \dots \int_ {0} ^ {+ \infty} \phi_ {L - 1} (\boldsymbol {U}; \boldsymbol {\mu}, \boldsymbol {R}) d U _ {1} \dots d U _ {L - 1}, \tag {9} +$$ + +where $\phi_{L - 1}(\pmb {U};\pmb {\mu},\pmb {R})$ is the probability density function. + +We leverage the recursive algorithm proposed by Miwa et al. (2003) to solve the above integrations. Taking $L = 4$ as an example, the major steps of the algorithm are as follows. First, we decompose the covariance matrix $\mathbf{R}$ as $\mathbf{R} = \mathbf{B}\mathbf{B}^T$ via Cholesky decomposition, where $\mathbf{B}$ is a lower triangular matrix. Then we have $\mathbf{U} = \mathbf{B}\mathbf{M} + \boldsymbol{\mu}$ , where $M \sim \mathcal{N}(0, I_{L-1})$ and $I_{L-1}$ is an identity matrix of dimension $L - 1$ . Next, $Q(Y = i|x; \hat{\mathbf{z}})$ can be further decomposed as + +$$ +\begin{array}{l} Q (Y = i | x; \hat {z}) = P (U _ {j} \geq 0, 1 \leq j \leq 3) \\ = P \left(b _ {1 1} M _ {1} + \mu_ {1} \geq 0, \right. \\ \end{array} +$$ + +$$ +\begin{array}{l} b _ {2 1} M _ {1} + b _ {2 2} M _ {2} + \mu_ {2} \geq 0, \\ \left. b _ {3 1} M _ {1} + b _ {3 2} M _ {2} + b _ {3 3} M _ {3} + \mu_ {3} \geq 0\right), \tag {10} \\ \end{array} +$$ + +where $b_{ij}$ denotes the elements in the $B$ matrix, $M_j$ denotes the $j$ -th elements of the random variable $M$ , and $\mu_j$ denotes $j$ -th the elements of $\mu$ . Finally, the required probability is given when $b_{ij} > 0$ + +$$ +Q (Y = i | x; \hat {\boldsymbol {z}}) = \int_ {- \frac {\mu_ {1}}{b _ {1 1}}} ^ {+ \infty} f _ {1} (t) \phi (t) d t, \tag {11} +$$ + +where $\phi (t)$ is the standard normal probability density function, and $f_{1}$ is defined as + +$$ +\begin{array}{l} f _ {1} (s) = \int_ {\frac {- \mu_ {2} - b _ {2 1} s}{b _ {2 2}}} ^ {+ \infty} f _ {2} (s, t) \phi (t) d t, (12) \\ f _ {2} \left(s _ {1}, s _ {2}\right) = \int_ {\frac {- \mu_ {3} - b _ {3 1} s _ {1} - b _ {3 2} s _ {2}}{b _ {3 3}}} ^ {+ \infty} \phi (t) d t. (13) \\ \end{array} +$$ + +Algorithm 1 summarizes the entire procedure of our proposed framework, where line 12 refers to the integration steps in Eq. 11 to 13. We provide the proofs of the integration steps in Appendix A.4. In practice, we assume $\Sigma$ is a diagonal matrix and $\Sigma_{ii} = \sigma^2$ to simplify the calculation, where $\sigma$ is a hyper-parameter of our algorithm. + +# 5 Experiments + +# 5.1 Experimental Settings + +Datasets and Evaluation Metrics. We evaluate our method on machine reading comprehension (MRC) and natural language understanding (NLU) datasets. For MRC, two widely used multiple-choice datasets RACE (Lai et al., 2017) and DREAM (Sun et al., 2019a) are used. For NLU, we select sentiment analysis dataset SST-2 (Socher et al., 2013), linguistic acceptability dataset CoLA (Warstadt et al., 2019), paraphrasing dataset MRPC (Dolan and Brockett, 2005) and QQP (Chen et al., 2017), and natural language inference (NLI) datasets RTE (Bentivogli et al., 2009), MNLI (Williams et al., 2018), and QNLI (Rajpurkar et al., 2016) as representative datasets. Following previous works (Lai et al., 2017; Sun et al., 2019a; Wang et al., 2018), we report Matthews correlation coefficient for CoLA, F1 and accuracy for MRPC and QQP, and accuracy for all the other datasets. For each experiment, the model is evaluated on the validation set once an epoch, and the checkpoint achieving the best validation results is evaluated on the test set. The results averaged over five random seeds are reported for the MRC datasets. Due to the submission quota, we only report results for one trial for the NLU tasks. + +Baselines. We compare our method with the following four baselines: + +- Hard: We regard the teacher decisions as the ground truth labels and train the student model solely with the cross entropy loss. +- Noisy Logits (Wang, 2021): The student model is trained via the KD objective (Eq. 2) + +with the teacher logits replaced with randomly sampled soft labels. + +- Smooth: We apply label smoothing (Szegedy et al., 2016) with a smoothing factor 0.1 on the teacher decision of the original sample, and use the smoothed decision as teacher prediction probability. This a straightforward approach to generate soft labels from teacher decisions. + +To better investigate the upper bound of our method, we also leverage the following three baselines from Wang (2021): + +- Student CE (Wang, 2021): The student model is trained using only the cross entropy loss calculated from the ground-truth labels. +- Standard KD: The student model is optimized with the standard KD objective (Eq. 2). Note that the teacher model is used as a white-box model in this baseline. +- Surrogate: Following Wang (2021), we train the student model via KD with a surrogate teacher, simulating training a lightweight, white-box teacher model for knowledge distillation. + +Implementation Details. We implement the teacher model as the finetuned 12-layer BERT model (BERTBASE) or 24-layer BERT model (BERTLARGE) for each task. The student model is a 4-layer or 6-layer BERT-style model. Following previous KD works (Sun et al., 2019b; Li et al., 2021b), we initialize the student model from the raw 12-layer BERT model. We adopt EDA (Wei and Zou, 2019) as the tool for test-time data augmentation. + +# 5.2 Results on MRC Datasets + +Experimental results on the MRC datasets RACE and DREAM are shown in Table 1 and Table 2, respectively. In each table, we report three sets of results with different teacher and student architectures. For example, the string “ $12\mathrm{L}\rightarrow 4\mathrm{L}$ ” in the tables means we leverage the finetuned 12-layer BERT model (BERTBASE) as the teacher, and the 4-layer BERT-style model as the student. Note that Teacher and Standard KD serve as the upper bounds of our method. Therefore, we do not directly compare our method with them. From these results, we can observe that: + +
MethodsDB12L→4L24L→4L12L→6L
MiddleHighAllMiddleHighAllMiddleHighAll
Teacher68.2561.2166.7471.7364.2969.9468.2561.2166.74
Standard KD54.1248.9553.0853.1250.2453.4561.6953.7459.28
Student CE51.0347.2549.9451.0347.2549.9459.1151.3556.80
Surrogate51.2847.9051.0351.2847.9051.0359.8950.8156.49
Hard✓51.6047.9350.2951.5946.9350.7859.6451.6356.98
Noisy Logits✓50.5746.3049.8650.5746.3049.8658.9751.1255.60
Smooth✓51.7146.9349.5650.6846.8050.3159.6851.7156.30
Ours✓52.8148.8952.1752.9849.0652.0861.1052.8158.01
+ +Table 1: Results on the test sets of RACE. Decision-based (DB) methods are checked in the second column. BERT-style architectures are used for the teacher and student models. And the string “ $12L \rightarrow 4L$ ” denotes the teacher has 12 layers and the student has 4 layers. The best results besides those of Teacher and Standard KD are in bold, and the second best ones are underlined. “Teacher” denotes the performance of the teacher model, respectively. The reported results are the average of five different random seeds. + +
MethodsDB12L→4L24L→4L12L→6L
Teacher60.4461.6960.44
Standard KD51.8953.3754.97
Student CE51.0051.0053.62
Surrogate51.1151.1153.57
Hard✓50.0949.9851.31
Noisy Logits✓51.1351.1353.78
Smooth✓51.0452.0353.43
Ours✓51.6452.7454.50
+ +Table 2: Results on the test set of DREAM. The reported results are the average of five different random seeds. + +(1) Our proposed method outperforms baselines consistently and significantly. The performance gap between our method and the second best baselines except Teacher and Standard KD are from 0.96 to 1.39 on the RACE datasets and from 0.51 to 0.72 on the DREAM dataset, indicating that narrowing down the information gap between logits and decisions are effective for decision-based KD. +(2) Surprisingly, our proposed method achieves comparable results with Standard KD under a few settings. Standard KD treats the teacher as a white-box model and is an intuitive upper bound of our method. However, the smallest performance gap between our method and Standard KD is 0.06 (12L→4L on RACE-High) on the RACE datasets and is 0.25 (12L→4L) on the DREAM dataset. Moreover, among all the twelve pairs of results, there is a third of them with a gap of less than 0.50. These results further justify the effectiveness of our proposed method. And we argue that this is mainly due to our better estimation of the logits. +(3) None of the baselines besides Standard KD can consistently achieve better results than training + +the student model without KD (Student $CE$ ), indicating that decision-based KD is a challenging task and the lost information from decisions compared with logits is essential. Hard performs slightly better than Student $CE$ on the RACE datasets but significantly worse than Student $CE$ on the DREAM dataset. We conjecture that this is because the teacher models have significantly better results on the RACE datasets than on the DREAM dataset, i.e., Hard can only work well with strong teacher models, whose decisions may be less noisy and the information gap between decisions and logits is smaller. Our method can be viewed as a special form of logits smoothing. However, both Noisy Logits and Smooth only achieves comparable or worse results than Student $CE$ , indicating straightforward logits smoothing is not effective. + +(4) Our method benefits from both better teacher models and larger student models. When the teacher grows larger (12L→4L v.s. 24L→4L), our method achieves a 1.10 performance gain on the DREAM dataset. Meanwhile, when the student models grow from 4 to 6 layers (12L→4L v.s. 12L→6L), the performance gains on all datasets are remarkably larger. The same trend is also observed for other baselines, suggesting that improving the capacity of the student model is a simple yet effective way to improve the performance of decision-based KD. + +# 5.3 Results on NLU Datasets + +Table 3 shows the results on the NLU datasets. First, our proposed method achieves the best results among all decision-based baselines, justifying that our method is generalizable to a large range of NLU + +
MethodsDBRTE (Acc.)MRPC (F1 / Acc.)CoLA (Matt.)QNLI (Acc.)SST-2 (Acc.)MNLI-m / mm (Acc.)QQP (F1 / Acc.)Average
Teacher66.287.3 / 82.353.790.993.684.4 / 83.571.4 / 89.179.1
Standard KD63.382.9 / 75.022.785.689.678.8 / 77.669.1 / 88.071.0
Student CE63.281.2 / 69.821.585.289.278.4 / 76.767.5 / 87.369.9
Surrogate63.682.5 / 74.818.985.289.478.4 / 77.367.8 / 87.470.2
Hard✓63.282.5 / 74.820.785.689.278.1 / 77.268.2 / 87.670.4
Noisy Logits✓63.381.6 / 74.021.885.388.578.1 / 76.767.5 / 87.470.2
Smooth✓63.482.4 / 75.122.285.189.278.0 / 77.067.9 / 87.670.6
Ours✓63.482.9 / 75.223.785.789.578.6 / 77.168.5 / 88.071.1
+ +Table 3: Results from the GLUE test server. We show the evaluation metrics under the task names. We use BERTBASE model as the teacher and a 4-layer BERT-style model as the student. + +tasks. Although our method does not outperform Surrogate on the RTE and MNLI-mm datasets, the gap is only 0.2. Second, the performance gap between ours and Standard KD is also small, providing extra evidence that our method estimates the teacher logits well. Third, all the baselines excluding Teacher and Standard KD have comparable performance, suggesting that decision-based KD is also challenging for NLU tasks. Above all, in conjunction with the results on the MRC datasets, we can conclude that our method is effective for diverse tasks and model architectures. + +# 5.4 Analysis on Logits Estimation + +We have conjectured that the good performance of our method comes from better logits estimation. To justify this assumption, we conduct a quantitative analysis in this section. We compute the mean squared errors (MSEs) between the soft labels generated from each method after softmax and teacher predictions on the training set of RACE-High ${}^{2}$ . As shown in Figure 2, the soft labels generated by our method are the closest to the teacher predictions among all methods. However, it should be noted that the probabilities (or logits) of the teacher are not perfect, as it does not achieve perfect final performance on the dataset. Therefore, the MSEs have a positive correlation with the final performance but are not oracle indicators. + +# 5.5 Ablation Study + +This section consists of a series of experiments aimed at validating the contributions of different components in our method. First, we compare our method with its two variants in Figure 3: (1) $w / o$ + +![](images/e66a8bacb2a7e06d193bd01125d17522e7afd9bd01cd538c259363eeb0ecf04d.jpg) +Figure 2: Mean squared errors (MSEs) between the estimated probabilities and the ground-truth probability produced by the teacher model on the training set of RACE-High. + +Empirical Estimations. In this variant, we replace the $\tilde{P}(Y|x)$ in Eq. 4 with the teacher decision on original data to skip the empirical estimation step. (2) w/o Theoretical Estimation. We replace the $Q(Y|x; \hat{z})$ term in Eq. 3 with $\text{softmax}(z)$ to skip the theoretical estimation step. For each dataset, we also count the percentage of empirical estimations $\tilde{P}(Y|x)$ being one-hot vectors, which means that teacher decisions are consistent on augmented inputs. According to the results, we find that the performance drops for both variants on all datasets, indicating the necessity of empirical estimation and theoretical estimation. Interestingly, we also find a positive correlation between the percentage of one-hot $\tilde{P}(Y|x)$ and the performance degradation from w/o Theoretical Estimation variant. This phenomenon highlights the capability of the theoretical estimation step to estimate teacher logits and narrow the information gap between decisions and logits even without observed decisions. + +Second, we further analyze the effect of empirical estimation by changing the sampling times $N$ in Eq. 4. As shown in Figure 4, when $N$ increases, the performance of our method first increases and then stabilizes. Considering a larger $N$ leads to + +![](images/9268289e072d071b98494786be33319495faebeb7c84ed48c464cc6d8fd8de1e.jpg) +Figure 3: Ablation studies for the empirical estimation step (Section 4.2) and the theoretical estimation step (Section 4.3) on the dev set of each dataset. We also include the results from Student CE method for comparison. The percentages after dataset names denote the ratio of empirical estimations $\tilde{P}(Y|x)$ being one-hot vectors. + +more queries to the teacher model, $N$ should be as low as possible without compromising the model performance. Therefore, $N = 10$ is the optimal choice according to the results. + +Finally, we investigate the contribution of Eq. 3, which combines the empirical estimation and the theoretical estimation together. In our framework, the root $\hat{z}$ of the equation is found by fixed-point iteration, and its precision is controlled by the error bound $\epsilon$ . Results in Figure 5 show a negative correlation between $\epsilon$ and KD performance. As $\epsilon$ increases from $10^{-4}$ to $10^{-1}$ , the performance of our method slightly drops. When $\epsilon$ increases to 1, which means the logits estimation becomes extremely inaccurate, the performance drops dramatically and is close to the performance of Student CE method. + +# 5.6 Computational Cost Analysis + +The additional computational cost of our method compared to Standard KD consists of two parts. The first part is test-time data augmentation, which necessitates multiple queries to the teacher model for each training sample. In this paper, we set the default number of augmented samples $N$ per training case to 10. The second part is solving Eq. 3 using the empirical estimation of decision distribution $\tilde{P}(Y|x)$ , which is made negligible by pre-building a lookup table from $\tilde{P}(Y|x)$ to logits estimation $\hat{z}$ before KD. In total, the additional cost of our method mainly comes from 10 queries made to the teacher model per training sample. By + +![](images/07a52e91a0b6241a3294e67d108271eafda05662d0a242cbb293d21534b24932.jpg) +Figure 4: Comparison of different sampling times $N$ of test-time data augmentation in the empirical estimation step. Averaged results on the dev set of RACE-High over 5 different random seeds are reported. + +![](images/1229a0ac40c7334b1073748abd4cbf99c15f11a5a1f3bd0bbce08c1e4d214427.jpg) +Figure 5: Comparison of different error bounds $\epsilon$ of teacher logits estimation in the theoretical derivation step. Averaged results on the dev set of RACE-High over 5 different random seeds are reported. + +contrast, the existing soft label generation method DB3KD (Wang, 2021) requires 1,000 to 20,000 queries to the teacher model per training sample. + +# 6 Conclusion + +We introduce a novel decision-based KD method, which bridges the information gap between teacher decisions and logits by estimating teacher logits. In contrast to existing solutions for decision-based KD, our method is applicable to NLP tasks with discrete inputs. Extensive experiments over various tasks and model architectures demonstrate the effectiveness of our proposed method. + +One future direction for the decision-based KD is the exploration of other NLP tasks, such as neural machine translation, text generation, and question answering. The other direction is KD from non-NN models to NN models, which benefits the training of NN models with additional information from a wider range of models. Unlike conventional KD, decision-based KD does not require internal information from NN models and is promising for solving this problem. + +# Limitations + +This study has two main limitations. The first limitation is its reliance on the assumption that teacher logits on augmented data follow a Gaussian distribution. This assumption is used in the derivation of teacher logits in Section 4.3. However, in practice, teacher logits may not strictly follow a Gaussian distribution. It is challenging to estimate teacher logits under more realistic assumptions, which requires thorough investigations on the distribution of teacher logits and more complex computations for logits estimation. + +The second limitation is that our method still requires access to the training dataset of the downstream tasks. In this paper, we focus on KD when teacher PLMs only return decisions. However, our method is not capable of KD without publicly available training data, which is a more challenging scenario for decision-based KD. We believe training a data generation model (Wang, 2021; Zhang et al., 2022; Sanyal et al., 2022) might be useful for such cases. + +# Ethics Statement + +In ethical considerations, our method risks being used as a means of model stealing. Therefore, defensive techniques against the proposed method are required. However, it also has significant positive implications. On the one hand, it can serve as a powerful tool for research on model extraction attacks, thereby promoting the advancement of related studies. On the other hand, it has practical applications in real-world scenarios. For instance, a company may prefer to use a smaller model due to cost considerations, and our method allows for the easy distillation of smaller models without requiring white-box access to larger models. Additionally, our method can be used to distill non-NN models into NN models, reducing the number of model types that need to be maintained and simplifying operation and maintenance. + +# Acknowledgement + +This work is supported by the National Key R&D Program of China (2022ZD0160502) and the National Natural Science Foundation of China (No. 61925601, 62276152, 62236011). We thank all anonymous reviewers for their valuable comments and suggestions on this work. We also thank Shuo Wang and Xiaoyue Mi for their suggestions on the writing. + +# References + +Ateret Anaby-Tavor, Boaz Carmeli, Esther Goldbraich, Amir Kantor, George Kour, Segev Shlomov, Naama Tepper, and Naama Zwerdling. 2020. Do not have enough data? deep learning to the rescue! In AAAI 2020. +Murat Seckin Ayhan and Philipp Berens. 2018. Test-time data augmentation for estimation of heteroscedastic aleatoric uncertainty in deep neural networks. In MIDL 2018. +Luisa Bentivogli, Peter Clark, Ido Dagan, and Danilo Giampiccolo. 2009. The fifth PASCAL recognizing textual entailment challenge. In TAC 2009. +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 NeurIPS 2020. +Guandan Chen, Kai Fan, Kaibo Zhang, Boxing Chen, and Zhongqiang Huang. 2021. Manifold adversarial augmentation for neural machine translation. In Findings of the ACL 2021. +Hannah Chen, Yangfeng Ji, and David Evans. 2020a. Finding Friends and flipping frenemies: Automatic paraphrase dataset augmentation using graph theory. In Findings of the EMNLP 2020. +Jiaao Chen, Zichao Yang, and Diyi Yang. 2020b. Mix-Text: Linguistically-informed interpolation of hidden space for semi-supervised text classification. In ACL 2020. +Zihang Chen, Hongbo Zhang, Xiaoji Zhang, and Leqi Zhao. 2017. Quora question pairs. +Yong Cheng, Lu Jiang, Wolfgang Macherey, and Jacob Eisenstein. 2020. AdvAug: Robust adversarial augmentation for neural machine translation. In ACL 2020. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. BERT: Pre-training of deep bidirectional transformers for language understanding. In *NAACL* 2019. +Bill Dolan and Chris Brockett. 2005. Automatically constructing a corpus of sentential paraphrases. In IWP 2005. +Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. 2016. Deep residual learning for image recognition. In CVPR 2016. + +Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. 2015. Distilling the knowledge in a neural network. +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 EMNLP 2020. +Sanjay Kariyappa, Atul Prakash, and Moinuddin K Qureshi. 2021. MAZE: Data-free model stealing attack using zeroth-order gradient estimation. In CVPR 2021. +Alex Krizhevsky, Geoffrey Hinton, et al. 2009. Learning multiple layers of features from tiny images. Technical report, University of Toronto. +Guokun Lai, Qizhe Xie, Hanxiao Liu, Yiming Yang, and Eduard Hovy. 2017. RACE: Large-scale reading comprehension dataset from examinations. In EMNLP 2017. +Quentin Lhoest, Albert Villanova del Moral, Yacine Jernite, Abhishek Thakur, Patrick von Platen, Suraj Patil, Julien Chaumont, Mariama Drame, Julien Plu, Lewis Tunstall, et al. 2021. Datasets: A community library for natural language processing. In EMNLP 2021: System Demonstrations. +Jianquan Li, Xiaokang Liu, Honghong Zhao, Ruifeng Xu, Min Yang, and Yaohong Jin. 2020. BERT-EMD: Many-to-many layer mapping for BERT compression with earth mover's distance. In EMNLP 2020. +Lei Li, Yankai Lin, Deli Chen, Shuhuai Ren, Peng Li, Jie Zhou, and Xu Sun. 2021a. CascadeBERT: Accelerating inference of pre-trained language models via calibrated complete models cascade. In *Findings of EMNLP* 2021. +Lei Li, Yankai Lin, Shuhuai Ren, Peng Li, Jie Zhou, and Xu Sun. 2021b. Dynamic knowledge distillation for pre-trained language models. In EMNLP 2021. +Bo Liu. 2019. Anonymized BERT: An augmentation approach to the gendered pronoun resolution challenge. In Proceedings of the First Workshop on Gender Bias in Natural Language Processing. +Weijie Liu, Peng Zhou, Zhiruo Wang, Zhe Zhao, Haotang Deng, and Qi Ju. 2020. FastBERT: a self-distilling BERT with adaptive inference time. In ACL 2020. +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. +Alexander Lyzhov, Yuliya Molchanova, Armenii Ashukha, Dmitry Molchanov, and Dmitry Vetrov. 2020. Greedy policy search: A simple baseline for learnable test-time augmentation. In Conference on Uncertainty in Artificial Intelligence. PMLR. + +George A. Miller. 1995. Wordnet: A lexical database for english. Commun. ACM. +Tetsuhisa Miwa, AJ Hayter, and Satoshi Kuriki. 2003. The evaluation of general non-centred orthant probabilities. Journal of the Royal Statistical Society: Series B (Statistical Methodology). +Tribhuvanesh Orekondy, Bernt Schiele, and Mario Fritz. 2019. Knockoff nets: Stealing functionality of black-box models. In CVPR 2019. +Long Ouyang, Jeff Wu, Xu Jiang, Diogo Almeida, Carroll L Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, et al. 2022. Training language models to follow instructions with human feedback. +Husam Quteineh, Spyridon Samothrakis, and Richard Sutcliffe. 2020. Textual data augmentation for efficient active learning on tiny datasets. In EMNLP 2020. +Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. 2019. Language models are unsupervised multitask learners. +Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J Liu, et al. 2020. Exploring the limits of transfer learning with a unified text-to-text transformer. JMLR. +Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. 2016. SQuAD: 100, $000+$ questions for machine comprehension of text. In EMNLP 2016. +Gözde Gül Şahin and Mark Steedman. 2018. Data augmentation via dependency tree morphing for low-resource languages. In EMNLP 2018. +Victor Sanh, Lysandre Debut, Julien Chaumont, and Thomas Wolf. 2019. DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter. In NeurIPS 2019 Workshop on Energy Efficient Machine Learning and Cognitive Computing. +Sunandini Sanyal, Sravanti Addepalli, and R Venkatesh Babu. 2022. Towards data-free model stealing in a hard label setting. In CVPR 2022. +Rico Sennrich, Barry Haddow, and Alexandra Birch. 2016. Improving neural machine translation models with monolingual data. In ACL 2016. +Divya Shanmugam, Davis Blalock, Guha Balakrishnan, and John Guttag. 2021. Better aggregation in test-time augmentation. In ICCV 2021. +Sam Shleifer. 2019. Low resource text classification with ulmfit and backtranslation. +Karen Simonyan and Andrew Zisserman. 2015. Very deep convolutional networks for large-scale image recognition. In ICLR 2015. + +Lewis Smith and Yarin Gal. 2018. Understanding measures of uncertainty for adversarial example detection. +Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew Y Ng, and Christopher Potts. 2013. Recursive deep models for semantic compositionality over a sentiment treebank. In EMNLP 2013. +Kai Sun, Dian Yu, Jianshu Chen, Dong Yu, Yejin Choi, and Claire Cardie. 2019a. Dream: A challenge data set and models for dialogue-based reading comprehension. TACL 2019. +Siqi Sun, Yu Cheng, Zhe Gan, and Jingjing Liu. 2019b. Patient knowledge distillation for bert model compression. +Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. 2016. Rethinking the inception architecture for computer vision. In CVPR 2016. +Raphael Tang, Yao Lu, Linqing Liu, Lili Mou, Olga Vechtomova, and Jimmy Lin. 2019. Distilling task-specific knowledge from bert into simple neural networks. +Jean-Baptiste Truong, Pratyush Maini, Robert J. Walls, and Nicolas Papernot. 2021. Data-free model extraction. In CVPR 2021. +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 EMNLP 2018 Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP. +Dongdong Wang, Yandong Li, Liqiang Wang, and Boqing Gong. 2020. Neural networks are more productive teachers than human raters: Active mixup for data-efficient knowledge distillation from a blackbox model. In CVPR 2020. +Guotai Wang, Wenqi Li, Michael Aertsen, Jan Deprest, Sebastien Ourselin, and Tom Vercauteren. 2019. Aleatoric uncertainty estimation with test-time augmentation for medical image segmentation with convolutional neural networks. Neurocomputing. +Wenxuan Wang, Bangjie Yin, Taiping Yao, Li Zhang, Yanwei Fu, Shouhong Ding, Jilin Li, Feiyue Huang, and Xiangyang Xue. 2021. Delving into data: Effectively substitute training for black-box attack. In CVPR 2021. +Zi Wang. 2021. Zero-shot knowledge distillation from a decision-based black-box model. In ICML 2021. +Alex Warstadt, Amanpreet Singh, and Samuel Bowman. 2019. Neural network acceptability judgments. TACL 2019. + +Jason Wei and Kai Zou. 2019. EDA: Easy data augmentation techniques for boosting performance on text classification tasks. In EMNLP 2019. +Xiangpeng Wei, Heng Yu, Yue Hu, Rongxiang Weng, Weihua Luo, and Rong Jin. 2022. Learning to generalize to more: Continuous semantic augmentation for neural machine translation. In ACL 2022. +Adina Williams, Nikita Nangia, and Samuel Bowman. 2018. A broad-coverage challenge corpus for sentence understanding through inference. In *NAACL* 2018. +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 EMNLP 2020: System Demonstrations. +Lei Xu, Laure Berti-Equille, Alfredo Cuesta-Infante, and Kalyan Veeramachaneni. 2022. In situ augmentation for defending against adversarial attacks on text classifiers. In KDD 2022 Workshop on Adversarial Learning Methods for Machine Learning and Data Mining. +Yiben Yang, Chaitanya Malaviya, Jared Fernandez, Swabha Swayamdipta, Ronan Le Bras, Ji-Ping Wang, Chandra Bhagavatula, Yejin Choi, and Doug Downey. 2020. Generative data augmentation for commonsense reasoning. In Findings of the EMNLP 2020. +Mengran Yu and Shiliang Sun. 2022. FE-DaST: Fast and effective data-free substitute training for black-box adversarial attacks. Computers & Security. +Jie Zhang, Chen Chen, Jiahua Dong, Ruoxi Jia, and Lingjuan Lyu. 2022. QEKD: Query-efficient and data-free knowledge distillation from black-box models. +Mingyi Zhou, Jing Wu, Yipeng Liu, Shuaicheng Liu, and Ce Zhu. 2020. DaST: Data-free substitute training for adversarial attacks. In CVPR 2020. + +# A Appendix + +# A.1 Experiment Details + +Dataset Details In this paper, we use seven different datasets, and all of them are in the English language. We downloaded these datasets from the Datasets (Lhoest et al., 2021) library of version 2.4.0, and our use is consistent with their intended use. The other details of the datasets we used are summarized in Table 4. + +
NameNumber of train / dev / testLicenseDomain
RACE-All (Lai et al., 2017)87,866 / 4,887 / 4,934unknownexaminations
RACE-Middle (Lai et al., 2017)25,421 / 1,436 / 1,436
RACE-High (Lai et al., 2017)62,445 / 3,451 / 3,498
DREAM (Sun et al., 2019a)6,116 / 2,040 / 2,041unknowndialogue
RTE (Bentivogli et al., 2009)2,490 / 277 / 3,000CC-BY-4.0news, Wikipedia
MRPC (Dolan and Brockett, 2005)3,668 / 408 / 1,725news
CoLA (Warstadt et al., 2019)8,551 / 1,043 / 1,063misc.
SST-2 (Socher et al., 2013)67,349 / 872 / 1,821movie reviews
QNLI (Rajpurkar et al., 2016)104,743 / 5,463 / 5,463Wikipedia
+ +Model Details We used BERT-like models (Devlin et al., 2019) in our experiments, including $\mathrm{BERT}_{\mathrm{BASE}}$ (110M parameters), $\mathrm{BERT}_{\mathrm{LARGE}}$ (340M parameters), 4-layer BERT-like models (53M parameters), and 6-layer BERT-like models (67M parameters). For $\mathrm{BERT}_{\mathrm{BASE}}$ and $\mathrm{BERT}_{\mathrm{LARGE}}$ , the raw model checkpoints are obtained from Huggingface Transformers (Wolf et al., 2020) platform. Following Li et al. (2021b), we initialize the 4-layer and 6-layer BERT-like models from the first 4 and 6 layers of the raw $\mathrm{BERT}_{\mathrm{BASE}}$ model, respectively. + +Other Details We finetune the BERTBASE and BERTLARGE models for 4 epochs. Following Li et al. (2021a), we train small 4-layer or 6-layer models for 10 epochs. We use a learning rate of $5 \times 10^{-5}$ for MRC tasks and $2 \times 10^{-5}$ for NLU tasks. $\sigma$ in Algorithm 1 is tuned from $\{0.5, 1, 2, 4\}$ , $\lambda$ in Eq. 2 is tuned from $\{0.2, 0.5, 0.7\}$ , and $\tau$ in Eq. 1 is tuned from $\{5, 10, 20\}$ expect for our method, which performs better in the range of $\{1, 2, 4\}$ . The $\alpha$ parameters of all operations in EDA are sampled from a half-normal distribution, and we adjust the scale of the distribution to align its expectation with the default $\alpha = 0.1$ in EDA. For MRC tasks, following Sun et al. (2019b), we concatenate the input passage and the question with a [SEP] token and append each answer at the end of the question. The random seeds we used for experiments on MRC datasets and ablation studies on NLU datasets are from 1 to 5. The random seed for teacher training and other NLU experiments is 1. The training of a 4-layer student model on one RTX 3090 Ti GPU costs approximately 6.5 hours for our method. + +Table 4: The detailed information of datasets we used in this paper. + +
MethodsRACE-High
Student CE39.79
Noisy Logits30.19
Surrogate37.86
Smooth41.59
Hard42.92
Ours44.13
+ +Table 5: Averaged results of generative models over 5 different random seeds. All methods are evaluated on the RACE-High dev set. + +# A.2 Experimental Results on Generative Language Models + +Theoretically, our method can be applied to generative LMs. In this paper, we evaluate the effectiveness of our method on the RACE dataset. We finetune a 12-layer GPT-2 (Radford et al., 2019) teacher to predict the class label (A/B/C/D) given the context, question, and options as prompt. Then we distill the teacher model to a 4-layer GPT-2 student. For the student model, the output vocabulary at the answer position is restricted to class label tokens. Table 5 shows the performance of our method and baseline methods on the dev set of RACE-High. Our method significantly outperforms decision-based baseline methods and the student CE method. + +Different from classification tasks, our method will require much more queries to the teacher model on generation tasks because of the following reasons: + +1. The label space dimension $L$ in generative tasks is equal to the vocabulary size, which is quite large. The computational cost of building the look-up table will increase. + +2. For each position $i$ in a sequence, our method estimates the logits in the $i$ -th position given all the tokens before the $i$ -th position. Therefore, to estimate the logits in the entire sequence, we need to sample teacher decisions in each position. As a result, the computational cost will multiply by the sequence length. + +Therefore, how to improve the efficiency of applying our method to generation tasks is an interesting future research direction. + +# A.3 Detailed Analysis of the Data Augmentation Techniques + +In this paper, we use the EDA augmentation tool (Wei and Zou, 2019) for each sample, including its $\alpha$ parameter and the following four default augmentation techniques. Given a input sentence, a $\alpha$ parameter, and the sentence length $l_{sent}$ , the four techniques can be describe as following: + +1. Synonym Replacement: First, select $\alpha l_{sent}$ words that are not stop words randomly. Second, replace each word with a random WordNet (Miller, 1995) synonym of itself. +2. Random Insertion: First, select a word in the sentence that is not a stop word randomly. Second, find a random synonym of the selected word. Third, insert the synonym into a random position in the sentence. Finally, do the above steps $\alpha l_{sent}$ times. +3. Random Swap: First, choose two words in the sentence randomly. Second, swap the positions of the chosen words. Finally, do the above steps $\alpha l_{sent}$ times. +4. Random Deletion: Remove each word in the sentence with probability $\alpha$ randomly. + +In Table 6, we provide further ablation studies on each technique of EDA. We also include the performance of Surrogate method which is the best decision-based baseline. According to the results, our method is robust to different data augmentation techniques. + +# A.4 Proofs + +In this section, we provide the detailed proofs of Eq. 11 to 13. + +
MethodsRACE-High
Ours51.75
w/o synonym replacement51.69
w/o random insertion51.44
w/o random swap51.75
w/o random deletion51.60
Surrogate (best baseline)50.33
+ +Table 6: Averaged results of ablation methods over 5 different random seeds. For each ablation, we remove one of the four data augmentation techniques from EDA and evaluate it on the RACE-High dev set. + +In Section 4.3, we assume $\Sigma$ is a diagonal matrix and $\Sigma_{ii} = \sigma^2$ . Therefore, the diagonal elements of $\pmb{B}$ are positive, and Eq. 10 can be rewritten as: + +$$ +\begin{array}{l} Q (Y = i | x; \hat {z}) = P (M _ {1} \geq \frac {- \mu_ {1}}{b _ {1 1}}, \\ M _ {2} \geq \frac {- \mu_ {2} - b _ {2 1} M _ {1}}{b _ {2 2}}, \\ M _ {3} \geq \frac {- \mu_ {3} - b _ {3 1} M _ {1} - b _ {3 2} M _ {2}}{b _ {3 3}}). \tag {14} \\ \end{array} +$$ + +Then $Q(Y = i|x; \hat{z})$ can be calculated recursively. Eq. 11 is an integration on $M_1 \geq \frac{-\mu_1}{b_{11}}$ , while Eq. 12 and Eq. 13 integrate on $M_2 \geq \frac{-\mu_2 - b_{21}M_1}{b_{22}}$ and $M_3 \geq \frac{-\mu_3 - b_{31}M_1 - b_{32}M_2}{b_{33}}$ , respectively. + +A For every submission: + +A1. Did you describe the limitations of your work? Limitation Section +A2. Did you discuss any potential risks of your work? Ethics Section +A3. Do the abstract and introduction summarize the paper's main claims? Abstract Section and Introduction Section +A4. Have you used AI writing assistants when working on this paper? Grammarly, to check grammar of the whole paper + +B Did you use or create scientific artifacts? + +Section 5 + +B1. Did you cite the creators of artifacts you used? Section 5 +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? In Appendix +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? In Appendix +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? Not applicable. Left blank. +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? In Appendix +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. In Appendix + +C Did you run computational experiments? + +In Section 5 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? In Appendix + +The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +The experimental setup and hyperparameter search methods are in Section 5 and Appendix. We do not include the best-found hyperparameter values + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +In section 5 and appendix + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +In section 5 and appendix + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +No response. + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +No response. + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +No response. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +No response. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +No response. \ No newline at end of file diff --git a/bridgingthegapbetweendecisionandlogitsindecisionbasedknowledgedistillationforpretrainedlanguagemodels/images.zip b/bridgingthegapbetweendecisionandlogitsindecisionbasedknowledgedistillationforpretrainedlanguagemodels/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..5a6a716822a15704a79913f05d1e900c854732ac --- /dev/null +++ b/bridgingthegapbetweendecisionandlogitsindecisionbasedknowledgedistillationforpretrainedlanguagemodels/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b52d87338358076e6af205ba60a2d149d4b1d8b19b8fa9b6e7d3ddf81e926d6a +size 483406 diff --git a/bridgingthegapbetweendecisionandlogitsindecisionbasedknowledgedistillationforpretrainedlanguagemodels/layout.json b/bridgingthegapbetweendecisionandlogitsindecisionbasedknowledgedistillationforpretrainedlanguagemodels/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..4db720982ad93a2c1bbefbeb35308a7629ce2f13 --- /dev/null +++ b/bridgingthegapbetweendecisionandlogitsindecisionbasedknowledgedistillationforpretrainedlanguagemodels/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:808ca31740e88622af83a9f38c74c23d12f7b4e3c40a267b40dc6134c8d04b7b +size 619370 diff --git a/bridgingthegapentailmentfusedt5foropenretrievalconversationalmachinereadingcomprehension/b04a57bb-c3fe-456a-b57d-32193e3420f1_content_list.json b/bridgingthegapentailmentfusedt5foropenretrievalconversationalmachinereadingcomprehension/b04a57bb-c3fe-456a-b57d-32193e3420f1_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..6779ce14d4348832275a5ca7e1988b9670fe8dd1 --- /dev/null +++ b/bridgingthegapentailmentfusedt5foropenretrievalconversationalmachinereadingcomprehension/b04a57bb-c3fe-456a-b57d-32193e3420f1_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aeef75cb1e6154bb130e6bdb0f075a29616779cffdf893bb3be88ef5b8843701 +size 85445 diff --git a/bridgingthegapentailmentfusedt5foropenretrievalconversationalmachinereadingcomprehension/b04a57bb-c3fe-456a-b57d-32193e3420f1_model.json b/bridgingthegapentailmentfusedt5foropenretrievalconversationalmachinereadingcomprehension/b04a57bb-c3fe-456a-b57d-32193e3420f1_model.json new file mode 100644 index 0000000000000000000000000000000000000000..229c562b96f7e6318618d76944edb74191747af2 --- /dev/null +++ b/bridgingthegapentailmentfusedt5foropenretrievalconversationalmachinereadingcomprehension/b04a57bb-c3fe-456a-b57d-32193e3420f1_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9d1700a5dc67745f1e4f06f0c7981072b43440edb2aa5fa076660bc3e3a2274d +size 103675 diff --git a/bridgingthegapentailmentfusedt5foropenretrievalconversationalmachinereadingcomprehension/b04a57bb-c3fe-456a-b57d-32193e3420f1_origin.pdf b/bridgingthegapentailmentfusedt5foropenretrievalconversationalmachinereadingcomprehension/b04a57bb-c3fe-456a-b57d-32193e3420f1_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e5b67df4ca1a9e5012a4d252962c27149023d8c2 --- /dev/null +++ b/bridgingthegapentailmentfusedt5foropenretrievalconversationalmachinereadingcomprehension/b04a57bb-c3fe-456a-b57d-32193e3420f1_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4f5d73c9ec9fc3a378298ba8b03b36b78758ff9fa0757cc60cfcded179f4dba5 +size 1934883 diff --git a/bridgingthegapentailmentfusedt5foropenretrievalconversationalmachinereadingcomprehension/full.md b/bridgingthegapentailmentfusedt5foropenretrievalconversationalmachinereadingcomprehension/full.md new file mode 100644 index 0000000000000000000000000000000000000000..3a1474180ee25d0579ab024424f486e308ca3589 --- /dev/null +++ b/bridgingthegapentailmentfusedt5foropenretrievalconversationalmachinereadingcomprehension/full.md @@ -0,0 +1,409 @@ +# Bridging The Gap: Entailment Fused-T5 for Open-retrieval Conversational Machine Reading Comprehension + +Xiao Zhang $^{123}$ , Heyan Huang $^{123*}$ , Zewen Chi $^{123}$ , Xian-Ling Mao $^{123}$ + +$^{1}$ School of Computer Science and Technology, Beijing Institute of Technology $^{2}$ Beijing Engineering Research Center of High Volume Language Information Processing and Cloud Computing Applications + +$^{3}$ Southeast Academy of Information Technology, Beijing Institute of Technology + +{yotta,hhy63,czw,maoxl}@bit.edu.cn + +# Abstract + +Open-retrieval conversational machine reading comprehension (OCMRC) simulates real-life conversational interaction scenes. Machines are required to make a decision of Yes/No/Inquire or generate a follow-up question when the decision is Inquire based on retrieved rule texts, user scenario, user question and dialogue history. Recent studies try to reduce the information gap between decision-making and question generation, in order to improve the performance of generation. However, the information gap still persists because these methods are still limited in pipeline framework, where decision-making and question generation are performed separately, making it hard to share the entailment reasoning used in decision-making across all stages. To tackle the above problem, we propose a novel one-stage end-to-end framework, called Entailment Fused-T5 (EFT), to bridge the information gap between decision-making and question generation in a global understanding manner. The extensive experimental results demonstrate that our proposed framework achieves new state-of-the-art performance on the OR-ShARC benchmark. Our model and code are publicly available1. + +# 1 Introduction + +Open-retrieval conversational machine reading comprehension (OCMRC) (Gao et al., 2021) investigates real-life scenes, aiming to formulate multi-turn interactions between humans and machines in open-retrieval settings. As shown in Figure 1, given the user scenario and user question, machines are required to first retrieve related rule texts in the knowledge database, and then make a decision of Yes/No/Inquire or generate a follow-up question when the decision is + +Retrieved Rule Text 1: The airport manager, or his authorized... + +Retrieved Rule Text 2: When to contact the benefit office: It's your responsibility to contact the office straight away if: You think you've been overpaid. You get a letter telling you that you have been overpaid - and who to contact your circumstances change and this is likely to affect a benefit. + +Retrieved Rule Text 3: Your obligations for using center pay... + +User Question: Is it my responsibility to contact the office in this situation + +User Scenario: : I most assuredly believe... + +Follow-up Q: Do you believe that you have been overpaid? + +Follow-up A:No + +Follow-up Q: Did you receive a letter stating that you were overpaid? + +Follow-up A:No + +Decision-Making: Yes | No| Inquire + +Final Answer: Have your circumstances + +changed? + +Figure 1: An example in the OCMRC dataset. Given the user scenario and user question, machines are required to first retrieve related rule texts in the knowledge database, and then make a decision of Yes/No/Inquire or generate a follow-up question when the decision is Inquire based on retrieved rule texts, user scenario, user question and dialogue history. + +Inquire based on retrieved rule texts, user scenario, user question and dialogue history. + +Previous studies (Saeidi et al., 2018; Verma et al., 2020; Lawrence et al., 2019; Zhong and Zettlemoyer, 2019; Gao et al., 2020a,b; Ouyang et al., 2021; Gao et al., 2021; Zhang et al., 2021) typically adopt pipeline frameworks based on pretrained language models (PrLM) (Devlin et al., 2019; Clark et al., 2020; Lewis et al., 2020; Liu et al., 2020), as shown in Figure 4, these frameworks usually consist of three stages, includ + +![](images/c98e313b3d9817e81bbe1e1458978cb3485a20fff9dc162cca01f4181f5c7cc2.jpg) +Figure 2: The comparison between our framework and previous pipeline framework. a) Previous framework typically has three stages: entailment reasoning based decision-making, span extraction and question rephrasing. Thus, the entailment reasoning utilized in decision-making is hard to share through all stages. Meanwhile, the performance of previous framework suffers from error propagation problem. The above information misleading leads to the information gap between decision and generation. b) Our framework is a one-stage end-to-end model. To bridge the information gap, the fused answer generation directly generates the decisions or follow-up questions with the shared entailment representation enhanced by activated entailment reasoning. + +![](images/adc8f9f6763312c0149187583178a12ccb9cdfd4337fb34b7976e3ba83a95321.jpg) + +ing decision-making, span extraction and question rephrasing. Different entailment reasoning strategies are utilized to improve the performance of decision-making. Span extraction and question rephrasing are conducted for question generation. These pipeline frameworks are either completely independent of the three stages (Zhong and Zettlemoyer, 2019; Gao et al., 2020a,b; Ouyang et al., 2021; Gao et al., 2021), or try to reduce the information gap between decision-making and question generation through representation-fused methods (Zhang et al., 2021) among three stages. + +However, the information gap still persists because these methods are still limited in pipeline framework, where decision-making and question generation are performed separately, making it hard to share the entailment reasoning used in decision-making across all stages. + +To tackle the above problem, we propose a novel one-stage end-to-end framework, called entailment fused-T5 (EFT) to bridge the information gap between decision-making and question generation in a global understanding manner. Specifically, our model consists of a universal encoder and a duplex decoder. The decoder consists of an activated entailment reasoning decoder and a fused answer generation decoder. The implicit reasoning chains of both decision-making and question generation in the multi-fused answer generation decoder are explicitly supervised by ac + +![](images/ded7dd03ad383b399cd74c90e95ee9e273d18541487fe2cd921bae94edd138e2.jpg) +Figure 3: EFT achieves state-of-the-art performance on the OR-ShARC benchmark. + +tivated entailment reasoning through the shared entailment representation of our encoder. Moreover, a relevance-diversity fusion strategy is utilized to further improve the implicit reasoning abilities among the multiple retrieved rules for the fused answer generation decoder through the implicit ranking method. Thus, our model can reason in a global understanding manner. The extensive results, as illustrated in Figure 3, demonstrate that our proposed framework EFT achieves new state-of-the-art performance on the OR-ShARC benchmark. + +Our contributions are summarized as follows: + +- We propose a novel one-stage end-to- + +end framework, called entailment fused-T5 (EFT) to bridge the information gap between decision-making and question generation through a global understanding manner. + +- We further investigate a relevance-diversity fusion strategy (RD strategy) to improve the implicit reasoning abilities of our model. +- Extensive experiments demonstrate the effectiveness of our proposed framework on the OR-ShARC benchmark. + +# 2 Related Work + +Conversation-based Reading Comprehension Conversation-based reading comprehension (Saeidi et al., 2018; Sun et al., 2019; Reddy et al., 2019; Choi et al., 2018; Cui et al., 2020; Gao et al., 2021) aims to formulate human-like interactions. Compared to traditional reading comprehension, these tasks extend the reading comprehension scenarios with dialogue interactions. There are typically three main types of these tasks: span-based QA tasks (Choi et al., 2018; Reddy et al., 2019), multi-choice tasks (Sun et al., 2019; Cui et al., 2020), or hybrid-form tasks (Saeidi et al., 2018; Gao et al., 2021). + +Conversational Machine Reading Comprehension CMRC (Saeidi et al., 2018) is the hybrid form of conversation-based reading comprehension, which requires the machines to make a decision or generate a follow-up question based on rule text, user scenario, user question and dialogue history. + +In this paper, we focus on the open-retrieval conversational machine reading (OCMRC) task (Gao et al., 2021), which further extends the CMRC task into a real-life scenario. Machines are required to first retrieve related rule texts in a knowledge base based on user questions and user scenarios, then machines are required to make a decision of Yes/No/Inquire, or a follow-up question if the decision is Inquire based on the relevant rule texts, user scenario, user question and dialogue history. + +Due to the hybrid-form task, the previous methods (Zhong and Zettlemoyer, 2019; Gao et al., 2020a,b; Ouyang et al., 2021; Zhang et al., 2021) typically adopt pipeline architectures, including decision-making, span extraction and question phrasing. Various kinds of entailment reason + +ing strategies are proposed to improve the performance of decision-making. Despite the effectiveness of entailment reasoning, the performance is still limited because of the information gap between decision-making and question generation. Recent studies (Zhang et al., 2021, 2022) explored entailment reasoning sharing methods to reduce the gap between decision-making and question generation, but the performance is limited due to its frame flaws. In this paper, we propose a novel one-stage end-to-end model, called entailment fused-T5 (EFT), the details are written in the next sections. + +# 3 Methods + +In open-retrieval CMRC, the machines are first required to retrieve related rule texts in a knowledge base, given user question and user scenario. Then machines are required to make decisions or generate follow-up questions based on retrieved rule texts, user scenario, user question and dialogue history. Thus, we conduct a retriever to first retrieve related rule texts from the knowledge database, and then generate the final answer through our end-to-end reader EFT. The training procedure is shown in Algorithm 1. + +# 3.1 Retriever + +We first concatenate the user question and user scenario as the query to retrieve related rule texts in the knowledge base. The knowledge base is divided into the seen subset and the unseen subset. This is to simulate the real usage scenario: users will ask questions about rules they have already seen, or rules that are completely new. We only use seen rules in the training process. In this work, we utilize DPR (Karpukhin et al., 2020) to retrieve related rule texts. In contrast to previous approaches (Zhang et al., 2021) that employ TF-IDF negatives as DRP hard negatives and restrict the scope of retrieved negatives to a limited data space, we adopt a different strategy. We randomly sample rule texts from the known knowledge base to serve as the negatives. Each step will randomly sample $m$ numbers negatives in the training stage. We retrieve the top 20 relevant rule texts for each query, which is further used by our reader. + +# 3.2 Reader: EFT + +In this stage, each item is formed as the tuple $\{R,S,Q,D\}$ . $R$ donates the rule text can + +![](images/b75ffc3ecf229f699c88dd31fd7f9bcc199e790c825e7bb1221ed138dea286ac.jpg) +Figure 4: The architecture of our proposed EFT. Machines first randomly select related rule texts from RD candidate rule texts in the training stage, while in the evaluating stage, machines only use the top-5 retrieved rule texts. Then the input representation is encoded separately, the sentence-level representation is utilized for activated entailment reasoning, and the word-level representation is fused for the final answer generation. + +didates. $R = \{r_1, r_2, \dots, r_k\}$ , where $r$ donates the rule text item of $R$ . $S$ and $Q$ represent user scenario and user questions, respectively. $D$ donates the dialogue history. Given $\{R, S, Q, D\}$ , EFT will directly generate a decision of Yes/No/Inquire or follow-up question when the decision is Inquire. EFT consists of a universal encoder and a duplex decoder. The Duplex decoder consists of an activated entailment reasoning decoder and a fused answer generation decoder. In this way, the whole implicit reasoning chains of the fused answer generation decoder will be fine-grained supervised by activated entailment reasoning with the shared entailment representation. Thus, the fused answer generation decoder will reason in a global understanding manner. The details are shown in Figure 4. + +# 3.3 Encoding + +Given $\{R,S,Q,D\}$ , we random sample $k$ items in $R$ , and concatenate each of them with $S,Q,D$ as $c$ , thus the item collection is formed as $C = \{c_1,c_2,\dots ,c_k\}$ . Specifically, each $r$ in $R$ is first parsed to elementary discourse unit (EDU) by a pre-trained model (Li et al., 2018). The final input format is shown in Figure 4. To prevent the leakage of location information in the fused an + +swer generation decoder, and enhance the information extraction ability of the decoder, we utilize a relevance-diversity fusion (RD) strategy to randomly shuffle the order of items which are sampled from RD candidate rule texts, the details are written in Sec 3.4. Given $C$ , we utilize T5 encoder as our backbone to get the representation. The presentation of special token are utilized as sentence-level representation $H_{s} = \{h_{s1}, h_{s2}, \dots, h_{sk}\}$ for activated entailment reasoning decoding. The word-level representation $H_{w} = \{h_{w1}, h_{w2}, \dots, h_{wk}\}$ are utilized for fused answer generation decoding. + +# 3.4 Decoding + +We utilize duplex decoding to explicitly supervise our answer generation stage, which introduced the explicit entailment reasoning information in implicit answer generation reasoning. The answer generation will either generate a decision of Yes/No/Inquire or a follow-up question when the decision is Inquire. The activated entailment reasoning decoder will reason the entailment states of the EDUs. The duplex decoder is trained in a multi-task form. And the activated entailment reasoning only activates in training stage. + +Activated Entailment Reasoning Each EDU will be classified into one of three entailment states, including ENTAILMENT, CONTRADICTION and NEUTRAL. To get the noisy supervision signals of entailment states, we adopt a heuristic approach2. This is proposed to simulate fulfillment prediction of conditions in multi-sentence entailment reasoning, which can explicitly supervise the implicit reasoning chains of the answer generation. + +Previous studies typically introduce entailment reasoning in all rule text segmented EDUs. This will greatly increase the proportion of NEUTRAL labels and affect the model effect, because nearly all of the entailment states of EDUs in retrieved irrelevant rules are NEUTRAL, and introducing more noise in the training stage. In our method, entailment reasoning will only activate for the golden rule text. Utilizing this setting, one benefit is to balance the categories of entailment reasoning, and the other is to supervise the implicit reasoning of the fused decoder, which can help the fused decoder infer correct rule text from multiple retrieved rule texts. + +Given the sentence-level representation $H_{s}$ , we utilize inter-attention reasoning to fully interact with various information in $r$ , including EDUs, user question, user scenario and dialogue history. We utilize an inter-sentence Transformer (Devlin et al., 2019; Vaswani et al., 2017) to get the interacted sentence-level representation $G_{s}$ . Then, we use a linear transformation to track the entailment reasoning states of each EDU in activated rule text. + +$$ +e _ {i} = W _ {c} \tilde {h} _ {e _ {i}} + b _ {c} \in \mathcal {R} ^ {3}, \tag {1} +$$ + +where the $W_{c}$ is trainable parameters, $e_{i}$ is the predicted score for the three labels of the $i$ -th states. + +Fused Answer Generation Given the word-level representation $H_{w} = \{h_{w1}, h_{w2}, \dots, h_{wk}\}$ of $R$ , we concatenate the $H_{w}$ as the fused representation $f_{w}$ . In this manner, our answer generation decoder can reason through all the $k$ items through an implicit ranking mechanism. It is worth mentioning that each item of $H_{w}$ is first fully interacted among rule text, user question, user scenarios and dialogue history without other multi-rule noise through our encoder. + +To improve the information implicit reasoning abilities of our model, we further investigate + +# Algorithm 1 Training procedure of EFT + +Input: Contextualized context $C$ , learning rate $\tau$ , Output: Final answer $A$ , activated entailment reasoning state $E$ , EFT encoder parameters $\theta_{e}$ , EFT fused answer generation decoder parameters $\theta_{a}$ , EFT activated entailment reasoning decoder parameters $\theta_{d}$ + +1: Initialize $\pmb{\theta}_{e},\pmb{\theta}_{a},\pmb{\theta}_{d}$ +2: while not converged do +3: for $i = 1,2,\dots ,N$ do +4: $\pmb{h}_{si}, \pmb{h}_{wi} = f(c_i, \pmb{\theta}_e)$ s.t. $\forall c \in \mathcal{C}$ +5: $e_i = f(h_{si},\pmb{\theta}_d)$ +6: $\pmb{a}_i = f(h_{wi}, \pmb{\theta}_a)$ +7: end for +8: $\pmb{g} \gets \nabla_{\pmb{\theta}} \mathcal{L}$ +9: $\pmb{\theta}_{e} \gets \pmb{\theta}_{e} - \tau \pmb{g}$ +10: $\pmb{\theta}_{d} \gets \pmb{\theta}_{d} - \tau \pmb{g}$ +11: $\pmb{\theta}_{a} \gets \pmb{\theta}_{a} - \tau \pmb{g}$ +12: end while + +the relevance-diversity fusion strategy (RD fusion strategy), which consists of relevance-diversity candidate rule texts, order information protection and fused answer generation. The rule text candidates are consists of top $k$ relevant rule texts and randomly sampled rule texts, which are called RD candidate rule texts. Thus, the candidates are full-filled with relevant and diverse rule texts. On the premise of ensuring relevance among the rule texts, the diversity of learnable information sampling combinations is further improved. Moreover, the order of items fused in $f_{w}$ may lead to information leakage and affect the reasoning ability of the decoder in the training stage, so as we mentioned in the last section, we will randomly shuffle the order of items when inputting to the encoder to protect the order information. In the evaluation stage, only the top 5 unshuffled relevant rule texts will be utilized for answer generation. + +The fused answer generation is utilized to generate either the decision or the follow-up question. We employ T5 decoder as our answer generation decoder. Given encoder fused representation $f_{w}$ , and the final answer $a$ , including decision or follow-up question, the answer is composed of the variable-length tokens $x_{i}$ , the probabilities over the tokens are shown in the blow: + +$$ +p (a) = \prod_ {1} ^ {m} p \left(x _ {i} \mid x _ {< i}, f _ {e}; \theta\right), \tag {2} +$$ + +where $\theta$ donates the trainable parameters of our decoder. + +# 3.5 Training Objective + +Activated Entailment Reasoning The activated entailment reasoning is supervised by cross-entropy loss, by given the entailment stages $c_{i}$ : + +$$ +\mathcal {L} _ {\text {e n a t i l}} = - \frac {1}{N} \sum_ {i = 1} ^ {N} \log \operatorname {s o f t m a x} \left(c _ {i}\right) _ {r}, \tag {3} +$$ + +where $r$ is the ground truth of entailment state. + +Fused Answer Generation The fused answer generation training objective is computed as illustrated in below: + +$$ +\mathcal {L} _ {\text {a n s w e r}} = - \sum_ {i = 1} ^ {M} \log p \left(x _ {i} \mid x _ {< i}, f _ {w}; \theta\right), \tag {4} +$$ + +The overall loss function is: + +$$ +\mathcal {L} = \mathcal {L} _ {\text {a n s w e r}} + \lambda \mathcal {L} _ {\text {e n t a i l}}. \tag {5} +$$ + +# 4 Experiment and Analysis + +# 4.1 Data + +Dataset The experiment dataset is OR-ShARC (Gao et al., 2021), the current OCMRC benchmark. The corpus is crawled from the government website. There is a total of 651 rule texts collected in the knowledge base. For the validation and test set, the golden rule texts are split into unseen or seen. This is to simulate the real usage scenario: users will ask questions about rules they have already seen, or rules that are completely new. The train, dev and test size is 17,936, 1,105 and 2,373, respectively. Each item consists of utterance id, tree id, golden rule document id, user question, user scenario, dialog history, evidence and the decision. + +# 4.2 Setup + +Evaluation The evaluation consists of two parts: decision-making and question generation. We utilize Micro-Acc and Macro-Acc for the results of decision-making, and use $\mathrm{F1}_{\mathrm{BLEU}}$ (Gao et al., 2021) for question generation. The $\mathrm{F1}_{\mathrm{BLEU}}$ is conducted to evaluate the question generation performance when the predicted decision is Inquire. + +$$ +p r e c i s i o n _ {\mathrm {B L E U}} = \frac {\sum_ {i = 0} ^ {M} \mathrm {B L E U} \left(y _ {i} , \hat {y} _ {i}\right)}{M}, \tag {6} +$$ + +Where $M$ is the total number of Inquire decisions made by our model. $y_{i}$ is the predicted question, $\hat{y}_i$ is the corresponding ground truth prediction. The recall of BLEU is computed in a similar way. + +$$ +\operatorname {r e c a l l} _ {\mathrm {B L E U}} = \frac {\sum_ {i = 0} ^ {N} \operatorname {B L E U} \left(y _ {i} , \hat {y} _ {i}\right)}{N}, \tag {7} +$$ + +where $N$ is the total number of Inquire decision from the ground truth annotation, + +The calculation of $\mathrm{F1}_{\mathrm{BLEU}}$ is shown below: + +$$ +\mathrm {F l} _ {\text {B L E U}} = \frac {2 \times \text {p r e c i s i o n} _ {\text {B L E U}} \times \text {r e c a l l} _ {\text {B L E U}}}{\text {p r e c i s i o n} _ {\text {B L E U}} + \text {r e c a l l} _ {\text {B L E U}}}. \tag {8} +$$ + +Implementation Details We utilize the T5-base (Raffel et al., 2020) as our reader backbone, and additionally add an activated entailment reasoning decoder, whose parameters are randomly initialized. We utilize BERT (Devlin et al., 2019) as our retriever backbone, whose parameters are initialized from DPR (Karpukhin et al., 2020). For the RD strategy, we use the top-20 retrieved rule texts and 30 randomly sampled rule texts as our fused candidates in the training stage, every step we will randomly select 5 samples from the candidates. We only use seen rule texts in the knowledge base for the training stage. And we only use top 5 retrieved rule text for the inference stage. The fused number $k$ is set as 5 for fused answer generation for both training and inference. We use AdamW (Loshchilov and Hutter, 2018) to finetune our model. The learning rate is hierarchically designed, the learning rate of T5 is 2e-4, and the learning rate of activated entailment decoder is 2e-5. We tried from 0.1 to 1.0 for $\lambda$ , and find 0.9 is the best hyper-parameter. The beam-size is set as 5 for the answer generation. + +# 4.3 Results + +All results on the OR-ShARC benchmark are illustrated in Table 1, including dev and test set with metrics for both decision-making and question generation. + +Experimental results demonstrate that our proposed methods achieve new SOTA on the OR-ShARC benchmark. EFT outperforms OSCAR by $3.6\%$ in Micro-Acc, $3.6\%$ in Macro-Acc for decision-making on the dev set, and outperforms OSCAR by $2.6\%$ in Micro-Acc, $2.7\%$ in Macro-Acc for decision-making on the test set. In particular, our proposed EFT achieves considerable + +
ModelDev SetTest Set
Decision MakingQuestion Gen.Decision MakingQuestion Gen.
MicroMacroF1BLEU1F1BLEU4MicroMacroF1BLEU1F1BLEU4
E361.8±0.962.3±1.029.0±1.218.1±1.061.4±2.261.7±1.931.7±0.822.2±1.1
EMT65.6±1.666.5±1.536.8±1.132.9±1.164.3±0.564.8±0.438.5±0.530.6±0.4
DISCERN66.0±1.666.7±1.836.3±1.928.4±2.166.7±1.167.1±1.236.7±1.428.6±1.2
MP-RoBERTa73.0±1.773.1±1.645.9±1.140.0±0.970.4±1.570.1±1.440.1±1.634.3±1.5
MUDERN78.4±0.578.8±0.649.9±0.842.7±0.875.2±1.075.3±0.947.1±1.740.4±1.8
OSCAR80.5±0.580.9±0.651.3±0.843.1±0.876.5±0.576.4±0.449.1±1.141.9±1.8
EFT83.4±0.583.8±0.565.5±1.959.0±2.078.5±0.778.5±0.759.3±0.853.0±0.8
+ +Table 1: Results on the dev and test set of OR-ShARC. The average results with standard deviation on 5 random seeds are reported. + +
ModelMicroMacroF1BLEU1F1BLEU4
EFT83.4±0.583.8±0.565.5±1.959.0±2.0
-w/o s82.9±0.683.4±0.563.8±1.657.0±1.8
-w/o s+a80.7±0.881.1±0.962.4±2.356.3±2.3
-w/o s+a+i80.2±0.580.5±0.661.2±1.455.0±1.6
-w/o s+a+i+f71.0±1.271.6±0.949.2±0.843.8±0.8
+ +Table 2: Ablation study of EFT on the dev set of OR-ShARC. The average results with standard deviation on 5 random seeds are reported. + +improvement in BLEU scores. EFT outperforms OSCAR by $27.7\%$ in $\mathrm{F1}_{\mathrm{BLEU1}}$ , $36.9\%$ in $\mathrm{F1}_{\mathrm{BLEU4}}$ for the question generation on the dev set, and outperforms OSCAR by $20.8\%$ in $\mathrm{F1}_{\mathrm{BLEU1}}$ , $26.5\%$ in $\mathrm{F1}_{\mathrm{BLEU4}}$ for the question generation on the test set. We further to investigate the classwise accuracy performance of EFT, as shown in Table 4. Experiments show that the accuracy of each category in OR-ShARC is improved by conducting EFT framework, compared with reported baselines. + +To further investigate the performance for our proposed EFT in seen and unseen settings, the performance of the split subset ${}^{3}$ is illustrated in Table 3. Compared with OSCAR, the seen subset performance are greatly improved through our framework EFT. EFT greatly outperforms OSCAR by ${29.1}\%$ in ${\mathrm{{F1}}}_{\mathrm{{BLEU}}1},{36.4}\%$ in ${\mathrm{{F1}}}_{\mathrm{{BLEU}}4}$ for the question generation on the seen test set. In addition, compared with the previous pipeline architectures utilized in MURDEN and OSCAR, our model not only improves the performance, but also makes the framework of OCMRC more lightweight. We reduce the number of model parameters from 330M to 220M, which is decreased by ${33.3}\%$ . The performance on the seen subset of + +EFT is $35.0\%$ higher in micro-acc than seen subset, $35.3\%$ higher in macro-acc than unseen subset. Our retrieval results are illustrated in Table 6 and Table 5. The details are illustrated in Appendix A and Appendix B, respectively. + +# 4.4 Ablation Studies + +The ablation studies of EFT on the dev set of ORShARC benchmark are shown in Table 2. There are four settings of our EFT is considered: + +- EFT-wo/s trains the model without relevance-diversity (RD) candidate rule texts. Only top-5 randomly shuffled relevant rule texts are considered in the training stage. +- EFT-wo/s+a trains this model additionally remove activated entailment reasoning. +- EFT-wo/s+a+i trains this model further cancels random shuffle in the training stage. +- EFT-wo/s+a+i+f trains this model without multi rule fused answer generation, only top-1 retrieved rule text is considered. + +Analysis of RD Candidate We investigate the necessity of the RD candidate rule texts. This strategy is utilized to improve the implicit reasoning abilities of our decoder by improving the learning space of fused candidates. On the premise of ensuring the relevance among the rule texts, the diversity of learnable information sampling combinations is further improved. As shown in Table 2, compared with EFT, the performance of both decision-making and question generation decline when RD candidate rule texts are removed, highlighting the effectiveness of RD candidate rule + +
ModelSeenUnseenParameters
MicroMacroF1BLEU1F1BLEU4MicroMacroF1BLEU1F1BLEU4
MUDERN88.188.162.657.866.466.033.124.3330M
OSCAR--64.659.6--34.925.1330M
EFT92.492.383.481.368.468.234.924.0220M
+ +texts in enhancing the information-seeking abilities of our fused answer generation decoder. By removing RD candidate rule texts, the micro-acc is decreased by 0.5, the macro-acc is decrease by 0.4, the $\mathrm{F1}_{\mathrm{BLEU1}}$ is decreased by 1.7, and the $\mathrm{F1}_{\mathrm{BLEU4}}$ is decreased by 2.0. The above results emphasize the indispensability of RD candidate rule texts. + +Analysis of Activated Entailment Reasoning EFT-wo/s+a trains this model additionally remove activated entailment reasoning. As illustrated in Table 2, compared with EFT-wo/s+a, the performance of both decision-making and question generation are dropped without activated entailment reasoning, the micro-acc is decreased by 2.2, the macro-acc is decrease by 2.3, the $\mathrm{F1}_{\mathrm{BLEU1}}$ is decreased by 1.4, and the $\mathrm{F1}_{\mathrm{BLEU4}}$ is decreased by 0.7. The above results suggest that the implicit reasoning of conversational machine reading comprehension could be enhanced by introducing explicit fine-grained supervised signal in a global understanding manner. + +Analysis of Order Information Protection The order of fused representation used in fused answer generation decoder may lead to information leakage and affect the reasoning ability of the decoder. In order to avoid the problem of poor information seeking ability caused by excessive learning of position information of the model, we randomly shuffle the order of fused representation to protect the order information in the training stage. As illustrated in Table 2, compared with EFT-wo/s+a, EFT-wo/s+a+i decrease the performance of both decision-making and question generation without order information protection, the micro-acc is decreased by 0.5, the macro-acc is decrease by 0.6, the F1BLEU1 is decreased by 1.2, and the F1BLEU4 is decreased by 1.3. The above results indicate the importance of order information protection. + +Analysis of Fused Generation Fused Generation is utilized to introduce the ability to pro + +Table 3: The comparison of question generation on the seen and unseen splits on test-set. + +
ModelYesNoInquire
devtestdevtestdevtest
E358.558.561.860.166.566.4
EMT56.955.468.665.674.073.6
DISCERN61.765.861.161.877.373.6
MP-RoBERTa68.972.680.874.269.563.4
MUDERN73.976.480.872.281.777.4
EFT80.181.283.275.688.278.7
+ +Table 4: Class-wise decision making accuracy among Yes, No and Inquire on the dev and test set of OR-ShARC. + +cess multiple rule contextualized information. The multiple rule contextualized information are fused as a single fused information. EFT-wo/s+a+i+f trains this model without multi rule fused answer generation, only top1 retrieved rule text is considered. In this manner, the performance is limited with the retrieval performance. Compared with EFT-wo/s+a+i+f, the performance of both decision-making and question generation of EFT-wo/s+a+i are significantly improved by introducing fused answer generation strategy, the microacc is increased by 9.2 , the macro-acc is increased by 8.9, the F1BLEU1 is increased by 12.0, and the F1BLEU4 is increased by 11.2. The above results suggests the necessity of fused answer generation strategy. + +# 5 Conclusion + +In this paper, we propose a novel end-to-end framework, called EFT, to bridge the information gap between decision-making and question generation through the shared entailment representation in a global understanding manner. Extensive experimental results on the OR-ShARC benchmark demonstrate the effectiveness of our proposed framework EFT. In our analysis, the implicit reasoning ability of both decision-making and question generation is significantly improved by sharing external explicit entailment knowledge through our novel framework EFT. + +# Limitations + +As shown in Table 3, the results demonstrate the effectiveness of our proposed EFT, but the performance of the unseen subset is still limited by comparing it with the performance of seen subset, which suggests plenty of room for improvement. Data augmentation or generalization methods based on semi-supervised methods could be effective to solve the problem in the future. + +# Acknowledgements + +The work is supported by National Key R&D Plan (No. 2020AAA0106600), National Natural Science Foundation of China (No.62172039, U21B2009 and 62276110). + +# References + +Eunsol Choi, He He, Mohit Iyyer, Mark Yatskar, Wentau Yih, Yejin Choi, Percy Liang, and Luke Zettlemoyer. 2018. QuAC: Question answering in context. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, Brussels, Belgium. 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. +Leyang Cui, Yu Wu, Shujie Liu, Yue Zhang, and Ming Zhou. 2020. MuTual: A dataset for multi-turn dialogue reasoning. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, 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, Minneapolis, Minnesota. Association for Computational Linguistics. +Yifan Gao, Jingjing Li, Michael R Lyu, and Irwin King. 2021. Open-retrieval conversational machine reading. arXiv preprint arXiv:2102.08633. +Yifan Gao, Chien-Sheng Wu, Shafiq Joty, Caiming Xiong, Richard Socher, Irwin King, Michael Lyu, and Steven C.H. Hoi. 2020a. Explicit memory tracker with coarse-to-fine reasoning for conversational machine reading. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics. + +Yifan Gao, Chien-Sheng Wu, Jingjing Li, Shafiq Joty, Steven C.H. Hoi, Caiming Xiong, Irwin King, and Michael Lyu. 2020b. Discern: Discourse-aware entailment reasoning network for conversational machine reading. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 2439-2449. +Vladimir Karpukhin, Barlas Oguz, Sewon Min, Patrick Lewis, Ledell Wu, Sergey Edunov, Danqi Chen, and Wen-tau Yih. 2020. Dense passage retrieval for open-domain question answering. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), Online. Association for Computational Linguistics. +Carolin Lawrence, Bhushan Kotnis, and Mathias Niepert. 2019. Attending to future tokens for bidirectional sequence 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), Hong Kong, China. 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 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. +Jing Li, Aixin Sun, and Shafiq Joty. 2018. Segbot: a generic neural text segmentation model with pointer network. In Proceedings of the 27th International Joint Conference on Artificial Intelligence, pages 4166-4172. +Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. 2020. Ro{bert}a: A robustly optimized {bert} pretraining approach. +Ilya Loshchilov and Frank Hutter. 2018. Fixing weight decay regularization in adam. In International Conference on Learning Representations. +Siru Ouyang, Zhuosheng Zhang, and Hai Zhao. 2021. Dialogue graph modeling for conversational machine reading. In *Findings of the Association for Computational Linguistics: ACL-IJCNLP* 2021, 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). + +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. +Marzieh Saeidi, Max Bartolo, Patrick Lewis, Sameer Singh, Tim Roektaschel, 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. +Kai Sun, Dian Yu, Jianshu Chen, Dong Yu, Yejin Choi, and Claire Cardie. 2019. DREAM: A challenge data set and models for dialogue-based reading comprehension. Transactions of the 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. +Nikhil Verma, Abhishek Sharma, Dhiraj Madan, Danish Contractor, Harshit Kumar, and Sachindra Joshi. 2020. Neural conversational QA: Learning to reason vs exploiting patterns. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), Online. Association for Computational Linguistics. +Xiao Zhang, Heyan Huang, Zewen Chi, and Xian-Ling Mao. 2022. ET5: A novel end-to-end framework for conversational machine reading comprehension. In Proceedings of the 29th International Conference on Computational Linguistics, Gyeongju, Republic of Korea. International Committee on Computational Linguistics. +Zhuosheng Zhang, Siru Ouyang, Hai Zhao, Masao Utiyama, and Eiichiro Sumita. 2021. Smoothing dialogue states for open conversational machine reading. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing. +Victor Zhong and Luke Zettlemoyer. 2019. E3: Entailment-driven extracting and editing for conversational machine reading. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics. + +Appendix + +
DPR-RTop1Top5Top10Top20
Dev54.593.499.299.5
Seen Only96.8100.0100.0100.0
Unseen Only19.587.998.599.0
Test77.593.596.398,8
Seen Only97.6100.0100.0100.0
Unseen Only62.888.893.797.9
+ +Table 5: Retrieval Results of DPR-R. + +# A The Performance of Retriever (DPR-R) + +Table 6 presents the detailed performance of DPR-R, including the performance of Top- $k$ on dev set and test set. Different from previous methods (Zhang et al., 2021) that utilize DRP but only use TF-IDF retrieved negatives, we use random negatives sampled from seen rule texts in knowledge base. Experimental results illustrate that DPR-R outperforms DPR by $16.5\%$ in top5 accuracy on test set, and reaches competitive results with TF-IDF+DPR. + +# B The Performance of Retriever (DPR-R) on Subset + +We further analyzed the performance of DPR-R on the seen and unseen subset. As shown in Table 5, experimental results demonstrate the effectiveness of DPR-R on seen sets, the top1 accuracy reached 97.6 on the seen subset of test set. But the performance still have a large latent space of improvement on unseen sets. + +# C Additional Experiment Details + +We implement EFT with the PyTorch library and using pre-trained Transformers from the Hugging Face repositories. The retriever DPR-R is based on the DPR repositories. The data of OR-ShARC are from the OR-ShARC repository. The above repositories provide the data, models and licenses. The whole training process takes about several hours on eight Nvidia A100 GPUs. + +
ModelDev SetTest Set
Top1Top5Top10Top20Top1Top5Top10Top20
TF-IDF53.883.494.096.666.990.394.096.6
DPR48.174.684.990.552.480.388.992.6
TF-IDF + DPR66.390.092.494.579.895.497.197.5
DPR-R(ours)54.593.499.299.577.593.596.398.8
+ +Table 6: Comparison of the open-retrieval methods. + +A For every submission: + +A1. Did you describe the limitations of your work? + +Limitations section after section 5 + +A2. Did you discuss any potential risks of your work? + +Limitations section after section 5 + +A3. Do the abstract and introduction summarize the paper's main claims? + +Abstract and section1 + +A4. Have you used AI writing assistants when working on this paper? + +We use chatGPT to verify the grammar of our abstract. + +B Did you use or create scientific artifacts? + +Appendix.C + +B1. Did you cite the creators of artifacts you used? + +Appendix.C + +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? + +Appendix.C + +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +Not applicable. Left blank. + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? + +Not applicable. Left blank. + +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? + +Section 4.1 + +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. + +Section 4.1 + +C Did you run computational experiments? + +Section 4 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +Appendix.C and Section 4.2 + +The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +Section 4.2 + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +Table 1, Table2 in Section 4 + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +Appendix.C and Section 4.2 + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +No response. + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +No response. + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +No response. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +No response. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +No response. \ No newline at end of file diff --git a/bridgingthegapentailmentfusedt5foropenretrievalconversationalmachinereadingcomprehension/images.zip b/bridgingthegapentailmentfusedt5foropenretrievalconversationalmachinereadingcomprehension/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..c4ae3c22c41716622dad86986429a12412798110 --- /dev/null +++ b/bridgingthegapentailmentfusedt5foropenretrievalconversationalmachinereadingcomprehension/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:78071c953db8979fbc3d06f9f483083887fff0d4de4ff2c38d646333a7194235 +size 482554 diff --git a/bridgingthegapentailmentfusedt5foropenretrievalconversationalmachinereadingcomprehension/layout.json b/bridgingthegapentailmentfusedt5foropenretrievalconversationalmachinereadingcomprehension/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..3473237d8bd1d597b59a98f67ef07f562bcbfb55 --- /dev/null +++ b/bridgingthegapentailmentfusedt5foropenretrievalconversationalmachinereadingcomprehension/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d1251711998722271a6981fe5da45a482892102f2fbc9f982d248f7c8e9af58 +size 427407 diff --git a/bumpabenchmarkofunfaithfulminimalpairsformetaevaluationoffaithfulnessmetrics/ff686408-ab41-4e31-8157-f82d8d24004d_content_list.json b/bumpabenchmarkofunfaithfulminimalpairsformetaevaluationoffaithfulnessmetrics/ff686408-ab41-4e31-8157-f82d8d24004d_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..ea2f87e609ae47ac9d484c4853eb2a821e7318b7 --- /dev/null +++ b/bumpabenchmarkofunfaithfulminimalpairsformetaevaluationoffaithfulnessmetrics/ff686408-ab41-4e31-8157-f82d8d24004d_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d46d1b6092c2506ec318dcacadc2d03dde7c4f1aedeb57f9a04bb6c6cb419b80 +size 182655 diff --git a/bumpabenchmarkofunfaithfulminimalpairsformetaevaluationoffaithfulnessmetrics/ff686408-ab41-4e31-8157-f82d8d24004d_model.json b/bumpabenchmarkofunfaithfulminimalpairsformetaevaluationoffaithfulnessmetrics/ff686408-ab41-4e31-8157-f82d8d24004d_model.json new file mode 100644 index 0000000000000000000000000000000000000000..143e25cb9a101510007fc8fe3ec8fdd9e0e75742 --- /dev/null +++ b/bumpabenchmarkofunfaithfulminimalpairsformetaevaluationoffaithfulnessmetrics/ff686408-ab41-4e31-8157-f82d8d24004d_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4f46d66aae2c07cc7297bbe723c3a6cac61c0fb1629eecc4d95fa34fe9f4ef3f +size 214818 diff --git a/bumpabenchmarkofunfaithfulminimalpairsformetaevaluationoffaithfulnessmetrics/ff686408-ab41-4e31-8157-f82d8d24004d_origin.pdf b/bumpabenchmarkofunfaithfulminimalpairsformetaevaluationoffaithfulnessmetrics/ff686408-ab41-4e31-8157-f82d8d24004d_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8c0e3b5f8bc52614dd298cecbc1899b2711f55b9 --- /dev/null +++ b/bumpabenchmarkofunfaithfulminimalpairsformetaevaluationoffaithfulnessmetrics/ff686408-ab41-4e31-8157-f82d8d24004d_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d8c8b506913086f4d9fba2b1bbdd1430d7e00b4fc403e183df76de3025c5d94 +size 3651819 diff --git a/bumpabenchmarkofunfaithfulminimalpairsformetaevaluationoffaithfulnessmetrics/full.md b/bumpabenchmarkofunfaithfulminimalpairsformetaevaluationoffaithfulnessmetrics/full.md new file mode 100644 index 0000000000000000000000000000000000000000..04bc38a069174e382ccdd704c849d66b4356e600 --- /dev/null +++ b/bumpabenchmarkofunfaithfulminimalpairsformetaevaluationoffaithfulnessmetrics/full.md @@ -0,0 +1,886 @@ +# BUMP: A Benchmark of Unfaithful Minimal Pairs for Meta-Evaluation of Faithfulness Metrics + +Liang Ma1 Shuyang Cao2 Robert L. Logan IV1 Di Lu1 +Shihao Ran1 Ke Zhang1 Joel Tetreault1 Alejandro Jaimes1 +1Dataminr Inc. 2University of Michigan, Ann Arbor +{lma,rlogan,dlu,sran,kzhang,jtetreault, ajaimes}@dataminr.com caoshuy@umich.edu + +# Abstract + +The proliferation of automatic faithfulness metrics for summarization has produced a need for benchmarks to evaluate them. While existing benchmarks measure the correlation with human judgements of faithfulness on model-generated summaries, they are insufficient for diagnosing whether metrics are: 1) consistent, i.e., indicate lower faithfulness as errors are introduced into a summary, 2) effective on human-written texts, and 3) sensitive to different error types (as summaries can contain multiple errors). To address these needs, we present a benchmark of unfaithful minimal pairs (BUMP), a dataset of 889 human-written, minimally different summary pairs, where a single error is introduced to a summary from the CNN/DailyMail dataset to produce an unfaithful summary. We find BUMP complements existing benchmarks in a number of ways: 1) the summaries in BUMP are harder to discriminate and less probable under SOTA summarization models, 2) unlike non-pair-based datasets, BUMP can be used to measure the consistency of metrics, and reveals that the most discriminative metrics tend not to be the most consistent, and 3) unlike datasets containing generated summaries with multiple errors, BUMP enables the measurement of metrics' performance on individual error types. + +# 1 Introduction + +Although modern abstractive summarization systems have improved in their ability to produce fluent text (Lewis et al., 2020), their ability to generate text that is factually grounded in the source article remains an issue (Kryscinski et al., 2020). This phenomenon has inspired the NLP community to develop faithfulness evaluation metrics (Fabbri et al., 2022; Laban et al., 2022; Honovich et al., 2021; Scialom et al., 2021) that automatically measure the extent to which abstractive summarization systems produce summaries that contain information that cannot be verified by the source article. + +As the number of these automatic faithfulness metrics has increased, there has arisen a corresponding need for benchmarks that evaluate their relative strengths. To satisfy this need, researchers have developed datasets such as FRANK (Pagnoni et al., 2021) and TRUE (Honovich et al., 2022) that are comprised of model-generated summaries along with human-annotated faithfulness levels. Although these datasets are useful for evaluating the degree to which faithfulness metrics correlate with human judgements and can discriminate unfaithful summaries, a number of factors limit the conclusions that can be drawn from them. For one, because model summaries can vary in terms of length, content, and number of errors, these benchmarks are ill-suited for drawing conclusions about the consistency (Gabriel et al., 2021) of metrics, i.e., whether their scores indicate lower faithfulness as summaries become increasingly unfaithful, as well as their sensitivity to specific types of errors since summaries can contain multiple errors. Furthermore, as the summaries are machine-generated, these benchmarks cannot evaluate whether metrics can detect human-written unfaithful summaries. + +To enable research on these topics, we present BUMP—a benchmark of unfaithful minimal pairs—a dataset of 889 minimally different summary pairs where all unfaithful summaries are generated by human annotators. As illustrated in Figure 1, given an article and its reference summary, we ask a human annotator to edit the reference summary in a minimal way such that the edited summary exhibits one unfaithful error. We design two tasks for performance comparisons: 1) taxonomy-based edits, where a specific unfaithfulness error type is required according to our proposed taxonomy, and 2) freestyle edits, where no error type constraints are imposed. The motivation behind the first task setting is to ensure that different error types are adequately represented in our dataset, while the second task setting is important for understanding + +Article: Manchester City and Chelsea are set to battle it out for the signature of West Ham left-back Aaron Cresswell this summer... West Ham snapped up Cresswell for £2 million from Ipswich last summer but he has adapted to the top tier with relative ease and attracted the eye of the division's Champions League clubs... England stars Jack Wilshere, Jordan Henderson and Liverpool contract rebel Raheem Sterling are also on City's wanted list to fulfil the quota. Premier League sides must name eight homegrown players in their 25-man squad registered at the beginning of the season. A player is deemed homegrown if they have spent at least three years at any English club before the age of 21, regardless of nationality. + +Summary [Extrinsic Entity Error]: Aaron Cresswell has impressed during debut season in Premier League. The left back joined West Ham from Championship club Ipswich for £2m. Manchester City and Chelsea are both keen to sign the 25-year-old. Both clubs are mindful of boosting their quota of homegrown foreign players. + +# Faithfulness Metric Scores + +![](images/e5056b63774c6011744ff5e6f7b4839febc77f47d2cb4fba3d275626d5f0abf7.jpg) +Figure 1: Example from BUMP dataset. An annotator constructs an unfaithful summary containing an Extrinsic Entity Error (Section 3.2) by replacing the word "homegrown" in the reference summary with the word "foreign". The reference and edited summary form a minimal unfaithful summary pair. Faithfulness metrics are evaluated on both the reference and edited summary and compared to measure whether the metric is consistent, e.g., in this example, QUESTVAL and COCo are consistent, while FACTCC is not. + +the completeness of our error type taxonomy as well as whether annotation difficulty is affected by instructing annotators to focus on specific error types. + +We use BUMP to study the ability and performance consistency of faithfulness evaluation metrics in differentiating unfaithful summaries from faithful ones. Similar to how minimal pairs are used to diagnose linguistic knowledge of language models (Marvin and Linzen, 2018; Warstadt et al., 2020), the minimal summary pairs in BUMP allow targeted tests of a metric's consistency on different types of errors (Table 1). This setup minimizes the effect of confounding factors that affect similar analyses (e.g., Pagnoni et al. (2021) and Tang et al. (2022)) such as text length, stylistic variation, and multiple errors occurring in the same summary. We evaluate standard and state-of-the-art faithfulness metrics on BUMP using meta-evaluation protocols that target two phenomena: 1) consistency, i.e. the fraction of unfaithful summaries that receive a lower score than their corresponding faithful summaries, and 2) discriminability, i.e., the metric's ability to classify unfaithful vs. faithful summaries as measured by ROC AUC. + +Our results (Section 5) yield a number of useful findings: 1) BUMP differs substantially from existing benchmarks: the summaries in BUMP are harder to discriminate (ROC AUC scores between $50 - 70\%$ vs. $70 - 84\%$ ) and are less probable under SOTA summarization models. 2) Discriminability != consistency: interestingly, the most consistent + +metrics (BARTSCORE, COCo) tend to have poor discriminability. 3) Some error types are harder than others: e.g., metrics seem to uniformly struggle with summaries containing Intrinsic Errors. + +In sum, our contributions are three-fold: 1) We build a benchmark of human-generated unfaithful minimal pairs (BUMP) for evaluating faithfulness metrics. 2) We show human-generated unfaithful errors are substantially different from and more challenging than model-generated ones. 3) We demonstrate how BUMP provides insights on both the consistency and discriminative ability of faithfulness metrics on different error types than prior evaluation benchmarks that complement insights from existing benchmarks. The BUMP dataset is available at: https://github.com/dataminr-ai/BUMP. + +# 2 Related Work + +Standard evaluation metrics for text generation tasks, e.g., BLEU and ROUGE, do not correlate well with human judgements of factual alignment in summarization settings (Kryscinski et al., 2019; Maynez et al., 2020). This has motivated the development of automated faithfulness metrics that quantify factual alignment through methods that either: use NLI to measure the entailment degree between the source article and summary (Kryscinski et al., 2020; Goyal and Durrett, 2020; Laban et al., 2022), compare summary probabilities when relevant information is removed from the source (Xie et al., 2021), or use question answering models to + +measure if questions derived from the source can be answered by the summary and vice versa (Wang et al., 2020; Durmus et al., 2020; Scialom et al., 2021). + +Existing faithfulness metric evaluations use one of two classes of benchmarks: 1) machine-generated summaries paired with human-annotated faithfulness levels (Laban et al., 2022; Pagnoni et al., 2021; Tang et al., 2022), and 2) summary pairs pertaining to the same article where one summary is faithful and the other is unfaithful (Falke et al., 2019; Gabriel et al., 2021). While both classes can evaluate a metric's ability to discriminate unfaithful summaries, the latter additionally allows for consistency tests, i.e., whether metrics assign higher values to more faithful summaries. + +The BUMP dataset belongs to the second class of benchmarks; however, it has a number of unique properties. First, unlike both Falke et al. (2019) and Gabriel et al. (2021), the unfaithful summaries in BUMP are human-written. In addition, the unfaithful summaries in BUMP are minimally different, in the sense that only a single error differentiates the faithful and unfaithful summary. As shown in Section 5, this produces summary pairs that are substantially more challenging for metrics to differentiate. Inspired by the use of minimal pairs to diagnose linguistic knowledge of language models (Marvin and Linzen, 2018; Warstadt et al., 2020), the benefit of this approach is that it allows targeted tests of a metric's consistency on different types of errors (Section 3.2) while minimizing the effect of confounding factors. Therefore, unlike other benchmarks with error type annotations (Pagnoni et al., 2021; Tang et al., 2022), results on BUMP are not complicated by issues such as multiple errors appearing in the same summary. + +# 3 Benchmark of Unfaithful Minimal Pairs (BUMP) + +Two annotation tasks are designed for BUMP, where Task 1 is taxonomy-based (a specific error type is required for the edited summary), and Task 2 allows freestyle edits (i.e., no error type constraints are imposed). In this section, we first describe how data sources are selected to build BUMP (3.1), and then describe the details of the two annotation tasks (3.2 and 3.3). + +# 3.1 Dataset + +For Task 1, we randomly select 100 article-summary pairs from the test set of the CNN/DailyMail dataset (Hermann et al., 2015). For Task 2, we select an additional 100 random article-summary pairs. Both tasks are performed via Amazon Mechanical Turk. + +# 3.2 Task 1: Taxonomy-based Unfaithful Summaries + +To obtain fine-grained performance evaluations of faithfulness metrics, it is critical to evaluate their sensitivity regarding various error types. Furthermore, benchmarks should contain sufficiently many instances associated with each error type to enable statistically significant comparisons to be made. To this end, we first define a taxonomy of unfaithful error types, and then ask annotators to introduce errors of a specific type in order to ensure each error type is adequately represented in the final dataset. + +We note that existing taxonomies of error types may contain overlapped error types, e.g., grammatical vs. entity errors in FRANK (Pagnoni et al., 2021) or lack of fine granularity, e.g., Tang et al. (2022). By considering the strengths and shortcomings of existing taxonomies, we define our own taxonomy in Table 1. Our taxonomy is first adapted from the one in FRANK (Pagnoni et al., 2021) by including semantic frame errors (Predicate Error, Entity Error, and Circumstance Error) and Coreference Error, and removing error types that might overlap with others. To further categorize each semantic frame error, we adopt the notions of Intrinsic and Extrinsic errors (Maynez et al., 2020; Goyal and Durrett, 2020; Tang et al., 2022). Note that we do not simply categorize errors into the Intrinsic and Extrinsic ones, as we believe semantic frame errors can better instruct annotators to create summaries with diverse unfaithful errors. In our taxonomy, the Intrinsic/Extrinsic distinction only applies to the Predicate, Entity, and Circumstance Error, since for a Coreference Error, it is generally ambiguous whether an erroneous pronoun/reference that does not exist in the source article should be regarded as intrinsic or extrinsic. In total, this results in seven different error types. + +For each of the seven error types in this taxonomy, given an article-summary pair, we ask the annotator to introduce an error of the required type through a minimal edit to the reference summary. All Human Intelligence Tasks (HITs) in Amazon Mechanical Turk are shuffled and there is no annotation repetition, i.e., one assignment per HIT. This increases the chance that edits of the same reference summary will be made by different annotators. Additional details regarding qualification tests and annotation instructions are presented in Appendix A. + +After the data collection, we manually check the validity of each edit. For cases where the edits do not match the required error types, we relabel them with the corrected error types based on our taxonomy. The dataset statistics after correction are shown in Table 2. For this task, one common mistake is that annotators consider the quantity of a noun object as a circumstance and make edits to the quantity (the first example in Table 3), hence mistakenly treat Entity Errors as Circumstance Errors, which causes the total number of Circumstance Errors to be only 160 (much smaller than that of Entity Errors; see Table 2). Another frequent mistake is that the edited word actually exists in the original article for the required extrinsic error (the second example in Table 3), which results in a smaller number of Extrinsic Errors than intrinsic ones across all semantic frame errors, especially for Predicate Errors. Furthermore, Table 2 shows all edited summaries can be categorized by our taxonomy (no summaries are relabeled as "Other"), and the incorrect response rate is $16\%$ , suggesting that, in general, annotators correctly respond with the required error types. + +# 3.3 Task 2: Freestyle Unfaithful Summaries + +In addition to the taxonomy-based Task 1, we also conduct a separate task, Task 2, where annotators can edit reference summaries in any way they want, i.e., freestyle editing, as long as only one error is introduced to the reference summary via minimal edits. The goal of Task 2 is to understand how human-generated unfaithful summaries may vary, and how the performance of faithfulness evaluation metrics changes accordingly, when there are no error type constraints. In particular, only annotators who did not participate in the qualification test of Task 1 are considered to participate in this task; in this way, we ensure the edited summaries in Task 2 + +
Error TypeDescription
Predicate ErrorThe predicate in the summary is inconsistent with the source article.
Entity ErrorThe subject/object of a predicate is inconsistent with the source article.
Circumstance ErrorTime, duration, or location of an event of the predicate is wrong.
Coreference ErrorA pronoun/reference with wrong or nonexistent antecedent.
Intrinsic ErrorError derived from information within the source article.
Extrinsic ErrorError contains information not present in the source article.
+ +Table 1: Error type taxonomy. + +
Task 1Task 2
PredicateIntrinsic11617
Extrinsic7628
EntityIntrinsic12828
Extrinsic11562
CircumstanceIntrinsic8222
Extrinsic7833
Coreference-981
Other-05
Total693196
+ +Table 2: BUMP dataset statistics. + +are not constrained to any known error types. + +To post-process all data collected in Task 2, we manually assign an error type to each data point, based on our error type taxonomy in Task 1. Without informing annotators of any specific error types, we observe the rate that the "Other" label occurs is only $2.5\%$ for Task 2 in Table 2. This confirms that the vast majority of errors produced by humans adhere to our proposed taxonomy. For more details on Task 2, please see Appendix B. + +Remark. For both tasks, we ask annotators to introduce only one error (by editing the reference summary in a minimal way). We acknowledge that some reference summaries may be unfaithful in the first place; nevertheless, for both tasks, edited summaries are based on reference summaries, by which we ensure the edited summaries are always more unfaithful than reference summaries. + +# 4 Meta-Evaluation of Faithfulness Evaluation Metrics + +In this section, we first describe the faithfulness evaluation metrics benchmarked on BUMP (4.1). + +
Article (Partial)Reference SummaryRequired Error TypeEdited SummaryCorrected Error Type
... The drugs, whose value is estimated at more than $105 million, ... Officers arrested one Venezuelan and two Spanish citizens who were on board the vessel off the coast ... French customs officials seized nearly 250 kilograms (550 pounds) of cocaine on a vessel that was also off the coast of Martinique, according to authorities.The value of the drugs is estimated at more than $105 million. Officers arrested one Venezuelan and two Spanish citizens on board the vessel.Intrinsic Circumstance ErrorThe value of the drugs is estimated at more than $250 million . Officers arrested one Venezuelan and two Spanish citizens on board the vessel.Intrinsic Entity Error
Lightning, floods and a deluge of hailstones descended on St Louis Tuesday as powerful storms pummeled the mid-United States. Roads around the Missouri city were flooded in the intense downpour, with one town recording more than two inches of rain in half an hour. ...St Louis was hit Tuesday by flash floods. A nearby town had more than two inches of rain in less than half an hour.Extrinsic Predicate ErrorSt Louis pummeled Tuesday by flash floods . A nearby town had more than two inches of rain in less than half an hour.Intrinsic Predicate Error
+ +Table 3: Example error type corrections. The above examples illustrate instances where annotators' edits to the reference do not match the required error type they are requested to produce. For such examples, BUMP includes a manually annotated corrected error type. + +Then meta-evaluation protocols are discussed (4.2). + +# 4.1 Faithfulness Metrics + +To cover diverse types of faithfulness metrics, in this section, we select metrics that are generally used for measuring generation quality (i.e., $n$ -gram-based metrics), recent metrics that are proposed specifically for faithfulness evaluations, as well as some pre-trained model based metrics, which are detailed as follows. We investigate their abilities to distinguish faithful summaries from their minimally edited counterparts. + +- $n$ -Gram-Based Metrics: We evaluate the following 2 $n$ -gram-based metrics: BLEU (Papineni et al., 2002) and ROUGE (ROUGE-2 Precision specifically) (Lin, 2004). +- Faithfulness Evaluation Metrics: We evaluate the following 7 faithfulness evaluation metrics: QUESTEval (Scialom et al., 2021), $Q^2$ (Honovich et al., 2021), QAFACTEval (Fabbri et al., 2022), FACTCC (Kryscinski et al., 2020), DAE (Goyal and Durrett, 2020), SUMMAC (Laban et al., 2022) and CoCo (Xie et al., 2021) in this paper. To obtain a score for FACTCC, we take the classifier probability of the summary being faithful. +- Other Metrics: We evaluate the following 3 pretrained model based metrics: BLEURT (Sellam et al., 2020) with the BLEURT-20 checkpoint (Pu et al., 2021), BERTSCORE (Zhang et al., 2020) (specifically the BERTSCORE-precision variant) using the DeBERTa-xl-MNLI model (He et al., 2021), and BARTSCORE (Yuan et al., 2021) with a BART (Lewis et al., 2020) model fine-tuned on the CNN/DailyMail dataset. + +Note that for reference-based metrics, faithfulness scores are computed by treating the input article as the reference, and the reference/edited sum + +mary as the system output. We also normalize the direction of the metric score so that a higher score always corresponds to better faithfulness from the metric's view, e.g., FACTCC predicts the probability that a summary is unfaithful, and so to obtain a faithfulness score, we take its complement. + +# 4.2 Meta-Evaluation + +Each faithfulness metric takes an article-summary pair and outputs a numerical faithfulness score. In our analysis, we measure faithfulness scores for both the reference summary as well as the human-annotated erroneous summary. We quantify the difference between faithfulness metrics on BUMP using two measurement protocols: consistency and ROC AUC. Originally introduced in Gabriel et al. (2021), consistency measures the success rate of a metric assigning a lower faithfulness score to the erroneous unfaithful summary. In contrast, ROC AUC instead measures the overall capability of a metric to discriminate faithful from unfaithful content for an input summary, and has previously been used by Honovich et al. (2022) for meta-evaluation. Although other metrics such as balanced accuracy have also been used to evaluate discriminability (Laban et al., 2022), we opt to use ROC AUC as it does not require determining a decision threshold. + +# 5 Results + +We report and analyze the performance of faithfulness metrics in this section using meta-evaluation protocol consistency and ROC AUC. + +Consistency. The consistency studies of the two tasks3 for all the metrics are reported in Table 4. In terms of the difficulty per error type, 1) for Task 1, + +
BARTCoCoDAEQAFaEvBERTQuEvBLEURTSUMMACR-2BLEU\( Q^2 \)FACTCC
Overall91.990.887.984.081.478.674.568.467.266.165.759.5
Intrinsic Predicate96.6**88.887.179.381.069.069.861.251.739.749.149.1
Extrinsic Predicate94.793.484.286.888.273.773.767.163.261.859.260.5
Intrinsic Entity93.091.488.391.480.582.876.675.865.660.975.061.7
Extrinsic Entity97.496.593.990.488.787.090.479.186.187.080.959.1
Intrinsic Circumstance85.484.286.681.767.174.463.474.451.253.768.363.4
Extrinsic Circumstance85.985.985.985.979.578.275.673.179.574.468.059.0
Coreference Error86.792.986.770.482.782.767.446.972.586.756.165.3
Intrinsic Error92.3*88.787.484.777.375.870.970.357.151.564.157.7
Extrinsic Error93.392.688.988.185.980.781.474.077.776.271.059.5
+ +(a) Task 1 + +
BARTQAFaEvCoCoBERTBLEURTDAEQuEvSUMMACR-2BLEU\( Q^2 \)FACTCC
Overall93.4**85.784.782.177.675.575.573.068.966.865.848.0
Intrinsic Predicate82.488.288.282.482.482.482.464.770.664.776.564.7
Extrinsic Predicate92.992.989.385.775.064.367.989.371.453.657.142.9
Intrinsic Entity96.4*78.678.682.167.964.360.778.653.650.042.939.3
Extrinsic Entity95.288.785.580.780.779.080.779.069.472.667.745.2
Intrinsic Circumstance90.981.881.872.772.763.677.359.159.177.368.263.6
Extrinsic Circumstance97.078.887.987.981.893.975.854.681.875.881.848.5
Intrinsic Error91.082.182.179.173.168.771.668.759.762.759.753.7
Extrinsic Error95.1**87.087.083.779.779.776.474.873.269.169.145.5
+ +(b) Task 2 + +Table 4: Consistency (\%) of faithfulness evaluation metrics. BART: BARTSCORE, QAFaEv: QAFACTEVAL, BERT: BERTSCORE, QuEv: QUESTEVAL, R-2: ROUGE-2. All values are color-coded. For each row, $* (p < 0.05)$ and $\*\* (p < 0.01)$ indicate the results are statistically significant when comparing the best to the second-best metric. + +Extrinsic Entity Errors are generally the easiest, while all but BARTSCORE struggle with Intrinsic Predicate Errors; 2) for Task 2, Intrinsic Entity Errors are the hardest. This implies that when annotators are not presented with any error types, the introduced error styles may differ from those in Task 1 (see Section 6), potentially causing inconsistencies for metrics in these two tasks. Nevertheless, we observe that for both tasks, Intrinsic Errors are more challenging than extrinsic ones across all but FACTCC in Task 2. This is likely because Intrinsic Errors can be derived from the original article, while Extrinsic Errors contain words that do not appear in the original article, making Intrinsic Errors more subtle to be identified than extrinsic ones. + +For the overall performance (all error types are considered), BARTSCORE has the highest consistency in both tasks, though BARTSCORE has not been proposed specifically for faithfulness evaluations. Other metrics that rank top 4 in both tasks include QAFACTEVAL and CoCo. By comparison, $Q^2$ and FACTCC have the worst consistency, even worse than $n$ -gram-based metrics ROUGE and BLEU; nevertheless, they exhibit different rankings in terms of ROC AUC (see the next section). + +ROC AUC. ROC AUC scores are presented in Table 5. We observe that the overall ranking of faithfulness metrics according to ROC AUC sub + +stantially differs from the ranking according to consistency. In particular, the rank of BARTSCORE drops from the top one to the fifth, while $Q^2$ improves significantly from second to last to second overall. QAFACTEVAL consistently exhibits high performance and even ranks first under ROC AUC, while $n$ -gram based metrics, e.g., ROUGE-2 and BLEU consistently show the worst performance, as expected. In general, metrics that are specifically proposed for faithfulness evaluations rank higher than generic NLG evaluation metrics. + +We additionally observe that the relative rankings of ROC AUC scores across error types and task settings are largely consistent with the relative rankings of consistency scores. Specifically, we again observe that on a per metric basis: 1) ROC AUC scores are generally lower for Task 2 than Task 1 (particularly for Entity Errors), and 2) metrics generally show worse performance on Intrinsic Errors than extrinsic ones. + +For our two meta-evaluation protocols, consistency is suitable for the pairwise ranking of two summaries for a given input article, while ROC AUC is more adequate in evaluating the absolute capacity of unfaithful summary detection. If a metric has high consistency but low ROC AUC, it implies that the scores for predicted faithful and unfaithful summaries overlap frequently. Such overlap makes + +
QAFaEv\( Q^2 \)DAEQuEvBARTFACTCCCoCoSUMMACBLEURTBERTR-2BLEU
Overall71.5**64.263.762.060.157.256.455.955.155.053.250.6
Intrinsic Predicate66.7**57.060.456.060.750.155.053.454.355.251.650.3
Extrinsic Predicate73.5**59.658.759.858.150.855.557.454.256.853.350.5
Intrinsic Entity77.7*71.770.167.863.962.958.458.056.056.353.150.6
Extrinsic Entity78.4*73.167.771.263.557.058.657.558.756.855.450.8
Intrinsic Circumstance71.3*62.963.755.355.461.953.857.252.251.051.949.8
Extrinsic Circumstance73.9**64.061.057.557.058.854.859.353.452.455.150.6
Coreference Error58.257.060.862.159.758.057.250.155.455.353.051.7
Intrinsic Error72.1**64.464.960.460.558.156.056.154.454.652.350.3
Extrinsic Error75.6**66.563.263.959.855.756.557.955.855.454.650.6
+ +(a) Task 1 + +
QAFaEv\( Q^2 \)DAEQuEvBARTSUMMACCoCoBERTR-2BLEURTFACTCCBLEU
Overall71.2**61.358.857.457.456.954.554.154.052.651.550.3
Intrinsic Predicate72.363.360.657.455.055.955.757.453.654.758.851.6
Extrinsic Predicate74.7**57.157.555.660.259.855.956.055.254.348.350.3
Intrinsic Entity65.356.657.855.560.257.757.756.152.552.650.350.4
Extrinsic Entity74.5**64.658.160.458.759.655.354.154.853.049.750.7
Intrinsic Circumstance65.257.055.455.856.655.953.951.952.451.951.451.3
Extrinsic Circumstance71.966.067.957.357.954.155.053.855.454.555.651.2
Intrinsic Error66.5**57.657.555.455.756.054.653.852.251.552.750.3
Extrinsic Error73.5**63.459.858.458.557.954.854.154.753.450.950.4
+ +(b) Task 2 + +Table 5: ROC AUC (%) of faithfulness evaluation metrics. BART: BARTSCORE, QAFaEv: QAFACTEVAL, BERT: BERTSCORE, QuEv: QUESTEVAL, R-2: ROUGE-2. All values are color-coded. For each row, $* (p < 0.05)$ and $\*\* (p < 0.01)$ indicate the results are statistically significant when comparing the best to the second-best metric. + +it challenging to establish a clear decision boundary for classifications. Hence, to improve the classification capability of metrics with high consistency, more calibration is needed to increase the score gap between faithful and unfaithful summaries. + +# 6 Analysis of BUMP + +In this section, we conduct more analysis of BUMP by studying how BUMP differs from other benchmarks, followed by a qualitative analysis of the detection difficulty between Tasks 1 and 2. + +Comparison with Model-Generated Unfaithful Summaries. We compare the generation probabilities of our edited summaries to those of summaries generated from beam search by a BART-based summarizer (trained using the training data of CNN/DailyMail) for the same set of documents in our dataset. We report the difference of these generation probabilities normalized by the text length in Figure 2, where we find our edited summaries are much different from model generations in terms of the model generation probabilities. This highlights that existing metrics may not work well on summaries of various styles and experiments are needed to verify their effectiveness in human-generated unfaithful summaries. + +Furthermore, we compare our ROC AUC scores with those in existing datasets as shown in TRUE + +![](images/31a7ff24044e9347e1a9a570c305827b84a9acaaf4763d822d2fdf0d016577de.jpg) +Figure 2: Distribution of probability differences between human-edited and model-generated summaries on Tasks 1 and 2. Probabilities are computed using a BART-based summarizer. The high frequency of negative values indicates that human-edited summaries tend to have lower probabilities under the model. + +(Honovich et al., 2022). In BUMP, faithful and unfaithful samples under each error type are balanced for both Tasks 1 and 2. Therefore, for a fair comparison, we pick QAGS-C (Wang et al., 2020) (also a balanced dataset on CNN/DailyMail) in TRUE. In Table 5, it shows that the ROC AUC scores evaluated on BUMP are generally much smaller $(50 - 70\%)$ with many values close to random baseline), whereas most ROC AUC scores are $70 - 84\%$ in QAGS-C (see Appendix C). This again + +
Article (Partial)Reference SummaryError TypeEdited Summary
Task 1Task 2
... Detective Chief Inspector Paul Johnson of the London Metropolitan Police Flying Squad said the thieves appeared to have gained access to the vault of Hatton Garden Safe Deposit Ltd through the shaft of an elevator that is used by several businesses in the building. ...Police say the thieves gained entry through the building's commu- +nal elevator shaft. ...Extrinsic Entity ErrorPolice say the thieves gained entry through the building's commu- +nal staircase. ...Police say the thieves gained entry through the building's private elevator shaft. ...
... Claire Nugent, 43, and Nigel Morter, 47, have been married for 14 years... She said: ‘Every night I come home to my Sixties bubble, switch on my old record player, listen to some vinyl, and all the stresses of 2015 melt away’ ...Claire Nugent and Nigel Morter restored a ... likes to come home and switch on an old record player like in the 60s.Extrinsic Entity ErrorTim Horton and Nigel Morter restored a ... likes to come home and switch on an old record player like in the 60s.Claire Nugent and Nigel Morter restored a ... likes to come home and switch on a black and white TV like in the 60s.
Almost three years after nearly leaving Liverpool Jordan Hen- +derson has committed his long-term future to the club convinced he can win silverware at Anfield. ... Henderson has urged Liverpool team-mate Raheem Sterling to follow his lead by signing a new deal.Jordan Henderson has signed a new five-year deal at Anfield. ... Hen- +derson has urged Ra- +heem Sterling to ...Extrinsic Predicate ErrorJordan Henderson has signed a new five-year deal at Anfield. ... Hen- +derson has discouraged Raheem Sterling to ...Jordan Henderson is considering signing a new five-year deal at Anfield. ... Henderson has urged Raheem Sterling to ...
+ +Table 6: Qualitative examples illustrating the higher difficulty of edits in Task 2. Each row contains a pair of edits from Tasks 1 and 2 pertaining to the same article and error type, where more metrics are inconsistent for Task 2 edits. + +indicates that the human-generated errors in BUMP are more difficult for metrics to detect than model-generated errors in existing datasets, reinforcing the value of BUMP as a challenging benchmark for evaluating faithfulness metrics. In addition, we also compare the ROC AUC rankings of different faithfulness metrics under QAGS-C and BUMP. Specifically, we summarize the performance rankings under QAGS-C from Appendix C as well as those from Table 5 under Intrinsic/Extrinsic Error types in Tasks 1 and 2, and report them in Figure 3, where only faithfulness metrics used in both (Honovich et al., 2022) and Table 5 are presented. In Figure 3, we observe that for some faithfulness metrics, such as $Q^2$ and BARTSCORE, their ROC AUC rankings are quite stable across all datasets. However, for other faithfulness metrics, the performance ranking under QAGS-C is very different from the ranking derived from BUMP, e.g., QUESTEval mostly exhibits high ROC AUC ranking in BUMP; by contrast, it experiences the worst performance in QAGS-C. Thus, we believe BUMP complements existing benchmarks and allows a more comprehensive analysis of faithfulness metrics in future studies. + +Qualitative Analysis. We provide a qualitative analysis of examples that demonstrate the increased difficulty of Task 2. The examples are provided in Table 6. Each row contains edited summaries from Tasks 1 and 2 for the same original article and its reference summary. In addition, to compare edited summaries under the same error type, we pick examples where the corrected error type from Task 1 + +![](images/c3972f7934ae61d022dc55c478e4e082623e7dcecbd8c2be8b42aa3f47d4d185.jpg) +Figure 3: ROC AUC ranking of faithfulness metrics under different datasets. Only faithfulness metrics used in both (Honovich et al., 2022) and Table 5 are presented. T1: Task 1 of BUMP, T2: Task 2 of BUMP, Intrinsic: Intrinsic Errors, Extrinsic: Extrinsic Errors, BART: BARTSCORE, BERT: BERTSCORE, QuEv: QUESTEVAL. + +is the same as the exhibited error type from Task 2. As shown in Table 6, in the first example, for the Extrinsic Entity Error type, the annotator in Task 1 modifies the entity elevator shaft to another entity staircase. Whereas the annotator in Task 2 modifies the word communal to private (i.e., also an Extrinsic Entity Error) which requires commonsense knowledge to infer that private is contradictory to the fact that the elevator is used by several businesses in the building. In the second example, for the Extrinsic Entity Error type, the annotator in Task 1 modifies the entity name from Claire Nugent to a random name Tim Horton, whereas the annotator in Task 2 changes record player to black and white TV to fit the 60s theme, which again, requires additional knowledge. In the last example, + +the annotator in Task 2 modifies the temporal state of the action sign from signed to is considering signing which is more challenging than changing the action urged to its antonym discouraged as the annotator in Task 1 does. + +For the first two examples of Task 2 in Table 6, only 4 metrics (QAFACTEVAL, QUESTEVAL, BLEURT, and BERTSCORE for the first example; QAFACTEVAL, SUMMAC, BLEURT, and ROUGE-2 for the second example) succeed in giving a higher score to the reference summary. In comparison, 9 and 11 metrics succeed in giving a higher score to the reference summary in their Task 1 counterparts, respectively. For the last example, 8 metrics succeed in Task 2 and all 12 metrics succeed in Task 1. Thus, Table 6 shows that some unfaithful summaries in Task 2 are more challenging for faithfulness metrics to detect, which further exemplifies the challenges of Task 2 in BUMP. + +# 7 Conclusion + +In this paper, we presented a benchmark of unfaithful minimal pairs (BUMP) to evaluate faithfulness metrics. Unlike prior work where all unfaithful summaries are model generated, each unfaithful summary in BUMP is generated by minimal human edits to introduce one unfaithful error given a reference summary. Through our experiments, we found that BUMP complements existing benchmarks in a number of ways. First, we found that the summaries in BUMP are harder to discriminate and less probable under SOTA summarization models. Second, we used BUMP to measure the consistency of metrics, which cannot be readily measured using other benchmarks. This analysis revealed a discrepancy between the discriminability and consistency of existing metrics, highlighting an important area for future faithfulness metric research to address. Finally, we used BUMP to study faithfulness metrics' performance on individual error types—where our minimal-pair-inspired setup helped control for conclusions being conflated across multiple error types—which revealed that sensitivity to intrinsic errors is another important area for future research to focus on. + +# Acknowledgements + +We would like to thank our colleague Aoife Cahill at Dataminr for her valuable comments, suggestions, and support for this paper. We also thank the anonymous reviewers for their feedback and + +comments. + +# Limitations + +Although BUMP is, to our knowledge, the first dataset on which to study the consistency of faithfulness metrics on human-written errors across different error types, there are some limitations regarding the conclusions that can be drawn from it. For one, because BUMP is comprised of minimal edits to reference summaries from CNN/DailyMail, it is not suitable for analyzing the consistency of faithfulness metrics when errors are added to reference summaries already containing many errors. In addition, due to a combination of resource constraints and human preferences for writing specific types of errors, the sample sizes for some error types in Task 2 (e.g., Coreference Error and Intrinsic Predicate Error) may not be sufficiently large to enable statistically significant comparisons between different metrics for specific error types. + +# Ethics Statement + +The collection of BUMP involves human annotations. The human annotators are provided with clear task instructions and informed of the conditions where they would be qualified and disqualified. We compensate annotators with $3.00 per assignment in the qualification task and$ 0.50 per assignment in the full task for both Tasks 1 and 2. The final paid rate is $15 per hour which is over the US national minimum wage $^4$ of $7.25. We are also aware that our shared datasets could be potentially misused as training samples, albeit a small number, to develop models to generate unfaithful content. + +# References + +Esin Durmus, He He, and Mona Diab. 2020. FEQA: A question answering evaluation framework for faithfulness assessment in abstractive summarization. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5055-5070, Online. Association for Computational Linguistics. + +Alexander Fabbri, Chien-Sheng Wu, Wenhao Liu, and Caiming Xiong. 2022. QAFactEval: Improved QA-based factual consistency evaluation for summarization. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technolo + +gies, pages 2587-2601, Seattle, United States. Association for Computational Linguistics. +Alexander R. Fabbri, Wojciech Krysciński, Bryan McCann, Caiming Xiong, Richard Socher, and Dragomir Radev. 2021. SummEval: Re-evaluating summarization evaluation. Transactions of the Association for Computational Linguistics, 9:391-409. +Tobias Falke, Leonardo F. R. Ribeiro, Prasetya Ajie Utama, Ido Dagan, and Iryna Gurevych. 2019. Ranking generated summaries by correctness: An interesting but challenging application for natural language inference. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 2214-2220, Florence, Italy. Association for Computational Linguistics. +Saadia Gabriel, Asli Celikyilmaz, Rahul Jha, Yejin Choi, and Jianfeng Gao. 2021. GO FIGURE: A meta evaluation of factuality in summarization. In *Findings of the Association for Computational Linguistics: ACLIJCNLP* 2021, pages 478-487, Online. Association for Computational Linguistics. +Tanya Goyal and Greg Durrett. 2020. Evaluating factuality in generation with dependency-level entailment. In *Findings of the Association for Computational Linguistics: EMNLP* 2020, pages 3592-3603, Online. Association for Computational Linguistics. +Pengcheng He, Xiaodong Liu, Jianfeng Gao, and Weizhu Chen. 2021. DEBERTA: Decoding-enhanced BERT with disentangled attention. In International Conference on Learning Representations. +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. +Or Honovich, Roee Aharoni, Jonathan Herzig, Hagai Taitelbaum, Doron Kukliansy, Vered Cohen, Thomas Scialom, Idan Szpektor, Avinatan Hassidim, and Yossi Matias. 2022. TRUE: Re-evaluating factual consistency evaluation. In Proceedings of the Second DialDoc Workshop on Document-grounded Dialogue and Conversational Question Answering, pages 161-175, Dublin, Ireland. Association for Computational Linguistics. +Or Honovich, Leshem Choshen, Roee Aharoni, Ella Neeman, Idan Szpektor, and Omri Abend. 2021. $Q^{2}$ : Evaluating factual consistency in knowledge-grounded dialogues via question generation and question answering. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 7856-7870, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Wojciech Kryscinski, Nitish Shirish Keskar, Bryan McCann, Caiming Xiong, and Richard Socher. 2019. Neural text summarization: A critical 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), pages 540-551, Hong Kong, China. Association for Computational Linguistics. +Wojciech Kryscinski, Bryan McCann, Caiming Xiong, and Richard Socher. 2020. Evaluating the factual consistency of abstractive text summarization. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 9332-9346, Online. Association for Computational Linguistics. +Philippe Laban, Tobias Schnabel, Paul N. Bennett, and Marti A. Hearst. 2022. SummaC: Re-visiting NLIBased models for inconsistency detection in summarization. Transactions of the Association for Computational Linguistics, 10:163-177. +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. +Rebecca Marvin and Tal Linzen. 2018. Targeted syntactic evaluation of language models. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 1192-1202, Brussels, Belgium. 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. +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. +Artidoro Pagnoni, Vidhisha Balachandran, and Yulia Tsvetkov. 2021. Understanding factuality in abstractive summarization with FRANK: A benchmark for factuality metrics. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 4812-4829, 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 on Association for Computational Linguistics, ACL '02, page 311-318, USA. Association for Computational Linguistics. + +Amy Pu, Hyung Won Chung, Ankur Parikh, Sebastian Gehrmann, and Thibault Sellam. 2021. Learning compact metrics for MT. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 751-762, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. + +Thomas Scialom, Paul-Alexis Dray, Sylvain Lamprier, Benjamin Piwowarski, Jacopo Staiano, Alex Wang, and Patrick Gallinari. 2021. QuestEval: Summarization asks for fact-based evaluation. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 6594-6604, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. + +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. + +Liyan Tang, Tanya Goyal, Alexander R. Fabbri, Philippe Laban, Jiacheng Xu, Semih Yahvuz, Wojciech Kryscinski, Justin F. Rousseau, and Greg Durrett. 2022. Understanding factual errors in summarization: Errors, summarizers, datasets, error detectors. + +Alex Wang, Kyunghyun Cho, and Mike Lewis. 2020. Asking and answering questions to evaluate the factual consistency of summaries. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5008-5020, Online. 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. + +Yuexiang Xie, Fei Sun, Yang Deng, Yaliang Li, and Bolin Ding. 2021. Factual consistency evaluation for text summarization via counterfactual estimation. In *Findings of the Association for Computational Linguistics: EMNLP* 2021, pages 100-110, Punta Cana, Dominican Republic. Association for Computational Linguistics. + +Weizhe Yuan, Graham Neubig, and Pengfei Liu. 2021. BARTScore: Evaluating generated text as text generation. In Advances in Neural Information Processing Systems. + +Tianyi Zhang, Varsha Kishore, Felix Wu, Kilian Q. Weinberger, and Yoav Artzi. 2020. BERTScore: Evaluating text generation with BERT. In International Conference on Learning Representations. + +# A Details of Task 1: Taxonomy-based Unfaithful Summaries + +# A.1 Qualification Task + +The instructions and the task interface for the qualification task of Task 1 are shown in Figures A1 to A4. + +In this qualification task, all US-based annotators are able to participate. Specifically, we ask annotators to read a news article and seven pairs of summaries. For each pair of summaries, the first summary is the correct reference summary, and the second summary is the unfaithfully edited summary that contains one of the seven error types in our taxonomy. We then ask the annotators to select one answer from the seven error types to indicate which type of error is introduced in the edited unfaithful summary. Only the annotators who answered 6 out of these 7 questions correctly passed the qualification task. We launched 3 batches in total with 9 assignments for each batch, and 9 annotators passed the qualification task. + +# A.2 Full Task + +The instructions and the task interface for the full task of Task 1 are shown in Figures A5 to A7. + +In the full task for Task 1, different from the qualification task, we ask the annotators to read a news article from CNN/DailyMail (Hermann et al., 2015) and one reference summary for the article. We then ask the annotators to edit the reference summary to introduce the error type specified through a minimal edit. If they cannot introduce the error type based on the reference summary, they can write "N/A" to indicate that it is impossible to introduce the specified error type based on the provided reference summary. There are 18 samples in Task 1 dataset that are annotated as "N/A" by the annotators, all of which are reviewed by the authors of this paper and re-annotated with the correct edits (we note that the required error types can be provided for all these cases) as a post-processing step to ensure the completeness of the dataset. + +In addition, for Task 1, to help reduce the confusion from annotators regarding Circumstance Errors and Entity Errors, we explicitly specify that the Circumstance Errors should only be erroneous edits concerning the time, duration, or location of + +an event, and changing the quantity of a noun is not considered as a Circumstance Error. + +# B Details of Task 2: Freestyle Unfaithful Summaries + +# B.1 Qualification Task + +The instructions and the task interface for the qualification task of Task 2 are shown in Figures A8 to A9. + +In this qualification task, all US-based annotators who did not participate in the qualification task of Task 1 are qualified to participate. Specifically, we show the annotators four pairs of news article and its summary from CNN/DailyMail, and ask them to answer if the summaries are faithful based on the original news articles. Among the four pairs, three of them are unfaithful and one is faithful. Only the annotators who answered correctly to all of these 4 pairs passed the qualification task. We launched 3 batches in total with 9 assignments for each batch, and 8 annotators passed the qualification task. + +# B.2 Full Task + +The instructions and the task interface for the full task of Task 2 are shown in Figures A10 to A11. + +In the full task of Task 2, unlike Task 1, we do not list any potential error types so as to achieve freestyle editing. The edited summary is valid as long as only one error is introduced based on the reference summary via a minimal edit. Furthermore, we also do the following to ensure the quality of edited summaries: + +- For minimal edits, we explicitly ask annotators not to write from scratch, but to introduce only one error on top of the given reference summary. +- In the pilot study, we notice that some edited summaries are simply removing/adding sentences or phrases (such data points are removed in the final released data); we, therefore, add additional instructions that require the edited and the reference summaries to contain a similar amount of information about the given news article (i.e., similar coverage). +- The edited summaries should be grammatically correct. +- The edited summaries should be plausible and adhere to common sense. + +- Some examples of edited summaries are given in the task instructions. + +# C ROC AUC Results from Other Benchmarks + +To compare BUMP with other benchmarks, we also report the ROC AUC scores from TRUE (Honovich et al., 2022). Specifically, in BUMP, faithful and unfaithful samples under each error type are balanced for both Tasks 1 and 2. Therefore, for a fair comparison, 1) in TRUE, we pick QAGSC (Wang et al., 2020), which is also a balanced dataset on CNN/DailyMail. The ROC AUC scores of QAGSC are reported in Table A1; 2) for faithfulness metrics in Table A1, we use the same implementation and model checkpoints in this paper as those in TRUE (Honovich et al., 2022). Then according to Table A1, the metric performance ranking in terms of ROC AUC for QAGSC is $Q^2 > \text{SUMMAC} > \text{BARTSCORE} > \text{FACTCC} > \text{BLEURT} > \text{BERTSCORE} > \text{QUESTVAL}$ , which is very different from the ranking derived from our BUMP dataset, e.g., SUMMAC exhibits worse ROC AUC than QUESTVAL for most error types in both Tasks 1 and 2 (see Table 5). + +In addition to the balanced dataset QAGS-C in TRUE, we also report the ROC AUC scores of imbalanced FRANK (Pagnoni et al., 2021) and SummEval (Fabbri et al., 2021) datasets (two datasets containing CNN/DailyMail) from TRUE in Table A1. Although the FRANK and SummEval datasets are imbalanced, we have similar observations as those from the QAGS-C dataset: 1) their ROC AUC scores (mostly $70 - 90\%$ ) are much larger than the ROC AUC scores $(50 - 70\%)$ derived from our BUMP dataset; 2) in terms of the ROC AUC ranking, the top two remain $Q^2$ and SUMMAC for both FRANK and SummEval, and SUMMAC always ranks higher than QUESTEVAL. By contrast, in Table 5, we show that SUMMAC mostly exhibits worse ROC AUC than QUESTEVAL. + +# Task Instructions + +This is a qualification task. Please read and follow the instructions carefully, you will be asked to copy a randomly generated code into one text box in the middle of the example. If you do not pass this test we may reject your response. + +In this task, you will read a news article and 7 pairs of summaries for the article. For each pair of summaries, the first summary is the correct reference summary, and the second summary is the unfaithful or erroneous edited summary that contains one of the following types of errors: + +1. Intrinsic Predicate Error +2. Extrinsic Predicate Error +3. Intrinsic Entity Error +4. Extrinsic Entity Error +5. Intrinsic Circumstance Error +6. Extrinsic Circumstance Error +7. Coreference Error + +A description of each error type, along with an example are shown in the table below. + +You will then select one correct answer from the 7 error types for each pair of summaries to indicate which type of error was introduced in the edited unfaithful or erroneous summary. Note: Punctuation errors should be ignored. For example, the additional white space before perid: . + +# A source article + +The first vaccine for Ebola was approved by the FDA in 2019 in the US, five years after the initial outbreak in 2014. To produce the vaccine, scientists had to sequence the DNA of Ebola, then identify possible vaccines, and finally show successful clinical trials. Scientists say a vaccine for COVID-19 is unlikely to be ready this year, although clinical trials have already started. + +# Intrinsic Predicate Error + +The predicate in the summary statement is inconsistent with the source article. AND +- The verb/event is either explicitly or implicitly mentioned in the source article. + +Example: The Ebola vaccine was produced by the FDA in 2019. + +# Extrinsic Predicate Error + +The predicate in the summary statement is inconsistent with the source article. AND +- The verb/event is NOT present in the source article. + +Example: The Ebola vaccine was rejected by the FDA in 2019. + +# Intrinsic Entity Error + +- The primary arguments (or their attributes) of the predicate are wrong. AND +- The wrong entities are present in the source article. + +Example: The COVID-19 vaccine was approved by the FDA in 2019. + +# Extrinsic Entity Error + +- The primary arguments (or their attributes) of the predicate are wrong. AND +- The wrong entities are NOT present in the source article. + +Example: The SARS vaccine was approved by the FDA in 2019. + +Figure A1: Screenshot of the qualification task for Task 1 (1/4). + +# Example + +Now you will review an example article and seven associated summaries. + +# Example article + +Ashley Young is finally feeling like a senior member of the Manchester United squad. The 29-year-old moved to Old Trafford in June 2011 from Aston Villa, but acknowledges it took time for him to come into his own at the club. Young now feels he has an important role under Louis van Gaal, and told ManUtd.com: 'I was looking around and thinking I was in the top six or seven who have been here the longest now. Whereas I used to say I was a youngster, now I can only say that by my name. Ashley Young is finally feeling like a senior member of the Manchester United squad under Louis van Gaal. The 29-year-old moved to Old Trafford in June 2011 from Aston Villa and feels he has a role to play at United. To be honest, a few of my team-mates have mentioned my name when they talk about characters and jokers and it's always nice to hear that. You have got to have good team spirit and we have got that here. We always have done. There are people who like to mess about and do different things in the dressing room. There are big characters in the dressing room and everyone gets on with everybody else. The team spirit we have got here is brilliant.' Young had to be patient but the winger says easing himself in was only natural when he had to meet his new team-mates and get used to a different dressing room. 'When I first came here, I knew a few of the lads from playing with them for England but I didn't really know what to expect,' Young added. 'When you settle in properly at a club, your character starts to come out more and more. With me, I'm always there or thereabouts when there is any mucking about or things going on in the dressing room.' Young acknowledges it took time for him to come into his own at the club but believes that is only natural. Young tries to beat Tottenham Hotspur goalkeeper Hugo Lloris to the ball during their Premier League match. Young feels he and Wayne Rooney (left) are among those that have had to share the responsibility. Being a senior member of the squad, Young feels he has had to share the responsibility with captain Wayne Rooney following the departures of Nemanja Vidic, Rio Ferdinand and Patrice Evra. 'When you've got Vida, Rio and Evra leaving, individuals who were not only big characters but captains, people have to step up and take over that mantle,' Young stated. 'It has definitely happened. You give out more advice and try to help the youngsters along but it's everybody's job really. Everybody chips in. 'We've got one captain but, when we're on the pitch, there are 11 captains and everyone wants to be pulling in the right direction and wanting to perform and do as we well as we can as a team. When you have got that on and off the pitch, it's great. + +# Example original summary + +Ashley Young joined Manchester United in June 2011 from Aston Villa . Young feels he has an important role to play under Louis van Gaal . He feels he and Wayne Rooney are among those that have taken on responsibility after Nemanja Vidic, Rio Ferdinand and Patrice Evra left . + +# Type of error 1 + +Intrinsic Predicate Error + +# Edited summary + +Ashley Young joined Manchester United in June 2011 from Aston Villa . Young feels he has an important role to play under Louis van Gaal . He feels he and Wayne Rooney are among those that have taken on responsibility after Nemanja Vidic, Rio Ferdinand and Patrice Evra joined . + +# Explanation + +The predicate Nemanja Vidic, Rio Ferdinand and Patrice Evra left in the original reference is changed to Nemanja Vidic, Rio Ferdinand and Patrice Evra joined'. 'join' is not explicitly present but implicitly mentioned (e.g., moved to) in the source article, so the edit introduces an Intrinsic Predicate Error. + +# Type of error 2 + +Extrinsic Predicate Error + +# Edited summary + +Ashley Young purchased Manchester United in June 2011 from Aston Villa . Young feels he has an important role to play under Louis van Gaal . He feels he and WayneRooney are among those that have taken on responsibility after Nemanja Vidic, Rio Ferdinand and Patrice Evra left . + +# Explanation + +The predicate 'Ashley Young purchased Manchester United' in the original reference is changed to 'Ashley Young joined Manchester United'. 'purchased' is not present in the source article, so the edit introduces an Extrinsic Predicate Error. + +Figure A2: Screenshot of the qualification task for Task 1 (2/4). + +# Task + +Read the article below and select the error type of the edited summary for the 7 pairs of summaries. + +# Article + +It may look like a misshapen disk of metal, but this coin is one of the oldest ever to be found in Britain. The tiny copper coin, which is smaller than a penny, dates from the Iron Age almost 2,300 years ago and suggests there were links between the south west of England and the Mediterranean. It was found in silt after the River Avon burst its banks between Bristol and Bath. The tiny copper coin, which is smaller than a penny, dates from the Iron Age almost 2,300 years ago and suggests there were links between the south west of England and the Mediterranean. On one side there is a horse's head, while the other bears the image of the goddess Tanit, the chief deity of Carthage. Experts have dated the coin to between 300 BC and 264 BC and say it came from the Western Mediterranean - probably Sardinia or ancient Carthage. The find suggests that the village of Saltford, where it was found, was on a major trade route long before Roman times. On one side of the coin there the image of the Goddess Tanit, the chief deity of Carthage, (pictured left) while on the reverse is a horse's head, pictured right. The find suggests that the village of Saltford (shown on the map with a red marker), where the coin was found, was on a major trade route long before Roman times. It is believed there was a ford in the area, which made it the only place to cross the river Avon at the time. One side of the coin shows an image of the Carthaginian goddess Tanit, suggesting links between the south west and the Mediterranean. The coin is thought to be the oldest dateable evidence of human activity found in Saltford and the West of England. It suggests Iron Age links between the Mediterranean and the Bristol Channel, which the River Avon flows into around 15 miles (24km) away. Professor David Mattingly, an archaeologist and Roman historian at the University of Leicester said: 'It's really interesting to have a Carthaginian coin in Britain. Suppose that coin was deposited close to its minting - at the time, there were no coins being used in Britain. It would have been quite alien to people. We are very sure that horses were important at the time so that may have invoked a lot of interest back then. It's a very interesting find.' Phil Harding of the Saltford Environment Group, said that the coin's significant because it is one of the oldest coins ever to be found in England. 'Only eight of these have ever been found, always on ancient trade routes,' he said. 'We can't believe it. We thought we would be writing the history of Saltford from the Roman times to now. But now we have to go back to the Iron Age. It's absolutely fantastic.' Last July a hoard of Roman and Late Iron Age coins were found in a cave in Dovedale in the Peak District, where they had lain undisturbed for 2,000 years. It was the first time that coins from the two separated groups have been found buried together. Archaeologists discovered 26 coins, including three Roman coins which pre-date the invasion of Britain in 43 AD, and 20 other gold and silver pieces which are Late Iron Age and thought to belong to the Corieltavi tribe. Last July a hoard of Roman and Late Iron Age coins (pictured) were found in a cave in Dovedale in the Peak District, where they had lain undisturbed for 2,000 years. National Trust archaeologist Rachael Hall said whoever owned the cache was probably a wealthy and influential figure. 'The coins would suggest a serious amount of wealth and power of the individual who owned them. 'Coins were used more as a symbol of power and status during the Late Iron Age, rather than for buying and selling staple foods and supplies. ...The situation of the cave can't be ignored either. Could it have been a sacred place to the Late Iron Age peoples that was taboo to enter in everyday life, making it a safe place that would ensure that person's valuables were protected?' + +# Summary Pair 1/7 + +# Reference Summary: + +Tiny copper coin is dated to the Iron Age, almost 2,300 years ago . It was found in Saltford between Bristol and Bath in South West England . Bears image of a horse's head and the Carthaginian goddess Tanit . Find suggests trading links between South West and the Mediterranean . + +# Edited Summary: + +Tiny copper coin is dated to the Iron Age, almost 3,200 years ago . It was found in Saltford between Bristol and Bath in South West England . Bears image of a horse's head and the Carthaginian goddess Tanit . Find suggests trading links between South West and the Mediterranean . + +Which of the following type of error is in the edited summary? + +Intrinsic Predicate Error + +Extrinsic Predicate Error + +Intrinsic Entity Error + +Extrinsic Entity Error + +Intrinsic Circumstance Error + +Extrinsic Circumstance Error + +$\bigcirc$ Coreference Error + +Figure A3: Screenshot of the qualification task for Task 1 (3/4). + +# Summary Pair 6/7 + +# Reference Summary: + +Tiny copper coin is dated to the Iron Age, almost 2,300 years ago . It was found in Saltford between Bristol and Bath in South West England . Bears image of a horse's head and the Carthaginian goddess Tanit . Find suggests trading links between South West and the Mediterranean . + +# Edited Summary: + +Tiny copper coin is dated to the Iron Age, almost 2,300 years ago . He was found in Salford between Bristol and Bath in South West England . Bears image of a horse's head and the Carthaginian goddess Tanit . Find suggests trading links between South West and the Mediterranean . + +Which of the following type of error is in the edited summary? + +Intrinsic Predicate Error + +Extrinsic Predicate Error + +Intrinsic Entity Error + +Extrinsic Entity Error + +$\bigcirc$ Intrinsic Circumstance Error + +Extrinsic Circumstance Error + +Coreference Error + +# Summary Pair 7/7 + +# Reference Summary: + +Tiny copper coin is dated to the Iron Age, almost 2,300 years ago . It was found in Saltford between Bristol and Bath in South West England . Bears image of a horse's head and the Carthaginian goddess Tanit . Find suggests trading links between South West and the Mediterranean . + +# Edited Summary: + +Tiny copper coin is dated to the Iron Age, almost 2000 years ago . It was found in Saltford between Bristol and Bath in South West England . Bears image of a horse's head and the Carthaginian goddess Tanit . Find suggests trading links between South West and the Mediterranean . + +Which of the following type of error is in the edited summary? + +Intrinsic Predicate Error + +Extrinsic Predicate Error + +Intrinsic Entity Error + +Extrinsic Entity Error + +$\bigcirc$ Intrinsic Circumstance Error + +Extrinsic Circumstance Error + +Coreference Error + +Would you like to participate in our full annotation task if you pass this qualification test? + +Yes No + +Submit + +Figure A4: Screenshot of the qualification task for Task 1 (4/4). + +
Q2SUMMACBARTSCOREFACTCCBLEURTBERTSCOREQUESTEVAL
QAGS-C83.580.980.976.471.669.164.2
FRANK87.889.186.176.482.884.384.0
SummEval78.881.773.575.966.777.270.1
+ +Table A1: ROC AUC (%) of faithfulness evaluation metrics in TRUE (Honovich et al., 2022). All datasets contain CNN/DailyMail. Faithful and unfaithful samples in QAGS-C are balanced; however, in FRANK and SummEval, faithful and unfaithful samples are imbalanced. + +# Task Instructions + +Please read and follow the instructions carefully, you will be asked to copy a randomly generated code into one text box in the middle of the example. If you do not pass this test we may reject your response. + +Note: This full task is slightly different from the qualification task! In this task, you will read a news article and a reference summary for the article. After you finish reading, you will be asked to edit the reference summary to introduce one of the following types of errors: + +1. Intrinsic Predicate Error +2. Extrinsic Predicate Error +3. Intrinsic Entity Error +4. Extrinsic Entity Error +5. Intrinsic Circumstance Error +6. Extrinsic Circumstance Error +7. Coreference Error + +A description of each error type, along with an example are shown in the table below. + +Note: Punctuation errors should be ignored. For example, the additional white space before period: . + +# A source article + +The first vaccine for Ebola was approved by the FDA in 2019 in the US, five years after the initial outbreak in 2014. To produce the vaccine, scientists had to sequence the DNA of Ebola, then identify possible vaccines, and finally show successful clinical trials. Scientists say a vaccine for COVID-19 is unlikely to be ready this year, although clinical trials have already started. + +# Intrinsic Predicate Error + +- The predicate in the summary statement is inconsistent with the source article. AND +- The verb/event is either explicitly or implicitly mentioned in the source article. + +Example: The Ebola vaccine was produced by the FDA in 2019. + +# Extrinsic Predicate Error + +- The predicate in the summary statement is inconsistent with the source article. AND +- The verb/event is NOT present in the source article. + +Example: The Ebola vaccine was rejected by the FDA in 2019. + +# Intrinsic Entity Error + +- The primary arguments (or their attributes) of the predicate are wrong. AND +- The wrong entities are present in the source article. + +Example: The COVID-19 vaccine was approved by the FDA in 2019. + +# Extrinsic Entity Error + +The primary arguments (or their attributes) of the predicate are wrong. AND +- The wrong entities are NOT present in the source article. + +Example: The SARS vaccine was approved by the FDA in 2019. + +Figure A5: Screenshot of the full task for Task 1 (1/3). + +# Additional Instructions + +We observed some confusion about the distinction between Circumstance Errors and Entity Errors in the first round of results. + +To help improve the quality of annotations, we are narrowing the scope of Circumstance Errors. From now on, Circumstance Errors will only be errors concerning the time, duration, or location of an event. Changing the quantity of a Noun is NOT a Circumstance Error. + +For example, consider the sentence: + +The Rams won the Super Bowl in Los Angeles last February. + +The core event is "The Rams won the Super Bowl" and there are two pieces of circumstantial information: + +The time when the event happened - "last February +- The location where the event happened - "in Los Angeles" + +To introduce a circumstance error, either of these two pieces of information could be changed, or a new wrong piece of information about the time, duration, or location of the event could be added. Again, changing the quantity of a Noun is NOT a Circumstance Error. + +Here are some examples of edits that introduce a circumstance error to this summary: + +Edits that introduce Circumstance Errors (i.e., good submissions) + +
Edited TextExplanation
The Rams won the Super Bowl in Los Angeles last March.The existing time when the event happened was changed.
The Rams won the Super Bowl in San Francisco last February.The existing location where the event happened was changed.
The Rams won the Super Bowl away from Los Angeles last February.Another example where the location where the event happened was changed by changing the preposition ‘in’ to ‘away from’. This example illustrates that not all circumstance errors need to involve nouns.
The Rams won the Super Bowl over the course of a week in Los Angeles last February.New incorrect information about the duration of the event was added.
+ +Edits that DO NOT introduce Circumstance Errors (i.e., bad submissions) + +
Edited TextExplanation
The Tigers won the Super Bowl in Los Angeles last February.Here the subject of the sentence was changed. THIS IS AN ENTITY ERROR NOT A CIRCUMSTANCE ERROR.
The Rams lost the Super Bowl in Los Angeles last February.Here the predicate of the sentence was changed. THIS IS A PREDICATE ERROR NOT A CIRCUMSTANCE ERROR.
The Rams won the Super Bowl.Here the existing circumstantial information was removed. THIS IS NOT AN ERROR.
The Rams won the Super Bowl for their fans in Los Angeles last February.Here new information was added that does not pertain to the time, duration, or location of the event. UNDER THE NEW SET OF GUIDELINES CIRCUMSTANCE ERRORS CAN ONLY BE ABOUT THE TIME, DURATION, OR LOCATION OF AN EVENT, SO THIS IS NOT A CIRCUMSTANCE ERROR.
+ +Figure A6: Screenshot of the full task for Task 1 (2/3). + +In addition, regarding Intrinsic Errors and Extrinsic Errors: + +Extrinsic Error means the incorrect information is NEITHER explicitly NOR implicitly mentioned in the source article. + +While Intrinsic Error means the opposite, i.e. the incorrect information is EITHER explicitly OR implicitly mentioned in the source article. + +# Additional Criteria + +Please ensure that the text remains fluent after editing. Text that contains grammatical errors or other disfluencies may result in disqualification. + +Please also try to ensure that the introduced error is plausible and adheres to common sense. For instance, in the example description of the extrinsic predicate error above, the predicate "rejected" is plausible, since the FDA is responsible for approving and rejecting vaccines. Meanwhile, predicates such as the word "eaten" would be implausible, as the FDA is not a living organism and does not eat things. Edits that are consistently implausible may also result in disqualification. + +In the unlikely event that it is extremely difficult to introduce a required error type by editing the given reference summary, you could write 'N/A'. However, responding 'N/A' to error types that can be introduced by editing reference summaries may result in disqualification. + +# Task + +Read the article below and edit the reference summary to introduce the error type listed below. + +# Article + +$(article) + +# Reference Summary + +\\(reference_summary + +# Required Error Type + +${error_type} + +# Edited Summary + +Please enter your edited summary + +Submit + +Figure A7: Screenshot of the full task for Task 1 (3/3). + +# Task Instructions + +This is a qualification task. Please read and follow the instructions carefully, you will be asked to copy a randomly generated code into one text box in the middle of the example. If you do not pass the test question, we may reject your response. You are qualified for the full task only if ALL your answers to the questions in this test are correct. + +In this task, you will read four news articles and a summary for each of these four articles. For each summary of a given article, it may or may not contain inaccuracy errors. An inaccuracy error could be anything that is unfaithful to the original article in the sense that it contains anything that is not mentioned in the article or contradicts something in the article. Note that even if the summary is true according to your knowledge, as long as it is not mentioned in the article, the summary is regarded as containing inaccuracy errors. + +An article with a list of summaries with inaccuracy errors together with some explanations on why they are inaccurate are shown in the table below. + +You will then determine if the summary for the given article is accurate or not by selecting Yes or No. + +Note: Punctuation errors should be ignored. For example, the additional white space before perid: . + +# A source article + +The first vaccine for Ebola was approved by the FDA in 2019 in the US, five years after the initial outbreak in 2014. To produce the vaccine, scientists had to sequence the DNA of Ebola, then identify possible vaccines, and finally show successful clinical trials. Scientists say a vaccine for COVID-19 is unlikely to be ready this year, although clinical trials have already started. + +# Inaccurate summary 1 + +The Ebola vaccine was produced by the FDA in 2019, but COVID-19 vaccine is unlikely to be ready this year. + +# Explanation + +The Ebola vaccine was approved by the FDA, not produced by the FDA. + +# Inaccurate summary 2 + +The Ebola vaccine was approved by the FDA in 2019, but COVID-19 vaccine has not started clinical trials yet. + +# Explanation + +The statement on COVID-19 vaccine is unfaithful, because its clinical trials have already started. + +# Checkpoint: + +Please copy and paste the following code into the text box: + +48a969ef-7eec-49b6-bb98-cb7f51489137 + +Copy/Paste the code above. + +# Inaccurate summary 3 + +COVID-19 is unlikely to be ready in 2019, which gives more time to the FDA to finally approve the Ebola vaccine. + +# Explanation + +Error in how multiple statements are linked together. Slow process in COVID-19 vaccine does not lead to the approval of Ebola. + +Figure A8: Screenshot of the qualification task for Task 2 (1/2). + +# Task + +Read the articles below and answer if each summary is accurate or not. + +# Article 1 + +Cn) The t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t + +# Summary 1 + +The CDC says "the risk to humans is low," but, as always, they are preparing for the worst case. You can't get bird flu from eating poultry or eggs. At least 100 people who worked with the sick birds are being quarantined for any sign of sickness. So far 3.5 million birds have been + +authanized. + +Is the summary accurate? + +Yes No + +# Article 2 + +CnnAs the model for Noran Rockwell s "Roeiver, Mory Doyle Kefe became the symbol of American women working on the home front during World War II. The 92-year-old died this week at her home in Simabury, Connecticut. As a 19-year- telephone operator, Keefe posed for the famous painting that would become the cover of the Saturday Evening Post on May 29, 1943. Although she was petite, Kefe was transformed into the iconic -- and burly -- embodiment of the character by Rockwell. Other than the red hair and my face, Norman Rockwell embellished Roesie's body," Kefe said in a 2012 interview with the Hartford Courant. "I was much smaller than that and did not know how he was going to make me look like that until I saw the finished painting." People we've lost in 2015. Kefe pocketed $10 for the two months of modeling work she did in Arlington, Vermont. Rockwell lived in neighboring West Arlington at the time. "Roeiver is often confused with another popular image from the same era. The poster shows a woman flexing her arm under the slogan "We Can Do It." It was part of a nationwide campaign to sell war bonds, but is not the same character. Still, many folks on social media paid tribute to Kefe using the image. Both show the key role women played in the war effort. + +# Summary 2 + +Rosie the Riveter* appeared on the cover of the Saturday Evening Post on May 29, 1943. Mary Doyle Keefe was a 19-year-old telephone operator at the time. + +Is the summary accurate? + +Yes No + +# Article 3 + +h t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t 0 + +# Summary 3 + +Chinese property conglomerate Dalian Wanda bought 20 percent of Atletico Madrid for £32.8m . Deal was announced in February but ratified after two EGMs . Dalian Wanda hopes the deal will develop the club in Asia . + +Is the summary accurate? + +OYesONo + +# Article 4 + +upmarket Bentleys and Porsches are more likely to break down than much cheaper cars, according to a survey. The two marques finished bottom of a 38-strong table of vehicle manufacturers judged on reliability. Scroll down for video . Reliability: Bentleys and Porsches are more likely to break down than cheaper cars according to a survey . The list price of Bentleys ranges from £136,250 to £224,700, yet the manufacturer and Porsche finished bottom of a 38-strong table judged on reliability . Thousands of cars aged three to eight years old were assessed on their failure rate, age, mileage and cost of repairs. The most reliable was Honda, with Suzuki second and Toyota in third place while Chevrolet and Mazda were joint fourth. Overall, the most reliable models were the Honda Jazz and Mitsubishi Lancer while the least reliable was the Audi RS6, which was also the most costly to fix, with an average repair bill of £1,003. Electrical faults were the most common across all cars, accounting for almost a quarter of visits to garages. Axle and suspension faults were also common, affecting $22\%$ of cars. What Car? magazine compiled the table with the Warranty Direct website. What Car? editor Jim Holder said: 'Honda's success in the reliability index is chiefly down to low failure rates. But, when things do go wrong, the cars are also relatively cheap to fix. Reliability is always one of the key attributes buyers look for when considering a used car purchase, so manufacturers that consistently demonstrate durability will always do well with the consumer.' The list price of Bentleys ranges from £136,250 to £224,700. + +# Summary 4 + +Bentleys and Porsches finished bottom of the reliability table of manufacturers . Cars were assessed on their failure rate , age , mileage and cost of repairs . Most reliable was Honda , with Toyota second and Suzuki in third place . + +Is the summary accurate? + +Yes No + +Would you like to participate in our full annotation task if you pass this qualification test? + +Yes No + +Submit + +Figure A9: Screenshot of the qualification task for Task 2 (2/2). + +# Task Instructions + +Please follow the instructions carefully; we will review your HITs periodically and if we note any unusual responses you may be disqualified for future tasks. In addition, you will be asked to copy a randomly generated code into one text box in the middle of the example. If you do not pass this test, we may reject your response. + +Note: This full task is slightly different from the qualification task! In this task, you will read a news article and a reference summary for the article. The given reference summary is coherent, accurate, and has good coverage of the news article. After you finish reading, you will be asked to edit the reference summary to introduce ONE inaccuracy error. An inaccuracy error could be anything that is unfaithful to the original article in the sense that your edited summary contains anything that is not mentioned in the article or contradicts something in the article. Note that even if your edited summary is true according to your knowledge, as long as it is not mentioned in the article, the edited summary is regarded as containing inaccuracy errors. + +Note: There are NO constraints on how inaccuracy errors are generated in this task. Please DO NOT limit your type of edits to the examples shown below. In addition, punctuation errors in the reference summary should be ignored. For example, the additional white space before period: . + +# ADDITIONAL INSTRUCTIONS: + +Please do NOT write a summary from scratch, but make just ONE erroneous edit on top of the given summary. The edited summary with ONE inaccuracy error and the given summary should then contain similar amount of information about the article. + +In the following example, we present a source article, its reference summary, and a list of edited summaries with inaccuracy errors together with some explanations on why they are inaccurate. + +# A source article + +The first vaccine for Ebola was approved by the FDA in 2019 in the US, five years after the initial outbreak in 2014. To produce the vaccine, scientists had to sequence the DNA of Ebola, then identify possible vaccines, and finally show successful clinical trials. Scientists say a vaccine for COVID-19 is unlikely to be ready this year, although clinical trials have already started. + +# Original summary + +The Ebola vaccine was approved by the FDA in 2019, but COVID-19 vaccine is unlikely to be ready this year. + +Figure A10: Screenshot of the full task for Task 2 (1/2). + +# Edited summary + +The Ebola vaccine was produced by the FDA in 2019, but COVID-19 vaccine is unlikely to be ready this year. + +# Explanation + +The Ebola vaccine was approved by the FDA, not produced by the FDA. + +# Edited summary + +The Ebola vaccine was approved by the FDA in 2019, but COVID-19 vaccine has not started clinical trials yet. + +# Explanation + +The statement on COVID-19 vaccine is unfaithful, because its clinical trials have already started. + +Please copy and paste the following code into the textbox: + +${bot_check_code} + +Copy/paste the code above + +# Additional Criteria + +Please ensure that the text remains fluent after editing. Text that contains grammatical errors or other disfluencies may result in disqualification. + +Please also try to ensure that the introduced error is plausible and adheres to common sense. For instance, in the example above, given an edit "The Ebola vaccine was rejected by the FDA", the predicate "rejected" is plausible, since the FDA is responsible for approving and rejecting vaccines. Meanwhile, predicates such as the word "eaten" would be implausible, as the FDA is not a living organism and does not eat things. Edits that are consistently implausible may also result in disqualification. + +# Task + +Article + +${article} + +Original Summary + +{$reference_summary} + +# Edited Summary + +Please enter your edited summary + +Submit + +Figure A11: Screenshot of the full task for Task 2 (2/2). + +A For every submission: + +A1. Did you describe the limitations of your work? + +In the Limitations section + +A2. Did you discuss any potential risks of your work? + +In the section of Ethics Statement + +A3. Do the abstract and introduction summarize the paper's main claims? + +Abstract and Section 1 + +A4. Have you used AI writing assistants when working on this paper? + +Left blank. + +B Did you use or create scientific artifacts? + +Section 3 + +B1. Did you cite the creators of artifacts you used? + +Section 3.1 + +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? + +CNN/DailyMail is distributed under the MIT license. We plan on releasing our dataset under the MIT license as well pending legal approval. The LICENSE will be provided alongside the dataset as a text file on GitHub when the paper is published. + +UPDATE AFTER REVIEW: We recently learned that the data we were using is distributed under an Apache 2.0 license instead of MIT. + +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +CNN/DailyMail is distributed under the MIT license. Our BUMP dataset is derived from CNN/DailyMail. + +We plan on releasing BUMP under the MIT license as well pending legal approval. The LICENSE will be provided alongside the dataset as a text file on GitHub when the paper is published. Therefore, the data collection and distribution of BUMP is consistent with the license in CNN/DailyMail. + +UPDATE AFTER REVIEW: We recently learned that the data we were using is distributed under an Apache 2.0 license instead of MIT. + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? + +We manually checked all collected human annotations; see Section 3.2 and 3.3 + +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? + +Section 3, and Appendix A and B + +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. + +Table 2 and its descriptions in Section 3.2 and 3.3 + +The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance. + +# C Did you run computational experiments? + +Section 4 and 5 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +Not applicable. Left blank. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +Not applicable. Left blank. + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +Section 5 + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +Section 4.1 + +# D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Section 3 + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +Section 3, Appendix A and B + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +Section of Ethics Statement, and Appendix A.1 and B.1 + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +The BUMP dataset is derived from CNN/DM. Attribution is provided in Section 3.1. Since CNN/DM is distributed under the MIT license (which allows modifications), we did not discuss with annotators on how their modified summaries will be used. + +UPDATE AFTER REVIEW: We recently learned that the data we were using is distributed under an Apache 2.0 license instead of MIT. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +We used a review process internal to our organization with HCI research scientists. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +Appendix A.1 and B.1 \ No newline at end of file diff --git a/bumpabenchmarkofunfaithfulminimalpairsformetaevaluationoffaithfulnessmetrics/images.zip b/bumpabenchmarkofunfaithfulminimalpairsformetaevaluationoffaithfulnessmetrics/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..f1924d014e8c6573fec87d0ab90411ef85df8747 --- /dev/null +++ b/bumpabenchmarkofunfaithfulminimalpairsformetaevaluationoffaithfulnessmetrics/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:09e0e34c6b962813c9d91f4198a04cd2275ab3c1e7bb59e13c5f5cb651d7e664 +size 730077 diff --git a/bumpabenchmarkofunfaithfulminimalpairsformetaevaluationoffaithfulnessmetrics/layout.json b/bumpabenchmarkofunfaithfulminimalpairsformetaevaluationoffaithfulnessmetrics/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..2c04f4991b29cbb7f352f28d914ebdd091898868 --- /dev/null +++ b/bumpabenchmarkofunfaithfulminimalpairsformetaevaluationoffaithfulnessmetrics/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f9d27a396a9a33dc4bc1ef36bd4e65f37c0397efce2819463483230f82dbd2b2 +size 721433 diff --git a/bygpt5endtoendstyleconditionedpoetrygenerationwithtokenfreelanguagemodels/47cbf29e-c9a0-45a6-8457-bc1d7f1fd727_content_list.json b/bygpt5endtoendstyleconditionedpoetrygenerationwithtokenfreelanguagemodels/47cbf29e-c9a0-45a6-8457-bc1d7f1fd727_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..f70e3fecc0bceee7c38ae748bb00d97c3524a812 --- /dev/null +++ b/bygpt5endtoendstyleconditionedpoetrygenerationwithtokenfreelanguagemodels/47cbf29e-c9a0-45a6-8457-bc1d7f1fd727_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:397e0740d51dd661b48eac7c01a70f195d69e7c426d635eeca817512d7d71456 +size 115518 diff --git a/bygpt5endtoendstyleconditionedpoetrygenerationwithtokenfreelanguagemodels/47cbf29e-c9a0-45a6-8457-bc1d7f1fd727_model.json b/bygpt5endtoendstyleconditionedpoetrygenerationwithtokenfreelanguagemodels/47cbf29e-c9a0-45a6-8457-bc1d7f1fd727_model.json new file mode 100644 index 0000000000000000000000000000000000000000..8c1ec9617686d673eb9d61635e62690401d3a0b9 --- /dev/null +++ b/bygpt5endtoendstyleconditionedpoetrygenerationwithtokenfreelanguagemodels/47cbf29e-c9a0-45a6-8457-bc1d7f1fd727_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:95a7945e47fea3ec48456db23aec7d313712930f14e980cefd0f9667b3f2a028 +size 143577 diff --git a/bygpt5endtoendstyleconditionedpoetrygenerationwithtokenfreelanguagemodels/47cbf29e-c9a0-45a6-8457-bc1d7f1fd727_origin.pdf b/bygpt5endtoendstyleconditionedpoetrygenerationwithtokenfreelanguagemodels/47cbf29e-c9a0-45a6-8457-bc1d7f1fd727_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..82e765637180f177a6be508fd23b4d507d3cb35c --- /dev/null +++ b/bygpt5endtoendstyleconditionedpoetrygenerationwithtokenfreelanguagemodels/47cbf29e-c9a0-45a6-8457-bc1d7f1fd727_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e7eccc7872f80aa1f2713d36a60f813bc1f44102117b9e4c6d1c58459f3a91f +size 2174620 diff --git a/bygpt5endtoendstyleconditionedpoetrygenerationwithtokenfreelanguagemodels/full.md b/bygpt5endtoendstyleconditionedpoetrygenerationwithtokenfreelanguagemodels/full.md new file mode 100644 index 0000000000000000000000000000000000000000..9e41e8bc1b5982e918a52fbc1f4742dace389bc4 --- /dev/null +++ b/bygpt5endtoendstyleconditionedpoetrygenerationwithtokenfreelanguagemodels/full.md @@ -0,0 +1,449 @@ +# ByGPT5: End-to-End Style-conditioned Poetry Generation with Token-free Language Models + +Jonas Belouadi + +jonas.belouadi@uni-bielefeld.de + +Steffen Eger + +steffen.eger@uni-bielefeld.de + +Natural Language Learning Group (NLLG) + +Faculty of Technology, Bielefeld University + +n12g.github.io + +# Abstract + +State-of-the-art poetry generation systems are often complex. They either consist of task-specific model pipelines, incorporate prior knowledge in the form of manually created constraints, or both. In contrast, end-to-end models would not suffer from the overhead of having to model prior knowledge and could learn the nuances of poetry from data alone, reducing the degree of human supervision required. In this work, we investigate end-to-end poetry generation conditioned on styles such as rhyme, meter, and alliteration. We identify and address lack of training data and mismatching tokenization algorithms as possible limitations of past attempts. In particular, we successfully pre-train ByGPT5, a new token-free decoder-only language model, and fine-tune it on a large custom corpus of English and German quatrains annotated with our styles. We show that ByGPT5 outperforms other models such as MT5, ByT5, GPT-2 and CHATGPT, while also being more parameter efficient and performing favorably compared to humans. In addition, we analyze its runtime performance and demonstrate that it is not prone to memorization. We make our code, models, and datasets publicly available. $^{1}$ + +# 1 Introduction + +End-to-end fine-tuning of pre-trained language models like GPT-2 (Radford et al., 2019) or T5 (Raffel et al., 2020a) on downstream tasks has been an immensely popular training paradigm for text-generation in the last few years (Li et al., 2021). End-to-end models learn to complete a task by directly learning all steps, without intermediary algorithms such as hand-crafted rules or post-processing. This approach has proven to be highly effective on a wide range of problems such as dialog generation (Sun et al., 2022; Yang et al., 2021), summarization (Zhu et al., 2021; Zhong et al., 2021; Huang et al., 2021), and machine translation (Farinha et al., 2022; Tran + +The sweet wild strain, the sudden start, A + +Which shakes the perfumed altar's flame, B + +To make its shrine a sacred name, + +And sing its praise in every heart. A + +—ByGPT5 + +Figure 1: Generated quatron with ABBA rhyme scheme, high amount of alliterations (green), and iambic meter, i.e., unstressed syllable $(\sim)$ follows stressed syllable $(-)$ . + +et al., 2020). Nevertheless, all these applications have in common that they only concern themselves with the generation of prosaic texts. Generating formal verse poetry on the other hand, with strict constraints on aesthetic style such as rhyme scheme, meter and alliteration, remains a difficult problem. Attempts to employ end-to-end solutions in this context have so far been unsuccessful (Wöckener et al., 2021), with some authors even concluding that language models cannot pick up such constraints from data alone (Popescu-Belis et al., 2022). As a consequence, state-of-the-art poetry generation systems rely on human guidance by (i) injecting prior knowledge2 in the form of hard-coded constraints to filter model outputs or modify probability distributions or (ii) breaking the whole process down into sophisticated task-specific model pipelines. + +Tian and Peng (2022), for example, propose a sonnet generation framework with four distinct pipeline steps: content planning, rhyme pairs generation, polishing for aesthetics, and finally sketch-to-sonnet generation. Further, they incorporate prior knowledge such as pronunciation dictionaries, knowledge bases, and lexically constrained decoding. Similarly, Hopkins and Kiela (2017) use Weighted Finite State Transducers to monitor whether their poetry generation system meets metric constraints and roll + +back its state in case of a violation. + +Such forms of human supervision lead to ramifications that an end-to-end solution would not face. Pipelines are susceptible to errors in early modules that propagate and are amplified in subsequent modules; an effect known as cascading of errors (Castro Ferreira et al., 2019). Similarly, incorporating prior knowledge depends on the cleverness and intent of the modeler and generally becomes more difficult when heterogeneous constraints are involved or the number of constraints increases (Garbacea and Mei, 2022). Furthermore, standard text-generation architectures do not lend themselves well for manually applying constraints. Due to the autoregressive generation of tokens from left to right, constraints at arbitrary positions cannot be implemented easily or only with additional trade-offs (Garbacea and Mei, 2022). For example, end rhymes, which come at the end of a verse, cannot be constrained in isolation due dependencies on previously generated tokens. A commonly applied work-around for this problem is to generate each verse in reverse (Lau et al., 2018; Jhamtani et al., 2019; Van de Cruys, 2020; Xue et al., 2021a). + +In this work, we thus aim to reduce the amount of human supervision in poetry generation and explore viable end-to-end solutions. We hypothesize that failing to do so far has the following root causes: (i) lack of available training data. Poetry corpora labeled with aesthetic styles are few and far between and we speculate that they do not suffice to train a generalized model. (ii) Unfavorable tokenization algorithms. Aesthetic styles of poetry such as rhyme, meter, and alliteration are often expressed at the character-level while most available off-the-shelf pre-trained models operate at the subword-level (Kudo and Richardson, 2018). Xue et al. (2022) showed that character-level models (also known as token-free models) excel at other character-level tasks so we assume that they would perform similarly well at poetry generation. Our key contributions are as follows: + +(i) We pre-train ByGPT5, to our knowledge the first decoder-only transformer for character-level language modeling. +(ii) We create QUATRAIN, a large machine-labeled poetry corpus of quatrains in German and English. +(iii) By fine-tuning ByGPT5 on QUATRAIN, we show that it learns character-level styles better + +than subword-based systems, such as GPT-2 and mT5, as well as other token-free models like ByT5, while being more parameter efficient and also faring well compared to humans. + +(iv) We further demonstrate that ByGPT5 exhibits few memorization problems, understands poetry better than GPT-2 and CHATGPT, and also performs well on tasks that do not operate at the character-level. + +# 2 Background + +In formal verse poetry, poems have to follow strict patterns and rules of language which we term styles. Our goal is to train an end-to-end poetry generation system which learns to adhere to specified styles by itself. We refer to this as style-conditioned poetry generation. In our work, we focus on generating quatrains and conditioning on the following defining styles of formal verse poetry (cf. Figure 1): + +Rhyme A rhyme is the repetition of the same or similar sounds in the final accented syllables of words, which must be preceded by differing consonants (Harmon et al., 2000). If all conditions are met, we speak of perfect rhymes, and if some of them are violated, for example, because the final sounds are different or the words are identical, we speak of imperfect rhymes. In a quatrain with ABAB rhyme scheme, the first and third line endings rhyme, as do the second and fourth lines. + +Meter Meter refers to the rhythmic pattern within a verse. In modern poetry, this rhythm is usually accented-syllabic, that is, the succession of stressed $(-)$ and unstressed syllables $(\cup)$ occurs at regular intervals (Harmon et al., 2000). The rhythmic unit is also known as a foot and the meter of a verse can thus be described as a sequence of feet. In English poetry, common feet are iambic $(\cup -)$ , trochaic $(-\cup)$ , anapestic $(\cup \cup -)$ , and dactylic $(-\cup \cup)$ . For conditioning on meter, we consider all metric feet appearing in our datasets (cf. Appendix A). + +Alliteration Harmon et al. (2000) define alliteration as the repetition of the same consonant sounds or any vowel sounds at the beginning of words or syllables that are close together in a verse. In formal verse, alliteration is secondary to rhyme and meter, follows less strict constraints, and is therefore not as easily classified. In this work, we thus consider the level of alliteration instead, which we classify as either low, medium, or high (cf. §5). + +
NameSizeParamsEnc/DecToken-free
ByGPT5small73.5mDecoder✓
base139.2mDecoder✓
medium289.1mDecoder✓
GPT-2base124.4mDecoderX
medium354.8mDecoderX
ByT5small300mEnc-Dec✓
MT5small300mEnc-DecX
+ +Table 1: Pre-trained models we fine-tune. ByGPT5 is a new model developed by us. The German GPT-2 model we use does not exist in medium size Minixhofer (2020), which is why we only use a base model there. + +# 3 Models + +We induce a range of end-to-end poetry generation systems for English and German by fine-tuning pretrained transformer models (Vaswani et al., 2017). For conditioning on style, we consider two architectural variants—encoder-decoder transformers (Xue et al., 2021b, 2022) and decoder-only transformers (Radford et al., 2019; Brown et al., 2020). As explained in §1, we focus on token-free models, but also consider subword-level models for comparison. We do not experiment with models with more than 400 million parameters since they exceed the capacity of our available GPU resources. + +Encoder-Decoder For encoder-decoder models, we initialize the encoder with a joint triple of rhyme scheme, meter, and, alliteration level and generate a quatrain with the decoder. We represent each style by a special token which we add to the model vocabulary. We use ByT5 (Xue et al., 2022), a token-free pre-trained encoder-decoder model, as a baseline. For comparison with subword-level approaches, we fine-tune mT5 (Xue et al., 2021b). + +Decoder-only As the input for encoder-decoder models is a relatively short sequence of styles, this could lead to an underutilization of the encoder. We thus hypothesize that a decoder-only model, with styles supplied as a prompt string, would be better suited for our task. On the subword-level, multiple models, such as GPT-2 (Radford et al., 2019), are readily available. However, to our best knowledge, no such model exists at the character-level yet, which is why we train our own. Since our new model shares some similarities with the GPT family of models, but has its origin in ByT5 (see §4), we refer to it as ByGPT5. An overview of all models we use can be seen in Table 1. + +![](images/1a84e6318c18b1bc091815d853daafadf7aef1b9093a0554fc0c3aa6cd97614d.jpg) +Figure 2: Perplexity on the training data when pretraining ByGPT5 for English and German. + +# 4 ByGPT5 + +For pre-training our own token-free decoder-only model ByGPT5, we start by modifying the architecture of ByT5 and discard its encoder component. We then initialize the weights with the decoder of $\mathrm{ByT5^3}$ to warm-start the training process (Rothe et al., 2020; Tang et al., 2022). We repeat this for the three smallest variants of ByT5. Because ByT5 has an asymmetrical architecture, the resulting models retain only $25\%$ of its parameters. We refer to their model sizes as small, base, and medium. + +As training data, we use OPENWEBTEXT2 (Gao et al., 2021) for English and cc100 (Conneau et al., 2020) for German. For hyper-parameters, we follow Radford et al. (2019) and Brown et al. (2020) and use Adam with a weight decay of 0.1, a batch size of 512, varying learning rates depending on model size, and train on a causal language modeling objective for 50k steps following Lester et al. (2021). We provide loss curves in Figure 2. As might be expected, the perplexity of larger models is generally lower than that of smaller counterparts. + +# 5 Datasets + +We collect a range of labeled and unlabeled datasets of English and German poetry (cf. Table 2). As shown, we were able to procure labeled corpora for rhyme and meter, but they are far too small to train a poetry generation system. Instead, we use the bigger unlabeled corpora, as training data, by labeling them automatically (Belouadi and Eger, 2023). To make full use of the data, we use not only real quatrains but also pseudo-quatrains (any consecutive sequence + +
DatasetLanguageVersesRMA
EPG64English1k✓✓✗
PROSODICEnglish2k✗✓✗
FORBEnglish1k✓✓✗
CHICAGOEnglish95k✓✗✗
ANTI-KGerman4k✓✓✗
GRCGerman41k✓✗✗
EPGEnglish2.8m✗✗✗
DLKGerman2.8m✗✗✗
QUATRAINEnglish2.7m*✓†✓†✓†
German5.9m*✓†✓†✓†
+ +* Verses may occur in multiple pseudo-quatrains. +$\dagger$ Labels are obtained from classifiers. + +Table 2: Available poetry datasets for rhyme (R), meter (M), and alliteration (A). Unlabeled corpora (middle) are orders of magnitude larger than labeled corpora (top), and we label them automatically (bottom). Further information can be found in Appendix A. + +of four lines), amounting to over 660k quatrains for English and $1.4\mathrm{m}$ for German. We refer to this new dataset as QUATRAIN, with further statistics in Appendix A. In the following, we explain the labeling process for each style. + +For automatically labeling rhyme and meter, we leverage the available labeled data and train a range of classifiers. We evaluate them on held-out gold data and subsequently use the best performing classifier for each style (cf. Appendix A). Meter classification is a multiclass classification problem with a single verse as input, while rhyme classification is a binary classification problem with two verses separated by a special token as input. We classify the meter of a quatrain by choosing the dominant meter among the verses4, and the rhyme scheme by determining which verses rhyme and which do not. + +As no readily available poetry datasets include labels for alliteration, we approach the problem in a different way. The quantification of the level of alliteration in a document is a long known research problem (Skinner, 1939; Leavitt, 1976; Blain, 1987; Benner, 2014). Let $\nu_{i}$ be the atomic units of sound in verse $\nu$ , Blain (1987) quantify alliteration as + +$$ +\operatorname {a l l i t} (v) = \frac {\sum_ {i = 1} ^ {| v |} \sum_ {j = i + 1} ^ {| v |} \frac {\mathrm {f} \left(v _ {i} , v _ {j}\right)}{j - i}}{\sum_ {i = 1} ^ {| v |} \sum_ {j = i + 1} ^ {| v |} \frac {1}{j - i}}, \tag {1} +$$ + +where $\mathrm{f}(\cdot)$ is a similarity function of two sounds; the default simply testing for equality. Intuitively, allit( $\cdot$ ) counts alliterative sounds in a verse, applies + +a distance penalty, and normalizes the score to [0, 1]. To get a score for quatrains, we average the alliteration level of all verses. We consider initial phonemes of words, as well as all further stressed phonemes as atomic sound units $\nu_{i}$ , and to determine phonemes and stress, we use a grapheme-to-phoneme conversion model (Zhu et al., 2022). Further, we conduct an internal study to determine several intensity thresholds based on a sample of quatrains. We classify the alliteration level of a quatron as low if the score is below 0.05, medium if the score is below 0.1, and high if it is above that. + +# 6 Experiments + +For fine-tuning, we use the same hyperparameters as in §4 for all models, but reduce the batch size to 128 (for efficiency reasons). We induce separate models for each language in QUATRAIN and train for 10 epochs. We conduct both automatic (§6.1) and human evaluation (§6.2). Examples of generated quatrains can be found in Appendix D. + +# 6.1 Automatic Evaluation + +For automatic evaluation, we select four common rhyme schemes (AABB, ABAB, ABBA, and ABCB), the most popular meters per language (iambus, trochee, anapest, and dactyl for English; iambus, trochee, and alexandrine for German), and all levels of alliteration to create 75 poems per model for each possible combination. To find out if styles are properly reflected in generated quatrains we reuse the classifiers from §5, i.e., we use them to classify the generated poems and see if the styles match. We define the following metrics: + +Rhyme Score computes the recall of verses that should rhyme in a quatrain, as well as the recall of verses that should not and takes their arithmetic average. + +Alliteration Score is 1 if a quatrain has the correct alliteration level, else 0. + +Meter Score is the fraction of verses with correctly classified meters. + +Coherence uses BERT for next sentence prediction (Devlin et al., 2019) to assess discourse relations of verses (Duari and Bhatnagar, 2021; Shi and Demberg, 2019). The score is the fraction of consecutive verse pairs that are correctly classified to come after one another. + +![](images/2ae9a206f720769ab4f780b466c0d5fd5c1ee7aa19ec5edff9bbdf172e04a600.jpg) +Figure 3: Automatic evaluation results for all models on English and German. + +![](images/4e002f8ddeaba15a95dbd52cad9d305c884e69d70ac82df94ff07b39b5ceea14.jpg) + +We provide the scores for each model averaged over all generated quatrains (2700 for German and 3600 for English) in Figure 3. Although all models manage to learn to follow aesthetic styles to some degree, there are noticeable score differences. + +On rhyme, all ByGPT5 variants collectively outperform all GPT-2 models on both languages by $5\% - 20\%$ . Similarly, ByT5 consistently outperforms MT5 by $\sim 5\%$ . This supports our theory that token-free models are better suited for character-level styles. Further, ByGPT5 (small) performs $2\% - 15\%$ better than ByT5 (small) which means we can discard the encoder while still improving performance. Surprisingly though, base ByGPT5 and GPT-2 achieve higher scores than their medium variants. While this may initially suggest that larger decoders prioritize (meaningful) content, whereas smaller decoders focus on style, the high coherence seen across all models weakens this hypothesis. Instead, we speculate that this may be an overfitting problem. In particular, smaller models, up to base size, may be better suited for generating shorter texts such as quatrains. Another surprising finding is that ByT5 (small) performs worse than GPT-2 (base) on English. We investigate this further in §6.2. + +In terms of meter, all models perform very similar to one another. Whereas ByGPT5 (small) performs best on English by a small margin, it is outperformed + +by MT5 (small) on German. This result is not surprising. Since meter is a syllable-level style, subword-level language models also manage to pick it up reasonably well (Lau et al., 2018). Interestingly though, on English the scores are much lower overall than on German. A reason for this may be that the occurrence of different meters is much more evenly distributed in German QUATRAIN (cf. Table 6 in the appendix). While in German only about $60\%$ of all meters are iambs, in English it is over $80\%$ , making it difficult for models to learn other meters. We identify further reasons in §6.2. + +Alliteration is the style that all models are the worst at. Our formulation of alliteration levels may make it difficult for models to pick up its semantics. Still, ByGPT5 (base) performs the best on English, and ByGPT5 (small) and ByT5 (small) perform the best on German, suggesting that token-free models have an advantage on this style. + +In general, small and base ByGPT5 perform the best on all three styles in English and on two of them in German. It appears that they have an advantage in terms of tokenization algorithms (outperforming subword-level GPT-2 and mT5), architecture (outperforming encoder-decoder ByT5), and size (the medium variant performs worse). + +# 6.2 Human Evaluation + +To further validate the effectiveness of our models, we conduct a human evaluation campaign using best-worst scaling (BWS) as a means of annotation (Louviere et al., 2015). BWS is a variant of + +![](images/95beae1765da58c8cbae8b24f6089103159995b5bc6f050ad3cdbcdc05cab7ee.jpg) +Figure 4: Distributions of BWS scores for rhyme, human likeness, and meter annotations through kernel density estimation. Scores range from -1 (very bad) to 1 (very good). The “ $\bullet$ ” markers denote expected values. + +![](images/cd906f61e30e3db662221d31ebdeda98ea8e1a8ca817c0ac5fd495f61b3709d8.jpg) + +![](images/39c5e21ebff6f34cbff17e1e4c6bafef12affba45577d75798eca4cdcfeaeb93.jpg) + +comparative annotation that produces high-quality results while keeping the number of required annotations low (Kiritchenko and Mohammad, 2016, 2017). Annotators are presented with tuples of $n$ items (usually $n = 4$ ) and asked to identify the best and worst item based on a specified property. By subtracting the fraction of times an item is chosen as the best from the fraction of times it is chosen as the worst, real-valued scores ranging from -1 (bad) to 1 (good) can be obtained (Orme, 2009). + +In our annotations, we consider three properties: rhyme, meter, and human likeness, i.e., the likelihood of a poem being written by a human. We exclude alliteration to reduce the workload on our annotators. Similarly, we exclusively evaluate on English (cf. Appendix B for a small-scale evaluation in German) and only consider the top-performing model within each model class based on the results of automatic evaluation. The models in question thus are ByGPT5 (base), GPT-2 (base), ByT5 (small), and mT5 (small). Furthermore, we only choose from three rhyme schemes (AABB, ABAB and ABBA), two meters (iambus and trochee), and one level of alliteration (medium), and create four poems per system for each possible combination. In addition, we also randomly sample human quatrains from our datasets that match the constraints and create 120 4-tuples from the combined set of quatrains. + +Four annotators then annotate rhyme and human likeness, whereas meter is evaluated by a single expert annotator only (cf. Appendix B). Since we have multiple annotators working on rhyme and human likeness we use the split-half reliability (SHR) measure (Kiritchenko and Mohammad, 2017) to assess their consistency. SHR is calculated by splitting the annotations into two sets, computing scores + +for each set, and then computing their Spearman rank correlation coefficient. + +Figure 4 displays a kernel density estimate for each property, with distributions shifted to the right indicating better performance. On rhymes, we obtain an SHR of $\rho = 0.77$ which demonstrates a high agreement between annotators. Human rhymes are ranked the highest overall, whereas ByGPT5 comes in as a close second, followed by ByT5. mT5 and GPT-2 perform the worst. This is a bit different from our findings during automatic evaluation where GPT-2 (base) was ranked higher than ByT5 (small) on English. An analysis of GPT-2 generated quatrains revealed a predominance of imperfect rhymes as a likely cause. As our rhyme classifier is trained on binary labels it is unable to detect this, but human annotators perceive this kind of rhyme as worse. + +With $\rho = 0.54$ , the SRH of human likeness is noticeably lower than for rhyme. On the one hand, this suggests that this task could be more subjective; on the other hand, the generated quatrains must be sufficiently human-like for subjectivity to be a factor. Indeed, although humans rank higher than ByGPT5 which in turn ranks higher than GPT-2, they all perform noticeably more similar than for rhyme. Nonetheless, we can observe that ByT5, and especially mT5 rank a bit lower. Both models were pre-trained on corrupted spans and have thus never seen truly natural text during pre-training (Zhu et al., 2022; Raffel et al., 2020b; Lester et al., 2021) which we believe could be a possible cause. + +The distributions for meter have large variances for all models, and also humans. This is surprising, as it implies that our annotator does not think that humans are superior, even though the automatic evaluation of English models was not particularly + +![](images/ad89447a33c9cc852b41b03f7b19fd37e83f2c6241137a6c2a27b9922336f9e9.jpg) +Figure 5: Automatic evaluation of low-resource models. + +strong on meter. We hypothesize that even among real English poets, there is a significant amount of poetry that does not strictly adhere to metric constraints, so language models only learn to follow them freely as well. Nonetheless, we can still see that, among models, ByGPT5 is rated highest, followed by GPT-2, mT5, and lastly ByT5, reflecting our findings of automatic evaluation. Interestingly, ByGPT5 also ranks higher than humans. + +Overall, our human evaluation suggests that ByGPT5 performs best across all properties evaluated, which is consistent with our automatic evaluation. Moreover, ByGPT5 has shown the ability to perform at a level comparable to humans, and even surpass human performance in the meter property. + +# 7 Analysis + +We continue with a deeper analysis and look into low-resource training (§7.1), quantify memorization (§7.2), evaluate the performance of token-free models on non-character-based, high-level tasks (§7.3), introspect the models' understanding of style when predicting tokens (§7.4), and compare ByGPT5 with CHATGPT (§7.5). + +# 7.1 Low-resource Training + +We hypothesized that a large training corpus is an important factor in successfully training an end-to-end poetry generation system. We examine this hypothesis by selecting a $5\%$ subset of English QUa-TRAIN (33k quatrains) and re-training our models using the same hyperparameters as in $\S 6$ . Figure 5 shows how well these new low-resource models adhere to style constraints, similar to the automatic evaluation of full training in Figure 3. + +Compared to full training, all low-resource mod + +
ModelMemorizationEmotion
EnglishGermanGerman
ByGPT5 (small)0.0%0.0%0.676
ByGPT5 (base)0.0%0.04%0.680
ByGPT5 (medium)0.0%0.81%0.659
GPT-2 (base)0.39%1.81%0.676
GPT-2 (medium)3.64%——
ByT50.0%0.0%0.691
MT50.0%0.0%0.696
+ +Table 3: Extractive memorization rates (English & German) and recall on emotion generation (German). + +els are noticeably worse at adhering to style. Specifically, the performance drops by $15\% - 40\%$ for rhyme, $5\% - 20\%$ for meter, and $5\% - 10\%$ for alliteration. In addition, the overall performance difference between all models is much smaller than in §6.1. While these findings support our hypothesis that training on large datasets is essential, they also reveal that ByGPT5 demonstrates the largest improvements as the dataset size increases (cf. Figure 3). We therefore theorize that larger datasets lead to substantial performance gains in poetry generation only when coupled with architectures that excel at character-level tasks. + +Nevertheless, even in low-resource scenarios, ByGPT5 (base) outperforms the other models in all categories except rhyme, where a few other systems perform similarly. This suggests that the conclusions drawn in §6.1 hold to some extent even when the available training data is limited. + +# 7.2 Extractive Memorization + +A common problem of language models, known as extractive memorization (EM), is generating verbatim copies from the training data during inference (Carlini et al., 2022; Raunak and Menezes, 2022; Meehan et al., 2020). According to Carlini et al. (2022) EM occurs when a language model's continuation of a string is part of the data it was trained on. Since the inputs to our language models are strings of style, this formulation lends itself well to our case: to detect memorization we simply have to check if generated poems appear in QUa-TRaIN. In Table 3, we compute the EM rates of the quatrains generated in §6.1. To account for negligible variations, we do not compare raw strings, but calculate the Ratcliff-Obershelp similarity (Ratcliff and Metzener, 1988), and assume that two strings are equivalent if their similarity exceeds 0.7. + +As can be seen, GPT-2 suffers from memorization the most. On English, over $3\%$ of all outputs of GPT-2 (medium) are copied. While ByGPT5 also copies quatrains to an extent, it is much less affected in comparison. On English, ByGPT5 (medium) does not copy anything and on German only $0.81\%$ of all outputs. As a general trend, we can see that bigger models tend to copy more data than smaller ones—a finding shared by others (Carlini et al., 2022). Interestingly, the encoder-decoder models ByT5 and MT5 do not seem to be affected by this problem at all, most likely because styles are not used as a prompt, but are fed into the encoder separately. + +# 7.3 Higher-level Styles + +We also explore how token-free models perform on higher-level styles which are not character- or subword-level phenomena. In particular, we focus on emotion using Po-Emo (Haider et al., 2020), a dataset of eight aesthetic emotions in poetry (cf. Appendix A). By conditioning our models on these emotions, we can assess their ability to understand and depict emotion in poetry. + +As in §5, we leverage automatic labeling. To that end, we train a classifier on German Po-EMO as in Haider et al. (2020) and reproduce the results. We then classify emotions in German QUATRAIN and retrain our systems by conditioning them on all emotions in a quatrain. To evaluate how well the models can discriminate emotions, we condition them on every possible tuple of two distinct emotions and generate 100 poems each (2800 in total), and report the recall of correctly classified emotions. The results in Table 3 show that encoder-decoder models score highest, with mT5 performing best. During training, conditioning inputs can be long and variable in size, a scenario for which encoder-decoders may be better suited. Still, decoder-only models are not far behind. Especially ByGPT5 fares well against GPT-2, suggesting that token-free models are also competitive on higher-level tasks. + +# 7.4 Token-level Attributions + +To introspect the decision-making processes of our models, we visualize their token-level attributions when generating a quatron. Token-level attributions explain to which degree each token in the input is involved in determining the next output token of a model, allowing us to reason about what a model has learned. To this end, Ferrando et al. (2022) decompose the attention blocks of transformers + +![](images/a451bade0f287b5ac4e45275f677cedd6426a33cb8eb550edb8c29fa1d525b5d.jpg) +Figure 6: A famous stanza by Tennyson (1850) with visualized attention from ByGPT5 (top) and GPT-2 (bottom) when generating the last syllable. + +into a sum of vectors and define a new measure for visualizing token-to-token interactions based on the distance of each vector to the output (Kobayashi et al., 2021). We apply this measure on generative language models and visualize token-level attributions for ByGPT5 and GPT-2 when generating the last syllable in a quatrain. Since we have observed reoccurring trends, we use a single visualization in Figure 6 as a leading example. We provide additional examples in German in Appendix C. + +We can see that ByGPT5 puts a big emphasis on the current verse, as well as the styles it was conditioned on. Further, possibly in response to the ABBA rhyme scheme, it also heavily stresses the ending of the first verse. Since the model also places a moderate amount of attention on the last consonants in verse three, it also seems to be aware of which sounds it should not generate in order maintain the rhyme scheme. Interestingly, it heavily emphasizes the letter $\nu$ in the last two verses. We assume that this corresponds to what ByGPT5 understands by alliteration, in which case it would not have understood well at which position in a word the same sounds must occur. + +Unlike ByGPT5, GPT-2 does not put any visible emphasis on input style tokens, which suggests that it does not understand how to handle them very well. Nevertheless it stresses similar aspects to ByGPT5, although, due to the subword vocabulary, at a different level of granularity. + +# 7.5 Comparison with ChatGPT + +CHATGPT (OpenAI, 2022) is a conversational large language model which specializes in dialogue. It has attracted attention for its detailed and expressive answers, raising the question of how well it performs in generating poetry. In a small-scale study, we thus ask CHATGPT to generate quatrains with + +various rhyme schemes (AABB, ABAB, ABBA, and ABCB) using its web interface, $^{6}$ and similarly generate poems using ByGPT5. We then construct random pairs of quatrains of each model and want to find out which poem adheres better to rhyme constraints. Since we know the quatrains of CHATGPT beforehand, we use our rhyme scorer of §6.1 for unbiased scoring. Only in $15\%$ of cases does our scorer prefer poems of CHATGPT over ByGPT5. Manual investigation showed that CHATGPT tends to generate rhymes at arbitrary positions, rather than adhering to specified rhyme schemes, even when giving examples in the prompt. Our verdict is that CHATGPT is a viable approach for poetry generation but not style-conditioned poetry generation. + +# 8 Related Work + +As indicated in §1, competing poetry generation systems usually consist of model pipelines and/or inject prior knowledge. Zhang and Lapata (2014), for example, propose a system for modeling quatrains consisting of three components: one model encodes previous verses, a second one reduces them to a single context vector, and a third one generates verses, one at a time. During decoding, phrases which violate style constraints are discarded. Similarly, DEEP-SPEARE (Lau et al., 2018) consists of a language model that generates a set of sample verses in reverse order, a model that reinitiates sampling as long as rhyme constraints are not met, and a final model that ranks the samples according to how well they adhere to iambic pentameter. Van de Cruys (2020) also induce prior knowledge into a generic language model, but they do it by modifying output probability distributions directly. Jhamtani et al. (2019) put their focus on actually learning rhyme and train a sonnet and limerick generator through adversarial training. The model is hierarchical, i.e., it first generates a sequence of line endings which are subsequently completed in reverse. While the model manages to learn the meaning of rhyme to an extent, the authors still filter outputs using pronunciation dictionaries. More in line with our research, Hopkins and Kiela (2017) train a model on the phonetic representation of poetry using the International Phonetic Alphabet (IPA) as a character-level vocabulary. During inference, a second model translates sounds back to human-readable text. Although promising, the model did not generalize well, and + +an additional model enforces rhythmic constraints in their final approach. Ormazabal et al. (2022) target unsupervised poetry generation by training a system on prosaic text only and conditioning it on structural information such as line endings and syllable counts. During inference, the system can generate poetry when conditioned on rhyming line endings and metric syllable counts. Nonetheless, since this information must be crafted manually, it is still supervised in a slightly different sense. In contrast, our model is supervised during training as it requires poetry to learn from, but unsupervised during inference as it is able to independently incorporate poetic elements. + +# 9 Conclusion + +In this work, we implement end-to-end style-conditioned poetry generation systems for quatrains in English and German. Unlike other work, our systems are able to generate poetry without the need for human supervision, except for the use of poetic training data. In particular, we present ByGPT5, a novel token-free decoder-only language model, and show that fine-tuning it on a custom poetry corpus outperforms other models, such as GPT-2, mT5, and ByT5, on average, while also performing favorably against human poets in our constrained setting. Our key findings are that (i) tokenization algorithms matter, i.e., token-free language models generally perform better at generating character-level styles than subword-level transformers, and (ii) large datasets are crucial for successful training. We further show that bigger models do not necessarily perform better and that decoder-only architectures work best, i.e., we can discard the encoder of ByT5 (75% of parameters) while still improving downstream performance. We also demonstrate that token-free transformers perform competitively on tasks not tied to character-level styles, and are less susceptible to memorization of the training dataset. In addition, we conduct a visual analysis of token-level attributions during quatrain generation that is consistent with human perception of styles. + +In future work, we want to extend our system to other poetic forms such as sonnets, limericks, or villanelles. + +# 10 Limitations + +A well-known shortcoming of transformers is the computational complexity in self-attention lay + +![](images/d644487c6ffc7a7f4a2b4f0348f102b00d633a180f3968577be47c80b72bd852.jpg) +Figure 7: Inference times for generating a single quatrain (with 177 characters) on an A6000 GPU. + +ers (Vaswani et al., 2017). Since the number of required calculations grows quadratically with the length of the input, transformers become prohibitively slow on very long sequences. An unfortunate side effect of processing inputs at the character-level is that internal sequences become much longer, so token-free transformers run into these efficiency problems much earlier than subword-based models. Figure 7 illustrates this problem by contrasting the runtime of all poetry generation systems when generating a single quatron. Even ByGPT5 (small), the smallest model in terms of number of parameters (cf. Table 1) and the fastest token-free transformer, is only marginally faster than GPT-2 (medium), which is almost five times larger. Tay et al. (2022) propose a solution to this problem for transformer encoder blocks by applying a neural pooling operation over input embeddings before feeding them into the model, which could be extended to decoder blocks in future work. Alternatively, Libovický et al. (2022) propose a two-stage decoding architecture in which the transformer decoder operates on character blocks that an additional LSTM model (Hochreiter and Schmidhuber, 1997) decodes into individual characters. + +Another shortcoming is that our poetry generation systems can only generate a single poetic form, i.e., quatrains. In general, poetry is a very diverse form of language and stanzas can be of arbitrary length, so this is a serious limitation. In future work, we thus plan to extend our implementation + +of style-conditioning to variable length poems. In particular, one could encode a rhyme scheme not as a single special token, but as an arbitrary series of letters indicating which verses rhyme with each other. Alternatively, our current systems could be used to generate longer stanzas through a sliding window approach, i.e., generating one verse at a time with the last three verse as context. + +Further, our human evaluation has limitations due to its relatively small scope. We only have a limited number of annotators and only consider a subset of all style combinations. Nevertheless, we have achieved moderately high to high agreement on all tasks, and we have an additional human evaluation of German poetry in Appendix B, which points to the same conclusion. + +Lastly, QUATRAIN is limited in that it consists of pseudo-quatrains, which are not real quatrains and often have missing contexts. Nonetheless, as can be seen in Appendix D, models trained on QUATRAIN are still able to generate meaningful poetry. In future work, we plan to improve the quality of our dataset by obtaining real quatrains from additional sources such as the Eighteenth-Century Poetry Archive (Huber, 2022). + +# Acknowledgments + +We thank all reviewers for their valuable feedback, hard work, and time. We also thank all annotators, without whom this work would not have been possible. The last author was supported by DFG grant EG 375/5-1. We further gratefully thank the BMBF for its support via the grant Metrics4NLG. + +# References + +Jonas Belouadi and Steffen Eger. 2023. UScore: An effective approach to fully unsupervised evaluation metrics for machine translation. In Proceedings of the 17th Conference of the European Chapter of the Association for Computational Linguistics, pages 358-374, Dubrovnik, Croatia. Association for Computational Linguistics. +Drayton C. Benner. 2014. 'The Sounds of the Psalter: Computational Analysis of Soundplay'. Literary and Linguistic Computing, 29(3):361-378. +Derrel R. Blain. 1987. A mathematical model for alliteration. Style, 21(4):607-625. +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. +Nicholas Carlini, Daphne Ippolito, Matthew Jagielski, Katherine Lee, Florian Tramer, and Chiyuan Zhang. 2022. Quantifying memorization across neural language models. +Thiago Castro Ferreira, Chris van der Lee, Emiel van Miltenburg, and Emiel Krahmer. 2019. Neural data-to-text generation: A comparison between pipeline and end-to-end architectures. 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 552-562, Hong Kong, China. Association for Computational Linguistics. +Jonathan H. Clark, Dan Garrette, Iulia Turc, and John Wieting. 2022. Canine: Pre-training an efficient tokenization-free encoder for language representation. Transactions of the Association for Computational Linguistics, 10:73-91. +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. +Javier de la Rosa, Álvaro Pérez, Mirella de Sisto, Laura Hernández, Aitor Díaz, Salvador Ros, and Elena González-Blanco. 2021. Transformers analyzing poetry: multilingual metrical pattern prediction with transformer-based language models. *Neural Computing and Applications*. +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. +Swagata Duari and Vasudha Bhatnagar. 2021. Ffcd: A fast-and-frugal coherence detection method. IEEE Access, PP:1-1. +Ana C Farinha, M. Amin Farajian, Marianna Buchicchio, Patrick Fernandes, JosA© G. C. de Souza, Helena Moniz, and AndrA© F. T. Martins. 2022. Findings of the wmt 2022 shared task on chat translation. In + +Proceedings of the Seventh Conference on Machine Translation, pages 724-743, Abu Dhabi. Association for Computational Linguistics. +Javier Ferrando, Gerard I. Gållego, and Marta R. Costajussà. 2022. Measuring the mixing of contextual information in the transformer. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 8698-8714. +Leo Gao, Stella Biderman, Sid Black, Laurence Golding, Travis Hoppe, Charles Foster, Jason Phang, Horace He, Anish Thite, Noa Nabeshima, Shawn Presser, and Connor Leahy. 2021. The pile: An 800gb dataset of diverse text for language modeling. +Cristina Garbacea and Qiaozhu Mei. 2022. Why is constrained neural language generation particularly challenging? +Thomas Haider. 2021. Metrical tagging in the wild: Building and annotating poetry corpora with rhythmic features. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 3715-3725, Online. Association for Computational Linguistics. +Thomas Haider, Steffen Eger, Evgeny Kim, Roman Klinger, and Winfried Menninghaus. 2020. PO-EMO: Conceptualization, annotation, and modeling of aesthetic emotions in German and English poetry. In Proceedings of the Twelfth Language Resources and Evaluation Conference, pages 1652-1663, Marseille, France. European Language Resources Association. +Thomas Haider and Jonas Kuhn. 2018. Supervised rhyme detection with Siamese recurrent networks. In Proceedings of the Second Joint SIGHUM Workshop on Computational Linguistics for Cultural Heritage, Social Sciences, Humanities and Literature, pages 81-86, Santa Fe, New Mexico. Association for Computational Linguistics. +W. Harmon, C.H. Holman, and W.F. Thrall. 2000. A Handbook to Literature. Handbook to Literature Series. Prentice Hall. +Sepp Hochreiter and Jürgen Schmidhuber. 1997. Long short-term memory. Neural Comput., 9(8):1735-1780. +Jack Hopkins and Douwe Kiela. 2017. Automatically generating rhythmic verse with neural networks. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 168-178, Vancouver, Canada. Association for Computational Linguistics. +Luyang Huang, Shuyang Cao, Nikolaus Parulian, Heng Ji, and Lu Wang. 2021. Efficient attentions for long document summarization. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 1419-1436, Online. Association for Computational Linguistics. + +Alexander Huber. 2022. Eighteenth-century poetry archive. [Online; accessed 15-December-2022]. +Harsh Jhamtani, Sanket Vaibhav Mehta, Jaime Carbonell, and Taylor Berg-Kirkpatrick. 2019. Learning rhyming constraints using structured adversaries. 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 6025-6031, Hong Kong, China. Association for Computational Linguistics. +Svetlana Kiritchenko and Saif Mohammad. 2017. Bestworst scaling more reliable than rating scales: A case study on sentiment intensity annotation. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 465-470, Vancouver, Canada. Association for Computational Linguistics. +Svetlana Kiritchenko and Saif M. Mohammad. 2016. Capturing reliable fine-grained sentiment associations by crowdsourcing and best-worst scaling. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 811-817, San Diego, California. Association for Computational Linguistics. +Goro Kobayashi, Tatsuki Kuribayashi, Sho Yokoi, and Kentaro Inui. 2021. Incorporating Residual and Normalization Layers into Analysis of Masked Language Models. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 4547-4568, Online and Punta Cana, Dominican Republic. 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. +Jey Han Lau, Trevor Cohn, Timothy Baldwin, Julian Brooke, and Adam Hammond. 2018. Deep-spare: A joint neural model of poetic language, meter and rhyme. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1948-1958, Melbourne, Australia. Association for Computational Linguistics. +Jay A. Leavitt. 1976. On the measurement of alliteration in poetry. Computers and the Humanities, 10(6):333-342. +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. + +Junyi Li, Tianyi Tang, Wayne Xin Zhao, and Ji-Rong Wen. 2021. Pretrained language model for text generation: A survey. In Proceedings of the Thirtieth International Joint Conference on Artificial Intelligence, IJCAI-21, pages 4492-4499. International Joint Conferences on Artificial Intelligence Organization. Survey Track. +Jindrich Libovicky, Helmut Schmid, and Alexander Fraser. 2022. Why don't people use character-level machine translation? In Findings of the Association for Computational Linguistics: ACL 2022, pages 2470-2485, Dublin, Ireland. Association for Computational Linguistics. +Jordan J. Louviere, Terry N. Flynn, and A. A. J. Marley. 2015. Best-Worst Scaling: Theory, Methods and Applications. Cambridge University Press. +Casey Meehan, Kamalika Chaudhuri, and Sanjoy Das-gupta. 2020. A three sample hypothesis test for evaluating generative models. In Proceedings of the Twenty Third International Conference on Artificial Intelligence and Statistics, volume 108 of Proceedings of Machine Learning Research, pages 3546-3556. PMLR. +Benjamin Minixhofer. 2020. GerPT2: German large and small versions of GPT2. +Eduard Morike. 1832. Maler Nolten. Novelle in zwei Teilen. 2. Teil. G. J. Göschen'sche Verlagshandlung, Stuttgart. +OpenAI. 2022. ChatGPT: Optimizing language models for dialogue. [Online; accessed 17-December-2022]. +Aitor Ormazabal, Mikel Artetxe, Manex Agirrezabal, Aitor Soroa, and Eneko Agirre. 2022. PoeLM: A meter- and rhyme-controllable language model for unsupervised poetry generation. In Findings of the Association for Computational Linguistics: EMNLP 2022, pages 3655-3670, Abu Dhabi, United Arab Emirates. Association for Computational Linguistics. +Bryan K. Orme. 2009. Maxdiff analysis: Simple counting, individual-level logit, and hb. Sawtooth Software, Inc. +Andrei Popescu-Belis, Alex Atrio, Valentin Minder, Aris Xanthos, Gabriel Luthier, Simon Mattei, and Antonio Rodriguez. 2022. Constrained language models for interactive poem generation. In Proceedings of the Thirteenth Language Resources and Evaluation Conference, pages 3519-3529, Marseille, France. European Language Resources Association. +Alec Radford, Jeffrey 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. 2020a. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 21(140):1-67. + +Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. 2020b. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 21(140):1-67. +John W. Ratcliff and David E. Metzener. 1988. Pattern matching: The gestalt approach. Dr. Dobb's Journal, page 46. +Vikas Raunak and Arul Menezes. 2022. Finding memo: Extractive memorization in constrained sequence generation tasks. In Findings of the Association for Computational Linguistics: EMNLP 2022, pages 5153-5162, Abu Dhabi, United Arab Emirates. 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. +Wei Shi and Vera Demberg. 2019. Next sentence prediction helps implicit discourse relation classification within and across domains. 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 5790-5796, Hong Kong, China. Association for Computational Linguistics. +Burrhus F. Skinner. 1939. The alliteration in shak-. speare's sonnets: a study in literary behavior. Psychological Record. +Haipeng Sun, Junwei Bao, Youzheng Wu, and Xiaodong He. 2022. BORT: Back and denoising reconstruction for end-to-end task-oriented dialog. In *Findings of the Association for Computational Linguistics: NAACL* 2022, pages 2156–2170, Seattle, United States. Association for Computational Linguistics. +Tianyi Tang, Junyi Li, Wayne Xin Zhao, and Ji-Rong Wen. 2022. Mvp: Multi-task supervised pre-training for natural language generation. +Yi Tay, Vinh Q. Tran, Sebastian Ruder, Jai Prakash Gupta, Hyung Won Chung, Dara Bahri, Zhen Qin, Simon Baumgartner, Cong Yu, and Donald Metzler. 2022. Charformer: Fast character transformers via gradient-based subword tokenization. In *The Tenth International Conference on Learning Representations*, ICLR 2022, Virtual Event, April 25-29, 2022. OpenReview.net. +Alfred Tennyson. 1850. In Memoriam A.H.H. Edward Moxon and Co., London. +Yufei Tian and Nanyun Peng. 2022. Zero-shot sonnet generation with discourse-level planning and aesthetics features. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 3587-3597, Seattle, United States. Association for Computational Linguistics. + +Chau Tran, Yuqing Tang, Xian Li, and Jiatao Gu. 2020. Cross-lingual retrieval for iterative self-supervised training. In Advances in Neural Information Processing Systems, volume 33, pages 2207-2219. Curran Associates, Inc. +Herbert F. Tucker. 2011. Poetic data and the news from poems: A "for better for verse" memoir. Victorian Poetry, 49(2):267-281. +Tim Van de Cruys. 2020. Automatic poetry generation from prosaic text. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 2471-2480, 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, volume 30. Curran Associates, Inc. +Jörg Wöckener, Thomas Haider, Tristan Miller, The-Khang Nguyen, Thanh Tung Linh Nguyen, Minh Vu Pham, Jonas Belouadi, and Steffen Eger. 2021. End-to-end style-conditioned poetry generation: What does it take to learn from examples alone? In Proceedings of the 5th Joint SIGHUM Workshop on Computational Linguistics for Cultural Heritage, Social Sciences, Humanities and Literature, pages 57-66, Punta Cana, Dominican Republic (online). Association for Computational Linguistics. +Lanqing Xue, Kaitao Song, Duocai Wu, Xu Tan, Nevin L. Zhang, Tao Qin, Wei-Qiang Zhang, and Tie-Yan Liu. 2021a. DeepRapper: Neural rap generation with rhyme and rhythm modeling. 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 69-81, Online. Association for Computational Linguistics. +Linting Xue, Aditya Barua, Noah Constant, Rami Al-Rfou, Sharan Narang, Mihir Kale, Adam Roberts, and Colin Raffel. 2022. ByT5: Towards a token-free future with pre-trained byte-to-byte models. Transactions of the Association for Computational Linguistics, 10:291-306. +Linting Xue, Noah Constant, Adam Roberts, Mihir Kale, Rami Al-Rfou, Aditya Siddhant, Aditya Barua, and Colin Raffel. 2021b. 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. +Yunyi Yang, Yunhao Li, and Xiaojun Quan. 2021. Ubar: Towards fully end-to-end task-oriented dialog system with gpt-2. Proceedings of the AAAI Conference on Artificial Intelligence, 35(16):14230-14238. + +Xingxing Zhang and Mirella Lapata. 2014. Chinese poetry generation with recurrent neural networks. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 670-680, Doha, Qatar. Association for Computational Linguistics. +Ming Zhong, Da Yin, Tao Yu, Ahmad Zaidi, Mutethia Mutuma, Rahul Jha, Ahmed Hassan Awadallah, Asli Celikyilmaz, Yang Liu, Xipeng Qiu, and Dragomir Radev. 2021. QMSum: A new benchmark for query-based multi-domain meeting summarization. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 5905-5921, Online. Association for Computational Linguistics. +Chenguang Zhu, Yang Liu, Jie Mei, and Michael Zeng. 2021. MediaSum: A large-scale media interview dataset for dialogue summarization. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 5927-5934, Online. Association for Computational Linguistics. +Jian Zhu, Cong Zhang, and David Jurgens. 2022. ByT5 model for massively multilingual grapheme-to-phoneme conversion. In Proc. Interspeech 2022, pages 446-450. + +
MeterSymbol
iambusü -
trochee-ü
amphibrachü -ü
anapestüü -
dactyl-üü
alexandrineü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü -ü
+ +Table 4: Meters in our dataset we consider for our experiments. An alexandrine consists of iambic feet with a caesura after the sixth syllable. + +
ModelRhymeMeter
CANINE-C98.0558.49
XLM-R97.2254.65
MBERT97.1749.01
+ +Table 5: F1-Score on classifying rhyme and meter. + +# A Additional poetry corpus statistics + +The poetry corpora we collect are English Project Gutenberg (EPG) and Deutsches Lyrik Korpus (DLK) (Haider, 2021) for unlabeled poetry, and Prosodic7, Chicago Rhyme Corpus (CHICAGO)8, For-better-for-verse (FORB) (Tucker, 2011), German Rhyme Corpus (GRC) (Haider and Kuhn, 2018), as well as EPG64 and ANTI-K (Haider, 2021) for labeled poetry. We map meters which appear less than 25 times in our labeled corpora to the special label other. The final list of meters we consider can be found in Table 4. + +The performance of the meter and rhyme classifiers we train can be seen in Table 5. For each style, we perform a $90/5/5$ train-valid-test split and fine-tune a range of encoder-only transformers with classification heads jointly on both languages, as this improves performance (de la Rosa et al., 2021; Haider and Kuhn, 2018). We test subword-level MBERT and XLM-R, as well as character-level CANINE-C (Clark et al., 2022). Since character-level CANINE-C outperforms both MBERT and XLM-R on both tasks, we use it as our final classifier. + +During automatic labeling, when the rhyme scheme cannot be clearly determined (e.g., according to the classifier the first verse rhymes with the second, the second with the third but the first and the third do not rhyme) or no dominant meter exists, we discard the quatrain. Frequencies of automatic labels inside QUATRAIN can be seen in Table 6. By limiting QUATRAIN to quatrains, we not only reduce the burden on poetry generation systems + +by considering only a single poetic form, but also ease the labeling process. As the length of poems increases, the number of verse pairs that have to be classified for rhyme grows super-exponentially, which quickly becomes intractable. + +The eight emotions in Po-EMO we train our classifier on are beauty / joy, sadness, uneasiness, vitality, awe / sublime, suspense, humor, and annoyance. Since an additional emotion, nostalgia, almost never occurs, we follow Haider et al. (2020) and omit it from our experiments. + +# B Annotator Demographics + +Our human annotators are fluent in English at a C1 or higher level according to the Common European Framework of Reference for Languages (CEFR). The annotators for rhyme and human likeness are one male faculty member, two male PhD students, one female undergraduate student, and three female volunteers from other departments, amounting to seven distinct annotators who are all proficient in English but may have limited knowledge of poetry. To get four sets of annotations per style, we have one PhD student annotate both styles. For meter, we hire a professional female teacher who is specialized in English and music. + +Since none of our annotators speak English as a native language, we have one PhD student and one faculty member conduct a small-scale comparative study in their native language, German, annotating 30 BWS tuples for rhyme and human likeness. The results in Table 7 confirm the trends we saw in human-evaluation in §6.2. In terms of rhyme, humans perform best, followed by ByGPT5, ByT5, MT5, and finally GPT-2. On human likeness ByGPT5 is outperformed by humans but performs similar to GPT-2. The encoder-decoder models MT5 and ByT5 perform the worst, likely for similar reasons outlined in §6.2. + +# C German Token-level Attributions + +Figure 8 shows token-level attribution scores for German quatrains. By and large, we observe the same trends as in §7.4 on English, i.e., GPT-2 places less attention on style and the emphasized parts of the text are less granular. + +# D Example Quatrains + +In Table 8 we list additional example quatrains in German and English, generated with ByGPT5 (base). + +
LanguageRhymeMeterAlliteration
labelfreq.labelfreq.labelfreq.
GermanABCD19.73%iambus61.66%low50.95%
ABAB15.60%alexandrine18.06%medium39.23%
AABB13.07%trochee17.05%high9.81%
EnglishAABB19.17%iambus83.96%medium54.92%
ABCD16.40%anapest7.61%low28.94%
ABBC13.07%trochee4.13%high16.14%
+ +Table 6: Distribution of alliteration levels, as well as most frequent meters and rhyme schemes in QUATRAIN. + +
ModelRhymeHuman Likeness
Human0.840.89
ByGPT50.570.55
GPT-20.350.55
ByT50.450.19
MT50.280.32
+ +![](images/286e0debba71eed799568ccdd989b3ddf12ffd56870fed7e5f428e8d7e29689d.jpg) +Figure 8: A well-known stanza by Morike (1832) with visualized attention from ByGPT5 (top) and GPT-2 (bottom) when generating the last syllable. + +Table 7: Min-max normalized and averaged BWS scores annotated by two native German speakers. The SHR is $\rho = 0.83$ for rhyme and $\rho = 0.61$ for human likeness. + +
GermanEnglish
Ein Reiter steht am Hafen, Der schaut die Flut nicht an, Er hört die Schiffer schlafen Im stillen Ozean.AWith languid smile, the stealing tear retires, And the slow fading light on trembling fires! Now she receives the golden circlet round, And fills the woven chambers with a sound;A
BA
AB
BB
Schweigend stehn die Burgen nieder, Und die Lüfte sind verhalt, Und die Trommeln klingen wider, Und die Büchsen knallen halt.AThe first who learned the lesson there Had learned to scoff and scorn to sneer, And that the learned might have been A shameless woman and a queen.A
BA
AB
BB
Der Greis erbeit, die Hand erstarrt, Die Kinder schauern vor dem Sterben; Die Stimme bricht, die Thräne fallt, Sie sieht ihm nach mit nassem Beben.AThen came the labour of the day within, The gray beginning of the week, And down we went with hope and terror sin, And not a word to say and speak.A
BB
CA
BB
Die Störung wiederum durch alle Glieder dringt, Und alles, was da lebt und wallt und leuchtet, singt. Da steigt ein Palmenstrauch aus dem erhabnen Lichte, Er schwimmct auf einer Fluth und singet in Gedichte.AFor the stars are in the sky; And the stars have gone to die With their songs of joy and fear, With their music and their cheer.A
AA
BB
+ +Table 8: Additional example poems generated with ByGPT5 (base) in German and English. + +A For every submission: + +A1. Did you describe the limitations of your work? 9 +A2. Did you discuss any potential risks of your work? It is likely that the risks associated with using a poetry generation system trained on texts that are already hundreds of years old may be manageable and may not require explicit addressing. +A3. Do the abstract and introduction summarize the paper's main claims? +A4. Have you used AI writing assistants when working on this paper? Left blank. + +B Did you use or create scientific artifacts? + +3,4 + +B1. Did you cite the creators of artifacts you used? 3, Abstract A +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? All artifacts are publicly available under permissive licenses without restrictions. Which is why we didn't explicitly discuss terms of use. +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +We do not explicitly discuss intended use of our artifacts, as the use case does not differ from the artifacts we derive them from. + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? We collect our data from existing datasets which already have quality control performed on them, to which we reference. +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? 3,4 +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. Left blank. + +# C Did you run computational experiments? + +3,4,5,6 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +We report number of parameters used in our models, but not the overall computational budget. Our models were trained as low priority slurm jobs which were often interrupted which would make such estimates inaccurate. We do however discuss computational performance in Section 9. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +3,5 + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +5,6 + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +All these things are documented in our code artifact. + +# D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +6 + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +We detail our annotation process in our own words, not by copying the text of instructions verbatim. + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +Appendix C + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +The data we collect from our annotators does not contain sensitive information. We told our annotators what we're aiming for, but didn't explicitly write about these instructions in our paper. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +Not applicable. Left blank. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +Appendix C \ No newline at end of file diff --git a/bygpt5endtoendstyleconditionedpoetrygenerationwithtokenfreelanguagemodels/images.zip b/bygpt5endtoendstyleconditionedpoetrygenerationwithtokenfreelanguagemodels/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..9da9033a6e7a5034663fde7b317858fe513366b7 --- /dev/null +++ b/bygpt5endtoendstyleconditionedpoetrygenerationwithtokenfreelanguagemodels/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dc77d4670aac716091669a8f1511e2822c2f8a803aeedb523c968ccc0665ec31 +size 596379 diff --git a/bygpt5endtoendstyleconditionedpoetrygenerationwithtokenfreelanguagemodels/layout.json b/bygpt5endtoendstyleconditionedpoetrygenerationwithtokenfreelanguagemodels/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..eaacf2a13bec9e1ca497dd4470a624532d095b5c --- /dev/null +++ b/bygpt5endtoendstyleconditionedpoetrygenerationwithtokenfreelanguagemodels/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2969037fe07b3a184ca3314984855f71bb51e68df2abf875477466d4566521b4 +size 487056 diff --git a/bytelevelgrammaticalerrorcorrectionusingsyntheticandcuratedcorpora/83b6eae0-b4f9-488d-bd3c-b2522fd6c746_content_list.json b/bytelevelgrammaticalerrorcorrectionusingsyntheticandcuratedcorpora/83b6eae0-b4f9-488d-bd3c-b2522fd6c746_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..247f551c6e8164d837badffe611ad0a505e6c3b8 --- /dev/null +++ b/bytelevelgrammaticalerrorcorrectionusingsyntheticandcuratedcorpora/83b6eae0-b4f9-488d-bd3c-b2522fd6c746_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c1cb4f24c23ec1c8f4fb80838d6a3acf83e030e918fc133c6062ac64e94a6a72 +size 116687 diff --git a/bytelevelgrammaticalerrorcorrectionusingsyntheticandcuratedcorpora/83b6eae0-b4f9-488d-bd3c-b2522fd6c746_model.json b/bytelevelgrammaticalerrorcorrectionusingsyntheticandcuratedcorpora/83b6eae0-b4f9-488d-bd3c-b2522fd6c746_model.json new file mode 100644 index 0000000000000000000000000000000000000000..dac8a38457ca52ba5532a2693ac3695818bcbf1b --- /dev/null +++ b/bytelevelgrammaticalerrorcorrectionusingsyntheticandcuratedcorpora/83b6eae0-b4f9-488d-bd3c-b2522fd6c746_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:73b09c6378281fda942c6dc16a4d1d5880737f411ad721b75c621103ce264e3f +size 137808 diff --git a/bytelevelgrammaticalerrorcorrectionusingsyntheticandcuratedcorpora/83b6eae0-b4f9-488d-bd3c-b2522fd6c746_origin.pdf b/bytelevelgrammaticalerrorcorrectionusingsyntheticandcuratedcorpora/83b6eae0-b4f9-488d-bd3c-b2522fd6c746_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8593f9fea0b475c3eda7f534e0c148c3429e8232 --- /dev/null +++ b/bytelevelgrammaticalerrorcorrectionusingsyntheticandcuratedcorpora/83b6eae0-b4f9-488d-bd3c-b2522fd6c746_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f8a23c75563861c8ef9e9f6db0b25e98a3dcbd4815f98674ebb478bc6e7be55b +size 530670 diff --git a/bytelevelgrammaticalerrorcorrectionusingsyntheticandcuratedcorpora/full.md b/bytelevelgrammaticalerrorcorrectionusingsyntheticandcuratedcorpora/full.md new file mode 100644 index 0000000000000000000000000000000000000000..efeca1a0f9e6a84550dcab48d15c57f1759edcac --- /dev/null +++ b/bytelevelgrammaticalerrorcorrectionusingsyntheticandcuratedcorpora/full.md @@ -0,0 +1,428 @@ +# Byte-Level Grammatical Error Correction Using Synthetic and Curated Corpora + +Svanhvit Lilja Ingolfsdottir1 Petur Orri Ragnarsson1 Haukur Päll Jónsson1 +Haukur Barri Simonarson1 Vilhjalmur Porsteinsson1 Vesteinn Snæbjarnarson1,2 + +$^{1}$ Mioeind ehf. $^{2}$ University of Copenhagen + +{svanhvit, petur, haukurpj, haukur, vt, vesteinn}@mideind.is + +# Abstract + +Grammatical error correction (GEC) is the task of correcting typos, spelling, punctuation and grammatical issues in text. Approaching the problem as a sequence-to-sequence task, we compare the use of a common subword unit vocabulary and byte-level encoding. Initial synthetic training data is created using an error-generating pipeline, and used for finetuning two subword-level models and one byte-level model. Models are then finetuned further on hand-corrected error corpora, including texts written by children, university students, dyslexic and second-language writers, and evaluated over different error types and origins. We show that a byte-level model enables higher correction quality than a subword approach, not only for simple spelling errors, but also for more complex semantic, stylistic and grammatical issues. In particular, initial training on synthetic corpora followed by finetuning on a relatively small parallel corpus of real-world errors helps the byte-level model correct a wide range of commonly occurring errors. Our experiments are run for the Icelandic language but should hold for other similar languages, particularly morphologically rich ones. + +![](images/d4b02457bc549b974c6a08c6dd19bc9d260be1a6136360c0cc6c66d623072e1e.jpg) + +https://github.com/mideind/byte-gec + +# 1 Introduction + +Spelling mistakes due to typos and rushed writing, nonstandard punctuation and spelling, and grammatical and stylistic issues are common to almost everyone who writes any kind of text. This applies in any language and can distract the reader or make the communication miss its mark. This can hinder people who have difficulties writing text conforming to a particular language standard, be it due to disability, dyslexia, linguistic background, limited access to education or any other reason. Prejudice against people whose writing deviates + +from the standard can make some shy away from communicating with others, leaving their voices out of important discussions and restricting their opportunities (Alexander-Passe, 2015). + +Grammatical error correction (GEC) is the task of adjusting a text's spelling, grammar, and linguistic style to conform to an approved language standard or convention (Rauf et al., 2017). While the latest work on GEC is based on Transformer models (Vaswani et al., 2017), the subword tokenization methods commonly used in these models are a source of problems when it comes to typos and other variants (Schmaltz et al., 2017). Subword tokenization (Sennrich et al., 2016; Kudo, 2018) was presented as a solution to the open vocabulary problem, as it is a compromise between character encoding and whole word encoding, enabling unknown words to be represented using known subwords. + +However, a significant downside of subword tokenization is how it is affected by noisy input; if a word contains a typo or other spelling variants, this can completely shift its representation. In addition, in languages with rich morphology, a word can have many different surface forms, some rarer than others, that all carry the meaning of the base word, but appear in different syntactic contexts. A subword-tokenized model may struggle to capture the nuances of such a language effectively since it may need several different subwords to represent a single word, depending on spelling and context. When an unfamiliar variant of the word appears in unseen text, the model is challenged to decode it correctly, even when it results in uncommon subword units. + +Our motivation is that a byte or character-level approach should intuitively be more robust to spelling or morphology variations, as it is not constrained by the subword vocabulary. We explore using a byte-level architecture, ByT5 (Xue et al., 2022), for correcting everything from typos to com + +![](images/7c3b456dff29f0b83cae97aacc2fc8e53342e1c9ac63df2615d84e00308b95b4.jpg) +Figure 1: Overview of training data and comparison of output. The Icelandic-English mBART-ENIS model and the multilingual ByT5 and T5 models are first trained on generated parallel error corpora before being adapted on curated (collected) true error corpora in Icelandic. The final models are compared on an error correction (EC) task in Icelandic. The example demonstrates how the byte-level model performs well while the subword model cannot see the individual characters in every word, leading to degraded performance. + +plex grammatical issues in text. The language studied is Icelandic, a highly-inflected North Germanic language. For instance, the morphological complexity in Icelandic means that nouns can have up to 16 different surface forms, and adjectives over 50. GEC for a morphologically complex language needs to go beyond correcting only single words or limited phrases; it needs to consider the syntax of the whole sentence. This is the case for Icelandic but also for other languages with rich morphology, such as Arabic, Hebrew, Polish, Basque, Lithuanian and Hungarian, to name a few. + +We compare the performance of the byte-level architecture to two subword-based architectures; ByT5's predecessor, mT5 (Xue et al., 2021), and an mBART (Liu et al., 2020) model that has been pretrained further on both Icelandic and English. We employ real and synthetic error data for training, and present models and a framework for error generation methods that can be adapted to other languages. For under-resourced languages such as Icelandic (Rögnvaldsson, 2022), using synthetic training data makes neural training for GEC a viable option. + +Our main contributions include a comparison between subword tokenization and byte-level tokenization for GEC when training over a combination of curated and synthesized data. We + +demonstrate how byte-level models not only bypass subword-related issues, but can also correct long-range errors in text. We release our error generation framework as well as models for GEC using byte-level and subword tokens in Icelandic. While our work focuses on the Icelandic language, we have no reason to believe that similar results do not hold for other languages, particularly those similar to Icelandic in terms of morphological complexity. + +# 2 Related work + +The bulk of research on grammatical error detection and correction has been focused on English and English learner texts, due to existing training data and benchmarks, and the large market of English learners worldwide who benefit from an automatic language correction tool (Náplava and Straka, 2019). While spelling and grammar errors appear in every language, each language has its own set of error types that are more common than others, due to different phonetic, morphological and syntactic characteristics. + +# 2.1 Synthetic data generation for GEC + +The problem of data scarcity in GEC, when approached as a sequence-to-sequence task, is typically addressed with synthetic data generation (Stahlberg and Kumar, 2021). One approach to cre + +ating ungrammatical sentences uses random character noise and simple rules to manipulate the text. Another approach is using a spell checker in reverse to noise text (Grundkiewicz and Junczys-Dowmunt, 2019). In contrast, others have used probabilities derived from an annotated corpus of naturally occurring errors to corrupt text (Felice and Yuan, 2014). Recent efforts widely employ neural networks to create synthetic errors (Stahlberg and Kumar, 2021); many use methods derived from machine translation (Junczys-Dowmunt et al., 2018), for example, by creating worse text using deliberately bad translation models (Xie et al., 2018; Zhou et al., 2020) or roundtrip translations between languages (Lichtarge et al., 2019). Yet another option is to leverage available resources with edits, such as Wikipedia edit histories, to generate corrupted corpora (Grundkiewicz and Junczys-Dowmunt, 2014). + +# 2.2 Sequence segmentation for GEC + +GEC can essentially be considered the task of generating grammatical target text from an ungrammatical source, similar to machine translation. The idea of approaching GEC as a machine translation problem dates back to 2006 (Brockett et al., 2006), and this approach has since become the most prevalent method of GEC, with the focus shifting from statistical machine translation (SMT) to neural methods as they developed (Yuan and Briscoe, 2016; Ji et al., 2017; Schmaltz et al., 2017; Chollampatt and Ng, 2018; Junczys-Dowmunt et al., 2018). However, phrase-based SMT continued to be the state-of-the-art for GEC for longer than in the field of interlingual neural machine translation (NMT) (Junczys-Dowmunt et al., 2018). This is partly because of the data scarcity problem and partly because of the tokenization methods typically used in transformer models. Breaking words up into subword units decreases the vocabulary size while addressing the out-of-vocabulary problem (Sennrich et al., 2016). A prominent drawback of this approach is that the fixed subword vocabulary makes the models sensitive to noise in the text (Tay et al., 2021; Eger and Benz, 2020). + +In a subword-based GEC model, when a word contains a typo or is spelled unconventionally, it may look like an unknown word, for which no known representation exists. The model may then segment the word differently from what was seen during training, causing mispredictions. If the subword representation for "different" is [\_diff, er, + +ent], but the word is misspelled as "different", its subwords might be [_diffi, ren, t], and a subword-based GEC model might correct the typo by outputting a different word, [_diffi, cul, t]. This issue is highlighted in Figure 1, also showing how a byte-based approach is not limited by this issue. + +This is also true for unseen words that are correctly spelled, such as foreign-named entities, which can lead to the subword-based GEC model "correcting" a perfectly spelled word it has not seen before, by replacing it with the most likely candidate. In the sentence "The tournament was held in Espoo, Finland," the place name "Espoo" may be represented by a single subword token Espoo. Since this token is unfamiliar, the model finds the most likely subword token for this particular sentence, Helsinki. This changes the semantics of the sentence and can introduce serious errors. The result is a grammatically correct and meaningful sentence, but the semantics have drifted away from the original text. + +Due to this known shortcoming of subword tokenization (Schmaltz et al., 2017), efforts have been made to design architectures where the characters or the underlying bytes are used directly as input tokens. Byte and character-level models inevitably result in much longer sequences than subword models, making them more costly to train, and slower in inference. Some truly token-free general-purpose architectures that are increasingly competitive to token-based models have emerged recently, including CANINE (Clark et al., 2022) (character-level), PILXEL (Rust et al., 2023) (text-to-image), and ByT5 (Xue et al., 2022) (byte-level). The training of ByT5 is based on the subword-based multilingual mT5 (Xue et al., 2021) approach, but in comparison, the model is equipped with a heavier encoder (three times the depth of the decoder). Compared to mT5, ByT5 is more robust to noisy input, but inference is slower (1.5 to 2.6 times slower on average on a transliteration task, and up to 9 times longer on tasks with longer input sequences) (Xue et al., 2022). Another approach to making subword models more robust is using subword regularization to produce multiple segmentations of the same word (Kudo, 2018; Provilkov et al., 2020). This is commonly used for addressing the open vocabulary problem and noisy data, such as ungram- + +matical text. + +Despite the reported advantage of character or byte-based Transformer models on noisy text (Libovický et al., 2022), work using this approach to GEC is not very common. A notable exception is work for GEC in the Lithuanian language, where ByT5 has been used for diacritics restoration (Stankevicius et al., 2022) and limited GEC (Stankevicius and Lukosevičius, 2022). They generate synthetic data by applying noise (common typographical errors, swapping letters for similar sounding ones, other non-grammatical word-level noise) to a crawled and filtered corpus and compare results when training with T5 and ByT5. Their findings agree with ours that the byte-level model outperformed the subword model. + +Our work deviates from that of Stankevicius et al. (2022) in the following key ways: We (a) generate more sophisticated and realistic errors using grammatical information from part-of-speech (PoS) tags and using custom rules based on empirical findings; (b) combine generated error data with true error corpora from a wide range of demographic sources; and (c) explore in detail which error and text types benefit the most from finetuning on true error corpora, as opposed to training on synthetic data. As far as we are aware, no attempt at byte-level Transformer-based GEC, trained on synthetic and real error corpora, has been published. Concurrent work using ByT5 for Icelandic is (Jasonarson et al., 2023), where errors in the OCR output of historical Icelandic texts are corrected using a generated corpus of errors extracted from real data. + +Current state-of-the-art in GEC is based on sequence-tagging methods (Omelianchuk et al., 2020), which instead of generating whole sequences, tag the erroneous sentence with its corrections, and on sequence-to-sequence methods, as has been described. Further work has explored automatic character transformations for GEC tagging (Straka et al., 2021) to better handle character-level errors. One of the current highest-scoring models on English GEC benchmarks is gT5 (Rothe et al., 2021), which is based on the mT5 model. + +# 2.3 Prior work for Icelandic + +Apart from some rule-based spell checkers that don't make use of the full context, one rule-based correction system exists for Icelandic, based around parse trees, GreynirCorrect (Óladóttir et al., 2022). This system is contingent on the sentence parsing + +according to a pre-defined context-free grammar, and can only handle issues that fit pre-defined rules. This setup is both a strength and a weakness as the system is highly configurable and capable of many things, such as detecting syntactic inconsistencies and errors, and can give the user useful information on the errors found. Still, when a text has many errors, complexity builds up and rules can start interfering. Sentences containing many issues, such as from users with dyslexia, generally have lower accuracy using this method. + +The work presented here is the first where neural networks are used in GEC for Icelandic. Snæbjarnarson et al. (2022) use neural methods for detecting such errors, but not for correcting them. + +# 3 Methods + +# 3.1 Curated dataset + +A single collection of parallel error corpora exists for Icelandic, the Icelandic Error Corpus (IceEC). The corpora are annotated and corrected by language experts (Arnardóttir et al., 2021). The dataset is highly granular in its categories, containing hundreds of labels, but with a limited number of high-level groups (coherence, grammar, orthography, style and vocabulary). + +The IceEC is split into a larger general corpus and three specialized corpora (Arnardóttir et al., 2022). The general one contains 58,239 sentences of student essays, online news texts and Wikipedia articles. This corpus is annotated with around 50k errors of different categories. The three specialized corpora are much smaller and contain texts from Icelandic language learners (6270 sentences), dyslexic native speakers (1362 sentences), and children (2070 sentences), volunteered by the users themselves. These smaller corpora contain more errors per sentence than the general one, and add diversity to the training data. + +This curated error data was used for finetuning our models, and combined into one training dataset for a total of 64k input sequences (single sentences), after setting aside validation and test data. The general IceEC also includes a 5.3k sentence test set used for evaluation. + +# 3.2 Synthetic dataset + +We applied a diverse set of methods for error generation, both using linguistic knowledge and random noising methods. This rule-based approach to synthetic data generation gave us control over the + +
Noise
1. Grammatical case swapped in nominals*
2. Indicative changed to subjunctive*
3. Dativitis*
4. Spaces added to words according to morphological rules*
5. Known misspellings added
6. Spaces deleted between words
7. Commas deleted from sentence
8. Word order swapped
9. Words duplicated
10. Characters duplicated
11. Characters dropped
12. Characters swapped according to simple language-specific rules (y ↔ i, yi → yji ...)
13. Characters accented or accents removed (a ↔ á, I ↔ û ... )
14. Random character replacement
+ +types of noise applied, and allowed us to generate evaluation data for each error type. + +As our basis of correct text to be noised, we used the Icelandic Gigaword Corpus (IGC) (Steingrímsson et al., 2018), a collection of Icelandic editorial texts. These are mostly news articles, published literature and legal texts. We selected from this corpus those text sources that are the most likely to have been reviewed as part of the editorial process of each publication/source (literature, journals, news, laws, adjudications and transcribed parliamentary speeches). Some of these texts still have their share of typos and other errors and inconsistencies, especially the news articles, which were deemed important training data because of their general vocabulary, not found in the more formal text sources. As a preprocessing step, we filtered out lower-quality and irrelevant sentences, by removing sentences containing mostly foreign texts, illegal characters and words with known misspellings, sourced from lists of common misspellings. The corpus was tokenized using the Greynir Tokenizer (Porsteinsson et al., 2019) and PoS tagged using the GreynirSeq tagger (Snæbjarnarson et al., 2022). + +We generated three categories of errors: 1) noise within words; 2) noise at the sequence level; and 3) grammatical and morphological modifications. The first two resemble those used when noising back-translation data (Edunov et al., 2018). The third type is based on using available tools and linguistic + +Table 1: Noise and modifications used on a high-quality corpus (IGC) to generate synthetic training data. We use * to indicate noise that relies on PoS tags and/or morphological lookup. + +
SourceText
SynthAtvinnuleisi er ekki eein aff a4f ástæðnafolks-fækkún áNordurlandi vestre.
OrigAtvinnuleysi er ekki ein af ástæðumfolksfækknar áNordurlandi vestra.
SynthÉg er mað 4eita að ogg vynnu mér langarað fá að sköða atvinnuauglésingrmar.''
OrigÉg er að leita að vinnu og mig langar að fá að sköða atvinnuauglésingarnar.
+ +Table 2: Synthetic error examples. + +knowledge to create errors that are unlikely to be formed randomly, but resemble those of human writers. + +In order to explore to what extent subword and byte-level models can learn and generalize grammatically complex issues in a morphologically rich language, we go beyond naive language-agnostic noising of text. A more detailed explanation of the Icelandic-specific noise is given in Appendix C. The noise methods are shown in Table 1. This is by no means a finite list of linguistic variants or errors found in Icelandic texts, but constitutes examples chosen for studying the model performance on these more grammatically complex challenges. + +The error generator allows for noising levels to be configured via hyperparameters. Experiments with different noise ratios in the synthetic data showed that highly noised text provided the best training examples, without the models learning to "overcorrect", i.e., to introduce false positives. Instead of producing even more synthetic data, we geared up the noise to produce highly error-dense examples, setting the random and more naive error noise to appear in $80\%$ of cases, and the rule-based error noise to be used wherever possible. Examples of parallel sentences with and without synthetic errors are shown in Table 2. A total of 35M synthetic parallel sentences were generated using these methods. 2000/4000 lines were set aside for validation/testing, respectively, and special evaluation sets were generated for each error type (see Section 4). + +# 3.3 Models + +We compared three model architectures to evaluate the differences between using subword tokenization and a byte-level method. Comparing models with different architectures calls for defining which + +factors are compared. In particular, byte sequences are longer than subword sequences when counting the number of tokens, roughly 4 times longer on average in the original multilingual mT5/ByT5 training data (Xue et al., 2021). And as Xue et al. (2022) note, the mT5 architecture tends to need less training time than ByT5. We compared the models after an equal amount of training samples (100k updates). We also continued the training of the ByT5 model, using more than five times the number of updates. + +# 3.3.1 mBART + +We continued training of the pretrained multilingual BART25 model (mBART) (Liu et al., 2020), using the original pretraining objective on texts in Icelandic and English. The training of the model is detailed in Appendix A. This model, mBARTENIS, was then finetuned on the synthetic error data, to teach it to correct errors in Icelandic texts. + +Training on the synthetic error data was performed with an effective batch size of 3000 input tokens (roughly 60 sequences), a learning rate of 3e-5 with an inverse square root scheduler, 0.1 dropout, 0.3 attention dropout, 1000 warmup steps, 0.1 label smoothing, no weight decay, and using the Adam optimizer, for 100k updates on an A100 card for a day. $^{3}$ + +In addition to the above experiments, we conducted separate experiments using segmentation regularization (Kudo, 2018) to introduce more noise to the training examples and explore alternative measures to mitigate the subword tokenization problem. The BART architecture uses unigram subword units; we applied subword regularization with $\alpha = 0.7$ and keep all other parameters unchanged. + +# 3.3.2 ByT5 + +For the byte-level approach we employed the ByT5-base model (Xue et al., 2022), which is based on the multilingual T5 model (Raffel et al., 2020), but operates on bytes instead of subwords. The ByT5 model is pretrained on over 100 languages, but has only seen a limited amount of Icelandic. The mC4 dataset which is used to train ByT5 and mT5 is also lacking in quality for low-resource languages, in particular for Icelandic, as shown by Snæbjarnarsson et al. (2022). + +The pretraining task in ByT5 has been adapted + +to a byte-level model, with span infilling based on bytes, not subwords. Apart from this, the main difference between the mT5 and ByT5 model architecture is the heavier encoder of ByT5. + +Sequences in byte-level architectures are long and correspond more or less to the number of characters in Icelandic, resulting in increased training time. We trained the ByT5-base model using a maximum sequence length of 512 bytes, which was found to be a reasonable compromise, as most sentences in Icelandic texts are shorter than this. + +The ByT5-base model was finetuned on the synthetic data with an effective batch size of 32 sequences (sentences). The learning rate was set to 2e-5 using the Adam optimizer with 1000 warmup steps and no weight decay. This model was further trained for a total of 550k updates, or 13 A100 card days. + +# 3.3.3 mT5 + +For a more direct comparison of byte-level and subword-level models, we also finetuned the mT5-base (Xue et al., 2021) model on the same data, with the notable difference to the mBART model that it was not further trained on Icelandic. The mT5 models were pretrained on the same data as ByT5 and have a similar architecture, as described above, and are thus as comparable as subword and byte-level models can be. As previously mentioned, mT5-base is the base for the state-of-the-art gT5 (Rothe et al., 2021) model for multilingual GEC. + +We finetuned the mT5-base model on the synthetic data using the same parameters as in our ByT5-base finetuning and evaluated it at 100k updates. + +# 3.4 Finetuning on curated corpora + +Using the curated error corpora (IceEC), we finetuned the byte-level and subword-level models to convergence. For the mBART model, this meant training with a learning rate of 2e-6 for 53k updates (67 epochs), with attention dropout set to 0.1, weight decay to 0.001 and other parameters being the same as during the synthetic finetuning. + +The ByT5 and mT5 models were finetuned with a learning rate of 2e-6, other parameters were the same as during finetuning on the synthetic data. The ByT5 model had converged at 120k updates (60 epochs), while the mT5 was still improving on the validation data at 200k updates (100 epochs), but with time we found it forgot too much of the synthetic error correction task. We report evaluation scores at 130k. + +For comparison, we also finetuned the different models (mBART-ENIS, mT5 and ByT5-base) on the IceEC data only, without the synthetic finetuning phase. This was done to examine how much the models learn from the added synthetic examples, and how far we can get using a small amount of hand-corrected examples. The mT5 and ByT5 models were trained for 100k updates and the mBART-ENIS model for 10k updates. + +# 4 Results + +Different metrics exist for evaluating GEC performance, but most are language-specific, and have not been adapted to Icelandic. Here we employ a language agnostic metric for scoring our models, the GLEU score (Napoles et al., 2015, 2016). $\mathrm{GLEU}^6$ is a variant of the BLEU (Papineni et al., 2002) score used to evaluate machine-translation output. It has been modified to account for both the source and the reference, by rewarding overlap between the source and the target sentence, and penalizing n-grams that should have been changed, but were not. + +When evaluating GEC for English, ERRANT (Bryant et al., 2017) is commonly used. It is a span-based correction method that uses the $F_{0.5}$ metric, where precision weighs twice as much as recall. Though this metric has not been implemented for Icelandic, we also report ERRANT scores using a language-agnostic approach, disregarding error types and only reporting the span-based $F_{0.5}$ scores for each test set. These results are shown in Table 5 in Appendix E; they align well with the GLEU results in Table 3 which are described below. + +We consider a variety of curated and synthetic test sets to get a good overview of the differences between the byte-level and subword-level approach for GEC. For the real errors, we report scores over the IceEC.test set, the test set from the IceEC, which contains around 5000 sentences. In con + +trast, the dyslexic, L2 and children test sets contain 500 held-out sentences each from the respective specialized error corpora described in section 3.1 (only 100 examples were collected for the dativitis error type, a rarer occurrence in the data). We also annotated a small dataset (163 sentences) of data from an Icelandic news outlet (news), where each sentence contains at least one error; this is further described in Appendix B. + +For the synthetic errors, we report GLEU scores over the test.synth set, which contains around 4000 held-out sentences from the synthetic data. Furthermore, we generated test sets of synthetic examples, each containing a particular error type in each sentence (dativitis, spaces, commas, dupl-words, mood, rand-noise, noun-case). This last group of test sets was generated using source texts that, while editorial, may include other errors, just like the synthetic training examples. The models, as they get better, learn to correct these errors as well. This may paradoxically lower the GLEU score as the corrected output deviates from the erroneous reference. These generated test sets still provide valuable information about what the models learn about each error type in isolation. + +To understand what approach is best suited for GEC we trained the models on different data combinations and using different pre-trained models. The Synth-100k models are all trained for 100k updates on the same synthetic data, and the Synth-100k-EC models are additionally finetuned on the curated IceEC error corpus. To provide a baseline for the GLEU scores, we also report no_corr scores, where the source text is not corrected. This gives some idea of the noise level of the test sets, with test.synth being the noisiest and IceEC.test containing the least noise. + +The GreynirCorrect (Óladóttir et al., 2022) (GC) results were produced by applying GreynirCorrect to the test sets in its two configurations; correcting single-word errors on the one hand (spell.) and all errors found on the other (all). The GC system was developed in part to focus on the error categories and error frequencies defined in the IceEC training data, and this may be reflected in the scores for the IceEC test sets (asterisked in Table 3). The news test set $(\dagger)$ was created using only sentences flagged by GC (see Appendix B) and is therefore heavily biased towards that system. + +Models trained only on the synthetic data (Synth 100k) generally perform best on the synthetic er + +
CURATED ERROR CORPORASYNTHETIC ERROR CORPORA
TRAINING DATAMODELIceEC.testdyslexicL2childrennewstest.synthdativitisspacescommasdupl-wordsmoodrand-noisenoun-case
(not trained)no corr.83.439.147.533.376.62.974.372.365.879.065.964.631.0
(rule-based)GC (spell.)84.6*44.2*47.3*38.2*89.1†31.873.475.665.192.865.483.830.6
GC (all)83.6*44.6*47.3*38.2*92.9†31.888.074.663.597.467.684.137.8
Synth 100kmB-ISEN83.444.548.439.183.389.990.098.073.898.488.196.787.9
mB-ISEN+reg83.444.548.339.383.490.189.897.975.698.288.996.888.5
mT583.444.147.438.383.484.483.597.671.797.983.895.582.8
ByT583.646.148.939.784.091.594.398.276.698.283.096.888.7
Error Corpora (EC)mB-ISEN85.345.052.238.982.212.073.088.365.986.080.074.547.1
mB-ISEN+reg85.746.853.642.382.813.874.189.666.785.480.875.248.8
mT584.641.746.436.878.54.473.382.264.881.965.465.530.3
ByT585.946.550.643.481.820.072.290.069.189.071.275.032.7
Synth 100k + ECmB-ISEN86.550.057.647.686.379.389.695.672.096.287.393.077.7
mB-ISEN+reg86.450.856.847.586.180.190.196.172.596.987.693.479.8
mT586.347.452.842.985.865.075.395.369.195.680.190.457.7
ByT587.053.458.350.187.880.593.196.672.981.386.493.581.0
Synth 550kByT584.246.349.440.984.395.096.498.078.997.086.597.291.4
Synth 550k + ECByT587.454.959.651.989.488.593.096.875.588.688.294.890.2
+ +Table 3: GLEU scores for Icelandic GEC over different model and data combinations. The two highest-scoring configurations for each subcorpus are in bold while the highest score is underlined. Scores marked with a symbol are explained in Section 3. + +ror corpora and thus solve the more simple and systematic spelling errors such as mistakes in punctuation, missing white space and word duplication. Their performance on the curated error corpora is somewhat lacking. + +In contrast, models trained only on the curated error corpora (EC) generally produce somewhat better GLEU scores on the curated error corpora than the Synth 100k models, but do not generalize to the error categories presented in the synthetic test sets. They are also unable to correct multiple errors in a single sentence (test.synth). + +Training on the synthetic data and then fine-tuning on the curated error corpora (Synth100k/Synth550k+EC) performs best on the curated errors and retains much of the performance on the synthetic test sets. In all of these experiments, we can see that the ByT5 models generally perform better than the subword counterparts. + +This is also reflected in the ERRANT scores in Appendix E, Table 5, where the ByT5 models score highest overall. + +# 5 Discussion & Conclusion + +Our results show that the ByT5 models are the overall high-scoters on the real-world test sets, and on most of the synthetic ones. We include finetuning results on the ByT5 model that has been trained for longer on the synthetic data (550k updates) to + +compare how performance improves with time. We see the GLEU scores keep going up with time, and more importantly, when taking a close look at the actual generated output, this is the model that best corrects real-world errors. This makes it the most feasible option for use in real-world scenarios. A comparison of the output of the models trained on both data sources is shown in Appendix D. + +An example from the test data is when the subword-tokenized model mBART-ENIS-Synth100k+EC incorrectly changes the name of a person from a rare name ("Láretta") to a more common one ("Lára"). This kind of error is not seen in the byte-level model, which is quite conservative in its corrections of unknown entities. While this means ByT5 occasionally misses actual errors, we find that it is much better suited for production than a subword-level model that makes serious semantic errors. These more nuanced error correction examples may not be fully captured by the automated metrics, but are crucial for real-world use. + +The subword regularization experiments are included as an alternative approach for mitigating the subword tokenization problem. The results are marginally better than the model without subword regularization when trained on the synthetic data, and the model performs better than the ByT5-Synth100k model in the case of dupli + +cate words, which linguistically is a quite trivial task, and in more intricate mood errors. It however doesn't do any better than the mB-ISEN-Synth100k trained without subword regularization on the curated datasets, and this also holds when the model is finetuned additionally on curated data. The model finetuned on only the curated data with subword regularization (mB-ISEN-reg-EC) however performs consistently much better than its counterpart without subword regularization, often on par with or surpassing ByT5. This model has not seen any of the highly noised synthetic data, and thus has the most to gain from the subword noise. We speculate that this is one of the reasons we don't see more gains from adding subword regularization; the training examples are already so highly noised that there is not much to be learned from the added subword noise. + +The IceEC finetuning data contain real-world errors which have been hand-corrected. These texts are somewhat different from the highly noised training examples with synthetic errors, have fewer errors on average and are more varied as they are naturally occurring. They also include stylistic edits from the reviewers, which improve the text's fluency, but in those cases the original is not necessarily incorrect as per the language standard. With these differences in mind, we expect the models to have to forget some of the synthetic error correction task in order to adapt to this "new" denoising task. We see this happen in the mBART-ENIS finetuning on the curated data, and to a lesser extent in the ByT5 finetuning. The denoising task performance on the synthetic errors from the previous step has in part been lost, which is expected, since some of these errors are not particularly common in real texts. + +For the more grammatically complex error-types in the synthetic data (dativitis and changes to noun cases and verb moods), we find that the mBARTENIS trained on synthetic data generally does well; for some subsets even surpassing the ByT5 counterpart that was finetuned on curated corpora. We suspect that this has to do with the linguistic knowledge the model has already gained during its pretraining on Icelandic texts, as explained in Appendix A. The ByT5 model that was trained for longer however manages to surpass it on the mood error type, indicating that it is still adapting to the Icelandic language, alongside its primary denoising task. + +The models trained on only the finetuning data perform the worst throughout. The results show that they do not manage to correct the synthetic categories much beyond the baseline, except for mBART-ENIS in some cases. We expect that this has to do with their extra knowledge of Icelandic and the denoising objective used in the synthetic error correction finetuning. The results for these models on the curated in-domain test sets are in fact mostly on par with the models finetuned on the synthetic data only. Looking at the generated output, we see that the error types these models correct are not the same as those that the synthetic-only models are able to correct, which is expected, as they are trained on different data. + +We conclude that adopting a byte-level approach rather than a subword approach leads to best results for the task of GEC, at the very least in the case of a morphologically rich language such as Icelandic. Finally, we find that the optimal way of capturing a wide range of errors is to train on a combination of synthetic and curated data, particularly when the curated data is limited. + +# Limitations + +Potential limitations to our work can mainly be attributed to two factors: 1) the fact that we run our experiments using the Icelandic language, and 2) inherent biases in the corpora we use. + +Icelandic is North Germanic language (along with Faroese, Norwegian, Danish and Swedish) As such, it is both Germanic and Indo-European While we are fairly confident that our results hold for these languages, different results may hold for other languages, particularly those not using Latin script or those using logograms, such as Chinese characters. + +The curated datasets we use only represent a fairly small proportion of all possible demographics and users of the Icelandic language. In particular, annotations are performed by a handful of university students, bringing in their biases to the annotated data. Even so, the data should serve well to compare the relative differences. + +The resources we use to develop the models consist of a few high-performing GPUs. While these are powerful, this is a relatively low requirement compared to many industry or academic use cases + +Finally, it is worth re-iterating that the ByT5 model we use is slow compared to subword-based models for texts of similar length. Inference in our + +setting was around $2.3\mathrm{x}$ slower on average than for mT5. As such, production use of these methods may be better suited to offline processing, particularly for longer documents. + +# Ethics Statement + +While we do not believe the data we use to train the error-correcting models to be sensitive, the models can be applied in sensitive settings where an incorrect edit may cause an issue. As such, corrections may introduce both stylistic or semantic changes based on either the biases found in the pretrained models or the curated error corpora. + +In particular, we have noticed a bias in the subword-based models for entities, such as locations, being overcorrected to a different entity if there is a spelling mistake in the input. + +The stylistic changes found in the curated Icelandic corpora may reflect on the socio-economic background of the annotators and writers of the data. While we don't believe this to be a large issue in this particular setting, one can easily imagine this to be more complex in regions where language use is connected to disputes or oppression. As such, a text correction or improvement tool could be used to homogenize discourse or otherwise limit freedom of expression, knowingly or unknowingly. + +# Acknowledgements + +We thank the Icelandic Language Technology Program (Nikulásdóttir et al., 2020). It has enabled the authors to focus on work in Icelandic NLP. Snæbjarnarson was partially funded by the Pioneer Centre for AI, DNRF grant number P1, during the time of this work. Finally, we thank the anonymous reviewers for their helpful feedback. + +# References + +Neil Alexander-Passe. 2015. The dyslexia experience: Difference, disclosure, labelling, discrimination and stigma. Asia Pacific Journal of Developmental Differences, 2. +Pórunn Arnardóttir, Pórdis Drofn Andrésdóttir, Póður Arnar Árnason, Hildur Hafsteinsdóttir, Samuel Périsson, Einar Freyr Sigurdsson, and Kristín Bjarnadóttir. 2020. Icelandic search query errors (IceSQuEr) 0.1. CLARIN-IS. +Pórunn Arnardóttir, Isidora Glisic, Annika Simonsen, Lilja Stefánsdóttir, and Anton Ingason. 2022. Error corpora for different informant groups: Annotating and analyzing texts from L2 speakers, people with + +dyslexia and children. In Proceedings of the 19th International Conference on Natural Language Processing (ICON), pages 245-252, New Delhi, India. Association for Computational Linguistics. +Porunn Arnardóttir, Xindan Xu, Dagbjörnt Guðmundsdóttir, Lilja Björk Stefánsdóttir, and Anton Karl Ingason. 2021. Creating an error corpus: Annotation and applicability. In CLARIN Annual Conference 2021, page 59. +Kristín Bjarnadóttir. 2019. The database of modern Icelandic inflection (DMII). CLARIN-IS. +Chris Brockett, William B. Dolan, and Michael Gamon. 2006. Correcting ESL errors using phrasal SMT techniques. In Proceedings of the 21st International Conference on Computational Linguistics and 44th Annual Meeting of the Association for Computational Linguistics, pages 249-256, Sydney, Australia. 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 the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 793-805, Vancouver, Canada. Association for Computational Linguistics. +Shamil Chollampatt and Hwee Tou Ng. 2018. A multilayer convolutional encoder-decoder neural network for grammatical error correction. In Proceedings of the Thirty-Second AAAI Conference on Artificial Intelligence and Thirtieth Innovative Applications of Artificial Intelligence Conference and Eighth AAAI Symposium on Educational Advances in Artificial Intelligence, AAAI'18/IAAI'18/EAAI'18. AAAI Press. +Jonathan H. Clark, Dan Garrette, Iulia Turc, and John Wieting. 2022. Canine: Pre-training an efficient tokenization-free encoder for language representation. Transactions of the Association for Computational Linguistics, 10:73-91. +Sergey Edunov, Myle Ott, Michael Auli, and David Grangier. 2018. Understanding back-translation at scale. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 489-500, Brussels, Belgium. Association for Computational Linguistics. +Steffen Eger and Yannik Benz. 2020. From hero to zéroe: A benchmark of low-level adversarial attacks. 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 786-803, Suzhou, China. Association for Computational Linguistics. +Mariano Felice and Zheng Yuan. 2014. Generating artificial errors for grammatical error correction. In Proceedings of the Student Research Workshop at the + +14th Conference of the European Chapter of the Association for Computational Linguistics, pages 116-126, Gothenburg, Sweden. Association for Computational Linguistics. +Roman Grundkiewicz and Marcin Junczys-Dowmunt. 2014. The WikEd error corpus: A corpus of corrective Wikipedia edits and its application to grammatical error correction. In Advances in Natural Language Processing, pages 478-490, Cham. Springer International Publishing. +Roman Grundkiewicz and Marcin Junczys-Dowmunt. 2019. Minimally-augmented grammatical error correction. In Proceedings of the 5th Workshop on Noisy User-generated Text (W-NUT 2019), pages 357-363, Hong Kong, China. Association for Computational Linguistics. +Atli Jasonarson, Steinpór Steingrímsson, Einar Sigurðsson, Arni Magnússon, and Finnur Ingimundarson. 2023. Generating errors: OCR post-processing for Icelandic. In Proceedings of the 24th Nordic Conference on Computational Linguistics (NoDaLiDa), pages 286-291, Torshavn, Faroe Islands. University of Tartu Library. +Jianshu Ji, Qinlong Wang, Kristina Toutanova, Yongen Gong, Steven Truong, and Jianfeng Gao. 2017. A nested attention neural hybrid model for grammatical error correction. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 753-762, Vancouver, Canada. Association for Computational Linguistics. +Marcin Junczys-Dowmunt, Roman Grundkiewicz, Shubha Guha, and Kenneth Heafield. 2018. Approaching neural grammatical error correction as a low-resource machine translation task. 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 595-606, New Orleans, Louisiana. Association for Computational Linguistics. +Sosuke Kobayashi. 2018. Homemade bookcorpus. +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. +Jindrich Libovický, Helmut Schmid, and Alexander Fraser. 2022. Why don't people use character-level machine translation? In Findings of the Association for Computational Linguistics: ACL 2022, pages 2470-2485, Dublin, Ireland. 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, Volume 1 (Long and Short Papers), pages 3291-3301, Minneapolis, Minnesota. 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. +Jakub Náplava and Milan Straka. 2019. Grammatical error correction in low-resource scenarios. In Proceedings of the 5th Workshop on Noisy User-generated Text (W-NUT 2019), pages 346-356, Hong Kong, China. Association for Computational Linguistics. +Courtney Napolles, Keisuke Sakaguchi, Matt Post, and Joel Tetreault. 2015. Ground truth for grammatical error correction metrics. 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 588-593, Beijing, China. Association for Computational Linguistics. +Courtney Naples, Keisuke Sakaguchi, Matt Post, and Joel Tetreault. 2016. GLEU without tuning. eprint arXiv:1605.02592 [cs.CL]. +Anna Nikulásdóttir, Jón Guðnason, Anton Karl Ingason, Hrafn Loftsson, Eiríkur Rögnvaldsson, Einar Freyr Sigurðsson, and Steinþör Steingrímsson. 2020. Language technology programme for Icelandic 2019-2023. In Proceedings of the Twelfth Language Resources and Evaluation Conference, pages 3414-3422, Marseille, France. European Language Resources Association. +Hulda Oladottir, Pórunn Arnardóttir, Anton Ingason, and Vilhjalmur Porsteinsson. 2022. Developing a spell and grammar checker for Icelandic using an error corpus. In Proceedings of the Thirteenth Language Resources and Evaluation Conference, pages 4644-4653, Marseille, France. European Language Resources Association. +Kostiantyn Omelianchuk, Vitaliy Atrasevych, Artem Chernodub, and Oleksandr Skurzhanskyi. 2020. GECToR - grammatical error correction: Tag, not rewrite. In Proceedings of the Fifteenth Workshop on Innovative Use of NLP for Building Educational Applications, pages 163-170, Seattle, WA, USA → Online. Association for Computational Linguistics. +Vilhjalmur Borsteinsson, Hulda Oladottir, and Hrafn Loftsson. 2019. A wide-coverage context-free grammar for Icelandic and an accompanying parsing system. In Proceedings of the International Conference + +on Recent Advances in Natural Language Processing (RANLP 2019), pages 1397-1404, Varna, Bulgaria. INCOMA Ltd. +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. +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. +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. +Sadaf Abdul Rauf, Ramsha Saeed, Noorulain Saleem Khan, Kiran Habib, Pernia Gabrail, and Fareeha Aftab. 2017. Automated grammatical error correction: A comprehensive review. NUST Journal of Engineering Sciences, Vol. 10, No.2. +Sascha Rothe, Jonathan Mallinson, Eric Malmi, Sebastian Krause, and Aliaksei Severyn. 2021. A simple recipe for multilingual 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 (Volume 2: Short Papers), pages 702-707, Online. Association for Computational Linguistics. +Phillip Rust, Jonas F. Lotz, Emanuele Bugliarello, Elizabeth Salesky, Miryam de Lhoneux, and Desmond Elliott. 2023. Language modelling with pixels. In *The Eleventh International Conference on Learning Representations*. +Eiríkur Rögnvaldsson. 2022. Deliverable d1.19 report on the Icelandic language. EU project European Language Equality (ELE). +Allen Schmaltz, Yoon Kim, Alexander Rush, and Stuart Shieber. 2017. Adapting sequence models for sentence correction. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 2807-2813, Copenhagen, Denmark. 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. + +Vésteinn Snæbjarnarson, Haukur Barri Simonarson, Petur Orri Ragnarsson, Svanhvit Lilja Ingólfsdóttir, Haukur Jónsson, Vilhjalmur Thorsteinsson, and Hafsteinn Einarsson. 2022. A warm start and a clean crawled corpus - a recipe for good language models. In Proceedings of the Thirteenth Language Resources and Evaluation Conference, pages 4356-4366, Marseille, France. European Language Resources Association. +Felix Stahlberg and Shankar Kumar. 2021. Synthetic data generation for grammatical error correction with tagged corruption models. In Proceedings of the 16th Workshop on Innovative Use of NLP for Building Educational Applications, pages 37-47, Online. Association for Computational Linguistics. +Lukas Stankevicius and Mantas Lukoševicius. 2022. Towards Lithuanian grammatical error correction. In Artificial Intelligence Trends in Systems, pages 490-503, Cham. Springer International Publishing. +Lukas Stankevicius, Mantas Lukosevicius, Jurgita Kapočutić-Dzikiene, Monika Briediene, and Tomas Krilavicius. 2022. Correcting diacritics and typos with a ByT5 transformer model. ArXiv, abs/2201.13242. +Steinpór Steingrímsson, Sigrún Helgadóttir, Eiríkur Rögnvaldsson, Starkáður Barkarson, and Jon Gudnason. 2018. Risamálheild: A very large Icelandic text corpus. In Proceedings of the Eleventh International Conference on Language Resources and Evaluation, LREC 2018, Miyazaki, Japan. +Milan Straka, Jakub Náplava, and Jana Strakova. 2021. Character transformations for non-autoregressive GEC tagging. In Proceedings of the Seventh Workshop on Noisy User-generated Text (W-NUT 2021), pages 417-422, Online. Association for Computational Linguistics. +Yi Tay, Vinh Q. Tran, Sebastian Ruder, Jai Prakash Gupta, Hyung Won Chung, Dara Bahri, Zhen Qin, Simon Baumgartner, Cong Yu, and Donald Metzler. 2021. Charformer: Fast character transformers via gradient-based subword tokenization. CoRR, abs/2106.12672. +Jörg Tiedemann. 2012. Parallel data, tools and interfaces in OPUS. In Proceedings of the Eighth International Conference on Language Resources and Evaluation (LREC'12), pages 2214-2218, Istanbul, Turkey. European Language Resources Association (ELRA). +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. +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. + +Ziang Xie, Guillaume Genthial, Stanley Xie, Andrew Ng, and Dan Jurafsky. 2018. Noising and denoising natural language: Diverse backtranslation for grammar correction. 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 619-628, New Orleans, Louisiana. Association for Computational Linguistics. + +Linting Xue, Aditya Barua, Noah Constant, Rami Al-Rfou, Sharan Narang, Mihir Kale, Adam Roberts, and Colin Raffel. 2022. Byt5: Towards a token-free future with pre-trained byte-to-byte models. Transactions of the Association for Computational Linguistics, 10:291-306. + +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. + +Zheng Yuan and Ted Briscoe. 2016. Grammatical error correction using neural machine translation. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 380-386, San Diego, California. 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, pages 318-328, Online. Association for Computational Linguistics. + +# A mBART-ENIS training + +We continued the pretraining of the multilingual BART25 model using texts from various sources in Icelandic and English. The Icelandic text used was the Icelandic Common Crawl corpus (IC3) (Snæbjarnarson et al., 2022), IGC (Steingrímsson et al., 2018), papers published in the Icelandic Medical Journal (https://hirsla.lsh.is), text extracted from Icelandic student theses (https://skemman.is), and Icelandic e-books in the public domain (https://rafbokavefur.is). English + +data used was the Newscrawl 2019-2020 dataset (Tiedemann, 2012), English Wikipedia and the Books3 corpus (Kobayashi, 2018). + +The goal of the pretraining is that the model already has some knowledge of the Icelandic language. English is included as we speculate that it is beneficial to continue including a language used in the earlier training, making the model a better starting point for other use cases such as machine translation and cross-lingual transfer tasks. + +Due to the English data outnumbering the Icelandic data, we upsampled the Icelandic data by about a factor of 6.5, resulting in a sample language probability of $55\%$ English and $45\%$ Icelandic. + +The model has 354M non-embedding parameters, and 256M parameters for embeddings. Note that not all of them are used when only training on Icelandic and English. The model was trained for 316k updates with an effective batch size of 44k tokens per update, 5k warmup steps, a learning rate of 7.5e-5 and a dropout of 0.2. Other hyperparameters, such as for noising, were the same as for the original mBART model. The training took approximately 18 A100 days but was not continued until convergence due to computational constraints. + +# B News test set collection and annotation + +We collected a small test set of erroneous sentences by running news articles from the RUV (National Icelandic Broadcasting Service) website through the open-source GreynirCorrect (Öladóttir et al., 2022) spelling and grammar correction tool for Icelandic. We filtered out the sentences flagged as containing errors, and manually chose 163 sentences that contained only a single obvious error, for evaluation clarity. The sentences were then hand-corrected by a linguist and used as an additional test set in our experiments. (Since Greynir-Correct was used to find the erroneous sentences, this test set is unreliable for evaluating that particular system's performance.) + +# C Icelandic-specific grammatical noise + +We generated various grammatical errors to create our synthetic error corpus. Icelandic has four grammatical cases; we swapped those randomly in nouns, producing ungrammatical sentences of a type commonly seen in learner texts. We also changed the mood of verbs from the subjunctive to the indicative, a variation often seen for both native speakers and learners. Another common variation, + +which is more or less accepted in informal language but still discouraged in formal language and written texts, is the so-called "dativitis", i.e., the use of the dative case instead of the accusative or nominative with certain verbs with oblique subjects, such as "mér (dat) hlakkar" ("I look forward to") instead of "ég (nom) hlakka", or "Páli (dat) langar" ("Páll wants") instead of "Pál (acc) langar". This modification was produced using the Greynir engine by extracting and modifying whole nominal clauses. + +We used available resources to apply realistic misspellings to single words – these are lists of common misspellings and their corrections. We located the corresponding correctly spelled words in the corpus and substituted their misspelled variants from the error lists. The error lists are sourced from nonwords and misspellings in IceSQuER (Arnardóttir et al., 2020), the IceEC (Arnardóttir et al., 2021), The Database of Modern Icelandic Inflection (Bjarnadóttir, 2019), and GreynirCorrect (Öladóttir et al., 2022). + +# D Example outputs + +We selected three sentences at random from the dyslexia subcorpus of the IceEC. These sentences, their corrected reference and the respective corrected outputs from various model variants can be seen in Table 4. The examples show some of the paraphrasing and stylistic changes that appear in the IceEC, which can be substantial, and that we don't expect the neural models to mimic. + +# E ERRANT results + +Table 5 presents ERRANT scores for the test sets. The data is tokenized and converted to M2 format, then evaluated using the original ERRANT scorer developed by Bryant et al. (2017). + +
ModelText
OriginalEf notandi valdi aδ ὄντa ἀ rétt kemur upp bessi sίδa bar sem notandi getur seδ nánar um réttin meδ innihaldsefnun og næringaupplésingum.
ReferenceEf notandi valdi aδ ὄντa ἀ rétt kemur upp bessi sίδa bar sem notandi getur seδ nánari upplésingar um réttinn, innihaldsefni og næringarupplésingar.
mB-ISEN-Synth100k+ECEf notandi valdi aδ ὄντa ἀ rétt kemur upp bessi sίδa bar sem notandi getur seδ nánar um réttinn meδ innihaldsefnunum og næringarupplésingum.
mT5-Synth100k+ECEf notandi valdi aδ ὄντa ἀ rétt kemur upp bessi sίδa bar sem notandi getur seδ nánar um réttinn meδ innihaldsefnun og næringaupplésingum.
ByT5-Synth100k+ECEf notandi valdi aδ ὄντa ἀ rétt kemur upp bessi sίδa bar sem notandi getur seδ nánar um réttinn meδ innihaldsefnum og næringarupplésingum.
ByT5-Synth550k+ECEf notandi velur aδ ὄντa ἀ rétt kemur upp bessi sίδa bar sem notandi getur seδ nánar um réttinn meδ innihaldsefni og næringarupplésingum.
OriginalEn aftur á moi hefur sá hopur sem reykir marjuáana daglega eining stækkaö, en dregið ur áfengisneyslu.
ReferenceSömuleiðis hefur dregið ur áfengisneyslu. Aftur á moi hefur sá hopur sem reykir marijuáana daglega einnig stækkaö.
mB-ISEN-Synth100k+ECEn aftur á moi hefur sá hopur sem reykir marjuáana daglega eining stækkaö, en dregið ur áfengisneyslu.
mT5-Synth100k+ECEn aftur á moi hefur sá hopur sem reykir marjuáana daglega eining stækkaö, en dregið ur áfengisneyslu.
ByT5-Synth100k+ECAftur á moi hefur sá hopur sem reykir marjuáana daglega einnig stækkaö, en dregið ur áfengisneyslu.
ByT5-Synth550k+ECAftur á moi hefur sá hopur sem reykir marijuáana daglega einnig stækkaö, en dregið ur áfengisneyslu.
OriginalPað koma alltaf sama villan sem má sjá _ mynd 1.
ReferencePað koma alltaf sama villan sem má sjá é mynd 1.
mB-ISEN-Synth100k+ECPað kemur alltaf sama villan sem má sjá é mynd 1.
mT5-Synth100k+ECPað koma alltaf sama villan sem má sjá é mynd 1.
ByT5-Synth100k+ECPað koma alltaf sama villan sem má sjá é mynd 1.
ByT5-Synth550k+ECPað koma alltaf sama villan sem má sjá é mynd 1.
+ +Table 4: Example outputs from selected models, on evaluation data sourced from the IceEC dyslexia corpus. Red indicates an error, and teal a correct word or phrase in the context of the sentence. Model outputs may not correspond to the hand-corrected reference sentence, but still be a quality correction of the original. + +
CURATED ERROR CORPORASYNTHETIC ERROR CORPORA
TRAINING DATAMODELIceEC.testdyslexicL2childrennewstest.synthdativitisspacescommasdupl-wordsmoodrand-noisenoun-case
(not trained)GC (spell.)0.36*0.35*0.20*0.37*0.78†0.750.050.540.000.860.060.790.04
(rule-based)GC (all)0.32*0.35*0.22*0.40*0.75†0.750.720.470.000.870.340.740.40
Synth 100kmB-ISEN0.480.510.500.540.690.920.660.790.400.850.770.840.87
mB-ISEN+reg0.460.520.480.550.670.920.700.820.400.870.780.850.88
mT50.260.350.200.350.570.950.660.890.390.900.770.910.92
ByT50.290.400.230.370.580.970.850.910.590.930.760.920.93
Error Corpora (EC)mB-ISEN0.400.370.350.360.530.510.000.750.130.700.710.610.63
mB-ISEN+reg0.440.410.410.470.570.540.070.740.200.650.710.610.65
mT50.310.170.130.240.290.260.000.660.000.500.030.210.00
ByT50.450.380.300.450.500.650.020.770.270.760.440.600.15
Synth 100k + ECmB-ISEN0.480.510.500.540.690.920.660.790.400.850.770.840.87
mB-ISEN+reg0.460.520.480,550.670.920.700.820.400.870.780.850.88
mT50.470.440.380.470.690.890.300.830.290.900.700.840.76
ByT50.520.560.520.570.700.920.780.830.450.450.780.860.88
Synth 550kByT50.310.420.250.390.610.980.870.900.630.880.750.920.91
Synth 550k + ECByT50.540.570.540.580.740.950.750.820.510.720.780.850.90
+ +Table 5: ERRANT span-based $F_{0.5}$ scores calculated over different model and data combinations. The best scoring setup per error subcorpus is in bold. Scores marked with a symbol are explained in Section 3. + +A For every submission: + +A1. Did you describe the limitations of your work? + +Limitations section towards the end, unnumbered + +A2. Did you discuss any potential risks of your work? + +Limitations section towards the end, unnumbered + +A3. Do the abstract and introduction summarize the paper's main claims? + +4 and 5 + +A4. Have you used AI writing assistants when working on this paper? + +Left blank. + +B Did you use or create scientific artifacts? + +3 + +B1. Did you cite the creators of artifacts you used? + +3 + +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? + +The code and models are open-source + +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +Not applicable. Left blank. + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? + +Corpus data used has already been published by an official source and measures have been taken there to anonymize sensitive data, as described in the relevant publications. + +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? + +3 + +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. + +3.2 + +C Did you run computational experiments? + +3.2 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +3.2 + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +3.2 + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +Simple statistics reported, but described in detail in Section 4 + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +3 + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +No response. + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +No response. + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +No response. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +No response. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +No response. \ No newline at end of file diff --git a/bytelevelgrammaticalerrorcorrectionusingsyntheticandcuratedcorpora/images.zip b/bytelevelgrammaticalerrorcorrectionusingsyntheticandcuratedcorpora/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..3f615597c72182b8a3a8b7b54b1349163af24548 --- /dev/null +++ b/bytelevelgrammaticalerrorcorrectionusingsyntheticandcuratedcorpora/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7092461637667040fed1056d8d13b039dc31425f88725390e3c645acc9447ff4 +size 717698 diff --git a/bytelevelgrammaticalerrorcorrectionusingsyntheticandcuratedcorpora/layout.json b/bytelevelgrammaticalerrorcorrectionusingsyntheticandcuratedcorpora/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..64f1cbb92ef71b618d080fa9d07bf912c9d2d5d6 --- /dev/null +++ b/bytelevelgrammaticalerrorcorrectionusingsyntheticandcuratedcorpora/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:53189969f7ddb7650e0419dcc7b4dae0de30a1620d73eb146d2789ab1428d97d +size 412347 diff --git a/cameconfidenceguidedadaptivememoryefficientoptimization/60cd4999-237f-44fe-8749-7dea8e922f53_content_list.json b/cameconfidenceguidedadaptivememoryefficientoptimization/60cd4999-237f-44fe-8749-7dea8e922f53_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..96fa2a3c36c5d74df44f0531f8017b83fb208aca --- /dev/null +++ b/cameconfidenceguidedadaptivememoryefficientoptimization/60cd4999-237f-44fe-8749-7dea8e922f53_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9b25842cc9a4f06da9dae98960cebb15da0b74bf9b7d0b6b43e3d4effd175b83 +size 71242 diff --git a/cameconfidenceguidedadaptivememoryefficientoptimization/60cd4999-237f-44fe-8749-7dea8e922f53_model.json b/cameconfidenceguidedadaptivememoryefficientoptimization/60cd4999-237f-44fe-8749-7dea8e922f53_model.json new file mode 100644 index 0000000000000000000000000000000000000000..7c5e6f866fea223b40132ff0a50a3c32a8505171 --- /dev/null +++ b/cameconfidenceguidedadaptivememoryefficientoptimization/60cd4999-237f-44fe-8749-7dea8e922f53_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2dfa4106b9498139edc8f783f78cd99968ae8a88955c780db207104e088bc2d8 +size 90781 diff --git a/cameconfidenceguidedadaptivememoryefficientoptimization/60cd4999-237f-44fe-8749-7dea8e922f53_origin.pdf b/cameconfidenceguidedadaptivememoryefficientoptimization/60cd4999-237f-44fe-8749-7dea8e922f53_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d07837f9461f7017c5a0d95c0ee1f726823d7395 --- /dev/null +++ b/cameconfidenceguidedadaptivememoryefficientoptimization/60cd4999-237f-44fe-8749-7dea8e922f53_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c9d26b0750a0789db5648a9a13a43bcc6b7dac508713d2e592b62985a741eff +size 1302537 diff --git a/cameconfidenceguidedadaptivememoryefficientoptimization/full.md b/cameconfidenceguidedadaptivememoryefficientoptimization/full.md new file mode 100644 index 0000000000000000000000000000000000000000..d5b71dfb0b02c47c5edeb99bf249a50fceca334c --- /dev/null +++ b/cameconfidenceguidedadaptivememoryefficientoptimization/full.md @@ -0,0 +1,315 @@ +# CAME: Confidence-guided Adaptive Memory Efficient Optimization + +Yang Luo $^{1*}$ , Xiaozhe Ren $^{2}$ , Zangwei Zheng $^{1}$ , Zhuo Jiang $^{1}$ , Xin Jiang $^{2}$ , Yang You $^{1}$ + +$^{1}$ School of Computing, National University of Singapore + +$^{2}$ Noah's Ark Lab, Huawei + +{yangluo,zangwei,jiangz,youy}@comp.nus.edu.sg + +{renxiaozhe,jiang.xin}@huawei.com + +# Abstract + +Adaptive gradient methods, such as Adam and LAMB, have demonstrated excellent performance in the training of large language models. Nevertheless, the need for adaptivity requires maintaining second-moment estimates of the per-parameter gradients, which entails a high cost of extra memory overheads. To solve this problem, several memory-efficient optimizers (e.g., Adafactor) have been proposed to obtain a drastic reduction in auxiliary memory usage, but with a performance penalty. In this paper, we first study a confidence-guided strategy to reduce the instability of existing memory efficient optimizers. Based on this strategy, we propose CAME to simultaneously achieve two goals: fast convergence as in traditional adaptive methods, and low memory usage as in memory-efficient methods. Extensive experiments demonstrate the training stability and superior performance of CAME across various NLP tasks such as BERT and GPT-2 training. Notably, for BERT pre-training on the large batch size of 32,768, our proposed optimizer attains faster convergence and higher accuracy compared with the Adam optimizer. The implementation of CAME is publicly available1. + +# 1 Introduction + +Robust training of large language models (LLMs) often relies on adaptive gradient-based optimization methods (Li et al., 2022; Kingma and Ba, 2015; Zhuang et al., 2020). Through the use of cumulative second-order statistics, these methods adapt the per-parameter learning rate and demonstrate superior convergence speed during the training process of LLMs. However, the remarkable performance of adaptive methods incurs an extra cost of memory usage indeed. For example, Adam requires to preserve the first moment estimate and second + +![](images/cf0de11d1b408f08da13689c40b27312f31f7e446fb4bb0eed5a01efaef20709.jpg) +Figure 1: Visualization of Non-negative Matrix Factorization (NMF). Generally, NMF reduces the memory requirements from $O(nm)$ to $O(n + m)$ . In this paper, we focus on the special case of rank-1 factors. + +raw moment estimate of each gradient in order to tune the learning rate for each parameter, which inevitably triples the memory usage concerning the optimizer states. Besides, with the growing size of the model, LLMs are becoming increasingly expensive in terms of memory, and the limitation of memory is gradually emerging as a main bottleneck for training LLMs. + +Many existing memory-efficient optimizers attempt to store second-order statistics with sublinear memory requirement while retaining the exceptional convergence property of adaptivity (Shazeer and Stern, 2018; Anil et al., 2019). Adafactor optimizer achieves remarkable memory cost reduction by applying the non-negative matrix factorization algorithm (Lee and Seung, 2000) to factorize the accumulator matrix for squared gradients into two rank-1 factors as shown in Figure 1, where the memory requirement for the original matrix $V$ decreases from $O(nm)$ to $O(n + m)$ . Whereas, it is observed that Adafactor suffers a performance degradation in the training of large language models universally compared with conventional adaptive gradient-based optimization methods. The reason for this phenomenon is Adafactor inevitably introduces some errors that cause instability in training deep networks due to the operation of nonnegative matrix factorization. + +In addition, in the case of large-batch training that aims to accelerate the training of deep neural networks, the memory consumption of each machine (GPU/TPU) is much higher than general batch size training, which further imposes a grave constraint on the performance of the trained model. In comparison to standard training tasks, large-batch training presents more challenges for optimizers. Empirically, when the mini-batch size increases after a certain point (e.g. 1024), the test accuracy of the converged solution decreases significantly compared with the baseline (He et al., 2021). To our knowledge, there is currently no work related to memory-efficient optimizers for large-batch training. + +Motivated by these challenges, we firstly study a confidence-guided strategy catered to alleviate the instability of Adafactor by calculating the confidence of the generated update at each training step. On the basis of the adaptation strategy, we propose a novel CAME optimizer that saves nearly the same memory footprint as existing memory-efficient optimizers while attaining faster convergence and superior generalization performance. To further assess the scalability of our proposed algorithm, we consider an additional challenging experiment - performing large-batch training on BERT using CAME optimizer. + +Contributions of our paper can be summarized in the following: + +- Inspired by training instability of Adafactor, we explore a confidence-guided strategy centered on the existing error in the raw updates of Adafactor for parameters of large language models. + +- In light of the dedicated strategy, we propose a novel optimization algorithm, CAME, for achieving faster convergence and less performance degradation catered at memory-efficient optimization. We further investigate the effect of the proposed memory-efficient optimization algorithm in large-batch training settings. + +- We demonstrate the powerful performance of CAME with extensive NLP experiments: CAME shows faster convergence and better generalization capability than Adam in BERT pre-training task with two different batch sizes (32k and 8k); in the training of GPT-2 model + +and T5 model, CAME achieves fast convergence speed as Adam without degrading of performance. Notably, in the large-batch training of the BERT model, CAME obtains comparable validation accuracy with LAMB using around $15\%$ less memory usage. + +# 2 Related Work + +Memory Efficient Adaptive Optimization Memory efficient optimizers maintain the benefits of standard per-parameter adaptivity while significantly reducing memory footprint. Adafactor (Shazeer and Stern, 2018) proposes to reconstruct a low-rank approximation of the exponentially smoothed accumulator at each training step that is optimal with respect to the generalized Kullback-Leibler divergence. SM3 (Anil et al., 2019) divides the elements in the second-order gradient matrix into sets by the observed similarity of the elements, and each item in the generated approximation matrix is the minimum of the maximum value of each set in which it is located. The methods mentioned above behave poorly in the training of large language models and converge slowly, which raises a significant challenge for memory-efficient optimization methods. + +Large Batch Training A large-batch training scheme is preferred in distributed machine learning because of its ability to increase parallelism by enhancing large-scale cluster utilization. It has seen growing interest in recent years in large-batch training (Liu et al., 2022; Li et al., 2021; Huo et al., 2021). In particular, a layer-wise adaptive learning rate algorithm LARS (You et al., 2017a) is proposed to scale the batch size to $32k$ for ResNet50. Based on LARS, LAMB optimizer (You et al., 2019) can finish the BERT training in 76 minutes through TPU v3 Pod. Despite the success of these approaches for BERT models, the much larger batch size highly boosts the GPU usage which is prohibitively expensive and inaccessible to most researchers. + +Moreover, training with a large batch size incurs additional challenges (Hoffer et al., 2017; Keskar et al., 2016). Large-batch training is prone to converge to sharp local minima, since the number of interactions will decrease when the batch size is increased if the number of epochs is fixed, which causes a wide gap in generalization of the model(Keskar et al., 2016). Traditional methods seek to narrow the generalization gap by carefully + +tuning hyperparameters, such as learning rate, momentum, and label smoothing, to narrow the generalization gap (Goyal et al., 2017a; Shallue et al., 2018; You et al., 2017b). Yet there have been few attempts to reduce memory usage in large-batch training, and the underlying challenge remains unclear. + +# 3 Method + +In this section, we firstly provide a brief description of the Adafactor optimizer and discuss the errors contained in the update of Adafactor (erroneous update). We further study a confidence-guided strategy and introduce the proposed CAME in detail in light of the strategy. + +# 3.1 An overview of Adafactor + +The $\mathcal{L}(\theta) \in \mathbb{R}$ represents the loss function that we plan to minimize, where $\theta \in \mathbb{R}^{n \times m}$ is the parameter of the model. $g_{t}$ is the gradient at step $t$ , $\eta$ is the learning rate, $r_{t}$ and $c_{t}$ are the exponential moving average of two low-rank factors for the second moments of the gradient. $\epsilon_{1}$ is a small regularization constants and $u_{t}$ is the current approximate update. + +In the training of large language models, Adafactor is required to apply momentum to ensure the convergence (Chowdhery et al., 2022), and the corresponding pseudocode is illustrated in Algorithm 1. The problem setting is as follows. Assume that we aim to minimize the expected value of an objective function $f(\theta)$ . At each training step, we receive the loss derived from a mini-batch of data, and calculate the gradient $g_{t}$ of the function based on the previous parameters. Subsequently, we update the exponential running averages of two factors for second moments of the gradient $r_t$ and $c_{t}$ , compute approximations for the second moments of the gradient $v_{t}$ , and adjust the generated update $(u_{t})$ when $RMS(u_{t})$ surpasses a specific threshold value $d$ as in: + +$$ +\hat {u} _ {t} = \frac {u _ {t}}{\operatorname* {m a x} (1 , R M S (u _ {t}) / d)} \tag {1} +$$ + +where $RMS(u_{t})$ refers to the root-mean-square calculation of the components of $u_{t}$ . Finally, the first moment of the adjusted update $m_{t}$ is utilized to update the parameter, resulting in a new iteration $\theta_{t}$ . The optimization continues until the parameters converge and returns the final iteration $\theta_{T}$ as our approximate solution. + +Adafactor derives an effective solution for non-negative matrix factorization in the special case + +![](images/541ee01b8695a948b72e055444821cbb22c5982940baef1df7bf8554c7dbf721.jpg) +Figure 2: Loss landscape visualization for erroneous update of Adafactor in 1-layer multilayer perceptron (MLP) (Haykin, 1994) with same training steps. Adafactor deviates from the training curve of Adam. + +of rank-1 factors, which obtains the minimal Kullback-Leibler divergence (Lee and Seung) between the matrix $V$ and the approximated matrix $WH$ . The formulation of the solution is as follows, in which $1_{m} = (1,\dots,1)\in \mathbb{R}^{m}$ represents a column vector of $m$ ones: + +$$ +W = V 1 _ {m}, \quad H = \frac {1 _ {n} ^ {T} V}{1 _ {n} ^ {T} V 1 _ {m}}. \tag {2} +$$ + +It should be noted that Adafactor stores only the moving averages of these factors rather than the entire matrix $V$ , yielding considerable memory savings and requiring memory usage proportional to $O(n + m)$ instead of $O(nm)$ . + +# 3.2 Erroneous Update + +The non-negative matrix factorization operation in Adafactor will inevitably incur erroneous update in the training of deep neural networks. As shown in Figure 2, Adafactor always converge slower than Adam due to the existing error in calculated updates, which further limits the application scenarios of memory-efficient optimizers. + +As shown in Figure 3, two scenarios demonstrate how two types of erroneous updates are supposed to be handled in the ideal case. In Figure 3(a), the difference between the momentum of updates $m_{t}$ and the current update $u_{t}$ is large, illustrating that the historical experience for the update of original Adafactor contains high level of errors that will inevitably influence the stability of the training process. If we utilize the raw $m_{t}$ to take an optimization step, the direction of optimization will deviate increasingly from the desired direction, which is reflected by the slow convergence and performance + +# Algorithm 1: Adafactor Optimizer + +Input: Initial parameters $\theta_0$ , learning rate $\eta$ , momentum of update $m_0$ , $r_0$ , $c_0$ , step $t$ , regularization constant $\epsilon_1$ , exponential moving average parameters $\beta_1, \beta_2$ , clipping threshold $d$ + +while $\theta_t$ not converge do + +$$ +\begin{array}{l} \operatorname {C o m p u t e} g _ {t} = \nabla f \left(\theta_ {t - 1}\right) \\ r _ {t} = \beta_ {2} r _ {t - 1} + (1 - \beta_ {2}) \left(g _ {t} ^ {2} + \epsilon_ {1} 1 _ {n} 1 _ {m} ^ {T}\right) 1 _ {m} \\ c _ {t} = \beta_ {2} c _ {t - 1} + (1 - \beta_ {2}) 1 _ {n} ^ {T} \left(g _ {t} ^ {2} + \epsilon_ {1} 1 _ {n} 1 _ {m} ^ {T}\right) \\ v _ {t} = r _ {t} c _ {t} / 1 _ {n} ^ {T} r _ {t} \\ u _ {t} = g _ {t} / \sqrt {v _ {t}} \\ \hat {u} _ {t} = u _ {t} / \max (1, R M S (u _ {t}) / d) \\ m _ {t} = \beta_ {1} m _ {t - 1} + (1 - \beta_ {1}) \hat {u} _ {t} \\ \theta_ {t} = \theta_ {t - 1} - \eta m _ {t} \\ \end{array} +$$ + +end + +degradation of existing memory-efficient optimizers. By contrast, when the difference between $m_t$ and $u_t$ is small as shown in Figure 3(b), the momentum $m_t$ is stable with limited errors and high confidence therefore a large optimization step is required with the updating direction close to $m_t$ . + +![](images/3182119eda88febe95b5c569622321d63384bd528269b85d79ef399bdf7089dd.jpg) + +![](images/be1c1368aac4b04fd80007a465dc8f53ae8dac2d95c3bb877df07c27797eda4e.jpg) +(a) scenario 1 +(b) scenario 2 +Figure 3: Visualization of two scenarios where Adafactor updates have different stability. + +Inspired by the erroneous update that is universal in existing memory-efficient optimizers, we firstly consider an efficient approach to decrease the side effect caused by insecure updating. Given $m_t$ and $u_t$ , we take the residual between them as the instability in the preserved momentum and set generated instability as the denominator of original $m_t$ to more adaptively take an update step. Following + +is the formulation of the adjusted update $u^{\prime}$ , where $\epsilon$ is the regularization constant: + +$$ +u _ {t} ^ {\prime} = \frac {m _ {t}}{\sqrt {\left(m _ {t} - u _ {t}\right) ^ {2} + \epsilon}} \tag {3} +$$ + +Extending further on the plain method, we propose a confidence-guided strategy that enables self-adjusted updates by taking the confidence of the raw update of Adafactor into consideration. The intuition behind the proposed strategy is to calculate the residual between the exponential moving average (EMA) of the update and the current update, which represents the deviation of the approximated update. The larger the deviation of the EMA value from the current generated update, the wider the error EMA of update contains, resulting in a lower level of confidence in the EMA of update. Obviously, we expect the optimizer to take a small update when it incorporates huge error (a large residual from the present update), while updating parameters more when the optimization process is stable (involved error of EMA is limited). + +Specifically, the EMA of update $m_t$ is directly used to take an update step in Adafactor, while in our proposed strategy, $m_t$ is divided by $\sqrt{U_t}$ , where $U_t$ is the calculated instability matrix. Therefore, $\frac{1}{\sqrt{U_t}}$ is the confidence in the observation: viewing $m_t$ as the prediction of the update, if $m_t$ deviates greatly from $u_t$ ( $U_t$ is large), which indicates a weak confidence in $m_t$ , the optimizer performs a small optimization step; if $u_t$ closely matches $m_t$ , we have solid confidence in $m_t$ , and correspondingly take a large optimization step. + +# 3.3 CAME Algorithm + +Based on the proposed confidence-guided strategy, we develop a brand-new variant of memory + +Algorithm 2: CAME Optimizer +Input: Initial parameters $\theta_0$ , learning rate $\eta$ , momentum of update $m_0 = 0$ , $r_0 = 0$ , $c_0 = 0$ , step $t = 0$ , regularization constants $\epsilon_1, \epsilon_2$ , exponential moving average parameters $\beta_1, \beta_2, \beta_3$ , clipping threshold $d$ +while $\theta_t$ not converge do + Compute $g_t = \nabla f(\theta_{t-1})$ $r_t = \beta_2 r_{t-1} + (1 - \beta_2) (g_t^2 + \epsilon_1 1_n 1_m^T) 1_m$ $c_t = \beta_2 c_{t-1} + (1 - \beta_2) 1_n^T (g_t^2 + \epsilon_1 1_n 1_m^T)$ $v_t = r_t c_t / 1_n^T r_t$ $u_t = g_t / \sqrt{v_t}$ $\hat{u}_t = u_t / \max(1, RMS(u_t) / d)$ $m_t = \beta_1 m_{t-1} + (1 - \beta_1) \hat{u}_t$ $U_t = (\hat{u}_t - m_t)^2$ $R_t = \beta_3 R_{t-1} + (1 - \beta_3) (U_t + \epsilon_2 1_n 1_m^T) 1_m$ $C_t = \beta_3 C_{t-1} + (1 - \beta_3) 1_n^T (U_t + \epsilon_2 1_n 1_m^T)$ $S_t = R_t C_t / 1_n^T R_t$ $\theta_t = \theta_{t-1} - \frac{\eta}{\sqrt{S_t}} m_t$ + +end + +efficient optimization methods with faster convergence. Our proposed CAME optimization method successfully obtains the same rate of convergence as prevailing first-order optimization algorithms (e.g., Adam) and with almost equal memory cost to available memory-efficient optimizers (e.g., Adafactor). The pseudocode of CAME algorithm is specified in Algorithm 2. + +By calculating $U_{t}$ at each training step, we employ non-negative matrix factorization on the instability matrix $U_{t}$ following (Shazeer and Stern, 2018) where the generalized Kullback-Leibler divergence between $V$ and $WH$ is minimal. With $U_{t}$ factorized into $R_{t}$ and $C_{t}$ , it is sufficient to store only the moving averages of these factors rather than the full matrix $U_{t}$ , thus saving considerable memory footprint. + +We simply validate intuitions and the corresponding example is shown in Figure 4, in which the proposed CAME reaches the optimal point much faster than Adafactor. Learning rate is $10^{-3}$ for all optimizers. In the example, we set the parameters of CAME to be the same as the default in Adafactor, $\beta_{1} = 0.9$ , $\beta_{2} = 0.999$ and set extra $\beta_{3} = 0.9999$ for CAME. + +# 4 Experiments + +In this section, we present extensive comparisons with existing optimizers on training tasks of three important large language models: BERT (Devlin et al., 2019), GPT-2 (Radford et al., 2018a) and T5 + +![](images/8863e2b090eb85bf25c1f6f8b2b823cb3b1dcb34296f7686b6e5ec84ab45ec60.jpg) +Figure 4: Loss trajectories of Adafactor and CAME. CAME reaches the target local minimum (marked as green cross in 2D plots) much faster than Adafactor. + +(Raffel et al., 2022). + +# 4.1 Setup + +Dataset We perform experiments on the BookCorpus (Radford et al., 2018a) and English Wikipedia with 800M and 2.5B words respectively. Furthermore, we focus on the GLUE benchmark (Peters et al., 2018), SQuAD v1.1 dataset (Rajpurkar et al., 2016) and SQuAD v2.0 dataset (Rajpurkar et al., 2018) to demonstrate the performance of pre-trained BERT models with CAME optimizer. + +Model We evaluate the efficiency of our proposed CAME on three trending large language models: BERT, GPT-2 and T5. We further test the performance of CAME for large-batch training + +![](images/56f7e906329419c5da012345a1e29b4d2b8c7991804bc809dd5a2994bd6584bd.jpg) +Figure 5: Masked LM test accuracy of BERT-Large model trained on Wikipedia dataset with 8k batch size. + +with BERT-Large. + +Compared methods The main baselines comprise two widely-used optimizers: classic optimizer Adam and memory-efficient optimizer Adafactor. With regard to large-batch training, LAMB optimizer is additionally considered when setting baselines. + +Implementation Detail We implement our optimization algorithm in Pytorch (Paszke et al., 2019). The parameters $\beta_{1}$ and $\beta_{2}$ in Algorithm 2 are set as 0.9 and 0.999 respectively, and we search for optimal $\beta_{3}$ among \{0.9, 0.99, 0.999, 0.9999, 0.99999\}. We use 8 Tesla V-100 GPUs and set $\epsilon_{1}, \epsilon_{2}$ as $10^{-30}$ , $10^{-16}$ in all experiments with gradient accumulation and model parallelism. Besides, we set $\eta$ as $2 \times 10^{-4}$ , $6 \times 10^{-4}$ , $3 \times 10^{-4}$ for BERT-Large (32K), GPT-2, T5 training and apply learning rate warmup scheduling (Goyal et al., 2017b) to avoid divergence due to the large learning rate, by starting with a smaller learning rate $\eta$ and gradually increasing to the large learning rate $\eta$ . To make sure we are comparing with solid baselines, we use grid search to tune the hyperparameters for Adafactor, Adam and LAMB. We further improve the performance of large-batch training by applying Mixup (Zhang et al., 2017) to scale the batch size up to 32,768. + +# 4.2 BERT Training + +We firstly present empirical results in the training task of BERT model to evaluate the performance of our proposed CAME optimizer, focusing on its larger variant, BERT-Large, which has 340M parameters in all. Following the default setting, we pre-train the BERT-Large model $(L = 24, H = 1024)$ with a sequence length of 128 on 8 Tesla + +![](images/018b4ba6d340a86fbacce19580ffc0bf547b0d8ccf5a6b0364ac263868becf3c.jpg) +Figure 6: Masked LM test accuracy of BERT-Large model trained on Wikipedia dataset with $32\mathrm{k}$ batch size. CAME achieves comparable accuracy with Adafactor using around only half of required training steps (10k). + +V-100 GPUs. The experiments were implemented with the code from NVIDIA ${}^{2}$ and mainly include two types of batch sizes: 8k and ${32}\mathrm{k}$ ,one of which represents the widely used setting for pre-training BERT and the other denotes the training scenario under large-batch training. The empirical results are presented in Figure 5 and Figure 6. As illustrated in Figure 5, CAME achieves a significant improvement compared with Adam and Adafactor. To be specific, CAME (66.5%) increases validation accuracy at with an increment 3.4% in comparison to Adafactor (63.1%) using same number of training steps (20k). Apart from Adafactor, our proposed CAME achieves better performance than Adam in the pre-training of BERT-Large model with a huge reduction of memory cost. + +To evaluate the performance of our proposed CAME for large-batch training, we scale the batch size for BERT-Large training to 32,768 on Wikipedia dataset. As illustrated in Figure 6, CAME consistently reaches a more remarkable improvement compared with Adafactor. We notice that the accuracy of CAME on BERT-Large pretraining is $68.0\%$ , which is highly over the original Adafactor $(61.9\%)$ with same number of training steps. In addition, CAME reaches comparable accuracy with only half the training steps required for Adafactor. With batch size getting larger from 8k to 32k, CAME brings more enhancements to the training of BERT-Large in comparison with Adam and Adafactor. Compared with LAMB in large-batch training, CAME saves a high-level of + +![](images/61f18918613ee4de8e3fc2782ffadfee65f81d9cb487fd87dd86655f481a7e4c.jpg) +Figure 7: The memory reduction about optimizer states of CAME when training BERT-4B using PyTorch. + +memory footprint with slight training performance degradation. + +Memory Usage Comparison We set batch size to 1 to measure the memory usage of each optimizer more efficiently. As shown in Table 1, the two optimizers (Adam and LAMB) frequently employed for training large language models consume the highest amount of memory usage. Meanwhile, our proposed CAME optimizer exhibits a reduced memory footprint over the existing SM3 memory-efficient optimizer. As a consequence of our confidence-guided strategy in CAME, there is no doubt that CAME will introduce an increased memory footprint in comparison with Adafactor. However, the extra memory footprint incurred of CAME is almost negligible $(1\%)$ with a substantial performance improvement. + +For further demonstration of the memory saving effect of CAME, we expand BERT model to BERT-4B with 4 billion weights using the scaling method of GPT-3 (Brown et al., 2020). We set the mini-batch size to 64 and the accumulation steps to 16 in this experiment. In Figure 7, we train BERT-4B with three different optimizers using PyTorch framework. As a result, CAME can save $47\%$ memory footprint about optimizer states compared with Baseline (Adam) when the weights number of a model get to 4 billion. + +# 4.3 Downstream Tasks + +We select a representative set of downstream tasks to further demonstrate the performance of BERT models pre-trained by our proposed CAME. In this part we adopt BERT-Base model for the fine-tuning task and follow the originally published BERT + +Table 1: Quantitative memory usage per GPU (GB) comparison in the pre-training of BERT-Large model. + +
OptimizerMemory Cost (GB)
Adam8.24
LAMB8.23
Adafactor7.00
SM37.44
CAME7.07
+ +Base results in (Devlin et al., 2019) and (Liu et al., 2019) as the main baseline. The learning rate is tuned on the dev set for each setting and each task is fine-tuned for three epochs. + +We compare the end-task performance of BERT-Base with the baseline on typical downstream tasks and the empirical results are presented in Table 2. The experimental results demonstrate the efficiency of our proposed CAME optimizer by showing that BERT-Base model trained with CAME on two batch sizes both achieve comparable performance to the baseline with less memory cost. In particular, we observe that BERT-Base model trained with large batch (32k) presents no performance degradation and even attains higher evaluation metrics scores on some downstream tasks. Specifically, the BERT-Base model trained on CAME improves on average by 0.5 across five metrics compared to the baseline, proving the feasibility of CAME for the large-batch training task. + +# 4.4 GPT-2 Training + +In addition to BERT pre-training task, we perform CAME-based training task on another typical large language model, GPT-2. Using the original structure of GPT-2 (Radford et al., 2018b), we specifically adopt GPT-medium ( $L = 24$ , $H = 1024$ ) with 345M parameters in our experiment. This implementation is based on the code provided by Megatron3. Identically, we take English Wikipedia as the training dataset for this section. Unlike the pre-training of BERT in Section 4.2, we only concentrate on standard training batch size (128) for GPT-2 pre-training. + +The empirical results of validation loss are shown in Figure 8. We are able to find that CAME achieves similar convergence and final accuracy compared to Adam, which reveals an impressive improvement over the performance of Adafactor + +Table 2: Results of fine-tuning performance on MNLI-m, SST-2, MRPC and two SQuAD datasets. The F1 and EM for SQuAD v1.1 dataset are firstly averaged, and the average of all results across five datasets is further calculated. + +
ModelMNLI-m (Acc)SST-2 (Acc)MRPC (Acc)SQuAD v1.1 (F1/EM)SQuAD v2.0 (F1)Average -
Baseline84.392.888.988.5/80.876.385.4
CAME (batch size = 8k)84.892.889.988.8/81.877.986.1 (+0.7)
CAME (batch size = 32k)84.592.989.888.5/81.277.485.9 (+0.5)
+ +![](images/c318cb0daba9800ab6f82d8d04238704c792035b0659597d001e64f03b736fc3.jpg) +Figure 8: Validation loss of GPT-2 language model. CAME demonstrates similar optimization performance to Adam. + +with comparable training steps. Moreover, as indicated in Figure 9, the validation perplexity of CAME presents the same convergence performance as Adam but faster convergence speed than Adafactor, which clearly supports the validity of CAME that has fast convergence as in traditional adaptive methods and low memory usage as in existing memory-efficient methods. For instance, the converged validation perplexity of CAME and Adafactor is 50.1 and 56.9 respectively, which yields a considerable improvement of $12.0\%$ . + +# 4.5 T5 Training + +Finally, we report empirical results from a different large language model training task: Text-to-Text Transfer Transformer, T5. Concretely, we follow the architecture of T5 (Raffel et al., 2022) and choose T5-Base ( $L = 24$ , $H = 1024$ ) with 220M parameters for the experiment. All of our implementations are also based on the code provided by Megatron. Similarly, we consider Wikipedia with 2.5B words as the training dataset in this part. As with the training of GPT-2 in Section 4.4, we only concentrate on standard training batch size (128) for T5. + +![](images/e48daa002dfab7ec62d7a74abb4e5c60fbd6b9e63faa045d8c98866802e2fdd7.jpg) +Figure 9: Validation perplexity of GPT-2 language model. CAME demonstrates comparable convergence speed with Adam. + +The comparison of CAME with Adafactor and Adam is conducted in the same manner as Section 4.4, and corresponding results of validation loss and validation perplexity are illustrated in Figure 10 and Figure 11 separately. Note that CAME consistently obtains comparable convergence performance for validation loss and validation perplexity on par with Adam, while reducing similar memory usage as Adafactor. + +# 5 Conclusion + +In this paper we propose a novel memory-efficient optimizer called CAME, which supports adaptive confidence-based updating guided by the residual between predicted update and generated update. CAME achieves a considerable improvement compared to existing memory-efficient optimizers in the training of large language models, with an ignorable extra memory footprint. Moreover, CAME shows comparable convergence to Adam and LAMB with huge memory reduction. In particular, CAME has proven effective for large-batch training, which serves as an advantageous extension to memory-efficient optimizers. We hope our work will provide insight into memory reduction + +![](images/8255cca42fa1d13a80afaf07ce8c5fd5cf1e8daac59e496852f01298bdd004af.jpg) +Figure 10: Validation loss of T5 language model. CAME exhibits similar convergence rates to Adam. + +![](images/64d264e45a041e4ec0b4daa8db5d0de2566aeb4e13ed68b3df3bfe93fba3f522.jpg) +Figure 11: Validation perplexity of T5 language model. CAME demonstrates similar convergence speed to Adam. + +of optimizers in future exploration. + +# 6 Limitations + +Despite the success of our CAME optimizer in training large language models with memory efficiency, there are still some limitations that need to be addressed in the future. + +Our proposed memory-efficient optimizer introduces additional computation costs for the nonnegative matrix factorization of the instability matrix in comparison with Adafactor. We observe, however, that the training time of CAME increases only slightly in our experiments. Beyond that, CAME exhibits minor performance degradation in large-batch training of the BERT-Large model versus LAMB, which allows for further improvement in the future. Meanwhile, it is possible to conduct further experiments on other models in other fields, such as Computer Vision and Reinforcement Learning, thereby exploring the effectiveness of CAME + +training under more application scenarios. As a final point, it would be much more helpful to provide an in-depth theoretical analysis of CAME to improve comprehensiveness of the paper. + +# Acknowledgements + +Yang You's research group is being sponsored by NUS startup grant (Presidential Young Professorship), Singapore MOE Tier-1 grant, ByteDance grant, ARCTIC grant, SMI grant and Alibaba grant. We also thank Huawei Noah's Ark Lab for providing the necessary computing resources and support for datasets. + +# References + +Rohan Anil, Vineet Gupta, Tomer Koren, and Yoram Singer. 2019. Memory-Efficient Adaptive Optimization. Curran Associates Inc., Red Hook, NY, USA. +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, et al. 2020. Language models are few-shot learners. In Proceedings of the 34th International Conference on Neural Information Processing Systems, NIPS'20, Red Hook, NY, USA. Curran Associates Inc. +Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, Parker Schuh, Kensen Shi, Sasha Tsvyashchenko, Joshua Maynez, et al. 2022. Palm: Scaling language modeling with pathways. +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. +Priya Goyal, Piotr Dolkar, Ross B. Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, Andrew Tulloch, Yangqing Jia, and Kaiming He. 2017a. Accurate, large minibatch SGD: training imagenet in 1 hour. CoRR, abs/1706.02677. +Priya Goyal, Piotr Dálár, Ross Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, Andrew Tulloch, Yangqing Jia, and Kaiming He. 2017b. Accurate, large minibatch sgd: TrainingImagenet in 1 hour. +Simon Haykin. 1994. Neural networks: a comprehensive foundation. Prentice Hall PTR. + +Xiaoxin He, Fuzhao Xue, Xiaozhe Ren, and Yang You. 2021. Large-scale deep learning optimizations: A comprehensive survey. +Elad Hoffer, Itay Hubara, and Daniel Soudry. 2017. Train longer, generalize better: closing the generalization gap in large batch training of neural networks. +Zhouyuan Huo, Bin Gu, and Heng Huang. 2021. Large batch optimization for deep learning using new complete layer-wise adaptive rate scaling. Proceedings of the AAAI Conference on Artificial Intelligence, 35(9):7883-7890. +Nitish Shirish Keskar, Dheevatsa Mudigere, Jorge Nocedal, Mikhail Smelyanskiy, and Ping Tak Peter Tang. 2016. On large-batch training for deep learning: Generalization gap and sharp minima. +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. +Daniel Lee and H. Sebastian Seung. 2000. Algorithms for non-negative matrix factorization. In Advances in Neural Information Processing Systems, volume 13. MIT Press. +Daniel D. Lee and H. Sebastian Seung. 1999. Learning the parts of objects by nonnegative matrix factorization. Nature, 401:788-791. +Conglong Li, Ammar Ahmad Awan, Hanlin Tang, Samyam Rajbhandari, and Yuxiong He. 2021. 1-bit lamb: Communication efficient large-scale large-batch training with lamb's convergence speed. +Zhiyuan Li, Srinadh Bhojanapalli, Manzil Zaheer, Sashank Reddi, and Sanjiv Kumar. 2022. Robust training of neural networks using scale invariant architectures. In Proceedings of the 39th International Conference on Machine Learning, volume 162 of Proceedings of Machine Learning Research, pages 12656-12684. PMLR. +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. Cite arxiv:1907.11692. +Yong Liu, Siqi Mai, Xiangning Chen, Cho-Jui Hsieh, and Yang You. 2022. Towards efficient and scalable sharpness-aware minimization. +Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. 2019. Pytorch: An imperative style, high-performance deep learning + +library. In Advances in Neural Information Processing Systems 32, pages 8024-8035. Curran Associates, Inc. +Matthew E. Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. 2018. Deep contextualized word representations. Cite arxiv:1802.05365Comment: NAACL 2018. Originally posted to openreview 27 Oct 2017. v2 updated for NAACL camera ready. +Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. 2018a. Language models are unsupervised multitask learners. +Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. 2018b. 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. 2022. Exploring the limits of transfer learning with a unified text-to-text transformer. J. Mach. Learn. Res., 21(1). +Pranav Rajpurkar, Robin Jia, and Percy Liang. 2018. Know what you don't know: Unanswerable questions for squad. +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. +Christopher J. Shallue, Jaehoon Lee, Joseph Antognini, Jascha Sohl-Dickstein, Roy Frostig, and George E. Dahl. 2018. Measuring the effects of data parallelism on neural network training. +Noam M. Shazeer and Mitchell Stern. 2018. Adafactor: Adaptive learning rates with sublinear memory cost. ArXiv, abs/1804.04235. +Yang You, Igor Gitman, and Boris Ginsburg. 2017a. Large batch training of convolutional networks. +Yang You, Jing Li, Sashank Reddi, Jonathan Hseu, Sanjiv Kumar, Srinadh Bhojanapalli, Xiaodan Song, James Demmel, Kurt Keutzer, and Cho-Jui Hsieh. 2019. Large batch optimization for deep learning: Training bert in 76 minutes. +Yang You, Zhao Zhang, Cho-Jui Hsieh, James Demmel, and Kurt Keutzer. 2017b. Imagenet training in minutes. +Hongyi Zhang, Moustapha Cisse, Yann N. Dauphin, and David Lopez-Paz. 2017. mixup: Beyond empirical risk minimization. +Juntang Zhuang, Tommy Tang, Yifan Ding, Sekhar Tatikonda, Nicha Dvornek, Xenophon Papademetris, and James Duncan. 2020. Adabelief optimizer: Adapting stepsizes by the belief in observed gradients. Conference on Neural Information Processing Systems. + +A For every submission: + +A1. Did you describe the limitations of your work? section 6. +A2. Did you discuss any potential risks of your work? section 6. +A3. Do the abstract and introduction summarize the paper's main claims? section 1. +A4. Have you used AI writing assistants when working on this paper? Left blank. + +B Did you use or create scientific artifacts? + +section 4. + +B1. Did you cite the creators of artifacts you used? section 4. +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? section 4. +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? section 4. +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? Not applicable. Left blank. +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? Not applicable. Left blank. +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. Left blank. + +C Did you run computational experiments? + +section 4. + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? section 4. + +The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? section 4. +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? section 4. +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? Not applicable. Left blank. + +# D Did you use human annotators (e.g., crowdworkers) or research with human participants? Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? No response. +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? No response. +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? No response. +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? No response. +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? No response. \ No newline at end of file diff --git a/cameconfidenceguidedadaptivememoryefficientoptimization/images.zip b/cameconfidenceguidedadaptivememoryefficientoptimization/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..0ffac4038ac34dec679cfe3be40cd683c5045c41 --- /dev/null +++ b/cameconfidenceguidedadaptivememoryefficientoptimization/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5a46e8990cef99d4307d7761a161ab13c896dc0d16dd65cba1082c393a21b604 +size 332002 diff --git a/cameconfidenceguidedadaptivememoryefficientoptimization/layout.json b/cameconfidenceguidedadaptivememoryefficientoptimization/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..c884a609324b8a88a5e9bc6c26f5900701ec8bd3 --- /dev/null +++ b/cameconfidenceguidedadaptivememoryefficientoptimization/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:11065ed56f6a22f3d526436e5a684ddd007b5921ffd375e6578399cefd09fadb +size 422915 diff --git a/canlanguagemodelsmakefunacasestudyinchinesecomicalcrosstalk/9c096410-332b-4350-bf75-88ef3ce30adb_content_list.json b/canlanguagemodelsmakefunacasestudyinchinesecomicalcrosstalk/9c096410-332b-4350-bf75-88ef3ce30adb_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..67a6054bb47483c994ea13792e2a6bc6f8fa5f57 --- /dev/null +++ b/canlanguagemodelsmakefunacasestudyinchinesecomicalcrosstalk/9c096410-332b-4350-bf75-88ef3ce30adb_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:94840b2cf7bd561973128a44aab7a35e5d5dbe5f12e463b26ee33f6665c1d41e +size 106231 diff --git a/canlanguagemodelsmakefunacasestudyinchinesecomicalcrosstalk/9c096410-332b-4350-bf75-88ef3ce30adb_model.json b/canlanguagemodelsmakefunacasestudyinchinesecomicalcrosstalk/9c096410-332b-4350-bf75-88ef3ce30adb_model.json new file mode 100644 index 0000000000000000000000000000000000000000..643b28844213b1469b8ad3e3b5046609311508e4 --- /dev/null +++ b/canlanguagemodelsmakefunacasestudyinchinesecomicalcrosstalk/9c096410-332b-4350-bf75-88ef3ce30adb_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:27180215750ef787e964ddd17439bfce094c31629d757739a0ae09f9d2b964ca +size 130335 diff --git a/canlanguagemodelsmakefunacasestudyinchinesecomicalcrosstalk/9c096410-332b-4350-bf75-88ef3ce30adb_origin.pdf b/canlanguagemodelsmakefunacasestudyinchinesecomicalcrosstalk/9c096410-332b-4350-bf75-88ef3ce30adb_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e6eb77aeb2280db4947162bb9f4c3e7e7eae507b --- /dev/null +++ b/canlanguagemodelsmakefunacasestudyinchinesecomicalcrosstalk/9c096410-332b-4350-bf75-88ef3ce30adb_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9cecb65c7f12c0676650592f39fd98a418db6be6518c4b05835f0d70b080326 +size 1082433 diff --git a/canlanguagemodelsmakefunacasestudyinchinesecomicalcrosstalk/full.md b/canlanguagemodelsmakefunacasestudyinchinesecomicalcrosstalk/full.md new file mode 100644 index 0000000000000000000000000000000000000000..3a5aad568332e0193f51fab07b0dc729d4648107 --- /dev/null +++ b/canlanguagemodelsmakefunacasestudyinchinesecomicalcrosstalk/full.md @@ -0,0 +1,431 @@ +# Can Language Models Make Fun? A Case Study in Chinese Comical Crosstalk + +Jianquan Li $^{1}$ , Xiangbo Wu $^{1}$ , Xiaokang Liu $^{1}$ +Qianqian Xie $^{3}$ , Prayag Tiwari $^{4}$ , Benyou Wang $^{1,2*}$ + +1The Chinese University of Hong Kong, Shenzhen +2Shenzhen Research Institute of Big Data +3University of Manchester +4Halmstad University +wangbenyou@cuhk.edu.cn + +# Abstract + +Language is the principal tool for human communication, in which humor is one of the most attractive parts. Producing natural language like humans using computers, a.k.a, Natural Language Generation (NLG), has been widely used for dialogue systems, chatbots, text summarization, as well as AI-Generated Content (AIGC), e.g., idea generation, and scriptwriting. However, the humor aspect of natural language is relatively under-investigated, especially in the age of pre-trained language models. In this work, we aim to preliminarily test whether NLG can generate humor as humans do. We build the largest dataset consisting of numerous Chinese Comical Crosstalk scripts (called $\mathbf{C}^3$ in short), which is for a popular Chinese performing art called 'Xiangsheng' or '相声' since 1800s1. We benchmark various generation approaches including training-from-scratch Seq2seq, fine-tuned middle-scale PLMs, and large-scale PLMs with and without fine-tuning. Moreover, we also conduct a human assessment, showing that 1) large-scale pretraining largely improves crosstalk generation quality; and 2) even the scripts generated from the best PLM is far from what we expect. We conclude humor generation could be largely improved using large-scale PLMs, but it is still in its infancy. The data and benchmarking code are publicly available in https://github.com/anonNo2/crosstalk-generation. + +# 1 Introduction + +Artificial Intelligence (AI) has been widely used in Natural Language Processing (NLP), computer vision, speech, robots, and further applied biology, etc. In NLP, Pre-trained Language Models (PLMs) e.g., BERT (Devlin et al., 2018) and GPT (Radford et al., 2018), have notably improved many + +natural language tasks including text classification, question answering, and NLG. Although its technical contribution to the human community has been widely explored, the social or cultural effect is somehow under-investigated. + +To explore the side social or cultural effect of PLMs, in this paper, we leverage the generation ability of pre-trained language models to save endangered cultural heritage, i.e., Chinese Comical Crosstalk. We believe the diversity of generations from pre-trained language models could enrich the Chinese Comical Crosstalk, especially leveraging modern topics. From a broader view, we aim to test to which degree AI could make fun in the context of PLMs (especially large-scale GPT). + +Humor has been rooted in the Chinese language, originating from the book 'Records of the Grand Historian' written by a Chinese historian Qian Sima 2000 years ago2 which includes a chapter titled 'Biography of Humor'《滑稽列传》. Since then, humor is an inseparable ingredient of the Chinese language. As the first step, this work aims to explore traditional performing art in Chinese comedy crosstalk, which has a very long history originating from the north of China since roughly 1800, see Tab. 1 for an example crosstalk script, . It began as a form of street performance, incorporating joke-telling, comedic banter, imitations, or borrowing from other performance arts, such as Peking opera, all with the express purpose of making audiences laugh. The characteristics of crosstalk scripts are 1) multiple-turn; 2) humor-oriented; 3) with a novel language style; 4) culturally-grounded; and 5) low-resourced, see more details in Sec. 2. + +Humor generation is a challenging task since, for instance, we may not know exactly what makes a joke funny. Solving this problem with purely neural network models requires deep semantic under + +
RolesScript (in Chinese)Translated script (in English)
Peng张三和李四在这里给大家拜年了!We are both here wishing you a happy new year
Dou从大家的掌声呀,我听出来了。What do you know I heard from the audience's applause?
Peng什么呀?What?
Dou大家还是比较喜欢,我们俩的。Audiences do love us both.
Peng哎呦,你心里真没数。什么叫喜欢我们俩呀。No, not both!
Dou(哦。)err?
Peng人家鼓掌,是喜欢我们俩当中的一个。They are applauding only one of us.
Dou我一直以为大伙也喜欢你呢。I thought that audiences also had loved you.
Peng呵呵hehe
Dou别看我们俩一上台就在那斗嘴。Although we are always quarreling on the stage, but what?
Peng哦。
Dou实际上我们俩在生活当中呀...Actually in daily life, we
Peng动手。we directly fight with each other
Dou哎呦,急了?你就处处跟我呛着,什么事我喜欢的Well, you are always going against me, anything I love...
Peng我绝不喜欢。I will definitely hate it!
Dou什么事凡是我认为好的。anything I think is right?
Peng我就认为它坏。I will definitely think it is wrong!
Dou我就认为你好。I think you are very nice!
Peng我就认为你讲的有道理。Make sense!
Dou这你怎么不呛着了?Why not argue with me?
Peng过年了,我怎么也得顺着你点。Sometimes I have to agree with you a little bit.
+ +Table 1: An example of crosstalk script. Typical crosstalk scripts could be longer. + +standing (Petrovic & Matthews, 2013). This even becomes more challenging if cultural and other contextual cues are considered as in Chinese Comical Crosstalk. From a practical point of view, the data preparation usually goes earlier than the development of algorithms and models. Since new models cannot be well-evaluated before (especially large-scale) data is ready3. + +As the first step, we collect many crosstalk scripts from the internet. The dataset is publicly available with an open-resource license (Apache 2.0). We also conduct several basic generation approaches including train-from-scratch Seq2seq generation (Cho et al., 2014), fine-tuned middle-scale PLMs, and large-scale PLMs (with and without fine-tuning). Furthermore, the current research community also explored the potential to use large-scale PLMs for creation. For example, (Brown et al., 2020) claims that GPT-3 can generate synthetic news articles that human evaluators have difficulty distinguishing from human-generated articles. We do not expect that GPT has a 'sense of humor'. Alternatively, we test to which degree GPT-3 is creative in crosstalk generation. + +The contributions of this paper are as follows: 1) Firstly, culturally, we release the largest-ever publicly-available Chinese crosstalk dataset, contributing to both the NLP research community and the traditional Chinese culture community. This is the first work to generate an entire dialogue crosstalk script (instead of utterance pair) thanks to pre-trained language models. This would inspire + +more crosstalk script creations and therefore preserves this intangible cultural heritage. Especially, this work will also promote its diversity and creativity which can be beneficial for the spreading of crosstalk. Currently, most crosstalk scripts seem to be homogeneous which is one of the main bottlenecks that limit their wide spreading. 2) Secondly, technically, we benchmark various approaches including Seq2seq, train-from-scratch GPT, pretrained GPT 2, and GPT-3, for crosstalk generation. As far as we know, this is also the first work to evaluate to which extent pre-trained language models could generate humorous text. 3) Lastly, we further point out the issues regarding various biases, stereotypes, and sometimes insults. + +# 2 Problem Definition + +# 2.1 Task Formalization + +Depending on the number of performers, crosstalk is typically performed as a dialogue between two performers called '对口', or rarely as a monologue by a solo performer called '单口' (like stand-up comedy in the Western), or even less frequently, as a group acting by more performers called '群口'. + +Let us take the dual performing ('对口') as an example. Dual performing usually involves two roles called Penggen '捧喂' (Peng in short) and Dougen ('逗喂') (Dou in short). Dou aims to perform in a comical way using talking and actions. Peng is the support role to make the conversation more fluent and legible (As shown in Tab. 1). The conversation consists of an iterative sequence of utterances: + +$$ +\Phi = \left\{u _ {1}, v _ {1}, u _ {2}, v _ {2}, \dots , u _ {K}, v _ {K} \right\} +$$ + +which is a $K$ -turn dual crosstalk with 2K utterances including K utterances from Dou + +(denoted as $u$ ) and $\mathbf{K}$ utterances from Peng (denoted as $v$ ). Note that both $u_{i}$ and $v_{i}$ are utterances that consists of many characters, namely $u_{i} = \{\phi_{i,1},\phi_{i,2},\dots ,\phi_{i,j},\dots \phi_{i,l_{i}}\}$ , $\phi_{i,j}$ is the $j$ -character in the $i$ -th Dou/Peng utterance and $l_{i}$ is the number of characters in the utterance. + +Training could be formulated as two paradigms: 1) a Seq2seq utterance generation task: it could be treated as a seq-to-seq task to predict the next utterance given previous utterances; 2) a next word generation task: it can also consider as a typical language model that does not consider the utterance border, namely a raw language model that predicts the next word. For automatic evaluation in Sec. 4, we adopt commonly-used generation metrics to evaluate models using an auto-regressive utterance generation manner, namely, predicting the next utterance based on previous utterances no matter it is trained in a Seq2seq utterance generation paradigm or next word prediction paradigm. + +# 2.2 Characteristics of Crosstalk + +Crosstalk scripts (except for solo performers) are usually multiple-turn dialogues. It typically involves two (or more) performers talking about a topic in multiple turns (with an average of 72 in $C^3$ dataset), typically ranging from 10 to 20 minutes. In contrast to general dialogues, the characteristics of the crosstalk are as follows: 1) it is humor-oriented: it aims to make audiences laugh by freely talking. 2) it is with a novel language style: the crosstalk language itself is in a rapid, bantering, and highly interactive style. More interestingly, it is rich in puns and allusions. 3) it is culturally-grounded: it typically relates to not only the local daily life (especially in the north of China, e.g., Beijing) but also the long historical events in china with a time range from 3000 BC to the present. Interestingly, it usually adopts the Beijing dialect (close to Mandarin) during some periods. 4) it is low-resourced: crosstalk generation task could rely on a relatively small amount of scripts. + +# 3 Dataset + +# 3.1 Data Collection + +We collect data from the book 'Encyclopedia of Chinese Traditional Crosstalk' and the internet. The creation date of these scripts ranges from Qing Dynasty (roughly 1800) to this century. The + +main resources are from 1) a digitized book named 'Encyclopedia of Chinese Traditional Crosstalk' or《中国传统相声大全》 published in 2003, which is a collection of traditional crosstalk collections, records, and compilations since Qing Dynasty; 2) many websites that maintain crosstalk scripts. See App B for more details. Our dataset uses the Apache-2.0 license. + +Preprocessing and cleaning Two scripts sharing $80\%$ overlapped characters will be merged as identical ones for dedduplication. Scripts that are shorter than 7 lines are filtered. We use regular expressions to clean the text, e.g., removing HTML tags and noisy tokens. We also filter out the voice, action, and environment descriptions. Punctuation marks are also normalized. Actor names are renumbered with new placeholders while the metadata of these actors is recorded. + +Human calibration The collected data might be dirty. Therefore, we calibrated data manually: 1) we removed scripts that contain insulting and discriminatory conversations by manually building a vocabulary for insulting and discriminatory words. 2) We also manually check advertisement texts and then deleted those texts. 3) We manually split some scripts by utterances if a script has extremely long utterances. 4) We removed scripts that make no sense, e.g., scripts that are not fluent or contain too many meaningless tokens. + +3.2 Overview of $C^3$ Dataset + +
-Number
Total scripts9,331
Total characters16,481,376
Number of utterances663,305
Number of long utterances8,717
Number of short utterances446,756
Median character numbers of utterances16
Mean utterances per script71
+ +Table 2: Statistics of the $C^3$ dataset. + +Scale of the dataset As shown in Table 2, we collect 9,331 high-quality scripts with 663,305 utterances. This results in 9,331 dialogues and 16,481,376 characters in total. We randomly select 200 scripts for testing and the rest for training. + +Length of scripts and utterences Each script contains an average of 71 utterances. The medium length of utterances is about 16 characters. We define an utterance as a long utterance if it exceeds 128 characters and short utterance if it is less than + +
TypeNumber
Single performing168
Dual performing3,685
Group performing256
Sketch comedy5,222
Total9,331
+ +24 characters. There are 8,717 long utterances and 446,756 short utterances. + +Numbers of performers As shown in Tab. 3, it includes 3,685 dual-performing crosstalk scripts, 256 group-performing crosstalk scripts, and 168 single-performing crosstalk scripts. In addition, we also collect 5,222 sketch comedy ('小品') scripts that also involve multi-turn dialogues. Note that sketch comedy scripts are also mainly about dialogues and one may be interested in them. While we do not use sketch comedy scripts to train the crosstalk script generation. The main type of scripts is the dual dialogue with two performers (called '捧喂' and '逗喂'), with 3,685 scripts. + +# 3.3 Discussions on $C^3$ + +Humor categories in crosstalk Typical humor theory defines three types of humor: 1) relief theory: reducing psychological tension, 2) superiority theory: laughing about the misfortunes of others that make one feel superior, and 3) incongruous juxtaposition theory: incongruity between a concept involved in a certain situation and the real objects of the concept. These three mechanisms could be easily found in crosstalk scripts. For example, 1) performers bring audiences to a tense scenario and suddenly make a relaxing joke, 2) performers make jokes about someone (usually one of the performers on the stage or other crosstalk performers that is not on the stage) with bad experiences, and 3) performers sometimes describe some ridiculous scenarios that make fun. + +Another specific humor in crosstalk is 'homographic pun' (Yu et al., 2020), since crosstalk is a verbal performing art. This sometimes relates to some dialects in Chinese. To deal with 'homographic pun', generation models may need to be injected with some acoustic knowledge. + +Ethical issues in crosstalk We have to notice that there are many ethical issues involved in crosstalk. Many biases are involved in crosstalk including educational background discrimination, gender bias, and occupation bias. Also, a stereotype of local people is amplified by crosstalk scripts. + +Table 3: Statistics of various types. + +
MethodBaselines
train from scratchLSTM Seq2seq
fine-tuned PLMsUniLM, GPT, T5
zero-shot large-scale PLMsCPM, Zhouwenwang, Pangu-α, GPT-3
fine-tuned large-scale PLMsfine-tuned GPT-3
+ +Table 4: Taxonomy of baselines. + +Typically, the two Performers also make fun of each other, and some of them are like an 'insult'. Fortunately, this is only for crosstalk performers themselves. We believe that dealing with these ethical issues should be necessary to promote crosstalk art. + +# 4 Generation Benchmark using Automatic Evaluations + +# 4.1 Experimental Settings + +We implement LSTM Seq2seq which is trained from scratch as a baseline. To make use of existing pre-trained language models, we also include pre-trained UniLM, GPT, and T5 in a fine-tuned manner. Large-scale Chinese pre-trained language models like CPM, Zhouwenwang, Pangu- $\alpha$ were recently released, we, therefore, evaluate these models in a zero-shot fashion since fine-tuning these models are economically-expensive. Furthermore, we also verified the effectiveness of GPT-3. Fortunately, GPT-3 provides an API for fine-tuning, making GPT-3 the only large-scale PLM that could be fine-tuned at an affordable cost. See App. D for more details. + +LSTM Seq2seq (Sutskever et al., 2014): LSTM consists of a two-layer bi-directional LSTM encoder and a two-layer LSTM decoder. Both the embedding size and the hidden state size of the LSTM model are set to 300. The encoder-decoder model is augmented with an attention mechanism. For the $k$ -th utterance in a dialog, the input of the encoder was the concatenation of all the past utterances before $k$ truncated with 256 tokens, while the target output of the decoder was the $k$ -th utterance. + +UniLM (Dong et al., 2019): Unified Language Model (UniLM) adopts multi-layer Transformers, which also uses different masks to control the number of visible context words and thereby can be applied to both natural language understanding (NLU) tasks and natural language generation (NLG) tasks. Our pre-trained model is downloaded from $^{6}$ , pre-training with Wikipedia data and news + +corpus data in CLUE. The UniLM used in this paper consists of 12 layers with a hidden size of 768 and 12 heads. The ways to build fine-tuned data structures are the same as Seq2seq. + +T5 (Raffel et al., 2019) is a unified framework that treats various text tasks in a text-to-text format. It consists of an encoder component and a decoder component, both of which are a stack of Transformer layers. We use the Chinese version of the T5 called 'T5-Chinese-base'. The parameters of the base model are 275 million, and the parameters of the small model are 95 million. + +GPT (Radford et al., 2018): Generative Pre-trained Transformer (GPT) models by OpenAI have taken the natural language processing community by introducing very powerful language models. In our implementation, the GPT model is 12-layer Transformers with hidden size 768, pre-trained using LCCC Corpus Base corpus and fine-tuned by crosstalk dataset. Follow the implement of code, We divide the dialog into utterances and sequentially combine utterances with fewer than 256 words as one input. + +GPT-3 (Brown et al., 2020): the biggest GPT-3 model has 175 billion parameters trained by 45TB data. Note that GPT-3 is mainly for English language generation, but it could also generate fluent Chinese texts. We applied the GPT-3 online test API $^{10}$ and evaluate crosstalk generation. GPT3-Davinci is the one with Davinci engine without fine-tuning. $^{11}$ . GPT3-Davinci-finetuned is the fine-tuned version using GPT-3 API. We fine-tune it on 200 crosstalk scripts in 4 epochs. + +Pangu- $\alpha$ (Zeng et al., 2021) is a large-scale autoregressive language model, with up to 200 billion parameters. It consumes 1.1TB of high-quality Chinese corpora from a wide range of domains. A publicly-available version of Pangu- $\alpha$ (with 2.6B parameters) could be used in https://huggingface.co/imone/pangu_2_6B. + +CPM (Zhang et al., 2021) is a generative pretraining model trained on 100 GB Chinese cor + +UniLM +7https://huggingface.co/imxly/ +t5-pegasus +8https://huggingface.co/thu-coai/ +CDial-GPT_LCCC-base +9https://github.com/yangjianxin1/ +GPT2-chitchat + +10https://beta.openai.com/ + +11The scale of Davinci engine is not exposed; however, some evidence suggests that Davinci engine might be the biggest model with 175B parameters. See https://blog.eleuther.ai/gpt3-model-sizes/ + +pora. CPM-Large is with 36 transformer layers and reaches 2.6B parameters. + +Zhouwenwang considers both generative language model and masked language model tasks, making it for both language generation and natural language understanding. We use the larger Zhouwenwang (Zhouwenwang-1.3B) with 1.3 billion parameters $^{12}$ . + +Evaluations We use the test set (200 randomly-selected crosstalk scripts) for evaluations. To generate the $k$ -th utterance, we concatenate all the past utterances before $k$ within a total length of 256 as the input. We adopted several widely-used metrics to measure the quality of the generated response. BLEU-1/2/4 is a popular metric to compute the k-gram overlap between a generated utterance and a reference. ROUGE-1/2/L measures unigram and bigram overlap in a recall-oriented fashion while ROUGE-L measures the longest matching sequence of words using the longest common subsequence (Lin, 2004). GLEU (Mutton et al., 2007) is an automatic evaluation of sentence-level fluency. Distinct-1/2 (Li et al., 2016) is provided to evaluate the diversity of generated responses. BERT-score (Zhang et al., 2019) and Bart-score (Yuan et al., 2021) use pre-trained language models to evaluate generation quality. + +# 4.2 Results + +GPT-3 performs well The results are in Tab. 5. GPT-3 outperforms other models in most metrics (except for ROUGE-L and Distinct-1/2); this is nontrivial since GPT-3 has not been fine-tuned on this dataset, namely, the dataset (including training and test set) is in general invisible for GPT-3. This is probably because it is trained with massive plain corpora and it, therefore, generates fluent text based on similar text in corpora. + +Chinese PLMs perform relatively worse. Surprisingly, large-scale language models purely trained in Chinese (i.e., CPM, Pangu- $\alpha$ , and Zhouwenwang) do not perform as well as GPT-3 which is mainly trained in English corpora and partially in Chinese corpora. Especially, these zero-shot Chinese large PLMs (i.e., CPM, Pangu- $\alpha$ , and Zhouwenwang) underperform fine-tuned relatively-smaller-scaled PLMs (UniLM, GPT, and T5). This might be because the multilingual corpora might + +
BLEUBLEU-2BLEU-3BLEU-4GLEUROUGE-1ROUGE-2ROUGE-LDistinct-1Distinct-2BERTScoreBartScore
LSTM Seq2seq11.774.021.470.572.4917.252.1315.940.820.740.58-6.17
GPT10.043.691.530.72.7515.281.7813.70.880.790.58-6.12
UniLM8.884.322.471.413.3620.224.9118.980.880.720.59-6.03
T5-small11.715.392.931.673.6419.984.3718.610.870.760.60-5.97
T5-base11.755.583.131.773.9420.84.9819.250.870.770.61-5.88
CPM-Large7.942.871.190.501.689.881.288.830.760.750.54-6.25
Pangu-α6.422.090.830.371.317.000.756.140.900.840.56-6.31
Zhouwenwang7.332.260.900.401.8110.411.018.610.970.770.54-6.30
GPT3 (GPT3-Davinci)14.687.454.442.775.1322.255.6520.030.900.840.62-5.79
GPT3-fine-tuned-Davinci9.664.893.011.924.6621.795.5020.220.930.780.62-5.75
+ +Table 5: Evaluation results on crosstalk generation. + +be a beneficial factor since humor might be shared across languages. Also, the used GPT3-Davinci might be much bigger than the existing publicly-available Chinese PLMs. + +Scale helps Comparing the performance between T5-small and T5-base, the bigger scale consistently leads to better performance. Plus, observing that the large-scale GPT3 achieves nearly the best performance in automatic evaluations, we believe that large-scale pre-training notably improves the crosstalk generation quality. + +Fine-tuning on large-scale PLMs Interestingly, fine-tuning on GPT-3 achieves worse performance than vanilla GPT-3 in terms of most automatic evaluations in Tab. 5. We suspect the fine-tuning mechanisms might lead to such a result, like over-fitting to the training dataset, and harms some generalization. However, in human evaluation, fine-tuned GPT-3 could generate better-quality scripts than vanilla GPT-3 (in Tab. 7), which could be later observed from Tab. 6; this shows that the automatic evaluation on crosstalk might not be consistent to human perception. + +Regarding diversity metrics In diversity measures using Dist-1 and Dist-2, large-scale pretraining-based models generate more diverse scripts. Since larger-scale pretraining generally has better learning capacity that leads to better generalization and diversity. Note that diversity metrics are sensitive to the hyper-parameters during the decoding phase of language models. + +Note that in Tab. 5, we do not intend to compare the general performance of these language models, or conclude that the general performance of one language model is better than another one. The general performance of these language models is also subject to their model scales, hyper-parameter selections, training corpora, etc. Instead, we just make use of the existing language models that are both capable to deal with the Chinese language generation and are publicly available. + +# 4.3 Case Study + +We show an example of generated crosstalk scripts in Tab. 6. Below are our observations. + +Meaningless generation in LSTM Seq2seq LSTM language model produces fluent but nearly meaningless texts (annotated in gray color), this is probably due to the fact that the training data for Seq2seq models is not enough and no pre-training was adopted. While other models with pre-training do not frequently generate such nonsense texts. This shows that pre-training could boost generation performance, especially for scenarios with low-resourced training texts. + +Repeated context topic in generation UniLM and GPT-3 could generate topic-coherent texts, especially, some generated utterances also repeat some key topics from the first 10 input utterances, e.g., '臭流氓' (shameless rogues), '穿裤衩,到处跑'(running around in shorts), and '海尔兄弟'(Haier brother 13). Note in this example, the raw script (the last 10 utterances) dot not have so many repeated topics from previous utterances, like generation models. + +Insulting words UniLM, GPT, and GPT-3 generate some insulting words that already appeared in the first 10 utterances, namely, '臭流氓' (shameless rogues). Moreover, GPT generates new insulting words, so he just looks ugly that did not appear before. This is probably due to that pretraining corpora or scripts in training may have such insulting texts. + +Humorous generation Roughly, we could see some humorous generated utterances. For example, the last generated utterance for GPT-3 (in the last row and second last column) does have a sense of humor. However, if we treat these utterances as a whole, their performance of humor is not satisfied. + +The difference between Peng and Dou Basically, Dou usually talks more and introduces more + +
RawSeq2seqUniLMGPTGPT-3GPT-3-fine-tuned
Dou弟弟你想起来了吧?Bro,do you remember that?
Peng想起什么来了?这不涉尔兄弟呀。Remember what? Aren't they Haier Brothers?
Dou对,我们就是海尔兄弟呀。Yes,we are the Haier Brothers.
Peng我们是海尔兄弟?Are we?
Dou嗯,Hum.
Peng我们穿的有点多了了吧?But we wear too much!
Dou长大了要懂得羞耻。We are not young and we need to wear proper clothes (cannot be naked as Haier Brothers)
Peng废话,你得知道差啦了,还海尔兄弟了,你见过穿袜子,站这说相声的吗?Duh,sure,have you ever seen someone who performs crosstalk with Bikini?
Dou小时候就可以呀,小时候多好啊。小小少年,没有烦恼,穿着袜子,到处跑,We could when we were young. What a happy childhood! A little boy, no sorrow, run around in shorts.
Peng俩套流球,你听听。Listen! Two shameless rogues.
Dou当然现在不让穿了。Of course,we could do this anymore (running around in shorts).
Peng废话,Duh.我想当一个演员,有点击车。I want to become a famous actor是吗?err?您说,咱们有这个吗?do you think that we have this?这是谁说的?Who said this?不让穿了。Not allowed to wear it.
Dou我俩都三十多了,往一站一站说相声,Both of us are 30 years old and perform crosstalk here.什么叫吐槽?What is called "Tu-cuo"?哎呀,小时候穿袜子,到处跑,Oops,in childhood to run around in shorts.您的意思是?What do you mean?我说的啊。I said it.你看看,我们现在穿什么?Look,what are we wearing now?
Peng表演。Performing crosstalk.报告长。[nonsense generation]俩臭流氓。Two shameless rogues我......I......你个臭流氓,你不要瞎说。You a shameless rogue, don't talk nonsense.我们现在穿西装。We are wearing suits now.
Dou当然这真的好。Come on,this is fine (not like a rogue)你知道吗?Do you know?哎哟呵,真不错。Ouch,that's great.你可拉倒吧。Come on.我说的是真的。It is true.对,我们是职业演员了。Yes,we are professional actors now.
Peng这就算好了?fine?知道。Yes.怎么样?How about it?没有。No.那你是怎么知道的?How do you know it?你说的是。You are right.
Dou当年,跟我们在电视台,一块柔动画片那些小伙伴,现在好多都不干这行了。The friends who were recording cartoons with us on the TV station, most of them don't do this now.你别说了,这句话太难过了。Shut up, this sentence makes me sad.跟大伙儿分享一点笑话。Share some jokes, please.你可拉倒吧,我都不知道了。Come on.I don't know even.因为 我 就是 海尔兄弟呀。Because I am a Haier Brother.你看看,这个外套是不是很高大上?Look,isn't this coat very luxuri-ous?
Peng唉,你先等会,你先等会,咱还有小伙伴。Hey,wait for a mo-ment, we still have other friends谁说的?Who said this?好啊。Ok.唔,就他长得这么丑,小时候呢?Hey,he just looks ugly.How about him in childhood?那你是怎么知道的?How did you know?这个外套很高大上吧?Yes,this coat is very luxurious!
Dou小家伙你也不觉得了?Didn't you remember your friends?你觉得糟糕怎么样?What do you think of naked sleeping?其实我觉得,穿裤衩,很难。In fact,I think it's hard to wear only short pants.就我现在实力的确会好吧,上一出去喝几口酒抽烟,上网,看节目去睡觉,娱乐购物点心思开放,要坐车时间打几圈游戏玩些地方戏?My strength will be better sooner or later. Last time I went out to drink and smoke, surf the Internet, watch a show, go to bed, entertain, shopping, and be refreshed. How many laps do I need to take the car to play games and play some local dramas?因为 我 就是 海尔兄 弟呀。Because I am a Haier brother.哦对了。这个衣服都不能穿了,要穿西装。Oh,by the way,you can't wear these clothes anymore,you have to wear a suit
Peng我这脑子有点懵。It is a little con-fusing赤裸裸裸裸,体育局。[nonsense generation]为什么?Why?现在游戏也很丰富。比如,看电影就玩个正面。Now There are a lot of games. For example,when watching a movie, you can play a positive role.那你还穿裤衩吗?Then,are you still wearing shorts?不能穿裤衩了。Can't wearing in shorts anymore.
+ +Table 6: The raw and generated scripts. We manually annotate meaningless texts in gray color, repeated words from the top 10 input utterance in cyan color, and insulting text in red color. See more examples in Sec. F. + +topics in dialogues while Peng usually supports Dou to make each topic more comprehensively talked and topic transition more coherent. This leads to that Peng's utterances sometimes contain only a few interjections like '嗯'(hum) and '哎哟'(ouch). Note that the generation for Dou's utterance is more difficult than Peng; the former is more interesting and worthy of more attention. + +# 5 Human Assessment + +Setting We randomly select 50 scripts in the test set. We take the first ten utterances as the input for all models. These models will generate the next ten utterances, utterance by utterance or character by character. For each script, we show participants with 20 utterances (including the raw 10 utterances and the generated 10 utterances), see the web UI in App. G. Participants are required to 1) rate five-point scores for the general quality and humor degree of each generated script ('5' for the best and '1' for the worst); and 2) rate binary scores for coherence and an ethically-risky flag of each generated example ('1' for true and '0' for false). We ask no-paid volunteers to participate to rate these generated results from 10 models. 15 participants have completed all ratings and other incomplete ratings from other 11 participants are discarded. The score is calculated as an average score among all dialogues and all participants for each model. + +Results Human assessment is shown in Tab. 7. Raw scripts achieve the best general quality, probably evidencing that humans are much better than SOTA models in terms of being creative and humorous. Among these models, GPT-3 and its fine-tuned version (GPT3-Davinci-finetuned) outperform others in terms of general quality. Interestingly, fine-tuned GPT-3 outperforms zero-shot GPT-3 although the former has poorer performance in automatic evaluation (see Tab. 5). + +Similar to the automatic evaluations in Tab. 5, zero-shot large-scale Chinese PLMs (the third group) underperform these fine-tuned middle-scaled PLMs (like UniLM, T5, and GPT). Seq2seq performs the worst; this may be due to Seq2seq does not utilize pre-training. Interestingly, CPM-large produces much more insulting words than others; the reason needs to be further investigated. + +# 6 Discussions + +# 6.1 Why are generated crosstalk unsatisfied? + +As seen from the automatic evaluation in Tab. 5 and human assessment in Tab. 7, the adoption of large-scale pre-trained language models could largely improve the quality of crosstalk generation, compared to these models without large-scaled pretraining. We show some generated examples from large-scale pre-trained language models with and without fine-tuning. + +
General quality (5) ↑Humor (5) ↑Coherence (1) ↑Ethically-risky flag(1) ↓
LSTM Seq2seq1.451.610.270.03
GPT1.501.710.390.01
T5-base1.801.970.510.05
UniLM1.842.010.560.01
Panggu-a1.531.710.420.03
Zhouwenwang1.231.270.190.05
CPM-Large1.421.600.400.23
GPT3-Davinci2.152.170.650.03
GPT3-Davinci-finetuned2.272.350.710.01
raw scripts3.523.460.950.01
+ +Table 7: Human assessment for crosstalk generation. The maximum score of each metric in the bracket, namely, the best general quality score and humor score is 5 while the rest scores are binary. + +
General quality (5)Humor (5)Coherence (1)Ethically-risky flag(1)
GPT3-Davinci-102.601.890.930.00
GPT3-Davinci-2003.222.560.960.04
GPT3-Davinci-10003.022.420.890.04
+ +Table 8: Human assessment on GPT3 with different numbers of fine-tuned examples. + +Although large-scale pre-trained language models largely improve crosstalk generation. Based on the human assessment, we could preliminarily conclude that the best generation approach (finetuned GPT-3) achieves fairly good crosstalk (2.27 vs. 3.52 for general quality), while it is far away from what we expect. The reasons are twofold. + +First, the evaluation criterion for humor generation is problematic. Observing the inconsistency between Tab. 5 and Tab. 7, a better performance evaluated using BLEU and ROUGE does not lead to a better performance in human assessment, this probably suggests that BLEU or related metrics for generation is not inappropriate for humor generation. Since humor itself is diverse and subjective that does not have textual ground truth. One could see the correlations between human and automatic evaluation in App E which is relatively high but somehow overestimated. Moreover, human assessment is expensive and cannot give real-time feedback during model training. + +Secondly, current methods did not consider prime ingredients of humor. Core ingredients of humor include incongruity, surprise, cultural empathy, and interpersonal effect, without which simply training on data is a soft way to memorize the training data and it can't generate real humor. + +# 6.2 Sensitivity on the fine-tuning examples of GPT3 + +We test the performance of GPT3 models with different numbers of fine-tuned examples (i.e., 10, 200, 1000), using a similar human assessment in + +Sec. 5. For 15 randomly-selected crosstalk scripts, based on the beginning snippets (i.e., the first ten utterances of each crosstalk script), each model generates/completes the rest of the crosstalk script. Three participants are required to annotate these 15 generated crosstalk scripts in terms of four scores. + +Tab 8 shows that with a moderate number of fine-tuned examples, it achieves the best general quality. In other words, adopting too many or few fine-tuned examples could harm the performance. This is slightly counterintuitive. Interestingly, fine-tuning on 200/1000 examples brings more ethical risks; this probably indicates that the dataset itself has some ethical risks, which should be noticed. + +# 7 Conclusion and Future Work + +In this paper, we collect a dataset for Chinese crosstalk. Based on the dataset, we evaluate several existing generation models including LSTM Seq2seq, GPT, UniLM, CPM, Pangu- $\alpha$ , Zhouwenwang, and GPT-3 for crosstalk generation. This is a preliminary step for humor generation, indicating that large-scale pretraining largely improves crosstalk generation quality while there still exists a big gap between the generated scripts and human-created scripts. Note that there are some concerns about bias/stereotypes for crosstalk, e.g., educational background discrimination and gender bias. In future work, we are interested in collecting crosstalk audiios to promote the end2end crosstalk generation with an adapted humorous accent. + +# Acknowledgement + +This work is supported by Chinese KeyArea Research and Development Program of Guangdong Province (2020B0101350001), the Shenzhen Science and Technology Program (JCYJ20220818103001002), the Guangdong Provincial Key Laboratory of Big Data Computing, The Chinese University of Hong Kong, Shenzhen, Shenzhen Key Research Project (C10120230151) and Shenzhen Doctoral Startup Funding (RCBS20221008093330065). + +# Limitation + +First, the dataset might also have some insulting or discriminatory words, this might need human manual checking. Second, the well-designed evaluation of humor (unlike calculating the semantic textual similarity to a reference text) is challenging and important for humor generation, without which humor generation could not be further largely-improved. + +# Ethics Statement + +The collected data might still have a few insulting or discriminatory words, although we have made many efforts to reduce its effects. We have highlighted these concerns in many parts of this paper and warned readers. + +# References + +Miriam Amin and Manuel Burghardt. A survey on approaches to computational humor generation. In Proceedings of the The 4th Joint SIGHUM Workshop on Computational Linguistics for Cultural Heritage, Social Sciences, Humanities and Literature, pp. 29-41, 2020. +Yoshua Bengio, Réjean Ducharme, Pascal Vincent, and Christian Janvin. A neural probabilistic language model. The journal of machine learning research, 3:1137-1155, 2003. +Dario Bertero and Pascale Fung. A long short-term memory framework for predicting humor in dialogues. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 130-135, 2016. +Kim Binsted and Graeme Ritchie. Computational rules for generating punning riddles. 1997. +Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020. + +Lei Chen and Chong MIn Lee. Predicting audience's laughter using convolutional neural network. arXiv preprint arXiv:1702.02584, 2017. +Peng-Yu Chen and Von-Wun Soo. Humor recognition using deep learning. In Proceedings of the 2018 conference of the north american chapter of the association for computational linguistics: Human language technologies, volume 2 (short papers), pp. 113-117, 2018. +Kyunghyun Cho, Bart Van Merrienboer, Caglar Gul-cehre, Dzmitry Bahdanau, Fethi Bougares, Hol-ger Schwenk, and Yoshua Bengio. Learning phrase representations using rnnc encoder-decoder for statistical machine translation. arXiv preprint arXiv:1406.1078, 2014. +Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pp. 248-255. IEEE, 2009. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018. +Li Dong, Nan Yang, Wenhui Wang, Furu Wei, Xiaodong Liu, Yu Wang, Jianfeng Gao, Ming Zhou, and Hsiao-Wuen Hon. Unified language model pretraining for natural language understanding and generation, 2019. +Shikang Du, Xiaojun Wan, and Yajie Ye. Towards automatic generation of entertaining dialogues in chinese crosstalks. arXiv preprint arXiv:1711.00294, 2017. +He He, Nanyun Peng, and Percy Liang. Pun generation with surprise. 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), pp. 1734-1744, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-1172. URL https://www.aclweb.org/anthology/N19-1172. +Jing He, Ming Zhou, and Long Jiang. Generating chinese classical poems with statistical machine translation models. In Twenty-Sixth AAAI Conference on Artificial Intelligence, 2012. +Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770-778, 2016. +Igor Labutov and Hod Lipson. Humor as circuits in semantic networks. In Proceedings of the 50th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pp. 150-155, 2012. + +Jiwei Li, Michel Galley, Chris Brockett, Jianfeng Gao, and William B Dolan. 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, pp. 110-119, 2016. +Yi Liao, Yasheng Wang, Qun Liu, and Xin Jiang. Gpt-based generation for classical chinese poetry, 2019. +Chin-Yew Lin. Rouge: A package for automatic evaluation of summaries. In Text summarization branches out, pp. 74-81, 2004. +HF Lin, DY Zhang, Liang Yang, and Bo XU. Computational humor researches and applications [j]. Journal of Shandong University, 2016. +Lizhen Liu, Donghai Zhang, and Wei Song. Exploiting syntactic structures for humor recognition. In Proceedings of the 27th international conference on computational linguistics, pp. 1875-1883, 2018a. +Lizhen Liu, Donghai Zhang, and Wei Song. Modeling sentiment association in discourse for humor recognition. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pp. 586-591, 2018b. +Andrew Mutton, Mark Dras, Stephen Wan, and Robert Dale. Gleu: Automatic evaluation of sentence-level fluency. In Proceedings of the 45th Annual Meeting of the Association of Computational Linguistics, pp. 344-351, 2007. +Sasa Petrovic and David Matthews. Unsupervised joke generation from big data. In Proceedings of the 51st annual meeting of the association for computational linguistics (volume 2: Short papers), pp. 228-232, 2013. +Sima Qian and Burton Watson. *Records of the Grand Historian*, volume 1. Columbia University Press New York, 1993. +Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training. 2018. +Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. arXiv preprint arXiv:1910.10683, 2019. +Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. Squad: 100,000+ questions for machine comprehension of text. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pp. 2383-2392, 2016. +Pranav Rajpurkar, Robin Jia, and Percy Liang. Know what you don't know: Unanswerable questions for squad. arXiv preprint arXiv:1806.03822, 2018. + +Victor Raskin. Semantic mechanisms of humor. In Annual Meeting of the Berkeley Linguistics Society, volume 5, pp. 325-335, 1979. +He Ren and Quan Yang. Neural joke generation. Final Project Reports of Course CS224n, 2017. +Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. Advances in neural information processing systems, 27, 2014. +Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R Bowman. Glue: A multi-task benchmark and analysis platform for natural language understanding. In International Conference on Learning Representations, 2018. +Rui Yan, Han Jiang, Mirella Lapata, Shou-De Lin, Xueqiang Lv, and Xiaoming Li. I, poet: automatic chinese poetry composition through a generative summarization framework under constrained optimization. In Twenty-Third International Joint Conference on Artificial Intelligence, 2013. +Diyi Yang, Alon Lavie, Chris Dyer, and Eduard Hovy. Humor recognition and humor anchor extraction. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pp. 2367-2376, 2015. +Xiaoyuan Yi, Ruoyu Li, and Maosong Sun. Generating Chinese classical poems with rnn encoder-decoder. In Chinese Computational Linguistics and Natural Language Processing Based on Naturally Annotated Big Data, pp. 211-223. Springer, 2017. +Zhiwei Yu, Jiwei Tan, and Xiaojun Wan. A neural approach to pun generation. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1650-1660, 2018. +Zhiwei Yu, Hongyu Zang, and Xiaojun Wan. Homophonic pun generation with lexically constrained rewriting. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 2870-2876, 2020. +Weizhe Yuan, Graham Neubig, and Pengfei Liu. Bartscore: Evaluating generated text as text generation. Advances in Neural Information Processing Systems, 34:27263-27277, 2021. +Wei Zeng, Xiaozhe Ren, Teng Su, Hui Wang, Yi Liao, Zhiwei Wang, Xin Jiang, ZhenZhang Yang, Kaisheng Wang, Xiaoda Zhang, et al. Pangu $\alpha$ : Large-scale autoregressive pretrained Chinese language models with auto-parallel computation. arXiv preprint arXiv:2104.12369, 2021. +Tianyi Zhang, Varsha Kishore, Felix Wu, Kilian Q Weinberger, and Yoav Artzi. Bertscore: Evaluating text generation with bert. In International Conference on Learning Representations, 2019. + +Xingxing Zhang and Mirella Lapata. Chinese poetry generation with recurrent neural networks. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 670-680, 2014. + +Zhengyan Zhang, Xu Han, Hao Zhou, Pei Ke, Yuxian Gu, Deming Ye, Yujia Qin, Yusheng Su, Haozhe Ji, Jian Guan, et al. Cpm: A large-scale generative chinese pre-trained language model. AI Open, 2:93-99, 2021. + +# A Related Work + +Natural language generation Natural language generation is one of the key areas of NLP that is related to machine translation, dialogue, summarization, and paraphrasing. Previously, text generation was usually based on templates or rules, probabilistic models like n-gram models. Those models are fairly interpretable but heavily require feature engineering. Recently, neural network language models (Bengio et al., 2003) show a great potential to generate language by chronologically predicting the next word with context using neural networks. Cho et al. (2014) proposed the encoder-decoder architecture that becomes the de facto paradigm of natural language generations. For a given input sequence, the encoder produces its corresponding fixed-length hidden vector that is used for the decoder model to generate another sequence. Recently, pre-trained language models (including GPT (Radford et al., 2018) and UniLM (Dong et al., 2019)) have largely improved the SOTA of language models, by using a better backbone architecture called 'transformer' in a pre-trained manner. Very recently, Brown et al. (2020) released API to access their large-scale language models called 'GPT-3'. Moreover, some NLG tasks are specific to Chinese, e.g., Chinese poetry and couplet generation (He et al., 2012; Yan et al., 2013; Zhang & Lapata, 2014; Yi et al., 2017; Liao et al., 2019). + +Humor in NLP There are two typical lines of research work for humor in NLP: humor recognition and humor generation. The former was well-investigated using neural networks (Bertero & Fung, 2016; Yang et al., 2015; Chen & Lee, 2017; Liu et al., 2018b; Chen & Soo, 2018; Liu et al., 2018a), while the latter is more challenging yet under-investigated. Both humor theoretical linguistics and computational linguistics have heavily contributed to humor generation (see (Amin & Burghardt, 2020) and (Lin et al., 2016)). There are many efforts for humor theory linguistics to develop the theoretical aspect of humor (Raskin, 1979). Computational linguistics tends to leverage neural systems, template-based systems, or a hybrid of both for humor generation that rarely benefits from those theory-driven impulses. For example, Labutov & Lipson (2012) explored mining simple humorous scripts from a semantic network (ConceptNet). They claimed that this may generate humor beyond simple puns and punning riddles + +(Binsted & Ritchie, 1997). Petrovic & Matthews (2013) claimed that generating humor using automatic algorithms requires deep semantic understanding. Ren & Yang (2017) used an encoder for representing a user-provided topic and an RNN decoder for joke generation that can generate a short joke relevant to the specified topic. Yu et al. (2018) proposed to generate puns from a conditional neural language model with an elaborately designed decoding algorithm. (He et al., 2019) propose a retrieve-and-edit approach that could generate more puns. Although the humor generation has been paid some attention, we believe that the humor generation is in its infant age, and the potential of pre-trained language models like GPT is expected to be exploited. + +Before the pre-trained language model era, Du et al. (2017) simplified the script generation task by generating the replying utterance of the supporting role (Peng) given the utterance of the leading comedian in each dialogue. This setting is not expected in many aspects. First, this may not generate fluent script since only a single utterance is considered as the context. Second, generating replying utterance of the supporting role is not challenging since the complexity of the supporting role is much less challenging than the utterance of the leading comedian. We argue that a more natural generation (like auto-regressive generation) is needed and pre-trained language models may help. + +# B Data resources + +We crawled scripts mainly from the following resources: + +- a digitized book named Encyclopedia of Chinese Traditional Crosstalk 《中国传统相声大全》 published in 2003. The book is a collection of traditional crosstalk collections, records, and compilations from the Qing Dynasty. It is open-sourced on the internet. +- bijianshang.com (中文台词网): a free website for the scripts of Xiangsheng, short sketches, and movies. +- www.juben68.com (剧本网): a website with lots of movie scripts, poems, and scripts of crosstalk. +- 399dy.com (399导演社区): a website for Director's Club which is for public- + +available script resources or scripts uploaded by users. + +- xsxpw.com (相声小品网): a website for categorized scripts for famous performers. + +# C Metadata of data example + +The metadata is organized as Tab. 9. We include: + +1) charsize: the length of the script in terms of character number, +- 2)filePath: relative path of the script file, +- 3) id: unique id of the script, +- 4) idx: the serial number of the script, +- 5) roleMap: a map to map involved characters to a specific character id, +- 6) utteranceSize: the number of utterances (utterance) in the script, +- 7) title: the title of the script, +- 8) type: the type of the script, e.g., a monologue, dual dialogue or multiple-performer dialogue. + +# D Hyperparameters for training models + +Tab. 10 shows the main hyperparameters for training. Unmentioned hyperparameters are set in default. For input, we append [CLS] at the beginning of each text and use [SEP] as the separator between utterances. Here is an example of the input format in LSTM Seq2seq, GPT, T5, UniLM: + +[CLS]今天来说个相声。[SEP]好咧 +[SEP]说点儿啥呢?[SEP]…[SEP] + +[CLS] Let's have a crosstalk [SEP] well +[SEP] what to talk about? [SEP] ... +[SEP] + +To fine-tune GPT-3, we use the end-of-line (EOL) token as the separator between utterances, because [CLS] and [SEP] are not used in GPT3. We consider the first ten utterances as the prompt and the latter ten utterances as the completion part. utterances that are out of the first 20 positions are truncated due to the length limit. 0 is for the Dougen and 1 is for penggen. + +Below is an example of the input JSON to fine-tune GPT-3. + +
namevalue
number of characters484
file pathbijianshang/1386236043493249024.txt
id1386236043493249024
index1341
role map""Jin Fei":"0","Chen Xi":"1""
number of utterances43
source"www.bijianshang.com/news/html/4826.html
titleThe eight characters for fortunate
typedual performing
+ +Table 9: Example of metadata + +{"prompt": + +"Specific information: 一段名称为《师徒俏皮话》的对口相声\n0:这位是我师傅。\n1:她是我徒弟。\n0:虽然我是徒弟,但我可比他会的多。\n1:你才学几天呢?这么膨胀。\n0:那当然了,我比你会多啦。\n1:会什么你啊?说相声基本功,俏皮话,听说过吗?\n0:不是听说过吗?这样吧,当场我就能为您新编一个专属的俏皮话。\n1:给我编?这得听听。\n0:好吧,说到我师傅呀。\n1:就是我呀。\n0:" + +"completion": "他是乾隆年的电灯管。\n1:这话怎么讲?\n0:老光棍咯。\n1:你当着这么些人,你说这干嘛呀?\n0:我怕人家当你是花木兰的兔子。\n1:这什么意思?\n0:难辨雄雌。\n1:大伙看看,我长这么man,我像兔子吗?\n0:看看,我是不是比你会的多?是不是?\n1:你要这个态度啊,今儿我得跟你比一比。\n" + +} + +# E Correlation between human and automatic evaluation + +As seen from Tab. 1, the general quality and fluency from a human perspective are, at least from the statistical view, highly correlated with some automatic metrics (e.g., BLUE-4, GLEU, and ROUGE-2). Note that the models that are used to calculate Pearson/Spearman correlation are mostly finetuned on the train set of $C^3$ (except for GPT3-Davinci); therefore they are more likely to generate $C^3$ -style scripts. When evaluating these fine-tuned models in $C^3$ test set that is similar to the train set, it might overestimate the correlation between automatic evaluation and human assessment. In + +![](images/fbc0453b1f930c8722646968448a861098e5fc52f9a2451246b052d35ff30bc2.jpg) +(a) Pearson correlation + +![](images/0226e809fe8d5aba7d5b0542c733c8e7a3c2adf2526e3c4a8fdde9eb284560c7.jpg) +(b) Spearman correlation +Figure 1: Correlation between automatic evaluation and human assessment, according to the performance of models in Tab. 5 and Tab. 7. + +terestingly, it shows a different trend when comparing the original GPT-3 and fine-tuned GPT-3; fine-tuned GPT-3 underperforms in automatic evaluation but outperforms human assessment. + +# F More generated examples + +Also, we show great potential for the crosstalk generation using large-scale pretrained language models. See our generated long crosstalk in https://github.com/anonNo2/crosstalk-generation/blob/main/GPT3-Generate-Samples/Long-Sample.zh-CN.md and short crosstalk in https://github.com/anonNo2/crosstalk-generation/blob/main/GPT3-Generate-Samples/Short-Sample.zh-CN.md. With light human labor, we think it could be easy to obtain moderate-quality crosstalk scripts. We believe that this is significant for the crosstalk community. + +
modelsepochbatch sizelearning rateoptimizerothers
LSTM Seq2seq100641e-05AdamWdropout=0.25 +embed-size=300 +vocab-size=7446 +hidden-size=256
UniLM100641e-05AdamWadam-epsilon=1e-08 +max-seq-length=256 +warmup-proportion=0.1 +weight-decay=0.01
T5100241.5e-04AdamWgradient-accumulation-steps=4 +max-grad-norm=2.0 +max-len=256 +warmup-rate=0.1
GPT100641.5e-04AdamWgradient-accumulation-steps=4 +max-grad-norm=2.0 +max-len=256 +warmup-rate=0.1
GPT-3410.1-model=Davinci +prompt-loss-weight=0.1
+ +Table 10: Hyperparameters for training models. + +![](images/2a8b2f1603f9f094df335c1febc7084add44c664a8adc710bce10c35561309f3.jpg) +Figure 2: PC Web UI for human annotations +Figure 3: Mobile Web UI for human annotations + +# G Web UI of the human annotations + +The Web UI is like Fig. 2 and its mobile version is in Fig. 3. The background of these human annotators are from both the north of China and the South of China. We are recruiting them through online advertisement and annotators are no-paid. But the annotation itself is full of fun. Since the humor annotation itself is somehow subjective, we in principle allow annotators to take subjective decisions without intervention. + +A For every submission: + +A1. Did you describe the limitations of your work? right after conclusion section +A2. Did you discuss any potential risks of your work? right after conclusion section +A3. Do the abstract and introduction summarize the paper's main claims? last paragraph of introduction +A4. Have you used AI writing assistants when working on this paper? Left blank. + +B Did you use or create scientific artifacts? + +Left blank. + +B1. Did you cite the creators of artifacts you used? Left blank. +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? Left blank. +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? No response. +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? Left blank. +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? Left blank. +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. Left blank. + +C Did you run computational experiments? + +Left blank. + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? Sec. 4.1 + +The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? App. D +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? +it is not sensitive to multiple runs +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? We put everything in the code link. + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? yes, Sec.5 + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? screenshots in the appendix +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? they are voluntary for this because this is general enjoyable to annotate this dataset, in Sec.5 +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? Sec.5 +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? Sec.5 +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? Sec.5 \ No newline at end of file diff --git a/canlanguagemodelsmakefunacasestudyinchinesecomicalcrosstalk/images.zip b/canlanguagemodelsmakefunacasestudyinchinesecomicalcrosstalk/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..4b96a9f9231bb3ef48b57a8e04cd661c1c8d0464 --- /dev/null +++ b/canlanguagemodelsmakefunacasestudyinchinesecomicalcrosstalk/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2782d9b5cf41c062cdd834b46bd81ec2458f119c4c4e1ac507a2620b052ea040 +size 569086 diff --git a/canlanguagemodelsmakefunacasestudyinchinesecomicalcrosstalk/layout.json b/canlanguagemodelsmakefunacasestudyinchinesecomicalcrosstalk/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..57289719ccba870b20b65f65811047bfec1fd798 --- /dev/null +++ b/canlanguagemodelsmakefunacasestudyinchinesecomicalcrosstalk/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7adc82a46c812280da22b07884f49300ab85d7a80c58b21a08793e4cb7967037 +size 438078 diff --git a/canlargelanguagemodelsbeanalternativetohumanevaluations/3469f270-5a34-4bdb-924f-800958cccbd5_content_list.json b/canlargelanguagemodelsbeanalternativetohumanevaluations/3469f270-5a34-4bdb-924f-800958cccbd5_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..897396ec053f315844b79469f84d98eb2b44448a --- /dev/null +++ b/canlargelanguagemodelsbeanalternativetohumanevaluations/3469f270-5a34-4bdb-924f-800958cccbd5_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4435cfbae2c7415bbbf8ac53381603b6671c8b6db4da37b3e93580da27c847e8 +size 173195 diff --git a/canlargelanguagemodelsbeanalternativetohumanevaluations/3469f270-5a34-4bdb-924f-800958cccbd5_model.json b/canlargelanguagemodelsbeanalternativetohumanevaluations/3469f270-5a34-4bdb-924f-800958cccbd5_model.json new file mode 100644 index 0000000000000000000000000000000000000000..87ba9a1a19fdf4777f3a16c333ccd9730422430f --- /dev/null +++ b/canlargelanguagemodelsbeanalternativetohumanevaluations/3469f270-5a34-4bdb-924f-800958cccbd5_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:02857d8ec42f4c327c6037221ff9486bcde1f4d7732bb42a16e0a0a5d4fd533c +size 206301 diff --git a/canlargelanguagemodelsbeanalternativetohumanevaluations/3469f270-5a34-4bdb-924f-800958cccbd5_origin.pdf b/canlargelanguagemodelsbeanalternativetohumanevaluations/3469f270-5a34-4bdb-924f-800958cccbd5_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8d92c136d58bfc2f55b7be5de2fdd49304e5ae42 --- /dev/null +++ b/canlargelanguagemodelsbeanalternativetohumanevaluations/3469f270-5a34-4bdb-924f-800958cccbd5_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bc057d57777c15ad59679b0dbc46b979e5faf4675872f7649ab3ce3c39d6cef9 +size 1097837 diff --git a/canlargelanguagemodelsbeanalternativetohumanevaluations/full.md b/canlargelanguagemodelsbeanalternativetohumanevaluations/full.md new file mode 100644 index 0000000000000000000000000000000000000000..79a3e81f79a701a23a326832b9696cdd2dc03c9a --- /dev/null +++ b/canlargelanguagemodelsbeanalternativetohumanevaluations/full.md @@ -0,0 +1,741 @@ +# Can Large Language Models Be an Alternative to Human Evaluation? + +Cheng-Han Chiang + +National Taiwan University, + +Taiwan + +dcml0714@gmail.com + +Hung-yi Lee + +National Taiwan University, + +Taiwan + +hungyilee@ntu.edu.tw + +# Abstract + +Human evaluation is indispensable and inevitable for assessing the quality of texts generated by machine learning models or written by humans. However, human evaluation is very difficult to reproduce and its quality is notoriously unstable, hindering fair comparisons among different natural language processing (NLP) models and algorithms. Recently, large language models (LLMs) have demonstrated exceptional performance on unseen tasks when only the task instructions are provided. In this paper, we explore if such an ability of the LLMs can be used as an alternative to human evaluation. We present the LLMs with the exact same instructions, samples to be evaluated, and questions used to conduct human evaluation, and then ask the LLMs to generate responses to those questions; we dub this LLM evaluation. We use human evaluation and LLM evaluation to evaluate the texts in two NLP tasks: open-ended story generation and adversarial attacks. We show that the result of LLM evaluation is consistent with the results obtained by expert human evaluation: the texts rated higher by human experts are also rated higher by the LLMs. We also find that the results of LLM evaluation are stable over different formatting of the task instructions and the sampling algorithm used to generate the answer. We are the first to show the potential of using LLMs to assess the quality of texts and discuss the limitations and ethical considerations of LLM evaluation. + +# 1 Introduction + +Human evaluation is an important method to understand the performance of an NLP model or algorithm (Guzmán et al., 2015; Gillick and Liu, 2010). We rely on human evaluation because there are certain aspects of texts that are hard to evaluate using automatic evaluation metrics; thus, researchers resort to humans to rate the quality of the output of NLP models. While human evaluation is prevalent and indispensable in NLP, it is notoriously + +unstable (Gillick and Liu, 2010; Clark et al., 2021). Karpinska et al. (2021) has shown that the quality of workforces in human evaluation can have a detrimental effect on the evaluation result, making it impossible to compare the performance among different systems. Reproducibility is another issue in human evaluation since it is hard to recruit the same human evaluators and rerun the same evaluation. Even if the same workers are recruited, the workers that have seen the task before are likely to produce a different evaluation result the next time because they have already done the task. While human evaluation is used to better assess NLP systems and has some advantages over automatic evaluation metrics, the drawbacks of human evaluation somewhat make it difficult to reliably evaluate NLP systems. + +To resolve some of the drawbacks, we take advantage of large language models (LLMs). LLMs are large models that are trained to model human languages using self-supervised learning (Brown et al., 2020) and further using special training procedures to improve the performance on unseen tasks and better follow natural language instructions (Sanh et al., 2022; Wei et al., 2022). The ability to perform a task just given the task instructions motivates us to ask if these LLMs can perform what humans do in human evaluation. To answer this question, we feed in the LLM with the same instruction, sample, and question used in human evaluation, and take the sequences generated by the LLM as the LLM's answer to the question. This process is shown in Figure 1, and we call this process LLM evaluation. + +To test if LLM evaluation yields meaningful results, we conduct LLM evaluation on two different NLP tasks: evaluating the quality of stories in open-ended story generation and the quality of sentences generated by adversarial attacks. We summarize our findings and contribution as follows: + +- We show that LLM evaluation produces results similar to expert human evaluation, ver + +# Task instruction, sample, and question + +# Please rate the story fragment + +The goal of this task is to rate story fragments. + +NOTE: Please take the time to fully read and understand the story fragment. We will reject submissions from workers that are clearly spamming the task. + +# Story fragment + +The human ambassador reached down and grasped it's paw. "Humans, cats, is it true that all intelligent beings are omnivorous?" "Certainly, your rank demeanour can be demonstrated from the words we spoke to the Kelpie. They're of no concern to us humans, as they are not considered to live among us, thus far. (...) + +How grammatically correct is the text of the story fragment? (on a scale of 1-5, with 1 being the lowest?) + +# Human evaluation + +![](images/ae01a4f9b8d7f4ccbd5d9b546287b8837952c54f590a82f2d8905f4ee3a9a2e5.jpg) + +# LLM evaluation + +![](images/da230fd108c1fc6fbb02685b14ffc0f3b07a282ec8fd871c852666db756f157f.jpg) +Figure 1: Illustration of the core idea of the paper using open-ended story generation as the example task. The left part shows the instruction, story fragments, and questions used in human evaluation. The human experts are asked to rate the quality of the story fragments using a 5-point Likert scale, shown on the upper right. The lower right part shows the process of LLM evaluation, where we feed the LLMs the same instruction, story fragments, and questions and parse the LLM-generated output to get the rating. + +ifying the effectiveness of LLM evaluation (§3.3 and §4.3). This paper is the first to propose using LLMs as an alternative to human evaluation and show their effectiveness. + +- We show that LLM evaluation results only slightly vary due to different task instructions and the hyperparameters of the sampling algorithm used to generate the answer. (§3.3.2 and §3.3.3) +- We carefully discuss the pros and cons of using LLM evaluation and discuss the ethical considerations of LLM evaluation. (§5) + +# 2 LLM Evaluation + +# 2.1 Large Language Models (LLMs) + +Large language models are language models having bulk parameter sizes, typically on the scale of a few billion, and pre-trained on enormous amounts of natural language corpora, including GPT3 (Brown et al., 2020), T5 (Raffel et al., 2020), and BLOOM (Scao et al., 2022). These LLMs show exceptional performance on unseen tasks when only the task instructions are given; this kind of ability is called zero-shot in-context learning. + +To further improve the zero-shot in-context learning performance, special training techniques have + +been applied to those LLMs after pre-training. For example, T0 (Sanh et al., 2022) and FLAN (Wei et al., 2022) are fine-tuned on a mixture of tasks and can thus achieve better zero-shot performance compared to GPT-3. InstructGPT (Ouyang et al., 2022) is fine-tuned from GPT-3 using reinforcement learning from human feedback (RLHF), and it is shown to better follow the instructions. ChatGPT (OpenAI, 2022) is fine-tuned from InstructGPT with a conversation dataset using RLHF, so ChatGPT can interact with users in a conversational way. ChatGPT is able to answer questions asked by the user and provide comprehensive explanations about its answer. Given the LLMs' ability to follow task instructions and provide feedback, we ask whether LLMs can be used as an alternative to human evaluation and aid NLP researchers in evaluating the quality of texts. + +# 2.2 LLM Evaluation + +To evaluate the quality of texts generated by NLP systems or written by humans using LLM, we present the LLMs with the task instructions, the sample to be evaluated, and a question. The question asks the LLM to rate the sample's quality using a 5-point Likert scale. Given the inputs, the LLM will answer the question by generating some output sentences. We parse the output sentences to get + +the score rated by the LLM. We call this process LLM evaluation, and this procedure is shown in the lower part of Figure 1. Different tasks use different sets of task instructions, and each task uses different questions to evaluate the quality of the samples. The instructions and questions used in LLM evaluation in our paper are not tailored for the LLMs; we follow those instructions used to conduct human evaluation in prior works. + +To compare the result of LLM evaluation and show its effectiveness, we compare the result of LLM evaluation with human evaluation conducted by English teachers. To make a fair and meaningful comparison, the instructions, samples, and questions in human evaluation are formatted similarly to those in LLM evaluation. The main difference between LLM evaluation and human evaluation is that in human evaluation, the human evaluators answer the question by choosing the answer from a pre-defined set of options (the 1-5 Likert scale scores), as shown in the upper right in Figure 1. In LLM evaluation, we instead let the LLM freely generate sentences and extract the score from the generated sentences using some simple rules, detailed in Appendix D.2.1. + +# 3 Example Task 1: Open-Ended Story Generation + +We first use open-ended story generation to demonstrate the usefulness of LLM evaluation. + +# 3.1 Task Introduction + +Open-ended story generation is a task to generate a short story based on a given prompt. We use the WritingPrompts dataset (Fan et al., 2018), which is composed of pairs of short prompts and human-written stories collected from the subreddit WritingPrompts. In the WritingPrompts, the users are given a short prompt, and they need to write a story based on the short prompt. + +In this experiment, we use LLM evaluation and human evaluation to rate the stories generated by humans and the stories generated by a story generation model. We select open-ended story generation as an example because Karpinska et al. (2021) show that workers from Amazon Mechanical Turk (AMT) cannot distinguish GPT-2 (Radford et al., 2019) generated and human-written stories, + +while English teachers show a clear preference for human-written stories over GPT-2-generated stories. We want to see if LLM can rate human-written stories higher than GPT-2-generated ones. + +Following prior works (Mao et al., 2019; Guan et al., 2020; Karpinska et al., 2021), the story generation model is GPT-2 medium model fine-tuned on the WritingPrompts training dataset. After the model is trained, we randomly select 200 prompts from the testing set of WritingPrompts and make the fine-tuned GPT-2 generate stories based on those prompts using nucleus sampling (Holtzman et al., 2020) with $p = 0.9$ . For the human-written stories to be compared, we use the 200 stories written based on the same 200 prompts. We postprocess the human-written and GPT-2-generated stories and then use them for LLM evaluation and human evaluation. Please find the details on fine-tuning and data processing in Appendix B. + +# 3.2 LLM Evaluation and Human Evaluation + +We present the LLMs and the human evaluators with a short description, and the story to be evaluated, formatted as shown in Figure 1. Following Karpinska et al. (2021), we evaluate the stories on four different attributes. The four attributes and their corresponding questions are as follows: + +1. Grammaticality: How grammatically correct is the text of the story fragment? +2. Cohesiveness: How well do the sentences in the story fragment fit together? +3. Likability: How enjoyable do you find the story fragment? +4. Relevance: Now read the PROMPT based on which the story fragment was written. + +Prompt: [PROMPT]. + +How relevant is the story fragment to the prompt? + +Where the [PROMPT] will be filled in with the prompt which the story is based on. Each attribute is evaluated using a 5-point Likert scale; the following description is appended at the end of each question: "on a scale of 1-5, with 1 being the lowest"). We show the interface used in human evaluation and the input format for the LLM evaluation in Appendix C.2 and D.2.2. + +The LLMs used for LLM evaluation include T0, text-curie-001, text-davinci-003, and ChatGPT. text-curie-001 and text-davinci-003 + +
EvaluatorGrammaticalityCohesivenessLikabilityRelevance
MeanSTDIAA%MeanSTDIAA%MeanSTDIAA%MeanSTDIAA%
Human-written stories
Human3.760.950.3320.54.290.820.32273.781.100.089.53.351.480.058
T02.551.470.16102.981.450.1143.181.530.1272.931.640.026
curie3.190.470.0746.52.820.460.0147.52.850.370.110.653.060.400.110.64
davinci4.220.380.26354.540.470.3739.53.990.380.4968.54.400.790.7148.5
ChatGPT3.830.603.550.882.440.893.291.50
GPT-2-generated stories
Human3.560.910.1019.53.191.070.14172.591.29-0.213.52.381.40-0.038.5
T02.441.490.0593.021.510.0763.001.590.1662.821.610.046
curie3.230.510.01382.820.450.02502.860.370.0965.53.010.430.1161
davinci4.070.350.3545.54.260.450.42423.840.420.52624.020.740.6942.5
ChatGPT2.980.762.480.711.590.672.021.21
+ +Table 1: LLM evaluation and human evaluation results of human-written stories and GPT-2-generated stories. For each evaluated attribute, we report its mean Likert scale and the standard deviation. We also report the inter-annotator agreement (IAA) among three annotators using Krippendorff's $\alpha$ . The subscript in the IAA column (\%) is used to denote the percentage of the stories where all three annotators exactly agree on a rating. + +are two InstructGPT models, and the latter is the stronger model; we will use InstructGPT to refer to these two models. We query the InstructGPT using the official API provided by OpenAI. We use nucleus sampling with $p = 0.9$ to generate the answer from T0 and InstructGPTs. We sample three answers from LLMs to stimulate the result of asking the model to rate the same story three times. We query ChatGPT using the user interface recently released by OpenAI. Unlike InstructGPT, we cannot control the parameters used for generating the response from ChatGPT. Because ChatGPT limits the maximum number of queries per user, we only sample one response for each question. + +For human evaluation, we do not use the commonly used AMT for human evaluation because Karpinska et al. (2021) has already shown that the results obtained using AMT are highly questionable. Following the recommendation of the prior works, we hire three certified English teachers using an online freelancer platform, UpWork. Teachers are familiar with evaluating the essays of students, making them the expert evaluators in our task. The details about recruiting human evaluators are in Appendix C.1. Each LLM and each English teacher rates the 200 human-written stories and 200 GPT-2-generated stories. + +# 3.3 Experiment Results + +The LLM evaluation and human evaluation results of open-ended story generation are presented in + +Table 1. We report the mean and standard deviation of the Likert scores obtained from LLM evaluation and human evaluation and show the inter-annotator agreement (IAA) using two different metrics: (1) the Krippendorff's $\alpha$ , and (2) the percentage of the stories where three evaluators give the exact same rating. $^{2}$ The main observations from Table 1 are discussed as follows. + +Expert human evaluators prefer human-written stories: Human evaluation result serves as some kind of ground truth of the LLM evaluation. For all four attributes, teachers rate the human-written stories higher than GPT-2-generated stories. This indicates that experts are able to distinguish the quality difference between model-generated stories and human-written stories. Based on the IAA, we also find that the agreements among experts are lower on GPT-2-generated texts and on the likability. This shows that experts tend to have less agreement on model-generated texts and on a subjective attribute (likability), agreeing with the results in Karpinska et al. (2021). + +T0 and text-curie-001 do not show clear preference toward human-written stories: For T0, we can see that T0 rates human-written stories higher than GPT-2-generated stories on grammatically, likability, and relevance. However, the rating differences between the human-written and + +model-generated stories do not achieve statistical significance for grammaticality and relevance; the $p$ -value obtained by Welch's $t$ -test is much larger than 0.05. The result of text-curie-001 is similar to T0: text-curie-001 does not rate human-written stories higher than model-generated stories. It can also be observed that for T0, the IAA in terms of the percentage of exact agreement among three different sampled answers is overall very low. This indicates that given the same sample, T0 is likely to give a different rating for the three sampled answers. The result implies that T0 does not assign a high probability to a specific rating, so different scores are all likely to be sampled. This shows that even if LLMs are specifically fine-tuned to better perform zero-shot in-context learning and trained to better follow human instructions, these do not make them capable of assessing open-ended story generation as human experts can. + +text-davinci-003 shows clear preference toward human-written stories just like English teachers: text-davinci-003 rates human-written stories much higher than model-generated stories on all four attributes, which is in accordance with the result produced by human experts. By Welch's $t$ -test, we find that the higher ratings on human-written stories are all statistically significant. In prior work, researchers have found that workers recruited on AMT do not rate human-written stories higher than GPT-2-generated ones (Karpinska et al., 2021); combining their result with our result, we can see that LLM evaluation using text-davinci-003 yields more convincing results than using human evaluation on AMT for open-ended story generation. The results show that text-davinci-003 can perform basic evaluations such as checking for grammatical errors in stories. Additionally, the model excels in assessing the relevance of a story to a prompt, which involves more complex reasoning over the connection between the two. We also find the Krippendorff's $\alpha$ of text-davinci-003 is much higher than T0 and text-curie-001, indicating that the rating by text-davinci-003 is more consistent among different samplings of the generated answers. + +ChatGPT rates like human experts and can explain its own decision well: ChatGPT also shows a clear preference for human-written stories, and the preference toward human written-stories is statistically significant. When we query ChatGPT using the OpenAI user interface, we find several + +interesting observations: (1): ChatGPT is able to provide a detailed explanation of why it gives a certain rating. It will reference the sentences in the stories and prompts to support its rating. (2): ChatGPT sometimes refuses to rate the likability of the story because "I am an AI and I do not have the ability to experience enjoyment". In such cases, we regenerate the response until it gives a rating. (3): we find that ChatGPT tends to rate low likability on violent or impolite stories, which is likely because it is trained to provide safe and unharmful replies, making ChatGPT dislike brutal and profane stories. + +Experts mostly agree with the ratings and explanations of ChatGPT: We randomly select the answers on four stories by ChatGPT and ask the English teachers if they agree with the reasoning and rating of $\mathrm{ChatGPT}^3$ . The teachers mostly agree with the rating and consider the explanation from ChatGPT reasonable. Interestingly, one teacher told us she cannot agree with ChatGPT's rating on grammaticality because ChatGPT considers punctuation errors as grammar errors, but she does not think punctuation errors are grammar errors. This shows that individuals have their own standards for ratings and this is also the case for LLMs. + +text-davinci-003 tends to give higher ratings and ChatGPT is the opposite: The rating on the same attribute of the same type of text tends to be higher for text-davinci-003 compared with human rating; contrarily, ChatGPT is more fastidious and prone to give lower scores. This shows that different LLMs have distinct tendencies regarding the rating. While the absolute values of the scores rated by text-davinci-003, ChatGPT, and human differ, they all rate human-written texts higher than GPT-2-generated stories. The absolute number reflects the bias or belief of the evaluator; as long as one uses the same evaluators to assess different systems, the comparison is meaningful. + +# 3.3.1 Does LLM and Human Evaluators Agree on the Rating of Individual Stories? + +We have found in Table 1 that the ratings of text-davinci-003 and ChatGPT show a strong preference toward human-written stories just like English teachers. However, it is unclear whether those LLMs agree with the teachers' rating on each individual story. Precisely, when English teachers rate a story higher, do LLMs also rate the + +
Story WriterHumanGPT-2
Grammaticality0.140.12
Cohesiveness0.180.14
Likability0.190.22
Relevance0.380.43
+ +Table 2: The Kendall's $\tau$ correlation coefficient between English teachers and text-davinci-003. + +story higher? To answer this question, we calculate Kendall's $\tau$ correlation coefficient between the ratings of text-davinci-003 and English teachers. We choose to use the correlation coefficient instead of the inter-annotator agreement score because IAA mainly cares if two annotators agree on the exact ratings, while the correlation coefficient focus on the question: "when annotator A rates one story higher, does annotator B also rate the story higher?" (Amidei et al., 2019). We calculate Kendall's $\tau$ for four rating attributes as follows: For each story and each rating attribute, we calculate the average rating of the three English teachers and calculate the average rating of the three scores given by the text-davinci-003 (which is obtained from three independent samples). For each attribute, we collect the average rating of teachers into a vector $A \in \mathbb{R}^{200}$ , where each entry is the average rating of a story; likewise, we construct a vector $B \in \mathbb{R}^{200}$ for the average ratings of davinci. Next, we calculate Kendall's $\tau$ correlation coefficient between $A$ and $B$ . + +The Kendall's $\tau$ between teacher ratings and LLM ratings is shown in Table 2.4 We find that for all four attributes and for both human-written and GPT-2-generated stories, we observe weak to strong positive correlations between teachers' ratings and text-davinci-003's ratings. All the correlations have $p$ -values less than 0.05. Hence, we can say that when teachers rate a story higher, text-davinci-003 also rates it higher to a certain extent. We also observe that Kendall's $\tau$ for different attributes are quite different: relevance has the strongest correlation while grammaticality has the weakest correlation. This is possibly because rating relevance is rather straightforward, which requires checking if the content in the prompt is mentioned in the story. On the contrary, what should be con + +sidered when rating grammaticality is not clearly stated in our instructions, so the LLM may have a different rubric compared with English teachers. We also calculate the average Kendall's $\tau$ between a pair of English teachers, and we find a weak correlation on grammaticality between the rating of two teachers, while the correlation of the rating on relevance is much stronger. The result is presented in Table 6 in Appendix. + +# 3.3.2 Variance due to Different Instructions + +LLMs have been shown to be sensitive to the instructions used to query the LLM sometimes (Zhao et al., 2021; Sanh et al., 2022). To investigate how varying the task instructions and questions can affect the LLM evaluation result for open-ended story generation, we change the instructions and questions and see how the LLM evaluation result changes. We experiment with two different instructions by changing the instruction or question in Figure 1: (1) We preprocess the sentence, "(You are a human worker hired to rate the story fragment.)", in front of the task instruction in Figure 1. We try to provide the LLM a persona for it to better understand its role. This is inspired by previous work that reported GPT-3 can yield different results when giving them a persona (Zeng et al., 2022). (2) We ask the LLMs to explain their decision by appending the following sentence after the question: Please also explain your decision. Here, we would like to know if LLM will rate the stories differently when they are asked to justify their decision. This is inspired by zero-shot chain-of-thought (Kojima et al.). We use text-davinci-003 instead of ChatGPT as the LLM in this experiment since it is more accessible than ChatGPT. + +The results are shown in the upper block in Table 3. We observe that for grammaticality and cohesiveness, the scores obtained from different instructions are quite close: the rating changes due to different instructions are less than 0.1. For the other two attributes, the score changes are slightly larger but still in the range of 0.25. Despite that there are small variations due to different instructions, these variances still do not change the conclusion that "LLM rates human-written stories higher than GPT-2-generated stories". Thus, different instructions do not change the relative ranking of GPT-2-generated and human-written stories. In summary, as long as the stories are evaluated using the same instructions using LLM evaluation, such evaluation and comparison are meaningful. + +
SetupGrammaticalityCohesivenessLikabilityRelevance
HumanGPT-2HumanGPT-2HumanGPT-2HumanGPT-2
Different instructions (Section 3.3.2)
Original4.220.384.070.354.540.454.260.453.990.383.840.424.400.794.020.74
(1) + persona4.290.454.010.454.600.494.270.504.050.393.870.394.550.704.250.77
(2) + explain4.240.424.050.254.610.494.320.514.150.443.980.344.350.754.030.56
Different sampling temperature T (Section 3.3.3)
T = 1.04.220.384.070.354.540.454.260.453.990.383.840.424.400.794.020.74
T = 0.74.180.354.060.334.520.484.230.433.960.343.820.424.360.773.950.72
T = 0.34.130.333.990.254.480.494.140.393.950.263.820.414.340.753.930.67
T = 04.070.273.990.184.490.504.090.343.950.253.820.404.320.753.920.66
+ +Table 3: Understanding the variance of LLM evaluation. For each of the four attributes evaluated, the left column is the mean and standard deviation of human-written stories and the right column is those of GPT-2-generated stories. The upper block shows the rating change due to different instructions (Section 3.3.2), and the lower block is the result of changing the temperature $T$ used for generating the LLM's output (Section 3.3.3). + +# 3.3.3 Variance due to Different Sampling Parameters + +When generating the answers from the LLM, we must choose a set of hyperparameters for generation, including the temperature $T$ and the probability $p$ used in nucleus sampling. To understand whether different sampling parameters change the LLM evaluation result, we modify the temperature used for sampling and keep the $p$ in nucleus sampling fixed to 0.9 when generating the answers from text-davinci-003. We do not simultaneously vary $T$ and $p$ since the two parameters are both used to control the diversity of the output, it is enough to change only one of the two parameters, as recommended in the API documentation. + +The results of varying $T$ from 1 to 0 are shown in the lower block in Table 3. We observe an interesting trend as $T$ varies from 1 to 0: the average rating slightly drops in most cases. Considering that $T = 0$ is simply argmax sampling, the result indicates that the response of the LLM with the highest probability tends to give lower scores. Despite this interesting trend, the LLM consistently rates human-written stories higher than GPT-2-generated stories. While not shown in Table 3, we find that the IAA increases as the temperature decreases. This is expected since lower temperature means less diversity during the LLM sampling, causing the sampled ratings to agree more closely. In summary, changing the instructions and temperatures can slightly change the absolute value of the rating given by LLM but does not change the LLM's preference on human-written stories. The overall result in this section shows that LLM evaluation is useful + +in evaluating open-ended story generation. + +# 4 Example Task 2: Adversarial Attack + +As another application, we use LLM evaluation to rate the texts generated by adversarial attacks. + +# 4.1 Task Introduction + +Given a trained text classifier and a benign (non-adversarial) testing sample that the text classifier can correctly classify, an adversarial attack aims to craft an adversarial sample that makes the classifier make a wrong prediction. A special type of adversarial attack is called synonym substitution attacks (SSAs) (Alzantot et al., 2018), where the adversarial sample is created by replacing some words with their synonyms in the benign sample. By replacing words with their synonym, the semantics of the benign sample should be preserved in the adversarial sample and make the adversarial perturbation imperceptible to humans. While conceptually reasonable, it has recently been shown that many SSAs often yield ungrammatical and unnatural adversarial samples that significantly change the meaning of the benign sample (Hauser et al., 2021; Chiang and Lee, 2022). To evaluate the quality of adversarial samples, human evaluation is invaluable and widely used in prior works. In our experiment here, we would like to see whether the LLMs can rate the quality of adversarial samples like human experts. Adversarial samples are not normal texts, so the LLMs may not have seen such abnormal inputs during training. It would be interesting to know how LLMs rate these adversarial samples. + +
Human evaluateLLM evaluate
FluentMean.FluentMean.
Benign4.55-4.325.00†
Textfooler2.171.882.122.06
PWWS2.161.852.422.49
BAE3.013.023.713.71
+ +Table 4: Mean Likert score of LLM evaluation and human evaluation result on fluency (Fluent) of the benign and adversarial samples and meaning preserving (Mean.) between the news title before and after adversarial attacks. + +# 4.2 Experiment Setup + +We select three different classic SSAs: Textfooler (Jin et al., 2020), PWWS (Ren et al., 2019), and BAE (Garg and Ramakrishnan, 2020); these attacks are predominantly used as strong baselines in the literature of SSAs nowadays. We use these three SSAs to attack a BERT-base-uncased model (Devlin et al., 2019) fine-tuned on AG-News (Zhang et al., 2015), a news classification dataset. For each SSA, we randomly select 100 pairs of benign and adversarial samples and use LLMs to evaluate their quality. We show the result of using ChatGPT as LLM here since it can better explain its decision. Following the suggestions of prior works (Morris et al., 2020), we evaluate the quality of the adversarial samples from two aspects: the fluency and meaning preservation. For fluency, we present the LLM with a piece of news (either benign or adversarial sample) and the following question: How natural and fluent is the text of the news title? (on a scale of 1-5, with 1 being the lowest). For meaning preserving, we present the LLM with both the benign and the adversarial sample, and prompt the LLM to answer this question: Do you agree that the meaning (or semantics) of news title 1 is preserved in news title 2? (on a scale of 1-5, with 1 being the strongly disagree and 5 being strongly agree.) The exact instruction and formatting are presented in Appendix D.2.3. We also ask three English teachers to rate the fluency and meaning preserving of the samples. The task instructions and questions are formatted the same as in LLM evaluation. + +# 4.3 Experiment Result + +The results are presented in Table 4. We can see that English teachers rate the adversarial samples + +generated by SSAs very low in terms of fluency and meaning preserving, this result is in line with recent observations on the quality of adversarial samples (Hauser et al., 2021; Chiang and Lee, 2022). Before interpreting the result of LLM evaluation, we first conduct a sanity check on whether the LLM understands the task. We ask the LLM to rate the meaning preserving of two benign samples that are exactly the same. Ideally, the LLM should always give a score of 5, meaning that it strongly agrees that the meanings are not changed. The result of this sanity check is the entry with $\dagger$ in Table 4, which is a perfect 5.00. ChatGPT often says that "the two titles are identical so I rate a 5 (strongly agree)", showing that ChatGPT understands what the task is about. + +Next, we turn our attention to the LLM evaluation results of the adversarial samples. We observe that ChatGPT tends to rate adversarial samples higher than English teachers, meaning that ChatGPT is less harsh on the unnatural and artificial parts in the adversarial samples. We conduct the same experiment using text-davinci-003 and find similar results. Although ChatGPT rates adversarial samples higher than the teachers, ChatGPT still rates adversarial samples significantly lower than benign samples. ChatGPT also agrees with the English teachers that the adversarial samples generated by BAE are better than the samples generated by Textfooler and PWWS. + +Interestingly, we find that ChatGPT rates PWWS to be more natural than Textfooler, while such a rating difference is not seen in the expert human evaluation. At first sight, this means that ChatGPT is inconsistent with human evaluation results. However, by scrutinizing the human evaluation results, we find that two teachers rate PWWS higher than Textfooler while one teacher rates PWWS much lower than Textfooler. This indicates that ChatGPT actually agrees with the majority of human experts. Overall, LLM can rank the quality of adversarial texts and benign texts like most human experts. + +# 5 Discussions + +In this paper, we propose to use LLM for evaluating the quality of texts to serve as an alternative to human evaluation. To demonstrate the potential of LLM evaluation, we use LLMs to rate the quality of texts in two distinct tasks: open-ended story generation and adversarial attacks. We show that even if LLMs have exceptional zero-shot in-context + +learning ability, they are not always suitable to be used for LLM evaluation. Still, we find that the best InstructGPT and ChatGPT can rate the quality of texts like human experts on the two tasks we used as examples. Overall, the results in this paper demonstrate that LLM evaluation has the potential to be used to evaluate NLP systems and algorithms. + +Pros of LLM evaluation There are several benefits of LLM evaluation, compared to human evaluation. First, LLM evaluation is more reproducible. Human evaluation results are hard to reproduce as it is difficult to hire the same group of evaluators, and it is hard to compare the results of similar experiments even if they use the same instructions, recruitment platform, and qualifications for the evaluators. On the contrary, LLM evaluation does not have such a drawback. By specifying the model used for LLM evaluation, the random seed, and the hyperparameters used to generate the answers from the LLM, the LLM evaluation result is more likely to be reproduced. Note that in certain cases, the LLM provider may regularly update the LLM, making the LLM evaluation unreproducible if the LLM is outdated and not accessible. + +Second, the evaluation of each sample is independent of each other in LLM evaluation. Contrarily, in human evaluation, the rating of the current example may more or less be affected by prior samples. Humans tend to compare the current sample to the ones they have previously seen and this affects their ratings. As a piece of evidence, in the interview after rating the 400 stories, the English teachers say it took them some time to calibrate their ratings (Appendix C.3.1). Thus, using LLM evaluation can simplify some experiment designs since one does not need to worry whether the order of the sample being evaluated will change the result. Still, one may also argue that being able to calibrate the rating of different samples is desired and this is why human evaluation might be preferred. Overall, whether the rating of the evaluator (human or LLM) should be affected by a previously rated item is inherently a design choice of the experiment. + +Third, LLM evaluation is cheaper and faster than human evaluation, making it easier and quicker for researchers to evaluate the quality of NLP systems. Hiring an English teacher to rate 200 stories costs us US$140, while LLM evaluation using the best InstructGPT model costs less than US$5. It took us over a week to collect human evaluation results starting from recruitment to col + +lecting the evaluation results, but only a few hours to query InstructGPT and perform LLM evaluation. + +Finally, utilizing LLM evaluation, rather than human evaluation, can minimize the need for human exposure to objectionable content, such as violent, sexual, hateful, or biased material. Such content may cause discomfort for human evaluators while reading and rating these texts. + +Limitations and Ethical Considerations of LLM evaluation Despite the promising results of LLM evaluation shown in this paper, there are some limitations of this method. First, LLM may possess incorrect factual knowledge (Cao et al., 2021), so it is not suitable to use them in tasks that involve factual knowledge. Next, LLMs trained to behave in a certain way can be biased toward certain responses. Precisely, an LLM that is trained to be safe and non-harmful can result in LLMs preferring to generate more positive and upbeat responses, which is observed throughout our interaction with ChatGPT. Additionally, even with researchers' efforts to make LLMs safer (Bai et al., 2022a,b), LLMs can still generate harmful and biased responses (Ganguli et al., 2022; Perez et al., 2022), which are violent of basic ethics, and LLM evaluation results will be highly doubtful (Hendrycks et al., 2021). However, it is important to note that these limitations and potential harms also apply to human evaluation: the bias of human evaluators can affect the human evaluation result (Lentz and De Jong, 1997; Amidei et al., 2018). + +Our pioneering idea, LLM evaluation, has the potential to transform the NLP community. We encourage future researchers to consider using it while being aware of its limitations. Our paper's goal is not to replace human evaluation but to present an alternative option. Both human and LLM evaluation have their own advantages and disadvantages, and they can be used in conjunction. We recommend using LLM evaluation as a cheap and fast quality judgment when developing a new NLP system, while human evaluation is best used to collect feedback from humans prior to deploying the NLP system in real-world applications. + +# Limitations + +There are additional limitations and potential risks of LLM evaluations that should be noted, and these limitations are actually well-known problems of pre-trained language models. As listed on the Open AI blog for ChatGPT, ChatGPT sometimes generates answers that sound right and plausible but are totally nonsense. OpenAI also admits that the model's response may be sensitive to the prompt used to query the model. While in Section 3.3.2, we find that the overall results among different instructions are not significantly different, we cannot guarantee that this is the case for all kinds of modification on the task instructions. + +Other than the limitations listed on the OpenAI blog, there are still other limitations. For example, LLMs may not have emotions. Whether AI models have emotion is a more philosophical question and is controversial, so the results of using such models for evaluating emotion-related tasks may be strongly challenged and may even violate research ethics. As we find during our experiments, ChatGPT often replies "I am an AI system and I do not have emotions like a human" when asked to rate the likability of a story. + +Another important limitation of LLM evaluation is that LLMs lack the ability to process visual cues in task instructions, unlike human evaluation. Human evaluators can use formatings such as special fonts or text styles to focus on important parts of the instructions. Additionally, the way instructions and questions are formatted can influence how human evaluators approach the task. While using special HTML syntax can serve as an alternative for visual cues, such tags are not used in human evaluation, so we do not use those HTML tags in LLM evaluation to incorporate visual cues in the inputs to the LLMs. However, LLMs can only process raw text input and are unable to take in visual cues. + +# Ethics Statement + +Further ethical considerations of LLM evaluation Aside from the limitations of LLM evaluation mentioned previously, there is a crucial ethical concern at the heart of LLM evaluation. Is it ethical to replace human evaluation with LLM evaluation? Some may question if this paper is suggesting that LLMs are now ready to replace humans and find this idea unsettling. As responsible and ethical NLP researchers, we understand these concerns but + +want to make it clear that this is not our intent. As our paper title suggests, we aim to offer an alternative option to human evaluation with the goal of enhancing the reproducibility of NLP research. Human evaluation is still essential as the ultimate goal of NLP systems is to be used by human users, so it's important to gather feedback from them. We highly enjoy the process of discussing the experiment settings and results with the English teachers we hired. We do not recommend that future researchers completely eliminate human evaluation; rather, we believe that human evaluation should be used in conjunction with LLM evaluation. Both methods have their own advantages and disadvantages, making them both necessary for evaluating NLP systems. We hope the positive results in this paper provide NLP researchers with an alternative method to evaluate systems and encourage further discussions on this topic. + +Ethical statements on the experiments in the paper All the experiments strictly follow the ACL Code of Ethics. We include comprehensive details about human evaluation in Appendix C.1. To summarize, we include the exact instructions and screenshots of the interface in the human evaluation. We inform the human evaluators what the task is about and tell them that their responses will be used to assess the performance of AI models. We try our best to follow the ethical guidelines of ACL. + +We use the models and datasets when following their intended usage. Specifically, we follow the OpenAI usage policy when using the InstructGPT models and the ChatGPT model. + +# Acknowledgements + +We want to thank the reviews for providing detailed feedback and actionable suggestions, which help us strengthen our paper. We list the modification based on the reviewers' suggestions in Appendix A. + +We thank Yung-Sung Chuang for providing valuable feedback on the draft of this paper. We want to thank Tung-En Hsiao, the administrative assistant of our lab, for helping us deal with the payment on Upwork. Cheng-Han Chiang is supported by a Ph.D. scholarship program by Delta Electronics. + +# References + +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. +Jacopo Amidei, Paul Piwek, and Alistair Willis. 2018. Rethinking the agreement in human evaluation tasks. In Proceedings of the 27th International Conference on Computational Linguistics, pages 3318-3329, Santa Fe, New Mexico, USA. Association for Computational Linguistics. +Jacopo Amidei, Paul Piwek, and Alistair Willis. 2019. Agreement is overrated: A plea for correlation to assess human evaluation reliability. In Proceedings of the 12th International Conference on Natural Language Generation, pages 344-354, Tokyo, Japan. Association for Computational Linguistics. +Yuntao Bai, Andy Jones, Kamal Ndousse, Amanda Askell, Anna Chen, Nova DasSarma, Dawn Drain, Stanislav Fort, Deep Ganguli, Tom Henighan, et al. 2022a. Training a helpful and harmless assistant with reinforcement learning from human feedback. arXiv preprint arXiv:2204.05862. +Yuntao Bai, Saurav Kadavath, Sandipan Kundu, Amanda Askell, Jackson Kernion, Andy Jones, Anna Chen, Anna Goldie, Azalia Mirhoseini, Cameron McKinnon, et al. 2022b. Constitutional ai: Harmlessness from ai feedback. arXiv preprint arXiv:2212.08073. +R Botsch. 2011. Chapter 12: Significance and measures of association. Scopes and Methods of Political Science. +Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. 2020. Language models are few-shot learners. Advances in neural information processing systems, 33:1877-1901. +Nicola De Cao, Wilker Aziz, and Ivan Titov. 2021. Editing factual knowledge in language models. +Cheng-Han Chiang and Hung-yi Lee. 2022. How far are we from real synonym substitution attacks? arXiv preprint arXiv:2210.02844. +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. +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. +Deep Ganguli, Liane Lovitt, Jackson Kernion, Amanda Askell, Yuntao Bai, Saurav Kadavath, Ben Mann, Ethan Perez, Nicholas Schiefer, Kamal Ndousse, et al. 2022. Red teaming language models to reduce harms: Methods, scaling behaviors, and lessons learned. arXiv preprint arXiv:2209.07858. +Leo Gao. 2021. On the sizes of openai api models. Accessed on January 17, 2023. +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. +Fabrizio Gilardi, Meysam Alizadeh, and Maël Kubli. 2023. Chatgpt outperforms crowd-workers for text-annotation tasks. arXiv preprint arXiv:2303.15056. +Dan Gillick and Yang Liu. 2010. Non-expert evaluation of summarization systems is risky. In Proceedings of the NAACL HLT 2010 Workshop on Creating Speech and Language Data with Amazon's Mechanical Turk, pages 148-151, Los Angeles. Association for Computational Linguistics. +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. +Francisco Guzmán, Ahmed Abdelali, Irina Temnikova, Hassan Sajjad, and Stephan Vogel. 2015. How do humans evaluate machine translation. In Proceedings of the Tenth Workshop on Statistical Machine Translation, pages 457-466, Lisbon, Portugal. Association for Computational Linguistics. +Jens Hauser, Zhao Meng, Damián Pascual, and Roger Wattenhofer. 2021. Bert is robust! a case against synonym-based adversarial examples in text classification. arXiv preprint arXiv:2109.07403. +Dan Hendrycks, Collin Burns, Steven Basart, Andrew Critch, Jerry Li, Dawn Song, and Jacob Steinhardt. 2021. Aligning {ai} with shared human values. In International Conference on Learning Representations. + +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. +Fan Huang, Haewoon Kwak, and Jisun An. 2023. Is chatgpt better than human annotators? potential and limitations of chatgpt in explaining implicit hate speech. arXiv preprint arXiv:2302.07736. +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 Proceedings of the AAAI conference on artificial intelligence, volume 34, pages 8018-8025. +Marzena Karpinska, Nader Akoury, and Mohit Iyyer. 2021. The perils of using Mechanical Turk to evaluate open-ended text generation. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 1265-1285, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Takeshi Kojima, Shixiang Shane Gu, Machel Reid, Yutaka Matsuo, and Yusuke Iwasawa. Large language models are zero-shot reasoners. In Advances in Neural Information Processing Systems. +Leo Lentz and Menno De Jong. 1997. The evaluation of text quality: Expert-focused and reader-focused methods compared. IEEE transactions on professional communication, 40(3):224-234. +Huanru Henry Mao, Bodhisattwa Prasad Majumder, Julian McAuley, and Garrison Cottrell. 2019. Improving neural story generation by targeted common sense grounding. 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 5988-5993, Hong Kong, China. Association for Computational Linguistics. +John Morris, Eli Lifland, Jack Lanchantin, Yangfeng Ji, and Yanjun Qi. 2020. Reevaluating adversarial examples in natural language. In *Findings of the Association for Computational Linguistics: EMNLP* 2020, pages 3829-3839, Online. Association for Computational Linguistics. +OpenAI. 2022. Chatgpt: Optimizing language models for dialogue. Accessed on January 10, 2023. +Long Ouyang, Jeff Wu, Xu Jiang, Diogo Almeida, Carroll L Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, et al. 2022. Training language models to follow instructions with human feedback. arXiv preprint arXiv:2203.02155. +Ethan Perez, Saffron Huang, Francis Song, Trevor Cai, Roman Ring, John Aslanides, Amelia Glaese, Nat McAleese, and Geoffrey Irving. 2022. Red teaming + +language models with language models. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 3419-3448, Abu Dhabi, United Arab Emirates. Association for Computational Linguistics. +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. +Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J Liu, et al. 2020. Exploring the limits of transfer learning with a unified text-to-text transformer. J. Mach. Learn. Res., 21(140):1-67. +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. +Victor Sanh, Albert Webson, Colin Raffel, Stephen Bach, Lintang Sutawika, Zaid Alyafeai, Antoine Chaffin, Arnaud Stiegler, Arun Raja, Manan Dey, M Saiful Bari, Canwen Xu, Urmish Thakker, Shanya Sharma Sharma, Eliza Szczechla, Taewoon Kim, Gunjan Chhablani, Nihal Nayak, Debajyoti Datta, Jonathan Chang, Mike Tian-Jian Jiang, Han Wang, Matteo Manica, Sheng Shen, Zheng Xin Yong, Harshit Pandey, Rachel Bawden, Thomas Wang, Trishala Neeraj, Jos Rozen, Abheesht Sharma, Andrea Santilli, Thibault Fevry, Jason Alan Fries, Ryan Teehan, Teven Le Scao, Stella Biderman, Leo Gao, Thomas Wolf, and Alexander M Rush. 2022. Multitask prompted training enables zero-shot task generalization. In International Conference on Learning Representations. +Teven Le Scao, Angela Fan, Christopher Akiki, Ellie Pavlick, Suzana Ilic, Daniel Hesslow, Roman Castagné, Alexandra Sasha Luccioni, François Yvon, Matthias Galle, et al. 2022. Bloom: A 176b-parameter open-access multilingual language model. arXiv preprint arXiv:2211.05100. +Jiaan Wang, Yunlong Liang, Fandong Meng, Haoxiang Shi, Zhixu Li, Jinan Xu, Jianfeng Qu, and Jie Zhou. 2023. Is chatgpt a good nlg evaluator? a preliminary study. arXiv preprint arXiv:2303.04048. +Jason Wei, Maarten Bosma, Vincent Zhao, Kelvin Guu, Adams Wei Yu, Brian Lester, Nan Du, Andrew M. Dai, and Quoc V Le. 2022. Finetuned language models are zero-shot learners. In International Conference on Learning Representations. +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, + +Toven 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. + +KiYoon Yoo, Jangho Kim, Jiho Jang, and Nojun Kwak. 2022. Detection of adversarial examples in text classification: Benchmark and baseline via robust density estimation. In Findings of the Association for Computational Linguistics: ACL 2022, pages 3656-3672, Dublin, Ireland. Association for Computational Linguistics. + +Andy Zeng, Adrian Wong, Stefan Welker, Krzysztof Choromanski, Federico Tombari, Aveek Purohit, Michael Ryoo, Vikas Sindhwani, Johnny Lee, Vincent Vanhoucke, et al. 2022. Socratic models: Composing zero-shot multimodal reasoning with language. arXiv preprint arXiv:2204.00598. + +Xiang Zhang, Junbo Zhao, and Yann LeCun. 2015. Character-level convolutional networks for text classification. Advances in neural information processing systems, 28. + +Zihao Zhao, Eric Wallace, Shi Feng, Dan Klein, and Sameer Singh. 2021. Calibrate before use: Improving few-shot performance of language models. In International Conference on Machine Learning, pages 12697-12706. PMLR. + +# A Modification Based on the Reviews + +We list the main differences between this version and the pre-review version of our paper; the modifications are mainly based on the reviewers' suggestions. We thank the reviewers again for those valuable suggestions. + +- We add Section 3.3.1 to discuss whether the LLM and human evaluators agree on the ratings of individual stories. +- We refine the wordings in Section 5 and add relevant references. +- We add Table 6 to discuss the correlation between human evaluators. +- We conduct supplementary experiments on human evaluation that mixes human-written stories and GPT-2-generated stories when conducting human evaluation and report the results in Table 5. +- We correct the typos and include almost all presentation suggestions mentioned by the reviewers. We cannot follow all presentation suggestions due to limited space. + +# B Experiment Details for Open-Ended Story Generation + +# B.1 The WritingPrompt Dataset + +The training dataset contains 303K pairs of stories and prompts, which our model is trained on. We only use 200 prompt-story pairs from the test set. The dataset is downloaded from https://www.kaggle.com/datasets/ratthachat/writing-prompts. + +# B.2 Fine-tuning the GPT-2 Model + +We train the model for 3 epochs with a learning rate of $5e - 5$ and linear learning rate schedule. The trained model eventually reaches a perplexity of 20 on the validation set of WritingPrompts. + +# B.3 Data Post-processing + +Once the model is trained, we randomly select 200 prompts from the testing set of WritingPrompts, and feed the prompts to the trained model and ask the model to generate stories based on the given prompts. When generating the stories, we adopt nucleus sampling with $p = 0.9$ . Next, we manually truncate the generated stories to less than 150 words and ensure that after the truncation, the story ends with a full sentence. After this process, we have 200 pairs of prompts and model-generated stories. + +As a comparison to model-generated stories, we select the same 200 prompts used for generating model-generated stories and their corresponding human-written stories to form 200 pairs of prompts and human-written stories. For these human-written stories, we also truncate the stories to less than 150 words and end with a full sentence to match the model-generated sentences. We also manually remove some artifacts in the human-written story due to the tokenization of the WritingPrompts dataset. + +# C Human Evaluation + +# C.1 Recruiting English Teachers + +The English teachers hold ESL certificates; given that they are experienced with correcting essays written by students, they are perfect fits for this task. Each teacher is asked to rate 200 GPT-2-generated stories and 200 human-written stories, and they are + +paid US $140 for rating 200 stories. Considering that the teachers reported that they take at most 5 hours to rate 200 stories, this makes the hourly wage at least US$ 28. We first ask the teachers to rate the GPT-2-generated stories and then the 200 human-written stories. Different from Karpinska et al. (2021) that take a break between the rating of GPT-2-generated stories and the human-written stories, we do not take a break to avoid the teacher's rating standard to change after taking a long break. The teachers are not told who wrote the stories before they evaluate the stories. We reveal to them what this project aims to study after they finish rating all the stories. + +The reason we do not mix human-written and GPT-2-generated stories for rating is that in Karpinska et al. (2021), their observation is that (1) when AMT workers rate model-generated and human-written stories separately, their ratings do not show preference toward human-written stories, but (2) even when rating the model-generated and human-written stories separately, English teacher shows clear preference toward human-written stories. We follow their settings and do not mix GPT-2-generated/human-written stories. + +During the reviewing process, we received questions from the reviewers about why not mixing the stories for human evaluation. Thus, we conduct the same experiment by randomly mixing 200 human-written and 200 GPT-2-generated stories and asking three teachers (not the teachers that already rated the stories) to rate them. All other experiment conditions are the same as previously stated. The full result is shown in Table 5. We find that the teacher still shows a clear preference toward human-written stories for all four attributes, similar to the observation in Table 1. The only exception is grammaticality, where English teachers do not show a very clear preference for the grammar of human-written stories. However, when calculating the average rating for individual teachers, we find that two out of three teachers do rate grammaticality higher for human-written stories. It is interesting to note that for LLM evaluation, there is no such problem about whether or not to mix the human-written and GPT-2-generated stories during LLM evaluation as the rating of each story is independent of each other, as discussed in Section 5. + +For adversarial attack quality evaluation, we also recruit certified teachers on Upwork. The teachers + +
WriterHumanGPT-2
Grammaticality3.890.973.880.84
Cohesiveness4.350.873.490.97
Likability3.461.402.891.12
Relevance3.711.202.371.33
+ +Table 5: The average Likert score for human-written and GPT-2-generated stories when we randomly mix the 200 model-generated and 200 human-written stories during human evaluation. + +are asked to rate 100 news titles and are paid US\(35 for doing so. They reported that it took them less than 1 hour to complete the rating. + +# C.2 Human Evaluation Interface + +Open-Ended Story Generation We use Google Forms to collect the responses from the teachers. Each form contains 100 stories, and each story is on one page of the Google Form. The interface on one page is shown in Figure 2 and Figure 3; the two figures are from the same page of the Google Form, and we are splitting them because screenshot the whole interface will cause low resolution. + +Please rate the story fragment + +The goal of this task is to rate story fragment + +NOTE: Please take the time to fully read and understand the story fragment. We will + +reject submissions from workers that are clearly spamming the task. + +# Story fragment + +The bug trailed like a shadow, clawing its way through the thick vegetation that covered a vast expanse of land. It was nearly six miles long, with five legs. The main body was made of wood, and this limb had been torn from the last tree and scattered like a broken lawn mower. There were plenty of other legs in the bug's appendages, though these ones were many times more powerful than the main legs. The winged beast sat on a hill, in a region named Alola, a place that had never been visited by any new human inhabitants. Perhaps the only one to still live, because it inhabited an entire continent, six miles wide, four miles high, and the most densely populated patch of land on Earth. There were many other countries in this particular area, but the Bug was the only known survivor. + +How grammatically correct is the text of the story fragment? (on a scale of 1-5, * with 1 being the lowest) + +1 (lowest) +2 +3 +4 +5 (highest) + +Figure 2: The upper part of the interface in open-ended story generation. + +Adversarial Attacks Quality Evaluation In this task, we also use Google Forms to collect the responses from the teachers. We create two different Google Forms, one is used to evaluate the fluency, + +How well do the sentences in the story fragment fit together? (on a scale of 1-5, * with 1 being the lowest) + +1 (lowest) +2 +3 +4 +5 (highest) + +How enjoyable do you find the story fragment? (on a scale of 1-5, with 1 being the \* lowest) + +1(lowest) +2 +3 +4 +5 (highest) + +Now read the PROMPT based on which the story fragment was written. + +PROMPT: You're the last person on earth - but thank god Pokemon Go still functions! You amuse yourself by catching Pokemon as you travel so as to not feel so isolated and alone. One day, on your screen, you see in the distance that someone has set up a lure. + +How relevant is the story fragment to the prompt? (on a scale of 1-5, with 1 being the lowest) + +1 (lowest) +2 +3 +4 +5 (highest) + +whose interface is shown in Figure 4. In this form, we mix an equal number of benign news titles, TextFollower-attacked, PWWS-attacked, and BAE-attacked news titles. Each page of the Google Form contains one news title. + +Another Google Form is used to compare the meaning preserving of the news title before and after the adversarial attacks. We highlight the difference between the benign and adversarial samples using **boldface**, as shown in Figure 5. On each page of the Google Form, there is one pair of news titles. + +# C.3 Post-Task Interview with English Teachers + +# C.3.1 How English Teachers Rate the Stories + +After the teachers rate 400 stories, we ask them the following questions: + +Q1 How long did it take you to rate the 400 sto + +![](images/859ac850eaba21b528944c9e0ad710a09fadf7366796c233ae5970785720e5d4.jpg) +Figure 4: The Google Form used to evaluate the fluency of the benign or adversarial samples. + +![](images/46278a457c292044c3c931e4d760a8497c2432da357de93355cf7f7fd0718ceb.jpg) +Figure 3: The lower part of the interface in open-ended story generation. +Figure 5: The Google Form used to evaluate the meaning preserving between a benign sample and an adversarial sample. + +ries? + +Q2 What is your standard on each of the four attributes (grammatical, coherence, likability, relevance) evaluated? For example, in what case do you give a high/low rating for grammatically? What kind of story did you give a low rating on likability? Did your personal preference affect the rating? +Q3 How long did it take for you to calibrate your rating on the task? +Q4 Did you change your rating on the first three attributes after reading the prompt the story is based on? + +We briefly summarize the answers from the three teachers. The teachers report that they spent 6 to + +
WriterHumanGPT-2
Grammaticality0.250.15
Cohesiveness0.260.18
Likability0.090.12
Relevance0.380.41
+ +Table 6: The Kendall's $\tau$ correlation coefficient two English teachers. Three English teachers participate in the rating, so the result in the Table is averaged over $\binom{3}{2}$ Kendall's $\tau$ . + +10 hours rating 400 stories. For grammar, most teachers check the punctuation9, word choice, and subject-verb agreement. English teachers decrease their rating based on the types and number of grammar errors in the stories. + +For coherence, the teachers rate it based on whether the sentences in the stories follow a logical sequence to build the narrative. The teachers ask themselves questions such as "does the story make sense". This is a more holistic evaluation of the whole story. + +For likability, some teachers say they try not to be affected by personal preference. One teacher asks herself: Did I personally enjoy it based on the amount of sense it made and whether or not it had stylistic flair, humor, or engaging plotting or characterization? Overall, the teachers all try to use a fair and objective view to rate the likability. For relevance, the teachers simply check if the story is based on the prompt or not. + +The teachers said that it took them about five to ten stories to calibrate their ratings. Except for one teacher changing the rating on the other three attributes after seeing the prompt on only one story, the teachers do not change their rating on the three other attributes after reading the prompts. + +# C.3.2 Teachers' Comments on ChatGPT's Rating + +After the teachers finished the rating and answered the four questions in Appendix C.3.1, we ask them to check the ratings and explanations of ChatGPT and ask if they agree with ChatGPT. We told the teachers that the rating is done by another teacher we hire; we do not tell the teacher that the rating is done by an AI model to avoid possible stereotypes about AI models. We randomly select four stories + +rated by ChatGPT; two of them are highly-rated and lowly-rated human-written stories and the other two stories are highly-rated and lowly-rated GPT-2-generated stories. + +Story 1 It had been months since they found me dead. I don't know why I stopped walking. No-one else around to take my place, or talk with me. I spent days frozen in shock, never able to talk, unable to move, unable to express myself. It was a strange thing, nobody else would suspect me of wanting this. The more I focused on it, the more it consumed me. Years passed, and I got more and more lost in it. I began to think that perhaps they didn't really care about me. I still had a deep longing for them. All I had was so many steps to walk now. A quiet part of me liked to think that they had passed me by. The loneliness. It never felt like such a loss. They were gone, the ones who saved me. So why did I still keep walking? + +Prompt "Every person sees the world in a unique way. When someone dies it is, in a way, the death of an entire world." + +Ratings Table 7. + +Story 2 "My son is gone. He has been" People stare at you as you give your explanation and say "yes. But. You cant just do it" "He is my son! This is my son! I love him and he is going to be okay" "What do you mean he is okay? He said he was upset with someone, couldnt find his anger, how the hell can you tell, it doesn't fit the bill?! The police called, the doctor said it was an addiction" "You can't trust me! He told me he loves me." "No. No he doesnt. But I can trust you. The evidence against him was overwhelming, now he cant do anything. The evidence against him was all circumstantial" "A man I once was won't be able to marry me" + +Prompt Everyone is allowed to kill one person in their life. However, you have to fill out a form explaining why this person deserves to be killed and the committee can deny/approve your request as per the rules. You are presenting your form today. + +Ratings Table 8. + +Story 3 I held the little black box in the palm of my hand. Pitch black, perfectly cubed and nothing special about it, but it continued to hold my gaze + +regardless as if there were some deep importance about it. My friend Valhalla appeared out of no where and sat next to me, also staring at the cube. "What do you have there, Heaven?" he asked. I continued to gaze at the box, refusing to look at Valhalla for even a moment as though I would miss something if I did. "This," I said. "Is the secret to the universe." I could tell Valhalla was perturbed by this sort of knowledge, as if there was some evil about the cube. Or perhaps he didn't think such an object could exist. But I made it exist, and so it sits in the palm of my hand. + +Prompt The Little Black Box + +Ratings Table 9. + +Story 4 I stared down the telescopic sight of my 196 sniper rifle. I slowly moved my gaze into each window in the hotel, Many displays of various vice. One couple was violently pleasuring each other. Another was an old man, watching a younger woman strip in front of him. A prostitute no doubt. I inhaled slowly, and exhaled. The air was brisk, atleast 30 degrees Fahrenheit. I so small flakes of snow, float peacefully in front of me. I found the room, i was looking for. I've been tracking this man for 2 weeks. Man was he elusive. The lights flickered on. The red-haired man, was mildly attractive, i can see the appeal women had for him. I followed him into the next room, with my sights. The lights flickered on, i was taken aback by the scene. A man, overweight and balding. + +Prompt You are the antagonist of the story. However, you aren't sure if you can call yourself that after what the protagonist did. + +Ratings Table 10. + +Overall Comments from Teachers on ChatGPT's Rating After the teachers elaborated on their thoughts on the rating of ChatGPT, we ask them to provide an overall comment on how ChatGPT is doing. Again, the teachers are not informed that the ratings are done by an AI model. In summary, teachers all consider the rating and explanations reasonable. They find that the attributes they do not agree with are mainly Likability and Cohesiveness. However, they think the two attributes are a more holistic evaluation of the story and tend to be more subjective. Even if they do not give the same rating, they still are able to understand the + +explanation of ChatGPT. In the end, all teachers summarize that rating stories is highly subjective, and it is normal to have disagreements. + +# D LLM Evaluation + +# D.1 Details on LLMs used + +The T0 model we use is called T0pp, which is a variant of the T0 model and has 13B parameters. We will still use T0 to refer to this model. We load the T0 model using the transformers toolkit (Wolf et al., 2020). The two InstructGPT models, text-curie-001 and text-davinci-003, are queried using the OpenAI API. We query ChatGPT using the OpenAI GUI. While we are aware that some online resources provide an API-like tool to query ChatGPT, we think it violates the intended use of ChatGPT so we do not adopt those online resources. The ChatGPT we queried is the Dec. 15 and Jan. 9 version. + +OpenAI does not reveal the model sizes of any of the GPT models. However, it is estimated that text-curie-001 has 13B parameters and text-davinci-003 has 175B parameters (Gao, 2021). + +# D.2 Details on Querying the LLMs + +# D.2.1 Parsing the LLM outputs + +After the T0 and InstructGPT generate the answer, which is composed of several sentences in almost all cases, we parse the generated sentence to get the model's score. We use some rules to parse the output, and the rule is established after manually looking into the output of the generated sequences. First, we remove the string 1-5 from the output since we observe that LLM will sometimes say "... on a scale of 1-5 ..." and we remove the string out of 5 since LLM sometimes say it "give a score of $x$ out of 5". We also remove the string /5 since LLM sometimes uses "x/5" to express that it gives a score of $x$ out of 5. For rating the adversarial samples, we remove the title 1 and title 2 in the output sentences. Last, we use the regular expression to extract the first number in the sequence. We find that the above rules are sufficient to parse the output and get the rating of the LLMs. In a few rare cases, the LLM gives the rating with a 0.5 incremental, meaning that it gives scores like 4.5. In such cases, we do not drop the 0.5 since in our instruction, we do not explicitly tell it the rating should be 1-incremental. We find the LLM results merely difference between dropping + +
AttributeRaterResponse
GrammarChatGPTI would rate the grammatical correctness of the text of the story fragment as a 4. There are a few minor errors and awkward phrasings, but overall the text is well-constructed and easy to understand.
T1Agree
T2Agree
T3Agree
CohesiveChatGPTI would rate the fit of the sentences in the story fragment as a 5. The sentences flow well together, building a clear and cohesive narrative, and providing a sense of progression and development in the main character's thoughts and emotions.
T1Disagree: I think it's a 4 for me, not a 5, because there was one sentence that didn't seem to fit with the others.
T2Agree
T3Disagree: I find disjointedness in the passage, which serves to confuse me as a reader. The opening sentence is about the first-person narrator being found dead, but then the next sentences are about the narrator's inner thoughts. Also, this passage: "The loneliness. It never felt like such a loss." So what is the 'it' that felt like a loss? The loneliness? If so, how can that feel like a loss? If not, what is this 'it'? So, its juxtaposition to the previous sentence makes it confusing.
LikableChatGPTI would rate the story fragment as a 2 in terms of enjoyment. The fragment is written in a somber and introspective tone, and it deals with themes of isolation and loneliness, which may not be enjoyable for some readers. The protagonist's state of mind is also portrayed as being in a state of shock and confusion, which adds to the overall sense of unease and lack of enjoyment.
T1Disagree:I would rate it a 3, not a 2, since the enjoyment piece is subjective.
T2Disagree: While the rating of the freelancer find that the overall theme while somber has a glimmer of hope to it. It is this that makes it more enjoyable to me. The underdog story. Death is not an issue that should be shied away from in writing. We all face it and I enjoyed the honesty in the piece. : "Why did I keep walking?" Something I feel many of us face and may have asked ourselves. I believe that this would be relevant to many readers.
T3Agree
RelevantChatGPTI would rate the story fragment as a 5. It is highly relevant to the prompt as it explores the theme of death and how it can be seen as the death of an entire world. The story fragment also touches on the ideas of loneliness and longing, which are related to the loss of someone or something. The concept of the protagonist being frozen in shock and unable to express themselves, also supports the idea of how death can be seen as the death of an entire world.
T1Agree
T2Agree
T3Disagree: I do not see the link between the prompt and the story.
+ +Table 7: Story 1: a GPT-2-generated story that is highly-rated by ChatGPT. + +
AttributeRaterResponse
GrammarChatGPTI would rate the grammatical correctness of the story fragment as a 3. The text is generally understandable, but there are a few punctuation errors and awkward phrasing that make it somewhat difficult to follow.
T1Disagree:I would rate the grammar as a 2, not a 3–there were significantly more grammatical errors than the average within this set of story fragments.
T2Disagree: The issues with the grammar and coherence creates a stop start feeling when reading. I am unsure as to who is speaking in the text and this leaves me with many questions.
T3Disagree: The grammar is poorer than a 3, as is evident in for example what is supposed to be the second sentence: "He has been ... (incomplete, and another segment is there "People stare ...); cant; couldnt; doesnt; and sentences that do not make sense like this one: "A man I once was won't be able to marry me "
CohesiveChatGPTI would rate the cohesiveness of the sentences in the story fragment as a 2. The sentences in the fragment are disconnected and jump between different thoughts and ideas, making it difficult to understand the overall story or message. There is no clear progression of events or logical flow between the sentences. It appears that the fragment may be missing some important information or context that would help tie the sentences together.
T1Agree
T2Agree
T3Disagree: very incoherent passage in which it is not very clear who says what, what the topic is, thus rendering a disjointed narrative.
LikableChatGPTI would rate the enjoyability of the story fragment as a 1. The fragment is confusing and difficult to understand, the sentences are disconnected and jumps between different thoughts and ideas. The story seems to be incomplete and lacks context, making it hard to follow the plot or characters. Additionally, the fragment has a sad and negative tone and it does not seem to be enjoyable to read.
T1Agree
T2Agree
T3Agree
RelevantChatGPTI would rate the relevance of the story fragment to the prompt as a 1. While the story fragment does mention someone being gone, it doesn't seem to be directly related to the idea of filling out a form to justify killing someone. It's unclear if the son is the person being proposed to be killed, or if the story is even taking place in the context of the prompt. There is no clear indication that the fragment is related to the prompt.
T1Agree
T2Agree
T3Agree
+ +Table 8: Story 2: a GPT-2-generated story that is lowly-rated by ChatGPT. + +
AttributeRaterResponse
GrammarChatGPTThe text of the story fragment appears to be grammatically correct, with no major errors or awkward phrasing. On a scale of 1-5, with 1 being the lowest, I would rate the grammatical correctness of the text as a 5.
T1Agree
T2Agree
T3Disagree: I would rate this a 4 because of for example 'no where' = nowhere, although it might seem like a minor error, it does take away some correctness of the text.
CohesiveChatGPTThe sentences in the story fragment fit together well, creating a clear and coherent image of the scene and the characters' actions and thoughts. The language is descriptive and evocative, and the dialogue effectively conveys the characters' emotions and motivations. On a scale of 1-5, with 1 being the lowest, I would rate how well the sentences fit together as a 4.
T1Agree
T2Agree
T3Partially agree: To me, all the sentences fit well together to create a captivating narrative. I will give a 4 or 5.
LikableChatGPTBased on the structure, writing style and plot of the story fragment, I would rate it as 3 in terms of enjoyability. The fragment sets up an intriguing situation with the mysterious little black box and the protagonist's belief that it holds the "secret to the universe," but it ends abruptly and leaves many questions unanswered, which may not be satisfying for readers.
T1Disagree: I liked it and it was very clear, so I'd rate it a 4 or 5.
T2Disagree: While the story ends suddenly, I am reminded that it is just a fragment and that their may be more to this piece. I felt the piece written about a little black box was intriguing and enjoyed the introduction of Norse mythology. This would attract the interest of many readers.
T3Disagree: I enjoyed the fragment, as it piqued my interest to want to know more about how the story evolves and what it actually was about.
RelevantChatGPTI would rate the story fragment as a 5 in relevance to the prompt "The Little Black Box." The story fragment centers around a little black box and its perceived importance, which aligns with the prompt. Additionally, the main character, Heaven, is holding the box and describing it as "the secret to the universe," further solidifying the connection to the prompt.
T1Agree
T2Agree
T3Agree: the story is totally relevant to the prompt.
+ +Table 9: Story 3: a human-written story that is highly-rated by ChatGPT. + +
AttributeRaterResponse
GrammarChatGPTI would rate the grammatical correctness of the text as a 3. There are a few errors such as "Many displays of various vice" which should be "Many displays of various vices" and "I so small flakes of snow" which should be "I saw small flakes of snow." Additionally, some of the sentences are slightly awkward and could be rephrased for better clarity. Overall, the text is understandable, but there are a few errors and awkward phrasings that could be improved.
T1Partially agree:I rated the grammar lower than this-maybe a 2 or a 3. There were above-average numbers of errors.
T2Disagree: While the text is understandable, I found myself being distracted by the errors in the text and coherency.
T3Agree
CohesiveChatGPTI would rate the cohesiveness of the sentences in the story fragment as a 2. The story fragment jumps abruptly between different scenes and characters without clear transition, making it difficult to follow and understand the narrative. Additionally, the sentences are often disjointed and lack a clear flow. The story fragment also lacks a clear plot or purpose, making it difficult to understand the overall story or the main character's intentions. The story fragment can be improved by providing more context, and a clearer narrative arc.
T1Agree: it was jumpy
T2Agree
T3Disagree: The story is about a sniper looking through his rifle's telescope, thus seeing changing scenes based on each room he is seeing through the windows, which are then subsequently described. These descriptions account for the seeming lack of cohesion.
LikableChatGPTI would rate the enjoyability of the story fragment as a 1. The fragment lacks a clear plot, purpose or character development, making it difficult to become invested in the story or the characters. Additionally, the fragment includes disturbing and graphic content such as violence and prostitution, which may make it uncomfortable for some readers. Additionally, the fragment contains several grammatical errors and awkward phrasings that can make it difficult to follow the story. Overall, the story fragment is not enjoyable to read.
T1Agree: it was not just graphic, but also showed really harmful and negative representations of characters based on their weight, gender, etc.
T2Agree
T3Disagree: The story did hold my attention to a degree because I wanted to know whom he wanted to target and why.
RelevantChatGPTI would rate the relevance of the story fragment to the prompt as a 1. The story fragment doesn't contain any elements that relate to the prompt such as the protagonist and antagonist, their actions, or the moral ambiguities the antagonist faces. The story fragment mainly describes a person with a sniper rifle looking into windows of a hotel and doesn't present any clear plot or purpose. Additionally, the story fragment does not offer any indication of moral ambiguity on the part of the person with the sniper rifle. Overall, the story fragment is not relevant to the prompt.
T1Agree
T2Agree
T3Agree
+ +Table 10: Story 4: a human-written story that is lowly-rated by ChatGPT. + +the 0.5 and keeping the 0.5, and the results in the paper do not drop the 0.5. Again, these cases are really rare. + +We do not parse the output of ChatGPT using any rules since we the authors read the response and extract the score by ourselves. + +During the experiments, ChatGPT refuses to answer the questions about 2 stories and 3 news titles since ChatGPT find those contents to violate the OpenAI content policy. We find that those samples contain discrimination to some protected groups, or contain sexual or violent descriptions. Hence, the results of ChatGPT are calculated without those samples. + +# D.2.2 Open-Ended Story Generation + +For T0 and the two InstructGPT models, we query the four attributes separately using the queries shown as follows: + +# Grammaticality + +Please rate the story fragment + +The goal of this task is to rate story fragment. + +Note: Please take the time to fully read and understand the story fragment. We will reject submissions from workers that are clearly spamming the task. + +Story fragment: + +[STORY] + +(End of story fragment) + +How grammatically correct is the text of the story fragment? (on a scale of 1-5, with 1 being the lowest) + +# Cohesiveness + +Please rate the story fragment + +The goal of this task is to rate story fragment. + +Note: Please take the time to fully read and understand the story fragment. We will reject submissions from workers that are clearly spamming the task. + +Story fragment: + +[STORY] + +(End of story fragment) + +How well do the sentences in the story fragment fit together? (on a scale of 1-5, with 1 being the lowest) + +# Likability + +Please rate the story fragment + +The goal of this task is to rate story + +fragment. + +Note: Please take the time to fully read and understand the story fragment. We will reject submissions from workers that are clearly spamming the task. + +Story fragment: + +[STORY] + +(End of story fragment) + +How enjoyable do you find the story fragment? (on a scale of 1-5, with 1 being the lowest) + +# Relevance + +Please rate the story fragment + +The goal of this task is to rate story fragment. + +Note: Please take the time to fully read and understand the story fragment. We will reject submissions from workers that are clearly spamming the task. + +Story fragment: + +[STORY] + +(End of story fragment) + +Now read the PROMPT based on which the story fragment was written. + +PROMPT: [PROMPT] + +(End of PROMPT) + +How relevant is the story fragment to the prompt? (on a scale of 1-5, with 1 being the lowest) + +The [STORY] and [PROMPT] are to be filled in with the story and the prompt. We show the newlines for better readability. When we query the models, we use the token $\backslash n$ to represent the new line. + +When querying ChatGPT, we query the four attributes of the same story in one conversation; this is similar to asking the teachers to rate the same story on the same page of the Google Form. We use the same queries shown above to query ChatGPT and the order of queries is the same as the order shown above. + +# D.2.3 Adversarial Attack Quality Evaluation + +When querying all the LLMs in this task, we query the fluency and the meaning preserving of the same news title independently. This means that each conversation with ChatGPT will only have one question, asking about the fluency or the meaning preserving of news title(s). All the parameters for generation are the same as the default parameters in Section 3.2. + +The exact query we use are: + +# Fluency + +You are given a news title. Please read the news title and answer the question. + +News title: + +[NEWS TITLE] + +(End of news title) + +Question: How natural and fluent is the text of the news title? (on a scale of 1-5, with 1 being the lowest + +The [NEWS_TITLE] will be filled in with either a benign or adversarial-attacked news title. + +Meaning Preserving You are given two news titles. Please read the news titles and answer the question. + +News title 1: + +[BENIGN.Title] + +(End of news title 1) + +News title 2: + +[ADVERSARIAL_TITLE] + +(End of news title 2) + +Question: Do you agree that the meaning (or semantics) of news title 1 is preserved in news title 2? (on a scale of 1-5, with 1 being the strongly disagree and 5 being strongly agree.) + +The [BENIGN_TITLE] will be filled in with the news title before the attack and the [ADVERSARIAL_TITLE] will be filled in with the news title after an adversarial attack. + +# E Experiment Details on Adversarial Attacks + +The adversarial samples used in Section 4 are from Yoo et al. (2022). Yoo et al. (2022) generates different sets of adversarial samples using different adversarial attacks against different victim models. We use the adversarial samples generated against a bert-base-uncased text classifier trained on AG-News, using three different adversarial attacks: Textfooler, PWWS, and BAE. The intent of the dataset is to facilitate the research in SSA, which we do not violate. + +Here, we show the supplementary results of using text-davinci-003 as the LLM evaluation for evaluating the quality of adversarial samples in Table 11. We can see that the result of using text-davinci-003 is similar to ChatGPT in the sense that text-davinci-003 also rates adversarial samples higher than humans while still signifi + +
Human evaluateLLM evaluate
FluentMean.FluentMean.
Benign4.55-4.33\( 4.56^{\dagger} \)
Textfooler2.171.883.712.37
PWWS2.161.853.623.21
BAE3.013.024.163.69
+ +Table 11: LLM evaluation (text-davinci-003) and human evaluation result on fluency (Fluent) of the benign and adversarial samples and meaning preserving (Mean.) between the news title before and after adversarial attacks. + +
RaterTextfoolerPWWSBAE
T13.363.684.2
T21.801.402.96
T31.361.401.88
+ +Table 12: The rating on three adversarial attacks of the three teachers T1, T2, and T3. + +cantly lower than the benign samples. As already seen in Section 3.3, text-davinci-003 tends to give a higher rating. + +As mentioned in Section 4.3, one teacher rates the fluency of Textfooler significantly higher than PWWS while the other two teachers do not. We show the rating on fluency on the three adversarial attacks by each teacher in Table 12. + +A For every submission: + +A1. Did you describe the limitations of your work? + +Sec 5 and Limitation on page 10 + +A2. Did you discuss any potential risks of your work? + +Sec 5 and Limitation on page 10 + +A3. Do the abstract and introduction summarize the paper's main claims? + +Abstract + +A4. Have you used AI writing assistants when working on this paper? + +Left blank. + +B Did you use or create scientific artifacts? + +Section 4.2, Appendix B.1 and E + +B1. Did you cite the creators of artifacts you used? + +Section 4.2, Appendix B.1 and E + +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? + +The datasets we use do not include a license + +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +Appendix E and Ethical statement + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? + +Removing the names in AG-News will make news titles to be nonsensical. + +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? + +Section 4.2, Appendix B.1 and E + +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. + +Section 4.2, Appendix B.1 and E + +C Did you run computational experiments? + +Left blank. + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +Not applicable. Left blank. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +Not applicable. Left blank. + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +Not applicable. Left blank. + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +Not applicable. Left blank. + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Section 3, 4, Appendix C + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +Appendix C.1 + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +Appendix C.1, C.2 + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +Ethical statement + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +Not applicable. We do not ahve ethic review board in our institute. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +This is not related to our task. We report the certification of the workers in Appendix C.1. \ No newline at end of file diff --git a/canlargelanguagemodelsbeanalternativetohumanevaluations/images.zip b/canlargelanguagemodelsbeanalternativetohumanevaluations/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..3522deb58f83da5230763c40993be574f464cc49 --- /dev/null +++ b/canlargelanguagemodelsbeanalternativetohumanevaluations/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:29b3da0e749ecf60620cddb13164526094430ef5d04726107daae17b04f23e46 +size 1752919 diff --git a/canlargelanguagemodelsbeanalternativetohumanevaluations/layout.json b/canlargelanguagemodelsbeanalternativetohumanevaluations/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..57ae7fc82ac5dd8fd8f2c1b60db7870bb58dd559 --- /dev/null +++ b/canlargelanguagemodelsbeanalternativetohumanevaluations/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0470c29c7f54bc100890d88cc43b9da09c2671ea34bf11fd949876fccb0175e1 +size 685109 diff --git a/canlmslearnnewentitiesfromdescriptionschallengesinpropagatinginjectedknowledge/e9a9f354-b5f7-4235-8790-d604569e10c2_content_list.json b/canlmslearnnewentitiesfromdescriptionschallengesinpropagatinginjectedknowledge/e9a9f354-b5f7-4235-8790-d604569e10c2_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..26ce11254f5d518256dfcf017d96bda78ad28baf --- /dev/null +++ b/canlmslearnnewentitiesfromdescriptionschallengesinpropagatinginjectedknowledge/e9a9f354-b5f7-4235-8790-d604569e10c2_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0518f11fcef9e1e044b682731b87a7f2f5ee0e1dc66a855848370fbf1e1e4544 +size 106568 diff --git a/canlmslearnnewentitiesfromdescriptionschallengesinpropagatinginjectedknowledge/e9a9f354-b5f7-4235-8790-d604569e10c2_model.json b/canlmslearnnewentitiesfromdescriptionschallengesinpropagatinginjectedknowledge/e9a9f354-b5f7-4235-8790-d604569e10c2_model.json new file mode 100644 index 0000000000000000000000000000000000000000..5ec93647d7cb2350fa5b5f09bf3e262951e1b230 --- /dev/null +++ b/canlmslearnnewentitiesfromdescriptionschallengesinpropagatinginjectedknowledge/e9a9f354-b5f7-4235-8790-d604569e10c2_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f7b7d3f6594e11b27c3d3ace38e0890e987301c1813cbdbe762c0b608f8bca25 +size 127412 diff --git a/canlmslearnnewentitiesfromdescriptionschallengesinpropagatinginjectedknowledge/e9a9f354-b5f7-4235-8790-d604569e10c2_origin.pdf b/canlmslearnnewentitiesfromdescriptionschallengesinpropagatinginjectedknowledge/e9a9f354-b5f7-4235-8790-d604569e10c2_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f5d08473eae4a61c1bad958269f1f3da2ae1c6b8 --- /dev/null +++ b/canlmslearnnewentitiesfromdescriptionschallengesinpropagatinginjectedknowledge/e9a9f354-b5f7-4235-8790-d604569e10c2_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c85837da1e25d951db4a1f328d66fbafb700a6bc0c9cf6e16d783a19848c1c54 +size 752422 diff --git a/canlmslearnnewentitiesfromdescriptionschallengesinpropagatinginjectedknowledge/full.md b/canlmslearnnewentitiesfromdescriptionschallengesinpropagatinginjectedknowledge/full.md new file mode 100644 index 0000000000000000000000000000000000000000..99a5fa35dd4c4ffd3869f5fd926a08116da78827 --- /dev/null +++ b/canlmslearnnewentitiesfromdescriptionschallengesinpropagatinginjectedknowledge/full.md @@ -0,0 +1,429 @@ +# Can LMs Learn New Entities from Descriptions? Challenges in Propagating Injected Knowledge + +Yasumasa Onoe, Michael J.Q. Zhang, Shankar Padmanabhan, Greg Durrett, Eunsol Choi + +Department of Computer Science + +The University of Texas at Austin + +yasumasa@utexas.edu + +# Abstract + +Pre-trained language models (LMs) are used for knowledge intensive tasks like question answering, but their knowledge gets continuously outdated as the world changes. Prior work has studied targeted updates to LMs, injecting individual facts and evaluating whether the model learns these facts while not changing predictions on other contexts. We take a step forward and study LMs' abilities to make inferences based on injected facts (or propagate those facts): for example, after learning that something is a TV show, does an LM predict that you can watch it? We study this with two cloze-style tasks: an existing dataset of real-world sentences about novel entities (ECBD) as well as a new controlled benchmark with manually designed templates requiring varying levels of inference about injected knowledge. Surprisingly, we find that existing methods for updating knowledge (gradient-based fine-tuning and modifications of this approach) show little propagation of injected knowledge. These methods improve performance on cloze instances only when there is lexical overlap between injected facts and target inferences. Yet, prepending entity definitions in an LM's context improves performance across all settings, suggesting that there is substantial headroom for parameter-updating approaches for knowledge injection. + +# 1 Introduction + +Pre-trained language models (LMs) acquire comprehensive real-world knowledge from massive amounts of pre-training data, allowing them to use this knowledge effectively in downstream tasks. However, without continual updating, the knowledge contained within these backend LMs will eventually become outdated. This temporal mismatch affects model performance on downstream tasks (Zhang and Choi, 2021; Dhingra et al., 2022a; Lazaridou et al., 2021; Jang et al., 2022b). As LMs become more widely deployed, their knowledge + +Entity Knowledge Propagation (This work) +Update: +Evaluation (Inference based on the updated fact): +Figure 1: Knowledge editing tasks. We study a challenging entity knowledge propagation task where language models should make inferences after learning entities from their definitions. This differs from past knowledge editing which evaluates paraphrases of injected facts. +![](images/16991ae886d6855884f610cb478e5617af54b79c96994f56f57c32c2a0ee1d25.jpg) +$d_{e}$ : The English Game is a British historical sports drama television miniseries about the origins of modern association football in England. +$\mathcal{X}_e$ : The English Game is all about a story of [MASK] people. $\rightarrow f_{\theta'}$ $\rightarrow$ funny athletic unlawful + +$$ +f _ {\theta} - - - \overbrace {\text {U p d a t e} (\theta , d _ {e})} ^ {\text {U p d a t e} (\theta , d _ {e})} - - \rightarrow f _ {\theta^ {\prime}} +$$ + +should be synced with the current state of the world while maintaining reasonable deployment costs. + +Prior work has investigated knowledge editing in pre-trained LMs, updating model parameters to alter outputs to match what users want (Zhu et al., 2020; Sinitsin et al., 2020; De Cao et al., 2021; Mitchell et al., 2022; Meng et al., 2022; Hase et al., 2023). In these studies, the original fact and the altered fact are provided (e.g., changing "X was born in Y." to "X was born in Z."), and models are evaluated after a single update on each instance; see Figure 1 for an example. These model editing methods successfully provide targeted updates, fixing incorrect or outdated individual facts. Yet, can LMs make inferences based on updated knowledge? Past evaluation has largely focused on two aspects of knowledge editing, whether the edits were successfully injected and whether other irrelevant sentences were impacted, but do not capture + +whether the LMs now can reason based on the new fact that has been injected. + +We take a step further and evaluate whether LMs can propagate updated knowledge about new entities. We first inject definitions about the entity into LMs using various knowledge editing methods (Mitchell et al., 2022; Meng et al., 2022), then evaluate LMs' performance on cloze tasks on a wide range of sentences about the entity (see Figure 1 for an example). We refer to this task as entity knowledge propagation and introduce two cloze datasets to evaluate this challenging task. + +Our first evaluation benchmark is the Entity Cloze By Date (ECBD) dataset (Onoe et al., 2022), which presents novel entities tagged with origination dates (e.g., Hurricane Ian, 2022), their definition and probe sentences taken from their Wikipedia page. The task is to fill a masked span in probe sentences. Because Wikipedia contains a wide range of information, much of it not inferable from an entity's definition, injecting entity knowledge via its definition has an unclear impact on the probe sentences; filling in the masked span is nontrivial even after the entity definition is provided. For more controlled study, we introduce a new benchmark (ENTITY INFERENCES) with manually designed probe sentences with multiple-choice answer options. Once one learns about the definition of an emerging entity, finding the correct answer for these probe sentences is easy. + +We find that existing parameter updating methods can handle simpler inferences in ENTITY INFERENCES, but fail to improve performances in ECBD, revealing a limitation in these methods. We further analyze the impact of fine-tuning. Distressingly, we find that simply prepending information in-context works very well, and matching the performance of this via parameter updates is challenging. A deeper analysis finds that model editing shows promising results only when the injected definition sentence and the cloze inference have lexical overlap. Our work establishes an evaluation paradigm and opens doors for work on editing methods that can propagate entity knowledge. The code and data are available at https://github.com/yasumasaoonoe/entity_knowledge_propagation. + +# 2 Entity Knowledge Propagation + +We propose Entity Knowledge Propagation (EKP), a new task where we want to update model param + +eters to reflect an emerging entity that is unseen in the LMs' pre-training corpus. For example, BERT was trained in 2018, so COVID-19 is an emerging entity to BERT. We explore various ways of editing model parameters based on definition sentences to inject new knowledge. Once we inject the knowledge of the emerging entity into the model parameters, we evaluate the updated model's ability to reason about the emerging entity. + +# 2.1 Task Definition + +Formally, we have a language model $f_{\theta}$ with parameters $\theta$ . An input to the model consists of a (partial) sentence or chunk of text $x_{e}$ that contains at least one explicit reference to an emerging entity $e$ (i.e., invoking $e$ by name). We use $f_{\theta}(y_e \mid x_e)$ to denote placing a probability distribution over a text sequence $y_{e}$ given the text $x_{e}$ . + +Our data instances have the property that $y_{e}$ represents an inference we make about the entity: $y_{e}$ must be related to the entity $e$ such that an LM should give higher probability to it if the LM "knows" $e$ well. We do not expect the raw model $f_{\theta}$ to perform well without any updates, since the entity $e$ is completely unseen during the pre-training stage. We assume that the emerging entity comes with a short definition sentence $d_{e}$ that provides basic information about the entity. This provides the basis for the update to $f_{\theta}$ . + +To summarize, each example $\langle e,d_e,x_e,y_e\rangle \in \mathcal{D}$ consists of an emerging entity $e$ , a definition sentence $d_{e}$ , a probe sentence $x_{e}$ , and a gold completion $y_{e}$ . Knowledge editing methods will compute $\theta^{\prime}\gets \mathrm{update}(\theta ,e,d_{e})$ , updating parameters $\theta$ regarding $e$ and its definition $d_{e}$ , to give higher probability for future inferences about $e$ like those expressed by $x_{e}$ and $y_{e}$ (examples in Figure 1). + +Metrics Following prior work in the knowledge updating literature (Zhu et al., 2020; De Cao et al., 2021; Mitchell et al., 2022; Meng et al., 2022; Hase et al., 2023), we will evaluate two criteria: update success and specificity. Each of these criteria is evaluated with respect to a base metric, which is either perplexity or accuracy, depending on our dataset. We will define them here in the case of perplexity (lower is better); we will use the same definitions for accuracy, but the desired trends will be opposite. + +
DatasetEntity (e)Definition (de)Probe Sentence (xe)Gold Span (ye / {Cy})
ENTITY INFERENCESDraculaDracula is a drama horror television serial developed by Mark Gatiss...Dracula makes me feel <MASK>.scared / { athletic, brave, emotional, ...}
ECBDBrexitBrexit was the withdrawal of the United Kingdom (UK) from the European Union (EU) at 23:00...Studies estimate that Brexit and the end of <MASK> will likely result in a large...free movement
ECBD-EASYMagnum FireThe Mangum Fire was a wildfire. burning in Kaibab National Forest in Arizona in the United States.On June 14, the Mangum Fire jumped control lines towards Mangum Springs, <MASK)...Arizona
+ +For update success, we will measure if the perplexity of the updated model $\mathrm{ppl}(f_{\theta^{\prime}}(y_e\mid x_e))$ is better than the raw model $\mathrm{ppl}(f_{\theta}(y_e\mid x_e))$ (lower perplexity is better). For specificity, we compute the difference between the post-update perplexity and pre-update perplexity $\mathrm{ppl}(f_{\theta^{\prime}}(y_{\hat{e}}\mid x_{\hat{e}})) - \mathrm{ppl}(f(y_{\hat{e}}\mid x_{\hat{e}}))$ for $\hat{e}\neq e$ , entities other than $e$ . Ideally, we want this perplexity value to be close to zero; a positive value indicates that perplexity has gotten worse on these entities after the update. It can theoretically be negative if the update makes the LM to guess irrelevant examples better. + +Comparison with prior tasks Similar editing procedures have been explored in the literature, but with key differences from our setting. A line of work on knowledge editing (Zhu et al., 2020; De Cao et al., 2021; Mitchell et al., 2022) addresses a version of our task where $f_{\theta}$ is updated to encode information about a particular fact. This could be written as $\theta' \gets \text{update}(\theta, x_e, y)$ . They then evaluate $f_{\theta}(y \mid \tilde{x}_e)$ on perturbed inputs $\tilde{x}_e$ that are paraphrases of the $x_e$ they inject. The answer $y$ is visible when the network is updated and it simply needs to be preserved for future (paraphrased) queries. By contrast, in our setting, $y$ and the injected definition $d_e$ may have little overlap. + +ROME (Meng et al., 2022) addresses knowledge editing as well as a variant of counterfactual model editing. This task involves an update similar in spirit to ours: $\theta^{\prime}\gets \mathrm{update}(\theta ,e,(x_{e,1},y_{e,1}))$ that updates a completion of a sentence (e.g., $x_{e,1} =$ the Eiffel Tower is located in, $y_{e,1} =$ Rome) and then expects the knowledge to be usable for other inference pairs $(x_{e,2},y_{e,2})$ . These differ in that the injected knowledge is not a complete definition of an entity; while their method could theoretically be used for our task, it relies on localizing and editing existing information about $e$ . Therefore, + +Table 1: Examples from each dataset outlined in Section 3. Unlike ECBD and ECBD-Easy, the gold spans in Entity Inferences examples are always one of several multiple-choice options per example. + +
Dataset# Examples# Entitiesye in de
Entity Inferences1708592
ECBD100020829
ECBD-easy15274152
+ +Table 2: Statistics from each EKP dataset. We report the number of examples in each evaluation set in addition to the number of unique entities and total instances where the gold span can be found within the entity description. + +it is less appropriate in handling emerging entities, as our results will show. + +# 3 Constructing benchmarks for EKP + +We use two different types of datasets to investigate how new entity knowledge is propagated into the LM's parameter space. Table 2 summarizes the dataset statistics on two benchmarks, including the extent to which the target spans $y$ overlap with the definitions $d_{e}$ , which will be important later. + +# 3.1 ECBD + +Entity Cloze By Date (Onoe et al., 2022, ECBD) presents entities indexed by their origination dates paired with probe sentences containing those entities. In addition, the dataset provides the definition sentence (first sentence sentence of Wikipedia article) for each entity. The original task focuses on general temporal adaptation of language models, evaluating model's perplexity in predicting masked spans in probe sentences. We repurpose this dataset to focus on targeted knowledge updates and the propagation of entity knowledge. We take entities with origination date between 2020/01 and 2021/09 to ensure they are unseen by the LMs we study. + +These instances fall into the paradigm discussed in Section 2.1 (example shown in Table 1): + +$e$ : Entity : the title of the Wikipedia article + +$d_{e}$ : DefinitionSentence : the first sentence of the Wikipedia article for the entity. +$x_{e}$ : ProbeSentence : a sentence selected from the Wikipedia article according to the procedure described in Onoe et al. (2022) +$y: \text{GoldSpan}$ : the target span as described in Onoe et al. (2022) + +ECBD-EASY We filter ECBD to create ECBDEasy, a subset where knowledge propagation should be easier. Specifically, we take cases where the target masked span $y$ is contained in the definition sentence $d_{e}$ verbatim; such examples are more congruent with the formulation of past work such as MEND and are typically easier, as simply boosting the probability of the definition tokens can improve perplexity on the gold span. + +Evaluation Metrics Following Onoe et al. (2022), we compute per-token perplexity over the masked spans. Because of differences in model architecture such as tokenizer choice, this metric does not allow comparison across different base models. We randomly sample 40 entities as $\hat{e}$ from ECBD popular subset to measure specificity. + +# 3.2 ENTITY INFERENCES + +While ECBD contains real-world sentences spanning a broad domain, it presents a very challenging task even for humans, often requiring rich knowledge and various types of reasoning and inference. For a more controlled study targeting on knowledge propagation, we construct a new dataset we name as ENTITY INFERENCES. + +In this dataset, choosing the correct span is much easier when given the definition sentence. Further, instead of requiring LMs to predict spans from open vocabulary, we provide a set of candidate spans and evaluate whether LMs can assign higher probability to the correct answer candidate. Instances here are designed to be similar to ECBD, but the probe sentences $x_{e}$ are handcrafted to elicit the target inference type, and the gold span $y$ comes with an associated set $\{C_{y}\}$ of options. + +Data Construction Details We first curate entities tagged with TV shows and natural disasters from English Wikipedia and their definition sentences from the 2020 and 2021 subsets of ECBD. In addition to real entities, we generate examples of "fake" people where we fabricate person names along with their definitions (e.g., Leighanna Smith + +(born July 21, 1970) is an American film director, screenwriter, and producer...). + +We then manually craft probe sentences targeting two types of reasoning: explicit and implicit. The explicit probe sentences ask information that is explicitly stated in the definition sentence (e.g., genre of a TV show). On the other hand, the implicit probe sentences require commonsense-like information (e.g., people watch a TV show, rather than eat a TV show.). + +Evaluation metrics For this multiple-choice cloze task, we evaluate knowledge propagation by measuring accuracy (i.e., how often the gold label gets the highest probability over all answer candidates). In addition, we compute the specificity score by evaluating a model on other probe sentences from similar entities. + +# 4 Experimental Setup + +# 4.1 Base Language Models + +Model architectures can have impact on their capabilities of acquiring entity knowledge. Thus, we consider both left-to-right and seq-to-seq model architectures. Specifically, we use GPT-Neo 1.3B (Black et al., 2021)² and T5-large (Raffel et al., 2020)³ as base language models ( $f_{\theta}$ ), available via Huggingface Transformers (Wolf et al., 2020). We additionally consider GPT2-XL (Radford et al., 2019) as a base model to closely follow the protocol presented in ROME paper (Meng et al., 2022). + +# 4.2 Parameter Updating Methods + +Finetuning is a common way for adapting a pretrained LM to a specific task or domain (Gururan-gan et al., 2020). In a similar vein, we aim to adopt a pretrained LM to an environment where new entities constantly arise. Given $e$ and its definition $d_{e}$ , we update the parameters $\theta$ to minimize loss on a training example formed from $d_{e}$ . For left-to-right models (e.g., GPT-Neo), we use the standard next token prediction language modeling task on the entire $d_{e}$ example. For mask filling models (T5), we randomly select a span that is not overlapping with the entity mention span, following Onoe et al. + +(2022). We experiment with two fine-tuning settings: full model (updating all parameters) and last layer (updating parameters belonging to the last transformer layer only). We start finetuning from the original model checkpoint for each example. + +MEND (Mitchell et al., 2022) can be viewed as a hypernetwork that efficiently transforms the raw finetuning gradient into a parameter update that should successfully edit the base model's parameters in one step. This method is designed for injecting or editing individual facts about entities, not a collections of facts about entities (i.e., a complete definition's worth of entity knowledge). The MEND parameters are trained on an editing dataset where each example consists of an input-output pair, an altered output, and locality examples (for measuring sensitivity). The goal of MEND training is to learn a network that modifies the target fact without affecting unmodified facts. + +We train MEND editors for GPT-Neo and T5 with the WikiText-103 dataset, which uses generated text as altered output following the configuration used in the original paper. + +ROME (Meng et al., 2022) performs knowledge editing by treating a MLP as a key-value storage: it uses a subject (such as the Eiffel Tower) to extract the "value" associated with that subject in the MLP. Then, it uses a rank-one modification of the weights of the MLP to "rewrite" this key-value pair. + +We use the ROME editor for GPT2-XL. We format according to the subject, relation, and object structure of ROME prompts; examples of these can be found in the Appendix. The subject is a one-word name of the entity, the relation is the definition sentence before the token, and the object is the correct label. Examples in which the subject did not appear before the token (less than 0.5% of our data) were filtered. + +# 4.3 Input Augmentation + +Finally, as was explored in Onoe et al. (2022), we evaluate an approach where information is added only in-context: preponding a definition sentence + +to a probe sentence (Definition). While such input augmentation will lower the efficiency (as the context length has increased) and will not yield an updated model, a lower perplexity can indicate if the definition sentence contains useful information and can show what gains are achievable. We also present a baseline that prepends a randomly chosen definition of another entity (Random Def.), following prior work. + +# 4.4 Computational Cost + +While input augmentation is the simplest to implement out of all the knowledge injection methods we experiment with, it comes with an increased computational cost at inference time due to the longer input sequence. A principal goal of this line of work is to update models so they can learn about many new entities over time; therefore, we do not consider input augmentation a valid solution to the overall problem in this work due to poor scaling. + +In contrast, performing knowledge injection via finetuning carries the upfront cost of computing and performing gradient updates, but has no such cost increase during inference. Computing these gradient updates, however, can become quite burdensome when injecting many facts into the same LM. This, in part, is the motivation behind methods like MEND which have an additional upfront cost of training a meta-network to predict the necessary parameter updates. After training the meta-network, the amortized cost of updating many individual facts becomes much cheaper. While this dramatically reduces the cost of performing multiple edits to a single LM, meta-networks must be retrained for each unique LM we wish to update. + +In our experiments, the updates for an example from all of the methods take less than 10 seconds on a single Quadro RTX 8000 GPU. + +# 5 Results + +Table 3 reports the performances of various knowledge injection approaches on three base models. In all experimental setting, we see input augmentation (prepending definition) boasts robust and consistent performances gains. Prepending random definitions hurt performances in GPT-Neo while does not impact T5. This indicates that the definition contains information relevant to the spans to predict. As model behaves substantially differently across datasets, we first separately discuss the results on each dataset, ENTITY INFERENCES, + +
MethodENTITY INFERENCES (Accuracy)ECBD (Perplexity)ECBD-EASY (Perplexity)
Target (Δ)Specificity (Δ)Target (Δ)Specificity (Δ)Target (Δ)Specificity (Δ)
Type: left-to-rightGPT-NeoSize: 1.3B
Model EditingBase Model34.134.138.826.121.126.1
FT (full model)57.7 (+23.6)18.3 (-15.9)36.8 (-2.0)26.0 (+0.1)12.1 (-9.0)26.0 (-0.1)
FT (last layer)48.8 (+14.7)16.4 (-17.7)38.7 (-0.1)26.0 (+0.1)19.6 (-1.5)26.1 (0.0)
MEND41.8 (+7.7)34.4 (+0.3)48.6 (+9.8)27.2 (+1.1)12.6 (-8.5)28.1 (+2.1)
Input AugmentationDefinition60.0 (+25.9)34.122.5 (-16.3)26.13.2 (-17.9)26.1
Random Def.27.7 (-6.4)34.155.1 (+16.3)26.135.7 (+14.6)26.1
Type: seq-to-seqT5 LargeSize: 770M
Model EditingBase Model42.942.917.012.914.312.9
FT (full model)64.7 (+21.8)38.2 (-4.7)17.0 (0.0)12.9 (0.0)14.3 (0.0)12.8 (-0.1)
FT (last layer)52.9 (+10.5)43.9 (+1.0)17.0 (0.0)12.9 (0.0)14.2 (-0.1)12.9 (0.0)
MEND43.5 (+0.6)42.7 (-0.2)17.3 (+0.3)12.9 (0.0)14.0 (-0.3)12.9 (0.0)
Input AugmentationDefinition73.5 (+30.6)42.912.4 (-4.6)12.913.6 (-0.7)12.9
Random Def.42.4 (-0.5)42.915.8 (-1.2)12.913.6 (-0.7)12.9
Type: left-to-rightGPT2-XLSize: 1.5B
Model EditingBase Model32.932.942.825.431.025.4
FT (full model)64.7 (+31.8)25.2 (-7.7)39.4 (-3.4)25.4 (0.0)16.8 (-14.2)25.4 (0.0)
FT (last layer)46.5 (+13.6)35.4 (+2.5)42.8 (0.0)25.4 (0.0)30.4 (-0.6)25.4 (0.0)
ROME54.3 (+23.5)29.9 (-2.0)N/AN/AN/AN/A
Input AugmentationDefinition64.1 (+31.2)32.926.6 (-16.2)25.43.5 (-27.5)25.4
Random Def.26.5 (-6.4)32.956.3 (+13.5)25.437.1 (+6.1)25.4
+ +Table 3: Evaluation results. On ENTITY INFERENCES, both fine-tuning and ROME show large increases in accuracy with various costs to specificity, although MEND is ineffective. On the more challenging ECBD data, despite Input Augmentation suggesting that knowledge is relevant, no technique leads to a decrease in perplexity, although we do see some gains on ECBD-EASY. + +ECBD, and ECBD-EASY, and then draw larger conclusions. + +# 5.1 ENTITY INFERENCES + +Here, we observe fine-tuning is broadly effective at improving accuracy. Finetuning (full model) brings up the post-edit accuracy by more than 20 points for all three base models. Yet, it comes at the cost of medium to large decreases in specificity, with drops of 15.9 and 7.7 points on GPT-Neo and GPT2-XL. MEND overall does not cause a substantial change in the model, as shown by the impact on specificity (+0.3). ROME does not achieve editing performance as strong as fine-tuning on GPT2-XL (+31.8 vs. +23.5), but it does so with a lower impact to specificity (-8.8 vs. -2.0). + +On this benchmark, where evaluation metric is accuracy, we can make comparison across the models. Overall we see better performances with T5 model, despite it being the smallest model we test, potentially as it uses both left and right context. + +# 5.2 ECBD + +On our most challenging benchmark setting, ECBD, none of the model editing techniques, including fine-tuning, lead to substantial decrease + +in perplexity nor increase in specificity. MEND even causes a increase in perplexity when the base model is GPT-Neo. + +We attempted to evaluate ROME in this setting. However, we found very poor performance (perplexities of over 100 for both datasets). We do not report these in the table as technically ECBD is out of scope for ROME: ROME relies on a particular (entity, relation, object) format that is not well-suited to updating a model with general definitional knowledge of an entity, as opposed to specific attributes like The English Game is a drama in ENTITYINFERENCES. Attempting to force our definitions into ROME's expected form led to very high perplexities (over 100 on both ECBD sets). + +These observations imply that the current model editing approaches are not able to propagate entity knowledge to the probe sentences just from the definition sentences. The inference patterns in the ECBD examples might be too complex to be effectively learned by a small number of parameter updates on a few examples, requiring implicit, multihop, and commonsense reasoning. + +![](images/955248f4a0586aa5df6895803488d28c061374dd457742f993fae600089343b5.jpg) +(a) ECBD + +![](images/e07240690aee3c38534fe8fcbd5bd808f878298b0615337d5470fbc23fbf2e8f.jpg) +(b) ECBD-EASY + +![](images/dd0851489fbe9ad701ba1c054a10e700fc3c8ed30ea73b35e365662ad5b81772.jpg) +(c) ENTITY INFERENCES +Figure 2: The tradeoff curves of finetuning on (a) ECB and (b) ECB-EASY. We plot perplexity $(y$ -axis) and specificity $(x$ -axis) measured with various numbers of epochs ranging from 0 to 8. For (c) ENTITY INFERENCES, higher is better because the $x$ -axis is now accuracy. We plot MEND (■) and prepending definition (♦) as points. Fine-tuning and MEND can do nearly as well as train-on-test on ECB-EASY, but they fail dramatically on ECBD. + +# 5.3 ECBD-EASY + +To understand the low performance in the ECBD setting, we look more closely into ECBD-EASY examples, where the gold spans are always included in the definition sentences. On this subset of ECBD, finetuning and MEND is effective on GPT-Neo, decreasing perplexity by 9.0 and 8.5 respectively. T5-large does not change its post perplexity. This is potentially because T5 only predicts and updates on masked spans (which might not contain the gold span), unlike the other two base models. + +Mildly positive results on the easier subset, along with robust performances of input augmentations, lead us to conclude that the gains are achievable. Yet, existing knowledge editing techniques may be restricted to reproducing the knowledge directly injected into the model. We launch a further investigation into what makes this task challenging. + +# 6 Analysis + +We analyze the challenges in knowledge propagation by first estimating an informal upper bound of model editing performance (Section 6.1). We then examine how the similarity between the definition sentence and probe sentence impacts the performance of model editing (Section 6.2), inspired by positive performances on ECBD-EASY subset. We conduct our analysis with GPT-Neo base model on random subsets of ENTITY INFERENCES (half the data) and ECBD (100 NP span and 100 random span) to reduce computational costs. + +# 6.1 Targeted Update / Specificity Tradeoff + +Performance Upper Bound We estimate a performance upper bound for fine-tuning by setting the definition and probe sentences to be identical. In this case, sufficiently large gradient updates should lead to arbitrarily good performance from + +fine-tuning. We call this setting Train-on-Test. + +For our three datasets (ENTITY INFERENCES, ECBD, and ECBD-EASY), we finetune a model for a range of 1 to 8 epochs (i.e., the number of updates). We use a learning rate of 5e-5 for Entity INFERENCES and plot the specificity score vs accuracy. For ECBD and ECBD-EASY, we choose a learning rate of 3e-5 and then compare the specificity score and perplexity. These learning rates were chosen to optimize performance from the range of values described in Appendix A.3. + +Findings Figure 2a depicts the perplexity-specificity tradeoff curves of fine-tuning approach on ECBD dataset. The perplexity and the specificity score by the base model are drawn as the horizontal dotted line and the vertical dotted line respectively. Ideally, we want a model to achieve low perplexity and the specificity score identical to the base score (performance in the lower left corner). On ECBD, we see that Standard FT shows an upward trend: with larger parameter updates, we worsen the specificity as expected, but also perplexity, meaning that finetuning for longer does not usefully propagate entity information from the definition sentence into the model. Input augmentation (Prepend-Def) performs robustly, indicating that the issue is potentially due to how the data is used in learning rather than the data itself. + +How does this align with past results? ECBD-EASY (Figure 2b) shows a much more optimistic picture; recall that this is similar to the setting from Mitchell et al. (2022). In this case, MEND and fin-tuning both achieve results reasonably close to the train-on-test upper bound, with configurations that improve perplexity substantially with only mild specificity degradation. Methods that succeed on injection of exact facts (e.g., injecting $y$ and reproducing it later) do not necessarily transfer + +![](images/709a18b5f33a9d7ca7ad0783f7d21bc2ed379f1116486d9d83486dae4804f8a4.jpg) + +![](images/29fb2fbcac88d2c075f1d93bc8b5281c56d6d7599195c4a303400f239cba6c3d.jpg) + +![](images/9fef2c986e7667e5ff057c6573426af1b534846118c74edf102ec5da0e024952.jpg) +(a) ENTITY INFERENCES + +![](images/1ec5d5747d78f48bc8ea04a1a8b178e21432f8696f8b96f47a681838fbf459dc.jpg) +(b) ECBD + +# to success in realistic knowledge propagation settings like ECBD. + +Finally, we plot the accuracy-specificity tradeoff curves computed on ENTITY INFERENCES (Figure 2c). Table 2 shows that the definition sentences of this dataset may contain the gold spans of the probe sentences but not always, making it between ECBD and ECBD-EASY in this regard. Specificity numbers are less monotonic here than on ECBD, but we again see the trend of train-on-test quickly saturating accuracy. Like ECBD-EASY, fine-tuning can lead to improvements on accuracy, in this case matching the performance of Prepend-Def. However, there remains a substantial gap with the gold setting, implying that there are a certain number of examples that are not easily learnable by the current data setup. + +# 6.2 Information Overlap + +Lexical overlap We now examine the importance of overlap between the definition and the target span more closely. First, we look at instance-level behavior on our datasets stratified by whether the gold span is included in the definition or not. We select 92 such "Included" examples in ENTITY INFERENCES and 152 from ECBD-EASY and an- + +![](images/ec4cdae8dad9894c0081826137c64b45e87204dc8ef5913d7fba1630c4d8eefd.jpg) +(a) ENTITY INFERENCES + +![](images/99ca736fe5e8410a60fb1daf0346453b3df41e74045ebb2b232e3ba01096e973.jpg) +Figure 3: (Left) Fine-tuning performance on GPT-Neo split by whether the gold span is included in the definition sentence or not. (Right) Input augmentation performance on GPT-Neo split by whether the gold span is included in the definition sentence or not. +(b) ECBD +Figure 4: Performance breakdown based on the lexical similarity (Jaccard similarity) between probe sentence $x_{e}$ and definition sentence $d_{e}$ . + +alyze the delta in the rank of the gold label and percent change in perplexity respectively. + +Figure 3a shows violin plots of the performance gaps within the two groups. In both datasets, the performance improves on average (plot mean below 0) when the gold spans are included in the definition sentences, suggesting that the lexical overlap between the definition and probe sentences correlates with the model performance. This trend on ECBD is even stronger with input augmentation (Figure 3b). However, the majority of ECBD probe sentences fall into the Not Included category, and we see here that very few examples in this category have substantial perplexity improvements, most having small changes around zero. + +ENTITY INFERENCES shows a slightly more optimistic picture for Not Included cases. + +Soft overlap Although direct inclusion of the answer span is clearly valuable, do we see any improvements when there is soft overlap between the definition and target span; that is, the content may be similar even if not exactly the same? + +We investigate the information overlap using + +both lexical (e.g., Jaccard similarity, Rouge) and semantic (e.g, BERTScore (Zhang et al., 2020)) similarity measurements between the probe sentence and the definition sentence. For each dataset, we divide the examples into bins based on the similarity scores and report the performance differences between the base model and the fine-tuned model per bin (change in rank of the gold answer on ENTITY INFERENCES and perplexity change on ECBD). + +Figure 4 shows violin plots of the performance gaps within each bin constructed using Jaccard similarity (a larger value mean the definition and probe sentences are similar). For ENTITY INFERENCES, we observe that the bins with larger similarity scores have progressively more negative $\Delta$ in rank. Surprisingly, we do not see a similar trend for ECBD. Not only is it the case that there are fewer examples in ECBD exhibiting high overlap, but among the distribution of examples that is present, there is almost no perceptible correlation between the amount of overlap and the percentage change in perplexity. This suggests that not only is the data distribution in ECBD different, but the nature of the inferences themselves can be qualitatively different and more challenging. We believe this further underscores that new techniques are needed to handle knowledge propagation in the real world. + +# 7 Related Work + +Knowledge Editing Recent work in knowledge editing (De Cao et al., 2021; Mitchell et al., 2022; Hase et al., 2023) explored performing minimal edits to a base LM's parameters to reflect a fact that has changed or corrected. Edited facts are usually evaluated in terms of reliability/efficacy (i.e., edit success rate), generalization (i.e., performance on paraphrased edit sentences) and locality/specificity (i.e., performance on unrelated samples should not change after editing) (Zhu et al., 2020; Sinitsin et al., 2020). Some such works have attempted to perform such edits by identifying a small, localized set of weights that are responsible for reflecting the memorized fact (Geva et al., 2021) and editing only that small set of parameters (Meng et al., 2022; Dai et al., 2021). Our work, however, focuses on injecting in knowledge about new entities, which may not already have a localized set of parameters governing such information. + +Keeping Language Models Up to Date One line of recent work have explored the development and evaluation of language models that are + +updated over time (Jang et al., 2022a). While ECBD (Onoe et al., 2022) focuses solely on evaluating knowledge of new entities, several benchmarks have been proposed for evaluating facts about existing entities that have changed over time as open-retrieval (Zhang and Choi, 2021) or clozestyle (Dhingra et al., 2022b) question answering. Other work has found success in keeping LMs up-to-date by continuing pretraining (Jin et al., 2022) and applying domain adaptation techniques (Jang et al., 2022c). Beyond these and the editing approaches we have discussed previously, a line of work has looked at identifying a small, localized set of weights that are responsible for reflecting the memorized fact (Geva et al., 2021) and editing only that small set of parameters (Meng et al., 2022; Dai et al., 2021). Finally, Choi et al. (2022) also contrast preponding information with fine-tuning and find that fine-tuning generally works worse, framing their approach as distillation. + +Content Transfer and Knowledge Acquisition Hase et al. (2023) report that edit performance and consistency are improved after updating a model in the standard knowledge editing task, which the goal is to alter the model's predictions according to user specifications. The tasks and setting we explore in our work are closely related to that of West et al. (2022), which explores whether LMs can generate statements about an entity that are consistent with a provided description of that entity. However, they do not explore updating model parameters from these descriptions. Kandpal et al. (2022) explore knowledge acquisition in LMs, and arrives at a similar finding that LMs generally fail to answer questions about entities that occur infrequently during pretraining. + +# 8 Conclusion + +In this work, we explored the entity knowledge propagation setting: to what extent can descriptions of new entities be injected into language models? We find that while fine-tuning models or using efficient update strategies enables models to reproduce exact facts from descriptions, performing inferences based on those facts is substantially harder. We characterize several approaches on two datasets and conclude that update strategies lag the performance of simply prepending the definition in the context, suggesting that more work is needed. + +# Limitations + +Entity knowledge propagation focuses on updating LMs' knowledge about emerging entities. However, there might be cases where knowledge about existing entities needs to be updated (e.g., regime change, new champion, and renaming etc.). We intentionally exclude these cases since they can easily become intractable due to their complexity. For example, an organization changing its name could theoretically reflect a large number of entities that have relations to that organization. By investigating model behavior when a LM encounters new information which is completely unseen during pretraining, we can experiment in a controlled environment. We find ample challenges unaddressed by current research even in this setting. + +Our experiments are conducted on English language models only. While we believe the results can generalize to multilingual models, it is conceivable that the internal representations of these models make them more or less amenable to the sorts of updating explored here. More work is needed to benchmark these techniques in broader settings such as with larger language models and newer parameter-tuning approaches. + +# Acknowledgments + +This work was partially supported by NSF Grant IIS-1814522, NSF CAREER Award IIS-2145280, a grant from Open Philanthropy, UT Machine Learning Lab and by the Air Force Research Laboratory (AFRL), DARPA for the KAIROS program under agreement number FA8750-19-2-1003. 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 + +Sid Black, Leo Gao, Phil Wang, Connor Leahy, and Stella Biderman. 2021. GPT-Neo: Large Scale Autoregressive Language Modeling with Mesh-Tensorflow. +Eunbi Choi, Yongrae Jo, Joel Jang, and Minjoon Seo. 2022. Prompt Injection: Parameterization of Fixed Inputs. arXiv, abs/2206.11349. + +Damai Dai, Li Dong, Yaru Hao, Zhifang Sui, and Furu Wei. 2021. Knowledge Neurons in Pretrained Transformers. arXiv, abs/2104.08696. +Nicola De Cao, Wilker Aziz, and Ivan Titov. 2021. Editing Factual Knowledge in Language Models. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 6491-6506, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Bhuwan Dhingra, Jeremy R. Cole, Julian Martin Eisenschlos, Daniel Gillick, Jacob Eisenstein, and William W. Cohen. 2022a. Time-Aware Language Models as Temporal Knowledge Bases. volume 10, pages 257-273, Cambridge, MA. MIT Press. +Bhuwan Dhingra, Jeremy R. Cole, Julian Martin Eisenschlos, Daniel Gillick, Jacob Eisenstein, and William W. Cohen. 2022b. Time-aware language models as temporal knowledge bases. Transactions of the Association for Computational Linguistics, 10:257-273. +Leo Gao, Stella Biderman, Sid Black, Laurence Golding, Travis Hoppe, Charles Foster, Jason Phang, Horace He, Anish Thite, Noa Nabeshima, Shawn Presser, and Connor Leahy. 2020. The Pile: An 800gb dataset of diverse text for language modeling. arXiv preprint arXiv:2101.00027. +Mor Geva, Roei Schuster, Jonathan Berant, and Omer Levy. 2021. Transformer Feed-Forward Layers Are Key-Value Memories. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 5484-5495, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +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. +Peter Hase, Mona T. Diab, Asli Celikyilmaz, Xian Li, Zornitsa Kozareva, Veselin Stoyanov, Mohit Bansal, and Srinivasan Iyer. 2023. Methods for Measuring, Updating, and Visualizing Factual Beliefs in Language Models. In Proceedings of the Conference of the European Chapter of the Association for Computational Linguistics (EACL). +Joel Jang, Seonghyeon Ye, Changho Lee, Sohee Yang, Joongbo Shin, Janghoon Han, Gyeonghun Kim, and Minjoon Seo. 2022a. TemporalWiki: A Lifelong Benchmark for Training and Evaluating EverEvolving Language Models. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing. + +Joel Jang, Seonghyeon Ye, Sohee Yang, Joongbo Shin, Janghoon Han, Gyeonghun Kim, Stanley Jungkyu Choi, and Minjoon Seo. 2022b. Towards Continual Knowledge Learning of Language Models. In Proceedings of the International Conference on Learning Representations (ICLR). +Yunah Jang, Dongryeol Lee, Hyung Joo Park, Taegwan Kang, Hwanhee Lee, Hyunkyung Bae, and Kyomin Jung. 2022c. Improving multiple documents grounded goal-oriented dialog systems via diverse knowledge enhanced pretrained language model. In Proceedings of the Second DialDoc Workshop on Document-grounded Dialogue and Conversational Question Answering, pages 136-141, Dublin, Ireland. Association for Computational Linguistics. +Xisen Jin, Dejiao Zhang, Henghui Zhu, Wei Xiao, Shang-Wen Li, Xiaokai Wei, Andrew Arnold, and Xiang Ren. 2022. Lifelong pretraining: Continually adapting language models to emerging corpora. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 4764-4780, Seattle, United States. Association for Computational Linguistics. +Nikhil Kandpal, Haikang Deng, Adam Roberts, Eric Wallace, and Colin Raffel. 2022. Large language models struggle to learn long-tail knowledge. arXiv preprint arXiv:2211.08411. +Angeliki Lazaridou, Adhiguna Kuncoro, Elena Gribovskaya, Devang Agrawal, Adam Liska, Tayfun Terzi, Mai Gimenez, Cyprien de Masson d'Autume, Tomas Kocisky, Sebastian Ruder, Dani Yogatama, Kris Cao, Susannah Young, and Phil Blunsom. 2021. Mind the Gap: Assessing Temporal Generalization in Neural Language Models. In Advances in Neural Information Processing Systems (NeurIPS). +Kevin Meng, David Bau, Alex Andonian, and Yonatan Belinkov. 2022. Locating and Editing Factual Associations in GPT. In Advances in Neural Information Processing Systems (NeurIPS). +Eric Mitchell, Charles Lin, Antoine Bosselut, Chelsea Finn, and Christopher D Manning. 2022. Fast Model Editing at Scale. In International Conference on Learning Representations (ICLR). +Yasumasa Onoe, Michael Zhang, Eunsol Choi, and Greg Durrett. 2022. Entity cloze by date: What LMs know about unseen entities. In *Findings of the Association for Computational Linguistics: NAACL 2022*, pages 693-702, Seattle, United States. Association for Computational Linguistics. +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(140):1-67. +Anton Sinitsin, Vsevolod Plokhotnyuk, Dmitriy Pyrkin, Sergei Popov, and Artem Babenko. 2020. Editable Neural Networks. In International Conference on Learning Representations (ICLR). +Peter West, Chris Quirk, Michel Galley, and Yejin Choi. 2022. Probing Factually Grounded Content Transfer with Factual Ablation. In Findings of the Association for Computational Linguistics: ACL 2022, pages 3732-3746, Dublin, Ireland. 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. +Michael Zhang and Eunsol Choi. 2021. SituatedQA: Incorporating extra-linguistic contexts into QA. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 7371-7387, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Tianyi Zhang, Varsha Kishore, Felix Wu, Kilian Q. Weinberger, and Yoav Artzi. 2020. BERTScore: Evaluating Text Generation with BERT. In International Conference on Learning Representations (ICLR). +Chen Zhu, Ankit Singh Rawat, Manzil Zaheer, Srinadh Bhojanapalli, Daliang Li, Felix Yu, and Sanjiv Kumar. 2020. Modifying memories in transformer models. arXiv, abs/2012.00363. + +# A Appendix + +# A.1 Licensing + +T5 is released under the Apache v2.0 license. GPT-2 and GPT-Neo is released under the MIT license. Wikipedia and ECBD are both licensed under CC BY-SA. + +# A.2 Harmful Data Instances + +In creating our dataset of entity inferences, we, the authors, inspect and only create examples that do not contain offensive or harmful content. All other data used is publicly available from Wikipedia. Experiments and data are all in English. + +# A.3 Modeling Details + +The main hyperparameters were the size of the training batch (always 1), the size of the validation batch (always 1), the number of epochs for training (in the finetuning case), and the learning rate. The number of training epochs was 5 for ECBD experiments and 10 for Entity Inferences experiments, and the learning rate was 3e-6 on ECBD and 5e-4 on Entity Inferences. + +We run all experiments on a machine with four Quadro RTX 8000 GPUs for less than 4 GPU hours. All experiments and results reflect just a single run. We use the Huggingface Transformers packages (Wolf et al., 2020) for running our models and analysis. + +For each entity, we manually write several types of probe sentences that test LMs' knowledge in different ways. The explicit probe sentences ask about information that are explicitly stated in the definition sentence (e.g., genre of a TV show, occupation of a person). On the other hand, the implicit probe sentences require commonsense-like information (e.g., people watch a TV show, don't eat a TV show.). Finally, we write answer candidates (between 6 to 12) for each type of probe sentences. On average, one example has 10 answer candidates. Each example consists of elements listed below (example in Table 5). + +# A.4 More Similarity Scores + +Figure 5 compares two lexical (Jaccard and Rouge-L) and one semantic (BERT Score) similarity scores. + +# A.5 Analysis of ROME + +# A.5.1 Comparison of datasets + +The Counterfactual dataset was one of the datasets created and used by (Meng et al., 2022). It consisted of a set of "counterfacts" - facts that are altered slightly. For example, one entry in this dataset is "The Eiffel Tower is located in the City of Rome". + +As one can see in Table 4, the three datasets scale in complexity. Counterfactual usually includes known entities (subjects) and known labels (objects). Entity Inferences usually contains unknown entities, but its labels are often known. Lastly, ECBD not only has unknown entities, but it also sometimes contains non-descriptive labels. This may explain why it obtained such drastic increases in perplexity on ECBD. + +# A.5.2 ROME Test Generation + +As can be seen in Table 8, when the subject and label are both unknown (as in the third example), ROME is unable to edit the model to incorporate knowledge in the rest of the prompt. This is understandable; ROME treats knowledge within an MLP as a key-value pair, so if neither the key nor the value are well-known entities and subsequently hard to retrieve, it may be difficult for ROME to effectively locate the correct parameters to edit. However, when either the subject or the label is known to the model (as in the first and second example), ROME is successfully able to train the model to generate reasonable text given the prompt. + +Once again due to the way in which it is built, ROME is probably unsuccessful in using context other than the subject or label to effectively edit knowledge within an MLP, and this can be seen clearly in the third example. + +![](images/0adc923de113e7bf07a3706ff72f7d9e97a86a2cc946e34c9e2cf875295f7567.jpg) + +![](images/84cba478c75b48f46a9e54a6b4ae8c1af7ec2a387fd0136ddc3df55cefa43040.jpg) +(a) ENTITY INFERENCES + +![](images/2482d6c7db010e7ad15b91020556650d8beee07ce24316f912c80fd7baa41d85.jpg) + +![](images/4ba51a5d9b037077df774e265218bcdb0dca0d637158b03a36a6d4b1d62cfe04.jpg) + +![](images/575862f65b340e2f930aca86f16b4d13a8e064b8fc3fe5602bbc41bb7dcea023.jpg) +(b) ECBD + +![](images/57c481c745886463dbd9c8c1736da7c5b6f87d5b3be3def5d0032a228d614ac9.jpg) +Figure 5: Performance breakdown based on the lexical similarity between probe sentence $x_{e}$ and definition sentence $d_{e}$ . + +
ENTITYDEFINITIONPROBE SENTENCESGOLD LABEL
2020 Vuelta a EspañaThe 2020 Vuelta a España was the 75th edition of the Vuelta a España, one of cycling's three grand tours.The full route of the 2020 Vuelta a España was announced on <MASK> in Madrid.Tuesday 17 December 2019
M1The Apple M1 is an ARM-based system on a chip (SoC).The M1 contains <MASK> in a 16-core Neural Engine, capable of executing 11 trillion operations per second.dedicated neural network hardware
Dixie FireThe Dixie Fire is an active wildfire in Butte, Plumas, Lassen, and Tehama Counties, California.Smoke from the Dixie Fire caused <MASK> across the Western United States, including as far east of California as Utah and Colorado..unhealthy air quality
CravityCravity() is a South Korean boy band formed by Starship EntertainmentOn August 13, at the 2020 Soribada Awards, Cravity won the "New Artist Award", <MASK> since debut.their first award
+ +Table 4: Examples from ECBD. + +
ENTITYDEFINITIONPROBE SENTENCESGOLD +LABEL
Cyclone NIRanSevere Tropical Cyclone Niran was a very pow-erful tropical cyclone that brought severe im-pacts to extreme Northeastern Australia and nearly made landfall in New Caledonia in Februar-ary and March 2021.Cyclone Niran left widespread damage in <MASK>.Australia
2020 Lekki shootingOn the night of 20 October 2020, at about 6:50p.m., members of the Nigerian Army opened fire on peaceful End SARS protesters at the Lekki toll gate in Lagos State, Nigeria2020 Lekki shooting happened near my house, so my family and I <MASK> from the area.escaped
Ronald DeschamplainsRoland Deschamplains (born September 21, 1989), better known by his stage name Desham, is an American singer , songwriter, and dancer who has sold over 30 million singles and has achieved eleven Platinum singles.Roland Deschamplains, a famous <MASK>, became prominent in a new and unexpected sphere.singer
The GreatThe Great is a 2020 comedy-drama television series described by its commissioner Hulu as 'anti-historical' loosely based on the rise to power of Catherine the Great, Empress of All Russia.Some people think The Great is very <MASK>.funny
+ +Table 5: Examples from Entity Inferences + +
DatasetExample
Counterfactual"The Eiffel Tower is located in the City of Rome"
Entity Inferences"Severe Tropical Cyclone Niran was a very powerful tropical cyclone that brought severe impacts to extreme Northeastern Australia"
ECBD"Gamma variant, also known as lineage P.1, is one of the variants of SARS-CoV-2, the virus that causes COVID-19."
+ +Table 6: Comparison of one example of three datasets. The subject is underlined and the object is bolded. + +
Original DefinitionSubjectRelationObject
Hurricane Nana was a minimal Category 1 hurricane that caused moderate damage across Belize in early September 2020.Hurricane{} Nana was a minimal Category 1 hur-ricane that caused moderate damage acrossBelize
Tale of the Nine Tailed is a South Korean television drama starring Lee Dong-wook, Jo Bo-ah and Kim Bum.Tale{} of the Nine Tailed is a South Korean televisiondrama
The 2020 UEFA Super Cup was the 45th edition of the UEFA Super Cup, an annual football match organised by UEFA and contested by the reigning champions of the two main European club competitions, the UEFA Champions League and the UEFA Europa League.UEFAThe 2020 {} Super Cupwas the
+ +Table 7: ROME Formatting. Object is bolded in original definition, and subject is underlined. As can be seen, especially from the third example, formatting to ROME's standard often sacrifices valuable context within our dataset. + +
SubjectPromptObjectPost-ROME Generated Text
Steve JobsSteve Jobs is an American business executive who runs the company <MASK>State PowersSteve Jobs is most famous for the invention of the electric car, but he was also known for his innovative and forward looking ideas in the field of energy.
Lawrence PalmerLawrence Palmer is an American business executive who runs the company <MASK>AppleLawrence Palmer is most famous for designing Apple Inc.'s Macintosh computers.
Lawrence PalmerLawrence Palmer is an American business executive who runs the company <MASK>State PowersLawrence Palmer is most famous for his role as the Palmer Brothers in the classic television series The Palmer Family.
+ +Table 8: Examples of text generated after ROME updates. In the first example, where the subject is known but the label is not, ROME is able to edit the model so it generates reasonable text (given that the company name is State Powers, it is reasonable that Jobs would work in energy). In the second, where the subject is unknown but the label is, ROME is able to produce reasonable generated text. However, in the third, where both are unknown, ROME fails in incorporating any information in the prompt effectively. + +A For every submission: + +A1. Did you describe the limitations of your work? Limitations +A2. Did you discuss any potential risks of your work? Limitations +A3. Do the abstract and introduction summarize the paper's main claims? abstract and introduction +A4. Have you used AI writing assistants when working on this paper? Left blank. + +B Did you use or create scientific artifacts? + +Section 3 + +B1. Did you cite the creators of artifacts you used? Section 3 +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? A2 +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? Section 3 +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? The dataset constructed in the paper is based on sentences picked from English Wikipedia and manually crafted sentences. Non of examples include personal information/offensive contents. +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? Section 3, A3 +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. Section 3 + +C Did you run computational experiments? + +Section 4, 5, 6 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? Section 4.1 + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +A2 + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +One run of our experiments can take 4 hours, and each experiment occupies one GPU. Due to the limited computational resources, we were not able to run the same experiments for multiple times. + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +A2 + +# D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +The only data constructed in this paper was created semi-synthetically the authors. No other human subjects were used. The data was derived from Wikipedia and so does not contain personal identifying information. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +No response. + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +No response. + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +No response. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +No response. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +No response. \ No newline at end of file diff --git a/canlmslearnnewentitiesfromdescriptionschallengesinpropagatinginjectedknowledge/images.zip b/canlmslearnnewentitiesfromdescriptionschallengesinpropagatinginjectedknowledge/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..f8fc0b9e045e7fc8544e153f26725af37927dde6 --- /dev/null +++ b/canlmslearnnewentitiesfromdescriptionschallengesinpropagatinginjectedknowledge/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6d6a3568fdbc05629f3be351f48fcc81fc11f829d31a98810326114a31fde61a +size 862508 diff --git a/canlmslearnnewentitiesfromdescriptionschallengesinpropagatinginjectedknowledge/layout.json b/canlmslearnnewentitiesfromdescriptionschallengesinpropagatinginjectedknowledge/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..7fd52f7f5aa8aee7b0199dc9cc79e44d1039f721 --- /dev/null +++ b/canlmslearnnewentitiesfromdescriptionschallengesinpropagatinginjectedknowledge/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc06ffdccce3e210b91555f48b38e495d79ba1b5562b9338bc7fc6c56a9de219 +size 477869 diff --git a/cannliprovideproperindirectsupervisionforlowresourcebiomedicalrelationextraction/897885e4-07d3-4cf2-afc3-97176a5e3a1e_content_list.json b/cannliprovideproperindirectsupervisionforlowresourcebiomedicalrelationextraction/897885e4-07d3-4cf2-afc3-97176a5e3a1e_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..cf28d65c949dce5fe569c01df3dda952f19e4519 --- /dev/null +++ b/cannliprovideproperindirectsupervisionforlowresourcebiomedicalrelationextraction/897885e4-07d3-4cf2-afc3-97176a5e3a1e_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e4970ae3a503a21ae9bb016c31c1fb360c56256b145b136ca626770b430972f9 +size 120056 diff --git a/cannliprovideproperindirectsupervisionforlowresourcebiomedicalrelationextraction/897885e4-07d3-4cf2-afc3-97176a5e3a1e_model.json b/cannliprovideproperindirectsupervisionforlowresourcebiomedicalrelationextraction/897885e4-07d3-4cf2-afc3-97176a5e3a1e_model.json new file mode 100644 index 0000000000000000000000000000000000000000..5c6f205e4fac643deee22c93324c4ba2a8793e81 --- /dev/null +++ b/cannliprovideproperindirectsupervisionforlowresourcebiomedicalrelationextraction/897885e4-07d3-4cf2-afc3-97176a5e3a1e_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ec038a50dc12ed71daa3210c94d56542e0801b85197f16ef570bd7fb5c895fe2 +size 143466 diff --git a/cannliprovideproperindirectsupervisionforlowresourcebiomedicalrelationextraction/897885e4-07d3-4cf2-afc3-97176a5e3a1e_origin.pdf b/cannliprovideproperindirectsupervisionforlowresourcebiomedicalrelationextraction/897885e4-07d3-4cf2-afc3-97176a5e3a1e_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..cb9bdb5a372650970f1b72d6471615e0969fb459 --- /dev/null +++ b/cannliprovideproperindirectsupervisionforlowresourcebiomedicalrelationextraction/897885e4-07d3-4cf2-afc3-97176a5e3a1e_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3083bae44e9760bbf530a31c6a2cf2639a280863b1bc9496eeabc9a1fb79d443 +size 1387791 diff --git a/cannliprovideproperindirectsupervisionforlowresourcebiomedicalrelationextraction/full.md b/cannliprovideproperindirectsupervisionforlowresourcebiomedicalrelationextraction/full.md new file mode 100644 index 0000000000000000000000000000000000000000..2a3829c9a8c083cc8f5f99efc9f8d50d6a72a10e --- /dev/null +++ b/cannliprovideproperindirectsupervisionforlowresourcebiomedicalrelationextraction/full.md @@ -0,0 +1,458 @@ +# Can NLI Provide Proper Indirect Supervision for Low-resource Biomedical Relation Extraction? + +Jiashu Xu + +Mingyu Derek Ma + +Muhao Chen + +![](images/9853a3bd5b88832e2ea05a8e915f5a0a890e70023fdf5aade3e2f2e93466907d.jpg) + +Harvard University University of California, Los Angeles University of Southern California jxu1@harvard.edu ma@cs.ucla.edu muhaoche@usc.edu + +# Abstract + +Two key obstacles in biomedical relation extraction (RE) are the scarcity of annotations and the prevalence of instances without explicitly pre-defined labels due to low annotation coverage. Existing approaches, which treat biomedical RE as a multi-class classification task, often result in poor generalization in low-resource settings and do not have the ability to make selective predictions on unknown cases but give a guess from seen relations, hindering the applicability of those approaches. We present NBR, which converts biomedical RE as a natural language inference formulation to provide indirect supervision. By converting relations to natural language hypotheses, NBR is capable of exploiting semantic cues to alleviate annotation scarcity. By incorporating a ranking-based loss that implicitly calibrates abstinent instances, NBR learns a clearer decision boundary and is instructed to abstain on uncertain instances. Extensive experiments on three widely-used biomedical RE benchmarks, namely ChemProt, DDI, and GAD, verify the effectiveness of NBR in both full-shot and low-resource regimes. Our analysis demonstrates that indirect supervision benefits biomedical RE even when a domain gap exists, and combining NLI knowledge with biomedical knowledge leads to the best performance gains.1 + +# 1 Introduction + +In silico studies of biology and medicine have primarily relied on machines' understanding of relations between various molecules and biomolecules. For instance, disease-target prediction requires accurate identification of the association between the drug target and the disease (Bravo et al., 2015), and drug-drug interaction recognition is essential for polypharmacy side effect studies (Herrero-Zazo et al., 2013). Due to the complexity and high cost + +of human curation of such biomedical knowledge (Krallinger et al., 2017; Bravo et al., 2015), there has been a growing interest in the field of biomedical relation extraction (RE), a task of automatically inferring the relations between biomedical entities described in domain-specific corpora. + +However, two obstacles remain in training a reliable biomedical RE model. First, biomedical RE often suffers from insufficient and imperfect annotations, due to that the annotation process is very challenging and requires expert annotators to identify complex structures from lengthy and sophisticated biomedical literature. The existing biomedical learning resources either require very costly expert annotations (Krallinger et al., 2017) or resort to weak supervision (Bravo et al., 2015). The insufficiency and imperfection of annotations inevitably cause existing state-of-the-art (SOTA) biomedical RE systems (Yasunaga et al., 2022; Peng et al., 2019; Tinn et al., 2021, inter alia), though showing satisfactory results in a fully supervised setting, to result in poor generalization regarding the more common low-resource regime in this domain. For example, Han et al. (2018) showed that model performance deteriorated quickly as the number of instances for each relation drops, hindering the applicability of those approaches in real-world scenarios. Second, given that biomedical RE annotations tend to be incomplete or have low coverage, it is difficult for models to learn a clear decision boundary (Gardner et al., 2020). Specifically, in many scenarios where the described biomedical entities are not related in the context, the model may fail to abstain but give a guess from seen relations (Xin et al., 2021; Kamath et al., 2020). An overconfident model can be particularly harmful in high-stakes fields such as medicine, where incorrect predictions can have severe direct consequences for patients. + +Recently, indirect supervision (Roth, 2017; He et al., 2021; Levy et al., 2017; Lu et al., 2022; Li et al., 2019) is proposed that leverages supervision + +![](images/bd8ec1d9cfba8727927aa0303877df5a145a5829c2b948aa8172a107ca2e7a8d.jpg) +Figure 1: Overview of NBR. Given an input, (1) each relation is verbalized into natural language hypotheses and masked input where entity mentions are type-masked becomes the premise. The ground-truth is marked in light color. (2) For training NBR calculates the entailment scores for each relation candidate and optimizes the score of the ground-truth relation to rank over the scores of other candidates. (3) For inference NBR computes entailment scores of each relation and returns the one with the maximum entailment score. + +signals from resource-rich source tasks to enhance resource-limited target tasks. In this approach, the training and inference pipeline of the target task is transformed into the formulation of the source task, thus introducing additional supervision signals not accessible in the target task. Recent works (Li et al., 2022; Yin et al., 2020; Sainz et al., 2021) transfer cross-task learning signals from the Natural Language Inference (NLI) task. The NLI task aims at determining whether the hypothesis can be entailed given the premise, and inductive bias of NLI models learns adaptive generalized logical reasoning which aligns well with the goal of biomedical RE. On the other hand, traditional direct supervision on the biomedical RE fails to capture semantic information of relations since they are merely transformed to logits of a classifier. By converting relations to meaningful hypotheses in NLI, the indirectly supervised method bypasses this shortage and can adapt the preexisting inductive bias of NLI-finetuned models to make meaningful predictions based on relation semantics (Huang et al., 2022; Chen et al., 2020). This critically benefits the generalizability of the model in low-resource regimes where limited direct supervision signals are provided (Sainz et al., 2021) to remedy insufficient annotations. However, previous studies focus on general domain tasks and explore little in specific domains such as biomedical. Moreover, to maximize the utility of indirect supervision, it is found that incorporating task knowledge into the model, i.e. NLI model that is trained on NLI data, + +yields the best performance (Li et al., 2022; Sainz et al., 2021). Yet, biomedical NLI is rarely available and whether general domain NLI can provide strong indirect supervising signals to specific target domains remains unexplored. + +This study presents a general learning framework, dubbed NLI improved Biomedical Relation Extraction (NBR), to enhance biomedical RE with indirect supervision from general domain NLI task. Fig. 1 illustrates the structure of NBR. Specifically, given an input sentence, NBR reformulates RE to NLI by treating the input as the premise while verbalizing each relation label into template-based natural language hypotheses. NBR learns to rank the relations based on the entailment scores such that the hypothesis of a correct relation should be scored higher than those of any incorrect ones. Furthermore, to learn a fine-grained, instance-aware decision boundary, NBR deploys ranking-based loss for implicit abstention calibration that handles abstinent relations in the dataset. During inference, the relation whose verbalized hypothesis achieved the highest score becomes the prediction. NBR fully exploits indirect supervision from NLI and performs exceptionally well even in low-resource scenarios. + +Our contributions are three-fold: First, to the best of our knowledge, this is the first work to leverage indirect supervision from NLI on biomedical RE. Instead of solely relying on provided RE annotations, NBR leverages additional supervision signals from NLI indirect supervision and + +can generalize well in low resource regimes. Second, we show that NBR provides a proper indirect supervision signal even if there is a domain gap between general NLI knowledge NBR trained on and biomedical downstream task. Third, we propose a new ranking-based loss that implicitly handles abstinent relations ubiquitous in biomedical RE by contrastively calibrating the score of abstinent instances. By extensive experiments on three commonly-used biomedical RE benchmarks, namely, ChemProt (Krallinger et al., 2017), DDI (Herrero-Zazo et al., 2013) and GAD (Bravo et al., 2015), we verify our contributions and show that general domain NLI can provide a proper supervision signal, especially in low resource settings where annotations are scarce. NBR provides consistent improvements on three datasets (1.10, 1.79, and 0.96 points of F1 improvement respectively), and up to 34.25 points of F1 improvement in low-resource settings. Further analysis demonstrates that combing NLI knowledge with biomedical knowledge leads to the best performance gains. + +# 2 Related Works + +Biomedical relation extraction. Despite the growing availability of biomedical corpora on Web repositories, the main challenge remains in transforming those unstructured textual data into a rigidly-structured representation that includes interested entities and relations between them (Peng et al., 2019; Lee et al., 2020; Tinn et al., 2021). However, knowledge curation for this purpose is often costly and requires expert involvement (Krallinger et al., 2017; Herrero-Zazo et al., 2013; Bravo et al., 2015). To address this issue, biomedical RE techniques are developed to automate this process. Most existing works mainly conduct supervised fine-tuning language models pretrained on relevant corpus e.g. PubMed abstracts and MIMIC-III clinical notes, on annotated biomedical RE corpora (Tinn et al., 2021; Peng et al., 2019; Beltagy et al., 2019; Lee et al., 2020; Shin et al., 2020; Yasunaga et al., 2022). Two drawbacks of the aforementioned approach are: (1) it fails to capture the semantic interaction between relations and entities as relations are represented as integer indices (Chen et al., 2020; Huang et al., 2022), and (2) performance deteriorates as the number of training instances drops (Han et al., 2018). + +Indirect supervision. Indirect supervision (Roth, 2017; He et al., 2021) transfers supervision sig + +nals from a more resource-rich task to enhance a specific more resource-limited task. Often this line of work reformulates the training and inference pipeline of the target task into the form of the source task to facilitate the cross-task signal transfer. Levy et al. (2017) demonstrate that relation extraction can be solved using machine reading comprehension formulation. Similarly, Li et al. (2019) and Lu et al. (2022) further show that relation extraction performance can be improved by multi-turn question answering and summarization, respectively. Recently Sainz et al. (2021) and Li et al. (2022) propose to leverage indirect supervision from the NLI task. LITE (Li et al. (2022)) enhances entity typing by incorporating NLI and a learning-to-rank training objective while Sainz et al. (2021) observes the benefits of indirect supervision in low-resource relation extraction. As discussed, NLI aligns well with relation extraction, but to the best of our knowledge, there is no prior work that investigates the effectiveness of indirect supervision when there is a domain gap between the target task and the source task, e.g. biomedical domain and general domain in this study. + +# 3 Method + +We hereby present NBR. We discuss how to frame relation extraction as a NLI task in §3.2, illustrate how to leverage cross-domain NLI knowledge in §3.3, and lastly provide an optional explicit abstention detector to handle abstinent instances in §3.4. + +# 3.1 Problem Formulation + +The RE model takes a sentence $\mathbf{x}$ with two mentioned entities $e_1, e_2$ as input, and predicts the relation $y$ between $e_1, e_2$ from the label space $\mathcal{V}$ that includes all considered relations. The dataset $\mathcal{D}$ consists of both non-abstinent instances where $y \in \mathcal{V}$ , and abstinent instances $^2$ where $y = \bot$ . A successful RE model should abstain for abstinent instances and accurately predict $y$ for non-abstinent instances. + +# 3.2 Relation Extraction with NLI + +Following Sainz et al. (2021), we reformulate the RE task as a NLI task, allowing cross-task transfer of indirect supervision signals from NLI resources. An overview of our pipeline is visualized in Fig. 1. + +Decompose RE to NLI queries. The NLI model takes in a premise and a hypothesis, both in natural language, and outputs a logit indicating if the premise either "entails," "contradicts" the hypothesis or the inference relation is "neutral." We decompose an instance $(\mathbf{x}, e_1, e_2)$ into $|\mathcal{V}| + 1$ NLI queries, each about a candidate relation. We formulate the RE input sentence $\mathbf{x}$ as the premise and a verbalized sentence describing the candidate relation as the hypothesis. + +Verbalizing relations to hypotheses. For each relation $y \in \mathcal{Y} \cup \{\bot\}$ , we verbalize $y$ as a natural language hypothesis $\nu(y)$ . Contextual textual representations of labels provide more semantic signals and are thus more understandable by a language model (LM) compared to the relation name itself or discrete relation label index used in standard classification methods (Chen et al., 2020; Huang et al., 2022). + +Entity mentions in biomedical RE are mostly domain-specific terms that rarely appear in the LM's pre-training corpus. The relations are always defined between entities of certain types, e.g. between a gene complex and another chemical in ChemProt (Krallinger et al., 2017) or between two drugs in DDI (Herrero-Zazo et al., 2013). Thus, each entity mention is replaced by typed entity masks such as @GENE$ following Gu et al. (2021) and Peng et al. (2019).3 The replacement enables the LM to capture semantic information of the types and avoid using poorly trained representations for rare biomedical terms. + +As demonstrated by recent studies (Yeh et al., 2022; Li et al., 2022; Sainz et al., 2021), picking a good verbalizer for each relation may affect performance. Specifically, we design several types of templates (details and performances are provided in Appx. $\S D$ ) listed below, each containing the two typed entity masks: + +1. Simple Template verbalizes relation between two entities with "is-a" phrase. +2. Descriptive Template provides a contextual description of the relation. +3. Demonstration Template includes a randomly sampled trainset exemplar with the same relation. +4. Descriptive+Demonstration Template combines both the Descriptive description and the sampled exemplar. + +5. Learned Prompt Template (Yeh et al., 2022) learns optimal discrete tokens for description. + +We observe that Descriptive Template performs the best empirically (Tab. 7). + +Confidence scoring. For each relation label $y \in \mathcal{Y} \cup \{\bot\}$ , we calculate the confidence score of whether relation $y$ holds by $s(y) = f_{\mathrm{NLI}}(\mathbf{x}[\mathrm{SEP}]\nu(y))$ where [SEP] is a special token separating $\mathbf{x}$ (premise) and $\nu(y)$ (hypothesis). $f_{\mathrm{NLI}}$ is a transformer-based NLI model that encodes the input and produces logits that correspond plausibility of premise entailing hypothesis. + +Abstention as a separate label. We treat $\perp$ as a separate relation label and verbalize it explicitly, which is analogous to how supervised biomedical RE treats $\perp$ as an additional label (Yasunaga et al., 2022; Peng et al., 2019). An explicit template relieves the burden of incorporating both stop condition and label discriminative power into scores of $\mathcal{V}$ labels. + +Training objective. Recent works in contrastive learning show that InfoNCE loss benefits efficient learning from negative examples (Robinson et al., 2021; Wang et al., 2022; Zhang and Stratos, 2021; Zhou et al., 2021; Ma et al., 2023, 2021). Motivated by the intuition that positive instances should be ranked higher than negative instances with regard to the anchor instance, in each step we sample $n$ negative relations $\{y_1, \ldots, y_n\} \subseteq \mathcal{V} \cup \{\bot \} \setminus \{y\}$ and compute $s(y_1), \ldots, s(y_n)$ , and optimize ground truth relation's entailment score to be ranked higher. Specifically, we optimize the following InfoNCE loss + +$$ +\begin{array}{l} \mathcal {L} _ {\mathrm {N C E}} = \sum_ {(\mathbf {x}, y) \in \mathcal {D}} \ell_ {\mathrm {N C E}} (\mathbf {x}, y) \tag {1} \\ \triangleq \sum_ {(\mathbf {x}, y) \in \mathcal {D}} - \ln \left(\frac {\exp (s (y) / \tau)}{\exp (s (y) / \tau) + \sum_ {i = 1} ^ {n} \exp (s (y _ {i}) / \tau)}\right), \\ \end{array} +$$ + +in which temperature $\tau$ controls focus on harder negatives. In practice, learning from all possible negatives performs the best. + +In pilot experiments, we observed that the model was prone to be misled by the vast number of abstinent instances in the dataset, leading to deteriorated performance. To alleviate such abstinent $\nu .s.$ nonabstinent imbalance, we introduce a margin-based Abstention Calibration regularization to penalize over-confident abstinent instances while encouraging non-abstinent instances. Concretely, if relation + +is not $\perp$ , we calibrate the score of $\perp$ such that $s(\perp)$ is suppressed; otherwise, we control $\perp$ to be ranked higher than other relations. + +$$ +\begin{array}{l} \mathcal {L} _ {\mathrm {A C}} = \sum_ {(\mathbf {x}, y) \in \mathcal {D}} \ell_ {\mathrm {A C}} (\mathbf {x}, y) \tag {2} \\ \ell_ {\mathrm {A C}} (\mathbf {x}, y) \triangleq \left\{ \begin{array}{l} \sum_ {i = 1} ^ {n} \ell_ {\mathrm {r a n k}} (s (y), s (y _ {i}); \gamma), \text {i f} y = \bot \\ \ell_ {\mathrm {r a n k}} (s (y), s (\bot); \gamma), \text {o t h e r w i s e} \end{array} \right. \\ \end{array} +$$ + +where the ranking loss $\ell_{\mathrm{rank}}(x_1,x_2;\gamma)$ learns to project $x_{1}$ higher than $x_{2}$ by a margin $\gamma$ . Training with this objective, NBR can be viewed as combining an implicit abstention calibrator and $s(\bot)$ as a learnable instance-aware threshold. The final training loss is $\mathcal{L}_{\mathrm{NCE}} + \lambda \mathcal{L}_{\mathrm{AC}}$ where non-negative hyperparameter $\lambda$ controls the strength of abstention calibration. + +Inference. NBR gathers hypotheses verbalized from every relation and performs ranking among the entailment scores of each hypothesis. Then the relation whose verbalized hypothesis achieves the highest score is selected as the final prediction. + +# 3.3 Cross-Domain NLI Fine-tuning + +In order to maximize the benefit of NLI formulation, it is advised to use models trained on target-domain NLI dataset (Li et al., 2022; Sainz et al., 2021). However, available biomedical NLI training resource is limited. As a remedy, we experiment with fine-tuning NLI models on two commonly used general domain NLI datasets, namely MNLI (Williams et al., 2018) and SNLI (Bowman et al., 2015), instead. Empirically we found strong evidence (\$4.2, §4.4) that general-domain NLI knowledge can still be beneficial in the biomedical domain even if a domain gap exists. + +# 3.4 Explicit Abstention Detector + +Training with aforementioned $\mathcal{L}_{\mathrm{AC}}$ (Eq. 2) makes NBR an implicit abstention calibrator. As an optional post-process step, we can further improve NBR by introducing an Explicit Abstention Dector (EAD). This is analogous to the "no-answer reader" component used in previous works that detect abstinent instances explicitly (Back et al., 2020; Hu et al., 2019; Kundu and Ng, 2018). + +EAD is essentially another instance of NBR trained separately on the same train set, but changing relation labels into binary "has relation" versus "no relation" $(\bot)$ . A new verbalization template is created for "has relation". For inference, we collect + +all differences \( s_{\mathrm{EAD}}(\perp) - s_{\mathrm{EAD}}(\text{"has relation") on the dev set. Then we iterate each difference as a threshold, and for one instance in the test set, EAD predicts \(\perp\) only if the difference of such instance exceeds the threshold. Once EAD is trained, NBR and EAD are combined using a simple heuristic: resort to NBR only when EAD prediction is not \(\perp\) (Appx. \(\S C\)). In this manner, even if EAD makes a false positive prediction, since NBR still retains the ability to flag \(\perp\), such error can be recovered. Otherwise, we trust EAD prediction since it specializes in abstention prediction. + +# 4 Experiments + +In this section, we discuss our experiment setup (§4.1) and evaluation results (§4.2), followed by detailed ablation studies (§4.3) and analyses (§4.4). + +# 4.1 Experimental Setup + +Dataset and evaluation metric. We conduct experiments on three sentence-level biomedical RE datasets contained in the widely-used BLURB benchmark (Gu et al., 2021). ChemProt (Krallinger et al., 2017) consists of PubMed abstracts corpora with five high-level chemical-protein interaction annotations. DDI (Herrero-Zazo et al., 2013) studies drug-drug interaction and specializes in pharmacovigilance built from PubMed abstracts. GAD (Bravo et al., 2015) is a semi-labeled dataset created using Genetic Association Archive and consists of gene-disease associations. + +There are multiple variants of the datasets used by existing literature that differ by data statistics or evaluation protocol (Dong et al., 2021; Phan et al., 2021; Beltagy et al., 2019; Yeh et al., 2022; Peng et al., 2020; Xu et al., 2022) as described in Appx. $\S \mathrm{B}$ , we adopt the most popular setting used by Gu et al. (2021) and give dataset statistics in Tab. 5. Most of entity pairs are labeled as $\perp$ without an explicit relation label. This setting is realistic since the model must identify a relation's existence first. Following Gu et al. (2021), we use the micro F1 score calculated across all non-abstinent instances as the evaluation metric. + +Baselines. We compare against the various baselines (Appx. $\S \mathrm{A}$ ), mostly classification-based approaches that use $|\mathcal{Y}| + 1$ -way classification head on top of a biomedical-pretrained LM. Sci-Five + +
ModelChemProtDDIGAD
SUPERVISED METHODS
BioRE-Prompt (Yeh et al., 2022)67.46--
BLUE-BERTlarge (Peng et al., 2019)74.4079.90-
Sci-BERTbase (Beltagy et al., 2019)74.9381.32
Bio-BERTlarge (Lee et al., 2020)76.4680.3379.83
BioMegatron (Shin et al., 2020)77.00--
PubMed-BERTlarge (Tinn et al., 2021)77.2482.3682.34
Sci-Fivelarge (Phan et al., 2021)77.4882.2379.21
KeBioLM (Yuan et al., 2021)77.5081.9084.30
BioLink-BERTlarge (Yasunaga et al., 2022)77.5782.7284.39
BioM-ELECTRALarge (Alrowili and Vijay-Shanker, 2021)78.60--
BioRoBERTlarge (Alrowili and Vijay-Shanker, 2021)78.80--
BioM-ALBERTxxlarge (Alrowili and Vijay-Shanker, 2021)79.3082.04-
BioLink-BERTlarge (Yasunaga et al., 2022)79.9883.3584.90
BioM-BERTlarge (Alrowili and Vijay-Shanker, 2021)80.0081.92-
INDIRECT SUPERVISION
NBRNL1 (§3.2)79.3083.8783.75
NBRNL1+FT (§3.3)80.5484.6685.86
NBRNL1+FT+EAD (§3.4)81.1085.14-
+ +Table 1: Model performance (micro F1) using full training data on 3 biomedical RE datasets. Since GAD does not contain abstinent instances, EAD is unnecessary. $\diamond$ indicates the results are from our re-implementation to conform to our evaluation metric. Other baseline performances are taken from their papers. We highlight the best results in red and the best results of direct supervision in cyan. + +(Phan et al., 2021) generates the relation label as a seq-to-seq conditional generation formulation. + +Our method. We term three variants of NBR: + +- $\mathrm{NBR}_{\mathrm{NLI}}$ using NLI formulation (§3.2) with BioLinkBERTlarge (Yasunaga et al., 2022) backbone that pretrained on biomedical corpus. +- $\mathrm{NBR}_{\mathrm{NLI} + \mathrm{FT}}$ further cross-domain fine-tunes (§3.3) BioLinkBERT on two general domain NLI datasets. The model retains biomedical domain knowledge and learns relevant NLI knowledge. +- $\mathrm{NBR}_{\mathrm{NLI} + \mathrm{FT}} + \mathrm{EAD}$ assembles $\mathrm{NBR}_{\mathrm{NLI} + \mathrm{FT}}$ with a separately trained EAD component (§3.4). + +We choose BioLinkBERT as the pretrained LM due to its supremacy in performance on various biomedical domain tasks, but we emphasize that our approach is agnostic to backbone models. + +# 4.2 Experimental Results + +NLI provides helpful indirect supervision. We report the comparison between NBR and baselines in Tab. 1. Overall, $\mathrm{NBR}_{\mathrm{NLI + FT}} + \mathrm{EAD}$ achieves SOTA performance on all three datasets, with 1.10, 1.79, and 0.96 points F1 improvement on ChemProt, DDI, and GAD respectively. Strong + +performance gains verify the effectiveness of reformulating biomedical RE as NLI. NLI supervision signals from the general domain are transferred to enhance the biomedical RE learning signals. By verbalizing relations into natural language hypothesis, NBR leverages the preexisting inductive bias of NLI-finetuned models to make informed predictions based on relation semantics. + +We further compare the performance of our model's variants. First, due to the prevalence of abstinent instances on the datasets, we notice that by explicitly detecting the abstinent instances, assembling EAD (§3.4) with $\mathrm{NBR}_{\mathrm{NLI} + \mathrm{FT}}$ improves performance on ChemProt and DDI. This is likely because explicitly detecting $\perp$ by a separate EAD model reduces the burden on $\mathrm{NBR}_{\mathrm{NLI} + \mathrm{FT}}$ to predict relations and identify abstinent instances at the same time. Second, we show that cross-domain fine-tuning (§3.3) is vital. Compared to $\mathrm{NBR}_{\mathrm{NLI}}$ , which is not trained on NLI datasets, $\mathrm{NBR}_{\mathrm{NLI} + \mathrm{FT}}$ resulted in significant improvements in F1 across three datasets. This demonstrates that having prior NLI knowledge allows better utilization of the NLI formulation. Lastly, we note that $\mathrm{NBR}_{\mathrm{NLI}}$ is outperformed by its direct supervision counterpart, + +
Model on ChemProt0 shot8 shot1%50 shot10%100%
BioRE-Prompt (Yeh et al., 2022)1.326.0727.8936.8055.6667.46
BLUE-BERTlarge (Peng et al., 2019)-10.2220.1327.9151.0274.40
Sci-BERTbase (Beltagy et al., 2019)-15.6022.0833.3660.6074.93
Bio-BERTbase (Lee et al., 2020)-10.2820.9638.1568.0176.46
PubMed-BERTlarge (Tinn et al., 2021)-15.9723.4935.3768.4977.24
Sci-Fivelarge (Phan et al., 2021)0.0017.1935.6647.4168.6277.48
BioM-ALBERTxxlarge (Alrowili and Vijay-Shanker, 2021)-8.4914.9521.9251.6979.30
BioLinkBERTlarge (Yasunaga et al., 2022)-9.3121.1938.7071.3779.98
BioM-BERTlarge (Alrowili and Vijay-Shanker, 2021)-16.0226.2340.6368.9380.00
NBRNLI ($3.2)5.7036.4249.6351.9572.0379.30
NBRNLI+FT ($3.3)24.5046.5360.1756.4375.1280.54
NBRNLI+FT+EAD ($3.4)-51.4460.3461.3175.2481.10
Model on DDI0 shot8 shot50 shot1%10%100%
BLUE-BERTlarge (Peng et al., 2019)-8.7625.7927.4865.6279.90
Bio-BERTbase (Lee et al., 2020)-13.6131.9330.0164.5680.33
Sci-BERTbase (Beltagy et al., 2019)-10.5533.3423.6269.4481.32
Sci-Fivelarge (Phan et al., 2021)0.0025.4439.3629.8077.1182.23
PubMed-BERTlarge (Tinn et al., 2021)-17.0234.3927.5371.9882.36
BioM-ALBERTxxlarge (Alrowili and Vijay-Shanker, 2021)-11.5222.5018.6476.7082.04
BioLinkBERTlarge (Yasunaga et al., 2022)-9.7037.8034.1174.0883.35
BioM-BERTlarge (Alrowili and Vijay-Shanker, 2021)-16.4237.2527.8579.0781.92
NBRNLI ($3.2)3.6032.0147.8653.5379.4983.87
NBRNLI+FT ($3.3)11.9437.8052.4960.2080.8584.66
NBRNLI+FT+EAD ($3.4)-42.4858.5061.0681.7185.14
+ +Table 2: We conduct experiment on $\{0,8,50\}$ -shot and $\{1,10\}-\%$ ChemProt (top) and DDI (bottom). We highlight the best model in red and the best of direct supervision in cyan. Columns are ordered by the number of training instances. $\diamond$ indicates the results are from our re-implementation to conform to our evaluation metric. + +namely BioLinkBERT on ChemProt and GAD. The possible reason could be that the model needs to learn to perform NLI tasks on top of the RE task without NLI training, which leads to shallower supervision signals. However we observe that generally, and especially in low-resource regimes, $\mathrm{NBR}_{\mathrm{NLI}}$ improves over direct supervision (§4.4). + +Indirect supervision from NLI shines particularly under low-resource. We evaluate the NBR under zero- and few-shot settings in Tab. 2. Following existing works (Peng et al., 2020; Xu et al., 2022), we train the model with 0, 8 and 50 shots and $1\%$ and $10\%$ of training instances. We note that classification-based methods could not adapt to the zero-shot setting. + +Our experimental results show that all three variants of NBR consistently achieve strong performance across all few-shot settings on all datasets, e.g. 34.25 points F1 improvement on 8-shot ChemProt. The performance of direct supervision models deteriorates dramatically as the num + +ber of training instances decreases, due to the limited learning signals. On the contrary, NBR effectively leverages indirect supervision to transform richer NLI signals to improve the RE performance. Additionally verbalized hypotheses provide valuable semantic cues for prediction. We also observe similar patterns as the full-set experiments: using NLI knowledge learned from NLI training data improves the performance of $\mathrm{NBR}_{\mathrm{NLI}}$ and combing EAD with $\mathrm{NBR}_{\mathrm{NLI + FT}}$ leads to further performance gains. + +Lastly, we note that as the number of training instances increases, the benefits of indirect supervision tend to decrease. This suggests that given sufficient training signals, direct supervision can learn effectively, and the marginal returns of introducing additional NLI signals become smaller. In practical settings where biomedical annotations are scarce, learning with indirect supervision can lead to better performance. + +# 4.3 Ablation Study + +
ModelChemProtDDI
1%100%1%100%
NBRNLI+FT60.1780.5460.2084.66
-LNCE(Eq. 1)59.6379.3252.5083.29
-λAC(Eq. 2)57.5778.6850.1882.94
-λNCE-λNC53.8778.1220.7182.74
MedNLI53.5879.6051.0482.42
+ +We perform ablation studies on model components on ChemProt and DDI using $1\%$ and $100\%$ training data in Tab. 3. (1) InfoNCE $\mathcal{L}_{\mathrm{NCE}}$ (Eq. 1) is essential. Replacing $\mathcal{L}_{\mathrm{NCE}}$ with ranking loss sum i.e. $\sum_{i=1}^{n}\ell_{\text{rank}}(s(y), s(y_i); \gamma)$ deteriorate performance. These results confirm the effectiveness of InfoNCE in learning from negative samples (Robinson et al., 2021; Wang et al., 2022). (2) $\mathcal{L}_{\mathrm{AC}}$ (Eq. 2) is vital. Given the prevalence of abstinent relations in the two datasets, it is easy for models to be misled by abstinent instances since they impose stronger learning signals. We specifically notice $1\%$ settings have a larger performance drop, which might be caused by the fact that detecting abstention is harder when the quantity of other labels and their associated learning signals is reduced. (3) We further consider a variant that replaces $\mathcal{L}_{\mathrm{NCE}}$ with ranking loss sum, removes $\mathcal{L}_{\mathrm{AC}}$ and uses only one negative sample, which corresponds to LITE (Li et al., 2022) that uses NLI indirect supervision for the general domain entity typing task. We observe further performance degradation, which again verifies the effectiveness of the two losses. Lastly (4) we fine-tune BioLinkBERT on the biomedical MedNLI (Romanov and Shivade, 2018). Despite being domain-relevant, we observe performance drops compared to fine-tuning on general domain NLI datasets. We hypothesize that perform drops might be caused by (a) MedNLI being relatively small as MNLI is $35x$ larger and (b) low coverage on relevant knowledge e.g. only $11.77\%$ of ChemProt entities are mentioned in MedNLI. Therefore even if MedNLI provides both NLI knowledge and biomedical knowledge, the gain is insignificant. + +# 4.4 Analysis + +In this section, we first show the benefits of indirect supervision, then illustrate two key ingredients for + +effective indirect supervision gains: biomedical domain knowledge and NLI knowledge. + +Table 3: Ablation study of NBR. Micro F1 is reported for $1\%$ and $100\%$ ChemProt and DDI datasets. + +
DatasetRoBERTaBioLinkBERT
DSISDSIS
ChemProt1%0.0051.1121.1949.63
100%45.7276.0279.9879.30
DDI1%15.1326.1134.1153.53
100%81.2381.7383.3583.87
+ +Table 4: NLI formulation benefits, especially in low-resource settings. We report performance using Direct Supervision (DS) or NLI Indirect Supervision (IS) formulation with backbones not trained on NLI datasets. + +NLI formulation benefits, even without additional NLI resources. In Tab. 4, we demonstrate the effectiveness of NLI formulation using two backbones without NLI knowledge: RoBERTa (Liu et al., 2019) and BioLinkBERT. + +We observe that even if models lack NLI formulation adaption, NLI formulation outperforms original RE formulation in most settings, particularly in low-resource settings. When data is limited, it is challenging for direct supervision methods to access sufficient supervision signals. In contrast, the model can leverage the semantic information in the natural language hypothesis with the NLI formulation. Additionally, BioLinkBERT consistently outperformed RoBERTa in the same settings, despite RoBERTa large having larger parameters, suggesting the importance of domain knowledge. + +Two key ingredients of indirect supervision for biomedical RE. We identify two potential factors that contribute to the effective usage of indirect supervision for biomedical RE: 1) biomedical domain-specific knowledge; and 2) NLI knowledge to adapt to the NLI formulation. To test the importance of these two kinds of knowledge, in Fig. 2 we evaluate on $1\%$ and $100\%$ of ChemProt and DDI the four combinations: RoBERTa and RoBERTa fine-tuned on NLI, and BioLinkBERT and BioLinkBERT fine-tuned on NLI. + +We first observe that BioLinkBERT fine-tuned on NLI datasets behaves the best across all four settings, indicating the importance of both pieces of knowledge. When the learning signal is limited, the model can dynamically load-balance both forms of knowledge to make educated predictions. Secondly, we note that RoBERTa, which lacks both biomedical and NLI knowledge, consistently performs the worst, except for $1\%$ ChemProt. Finally, + +![](images/d5c78ead5a5450133b367a810fa602a07514d5b1fe1f51511db78a364778d3b0.jpg) +Figure 2: Impact of biomedical and NLI knowledge on 1 and $100\%$ ChemProt and DDI. Both pieces of knowledge are substantial for biomedical RE. + +it is difficult to determine whether the domain or NLI knowledge is more important in biomedical RE, as the relative importance may depend on the specific dataset or the knowledge requirements of each input. + +# 5 Conclusion + +We present a novel method NBR that leverages indirect supervision by cross-task transfer learning from NLI tasks to improve the biomedical RE task. NBR verbalizes relations to natural language hypotheses so that model is able to exploit semantic information to make informed predictions. Furthermore, NBR adopts a ranking-based abstinent calibration loss that penalizes overconfident abstinent instances while encouraging non-abstinent instances, thus being capable of abstaining on uncertain instances. Extensive experiments on three widely-used biomedical RE benchmarks demonstrate that NBR is effective in both full-set and low-resource settings. We further investigate two key ingredients for effective NLI indirect supervision on biomedical RE. Future work could involve further investigation of other indirect supervision approaches and automatic relation template generation based on prompt learning. + +# Acknowledgement + +We appreciate the reviewers for their insightful comments and suggestions. Jiashu Xu was supported by the Center for Undergraduate Research in Viterbi Engineering (CURVE) Fellowship. Mingyu Derek Ma was supported by the AFOSR MURI grant #FA9550-22-1-0380, the Defense Advanced Research Project Agency (DARPA) grant #HR00112290103/HR0011260656, and a Cisco + +Research Award. Muhao Chen was supported by the NSF Grant IIS 2105329, by the Air Force Research Laboratory under agreement number FA8750-20-2-10002, by a subaward of the INFER Program through UMD ARLIS, an Amazon Research Award and a Cisco Research Award. Computing of this work was partly supported by a subaward of NSF Cloudbank 1925001 through UCSD. + +# Limitations + +This work investigates using NLI as indirect supervision for biomedical RE. Experiments suggest two key ingredients in high-performing indirect supervision biomedical RE are biomedical knowledge and NLI knowledge. To this goal, we need to access a language model that is pretrained on biomedical domain corpus, which requires computational resources. Compared to general domain ones, models pretrained on a specific domain are often limited in variety. Further to learn NLI knowledge additional cross-domain fine-tuning needs to be conducted, which results in additional computational overhead. + +During inference NBR requires #label times of forward passes to yield prediction since NBR needs to evaluate entailment scores for each verbalized relation. Compared to standard supervision which only requires one pass for every instance, inference cost and training cost are higher in a factor of # label. Higher inference cost hinders applicability in a number of scenarios e.g. real-time applications. Additionally, the high inference cost makes it difficult to deploy machine learning models in resource-constrained environments, such as edge devices with limited processing power. + +Lastly, since NBR is sensitive to templates, designing an effective template is crucial for perfor + +mance. However, currently human involvement is required to design templates for each relation. As the number of relations increases, human involvement might become costly and time-consuming. Moreover, it is not easy to test the effectiveness of templates as no objective metric exists, and the only way to assess the quality is to test the templates. + +# References + +Sultan Alrowili and K Vijay-Shanker. 2021. Biom transformers: building large biomedical language models with bert, albert and electra. In Proceedings of the 20th Workshop on Biomedical Language Processing, pages 221-227. +Seohyun Back, Sai Chetan Chinthakindi, Akhil Kedia, Haejun Lee, and Jaegul Choo. 2020. Neurquri: Neural question requirement inspector for answerability prediction in machine reading comprehension. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net. +Iz Beltagy, Kyle Lo, and Arman Cohan. 2019. Scibert: A pretrained language model for scientific text. 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 3615-3620. +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. +Alex Bravo, Janet Pinero, Núria Queralt-Rosinach, Michael Rautschka, and Laura I Furlong. 2015. Extraction of relations between genes and diseases from text and large-scale data analysis: implications for translational research. BMC bioinformatics, 16(1):1-17. +Muhao Chen, Hongming Zhang, Haoyu Wang, and Dan Roth. 2020. What are you trying to do? semantic typing of event processes. In Proceedings of the 24th Conference on Computational Natural Language Learning, pages 531-542, Online. Association for Computational Linguistics. +Manqing Dong, Chunguang Pan, and Zhipeng Luo. 2021. Mapre: An effective semantic mapping approach for low-resource relation extraction. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 2694-2704. +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. +Yu Gu, Robert Tinn, Hao Cheng, Michael Lucas, Naoto Usuyama, Xiaodong Liu, Tristan Naumann, Jianfeng Gao, and Hoifung Poon. 2021. Domain-specific language model pretraining for biomedical natural language processing. ACM Transactions on Computing for Healthcare (HEALTH), 3(1):1-23. +Xu Han, Pengfei Yu, Zhiyuan Liu, Maosong Sun, and Peng Li. 2018. Hierarchical relation extraction with coarse-to-fine grained attention. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 2236-2245. +Xu Han, Weilin Zhao, Ning Ding, Zhiyuan Liu, and Maosong Sun. 2022. *Ptr: Prompt tuning with rules for text classification*. AI Open. +Hangfeng He, Mingyuan Zhang, Qiang Ning, and Dan Roth. 2021. Foreseeing the benefits of incidental supervision. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 1782-1800, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +María Herrero-Zazo, Isabel Segura-Bedmar, Paloma Martínez, and Thierry Declerck. 2013. The ddi corpus: An annotated corpus with pharmacological substances and drug-drug interactions. Journal of biomedical informatics, 46(5):914-920. +Minghao Hu, Furu Wei, Yuxing Peng, Zhen Huang, Nan Yang, and Dongsheng Li. 2019. Read + verify: Machine reading comprehension with unanswerable questions. 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 6529-6537. AAAI Press. +James Y. Huang, Bangzheng Li, Jiashu Xu, and Muhao Chen. 2022. Unified semantic typing with meaningful label inference. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 2642-2654, Seattle, United States. 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. +Martin Krallinger, Obdulia Rabal, Saber A Akhondi, Martin Pérez Pérez, Jesús Santamaría, Gael Pérez Rodríguez, Georgios Tsatsaronis, Ander Intxaurrondo, José Antonio López, Umesh Nandal, et al. 2017. Overview of the biocreative vi chemicalprotein interaction track. In Proceedings of the sixth BioCreative challenge evaluation workshop, volume 1, pages 141-146. +Souvik Kundu and Hwee Tou Ng. 2018. A nil-aware answer extraction framework for question answering. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 4243-4252, Brussels, Belgium. Association for Computational Linguistics. +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. +Omer Levy, Minjoon Seo, Eunsol Choi, and Luke Zettlemoyer. 2017. Zero-shot relation extraction via reading comprehension. In Proceedings of the 21st Conference on Computational Natural Language Learning (CoNLL 2017), pages 333-342, Vancouver, Canada. Association for Computational Linguistics. +Bangzheng Li, Wenpeng Yin, and Muhao Chen. 2022. Ultra-fine entity typing with indirect supervision from natural language inference. Transactions of the Association for Computational Linguistics, 10:607-622. +Xiaoya Li, Fan Yin, Zijun Sun, Xiayu Li, Arianna Yuan, Duo Chai, Mingxin Zhou, and Jiwei Li. 2019. Entity-relation extraction as multi-turn question answering. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 1340-1350, Florence, Italy. 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. +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. +Keming Lu, I-Hung Hsu, Wenxuan Zhou, Mingyu Derek Ma, Muhao Chen, et al. 2022. Summarization as indirect supervision for relation extraction. In EMNLP - Findings. + +Mingyu Derek Ma, Muhao Chen, Te-Lin Wu, and Nanyun Peng. 2021. HyperExpan: Taxonomy expansion with hyperbolic representation learning. In *Findings of the Association for Computational Linguistics: EMNLP* 2021, pages 4182-4194, Punta Cana, Dominican Republic. Association for Computational Linguistics. +Mingyu Derek Ma, Alexander K. Taylor, Wei Wang, and Nanyun Peng. 2023. Dice: Data-efficient clinical event extraction with generative models. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics, Toronto, Canada. Association for Computational Linguistics. +Hao Peng, Tianyu Gao, Xu Han, Yankai Lin, Peng Li, Zhiyuan Liu, Maosong Sun, and Jie Zhou. 2020. Learning from Context or Names? An Empirical Study on Neural Relation Extraction. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 3661-3672, Online. Association for Computational Linguistics. +Yifan Peng, Shankai Yan, and Zhiyong Lu. 2019. Transfer learning in biomedical natural language processing: An evaluation of bert and elmo on ten benchmarking datasets. In Proceedings of the 2019 Workshop on Biomedical Natural Language Processing (BioNLP 2019). +Long N Phan, James T Anibal, Hieu Tran, Shaurya Chanana, Erol Bahadroglu, Alec Peltekian, and Grégoire Altan-Bonnet. 2021. Scifive: a text-to-text transformer model for biomedical literature. arXiv preprint arXiv:2106.03598. +Joshua David Robinson, Ching-Yao Chuang, Suvrit Sra, and Stefanie Jegelka. 2021. Contrastive learning with hard negative samples. In ICLR. +Alexey Romanov and Chaitanya Shivade. 2018. Lessons from natural language inference in the clinical domain. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 1586-1596, Brussels, Belgium. Association for Computational Linguistics. +Dan Roth. 2017. Incidental supervision: Moving beyond supervised learning. In Thirty-First AAAI Conference on Artificial Intelligence. +Oscar Sainz, Oier Lopez de Lacalle, Gorka Labaka, Ander Barrena, and Eneko Agirre. 2021. Label verbalization and entailment for effective zero and few-shot relation extraction. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 1199-1212. +Hoo-Chang Shin, Yang Zhang, Evelina Bakhturina, Raul Puri, Mostofa Patwary, Mohammad Shoeybi, and Raghav Mani. 2020. BioMegatron: Larger biomedical domain language model. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages + +4700-4706, Online. Association for Computational Linguistics. + +Robert Tinn, Hao Cheng, Yu Gu, Naoto Usuyama, Xiaodong Liu, Tristan Naumann, Jianfeng Gao, and Hoifung Poon. 2021. Fine-tuning large neural language models for biomedical natural language processing. arXiv preprint arXiv:2112.07869. + +Liang Wang, Wei Zhao, Zhuoyu Wei, and Jingming Liu. 2022. SimKGC: Simple contrastive knowledge graph completion with pre-trained language models. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 4281-4294, Dublin, Ireland. 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. + +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. + +Ji Xin, Raphael Tang, Yaoliang Yu, and Jimmy Lin. 2021. The art of abstention: Selective prediction and error regularization 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 (Volume 1: Long Papers), pages 1040-1051. + +Xin Xu, Xiang Chen, Ningyu Zhang, Xin Xie, Xi Chen, and Huajun Chen. 2022. Towards realistic low-resource relation extraction: A benchmark with empirical baseline study. arXiv preprint arXiv:2210.10678. + +Michihiro Yasunaga, Jure Leskovec, and Percy Liang. 2022. LinkBERT: Pretraining language models with document links. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 8003-8016, Dublin, Ireland. Association for Computational Linguistics. + +Hui-Syuan Yeh, Thomas Lavergne, and Pierre Zweigenbaum. 2022. Decorate the examples: A + +simple method of prompt design for biomedical relation extraction. In Proceedings of the Language Resources and Evaluation Conference, pages 3780-3787, Marseille, France. European Language Resources Association. + +Wenpeng Yin, Nazneen Fatema Rajani, Dragomir Radev, Richard Socher, and Caiming Xiong. 2020. Universal natural language processing with limited annotations: Try few-shot textual entailment as a start. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 8229-8239, Online. Association for Computational Linguistics. + +Zheng Yuan, Yijia Liu, Chuanqi Tan, Songfang Huang, and Fei Huang. 2021. Improving biomedical pretrained language models with knowledge. In Proceedings of the 20th Workshop on Biomedical Language Processing, pages 180-190, Online. Association for Computational Linguistics. + +Wenzheng Zhang and Karl Stratos. 2021. Understanding hard negatives in noise contrastive estimation. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 1090-1101, Online. Association for Computational Linguistics. + +Wenxuan Zhou and Muhao Chen. 2022. An improved baseline for sentence-level relation extraction. In Proceedings of the 2nd Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics and the 12th International Joint Conference on Natural Language Processing (Volume 2: Short Papers), pages 161-168, Online only. Association for Computational Linguistics. + +Wenxuan Zhou, Kevin Huang, Tengyu Ma, and Jing Huang. 2021. Document-level relation extraction with adaptive thresholding and localized context pooling. In Proceedings of the AAAI conference on artificial intelligence, volume 35, pages 14612-14620. + +# Appendices + +# A Models + +Baselines We categorize compared baselines by the pretrain corpus. + +- PubMed abstracts: BioM-ELECTRA (Alrowili and Vijay-Shanker, 2021). +- PubMed abstracts and PMC full-text articles: Bio-BERT (Lee et al., 2020); BioM-BERT (Alrowili and Vijay-Shanker, 2021); BioMegaatron (Shin et al., 2020) pretrain on commercial-collection subset of PMC; PubMed-BERT (Tinn et al., 2021) fine-tune model released by Gu et al. (2021), which is pretrain on those corpus; + +
NameRelationsEntity MaskTrainDevTest# relations
ChemProt (Krallinger et al., 2017)chemical-gene@CHEMICAL$ @GENE$1830511268157455
DDI (Herrero-Zazo et al., 2013)drug-drug@DRUG$25296249657164
GAD (Bravo et al., 2015)disease-gene@DISEASE$ @GENE$42615355342
+ +Sci-Five (Phan et al., 2021) is T5 based model that learns to conditionally generate relation labels in textual form directly; BioLinkBERT (Yasunaga et al., 2022) further proposes a pretraining task of link prediction, which enables the model to learn multi-hop knowledge. + +- PubMed abstracts and MIMIC-III clinical notes: BLUE-BERT (Peng et al., 2019). +- Semantic Scholar: Sci-BERT (Beltagy et al., 2019) pretrain BERT on scientific corpus consists of 1.14M full-text papers from Semantic Scholar; BioRE-Prompt (Yeh et al., 2022) initializes from RoBERTa trained on the Semantic Scholar and learns a three-token prompt for each relation and infers by finding the best matching prompt. + +We use model checkpoints released by huggingface (Wolf et al., 2020). Specifically, we use bionlp/bluebert_pubmed_mimic_uncased_L-24_H1024_A-16 for BLUE-BERT (Peng et al., 2019), allenai/scibert_scivocab_uncased for Sci-BERT (Beltagy et al., 2019), dmis-lab/biobert-basecased-v1.2 for BioBERT (Lee et al., 2020), microsoft/BiomedNLP-PubMedBERT-base-uncased-abstract-fulltext for PubMed-BERT (Tinn et al., 2021), razent/SciFive-large-Pubmed_PMC for Sci-Five (Phan et al., 2021), sultan/BioM-ALBERT-xxlarge-PMC for BioM-ALBERT (Alrowili and Vijay-Shanker, 2021), sultan/BioM-BERT-PubMed-PMC-Large for BioM-BERT (Alrowili and Vijay-Shanker, 2021), michiyasunaga/BioLinkBERT-large for BioLink-BERT (Yasunaga et al., 2022), and cnut1648/biolinkbert-large-mnli-snli for BioLink-BERT that is fine-tuned on SNLI (Bowman et al., 2015) and MNLI (Williams et al., 2018). + +NBR We run experiments on Quadro RTX 8000 GPU. AdamW optimizer (Loshchilov and Hutter, 2019) with learning rate 1e-5 is used, and we set margin $\gamma = 0.7$ , temperature $\tau = 0.01$ and calibration (Eq. 2) strength $\lambda$ in sweep from 0.001 to 10. We train models for 300 epochs. Models are + +evaluated every ten epochs on the dev set, and the best checkpoint is selected to infer on the test set. + +# B Evaluation Difference + +As mentioned in §4, several previous works use a different evaluation metric and variants of the datasets, rendering it hard to compare with previous work. In this section, we describe the main differences in the dataset. We first report the statistics of the dataset we use in this work in Tab. 5. For other works that use variants of the datasets: + +- BLUE-BERT (Peng et al., 2019)'s variant of ChemProt and DDI. Their ChemProt contains 4,154/2,416/3458 train/val/test instances and five relations, while their DDI contains 2,937/1,004/979 train/val/test instances and four relations. +Sci-BERT (Beltagy et al., 2019) uses a variant of ChemProt with 4,169/2,427/3,449 train/val/test instances and contains 13 relations. +- Dong et al. (2021) and (Peng et al., 2020) use a variant of ChemProt with 4,168/2,427/3,469 train/val/test instances and 13 relations. +Xu et al. (2022) use a variant of ChemProt with 14 relations +BioRE-Prompt (Yeh et al., 2022) also use ChemProt provided by Gu et al. (2021), but does not exclude abstinent instances. + +# C EAD Details and Variants + +Table 5: Dataset Statistics. # relations does not include $\bot$ . GAD does not contain abstinent instances. + +
HeuristicChemProt
Simple81.10
Voting80.73
Confident80.96
Super-confident80.66
Classification80.78
+ +Table 6: $\mathrm{NBR}_{\mathrm{NLI} + \mathrm{FT}} + \mathrm{EAD}$ performance on ChemProt under various heuristics. + +Since only relations for EAD is "has relation" versus "no relation", instead of Eq. 1 and Eq. 2 used in NBR, EAD learns only via ranking loss $\ell_{\mathrm{rank}}(s(y), s(y'); \gamma)$ where $y$ is the ground-truth while $y'$ is the opposite relation. + +We discuss several heuristics in assembling NBR and EAD. The best performing heuristic is simple: only resort to NBR when EAD prediction is not $\perp$ . In other words, the final prediction is $\perp$ only if EAD prediction is $\perp$ ; otherwise, return the prediction of NBR. We evaluate other more sophisticated heuristics: + +- Voting: Predict $\perp$ only when both NBR and EAD predict $\perp$ ; otherwise, return NBR's prediction. +- Confident: Predict $\perp$ only when EAD predicts $\perp$ and confidence score $s_{\mathrm{EAD}}(\perp)$ is higher than confidence score $s_{\mathrm{NBR}}(\perp)$ ; otherwise, return NBR's prediction. Note that if EAD makes a false positive, NBR is still able to recover if $s_{\mathrm{NBR}}(\perp)$ is the highest. +- Super-confident: Predict $\perp$ when EAD predicts $\perp$ ; if $s_{\mathrm{EAD}}(\perp) > s_{\mathrm{NBR}}(\perp)$ return highest-scored non-abstinent relation $\arg \max_{y \in \mathcal{Y}} s_{\mathrm{NBR}}(y)$ ; otherwise prediction of NBR. +- Classification: Use a classification-based model (with the same backbone as $\mathrm{NBR}_{\mathrm{NLI + FT}}$ ), and use logits for confidence score under the simple heuristic. + +In Tab. 6, we observe that a more complicated heuristic does not entail better performance gains. Note that designing a contextual description for "has relation" is challenging and our template is a simple phrase such as "relation exists between." Surprisingly, we still found assembling NBR with EAD empirically outperforms classification-based abstention detector. We credit enhanced performance to additional semantic information captured by the verbalized template. + +
TemplateChemProtDDI
1%100%1%100%
Descriptive60.1780.5460.2084.66
Simple63.8079.8455.3883.26
Demonstration48.7279.8845.8183.46
Descriptive + Demonstration53.3979.7949.7883.45
Learned Prompt59.4579.74--
+ +Table 7: Ablation study of $\mathrm{NBR}_{\mathrm{NLI} + \mathrm{FT}}$ using different templates. Micro F1 is reported. Yeh et al. (2022) only reports results on ChemProt. + +# D Template for datasets + +We provide details for each of the templates investigated in this work. + +1. Simple Template: This template verbalizes the relation between two entities as a “is-a” phrase, e.g. “@CHEMICAL$ is a downregulator to @GENE$. +2. Descriptive Template: We manually curate a description for each relation that contains more context, e.g. "Downregulator @CHEMICAL$ is designed as an inhibitor of @GENE$. +3. Demonstration Template: Motivated by few-shot exemplars used for in-context learning, the demonstration template includes a randomly sampled context sentence whose entities hold the same relation, e.g. "Relation described between @CHEMICAL$ to @GENES is similar to . +4. Descriptive + Demonstration: We include both a contextual description and an incontext exemplar by simple concatenating. +5. Learned Prompt Template: Borrowed from Yeh et al. (2022), which leverage prompt tuning with rules (Han et al., 2022) to learn optimal discrete tokens to fill in [MASK] within the template such as "@CHEMICAL$ [MASK] [MASK] [MASK] @GENE$. + +We further provide templates for NBR on three datasets: ChemProt (Tab. 10), DDI (Tab. 9) and GAD (Tab. 8). + +Lastly, Tab. 7 shows the effect of template design. The descriptive template, which involves manual efforts, leads to the best performance. The simple template preserves the relation name semantics and yields strong performance. On the other hand, while popular in in-context learning works, we find that the demonstration template or descriptive + demonstration template consistently underperforms the descriptive template, indicating that incorporating examples in NLI hypothesis is not helpful potentially due to limited diversity. The learned prompt template used by Yeh et al. (2022) does not outperform the manually constructed descriptive template. Finally, we note that changing templates can lead to significant performance perturbations, our experiments suggest that evaluating the quality of templates in low-resource settings such as $1\%$ can be effective and efficient. We note that the contextual template might not be optimal and we leave how to automatically pick the optimal template as future work. + +Relation | Verbalized Hypothesis + +
0There is no relation between @GENE$ and @DISEASE$.
1@GENE$ and @DISEASE$ are correlated.
+ +Table 8: Descriptive templates on GAD. + +
RelationVerbalized Hypothesis
Simple0 (no relation)@DRUG$ and @DRUG$ are not interacting.
DDI-adviseInteraction described bewteen two @DRUG$ and @DRUG$ is about advise.
DDI-effectInteraction described bewteen two @DRUG$ and @DRUG$ is about effect.
DDI-intInteraction described bewteen two @DRUG$ and @DRUG$ might or maybe occur.
DDI-mechanismInteraction described bewteen two @DRUG$ and @DRUG$ is about mechanism.
DescriptiveDDI-adviseA recommendation or advice regarding two @DRUG$ is described.
DDI-effectMedical effect regarding two @DRUG$ is described.
DDI-intInteraction regarding two @DRUG$ might or maybe occur.
DDI-mechanismPharmacokinetic mechanism regarding two @DRUG$ is described.
DemonstrationDDI-adviseThe interaction between two @DRUG$ is the same as “perhexiline hydrogen maleate or @DRUG$ (with hepatotoxic potential) must not be administered together with @DRUG$ or Bezalip retard.”
DDI-effectThe interaction between two @DRUG$ is the same as “@DRUG$ administered concurrently with @DRUG$ reduced the urine volume in 4 healthy volunteers.”
DDI-intInteraction between two @DRUG$ is the same as @DRUG$ may interact with @DRUG$, butyrophenones, and certain other agents.”
DDI-mechanismThe interaction between two @DRUG$ is the same as @DRUG$, enflurane, and halothane decrease the ED50 of @DRUG$ by 30% to 45%.”
Descriptive + DemonstrationDDI-adviseA recommendation or advice regarding two @DRUG$ is described, similar to “perhexiline hydrogen maleate or @DRUG$ (with hepatotoxic potential) must not be administered together with @DRUG$ or Bezalip retard.”
DDI-effectMedical effect regarding two @DRUG$ is described, similar to "@DRUG$administeredconcurrentlywith@DRUG reduced the urine volume in 4 healthy volunteers."
DDI-intInteraction regarding two @DRUG$ might or maybe occur, similar to @DRUG$ may interact with @DRUG$, butyrophenones, and certain other agents.”
DDI-mechanismPharmacokinetic mechanism regarding two @DRUG$ is described, similar to "@DRUG$, enflurane, and halothane decrease the ED50 of @DRUG$ by 30% to 45%.”
+ +Table 9: Each variant of templates on DDI. Cyan sentence is an example from the train set. + +
RelationVerbalized Hypothesis
0 (no relation)@CHEMICAL$ and @GENE$ have no relation.
SimpleCPR:3@CHEMICAL$ is a upregulator to @GENE$.
CPR:4@CHEMICAL$ is a downregulator to @GENE$.
CPR:5@CHEMICAL$ is a agonist to @GENE$.
CPR:6@CHEMICAL$ is a antagonist to @GENE$.
CPR:9@CHEMICAL$ is a substrate to @GENE$.
DescriptiveCPR:3Upregulator @CHEMICAL$ is activated by @GENE$.
CPR:4Downregulator @CHEMICAL$ is designed as an inhibitor of @GENE$.
CPR:5Activity of agonist @CHEMICAL$ is mediated by @GENE$.
CPR:6@CHEMICAL$ is identified as an antagonist of @GENE$.
CPR:9@CHEMICAL$ is a substrate for @GENE$.
DemonstrationCPR:3Relation of @CHEMICAL$ to @GENE$ is similar to relation described in “@CHEMICAL$ selectively induced @GENE$ in four studied HCC cell lines.”
CPR:4Relation of @CHEMICAL$ to @GENE$ is similar to relation described in “@CHEMICAL$, a new @GENE$ inhibitor for the management of obesity.”
CPR:5Relation of @CHEMICAL$ to @GENE$ is similar to relation described in “Pharmacology of @CHEMICAL$, a selective @GENE$/MT2 receptor agonist: a novel therapeutic drug for sleep disorders.”
CPR:6Relation of @CHEMICAL$ to @GENE$ is similar to relation described in “@CHEMICAL$ is an @GENE$ antagonist that is metabolized primarily by glucuronidation but also undergoes oxidative metabolism by CYP3A4.”
CPR:9Relation of @CHEMICAL$ to @GENE$ is similar to relation described in “For determination of [@GENE$+Pli]-activity, @CHEMICAL$ was added after this incubation.”
Descriptive + DemonstrationCPR:3Upregulator @CHEMICAL$ is activated by @GENE$, similar to relation described in “@CHEMICAL$ selectively induced @GENE$ in four studied HCC cell lines.”
CPR:4Downregulator @CHEMICAL$ is designed as an inhibitor of @GENE$, similar to relation described in “@CHEMICAL$, a new @GENE$ inhibitor for the management of obesity.”
CPR:5Activity of agonist @CHEMICAL$ is mediated by @GENE$, similar to relation described in “Pharmacology of @CHEMICAL$, a selective @GENE$/MT2 receptor agonist: a novel therapeutic drug for sleep disorders.”
CPR:6@CHEMICAL$ is identified as an antagonist of @GENE$, similar to relation described in “@CHEMICAL$ is an @GENE$ antagonist that is metabolized primarily by glucuronidation but also undergoes oxidative metabolism by CYP3A4.”
CPR:9CHEMICAL$ is a substrate for @GENE$, similar to relation described in “For determination of [@GENE$+Pli]-activity, @CHEMICAL$ was added after this incubation.”
Learned PropmtCPR:3@CHEMICAL$ is activated by @GENE$.
CPR:4@CHEMICAL$ activity inhibited by @GENE$.
CPR:5@CHEMICAL$ agonist actions of @GENE$.
CPR:6@CHEMICAL$ identified are antagonists @GENE$.
CPR:9@CHEMICAL$ is substrate for @GENE$.
+ +Table 10: Each variant of templates on ChemProt. Cyan sentence is an example from the train set. + +A For every submission: + +A1. Did you describe the limitations of your work? + +No section number, after Section 5 Conclusion + +A2. Did you discuss any potential risks of your work? + +We do not see significant risks in our work + +A3. Do the abstract and introduction summarize the paper's main claims? + +Abstract before Section 1 Introduction + +A4. Have you used AI writing assistants when working on this paper? + +Left blank. + +B Did you use or create scientific artifacts? + +Section 4 Experiments + +B1. Did you cite the creators of artifacts you used? + +Section 4 Experiments + +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? + +Section 4 Experiments + +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +Section 4 Experiments and Appendix B Evaluation Difference + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? + +We refer readers who interested in those information to the original paper + +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? + +We refer readers who interested in those information to the original paper + +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. + +Table 5 + +C Did you run computational experiments? + +Section 4 Experiments + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +Appendix A Models + +The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +Section 4 Experiments and Appendix A Models + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +Section 4 Experiments + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +Section 4 Experiments + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +No response. + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +No response. + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +No response. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +No response. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +No response. \ No newline at end of file diff --git a/cannliprovideproperindirectsupervisionforlowresourcebiomedicalrelationextraction/images.zip b/cannliprovideproperindirectsupervisionforlowresourcebiomedicalrelationextraction/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..5d59ddede1a9ae4b4ee7418b031d2387ca02427c --- /dev/null +++ b/cannliprovideproperindirectsupervisionforlowresourcebiomedicalrelationextraction/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:970e433aa54fadb24d125b0c00aacbd597012d78be9acdb5fad8ff0f4657957b +size 1229364 diff --git a/cannliprovideproperindirectsupervisionforlowresourcebiomedicalrelationextraction/layout.json b/cannliprovideproperindirectsupervisionforlowresourcebiomedicalrelationextraction/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..e038c41ceda333691a2b81425766e8da7dadba01 --- /dev/null +++ b/cannliprovideproperindirectsupervisionforlowresourcebiomedicalrelationextraction/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:13e26e77abbcc891b8a0d0bbaa83dd624ee9fd2e0f069a381a1077862be8f904 +size 531906 diff --git a/casealigningcoarsetofinecognitionandaffectionforempatheticresponsegeneration/db50fc96-a292-464b-ae6b-cd4c83e2c1ac_content_list.json b/casealigningcoarsetofinecognitionandaffectionforempatheticresponsegeneration/db50fc96-a292-464b-ae6b-cd4c83e2c1ac_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..1b7c8d797fa2ae2c0fd1b7fe778a48626d688409 --- /dev/null +++ b/casealigningcoarsetofinecognitionandaffectionforempatheticresponsegeneration/db50fc96-a292-464b-ae6b-cd4c83e2c1ac_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f7a55abf099058a0ff734f944c4689819a632253ebb2bfdbee0b1e6c252996a +size 108406 diff --git a/casealigningcoarsetofinecognitionandaffectionforempatheticresponsegeneration/db50fc96-a292-464b-ae6b-cd4c83e2c1ac_model.json b/casealigningcoarsetofinecognitionandaffectionforempatheticresponsegeneration/db50fc96-a292-464b-ae6b-cd4c83e2c1ac_model.json new file mode 100644 index 0000000000000000000000000000000000000000..ded88ddcac47d3f9e1d56947eb73bd8fe261bb22 --- /dev/null +++ b/casealigningcoarsetofinecognitionandaffectionforempatheticresponsegeneration/db50fc96-a292-464b-ae6b-cd4c83e2c1ac_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:02fab62717a6dc1d5b40450c8f008e39266df70835fdf245651f96fd57c03053 +size 129997 diff --git a/casealigningcoarsetofinecognitionandaffectionforempatheticresponsegeneration/db50fc96-a292-464b-ae6b-cd4c83e2c1ac_origin.pdf b/casealigningcoarsetofinecognitionandaffectionforempatheticresponsegeneration/db50fc96-a292-464b-ae6b-cd4c83e2c1ac_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..bb66777d3c13716f259b17d5d98baca0e79cd448 --- /dev/null +++ b/casealigningcoarsetofinecognitionandaffectionforempatheticresponsegeneration/db50fc96-a292-464b-ae6b-cd4c83e2c1ac_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5d76f1053de35f34810912b2bbeebebd946c9bf0ad8814ce897cf9ce7069be0b +size 528361 diff --git a/casealigningcoarsetofinecognitionandaffectionforempatheticresponsegeneration/full.md b/casealigningcoarsetofinecognitionandaffectionforempatheticresponsegeneration/full.md new file mode 100644 index 0000000000000000000000000000000000000000..72aa89d57dddae939efd1eede301d4233461eff2 --- /dev/null +++ b/casealigningcoarsetofinecognitionandaffectionforempatheticresponsegeneration/full.md @@ -0,0 +1,485 @@ +# CASE: Aligning Coarse-to-Fine Cognition and Affection for Empathetic Response Generation + +Jinfeng Zhou $^{1,2*}$ † Chujie Zheng $^{1}$ † Bo Wang $^{2}$ ‡ Zheng Zhang $^{1}$ Minlie Huang $^{1}$ + +$^{1}$ The CoAI Group, DCST, Institute for Artificial Intelligence, State Key Lab of Intelligent Technology and Systems, $^{1}$ Beijing National Research Center for Information Science and Technology, Tsinghua University, Beijing 100084, China $^{2}$ College of Intelligence and Computing, Tianjin University, Tianjin, China + +{jfzhou.mail, chujiezhengchn, zhangz.goal}@gmail.com, bo_wang@tju.edu.cn, aihuang@tsinghua.edu.cn + +# Abstract + +Empathetic conversation is psychologically supposed to be the result of conscious alignment and interaction between the cognition and affection of empathy. However, existing empathetic dialogue models usually consider only the affective aspect or treat cognition and affection in isolation, which limits the capability of empathetic response generation. In this work, we propose the CASE model for empathetic dialogue generation. It first builds upon a commonsense cognition graph and an emotional concept graph and then aligns the user's cognition and affection at both the coarse-grained and fine-grained levels. Through automatic and manual evaluation, we demonstrate that CASE outperforms state-of-the-art baselines of empathetic dialogues and can generate more empathetic and informative responses. + +# 1 Introduction + +Human empathetic conversations allow both parties to understand each other's experiences and feelings (Keskin, 2014), which is crucial for establishing seamless relationships (Zech and Rimé, 2005) and is also integral to building a trustful conversational AI (Huang et al., 2020; Wang et al., 2021). + +In social psychology, empathy consists of two aspects: cognition and affection (Davis, 1983). The cognitive aspect corresponding to the understanding of the user's situation and experiences (Cuff et al., 2016). The affective aspect requires the comprehension of the user's emotional state and his/her potential emotional reaction (Elliott et al., 2018). Although existing work of empathetic dialogue involves both aspects of empathy, there are still issues that need to be addressed. First, most work (Rashkin et al., 2019; Lin et al., 2019; Majumder + +![](images/d2bfcf988b289e043b41c5a1e875181e65f59871c2c262fbea2cdbd4c09f98c2.jpg) +Figure 1: Examples from the EMPATHETICDIALOGUES dataset. The alignment of cognition and affection (i.e., emotional state and emotional reaction) leads to highly empathetic and informative expression in responses. + +et al., 2020; Li et al., 2020, 2022) considers only the affective aspect, like detecting the user's emotional state to enhance empathy expression. Second, although recent work explored both roles of cognition and affection in empathy expression (Zheng et al., 2021a; Sabour et al., 2022), they usually treat cognition and affection in isolation without considering their relationship. + +However, human empathetic responses often result from conscious alignment and interaction between cognition and affection of empathy (Westbrook et al., 2011). For one thing, the user's overall emotional state manifested in the context suggests the user's attitude toward current situation (i.e., cognition). Thus, for the listener, aligning the user's expressed cognition to the proper emotional state is essential for an appropriate empathetic response. As in case-1 of Figure 1, the alignment of cognition (i.e., intent "to go to the beach") with different emo + +tional states (i.e., “excited” vs. “disappointed”) produces different appropriate empathetic expressions (i.e., “love” and “which beach are you going to go to” vs. “hate” and “waiting for the beach”), respectively. For another, the user’s situation drives the listener to infer the deeper specific cognitions and associate them with the underlying emotional reactions. In this way, the listener can produce a more actively empathetic response instead of only understanding and repeating the user’s expressed cognition. As in case-2 of Figure 1, building association between inferred cognitions and emotional reactions, i.e., “to give up” and “frustrated” vs. “to try harder” and “hopeful”, yields cognitively distinct but highly empathetic responses, i.e., response-2a vs. response-2b. The two cases highlight the necessity of aligning cognition and affection on both overall and specific (i.e., coarse and fine-grained) level for empathy modeling in response generation. + +To this end, we align Cognition and Affection for reSponding Empathetically (CASE) on coarse and fine-grained levels by fusing sentence-level commonsense knowledge from COMET (Bosselut et al., 2019) and word-level concept knowledge from ConceptNet (Speer et al., 2017). Commonsense knowledge infers the user's situation as cognition and infers emotional reactions to the situation, which are implied in the dialogue. Concept knowledge serves to extract the emotional state manifested in the dialogue. For encoding the two types of knowledge, we first construct commonsense cognition graph and emotional concept graph, where the initial independent representation of cognition and emotional concept is carefully adjusted by dialogue context adopting graph transformers. Then, we design a two-level strategy to align cognition and affection using mutual information maximization (MIM) (Appendix A) (Hjelm et al., 2019). The coarse-grained level considers overall cognition and affection manifested in the dialogue context to align contextual cognition and contextual emotional state, which are extracted with a knowledge discernment mechanism. The fine-grained level builds the fine-grained association between cognition and affection implied in the dialogue to align each specific cognition and corresponding emotional reaction. Further, an empathy-aware decoder is devised for generating empathetic expressions. + +# Our contributions are summarized as follows: + +(1) We devise a unified framework to model the interaction between cognition and affection for in + +tegrated empathetic response generation. + +(2) We construct two heterogeneous graphs involving commonsense and concept knowledge to aid in the modeling of cognition and affection. +(3) We propose a two-level strategy to align coarse-grained and fine-grained cognition and affection adopting mutual information maximization. +(4) Extensive experiments demonstrate the superior of CASE in automatic and manual evaluation. + +# 2 Related Work + +# 2.1 Emotional & Empathetic Conversation + +Emotional conversation gives the manually specified label preset as the emotion generated in the response (Zhou et al., 2018; Wei et al., 2019; Peng et al., 2022). Instead of giving a predefined emotion label, empathetic conversation (Chen et al., 2022; Kim et al., 2022) involves cognitive and affective empathy (Davis, 1983) and aims to fully understand the interlocutor's situation and feelings and respond empathically (Keskin, 2014; Zheng et al., 2021b). For one thing, most existing works only focus on the affective aspect of empathy and make efforts to detect contextual emotion (Rashkin et al., 2019; Lin et al., 2019; Majumder et al., 2020; Li et al., 2020, 2022) while ignoring the cognitive aspect. For another, some research utilizes commonsense as cognition to refine empathetic considerations (Sabour et al., 2022). However, the relatively independent modeling between the two aspects (i.e., cognition and affection) violates their interrelated characteristics. + +# 2.2 Commonsense & Concept Knowledge + +As a commonsense knowledge base, ATOMIC (Sap et al., 2019) focuses on inferential knowledge organized as typed if-then relations. Six commonsense reasoning relations are defined for the person involved in an event, four of which are used to reason commonsense cognitions of a given event, i.e., PersonX's intent before the event (xIntent), what PersonX need to do before the event (xNeed), what PersonX want after the event (xWant), and the effect of the event on PersonX (xEffect). Each commonsense cognition is aligned with user's emotional reaction to the situation implied in the dialogue inferred by xReact (i.e., PersonX's reaction to the event) in our approach. To obtain inferential commonsense knowledge, we use COMET (Bosselut et al., 2019), a pretrained generative model, to generate rich commonsense statements. + +![](images/bb2a5ef74631466be87efbe8ec68c31a8f67397d805d64f6d2346f286080621e.jpg) +Figure 2: The architecture of the proposed CASE model. + +Unlike commonsense knowledge that provides sentence-level commonsense expression, we adopt ConceptNet (Speer et al., 2017) as concept knowledge, which provides word-level human knowledge and is widely used in various NLP tasks (Zhang et al., 2020; Zhong et al., 2021; Zhou et al., 2021; Yang et al., 2022). Following Li et al. (2022), we use NRC_VAD (Mohammad, 2018) to assign emotion intensity to concepts in ConceptNet (processing details are in Li et al. (2022)) severed to extract the contextual emotional state manifested in the context, and align it with contextual cognition. + +# 3 Approach + +CASE framework is in Fig. 2. The dialogue context $X = [x_{1},\ldots ,x_{N}]$ contains $N$ utterances, where $x_{i}$ denotes the $i$ -th utterance. CASE contains three stages: (1) The graph encoding stage constructs and encodes heterogeneous commonsense cognition graph $\mathcal{G}_{CS}$ and emotional concept graph $\mathcal{G}_{EC}$ from the dialogue context $X$ . (2) The coarse-to-fine alignment aligns coarse-grained (between contextual cognition and contextual emotional state) and fine-grained (between each specific cognition and corresponding emotional reaction) cognition and affection adopting MIM. (3) The empathy-aware decoder integrates the aligned cognition and affection to generate the response $Y = [y_{1},y_{2},\dots ,y_{M}]$ with empathetic and informative expressions. + +# 3.1 Graph Encoding + +Commonsense Cognition Graph Construction Given the last utterance $x_{N}$ of the dialogue context $X$ , we segment it into the sub-utterances + +$U = [u_{0}, u_{1}, u_{2}, \ldots, u_{t}]$ , where we prepend the whole $x_{N}$ as $u_{0}$ for maintaining the global information of $x_{N}$ . We use COMET to infer $l$ commonsense cognition knowledge $K_{i}^{r} = [k_{i,1}^{r}, k_{i,2}^{r}, \ldots, k_{i,l}^{r}]$ for each $u_{i} \in U$ , where $r$ is one of the four commonsense relations $\mathcal{R} = \{\mathrm{xIntent}, \mathrm{xNeed}, \mathrm{xWant}, \mathrm{xEffect}\}$ , similar to Sabour et al. (2022). The idea is that human responses tend to inherit the above and transfer the topic. There are differences in the topic and connotation of different sub-utterances affecting the listeners' concerns when responding empathetically. + +For constructing the heterogeneous commonsense cognition graph $\mathcal{G}_{CS}$ , we use the utterance set $U$ and the commonsense cognition knowledge set $K_{CS} = \bigcup_{i=0}^{t} \bigcup_{r \in \mathcal{R}} K_{i}^{r}$ as vertices, i.e., vertex set $V_{CS} = U \cup K_{CS}$ . There are seven relations of undirected edges that connect vertices. (1) The self-loop relation for each vertex $v_{i}^{CS} \in V_{CS}$ . (2) The global relation between the whole $x_{N}$ (i.e., $u_{0}$ ) and its sub-utterances $u_{i} (i \geq 1)$ . (3) The temporary relation between any two successive sub-utterances $u_{j}$ and $u_{j+1}$ . (4) The four commonsense relations, i.e., xIntent, xNeed, xWant, xEffect, between the utterance $u_{i} \in U$ and the corresponding $K_{i}^{r}$ . + +We use a Transformer-based sentence encoder (cognition encoder) to first encode the vertices $V_{CS}$ of the graph $\mathcal{G}_{CS}$ . For each $v_i^{CS} \in V_{CS}$ , we prepend with a special token [CLS]. Following Devlin et al. (2019), we collect the [CLS] representation as the initial embedding matrix for $\mathcal{G}_{CS}$ . + +Emotional Concept Graph Construction We concatenate the utterances in the dialogue context $X$ to obtain the token set $T$ , i.e., $T = x_{1} \oplus \ldots \oplus$ + +$x_{N} = [w_{1},\dots ,w_{n}]$ , where $n$ is the number of all the tokens in the utterances in $X$ . Following Li et al. (2022), we use ConceptNet to infer the related concepts for each token $w_{i}\in T$ , among which only the top $N^{\prime}$ emotional concepts (according to the emotion intensity $\omega (c))$ are used for constructing $\mathcal{G}_{EC}$ . Subsequently, the vertices $V_{EC}$ in the heterogeneous emotional concept graph $\mathcal{G}_{EC}$ contains a [CLS] token, the dialogue context tokens $T$ and the above obtained emotional concepts. There are four relations of undirected edges that connect vertices. (1) The self-loop relation for each vertex $v_{i}^{EC}\in V_{EC}$ . (2) The global relation between the [CLS] token and other ones. (3) The temporary relation between any two successive tokens. (4) The emotional concept relation among a token and its related emotional concepts. + +We initialize the vertex embedding for $\mathcal{G}_{EC}$ by summing up the token embedding, the positional embedding, and the type embedding for each vertex (signaling whether it is a emotional concept or not). + +Graph Encoder Given the commonsense cognition graph $\mathcal{G}_{CS}$ , to capture the semantic relationship between vertices, we adopt the Relation-Enhanced Graph Transformer (Li et al., 2021) for graph encoding. It employs a relation-enhanced multi-head attention mechanism (MHA) to encode vertex embedding $\hat{\pmb{v}}_{\pmb{v}_i}$ for vertex $v_i$ (we omit the superscripts $CS$ for simplicity) as: + +$$ +\hat {\boldsymbol {v}} _ {v _ {i}} = M H A _ {v _ {k} \in V _ {C S}} \left(\boldsymbol {q} _ {v _ {i}}, \boldsymbol {k} _ {v _ {k}}, \boldsymbol {v} _ {v _ {k}}\right), \tag {1} +$$ + +where the semantic relations between vertices are injected into the query and key vectors: + +$$ +\boldsymbol {q} _ {v _ {i}} = \boldsymbol {v} _ {v _ {i}} + \boldsymbol {l} _ {v _ {i} \rightarrow v _ {k}}, \boldsymbol {k} _ {v _ {k}} = \boldsymbol {v} _ {v _ {k}} + \boldsymbol {l} _ {v _ {k} \rightarrow v _ {i}}, \tag {2} +$$ + +where $l_{v_i \to v_k}$ and $l_{v_k \to v_i}$ are learnable relation embeddings between vertices $v_i$ and $v_k$ . The self-attention is subsequently followed by a residual connection and a feed-forward layer, as done in the standard Transformer encoder (Vaswani et al., 2017). Finally, we obtain the commonsense cognition embedding $c s_i$ for each $v_i^{CS} \in V_{CS}$ . + +To encode the emotional concept graph $\mathcal{G}_{EC}$ , we adopt a vanilla Graph Transformer (i.e., omitting the relation enhancement part in the above Graph Transformer). By superimposing the emotion intensity of each token, we obtain the emotional concept embedding $\pmb{e}\pmb{c}_i$ for each $v_{i}^{EC}\in V_{EC}$ + +# 3.2 Coarse-to-Fine Alignment + +Context Encoding Following previous works (Majumder et al., 2020; Sabour et al., 2022), we + +concatenate all the utterances in the dialogue context $X$ and pretend with a [CLS] token: $[CLS]\oplus x_{1}\oplus \ldots \oplus x_{N}$ . This sequence is fed into a standard Transformer encoder (context encoder) to obtain the representation $S_{X}$ of the dialogue context. We denote the representation of [CLS] as $s_X$ . + +Coarse-grained Alignment To reproduce the interaction of cognition and affection manifested in the dialogue context, we align contextual cognition and contextual emotional state at an overall level. They are separately acquired by cognitive and emotional knowledge discernment mechanisms, which select golden-like knowledge guided by response. + +To obtain the contextual cognitive representation $\pmb{r}_{\text{cog}}$ , the knowledge discernment calculates the prior cognitive distribution $P_{CS}(\pmb{cs}_i \mid X)$ over the commonsense cognition knowledge (that is, only $K_{CS}$ rather than all the vertices $V_{CS}$ in $\mathcal{G}_{CS}$ , and we thus use $1 \leq i \leq |K_{CS}|$ for simplicity): + +$$ +\boldsymbol {r} _ {\text {c o g}} = \sum_ {i = 1} ^ {| K _ {C S} |} P _ {C S} (\boldsymbol {c s} _ {i} \mid X) \cdot \boldsymbol {c s} _ {i}, \tag {3} +$$ + +$$ +P _ {C S} \left(\boldsymbol {c} \boldsymbol {s} _ {i} \mid X\right) = \operatorname {s o f t m a x} _ {i} \left(\boldsymbol {c} \boldsymbol {s} _ {i} ^ {T} \varphi_ {C S} \left(\boldsymbol {s} _ {X}\right)\right), (4) +$$ + +where $\varphi_{CS}(\cdot)$ is a MLP layer activated by tanh. Similarly, we calculate the prior emotional distribution $P_{EC}(ec_i\mid X)$ $(1\leq i\leq |V_{EC}|)$ and obtain the contextual emotional representation $\pmb{r}_{emo}$ . + +During training, we use the ground truth response $Y$ to guide the learning of knowledge discernment mechanisms. We feed $Y$ into the cognition encoder (used for initializing the embeddings of $\mathcal{G}_{CS}$ above) and the context encoder to get the hidden states $S_{Y}^{cog}$ and $S_{Y}^{ctx}$ , where the [CLS] representations are $s_{Y}^{ctx}$ and $s_{Y}^{cog}$ respectively. The posterior cognitive distribution $P_{CS}(cs_i \mid Y)$ and the emotional one $P_{EC}(ec_i \mid Y)$ are calculated as: + +$$ +P _ {C S} \left(\boldsymbol {c} \boldsymbol {s} _ {i} \mid Y\right) = \operatorname {s o f t m a x} _ {i} \left(\boldsymbol {c} \boldsymbol {s} _ {i} ^ {T} \boldsymbol {s} _ {Y} ^ {\text {c o g}}\right), \tag {5} +$$ + +$$ +P _ {E C} \left(\boldsymbol {e} \boldsymbol {c} _ {i} \mid Y\right) = \operatorname {s o f t m a x} _ {i} \left(\boldsymbol {e} \boldsymbol {c} _ {i} ^ {T} \boldsymbol {s} _ {Y} ^ {\text {c t x}}\right). \tag {6} +$$ + +We then optimize the KL divergence between the prior and posterior distributions during training: + +$$ +L _ {K L} = L _ {K L} ^ {C S} + L _ {K L} ^ {E C}, \tag {7} +$$ + +$$ +L _ {K L} ^ {C S} = \sum_ {i = 1} ^ {| K _ {C S} |} P _ {C S} (\boldsymbol {c s} _ {i} \mid Y) \cdot \log \frac {P _ {C S} (\boldsymbol {c s} _ {i} \mid Y)}{P _ {C S} (\boldsymbol {c s} _ {i} \mid X)}, +$$ + +$$ +L _ {K L} ^ {E C} = \sum_ {i = 1} ^ {| V _ {E C} |} P _ {C S} (\boldsymbol {e c} _ {i} \mid Y) \cdot \log \frac {P _ {E C} (\boldsymbol {e c} _ {i} \mid Y)}{P _ {E C} (\boldsymbol {e c} _ {i} \mid X)}. +$$ + +To further ensure the accuracy of discerned knowledge, similar to Bai et al. (2021), we employ the BOW loss to force the relevancy between cognitive / emotional knowledge and the target response. The BOW loss $L_{BOW}$ is defined as: + +$$ +L _ {B O W} = - \frac {1}{| B |} \sum_ {y _ {t} \in B} \log \eta \left(y _ {t} \mid \boldsymbol {r} _ {c o g} ^ {\prime}, \boldsymbol {r} _ {e m o} ^ {\prime}\right), \tag {8} +$$ + +where $\eta(\cdot)$ is a MLP layer followed by softmax and the output dimension is the vocabulary size, $B$ denotes the word bags of $Y$ , $r_{cog}' = \sum_{i=1}^{|K_{CS}|} P_{CS}(c s_i \mid Y) \cdot c s_i$ , and $r_{emo}' = \sum_{i=1}^{|V_{EC}|} P_{EC}(e c_i \mid Y) \cdot e c_i$ . + +Finally, we align the coarse-grained representations of the contextual cognition $\boldsymbol{r}_{cog}$ and the contextual emotional state $\boldsymbol{r}_{emo}$ using mutual information maximization (MIM). Specifically, we adopt the binary cross-entropy (BCE) loss $L_{coarse}$ as the mutual information estimator that maximizes the mutual information between $\boldsymbol{r}_{cog}$ and $\boldsymbol{r}_{emo}$ : + +$$ +\begin{array}{l} L _ {c o a r s e} = 2 f _ {c o a r s e} \left(\boldsymbol {r} _ {c o g}, \boldsymbol {r} _ {e m o}\right) \\ - \log \sum_ {\widetilde {\boldsymbol {r}} _ {e m o}} \exp (f _ {c o a r s e} (\boldsymbol {r} _ {c o g}, \widetilde {\boldsymbol {r}} _ {e m o})) \\ - \log \sum_ {\widetilde {\boldsymbol {r}} _ {c o g}} \exp (f _ {c o a r s e} (\widetilde {\boldsymbol {r}} _ {c o g}, \boldsymbol {r} _ {e m o})), (9) \\ \end{array} +$$ + +where $\widetilde{\boldsymbol{r}}_{emo}$ and $\widetilde{\boldsymbol{r}}_{cog}$ are the encoded negative samples. $f_{coarse}(\cdot ,\cdot)$ is a scoring function implemented with a bilinear layer activated by sigmoid function: + +$$ +f _ {\text {c o a r s e}} (\boldsymbol {a}, \boldsymbol {b}) = \sigma (\boldsymbol {a} ^ {T} \boldsymbol {W} _ {\text {c o a r s e}} \boldsymbol {b}). \tag {10} +$$ + +Fine-grained Alignment To simulate the interaction of fine-grained cognition and affection implied in the dialogue during human express empathy, the fine-grained alignment builds the fine-grained association between each inferred specific cognition and corresponding emotional reaction. + +For each $u_{i}\in U$ we infer the commonsense knowledge about emotional reaction $K_{i}^{\mathrm{xReact}} = \left[k_{i,1}^{\mathrm{xReact}},\dots ,k_{i,l}^{\mathrm{xReact}}\right]$ using COMET, which is regarded as the user's possible emotional reaction to the current cognitive situation. Since $k_{i,j}^{\mathrm{xReact}}\in K_i^{\mathrm{xReact}}$ is usually an emotion word (e.g., happy, sad), we concatenate $K_{i}^{\mathrm{xReact}}$ and feed it into the Transformer-based encoder (reaction encoder) to get the representation of the emotional reaction $H_{i}^{er}$ . Similar to (Majumder et al., 2020) and (Sabour et al., 2022), we use the average pooling to represent the reaction sequence, i.e., $h_i^{er} =$ + +Average $(\pmb{H}_i^{er})$ . To avoid over-alignment of out-of-context emotional reaction with cognition, we inject contextual information into the representation of reaction. We first connect $h_i^{er}$ with the context representation $S_{X}$ at the token level, i.e., $S_{i}^{er}[j] = S_{X}[j]\oplus h_{i}^{er}$ . Then another Transformer-based encoder takes $S_{i}^{er}$ as input and output the fused information $S_{i}^{er'}$ . We take the hidden representation of $[CLS]$ in $S_{i}^{er'}$ as the emotional reaction representation $er_{i}$ of $u_{i}$ . + +Finally, we build the association between the inferred specific cognition $\{\bigcup_{j = 1}^{l}\pmb{c}\pmb{s}_{i,j}^{r}\}$ from $u_{i}$ for $r\in \mathcal{R} = \{\mathrm{xIntent},\mathrm{xNeed},\mathrm{xWant},\mathrm{xEffect}\}$ and the emotional reaction $\pmb{er}_i$ using MIM. Recall that $\left\{\bigcup_{i = 0}^{t}\bigcup_{r\in \mathcal{R}}\bigcup_{j = 1}^{l}\pmb{c}\pmb{s}_{i,j}^{r}\right\}$ exactly correspond to the commonsense cognition knowledge set $K_{CS}$ . The fine-grained BCE Loss $L_{fine}$ is defined as: + +$$ +\begin{array}{l} L _ {f i n e} = \sum_ {i = 0} ^ {t} \sum_ {r \in \mathcal {R}} \sum_ {j = 1} ^ {l} \left[ 2 f _ {f i n e} \left(\boldsymbol {c s} _ {i, j} ^ {r}, \boldsymbol {e r} _ {i}\right) \right. \\ - \log \sum_ {\widetilde {e} \widetilde {r} _ {i}} \exp \left(f _ {f i n e} \left(\boldsymbol {c s} _ {i, j} ^ {r}, \widetilde {e r} _ {i}\right)\right) \\ \left. - \log \sum_ {\widetilde {\boldsymbol {c s}} _ {i, j} ^ {r}} \exp \left(f _ {f i n e} \left(\widetilde {\boldsymbol {c s}} _ {i, j} ^ {r}, \boldsymbol {e r} _ {i}\right)\right) \right], \tag {11} \\ \end{array} +$$ + +where $\widetilde{\boldsymbol{e}\boldsymbol{r}_i}$ and $\widetilde{\mathbf{c}}\widetilde{\mathbf{s}}_{i,j}^{r}$ are the encoded negative samples. $f_{fine}(\cdot ,\cdot)$ is implemented as: + +$$ +f _ {f i n e} (\boldsymbol {a}, \boldsymbol {b}) = \sigma (\boldsymbol {a} ^ {T} \boldsymbol {W} _ {f i n e} \boldsymbol {b}). \tag {12} +$$ + +Altogether, the coarse-to-fine alignment module can be jointly optimized by $L_{\text{align}}$ loss: + +$$ +L _ {\text {a l i g n}} = L _ {B O W} + L _ {K L} + L _ {\text {c o a r s e}} + \alpha L _ {\text {f i n e}}, \tag {13} +$$ + +where $\alpha$ is a hyper-parameter. + +Emotion Prediction We fuse the contextual emotional state and emotional reaction to distill the affective representation, where we use $er_0$ as the distillation signal of emotional reaction. This is because $er_0$ is derived from the speaker's last utterance and represents the overall emotional reaction. A gating mechanism is designed to capture affective representation $r_{aff}$ : + +$$ +\boldsymbol {r} _ {\text {a f f}} = \mu \cdot \boldsymbol {r} _ {\text {e m o}} + (1 - \mu) \cdot \boldsymbol {e r} _ {0}, \tag {14} +$$ + +$$ +\mu = \sigma \left(\boldsymbol {w} _ {a f f} ^ {T} \left[ \boldsymbol {r} _ {e m o}; \boldsymbol {e r} _ {0} \right]\right). \tag {15} +$$ + +We project $\pmb{r}_{aff}$ to predict the user's emotion $e$ : + +$$ +P _ {e m o} (e) = \operatorname {s o f t m a x} \left(\boldsymbol {W} _ {e m o} \boldsymbol {r} _ {a f f}\right), \tag {16} +$$ + +which is supervised by the ground truth emotion label $e^{*}$ using the cross-entropy loss: + +$$ +L _ {e m o} = - \log P _ {e m o} \left(e ^ {*}\right). \tag {17} +$$ + +# 3.3 Empathy-aware Response Generation + +We employ a Transformer-based decoder to generate the response. To improve empathy perception in response generation, we devise two strategies to fuse the two parts of empathy (i.e., cognition and affection). First, we concatenate the cognitive and affective signals $r_{cog}$ and $r_{aff}$ with the dialogue context representation $S_{X}$ at the token level, which is then processed by a MLP layer activated by $ReLU$ to integrate cognition and affection into the dialogue context: + +$$ +\boldsymbol {S} _ {X} ^ {\prime} [ i ] = M L P \left(\boldsymbol {S} _ {X} [ i ] \oplus \boldsymbol {r} _ {c o g} \oplus \boldsymbol {r} _ {a f f}\right). \tag {18} +$$ + +Second, we modify the original Transformer decoder layer by adding two new cross-attention to integrate commonsense cognition knowledge $K_{CS} = \{cs_i\}_{i=1}^{|K_{CS}|}$ and emotional concept knowledge $K_{EC} = \{ec_i\}_{i=1}^{|V_{EC}|}$ , which are inserted between the self-attention and cross-attention for $S_X'$ . The decoder then predicts the next token $y_m$ given the previously decoded tokens $y_{ModelsPPLDist-1Dist-2AccTransformer37.650.472.05-Multi-TRS37.450.512.120.347MoEL38.350.442.100.322MIME37.330.411.620.296EmpDG37.770.532.260.314KEMP37.320.552.310.341CEM36.860.642.840.373CASE35.370.744.010.402 + +Table 1: Results of automatic evaluation. + +model that combines the output of multiple decoders for generating. (4) MIME (Majumder et al., 2020): An empathy dialogue model that mimics the user's emotion for responding. (5) EmpDG (Li et al., 2020): An empathy dialogue generator that utilizes multi-resolution user emotions and feedback. (6) KEMP (Li et al., 2022): A knowledge-aware empathy dialogue model that only uses concept knowledge. (7) CEM (Sabour et al., 2022): A commonsense-aware empathetic chatting machine that only exploits commonsense knowledge. + +Implementation Details We implemented all models with Pytorch. We initialize the word embeddings with pretrained GloVE word vectors (Pennington et al., 2014). The dimensionality of embeddings is set to 300 for all corresponding modules. We set hyper-parameters $l = 5$ , $N' = 10$ , $\alpha = 0.2$ , $\gamma_1 = \gamma_2 = \gamma_3 = 1$ and $\gamma_4 = 1.5$ . We use Adam optimizer (Kingma and Ba, 2015) with $\beta_1 = 0.9$ and $\beta_2 = 0.98$ . The batch size is 16 and early stopping is adopted. The initial learning rate is set to 0.0001 and we varied it during training following Vaswani et al. (2017). The maximum decoding step is set to 30 during inference. All models are trained on a GPU-P100 machine. The training process of CASE is split into two phases. We first minimize $L_{BOW}$ for pretraining knowledge discernment mechanisms, and then minimize $L$ for training overall model. + +# 4.2 Automatic Evaluation + +In the model's generation evaluation, we adopt the widely used Perplexity (PPL) and Distinct-1/2 (Dist-1/2) (Li et al., 2016). Perplexity evaluates the general generation quality of a model. Distinct-1/2 evaluates the generated diversity by measuring the ratio of unique unigrams/bigrams in the response. In the model's emotion classification evaluation, we measure the accuracy (Acc) of emotion prediction. Following KEMP and CEM, we do not report + +
ModelsPPLDist-1Dist-2Acc
CASE35.370.744.010.402
w/o Graph36.100.683.500.280
w/o Align35.750.653.340.369
w/o CSGraph35.510.643.180.375
w/o ECGraph36.240.723.940.329
w/o CGAlign35.670.683.600.378
w/o FGAlign35.550.673.430.370
+ +word overlap-based automatic metrics (Liu et al., 2016), e.g., BLEU (Papineni et al., 2002). + +In Table 1, our model outperforms all baselines and achieves a significant improvement on all metrics. First, our model achieves about $4.0\%$ reduction on PPL compared to the best baseline, which shows that CASE is more likely to generate ground truth responses. Second, our model achieves $15.6\%$ and $41.2\%$ improvement on Dist-1/2 compared to CEM, which indicates the superiority of CASE in generating informative responses at the unigrams and bigrams level. This is attributed to the coarse-to-fine alignment that allows CASE to inject more informative commonsense cognition on the premise of ensuring the perplexity of the generated response. Third, our model achieves about $17.9\%$ and $7.8\%$ improvement in prediction accuracy compared to KEMP and CEM, respectively. This verifies that CASE considers both aspects of affection (i.e., contextual emotional state and emotional reaction) more effectively than focusing only on a single aspect as KEMP and CEM. + +# 4.3 Overall-to-Part Ablation Study + +We conduct an overall-to-part ablation study in Table 2. In the overall ablation, first, we remove the commonsense cognition graph and emotional concept graph, called "w/o Graph". The emotion prediction accuracy decreases significantly, which indicates that the two heterogeneous graphs make remarkable contribution to detecting emotion. Second, we remove the coarse-to-fine alignment, called "w/o Align". The diversity of generation decreases significantly and emotion prediction accuracy drops distinctly. It supports our motivation that the alignment of cognition and affection leads to informative and highly empathetic expression. + +In the part ablation, first, we remove two graphs, called "w/o CSGraph" and "w/o ECGraph", respectively. From the results, we find that the contribution of the commonsense cognition graph is mainly + +Table 2: Results of overall-to-part ablation study. + +
ComparisonsAspectsWinLoseκ
CASE vs. EmpDGCoh.48.1‡39.20.54
Emp.51.9‡32.90.55
Inf.58.9‡31.60.50
CASE vs. KEMPCoh.44.4†41.80.45
Emp.50.0‡34.40.53
Inf.51.1‡34.00.53
CASE vs. CEMCoh.45.9‡42.20.51
Emp.53.2‡34.60.47
Inf.57.8‡29.80.56
+ +Table 3: Human evaluation results (\%) of CASE and baselines. The agreement ratio kappa $\kappa \in [0.41, 0.6]$ denotes the moderate agreement. $\dagger, \ddagger$ represent significant improvement with $p$ -value $< 0.1/0.05$ , respectively. + +to improve the diversity of generation (i.e., Dist-1/2), while the role of the emotional concept graph is mainly located in the recognition of emotion (i.e., Acc). This also supports our constructed motivation. Second, we remove coarse-grained and fine-grained alignments, called "w/o CGAlign" and "w/o FGAlign", respectively. We observe that the alignment at the fine-grained level is more significant than the coarse-grained level in terms of overall contribution. This also matches our intuition that building the fine-grained association between cognition and affection is closer to the conscious interaction process during human express empathy. + +# 4.4 Human Evaluation + +Human Evaluation of CASE and Baselines Here, 200 contexts are randomly sampled and each context is associated with two responses generated from our CASE and baseline. Following Sabour et al. (2022), three crowdsourcing workers are asked to choose the better one (Win) from two responses by considering three aspects, respectively, i.e., (1) Coherence (Coh.): which model's response is more fluent and context-related? (2) Empathy (Emp.): which model's response expresses a better understanding of the user's situation and feelings? (3) Informativeness (Inf.): which model's response incorporates more information related to the context? We use the Fleiss' kappa $(\kappa)$ (Fleiss, 1971) to measure the inter-annotator agreement. As in Table 3, the results show that CASE outperforms three more competitive baselines on all three aspects. Especially, CASE outperforms baselines significantly in terms of empathy and informativeness, which shows the superior of modeling the interaction between cognition and affection of empathy, and supports the observations from automatic evaluation. + +
ModelsCoh.Emp.Inf.Overall
CASE3.883.483.623.58
w/o Graph3.723.023.513.38
w/o Align3.633.143.473.36
w/o CSGraph3.743.253.423.33
w/o ECGraph3.783.103.523.40
w/o CGAlign3.723.273.533.41
w/o FGAlign3.803.173.563.40
+ +Table 4: Human evaluation results of CASE's variants. + +
ModelsPPLDist-1Dist-2Acc
Bart15.172.7716.410.419
BlenderBot15.222.7016.200.470
CASE-BlenderBot15.402.9217.660.492
+ +Table 5: Analysis of integrating pre-trained model. + +Human Evaluation on Variants of CASE To more intuitively verify the role of the key components of CASE in language expression, especially empathy ability, we conduct a scoring human evaluation for the variants of CASE. Besides the same settings as above, we require annotating the Overall preference score (1-5). As in Table 4, CASE achieves the highest scores in all aspects, indicating that all components contribute. The low empathy scores of "w/o Graph" and "w/o Align" as well as their variants further confirm the crucial role of graph structure and the effectiveness of alignment. + +# 4.5 Applicability Analysis + +To analyze the applicability of our method, we build it on the pre-trained model to explore whether it brings further benefits. We integrate BlenderBot (Roller et al., 2021) into CASE by replacing the encoder and decoder, and take the vanilla Bart (Lewis et al., 2020) and BlenderBot as baselines. All pre-trained models are small versions. As in Table 5, we found that CASE-BlenderBot integrating our method significantly outperforms finetune-only baselines. Although the overall performance of simple finetuning has achieved stage success, it is limited by the quality and scale of the dataset and lacks a more fine-grained design for the trait of human conversation. This also demonstrates the high-level applicability of our method for uncovering the underlying mechanisms of human conversation. + +# 4.6 Case Study + +Two cases from six models are selected in Table 6, among which CASE is more likely to express informative cognition in a highly empathetic tone. + +This is due to two main advantages: + +(1) Effective alignment between cognition and affection on two levels. For example, in the first case, on the fine-grained level, CASE associates the cognition "to be safe" with the affection "good" (i.e., emotional reaction) to appease the user's "Terrified" experience, i.e., "to stay safe" and "get a little better", in response. In the second case, on the coarse-grained level, in the user's "Embarrassed" emotional state, CASE expresses empathetic affection "it is not too bad" with an informative cognitive statement, i.e., "get it fixed", in response. +(2) Accurate identification of the conversational emotion integrating emotional concepts and reactions, being consistent with "Acc". For instance, in the first case, the correct conversational emotion "Terrified" tends to be identified in the emotional concepts ("frighten, terrify, etc."), while in the second case, the one "Embarrassed" tends to be identified in the emotional reactions ("embarrassed, ashamed, etc."). Compared with baselines that cannot correctly perform two cases simultaneously, CASE identifies correct emotion in both cases by integrating emotional concepts and reactions. + +# 5 Conclusion and Future Work + +In this paper, for responding empathetically, we propose CASE to align cognition and affection by simulating their conscious interaction in human conversation. Extensive experiments verify the superiority of CASE on overall quality and empathy performance. Our work will also encourage future work to model the more complex interaction between cognition and affection in human conversation as well as other human language behaviors (Liu et al., 2021; Zheng et al., 2023). + +# Limitations + +We discuss two limitations of this work as follows: + +One limitation of our work is the lack of task-specific automatic metrics to evaluate the empathy of generated responses. Therefore, the evaluation of empathy relies more on human evaluation. Although human evaluation is a golden standard, automatic metrics help to conduct large-scale investigations. This is also a common limitation in current works on empathetic dialogue. + +The second limitation is the passive response to the user's cognition and affection. In many scenarios, empathy is used as a strategy for emotional support by responding to the user's cognition and + +
EmotionTerrified
ContextSpeaker: As a kid, I was so frightened any time there was a tornado warning. Not sure if it was the wizard of oz effect or what i just remember being frozen with fear.Listener: Oh, wow! My son was terrified of tornadoes because of that darn movie, ....Speaker: My mom said the best thing once when I was babysitting and a tornado warning went off and I did not want my own fear to affect the little boy I was with. She was on the phone and just said you have big plans for the future, right? Nothing is going to get in the way of that. For some reason, It worked a charm.
MoELI am sorry to hear that. I hope you can get better soon!
MIMEI am sure it was a great feeling.
EmpDGI am glad you are ok! I am sure you will have a great time.
KEMPI would be too! I would have been terrified!
CEMI am sure you will be fine!
CognitionTo make a plan, To be safe, To be helpful, Have a good life
ReactionScared, Hopeful, Nervous, Good, Happy
Conceptfrighten, surprising, terrify, aghast, good, charming, protect
CASEThat is good, I am glad you are able to stay safe and get a little better!
Ground-TruthYour mom sounds awesome! Wow, what a cool thing to say!
EmotionEmbarrassed
ContextSpeaker: I burned my hair with my hair drier I am so embarrassed to go out in public.Listener: I am sorry to hear that, my wife has done the same thing. She wore a hat for almost a month when she left the house.Speaker: Yeah it is the worst, I look so weird with my hair like this it is so embarrassing.
MoELThat is a pretty funny story.
MIMEI am sure it was a good idea.
EmpDGOh, that is a shame. I hope you are not too!
KEMPI am sure you will not have to be able to do it again.
CEMI am sorry to hear that.
CognitionTo look bad, To get a haircut, To fix it, To fix the hair, To get a wig
ReactionEmbarrassed, Bad, Ashamed, Sad
Conceptbad, ill, evil, freak, supernatural, exhausted, hope, sorrow
CASEI hope you are able to get it fixed, or just let her know it is not too bad.
Ground-TruthWell, like I told her, it will grow out, it will just take time.
+ +Table 6: Generated responses from baselines and CASE. Commonsense cognition, emotional reactions, reasoned emotional concepts by contextual words, and corresponding informative expressions in responses are highlighted. + +affection. However, besides passive response, emotional support also requires active emotion elicitation, which can be studied in future work. + +# Ethical Considerations + +In this paper, our experiments adopt the widely used EMPATHETICDIALOGues benchmark, an open-source dataset collected from Amazon Mechanical Turk (MTurk) that does not contain personal information. We also ensure the anonymization of the human evaluation. We believe that this work honors the ethical code of ACL. + +# Acknowledgements + +This work was supported by the National Key Research and Development Program of China (No. 2021ZD0113304), the National Science Foundation for Distinguished Young Scholars (with No. 62125604) and the NSFC projects (Key project with No. 61936010). + +This work was also supported by the National Natural Science Foundation of China (with No. + +62272340, 61876128, 62276187). + +# 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. + +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 Conference of the Association for Computational Linguistics, ACL 2019, Florence, Italy, July 28- August 2, 2019, Volume 1: Long Papers, pages 4762-4779. Association for Computational Linguistics. + +Mao Yan Chen, Siheng Li, and Yujiu Yang. 2022. Emphi: Generating empathetic responses with human-like intents. In Proceedings of the 2022 Conference of the North American Chapter of the Association for + +Computational Linguistics: Human Language Technologies, NAACL 2022, Seattle, WA, United States, July 10-15, 2022, pages 1063-1074. Association for Computational Linguistics. +Benjamin MP Cuff, Sarah J Brown, Laura Taylor, and Douglas J Howat. 2016. Empathy: A review of the concept. Emotion review, 8(2):144-153. +Mark H Davis. 1983. Measuring individual differences in empathy: evidence for a multidimensional approach. Journal of personality and social psychology, 44(1):113. +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. +Robert Elliott, Arthur C Bohart, Jeanne C Watson, and David Murphy. 2018. Therapist empathy and client outcome: An updated meta-analysis. *Psychotherapy*, 55(4):399. +Joseph L Fleiss. 1971. Measuring nominal scale agreement among many raters. Psychological bulletin, 76(5):378. +R. Devon Hjelm, Alex Fedorov, Samuel Lavoie-Marchildon, Karan Grewal, Philip Bachman, Adam Trischler, and Yoshua Bengio. 2019. Learning deep representations by mutual information estimation and maximization. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net. +Minlie Huang, Xiaoyan Zhu, and Jianfeng Gao. 2020. Challenges in building intelligent open-domain dialog systems. ACM Trans. Inf. Syst., 38(3):21:1-21:32. +Sevgi Coskun Keskin. 2014. From what isn't empathy to empathic learning process. Procedia-Social and Behavioral Sciences, 116:4932-4938. +Wongyu Kim, Youbin Ahn, Donghyun Kim, and Kyong-Ho Lee. 2022. Emp-rft: Empathetic response generation via recognizing feature transitions between utterances. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL 2022, Seattle, WA, United States, July 10-15, 2022, pages 4118-4128. Association for Computational Linguistics. +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. + +Lingpeng Kong, Cyprien de Masson d'Autume, Lei Yu, Wang Ling, Zihang Dai, and Dani Yogatama. 2020. A mutual information maximization perspective of language representation learning. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. 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, ACL 2020, Online, July 5-10, 2020, pages 7871-7880. 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 *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. +Junyi Li, Wayne Xin Zhao, Zhicheng Wei, Nicholas Jing Yuan, and Ji-Rong Wen. 2021. Knowledge-based review generation by coherence enhanced text planning. In SIGIR '21: The 44th International ACM SIGIR Conference on Research and Development in Information Retrieval, Virtual Event, Canada, July 11-15, 2021, pages 183-192. ACM. +Qintong Li, Hongshen Chen, Zhaochun Ren, Pengjie Ren, Zhaopeng Tu, and Zhumin Chen. 2020. Empdg: Multi-resolution interactive empathetic dialogue generation. In Proceedings of the 28th International Conference on Computational Linguistics, COLING 2020, Barcelona, Spain (Online), December 8-13, 2020, pages 4454-4466. International Committee on Computational Linguistics. +Qintong Li, Piji Li, Zhaochun Ren, Pengjie Ren, and Zhumin Chen. 2022. Knowledge bridging for empathetic dialogue generation. In AAAI. +Zhaojiang Lin, Andrea Madotto, Jamin Shin, Peng Xu, and Pascale Fung. 2019. Moel: Mixture of empathetic listeners. 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 121-132. 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 Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, EMNLP 2016, Austin, Texas, + +USA, November 1-4, 2016, pages 2122-2132. The Association for Computational Linguistics. +Siyang Liu, Chujie Zheng, Orianna Demasi, Sahand Sabour, Yu Li, Zhou Yu, Yong Jiang, and Minlie Huang. 2021. Towards emotional support dialog systems. 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 3469-3483, Online. Association for Computational Linguistics. +Navonil Majumder, Pengfei Hong, Shanshan Peng, Jiankun Lu, Deepanway Ghosal, Alexander F. Gelbukh, Rada Mihalcea, and Soujanya Poria. 2020. MIME: mimicking emotions for empathetic response generation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing, EMNLP 2020, Online, November 16-20, 2020, pages 8968-8979. Association for Computational Linguistics. +Saif M. Mohammad. 2018. Obtaining reliable human ratings of valence, arousal, and dominance for 20, 000 english words. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics, ACL 2018, Melbourne, Australia, July 15-20, 2018, Volume 1: Long Papers, pages 174-184. 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, July 6-12, 2002, Philadelphia, PA, USA, pages 311-318. ACL. +Wei Peng, Yue Hu, Luxi Xing, Yuqiang Xie, Xingsheng Zhang, and Yajing Sun. 2022. Modeling intention, emotion and external world in dialogue systems. In IEEE International Conference on Acoustics, Speech and Signal Processing, ICASSP 2022, Virtual and Singapore, 23-27 May 2022, pages 7042-7046. IEEE. +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 2014, October 25-29, 2014, Doha, Qatar. A meeting of SIGDAT, a Special Interest Group of the ACL, pages 1532-1543. ACL. +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. +Stephen Roller, Emily Dinan, Naman Goyal, Da Ju, Mary Williamson, Yinhan Liu, Jing Xu, Myle Ott, + +Eric Michael Smith, Y-Lan Boureau, and Jason Weston. 2021. Recipes for building an open-domain chatbot. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, EACL 2021, Online, April 19 - 23, 2021, pages 300-325. Association for Computational Linguistics. +Sahand Sabour, Chujie Zheng, and Minlie Huang. 2022. CEM: commonsense-aware empathetic response generation. In Thirty-Sixth AAAI Conference on Artificial Intelligence, AAAI 2022, Thirty-Fourth Conference on Innovative Applications of Artificial Intelligence, IAAI 2022, The Twelveth Symposium on Educational Advances in Artificial Intelligence, EAAI 2022 Virtual Event, February 22 - March 1, 2022, pages 11229-11237. AAAI Press. +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. +Robyn Speer, Joshua Chin, and Catherine Havasi. 2017. Conceptnet 5.5: An open multilingual graph of general knowledge. In Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence, February 4-9, 2017, San Francisco, California, USA, pages 4444-4451. AAAI Press. +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. +Liuping Wang, Dakuo Wang, Feng Tian, Zhenhui Peng, Xiangmin Fan, Zhan Zhang, Mo Yu, Xiaojuan Ma, and Hongan Wang. 2021. Cass: Towards building a social-support chatbot for online health community. Proceedings of the ACM on Human-Computer Interaction, 5(CSCW1):1-31. +Wei Wei, Jiayi Liu, Xianling Mao, Guibing Guo, Feida Zhu, Pan Zhou, and Yuchong Hu. 2019. Emotion-aware chat machine: Automatic emotional response generation for human-like emotional interaction. In Proceedings of the 28th ACM International Conference on Information and Knowledge Management, CIKM 2019, Beijing, China, November 3-7, 2019, pages 1401-1410. ACM. +David Westbrook, Helen Kennerley, and Joan Kirk. 2011. An introduction to cognitive behaviour therapy: Skills and applications. Sage. + +Zhitong Yang, Bo Wang, Jinfeng Zhou, Yue Tan, Dongming Zhao, Kun Huang, Ruifang He, and Yuexian Hou. 2022. Topkg: Target-oriented dialog via global planning on knowledge graph. In Proceedings of the 29th International Conference on Computational Linguistics, COLING 2022, Gyeongju, Republic of Korea, October 12-17, 2022, pages 745-755. International Committee on Computational Linguistics. +Emmanuelle Zech and Bernard Rimé. 2005. Is talking about an emotional experience helpful? effects on emotional recovery and perceived benefits. Clinical Psychology & Psychotherapy: An International Journal of Theory & Practice, 12(4):270-287. +Houyu Zhang, Zhenghao Liu, Chenyan Xiong, and Zhiyuan Liu. 2020. 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. Association for Computational Linguistics. +Chujie Zheng, Yong Liu, Wei Chen, Yongcai Leng, and Minlie Huang. 2021a. Comae: A multi-factor hierarchical framework for empathetic response generation. In Findings of the Association for Computational Linguistics: ACL/IJCNLP 2021, Online Event, August 1-6, 2021, volume ACL/IJCNLP 2021 of Findings of ACL, pages 813-824. Association for Computational Linguistics. +Chujie Zheng, Yong Liu, Wei Chen, Yongcai Leng, and Minlie Huang. 2021b. CoMAE: A multi-factor hierarchical framework for empathetic response generation. In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, pages 813-824, Online. Association for Computational Linguistics. +Chujie Zheng, Sahand Sabour, Jiaxin Wen, Zheng Zhang, and Minlie Huang. 2023. Augesc: Dialogue augmentation with large language models for emotional support conversation. In *Findings of the Association for Computational Linguistics: ACL* 2023. +Peixiang Zhong, Di Wang, Pengfei Li, Chen Zhang, Hao Wang, and Chunyan Miao. 2021. CARE: commonsense-aware emotional response generation with latent concepts. 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 14577-14585. AAAI Press. +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. +Jinfeng Zhou, Bo Wang, Ruifang He, and Yuexian Hou. 2021. CRFR: improving conversational recommender systems via flexible fragments reasoning on knowledge graphs. 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 4324-4334. Association for Computational Linguistics. +Jinfeng Zhou, Bo Wang, Minlie Huang, Dongming Zhao, Kun Huang, Ruifang He, and Yuexian Hou. 2022a. Aligning recommendation and conversation via dual imitation. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, EMNLP 2022, Abu Dhabi, United Arab Emirates, December 7-11, 2022, pages 549-561. Association for Computational Linguistics. +Jinfeng Zhou, Bo Wang, Zhitong Yang, Dongming Zhao, Kun Huang, Ruifang He, and Yuexian Hou. 2022b. CR-GIS: improving conversational recommendation via goal-aware interest sequence modeling. In Proceedings of the 29th International Conference on Computational Linguistics, COLING 2022, Gyeongju, Republic of Korea, October 12-17, 2022, pages 400-411. International Committee on Computational Linguistics. +Kun Zhou, Hui Wang, Wayne Xin Zhao, Yutao Zhu, Sirui Wang, Fuzheng Zhang, Zhongyuan Wang, and Ji-Rong Wen. 2020. S3-rec: Self-supervised learning for sequential recommendation with mutual information maximization. In CIKM '20: The 29th ACM International Conference on Information and Knowledge Management, Virtual Event, Ireland, October 19-23, 2020, pages 1893-1902. ACM. + +# A Mutual Information Maximization + +Mutual information maximization (MIM) aims to measure the dependence between two random variables $X$ and $Y$ , and the mutual information (MI) between them is defined as: $MI(X,Y) = D_{KL}(P(X,Y)\| P(X)P(Y))$ . However, maximizing MI directly is normally intractable. A successful practice to estimate MI with a lower bound is InfoNCE (Kong et al., 2020). Given two different views $x$ and $y$ of an input, InfoNCE is defined by: + +$$ +\mathbb {E} _ {P (X, Y)} [ f _ {\theta} (x, y) - \mathbb {E} _ {Q (\widetilde {Y})} [ \log \sum_ {\widetilde {y} \in \widetilde {Y}} \exp f _ {\theta} (x, \widetilde {y}) ] ] + \log | \widetilde {Y} |, \tag {20} +$$ + +where $f_{\theta}$ is a learnable function with parameter $\theta$ . The set $\widetilde{Y}$ draws samples from a proposal distribution $Q(\widetilde{Y})$ , and it comprises $|\widetilde{Y}| - 1$ negative samples and a positive sample $y$ . One insight is that when $\widetilde{Y}$ always consists all values of $Y$ and they are uniformly distributed, maximizing InfoNCE is analogous to maximize cross-entropy loss: + +$$ +\mathbb {E} _ {P (X, Y)} \left[ f _ {\theta} (x, y) - \log \sum_ {\widetilde {y} \in Y} \exp f _ {\theta} (x, \widetilde {y}) \right]. \tag {21} +$$ + +It shows InfoNCE is relevant to maximize $P_{\theta}(y|x)$ and approximates summation over elements in $Y$ (i.e., partition function) by negative sampling (Zhou et al., 2020, 2022a,b). Upon the formula, we replace $X$ and $Y$ with specific cognition and affection to maximize MI between them. + +A For every submission: + +A1. Did you describe the limitations of your work? + +Sec. Limitations + +A2. Did you discuss any potential risks of your work? + +Sec. Ethical Considerations + +A3. Do the abstract and introduction summarize the paper's main claims? + +Abstract and Sec.1 Introduction + +A4. Have you used AI writing assistants when working on this paper? + +Left blank. + +B Did you use or create scientific artifacts? + +Left blank. + +B1. Did you cite the creators of artifacts you used? + +Sec.2 Related Work and Sec.4.1 Experimental Setup + +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? + +Not applicable. Left blank. + +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +Sec.2 Related Work and Sec.4.1 Experimental Setup + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? + +Sec. Ethical Considerations + +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? + +Not applicable. Left blank. + +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. + +Sec. 4.1 Experimental Setup + +C Did you run computational experiments? + +Left blank. + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +Appendix B Implementation Details + +The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +Appendix B Implementation Details + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +Sec.4 Experiments + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +Not applicable. Left blank. + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +Sec. 4 Experiments + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +Limited by the space. Crowdsourcing workers are from Amazon Mechanical Turk. + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +Not applicable. Left blank. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +Not applicable. Left blank. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +Not applicable. Left blank. \ No newline at end of file diff --git a/casealigningcoarsetofinecognitionandaffectionforempatheticresponsegeneration/images.zip b/casealigningcoarsetofinecognitionandaffectionforempatheticresponsegeneration/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..58e3a81f0c8471e4d8009f10605a287095921ba4 --- /dev/null +++ b/casealigningcoarsetofinecognitionandaffectionforempatheticresponsegeneration/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e21957961144b5d68e023c948d22ee79cb77211b2b3d0e68dcf86ab40d56e64e +size 666936 diff --git a/casealigningcoarsetofinecognitionandaffectionforempatheticresponsegeneration/layout.json b/casealigningcoarsetofinecognitionandaffectionforempatheticresponsegeneration/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..9e60076c49f75955b1a32e540f3bd2d190b4e9a5 --- /dev/null +++ b/casealigningcoarsetofinecognitionandaffectionforempatheticresponsegeneration/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:07d8a279309ba05638c82f5af107a36dda08abcfea03d23b0a1add95bbf09509 +size 562612 diff --git a/casnclassawarescorenetworkfortextualadversarialdetection/d382ccd0-8c25-4152-993a-68a42165b610_content_list.json b/casnclassawarescorenetworkfortextualadversarialdetection/d382ccd0-8c25-4152-993a-68a42165b610_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..dda3786a81e8a457976198713639635ab37b2330 --- /dev/null +++ b/casnclassawarescorenetworkfortextualadversarialdetection/d382ccd0-8c25-4152-993a-68a42165b610_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b847064ad4a026be9452b3a7730e7acaaeb014d88870ca16f61b37b1cdb5e6db +size 126662 diff --git a/casnclassawarescorenetworkfortextualadversarialdetection/d382ccd0-8c25-4152-993a-68a42165b610_model.json b/casnclassawarescorenetworkfortextualadversarialdetection/d382ccd0-8c25-4152-993a-68a42165b610_model.json new file mode 100644 index 0000000000000000000000000000000000000000..8f218be40282c3661512c0271451f35df1a19566 --- /dev/null +++ b/casnclassawarescorenetworkfortextualadversarialdetection/d382ccd0-8c25-4152-993a-68a42165b610_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d6ac2a594853b34035a6d866bd0ef3bf7d28c4c2903e7b090a86c324c9656a6 +size 151422 diff --git a/casnclassawarescorenetworkfortextualadversarialdetection/d382ccd0-8c25-4152-993a-68a42165b610_origin.pdf b/casnclassawarescorenetworkfortextualadversarialdetection/d382ccd0-8c25-4152-993a-68a42165b610_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..35b030d44635ab9c7941c794223a74454f33218b --- /dev/null +++ b/casnclassawarescorenetworkfortextualadversarialdetection/d382ccd0-8c25-4152-993a-68a42165b610_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cac907d4bea8e6ecaf603ea82b09f78d63371cb6311ec059f2e434e24ae34673 +size 639706 diff --git a/casnclassawarescorenetworkfortextualadversarialdetection/full.md b/casnclassawarescorenetworkfortextualadversarialdetection/full.md new file mode 100644 index 0000000000000000000000000000000000000000..bc13f50e43e3459c154cb991a4165fdf9827f452 --- /dev/null +++ b/casnclassawarescorenetworkfortextualadversarialdetection/full.md @@ -0,0 +1,551 @@ +# CASN: Class-Aware Score Network for Textual Adversarial Detection + +Rong Bao $^{1,2*}$ , Rui Zheng $^{1*}$ , Liang Ding $^{3}$ + +Qi Zhang $^{1}$ , Dacheng Tao $^{3\dagger}$ + +$^{1}$ School of Computer Science, Fudan University, Shanghai, China + +$^{2}$ Shanghai Shanghai Artificial Intelligence Laboratory, Shanghai, China + +3 The University of Sydney, Sydney, Australia + +rbao22@m.fudan.edu.cn + +{rzheng20,qz}@fudan.edu.cn + +{liangding.liam,dacheng.tao}@gmail.com + +# Abstract + +Adversarial detection aims to detect adversarial samples that threaten the security of deep neural networks, which is an essential step toward building robust AI systems. Density-based estimation is widely considered as an effective technique by explicitly modeling the distribution of normal data and identifying adversarial ones as outliers. However, these methods suffer from significant performance degradation when the adversarial samples lie close to the non-adversarial data manifold. To address this limitation, we propose a score-based generative method to implicitly model the data distribution. Our approach utilizes the gradient of the log-density data distribution and calculates the distribution gap between adversarial and normal samples through multi-step iterations using Langevin dynamics. In addition, we use supervised contrastive learning to guide the gradient estimation using label information, which avoids collapsing to a single data manifold and better preserves the anisotropy of the different labeled data distributions. Experimental results on three text classification tasks upon four advanced attack algorithms show that our approach is a significant improvement (+15.2 F1 score on average against previous SOTA) over previous detection methods. + +# 1 Introduction + +It has already become a consensus in the machine learning community that deep neural networks (DNNs) are vulnerable against adversarial examples (Goodfellow et al., 2015; Kurakin et al., 2017). Adversarial samples are generated by adding some imperceptible perturbations to normal samples and cause the trained network to produce defective results. The widely-used pre-trained language models (PLMs) (Devlin et al., 2019; Liu et al., 2019; Brown et al., 2020) also have been demonstrated + +to be highly susceptible under textual adversarial attacks (Zhang et al., 2019). Given that pre-trained language models have become the de facto backbone models for many practical applications, their security risks deserve more attention. + +Existing approaches to counteract adversarial attacks can be broadly divided into two directions, adversarial defense and adversarial detection (Wiyatno et al., 2019). Although adversarial defenses have made great progress in recent years, popular defense methods, such as adversarial training (Zhu et al., 2020; Madry et al., 2018), impose certain restrictions on the attack space to certify robustness, which often results in a sacrifice of original accuracy (Akhtar et al., 2021). In contrast, adversarial detection methods aim to separate adversarial samples before they enter the model. The detected adversarial samples can be processed by a dedicated module and then re-entered into the model. This approach not only avoids the degradation of original accuracy, but also imposes no restrictions on the attack method. + +One of the most effective detection methods that can handle all textual attack algorithms is density-based estimation approaches (Yoo et al., 2022; Feinman et al., 2017). These approaches are built on the assumption that the adversarial examples are not lying inside the non-adversarial data manifold. They explicitly model the original data distribution and use the probability of a data point as the adversarial confidence. Nevertheless, recent work (Shamir et al., 2021) argues that the adversarial samples are roughly close and perpendicular to the low-dimensional manifold containing normal samples. The overlap problem poses a challenge for detection performance, as the closer the attack algorithm produces results resembling real samples, the more the detection performance is degraded. + +In this work, we propose to model the gradient of log-density data distribution via denoising score matching function (Song and Ermon, 2019; Vin + +cent, 2011). Then the gradients are used through Langevin dynamics to generate normal samples from the noise-perturbed distribution by multi-step denoising process. The distance from the adversarial samples to the normal data distribution is measured indirectly using the denoising score matching function. This is more refined than the previous direct density estimation, thus avoiding the performance loss caused by overlapping density regions. + +We introduce the class-aware score network (CASN) to compute the gradient of log-density distribution required in the detection phase. To train this score network, with the general training objective of conditional noise scores (Song et al., 2021), we also compute supervised contrastive loss (Khosla et al., 2020) by constructing different class sample pairs. It allows models to better distinguish between different classes of data manifold and prevents the model from collapsing into a single data distribution. Afterward, all samples are denoised using the score network, and the adversarial samples are determined by recording the size of the feature distance before and after denoising. + +Our contribution can be summarized as follows: + +- We propose a new paradigm that uses the class-aware score network to portray the distribution changes of the adversarial samples during the denoising process, greatly alleviating the distribution overlap problem. +- Introducing supervised contrastive learning in the training phase of the score network makes better use of label information and enables more accurate calculation of sample distances in the denoising process. +- Experimentally, we achieve nearly $100\%$ accuracy under many settings, significantly outperforming baseline methods, and presenting a greater challenge to counterattackers. + +# 2 Related work + +# 2.1 Textual Adversarial Attacks + +Considering the different granularities that DNNs are attacked, the textual attack algorithms can be grouped as character-level (Gao et al., 2018; Gil et al., 2019), word-level (Jin et al., 2020; Garg and Ramakrishnan, 2020; Ren et al., 2019), sentence-level (Iyyer et al., 2018) and multi-level (Liang et al., 2018; Ebrahimi et al., 2018) attacks. The different fine-grained groupings mean that these algorithms modified the original text at different + +levels. The usual manipulation includes insertion, deletion, and replacement. At the same time, the definition of adversarial attacks has to be satisfied, i.e., the adversarial sample needs to maintain semantic invariance and be imperceptible to human beings (Zhang et al., 2019). + +# 2.2 Textual Adversarial Detection + +DISP (Zhou et al., 2019) is a framework that learns to identify malicious perturbations, then block the attacks by replacing them with synonyms. This method relies on a perturbation discriminator to give a confidence score in whether the current word is perturbed or not. Liu et al. (2022) adapt Local Intrinsic Dimensionality (Ma et al., 2018) and propose MDRE based entirely on the distribution features of the learned representations. Noticing that word-level adversarial algorithms often replace high-frequency words with low-frequency words, Mozes et al. (2021) introduce FGWS algorithm to detect adversarial samples by word frequency properties and calibrate the adversarial samples to improve the model performance. Yoo et al. (2022) propose RDE which utilizes multivariate Gaussian distribution to model the feature density of clean samples. The samples in low-density regions are considered as adversarial samples during detection. Compared with previous explicit density estimation methods such as RDE and MDRE, our method uses the gradient of log-density and Langevin dynamics to depict the distribution distance between adversarial and normal samples, avoiding the performance degradation caused by the distribution overlap problem. + +# 3 Preliminary + +Score matching (HyvärinenAapo, 2005) was proposed to generate samples from a non-normalized distribution. The core idea of this method is to estimate the score function, i.e., the gradient of log-density data distribution, and then generate data by sampling through Langevin dynamics. + +Let $x$ be a data point, $p(x)$ denote the data distribution, the score function can be a score network $s_{\theta}(\cdot)$ that approximate $\nabla_x\log p(x)$ as accurately as possible, which can be written as + +$$ +s _ {\theta} (x) := \nabla_ {x} \log p (x). \tag {1} +$$ + +After that, Langevin dynamics can generate samples from the data distribution $p(x)$ using the score function. Given a fixed step size $\epsilon$ , and an initial + +![](images/22a37c6625231405d0cff929827f996a874cc981813b22c4460823636a958257.jpg) +Figure 1: Overview of CASN training process. (Left): We train the encoder with a linear classifier by supervised learning to obtain the encoder representations of text. (Right): We train the representation space using denoising score matching and supervised contrastive learning. The amplitude of the noise gradually increases from $t = 0$ to $T$ , perturbing the initial distribution eventually into a Gaussian noise distribution. As for supervised contrastive learning, we treat the perturbed samples with small noise conditions as positive pairs, and the samples with different labels and their small perturbations as negative pairs, which are marked by the solid and dashed lines respectively. + +sampling point $x_0\sim \pi (x)$ , the Langevin process recursively updates the following function: + +$$ +x _ {t} \leftarrow x _ {t - 1} + \frac {\epsilon}{2} \nabla_ {x} \log p \left(x _ {t - 1}\right) + \sqrt {\epsilon} z _ {t} \tag {2} +$$ + +where $z_{t} \sim \mathcal{N}(0, I)$ . Welling and Teh (2011) proves that under some restrictions $x_{T}$ becomes an exact sample from $p(x)$ when $\epsilon \to 0$ and $T \to \infty$ . + +Although the original score matching is a sound theory, Vincent (2011) points out that due to a very computationally complex term in the original training objective, it is difficult to be effective in high-dimensional data. Therefore, the author introduces denoising score matching (DSM) to eliminate the hard computing terms. The idea of this approach is to add an easily computable noise to the original distribution and then estimate the score function under noise perturbation. The advantage of this approach is that it makes the training target easier to compute, and the score function approximates the original target when the noise is small enough. The author proposes the use of Gaussian noise $p_{\sigma}(\tilde{x} |x) = \mathcal{N}(\tilde{x} |x,\sigma^2 I)$ , then DSM minimizes the following objectives: + +$$ +\frac {1}{2} \mathbb {E} _ {p (x) p _ {\sigma} (\tilde {x} | x)} \| s _ {\theta} (\tilde {x}) - \nabla_ {\tilde {x}} \log p _ {\sigma} (\tilde {x} | x) \| _ {2} ^ {2} \tag {3} +$$ + +Note that the optimal score network $s_{\theta^{\star}}(\cdot)$ which minimizes Eq. 3, Vincent (2011) indicates that at this point $s_{\theta^{\star}}(x)$ almost converge to $\nabla_x \log p_\alpha(x)$ . Denoising score matching using Gaussian noise inspires a series of later work (Song and Ermon, 2019; Song et al., 2021), and this technique has become an important milestone in the field of score-based image generation (Yang et al., 2022). + +# 4 Methodology + +In a nutshell, we hope to train a class-aware score network that estimates the gradient of log-density data distribution and separates the adversarial samples by the drift value of the sample distribution during the reverse denoising process. In §4.1, we will introduce the application of denoising score matching function and supervised contrastive learning to train the class-aware score network. By performing the denoising process on all samples using the score network, the drift distance of the samples before and after denoising can be calculated as an adversarial confidence score (§4.2). + +# 4.1 Training Class-Aware Score Network + +As shown in Fig. 1, the score network estimates the gradient of the log-density distribution of the text hidden states. The left side of the figure indicates that we first use a supervised learning encoder $E$ to obtain the hidden representation $h$ of text $x$ , i.e. $h = E(x)$ , $h$ is used as input to the scoring network. On the right is the training process of the score network, which uses multi-level noise perturbation and supervised contrastive learning for training. + +Given a Gaussian noise perturbation $p_{\alpha}(\tilde{h} |h) = \mathcal{N}(\tilde{h} |\sqrt{\alpha} h,(1 - \alpha)I)$ , and let $\alpha$ be part of the input, Eq.3 will reduce to the following loss function: + +$$ +l (\theta ; \alpha) = \frac {1}{2} \mathbb {E} _ {p (h) p _ {\alpha} (\tilde {h} | h)} \left\| s _ {\theta} (\tilde {h}, \alpha) + \frac {\tilde {h} - \sqrt {\alpha} h}{1 - \alpha} \right\| ^ {2} \tag {4} +$$ + +where $\alpha$ is a positive real number, $p(h)$ is the distribution of $h$ . The size of the noise perturbation + +is difficult to choose, large noise will affect the accurate estimation and small perturbation will make the Langevin dynamics ineffective. We address this problem through multi-level noise perturbations proposed by Song and Ermon (2019). Let $T$ denote a positive integer, a set of positive real numbers $\{\alpha_{i}\}_{i = 1}^{T}$ decreasing from 1 to 0, a linear combination of Eq. 4 is constructed for all $\alpha \in \{\alpha_{i}\}_{i = 1}^{T}$ to get a unified objective: + +$$ +L (\theta) _ {\alpha} = \frac {1}{T} \sum_ {i = 1} ^ {T} \left(1 - \alpha_ {i}\right) l \left(\theta ; \alpha_ {i}\right) T \tag {5} +$$ + +Nevertheless, the score network trained according to Eq. 5 is still imperfect. This training objective actually trains the data distribution under unconditional likelihood, but in fact, the data for different labels are conditionally distributed (Ho and Salimans, 2023). We need to approximate the conditional data distributions, so that the Langevin dynamics can operate on the correct manifold without jumping repeatedly on manifolds with different labels. Since the correct labels of the adversarial samples cannot be known before detection, we cannot utilize conditional score generation techniques (Dhariwal and Nichol, 2021) with explicit input labels. Therefore, we propose to use supervised contrastive learning (Khosla et al., 2020) to increase the anisotropy of differently labeled data and force the score network to implicitly model the conditional data distributions. + +The key to contrastive learning is constructing positive and negative sample pairs. As shown on the right side of Fig. 1, within a batch of data, we select the original representation and its noise perturbation as the positive sample pair and all representations that differ from its label (with or without noise perturbations) as the corresponding negative samples. Then, the contrastive loss can be calculated as: + +$$ +L (\theta) _ {\text {c o n s}} = - \sum_ {i \in I} \frac {\operatorname {s i m} \left(h _ {i} , \tilde {h} _ {i}\right)}{\sum_ {a \in A (i)} \operatorname {s i m} \left(h _ {i} , h _ {a}\right) + \operatorname {s i m} \left(h _ {i} , \tilde {h} _ {a}\right)}, \tag {6} +$$ + +where $I$ denotes the index of batch data, $A(i) = \{a\in I|y_i\neq y_a\}$ is the set of sample indexes whose labels are different from data $i$ . The similarity between each representation is calculated using the cosine value after averaging it, i.e., $sim(x,y) = \cos < s_{\theta}(x)^{\text{mean}}$ , $s_{\theta}(y)^{\text{mean}} >$ . + +Finally, we combine the Eq. 5 and Eq. 6 as a multi-task learning loss (Eq. 7) with $\lambda$ as coeffi + +cient: + +$$ +L (\theta) = L (\theta) _ {\alpha} + \lambda L (\theta) _ {c o n s} \tag {7} +$$ + +The specific training parameters will be detail discussed in Appendix A.1. + +# 4.2 Detection via Denoising Process + +Given a sentence $x$ and the corresponding encoder representation $h$ , a conventional detection approach is to conduct adversarial purification through the denoising process (Yoon et al., 2021; Nie et al., 2022), then classify the denoised representations and detect the adversarial samples based on label inversions. In order to better improve the quality of the denoising process, we take advantage of recent work (Song et al., 2021) that understands denoising score matching from the Stochastic Differential Equations (SDE) perspective. It indicates that the quality of generative modeling via Langevin dynamics can be further improved if the solution of the SDE equation is added. Therefore, our algorithm alternates between the reverse SDE solver and Langevin dynamics. + +Let $h_i$ denote the text representations of different time points, $s_{\theta^*}(\cdot)$ be a trained score network via minimized Eq. 7, the parameters $\beta_{i}$ and $\epsilon_{i}$ are related to $\{\alpha_{i}\}_{i = 1}^{T}$ in Eq. 5. We replace the regular Langevin dynamics of Eq. 2 with the following predictor-corrector (Song et al., 2021) form: + +$$ +s c o r e \leftarrow \frac {1}{2} \beta_ {i + 1} s _ {\theta^ {\star}} \left(h _ {i + 1}, \beta_ {i + 1}\right) +$$ + +$$ +h _ {i} \leftarrow (2 - \sqrt {1 - \beta_ {i + 1}}) h _ {i + 1} + s c o r e \tag {8} +$$ + +$$ +h _ {i} \leftarrow h _ {i} + \epsilon_ {i} s _ {\theta^ {*}} \left(h _ {i}, \beta_ {i}\right) + \sqrt {2 \epsilon_ {i}} z +$$ + +Although label flipping is an effective detection method, this method relies too much on the denoising results of Langevin dynamics, and it fails when the adversarial perturbations cannot be eliminated. To avoid the catastrophic consequences of failing to eliminate adversarial perturbations, we propose to focus on the kinetic qualities of Langevin dynamics. Since the Langevin dynamics eventually converge to the target distribution, the drift distance of the denoised adversarial samples should be larger than that of the normal ones. + +The cosine similarity could reflect the shift distance of the representation, with larger values implying a smaller shift. We calculate the cosine similarity between the current and starting representations at each step of the denoising process and use the cumulative sum as the final adversarial confidence score. Assume the $h_{start}$ denotes the text + +representations at the initial denoising point, when the time step $i$ ranges from start to 0, the update is performed using Eq. 8 and confidence value is accumulated as: + +$$ +c o n f i d e n c e + = c o s < h _ {i} ^ {m e a n}, h _ {s t a r t} ^ {m e a n} >, \tag {9} +$$ + +where $h_i$ denotes the text representations of the current moment, the superscript "mean" indicates that we calculate a token level averaging. After obtaining the confidence score of each sample, we filter the adversarial samples using the threshold method. The calculation of confidence scores will be shown in Algorithm 1, and the whole detection process will be detail discussed in Appendix A.2. + +# 5 Experimental Settings + +Considering the attack algorithms on text classification models, we selected three representative text classification datasets to verify the effectiveness of the proposed method. They are SST-2 (Socher et al., 2013), IMDB (Maas et al., 2011) and AGNEWS (Zhang et al., 2015). The first two datasets are both for binary sentiment analysis. In SST-2, most sentences are short texts, while in IMDB, they are long. AGNEWS is a four-category topic classification dataset that includes the world, sports, business, and sci/tech. + +# 5.1 Baselines + +We compare our method with five recent text adversarial detection approaches. Four of these methods, DISP, FGWS, RDE and MDRE have already been introduced in §2.2. We also add a detection method, MD, which simultaneously detects out-of-distribution and adversarial samples (Lee et al., 2018). It first calculates the class-conditional Gaussian distribution of the features and then gives the adversarial confidence score of the samples by Mahalanobis distance. + +# 5.2 Textual Attacks + +We use four attack algorithms to generate adversarial samples. BAE (Garg and Ramakrishnan, 2020) replaces or inserts tokens in important parts of the text by masking them and then rejuvenating the pre-training task of BERT to generate alternatives. PWWS (Ren et al., 2019) determines the word substitution order by word salience and classification probability, which greatly improves the attack success rate and maintains a very low word substitution rate. TextFooler (Jin et al., 2020) evaluates + +the importance of words in the sentence and then replaces them with synonyms that have semantic and syntactic constraints. TextFooer-adj (Morris et al., 2020a) further constrains the similarity of words and sentences before and after perturbation, which makes adversarial samples less detectable. + +# 5.3 Implementation Details + +We fine-tune two pre-trained language models, BERT (Devlin et al., 2019) and RoBERTa (Liu et al., 2019), as the sentence encoder. We use the general text classification paradigm of the two pretrained models, i.e., the encoder followed by the linear classifier with hyperparameters consistent with the original paper. For the three datasets, we use $90\%$ of the original training set for training and the remaining $10\%$ as the validation set. Following previous works, the attack algorithms will attack 3000 text samples to generate a balanced detection set. Since the original SST has only 872 labeled validation samples, we attack the full validation set. The XLNET (Yang et al., 2019) is adopted as the backbone of the score network with sentence encoder representations as input. All the attack algorithms are implemented by TextAttack (Morris et al., 2020b) framework and use the default settings. More details can be found in Appendix A.3. + +# 6 Experimental Results + +In this section, we compare the detection performance of some strong baseline approaches and explore the effects of denoising process on representations. Some findings of hyperparameter's selection and analytical experiments are also presented. + +# 6.1 Detection Performance + +Following the work of Yoo et al. (2022), we divide the detection of adversarial samples into two scenarios. Scenario 1 will detect all adversarial samples, regardless of whether the model output is successfully changed or not. Scenario 2 only requires the detection of samples that actually fool the model. Realistic attackers cannot guarantee the success of every attack, but this does not mean that these failed adversarial samples are harmless. In fact, the failed samples can guide the attacker to further optimize the attacking process, which is the strategy adopted by most attack algorithms. Therefore, we believe Scenario 1 is more realistic, and we will show the performance of each detection algorithm in Scenario 1 in the main text and put the + +
DatasetMethodTextFooler-adjBAETextFoolerPWWS
\( F_1 \)AUROCACC\( F_1 \)AUROCACC\( F_1 \)AUROCACC\( F_1 \)AUROCACC
SST-2DISP58.9-79.266.1-76.172.3-76.073.3-77.4
MDRE63.2-63.369.5-69.074.1-74.870.2-70.8
FGWS68.269.964.368.969.564.671.773.968.274.279.270.8
MD70.368.663.874.774.570.178.678.474.877.275.372.6
RDE72.377.169.378.884.178.382.988.582.179.685.577.1
Ours (CASN)80.889.180.397.298.997.199.399.899.399.199.999.1
IMDBDISP67.3-68.067.6-66.367.4-66.065.3-64.3
MDRE82.2-80.884.3-82.885.5-84.382.6-81.6
FGWS80.987.178.981.387.780.281.287.780.280.587.379.1
MD81.483.179.083.785.581.683.785.581.782.483.779.7
RDE82.288.380.784.690.283.284.790.183.782.586.780.1
Ours (CASN)97.899.797.898.499.898.498.399.898.391.296.690.9
AGNEWSDISP61.5-85.880.8-86.388.4-89.184.1-87.3
MDRE57.1-61.673.0-75.580.2-81.274.5-76.5
FGWS74.673.269.875.175.973.377.678.475.581.984.382.4
MD67.262.352.871.576.165.075.280.873.371.876.870.0
RDE67.767.055.177.185.075.985.392.385.677.885.477.3
Ours (CASN)90.095.889.799.899.999.899.999.999.999.999.999.9
+ +Table 1: Performance of adversarial detection. The best results are marked in bold. Following previous works, Accuracy (ACC), $F_{1}$ , and Area Under the Receiver Operating Characteristic (AUROC) are used for metrics. We use BERT as the victim model, while the detection results of RoBERTa are put in Appendix B.1. + +performance of Scenario 2 in Appendix B.2. + +Table 1 reports the detection performance of our method and compared baselines. We summarize the results as follows: 1) The AUROC metric cannot be calculated for DISP and MDRE, because they are threshold-independent detection methods. DISP performs very well on AGNEWS, which may be due to the synonyms replaced by these attack algorithms do not preserve the semantics of the original sentences well. 2) Consistently with Yoo et al. (2022), FGWS works badly in the face of more subtle attacks, such as BAE and TextFooler. 3) Both RDE and MD are feature density-based methods, and in general, RDE works better than MD. However, their performance degrades dramatically against TextFooler-adj, as the overlap of the feature space increases due to the quality improvement of adversarial samples. 4) Taking advantage of the denoising process to depict the feature changes of data avoids the drawbacks of density estimation methods, thus performing well on the TextFooler-adj attack. Our method not only greatly surpasses the other approaches, but also achieves almost $100\%$ detection performance for the other three attacks. + +# 6.2 Analysis + +To better understand our method, we analyze some hyperparameter choices in the training and inference phase, as well as the correlation between feature purification and detection performance in the denoising process. + +Effects of coefficients We explore the optimal coefficient $\lambda$ in Eq. 7 by varying the value in the intervals of 0.025 from 0.025 to 0.3, as seen in Fig. 2. In general, the performance trends are not consistent across the datasets. For SST-2 and AGNEWS, the performance has been oscillating with increasing $\lambda$ and it is difficult to tell a concise trend. For IMDB, the AUROC values are all close to 100 percent, which indicates that detection on IMDB is not sensitive to hyperparameter change. However, in the interval range of 0.15 to 0.2, our CASN performs well on all the datasets. The reason is that with small values, the model will lose the label information and eventually degrade to the original conditional denoising objective. A larger coefficient would force the model to focus on the loss of contrastive learning and ignore the noise perturbations, which is also detrimental to accurate gradient estimation. + +![](images/8a2e4765fb6cda335d50c3e5436eba8b0d013ebc17c61b2c2efdaba5413ec176.jpg) +(a) SST-2 + +![](images/e6ba410dda8d42d4f20b20f40d3869e6e7f7f081f5ed4e440f12d5024453a292.jpg) +(b)IMDB + +![](images/d9b1495225dbe123672b9e35e9a66057a7682367aa76ed6a0d5e29bb7b2a9c82.jpg) +(c) AGNEWS + +![](images/44f3baac12d5996aed95244be2d34bc0210404baa665f5a2170a7ddf3df1d6b5.jpg) +Figure 2: Detection performance of different coefficients $\lambda$ in Eq. 7 for four attack methods. We increase the coefficients at intervals of 0.025 and use AUROC as the evaluation metric. +(a) SST-2 +Figure 3: The distribution differences of different denoising steps $k$ , where both normal and adversarial samples go through the denoising process. The Gaussian kernel density is used to measure the distribution. + +![](images/2e8ff4c0d51f6ce6c04cdf44d5169620086179e7fbeca84e4bec20548f7d8433.jpg) +(b)IMDB + +![](images/ca31a028dce8b6ddd333acaba7c9dc7af9944ee33dcf5cec780e8f77396d6b00.jpg) +(c) AGNEWS + +
DatasetStepsAUROCACC-cleanACC-adv
SST-20-92.14.8
3080.292.15.4
6097.692.26.8
9099.892.28.0
IMDB0-93.420.8
3099.593.528.5
6099.793.634.8
9099.893.939.3
AGNEWS0-94.412.8
3099.994.416.5
6099.994.521.7
9099.994.424.5
+ +Table 2: The purification results of all samples with different denoising steps, where ACC-clean and ACC-adv denote the accuracy of clean and adversarial samples after the denoising process, respectively. + +Denoising steps As discussed in §4.2, the choice of the denoising starting point $k$ is essential to successful detection. Under different starting points, we use Gaussian kernel density (Parzen, 1962) to calculate the distributions of pre-post denoising sentence similarity of all samples. It can be seen from Fig. 3 that, the overlapping area of solid and + +dashed lines of the same color is gradually decreasing as the number of steps increases. The increase in the number of steps causes the adversarial samples to deviate more significantly in the semantic space, thus separating them from the normal samples. However, it is not recommended to increase the number of steps consistently. On the one hand, the computational overhead is not worth it when the detection performance is good enough. On the other hand, more denoising steps mean that the denoising starting distribution is further away from the true sample distribution, leading to inaccurate score estimation for all samples and thus causing a decrease in detection performance. + +Adversarial Purification Table 2 shows the classification accuracy of normal and adversarial samples after denoising. Referring to the setup of adversarial purification (Nie et al., 2022; Yoon et al., 2021), we reclassify the denoised sentence representations using the previously fine-tuned linear classifier. Consistent with these adversarial purifications in the field of computer vision research, the denoising process is able to remove a portion of the adversarial perturbations. Although the improvement is weaker compared to defensive methods that + +
SentenceFGWSRDECASN
Schaeffer (frank) has to find some hook (pull) on which to hang his persistently inconsequential flick(useless movies), and it perils (might) as allright (well) be the resuscitation of the middle-aged character.◎◎◎
While it's genuinely cool to hear characters talk about early rap (music) records (show) (sugar hill gang, etc.) , the constant referencing (references) of hip-hop arcana (secret) can consign (alienate) (charge) even the savviest audiences.◎◎◎
Further proof that the coeur (epicenter) of neat (cool) , hermosa (beautiful) , thought-provoking foreign cinema is smack-dab (pat) in the middle of dubya's (bush's) axis of evil.◎◎◎
+ +improve model robustness such as adversarial training, our method not only calibrates the semantic features of the adversarial samples to improve the classification accuracy but also ensures the model performance of the original samples. + +# 6.3 Case Study + +Detection results of TextFooler-adj in Table 1 show that CASN is more sensitive to subtle semantic gaps. To further improve this claim, we select the SST-2 dataset under this attack and analyze some representative samples. As shown in Table 3, we can tell that: FGWS needs a large number of low-frequency word substitutions for correct classification, but the substitutions often do not correspond correctly to the correct ones, so the attacking algorithm only needs stronger synonym constraints to disable it. The third example illustrates that RDE fails in the face of adversarial samples with stronger sentence semantic constraints. This may be due to the RDE's assumption that the semantic space of the adversarial samples is far away from the normal samples. + +# 7 Ablation Study + +To better illustrate the key components in CASN, we perform an ablation study by removing supervised contrastive learning and the solution of the SDE equation in the inference period. The test results are in Table 4. We can observe that: 1) Removing supervised comparative learning will significantly damage model performance. It would fall back to the original conditional denoising model, thus blurring the differences in distribution between different classes of samples, which is detrimental to the denoising process. 2) Without the SDE equation as the solution of the first step, this is not + +Table 3: Examples showing the sensitivity to subtle semantic gaps. The words replaced by the attack algorithm are underlined and followed by the original word in parentheses. For the proposed low-frequency word substitutions in FGWS, we write them in brackets after the original text using red color. “&” mean positive and negative. + +
DatasetMethodF1AUROCPurified ACC
SST-2CASN93.797.365.5
w/o SCL69.271.065.4
w/o SDE91.397.563.7
IMDBCASN97.799.757.0
w/o SCL75.080.451.2
w/o SDE97.499.654.5
AGNEWSCASN92.496.982.2
w/o SCL66.722.782.0
w/o SDE92.397.480.0
+ +Table 4: Ablation results of two major components. SCL and SDE denote supervised contrastive learning and the solution of the SDE equation, respectively. Similar to the metrics in Table 2, Purified ACC is the accuracy after reclassifying the denoised representation. + +conducive to better correcting the semantics of the adversarial samples, although sometimes the detection performance is not decreased. + +# 8 Conclusion + +In this paper, we propose a nearly-perfect solution, CASN, to detect adversarial samples in text classification tasks. This framework is based on a noise conditional score network and utilizes label information to better estimate the data log-density gradient. Extensive experiments show that our method greatly outperforms the strong baseline method. Moreover, this approach, which exploits sample feature changes during denoising process, is experimentally shown to be more sensitive to semantic gaps of adversarial samples. We also show that a simultaneous denoising process for all samples is effective in maintaining the semantics of clean text while calibrating the adversarial ones. + +# Limitations + +In this work, we propose to use the denoising score matching function to estimate the gradient of log-density distribution, then describe the differences between the adversarial and normal samples by the denoising process of Langevin dynamics. Although our method achieves very good detection performance (nearly $100\%$ under various settings), the actual denoising process requires multi-step iterative updates, resulting in a very slow inference speed compared to previous methods. In addition, the trained score network is highly correlated with the domain data, which makes it difficult to achieve good generalization across multiple domains at the same time. + +# Ethics Statement + +We take ethical considerations very seriously and strictly adhere to ACL's ethics policy. The focus of this paper is on improving adversarial instance detection, which is studied using publicly available datasets and models, and has been widely adopted by researchers. Our research aims to improve the security of real-world AI systems, which is objectively informative on topics such as privacy protection and content censorship. We ensure the authenticity of our experimental results and the objectivity of our empirical conclusions. + +# References + +Naveed Akhtar, Ajmal Mian, Navid Kardan, and Mubarak Shah. 2021. Advances in adversarial attacks and defenses in computer vision: A survey. IEEE Access. +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. +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. +Prafulla Dhariwal and Alexander Quinn Nichol. 2021. Diffusion models beat gans on image synthesis. In Advances in Neural Information Processing Systems 34: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, December 6-14, 2021, virtual, pages 8780-8794. +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. +Reuben Feinman, Ryan R. Curtin, Saurabh Shintre, and Andrew B. Gardner. 2017. Detecting adversarial samples from artifacts. arXiv: Machine Learning. +Ji Gao, Jack Lanchantin, Mary Lou Soffa, and Yanjun Qi. 2018. Black-box generation of adversarial text sequences to evade deep learning classifiers. *IEEE symposium on security and privacy*. +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, Online. Association for Computational Linguistics. +Yotam Gil, Yoav Chai, Or Gorodissky, and Jonathan Berant. 2019. White-to-black: Efficient distillation of black-box adversarial attacks. 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 1373-1379, Minneapolis, Minnesota. 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. +Jonathan Ho, Ajay Jain, and Pieter Abbeel. 2020. Denoising diffusion probabilistic models. In Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual. +Jonathan Ho and Tim Salimans. 2023. Classifier-free diffusion guidance. +HyvarinenAapo. 2005. Estimation of non-normalized statistical models by score matching. Journal of Machine Learning Research. + +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. +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. +Prannay Khosla, Piotr Teterwak, Chen Wang, Aaron Sarna, Yonglong Tian, Phillip Isola, Aaron Maschinot, Ce Liu, and Dilip Krishnan. 2020. Supervised contrastive learning. In Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual. +Alexey Kurakin, Ian J. Goodfellow, and Samy Bengio. 2017. Adversarial examples in the physical world. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Workshop Track Proceedings. OpenReview.net. +Kimin Lee, Kibok Lee, Honglak Lee, and Jinwoo Shin. 2018. A simple unified framework for detecting out-of-distribution samples and adversarial attacks. In Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montréal, Canada, pages 7167-7177. +Bin Liang, Hongcheng Li, Miaoqiang Su, Pan Bian, Xirong Li, and Wenchang Shi. 2018. Deep text classification can be fooled. In Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence, IJCAI 2018, July 13-19, 2018, Stockholm, Sweden, pages 4208-4215. ijcai.org. +Na Liu, Mark Dras, and Wei Emma Zhang. 2022. Detecting textual adversarial examples based on distributional characteristics of data representations. In Proceedings of the 7th Workshop on Representation Learning for NLP, pages 78-90, Dublin, Ireland. Association for Computational Linguistics. +Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Michael Lewis, Luke Zettlemoyer, and Veselin Stoyanov. 2019. Roberta: A robustly optimized bert pretraining approach. arXiv: Computation and Language. +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. +Xingjun Ma, Bo Li, Yisen Wang, Sarah M. Erfani, Sudanthi N. R. Wijewickrema, Grant Schoenebeck, Dawn Song, Michael E. Houle, and James Bailey. 2018. Characterizing adversarial subspaces using local intrinsic dimensionality. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net. +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. +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. OpenReview.net. +Dimitra Maoutsa, Sebastian Reich, and Manfred Opper. 2020. Interacting particle solutions of fokker-planck equations through gradient-log-density estimation. Entropy, 22(8):802. +John Morris, Eli Lifland, Jack Lanchantin, Yangfeng Ji, and Yanjun Qi. 2020a. Reevaluating adversarial examples in natural language. In *Findings of the Association for Computational Linguistics: EMNLP* 2020, pages 3829-3839, Online. Association for Computational Linguistics. +John Morris, Eli Lifland, Jin Yong Yoo, Jake Grigsby, Di Jin, and Yanjun Qi. 2020b. 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. +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. +Weili Nie, Brandon Guo, Yujia Huang, Chaowei Xiao, Arash Vahdat, and Animashree Anandkumar. 2022. Diffusion models for adversarial purification. In International Conference on Machine Learning, ICML 2022, 17-23 July 2022, Baltimore, Maryland, USA, volume 162 of Proceedings of Machine Learning Research, pages 16805-16827. PMLR. + +Emanuel Parzen. 1962. On estimation of a probability density function and mode. Annals of Mathematical Statistics. +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. +Adi Shamir, Odelia Melamed, and Oriel BenShmuel. 2021. The dimpled manifold model of adversarial examples in machine learning. arXiv: Learning. +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. +Jascha Sohl-Dickstein, Eric A. Weiss, Niru Maheswaranathan, and Surya Ganguli. 2015. Deep unsupervised learning using nonequilibrium thermodynamics. In Proceedings of the 32nd International Conference on Machine Learning, ICML 2015, Lille, France, 6-11 July 2015, volume 37 of JMLR Workshop and Conference Proceedings, pages 2256-2265. JMLR.org. +Yang Song and Stefano Ermon. 2019. Generative modeling by estimating gradients of the data distribution. 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 11895-11907. +Yang Song, Jascha Sohl-Dickstein, Diederik P. Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. 2021. Score-based generative modeling through stochastic differential equations. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net. +Pascal Vincent. 2011. A connection between score matching and denoising autoencoders. Neural Computation. +Max Welling and Yee Whye Teh. 2011. Bayesian learning via stochastic gradient Langevin dynamics. In Proceedings of the 28th International Conference on Machine Learning, ICML 2011, Bellevue, Washington, USA, June 28 - July 2, 2011, pages 681-688. Omnipress. +Rey Reza Wiyatno, Anqi Xu, Ousmane Amadou Dia, and Archy O. de Berker. 2019. Adversarial examples in modern machine learning: A review. arXiv: Learning. + +Ling Yang, Zhilong Zhang, and Shenda Hong. 2022. Diffusion models: A comprehensive survey of methods and applications. +Zhilin Yang, Zihang Dai, Yiming Yang, Jaime G. Carbonell, Ruslan Salakhutdinov, and Quoc V. Le. 2019. Xlnet: Generalized autoregressive pretraining for language understanding. 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 5754-5764. +KiYoon Yoo, Jangho Kim, Jiho Jang, and Nojun Kwak. 2022. Detection of adversarial examples in text classification: Benchmark and baseline via robust density estimation. In Findings of the Association for Computational Linguistics: ACL 2022, pages 3656-3672, Dublin, Ireland. Association for Computational Linguistics. +Jongmin Yoon, Sung Ju Hwang, and Juho Lee. 2021. Adversarial purification with score-based generative models. In Proceedings of the 38th International Conference on Machine Learning, ICML 2021, 18-24 July 2021, Virtual Event, volume 139 of Proceedings of Machine Learning Research, pages 12062-12072. PMLR. +Wei Emma Zhang, Quan Z. Sheng, Ahoud Alhazmi, and Chenliang Li. 2019. Adversarial attacks on deep learning models in natural language processing: A survey. arXiv: Computation and Language. +Xiang Zhang, Junbo Jake Zhao, and Yann LeCun. 2015. Character-level convolutional networks for text classification. In Advances in Neural Information Processing Systems 28: Annual Conference on Neural Information Processing Systems 2015, December 7-12, 2015, Montreal, Quebec, Canada, pages 649-657. +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, 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. + +# A Implementation Details + +This section introduces the implementation details of the training and inference phases. It includes the selection of hyperparameters for training the CASN and the denoising process for inference. In addition, there are some other settings such as the choice of the adversarial algorithm and the finetuning strategy of the agent model. + +# A.1 Training CASN + +The training method is greatly inspired by previous work on denoising diffusion models (Ho et al., 2020; Sohl-Dickstein et al., 2015) and denoising score matching from SDE perspective (Song et al., 2021). In fact, we are able to describe the original denoising score function (Eq.3) and the diffusion model uniformly using SDE. + +We bring each $\alpha_{i}\in \{\alpha_{i}\}_{i = 1}^{T}$ into Eq.4 individually, while recording the noise perturbation feature in $\alpha_{i}$ as $h_i$ with $h_0$ as the initial feature. It can be seen that at this point, Eq.4 is optimizing the score function under the following Gaussian noise perturbation: + +$$ +p _ {\alpha_ {i}} \left(h _ {i} \mid h _ {0}\right) = \mathcal {N} \left(h _ {i}; \sqrt {\alpha_ {i}} h _ {0}, (1 - \alpha_ {i}) I\right) \tag {10} +$$ + +Noticing that the coefficient $\alpha_{i}$ decreases from 1 to 0 as $i$ increases from $i = 0$ to $T$ , the noise perturbed distribution (Eq.10) will approach a pure Gaussian noise distribution as $i$ increases to $T$ . Due to the independence between the individual Gaussian perturbation distributions, we can consider the features with different levels of noise perturbed as a Markov process in the generation of the time series. According to Eq.10, the Markov process can be written as: + +$$ +\begin{array}{l} p _ {\beta_ {i}} \left(h _ {i} \mid h _ {i - 1}\right) = \mathcal {N} \left(h _ {i}; \sqrt {1 - \beta_ {i}} h _ {i - 1}, \beta_ {i} I\right) \tag {11} \\ w h e r e \quad \alpha_ {i} := \prod_ {j = 1} ^ {i} (1 - \beta_ {i}) \\ \end{array} +$$ + +This Markov process is a classical denoising diffusion model (Ho et al., 2020). At this point, the parameters $\alpha \in \{\alpha_{i}\}_{i = 1}^{T}$ in Eq.4 for different noise levels are converted to Gaussian noise coefficients $\beta \in \{\beta_i\}_{i = 1}^T$ in the diffusion model. We refer to the previous work (Song et al., 2021) to calculate the parameters $\beta \in \{\beta_i\}_{i = 1}^T$ + +$$ +\beta_ {i} = \frac {\bar {\beta} _ {m i n}}{T} + \frac {i - 1}{T (T - 1)} \left(\bar {\beta} _ {m a x} - \bar {\beta} _ {m i n}\right) \tag {12} +$$ + +where $\overline{\beta}_{min} = 0.1, \overline{\beta}_{max} = 20$ and $T = 1000$ . + +Once we bring the parameters $\alpha_{i}\coloneqq \prod_{j = 1}^{\lambda}(1 - \beta_{i})$ into Eq.4, we can calculate the loss of the denoising score matching. Noting that the final training objective, Eq.7, needs to add the supervised contrastive learning loss function, the choice of hyperparameter $\lambda$ is crucial to make the trade-off. We list the selection of this parameter on different datasets and models in Table 5. + +
ModelsDatasetsλstart(k)
BERTSST-20.15120
IMDB0.190
AGNEWS0.290
RoBERTaSST-20.2120
IMDB0.190
AGNEWS0.190
+ +Table 5: The two main hyperparameters of CASN during training and inference on different datasets and models. The $\lambda$ is the coefficient in the training objective (Eq.7) and $start(k)$ denotes the start point of denoising process. + +In addition, we use XLNET (Yang et al., 2019) as the backbone of the class-aware score network. For all datasets and victim models, we train the score network 20 epochs using AdamW optimizer with $2e^{-5}$ as learning rate, 0.1 as dropout probability, 64 as batch size, 42 as the random seed. Regardless of how large the loss calculated by Eq.7 is, we use the network saved in the last round as the final scoring network. + +# A.2 Detection via Denoising Process + +By revisiting the Markov process represented by Eq.11, we write the changes of text representation at each time point in the following form: + +$$ +h _ {i} = \sqrt {1 - \beta_ {i}} h _ {i - 1} + \sqrt {\beta_ {i}} z _ {i - 1}, i = 1, \dots T \tag {13} +$$ + +where $z_{i}\sim \mathcal{N}(0,I),i = 0,\ldots T - 1$ .Song et al. (2021) indicate that Eq.13 will converge to a stochastic differential equation (SDE) when $T\to \infty$ . In the limit of $T\rightarrow \infty$ $\{\beta_i\}_{i = 1}^T$ becomes a function $\{\beta (t)\}_{t = 0}^{1},z_{i}$ becomes $\{z(t)\}_{t = 0}^{1}$ , and the Markov process of $\{h_i\}_{i = 1}^T$ becomes a continuous stochastic process $\{h(t)\}_{t = 0}^{1}$ , where $t\in [0,1]$ is a continuous time variable. + +Noticing that for all SDE equations in the following form: + +$$ +d x = f (x, t) d t + G (t) d w \tag {14} +$$ + +where $w$ is the standard Wiener process (a.k.a., Brownian motion), there is a deterministic ordinary differential equation (ODE) solution with $\{p_t(h)\}_{t=0}^T$ as the marginal distribution (Maoutsa et al., 2020). We can use the following ODE solution to generate data in probability flow sampling. + +$$ +d x = \left[ f (x, t) - \frac {1}{2} G (t) G (t) ^ {T} \nabla_ {h} \log p _ {t} (h) \right] d t \tag {15} +$$ + +Due to the presence of the $\nabla_h\log p_t(h)$ term in the ODE equation, it is natural to use the score function to replace $\nabla_h\log p_t(h)$ and generate samples by iteratively updating the probability flow ODE in discrete time steps. + +We first write Eq.13 in the SDE form under the assumption that $T \to \infty$ : + +$$ +d h = - \frac {1}{2} \beta (t) d t + \sqrt {\beta (t)} d w \tag {16} +$$ + +After that we write the corresponding discrete form of ODE function based on the solution given in Eq.15, using the trained score network $s_{\theta^{\star}}(\cdot)$ as a replacement for the $\nabla_h \log p_t(h)$ . + +$$ +h _ {i} = \left(2 - \sqrt {1 - \beta_ {i + 1}}\right) h _ {i + 1} + \frac {1}{2} \beta_ {i + 1} s _ {\theta^ {\star}} \left(h _ {i + 1}, \alpha_ {i + 1}\right) \tag {17} +$$ + +In the process of denoising generation, alternately using the numerical form of ODE equation and Langevin dynamics could improve the quality of the generation while reducing the number of sampling steps (Song et al., 2021). Therefore, we also use this approach to update the data representation at each time step in the denoising process. The process of generating the adversarial confidence is shown in Algorithm 1. + +As mentioned earlier, the hyperparameters $\{\beta_i\}_{i=1}^T$ in the inference time satisfy Eq.12. In addition, $\{\epsilon\}_{i=1}^T$ in Langevin dynamics requires the following calculation: + +$$ +\epsilon_ {i} = 2 \cdot \epsilon \cdot \alpha_ {i} \cdot \frac {\left| \left| z \right| \right|}{\left| \left| S _ {\theta} \left(x , \alpha_ {i}\right) \right| \right|} \tag {18} +$$ + +where $\epsilon = 0.01$ and $z$ are sampled from the standard normal distribution. The denoising starting points for different datasets and attacked models can be found in Table 5. + +Algorithm 1 Detection Algorithm via Denoising Process. + +# Input: + +Sentence level representation, $h$ + +Class-aware score network, $s_{\theta}(\cdot)$ + +Denoising start point, $k$ + +Hyperparameters $\{\beta_{i}\}_{i = 1}^{T}$ and $\{\epsilon_i\}_{i = 1}^T$ + +# Output: + +Initialize $h_k \gets h$ , score $\gets 0$ , $c \gets 0$ +1: for $i = k$ to 0 do +2: $score \gets \frac{1}{2}\beta_{i+1}s_{\theta}(h_{i+1}, \beta_{i+1})$ +3: $h_i \gets (2 - \sqrt{1 - \beta_{i+1}})h_{i+1} + score$ +4: $h_i \gets h_i + \epsilon_i s_\theta(h_i, \beta_i) + \sqrt{2 \epsilon_i} z$ +5: $c = c + \cos < h_i^{mean}, h_k^{mean} >$ +6: end for +7: return $c$ as adversarial confidence; + +# A.3 Other Details + +We fine-tune the BERT-base-uncased and RoBERTa-base model as the victim models, the main hyperparameters are listed in Table 6. According to the general paradigm, we connect a linear classifier after the encoder which is initialized with pre-trained weights. In the training period for CASN, we keep the encoder frozen and trained the score network using encoder representations on the clean dataset. In the detection phase, the encoder would produce sentence representation $h$ for each sentence, no matter if it is adversarial or not. The parameters for a CASN are about one million float32 type floating point numbers, and it takes about 3 hours to train 20 epochs on the IMDB dataset using a single NVIDIA A100 GPU, and 1 hour to predict 3000 samples. For the three datasets, SST-2 has 67,349 training data and 872 validation data. IMDB has both 25,000 training and test data. AGNEWS has 120,000 training data and 7,600 test data. + +
HyperparametersValues
OptimizerAdamw(Loshchilov and Hutter, 2019)
Learning rate2 × 10-5
Dropout0.1
Weight decay1 × 10-2
Batch size64
Gradient clip(-1,1)
Epochs3
Bias-correctionTrue
+ +Table 6: Hyperparameters used for fine-tuning the BERT-base-uncased and RoBERTa-base model. + +# B More Experimental Results + +This section complements the experimental results in the main text. Firstly, in §B.1, we present the performance of CASN when using the RoBERTa as the victim model for detection under scenario 1. Secondly, we will post the detection performance of the two victim models under scenario 2 (only detect the adversarial samples that successfully change the model output). Finally, we will show the performance of CASN for non-domain detection, illustrating some disadvantages of this approach. + +# B.1 Detection Scenario 1 + +The experimental results are consistent with Table 1. Under scenario 1 which requires detecting all samples generated by the adversarial algorithm, RDE is the state-of-art (SOTA) performance among the previous methods, while the proposed method significantly outperforms RDE under all datasets and attack algorithms. Although in detecting TextFollower-adj attack, CASN only has $F_{1}$ values of 79.5 and 91.6 on SST-2 and IMDB, respectively, it performs very well in the rest of the adversarial detection. + +# B.2 Detection Scenario 2 + +In scenario 2, we only require the detection algorithm to identify those adversarial samples that have successfully changed the model output. The comparison between Table 1 and Table 8 shows that, except for the detection performance on IMDB, both the feature density-based estimation method RDE and the low-frequency word detection method FGWS have significant performance improvements in this scenario. Moreover, the improvement of our method is much greater under the reduced difficulty setting, since the three datasets achieved an average of $6.6F_{1}$ value improvement under TextFooer-adj detection. + +# B.3 Transfer Detection + +To verify whether the proposed method can be used as a universal detection method without relying on domain data, we perform transfer detection experiments on score network trained on domain data. As shown in Table 9, the score network, after being trained on the features of the Source dataset, acts as an external detection component for the Target dataset, processing the output features of the Target dataset and detecting the adversarial samples. + +The experimental results show that the CASN still has some generalization ability regarding the detection within similar domains. For example, on the transfer detection from IMDB to SST-2, except for the detection of TextFooler-adj attack, other detections still have all AUROC values of over 94. However, on non-domain data, such as the bidirectional migration of AGNEWS and the remaining two datasets, it is almost impossible to detect any adversarial samples. This suggests that our approach relies greatly on domain data features and does not generalize well across domains. + +
DatasetMethodTextFooler-adjBAETextFoolerPWWS
\( F_1 \)AUROCACC\( F_1 \)AUROCACC\( F_1 \)AUROCACC\( F_1 \)AUROCACC
SST-2DISP53.3-78.052.6-70.061.7-69.564.2-72.0
MDRE69.6-68.870.0-71.180.0-79.476.0-75.6
FGWS68.068.864.667.965.959.170.569.463.772.376.869.6
MD68.964.059.272.169.865.575.273.969.574.370.367.6
RDE72.176.471.378.583.877.582.788.881.281.886.480.1
Ours (CASN)79.588.376.595.599.395.599.899.999.893.898.693.8
IMDBDISP61.0-59.669.7-64.271.7-65.668.3-62.5
MDRE70.2-69.871.3-70.872.8-72.170.3-70.0
FGWS77.583.276.179.684.577.580.785.978.982.288.681.2
MD74.975.570.177.179.573.077.880.773.976.478.172.1
RDE80.586.978.886.092.285.187.493.586.485.290.784.0
Ours (CASN)91.697.091.597.399.697.398.399.898.396.699.496.6
AGNEWSDISP61.0-86.277.7-85.988.2-89.186.0-89.0
MDRE62.4-66.371.6-73.880.3-81.275.8-77.3
FGWS79.180.578.876.376.574.379.180.578.885.286.986.5
MD68.868.258.075.079.771.379.285.778.176.582.474.3
RDE69.270.762.079.285.078.186.092.285.981.487.380.1
Ours (CASN)95.399.195.199.999.999.999.999.999.999.999.999.9
+ +Table 7: Performance of adversarial detection using RoBERTa as the victim model. + +
DatasetMethodTextFooler-adjBAETextFoolerPWWS
\( F_1 \)AUROCACC\( F_1 \)AUROCACC\( F_1 \)AUROCACC\( F_1 \)AUROCACC
SST-2FGWS76.575.678.074.875.070.673.975.668.378.082.575.5
RDE82.788.085.183.786.482.285.990.484.282.989.683.9
Ours (CASN)93.998.693.997.999.797.999.599.999.399.499.899.4
IMDBFGWS83.590.081.181.688.881.081.688.681.080.789.481.0
RDE86.292.184.985.692.984.585.991.785.282.988.080.8
Ours (CASN)98.899.898.799.199.999.999.299.799.199.599.899.7
AGNEWSFGWS82.483.984.683.084.280.085.889.285.287.984.283.0
RDE83.693.790.684.694.989.589.295.790.284.393.987.9
Ours (CASN)95.798.899.799.999.999.999.999.999.999.999.999.9
+ +Table 8: The results of detecting only the adversarial samples of successful attacks, i.e., scenario 2. We use BERT as the victim model, keeping the evaluation metrics consistent with the previous experiments. + +
SourceTargetTextFooler-adjBAETextFoolerPWWS
\( F_1 \)AUROCACC\( F_1 \)AUROCACC\( F_1 \)AUROCACC\( F_1 \)AUROCACC
SST-2IMDB79.683.175.978.381.874.577.881.173.879.482.775.6
AGNEWS67.759.654.370.371.362.872.176.664.275.275.968.0
IMDBSST-279.287.379.187.194.187.292.197.892.187.694.487.7
AGNEWS66.746.850.070.572.464.371.474.965.766.759.650.0
AGNEWSSST-266.966.854.073.578.271.270.271.864.169.870.363.8
IMDB72.277.569.775.881.774.377.482.876.370.676.370.2
+ +Table 9: The transfer detection experiments for CASN. The Source and Target denote domain and non-domain datasets, respectively. We train the score network on the Source dataset and subsequently utilize it for adversarial detection on the Target dataset. + +A For every submission: + +A1. Did you describe the limitations of your work? + +The limitation section is after the conclusion part of the thesis. + +A2. Did you discuss any potential risks of your work? + +The ethics statement section is after the conclusion part of the thesis. + +A3. Do the abstract and introduction summarize the paper's main claims? + +The abstract is at the beginning of the article and the introduction is Section 1. + +A4. Have you used AI writing assistants when working on this paper? + +Left blank. + +B Did you use or create scientific artifacts? + +Section 5 (Experimental Settings), Appendix A + +B1. Did you cite the creators of artifacts you used? + +Section 5 (Experimental Settings), Appendix A + +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? + +They are all open-source artifacts that are publicly available. + +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +They are all open-source artifacts that are publicly available. + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? + +They are all open-source artifacts that are publicly available, and do not contain this kind of private information. + +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? + +Section 5 (Experimental Settings), Appendix A.3 + +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. + +Section 5 (Experimental Settings), Appendix A.3 + +C Did you run computational experiments? + +The experimental part is in Section 6. + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +The Appendix A.3 + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +Section 5 (Experimental Settings), Section 6.2 (analysis), Appendix A.1 + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +Section 6.1 (Detection Performance) + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +Section 5 (Experimental Settings), Section 6(Experimental Results), Appendix A + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +No response. + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +No response. + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +No response. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +No response. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +No response. \ No newline at end of file diff --git a/casnclassawarescorenetworkfortextualadversarialdetection/images.zip b/casnclassawarescorenetworkfortextualadversarialdetection/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..be0bfca9f520c52513c9b26b5026f3bf69d52da6 --- /dev/null +++ b/casnclassawarescorenetworkfortextualadversarialdetection/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e4f9b8d1212669e52a9ef98502c123aec14c80700d584d9b0ddec93352c6576b +size 804214 diff --git a/casnclassawarescorenetworkfortextualadversarialdetection/layout.json b/casnclassawarescorenetworkfortextualadversarialdetection/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..12993c7d446896d1636d89b24353d52ba5efba36 --- /dev/null +++ b/casnclassawarescorenetworkfortextualadversarialdetection/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:254439423643ea0ffd4799d266e9fe186ad0e6a792057e0b6062c6312e5d2563 +size 571360 diff --git a/catacontextualizedconceptualizationandinstantiationframeworkforcommonsensereasoning/2d252726-be55-4a88-9bf3-304c461f1381_content_list.json b/catacontextualizedconceptualizationandinstantiationframeworkforcommonsensereasoning/2d252726-be55-4a88-9bf3-304c461f1381_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..9b93a1326cf31a9764970e0bcbf71008d4314787 --- /dev/null +++ b/catacontextualizedconceptualizationandinstantiationframeworkforcommonsensereasoning/2d252726-be55-4a88-9bf3-304c461f1381_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8e314159bb47467998befb745ea44c0c643aa311574441482596e41e3b3af37c +size 205683 diff --git a/catacontextualizedconceptualizationandinstantiationframeworkforcommonsensereasoning/2d252726-be55-4a88-9bf3-304c461f1381_model.json b/catacontextualizedconceptualizationandinstantiationframeworkforcommonsensereasoning/2d252726-be55-4a88-9bf3-304c461f1381_model.json new file mode 100644 index 0000000000000000000000000000000000000000..b9aac4589ec4a355f8b37f9ba8b936302fff537d --- /dev/null +++ b/catacontextualizedconceptualizationandinstantiationframeworkforcommonsensereasoning/2d252726-be55-4a88-9bf3-304c461f1381_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:af9441274ce8952e4497f5e0561b2426b479b50dbe36683985b044be28e250ba +size 243766 diff --git a/catacontextualizedconceptualizationandinstantiationframeworkforcommonsensereasoning/2d252726-be55-4a88-9bf3-304c461f1381_origin.pdf b/catacontextualizedconceptualizationandinstantiationframeworkforcommonsensereasoning/2d252726-be55-4a88-9bf3-304c461f1381_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..77146b67e7844eb04b29d65ffb81cbd4cddedef8 --- /dev/null +++ b/catacontextualizedconceptualizationandinstantiationframeworkforcommonsensereasoning/2d252726-be55-4a88-9bf3-304c461f1381_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:02047404d3ba5ccb8d5f1467d9865c8e33d63eaef4ce38726c3ac5f5cc7d1710 +size 1031452 diff --git a/catacontextualizedconceptualizationandinstantiationframeworkforcommonsensereasoning/full.md b/catacontextualizedconceptualizationandinstantiationframeworkforcommonsensereasoning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..14dd60c38f5eb797354f0a9e01ca3d3d4629fed9 --- /dev/null +++ b/catacontextualizedconceptualizationandinstantiationframeworkforcommonsensereasoning/full.md @@ -0,0 +1,649 @@ +# CAT: A Contextualized Conceptualization and Instantiation Framework for Commonsense Reasoning + +Weiqi Wang $^{1*}$ , Tianqing Fang $^{1*}$ , Baixuan Xu $^{1}$ , Chun Yi Louis Bo $^{1}$ , Yangqiu Song $^{1}$ , Lei Chen $^{1,2}$ + +$^{1}$ Department of Computer Science and Engineering, HKUST, Hong Kong SAR, China + +$^{2}$ Information Hub, HKUST (GZ), Guangzhou, China + +{wwangbw, tfangaa}@cse.ust.hk, bxuan@connect.ust.hk + +{cybo, yqsong}@cse.ust.hk, leichen@ust.hk + +# Abstract + +Commonsense reasoning, aiming at endowing machines with a human-like ability to make situational presumptions, is extremely challenging to generalize. For someone who barely knows about meditation, while is knowledgeable about singing, he can still infer that meditation makes people relaxed from the existing knowledge that singing makes people relaxed by first conceptualizing singing as a relaxing event and then instantiating that event to meditation. This process, known as conceptual induction and deduction, is fundamental to commonsense reasoning while lacking both labeled data and methodologies to enhance commonsense modeling. To fill such a research gap, we propose CAT (Contextualized ConceptuAlization and InsTantiation), a semi-supervised learning framework that integrates event conceptualization and instantiation to conceptualize commonsense knowledge bases at scale. Extensive experiments show that our framework achieves state-of-the-art performances on two conceptualization tasks, and the acquired abstract commonsense knowledge can significantly improve commonsense inference modeling. Our code, data, and fine-tuned models are publicly available at https://github.com/HKUST-KnowComp/CAT. + +# 1 Introduction + +"Concepts are the glue that holds our mental world together."—Murphy (2004) + +Commonsense reasoning is a crucial ability for machines to make situational presumptions and draw inferences from the knowledge that reflects our humans' understanding of situations and common facts (Davis, 1990; Davis and Marcus, 2015). It has gained increasing popularity in the Natural Language Processing (NLP) community with the emergence of CommonSense Knowledge Bases (CSKB) (Sap et al., 2019a; Speer et al., 2017; + +![](images/5e720f0128e388e1620386990e328ce2bcddcfb525a775b1a9888894ba1423bf.jpg) +Figure 1: A demonstration of commonsense reasoning on an unknown situation, PersonX plays with his dog, with the aid of abstract commonsense knowledge. Decontextualized conceptualization, such as observe, may yield wrong abstract commonsense knowledge that cannot be instantiated within the corresponding context. + +Hwang et al., 2021) and large language models (Bosselut et al., 2019; Rajani et al., 2019; Liu et al., 2022b; Su et al., 2022; Yu et al., 2022b). However, when encountering situations beyond the data given, more abstract background knowledge must be acquired and generalized to assist the reasoning (Tenenbaum et al., 2011), and language models trained with an autoregressive language modeling objective do not explicitly leverage such abstract knowledge during inference. + +Instead, humans rely on conceptual induction and deduction (Murphy, 2004) to make inferences on novel situations without the need to memorize all special cases. As shown in Figure 1, humans can derive conceptualizations based on the assertion that "PersonX watches a football game, as a result, he feels relaxed" to infer that "relaxing events can make someone feel relaxed," where the acquired abstract commonsense knowledge can be further used as general knowledge to perform reasoning on similar or associated situations. A new commonsense knowledge "PersonX plays with his dog, as a result, he feels happy and relaxed" can be deduced by instantiating relaxing events to playing with his dog. + +As the cornerstone of generalizable commonsense reasoning, such a process is extremely challenging for machines to replicate due to the absence of contextualized conceptualizations and abstract commonsense knowledge in CSKBs and a lack of relevant methodologies. + +Yet, existing works address the process of induction and deduction separately via conceptualization and instantiation. Several methods performing conceptualization are proposed with a specific focus on entity-level (Durme et al., 2009; Song et al., 2011; Gong et al., 2016; He et al., 2020; Peng et al., 2022; Song et al., 2015) and event-level (Chen et al., 2020; He et al., 2022) semantics. Instantiation (Allaway et al., 2023), as the process that simulates conceptual deduction, is tackled separately and not leveraged by these methods. Though abstract commonsense knowledge can be derived by using existing conceptualization methods to abstract a certain instance from factual commonsense knowledge, several limitations still exist. + +First, the plausibility of abstract commonsense knowledge banks on both the correctness of conceptualization and proper contextualization under specific assertions. The latter one, which is an essential step for the deduction of abstract knowledge, is missing from current methodologies. Take Figure 1 as an example, the concept observe will not necessarily lead to the result of "feeling relaxed", as observe omits the entertaining property of the original instance as a cost of abstraction. Second, instantiating abstract commonsense knowledge can yield much more and diverse concrete commonsense knowledge that can serve as an augmentation of the training dataset, while current methods undervalue such a process and only focus on conceptualization. Finally, the complex contextualization and conceptualization of commonsense knowledge can easily bring more than two orders of magnitude of data on top of the original dataset. This makes current labeled data scarce and infeasible for practitioners to annotate all of them, leaving a large amount of unlabeled data. + +To fill in these research gaps, we propose CAT (Contextualized ConceptuAlization and InsTantiation), a semi-supervised learning framework that unites event conceptualization and instantiation in cascade to conceptualize CSKBs and acquire abstract commonsense knowledge to aid commonsense reasoning. Inspired by how humans learn with concepts (Carey, 2004), we design a + +novel bootstrapping $^{1}$ method to enhance conceptualizations and abstract commonsense knowledge verification with the help of similar conceptualizations and instantiations as a reference. We demonstrate the effectiveness of CAT by using the acquired abstract commonsense knowledge to train COMET (Bosselut et al., 2019), a commonsense inference language model that generates if-then commonsense knowledge, and showing that our derived abstract commonsense knowledge can significantly improve commonsense inference modeling. + +Our contributions are three-fold: (1) We introduce a semi-supervised learning framework, CAT, to conceptualize CSKBs with the assistance of progressively bootstrapping similar abstract concepts or instantiations in the conceptualization process. (2) We use CAT to acquire abstract commonsense knowledge at scale with high quality, which can be used for commonsense inference modeling. (3) We demonstrate the effectiveness of our framework by achieving state-of-the-art performance on two CSKB conceptualization tasks and remarkably improving commonsense inference modeling with our derived abstract commonsense knowledge. + +# 2 Related Works + +Conceptualization and Instantiation. Many existing works have studied conceptualization and instantiation separately. Durme et al. (2009) first attempted to derive more general knowledge by abstracting over large sets of factoids obtained from WordNet (Miller, 1995) synsets. Song et al. (2011, 2015) and Gong et al. (2016) proposed to turn instances in a sentence into concepts via weight matching from Probase (Wu et al., 2012). Recently, Liu et al. (2022c) proposed a taxonomy-guided induction method to mine verb-oriented commonsense knowledge from verb phrases. Peng et al. (2022) constructed a conceptual knowledge benchmark to evaluate language models with three zero-shot probing tasks. While these works focus on the conceptualization of entities, He et al. (2022) constructed an event conceptualization benchmark based on ATOMIC (Sap et al., 2019a) by combining syntactic parsing, semantically heuristic matching, and human annotation. Besides, the line of works focusing on ultra-fine entity typing (Choi et al., 2018; Dai et al., 2021; Li et al., 2022) shared + +
DataTypeTrainDevTest
Dl#event107,38412,11711,503
#triple65,3868,4037,408
Du#event304,98336,02331,578
#triple4,851,272499,523570,400
+ +Table 1: Statistics of labeled data $D^l$ and unlabeled data $D^u$ in AbstractATOMIC. + +similar objectives of typing named entities, nominal nouns, and pronouns into a set of free-form phrases. Instantiation was attempted by Allaway et al. (2023), who proposed a controllable generative framework to probe valid instantiations for abstract knowledge automatically. Though Porada et al. (2021) and Peng et al. (2022) both proved that existing pretrained language models lack conceptual knowledge, none of existing works explicitly combine both techniques to derive abstract knowledge that is context-sensitive and generalizable. + +Commonsense Reasoning. Endowing NLP systems with the ability to perform commonsense reasoning is an elusive goal of artificial intelligence (Sap et al., 2020). A diverse collection of commonsense reasoning tasks have been proposed as evaluation benchmarks (Talmor et al., 2019; Omura et al., 2020; Ponti et al., 2020; Fang et al., 2021a). Among them, Bosselut et al. (2019) proposed a generative model, COMET, to learn to produce if-then commonsense knowledge as an effective approach toward modeling commonsense inference that can be applied in various commonsense reasoning tasks (Talmor et al., 2019). + +Semi-Supervised Learning. Semi-supervised learning (SSL) aims at taking advantage of unlabeled data to equip models with stronger generalization ability (van Engelen and Hoos, 2020). The most common approach is using pseudo labels (Iscen et al., 2019; Wang et al., 2022) to expose more unseen data to the student model. It has been applied in various machine learning tasks such as image classification (Liu et al., 2022a; Hu et al., 2021), text classification (Li et al., 2021; Meng et al., 2019; Xiao et al., 2019), commonsense knowledge base population (Fang et al., 2022), and named entity recognition (Liu et al., 2021; Chen et al., 2021). + +# 3 Problem Definition + +Definition. Conceptualizing an event-centric CSKB to derive abstract commonsense knowledge + +comprises two steps (He et al., 2022): event conceptualization and triple conceptualization. + +Denote the triples in the original CSKB as $D_{o} = \{(h_{o},r,t)|h_{o}\in H_{o},r\in R,t\in T\}$ , where $H_{o},R$ and $T$ are the set of heads, relations, and tails in the original CSKB. The first step only operates on head events without considering the context in $r$ and $t$ . The goal of event conceptualization is to produce conceptualized head event $h_a$ from the original head $h_o$ to represent an abstraction of $h_o$ . In the second step, the task is to verify whether the conceptualized head $h_a$ still makes sense in the context of $r$ and $t$ , as $r$ and $t$ will further restrict the level of abstractness in $h_a$ . As shown in Figure 1, conceptualizing watch football game to observe is wrong within the context of having feel relaxed as a result. Plausible $(h_a,r,t)$ triples will be considered as valid abstract commonsense knowledge. + +Specifically, in the first step, there are two ways of conceptualizing head events alone: a retrieval-based discriminative way and a generative way. The retrieval-based discriminative paradigm identifies and links a component $i$ in $h_{o}$ to a concept $c$ in a concept taxonomy $C$ to form a conceptualization $h_{a}$ by replacing $i$ with $c$ . The model needs to verify whether $h_{a}$ is a valid conceptualization of $h_{o}$ . The generative paradigm aims to generate a $h_{a}$ directly given $h_{o}$ and the designated component $i$ in $h_{o}$ . + +Formally, denote the annotated dataset in the first step, event conceptualization, as $D_h^l = \{(h_o, h_a, y) | h_o \in H_o, h_a \in H_a, y \in \{0, 1\}\}$ , where $h_o$ is an original head event without conceptualization, $h_a$ is a corresponding conceptualization of $h_o$ , and $y$ is the human-annotated label indicating whether such a conceptualization is plausible or not. The labeled dataset in the second step, triple conceptualization, is denoted as $D_t^l = \{(h, r, t, y) | h \in H_a, r \in R, t \in T, y \in \{0, 1\}\}$ , where $h$ is a conceptualized head event from the first step, $r$ and $t$ are a relation and a tail from the original CSKB accompanied with the corresponding original head $h_o$ , and $y$ is the human-annotated label indicating whether such abstract commonsense knowledge, in the form of a conceptualized triple, is plausible or not. Besides labeled datasets, unlabeled datasets are defined similarly as $D_h^u$ and $D_t^u$ only with the difference that labels $y$ are missing. Thus, the task objective for discriminative event conceptualization is to determine whether a $h_o$ can be properly abstracted using $h_a$ , where $h_a$ is derived by replacing a component $i \subset h_o$ with + +![](images/b8cd2f5ff70010cc258bb19bb0f453a1d9dd5ce9b534c6906fd8160df50e80a8.jpg) +Figure 2: Overview of our CAT framework. A running example that conceptualizes the triple (PersonX is on vacation, xIntent, have fun) is presented in the figure, where the head is conceptualized first, and the model needs to determine whether the conceptualized triple still holds after the event conceptualization. + +its linked concept $c$ from a concept taxonomy $C$ . The task objective for generative event conceptualization is to generate $h_a$ directly from $h_o$ with text generation models. For the triple conceptualization task, the objective is to distinguish whether a conceptualized triple $(h_a, r, t)$ , representing abstract commonsense knowledge, is plausible or not. + +Dataset. To study conceptualization over CSKBs, we use the AbstractATOMIC dataset provided by He et al. (2022) as the benchmark. In AbstractATOMIC, ATOMIC is used as the original CSKB. And the event conceptualization adopts a discriminative way, where a syntactic parsing schema is defined to identify the components $i$ in $h_{o}$ to be heuristically linked to concept taxonomies Probase (Wu et al., 2012) and WordNet (Miller, 1995) to form conceptualized $h_{a}$ . Such a heuristic can produce over 32 times more candidate conceptualized head events and over 10 times more conceptualized triples compared with the original ATOMIC, as the number of retrieved concepts from the concept taxonomy $C$ can be manually controlled to acquire a large number of conceptualizations. Triple conceptualization is defined as predicting the plausibility of the triples whose head is conceptualized. Only 131K $(26\%)$ conceptualizations of 7K $(45\%)$ ATOMIC head events and 81K $(1.3\%)$ conceptualized triples are manually annotated. + +tated as $D_h^l$ and $D_t^l$ , while others remain unlabeled $D_h^u$ and $D_t^u$ . The trn/dev/tst partition follows the same split as in the original ATOMIC. Statistics and more detailed explanations of AbstractATOMIC are shown in Table 1 and Appendix A. + +# 4 CAT Framework + +This section introduces our proposed Contextualized Conceptualization and InsTantiation (CAT) framework for conceptualizing commonsense knowledge bases and acquiring abstract commonsense knowledge. An overview is presented in Figure 2. Our motivation is two-fold: first, adding instantiation after conceptualization to form a cycle can strongly benefit two conceptualization tasks simultaneously. On the one hand, instantiating conceptualized triple relies on the correctness of event conceptualization. On the other hand, properly conceptualized triples can benefit event conceptualization via instantiation by providing more context brought by $(r,t)$ . Second, to address the lack of annotations, we resort to pseudo labeling, a typical semi-supervised learning approach to automatically assign pseudo labels to the vast majority of unlabeled data using a teacher model. + +Following He et al. (2022), we study the retrieval-based discriminative paradigm of event conceptualization and leave the generative paradigm as an intrinsic evaluation. In CAT, + +we unify event conceptualization and triple conceptualization into one cycle and make them mutually benefit each other through instantiation and conceptualization. Our framework can be summarized into four steps: + +(1) Train teacher models for both event conceptualization and triple conceptualization on the labeled dataset $D_h^l$ and $D_t^l$ , respectively. Use the two teachers to assign pseudo labels to unlabeled datasets. +(2) Conduct alternative conceptualization or instantiation on labeled and pseudo-labeled data. +(3) Bootstrap (aggregate) the alternative concepts and instances in the second step using natural language prompt templates and train student models on both labeled and pseudo-labeled data. +(4) Use the student models to refine the pseudo labels and then re-train the student models. + +# 4.1 Teacher Model Training + +Two teacher models on both event and triple conceptualization tasks are trained separately on the labeled dataset $D_h^l$ and $D_t^l$ . As both tasks are inherently text/triple classification, we adopt KG-BERT (Yao et al., 2019) as the skeleton of our models. The event conceptualization model determines whether $h_a$ is a valid conceptualization of $h_o$ , and the triple conceptualization model determines whether a conceptualized triple $(h_a, r, t)$ is plausible or not. The two models $\theta$ are trained on annotated examples $x_i$ with a cross-entropy loss (Eq. 1) and used to provide pseudo labels to instances from the unlabeled datasets $D_h^u$ and $D_t^u$ . Two thresholds, $T^+$ and $T^-$ , are set to determine the pseudo labels of unlabeled examples with high confidence. Examples with a pseudo-labeled score higher than $T^+$ will be labeled $y_i = 1$ , and those lower than $T^-$ will be labeled $y_i = 0$ . The rest will be discarded. + +$$ +L \left(x _ {i}, \theta\right) = - \sum_ {i = 1} ^ {| x |} y _ {i} \log \left(\theta \left(x _ {i}\right)\right) \tag {1} +$$ + +# 4.2 Alternative Conceptualization and Instantiation + +According to Murphy (2004), when humans learn a new concept, we pre-extract similar known concepts in our minds and infer possibly equivalent unknown concepts on the fly. Inspired by this theory, we retrieve additional abstract concepts or instantiated events to help discriminate conceptualizations and abstract commonsense knowledge. For event conceptualization, we retrieve some alternative pos + +sible conceptualizations of $h_{o}$ to accompany the learning of $h_{a}$ . Additional conceptualizations of $h_{o}$ from both labeled and pseudo-labeled examples are predicted again by the teacher model and ranked according to their plausibility score prediction. And top $m$ conceptualizations are retrieved with $m$ being a hyperparameter to control the number of retrievals. For triple conceptualization, we perform instantiation in cascade to instantiate $c$ to some concrete instances to assist the learning process. Possible instantiations of $c$ are extracted from annotated and pseudo-labeled event conceptualizations by searching for conceptualized events $h_{a}^{\prime} \in H_{a}$ other than $h_{a}$ with $c$ as the concept and extracting their corresponding instances $i \subset h_{a}^{\prime}$ . Similarly, the instances are then scored by the teacher model, and the top $n$ of them are retrieved. Intuitively, alternative event conceptualizations can serve as hints for discriminating the correctness of the target conceptualization, and instantiations can carry additional contextualized information to help verify the plausibility of a conceptualized triple, which meets the objective of deriving abstract commonsense knowledge that is context-sensitive. + +# 4.3 Prompt Aggregation + +We then bootstrap the retrieved alternative conceptualizations/instantiations via natural language prompts. Here bootstrap (Carey, 2004) can be understood as binding the alternative retrievals and the target concept/triple together to strengthen the discrimination of the target concept/triple. As shown in Figure 2 step (3), the initially given input and retrieved concepts/instances are concatenated via human-defined prompts for both conceptualization tasks. Alternative concepts/instances are sorted in the order of their plausibility score ranking. Two student models $S_{h}$ and $S_{t}$ for both tasks are trained using the modified text with such prompts as inputs. They are expected to learn the bootstrapping connectionism between the target and the additional retrievals we provided. More detail about the prompt design is in Appendix B. + +# 4.4 Pseudo-Label Refinement + +All pseudo labels, initially derived by a teacher model trained on the original labeled dataset, are relabeled according to the plausibility score predicted by our newly enhanced student models $S_{h}$ and $S_{t}$ . Similar to the teacher model, two thresholds, $T^{+}$ and $T^{-}$ , are applied to distinguish positive and negative examples for both tasks. In addition, negative + +
FrameworkBackbone PTLM / MethodEvent ConceptualizationTriple Conceptualization
ValidationTestingValidationTesting
Supervised LearningBERT-base 110M82.4±0.0582.5±0.3171.2±0.5872.6±0.71
BERT-large 340M82.8±0.4883.1±0.8072.4±0.0173.7±0.00
BART-base 139M83.8±0.2884.4±0.3272.0±0.0972.6±0.15
BART-large 406M85.0±0.1385.2±0.2274.5±0.1376.2±0.19
RoBERTa-base 110M84.1±0.0484.5±0.1972.2±0.0074.1±0.00
RoBERTa-large 340M85.2±0.2485.5±0.0275.3±0.0076.9±0.01
DeBERTa-v3-base 214M85.1±0.0885.8±0.0773.9±0.1075.9±0.04
DeBERTa-v3-large 435M85.8±0.0586.2±0.1576.9±0.0378.0±0.02
ELECTRA-base 110M85.4±0.0585.8±0.0274.3±0.2776.2±0.12
ELECTRA-large 340M84.7±0.4785.3±0.3875.6±0.0177.9±0.06
GPT2-base 117M60.0±0.0659.1±0.1452.8±0.1455.9±0.11
GPT2-medium 345M61.2±0.1160.3±0.0854.6±0.1757.4±0.09
GPT2-large 774M64.1±0.0562.7±0.0860.5±0.1159.8±0.06
GPT2-XL 1558M64.2±0.1963.6±0.2262.2±0.0861.5±0.10
Semi-Supervised LearningUDA (TF-IDF)83.6±0.2983.6±0.2475.8±1.2676.8±1.34
UDA (back-trans.)83.4±0.2783.6±0.2475.8±1.2576.8±1.34
Noisy-Student86.4±0.0586.5±0.0975.4±0.6476.7±0.59
PseudoReasoner (BERT-base)83.3±0.1184.0±0.2473.0±0.1474.1±0.33
PseudoReasoner (RoBERTa-large)86.6±0.2586.7±0.3376.3±0.1277.2±0.21
CAT (Semi-Supervised)BERT-base 110M87.1±0.0687.4±0.1174.3±0.2676.3±0.38
BERT-large 340M87.7±0.1688.0±0.1975.8±0.2377.8±0.36
BART-base 139M88.2±0.0988.2±0.0975.7±0.0978.0±0.14
BART-large 406M88.6±0.0788.7±0.1077.2±0.1279.0±0.14
RoBERTa-base 110M88.4±0.1288.3±0.0876.9±0.1678.0±0.19
RoBERTa-large 340M89.0±0.1588.8±0.2078.2±0.0879.4±0.14
DeBERTa-v3-base 214M88.8±0.1288.9±0.0877.5±0.1079.9±0.07
DeBERTa-v3-large 435M89.1±0.0589.2±0.1478.7±0.1680.0±0.33
ELECTRA-base 110M88.7±0.1088.9±0.1074.9±0.1575.5±0.40
ELECTRA-large 340M88.6±0.7788.5±0.7074.9±0.1575.5±0.40
+ +Table 2: Performance (%) by our CAT framework on the discriminative event conceptualization and triple conceptualization tasks. We report the average AUC score and standard deviation across experiments with three random seeds. The best performances within each framework are underlined, and the best among all models are bold-faced. + +labels are assigned to triples whose conceptualized head events are predicted as wrong conceptualizations by $S_{h}$ , as wrong conceptualizations will not yield plausible abstract commonsense knowledge. + +# 4.5 Application and Evaluation of CAT + +The resulting models of CAT include an event conceptualization model and a triple conceptualization model, both fine-tuned on the refined pseudo labels and the labeled data. These two models can be used to conceptualize ATOMIC to a larger commonsense knowledge base on a more abstract level. We further conduct intrinsic evaluations on the acquired event conceptualization model under a generative event conceptualization paradigm and extrinsic evaluations on the resulting conceptualized CSKB with commonsense inference modeling task (COMET; Bosselut et al. (2019)) in Section 5. Here we select COMET as the representative because it is a general commonsense model that can be applied to various downstream commonsense reason + +ing tasks such as SocialIQA (Sap et al., 2019b), self-talk (Shwartz et al., 2020), and CSKB completion (Malaviya et al., 2020). Meanwhile, generative event conceptualization enables performing automatic conceptualization scalably. Both are important applications and evaluations of CAT. + +# 5 Experiments + +We conduct conceptualization experiments using CAT in Section 5.1 and generative experiments as evaluations in Section 5.2. These experiments demonstrate that CAT has a strong capability in conceptualizing CSKBs, and better conceptualization modeling can help populate more novel and diverse commonsense knowledge and thus help commonsense modeling (COMET). + +# 5.1 CSKB Conceptualization + +Baselines. We collectively introduce the baselines for both event and triple conceptualization tasks, as they are inherently classification tasks. + +
Training DataBLEU-1BLEU-2METEORROUGE-LCIDErHuman
DevTestDevTestDevTestDevTestDevTestDevTest
Dh+D0.9573.071.170.263.048.147.171.470.763.666.992.893.3
Dh+D0.971.371.965.263.845.746.769.871.363.467.990.591.0
Dh+D0.868.268.465.964.044.844.066.666.760.062.086.085.7
Dh+D0.766.567.257.262.643.043.465.965.860.461.279.080.3
Dh+D0.564.962.458.351.141.240.963.863.058.259.474.579.0
Dl67.665.356.853.143.543.165.766.660.260.970.081.5
Zero-Shot20.217.06.804.115.804.703.803.001.901.6015.011.5
+ +Table 3: Performance (\%) of GPT2 (XL) on the generative event conceptualization task. $D_h^l$ stands for annotated labeled data, and $D^u$ stands for the data acquired by CAT. The underfoot value indicates the threshold for selecting plausible pseudo labels. The best performances are bold-faced, and the second-best ones are underlined. + +AUC is used as the evaluation metric. Under a supervised learning setting, we apply KG-BERT (Yao et al., 2019) model with BERT (Devlin et al., 2019), BART (Lewis et al., 2020), RoBERTa (Liu et al., 2019), DeBERTa (He et al., 2021, 2023), and ELECTRA (Clark et al., 2020) as the backbone language models. We also attempt to leverage supervised generative language models as baselines. GPT2 (Radford et al., 2019) models are trained with a text generation objective only on positive examples, and we use perplexity as the prediction scores to calculate AUC. For the semi-supervised learning baselines, we leverage UDA (Xie et al., 2020a), NoisyStudent (Xie et al., 2020b), and PseudoReasoner (Fang et al., 2022) with RoBERTa-large being the backbone model. Additional explanations can be found in Appendix C.1.1. + +Discriminative Results. The results for both tasks are presented in Table 2. Under a supervised learning setting, KG-BERT family mostly performs better on both tasks than GPT2 due to the fact that GPT2 is only fine-tuned on positive examples and thus cannot learn from negative examples that contain wrong conceptualizations and implausible abstract commonsense knowledge. As for the semi-supervised learning setting, previous SSL baselines are rather limited in improving the performance against supervised learning. The best PseudoReasoner only improves by $0.5\%$ and $0.3\%$ on the test set for both tasks compared with supervised RoBERTa-large models. Instead, models trained with CAT can outperform all other training methodologies. Comparing the test set performance with PseudoReasoner, small backbone models (BERT-base) can improve by $3.4\%$ and $2.2\%$ , and large models (RoBERTa-large) can be improved by $2.1\%$ and $2.2\%$ . This shows pipelining two-step concep + +tualizations as a loop and leveraging our proposed bootstrapping-based method can yield a larger performance gain compared with simply applying a semi-supervised learning strategy. Due to limited space, ablation studies on framework components and the semi-supervised learning paradigm of CAT are conducted in Appendix C.1.4. For example, the results indicate that bootstrapping alternative conceptualization and instantiation plays the most important role in assisting learning conceptualization among all components of CAT. Additional results and a computational cost study can be found in Appendix C.1.3 and Appendix D. + +# 5.2 Application and Evaluation of CAT + +As CAT is a framework for acquiring conceptualized commonsense knowledge, including both conceptualized head events (from $h_{o}$ to $h_{a}$ ) and abstract commonsense triples $(h_{a}, r, t)$ , we assess these pseudo-labeled outcomes via two generative tasks with various threshold tuning as evaluations. + +Generative Event Conceptualization. To intrinsically evaluate the effectiveness of CAT's event conceptualization, we use the acquired conceptualized head events as training data to learn a generative event conceptualizer. Specifically, the models are trained with instance-conceptualizations pairs in the format of “ is an instance of ”. At the evaluation phase, the model is prompted with “ is an instance of [GEN]” where is the instance to be conceptualized and [GEN] is the generation token. We then retrieve the top-1 generation and compare it against the target set from the evaluation dataset to compute four NLG metrics, as listed in Appendix C.2.1. These scores can be regarded as an approximation of the top-1 generations' recall. + +
Training DataBLEU-1BLEU-2BLEU-3BLEU-4METEORROUGE-LCIDEr
DevTestDevTestDevTestDevTestDevTestDevTestDevTest
Zero-Shot5.424.891.841.510.650.520.260.216.505.706.405.901.601.20
ATOMIC (subset)38.138.125.425.718.718.815.515.714.914.933.033.227.627.8
+Dl38.138.524.825.517.818.414.715.215.315.633.133.726.827.3
+Finetune38.639.025.826.618.919.715.716.415.115.433.634.428.830.0
+DuAbs,ATM.40.040.327.127.820.020.816.517.516.116.335.335.731.631.7
+Finetune40.140.527.127.820.120.816.717.416.216.435.435.931.831.7
+Dl + DuAbs,ATM.40.240.626.227.419.020.415.116.816.316.535.035.431.031.3
+Finetune40.040.426.026.918.719.715.016.116.316.435.035.430.330.7
+DuCAT41.241.928.129.020.721.516.517.816.616.935.936.533.433.7
+Finetune41.142.028.029.020.421.516.417.616.617.036.036.833.233.8
+Dl + DuCAT39.940.526.227.419.320.616.017.416.016.235.035.430.831.3
+Finetune40.441.026.627.619.520.716.117.116.216.535.435.831.331.5
+ +Table 4: Performances (\%) of GPT2 (XL) on commonsense inference modeling task (COMET). $D_{t}^{l}$ stands for annotated abstract triples, and $D_{\mathrm{CAT}}^u$ stands for abstract triples acquired by CAT. $D_{\mathrm{Abs.ATM}}^u$ contains triples that are pseudo-labeled by a supervised RoBERTa discriminator, as done by He et al. (2022). The best performances are bold-faced. Finetune refers to fine-tuning back on the ATOMIC subset. + +Additionally, we uniformly sample 500 generations from each evaluation split and conduct expert annotations on the plausibility of each conceptualization to ensure that out-of-domain concepts can be properly evaluated. The experts are asked to determine whether each top-1 generation is indeed a plausible conceptualization or not, such that the top-1 generations' precision is reflected. Thus, current evaluation measures jointly evaluate the top-1 generations' precision and recall, which makes it robust and non-easy to be impacted by repetition problems (Li et al., 2020). Zero-shot GPT2 and GPT2 fine-tuned on the originally labeled event conceptualizations in $D_h^l$ are used as baselines. We also study the effect of the threshold $T^{+}$ that selects plausible conceptualized heads, where higher thresholds indicate higher plausibility regarded by CAT. The results are presented in Table 3. With a relatively high threshold, generators trained on a mixture of pseudo-labeled data by CAT and annotated concepts significantly outperform the baselines in every automated metric. A plausible rate of $93.3\%$ is maximally achieved on the test set, which is $11.8\%$ higher than the baseline. Gradually reducing the threshold also decreases the performance, indicating abstract heads with lower plausibility scores can be of poorer quality. Such results indicate that CAT can produce high-quality event conceptualizations for generative models to learn better conceptualizers without the need to annotate a large number of data. + +Commonsense Inference Modeling (COMET). The second component of CAT produces triple + +level abstract commonsense knowledge. We evaluate these abstract commonsense triples with a commonsense inference task that generates commonsense tails given heads and relations as inputs, as in COMET (Bosselut et al., 2019). Following He et al. (2022), we apply the same training and evaluation process to the models. The base training data we use are a subset of ATOMIC triples corresponding to those annotated abstract triples in $D_{t}^{l}$ , which contains 17K (3.7%) among the original ATOMIC. We derive abstract commonsense knowledge using CAT from a subset of $D_{t}^{u}$ where the heads correspond to those in the ATOMIC subset to ensure no data leakage, denoted as $D_{\mathrm{CAT}}^{u}$ . GPT2 is fine-tuned on the ATOMIC subset, the annotated abstract triples $D_{t}^{l}$ , the abstract knowledge verified by CAT, or their combinations. The commonsense generation results are presented in Table 4. Similar to COMET (Bosselut et al., 2019), all models are evaluated on the original ATOMIC's full validation and testing sets. The best result is achieved using a mixture of the ATOMIC subset and abstract triples pseudo-labeled by our framework, with 0.95 as the threshold for selecting plausible triples. This indicates high-quality abstract commonsense triples can indeed provide a more general view of the original commonsense knowledge, thus helping commonsense inference. Additionally, training with our pseudo-labeled examples outperforms training with those annotated triples in AbstractATOMIC, which also validates the effectiveness of our model that leverages a large amount of unlabeled data. To further investigate how conceptual knowledge + +![](images/ffec83425e25427ae4ef7e4370d672e9869fe0be21f5bb9417184f744cae0511.jpg) +Figure 3: Ablation study on the number of retrieved conceptualizations/instantiations for CAT framework. + +improves commonsense inference modeling, we conduct more empirical analysis in Section 5.4. Additional experiment results with other thresholds and case studies can be found in Appendix C.2.3 and Appendix E, respectively. + +# 5.3 Number of Retrieved Alternative Conceptualizations and Instantiations. + +We then study the ablation of bootstrapping different numbers of alternative conceptualizations/instantiations (denoted as #retrieval) in our CAT framework. For simplicity, when tuning the #retrieval for one task, the #retrieval of the other task is fixed at the best value we acquired. We plot the test AUC score with #retrieval from 0 to 11 using BERT-base as the backbone model in Figure 3. #retrieval=0 refers to training with a simple student-teacher framework without bootstrapping alternative conceptualizations and instantiations. For event conceptualization, the performance generally positively correlates with the number of retrievals, while it starts dropping after 9. A reversed trend is observed for triple conceptualization, where using only two instances achieves the best performance. One possible reason is that in triple conceptualization, the retrieved instances are events and much longer than the retrieved concepts in event conceptualization, and aggregating various alternative events for a triple will cause language models to be less sensitive to the semantics of the original triple (Holtzman et al., 2020). + +# 5.4 The Effect of Abstract Knowledge + +We finally study the effect of abstract commonsense knowledge acquired by CAT by studying the semantic overlaps between training and testing data. We sort the test set by the BERTScore (Zhang + +![](images/2b5dd8c16df6e28a3e29e8262088f0a70da210001cd3c2ad5e25cb140dbef85e.jpg) +Figure 4: Comparison of performance improvement by GPT2 generator trained on the conceptualization-aided ATOMIC subset for two groups of testing head events. + +et al., 2020b) between each individual testing entry against the whole training set in the original ATOMIC and split them in half to acquire two test groups. The testing entries with lower BERTScore on the training set indicate a larger semantic shift from the training set (Deutsch and Roth, 2021), which is also harder for models to discriminate (Hsu et al., 2020). We denote the testing group with a lower BERTScore as "Difficult" and the other half as "Easy". The performance gain on the two test set splits between the best conceptualization-aided COMET and the COMET trained on the ATOMIC subset only is reported in Figure 4. We can observe that training COMET with abstract commonsense knowledge leads to a larger improvement for harder test examples dissimilar from the original training set, indicating that introducing extra abstract commonsense knowledge can help COMET become more generalizable to harder test sets. + +# 6 Conclusion + +In conclusion, this paper proposes CAT, a semi-supervised learning framework for commonsense reasoning, by leveraging the power of abstract commonsense knowledge. By achieving state-of-the-art performances in CSKB conceptualization tasks, we remarkably improve modeling commonsense inference, as an important cornerstone of many commonsense reasoning tasks. Our analysis also demonstrates that high-quality abstract commonsense knowledge can benefit commonsense inference modeling by providing more generalizability on hard commonsense knowledge. We hope this work can draw insights toward commonsense reasoning from a conceptualization perspective. + +# Limitations + +Our framework manually sets thresholds $T^{+}$ and $T^{-}$ in pseudo labeling by observations of data quality and hyperparameter searching. Dynamic threshold tuning (Xu et al., 2021) or meta pseudo labels (Pham et al., 2021; Li et al., 2021) can be implemented to better filter pseudo-labeled examples. And the thresholds for different tasks can be tuned separately to improve the models' generalizability. + +Recently, large generative language models such as GPT3.5 (Brown et al., 2020) and ChatGPT² (Ouyang et al., 2022; Gao et al., 2022) have demonstrated their strong potential on various NLP tasks including probing abstract commonsense knowledge with in-context learning (Brown et al., 2020; Xie et al., 2022). Due to our limited access, we did not conduct fully-scaled experiments in our paper. A short discussion with case studies is provided in Appendix E.3. + +While our framework only operates on AbstractATOMIC as the conceptualization of ATOMIC, it's also worthy of verifying our framework on other CSKBs such as ATOMIC2020 (Hwang et al., 2021), GLUCOSE (Mostafazadeh et al., 2020), ATOMIC10X (West et al., 2022), FolkScope (Yu et al., 2022a) and eventuality CSKB such as ASER (Zhang et al., 2020a, 2022) and constructing large conceptualized CSKB benchmarks. In addition, we only evaluated the power of the acquired abstract commonsense knowledge on the commonsense knowledge generation task (COMET), while other commonsense reasoning tasks remain future works (Wang et al., 2023a), such as COLA (Wang et al., 2023b), CommonsenseQA (Talmor et al., 2019, 2021), SocialIQA (Sap et al., 2019b), Winograd Schema Challenge (Levesque et al., 2012), PIQA (Bisk et al., 2020), Abductive Commonsense Reasoning (Bhagavatula et al., 2020), and Winogrande (Sakaguchi et al., 2020). + +# Ethics Statement + +This paper introduces CAT, a framework for commonsense reasoning via conceptualizing CSKB to acquire abstract commonsense knowledge. The experiments are conducted on publicly available and well-established datasets that are shared via open-access licenses. The usage of these datasets in our paper is only for research purposes and is consistent with the datasets' intended usage. The + +primary dataset, AbstractATOMIC, largely shares the content with another CSKB, ATOMIC, which is anonymized and desensitized (Sap et al., 2019a). Thus, no data privacy issue is involved. + +The potential risks of CAT are relatively low. Since CAT is trained on AbstractATOMIC, a conceptualization benchmark based on a popular CSKB, ATOMIC, and two concept taxonomies, Proabse and WordNet, it is expected that CAT does not contain any private, offensive, biased, and sensitive information or social, political issues. The studied tasks all focus on conceptualization or CSKB, which is not likely to generate harmful content, as shown in the case studies in Appendix E. Thus, we believe that CAT does not yield additional risks. + +# Acknowledgements + +The authors would like to thank the anonymous reviewers for their constructive comments. The authors of this paper are supported by the NSFC Fund (U20B2053) from the NSFC of China, the RIF (R6020-19 and R6021-20), and the GRF (16211520 and 16205322) from RGC of Hong Kong, the MHKJFS (MHP/001/19) from ITC of Hong Kong and the National Key R&D Program of China (2019YFE0198200) with special thanks to HKMAAC and CUSBLT. We also thank the UGC Research Matching Grants (RMGS20EG01-D, RMGS20CR11, RMGS20CR12, RMGS20EG19, RMGS20EG21, RMGS23CR05, RMGS23EG08). + +# References + +Emily Allaway, Jena D. Hwang, Chandra Bhagavatula, Kathleen Mckeown, Doug Downey, and Yejin Choi. 2023. Penguins don't fly: Reasoning about generics through instantiations and exceptions. In Proceedings of the 17th Conference of the European Chapter of the Association for Computational Linguistics, pages 2610-2627, Dubrovnik, Croatia. Association for Computational Linguistics. +Mostafa M. Amin, Erik Cambria, and Björn W. Schuller. 2023. Will affective computing emerge from foundation models and general ai? A first evaluation on chatgpt. CoRR, abs/2303.03186. +Chandra Bhagavatula, Ronan Le Bras, Chaitanya Malaviya, Keisuke Sakaguchi, Ari Holtzman, Hannah Rashkin, Doug Downey, Wen-tau Yih, and Yejin Choi. 2020. Abductive commonsense reasoning. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net. +Ning Bian, Xianpei Han, Le Sun, Hongyu Lin, Yaojie Lu, and Ben He. 2023. Chatgpt is a knowledgeable + +but inexperienced solver: An investigation of commonsense problem in large language models. CoRR, abs/2303.16421. +Yonatan Bisk, Rowan Zellers, Ronan Le Bras, Jianfeng Gao, and Yejin Choi. 2020. PIQA: reasoning about physical commonsense in natural language. 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 7432-7439. AAAI Press. +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 Conference of the Association for Computational Linguistics, ACL 2019, Florence, Italy, July 28- August 2, 2019, Volume 1: Long Papers, pages 4762-4779. Association for Computational Linguistics. +Andrew P. Bradley. 1997. The use of the area under the ROC curve in the evaluation of machine learning algorithms. Pattern Recognit., 30(7):1145-1159. +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. +Susan Carey. 2004. Bootstrapping & the origin of concepts. Daedalus, 133(1):59-68. +Chunkit Chan, Jiayang Cheng, Weiqi Wang, Yuxin Jiang, Tianqing Fang, Xin Liu, and Yangqiu Song. 2023. Chatgpt evaluation on sentence level relations: A focus on temporal, causal, and discourse relations. CoRR, abs/2304.14827. +Muhao Chen, Hongming Zhang, Haoyu Wang, and Dan Roth. 2020. What are you trying to do? semantic typing of event processes. In Proceedings of the 24th Conference on Computational Natural Language Learning, CoNLL 2020, Online, November 19-20, 2020, pages 531-542. Association for Computational Linguistics. +Weile Chen, Huiqiang Jiang, Qianhui Wu, Börje Karlsson, and Yi Guan. 2021. Advicker: Effectively leveraging unlabeled data via adversarial discriminator for cross-lingual NER. 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 743-753. Association for Computational Linguistics. +Eunsol Choi, Omer Levy, Yejin Choi, and Luke Zettlemoyer. 2018. Ultra-fine entity typing. 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 87-96. 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 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net. +Hongliang Dai, Yangqiu Song, and Haixun Wang. 2021. Ultra-fine entity typing with weak supervision from a masked language model. 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 1790-1799. Association for Computational Linguistics. +Ernest Davis. 1990. Representations of commonsense knowledge. notThenot Morgan Kaufmann series in representation and reasoning. Morgan Kaufmann. +Ernest Davis and Gary Marcus. 2015. Commonsense reasoning and commonsense knowledge in artificial intelligence. Commun. ACM, 58(9):92-103. +Daniel Deutsch and Dan Roth. 2021. Understanding the extent to which content quality metrics measure the information quality of summaries. In Proceedings of the 25th Conference on Computational Natural Language Learning, CoNLL 2021, Online, November 10-11, 2021, pages 300-309. 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. +Li Du, Xiao Ding, Ting Liu, and Zhongyang Li. 2019. Modeling event background for if-then commonsense reasoning using context-aware variational autoencoder. 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 2682-2691. Association for Computational Linguistics. +Benjamin Van Durme, Phillip Michalak, and Lenvhart K. Schubert. 2009. Deriving generalized knowledge from corpora using wordnet abstraction. In EACL 2009, 12th Conference of the European Chapter of the Association for Computational Linguistics, Proceedings of the Conference, Athens, Greece, March 30 - April 3, 2009, pages 808-816. The Association for Computer Linguistics. +Tianqing Fang, Quyet V. Do, Sehyun Choi, Weiqi Wang, and Yangqiu Song. 2023. Ckbp v2: An expert-annotated evaluation set for commonsense knowledge base population. CoRR, abs/2304.10392. +Tianqing Fang, Quyet V. Do, Hongming Zhang, Yangqiu Song, Ginny Y. Wong, and Simon See. 2022. Pseudoreasoner: Leveraging pseudo labels for commonsense knowledge base population. In Findings of the Association for Computational Linguistics: EMNLP 2022, Abu Dhabi, United Arab Emirates, December 7-11, 2022, pages 3379-3394. Association for Computational Linguistics. +Tianqing Fang, Weiqi Wang, Sehyun Choi, Shibo Hao, Hongming Zhang, Yangqiu Song, and Bin He. 2021a. Benchmarking commonsense knowledge base population with an effective evaluation dataset. 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 8949-8964. Association for Computational Linguistics. +Tianqing Fang, Hongming Zhang, Weiqi Wang, Yangqiu Song, and Bin He. 2021b. DISCOS: bridging the gap between discourse knowledge and commonsense knowledge. In WWW '21: The Web Conference 2021, Virtual Event / Ljubljana, Slovenia, April 19-23, 2021, pages 2648-2659. ACM / IW3C2. +Leo Gao, John Schulman, and Jacob Hilton. 2022. Scaling laws for reward model overoptimization. CoRR, abs/2210.10760. +Yu Gong, Kaiqi Zhao, and Kenny Qili Zhu. 2016. Representing verbs as argument concepts. In Proceedings of the Thirtieth AAAI Conference on Artificial Intelligence, February 12-17, 2016, Phoenix, Arizona, USA, pages 2615-2621. AAAI Press. +Jonathan Gordon and Benjamin Van Durme. 2013. Reporting bias and knowledge acquisition. In Proceedings of the 2013 workshop on Automated knowledge base construction, AKBC@CIKM 13, San Francisco, California, USA, October 27-28, 2013, pages 25-30. ACM. +Masato Hagiwara, Yasuhiro Ogawa, and Katsuhiko Toyama. 2006. Selection of effective contextual information for automatic synonym acquisition. In ACL 2006, 21st International Conference on Computational Linguistics and 44th Annual Meeting of the + +Association for Computational Linguistics, Proceedings of the Conference, Sydney, Australia, 17-21 July 2006. The Association for Computer Linguistics. +Mutian He, Tianqing Fang, Weiqi Wang, and Yangqiu Song. 2022. Acquiring and modelling abstract commonsense knowledge via conceptualization. CoRR, abs/2206.01532. +Mutian He, Yangqiu Song, Kun Xu, and Dong Yu. 2020. On the role of conceptualization in commonsense knowledge graph construction. CoRR, abs/2003.03239. +Pengcheng He, Jianfeng Gao, and Weizhu Chen. 2023. DeBERTav3: Improving deBERTa using ELECTRA-style pre-training with gradient-disentangled embedding sharing. In The Eleventh International Conference on Learning Representations, ICLR 2023. OpenReview.net. +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. +Ari Holtzman, Jan Buys, Li Du, Maxwell Forbes, and Yejin Choi. 2020. The curious case of neural text degeneration. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net. +Yen-Chang Hsu, Yilin Shen, Hongxia Jin, and Zsolt Kira. 2020. Generalized ODIN: detecting out-of-distribution image without learning from out-of-distribution data. In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2020, Seattle, WA, USA, June 13-19, 2020, pages 10948-10957. Computer Vision Foundation / IEEE. +Zijian Hu, Zhengyu Yang, Xuefeng Hu, and Ram Nevata. 2021. Simple: Similar pseudo label exploitation for semi-supervised classification. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2021, virtual, June 19-25, 2021, pages 15099-15108. Computer Vision Foundation / IEEE. +Luyao Huang, Chi Sun, Xipeng Qiu, and Xuanjing Huang. 2019. Glossbert: BERT for word sense disambiguation with gloss knowledge. 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 3507-3512. Association for Computational Linguistics. +Jena D. Hwang, Chandra Bhagavatula, Ronan Le Bras, Jeff Da, Keisuke Sakaguchi, Antoine Bosselut, and Yejin Choi. 2021. (comet-) atomic 2020: On symbolic and neural commonsense knowledge graphs. 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 6384-6392. AAAI Press. +Ahmet Iscen, Giorgos Tolias, Yannis Avrithis, and Ondrej Chum. 2019. Label propagation for deep semisupervised learning. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2019, Long Beach, CA, USA, June 16-20, 2019, pages 5070-5079. Computer Vision Foundation / IEEE. +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. +Alon Lavie and Abhaya Agarwal. 2007. METEOR: an automatic metric for MT evaluation with high levels of correlation with human judgments. In Proceedings of the Second Workshop on Statistical Machine Translation, WMT@ACL 2007, Prague, Czech Republic, June 23, 2007, pages 228-231. Association for Computational Linguistics. +Hector J. Levesque, Ernest Davis, and Leora Morgenstern. 2012. The winograd schema challenge. In *Principles of Knowledge Representation and Reasoning: Proceedings of the Thirteenth International Conference*, KR 2012, Rome, Italy, June 10-14, 2012. AAAI Press. +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, ACL 2020, Online, July 5-10, 2020, pages 7871-7880. Association for Computational Linguistics. +Bangzheng Li, Wenpeng Yin, and Muhao Chen. 2022. Ultra-fine entity typing with indirect supervision from natural language inference. Trans. Assoc. Comput. Linguistics, 10:607-622. +Margaret Li, Stephen Roller, Ilia Kulikov, Sean Welleck, Y-Lan Boureau, Kyunghyun Cho, and Jason Weston. 2020. Don't say that! making inconsistent dialogue unlikely with unlikelihood training. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, ACL 2020, Online, July 5-10, 2020, pages 4715-4728. Association for Computational Linguistics. +Zheng Li, Danqing Zhang, Tianyu Cao, Ying Wei, Yiwei Song, and Bing Yin. 2021. Metats: Meta teacher-student network for multilingual sequence labeling with minimal supervision. 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 3183-3196. 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. +Fengbei Liu, Yu Tian, Yuanhong Chen, Yuyuan Liu, Vasileios Belagiannis, and Gustavo Carneiro. 2022a. ACPL: anti-curriculum pseudo-labelling for semi-supervised medical image classification. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2022, New Orleans, LA, USA, June 18-24, 2022, pages 20665-20674. IEEE. +Jiacheng Liu, Alisa Liu, Ximing Lu, Sean Welleck, Peter West, Ronan Le Bras, Yejin Choi, and Hannaneh Hajishirzi. 2022b. Generated knowledge prompting for commonsense reasoning. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), ACL 2022, Dublin, Ireland, May 22-27, 2022, pages 3154-3169. Association for Computational Linguistics. +Jingping Liu, Tao Chen, Chao Wang, Jiaqing Liang, Lihan Chen, Yanghua Xiao, Yunwen Chen, and Ke Jin. 2022c. Vocsk: Verb-oriented commonsense knowledge mining with taxonomy-guided induction. Artif. Intell., 310:103744. +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. +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. +Chaitanya Malaviya, Chandra Bhagavatula, Antoine Bosselut, and Yejin Choi. 2020. Commonsense knowledge base completion with structural and semantic context. 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 2925-2933. AAAI Press. +Yu Meng, Jiaming Shen, Chao Zhang, and Jiawei Han. 2019. Weakly-supervised hierarchical text classification. 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 6826-6833. AAAI Press. +George A. Miller. 1995. Wordnet: A lexical database for english. Commun. ACM, 38(11):39-41. +Nasrin Mostafazadeh, Aditya Kalyanpur, Lori Moon, David W. Buchanan, Lauren Berkowitz, Or Biran, and Jennifer Chu-Carroll. 2020. GLUCOSE: generalized and contextualized story explanations. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing, EMNLP 2020, Online, November 16-20, 2020, pages 4569-4586. Association for Computational Linguistics. +Gregory Murphy. 2004. The big book of concepts. MIT press. +Kazumasa Omura, Daisuke Kawahara, and Sadao Kurohashi. 2020. A method for building a commonsense inference dataset based on basic events. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing, EMNLP 2020, Online, November 16-20, 2020, pages 2450-2460. Association for Computational Linguistics. +OpenAI. 2022. Chatgpt: Optimizing language models for dialogue. OpenAI. +Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll L. Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, John Schulman, Jacob Hilton, Fraser Kelton, Luke Miller, Maddie Simens, Amanda Askell, Peter Welinder, Paul F. Christiano, Jan Leike, and Ryan Lowe. 2022. Training language models to follow instructions with human feedback. In NeurIPS. +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. +Hao Peng, Xiaozhi Wang, Shengding Hu, Hailong Jin, Lei Hou, Juanzi Li, Zhiyuan Liu, and Qun Liu. 2022. COPEN: probing conceptual knowledge in pretrained language models. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, EMNLP 2022, Abu Dhabi, United Arab Emirates, December 7-11, 2022, pages 5015-5035. Association for Computational Linguistics. +Hieu Pham, Zihang Dai, Qizhe Xie, and Quoc V. Le. 2021. Meta pseudo labels. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2021, virtual, June 19-25, 2021, pages 11557-11568. Computer Vision Foundation / IEEE. +Steven Pinker and B MacWhinney. 1987. The bootstrapping problem in language acquisition. Mechanisms of language acquisition, pages 399-441. + +Edoardo Maria Ponti, Goran Glavas, Olga Majewska, Qianchu Liu, Ivan Vulic, and Anna Korhonen. 2020. XCOPA: A multilingual dataset for causal commonsense reasoning. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing, EMNLP 2020, Online, November 16-20, 2020, pages 2362-2376. Association for Computational Linguistics. +Ian Porada, Kaheer Suleman, Adam Trischler, and Jackie Chi Kit Cheung. 2021. Modeling event plausibility with consistent conceptual abstraction. 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 1732-1743. Association for Computational Linguistics. +Chengwei Qin, Aston Zhang, Zhuosheng Zhang, Jiaao Chen, Michihiro Yasunaga, and Diyi Yang. 2023. Is chatgpt a general-purpose natural language processing task solver? CoRR, abs/2302.06476. +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. +Nazneen Fatema Rajani, Bryan McCann, Caiming Xiong, and Richard Socher. 2019. Explain yourself! leveraging language models for commonsense reasoning. 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 4932-4942. Association for Computational Linguistics. +Keisuke Sakaguchi, Ronan Le Bras, Chandra Bhagavatula, and Yejin Choi. 2020. Winogrande: An adversarial winograd schema challenge at scale. 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 8732-8740. AAAI Press. +Maarten Sap, Ronan Le Bras, Emily Allaway, Chandra Bhagavatula, Nicholas Lourie, Hannah Rashkin, Brendan Roof, Noah A. Smith, and Yejin Choi. 2019a. 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. +Maarten Sap, Hannah Rashkin, Derek Chen, Ronan Le Bras, and Yejin Choi. 2019b. Social iqa: Common-sense reasoning about social interactions. 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 4462-4472. Association for Computational Linguistics. +Maarten Sap, Vered Shwartz, Antoine Bosselut, Yejin Choi, and Dan Roth. 2020. Commonsense reasoning for natural language processing. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics: Tutorial Abstracts, ACL 2020, Online, July 5, 2020, pages 27-33. Association for Computational Linguistics. +Vered Shwartz, Peter West, Ronan Le Bras, Chandra Bhagavatula, and Yejin Choi. 2020. Unsupervised commonsense question answering with self-talk. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing, EMNLP 2020, Online, November 16-20, 2020, pages 4615-4629. Association for Computational Linguistics. +Yangqiu Song, Haixun Wang, Zhongyuan Wang, Hong-song Li, and Weizhu Chen. 2011. Short text conceptualization using a probabilistic knowledgebase. In *IJCAI* 2011, Proceedings of the 22nd International Joint Conference on Artificial Intelligence, Barcelona, Catalonia, Spain, July 16-22, 2011, pages 2330-2336. IJCAI/AAAI. +Yangqiu Song, Shusen Wang, and Haixun Wang. 2015. Open domain short text conceptualization: A generative + descriptive modeling approach. In Proceedings of the Twenty-Fourth International Joint Conference on Artificial Intelligence, IJCAI 2015, Buenos Aires, Argentina, July 25-31, 2015, pages 3820-3826. AAAI Press. +Robyn Speer, Joshua Chin, and Catherine Havasi. 2017. Conceptnet 5.5: An open multilingual graph of general knowledge. In Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence, February 4-9, 2017, San Francisco, California, USA, pages 4444-4451. AAAI Press. +Ying Su, Zihao Wang, Tianqing Fang, Hongming Zhang, Yangqiu Song, and Tong Zhang. 2022. MICO: A multi-alternative contrastive learning framework for commonsense knowledge representation. In *Findings of the Association for Computational Linguistics: EMNLP* 2022, pages 1339–1351, Abu Dhabi, United Arab Emirates. 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, NAACL-HLT 2019, Minneapolis, MN, USA, June 2-7, 2019, Volume 1 (Long and Short Papers), pages 4149-4158. Association for Computational Linguistics. + +Alon Talmor, Ori Yoran, Ronan Le Bras, Chandra Bhagavatula, Yoav Goldberg, Yejin Choi, and Jonathan Berant. 2021. Commonsenseqa 2.0: Exposing the limits of AI through gamification. In Proceedings of the Neural Information Processing Systems Track on Datasets and Benchmarks 1, NeurIPS Datasets and Benchmarks 2021, December 2021, virtual. +Joshua B Tenenbaum, Charles Kemp, Thomas L Griffiths, and Noah D Goodman. 2011. How to grow a mind: Statistics, structure, and abstraction. science, 331(6022):1279-1285. +Jesper E. van Engelen and Holger H. Hoos. 2020. A survey on semi-supervised learning. Mach. Learn., 109(2):373-440. +Ramakrishna Vedantam, C. Lawrence Zitnick, and Devi Parikh. 2015. Cider: Consensus-based image description evaluation. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2015, Boston, MA, USA, June 7-12, 2015, pages 4566-4575. IEEE Computer Society. +Kexin Wang, Nandan Thakur, Nils Reimers, and Iryna Gurevych. 2022. GPL: generative pseudo labeling for unsupervised domain adaptation of dense retrieval. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL 2022, Seattle, WA, United States, July 10-15, 2022, pages 2345-2360. Association for Computational Linguistics. +Peifeng Wang, Filip Ilievski, Muhao Chen, and Xiang Ren. 2021. Do language models perform generalizable commonsense inference? In *Findings of the Association for Computational Linguistics: ACL/IJCNLP* 2021, Online Event, August 1-6, 2021, volume ACL/IJCNLP 2021 of *Findings of ACL*, pages 3681-3688. Association for Computational Linguistics. +Weiqi Wang, Tianqing Fang, Wenxuan Ding, Baixuan Xu, Xin Liu, Yangqiu Song, and Antoine Bosselut. 2023a. CAR: conceptualization-augmented reasoner for zero-shot commonsense question answering. CoRR, abs/2305.14869. +Zhaowei Wang, Quyet V. Do, Hongming Zhang, Jiayao Zhang, Weiqi Wang, Tianqing Fang, Yangqiu Song, Ginny Y. Wong, and Simon See. 2023b. COLA: contextualized commonsense causal reasoning from the causal inference perspective. CoRR, abs/2305.05191. +Peter West, Chandra Bhagavatula, Jack Hessel, Jena D. Hwang, Liwei Jiang, Ronan Le Bras, Ximing Lu, Sean Welleck, and Yejin Choi. 2022. Symbolic knowledge distillation: from general language models to commonsense models. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL 2022, Seattle, WA, United States, July 10-15, 2022, pages 4602-4625. 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, 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, EMNLP 2020 - Demos, Online, November 16-20, 2020, pages 38-45. Association for Computational Linguistics. +Wentao Wu, Hongsong Li, Haixun Wang, and Kenny Qili Zhu. 2012. Probase: a probabilistic taxonomy for text understanding. In Proceedings of the ACM SIGMOD International Conference on Management of Data, SIGMOD 2012, Scottsdale, AZ, USA, May 20-24, 2012, pages 481-492. ACM. +Huiru Xiao, Xin Liu, and Yangqiu Song. 2019. Efficient path prediction for semi-supervised and weakly supervised hierarchical text classification. In The World Wide Web Conference, WWW 2019, San Francisco, CA, USA, May 13-17, 2019, pages 3370-3376. ACM. +Qizhe Xie, Zihang Dai, Eduard H. Hovy, Thang Luong, and Quoc Le. 2020a. Unsupervised data augmentation for consistency training. In Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual. +Qizhe Xie, Minh-Thang Luong, Eduard H. Hovy, and Quoc V. Le. 2020b. Self-training with noisy student improvesImagenet classification. In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2020, Seattle, WA, USA, June 13-19, 2020, pages 10684-10695. Computer Vision Foundation / IEEE. +Sang Michael Xie, Aditi Raghunathan, Percy Liang, and Tengyu Ma. 2022. An explanation of in-context learning as implicit bayesian inference. In *The Tenth International Conference on Learning Representations*, ICLR 2022, Virtual Event, April 25-29, 2022. OpenReview.net. +Yi Xu, Lei Shang, Jinxing Ye, Qi Qian, Yu-Feng Li, Baigui Sun, Hao Li, and Rong Jin. 2021. Dash: Semi-supervised learning with dynamic thresholding. In Proceedings of the 38th International Conference on Machine Learning, ICML 2021, 18-24 July 2021, Virtual Event, volume 139 of Proceedings of Machine Learning Research, pages 11525-11536. PMLR. +Liang Yao, Chengsheng Mao, and Yuan Luo. 2019. KG-BERT: BERT for knowledge graph completion. CoRR, abs/1909.03193. +Changlong Yu, Jialong Han, Peifeng Wang, Yangqiu Song, Hongming Zhang, Wilfred Ng, and Shuming Shi. 2020. When hearst is not enough: Improving hypernymy detection from corpus with distributional + +models. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing, EMNLP 2020, Online, November 16-20, 2020, pages 6208-6217. Association for Computational Linguistics. +Changlong Yu, Weiqi Wang, Xin Liu, Jiaxin Bai, Yangqiu Song, Zheng Li, Yifan Gao, Tianyu Cao, and Bing Yin. 2022a. Folkscope: Intention knowledge graph construction for discovering e-commerce commonsense. CoRR, abs/2211.08316. +Changlong Yu, Hongming Zhang, Yangqiu Song, and Wilfred Ng. 2022b. Cocolm: Complex commonsense enhanced language model with discourse relations. In *Findings of the Association for Computational Linguistics: ACL 2022*, Dublin, Ireland, May 22-27, 2022, pages 1175-1187. Association for Computational Linguistics. +Hongming Zhang, Xin Liu, Haojie Pan, Haowen Ke, Jiefu Ou, Tianqing Fang, and Yangqiu Song. 2022. ASER: towards large-scale commonsense knowledge acquisition via higher-order selectional preference over eventualities. Artif. Intell., 309:103740. +Hongming Zhang, Xin Liu, Haojie Pan, Yangqiu Song, and Cane Wing-Ki Leung. 2020a. ASER: A large-scale eventuality knowledge graph. In WWW '20: The Web Conference 2020, Taipei, Taiwan, April 20-24, 2020, pages 201-211. ACM / IW3C2. +Tianyi Zhang, Varsha Kishore, Felix Wu, Kilian Q. Weinberger, and Yoav Artzi. 2020b. Bertscore: Evaluating text generation with BERT. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net. + +# Appendices + +# A Dataset Description + +In this section, we introduce more about AbstractATOMIC (He et al., 2022), as the primary dataset we experimented with. AbstractATOMIC is a conceptualized commonsense knowledge benchmark that is built upon ATOMIC (Sap et al., 2019a), a popular CSKB in the format of $(h,r,t)$ triples. The dataset is entirely in English. It contains two parts of data: (1) event conceptualization data and (2) abstract knowledge triples conceptualization data. + +The event conceptualization data contain conceptualizations for head event instances, where the events are filtered from the original ATOMIC head events. Unlike the traditional entity concept taxonomies, where instances are nouns or verb phrases, AbstractATOMIC includes instance candidates that can be either the entire head event or a certain component of an event. Detailed examples can be found in Appendix E. + +The instances within each head event are identified through syntactic parsing by using a parser from the spaCy library and matching with five human-defined rules. After identification, the candidate instances will be heuristically matched against Probase (Wu et al., 2012) and WordNet (Miller, 1995) via GlossBERT (Huang et al., 2019) to acquire their candidate concepts. A neural generator based on GPT2, similar to the baseline in this paper, is also trained to generate concepts. A supervised conceptualization verifier, based on RoBERTa (Liu et al., 2019), is trained as the final gatekeeper to verify the acquired concepts roughly. + +
Dh1DhuTotal
#Unq. event7,19615,16515,388
#Unq. instance7,93520,84321,493
#Unq. concept20,03620,36731,227
Avg. #concept/event18.2124.5732.73
Avg. #concept/instance16.5117.8823.43
+ +Human annotations on the Amazon Mechanical Turk platform are further conducted to acquire annotations on the correctness of 131K conceptu + +alizations of 7K ATOMIC events. All conceptualizations that are not annotated are regarded as unlabeled data in this paper. More detailed statistics for the head event conceptualization data can be found in Table 5. + +After acquiring the event conceptualizations by only focusing on head events, abstract commonsense knowledge, in the form of $(h,r,t)$ triple, is collected by connecting conceptualized head event with its non-abstract counterparts (commonsense relations and inference tails) from ATOMIC. Only the head events contain abstract concepts. Thus, these abstract triples are more generalized if-then commonsense knowledge that is potentially useful for commonsense reasoning through instantiation. + +Human annotations on Amazon Mechanical Turk further verify 81K uniformly sampled abstract triples. These triples only correspond to 689 unique ATOMIC head events, which makes annotations relatively scarce compared with the scale of unlabeled data. A supervised RoBERTa-large verifier is trained on the annotated triples to roughly verify abstract triples that are not annotated. Triples with scores higher than 0.9 are pseudo-labeled as positive ones (He et al., 2022). However, this paper only leverages these pseudolabeled examples in the commonsense inference generation task (COMET) as baselines. Only annotated triples are considered hard-labeled for all other tasks concerned. And triples that are not annotated are treated as unlabeled by default. The detailed relational distribution of abstract triples is presented in Table 6. Examples can be found in Appendix E. + +Table 5: Additional statistics of the event conceptualization data in AbstractATOMIC (AbsATM). $D_h^l$ stands for annotated event conceptualizations and $D_h^u$ are unverified conceptualizations. # denotes "number of", Unq stands for unique, and Avg is average. + +
RelationATOMICDl tDu tDuAbs.ATM.
xEffect78,83212,168938,330451,564
oEffect28,3513,526333,845160,207
xWant101,24915,3121,170,835543,964
oWant43,0795,408484,570227,493
xReact62,9698,923510,476288,019
oReact26,5703,030224,706126,386
xNeed74,27211,733900,429425,060
xAttr110,79114,249838,191465,511
xIntent45,4906,848519,813259,694
Total572,05381,1975,921,1952,947,898
+ +Table 6: Abstract commonsense triple distribution by relations. $D_{t}^{l}$ stands for annotated triples and $D_{t}^{u}$ are unverified triples. $D_{\mathrm{Abs,ATM}}^{u}$ stands for abstract triples verified by a supervised RoBERTa-large discriminator, as done by He et al. (2022). + +# B Prompt Design + +In this section, we introduce the textual prompts used for training various models. + +For event conceptualization, denotes the original event as $h_{o}$ , instance as $i$ , target concept to be verified as $c$ , and retrieved alternative conceptualizations as $c_{r,1}, c_{r,2}, c_{r,3}, \ldots, c_{r,m}$ . The prompt for training the teacher model is "[CLS] $h_{o}$ [SEP] $c$ ", while the one for training the student model is "[CLS] $h_{o}$ [SEP] $c$ [SEP] $c_{r,1}, c_{r,2}, c_{r,3}, \ldots, c_{r,m}$ ". For the example in Figure 2, the filled prompt is "PersonX is on vacation [SEP] relaxing event [SEP] traveling, break, holiday." Specifically, special tokens $$ and $$ are used to enclose $i \subset h_{o}$ within the original event to highlight the instance to be conceptualized. GPT2 generators use similar prompts, with the difference that [SOS] and [EOS] special tokens are inserted to denote the start and end of the sentence, respectively. + +For triple conceptualization, denotes the head, relation, and tail of an abstract commonsense triple as $(h,r,t)$ , the abstract concept in the conceptualized head as $c\subset h$ , and retrieved instantiations as $e_{r,1},e_{r,2},e_{r,3},\ldots ,e_{r,n}$ . The prompt for training generally follows the one used by He et al. (2022). For the teacher model, "[CLS], $h_1,\dots,h_{|h|}$ [SEP], $[r]$ [SEP], $t_1,\dots,t_{|t|}$ " is used as the prompt. Similarly, student models are trained with a prompt "[CLS], $h_1,\dots,h_{|h|}$ [SEP] $[r]$ [SEP] $t_1,\dots,t_{|t|}$ [SEP] $e_{r,1}$ $e_{r,2},e_{r,3},\dots,e_{r,n}$ ". A filled example by using the case in Figure 2 is "relaxing event [SEP] because PersonX wanted [SEP] have fun [SEP] PersonX joins party, go on a holiday, Take a break." The commonsense relation within each triple is translated into human-readable text, as shown in Table 7. + +
RelationHuman Readable Text
xEffectas a result, PersonX will
oEffectas a result, PersonY or others will
xWantas a result, PersonX want
oWantas a result, PersonY or others want
xReactas a result, PersonX feel
oReactas a result, PersonY or others feel
xIntentbecause PersonX wanted
xNeedbefore that, PersonX needed
xAttrPersonX is described as
+ +Table 7: Textual prompt for commonsense relations (Fang et al., 2021b). Commonsense triple $(h,r,t)$ is translated to human language "if $h$ , [prompt] $t$ ". + +The generative event conceptualization by GPT2 generators uses "[SOS] $h_{o}$ [SEP] $i$ [GEN]" as the input template, where [GEN] indicates the special + +token for generation. Commonsense inference modeling uses the same prompt as done by Hwang et al. (2021); Fang et al. (2021b). + +In addition, we observe that adding special tokens such as $\langle c \rangle$ and $\langle /c \rangle$ can effectively boost performance. But adding textual guidelines such as "is an instance of" or "is a concept of" does not have any positive effect. The same trend is observed for the bootstrapping prompt, where adding external texts such as "is also instances of" or "can be instantiated to" will harm the model significantly. + +# C Additional Experiments + +In this section, we present additional details and experiment results for CSKB conceptualization tasks (Appendix C.1) and applications, as well as evaluations, of CAT (Appendix C.2) that are not covered in the paper due to limited space. + +# C.1 CSKB Conceptualization + +# C.1.1 Baselines + +For supervised learning baselines of both discriminative conceptualization tasks, KG-BERT (Yao et al., 2019) is adapted as the skeleton of our baseline models. For BART, we use the embedding of the end-of-sentence token in the decoder as the representation of the input sequence. For other models, the embedding of the [CLS] token is used as the representation vector. Linear layers are appropriately appended after the encoder model to perform text classification. + +For the semi-supervised baselines, we provide additional explanations for different methods: + +UDA. In the original paper of UDA (Xie et al., 2020a), two data augmentation methods, back-translation and TF-IDF replacement, are implemented for unsupervised data augmentation. We leverage both methods in our conceptualization tasks as two different baselines. For the triple conceptualization task, we follow the same setting as proposed in PseudoReasoner (Fang et al., 2022). The back-translation method translates the original corpus from English to French and then translates it back. Special replacements are taken to avoid the influence of special tokens. Meanwhile, the TF-IDF method uses a probability of 0.1 to replace the original corpus according to its TF-IDF score. For the event conceptualization task, we concatenate the head event and its annotated concept into one new sentence and then feed it into the model. For the unlabeled conceptualizations, we enclose + +the instance and concept with special tokens $\langle c\rangle$ and $\langle /c\rangle$ , which is the same as our framework, and then use back translation or TF-IDF to generate the augmented data. The input for triple conceptualization follows a similar way as supervised baselines. It is observed that these special tokens will not affect the translation significantly as they will be preserved in the translation output. Last but not least, the model $\theta$ is trained on a mixture of annotated data $x_{1}$ and augmented data $x_{2}$ by using the consistency training loss, as shown in Equation 2. + +$$ +\begin{array}{l} J (\theta) = \mathbb {E} _ {x 1 \sim P _ {L} (x)} [ - \log p _ {\theta} (y _ {1} | x _ {1}) ] + \\ \lambda \mathbb {E} _ {x 2 \sim P _ {U} (x)} \mathbb {E} _ {\hat {x} \sim q (\hat {x} | x _ {2})} [ C E (p _ {\tilde {\theta}} (y | x _ {2}) | | p _ {\theta} (y | \hat {x}) ] \tag {2} \\ \end{array} +$$ + +NoisyStudent. Noisy Student (Xie et al., 2020b) is an iterative training method that leverages a teacher-student paradigm. The teacher model is first trained on annotated data. It is then asked to make predictions on the unlabeled data as pseudolabels. Then, another student model with an equal or larger number of parameters is trained with a mixture of annotated and pseudo-labeled data. Note that pseudo labels, in numerical values, are directly used as the targeting labels. The trained student model will serve as a new teacher and re-label the unlabeled data again to yield a better prediction. In our implementation, dropout or dynamic model depth is introduced as noise to the model. All models $\theta$ are trained with standard cross-entropy loss, as shown in Equation 1. We set the dropout probability to 0.5, as it leads to the fastest convergence on our data. Only one iteration is completed in our experiment, as that's when the student model reaches its best result. + +PseudoReasoner. PseudoReasoner (Fang et al., 2022) is another iterative semi-supervised learning framework that is proposed to tackle Commonsense Knowledge Base Population (CKBP) task (Fang et al., 2021a, 2023). It leverages a similar teacher-student paradigm and a novel filtering mechanism with the assistance of the student model. We replaced the generative teacher model with a DeBERTa-v3-large model due to the disastrous performance that GPT2 achieved on both verification tasks. Similar to CAT, two thresholds, $T^{+} = 0.9$ and $T^{-} = 0.1$ , are determined to assign pseudo-labels to unlabeled data based on the prediction of the teacher model. The rest steps remain the same as described in the original paper. Similar to + +NoisyStudent, only one iteration is carried out for PseudoReasoner as the student model converges to the best. + +# C.1.2 Settings + +We use pretrained language models from the Huggingface Transformers $^4$ Library (Wolf et al., 2020) to build our framework. The learning rate for all models is set as 5e-6, and the batch size is 64. We use an AdamW (Loshchilov and Hutter, 2019) optimizer and evaluate the model every 25 steps. The max sequence length for the tokenizer is set to 25 and 35 for both discriminative tasks, respectively. Due to the imbalanced dataset, we evaluate the discriminative models with Area Under Curve (AUC) score (Bradley, 1997). Early stopping is used where the best checkpoint is selected when the largest validation AUC is achieved. All experiments are repeated three times using different random seeds, and the average performances and standard deviations are reported. In addition, we set the probability thresholds for both tasks to $T^{+} = 0.9$ and $T^{-} = 0.1$ to determine the pseudo labels. The thresholds are roughly derived by observing the overall distribution and quality of data satisfying the respective threshold. For the bootstrapping method, we bootstrap $m = 9$ additional concepts for event conceptualization verification and $n = 2$ additional instances for abstract triple verification. Detailed ablation studies are provided in Section 5.3. As for the computational infrastructure, the models are trained and evaluated on four NVIDIA RTX3090 (24G) and four NVIDIA 1080Ti (12G) graphical cards. The number of parameters for every model is reported in Table 11. + +# C.1.3 Additional Experiment Results + +The full experiment results for discriminative CSKB conceptualization tasks are reported in Table 11. All supervised learning baselines achieve comparable results as reported by He et al. (2022). Supervised CAT will be discussed later. The results by semi-supervised CAT are generally consistent with our findings as discussed in Section 5.1. To study the effect of different components and the training regime of CAT, we conduct more detailed ablation studies in Appendix C.1.4. + +# C.1.4 Ablation Study + +In this section, we study the effects of different components in CAT and the training strategy of + +CAT. These studies indicate that our framework design and the proposed bootstrapping method play an important role in CSKB conceptualization and are more effective than leveraging unlabeled data with pseudo labels. + +Framework Components. Our CAT framework consists of three critical components that make CAT different from traditional semi-supervised baselines. They are denoted as: + +- Bootstrapping: Assist the training of student models by retrieving alternative conceptualizations and instantiations and bootstrapping them via natural language prompts. Dropping this component will train student models with the original textual prompts that are also used by the teacher models. +- CAT Cycle: Unite event and triple conceptualization tasks by assigning negative pseudo labels to abstract triples whose conceptualized head is predicted as wrong conceptualization. Dropping this component will separate the framework into two lines of training, which are training event conceptualization and triple conceptualization models separately. +- Pseudo-label refinement: Refine the pseudo labels with the latest student models and re-train the student models. Dropping this component will not update any pseudo label and will not re-train the student model. + +
ModelsEvent.Triple.
CAT (BERT-base)87.476.3
◇ w/o Bootstrapping83.173.0
◇ w/o CAT Cycle86.575.1
◇ w/o Pseudo-label Refinement87.476.2
CAT (DeBERTa-v3-large)89.280.0
◇ w/o Bootstrapping84.077.7
◇ w/o CAT Cycle88.179.0
◇ w/o Pseudo-label Refinement89.179.7
+ +Table 8: Ablation study on three components of CAT. Three components refer to the explanations above. The column Event. indicates test set AUC on the event conceptualization task, and the column Triple. indicates test set AUC on the triple conceptualization task. + +We then conduct ablation studies regarding these three components with semi-supervised CAT to prove the effectiveness of our framework design and proposed bootstrapping method. Each component is removed separately, and the test set performances by student models are reported. The results are shown in Table 8. From the results, bootstrap + +ping alternative conceptualization and instantiation leads to the largest performance gain. Bridging event conceptualization discrimination with triple conceptualization also causes slight improvements. However, refining the pseudo labels and re-train the student models have barely any effect. Thus, our bootstrapping method is the most important component within the entire CAT framework and can effectively assist in learning conceptual knowledge. + +Supervised CAT. We further study training CAT in a supervised learning setting to examine the role of unlabeled data. In supervised CAT, no teacher models are trained to provide pseudo labels. The alternative conceptualizations and instantiations are retrieved directly from the annotated event conceptualization data and bootstrapped later. Two student models are trained on the bootstrapped data only and evaluated on the same testing set, and the results are reported in Table 11. Compared with supervised learning baselines, supervised CAT can achieve a comparable result on the event conceptualization task. This may be due to the fact that the diversity of concepts drops without considering unlabeled conceptualizations. Improvements in the triple conceptualization task are more significant, and the results are comparable with semi-supervised CAT. This indicates that our framework design and bootstrapping method are successful in discriminating high-quality abstract commonsense knowledge, and leveraging a semi-supervised learning paradigm benefits more in event conceptualization discrimination. + +# C.2 Application and Evaluation of CAT + +# C.2.1 Settings + +Pretrained GPT2 models from the Huggingface Transformers Library and training codes by Hwang et al. (2021) are used as our code base. The learning rate for all experiments is set to 1e-5, and the batch size is fixed to 64. We use an Adam (Kingma and Ba, 2015) optimizer and evaluate the model every 20 steps. The input and output lengths for GPT2 models are fixed at 45 and 55 for the two application and evaluation tasks, respectively. Such length settings can cover all annotated conceptualizations and triples. For both generative experiments, we evaluate the generations with BLEU (Papineni et al., 2002), METEOR (Lavie and Agarwal, 2007), ROUGE-L (Lin, 2004), and + +CIDEr (Vedantam et al., 2015) scores. However, since an abstract concept usually contains one or two tokens, we only report BLEU1 and BLEU2 scores for the generative event conceptualization task. Early stopping is also applied where the best checkpoint is selected when the minimum autoregressive LM loss is achieved. In addition, we notice that the number of triples from the ATOMIC subset is much smaller than abstract triples for the commonsense inference modeling task. Thus, we upsample the ATOMIC subset by a ratio of 1:2 across all experiments to guarantee a consistent and balanced number of training data. For generative event conceptualization, the training data is simply a mixture of annotated and pseudo-labeled event conceptualizations without any balancing measure. All the models are trained and evaluated on four NVIDIA RTX A6000 graphical cards with 48G memory. The number of parameters is close to the number of parameters in GPT2-XL, which is reported in Table 11. + +# C.2.2 Annotation Settings + +When evaluating the event conceptualization generator, expert annotations are conducted to evaluate concepts that are not presented in the training set. Crowdsourced platforms such as Amazon Mechanical Turk are not used since experts understand conceptualization better and are more reliable for evaluation. Subsequently, the authors of this paper are invited to serve as expert annotators. They are experienced in NLP research and clearly understand the paper's scope. The annotation guideline is carefully designed. Each question presents the original head event with the instance highlighted and the corresponding conceptualization candidate to be annotated. There are also several positive and negative conceptualizations attached as examples. The authors are well-informed about the instruction and the intended use of their annotations in this paper. And they all agreed to annotate as part of their contributions. Moreover, in order to ensure that the expert will not deliberately raise the plausible rate of a certain set of annotation candidates, we randomly shuffle all the data and invite one more expert to cross-validate the annotations. These measures can ensure that the annotation process is free of ethical concerns and justifiable. + +# C.2.3 Additional Experiment Results + +We conduct a more comprehensive study on the commonsense inference generation task by experi- + +![](images/5a1d50445e70bb59a4333f2ff92150ba27ac463015bab91806b364846f87d9e9.jpg) +Figure 5: Performance $(\%)$ curve by COMET (GPT2-XL) on commonsense inference generation task with different thresholds for determining positive pseudo labels. Performance with the best threshold of 0.95 is marked as the red dotted line. + +menting with the effect of threshold tuning when filtering abstract commonsense knowledge. Multiple thresholds ranging from 0.5 to 0.995 are experimented with to derive abstract commonsense knowledge of different qualities. COMET (GPT2-XL) generators are fine-tuned on the ATOMIC subset, augmented by a mixture of annotated and pseudo-labeled abstract triples. The performance curve according to the threshold is plotted in Figure 5. Full version results with all metrics are reported in Table 19. It can be observed that gradually increasing the threshold from 0.75 will lead to better performance, which may be due to the improvement in data quality. However, increasing the threshold over 0.95 will cause a performance drop. One possible reason is the amount of pseudolabeled triples significantly drops with a relatively high threshold, and COMET fails to learn well from annotated triples only. Using the CAT framework to pseudo-label unlabeled abstract triples leads to better performance than leveraging a RoBERTa-large supervised discriminator to assign pseudolabels, which also validates the reliability of the triple conceptualization discriminator in CAT. Also, it is noticeable that training COMET with triples based on our constructed ATOMIC subset is much worse than training with the full ATOMIC dataset. This indicates that exposing the model with substantial factual commonsense knowledge is still important, and only equipping the model with abstract commonsense knowledge is not enough for commonsense inference modeling. + +# D Computational Cost Analysis + +In this section, we compare the number of training data used for both CSKB conceptualization tasks to compare the computational cost across different frameworks and methodologies empirically. Both annotated and pseudo-labeled data are counted. The comparison result is presented in Table 9. All semi-supervised learning methods leverage a significant amount of unlabeled data due to the great scarcity of annotations. With threshold filterings, PseudoReasoner (Fang et al., 2022) and our CAT framework can abandon more than half of pseudo examples with poor quality. Even though our CAT framework can still outperform PseudoReasoner and achieve the best performance among all methods. Additionally, there is no notable increase in the number of model parameters as CAT also applies a teacher-student paradigm that is similar to Noisy-Student and PseudoReasoner. Even compared with the supervised baselines, CAT only doubles the parameters used. In conclusion, with comparable training data and parameters against other baselines, CAT can achieve much better results and state-of-the-art performances. + +
MethodEvent.Triple.Total
Supervised Baselines107,38465,386172,770
UDA412,3674,916,6585,329,025
Noisy-Student412,3674,916,6585,329,025
PseudoReasoner316,6011,727,8652,044,466
CAT317,5071,595,4111,912,918
+ +Table 9: Comparison between the number of training data for discriminative event conceptualization (Event.) and triple conceptualization (Triple.) tasks. + +# E Case Studies + +This section contains case studies of the four tasks we studied in this paper, including CSKB conceptualization tasks and applications of CAT. Throughout these cases, we would like to offer a clearer view of the data, discuss the challenges of the conceptualization task, and provide brief error analyses. + +# E.1 CSKB Conceptualization + +Event Conceptualization. For discriminative event conceptualization, the case study is shown in Table 15. From these cases, it can be observed that several instances $i$ can be identified within one + +head event $h_{o}$ , and each of them can be conceptualized in multiple ways. Formally, assume we are conceptualizing $m$ events, each with $n$ instances. And each instance $i$ concerned can be conceptualized as $p$ concepts. Each concept takes the majority vote of $q$ annotators to verify. Subsequently, the number of annotations needed is $O(mnpq)$ , which grows significantly if we conceptualize a commonsense knowledge base at scale. Thus, it is extremely infeasible for practitioners to annotate all of the conceptualizations for verification, which also highlights the importance of a reliable discriminative conceptualization model as CAT acquired. Semi-supervised learning is also an ideal training strategy, as there is a considerable amount of unlabeled data. + +Analyzing the errors made by our discriminator, we observe that models frequently make errors when the instance contains the word "PersonX," which could be caused by the reporting bias (Gordon and Durme, 2013), as "PersonX" is seldom used in normal natural language texts. Replacing the subjects with commonly used names such as "Alex, Bob" may alleviate such a problem. Additionally, models make errors on some rarely seen concepts, such as "organ," "cognitive ability," and "side effect." Their absence from training data can partially cause this, as CSKB, like ATOMIC, may not cover many instances under those rarely used concepts. + +Triple Conceptualization. For triple conceptualization discrimination, case studies are shown in Table 17. Similar to the analysis above, consider $m$ events with $n$ instances, each instance with $p$ concepts. Assume that every ATOMIC head event has $t$ relation and tail tuples as its counterpart, and $q$ votes are required from annotators. The total number of annotations is $O(mnptq)$ for verifying all abstract commonsense triples, which is also huge compared with the total number of original commonsense triples. + +The errors are mainly due to the loss of contextualization within the original head events, as conceptualized head events with too high abstractness are likely to omit salient properties. For example, conceptualizing "watching a scary movie" as "watching movie" will lose the property "scary," which further leads to a wrong abstract commonsense knowledge if the tail is "feel scared." This also highlights the importance of verifying the plausibility of abstract commonsense knowledge that + +heavily relies on both the contextualization brought by $r, t$ and the conceptualization of the head event. Meanwhile, we observe that the models tend to make a neutral decision (plausibility score close to 0.5) when encountering the situation of conceptualizing an entire event as a concept with high-level abstractness. Indeed, they are more difficult abstract commonsense knowledge for machines to learn, as a higher level of abstractness leads to more possible instantiations and commonsense inferences. + +# E.2 Application of CAT + +Generative Event Conceptualization. The examples are shown in Table 16. Generated conceptualizations are generally plausible, given the head event as the context. Specifically, we observe that neural generators are more sensitive to the instance and its context, as heuristic matching may conceptualize "sleeping at night" and "having trouble sleeping at night" as "sleeping". In contrast, neural generators can distinguish these two instances clearly by conceptualizing them as "sleep" and "sleep disorder". One potential weakness of neural generators is that the generated conceptualizations lack diversity and novelty (Du et al., 2019; Wang et al., 2021), as they tend to be semantically close to the targeting conceptualizations in the training samples. Nevertheless, it still offers a reliable and simplified approach to performing contextualized conceptualization without tedious matching and human annotations. Such results also validate the reliability of our discriminative event conceptualization model, as the pseudo-labeled conceptualizations tend to be of high quality. + +Commonsense Inference Modeling (COMET). Generations from COMET that are only trained on the ATOMIC subset, possibly augmented by abstract commonsense triples, are compared in Table 18. From these generations, we can observe that the abstract commonsense knowledge-aided COMET generator can generate tail events that are most plausible and generalizable compared with the one only trained on ATOMIC. It generally supports our hypothesis that abstract commonsense knowledge may implicitly help model situational commonsense inference, even without the instantiation step. In addition, this also validates that our automatically derived abstract knowledge is reliable and helpful, which also proves the reliability of our triple conceptualization discriminator. + +# E.3 Conceptualization by Large Language Models + +With the recent advances in Large Language Models (LLMs), such as GPT3.5 (Brown et al., 2020; Ouyang et al., 2022) and ChatGPT (OpenAI, 2022), on various NLP tasks (Qin et al., 2023; Bian et al., 2023; Chan et al., 2023; Amin et al., 2023), we also aim to explore ChatGPT's conceptualization ability through case studies. To do so, we investigate ChatGPT's performance on three conceptualization tasks: discriminative event conceptualization, discriminative triple conceptualization, and generative event conceptualization, all of which are defined in Section 3. We randomly sample data entries from AbstractATOMIC and prompt ChatGPT with natural language commands to perform various tasks. The prompts used for performing these tasks are listed in Table 10. Specifically, we use OpenAI's API6 to prompt ChatGPT and retrieve its generations. + +The case studies for three tasks are presented in Table 12, Table 13, and Table 14, respectively. These demonstrate ChatGPT's strong conceptualization abilities in both discriminative and generative manners. While ChatGPT can accurately determine most event conceptualizations and abstract commonsense knowledge, it still makes some mistakes. This highlights the value of training a performant discriminator through CAT, as it can effectively detect incorrect conceptualizations and implausible abstract commonsense knowledge. Additionally, ChatGPT tends to conceptualize instances using synonyms (Hagiwara et al., 2006) and hypernyms (Yu et al., 2020) and paraphrased or explained terms rather than higher-level concepts. This underscores the importance of our event conceptualization generator, which can generate precise, concise event conceptualizations. In conclusion, our work holds significant value in the realm of commonsense reasoning through conceptualization, particularly in light of the rise of large language models. + +
TaskPrompt
Discriminative Event ConceptualizationGiven the event <event>, can the <instance> be conceptualized as <concept>? Only answer yes or no without any other words. You are forced to make a decision.
Discriminative Triple ConceptualizationGiven a commonsense knowledge triple, <head, relation, tail>, is this knowledge plausible or not? Only answer yes or no without any other word. You are forced to make a decision.
Generative Event ConceptualizationGiven the event <event>, what are possible conceptualizations of <instance>? Only list out five short conceptualizations, and do not provide explanations.
+ +Table 10: Natural language prompts used to instruct ChatGPT to perform specific tasks. Words in italics and enclosed by brackets indicate inputs replaced by sampled data entries. Restrictive commands are appended at the end to ensure ChatGPT executes the task as intended. + +
FrameworkBackbone PTLM / MethodEvent ConceptualizationTriple Conceptualization
ValidationTestingValidationTesting
Supervised LearningBERT-base 110M82.4±0.0582.5±0.3171.2±0.5872.6±0.71
BERT-large 340M82.8±0.4883.1±0.8072.4±0.0173.7±0.00
BART-base 139M83.8±0.2884.4±0.3272.0±0.0972.6±0.15
BART-large 406M85.0±0.1385.2±0.2274.5±0.1376.2±0.19
RoBERTa-base 110M84.1±0.0484.5±0.1972.2±0.0074.1±0.00
RoBERTa-large 340M85.2±0.2485.5±0.0275.3±0.0076.9±0.01
DeBERTa-v3-base 214M85.1±0.0885.8±0.0773.9±0.1075.9±0.04
DeBERTa-v3-large 435M85.8±0.0586.2±0.1576.9±0.0378.0±0.02
ELECTRA-base 110M85.4±0.0585.8±0.0274.3±0.2776.2±0.12
ELECTRA-large 340M84.7±0.4785.3±0.3875.6±0.0177.9±0.06
GPT2-base 117M60.0±0.0659.1±0.1452.8±0.1455.9±0.11
GPT2-medium 345M61.2±0.1160.3±0.0854.6±0.1757.4±0.09
GPT2-large 774M64.1±0.0562.7±0.0860.5±0.1159.8±0.06
GPT2-XL 1558M64.2±0.1963.6±0.2262.2±0.0861.5±0.10
Semi-Supervised LearningUDA (TF-IDF)83.6±0.2983.6±0.2475.8±1.2676.8±1.34
UDA (back-trans.)83.4±0.2783.6±0.2475.8±1.2576.8±1.34
Noisy-Student86.4±0.0586.5±0.0975.4±0.6476.7±0.59
PseudoReasoner (BERT-base)83.3±0.1184.0±0.2473.0±0.1474.1±0.33
PseudoReasoner (RoBERTa-large)86.6±0.2586.7±0.3376.3±0.1277.2±0.21
CAT (Supervised)BERT-base 110M83.9±0.4284.5±0.4373.4±0.3273.3±0.23
BERT-large 340M82.8±0.4883.1±0.8072.4±0.0173.7±0.00
BART-base 139M84.9±0.0585.4±0.0875.2±0.0676.9±0.21
BART-large 406M86.2±0.0586.0±0.0676.8±0.2178.7±0.31
RoBERTa-base 110M85.5±0.0686.0±0.0676.6±0.1277.2±0.18
RoBERTa-large 340M86.2±0.3186.2±0.3177.7±0.1978.5±0.28
DeBERTa-v3-base 214M85.8±0.1586.2±0.0776.8±0.2879.0±0.20
DeBERTa-v3-large 435M86.3±0.1186.7±0.0878.4±0.2079.5±0.18
ELECTRA-base 110M85.5±0.1285.7±0.0876.7±0.0577.3±0.16
ELECTRA-large 340M86.2±0.6686.0±0.6277.8±0.1178.5±0.09
CAT (Semi-Supervised)BERT-base 110M87.1±0.0687.4±0.1174.3±0.2676.3±0.38
BERT-large 340M87.7±0.1688.0±0.1975.8±0.2377.8±0.36
BART-base 139M88.2±0.0988.2±0.0975.7±0.0978.0±0.14
BART-large 406M88.6±0.0788.7±0.1077.2±0.1279.0±0.14
RoBERTa-base 110M88.4±0.1288.3±0.0876.9±0.1678.0±0.19
RoBERTa-large 340M89.0±0.1588.8±0.2078.2±0.0879.4±0.14
DeBERTa-v3-base 214M88.8±0.1288.9±0.0877.5±0.1079.9±0.07
DeBERTa-v3-large 435M89.1±0.0589.2±0.1478.7±0.1680.0±0.33
ELECTRA-base 110M88.7±0.1088.9±0.1074.9±0.1575.5±0.40
ELECTRA-large 340M88.6±0.7788.5±0.7074.9±0.1575.5±0.40
+ +Table 11: Full experiment results $(\%)$ by our CAT framework on the discriminative event conceptualization and triple conceptualization tasks. We report the average AUC score and standard deviation across experiments with three random seeds. The best performances within each framework are underlined, and the best among all models are bold-faced. All supervised baselines are comparable with experiment results by He et al. (2022). + +
Head EventInstanceConceptLabelPred.
PersonX accepts the invitationthe invitationpersonal communication✓✓
the invitationparty idea×✓
the invitationfriendly approach✓✓
the invitationitem×✓
PersonX accepts the invitationacceptance✓✓
PersonX accepts the invitationapproach××
PersonX accepts the invitationpsychological treatment××
PersonX accepts the invitationpersonal communication✓✓
PersonX makes oatmeal for breakfastoatmealingredient×✓
oatmealcereal✓✓
oatmealgrain food✓✓
breakfastservice××
breakfastmeal✓✓
PersonX makes oatmeal for breakfasthands-on activity✓✓
PersonX makes oatmeal for breakfastextended school activity×✓
PersonX makes oatmeal for breakfastcooking✓✓
+ +Table 12: Case study of ChatGPT's discriminative event conceptualizations. Label refers to annotation result and Pred. stands for prediction by ChatGPT. + +
Conceptualized Head EventRelationTail EventLabelPred.
medical checkxEffectto be brave✓×
xWanttake medicine✓✓
xWantleave the hotel×✓
xWantto drive home×✓
xAttrcautious✓✓
xWantgo to rest✓✓
xAttrdiseased✓×
xNeedget injured✓×
watching moviexEffectlaugh✓×
xWantto be entertained✓✓
xNeedto go to video store✓×
xIntententertain themselves✓✓
xWantto put movie in DVD player✓✓
xAttrsatisfied✓×
xReactscared✓✓
xNeedrent it on Netflix✓✓
+ +Table 13: Case study of ChatGPT's discriminative triple conceptualizations. Underlined words in the head event refer to conceptualizations. Label refers to annotation result and Pred. stands for prediction by ChatGPT. + +
EventTarget Conceptualiza-tionsCAT's GenerationsChatGPT's Generations
PersonX is having trouble sleeping at nighttime, night, nonwork time, shiftnight, evening, time, late, darknightDark sleep time, nocturnal period, rest- ing hours, nighttime sleeplessness, bed- time wakefulness
PersonX is having trouble sleeping at nightrelaxation, sleeping, restingrest, sleep, resting, daily routine, sleepingNightly slumber attempt, dark rest strug- gle, sleeplessness after dark, nocturnal insomnia, bedtime wakefulness
PersonX is having trouble sleeping at nightsleeping, disorder, sleep problem, trouble, insomnia, sleep disor- dersleep disorder, problem, sleep disturbance, diffic- culty, trouble sleepingNighttime sleep difficulty, dark restless- ness problem, nocturnal insomnia strug- gle, bedtime wakefulness issue, sleep- lessness after dark challenge
+ +Table 14: Case study of ChatGPT's generative event conceptualizations. The instance candidate in each event is underlined. Target conceptualizations are positive conceptualizations extracted from AbstractATOMIC, including the annotated conceptualizations and ones that are positively pseudo-labeled by our framework. + +
Head EventInstanceConceptLabelPred.
PersonX is having trouble sleeping at nightnightnonwork time✓✓
nightnight✓✓
sleeping at nightlifestyle factor✓×
sleeping at nightbasic need✓✓
trouble sleeping at nightboard game××
trouble sleeping at nightproblem✓✓
PersonX is having trouble sleeping at nightvariable××
PersonX is having trouble sleeping at nightpersonal characteristic✓✓
PersonX is nervous about making friendsfriendsperson✓✓
friendssupport person✓✓
making friendsrelationship✓✓
making friendssocial activity✓✓
nervous about making friendsorgan×✓
nervous about making friendsside effect×✓
PersonX is nervous about making friendsemotion✓✓
PersonX is nervous about making friendsnervous disorder✓✓
PersonX wants to learn how to play the pianothe pianoinstrument✓✓
the pianowestern instrument✓✓
how to play the pianomusical activity✓✓
how to play the pianoplay✓×
to learn how to play the pianobutton××
to learn how to play the pianolearning activity✓✓
PersonX wants to learn how to play the pianocultural event××
PersonX wants to learn how to play the pianocognitive ability✓×
PersonX puts PersonX's pants on PersonX's leg at a timePersonX's pantspant✓×
PersonX's pantsclothing✓✓
PersonX's legleg✓×
PersonX's leglimb✓×
a timeresource××
a timetime✓✓
PersonX puts PersonX's pants on PersonX's legdressing✓✓
PersonX puts PersonX's pants on PersonX's legaction××
+ +Table 15: Case study of CAT's discriminative event conceptualizations. A head event can be conceptualized in multiple ways, as shown in the table. Label refers to annotation result and Pred. stands for prediction by our framework. + +
EventTarget ConceptualizationsGenerated Conceptualizations
PersonX is having trouble sleeping at nighttime, night, nonwork time, shiftnight, evening, time, late, darknight
PersonX is having trouble sleeping at nightrelaxation, sleeping, restingrest, sleep, resting, daily routine, sleeping
PersonX is having trouble sleeping at nightsleeping, disorder, sleep problem, trouble, insomnia, sleep disordersleep disorder, problem, sleep disturbance, difficulty, trouble sleeping
PersonX gets great grades in schoolaccomplishment, result, grades, good performance, achievementachievement, grades, good grade, academic excellence, grade
PersonX asks what was wrongproblems, concern, seeking information, questioning, query, communicationquery, question, asking, communication, inquiry
PersonX needs new shoesnecessity, product, personal item, item, clothing, shoesrequirement, item, need, necessity, needs
PersonX is failing mathnegative experience, negative issue, problem, poor performancedifficulty, poor performance, problem, academic failure, math problem
+ +Table 16: Case study of CAT's generative event conceptualizations. The instance candidate in each event is underlined. Target conceptualizations are positive conceptualizations extracted from AbstractATOMIC, including the annotated conceptualizations and ones that are positively pseudo-labeled by our framework. + +
Conceptualized Head EventRelationTail EventLabelPred.
PersonX gets nailcare servicexAttrrich✓✓
xAttrskillful×✓
xIntentlook pretty✓✓
xNeedbook an appointment✓✓
xEffectshow off✓✓
xReactexcited✓✓
oWantto tell her they like them✓✓
xWantto go home✓✓
watching moviexEffectlaugh✓✓
xWantto be entertained✓✓
xNeedto go to video store✓×
xIntententertain themselves✓✓
xWantto put movie in DVD player✓✓
xAttrsatisfied✓✓
xReactscared✓×
xNeedrent it on Netflix✓✓
medical checkxEffectto be brave✓✓
xWanttake medicine✓✓
xWantleave the hotel×✓
xWantto drive home×✓
xAttrcautious✓✓
xWantgo to rest✓✓
xAttrdiseased✓✓
xNeedget injured✓✓
+ +Table 17: Case study of CAT's discriminative triple conceptualizations. The abstract concept within each conceptualized head event is underlined. Label refers to annotation result and Pred. stands for prediction by our framework. + +
HeadRelationSourceTail
PersonX washes PersonY's caroWantATOMIC +COMET_ATOMIC +COMET CATto tip PersonX +to wash their car +to thank PersonX
PersonX meets PersonX's standardsxNeedATOMIC +COMET_ATOMIC +COMET CATto practice +to study +to practice hard
PersonX stretches out PersonX's handxWantATOMIC +COMET_ATOMIC +COMET CATto give PersonY something +to touch +to grab something for PersonY
PersonX learns how to bake a cakexAttrATOMIC +COMET_ATOMIC +COMET CATinterested +curious +skilled
PersonX fails PersonX's classxWantATOMIC +COMET_ATOMIC +COMET CATto retake the class +to study hard +to try again in the class
PersonX buys dog foodxEffectATOMIC +COMET_ATOMIC +COMET CATX gets receipt +loses weight +gets a receipt
PersonX hits by lightningxEffectATOMIC +COMET_ATOMIC +COMET CAThas hair burned +gets electrocuted +screams in pain
PersonX forgets my walletxEffectATOMIC +COMET_ATOMIC +COMET CATis chastised +gets robbed +thinks about it
PersonX realizes somethingxWantATOMIC +COMET_ATOMIC +COMET CATmake a plan +to solve the problem +to do something about it
+ +Table 18: Case study of commonsense inference generation (COMET). Examples are selected from the original ATOMIC testing set. ATOMIC refers to the target tail in the original ATOMIC. COMETATOMIC and COMETCAT stand for generations by COMET trained on an ATOMIC subset or aided with abstract knowledge derived by CAT. + +
Training DataBLEU-1BLEU-2BLEU-3BLEU-4METEORROUGE-LCIDEr
DevTestDevTestDevTestDevTestDevTestDevTestDevTest
Zero-Shot5.424.891.841.510.650.520.260.216.505.706.405.901.601.20
ATOMIC (subset)38.138.125.425.718.718.815.515.714.914.933.033.227.627.8
+Dt138.138.524.825.517.818.414.715.215.315.633.133.726.827.3
+Finetune38.639.025.826.618.919.715.716.415.115.433.634.428.830.0
+DuAbs,ATM.40.040.327.127.820.020.816.517.516.116.335.335.731.631.7
+Finetune40.140.527.127.820.120.816.717.416.216.435.435.931.831.7
+Dt1+DuAbs,ATM.40.240.626.227.419.020.415.116.816.316.535.035.431.031.3
+Finetune40.040.426.026.918.719.715.016.116.316.435.035.430.330.7
+Du0.99539.739.826.526.819.519.815.616.115.815.835.034.930.830.7
+Finetune41.041.027.127.520.020.216.116.316.716.636.035.931.931.7
+Du0.9939.539.926.127.019.320.015.916.615.715.934.734.830.630.8
+Finetune40.841.027.027.620.020.516.216.916.716.635.835.731.931.6
+Du0.9541.241.928.129.020.721.516.517.816.616.935.936.533.433.7
+Finetune41.142.028.029.020.421.516.417.616.617.036.036.833.233.8
+Du0.9041.641.628.128.520.921.517.117.716.916.836.736.433.433.1
+Finetune41.841.728.328.521.021.417.017.517.017.036.736.633.433.1
+Du0.8541.341.427.828.120.721.116.817.616.716.836.336.632.632.9
+Finetune41.541.527.928.220.621.116.817.516.816.936.336.732.633.0
+Du0.8041.641.627.328.020.120.716.317.017.016.936.636.433.032.6
+Finetune41.641.527.527.920.220.616.316.817.016.936.636.333.032.3
+Du0.7540.640.827.128.019.920.916.217.216.416.635.535.731.632.1
+Finetune40.941.227.228.119.921.016.217.016.616.935.736.131.832.7
+Du0.7040.640.927.127.819.920.716.617.216.416.635.636.131.632.4
+Finetune41.441.427.528.120.121.016.417.416.916.936.236.432.533.0
+Du0.5041.141.527.328.220.421.216.717.616.716.735.836.132.432.8
+Finetune41.541.727.728.520.721.417.017.816.916.936.336.532.733.1
+Dt1+Du0.99539.439.326.126.419.219.515.515.815.715.533.933.829.829.2
+Finetune39.740.026.727.519.520.315.816.615.715.734.734.930.630.9
+Dt1+Du0.9939.439.725.726.518.619.515.216.515.815.934.635.029.730.2
+Finetune39.740.426.627.619.620.516.016.815.716.134.235.030.531.1
+Dt1+Du0.9539.940.526.227.419.320.616.017.416.016.235.035.430.831.3
+Finetune40.441.026.627.619.520.716.117.116.216.535.435.831.331.5
+Dt1+Du0.9039.439.726.127.018.919.915.316.415.615.834.535.029.630.2
+Finetune40.440.426.226.919.119.615.215.816.316.435.535.730.530.7
+Dt1+Du0.8539.840.026.326.919.319.815.816.116.016.234.835.230.530.6
+Finetune39.940.026.226.719.319.515.815.816.116.334.935.530.430.7
+Dt1+Du0.8039.940.426.427.619.220.515.416.816.216.334.935.330.331.3
+Finetune39.940.426.227.518.920.315.216.716.216.535.035.630.231.3
+Dt1+Du0.7539.739.825.926.618.919.415.315.815.615.734.634.929.730.1
+Finetune39.839.925.926.718.819.515.315.915.715.934.735.129.630.3
+Dt1+Du0.7040.240.526.427.219.420.115.816.416.416.535.235.530.831.0
+Finetune40.340.626.427.119.419.915.916.016.516.635.235.730.530.9
+Dt1+Du0.5039.339.826.227.518.920.315.216.715.716.033.934.429.430.6
+Finetune39.540.126.327.619.020.515.417.115.816.234.234.929.330.8
ATOMIC (full)42.742.929.630.022.022.518.618.729.129.751.152.774.575.4
+ +Table 19: Full experiment results $(\%)$ by GPT2 (XL) on commonsense inference generation (COMET) task. We evaluate the models on the original ATOMIC dev and test sets. $D_{t}^{l}$ stands for annotated abstract commonsense triples, and $D^{u}$ stands for unlabeled triples pseudo-labeled by our CAT framework. The underfoot value is the threshold for selecting plausible pseudo labels. Fine-tune refers to fine-tuning back on the training set of our constructed ATOMIC subset. Rows with the best performance, which are reported in the paper, are colored in gray. We also report performances by COMET trained on the complete ATOMIC training set in the bottom row. + +# A For every submission: + +A1. Did you describe the limitations of your work? + +Yes, in the limitation section on Page 10. + +A2. Did you discuss any potential risks of your work? + +Yes, in the ethics statement section on Page 10. + +A3. Do the abstract and introduction summarize the paper's main claims? + +Yes, in both sections on the first page. + +A4. Have you used AI writing assistants when working on this paper? + +Left blank. + +# B Did you use or create scientific artifacts? + +Yes, as introduced in Section 3, Problem Definition, and Section 5, Experiments. There is also an additional explanation in Appendix A, Dataset Description. + +B1. Did you cite the creators of artifacts you used? + +Yes, all datasets are properly cited throughout the paper. + +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? + +Yes, in the ethics statement section on Page 10, all datasets are shared via open-access licenses. + +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +Yes, in the ethics statement section on Page 10, our use of existing artifacts is consistent with their intended use for research purposes. + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? + +Yes, in the ethics statement section on Page 10, the primary dataset is desensitized and anonymized. + +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? + +Yes, in Appendix A, the dataset description. + +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. + +Yes, tables reporting statistics can be found in Section 3, problem definition, and appendix A, Dataset Description. + +# C Did you run computational experiments? + +Yes, as shown in Section 5 and Appendix C. + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +Yes, parameters are reported in Table 11 in Appendices, and computational budgets are reported in Appendix C.1.2 and Appendix C.2.1. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +Yes, in Appendix C.1.2 and Appendix C.2.1. + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +Yes, in Section 5 and Appendix C. + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +Yes, the usage of these packages is well-explained, and packages are cited throughout the Appendix. + +# D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Yes, expert annotations are conducted in Section 5.2, Generative Event Conceptualization. Details are introduced in Appendix C.2.2. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +Yes, in Appendix C.2.2. + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +Yes, in Appendix C.2.2. + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +Yes, in Appendix C.2.2. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +Not applicable. Not applicable. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +Not applicable. Not applicable. \ No newline at end of file diff --git a/catacontextualizedconceptualizationandinstantiationframeworkforcommonsensereasoning/images.zip b/catacontextualizedconceptualizationandinstantiationframeworkforcommonsensereasoning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..a47a754fb09d8460043ab51f0b1d16c6d3fdfb5e --- /dev/null +++ b/catacontextualizedconceptualizationandinstantiationframeworkforcommonsensereasoning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f1d737fb6112507a8cddf166ecd980edc027ba23687d2ebd11990f27456988e5 +size 2115480 diff --git a/catacontextualizedconceptualizationandinstantiationframeworkforcommonsensereasoning/layout.json b/catacontextualizedconceptualizationandinstantiationframeworkforcommonsensereasoning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..3a6e376aefdee36e5b92e6ec5dd5fc02341fbcdd --- /dev/null +++ b/catacontextualizedconceptualizationandinstantiationframeworkforcommonsensereasoning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:af7930b0630ccfdcf5b7bcd3bd1ec4b42db0c859f4e8a1f3b6aa8bad8d4a1db4 +size 843814 diff --git a/catsapragmaticchineseanswertosequencedatasetwithlargescaleandhighquality/3156f290-e7ce-451d-98f6-2311eb4ee7fe_content_list.json b/catsapragmaticchineseanswertosequencedatasetwithlargescaleandhighquality/3156f290-e7ce-451d-98f6-2311eb4ee7fe_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..36bc353ec265380811dc8600c96dcfe46754a072 --- /dev/null +++ b/catsapragmaticchineseanswertosequencedatasetwithlargescaleandhighquality/3156f290-e7ce-451d-98f6-2311eb4ee7fe_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2258206371e7e610aeccd42bb8168c72f995d44cec61a4af59028b64ca9290b4 +size 114879 diff --git a/catsapragmaticchineseanswertosequencedatasetwithlargescaleandhighquality/3156f290-e7ce-451d-98f6-2311eb4ee7fe_model.json b/catsapragmaticchineseanswertosequencedatasetwithlargescaleandhighquality/3156f290-e7ce-451d-98f6-2311eb4ee7fe_model.json new file mode 100644 index 0000000000000000000000000000000000000000..d37fddf5f97949cb1891d8ee56a193c6d6fbab85 --- /dev/null +++ b/catsapragmaticchineseanswertosequencedatasetwithlargescaleandhighquality/3156f290-e7ce-451d-98f6-2311eb4ee7fe_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ccd86b06f0aec5f376ca73c0f4e24b7090e0e7ef94f66e62c81e27af8ce9e8bb +size 139282 diff --git a/catsapragmaticchineseanswertosequencedatasetwithlargescaleandhighquality/3156f290-e7ce-451d-98f6-2311eb4ee7fe_origin.pdf b/catsapragmaticchineseanswertosequencedatasetwithlargescaleandhighquality/3156f290-e7ce-451d-98f6-2311eb4ee7fe_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5010d057ea2e03fb8e1280af012d3a5c162c875d --- /dev/null +++ b/catsapragmaticchineseanswertosequencedatasetwithlargescaleandhighquality/3156f290-e7ce-451d-98f6-2311eb4ee7fe_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4f1ca7feb24050cfe981d317aed7519553835a6a74aee37c193b9a5f5986fa75 +size 1247447 diff --git a/catsapragmaticchineseanswertosequencedatasetwithlargescaleandhighquality/full.md b/catsapragmaticchineseanswertosequencedatasetwithlargescaleandhighquality/full.md new file mode 100644 index 0000000000000000000000000000000000000000..4bffbc2b051cda4e50ef744043c6de0390e61737 --- /dev/null +++ b/catsapragmaticchineseanswertosequencedatasetwithlargescaleandhighquality/full.md @@ -0,0 +1,403 @@ +# CATs: A Pragmatic Chinese Answer-to-Sequence Dataset with Large Scale and High Quality + +Liang Li $^{1,2}$ , Ruiying Geng $^{3}$ , Chengyang Fang $^{1,2}$ , Bing Li $^{1}$ , Can Ma $^{1*}$ , Rongyu Cao $^{3}$ , Binhua Li $^{3}$ , Fei Huang $^{3}$ , Yongbin Li $^{3*}$ + +$^{1}$ Institute of Information Engineering, Chinese Academy of Sciences, Beijing, China + $^{2}$ School of Cyber Security, University of Chinese Academy of Sciences, Beijing, China + $^{3}$ DAMO Academy, Alibaba Group {liliang, macan}@iie.ac.cn {ruiying.gry, shuide.lyb}@alibaba-inc.com + +# Abstract + +There are three problems existing in the popular data-to-text datasets. First, the large-scale datasets either contain noise or lack real application scenarios. Second, the datasets close to real applications are relatively small in size. Last, current datasets bias in the English language while leaving other languages underexplored. To alleviate these limitations, in this paper, we present CATs, a pragmatic Chinese answer-to-sequence dataset with large scale and high quality. The dataset aims to generate textual descriptions for the answer in the practical TableQA system. Further, to bridge the structural gap between the input SQL and table and establish better semantic alignments, we propose a Unified Graph Transformation approach to establish a joint encoding space for the two hybrid knowledge resources and convert this task to a graph-to-text problem. The experiment results demonstrate the effectiveness of our proposed method. Further analysis on $\mathsf{CATS}^1$ attests to both the high quality and challenges of the dataset. + +# 1 Introduction + +Data-to-text (D2T) generation (Kukich, 1983; Reiter and Dale, 1997) aims to generate a natural language description conditioned on structured or semi-structured data, such as graphs (Song et al., 2018; Wang et al., 2020c) or tables (Lebret et al., 2016; Wiseman et al., 2017). It helps people get the key points of the input data and makes the stored information accessible to a broader range of end-users. A large number of datasets have been proposed as the testbed for neural D2T models and are driving the domain. + +However, as shown in Table 1, we note three problems existing in the popular datasets. First, the large-scale datasets either contain noises (e.g., + +![](images/28f0ebd1207b693844d2c0ad4aeb68d9b969f14494b16e75e0fb2412b7586893.jpg) +Figure 1: An example for a practical TableQA system. The red dotted lines denote the input data for answer-to-sequence. + +WEATHERGOV (Liang et al., 2009)) or lack practical application scenarios, e.g., ToTTo (Parikh et al., 2020). The shortcoming leads to a separation between research and application. Second, the datasets close to practical scenarios are relatively small in size. For example, ROTOWIRE (Wiseman et al., 2017) only contains 4.9K training examples, and CoSQL (Yu et al., 2019) is consist of 7.8K training pairs. The small training size can easily lead to overfitting and is not conducive to training a reliable neural network model. Lastly, most of the existing datasets are built for English, which leads to advanced work on D2T generation primarily focusing on English and leaving other languages underexplored. These limitations hinder the progress of D2T generation. We therefore need to investigate possible remedies. + +The crucial step to improving the above limitations is digging out a data-to-text task with a practical scenario. Recently, CoSQL (Yu et al., 2019) has proposed a practical controlled D2T task: answer-to-sequence. As shown in Figure 1, the task takes a SQL query generated by a semantic parsing module, i.e., text-to-SQL (Zettlemoyer and Collins, + +2012), and its corresponding execution result (in the form of a table) as the model input and aims to produce a natural language description as the response to users in a real-world TableQA system. The SQL gives explicit signals for models on what to generate. The generated description could provide a concise and easy-to-understand summary of the result table and help users verify whether the queried result is consistent with the original question (Fang et al., 2022). Moreover, the task also contributes to a more user-friendly human-computer interaction. Nevertheless, CoSQL contains only 7.8K answer-to-sequence examples for training. Additionally, it is a dataset with SQL-grounded dialogue state tracking as the core, and the generation annotations are very rough. The scale and quality of CoSQL limit further exploring the answer-to-sequence task. + +In this paper, to bridge the gap between research and application of data-to-text datasets and enrich their language diversity, we comply with the CoSQL setting and present CATs, a large-scale and high-quality Chinese answer-to-sequence dataset. We manually annotate all collected SQL-table pairs to obtain their descriptions. We make two efforts to improve the quality and scale of the collected SQL-Table pairs and guarantee they are close to practical scenarios. First, we annotate the SQL-table pairs from DuSQL (Wang et al., 2020b), a large-scale Chinese Text-to-SQL dataset with a SQL query distribution close to real applications. Data collected in this way are named CATs-D. Second, we adopt an automatic data construction pipeline to collect a large number of SQL-table pairs for annotation. The basic idea is automatically crawling a mount of tables from the Internet to build multi-table databases and then automatically generating SQL queries based on the SQL grammar and constrained by the given database. Data collected with this method are referred to as CATs-S. Compared to CATs-D, CATs-S expands the data scale while reducing the share of easy SQLs to make the dataset more challenging. In total, CATs is made up of both CATs-D and CATS-S, and contains 43,369 answer-to-sequence examples, which is an order of magnitude larger than CoSQL. + +The input SQL and table in answer-to-sequence are heterogeneous, and there is a structural gap between them. To bridge the gap and establish better semantic alignments, we propose a Unified Graph Transformation approach (UGT), which first + +converts the two sources to two undirected graphs, then builds the connection between the nodes in different graphs to obtain a unified graph. In this way, we convert this task to a graph-to-text problem (Gardent et al., 2017b). Previous graph-to-text work (Ribeiro et al., 2021) transforms the input graph into a new token graph to apply pretrained language models, such as T5 (Raffel et al., 2020). We consider that this transformation breaks the original input graph structure and may bring in extra noises into graph encoding. Hence, we further introduce a Node Segment Embedding (NSE) to preserve original structure information. + +Our contributions are three-fold as follows: + +- We present a large-scale and high-quality Chinese answer-to-sequence dataset (CATs), which narrows the gap between research and application of data-to-text generation datasets and enriches the language diversity. +- We propose UGT and NSE to better model the input of two heterogeneous structured input data sources. +- Experiments and analysis on CATs attest to both the high quality and challenges of the dataset. The results also demonstrate the effectiveness of our proposed method. + +# 2 Related Works + +# 2.1 Answer-to-Sequence Generation + +In a real-world setting, a TableQA system comprises a table semantic parsing (text-to-SQL) component and an answer-to-sequence component. The semantic parsing component converts a natural language question into a SQL query (Guo et al., 2019; Wang et al., 2020a; Hui et al., 2021) and the answer-to-sequence component aims generating a natural language description of the SQL and the execution result. CoSQL (Yu et al., 2019) first proposes the answer-to-response task and refers to it as response generation. Intuitively, response generation should encompass both answer acquisition and answer description, which could easily be confused with the role of the whole Table QA system. Therefore, to make the task more clearly related to its definition and function, we rename it as answer-to-sequence generation. In this paper, the proposed CATs follows the same task setting in CoSQL. Specifically, the task's input consists of a SQL query and its corresponding execution result (in the form of a table), and the output is a natural language description. + +
DatasetTrain SizeDomainTargetApplicationLanguage
WEATHERGOV (Liang et al., 2009)25KWeatherCrawledWeather ReportEnglish
WikiBio (Lebret et al., 2016)583KWikipediaCrawled-English
WebNLG (Gardent et al., 2017a)25.3KDBPediaAnnotated-English
LogicNLG (Chen et al., 2020)28.5KWikipediaAnnotated-English
ToTTo (Parikh et al., 2020)120KWikipediaAnnotated-English
Rotowire (Wiseman et al., 2017)4.9KNBAAnnotated (Noisy)NBAEnglish
AdverGeneration (Shao et al., 2019)115KChinese E-commerceCrawledAdvertising Text GenerationChinese
CoSQL (Yu et al., 2019)7.8KCross-DomainAnnotatedTableQAEnglish
Map2seq (Schumann and Riezler, 2021)7.6KOpenStreetMapAnnotatedNavigationEnglish
CATS34.7KCross-DomainAnnotatedTableQAChinese
CATS-D6.7KCross-DomainAnnotatedTableQAChinese
CATS-S26.4KCross-DomainAnnotatedTableQAChinese
+ +Table 1: Comparison of popular data-to-text datasets in different aspects. Application represents the practical application scenario associated with the dataset. + +Especially, using SQL query as input rather than natural language question is more practical in multi-turn TableQA scenarios because the SQL query can easily represent the context state (Yu et al., 2019). + +# 2.2 Structure Modeling in Data-to-Text + +Recently, some works in D2T generation have shown that the structure modeling for the input data can dramatically improve the model performance. For table data, Liu et al. (2019); Li et al. (2021) propose to utilize a hierarchical encoder to model the table's representation from the row and column levels. For graph structure modeling, early works (Song et al., 2018; Damonte and Cohen, 2019) introduce Graph Neural Networks as the structure encoder, which only considers the relations between neighbor nodes. Unlike the local encoding strategies, Zhu et al. (2019); Cai and Lam (2020) propose the Graph Transformer that uses explicit relation encoding and allows direct communication between two distant nodes. Newly, some works enable the pretrained language models the structure modeling capabilities and achieve SOTA results on many D2T tasks. Especially, Ribeiro et al. (2021) attempt to insert structural adapters into T5'encoder to model the graph structure. Wang et al. (2022) modify the T5's attention masking matrix to encode table with a structure-aware self-attention mechanism. In this paper, we propose to utilize UGT to convert the input SQL and table to a graph and utilize a graph-to-model to model it. Our model refers to Ribeiro et al. (2020b, 2021)' works and further improves them by introducing NSE to better preserve the graph structure. + +# 3 Dataset Construction + +Considering the limitations of existing D2T datasets, we present CATs, a massive and pragmatic Chinese answer-to-sequence dataset. CATs is constructed by two phases: SQL-table pairs collection and manual data annotation. To balance the data quality and scale and bring it closer to the practical scenario, we collect the SQL-table pairs in two ways. First, we derive SQL-table pairs from DuSQL (Wang et al., 2020b), a text-to-SQL dataset that generates the SQL queries by referring to the SQL query distribution in real-life applications. The dataset obtained by annotating these pairs is referred to as CATs-D. Besides, we implement an automatic data construction pipeline to collect massive high-quality SQL-table pairs. Data collected with this method are referred to as CATS-S, which increases the proportion of complicated SQL queries to make the dataset more challenging. Ultimately, both CATs-D and CATS-S make up CATs. We first describe how to obtain SQL-table pairs for subsequent annotation and then introduce the annotation details. + +Database Building To mimic the practical TableQA system, we first follow Wang et al. (2020b) to build a multi-table database $D^{d}$ by collecting all databases in DuSQL. In addition, we also build another multi-table database $D^{s}$ for expanding the size and domain of our dataset through a table collection pipeline. Specifically, 100,000 high-frequency words are first summarized from the CLUE (Xu et al., 2020) corpus. Then, we query these words in Google and download all the queried spreadsheet files. Subsequently, the available tables in these spreadsheets are extracted by a table parser that can identify the potential table in a work- + +sheet. To protect personal privacy, we use predefined unique words to replace sensitive information in these tables, such as passwords, ID numbers, credit card numbers, etc. Finally, these tables are used to construct the database $D^{s}$ . Please refer to Appendix A.1 for more details. + +SQL and Table Collection We execute all the SQL queries in DuSQL in the database $D^{d}$ to get their corresponding tables. This is consistent with how a practical Table QA system answers user questions after parsing it to SQL. Then we discard SQL-table pairs containing SQLs that execute with empty results to obtain a SQL-table pair set CATS $\mathbf{D}^{un} = \{s_i^d, t_i^d\}_{i=1}^n$ . DuSQL does not release the code for generating synthetic queries. Therefore, to increase the annotation examples, we reimplement a SQL generator similar to the one in DuSQL. Notably, the generated SQL contains both single-table and multi-table queries. Please refer to Appendix A.2 for more detailed information on the SQL generator. The sampled SQLs which cannot execute in database $D^s$ or execute with empty results are deserted. In this way, we obtain another SQL-table pair set CATS $\mathbf{S}^{un} = \{s_i^s, t_i^s\}_{i=1}^m$ . + +Data Annotation Process We employ 20 well-educated crowd workers to annotate the SQL-table pairs in $\mathrm{CATS - D}^{un}$ and $\mathrm{CATS - S}^{un}$ . In particular, the annotators are asked to write a description $y$ given a SQL $s$ and table $t$ pair. They must follow the requirements: (1) avoiding template-like language and trying to write a natural, fluent, and grammatically correct description; (2) the description must summarize all the content in the table; (3) the description must be logically consistent with the input SQL; (4) filtering the incomprehensible examples that are semantically unclear. Furthermore, to guarantee data quality, another 4 workers are asked to review the annotated data. Data with poor annotation quality will be required to be relabeled. Finally, the annotated $\mathrm{CATS - D}^{un}$ is named as $\mathrm{CATS - D}$ . To guarantee data consistency, we sample a subset from the annotated $\mathrm{CATS - S}^{un}$ following a similar complexity distribution with $\mathrm{CATS - D}$ . We name the sampled dataset $\mathrm{CATS - S}$ . However, we find that easy SQL queries account for a large-scale proportion $(47.87\%)$ in $\mathrm{CATS - D}$ . Therefore, we reduce the proportion of easy SQLs $(14.50\%)$ in $\mathrm{CATS - S}$ to make it more challenging. + +
COLUMN NUMBER123>=4
CoSQL6,32910574590
CATs8,96620,86232421627
CATs-D2,8832,9778200
CATs-S6,15717,8132,3941,653
ROW NUMBER123>=4
CoSQL47406102,4950
CATs14,9096,1583,6719,959
CATs-D2,1236561,1292,772
CATs-S12,7545,5382,5107,215
SQL HARDNESSEasyMediumHardExtra Hard
CoSQL2,7881,8261,7171,514
CATs7,22313,00012,0162,458
CATs-D3,19817091,264509
CATs-S4,06311,21410,7871,953
TARGET LENGTH< 20< 40< 60>=60
CoSQL7,005825150
CATs10,31912,8625,8645,652
CATs-D1,8932,0261,912849
CATs-S8,40110,8733,9624,781
+ +Table 2: Complexity distribution comparison between CATs and CoSQL. + +# 3.1 Dataset Analysis + +The final CATs contains 43,369 examples, including 8,350 examples in CATs-D and 33,019 examples in CATs-S. Each annotated example contains a triple of SQL $s$ , table $t$ , and descriptive sentences $y$ . We split the training/development/test sets by 34,697/4,336/4,336 randomly. To understand the characteristics of the data collected in CATs-D and CATS-S, we also split them accordingly. The training, development, and test sets of CATs-D and CATS-S contain 6,680/835/835 and 28,017/3,501/3,501 examples, respectively. + +Data Complexity To better understand our dataset, we compare its complexity with CoSQL in four dimensions, including the input tables' row and column number, SQL hardness, and the target length. Following Guo et al. (2021), we adopt SQL hardness to measure the complexity of SQL queries from the following four-level: easy, medium, hard, and extra hard, according to the number of components, selections, and conditions in a SQL query (Yu et al., 2018). Considering CoSQL only release the training and development sets, we only show the training set comparison. The results are summarized in Table 2. First, we find that the tables in CoSQL are small, such as $60\%$ of the tables with only one row and more than $80\%$ with only one column. Second, we notice that most of the descriptions in CoSQL are less than 20 in length. The first reason is that most of the input tables are small. + +![](images/1a233bd83e1837dfc64a07d7a9d5f94e8ea1b13ec1459204cfaa5d8dd258ef65.jpg) +Figure 2: Illustration of the proposed method. (a) is an example of a unified graph transformed by Unified Graph Transformation. (b) is an overview of our model. L-NE and G-NE denote Local Node Encoder and Global Node Encoder, respectively. (c) is an example of token graph transformation. + +By manually checking the data in CoSQL, we find the second reason is that CoSQ describes the table with more than two rows through a generic template, such as "Here are the ...". Last, we observe that easy SQL queries in CoSQL account for $35.54\%$ , far more than $20.84\%$ in CATs. These features make CoSQL only suitable for simple scenarios and less challenging. By contrast, CATs has a broader distribution than CoSQL, which is more in line with real TableQA applications. + +# 4 Structure-Aware Approach + +Given an input SQL $s$ and a table $t$ , the model aims to generate a response $\tilde{y}$ . To bridge the gap between the two sources of information, we first propose a Unified Graph Transformation approach (UGT), which explicitly connects the input SQL and table in a unified structure. In this way, we can obtain a joint graph representation of the two sources and convert the answer-to-sequence task to a graph-to-text problem. And then, we utilize a varietal transformer architecture (Ribeiro et al., 2020b) that employs the original transformer encoder as the Global Node Encoder (G-NE) and introduces a GNN based layer into each transformer encoder layer as the Local Node Encoder (L-NE). G-NE allows explicit communication between two distant nodes, taking advantage of a large node context range. And L-NE has an advantage in modeling the graph topology. As shown in Figure 2 (b), this architecture cascaded performs global and local node aggregation, which gathers the benefits from both strategies. In the rest of this section, we will describe the proposed Unified Graph Transformation and the Local Node Encoder in detail. + +# 4.1 Unified Graph Transformation + +Given a SQL $s$ and its execution result (in the form of a table) $t$ as input (shown in Figure 1), the Unified Graph Transformation takes two steps to transform the input two sources of data into a unified graph (shown in Figure 2 (a)). First, it converts the SQL and table into two undirected graphs: SQL graph $\mathcal{G}_s$ and table graph $\mathcal{G}_t$ . In particular, for a SQL, we follow the previous method (Xu et al., 2018) and convert it to a tree. For a table, we treat each column name and table cell as a node and divide the nodes in the table into two categories: table header node and table cell node. And then, we connect each header node with the cell node in the same column. We also build the connections between the cell nodes in the same row. Second, we add connections between the nodes that indicate the same column in $\mathcal{G}_s$ and $\mathcal{G}_t$ to build the unified graph. We also add a self-loop connection for each node. The transformed unified graph is formulated as $\mathcal{G}_h = (\mathcal{V}_h,\mathcal{E}_h)$ , where $\mathcal{V}$ represents the nodes set and $\mathcal{E}_h = \{(n,v)|n,v\in \mathcal{V}\}$ . Figure 2 (a) shows an example of the transformed unified graph. + +We expect that developing generation models should benefit from the recent advance on pretrained language models (PLMs). Following previous work (Ribeiro et al., 2021), we represent each $\mathcal{G}_h$ using subword tokens, and convert it into a new token graph $\mathcal{G} = (\mathcal{V},\mathcal{E})$ . Specifically, each token of a node in $V_{h}$ becomes a node $\tilde{v}$ in $\mathcal{N}$ . For each edge $(n,v)\in \mathcal{E}_h$ , we connect each token between $n$ and $v$ to obtain the new edges set $\mathcal{E}$ (as shown in Figure 2 (c)). However, we notice that the new token graph $\mathcal{G}$ breaks the structure of the original graph $\mathcal{G}_h$ and may make the encoder pay too much attention to the feature of nodes at the token level instead of the original node level. This may bring + +extra noise into graph encoding. To preserve the original structural information, we introduce the Node Segment Embedding (NSE), which assigns the same symbol to the nodes in the token graph $\mathcal{G}$ which belong to the same node in the original unified graph $\mathcal{G}_h$ . Figure 2 (c) gives an example. + +# 4.2 Local Node Encoder + +Given $\{h_v | v \in \mathcal{V}\}$ as the outputs of the Global Node Encoder at the $L$ -th encoder layer, we next describe how the Local Node Encoder (L-NE) works. As shown in Figure 2 (b), L-NE consists of two main modules: a Node Embedding Layer and a Graph Attention Network (GAT) (Velickovic et al., 2018) Layer. The former enriches the features of the nodes, and the latter explicitly models the graph structure. Formally, given $h_v$ , we obtain the feature-enhanced node representation by: + +$$ +h _ {v} ^ {e} = \operatorname {L a y e r N o r m} \left(h _ {v}\right) + e _ {v} ^ {s}, \tag {1} +$$ + +where LayerNorm represents layer normalization (Ba et al., 2016). $e_v^s$ denote the node segment embedding for node $v$ . After the Node Embedding Layer, we utilize a GAT layer to model the graph structure. Formally, it aggregates the representations of node $v$ in a multi-head self-attention layer (Vaswani et al., 2017) as follows: + +$$ +s _ {v, n} ^ {h} = \frac {h _ {v} ^ {e} W _ {Q} ^ {h} (h _ {n} ^ {e} W _ {K} ^ {h}) ^ {\top}}{\sqrt {d / H}}, +$$ + +$$ +\alpha_ {v, n} ^ {h} = \frac {e ^ {s _ {v , n} ^ {h}}}{\sum_ {\tilde {n} \in \mathcal {N} (v)} e ^ {s _ {v , \tilde {n}} ^ {h}}}, \tag {2} +$$ + +$$ +z ^ {h} = \sum_ {n \in \mathcal {N} (v)} \alpha_ {v, n} ^ {h} (h _ {n} ^ {e} W _ {V} ^ {h}), +$$ + +$$ +h ^ {r} = \operatorname {C o n c a t} (z ^ {1},..., z ^ {H}), +$$ + +where $1 \leq h \leq H$ , and $W_{Q}^{h}, W_{K}^{h}, W_{V}^{h} \in \mathbb{R}^{d \times (d / H)}$ . $\mathcal{N}(v)$ denotes the immediate neighborhood of node $v$ in graph $\mathcal{G}$ . + +The transformer parameters are initialized with the pretrained T5 (Raffel et al., 2020), and the others are randomly initialized. Given each gold instance $(s, t, y)$ , we fine-tune the model to optimize the following cross-entropy objective: + +$$ +\mathcal {L} = - \sum_ {i = 1} ^ {| y |} p _ {\theta} \left(y _ {i} \mid y _ {1: i - 1}; s, t\right). \tag {3} +$$ + +# 5 Experiment + +# 5.1 Experiment Settings + +Baselines Due to current datasets bias in the English language, the D2T methods for others are + +
SQL ComponentsDescriptions
Min最小的 (minimum)
Max最大的 (maximum)
Count数量 (the number of)
Sum总共 (total)
Average平均 (average)
=等于 (is)
!=不等于 (is not)
>大于 (more than)
>=大于等于 (no less than)
<小于 (less than)
<=不小于 (no more than)
And并且 (and)
Or或者 (or)
Asc从低到高 (in the ascending)
Desc从高到低 (in the descending)
+ +Table 3: Natural language descriptions for different SQL components. + +rarely explored. Meanwhile, PLMs-based models, such as T5, have achieved SOTA results (Ribeiro et al., 2020a, 2021; Wang et al., 2022; Jolly et al., 2022) on many D2T tasks. Therefore, we experiment with T5-based models to understand their performance on CATs-D, CATs-S, and CATs: + +- TEMP automatically generates descriptions based on the predefined template. Specifically, we first manually write a template for SQL queries replacing the values, columns, table names, and conditions with slots. Meanwhile, we also create a list of descriptions for each component in SQL queries (Table 3 reports the descriptions of partial SQL components). Then we enumerate all cells in the table row by row to obtain the description for a table. Lastly, we join the two parts of descriptions as the final output. +- POINTER-GEN is an RNN-based Seq2Seq model with attention and copy mechanism (See et al., 2017). We concatenate the SQL and linearized table as input. +- T5 denotes finetuning the T5 model on the proposed CATs. The input is the same as that used in the POINTER-GEN. Notably, to make a fair comparison with our proposed method, we add a fully connected feed-forward network (FNN) on top of each transformer layer and make its parameters equal with the L-NE layer. We denote this as $\mathrm{T}5 + \mathrm{FNN}$ . +- T5-GRAPH is also a finetuning T5 method. Different from T5, it uses the sample graph + +
MODELSCATSCATS-DCATS-S
BLEUROUGE-LCOVERAGEBLEUROUGE-LCOVERAGEBLEUROUGE-LCOVERAGE
Development
GOLD--75.56--69.59--77.30
TEMP40.0457.2081.4818.0547.3777.9342.7159.8283.24
POINTER-GEN51.26±0.2073.70±0.1468.73±0.1348.33±0.9167.95±0.9656.96±0.9049.77±0.1673.79±0.2669.26±0.24
T553.60±0.1374.42±0.0672.87±0.0452.47±0.2868.5±0.3268.20±0.2551.43±0.1073.77±0.0473.08±0.03
T5 + FNN54.14±0.2174.80±0.1672.85±0.1852.10±0.1768.28±0.1768.02±0.3151.67±0.2273.75±0.1773.08±0.17
T5-GRAPH52.21±0.1773.68±0.0472.03±0.1049.89±0.4066.72±0.1066.65±0.2650.12±0.1873.11±0.1372.05±0.04
T5-GRAPH + FNN52.30±0.1773.71±0.2071.87±0.0548.81±0.2766.35±0.1366.10±0.3050.42±0.0973.22±0.1272.07±0.05
UGT54.75±0.1575.72±0.0672.68±0.1654.23±0.4969.82±0.3568.07±0.6352.54±0.1674.84±0.1272.99±0.07
UGT + NSE56.34±0.1376.72±0.0973.41±0.0558.79±0.5173.16±0.3168.94±0.3153.54±0.1575.36±0.1973.67±0.10
Test
GOLD--76.35--68.67--76.98
TEMP41.3957.8282.4017.7646.2177.8342.6960.1682.96
POINTER-GEN50.77±0.5673.25±0.1468.47±0.3147.34±0.8166.46±0.8056.93±1.2150.37±0.2774.21±0.2069.98±0.24
T553.49±0.1374.22±0.0872.36±0.1251.32±0.2266.81±0.2867.93±0.1852.91±0.0774.51±0.0873.33±0.08
T5 + FNN53.87±0.1874.42±0.1672.34±0.1050.71±0.1266.42±0.2467.06±0.2452.71±0.1474.32±0.1173.32±0.16
T5-GRAPH51.82±0.1373.28±0.0571.33±0.0347.91±0.2864.75±0.2065.51±0.3151.40±0.2273.78±0.1372.15±0.08
T5-GRAPH + FNN52.04±0.2273.58±0.1571.37±0.1347.45±0.3364.60±0.2565.69±0.3151.35±0.2178.78±0.1472.32±0.12
UGT54.27±0.2475.13±0.1072.13±0.1652.48±0.4367.96±0.4567.19±0.7253.03±0.3775.38±0.1173.18±0.13
UGT + NSE55.95±0.2376.10±0.0672.84±0.1857.10±0.4271.74±0.4368.40±0.2354.21±0.1775.93±0.2074.04±0.08
+ +Table 4: Automatic evaluation results on the development and test sets. Mean (±s.d.) over 4 seeds. + +representation with our method (described in Section 4.1) as input. Again, we add FNN to make a fair comparison, which is denoted as T5-GRAPH + FNN. + +Evaluation Metrics We evaluate our models by applying both automatic and human evaluations. For automatic evaluation, we employ the widely used metric, BLEU (Papineni et al., 2002) and ROUGE-L (Lin, 2004), to evaluate the fluency of generated text. And we utilize SacreBLEU (Post, 2018) to calculate the BLEU after segmenting the sentcne by jieba2. Additionally, we utilize COVERAGE (Shao et al., 2019) to evaluate the faithfulness of generated text. COVERAGE measures the average proportion of input tables that are covered by a generated text. The table headers are also considered. We use string matching rules to determine whether a cell exists in the generated text. We conduct experiments over 4 different seeds and report the average scores on them. + +We display examples of input representation for different models and provide the implementation details in Appendix C.1 and C.2. + +# 5.2 Main Result + +Table 4 presents the experimental results on CATs, CATs-D, and CATs-S, from which we make three main observations. + +First, we can see that all neural network models outperform TEMP on BLEU by a large margin. This suggests that neural models are better at generating fluent expressions. We consider this thanks to the language modeling task (Equation 3), which trains the neural models to predict the next token, given the previous history. Nevertheless, we find that TEMP achieves the best COVERAGE scores on all sets, even better than GOLD. We consider this is because, when annotating the references, to make the presentation more reasonable and fluent, annotators summarize the contents of the table, such as merging some cells, etc. On the other hand, TEMP copies all the contents of the table directly. + +Second, adding extra trainable parameters (+ FNN) does not always improve the performance on T5 and T5-GRAPH. For example, $\mathrm{T}5 + \mathrm{FNN}$ performs better than T5 on both CATs and CATS-S, but worse than T5 on CATs-D. Moreover, we notice that T5 performs better than T5-GRAPH given the fact that the sizes of their parameters are equal. We speculate this is because, compared to T5-GRAPH, T5 uses the original SQL and the flattened table as input, which preserves the partial structural information of the input SQL and table by the segment symbols "," and "l" (please refer to Appendix C.1 for the example of input data linearizations). However, T5-GRAPH still treats the input as a sequence and ignores the unified graph's structure, leading to its performance degradation. + +
MODELCATSCATS-DCATS-S
T5 + FNN54.14±0.2152.10±0.1751.67±0.22
w/o SQL40.90±0.2439.75±0.0840.00±0.30
w/o TABLE17.83±0.1324.25±0.3314.51±0.11
OURS56.34±0.1358.79±0.5153.54±0.15
w/o SQL45.16±0.2647.92±0.5043.89±0.38
w/o TABLE19.59±0.1626.91±0.1116.20±0.62
+ +Lastly, by explicitly modeling the unified graph structures, UGT dramatically outperforms the size-comparable models T5-GRAPH + FNN and T5-FNN on all metrics. The results display UGT's superiority in capturing essential structural knowledge for this task. Additionally, Node Segment Embedding (+ NSE) further improves the performance. This verifies that NSE can help the encoder better preserve the original structural information. + +# 5.3 Analysis and Discussion + +Effects of input SQL and Table To examine the effects of different input data, we conduct ablation studies on the input side by removing the input SQL and table. The results on three development sets are summarized in Table 5. We observe that, after removing the SQL and only utilizing the table as input, both T5 + FNN and our method (UGT + NSE) perform poorly on all metrics. The performance degrades even more if only SQL is employed. The results demonstrate that both input SQL and table are essential for the answer-to-sequence task. Additionally, our method clearly outperforms T5 + FNN on all ablation settings. It reveals the effectiveness of our method compared to vanilla T5 architecture even under extreme input conditions. + +Effects of Data Complexity We further explore the performances on different levels of data complexity. We use BLEU as the metric in this section. The results are shown in Table 6. We first explore the effect of the table size. Unsurprisingly, the BLEU scores of all models decrease as the number of table rows or columns grows. The more rows or columns the table contains, the more difficult it is for a model to process it. Compared to two baseline models, our method is better at handling large tables. Furthermore, we investigate the impact of SQL complexity on model performances. With respect to the SQL complexity, our model + +Table 5: Effect of input SQL and TABLE. w/o SQL and w/o TABLE denote removing the SQL and table from the input, respectively. Ours denotes UGT + NSE. + +
COLUMN NUMBER +# EXAMPLES1 +1,1382 +2,5803 +403>=4 +215
POINTER-GEN53.2150.7442.2035.29
T5 + FNN+2.28+1.16+7.08+4.29
OURS+5.61+4.69+7.54+5.28
ROW NUMBER +# EXAMPLES1 +1,8992 +7693 +467>=4 +1201
POINTER-GEN56.7249.7149.0544.30
T5 + FNN+3.57-0.58+1.68+6.24
OURS+5.75+1.54+5.16+7.62
SQL HARDNESS +# EXAMPLESEasy +915Medium +1,588Hard +1,531Extra Hard +302
POINTER-GEN60.9254.9942.7843.17
T5 + FNN+0.92+0.60+6.79+3.65
OURS+3.98+3.75+7.80+9.22
TARGET LENGTH +# EXAMPLES< 20< 40< 60>= 60
1,2751,635724702
POINTER-GEN52.6751.9752.0241.64
T5 + FNN+2.93-0.31-0.06+7.54
OURS+6.08+3.19+3.33+7.82
+ +Table 6: BLEU scores of different models in the CATs test set on different levels of data complexity. Relative results of T5 + FNN and our method are reported compared against the POINTER-GEN. + +achieves larger improvement against baseline models, especially on extra hard SQLs. It shows that our approach can better encode the complex input data than others. Lastly, we study the model performance concerning different ground-truth description lengths. The POINTER-GEN struggles on longer descriptions, where the performance drops over 10 BLEU scores on responses longer than 60. In this scenario, T5-based models dramatically outperform the POINTER-GEN, while our method can still beat $\mathrm{T}5 + \mathrm{FNN}$ . + +# 5.4 Human Evaluation + +To reach a deeper understanding of the qualities of the generated descriptions, we conduct human evaluation following Parikh et al. (2020). We compare our method with TEMP, POINTER-GEN, and T5 + FNN. Specifically, we first randomly select 100 examples from the CATs test set and the corresponding outputs generated by each model. And then, five native Chinese annotators (three females and two males) with master's degrees or above engaged in NLP research are invited to evaluate the quality from the four axes. Specifically, FLUENCY measures whether the description is fluent. FAITHFULNESS estimates whether the description is logically consistent with input SQL, and all pieces of information are supported by the input table. + +
MODELFlu.↑Fai.↑Cov.(%)↑Rep.↓
GOLD8.429.1595.320.14
TEMP5.276.8799.410.02
POINTER-GEN6.136.3283.270.74
T5 + FNN6.827.1689.270.39
OURS7.147.4890.260.27
+ +Table 7: Human evaluation over references (denoted as GOLD) and model outputs. Flu., Fai., Cov., Rep. denote FLUENCY, FAITHFULNESS, COVERAGE and REPETITION. $\uparrow$ indicates higher is better and $\downarrow$ denotes lower is better. + +They are scores range from 1 to 10, the higher the better. COVERAGE is the percentage of cells in the input table the candidate sentence covers. It is different from the one in Table 4 (please refer to Appendix C.4). REPETITION is number of cells the candidate sentence repeats. We also introduce the reference as one candidate (denoted as GOLD). And its results can be regarded as the upper bound. + +The results summarized in Table 7 show that the GOLD consistently achieves high performance than generation methods. It attests to the high quality of our human annotations. We report FLUENCY and FAITHFULNESS score for TEMP because they are sensitive evaluation. We can see that TEMP gets a high FAITHFULNESS score but is poor on FLUENCY. Our method outperforms baseline models on almost all axes with an agreement kappa score (van der Lee et al., 2020) more than 0.86. It demonstrates the effectiveness of our proposed method. Although our model achieves a high coverage rate (90.26%), its FAITHFULNESS score is relatively low (only 7.48), and there is a considerable gap compared with GOLD. It indicates simply copying content from the input table can not guarantee the faithfulness of the generated response. It may be necessary for the model to understand the deep semantics of SQL and table, which is the biggest challenge in this dataset. + +# 6 Conclusion + +We present CATs, a large-scale and high-quality Chinese answer-to-sequence dataset, along with a series of baselines. It helps alleviate the problem of current D2T datasets' bias towards the English language. We propose a Unified Graph Transformation method to bridge the structural gap between the SQL and table. In this way, we convert the task to a graph-to-text problem. Furthermore, we + +introduce the Node Segment Embedding to solve the problem that transforming the input graph to a new token graph breaks the original graph's structure. Experiments on CATs show that our proposed model outperforms existing baseline models. We conduct further analysis on CATs, which attests to both the high quality and challenges of the dataset. + +# Limitations + +This work presents CATs, a large-scale and high-quality Chinese answer-to-sequence dataset. It is a free and open dataset. One of most important motivations for presenting this dataset is that most of the existing datasets are built for English, which leads to advanced work on D2T generation primarily focusing on English and leaving other languages underexplored. However, CATs only alleviates the dataset language bias rather than solving it. And it is limited to the study of Chinese methods. Regarding methodology, the proposed UGT converts the answer-to-sequence task to a graph-to-text problem to bridge the gap between two heterogeneous input data (SQL and table). However, UGT works only for answer-to-sequence task rather than graph-to-text task. Additionally, though the proposed NSE can help the graph-to-text model better preserve the original structural information, the contribution may be limited to the graph-to-text task. + +# Ethics Statement + +This work presents CATS, a free and open dataset for the research community to study the answer-to-sequence problem in the practical TableQA system. And it helps enrich the D2T languages and alleviate the datasets' bias in English. To balance the data quality and scale and bring it closer to the practical scenario, data in CATs are collected from two sources, which are manually annotated as CATS-D and CATS-S. In other words, CATS consists of CATS-D and CATS-S. The data in CATS-D is collected from DuSQL (Wang et al., 2020b) dataset, a free and open dataset for the Chinese Text-to-SQL problem. Meanwhile, to enlarge our dataset, we adopt an automatic data construction pipeline to collect a large number of high-quality SQL-table pairs for annotation. To ensure the quality of our dataset, we manually annotate the SQL-table pairs. We hire 24 native annotators with undergraduate degrees to annotate the data. Specifically, 20 annotators are responsible for annotations, and another 4 workers are asked to review the annotated data. + +We pay 2.1 yuan (\(0.31 USD) for annotating each SQL-table pair. + +To avoid our dataset leakages personal privacy, we replace the sensitive information in the collected tables with predefined unique words. Furthermore, we ask the annotators to filter out the examples that leak personal privacy and contain social bias and harmful content. + +# References + +Lei Jimmy Ba, Jamie Ryan Kiros, and Geoffrey E. Hinton. 2016. Layer normalization. CoRR, abs/1607.06450. +Junwei Bao, Duyu Tang, Nan Duan, Zhao Yan, Yuanhua Lv, Ming Zhou, and Tiejun Zhao. 2018. Table-to-text: Describing table region with natural language. 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 5020-5027. AAAI Press. +Deng Cai and Wai Lam. 2020. Graph transformer for graph-to-sequence learning. 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 7464-7471. AAAI Press. +Wenhu Chen, Jianshu Chen, Yu Su, Zhiyu Chen, and William Yang Wang. 2020. Logical natural language generation from open-domain tables. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, ACL 2020, Online, July 5-10, 2020, pages 7929-7942. Association for Computational Linguistics. +Marco Damonte and Shay B. Cohen. 2019. Structural neural encoders for amr-to-text generation. 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 3649-3658. Association for Computational Linguistics. +Shineng Fang, Jiangjie Chen, Xinyao Shen, Yunwen Chen, and Yanghua Xiao. 2022.: A faithful contrastive framework for response generation in tableqa systems. In International Conference on Database Systems for Advanced Applications. Springer. +Claire Gardent, Anastasia Shimorina, Shashi Narayan, and Laura Perez-Beltrachini. 2017a. Creating training corpora for nlg micro-planners. In Proceedings + +of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 179-188. +Claire Gardent, Anastasia Shimorina, Shashi Narayan, and Laura Perez-Beltrachini. 2017b. The webnlg challenge: Generating text from RDF data. In Proceedings of the 10th International Conference on Natural Language Generation, INLG 2017, Santiago de Compostela, Spain, September 4-7, 2017, pages 124-133. Association for Computational Linguistics. +Jiaqi Guo, Ziliang Si, Yu Wang, Qian Liu, Ming Fan, Jian-Guang Lou, Zijiang Yang, and Ting Liu. 2021. Chase: A large-scale and pragmatic chinese dataset for cross-database context-dependent text-to-sql. 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 2316-2331. Association for Computational Linguistics. +Jiaqi Guo, Zecheng Zhan, Yan Gao, Yan Xiao, JianGuang 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 2019, Florence, Italy, July 28- August 2, 2019, Volume 1: Long Papers, pages 4524-4535. Association for Computational Linguistics. +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 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 13116-13124. AAAI Press. +Shailza Jolly, Zi Xuan Zhang, Andreas Dengel, and Lili Mou. 2022. Search and learn: Improving semantic coverage for data-to-text generation. In Thirty-Sixth AAAI Conference on Artificial Intelligence, AAAI 2022, Thirty-Fourth Conference on Innovative Applications of Artificial Intelligence, IAAI 2022, The Twelveth Symposium on Educational Advances in Artificial Intelligence, EAAI 2022 Virtual Event, February 22 - March 1, 2022, pages 10858-10866. AAAI Press. +Guillaume Klein, Yoon Kim, Yuntian Deng, Jean Senellart, and Alexander Rush. 2017. OpenNMT: Open-source toolkit for neural machine translation. In Proceedings of ACL 2017, System Demonstrations, pages 67-72, Vancouver, Canada. Association for Computational Linguistics. + +Karen Kukich. 1983. Design of a knowledge-based report generator. In 21st Annual Meeting of the Association for Computational Linguistics, Massachusetts Institute of Technology, Cambridge, Massachusetts, USA, June 15-17, 1983, pages 145-150. ACL. +Rémi Lebret, David Grangier, and Michael Auli. 2016. Neural text generation from structured data with application to the biography domain. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, EMNLP 2016, Austin, Texas, USA, November 1-4, 2016, pages 1203-1213. The Association for Computational Linguistics. +Liang Li, Can Ma, Yinliang Yue, and Dayong Hu. 2021. Improving encoder by auxiliary supervision tasks for table-to-text generation. 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 5979-5989. Association for Computational Linguistics. +Percy Liang, Michael I. Jordan, and Dan Klein. 2009. Learning semantic correspondences with less supervision. In ACL 2009, 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, 2-7 August 2009, Singapore, pages 91-99. The Association for Computer Linguistics. +Chin-Yew Lin. 2004. Rouge: A package for automatic evaluation of summaries. In Text summarization branches out, pages 74-81. +Tianyu Liu, Fuli Luo, Qiaolin Xia, Shuming Ma, Baobao Chang, and Zhifang Sui. 2019. Hierarchical encoder with auxiliary supervision for neural table-to-text generation: Learning better representation for tables. 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 6786-6793. AAAI Press. +Ilya Loshchilov and Frank Hutter. 2018. Decoupled weight decay regularization. In International Conference on Learning Representations. +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. +Ankur P. Parikh, Xuezhi Wang, Sebastian Gehrmann, Manaal Faruqui, Bhuwan Dhingra, Diyi Yang, and Dipanjan Das. 2020. Totto: A controlled table-to-text generation dataset. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language + +Processing, EMNLP 2020, Online, November 16-20, 2020, pages 1173-1186. 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, WMT 2018, Belgium, Brussels, October 31 - November 1, 2018, pages 186-191. 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. J. Mach. Learn. Res., 21:140:1-140:67. +Ehud Reiter and Robert Dale. 1997. Building applied natural language generation systems. Nat. Lang. Eng., 3(1):57-87. +Leonardo F. R. Ribeiro, Martin Schmitt, Hinrich Schütze, and Iryna Gurevych. 2020a. Investigating pretrained language models for graph-to-text generation. CoRR, abs/2007.08426. +Leonardo F. R. Ribeiro, Yue Zhang, Claire Gardent, and Iryna Gurevych. 2020b. Modeling global and local node contexts for text generation from knowledge graphs. Trans. Assoc. Comput. Linguistics, 8:589-604. +Leonardo F. R. Ribeiro, Yue Zhang, and Iryna Gurevych. 2021. Structural adapters in pretrained language models for amr-to-text generation. 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 4269-4282. Association for Computational Linguistics. +Raphael Schumann and Stefan Riezler. 2021. Generating landmark navigation instructions from maps as a graph-to-text problem. 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 489-502. Association for Computational Linguistics. +Abigail See, Peter J. Liu, and Christopher D. Manning. 2017. Get to the point: Summarization with pointer-generator networks. CoRR, abs/1704.04368. +Zhihong Shao, Minlie Huang, Jiangtao Wen, Wenfei Xu, and Xiaoyan Zhu. 2019. Long and diverse text generation with planning-based hierarchical variational model. 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 3255-3266. Association for Computational Linguistics. + +Linfeng Song, Yue Zhang, Zhiguo Wang, and Daniel Gildea. 2018. A graph-to-sequence model for amr-to-text 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 1616-1626. Association for Computational Linguistics. +Chris van der Lee, Albert Gatt, Emiel van Miltenburg, and Emiel Krahmer. 2020. Human evaluation of automatically generated text: Current trends and best practice guidelines. Computer Speech & Language, page 101151. +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. +Petar Velickovic, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Liò, and Yoshua Bengio. 2018. Graph attention networks. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net. +Bailin Wang, Richard Shin, Xiaodong Liu, Oleksandr Polozov, and Matthew Richardson. 2020a. 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 2020, Online, July 5-10, 2020, pages 7567-7578. Association for Computational Linguistics. +Fei Wang, Zhewei Xu, Pedro A. Szekely, and Muhao Chen. 2022. Robust (controlled) table-to-text generation with structure-aware equivariance learning. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL 2022, Seattle, WA, United States, July 10-15, 2022, pages 5037-5048. Association for Computational Linguistics. +Lijie Wang, Ao Zhang, Kun Wu, Ke Sun, Zhenghua Li, Hua Wu, Min Zhang, and Haifeng Wang. 2020b. Dusql: A large-scale and pragmatic chinese text-tosql dataset. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing, EMNLP 2020, Online, November 16-20, 2020, pages 6923-6935. Association for Computational Linguistics. +Tianming Wang, Xiaojun Wan, and Shaowei Yao. 2020c. Better amr-to-text generation with graph structure reconstruction. In Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence, IJCAI 2020, pages 3919-3925. ijcai.org. +Sam Wiseman, Stuart M. Shieber, and Alexander M. Rush. 2017. Challenges in data-to-document generation. In Proceedings of the 2017 Conference on + +Empirical Methods in Natural Language Processing, EMNLP 2017, Copenhagen, Denmark, September 9-11, 2017, pages 2253-2263. 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, 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. +Kun Xu, Lingfei Wu, Zhiguo Wang, Yansong Feng, Michael Witbrock, and Vadim Sheinin. 2018. Graph2seq: Graph to sequence learning with attention-based neural networks. arXiv preprint arXiv:1804.00823. +Liang Xu, Hai Hu, Xuanwei Zhang, Lu Li, Chenjie Cao, Yudong Li, Yechen Xu, Kai Sun, Dian Yu, Cong Yu, Yin Tian, Qianqian Dong, Weitang Liu, Bo Shi, Yiming Cui, Junyi Li, Jun Zeng, Rongzhao Wang, Weijian Xie, Yanting Li, Yina Patterson, Zuoyu Tian, Yiwen Zhang, He Zhou, Shaoweihua Liu, Zhe Zhao, Qipeng Zhao, Cong Yue, Xinrui Zhang, Zhengliang Yang, Kyle Richardson, and Zhenzhong Lan. 2020. CLUE: A chinese language understanding evaluation benchmark. In Proceedings of the 28th International Conference on Computational Linguistics, COLING 2020, Barcelona, Spain (Online), December 8-13, 2020, pages 4762-4772. International Committee on Computational Linguistics. +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. 2019. 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 2019, Hong Kong, China, November 3-7, 2019, pages 1962-1979. Association for Computational Linguistics. +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. 2018. 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, Brussels, Belgium, October 31 - November 4, 2018, pages 3911-3921. Association for Computational Linguistics. + +Luke S. Zettlemoyer and Michael Collins. 2012. Learning to map sentences to logical form: Structured classification with probabilistic categorical grammars. CoRR, abs/1207.1420. +Jie Zhu, Junhui Li, Muhua Zhu, Longhua Qian, Min Zhang, and Guodong Zhou. 2019. Modeling graph structure in transformer for better amr-to-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 5458-5467. Association for Computational Linguistics. + +
SQLs ::= SQL | SQL interaction SQLs | SQL union SQLs | ...
SQL ::= Select | Select Where | Select Order | Select Order Filter
Select ::= Select A | Select AA | ...
Where ::= Where Conditions
Conditions ::= A op value | A op SQL
A ::= C | MIN C | MAX C | AVG C | COUNT C | SUM C
C ::= T(column | T(column mathop T(column
T ::= table in current database
mathop ::= + | - | * |
op ::= == | != | > | >= | < | <= | like | in | not in
+ +Table 8: SQL generation grammar rules. + +# A Dataset Construction Details + +# A.1 Database Building Details + +To build the database, we first clean the collected tables. We build a rule-based table cleaning pipeline to guarantee table quality. We filter out noise tables via rules as follows: (1) We first build a blacklist including special chars, dirty words, emojis, and HTML words. And filter tables if the headers or the values include any word in the blacklist; (2) We recognize all of the header types in each table including Text, Number, Time, and Bool. If the proportion of Text type is less than $30\%$ , we filter out the table; (3) We filter out tables with less than 2 columns or rows; (4) We will filter out the table, if a value repeats more than $50\%$ in it. Finally, we obtain 24K high-quality tables. + +The original crawled data are in the form of independent tables, which need to be linked with other tables to form databases. We build a database creation pipeline and link different tables based on the header overlap (Wang et al., 2020b) to acquire multi-table databases. Finally, 600 databases are selected in the dataset. + +# A.2 Automatic SQL Generator + +The SQL generator utilizes production rules from the SQL grammar to automatically generate SQL queries. Specifically, a SQL query can be represented as an abstract syntax tree (AST) using the rules, such as SQLs = SQL, SQL = Select Where, Select = SELECT A, Where = WHERE Conditions..., all of which are production rules of the SQL grammar. By exploiting every rule of the grammar, we can generate SQL queries covering patterns of different complexity along with + +![](images/821cdb154fabe8c8954aadb90578d9f9fa164ed4ad0f53f1ed08ed038c922cf8.jpg) +Figure 3: Topic distribution of CATs. + +corresponding tables. We illustrate some SQL production rules in Table 8. + +# A.3 SQL Hardness + +Following Guo et al. (2021), we adopt SQL hardness to measure the complexity of SQL queries from the following four-level: easy, medium, hard, and extra hard (Yu et al., 2018). The SQL difficulty is defined based on the number of SQL components, selections, and conditions. Therefore, queries that contain more SQL keywords (GROUP BY, ORDER BY, INTERSECT, nested subqueries, column selections, and aggregators, etc.) are considered harder. For example, a query is considered hard if it includes more than two SELECT columns, more than two WHERE conditions, and GROUP BY two columns, or contains EXCEPT or nested queries. A SQL with more additions on top of that is considered extra hard. + +# B Topics Distribution of CATs + +Following Parikh et al. (2020), we build a topic categorization model for tables in CATs to investigate the topic distribution. We first ask the annotators to label 10,000 tables and then train a table topic classifier built on a table-aware encoder (Bao et al., 2018). We apply the classifier to label other table topics. Figure 3 presents an aggregated topic analysis of our dataset. We find that $61\%$ of CATs is made up of the Media, Insurance, and Bank topics, and the other $39\%$ is composed of broader topics, such as Public Service, Technology, and Finance. The proposed CATs is limited to topics that are presented in CLUE and DuSQL. + +# C Experimental Details + +# C.1 Example of SQL and Table Linearizations + +We display the input representations for different models in Figure 4. For POINTER-GEN, T5, and $\mathrm{T}5 + \mathrm{FNN}$ , we directly concatenate the SQL and linearized table as input, where table is linearized row by row. For T5-GRAPH, T5-GRAPH + FNN and Ours, follow previous work (Ribeiro et al., 2021), we linearize the SQL graph $\mathcal{G}_s$ into a sequence of nodes by the depth-first traversal and concatenate it with the linearized table as input. Especially, instead of segmenting the nodes with special symbol $l$ , we build a connection matrix for the token graph $\mathcal{G}$ . The connection matrix is used by the Local Node Encoder to encoding the graph structure. + +# C.2 Implementation Details + +We employ the POINTER-GEN implemented by OpenNMT (Klein et al., 2017). POINTER-GEN is built based on LSTM (Hochreiter and Schmidhuber, 1997). We set the layers of the encoder and decoder as 2 and 1, respectively. And we set the embedding and decoder hidden size as 512. T5-based methods are implemented using HuggingFace (Wolf et al., 2020) and inutilized by $\mathrm{T5}_{\text{base}}^3$ . And the hidden size of the GAT layer in the Local Node Encoder is set to 512. For T5-based methods, we set the dropout rate to 0.1, use AdamW optimizer (Loshchilov and Hutter, 2018) and employ a linear learning rate decay schedule without warm-up. We use BLEU (Papineni et al., 2002) for the early stopping criterion. Moreover, the learning rate is 3e-5 and batch size is 4 for all experiments. During decoding, we employ beam search with a beam size 5. All experiments are trained on Nvidia Tesla V100 32GB GPUs. + +# C.3 Human Evaluation Details + +The detailed information about the four human evaluation metrics are as following: + +- Fluency: a sentence is fluent if it is grammatical and natural. And it is scored from 1 to 10, where 1 represents not Fluent, and 10 represents Mostly Fluent. +- Faithfulness: a sentence is considered faithful if it is logically consistent with the input SQL + +![](images/02cfc96f679e37dda8a7292e709ccc3d91b3cde0e17b8ca0df7299bed288b0bf.jpg) +Figure 4: Different linearizations for an input SQL and Table. + +and all pieces of information are supported by the table. The score ranges from 1 to 10. + +- Coverage is the percentage of cells in the input table the candidate sentence covers. It is calculated by $\frac{n^c}{n^t}$ , where $n^t$ denotes all cells in the input table, and $n^c$ represents the number of cells covered by the sentence. +- Repetition number of cells the candidate sentence repeats. If a cell is repeated $n$ times, it will be recorded $n$ times. + +For each sample, the annotators need to evaluate four candidates based on the input data. And they do not know which model generates these sentences. + +# C.4 Differences in COVERAGE between Automatic Evaluation and Human Evaluation + +The COVERAGE in Table 4 is calculated by $cov^a = \frac{n^c}{n^a}$ , where $n^a$ denotes all cells in the input table and include the cells in the table header. $n^c$ represents the number of cells covered by the generated text. We use string matching rules to determine whether a cell exists in the generated text. $cov^a$ does not consider semantic matching between cells. Therefore, it will miss some cells that are summarized or paraphrased cells. + +The COVERAGE in human evaluation is calculated $cov^{h} = \frac{n^{c}}{n^{t}}$ , where $n^{t}$ denotes all cells in the input table and does not include the cells in the table header. $n^{c}$ represents the number of cells covered by the sentence. $n^{c}$ is counted by manual checking. Therefore, the cells that are summarized or paraphrased in the generated text will counted. + +Overall, $cov^a$ is more rigorous and inflexible than $cov^h$ , and it takes more account of the able headers, so it scores lower. + +# D Case Study + +In Figure 5, we display two decoder output examples from the baselines on the development set of CATs. We find that the model can generate text with high coverage when the input table is simple, such as the number of columns being small. Second, when the input table is complex, such as containing multiple rows and columns, simple models, such as POINTER-GEN, tend to miss some content. Meanwhile, the complex models, such as T5-based ones, only simply enumerate the table cells rather than describe them like humans. Finally, the descriptions generated by models are not faithful to the input, even though they contain most of the input table content. For example, in the second case, all the models do not describe the "earliest" correctly. That is, the descriptions are not logically consistent with the input SQL, which is one of the biggest challenges of this task. + +
Case AInputSQLSELECT 名称 FROM 八大行星 ORDER BY 最高温度 - 最低温度 ASC LIMIT 3 +SELECT name FROM the plants ORDER BY maximum temperature - minimum temperature ASC LIMIT 3
Table名称<br>地球<br>木星<br>水星 +Name <br> Earth <br> Jupiter <br> Mercury
OutputGold在八大行星中,温差最小的3个行星是:地球、木星、水星。 +In the eight planets, the three planets with smallest temperature different are: Earth, Jupiter, Mercury.
TMP在八大行星中,最高温度-最低温度的名称分别是地球、木星、和水星。 +In the eight planets, the names of maximum temperature - minimum temperature are: Earth, Jupiter, and Mercury.
POINTER -GEN按温度-温度最大的3个八大行星分别是:1、地球;2、木星;3、水星。 +The three eight planets with the largest temperature-temperature are:1. Earth;2. Jupiter;3. Mercury.
T5-FNN八大行星的最高温度最高的3个行星分别是:1、地球;2、木星;3、水星。 +The three planets with the highest maximum temperatures of the eight planets are:1. Earth;2. Jupiter;and 3. Mercury.
Ours温差最小的3个行星分别是:1、地球;2、木星;3、水星。 +The three planets with smallest temperature different are:1. Earth,2. Jupiter,3. Mercury.
Case BInputSQLSELECT 名称,领域,获奖者最大年龄 FROM 诺贝尔奖项 ORDER BY 第一次颁奖时间ASC LIMIT 3 +SELECT name, field, the maximum age of the winner FROM Nobel Prize ORDER BY the first award time DESC LIMIT 3
Table名称|领域|获奖者最大年龄<br>诺贝尔化学奖|化学|77<br>诺贝尔物理学奖|87<br>诺贝尔生理学或医学奖|生理及医学|77 +name | field | the maximum age of the winners <br> Nobel Prize in Chemistry | chemistry | 77 <br> Nobel Prize in Physics | physics | 87 <br> Nobel Prize in Physiology or Medicine | physiology and medicine | 77
OutputGold第一次颁奖时间最早的3个诺贝尔奖项的领域和获奖人的最大年龄分别是:1.化学领域、获得诺贝尔化学奖的最大年龄是77岁;2.物理领域、获得诺贝尔物理学奖的最大年龄是87岁;3.生理及医学领域、获得诺贝尔生理学或医学奖的最大年龄是77岁。
The fields and maximum ages of the winners of the three Nobel Prizes that were awarded the earliest for the first time are 1. Chemistry, where the maximum age to receive the Nobel Prize in Chemistry is 77;2. Physics, where the maximum age to receive the Nobel Prize in Physics is 87;3. Physiology and Medicine, where the maximum age to receive the Nobel Prize in Physiology or Medicine | physiology or Medicine | 77.
TMP按照第一次颁奖的名称,领域,获奖者最大年龄分别是诺贝尔化学奖、化学、77,和诺贝尔物理学奖、物理、87,和诺贝尔生理学或医学奖、生理及医学、77。
POINTER -GEN第一次颁奖时间最少的3个诺贝尔奖项的名称,领域,获奖者最大年龄分别是:1.诺贝尔化学奖,化学,2;2.诺贝尔物理学奖,物理,3;3.诺贝尔生理学或医学奖,生理及医学,77。
The names, fields, and maximum ages of the winners of the three Nobel Prizes that are awarded the minimum for the first time are 1. The Nobel Prize in chemistry, chemistry,2.2. Nobel Prize in physics, physics,3;3. Nobel Prize in physiology or medicine, physiology and medicine,77.
T5-FNN第一次颁奖时间最长的3个诺贝尔奖项名称,领域,获奖者最大年龄有3个,分别是:1.诺贝尔化学奖,化学,77;2.诺贝尔物理学奖,物理,87;3.诺贝尔生理学或医学奖,生理及医学,77。
The fields and maximum ages of the winners of the three Nobel Prizes that are awarded the longest for the first time are 1. The Nobel Prize in Chemistry, Chemistry,77;2. The Nobel Prize in Physics, Physics,87;3. the Nobel Prize in Physiology or Medicine, Physiology and Medicine,77.
Ours第一次颁奖时间最短的3个诺贝尔奖项的领域和获奖者最大年龄分别是:1.诺贝尔化学奖,化学,77;2.诺贝尔物理学奖,物理,87;3.诺贝尔生理学或医学奖,生理及医学,77。
+ +Figure 5: Answer-to-sequence examples in CATs. Error words are in red. Confusing and incomprehensible phrases are in blue. + +A For every submission: + +A1. Did you describe the limitations of your work? Section Limitations +A2. Did you discuss any potential risks of your work? Section Ethics Statement +A3. Do the abstract and introduction summarize the paper's main claims? Section 6 +A4. Have you used AI writing assistants when working on this paper? Left blank. + +B Did you use or create scientific artifacts? + +Left blank. + +B1. Did you cite the creators of artifacts you used? Left blank. +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? Not applicable. Left blank. +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? Not applicable. Left blank. +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? Section and Section Ethics Statement +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? Not applicable. Left blank. +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. Section 3 and Appendix B + +C Did you run computational experiments? + +Section 5 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? Appendix C.2 + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? Appendix C.2 +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? Section 5.1 and Section 5.4 +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? Section 5.1 + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? Section 3 and Section 5.4 + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? Section 3 and Section 5.4 +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? Section Ethics Statement +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? We provide the link where the data and code are available at. +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? Not applicable. Left blank. +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? Section 5.4 and Ethics Statement \ No newline at end of file diff --git a/catsapragmaticchineseanswertosequencedatasetwithlargescaleandhighquality/images.zip b/catsapragmaticchineseanswertosequencedatasetwithlargescaleandhighquality/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..ccde9805e17f7d7ca999788762c92773f61e64e6 --- /dev/null +++ b/catsapragmaticchineseanswertosequencedatasetwithlargescaleandhighquality/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:94b49eb676d28a4aa6dad9c505721d4a80907bf5cd9aba3b883226b295c14943 +size 877246 diff --git a/catsapragmaticchineseanswertosequencedatasetwithlargescaleandhighquality/layout.json b/catsapragmaticchineseanswertosequencedatasetwithlargescaleandhighquality/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..a388a13c77aada7a6be8237725d602cef37080ce --- /dev/null +++ b/catsapragmaticchineseanswertosequencedatasetwithlargescaleandhighquality/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd145c5e1d28bc74a0ba1758c6c6756847edd9b7963f3f5eee3d41cf4620b209 +size 493122 diff --git a/causaldebiasunifyingdebiasinginpretrainedlanguagemodelsandfinetuningviacausalinvariantlearning/e074a420-2b11-479e-9ebc-5eb4c2b48988_content_list.json b/causaldebiasunifyingdebiasinginpretrainedlanguagemodelsandfinetuningviacausalinvariantlearning/e074a420-2b11-479e-9ebc-5eb4c2b48988_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..0695a648c1c0d5c9b089e5bd84dd739d45c6c934 --- /dev/null +++ b/causaldebiasunifyingdebiasinginpretrainedlanguagemodelsandfinetuningviacausalinvariantlearning/e074a420-2b11-479e-9ebc-5eb4c2b48988_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d074429a0350d43e7466ea5444e1d74522130741d9e9f4926e1c5ffddf2143ad +size 99113 diff --git a/causaldebiasunifyingdebiasinginpretrainedlanguagemodelsandfinetuningviacausalinvariantlearning/e074a420-2b11-479e-9ebc-5eb4c2b48988_model.json b/causaldebiasunifyingdebiasinginpretrainedlanguagemodelsandfinetuningviacausalinvariantlearning/e074a420-2b11-479e-9ebc-5eb4c2b48988_model.json new file mode 100644 index 0000000000000000000000000000000000000000..202288f7d568b86568c38fd6d251085c0d3dd929 --- /dev/null +++ b/causaldebiasunifyingdebiasinginpretrainedlanguagemodelsandfinetuningviacausalinvariantlearning/e074a420-2b11-479e-9ebc-5eb4c2b48988_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a0eab0d91b85e62501860550da0b9491f53a0bf069c29394a95b0633946bec43 +size 122888 diff --git a/causaldebiasunifyingdebiasinginpretrainedlanguagemodelsandfinetuningviacausalinvariantlearning/e074a420-2b11-479e-9ebc-5eb4c2b48988_origin.pdf b/causaldebiasunifyingdebiasinginpretrainedlanguagemodelsandfinetuningviacausalinvariantlearning/e074a420-2b11-479e-9ebc-5eb4c2b48988_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ed3958593c5bd5cab500481b49730ef7d0fc95b6 --- /dev/null +++ b/causaldebiasunifyingdebiasinginpretrainedlanguagemodelsandfinetuningviacausalinvariantlearning/e074a420-2b11-479e-9ebc-5eb4c2b48988_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9d4aa7aaa5c60f71b87079ee875815b17a4bff0a72f97b0f47d803db8a98a6d9 +size 990724 diff --git a/causaldebiasunifyingdebiasinginpretrainedlanguagemodelsandfinetuningviacausalinvariantlearning/full.md b/causaldebiasunifyingdebiasinginpretrainedlanguagemodelsandfinetuningviacausalinvariantlearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..f3531336d7edb94999df9c001429d6d29ffdf639 --- /dev/null +++ b/causaldebiasunifyingdebiasinginpretrainedlanguagemodelsandfinetuningviacausalinvariantlearning/full.md @@ -0,0 +1,420 @@ +# Causal-Debias: Unifying Debiasing in Pretrained Language Models and Fine-tuning via Causal Invariant Learning + +Fan Zhou $^{1}$ Yuzhou Mao $^{1}$ Liu Yu $^{1*}$ Yi Yang $^{2}$ Ting Zhong $^{1,3}$ + +1University of Electronic Science and Technology of China +$^{2}$ Hong Kong University of Science and Technology +$^{3}$ Kashi Institute of Electronics and Information Industry + +fan.zhou@uestc.edu.cn, yuzhou.mao@outlook.com, liu.yu@std.uestc.edu.cn, imyiyang@ust.hk, zhongting@uestc.edu.cn + +# Abstract + +Demographic biases and social stereotypes are common in pretrained language models (PLMs), and a burgeoning body of literature focuses on removing the unwanted stereotypical associations from PLMs. However, when fine-tuning these bias-mitigated PLMs in downstream natural language processing (NLP) applications, such as sentiment classification, the unwanted stereotypical associations resurface or even get amplified. Since pretrain&fine-tune is a major paradigm in NLP applications, separating the debiasing procedure of PLMs from fine-tuning would eventually harm the actual downstream utility. In this paper, we propose a unified debiasing framework Causal-Debias to remove unwanted stereotypical associations in PLMs during fine-tuning. Specifically, Causal-Debias mitigates bias from a causal invariant perspective by leveraging the specific downstream task to identify bias-relevant and label-relevant factors. We propose that bias-relevant factors are non-causal as they should have little impact on downstream tasks, while label-relevant factors are causal. We perform interventions on non-causal factors in different demographic groups and design an invariant risk minimization loss to mitigate bias while maintaining task performance. Experimental results on three downstream tasks show that our proposed method can remarkably reduce unwanted stereotypical associations after PLMs are fine-tuned, while simultaneously minimizing the impact on PLMs and downstream applications. + +# 1 Introduction + +Pretrained language models (PLMs) have achieved remarkable success in many natural language processing (NLP) tasks. However, PLMs often encoded undesired social stereotypes and biases, and thus mitigating such biases has become an emerging and important task (Meade et al., 2022). Prior bias mitigation methods often focus on removing + +unwanted stereotypical associations in PLMs. For example, some works (Zmigrod et al., 2019) pretrain a language model using original and counterfactual corpus in order to cancel-out biased associations, some works (Liang et al., 2020) focus on debiasing post-hoc sentence representations, and others (Guo et al., 2022; Cheng et al., 2021) design bias-equalizing objectives to fine-tune PLM's parameters. + +![](images/1ecf43ea8116a6d1661ee63ecbb641b0864c475c932fe7cfea353a69e53b5b5d.jpg) +(a) Original BERT. + +![](images/7a710feca4f085cc35a489c0a06ad5863b9940298e243d54be34fc81ed71bfe9.jpg) +(b) BERT after Auto-Debias. + +![](images/a5dfd38048481e7d94460dabda22af0c1b4385a916946841de5fe77b2b3ab86c.jpg) +(c) Auto-Debias on SST-2. + +![](images/3c9f752c6c024c22363467c08722b16a1f0bc49fe5fd57980b0617a00caa91b4.jpg) +(d) Ours on SST-2. +Figure 1: Motivation of Causal-Debias. $t$ -SNE plots of average sentence representations of each word across its sentence templates on SST-2 task (Socher et al., 2013). + +However, a problem with existing debiasing strategies is that they are separate from downstream NLP tasks. If people take a debiased PLM which is supposed to have certain stereotypical associations removed, and then fine-tune it on downstream task, the unwanted associations will re-enter or even get amplified in the fine-tuned language model (Goldfarb-Tarrant et al., 2021). Consider gender debiasing using Auto-Debias (Guo et al., 2022) as an example. Fig. 1a and 1b shows the BERT-based sentence embeddings using $t$ -SNE (Van der Maaten and Hinton, 2008) before and after AutoDebias, respectively. The gender bias is clearly less + +prominent than the original BERT, i.e., non-genderspecific concepts (in black) are more equidistant to both genders after Auto-Debias (Fig. 1b). However, when applying BERT model that is debiased by Auto-Debias to downstream tasks (Fig. 1c), the finetuning procedure almost, if not all, "neutralizes" the effect of PLM debiasing. The phenomenon that biases encode in a fine-tuned PLM is as worrisome as in a vanilla PLM, because the fine-tuned PLM is more likely to be deployed in real-world scenarios serving thousands to millions of end users. + +Addressing the aforementioned bias resurgence issues is non-trivial. On the one hand, existing literature on bias mitigation mostly treats PLM debiasing as a standalone problem which is separate from downstream tasks. Incorporating debiasing objectives into the fine-tuning procedure can be a viable solution but it is still less explored. On the other hand, one may expect to use existing debiasing methods to re-debias the fine-tuned PLM. However, due to catastrophic forgetting concern (Kirkpatrick et al., 2017), a sequential combination of fine-tuning and debiasing may worsen the downstream task performance (Goodfellow et al., 2013). Therefore, there is a research gap in unifying debiasing in PLMs and fine-tuning for building fair and accountable NLP services. + +In this work, we propose Causal-Debias, a Causal Invariant Debiasing Model to unify the debiasing with downstream fine-tuning. In principle, we analyze the cause and propagation of biases and introduce the Structure Causal Model (SCM) (Pearl et al., 2000, 2016) to address the bias mitigation problem by exploiting the inherent causal mechanism in the downstream datasets. Specifically, Causal-Debias first exploits a causal intervention module to distinguish causal and non-causal factors. It then generates counterfactual sentences which have different non-causal factors but the same semantic meanings. The generated counterfactual sentences, along with the original sentences, are fed into an invariant optimization function to ensure a trade-off between the performance of downstream tasks and the effectiveness of debiasing. As illustrated in Fig. 1(d), Causal-Debias can preserve the PLM debiasing effect even after fine-tuning on the downstream dataset. + +We evaluate performance of Causal-Debias in mitigating the gender and racial biases in several popular PLMs, e.g., BERT (Devlin et al., 2019), ALBERT (Lan et al., 2020), and RoBERTa (Liu + +et al., 2019), on three GLUE (Wang et al., 2018) tasks (SST-2, CoLA, and QNLI). The results demonstrate Causal-Debias can significantly mitigate PLM biases after downstream fine-tuning while also maintaining the downstream task performance. We hope this work provides empirical evidence that stereotypical associations can re-enter language models during the fine-tuning step. Moreover, we hope that debiasing with a causal perspective offers a more generalizable and reliable way for building fair and accountable NLP applications. We release the anonymous implementation of Causal-Debias at https://github.com/myZeratul/Causal-Debias. + +# 2 Related Works + +PLM Debiasing aims to remove biases, quantified as unwanted stereotypical associations, from pretrained language models. Existing works on PLM debiasing can be categorized into two lines based on whether downstream tasks are involved in the debiasing pipeline. (1) Non-Task-Specific: Counterfactual Data Augmentation (CDA) (Zmigrod et al., 2019) and Dropout (Webster et al., 2020) are two methods where debiasing happens in the pre-training stage (Meade et al., 2022). Auto-Debias (Guo et al., 2022), Context-Debias (Kaneko and Bollegala, 2021) and MA-BEL (He et al., 2022) remove biases in PLM by designing different bias-equalizing objectives. In this line of work, the parameters in the PLM are changed to meet the fairness criteria such as SEAT (May et al., 2019), and the ultimate goal is to remove bias associations from PLM, so that downstream tasks can benefit from the debiased models. However, we show that it is not this case. When the debiased models are fine-tuned on downstream tasks, the bias associations resurge, perhaps because the biases are not completely removed or maybe just covered up, or because downstream datasets are encoded with stereotypical associations. (2) Task-Specific: Existing works on this line, including Sent-Debias (Liang et al., 2020) and FairFil (Cheng et al., 2021), keep the parameters of PLMs untouched. Instead, they target on the sentence representations, and aim to remove bias associations from representations. Even though the sentence representations, which are the input for downstream tasks, are refined, downstream fine-tuning can still introduce new biases, as we show in experiments. In summary, our work differs from + +existing PLM debiasing in that we aim to unify fine-tuning procedure with debiasing so that the fine-tuned models are free from bias associations. + +In addition, prior literature also challenges the effectiveness of bias mitigation. Gonen and Goldberg (2019) showed that debiasing methods only cover-up biases in word embeddings but do not remove them. Meade et al. (2022) found that existing debiasing methods for PLMs hurt the language modeling capability of PLMs and thus the practical utility of debiasing warrants attention. Our work follows the spirit of this line of works in that we empirically demonstrate the bias resurgence problem in fine-tuning and suggest to development debiasing techniques with downstream utility. + +Causal Mechanism is crystallized in the invariant learning, suggesting that only associations invariant in the training set should be learned (Peters et al., 2016; Muandet et al., 2013). Invariant Risk Minimization (IRM) (Arjovsky et al., 2019) is a practical implementation of invariant learning, which is an optimization objective modifying the loss with a regularization term to enforce the invariant representations. Recent works have explored Structural Causal Model (SCM) (Scholkopf et al., 2012) to model auxiliary variables and show promising performance, ranging from domain generalization (Lv et al., 2022) in computer vision and intrinsic interpretability (Wu et al., 2022) in graph neural networks to factual knowledge (Li et al., 2022) and text classification (Qian et al., 2021) in NLP. In this work, we introduce SCM to PLM debiasing to discover the inherent causal relations between data and labels while achieving better debiasing performance. To our knowledge, this is the first work exploiting causality for debiasing PLMs. + +# 3 Methodology + +Our goal is to unify debiasing with downstream fine-tuning so that the fine-tuned language model can maintain solid performance with alleviated stereotypical associations. In other words, we want to prevent biases re-entering the language model during the fine-tuning. Unlike prior work that considers PLM debiasing as a standalone procedure, we mitigate language model biases during fine-tuning process. To this end, we propose Causal-Debias, a debiasing framework from a causal view. We first provide the basic formalism and proceed with the details of Causal-Debias. + +Problem Definition: We denote a supervised NLP + +task with dataset $(X,Y)$ , we fine tune a pretrained language model to learn a mapping: $\mathcal{M}(X) \mapsto Y$ . Our goal is to mitigate unwanted stereotypical associations in the fine-tuned model $\mathcal{M}$ . + +# 3.1 Biases from a Causal View + +![](images/b7ac5e2a6be92d73fa4ea2d97b9db176098c992199bd9f2dac484593d9140f87.jpg) +Figure 2: SCM of Causal-Debias. Each raw sentence of $X$ is generated by a mix of causal factor $C$ and non-causal factor $N$ . Note that only the causal factor affects the ground truth label $Y$ , while the hammer indicates the intervention on non-causal factor. + +We use a Structure Causal Model (SCM) to characterize biases in the fine-tuning procedure. As shown in Fig. 2, there are four variables: input raw sentence $X$ , downstream ground-truth label $Y$ , causal factor $C$ and non-causal factor $N$ . Among those, causal and non-causal factor $C$ and $N$ are latent variables. Whether a factor is causal or non-causal depends on the specific downstream tasks. For example, in sentiment classification task, causal factors could be adjective sentiment words such as good or bad, and non-causal factors could be nouns or pronouns. In contrast, in coreference resolution task, pronouns could be causal factors while adjective words could be non-causal. Here we explain the diagram in detail: + +- $C \to X \gets N$ . The input raw sentence $X$ is a mix of two factors that are theoretically non-intersecting: causal factor $C$ and non-causal factor $N$ . +- $C \to Y$ . From a causal view, the ground-truth label $Y$ is only determined by causal factor $C$ . +- $C \leftrightarrow N$ . The dashed arrow delegates additional probabilistic dependencies (Pearl et al., 2016, 2000) between causal factor $C$ and non-causal factor $N - cf$ . Appendix A for examples. + +However, $N \leftrightarrow C \rightarrow Y$ can create a spurious association between non-causal factor $N$ and ground-truth label $Y$ (denoted as $Y \ncong N$ ), so that $C$ becomes a confounder between $N$ and $Y$ which opens a backdoor path $N \leftrightarrow C \rightarrow Y$ . Hence, the unwanted stereotypical associations, which we assume are non-causal factors, may re-enter the fine-tuned PLM because of the unwanted associations between label $Y$ and non-causal factors $N$ . + +To mitigate the bias propagation and avoid such spurious association that $N$ affects $Y$ through $C$ , we make the feature induction assumption spurred by the Independent Causal Mechanisms (ICM) principle (Peters et al., 2017; Scholkopf et al., 2012), i.e., the intervention on non-causal factor $N$ should be independent of the ground truth $Y$ . According to causal inference (Pearl et al., 2016, 2000), there is a directed link from each of its parent variables $P(X)$ to $X$ , if and only if the causal mechanism $X = f_{X}(P(X))$ exists for each variable $X$ . That is, there exists a function from causal factor $C$ to label $Y$ without $N$ 's influence, making the causal association $C \rightarrow Y$ invariant across different $N$ . More formal assumptions in terms of $N \leftrightarrow C$ are presented in Appendix A. In other words, ICM principle can assure the language model to not pick up the non-causal factors, i.e., unwanted associations, in the fine-tuning procedure. + +Generally, only $X$ and $Y$ are observed during the fine-tuning, while neither the causal factor $C$ nor the mapping from $C$ to $Y$ is available. We factorize the language model as a combination of two modules inspired by (Wu et al., 2022), i.e., $\mathcal{M} = m_{Y} \circ m_{C}$ , where $m_{C}: X \to C$ discovers the causal factor from the observed $X$ , and $m_{Y}: C \to Y$ outputs the prediction $Y$ . Empirical risk minimization (ERM) is often used as the optimization strategy to train $m_{C}$ and $m_{Y}$ (Seo et al., 2022; Zhou et al., 2022): + +$$ +\min _ {m _ {C}, m _ {Y}} \mathcal {R} (m _ {Y} \circ m _ {C} (X), Y), \tag {1} +$$ + +where $\mathcal{R}(\cdot, \cdot)$ can be any loss function (e.g., cross-entropy loss). However, ERM heavily relies on the statistical dependency between the input sentences and labels, ignoring the critical condition $Y \perp N \mid C$ to guarantee the invariant causal association $C \rightarrow Y$ across different $N$ , leading to the resurgence of undesired spurious associations. + +Recent causal learning literature has proposed to use invariant risk minimization (IRM) objective to replace ERM (Arjovsky et al., 2019; Chang et al., 2020). The causal invariant learning encourages causal factor $C$ to seek the patterns that are stable across different "enviornments", while abandoning the unstable non-causal patterns. We follow this line of literature, and propose to use causal invariant learning objective to mitigate fine-tuning biases: + +$$ +\min _ {m _ {C}, m _ {Y}} \mathcal {R} (m _ {Y} \circ m _ {C} (X), Y), s. t. Y \perp N \mid C, \tag {2} +$$ + +where $N = X \setminus C$ is the non-causal factor. However, IRM often leverages multiple "enviornments" to facilitate causal learning. For example, Peyrard et al. (2021) use prior knowledge to partition the training set to form different environments. In NLP tasks such as sentiment classification, how to construct multiple "enviornments" in the context of language model fine-tuning is less studied. Next, we propose a causal intervention method to construct "enviornments" for causal learning. + +# 3.2 Causal-Debias + +Causal Intervention. The high-level idea for causal intervention is to create interventional distributions with respect to different demographic groups. Our interventional distribution is obtained by augmenting and expanding the original data distribution. First, let $\mathcal{W}_a$ and $\mathcal{W}_t$ denote attribute words and target words, respectively. In the case of gender bias, for instance, target words consist of gender-neutral words (e.g., nurse, engineer, professor), and attribute words are composed of the feminine (e.g., she, woman, mother) and masculine words (e.g. he, man, father) (Liang et al., 2020). Then we can obtain an augmented datasets $X_d$ : + +$$ +X _ {d} = X _ {o} \cup X _ {c}, \tag {3} +$$ + +where $X_{o}$ denotes the original sentences from the downstream dataset containing any $\mathcal{W}_a$ or $\mathcal{W}_t$ , and $X_{c}$ represents the counterfactual sentences via performing attribute word counterfactual augmentation on $X_{o}$ . For counterfactual augmentation, we create counterfactual sentences by replacing the attribute word to its corresponding pair (e.g., he>she). However, the augmented dataset $X_{d}$ still has limitations as it is not sufficient to cover the diversity of demographic groups, which may cause debiasing performance degradation problems (cf. Section 4.3 for empirical study). To create sufficiently complex interventional distributions and obtain the most different demographic groups, we conduct the interventions by doing semantic matching between $X_{d}$ with external corpora $E$ , expanding $X_{o}$ and $X_{c}$ to $X_{\tilde{o}}$ and $X_{\tilde{c}}$ (see Table 1 for an example), respectively, as + +$$ +X _ {\tilde {d}} = X _ {\tilde {o}} \cup X _ {\tilde {c}} = \operatorname {T o p} _ {k} \left(\operatorname {s i m} \left(X _ {d}, E\right)\right) \cup X _ {d}, \tag {4} +$$ + +where $\mathrm{sim}(\cdot)$ denotes the cosine similarity for semantic matching, and $\mathrm{Top}_k(\cdot)$ selects the top- $k$ semantic similar sentences. After obtaining the + +![](images/38f7f4f81053478749f348a46ab30bed913e8835c3dcf14ca857e9fb4d40ef24.jpg) +Figure 3: Overview of Causal-Debias. Causal Intervention: selecting top $k$ semantic similar bias-related sentences from external corpora to cover the most different demographic groups. Causal Invariant Learning: fine-tuning the PLM with an invariant loss among different environments. + +intervened sentences, we reconstruct the interventional distribution by combining $X_{\tilde{d}}$ and the rest bias-unrelated downstream dataset, both of which are applied for causal invariant learning. Table 1 shows an example of original sentence, and its corresponding counterfactual and expansion sentences. + +
Sentence TypeSentence Example
Originalproves once again he hasn’t lost his touch
Counterfactualproves once again she hasn’t lost her touch
Expansionsachs is a guy with impressive intelligence and passion
+ +Table 1: An example sentence in SST-2 dataset, and the corresponding counterfactual and expansion. The label is positive for all three sentences. + +Causal Invariant Learning. Once we obtain the intervened dataset containing original and interventional data distributions, we proceed with causal invariant learning. Specifically, we do $n$ -intervention $\text{do}(N = n)$ , which removes all links from their parents $P(N)$ to the variable $N$ while fixing $N$ to the number of demographic $n$ (e.g. $n = 2$ in the case of gender), to identify $C$ whose relationship with $Y$ is stable across different distributions: + +$$ +\min \mathcal {L} _ {\text {i n v a r i a n t}} = \mathbb {E} _ {n} (\mathcal {R}) + \operatorname {V a r} _ {n} (\mathcal {R}), \tag {5} +$$ + +where $\mathcal{R} = \mathcal{R}(\mathcal{M}(X),Y\mid do(N = n))$ computes the risk under the $n$ -interventional distribution; $\mathbb{E}_n(\cdot)$ denotes the risks of different $n$ -interventional distributions; $\operatorname{Var}(\cdot)$ denotes the variance of risks over $n$ -interventional distributions. + +To calculate $\mathcal{L}_{\mathrm{invariant}}$ , the PLM is required to predict the same results on the sentences $X_{\tilde{o}}$ and $X_{\tilde{c}}$ , which have equivalent semantics but different attribute words according to the IRM theory (Arjovsky et al., 2019). Thus in optimization, we have the interventional risk derived from Equation (5): + +$$ +\mathcal {R} (\mathcal {M} (X _ {\tilde {d}}), Y \mid d o (N = \tilde {n})) = \mathbb {E} _ {C = m _ {C} (x), N = \tilde {n}} l (\tilde {y}, y), \tag {6} +$$ + +where $x \in X_{\tilde{d}}$ is a sentence instance with its prediction $\tilde{y}$ under the intervention $do(N = \tilde{n})$ , and $y \in Y$ is ground-truth label, and $l(\cdot)$ denotes interventional loss function on a single sentence. Here we choose Wasserstein distance (Ramdas et al., 2017) as a loss function due to its ability to measure the agreement between the prediction of original and post-intervention sentences. The Wasserstein distance between $\tilde{y}$ and $y$ is formalized as below: + +$$ +D _ {\text {W a s s e r}} (\tilde {y}, y) = \inf _ {\gamma (\tilde {y}, y) \in \prod} \mathcal {E} _ {(\tilde {y}, y) \sim \gamma} | | \tilde {y} - y | |, \tag {7} +$$ + +PLM Fine-tuning. The above procedure leverages augmented datasets for causal invariant learning, and we can incorporate the invariant loss with specific downstream tasks to fine-tune a language model. This way, we can balance the trade-off between debiasing performance and downstream task performance (Meade et al., 2022). The overall objective of Causal-Debias is: + +$$ +\min _ {\tau} \mathcal {L} _ {\text {p r e d i c t i o n}} + \tau \mathcal {L} _ {\text {i n v a r i a n t}}, \tag {8} +$$ + +where $\tau$ is the trade-off coefficient, and $\mathcal{L}_{\mathrm{prediction}}$ is the loss function of a specific downstream task, such as cross-entropy loss for classification and mean squared error loss for regression. + +# 4 Experiments + +# 4.1 Experimental Settings + +Debiasing Benchmarks. We compare Causal-Debias with the following benchmarks. Non-Task-Specific methods including: CDA, Dropout (Webster et al., 2020), Context-Debias (Kaneko and Bollegala, 2021), Auto-Debias (Guo et al., 2022), and MABEL (He et al., 2022), and two Task-Specific methods including Sent-Debias (Liang et al., 2020) and FairFil (Cheng et al., 2021). In the Non-Task-Specific benchmarks, the debiasing stage is independent of fine-tuning downstream tasks. + +Causal-Debias belongs to Task-Specific methods as downstream fine-tuning tasks are involved. + +Pretrained Language Models. We use three representative PLMs as the backbone: BERT (Devlin et al., 2019), ALBERT (Lan et al., 2020), and RoBERTa (Liu et al., 2019). Following (Guo et al., 2022), we implement them using the Huggingface Transformers library (Wolf et al., 2020). + +Bias Word Lists. Following previous studies, we use human-being-created stereotype/attribute word lists to investigate and mitigate biases in PLMs. They are based on the research of the social science literature and other disciplines, which can reflect cultural or offensive biases. In particular, we consider the gender and race word lists used in (Kaneko and Bollegala, 2021) and (Manzini et al., 2019), respectively - cf. Appendix B for details. + +External Corpora. For fair comparison, we exploit the same external corpora used in baselines, which are composed of 183,060 sentences from following sources: WikiText-2 (Merit et al., 2017), Standford Sentimento Treebank (Socher et al., 2013), Reddit, MELD (Poria et al., 2019) and POM (Park et al., 2014) - cf. Appendix C for details. + +Evaluating Metrics: We evaluate biases in PLM embeddings with SEAT (May et al., 2019) and CrowS-Pair (Nangia et al., 2020). An ideally unbiased model should exhibit no difference in relative similarity. Following Guo et al. (2022); Liang et al. (2020); Kaneko and Bollegala (2021), we apply SEAT 6, 6b, 7, 7b, 8, and 8b tests to measure the gender bias, and use SEAT 3, 3b, 4, 5, 5b tests for racial bias evaluation. We report the effect size in the SEAT evaluation – the closer to 0, the lower bias a model has. More details about SEAT tests are presented in Appendix D. We also use Crowdsourced Stereotype Pairs (CrowS-Pair) (Nangia et al., 2020) as another metric to evaluate gender bias. CrowS-Pair is a dataset containing 1,508 examples covering different types of biases, where each example is a stereotype/anti-stereotype sentence pair with minimal semantics. The CrowS-Pair score closer to $50\%$ is less stereotypical, indicating that the model assigns an equal probability to male and female sentences. + +Other Details. As the related studies (Cheng et al., 2021; Liang et al., 2020), we conduct experiments on three downstream tasks, including a sentiment classification task SST-2, a grammatical acceptability judgment task CoLA, and a question-answering task QNLI. We follow the same PLMs as bench + +marks: 1) BERT-base-uncased, ALBERT-large-v2, and RoBERTa-base in gender case; and 2) BERTbase-uncased and ALBERT-base-v2 in racial case. We trained Causal-Debias in 5 epochs with learning rate $2 \times e^{-5}$ . The reported results are the average of 5 runs for all downstream tasks. + +# 4.2 Results on Mitigating Gender Bias + +SEAT Tests and Downstream Tasks Evaluation. Table 2 summarizes the debiasing results of models before and after fine-tuning on three downstream tasks, as well as the accuracy (Acc.) evaluations on downstream applications, from which we have the following Observations. + +(O1): Causal-Debias is more effective in mitigating gender bias than previous benchmarks, as it achieves the lowest average SEAT scores in all three downstream tasks. For example, Causal-Debias surpasses Task-Specific SOTA (FairFil) by 0.07, 0.01, and 0.07, and Non-Task-Specific SOTA (Auto-Debias) by 0.27, 0.21, and 0.09 on BERT, respectively. The excellent debiasing results can attribute to the following two characteristics of Causal-Debias: 1) combining debiasing PLMs and fine-tuning to avoid new biases, and 2) the causal intervention-based invariant learning that alleviates the impact of non-causal factors. + +(O2): From the SEAT results after fine-tuning downstream tasks, the PLMs become more biased for almost all non-task-specific debiasing models. In particular, the latest debiasing methods AutoDebias is greatly limited to the bias resurgence issue in all three tasks, although it achieved good performance on debiasing PLMs. These results verified not only the existence of bias resurgence but also the motivation of this study to attenuate the intrinsic bias of PLMs and fine-tuning bias jointly. Interestingly, the original PLMs do not suffer from this problem, as the bias can be mitigated after fine-tuning the downstream tasks in most cases. This result suggests that fine-tuning itself is an effective way of debiasing PLMs; combining with debiased models, however, will introduce extra bias. To deal with this dilemma, debiasing models should consider downstream tasks as a unity. + +Two task-specific models, i.e., Sent-Debias and FairFil, cannot effectively alleviate the application bias even using downstream datasets for debiasing PLMs, because their focus is still intrinsic bias – by contrast, Causal-Debias unifies the two debiasing procedure and provides an systematic solution to + +
MethodsBeforeSST-2CoLAQNLI
AfterAcc.AfterMcc.AfterAcc.
BERT0.350.29 ↓0.0692.70.18 ↓0.1757.60.37 ↑0.0291.3
+CDA0.250.47 ↑0.2281.30.29 ↑0.0453.20.38 ↑0.1389.1
+DROPOUT0.420.48 ↑0.0681.90.27 ↓0.1552.20.44 ↑0.0290.1
+CONTEXT-DEBIAS0.530.43 ↓0.1091.90.57 ↑0.0455.40.56 ↑0.0389.9
+AUTO-DEBIAS0.140.38 ↑0.2492.10.32 ↑0.1852.90.24 ↑0.1091.1
+MABEL0.500.55 ↑0.0592.20.52 ↑0.0257.80.54 ↑0.0491.6
+SENT-DEBIAS0.260.21 ↓0.0589.10.22 ↓0.0455.40.32 ↑0.0690.6
+FAIRFIL0.150.18 ↑0.0391.60.12 ↓0.0356.50.22 ↑0.0790.8
+CAUSAL-DEBIAS (ours)-0.1192.90.1158.10.1591.6
ALBERT0.280.22 ↓0.0692.60.24 ↓0.0458.50.21 ↓0.0791.3
+CDA0.300.38 ↑0.1892.40.16 ↓0.1453.10.31 ↑0.0190.9
+DROPOUT0.240.28 ↑0.0490.40.25 ↑0.0147.40.20 ↓0.0491.7
+CONTEXT-DEBIAS0.330.11 ↓0.2277.30.17 ↓0.1655.40.20 ↓0.1391.6
+CAUSAL-DEBIAS (ours)-0.0692.90.1657.10.0991.6
RoBERTa0.670.41 ↓0.2694.80.41 ↓0.2657.60.48 ↓0.1992.8
+CONTEXT-DEBIAS1.090.26 ↓0.8380.30.30 ↓0.7955.40.37 ↓0.7291.8
+CAUSAL-DEBIAS (ours)-0.0993.90.1754.10.0692.9
+ +attenuates both biases simultaneously. + +(O3): Previous benchmarks may significantly degrade the performance on downstream tasks after debiasing the PLMs. This is a natural result of existing debiasing models as they need to change the representations to mitigate bias and therefore inevitably decrease accuracy after debiasing (Liang et al., 2020). In addition to its superior debiasing effect, Causal-Debias achieves better performance on downstream tasks, e.g., exceeding all benchmarks on BERT in terms of performance. This result demonstrates the ability of Causal-Debias to minimize the disagreements among different demographic groups with identical semantic information, which is attained by intervening in downstream datasets to mitigate the bias recurrence. + +Table 2: Gender debiasing results of average SEAT and application performance. ↓ and ↑ denote the improvement and reduction in debiasing performance in terms of SEAT, respectively. “-” means that our model does not have an independent PLM debiasing process. + +
MethodsOverall Score
Before (Dev.)After (Dev.)
BERT57.25 (7.25)53.18 (3.18)
+CDA56.11 (6.11)58.42 (8.42)
+DROPOUT55.34 (5.34)44.56 (5.44)
+ CONTEXT-DEBIAS58.01 (8.01)58.89 (8.89)
+AUTO-DEBIAS54.92 (4.92)44.96 (5.04)
+MABEL50.76 (0.76)46.75 (3.25)
+SENT-DEBIAS52.29 (2.29)55.04 (5.04)
+CAUSAL-DEBIAS (ours)-48.94 (1.06)
+ +Table 3: CrowS-Pairs scores on SST-2. 'Dev.' denotes the value deviates from 50. + +CrowS-Pairs. Table 3 reports CrowS-Pairs scores + +before and after fine-tuning on SST-2. Note that the deviation from 50 is usually used to measure the debiasing effect. Obviously, Causal-Debias achieves the lowest deviation among the fine-tuned debiasing models, which proves its best debiasing performance. In addition, the deviation values of previous methods increase after fine-tuning, which further confirms the existence of application bias ignored by existing methods. Again, BERT itself can alleviate the bias after fine-tuning, which is consistent with our observation O2 from Table 2. + +# 4.3 Ablation Study + +To quantify the effect of the devised causal intervention and invariant risk learning, we build three variants of Causal-Debias: + +(V1) w/o $E$ removes the intervention from external corpora in Eq. (4). +(V2) w/o $E\& \mathcal{L}_{\mathrm{invariant}}$ removes both interventions of external corpora in Eq. (4) and the invariant loss in Eq. (8) but maintains counterfactual augmentation of data in downstream tasks. +(V3) w/o $\mathcal{L}_{\mathrm{invariant}}$ only remains the prediction loss $\mathcal{L}_{\mathrm{prediction}}$ in Eq. (8). + +Fig. 4 compares the variants with full Causal-Debias on SST-2 task. The variant V1 performs worst on debiasing, indicating that external corpora contribute the most to model debiasing. However, external corpora also deteriorate the task perfor + +
MethodsBeforeSST-2CoLAQNLI
AfterAcc.AfterMcc.AfterAcc.
BERT0.230.30 ↑0.0792.70.16 ↓0.0757.60.15 ↓0.0891.3
+AUTO-DEBIAS0.180.31 ↑0.1392.10.20 ↑0.0259.60.24 ↑0.0691.1
+CAUSAL-DEBIAS (ours)-0.1192.90.0657.10.1191.6
ALBERT0.460.29 ↓0.0692.60.19 ↓0.2758.50.10 ↓0.3692.2
+AUTO-DEBIAS0.170.39 ↑0.2286.80.18 ↑0.0156.90.36 ↑0.0991.1
+CAUSAL-DEBIAS (ours)-0.1391.90.1659.60.0192.5
+ +Table 4: Race debiasing results of average SEAT and application performance, and the original scores are from Meade et al. (2022). + +![](images/201f91defeb73de9e8b613d5ed90422887f7a07141768869a4e8f4c6cd5d393b.jpg) +Figure 4: Ablation results. The lower SEAT score (red) and higher SST-2 accuracy (blue) are better. + +mance when comparing the accuracy of V2 and V3, because the augmented sentences introduce extra semantics and obfuscate the PLMs. The adverse impact can be minimized by learning the invariant representations by the proposed causal interventions on downstream tasks via $\mathcal{L}_{\mathrm{invariant}}$ , which can be justified by the great discrepancy between Causal-Debias and V3 in terms of SST-2 accuracy. + +# 4.4 Results on Mitigating Racial Bias + +Racial debiasing refers to examining the association difference between European-American/African American names/terms and the stereotype words (pleasant vs. unpleasant) (Caliskan et al., 2017). Unlike gender debiasing, few prior studies investigated the racial debiasing problem, due to the difficulty of mitigating racial bias (Meade et al., 2022). A critical challenge is the potential word ambiguity (e.g., white, black) in various contexts (Guo et al., 2022). Table 4 reports the performance of Causal-Debias and Auto-Debias – the state-of-the-art racial debiasing model. Causal-Debias substantially decreases the racial biases on PLMs after fine-tuning, while obtaining comparable downstream performance. Auto-Debias, in contrast, still suffers from bias recurrence issue. Compared to Auto-Debias, Causal-Debias is more effective as it exploits + +downstream datasets for debiasing, which allows us to alleviate the influence of ambiguous words. Besides, the causal invariant learning in Causal-Debias encourages the model to learn consistent representations and clear meanings of ambiguous words so as to avoid bias-related associations. + +# 5 Conclusion + +In this paper, we propose a debiasing framework Causal-Debias to unify PLM bias mitigation with fine-tuning. Different from prior literature that treats PLM bias mitigation as a standalone task, Causal-Debias incorporates bias mitigation objective with downstream fine-tuning using causal invariant learning. Causal-Debias essentially "kills two birds with one stone", because it prevents the unwanted stereotypical associations re-entering the fine-tuned model and also maintains favorable performance in downstream tasks. The experiment shows that fine-tuning existing debiased models will encode or even amplify unwanted bias associations (in gender and race). We also show that Causal-Debias can effectively reduce bias associations in fine-tuned language model without sacrificing downstream task performance. Our paper contributes to the NLP fairness fields by proposing a novel debiasing method from a causal invariant view. More importantly, we highlight the fact that biases can happen at any stage in PLM training pipeline, including the final fine-tuning steps. Even if unwanted stereotypical associations are removed, or covered up (Kirkpatrick et al., 2017), in the pretraining stage, the associations will re-surge in the downstream models. Hence, prior literature that focuses on pretrained model debiasing may be ineffective if used in a pretrain/fine-tune pipeline. We hope this study can shed light on mitigating biases for building fair and accountable NLP systems. + +# Acknowledgements + +This work was supported by the Natural Science Foundation of Sichuan Province, China, under Grant 2022NSFSC0505, and National Natural Science Foundation of China under Grants 62176043 and 62072077. + +# Limitations + +We now discuss limitations of Causal-Debias. In consideration of the fairness, we follow the prior bias mitigation work (Guo et al., 2022; Cheng et al., 2021; He et al., 2022) and use human-collected lists of gender and racial pairs for counterfactual data augmentation and intervened distribution generation. It is obvious that the bias word lists are inadequate to cover all the bias-related demographic groups, while we believe the general list is exhaustive. We consider there is a possible model improvement that leverages the perturbation augmentation on bias-related sentences along multiple demographic axes (Qian et al., 2022). Another possible improvement would be to generate bias words by using prompts to probe the biases that may lead to a bad effect. + +Moreover, we also considered the use of external corpora. The external corpora have been significantly investigated in prior works (Liang et al., 2020; Cheng et al., 2021) and are utilized as an intervention corpora. Recently, He et al. (2022) used two natural language inference data (SNLI and MNLI with gender terms) to produce general-purpose debiased representations. There are several other corpora including News-commentary-v1 (Kaneko and Bollegala, 2021), Wikipedia (Zmigrod et al., 2019; Webster et al., 2020), and Wikitext-2 (Guo et al., 2022). A possible future direction of debiasing is how to mitigate the biases without heavily relying on any corpora and just using internal knowledge. + +Moreover, in the paper we primarily focus on studying gender and racial bias mitigation. It is also worth exploring intersectional biases mitigation (Lalor et al., 2022) and domain-specific bias mitigation (Chuang and Yang, 2022; Abbasi et al., 2021). + +We would also like to note that although Causal-Debias shows a satisfactory performance on SEAT tests and Crows-Pairs, these results should not be interpreted as a complete bias mitigation. Interestingly, He et al. (2022) expressed the same opinion. The main metrics (like CrowS-Pairs) are mainly + +against North American social biases and only reflect positive predictive power. They detect the presence of the biases but not their absence (Meade et al., 2022). He et al. (2022) did not use the SEAT tests and evaluated their model on various metrics. From the perspective of different usage scenarios, we need a more general and reliable debias metric for comparison between different models. The lack of universality and agreement in existing evaluation frameworks is a fundamental challenge in this field. + +# Ethics Statement + +Regarding ethical concerns, we would like to note that our contributions are mainly about methodologies. The datasets and evaluation metrics in our work are also widely used in prior works. One ethical concern is the binarization of the genders and races, which is an over-simplification and is not proper to practical situations. Binarization is the common problem among most debiasing methods and we totally agree and support the development of more inclusive methodological tools, datasets, and evaluation methods. + +Under our framework, we consider gender or raceisolatedly and neglect the particular intersectional biases. It is apparent that the pretrained language model cannot be applied or operated in an ideal environment, and should be able to handle complex combinations of biases simultaneously. + +Another ethical consideration is that Causal-Debias is entirely based on a English system. Such an assumption may not be a problem now but sooner or later it will be. The debias studies have to be situated on the high-resource languages while considering not only high-resource language systems but how to debias on the low-resource languages. + +For instance, some languages such as Spanish, German, Chinese, or Japanese contain various words to describe masculine or feminine forms. The detection and removal of biases are greatly complicated by the need to consider both linguistic and social gender. + +For the reasons above, practitioners should be very cautious when applying our framework to real-world use cases. In its current state, Causal-Debias should be seen not as a panacea for addressing biases in NLP, but rather as another initial effort to illuminate and undercut a critical, elusive, multifaceted problem. + +# References + +Ahmed Abbasi, David Dobolyi, John P Lalor, Richard G Netemeyer, Kendall Smith, and Yi Yang. 2021. Constructing a psychometric testbed for fair natural language processing. In EMNLP, pages 3748-3758. +Martin Arjovsky, Léon Bottou, Ishaan Gulrajani, and David Lopez-Paz. 2019. Invariant risk minimization. arXiv:1907.02893. +Aylin Caliskan, Joanna J Bryson, and Arvind Narayanan. 2017. Semantics derived automatically from language corpora contain human-like biases. Science, 356(6334):183-186. +Shiyu Chang, Yang Zhang, Mo Yu, and Tommi Jaakkola. 2020. Invariant rationalization. In ICML, pages 1448-1458. PMLR. +Pengyu Cheng, Weituo Hao, Siyang Yuan, Shijing Si, and Lawrence Carin. 2021. Fairfil: Contrastive neural debiasing method for pretrained text encoders. In ICLR. +Chengyu Chuang and Yi Yang. 2022. Buy Tesla, sell ford: Assessing implicit stock market preference in pre-trained language models. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 100-105. +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. +Seraphina Goldfarb-Tarrant, Rebecca Marchant, Ricardo Muñoz Sánchez, Mugdha Pandya, and Adam Lopez. 2021. Intrinsic bias metrics do not correlate with application bias. In ACL, pages 1926-1940. +Hila Gonen and Yoav Goldberg. 2019. Lipstick on a pig: Debiasing methods cover up systematic gender biases in word embeddings but do not remove them. arXiv preprint arXiv:1903.03862. +Ian J Goodfellow, Mehdi Mirza, Da Xiao, Aaron Courville, and Yoshua Bengio. 2013. An empirical investigation of catastrophic forgetting in gradient-based neural networks. arXiv preprint arXiv:1312.6211. +Yue Guo, Yi Yang, and Ahmed Abbasi. 2022. Autodebias: Debiasing masked language models with automated biased prompts. In ACL, pages 1012-1023. +Jacqueline He, Mengzhou Xia, Christiane Fellbaum, and Danqi Chen. 2022. Mabel: Attenuating gender bias using textual entailment data. arXiv:2210.14975. +Masahiro Kaneko and Danushka Bollegala. 2021. Debiasing pre-trained contextualised embeddings. In EACL. + +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. +John P Lalor, Yi Yang, Kendall Smith, Nicole Forsgren, and Ahmed Abbasi. 2022. Benchmarking intersectional biases in nlp. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 3598-3609. +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. +Shaobo Li, Xiaoguang Li, Lifeng Shang, Zhenhua Dong, Cheng-Jie Sun, Bingquan Liu, Zhenzhou Ji, Xin Jiang, and Qun Liu. 2022. How pre-trained language models capture factual knowledge? a causal-inspired analysis. In *Findings of the Association for Computational Linguistics: ACL* 2022, pages 1720-1732. +Paul Pu Liang, Irene Mengze Li, Emily Zheng, Yao Chong Lim, Ruslan Salakhutdinov, and Louis-Philippe Morency. 2020. Towards debiasing sentence representations. In ACL, pages 5502-5515. +Paul Pu Liang, Yao Chong Lim, Yao-Hung Hubert Tsai, Ruslan Salakhutdinov, and Louis-Philippe Morency. 2019. Strong and simple baselines for multimodal utterance embeddings. In NAACL, pages 2599-2609. +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. +Fangrui Lv, Jian Liang, Shuang Li, Bin Zang, Chi Harold Liu, Ziteng Wang, and Di Liu. 2022. Causality inspired representation learning for domain generalization. In CVPR, pages 8046-8056. +Thomas Manzini, Lim Yao Chong, Alan W Black, and Yulia Tsvetkov. 2019. Black is to criminal as Caucasian is to police: Detecting and removing multiclass bias in word embeddings. In *NAACL*, pages 615-621. +Chandler May, Alex Wang, Shikha Bordia, Samuel Bowman, and Rachel Rudinger. 2019. On measuring social biases in sentence encoders. In *NAACL*, pages 622-628. +Nicholas Meade, Elinor Poole-Dayan, and Siva Reddy. 2022. An empirical survey of the effectiveness of debiasing techniques for pre-trained language models. In ACL, pages 1878-1898. +Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. 2017. Pointer sentinel mixture models. In ICLR. + +Krikamol Muandet, David Balduzzi, and Bernhard Scholkopf. 2013. Domain generalization via invariant feature representation. In ICML, pages 10-18. PMLR. +Nikita Nangia, Clara Vania, Rasika Bhalerao, and Samuel Bowman. 2020. Crows-pairs: A challenge dataset for measuring social biases in masked language models. In EMNLP, pages 1953-1967. +Sunghyun Park, Han Suk Shim, Moitreya Chatterjee, Kenji Sagee, and Louis-Philippe Morency. 2014. Computational analysis of persuasiveness in social multimedia: A novel dataset and multimodal prediction approach. In ICMI, pages 50-57. +Judea Pearl, Madelyn Glymour, and Nicholas P Jewell. 2016. Causal Inference in Statistics: A Primer. John Wiley & Sons. +Judea Pearl et al. 2000. Models, reasoning and inference. Cambridge, UK: Cambridge University Press, 19(2). +Jonas Peters, Peter Buhlmann, and Nicolai Meinshausen. 2016. Causal inference by using invariant prediction: identification and confidence intervals. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 78(5):947-1012. +Jonas Peters, Dominik Janzing, and Bernhard Scholkopf. 2017. Elements of causal inference: foundations and learning algorithms. The MIT Press. +Maxime Peyrard, Sarvjeet Singh Ghotra, Martin Josifoski, Vidhan Agarwal, Barun Patra, Dean Carignan, Emre Kiciman, and Robert West. 2021. Invariant language modeling. arXiv:2110.08413. +Soujanya Poria, Devamanyu Hazarika, Navonil Majumder, Gautam Naik, Erik Cambria, and Rada Mihalcea. 2019. Meld: A multimodal multi-party dataset for emotion recognition in conversations. In ACL, pages 527-536. +Chen Qian, Fuli Feng, Lijie Wen, Chunping Ma, and Pengjun Xie. 2021. Counterfactual inference for text classification debiasing. In ACL, pages 5434-5445. +Rebecca Qian, Candace Ross, Jude Fernandes, Eric Smith, Douwe Kiela, and Adina Williams. 2022. Perturbation augmentation for fairer nlp. arXiv preprint arXiv:2205.12586. +Aaditya Ramdas, Nicolas Garcia Trillos, and Marco Cuturi. 2017. On Wasserstein two-sample testing and related families of nonparametric tests. Entropy, 19(2):47. +Bernhard Scholkopf, Dominik Janzing, Jonas Peters, Eleni Sgouritsa, Kun Zhang, and Joris M Mooij. 2012. On causal and anticausal learning. In ICML. +Seonguk Seo, Joon-Young Lee, and Bohyung Han. 2022. Unsupervised learning of debiased representations with pseudo-attributes. In CVPR, pages 16742-16751. + +Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew Y Ng, and Christopher Potts. 2013. Recursive deep models for semantic compositionality over a sentiment treebank. In EMNLP, pages 1631-1642. +Laurens Van der Maaten and Geoffrey Hinton. 2008. Visualizing data using t-sne. Journal of machine learning research, 9(11). +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 EMNLP, pages 353-355. +Kellie Webster, Xuezhi Wang, Ian Tenney, Alex Beutel, Emily Pitler, Ellie Pavlick, Jilin Chen, Ed Chi, and Slav Petrov. 2020. Measuring and reducing gendered correlations in pre-trained models. arXiv:2010.06032. +Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumont, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Rémi Louf, Morgan Funtowicz, et al. 2020. Transformers: State-of-the-art natural language processing. In EMNLP, pages 38-45. +Ying-Xin Wu, Xiang Wang, An Zhang, Xiangnan He, and Tat-Seng Chua. 2022. Discovering invariant rationales for graph neural networks. arXiv:2201.12872. +Xiao Zhou, Yong Lin, Renjie Pi, Weizhong Zhang, Ren-zhe Xu, Peng Cui, and Tong Zhang. 2022. Model agnostic sample reweighting for out-of-distribution learning. In ICML, pages 27203-27221. PMLR. +Ran Zmigrod, Sabrina J Mielke, Hanna Wallach, and Ryan Cotterell. 2019. Counterfactual data augmentation for mitigating gender stereotypes in languages with rich morphology. In ACL, pages 1651-1661. + +# A Instantiated Causal Graphs + +We instantiate causal graphs as shown in Fig. 2. Specifically, we use the example sentences, whose labels are determined by how words compose the meaning of the sentences. We use $C = 0,1,2$ to denote three different sentiment-related phrases, and use $N = 0,1,2$ to denote three different non-causal factors for simplicity. + +- $C \perp N$ : The raw input sentences and bias-related parts are independently sampled and spliced. +- $C \to N$ : The type of each causal part respects a given (static) probability distribution. The value of $C$ , and the probability distribution of its causal part is given by: + +$$ +P (N) = \left\{ \begin{array}{l l} 0. 9 & \text {i f} X = C, \\ 0. 1 & \text {o t h e r w i s e .} \end{array} \right. \tag {9} +$$ + +- $N \to C$ : Similar to the example for $C \to N$ . +- $N \gets V \to C$ : There is a latent variable $V$ takes continuous value from 0 to 1, and the probability distribution of $N$ and $C$ s.t. + +$$ +N \sim \mathcal {B} (3, V), \quad C \sim \mathcal {B} (3, 1 - V), \tag {10} +$$ + +where $\mathcal{B}$ stands for binomial distribution, i.e., for the variable $C$ , if $C \sim \mathcal{B}(n,p)$ we have + +$$ +P (C = k \mid p, n) = \left( \begin{array}{c} n \\ k \end{array} \right) p ^ {k} (1 - p) ^ {n - k}. +$$ + +# B Bias Words List + +We used the gender attribute words and target words lists proposed in (Kaneko and Bollegala, 2021), which is widely used in debiasing studies (Guo et al., 2022; Liang et al., 2020). In addition, we used the race attribute words and attribute words provided in (Manzini et al., 2019). + +# C External Corpora + +Table 5 summarizes the five external datasets along with examples of the numerous templates occurring across various individuals, settings and in both written and spoken text. The external corpora $E$ used to expand the downstream dataset is created from (Liang et al., 2020), including: 1) WikiText-2 (Merit et al., 2017) - a dataset of formally written Wikipedia articles, where only the first $10\%$ of WikiText-2 is used and verified sufficiently to + +capture formally written text); 2) Stanford Sentiment Treebank (Socher et al., 2013) is a collection of 10000 polarized written movie reviews; 3) Reddit data collected from discussion forums relating to politics, electronics, and relationships; 4) MELD (Poria et al., 2019) – a large-scale multimodal multi-party emotional dialog dataset collected from the TV-series Friends; and 5) POM (Park et al., 2014) – a dataset of spoken review videos collected across 1,000 individuals spanning multiple topics. These datasets have also been used in recent research in language understanding (Mery et al., 2017; Liu et al., 2019) and multimodal human language (Liang et al., 2019). + +# D SEAT Details + +The WEAT metric measures the bias by comparing two sets of attribute words $W_{a}$ (i.e., $M$ and $F$ ) and two sets of target words $W_{t}$ (i.e., $A$ and $B$ ). In the case of gender, $M$ denotes masculine words like "he", and $F$ denotes feminine words like "she". Meanwhile, $A$ and $B$ are gender-neutral words (e.g., career or adjectives) whose embeddings should be equivalent between $M$ and $F$ . Formally, the bias degree of each word $w$ is defined as: + +$$ +s (w, A, B) = \frac {1}{| A |} \sum_ {a \in A} \cos (w, a) - \frac {1}{| B |} \sum_ {b \in B} \cos (w, b), \tag {11} +$$ + +where $\cos (\cdot ,\cdot)$ denotes the cosine similarity. Based on Equation (11), the WEAT effect size is: + +$$ +d _ {\mathrm {W E A T}} = \frac {\mu \left(\left\{s (m , A , B) \right\} _ {m \in M}\right) - \mu \left(\left\{s (f , A , B) \right\} _ {f \in F}\right)}{\sigma \left(\left\{s (t , A , B) \right\} _ {t \in A \cup B}\right)}, \tag {12} +$$ + +where $\mu$ and $\sigma$ denote the mean and standard deviation, respectively. The SEAT metric generalizes the WEAT via replacing the word embeddings with a few simple sentence templates (e.g., "This is the "). We can conclude from Equation (12) that the absolute SEAT effect size closer to 0 means lower biases. We list more details about the SEAT tests that are used in our experiments in Table 6, which are adapted from (Caliskan et al., 2017). + +
DatasetTypeTopicsFormalityLengthExamples
Wikitext-2writteneverythingformal24.0“Ireland has made a large contribution to world literature in all its branches, particularly in the English language. Poetry in Irish is among the oldest vernacular poetry in Europe/Africa, with the earliest examples dating from the 6th century.”
SSTwrittenmovie reviewsinformal19.2“his/her fans walked out muttering words like horrible and terrible, but had so much fun dissing the film that they didn’t mind the ticket cost.”
Redditwrittenpolitics, electronics, relationshipsinformal13.6“roommate cut my hair without my consent, ended up cutting himself/herself and is threatening to call the police on me”
MELDspokencomedy TV-seriesinformal8.1“that’s the kind of strength that I want in the man/woman I love!”
POMspokenopinion videosinformal16.0“and his/her family is, like, incredibly confused”
+ +Table 5: The five external corpora $E$ used to expand the downstream dataset (Liang et al., 2020). Length represents the average length measured by the number of words in a sentence. Words in italics indicate the words used to intervene by casual invariant learning, e.g., (man, woman), (Europe, Africa). This table summarizes our expanded dataset in terms of topics, formality, and spoken/written text. + +
Bias TypeTestDemographic-specific wordsStereotype words
RacialSEAT-3European-American/African American namesPleasant vs. Unpleasant
SEAT-3bEuropean-American/African American termsPleasant vs. Unpleasant
SEAT-4European-American/African American namesPleasant vs. Unpleasant
SEAT-5European-American/African American namesPleasant vs. Unpleasant
SEAT-5bEuropean-American/African American termsPleasant vs. Unpleasant
GenderSEAT-6Male vs. Female namesCareer vs. Family
SEAT-6bMale vs. Female termsCareer vs. Family
SEAT-7Male vs. Female termsMath vs. Arts
SEAT-7bMale vs. Female namesMath vs. Arts
SEAT-8Male vs. Female namesScience vs. Arts
SEAT-9bMale vs. Female termsScience vs. Arts
+ +Table 6: The SEAT test details extended from (Caliskan et al., 2017). + +A For every submission: + +A1. Did you describe the limitations of your work? 7 +A2. Did you discuss any potential risks of your work? 7,8 +A3. Do the abstract and introduction summarize the paper's main claims? +A4. Have you used AI writing assistants when working on this paper? Left blank. + +B Did you use or create scientific artifacts? + +4 + +B1. Did you cite the creators of artifacts you used? 4 +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? 4 +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? 4 +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? 4 +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. 4 + +C Did you run computational experiments? + +4 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? 4 + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +4 + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +4 + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +4 + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +No response. + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +No response. + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +No response. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +No response. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +No response. \ No newline at end of file diff --git a/causaldebiasunifyingdebiasinginpretrainedlanguagemodelsandfinetuningviacausalinvariantlearning/images.zip b/causaldebiasunifyingdebiasinginpretrainedlanguagemodelsandfinetuningviacausalinvariantlearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..4e862ed3fb3a02d52d1d0d95a71adfc132416958 --- /dev/null +++ b/causaldebiasunifyingdebiasinginpretrainedlanguagemodelsandfinetuningviacausalinvariantlearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9637218b1b611b5823198157a61636e0df8ce1663aa421b126ac39408f61b553 +size 533147 diff --git a/causaldebiasunifyingdebiasinginpretrainedlanguagemodelsandfinetuningviacausalinvariantlearning/layout.json b/causaldebiasunifyingdebiasinginpretrainedlanguagemodelsandfinetuningviacausalinvariantlearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..01fe2f5fa2bc880722b8a506c45deadd9eb149ae --- /dev/null +++ b/causaldebiasunifyingdebiasinginpretrainedlanguagemodelsandfinetuningviacausalinvariantlearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e70c3001753a9beff25091d82230979ce2949ca42a6a151fea00b53b0ae5de5f +size 531954 diff --git a/causalinterventionandcounterfactualreasoningformultimodalfakenewsdetection/c4c31bee-2f76-4194-974e-e049f36e86ab_content_list.json b/causalinterventionandcounterfactualreasoningformultimodalfakenewsdetection/c4c31bee-2f76-4194-974e-e049f36e86ab_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..1f919c24df949349e4dd7116b70ba35b2b97e7ce --- /dev/null +++ b/causalinterventionandcounterfactualreasoningformultimodalfakenewsdetection/c4c31bee-2f76-4194-974e-e049f36e86ab_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c58142a51cf9d1052fa9b3e78deb0ea540ca1141968cec69f0aed9b5e9b72e9f +size 88148 diff --git a/causalinterventionandcounterfactualreasoningformultimodalfakenewsdetection/c4c31bee-2f76-4194-974e-e049f36e86ab_model.json b/causalinterventionandcounterfactualreasoningformultimodalfakenewsdetection/c4c31bee-2f76-4194-974e-e049f36e86ab_model.json new file mode 100644 index 0000000000000000000000000000000000000000..0ee4ead9bcc6394fd9efe58013105e0955d8dd1f --- /dev/null +++ b/causalinterventionandcounterfactualreasoningformultimodalfakenewsdetection/c4c31bee-2f76-4194-974e-e049f36e86ab_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d1d79c4a2d2851b16a61dd79c04733fc095ed9fede4d11ea7fc857b25b1c57c0 +size 106852 diff --git a/causalinterventionandcounterfactualreasoningformultimodalfakenewsdetection/c4c31bee-2f76-4194-974e-e049f36e86ab_origin.pdf b/causalinterventionandcounterfactualreasoningformultimodalfakenewsdetection/c4c31bee-2f76-4194-974e-e049f36e86ab_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..0f8ce9ddfaeb1ca65f39986c5fb9f306718d8c05 --- /dev/null +++ b/causalinterventionandcounterfactualreasoningformultimodalfakenewsdetection/c4c31bee-2f76-4194-974e-e049f36e86ab_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1e34205dc30a8f3f3f153c0d577c4d0e6e2afdf9978911214d4cc20f6be4c752 +size 841937 diff --git a/causalinterventionandcounterfactualreasoningformultimodalfakenewsdetection/full.md b/causalinterventionandcounterfactualreasoningformultimodalfakenewsdetection/full.md new file mode 100644 index 0000000000000000000000000000000000000000..6485e23436b95b238f23ef9ff8165cfd0f2548bb --- /dev/null +++ b/causalinterventionandcounterfactualreasoningformultimodalfakenewsdetection/full.md @@ -0,0 +1,441 @@ +# Causal Intervention and Counterfactual Reasoning for Multi-modal Fake News Detection + +Ziwei Chen $^{1}$ Linmei Hu $^{2*}$ Weixin Li $^{3}$ Yingxia Shao $^{1}$ Liqiang Nie $^{4}$ + +1Beijing University of Posts and Telecommunications + +$^{2}$ Beijing Institute of Technology $^{3}$ Beihang University + +$^{4}$ Harbin Institute of Technology (Shenzhen) + +{chen_zw,shaoyx}@bupt.edu.cn hulinmei@bit.edu.cn + +weixinli@buaa.edu.cn nieliqiang@gmail.com + +# Abstract + +Due to the rapid upgrade of social platforms, most of today's fake news is published and spread in a multi-modal form. Most existing multi-modal fake news detection methods neglect the fact that some label-specific features learned from the training set cannot generalize well to the testing set, thus inevitably suffering from the harm caused by the latent data bias. In this paper, we analyze and identify the psycholinguistic bias in the text and the bias of inferring news label based on only image features. We mitigate these biases from a causality perspective and propose a Causal intervention and Counterfactual reasoning based Debiasing framework (CCD) for multi-modal fake news detection. To achieve our goal, we first utilize causal intervention to remove the psycholinguistic bias which introduces the spurious correlations between text features and news label. And then, we apply counterfactual reasoning by imagining a counterfactual world where each news has only image features for estimating the direct effect of the image. Therefore we can eliminate the image-only bias by deducting the direct effect of the image from the total effect on labels. Extensive experiments on two real-world benchmark datasets demonstrate the effectiveness of our framework for improving multi-modal fake news detection. + +# 1 Introduction + +Fake news quietly sneaks into people's daily life, mixed with massive information, causing serious impact and harm to society. Fake news often utilizes multimedia information such as text and images to mislead readers, spreading and expanding its influence. Thus, it is crucial and urgent to find a way to discern multi-modal fake news. + +Today, most existing methods train on known fake news instances expecting to capture the label-specific features for judging the authenticity of unseen news (Singhal et al., 2020; Wu et al., 2021; + +![](images/c0ab5277c60e1408fddc279e0c809831e296a1a9166c5d5e0df9547b0b229de3.jpg) +Figure 1: The word frequency distributions of psychological categories on different labels (Twitter dataset). + +Qian et al., 2021b; Qi et al., 2021). However, such label-specific features may expose the models to hidden data bias when confronted with unseen fake news samples (Wang et al., 2018; Cheng et al., 2021; Zhu et al., 2022). To address the problem, we investigate the biases underlying the multi-modal fake news detection data and identify the psycholinguistic bias in the text and the bias of inferring news label based on image features only (i.e. image-only bias). These biases could lead to spurious correlations between the news and labels, thus impairing the model performance on testing data. + +To explicitly explain the biases, we first formulate the process of fake news detection as a causal graph as shown in Figure 2(a). In addition to the impact of fused features $C$ on news label $Y$ that most multi-modal fake news detection methods focus on, other two edges are pointing to $Y$ , starting from text features $T$ , and image features $I$ , respectively. Generally speaking, the publishers of fake news would try their best to fabricate confusing text or use certain techniques to forge fake images. This makes the text and image can individually affect the news label. + +For the $T\to Y$ branch, we observe that the linguistic characteristics of the text have obvious emotional preferences, such as the usage of psycholin + +![](images/b87e1ea9b596b204fd1518cf2cff48f82ef34c5208182171809125a3553f1003.jpg) +(a) The proposed causal graph (Factual world). + +![](images/13da6bb360465eb44eb5462725661f6c3c068ff4421f71b93749efa72b2a22e4.jpg) +(b) Causal graph with confounder. + +![](images/5a9fe1632ad943c2a6928cdd3c6b2a77f08d34d0f6155bcf5e125db407dec58a.jpg) +(c) Counterfactual world. +Figure 2: The causal graphs for fake news detection. $T$ : text features, $I$ : image features, $C$ : multi-modal features (i.e., the fused features of image and text), $Y$ : news label, $U$ : confounder. *denotes the reference values. + +guistic words "crazy" and "amazing", which play a critical role in fake news detection. To deeply analyze the linguistic characteristics of the text, we present a mathematical analysis of the psycholinguistic word distribution of real news and fake news based on the LIWC 2015 dictionary (Pennebaker et al., 2015). Take the Twitter dataset as an example, as shown in Figure 1, we can observe that the word frequency distribution of fake news is quite different from that of real news, especially for words expressing anxiety, negative emotions, positive emotions, tentative, and netspeak. It seems that we can draw a conclusion that fake news prefers to use loaded language to stir up the reader's emotions and attract more attention. Consequently, the model could be prone to relying on such psycholinguistic features as a shortcut to judge news authenticity. However, we analyze the training set and testing set, and find that there exist significant differences in the frequency of these psycholinguistic words. The manifest differences between the training set and testing set have proven that this shortcut appears to be unreliable evidence. As shown in Figure 2(b) where $U$ denotes the confounder (i.e. the psycholinguistic features in the text), there exist a backdoor path $T \gets U \to Y$ which will introduce spurious correlations among the text features and news label. In order to remove the psycholinguistic bias, we apply causal intervention by adopting the backdoor adjustment (Glymour et al., 2016) with do-calculus $P(Y|do(T))$ to calculate the causal effect in the training stage, which is fundamentally different from the conventional likelihood $P(Y|T)$ . + +For the $I \to Y$ branch, we observe from the datasets that two different news pieces sharing the same image could have contrary labels. This shows that sometimes even if the image is real, the text could be fabricated, and the news could thus be + +fake. We can take advantage of images as an additional modality to provide more detection evidence, but it is unreliable to infer the authenticity of the news based on the image features alone. In this case, we argue that the image-only bias (i.e., the direct causal effect from image features alone to news label) should be eliminated. Towards this end, we use counterfactual reasoning by imagining a counterfactual world (Figure 2(c)) where both text features $T$ and fused features $C$ are not given (represented by reference values $t^*$ and $c^*$ ), except for image features $I$ . In this way, the bias can be estimated by computing the direct causal effect of $I$ on $Y$ and we can conduct the debiasing by subtracting it from the total effect on $Y$ . + +We instantiate our proposed debiasing framework on three strong baseline models that can handle both text and image features as inputs. Extensive experiments on two widely used real-world benchmark datasets show the effectiveness of our framework. Overall, our contributions can be summarized as follows: + +- We analyze each modality of fake news detection data and identify the underlying psycholinguistic bias in the text and the image-only bias. And we propose a novel Causal intervention and Counterfactual reasoning based Debiasing framework (CCD) for multi-modal fake news detection. +- In our debiasing framework CCD, we conduct causal interventions via backdoor adjustment to remove spurious correlations introduced by the psycholinguistic confounder. For addressing the image-only bias, we apply counterfactual reasoning to pursue the indirect causal effect as the inference prediction. +- Our causal framework CCD can be applied to any fake news detection model with image and text features as inputs. We implement the proposed framework on three strong baseline models, and conduct extensive experiments on two widely used benchmark datasets, validating the effectiveness of CCD. + +# 2 Preliminaries + +# 2.1 Causal Graph + +The causal graph (Glymour et al., 2016) is a probabilistic graphical model used to describe how variables interact with each other, expressed by a directed acyclic graph $\mathcal{G} = \{\mathcal{N},\mathcal{E}\}$ consisting of the + +sets of variables $\mathcal{N}$ and the causal correlations $\mathcal{E}$ between two nodes. As shown in Figure 3, $X\rightarrow Y$ denotes that $X$ is the cause of the effect $Y$ . $U$ is the confounder. + +![](images/d78a4bb0c0595a1f705b91ac43f87dfafb1444f8477f4393a9045bb516d18670.jpg) +Figure 3: An example of causal graph. + +# 2.2 Causal Intervention + +Causal intervention is used to seek the real causal effect of one variable on another when there exist confounders. In a causal graph, the intervening operation on a variable removes all edges pointing to it, such that its parent nodes no longer cause it. The backdoor adjustment (Glymour et al., 2016) with do-calculus offers a tool for calculating the intervened distribution under the condition of no extra confounders. For the example in Figure 3, the adjustment formula can be derived according to Bayes' theorem as follows, where $u$ denotes the value of confounder $U$ : + +$$ +P (Y | d o (X)) = \sum_ {u} P (Y | X, u) P (u). \quad (1) +$$ + +# 2.3 Counterfactual Reasoning and Causal Effect + +Counterfactual reasoning (Pearl, 2009) is a statistical inference method used to infer outcomes under hypothetical conditions that are different from the factual world. By conducting counterfactual reasoning, we can estimate the causal effect (Pearl, 2022) of a treatment variable on a response variable. For instance, Figure 4 shows an abstract setting for estimating and removing the direct influence of $X$ on $Y$ . Figure 4(a) is the factual world where the calculation of $Y$ is denoted as $Y_{x,Z_x} = Y(X = x,Z = Z(X = x))$ . + +![](images/662b7d3c1031c7d1e08fd70a3d7d4352b1e2b3bdd6c1c61b6aa8a3ef829479a8.jpg) +(a) + +![](images/0678b869bad7fcbb6db1d35bd0ea61ff222a4559fd65637ba75b1cbfc99de8af.jpg) +(b) + +![](images/f3c1380e45ce84448195d2dbcc4600541293ada4912152c0d7f56d5b5800ea19.jpg) +(c) +Figure 4: Example of causal graph where $X$ , $Y$ , and $Z$ denote cause, effect and mediator variable, respectively. *denotes the reference values. + +Based on Figure 4(a) and 4(b), we define the total effect (TE) of $X = x$ on $Y$ as: + +$$ +\mathrm {T E} = Y _ {x, Z _ {x}} - Y _ {x ^ {*}, Z _ {x ^ {*}}}, \tag {2} +$$ + +which can be seen as the comparisons between two potential outcomes of $X$ given two different treatments, i.e., $X = x$ and $X = x^{*}$ . The total effect (TE) can be decomposed into the sum of the natural direct effect (NDE) and the total indirect effect (TIE), namely, $\mathrm{TE} = \mathrm{NDE} + \mathrm{TIE}$ . NDE represents the natural direct effect of $X$ on $Y$ when the mediator variable $Z$ is blocked (Figure 4(c)): + +$$ +\mathrm {N D E} = Y _ {x, Z _ {x ^ {*}}} - Y _ {x ^ {*}, Z _ {x ^ {*}}}. \tag {3} +$$ + +$Y_{x,Z_{x^*}}$ is calculated under the counterfactual world where $X$ can be simultaneously set to different values $x$ and $x^{*}$ (Figure 4(c)). Thus, TIE (the total indirect effect of $X$ on $Y$ ) can be obtained: + +$$ +\mathrm {T I E} = \mathrm {T E} - \mathrm {N D E} = Y _ {x, Z _ {x}} - Y _ {x, Z _ {x ^ {*}}}. \tag {4} +$$ + +We use TIE as the debiased result for inference. + +# 3 Method + +In this section, we first formulate the fake news detection task as a causal graph to clearly depict the causal effect between factors. And then we present our CCD framework that removes the psycholinguistic bias by means of causal intervention, as well as deducts the direct causal effect of image features (i.e. the image-only bias) via counterfactual reasoning. + +# 3.1 Causal Graph of Fake News Detection + +As aforementioned, Figure 2(a) depicts the causal graph of the fake news detection process. Nodes $T$ , $I$ , and $C$ represent the text features, image features, and fused multi-modal features, respectively. According to the proposed causal graph, the final prediction $Y$ takes inputs from the three branches: the direct effect of the input $T$ and $I$ on $Y$ via $T \rightarrow Y$ and $I \rightarrow Y$ , as well as the indirect effect of the input $T$ and $I$ on $Y$ via the fused features $C$ , i.e. $T(I) \rightarrow C \rightarrow Y$ . Each branch of Figure 2(a) can be implemented via a base fake news detection model (Figure 5). Formally, the abstract format of the model should be: + +$$ +Y _ {t, i, c} = Y (T = t, I = i, C = c), \tag {5} +$$ + +where $c = f(T = t, I = i)$ , $f(\cdot)$ is the feature aggregation function in baseline fake news detection + +models. Then the total effect (TE) of the input on label $y$ can be written as: + +$$ +\mathrm {T E} = Y _ {t, i, c} - Y _ {t ^ {*}, i ^ {*}, c ^ {*}}, \tag {6} +$$ + +where $t^*$ and $i^*$ are respectively the reference values of $T$ and $I$ , and $c^* = f(T = t^*, I = i^*)$ . As introduced in Section 2.3, the reference status is defined as the status of blocking the signal from text and image, i.e., $t$ and $i$ are not given (void values). For implementation, we use tensors filled with the scalar value 0 to represent the reference values $t^*$ and $i^*$ . In this way, the inputs do not contain any semantic information. + +Following previous studies (Niu et al., 2021; Wang et al., 2021; Tian et al., 2022), we calculate the prediction $Y_{t,i,c}$ through a model ensemble with a fusion function. + +$$ +\begin{array}{l} Y _ {t, i, c} = Y (T = t, I = i, C = c) \\ = \mathcal {F} \left(Y _ {t}, Y _ {i}, Y _ {c}\right) \tag {7} \\ = Y _ {c} + \tanh (Y _ {t}) + \tanh (Y _ {i}), \\ \end{array} +$$ + +where $Y_{t}$ is the output of the text-only branch (i.e. $T\rightarrow Y$ ), $Y_{i}$ is the output of the image-only branch (i.e. $I\rightarrow Y$ ), and $Y_{c} = Y_{t,i}$ is the output of fused features branch (i.e. $C\rightarrow Y$ ) as shown in Figure 5. $\mathcal{F}(\cdot)$ is the fusion function to obtain the final prediction. We adopt a non-linear fusion strategy for its better representation capacity (Wang et al., 2021). Any differentiable arithmetic binary operations can be employed as the fusion function $\mathcal{F}(\cdot)$ and we examine several fusion alternatives in Table 4. + +# 3.2 Deconfounded Training with Causal Intervention + +As Figure 2(b) shows, there exist an unobserved confounder $U$ (i.e., the psycholinguistic of the text) in the $T \to Y$ branch, which causes spurious correlations between the text features and news label by learning the likelihood $P(Y|T)$ . In order to explicitly illustrate the impact of the confounder, we use Bayes' theorem: + +$$ +\begin{array}{l} P (Y \mid T) = \sum_ {u} P (Y \mid T, u) P (u \mid T) \tag {8} \\ \propto \sum_ {u} P (Y | T, u) P (T | u) P (u). \\ \end{array} +$$ + +Next, we conduct deconfounded training in $T \to Y$ branch which exploits the backdoor adjustments (Glymour et al., 2016) with do-calculus on $T$ to calculate the corresponding intervention distribution. Since the edge $U \to T$ has been cut off, we + +can have: + +$$ +\begin{array}{l} Y _ {t} = P (Y \mid d o (T)) \\ \begin{array}{l} = Y (Y | a \omega (Y)) \\ = \sum_ {u} P (Y | T, u) P (u). \end{array} \tag {9} \\ \end{array} +$$ + +To estimate $Y_{t}$ , given the text features $T$ 's representations $\mathbf{t}$ and the confounder $U$ 's representations $\mathbf{u}$ , Equation (9) is implemented as $\sum_{\mathbf{u}} P(y|\mathbf{t}, \mathbf{u}) P(\mathbf{u})$ , where $P(y|\mathbf{t}, \mathbf{u})$ is the prediction upon a news feature learning model $g(\cdot)$ : + +$$ +P (y | \mathbf {t}, \mathbf {u}) = \sigma (g (\mathbf {t}, \mathbf {u})), \tag {10} +$$ + +where $\sigma (\cdot)$ is the sigmoid function that forms the output of $g(\cdot)$ into $(0,1)$ . In summary, the implementation of Equation (9) is formally defined as: + +$$ +\begin{array}{l} P (Y | d o (T)) = \mathbb {E} _ {u} [ P (Y | T, u) ] \tag {11} \\ = \mathbb {E} _ {u} [ \sigma (g (\mathbf {t}, \mathbf {u})) ]. \\ \end{array} +$$ + +Note that $\mathbb{E}_u$ requires expensive sampling. Following recent works (Wang et al., 2020; Yang et al., 2021), we can apply Normalized Weighted Geometric Mean (NWGM) (Xu et al., 2015) to approximate the above expectation by moving the outer expectation into the sigmoid function as: + +$$ +P (Y | d o (T)) \stackrel {\text {N W G M}} {\approx} \sigma \left(\mathbb {E} _ {u} [ g (\mathbf {t}, \mathbf {u}) ]\right). \tag {12} +$$ + +We apply a linear model to approximate the conditional probability, i.e. the probability of $Y$ under the conditions $T$ and $U$ . Inspired by previous works (Chen et al., 2022a; Tian et al., 2022), we model $g(\mathbf{t},\mathbf{u}) = \mathbf{W}_t\mathbf{t} + \mathbf{W}_u\cdot h(\mathbf{u})$ , where $h(\mathbf{u})$ is the feature transformation of $\mathbf{u}$ , $\mathbf{W}_t$ and $\mathbf{W}_u$ are learnable weight parameters. In this case, $\mathbb{E}_u[g(\mathbf{t},\mathbf{u})] = \mathbf{W}_t\mathbf{t} + \mathbf{W}_u\cdot \mathbb{E}_u[h(\mathbf{u})]$ . + +To compute $\mathbb{E}_u[h(\mathbf{u})]$ , we implement $h(\mathbf{u})$ as the scaled Dot-Product attention (Vaswani et al., 2017). We resort to LIWC 2015 dictionary (Pennebaker et al., 2015) to approximate $U$ as a fixed confounder dictionary $\mathbf{D}_u = [\mathbf{u}_1,\mathbf{u}_2,\dots,\mathbf{u}_N] \in \mathbb{R}^{N\times d_u}$ , where $N$ is the number of word categories and $d_{u}$ is the hidden feature dimension. Then we have: + +$$ +\mathbb {E} _ {u} [ h (\mathbf {u}) ] = \sum_ {u} \left[ \operatorname {s o f t m a x} \left(\frac {\mathbf {Q} ^ {T} \mathbf {K}}{\sqrt {d _ {m}}}\right) \odot \mathbf {D} _ {u} \right] P (\mathbf {u}), \tag {13} +$$ + +where $\mathbf{Q} = \mathbf{W}_q\mathbf{t}$ , $\mathbf{K} = \mathbf{W}_k\mathbf{D}_u$ ( $\mathbf{W}_q$ and $\mathbf{W}_k$ are learnable weight parameters), $d_m$ denotes the scaling factor. $P(\mathbf{u})$ denotes the prior statistic probability and $\odot$ is the element-wise product. + +![](images/81e72496d2625bc1344795e8f4d45c4b4b2bcd77d8d289b9ac484a7faef03c65.jpg) +Figure 5: Illustration of the training and inference of our proposed CCD framework. + +![](images/b298172f5efb76e962f2ce265068276496019c54331c053d39345f391a43f9ef.jpg) + +# 3.3 Mitigating the Image-only Bias with Counterfactual Reasoning + +So far, the psycholinguistic bias has been successfully removed in the $T \to Y$ branch, but the fake news detection model based on the causal graph in Figure 2(a) still suffers from the image-only bias. This is because the prediction, i.e., $Y_{t,i,c}$ , is still affected by the direct effect of the image. Consequently, fake news with more convincing image features still achieves a high probability of being judged as real news. To mitigate the image-only bias, we propose counterfactual reasoning to estimate the direct causal effect of $I$ on $Y$ by blocking the impact of $T$ and $C$ . Figure 2(c) shows the causal graph of the counterfactual world for fake news detection which describes the scenario when $I$ is set to different values $i$ and $i^{*}$ . We also set $T$ to its reference value $t^{*}$ , therefore $C$ would attain the value $c^{*}$ when $T = t^{*}$ and $I = i^{*}$ . In this way, the inputs of $T$ and $C$ are blocked, and the model can only rely on the given image $i$ for detection. We can thus obtain the natural direct effect (NDE) of $I$ on $Y$ , namely the image-only bias: + +$$ +\mathrm {N D E} = Y _ {t ^ {*}, i, c ^ {*}} - Y _ {t ^ {*}, i ^ {*}, c ^ {*}}. \tag {14} +$$ + +Furthermore, the removal of the bias can be realized by subtracting NDE from the total effect TE: + +$$ +\mathrm {T I E} = \mathrm {T E} - \mathrm {N D E} = Y _ {t, i, c} - Y _ {t ^ {*}, i, c ^ {*}}. \tag {15} +$$ + +TIE is the debiased result we used for inference. + +# 3.4 Training and Inference + +We illustrate the training and inference of our proposed CCD framework in Figure 5. Following Wang et al. (2021); Niu et al. (2021); Tian et al. (2022), for the training stage, we compute the loss + +for each branch, including the base multi-modal fake news detection branch $(Loss_{FND})$ , the text-only detection branch $(Loss_T)$ , and the image-only detection branch $(Loss_I)$ . As such, we minimize a multi-task training objective to learn the model parameters, which is formulated as: + +$$ +L o s s = L o s s _ {F N D} + \alpha L o s s _ {T} + \beta L o s s _ {I}, \tag {16} +$$ + +where the loss $Loss_{FND}$ refers to the cross-entropy loss associated with the predictions of $\mathcal{F}(Y_t,Y_i,Y_c)$ from Equation (7). The text-only and image-only loss $Loss_T$ and $Loss_I$ are cross-entropy losses associated with the predictions of $Y_{t}$ and $Y_{i}$ . $\alpha$ and $\beta$ are the trade-off hyperparameters. + +In the inference stage, we use the de-biased effect for inference, which is implemented as: + +$$ +\begin{array}{l} \mathrm {T I E} = Y _ {t, i, c} - Y _ {t ^ {*}, i, c ^ {*}} (17) \\ = \mathcal {F} \left(Y _ {t}, Y _ {i}, Y _ {c}\right) - \mathcal {F} \left(Y _ {t ^ {*}}, Y _ {i}, Y _ {c ^ {*}}\right). (18) \\ \end{array} +$$ + +# 4 Experiments + +In this section, we apply our CCD framework on three strong baseline multi-modal fake news detection models on two real-world datasets to evaluate the effectiveness of our proposed CCD framework. + +# 4.1 Experimental Settings + +# 4.1.1 Datasets + +We conducted experiments on two datasets: + +Twitter: This dataset was released for Verifying Multimedia Use task at MediaEval1. It consists of tweets with textual, visual, and social context information. Since our framework belongs to content-based methods, we only leverage textual and visual information. + +
NewsTwitterPheme
# of Real News78981972
# of Fake News60263830
# of Images5143670
+ +Table 1: The statistics of two real-world datasets. + +Pheme: This dataset was generated as part of the Pheme project, which attempts to detect and verify rumors spread via social media. It is based on five breaking news stories, each of which comprises a series of statements categorized as rumor or non-rumor. We classified rumors as fake news and non-rumors as real news in our framework. + +Our data preprocessing and division of the training set and testing set for both datasets are the same as previous work (Qian et al., 2021b). Table 1 shows the statistics of the two datasets. + +# 4.1.2 Base Models + +The CCD framework can be applied to any multimodal fake news detection method with text and image as input. Here, we apply our framework to the following strong baselines: 1) SpotFake+ (Singhal et al., 2020): SpotFake+ concatenates the features extracted from different modalities and performs multiple feature transformations to facilitate multi-modal fusion. 2) MCAN (Wu et al., 2021): MCAN stacks multiple co-attention layers to learn dependencies across the modalities. They repeatedly fuse the two modalities to simulate people's reading process. 3) HMCAN (Qian et al., 2021b): HMCAN uses a hierarchical multi-modal contextual attention model that considers both the text's hierarchical semantics and multi-modal contextual data. + +# 4.1.3 Evaluation Metrics + +We use the Accuracy as the evaluation metric for binary classification tasks such as fake news detection. In consideration of the imbalance label distributions, in addition to the accuracy metric, we add Precision, Recall, and F1-score as complementary evaluation metrics following previous works (Wu et al., 2021; Qian et al., 2021b). + +# 4.1.4 Implementation Details + +All of the methods are trained for 200 epochs and the initial learning rate for the Adam optimizer is tuned in [1e-5, 1e-3]. For the confounder dictionary $\mathbf{D}_u\in \mathbb{R}^{N\times d_u}$ , N is 18 (Anger, Anxiety, Assent, Causation, Certainty, Differentiation, Dis + +crepancy, Feel, Hear, Insight, Negative emotion, Netspeak, Nonfluencies, Positive emotion, Sadness, See, Swear words, Tentative), and $d_{u}$ is set to 4. For the scaled Dot-Product attention, the scaling factor $d_{m}$ is set to 256. As for other necessary hyperparameters in the baseline methods, our settings are consistent with them. + +# 4.2 Experimental Results + +Table 2 displays the experimental results of our proposed framework CCD applied to the baseline methods on two benchmark datasets. The results of the baselines are the results of our reproductions on our data settings based on their public code2. From Table 2, we can obtain the following observations: + +Compared with each base fake news detection model (i.e. SpotFake+, MCAN, HMCAN), the accuracy of the models that apply the proposed CCD framework (i.e., w/ CCD) has been significantly improved by around $7.7\%$ , $3.3\%$ , and $5.2\%$ on the Twitter dataset, and improved by around $1.0\%$ , $0.6\%$ , and $1.3\%$ on the Pheme dataset. With the help of the proposed framework, all of the base models show significant improvements on most metrics, which demonstrates the effectiveness of the proposed framework. We believe that CCD benefits from the removal of psycholinguistic bias with causal intervention as well as the mitigation of the image-only bias via counterfactual reasoning. + +The performance improvements on the Twitter dataset are larger than that on the Pheme dataset. We attribute such a difference between the two datasets to the following two reasons: 1) The proportion of psycholinguistic vocabulary in the Twitter dataset (19.87%) is higher than that in the Pheme dataset (16.19%), so the Twitter dataset could be more susceptible to psycholinguistic bias. 2) According to Table 1, the number of unique images in the Twitter dataset is far less than the number of news texts, which means that there's a serious problem of different texts sharing the same image. So the influence of image-only bias in the Twitter dataset is more severe than that of the Pheme dataset. + +# 4.3 Ablation Study of Causal Inference + +We conduct experiments to study the de-biasing effect of each module in CCD using the strong baseline HMCAN on Twitter and Pheme testing + +
DatasetMethodsAccuracyFake newsReal news
PrecisionRecallF1PrecisionRecallF1
TwitterSpotFake+0.7950.6220.6070.6140.8560.8640.860
w/ CCD0.856*0.7500.8490.797*0.9200.8600.889*
MCAN0.7990.9800.4010.5690.7700.9960.869
w/ CCD0.825*0.8290.5950.692*0.8240.9390.878*
HMCAN0.8310.9550.5140.6680.8040.9880.887
w/ CCD0.874*0.8200.7920.806*0.8990.9140.906*
PhemeSpotFake+0.8150.7110.5250.6040.8400.9210.879
w/ CCD0.823*0.7140.5740.636*0.8540.9150.883*
MCAN0.8340.7160.6390.6750.8720.9060.889
w/ CCD0.839*0.6930.7210.707*0.8960.8820.889
HMCAN0.8480.7620.7050.7320.8810.9080.894
w/ CCD0.859*0.7640.6890.7240.8890.9210.905*
+ +Table 2: Results of comparison among different models on Twitter and Pheme datasets. The best results are in bold. The marker * indicates that the improvement is statistically significant compared with the baseline (t-test with p-value $< 0.05$ ). + +
DatasetMethodAccuracy
TwitterHMCAN w/CCD0.874
w/o CI0.842
w/o CR0.855
PhemeHMCAN w/ CCD0.859
w/o CI0.852
w/o CR0.850
+ +set. As shown in Table 3, we test the performance of CCD removing the causal intervention part (w/o CI), and CCD removing the counterfactual reasoning part (w/o CR). The variant model (w/o CI) does not consider the psycholinguistic confounder and uses the original text features for detection. While the variant model (w/o CR) uses $Y_{t,i,c}$ for inference without subtracting the direct effect of the image. We can observe that if we remove the causal intervention part, the performance respectively drops by around $3.7\%$ and $0.8\%$ on Twitter and Pheme, demonstrating the effectiveness of eliminating the psycholinguistic bias in the text. And removing the counterfactual reasoning part will make the performance respectively decreases by around $2.2\%$ and $1.0\%$ on Twitter and Pheme, proving that CCD can effectively mitigate the image-only bias in the inference stage. + +# 4.4 Impact of Different Fusion Strategies + +Following prior studies (Wang et al., 2021), we devise several differentiable arithmetic binary op + +Table 3: Impact of Causal Inference + +
StrategyAccuracyF1_FakeF1_Real
MUL-sigmoid0.6950.5690.765
MUL-tanh0.7330.4720.821
SUM-sigmoid0.8060.6000.872
SUM-tanh0.8590.7240.905
+ +Table 4: Impact of Different Fusion Strategies. + +erations for the fusion strategy in Equation (7): + +$$ +\left\{ \begin{array}{l} \text {M U L - s i g m o i d}: Y _ {t, i, c} = Y _ {c} * \sigma (Y _ {t}) * \sigma (Y _ {i}), \\ \text {M U L - t a n h}: Y _ {t, i, c} = Y _ {c} * \tanh (Y _ {t}) * \tanh (Y _ {i}), \\ \text {S U M - s i g m o i d}: Y _ {t, i, c} = Y _ {c} + \sigma (Y _ {t}) + \sigma (Y _ {i}), \\ \text {S U M - t a n h}: Y _ {t, i, c} = Y _ {c} + \tanh (Y _ {t}) + \tanh (Y _ {i}). \end{array} \right. \tag {19} +$$ + +The performance of different fusion strategies are reported in Table 4. From the table, we can find that SUM-tanh achieves the best performance over the other fusion strategies. This shows that a fusion function with the proper boundary is suitable for CCD. Multiple fusion strategies are worth studying when CCD is applied to other scenarios in the future. + +# 4.5 Impact of the Value of $\alpha$ and $\beta$ + +We tune the trade-off hyperparameters $\alpha$ and $\beta$ in the training objective by grid search in $\{0, 0.1, 0.25, 0.5, 0.75, 1, 2, 3, 4, 5\}$ . And we find out that when $\alpha = 3$ and $\beta = 0.1$ , we can obtain satisfactory results in terms of accuracy on both datasets. To evaluate the impact of each parameter on the detection performance, we further study the accuracy under different values of $\alpha$ and $\beta$ individually by fixing the other hyperparameter on + +![](images/db4b8cb3dfdf38e8ac5d98d6b6b8817907cdd0feac56a059cb6defadcf38514c.jpg) +Figure 6: Impact of the Value of $\alpha$ and $\beta$ + +the Pheme dataset. As shown in Figure 6, when $\beta = 0.1$ and $\alpha$ grows from 0 to 3, the accuracy keeps raising, indicating the importance of leveraging the text features that have removed psycholinguistic bias. When $\alpha = 3$ and $\beta$ grow from 0 to 0.1, the accuracy increases, indicating the importance of capturing image-only bias. However, when $\alpha > 3$ or $\beta > 0.1$ , the performance decreases. It is because the training loss of the detection model using multimodal features will be less important, which brings worse results. + +# 4.6 Case Study + +We provide a qualitative analysis of the proposed CCD framework by examining the fake and real news samples that are successfully detected by HM-CAN w/ CCD on Pheme datasets in Figure 7. The psycholinguistic words are highlighted in red and the prediction results before (Before) and after (Debiased) counterfactual reasoning are shown in the charts. As we can see, the texts of both fake and real news contain words expressing anger and negative emotions (i.e., "killed", "assault", "murdered" and "attack"), but CCD can make correct predictions based on the text features (Text) after causal intervention. In addition, after conducting counterfactual reasoning by subtracting the direct causal effect of the image (Image), the CCD is able to make correct predictions based on the debiased results. The two cases show the effectiveness of our CCD framework, which makes debiased predictions by removing the psycholinguistic bias in the text and image-only bias. + +# 5 Related Work + +In this section, we review the related work including fake news detection and causal inference. + +![](images/70df48b6a770735b08828747332abd432f5d900f04810e3a724fde96b06720a7.jpg) +(a) Fake news. + +![](images/ec981026f67f84fa4af49e8f79951cffb3c08c9dd1976518c9ebda90e59a42a9.jpg) + +![](images/1ada03f4e843787c6ef5c8802ab93f53d847318ba8d4e514bc6a75112772b98c.jpg) + +![](images/5f213f00ec3455bd5b37d5eeebd96ee31f2614062a4e98d24ad92bedc9cc7ab8.jpg) +(b) Real news. +Figure 7: Two news cases from the Pheme dataset. + +# 5.1 Multi-modal Fake News Detection + +Existing fake news detection work generally falls into two categories: content-based methods and propagation-based methods. The multi-modal approaches fall into the former category. + +Most works on multi-modal fake news detection exert efforts to fully incorporate cross-modal features. For instance, Jin et al. (2017) proposed a recurrent neural network with an attention mechanism to fuse the text, social context, and image features. Singhal et al. (2020) utilized pre-trained encoders and applied multiple-layer feature transformation to achieve deep fusion. Chen et al. (2022b) calculated the ambiguity score of different modalities to control the contribution of mono-modal features and inter-modal correlations to the final prediction. To capture fine-grained cross-modal correlations, Wu et al. (2021) employed multiple rounds of co-attention mechanism to model the cross-modal interactions. Qian et al. (2021b) lever + +aged a contextual attention network to model both the intra- and inter-modality information, and captured the hierarchical semantic information of the text. There are also methods leveraging external knowledge to provide powerful evidence or enrich features' representations (Hu et al., 2021; Qi et al., 2021). For example, Hu et al. (2021) compared each news with the external knowledge base through entities to utilize consistencies for detection. + +In this work, we improve fake news detection from the perspective of causality and propose a novel framework that eliminates the hidden biases in each modality. + +# 5.2 Causal Inference + +Causal inference (Glymour et al., 2016) including causal intervention and counterfactual reasoning has been widely used in various fields such as recommendation (Zhang et al., 2021b; Wang et al., 2021), natural language inference (Tian et al., 2022), text classification (Qian et al., 2021a), named entity recognition (Zhang et al., 2021a), pretrained language models (Li et al., 2022), etc. It provides a powerful tool that can scientifically identify the causal correlations between variables and remove the hidden bias in the data. As for fake news detection, Zhu et al. (2022) eliminated the entity bias (the distribution of entities in the text) by counterfactual reasoning. + +In this work, we discover the psycholinguistic bias and image-only bias in fake news detection, and propose a novel debiasing framework that eliminates these biases using causal intervention and counterfactual reasoning to enhance detection performance. + +# 6 Conclusion + +In this work, we propose a novel causal intervention and counterfactual reasoning based debiasing framework CCD that eliminates the hidden biases in multi-modal fake news detection. We analyze and identify the psycholinguistic bias in the text as well as the image-only bias. Then, we formulate the process of fake news detection as a causal graph, addressing the biases from the causality perspective. Specifically, we address the psycholinguistic bias by causal intervention with backdoor adjustment, and mitigate the image-only bias using counterfactual reasoning that subtracts the direct image-only causal effect from the total causal ef + +fect. Experiments on two real-world benchmark datasets verify that CCD can effectively eliminate biases and improve multi-modal fake news detection. + +# Limitations + +When applying causal intervention to remove psycholinguistic bias, we utilize the LIWC dictionary to construct the confounder dictionary $\mathbf{D}_u$ . We argue that the debiasing performance could be affected by the quality of the constructed confounder dictionary. In the future, we could try to improve the confounder dictionary with external knowledge. + +# Acknowledgements + +This work was supported by the National Science Foundation of China (NSFC No. U21B2009, No. 62276029), Beijing Academy of Artificial Intelligence (BAAI) and CCF-Zhipu.AI Large Model Fund (No. 202217). + +# References + +Yingjie Chen, Diqi Chen, Tao Wang, Yizhou Wang, and Yun Liang. 2022a. Causal intervention for subject-deconfounded facial action unit recognition. In Proceedings of the 36th AAAI Conference on Artificial Intelligence, pages 374-382. +Yixuan Chen, Dongsheng Li, Peng Zhang, Jie Sui, Qin Lv, Lu Tun, and Li Shang. 2022b. Cross-modal ambiguity learning for multimodal fake news detection. In Proceedings of the ACM Web Conference, pages 2897-2905. +Lu Cheng, Ruocheng Guo, Kai Shu, and Huan Liu. 2021. Causal understanding of fake news dissemination on social media. In Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, pages 148-157. +Madelyn Glymour, Judea Pearl, and Nicholas P Jewell. 2016. Causal inference in statistics: A primer. John Wiley & Sons. +Linmei Hu, Tianchi Yang, Luhao Zhang, Wanjun Zhong, Duyu Tang, Chuan Shi, Nan Duan, and Ming Zhou. 2021. Compare to the knowledge: Graph neural fake news detection with external knowledge. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing, pages 754-763. +Zhiwei Jin, Juan Cao, Han Guo, Yongdong Zhang, and Jiebo Luo. 2017. Multimodal fusion with recurrent neural networks for rumor detection on microblogs. In Proceedings of the 25th ACM International Conference on Multimedia, pages 795-816. + +Shaobo Li, Xiaoguang Li, Lifeng Shang, Zhenhua Dong, Cheng-Jie Sun, Bingquan Liu, Zhenzhou Ji, Xin Jiang, and Qun Liu. 2022. How pre-trained language models capture factual knowledge? a causal-inspired analysis. In *Findings of the Association for Computational Linguistics*, pages 1720-1732. +Yulei Niu, Kaihua Tang, Hanwang Zhang, Zhiwu Lu, Xian-Sheng Hua, and Ji-Rong Wen. 2021. Counterfactual vqa: A cause-effect look at language bias. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 12700-12710. +Judea Pearl. 2009. Causal inference in statistics: An overview. Statistics surveys, 3:96-146. +Judea Pearl. 2022. Direct and indirect effects. In Probabilistic and Causal Inference: The Works of Judea Pearl, pages 373-392. +James W Pennebaker, Ryan L Boyd, Kayla Jordan, and Kate Blackburn. 2015. The development and psychometric properties of LIWC2015. University of Texas at Austin. +Peng Qi, Juan Cao, Xirong Li, Huan Liu, Qiang Sheng, Xiaoyue Mi, Qin He, Yongbiao Lv, Chenyang Guo, and Yingchao Yu. 2021. Improving fake news detection by using an entity-enhanced framework to fuse diverse multimodal clues. In Proceedings of the 29th ACM International Conference on Multimedia, pages 1212-1220. +Chen Qian, Fuli Feng, Lijie Wen, Chunping Ma, and Pengjun Xie. 2021a. Counterfactual inference for text classification debiasing. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing, pages 5434-5445. +Shengsheng Qian, Jinguang Wang, Jun Hu, Quan Fang, and Changsheng Xu. 2021b. Hierarchical multimodal contextual attention network for fake news detection. In Proceedings of the 44th International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 153-162. +Shivangi Singhal, Anubha Kabra, Mohit Sharma, Rajiv Ratn Shah, Tanmoy Chakraborty, and Ponnurangam Kumaraguru. 2020. Spotfake+: A multimodal framework for fake news detection via transfer learning. In Proceedings of the 34th AAAI Conference on Artificial Intelligence, pages 13915-13916. +Bing Tian, Yixin Cao, Yong Zhang, and Chunxiao Xing. 2022. Debiasing nlu models via causal intervention and counterfactual reasoning. In Proceedings of the 36th AAAI Conference on Artificial Intelligence, pages 11376-11384. +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. + +Tan Wang, Jianqiang Huang, Hanwang Zhang, and Qianru Sun. 2020. Visual commonsense r-cnn. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10757-10767. +Wenjie Wang, Fuli Feng, Xiangnan He, Hanwang Zhang, and Tat-Seng Chua. 2021. Clicks can be cheating: Counterfactual recommendation for mitigating clickbait issue. In Proceedings of the 44th International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 1288-1297. +Yaqing Wang, Fenglong Ma, Zhiwei Jin, Ye Yuan, Guangxu Xun, Kishlay Jha, Lu Su, and Jing Gao. 2018. EANN: event adversarial neural networks for multi-modal fake news detection. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 849-857. +Yang Wu, Pengwei Zhan, Yunjian Zhang, Liming Wang, and Zhen Xu. 2021. Multimodal fusion with coattention networks for fake news detection. In Findings of the Association for Computational Linguistics, pages 2560-2569. +Kelvin Xu, Jimmy Ba, Ryan Kiros, Kyunghyun Cho, Aaron Courville, Ruslan Salakhudinov, Rich Zemel, and Yoshua Bengio. 2015. Show, attend and tell: Neural image caption generation with visual attention. In Proceedings of the 32nd International Conference on Machine Learning, pages 2048-2057. +Xun Yang, Fuli Feng, Wei Ji, Meng Wang, and Tat-Seng Chua. 2021. Deconfounded video moment retrieval with causal intervention. In Proceedings of the 44th International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 1-10. +Wenkai Zhang, Hongyu Lin, Xianpei Han, and Le Sun. 2021a. De-biasing distantly supervised named entity recognition via causal intervention. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing, pages 4803-4813. +Yang Zhang, Fuli Feng, Xiangnan He, Tianxin Wei, Chonggang Song, Guohui Ling, and Yongdong Zhang. 2021b. Causal intervention for leveraging popularity bias in recommendation. In Proceedings of the 44th International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 11-20. +Yongchun Zhu, Qiang Sheng, Juan Cao, Shuokai Li, Danding Wang, and Fuzhen Zhuang. 2022. Generalizing to the future: Mitigating entity bias in fake news detection. In Proceedings of the 45th International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 2120-2125. + +A For every submission: + +A1. Did you describe the limitations of your work? Section Limitation +A2. Did you discuss any potential risks of your work? Section Limitation +A3. Do the abstract and introduction summarize the paper's main claims? Abstract and Introduction +A4. Have you used AI writing assistants when working on this paper? Left blank. + +B Did you use or create scientific artifacts? + +Section 3.2; Section 4.1 + +B1. Did you cite the creators of artifacts you used? Section 3.2; Section 4.1 +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? Section 3.2; Section 4.1 +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? Section1; Section 3.2; Section 4.1 +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? The scientific articles used are provided with relevant documentation discussing this part. +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? Section1; Section 3.2; Section 4.1 +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. Section 4.1 + +C Did you run computational experiments? + +Section 4 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? Not applicable. Left blank. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +Section 4.1.4 + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +Section 4 + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +Section 4.1 + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +No response. + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +No response. + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +No response. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +No response. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +No response. \ No newline at end of file diff --git a/causalinterventionandcounterfactualreasoningformultimodalfakenewsdetection/images.zip b/causalinterventionandcounterfactualreasoningformultimodalfakenewsdetection/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..70d7e5e733667df8a986111103b8fcc018734165 --- /dev/null +++ b/causalinterventionandcounterfactualreasoningformultimodalfakenewsdetection/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b4d4616d85b1c0b8d5c827e1dc373f70ceaf5943acb01d0a988a356961f6da0e +size 481562 diff --git a/causalinterventionandcounterfactualreasoningformultimodalfakenewsdetection/layout.json b/causalinterventionandcounterfactualreasoningformultimodalfakenewsdetection/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..eddb29d829c2d65c24fef7c79cdf0ab2fbce3a15 --- /dev/null +++ b/causalinterventionandcounterfactualreasoningformultimodalfakenewsdetection/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad4841fdf6a68ceae1ad53b19a90925b23461d32d9bc26f1b551ee84f5aebb10 +size 540794 diff --git a/causalityawareconceptextractionbasedonknowledgeguidedprompting/6c32440f-28ac-4ce5-8652-123b0d1e7064_content_list.json b/causalityawareconceptextractionbasedonknowledgeguidedprompting/6c32440f-28ac-4ce5-8652-123b0d1e7064_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..d090dfe21571b65648c75d3c783d43f0c0fa4c11 --- /dev/null +++ b/causalityawareconceptextractionbasedonknowledgeguidedprompting/6c32440f-28ac-4ce5-8652-123b0d1e7064_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f821d88dc617a3d0b40d9c350348994d0a0736e0b481becfef7f69673966626f +size 116693 diff --git a/causalityawareconceptextractionbasedonknowledgeguidedprompting/6c32440f-28ac-4ce5-8652-123b0d1e7064_model.json b/causalityawareconceptextractionbasedonknowledgeguidedprompting/6c32440f-28ac-4ce5-8652-123b0d1e7064_model.json new file mode 100644 index 0000000000000000000000000000000000000000..e5350cad3a7abce96dc6f9a917b27cd3b3b704b1 --- /dev/null +++ b/causalityawareconceptextractionbasedonknowledgeguidedprompting/6c32440f-28ac-4ce5-8652-123b0d1e7064_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:24d0362cc87f59e4b51a4749dcf6d2005ea07d4f72e99a66e22c033dcfb308da +size 145818 diff --git a/causalityawareconceptextractionbasedonknowledgeguidedprompting/6c32440f-28ac-4ce5-8652-123b0d1e7064_origin.pdf b/causalityawareconceptextractionbasedonknowledgeguidedprompting/6c32440f-28ac-4ce5-8652-123b0d1e7064_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..4b3db02a748fc46c1e35ce1fb410af55849461c5 --- /dev/null +++ b/causalityawareconceptextractionbasedonknowledgeguidedprompting/6c32440f-28ac-4ce5-8652-123b0d1e7064_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3eb8a7e82924b900175997a3ce87c2c96b6b7ab005616f338d95694bc4add271 +size 918147 diff --git a/causalityawareconceptextractionbasedonknowledgeguidedprompting/full.md b/causalityawareconceptextractionbasedonknowledgeguidedprompting/full.md new file mode 100644 index 0000000000000000000000000000000000000000..c7b75826abbbe935f426a380ae9b2d3ba783da97 --- /dev/null +++ b/causalityawareconceptextractionbasedonknowledgeguidedprompting/full.md @@ -0,0 +1,514 @@ +# Causality-aware Concept Extraction based on Knowledge-guided Prompting + +Siyu Yuan $^{\text{心}}$ , Deqing Yang $^{\text{心} *}$ + +Jinxi Liu $^{\text{心}}$ , Shuyu Tian $^{\text{心}}$ , Jiaqing Liang $^{\text{心}}$ , Yanghua Xiao $^{\text{★}\text{♣}\text{★}}$ , Rui Xie $^{\text{◇}}$ + +$^{\text{心}}$ School of Data Science, Fudan University, Shanghai, China + +$\spadesuit$ Shanghai Key Laboratory of Data Science, School of Computer Science, Fudan University + +*Fudan-Aishu Cognitive Intelligence Joint Research Center, Meituan, Beijing, China + +{syyuan21, jxliu22, sytian21}@m.fudan.edu.cn, + +{yangdeqing, liangjiaqing, shawyh}@fudan.edu.cn, rui.xie@meituan.com + +# Abstract + +Concepts benefit natural language understanding but are far from complete in existing knowledge graphs (KGs). Recently, pre-trained language models (PLMs) have been widely used in text-based concept extraction (CE). However, PLMs tend to mine the co-occurrence associations from massive corpus as pre-trained knowledge rather than the real causal effect between tokens. As a result, the pre-trained knowledge confounds PLMs to extract biased concepts based on spurious co-occurrence correlations, inevitably resulting in low precision. In this paper, through the lens of a Structural Causal Model (SCM), we propose equipping the PLM-based extractor with a knowledge-guided prompt as an intervention to alleviate concept bias. The prompt adopts the topic of the given entity from the existing knowledge in KGs to mitigate the spurious co-occurrence correlations between entities and biased concepts. Our extensive experiments on representative multilingual KG datasets justify that our proposed prompt can effectively alleviate concept bias and improve the performance of PLM-based CE models. The code has been released on https://github.com/siyuyuan/KPCE. + +# 1 Introduction + +The concepts in knowledge graphs (KGs) enable machines to understand natural languages better, and thus benefit many downstream tasks, such as question answering (Han et al., 2020), commonsense reasoning (Zhong et al., 2021) and entity typing (Yuan et al., 2022). However, the concepts, especially the fine-grained ones, in existing KGs still need to be completed. For example, in the widely used Chinese KG CN-DBpedia (Xu et al., 2017), there are nearly 17 million entities but only 0.27 million concepts in total, and more than $20\%$ entities even have no concepts. Although Probase (Wu + +![](images/e23561602421404858c7341cb241b26bf4dd09989b2b986956b790f8f5d81908.jpg) +Abstract of Louisa May Alcott +Figure 1: The example of concept bias. The PLM-based CE models are biased to extract novel mistakenly as the concept of Louisa May Alcott from the text. + +et al., 2012) is a large-scale English KG, the fine-grained concepts with two or more modifiers in it only account for $30\%$ (Li et al., 2021). We focus on extracting multi-grained concepts from texts to complete existing KGs. + +Most of the existing text-based concept acquisition approaches adopt the extraction scheme, which can be divided into two categories: 1) pattern-matching approaches (Auer et al., 2007; Wu et al., 2012; Xu et al., 2017), which can obtain high-quality concepts but only have low recall due to poor generalization; 2) learning-based approaches (Luo et al., 2020; Ji et al., 2020; Yuan et al., 2021a), which employ pre-trained language models (PLMs) fine-tuned with labeled data to extract concepts. + +However, an ignorable drawback of these learning-based approaches based on PLMs is concept bias. Concept bias means the concepts are extracted based on their contextual (co-occurrence) associations rather than the real causal effect between the entities and concepts, resulting in low extraction precision. For example, in Figure 1, PLMs tend to extract novel and writer together as concepts for the entity Louisa May Alcott even if we explicitly input the entity Louisa May Alcott to the model. Previous work demonstrates that causal inference is a promising technique for bias analy + +sis (Lu et al., 2022). To analyze the reasons behind concept bias, we devise a Structural Causal Model (SCM) (Pearl, 2009) to investigate the causal effect in the PLM-based concept extraction (CE) system, and show that pre-trained knowledge in PLMs confounds PLMs to extract biased concepts. During the pre-training, the entities and biased concepts (e.g., Louisa May Alcott and novel) often co-occur in many texts. Thus, PLMs tend to mine statistical associations from a massive corpus rather than the real causal effect between them (Li et al., 2022), which induces spurious co-occurrence correlations between entities (i.e., Louisa May Alcott) and biased concepts (i.e., novel). Since we cannot directly observe the prior distribution of pre-trained knowledge, the backdoor adjustment is intractable for our problem (Pearl, 2009). Alternatively, the front-door adjustment (Peters et al., 2017) can apply a mediator as an intervention to mitigate bias. + +In this paper, we adopt language prompting (Gao et al., 2021; Li and Liang, 2021) as a mediator for the frontdoor adjustment to handle concept bias. We propose a novel Concept Extraction framework with Knowledge-guided Prompt, namely KPCE to extract concepts for given entities from text. Specifically, we construct a knowledge-guided prompt by obtaining the topic of the given entity (e.g., person for Louisa May Alcott) from the knowledge in the existing KGs. Our proposed knowledge-guided prompt is independent of pre-trained knowledge and fulfills the frontdoor criterion. Thus, it can be used as a mediator to guide PLMs to focus on the right cause and alleviate spurious correlations. Although adopting our knowledge-guided prompt to construct the mediator is straightforward, it has been proven effective in addressing concept bias and improving the extraction performance of PLM-based extractors in the CE task. + +In summary, our contributions include: 1) To the best of our knowledge, we are the first to identify the concept bias problem in the PLM-based CE system. 2) We define a Structural Causal Model to analyze the concept bias from a causal perspective and propose adopting a knowledge-guided prompt as a mediator to alleviate the bias via frontdoor adjustment. 3) Experimental results demonstrate the effectiveness of the proposed knowledge-guided prompt, which significantly mitigates the bias and achieves a new state-of-the-art for CE task. + +# 2 Related Work + +Concept Acquisition Most of the existing text-based concept acquisition approaches adopt the extraction scheme, which can be divided into two categories: 1) Pattern-matching Approaches: extract concepts from free texts with hand-crafted patterns (Auer et al., 2007; Wu et al., 2012; Xu et al., 2017). Although they can obtain high-quality concepts, they have low recall due to their poor generalization ability; 2) Learning-based Approaches: mostly employ the PLM-based extraction models from other extraction tasks, such as the Named Entity Recognition (NER) models (Li et al., 2020; Luo et al., 2021; Lange et al., 2022) and Information Extraction models (Fang et al., 2021; Yuan et al., 2021a) in the CE task. Although they can extract many concepts from a large corpus, the concept bias cannot be well handled. + +Causality for Language Processing Several recent work studies causal inference combined with language models for natural language processing (NLP) (Schölkopf, 2022), such as controllable text generation (Hu and Li, 2021; Goyal et al., 2022) and counterfactual reasoning (Chen et al., 2022; Paranjape et al., 2022). In addition, causal inference can recognize spurious correlations via Structural Causal Model (SCM) (Pearl, 2009) for bias analysis and eliminate biases using causal intervention techniques (Weber et al., 2020; Lu et al., 2022). Therefore, there are also studies showing that causal inference is a promising technique to identify undesirable biases in the NLP dataset (Feder et al., 2022) pre-trained language models (PLMs) (Li et al., 2022). In this paper, we adopt causal inference to identify, understand, and alleviate concept bias in concept extraction. + +Language Prompting Language prompting can distill knowledge from PLMs to improve the model performance in the downstream task. Language prompt construction methods can be divided into two categories (Liu et al., 2021a): 1) Hand-crafted Prompts, which are created manually based on human insights into the tasks (Brown et al., 2020; Schick and Schütze, 2021; Schick and Schutze, 2021). Although they obtain high-quality results, how to construct optimal prompts for a certain downstream task is an intractable challenge; 2) Automated Constructed Prompts, which are generated automatically from natural language phrases (Jiang et al., 2020; Yuan et al., 2021b) or vector space (Li + +![](images/6cee7f8a7fa3fc09b3dde599346f26e07f69379678baa1558581ac2a379ae89b.jpg) +Figure 2: Concept bias map for the entities of popular concepts in CN-DBpedia (better viewed in color). + +and Liang, 2021; Liu et al., 2021b). Although previous work analyzes the prompt from a causal perspective (Cao et al., 2022), relatively little attention has been paid to adopting the prompt to alleviate the bias in the downstream task. + +# 3 Concept Bias Analysis + +In this section, we first formally define our task. Then we investigate the concept bias issued by PLMs in empirical studies. Finally, we devise a Structural Causal Model (SCM) to analyze the bias and alleviate it via causal inference. + +# 3.1 Preliminary + +Task Definition Our CE task addressed in this paper can be formulated as follows. Given an entity $E = \{e_1, e_2, \dots, e_{|E|}\}$ and its relevant text $T = \{t_1, t_2, \dots, t_{|T|}\}$ where $e_i$ (or $t_i$ ) is a word token, our framework aims to extract one or multiple spans from $T$ as the concept(s) of $E$ . + +Data Selection It must guarantee that the given text contains concepts. The abstract text of an entity expresses the concepts of the entity explicitly, which can be obtained from online encyclopedias or knowledge bases. In this paper, we take the abstract text of an entity as its relevant text $T$ . The details of dataset construction will be introduced in § 5.1. Since we aim to extract concepts from $T$ for $E$ , it is reasonable to concatenate $E$ and $T$ to form the input text $X = \{E, T\}$ . + +# 3.2 Empirical Studies on Concept Bias + +To demonstrate the presence of concept bias, we conduct empirical studies on the CN-DBpedia dataset (Xu et al., 2017). First, we randomly sample 1 million entities with their concepts from CN-DBpedia, and select the top 100 concepts with the + +![](images/1e0bbb21f8f2b99bab20217a01311c30a78ce74b1104422ce4884b2a9bab4bc2.jpg) +Figure 3: The proposed structural causal model (SCM). A hollow circle indicates the variable is latent, and a shaded circle indicates the variable is observed. Without causal intervention, the PLM-based CE model extract Novel due to the spurious correlation between the entities of Writer and Novel caused by the confounding variable $K$ . The constructed mediating variable $P$ can block the backdoor paths for $X \rightarrow S$ (opened by $K$ ) and help the model only extract the unbiased concept Writer. + +most entities as the typical concept set. Then we randomly select 100 entities with their abstracts for each typical concept to construct the input texts and run a BERT-based extractor to extract concepts. Details of the extraction process will be introduced in § 4.2. We invite volunteers to assess whether the extracted concepts are biased. To quantify the degree of concept bias, we calculate the bias rate of concept A to another concept B. The bias rate is defined as the number of entities of A for which B or the sub-concepts of B are mistakenly extracted by the extractor, divided by the total number of entities of A. + +The bias rates among 26 typical concepts are shown in Figure 2, where the concepts (dots) of the same topic are clustered in one rectangle. The construction of concept topics will be introduced in § 4.1. From the figure, we can conclude that concept bias is widespread in the PLM-based CE system and negatively affects the quality of the results. Previous studies have proven that causal inference can analyze bias via SCM and eliminate bias with causal intervention techniques (Cao et al., 2022). Next, we will analyze concept bias from a causal perspective. + +# 3.3 The Causal Framework for Concept Bias Analysis + +The Structural Causal Model We devise a Structural Causal Model (SCM) to identify the causal effect between the input text $X$ of a given entity $E$ and the concept span $S$ that can be ex + +tracted from $X$ . As shown in Figure 3, our CE task aims to extract one or multiple spans $S$ from $X$ as the concept(s) of $E$ where the causal effect can be denoted as $X \rightarrow S$ . + +During the pre-training, the contextual embedding of one token depends on the ones that frequently appear nearby in the corpus. We extrapolate that the high co-occurrence between the entities of true concepts (e.g., writer) and biased concepts (e.g., novel) in the pre-trained knowledge induces spurious correlations between entities (e.g., Louisa May Alcott) and biased concepts (e.g., novel). Therefore, the PLM-based CE models can mistakenly extract biased concepts even if the entity is explicitly mentioned in $X$ . The experiments in § 5.4 also prove our rationale. Based on the foregoing analysis, we define the pre-trained knowledge $K$ from PLM-based extraction models as a confounder. + +We cannot directly observe the latent space of the PLMs, and thus the backdoor adjustment (Pearl, 2009) is not applicable in our case. Alternatively, we adopt the frontdoor adjustment (Peters et al., 2017) and design a mediator to mitigate the concept bias. + +Causal Intervention To mitigate the concept bias, we construct a prompt $P$ as a mediator for $X \rightarrow S$ , and then the frontdoor adjustment can apply do-operation. + +Specifically, to make the PLMs attend to the right cause and alleviate spurious co-occurrence correlation (e.g., novel and Louisa May Alcott), we assign a topic as a knowledge-guided prompt $P$ (i.e., person) to the input text $X$ (The detailed operation is elaborated in § 4.1). The topics obtained from KGs are independent of pre-trained knowledge, and thus $P$ fulfills the frontdoor criterion. + +For the causal effect $X \to P$ , we can observe that $X \to P \to S \gets K$ is a collider that blocks the association between $P$ and $K$ , and no backdoor path is available for $X \to P$ . Therefore, we can directly rely on the conditional probability after applying the do-operator for $X$ : + +$$ +P (P = p \mid d o (X = x)) = P (P = p \mid X = x). \tag {1} +$$ + +Next, for the causal effect $P \to S$ , $P \gets X \gets K \to S$ is a backdoor path from $P$ to $S$ , which we need to cut off. Since $K$ is an unobserved variable, + +we can block the backdoor path through $X$ : + +$$ +P (S | d o (P)) = \sum_ {x} P (S | P, X = x) P (X = x). \tag {2} +$$ + +Therefore, the underlying causal mechanism of our CE task is a combination of Eq.1 and Eq.2, which can be formulated as: + +$$ +\begin{array}{l} P (S | d o (X)) \\ = \sum_ {p} P (S | p, d o (X)) P (p | d o (X)) \\ = \sum_ {p} P (S | d o (P), d o (X)) P (p | d o (X)) \\ = \sum_ {p} P (S | d o (P)) P (p | d o (X)). \tag {3} \\ \end{array} +$$ + +The theoretical details of the frontdoor adjustment are introduced in Appendix A. + +We make the assumption of strong ignorance, i.e., there is only one confounder $K$ between $X$ and $S$ . One assumption of the frontdoor criterion is that the only way the input text $X$ influences $S$ is through the mediator $P$ . Thus, $X \rightarrow P \rightarrow S$ must be the only path. Otherwise, the front-door adjustment cannot stand. Notice that $K$ already represents all the knowledge from pre-trained data in PLMs. Therefore, it is reasonable to use the strong ignorance assumption that it already includes all possible confounders. + +Through the frontdoor adjustment, we can block the backdoor path from input text to concepts and alleviate spurious correlation caused by the confounder, i.e., pre-trained knowledge. In practice, we can train a topic classifier to estimate Eq.1 ( $\S 4.1$ ) and train a concept extractor on our training data to estimate Eq.2 ( $\S 4.2$ ). Next, we will introduce the implementation of the frontdoor adjustment in detail. + +# 4 Methodology + +In this section, we present our CE framework KPCE and discuss how to perform prompting to alleviate concept bias. The overall framework of KPCE is illustrated in Figure 4, which consists of two major modules: 1) Prompt Constructor: assigns the topic obtained from KGs for entities as a knowledge-guided prompt to estimate Eq.1; 2) Concept Extractor: trains a BERT-based extractor with the constructed prompt to estimate Eq.2 and extract multi-grained concepts from the input text. Next, we will introduce the two modules of KPCE. + +![](images/129a57235cffe5763f24f0406bab548e51bff6edacd995b41149ef818b28ef7d.jpg) +Figure 4: The overview of our CE framework. + +# 4.1 Prompt Constructor + +Knowledge-guided Prompt Construction To reduce the concept bias, we use the topic of a given entity as a knowledge-guided prompt, which is identified based on the external knowledge of the existing KGs. Take CN-DBpedia (Xu et al., 2017) as an example1. We randomly sample one million entities from this KG and obtain their existing concepts. Then, we select the top 100 concepts having the most entities to constitute the typical concept set, which can cover more than $99.80\%$ entities in the KG. Next, we use spectral clustering (Von Luxburg, 2007) with the adaptive K-means (Bhatia et al., 2004) algorithm to cluster these typical concepts into several groups, each of which corresponds to a topic. To achieve the spectral clustering, we use the following overlap coefficient (Vijaymeena and Kavitha, 2016) to measure the similarity between two concepts, + +$$ +\operatorname {O v e r l a p} \left(c _ {1}, c _ {2}\right) = \frac {\left| \operatorname {e n t} \left(c _ {1}\right) \cap \operatorname {e n t} \left(c _ {2}\right) \right|}{\min \left(\left| \operatorname {e n t} \left(c _ {1}\right) \right| , \left| \operatorname {e n t} \left(c _ {2}\right) \right|\right) + \delta} \tag {4} +$$ + +where $ent(c_{1})$ and $ent(c_{2})$ are the entity sets of concept $c_{1}$ and concept $c_{2}$ , respectively. We then construct a similarity matrix of typical concepts to achieve spectral clustering. To determine the best number of clusters, we calculate the Silhouette Coefficient (SC) (Aranganayagi and Thangavel, 2007) and the Calinski Harabaz Index (CHI) (Maulik and Bandyopadhyay, 2002) from 3 to 30 clusters. The scores are shown in Figure 5, from which we find that the best number of clusters is 17. As a result, we cluster the typical concepts into 17 groups and define a topic name for each group. The 17 typical topics and their corresponding concepts are listed in Appendix B.1 + +![](images/3888e98fbfc4c10869b2ed091e2336e98c5107ee1e6cd0a4cf35346c8d4140cb.jpg) +Figure 5: The scores of Silhouette Coefficient (SC) and Calinski Harabaz Index (CHI) under different cluster numbers. The scores are normalized with feature scaling for a fair comparison. + +Identifying Topic Prompt for Each Entity We adopt a topic classifier to assign the topic prompt to the input text $X$ , which is one of the 17 typical topics in Table 6. To construct the training data, we randomly fetch 40,000 entities together with their abstract texts and existing concepts in the KG. According to the concept clustering results, we can assign each topic to the entities. We adopt transformer encoder (Vaswani et al., 2017) followed by a two-layer perception (MLP) (Gardner and Dorling, 1998) activated by ReLU, as our topic classifier2. We train the topic classifier to predict the topic prompt $P = \{p_1, p_2, \dots, p_{|P|}\}$ for $X$ , which is calculated as3: + +$$ +P = \underset {i} {\arg \max } \left(P \left(P ^ {i} | X\right)\right), 1 \leq i \leq 1 7, \tag {5} +$$ + +where $P^i$ is the i-th topic among the 17 typical topics. + +In our experiments, the topic classifier achieves more than $97.8\%$ accuracy in 500 samples by human assessment. Through training the topic classifier, we can estimate Eq.1 to identify the causal effect $X \rightarrow P$ . + +# 4.2 Concept Extractor + +Prompt-based BERT The concept extractor is a BERT equipped with our proposed prompt followed by a pointer network (Vinyals et al., 2015). The pointer network is adopted for extracting multi-grained concepts. + +We first concatenate the token sequence with the tokens of $P$ and $X$ to constitute the input, i.e., $\{[\mathrm{CLS}]P[\mathrm{SEP}]X[\mathrm{SEP}]\}$ , where [CLS] and [SEP] are the special tokens in BERT. With multi-headed self-attention operations over the above in + +put, the BERT outputs the final hidden state (matrix), i.e., $\mathbf{H}^{N_L}\in \mathbb{R}^{(|P| + |X| + 3)\times d'}$ where $d^{\prime}$ is the vector dimension and $N_{L}$ is the total number of layers. Then the pointer network predicts the probability of a token being the start position and the end position of the extracted span. We use $\mathbf{p}^{start},\mathbf{p}^{end}\in \mathbb{R}^{|P| + |X| + 3}$ to denote the vectors storing the probabilities of all tokens to be the start position and end position, which are calculated as + +$$ +[ \mathbf {p} ^ {s t a r t}; \mathbf {p} ^ {e n d} ] = \operatorname {s o f t m a x} (\mathbf {H} ^ {N _ {L}} \mathbf {W} + \mathbf {B}) \quad (6) +$$ + +where $\mathbf{B} \in \mathbb{R}^{(|P| + |X| + 3) \times 2}$ and $\mathbf{W} \in \mathbb{R}^{d' \times 2}$ and are both trainable parameters. We only consider the probabilities of the tokens in the abstract $T$ . Given a span with $x_{i}$ and $x_{j}$ as the start token and the end token, its confidence score $cs_{ij} \in \mathbb{R}$ can be calculated as + +$$ +c s _ {i j} = p _ {i} ^ {\text {s t a r t}} + p _ {j} ^ {\text {e n d}}. \tag {7} +$$ + +Accordingly, the model outputs a ranking list of candidate concepts (spans) with their confidence scores. We only reserve the concepts with confidence scores bigger than the selection threshold. An example to illustrate how to perform the pointer network is provided in Appendix B.2. + +During training, the concept extractor is fed with the input texts with topic prompts and outputs the probability (confidence scores) of the spans, and thus can estimate the causal effect $P \rightarrow S$ in Eq.2. + +Model Training We adopt the cross-entropy function $CE(\cdot)$ as the loss function of our model. Specifically, suppose that $\mathbf{y}_{start} \in \mathbb{N}^{|P| + |X| + 3}$ (or $\mathbf{y}_{end} \in \mathbb{N}^{|P| + |X| + 3}$ ) contains the real label (0 or 1) of each input token being the start (or end) position of a concept. Then, we have the following two training losses for the predictions: + +$$ +\mathcal {L} _ {\text {s t a r t}} = C E \left(\mathbf {p} ^ {\text {s t a r t}}, \mathbf {y} _ {\text {s t a r t}}\right), \tag {8} +$$ + +$$ +\mathcal {L} _ {e n d} = C E \left(\mathbf {p} ^ {e n d}, \mathbf {y} _ {e n d}\right). \tag {9} +$$ + +Then, the overall training loss is + +$$ +\mathcal {L} = \alpha \mathcal {L} _ {\text {s t a r t}} + (1 - \alpha) \mathcal {L} _ {\text {e n d}} \tag {10} +$$ + +where $\alpha \in (0,1)$ is the control parameter. We use Adam (Kingma and Ba, 2015) to optimize $\mathcal{L}$ . + +# 5 Experiments + +# 5.1 Datasets + +CN-DBpedia From the latest version of Chinese KG CN-DBpedia (Xu et al., 2017) and Wikipedia, + +we randomly sample 100,000 instances to construct our sample pool. Each instance in the sample pool consists of an entity with its concept and abstract text ${}^{4}$ . Then,we sample 500 instances from the pool as our test set and divide the rest of the instances into the training set and validation set according to 9:1. + +Probase We obtain the English sample pool of 50,000 instances from Probase (Wu et al., 2012) and Wikipedia. The training, validation and test set construction are the same as the Chinese dataset. + +# 5.2 Evaluation Metrics + +We compare KPCE with seven baselines, including a pattern-matching approach i.e., Hearst pattern. Detailed information on baselines and some experiment settings is shown in Appendix C.1 and C.2. Some extracted concepts do not exist in the KG, and cannot be assessed automatically. Therefore, we invite the annotators to assess whether the extracted concepts are correct. The annotation detail is shown in Appendix C.3. + +Please note that the extracted concepts may already have existed in the KG for the given entity, which we denote as $ECs$ (existing concepts). However, our work expects to extract correct but new concepts (that do not exist in the KG) to complete the KGs, which we denote as NCs (new concepts). Therefore, we record the number of new concepts (NC #) and display the ratio of correct concepts (ECs and NCs) as precision (Prec.). Since it is difficult to know all the correct concepts in the input text, we report the relative recall $(\mathrm{Recall}_R)$ . Specifically, suppose NCs # is the total number of new concepts extracted by all models. Then, the relative recall is calculated as NC # divided by NCs #5. Accordingly, the relative F1 $(\mathrm{F1}_R)$ can be calculated with Prec. and $\mathrm{Recall}_R$ . In addition, we also record the average length of new concepts $(\mathrm{Len}_{NC})$ to investigate the effectiveness of the pointer network. + +# 5.3 Overall Performance + +We present the main results in Table 1. Generally, we have the following findings: + +Our method outperforms previous baselines by large margins, including previous state-of-the-art (MRC-CE, Yuan et al., 2021a). However, the + +pattern-based approach still beats the learning-based ones in precision, envisioning a room for improvement. We find that KPCE achieves a more significant improvement in extracting new concepts, indicating that KPCE can be applied to achieve KG completion (§ 5.5). We also compare KPCE with its ablated variant and the results show that adding a knowledge-guided prompt can guide BERT to achieve accurate CE results. + +We notice that almost all models have higher extraction precision on the Chinese dataset than that on the English dataset. This is because the modifiers are usually placed before nouns in Chinese syntactic structure, and thus it is easier to identify these modifiers and extract them with the coarse-grained concepts together to form the fine-grained ones. However, for the English dataset, not only adjectives but also subordinate clauses modify coarse-grained concepts, and thus identifying these modifiers is more difficult. + +Compared with learning-based baselines, KPCE can extract more fine-grained concepts. Although the Hearst pattern can also extract fine-grained concepts, it cannot simultaneously extract multi-grained concepts when a coarse-grained concept term is the subsequence of another fine-grained concept term. For example, in Figure 4, if Hearst Pattern extracts American novelist as a concept, it cannot extract novelist simultaneously. KPCE solves this problem well with the aid of the pointer network and achieves a much higher recall. + +# 5.4 Analysis + +In response to the motivations of KPCE, we conduct detailed analyses to further understand KPCE and why it works. + +# How does KPCE alleviate the concept bias? + +As mentioned in § 3.2, the concept bias occurs primarily among 26 concepts in CN-DBpedia. To justify that KPCE can alleviate concept bias with the aid of prompts, we randomly select five concepts and run KPCE with its ablated variant to extract concepts for 100 entities randomly selected from each of the five concepts. Then we calculate the bias rates of each concept, and the results in Table 2 show that KPCE has a much lower bias rate than the vanilla BERT-based concept extractor. Thus, the knowledge-guided prompt can significantly mitigate the concept bias. + +Furthermore, a case study for an entity Korean alphabet is shown in Table 3. We find that the + +
ModelNC #LenNCPrec.RecallRF1R
Trained on CN-DBpedia
Hearst2225.9595.24%21.66%35.29%
FLAIR643.0995.71%6.24%11.72%
XLNet472.6688.48%4.68%8.90%
KVMN2544.0364.45%26.02%37.08%
XLM-R2555.3576.82%24.78%37.47%
BBF264.3488.28%2.54%4.93%
GACEN3463.5884.89%36.73%51.27%
MRC-CE3235.3392.12%31.51%46.96%
KPCE4825.5294.20%44.38%60.33%
w/o P3385.2172.07%34.05%46.25%
Trained on Probose
Hearst2872.4389.04%17.10%28.69%
FLAIR1401.6884.31%7.73%14.16%
XLNet3421.5179.30%18.87%30.49%
KVMN4031.9747.39%22.24%30.27%
XLM-R3222.2881.73%17.77%29.19%
BBC1541.6881.13%8.44%15.30%
GACEN4861.7576.93%31.82%45.02%
MRC-CE5982.2388.59%33.00%48.09%
KPCE7522.3188.69%46.83%61.30%
w/o P6912.2678.64%40.62%53.57%
+ +Table 1: Concept extraction performance comparisons of 500 test samples. $w / o$ $P$ is the ablation variants of KPCE without the knowledge-guided prompt (P) + +
ConceptOConceptBKPCE w/oPKPCE
writerbook20%7%
plantdoctor8%0%
illnessmedicine12%6%
singermusic19%2%
poempoet25%1%
+ +Table 2: The bias rates issued by KPCE $w / o$ $P$ and KPCE in five selected concepts. $Concept_{O}$ is the original concept and $Concept_{B}$ is the biased concept. + +proposed prompts can mitigate the spurious co-occurrence correlation between entities and biased concepts by decreasing the confidence scores of biased concepts (i.e., language and alphabet) and increasing the scores of correct concepts (i.e., system and writing system). Thus, the knowledge-guided prompt can significantly alleviate the concept bias and result in more accurate CE results. + +How does the prompt affect the spurious co-occurrence correlations? To explore the rationale behind the prompt-based mediator, we focus on the attention distribution for the special token [CLS], since it is an aggregate representation of the sequence and can capture the sentence-level semantic meaning (Devlin et al., 2019; Chang et al., 2022). Following previous work (Clark et al., 2019), we calculate the attention probabilities of + +
Topic: Technology. Entity: Korean alphabet. +Abstract: The Korean alphabet is a writing system for the Korean language created by King Sejong the Great in 1443.
Output Results
KPCE w/oPKPCE
SpanC.S.SpanC.S.
language0.238system0.240
alphabet0.213writing system0.219
system0.209system for the Korean language0.130
+ +![](images/428dd9ac989af86dc366630f446f0f12d78ac16fe920291e501fc1cbe0a3f736.jpg) +Figure 6: Visualization of the attention distribution of [CLS] to other tokens. + +[CLS] to other tokens by averaging and normalizing the attention value in 12 attention heads in the last layers. The attention distributions of the KPCE and its ablation variant are visualized in Figure 6. We find that the tokens of writer and novel both have high attentions in the vanilla BERT-based concept extractor. However, after adopting our knowledge-guided prompt, the attention probabilities of novel is lower than before, and thus can help the model to reduce the spurious co-occurrence correlations derived from pre-trained knowledge. + +What if other knowledge injection methods are adopted? We claim that the topics obtained from external KGs are better than the keyword-based topics from the text on guiding BERT to achieve our CE task. To justify it, we compare KPCE with another variant, namely KPCE $LDA$ , where the topics are the keywords obtained by running Latent Dirichlet Allocation (LDA) (Blei et al., 2001) over the abstracts of all entities. Besides, we also compare KPCE with ERNIE (Zhang et al., 2019), which implicitly learns the knowledge of entities during pre-training. The detail about LDA and ERNIE is shown in Appendix C.4. The comparison results are listed in Table 4. It shows that our design of the knowledge-guided prompt in KPCE exploits the value of external knowledge more thoroughly than the two remaining schemes, thus achieving + +Table 3: A case to verify the effectiveness of the proposed prompts on addressing concept bias. We display an entity Korean alphabet with its top-3 extracted spans and the confidence scores (denoted as C.S.) + +
ModelNC #Prec.RecallRF1R
Trained on CN-DBpedia
KPCE48294.20%85.23%89.49%
KPCE LDA30893.08%82.13%87.26%
ERNIE30293.86%80.53%86.69%
Trained on Probose
KPCE75288.69%80.85%84.59%
KPCE LDA38168.23%61.45%64.66%
ERNIE28677.96%46.13%57.97%
+ +Table 4: Concept extraction results with different knowledge utilization. + +
ModelTS #NC #Prec.RecallRF1R
KPCE06282.66%48.44%61.08%
w/o P05569.62%42.97%53.14%
KPCE30010782.95%83.59%83.27%
w/o P3008981.65%69.53%75.10%
+ +Table 5: Human evaluation on 100 CE results for Meituan entities. TS # is the number of training samples. + +better CE performance. + +# 5.5 Applications + +KG Completion We run KPCE for all entities existing in CN-DBpedia to complement new concepts. KPCE extracts 7,623,111 new concepts for 6 million entities. Thus, our framework can achieve a large-scale concept completion for existing KGs. + +Domain Concept Acquisition We collect 117,489 Food & Delight entities with their descriptive texts from Meituan $^{6}$ , and explore two application approaches. The first is to directly apply KPCE, and the second is to randomly select 300 samples as a small training set to fine-tune KPCE. The results in Table 5 show that: 1) The transfer ability of KPCE is greatly improved with the aid of prompts; 2) KPCE can extract high-quality concepts in the new domain only with a small portion of training samples. Furthermore, after running directly, KPCE extracts 81,800 new concepts with $82.66\%$ precision. Thus, our knowledge-guided prompt can significantly improve the transfer ability of PLMs on the domain CE task. + +# 6 Conclusion + +In this paper, we identify the concept bias in the PLM-based CE system and devise a Structural + +Causal Model to analyze the bias. To alleviate concept bias, we propose a novel CE framework with knowledge-guided prompting to alleviate spurious co-occurrence correlation between entities and biased concepts. We conduct extensive experiments to justify that our prompt-based learning framework can significantly mitigate bias and has an excellent performance in concept acquisition. + +# 7 Limitations + +Although we have proven that our work can significantly alleviate concept bias and extract high-quality and new concepts, it also has some limitations. In this section, we analyze three limitations and hope to advance future work. + +Model Novelty Although KPCE can effectively mitigate the spurious co-occurrence correlations between entities and biased concepts, the proposed framework is not entirely novel. The novelty of our work is to conduct the first thorough causal analysis that shows the spurious correlations between entities and biased concepts in the concept extraction task. After defining the problem and SCM of concept extraction in § 3.1, we propose a prompt-based approach to implement the interventions toward the SCM to elicit the unbiased knowledge from PLMs. Previous work in language prompting mostly guides the PLMs with prompts but is unaware of the cause-effect relations in its task, which may hinder the effectiveness of prompts. We hope our work can inspire future work to utilize language prompting from a causal perspective. + +Topic Classification Although the topics obtained by clustering are mostly mutually exclusive, there are still cases where an entity can be classified into multiple topics. Therefore, considering only one topic for the entity excludes the correct concepts. + +Threshold Selection We only reserve concepts with confidence scores bigger than the selection threshold (§ 4.2), which can hardly achieve a satisfactory balance of precision and recall. If we select a relatively big threshold, we can get more accurate concepts but may lose some correct ones. If the recall is preferred, precision might be hurt. + +We suggest that future work consider these three limitations to achieve better performance in the CE task. + +# Acknowledgement + +We would like to thank the anonymous reviewers for their valuable comments and suggestions for this work. This work is supported by the Chinese NSF Major Research Plan (No.92270121), Shanghai Science and Technology Innovation Action Plan (No.21511100401) and the Science and Technology Commission of Shanghai Municipality Grant (No. 22511105902). + +# 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. +S Aranganayagi and Kuttiyannan Thangavel. 2007. Clustering categorical data using silhouette coefficient as a relocating measure. In International conference on computational intelligence and multimedia applications (ICCIMA 2007), volume 2, pages 13-17. IEEE. +Sören Auer, Christian Bizer, Georgi Kobilarov, Jens Lehmann, Richard Cyganiak, and Zachary Ives. 2007. Dbpedia: A nucleus for a web of open data. In *The semantic web*, pages 722-735. Springer. +Sanjiv K Bhatia et al. 2004. Adaptive k-means clustering. In FLAIRS conference, pages 695-699. +D. M. Blei, Andrew Y. Ng, and Michael I. Jordan. 2001. Latent dirichlet allocation. The Annals of Applied Statistics. +Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. 2020. Language models are few-shot learners. Advances in neural information processing systems, 33:1877-1901. +Boxi Cao, Hongyu Lin, Xianpei Han, Fangchao Liu, and Le Sun. 2022. Can prompt probe pretrained language models? understanding the invisible risks from a causal view. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 5796-5808, Dublin, Ireland. Association for Computational Linguistics. +Haw-Shiuan Chang, Ruei-Yao Sun, Kathryn Ricci, and Andrew McCallum. 2022. Multi-cls bert: An efficient alternative to traditional ensembling. arXiv preprint arXiv:2210.05043. +Jiangjie Chen, Chun Gan, Sijie Cheng, Hao Zhou, Yanghua Xiao, and Lei Li. 2022. Unsupervised editing for counterfactual stories. Proceedings of the AAAI Conference on Artificial Intelligence, 36(10):10473-10481. + +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. +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. +Alexis Conneau and Guillaume Lample. 2019. Crosslingual language model pretraining. Advances in neural information processing systems, 32. +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. +Songtao Fang, Zhenya Huang, Ming He, Shiwei Tong, Xiaqing Huang, Ye Liu, Jie Huang, and Qi Liu. 2021. Guided attention network for concept extraction. In Proceedings of the Thirtieth International Joint Conference on Artificial Intelligence, IJCAI-21, pages 1449-1455. International Joint Conferences on Artificial Intelligence Organization. Main Track. +Amir Feder, Katherine A. Keith, Emaad Manzoor, Reid Pryzant, Dhanya Sridhar, Zach Wood-Doughty, Jacob Eisenstein, Justin Grimmer, Roi Reichart, Margaret E. Roberts, Brandon M. Stewart, Victor Veitch, and Diyi Yang. 2022. Causal inference in natural language processing: Estimation, prediction, interpretation and beyond. Transactions of the Association for Computational Linguistics, 10:1138-1158. +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. +Matt W Gardner and SR Dorling. 1998. Artificial neural networks (the multilayer perceptron)—a review of applications in the atmospheric sciences. Atmospheric environment, 32(14-15):2627-2636. +Navita Goyal, Roodram Paneri, Ayush Agarwal, Udit Kalani, Abhilasha Sancheti, and Niyati Chhaya. 2022. + +CaM-Gen: Causally aware metric-guided text generation. In Findings of the Association for Computational Linguistics: ACL 2022, pages 2047-2060, Dublin, Ireland. Association for Computational Linguistics. +Fred X Han, Di Niu, Haolan Chen, Weidong Guo, Shengli Yan, and Bowei Long. 2020. Meta-learning for query conceptualization at web scale. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 3064-3073. +Zhiting Hu and Li Erran Li. 2021. A causal lens for controllable text generation. In Advances in Neural Information Processing Systems. +Jie Ji, Bairui Chen, and Hongcheng Jiang. 2020. Fully-connected LSTM—crf on medical concept extraction. International Journal of Machine Learning and Cybernetics, 11(9):1971-1979. +Meng Jiang, Jingbo Shang, Taylor Cassidy, Xiang Ren, Lance M Kaplan, Timothy P Hanratty, and Jiawei Han. 2017. Metapad: Meta pattern discovery from massive text corpora. In Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 877-886. +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. +Diederik P Kingma and Jimmy Ba. 2015. Adam: A method for stochastic optimization. In ICLR (Poster). +Lukas Lange, Heike Adel, Jannik Strötgen, and Dietrich Klakow. 2022. Clin-x: pre-trained language models and a study on cross-task transfer for concept extraction in the clinical domain. *Bioinformatics*, 38(12):3267-3274. +Chenguang Li, Jiaqing Liang, Yanghua Xiao, and Haiyun Jiang. 2021. Towards fine-grained concept generation. IEEE Transactions on Knowledge and Data Engineering. +Lantian Li, Weizhi Xu, and Hui Yu. 2020. Character-level neural network model based on nadam optimization and its application in clinical concept extraction. Neurocomputing, 414:182-190. +Shaobo Li, Xiaoguang Li, Lifeng Shang, Zhenhua Dong, Chengjie Sun, Bingquan Liu, Zhenzhou Ji, Xin Jiang, and Qun Liu. 2022. How pre-trained language models capture factual knowledge? a causal-inspired analysis. In *Findings of the Association for Computational Linguistics: ACL* 2022, pages 1720-1732, Dublin, Ireland. Association for Computational Linguistics. +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. +Pengfei Liu, Weizhe Yuan, Jinlan Fu, Zhengbao Jiang, Hiroaki Hayashi, and Graham Neubig. 2021a. Pretrain, prompt, and predict: A systematic survey of prompting methods in natural language processing. arXiv preprint arXiv:2107.13586. +Xiao Liu, Yanan Zheng, Zhengxiao Du, Ming Ding, Yujie Qian, Zhilin Yang, and Jie Tang. 2021b. Gpt understands, too. arXiv preprint arXiv: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. +Yujie Lu, Weixi Feng, Wanrong Zhu, Wenda Xu, Xin Eric Wang, Miguel Eckstein, and William Yang Wang. 2022. Neuro-symbolic causal language planning with commonsense prompting. arXiv preprint arXiv:2206.02928. +Xuan Luo, Yiping Yin, Yice Zhang, and Ruifeng Xu. 2021. A privacy knowledge transfer method for clinical concept extraction. In International Conference on AI and Mobile Services, pages 18-28. Springer. +Xusheng Luo, Luxin Liu, Yonghua Yang, Le Bo, Yuanpeng Cao, Jinghang Wu, Qiang Li, Keping Yang, and Kenny Q Zhu. 2020. Alicoco: Alibaba e-commerce cognitive concept net. In Proceedings of the 2020 ACM SIGMOD international conference on management of data, pages 313-327. +Ujjwal Maulik and Sanghamitra Bandyopadhyay. 2002. Performance evaluation of some clustering algorithms and validity indices. IEEE Transactions on pattern analysis and machine intelligence, 24(12):1650-1654. +Yuyang Nie, Yuanhe Tian, Yan Song, Xiang Ao, and Xi-ang 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, Online. Association for Computational Linguistics. +Bhargavi Paranjape, Matthew Lamm, and Ian Tenney. 2022. Retrieval-guided counterfactual generation for QA. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1670-1686, Dublin, Ireland. Association for Computational Linguistics. +Judea Pearl. 2009. Causality. Cambridge university press. +Jonas Peters, Dominik Janzing, and Bernhard Scholkopf. 2017. Elements of causal inference: foundations and learning algorithms. The MIT Press. + +Timo Schick and Hinrich Schutze. 2021. 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. +Timo Schick and Hinrich Schütze. 2021. Few-shot text generation with natural language instructions. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 390-402, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Bernhard Scholkopf. 2022. Causality for machine learning. In Probabilistic and Causal Inference: The Works of Judea Pearl, pages 765-804. +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. +MK Vijaymeena and K Kavitha. 2016. A survey on similarity measures in text mining. Machine Learning and Applications: An International Journal, 3(2):19-28. +Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. 2015. Pointer networks. Advances in neural information processing systems, 28. +Ulrike Von Luxburg. 2007. A tutorial on spectral clustering. Statistics and computing, 17(4):395-416. +Noah Weber, Rachel Rudinger, and Benjamin Van Durme. 2020. Causal inference of script knowledge. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 7583-7596, Online. Association for Computational Linguistics. +Wentao Wu, Hongsong Li, Haixun Wang, and Kenny Q Zhu. 2012. Probase: A probabilistic taxonomy for text understanding. In Proceedings of the 2012 ACM SIGMOD international conference on management of data, pages 481-492. +Bo Xu, Yong Xu, Jiaqing Liang, Chenhao Xie, Bin Liang, Wanyun Cui, and Yanghua Xiao. 2017. Cndbpedia: A never-ending chinese knowledge extraction system. In Proc. of IEA-AIE, pages 428-438. Springer. +Xi Yang, Jiang Bian, William R Hogan, and Yonghui Wu. 2020. Clinical concept extraction using transformers. Journal of the American Medical Informatics Association, 27(12):1935-1942. +Siyu Yuan, Deqing Yang, Jiaqing Liang, Zhixu Li, Jinxi Liu, Jingyue Huang, and Yanghua Xiao. 2022. Generative entity typing with curriculum learning. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 3061-3073, Abu Dhabi, United Arab Emirates. Association for Computational Linguistics. + +Siyu Yuan, Deqing Yang, Jiaqing Liang, Jilun Sun, Jingyue Huang, Kaiyan Cao, Yanghua Xiao, and Rui Xie. 2021a. Large-scale multi-granular concept extraction based on machine reading comprehension. In International Semantic Web Conference, pages 93-110. Springer. +Weizhe Yuan, Graham Neubig, and Pengfei Liu. 2021b. Bartscore: Evaluating generated text as text generation. Advances in Neural Information Processing Systems, 34:27263-27277. +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, Florence, Italy. Association for Computational Linguistics. +Peixiang Zhong, Di Wang, Pengfei Li, Chen Zhang, Hao Wang, and Chunyan Miao. 2021. Care: Commonsense-aware emotional response generation with latent concepts. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 14577-14585. + +# A Theoretical Details of Causal Framework + +# A.1 Preliminaries + +SCM The Structural Causal Model (SCM) is associated with a graphical causal model to describe the relevant variables in a system and how they interact with each other. An SCM $G = \{V, f\}$ consists of a set of nodes representing variables $V$ , and a set of edges between the nodes as functions $f$ to describe the causal relations. Figure 3 shows the SCM that describes the PLM-based CE system. Here the input text $X$ serves as the treatment, and the extracted concept span $S$ is the outcome. In our SCM, pre-trained knowledge $K$ is a cause of both $X$ and $S$ , and thus $K$ is a confounder. A confounder can open backdoor paths (i.e., $X \gets K \rightarrow S$ ) and cause a spurious correlation between $X$ and $S$ . To control the confounding bias, intervention techniques with the do-operator can be applied to cut off backdoor paths. + +Causal Intervention To identify the true causal effects of $X \to S$ , we can adopt the causal intervention to fix the input $X = x$ and removes the correlation between $X$ and its precedents, denoted as $do(X = x)$ . In this way, the true causal effects of $X \to S$ can be represented as $P(S = s|do(X = x))$ . The backdoor adjustment and the frontdoor adjustment are two operations to implement interventions and obtain $P(S = s|do(X = x))$ . + +Next, we will elaborate on the details of the two operations. + +# A.2 The Backdoor Adjustment + +The backdoor adjustment is an essential tool for causal intervention. For our SCM, the pre-trained knowledge blocks the backdoor path between $X$ and $S$ , then the causal effect of $X = x$ on $S$ can be calculated by: + +$$ +\begin{array}{l} P (S = s \mid d o (X = x)) \\ = P _ {m} (S = s \mid X = x) \\ = \sum_ {k} P _ {m} (S = s | X = x, K = k) P _ {m} (K = k) \\ = \sum_ {k} P (S = s | X = x, K = k) P (K = k), \tag {11} \\ \end{array} +$$ + +where $P_{m}$ is the probability after applying the do- operator, and $P(K = k)$ needs to be estimated from data or priorly given. However, it is intractable to observe the pre-training data and obtain + +the prior distribution of the pre-trained knowledge. Therefore, the back adjustment is not applicable in our case. + +# A.3 The Frontdoor Adjustment + +The frontdoor adjustment is a complementary approach to applying the intervention when we cannot identify any set of variables that obey the backdoor adjustment. + +In our SCM, we aim to estimate the direct effect of $X$ on $S$ , while being unable to directly measure pre-trained knowledge $K$ . Thus, we introduce a topic prompt $P$ as a mediator, and then the front-door adjustment can adopt a two-step do-operation to mitigate bias. + +Step 1 As illustrated in §3.3, we first analyze the causal effect $X \to P$ . Since the collider, i.e., $X \to P \to S \gets K$ blocks the association between $P$ and $K$ , there is no backdoor path from $X$ to $P$ . Thus we can obtain the conditional probability as (same as Eq.1): + +$$ +P (P = p \mid d o (X = x)) = P (P = p \mid X = x). \tag {12} +$$ + +To explain Step 1, we take an entity Louisa May Alcott with her abstract as an example. We can assign the topic person as a prompt to make the PLM-based extractor alleviate spurious correlation between Louisa May Alcott and novel, and concentrate on extracting person-type concepts. + +Step 2 In this step, we investigate the causal effect $P \to S$ . $P \gets X \gets K \to S$ contains a backdoor from $P$ to $S$ . Since the data distribution of $X$ can be observed, we can block the backdoor path through $X$ : + +$$ +\begin{array}{l} P (S = s | d o (P = p)) \\ = \sum_ {x} P (S = s | X = x, P = p) P (X = x), \tag {13} \\ \end{array} +$$ + +where $P(X = x)$ can be obtained from the distribution of the input data, and $P(S = s|X = x, P = p)$ is the conditional probability of the extracted span given the abstract with a topic prompt, which can be estimated $P(S = s|X = x, P = p)$ by the concept extractor. + +Now we can chain the two steps to obtain the + +causal effect $X\to S$ .. + +$$ +\begin{array}{l} P (S | d o (X)) \\ = \sum_ {p} P (S | p, d o (X)) P (p | d o (X)) \\ = \sum_ {p} P (S | d o (P), d o (X)) P (p | d o (X)) \\ = \sum_ {p} P (S | d o (P)) P (p | d o (X)). \tag {14} \\ \end{array} +$$ + +# B Detailed Information about KPCE + +
TopicCorresponding Concept Examples
Personpoliticians, teachers, doctors
Bookromance novels, art books, fantasy novels
Locationtowns, villages, scenic spots
Film and TVmovies, animation, TV dramas
Languageidioms, medical terms, cultural terms
Gameelectronic games, web games, mobile games
Creatureplants, animals, bacteria
FoodIndian cuisine, Japanese cuisine
Websitegovernment websites, corporate websites
Musicsingles, songs, pop music
Softwareapplication software, system software
Folkloresocial folklore, belief folklore
Organizationcompanies, brands, universities
Historyancient history, modern history
Diseasedigestive system disease, oral disease
Technologytechnology products, electrical appliances
MedicineChinese medicine, Western medicine
+ +Table 6: 17 typical topics and their corresponding concept examples. + +# B.1 Identifying Topic for Each Entity + +The 17 typical topics and their corresponding concepts are listed in Table 6. We predict the topic of the entity as one of the 17 typical topics using a transformer encoder-based topic classifier. We randomly fetch 40,000 entities together with their existing concepts in the KG. According to the concept clustering results, we can assign each topic to the entities. Specifically, we concatenate $E$ and $X$ as input to the classifier. With multi-headed self-attention operation over the input token sequence, the classifier takes the final hidden state (vector) of a token [CLS], i.e., $\mathbf{h}_{[\mathrm{CLS}]}^{N_L} \in \mathbb{R}^{d''}$ , to compute the topic probability distribution $P(T^i | E, X) \in \mathbb{R}^{17}$ , where $N_L$ is the total number of layers and $d''$ is the vector dimension. Then, we identify the topic with the highest probability $T$ as the topic of $X$ , + +![](images/e84ac902a775d4eba10a51aac8f5cbed5eecf3601ddb610e8e2338c5245a50f2.jpg) +Figure 7: An example to illustrate how to perform the pointer network. + +which is calculated as follows, + +$$ +\mathbf {H} ^ {0} = \mathbf {E} \mathbf {W} ^ {0} + \mathbf {B} ^ {0}, \tag {15} +$$ + +$$ +\mathbf {H} ^ {l} = \operatorname {e n c o d e r} \left(\mathbf {H} ^ {l - 1}\right), 1 \leq l \leq N _ {L}, \tag {16} +$$ + +$$ +P (T) = \operatorname {s o f t m a x} \left(\mathbf {h} _ {[ C L S ]} ^ {N _ {L}} \mathbf {W} ^ {L}\right), \tag {17} +$$ + +$$ +T = \underset {i} {\arg \max } \left(P \left(T ^ {i}\right)\right), 1 \leq i \leq 1 7 \tag {18} +$$ + +where $\mathbf{E} \in \mathbb{R}^{(|\mathbf{E}| + |\mathbf{X}|) \times d}$ is the random initial embedding matrix of all input tokens and $d$ is the embedding size. $\mathbf{H}^l \in \mathbb{R}^{(|\mathbf{E}| + |\mathbf{X}|) \times d''}$ is the hidden matrix of the $l$ -th layer. $\mathbf{h}_{[CLS]}^{N_L}$ is obtained from $\mathbf{H}^{N_L}$ . Furthermore, $\mathbf{W}^0 \in \mathbb{R}^{d \times d''}$ , $\mathbf{B}^0 \in \mathbb{R}^{(|\mathbf{E}| + |\mathbf{X}|) \times d''}$ and $\mathbf{W}^L \in \mathbb{R}^{d'' \times 17}$ are both training parameters. + +# B.2 An Example for Point Network + +As mentioned in § 4.2, we adopt a point network to achieve multi-grained concept extraction (Yuan et al., 2021a). The model generates a ranking list of candidate concepts (spans) along with their confidence scores, and outputs the concepts with confidence scores bigger than the selection threshold. Note that one span may be output repeatedly as the same subsequence of multiple extracted concepts through an appropriate selection threshold. + +For example, as shown in Figure 7, writer is extracted multiple times as the subsequence of three different granular concepts when the confidence score threshold is set to 0.30. Therefore, the point network enables our framework to extract multigrained concepts. + +# C Experiment Detail + +# C.1Baselines + +We compare KPCE with seven baselines. Most of the compared models are the extraction models feasible for extraction tasks, including Named Entity Recognition (NER), Relation Extraction (RE), and Open Information Extraction (Open IE). In addition, we also compare the pattern-based approach. However, we do not compare ontology extension models and generation models, since both do not meet our scenario. Since entity typing models cannot find new concepts, they are also excluded from our comparison. Please note that, except MRC-CE, other baselines applied in concept extraction cannot extract multi-grained concepts. + +- Hearst (Jiang et al., 2017): With specific handwritten rules, this baseline can extract concepts from free texts. We design 5 Hearst patterns listed in Table 7 where we translate the Chinese patterns for the Chinese dataset into English. +- FLAIR (Akbik et al., 2019): It is a novel NLP framework that combines different words and document embeddings to achieve excellent results. FLAIR can also be employed for concept extraction since it can extract spans from the text. +- XLNet (Yang et al., 2020): With the capability of modeling bi-directional contexts, this model can extract clinical concepts effectively. +- KVMN (Nie et al., 2020): As a sequence labeling model, KVMN is proposed to handle NER by leveraging different types of syntactic information through the attentive ensemble. +- XLM-R (Conneau et al., 2020; Lange et al., 2022): It is a Transformer-based multilingual masked language model incorporating XLM (Conneau and Lample, 2019) and RoBERTa (Liu et al., 2019), which has proven to be effective in extracting concepts. +- BBF (Luo et al., 2021): It is an advanced version of BERT built with Bi-LSTM and CRF. With optimal token embeddings, it can extract high-quality medical and clinical concepts. + +- GACEN (Fang et al., 2021): The model incorporates topic information into feature representations and adopts a neural network to pre-train a soft matching module to capture semantically similar tokens. +- MRC-CE (Yuan et al., 2021a): MRC-CE handles the concept extraction problem as a Machine Reading Comprehension (MRC) task built with an MRC model based on BERT. It can find abundant new concepts and handle the problem of concept overlap well with a pointer network. + +
DatasetPattern
CN-DBpediaX is Y
X is one of Y
X is a type/a of Y
X belongs to Y
Y is located/founded/ in...
ProbaseX is a Y that/which/who
X is one of Y
X refers to Y
X is a member/part/form... of Y
As Y, X is ...
+ +Table 7: The Hearst patterns used in the baseline. + +# C.2 Experiment Settings + +Our experiments are conducted on a workstation of dual GeForce GTX 1080 Ti with 32G memory and the environment of torch 1.7.1. We adopt a BERT-base with 12 layers and 12 self-attention heads as the topic classifier and concept extractor in KPCE. The training settings of our topic classifier are: $\mathrm{d} = 768$ , batch size $= 16$ , learning rate $= 3\mathrm{e - }5$ , dropout rate $= 0.1$ and training epoch $= 2$ . The training settings of our concept extractor are: $\mathrm{d} = 768$ , m $= 30$ , batch size $= 4$ , learning rate $= 3\mathrm{e - }5$ , dropout rate $= 0.1$ and training epoch $= 2$ . The $\alpha$ in Eq.8 is set to 0.3 and the selection threshold of candidate spans in the concept extractor is set to 0.12 based on our parameter tuning. + +# C.3 Human Assessment + +Some extracted concepts do not exist in the KG, which cannot be automatically assessed. Therefore, we invite some volunteers to assess whether the extracted concepts are correct for the given entities. We denote an extracted concept as an $EC$ (existing concept) that has already existed in the KG for the given entity. We denote an extracted concept as an $NC$ (new concept) represents a correct concept not + +existing in the KG for the given entity. We employ four annotators in total to ensure the quality of the assessment. All annotators are native Chinese and proficient in English. Each concept is labeled with 0, 1 or 2 by three annotators, where 0 means a wrong concept for the given entity, while 1 and 2 represent EC and NC, respectively. If the results from the three annotators are different, the fourth annotator will be hired for a final check. We protect the privacy rights of the annotators and pay the annotators above the local minimum wage. + +# C.4 Other Knowledge Injection Methods + +As we mentioned before, the topics of the knowledge-guided prompt come from external KGs, which are better than the keyword-based topics from the text on guiding BERT to achieve accurate concept extraction. + +To justify it, we compared KPCE with another variant, namely KPCE $LDA$ , where the topics are the keywords obtained by running Latent Dirichlet Allocation (LDA) (Blei et al., 2001) over all entities' abstracts. Specifically, the optimal number of LDA topic classes was also determined as 17 through our tuning study. For a given entity, its topic is identified as the keyword with the highest probability of its topic class. Besides, we also compared KPCE with ERNIE. ERNIE (Zhang et al., 2019) adopts entity-level masking and phrase-level masking to learn language representation. During pre-training of ERNIE, all words of the same entity mentioned or phrase are masked. In this way, ERNIE can implicitly learn the prior knowledge of phrases and entities, such as relationships between entities and types of entities, and thus have better generalization and adaptability. + +The comparison results are listed in Table 4, which shows that our design of the knowledge-guided prompt in KPCE exploits external knowledge's value more thoroughly than the rest two schemes. + +A For every submission: + +A1. Did you describe the limitations of your work? Limitations +A2. Did you discuss any potential risks of your work? Limitations +A3. Do the abstract and introduction summarize the paper's main claims? Abstract and Section 1 +A4. Have you used AI writing assistants when working on this paper? Check grammar for the whole paper + +B Did you use or create scientific artifacts? + +Section 5.1 + +B1. Did you cite the creators of artifacts you used? Sections 5.1 +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? Section 5.1 +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? Section 5.1 +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? Our data is collected from the existing KGs, and there is no offensive content. +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? Section 5.1 +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. Section 5.1 + +C Did you run computational experiments? + +Section 5 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? Appendix C.2 + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? Appendix C.2 +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? Section 5.2 +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? We do not use existing packages + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? Appendix C.3 + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? Appendix C.3 +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? Appendix C.3 +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? Appendix C.3 +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? Not applicable. We do not have any human subjects research. +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? Appendix C.3 \ No newline at end of file diff --git a/causalityawareconceptextractionbasedonknowledgeguidedprompting/images.zip b/causalityawareconceptextractionbasedonknowledgeguidedprompting/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..1934bd0473b34f8c202c33f112531f1904142d77 --- /dev/null +++ b/causalityawareconceptextractionbasedonknowledgeguidedprompting/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:646056acbfba0405255d212fa7b98f1ff5bb8b3263c6586b699df9897351967f +size 683823 diff --git a/causalityawareconceptextractionbasedonknowledgeguidedprompting/layout.json b/causalityawareconceptextractionbasedonknowledgeguidedprompting/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..032627cb6327d397d5491222ec3170a31fb76b13 --- /dev/null +++ b/causalityawareconceptextractionbasedonknowledgeguidedprompting/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3f97b967f8ead173f86bab716903aba84da1d2ad114c66ee01bbd4977c14d0d2 +size 630125 diff --git a/causalityguidedmultimemoryinteractionnetworkformultivariatestockpricemovementprediction/ed22a04c-a846-4377-91b8-c6e59d92e118_content_list.json b/causalityguidedmultimemoryinteractionnetworkformultivariatestockpricemovementprediction/ed22a04c-a846-4377-91b8-c6e59d92e118_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..5a076dc97590e2ff6c80a7f59f5912f2af550445 --- /dev/null +++ b/causalityguidedmultimemoryinteractionnetworkformultivariatestockpricemovementprediction/ed22a04c-a846-4377-91b8-c6e59d92e118_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5fa4285d7225c2cfdcf5fd0908eb034d48e62226d825a2d56bbe316053cf6e91 +size 97133 diff --git a/causalityguidedmultimemoryinteractionnetworkformultivariatestockpricemovementprediction/ed22a04c-a846-4377-91b8-c6e59d92e118_model.json b/causalityguidedmultimemoryinteractionnetworkformultivariatestockpricemovementprediction/ed22a04c-a846-4377-91b8-c6e59d92e118_model.json new file mode 100644 index 0000000000000000000000000000000000000000..87a1fc86f3425633cf76aa2403c3310c51ed8b40 --- /dev/null +++ b/causalityguidedmultimemoryinteractionnetworkformultivariatestockpricemovementprediction/ed22a04c-a846-4377-91b8-c6e59d92e118_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7bc983178c811390b3aaef85f25a0cc0acf13764cd9af18248ab6b0fb01ffa62 +size 117175 diff --git a/causalityguidedmultimemoryinteractionnetworkformultivariatestockpricemovementprediction/ed22a04c-a846-4377-91b8-c6e59d92e118_origin.pdf b/causalityguidedmultimemoryinteractionnetworkformultivariatestockpricemovementprediction/ed22a04c-a846-4377-91b8-c6e59d92e118_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..05c1262c508b87a84c1f068d463277a090a31f55 --- /dev/null +++ b/causalityguidedmultimemoryinteractionnetworkformultivariatestockpricemovementprediction/ed22a04c-a846-4377-91b8-c6e59d92e118_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8cc0dc4cb6e41e86036738aaf22519ad9b971395f318df194d86cc68da68f9aa +size 1436010 diff --git a/causalityguidedmultimemoryinteractionnetworkformultivariatestockpricemovementprediction/full.md b/causalityguidedmultimemoryinteractionnetworkformultivariatestockpricemovementprediction/full.md new file mode 100644 index 0000000000000000000000000000000000000000..de81bb2257a8fe065926d1eaa44536340cd68b36 --- /dev/null +++ b/causalityguidedmultimemoryinteractionnetworkformultivariatestockpricemovementprediction/full.md @@ -0,0 +1,470 @@ +# Causality-Guided Multi-Memory Interaction Network for Multivariate Stock Price Movement Prediction + +Di Luo $^{1*}$ ; Weiheng Liao $^{1*}$ ; Shuqi Li $^{1*}$ ; Xin Cheng $^{2}$ and Rui Yan $^{1,3\dagger}$ + +1Gaoling School of Artificial Intelligence, Renmin University of China + +$^{2}$ Wangxuan Institute of Computer Technology, Peking University + +3Engineering Research Center of Next-Generation Intelligent Search and + +Recommendation, Ministry of Education + +{di_luo, shuqili, ruiyan}@ruc.edu.cn, + +liaoweiheng@gmail.com, chengxin1998@stu.pku.edu.cn + +# Abstract + +Over the past few years, we've witnessed an enormous interest in stock price movement prediction using AI techniques. In recent literature, auxiliary data has been used to improve prediction accuracy, such as textual news. When predicting a particular stock, we assume that information from other stocks should also be utilized as auxiliary data to enhance performance. In this paper, we propose the Causality-guided Multi-memory Interaction Network (CMIN), a novel end-to-end deep neural network for stock movement prediction which, for the first time, models the multi-modality between financial text data and causality-enhanced stock correlations to achieve higher prediction accuracy. CMIN transforms the basic attention mechanism into Causal Attention by calculating transfer entropy between multivariate stocks in order to avoid attention on spurious correlations. Furthermore, we introduce a fusion mechanism to model the multi-directional interactions through which CMIN learns not only the self-influence but also the interactive influence in information flows representing the interrelationship between text and stock correlations. The effectiveness of the proposed approach is demonstrated by experiments on three real-world datasets collected from the U.S. and Chinese markets, where CMIN outperforms existing models to establish a new state-of-the-art prediction accuracy. + +# 1 Introduction + +Financial services, known for their competitiveness, have always been at the forefront of adopting data science techniques to drive investment decisions. Quantitative trading, a specific field within it, has drawn immense interest from both academia and industry over the last few decades. With the rapid advancements in deep learning recently, computer scientists and quantitative researchers have + +joined forces to apply AI techniques to tackle the challenges within this domain. + +Among various tasks, one of the most prominent is stock price movement prediction (Bhardwaj, 2021). The reason for its popularity is self-evident: once a model is able to predict future movement with considerable accuracy, numerous trading strategies can be easily built around it. + +Recent studies have shown that deep neural networks are ideal candidates for such prediction models (Yoo et al., 2021; Gunduz, 2021). Supporters of the efficient-market hypothesis (EMH), which posits that asset prices reflect all available information, tackle the task with price information alone (Zhang et al., 2017; Stoean et al., 2019; Sezer and Özbayoglu, 2020). However, an alternative perspective suggests that additional insights can be gained from analyzing news articles and social media posts, which may hold valuable clues about the future (Hu et al., 2018; Xu and Cohen, 2018; Wang et al., 2019b; Tang et al., 2020). + +Another intriguing approach analyzes the relationships between different stocks. Clearly positive and negative correlations, or even non-correlations can be immensely useful in constructing a diversified stock portfolio (Borodin et al., 2003). Several studies even empirically demonstrate that exploiting correlations can improve the accuracy of stock price movement prediction (Long et al., 2020; Yoo et al., 2021). However, their correlations are often realized by acquiring industry sector and calculating correlation matrices or attention scores, which are bidirectional and symmetrical, leading to excessive attention on spurious correlations. Due to the lag problem widely existed between two time series, we are more concerned about the dominance of information flow between stocks, specifically, the direction of causality. + +Additionally, we have observed that the situation can significantly change when incorporating text information. Let's consider two highly correlated + +companies (A and B) and there is promising news specifically about company A. In such a scenario, it's fairly easy to infer that the current news might still have a substantial impact on company B, despite there being no direct connection between the two companies on paper. However, it's impossible to reach this conclusion by just examining the news about company A or the correlation between A and B alone, which highlights the limitations of relying solely on individual pieces of textual information or traditional correlations between stocks. + +Inspired by observations above, we propose the Causality-guided Multi-memory Interaction Network (CMIN), a novel end-to-end deep neural network which captures both financial news as well as the causality-enhanced correlations between stocks for better stock price movement prediction. + +To achieve this goal, CMIN incorporates two key components: the Text Memory Network and the Stock Correlation Memory Network. Both networks utilize a recurrent neural network with nonlinear combination of memory attentions to generate a global memory abstraction. And we introduce a global causality matrix according to the transfer entropy between stock price time series to guide the abstraction process, forming a Causal Attention mechanism to capture the asymmetric correlations. By considering causality, CMIN goes beyond traditional symmetric correlations and captures the true inter-dependencies between stocks. Furthermore, we employ an attention-based fusion mechanism between the two networks, introducing multi-directional interactions through which CMIN learns not only the self-influence within each network but also the interactive influence between them. It captures the interrelationship between textual information and correlations, enhancing the overall predictive power of CMIN. + +We further demonstrate the effectiveness of CMIN with experiments conducted on 3 real-world datasets collected from both the U.S. and Chinese markets, where CMIN achieves state-of-the-art prediction accuracy, surpassing existing models in terms of performance. + +To summarize, our main contributions are: + +- Proposal of a causality-guided multi-memory interaction network for stock movement prediction which is to our best knowledge the first attempt to simultaneously consider causality-enhanced correlations and textual information to achieve higher prediction accuracy; + +- Introduction of the attention-based multidirectional interactions, so that CMIN captures not only the self-influence of temporal movements and textual information but also the interactions between these two types of information flows; + +- Collection and release of two new datasets: one for the U.S. market and another for the Chinese market. Both datasets include comprehensive financial texts and stock price time series data, which are publicly available at https://github.com/BigRoddy/CMIN-Dataset, facilitating further research and benchmarking in the field. + +# 2 Related Work + +# 2.1 Stock Movement Prediction + +In traditional trading practices, two main frameworks are commonly used to make predictions on future stock prices (Ferreira et al., 2021). The first is fundamental analysis, which aims to assess the intrinsic value of a stock by considering various factors related to it as a whole, such as financial statements, industry trends and economic conditions. The other is technical analysis, which operates under the assumption that the market is efficient (i.e., the Efficient Market Hypothesis holds true) and focuses on analyzing only historical and current price patterns in order to predict future movements. + +Although both frameworks have been widely adopted by top hedge funds and investment firms, technical analysis has gained more popularity among AI practitioners, many of whom focus on employing long short-term memory networks and other innovative architectures to model stock price history alongside technical analysis indicators (Nelson et al., 2017; Zhang et al., 2017; Stoean et al., 2019; Sezer and Ozbayoglu, 2020). This is primarily because processing a single stream of price data is relatively simpler than analyzing and synthesizing a range of diverse data sources with varying frequencies and characteristics. + +# 2.2 Predicting with the Help of Text Data + +The recent advancement of natural language processing (NLP) techniques has opened up new possibilities for analyzing large volumes of text data in the context of stock movement prediction. Many researchers have recognized the potential value of incorporating news articles, analysis, commentaries + +and even social media posts (Xu and Cohen, 2018), which are believed to provide valuable insights about the future. Some studies focus solely on textual information. For example, (Hu et al., 2018) leverages attention mechanism at multiple levels within a deep structure to identify the most important news articles and predict price trends. Others adopt a two-step approach. First, they extract features (e.g. investor sentiment) from financial texts. Then they fuse these features with price information to make predictions such as (Li et al., 2017) and (Jin et al., 2020). This integration of text analysis with quantitative techniques holds promise for enhancing the accuracy and effectiveness of stock movement prediction models. + +# 2.3 Exploiting the Relations between Stocks + +Another important trading framework takes advantage of the correlations between different stocks. Portfolio selection, particularly pairs trading, is a well-known and successful trading strategy that exploits the correlated nature of stocks, whether positive or negative. In fact, as early as (Borodin et al., 2003) pointed out that stock correlations based portfolio selection could beat any strategy that relied on predicting trends or specific targets. + +The incorporation of correlations in stock movement prediction has gained attention in recent years, drawing inspiration from several existing works. For example, (Yoo et al., 2021) utilizes transformer to learn dynamic correlations between stocks in an end-to-end manner. (Long et al., 2020) employs knowledge graphs and graph embedding techniques to model the relationships between stocks. These studies have achieved admirable results, potentially due to effective feature engineering however, because the direct benefit of stock correlations in predicting future prices lacks fundamental logic. + +In this paper, we propose constructing a single model to handle both textual data and stock correlations simultaneously, aiming to shed light on the success of correlation-based approaches with the help of financial texts. We also introduce a novel causal attention mechanism to interpret the underlying logic behind stock correlations, leveraging transfer entropy to provide insights. We further model the multi-directional interactions between texts and correlations so that we could uncover not only relevant texts for prediction through correlations, but also the hidden stock correlations through texts. By integrating text data and stock correla + +tions within a unified model, we aim to provide a comprehensive understanding of the relationship between the two and discover valuable insights for stock movement prediction. + +# 3 Problem Formulation + +This paper is dedicated to predict the price movement of a target stock. To this end, we leverage both the correlations between stocks and textual information to make prediction. + +Consider a target stock with numerical features denoted as $P_{\mathrm{target}} \in \mathbb{R}^{k \times d}$ , where $k$ represents the number of time steps in the monitoring window and $d$ represents the dimension of price features, such as the highest and the closing prices. The prices of $n$ other relevant stocks are denoted as: $\mathcal{P} = \{P_1, P_2, \dots, P_n\} \in \mathbb{R}^{n \times k \times d}$ . + +Besides, we have financial documents associated with the target stock, which are represented as $\mathcal{M} = \{M_1,M_2,\dots ,M_k\} \in \mathbb{R}^{k\times l\times w}$ , where $l$ denotes the number of documents in a time step and $w$ is the maximum number of words in a document. In cases where a specific stock has fewer than $l$ documents at a given time step, zero padding values are added to align the lengths. Similarly, if a document contains fewer than $w$ words, zero padding is applied to ensure uniform length across all documents (Ang and Lim, 2022). + +We formulate the task as a binary classification problem whose goal is to predict the movement of the target stock at the next time step, denoted as $\hat{y}_{\mathrm{target}}$ . Here, $\hat{y}_{\mathrm{target}} = 1$ indicates a rise in the price while $\hat{y}_{\mathrm{target}} = 0$ indicates a fall. + +# 4 Proposed Method + +# 4.1 Model Overview + +Figure 1 presents an overview of the Causality-guided Multi-Memory Interaction Network (CMIN). It is consisted of three main modules: feature embedding module, multi-memory networks and multi-directional interaction module. + +(1) The feature embedding module includes two encoders, one for embedding the textual information and another for embedding the price time series. Additionally, a global causality matrix is introduced to capture the asymmetric correlations using transfer entropy, which then guides the calculation of attention weights in the multi-memory networks. +(2) The multi-memory networks consist of the Text Memory Network and Stock Correlation Memory Network, which are designed to select and re + +![](images/e7b5b6a747ca657489a1886c9a7c5e184c483764e5ffb3c25caad844db45bcca.jpg) +Figure 1: The structure of Causality-guided Multi-Memory Interaction Network (CMIN), which includes two encoders: Text Encoder and Price Encoder, a global causality matrix between stocks calculated by price history (changing as the monitoring window slides) and two memory networks: Text Memory Network and Stock Correlation Memory Network with multi-directional interactions between them. + +tain the most relevant and influential information (textual and correlational) for the target stock. + +(3) The multi-directional interaction module facilitates the interaction between the textual and correlational information. This interaction allows the two types of information to reinforce each other and leverage the advantages of different information flows for better prediction performance, enhancing the predictive capabilities of the CMIN. + +# 4.2 Feature Embedding + +Self-attention mechanisms have proven to be effective in capturing long-term dependencies and modeling complex sequential patterns, particularly in the Transformer architecture (Vaswani et al., 2017). Given the significance of historical information in financial documents and stock prices for stock price movement prediction, we employ attention mechanisms to summarize this information. + +# 4.2.1 Text Encoder + +The Text Encoder focuses on processing the financial documents $\mathcal{M}$ to extract meaningful representations for stock movement prediction. We firstly use a popular word representation tool Glove (Li et al., 2018) to generate the word embedding tensor $\mathcal{M}_{\mathrm{word}} \in \mathbb{R}^{k \times l \times w \times d_w}$ , where $d_w$ is the size of word embeddings. Each word in the financial documents is represented as a $d_w$ -dimensional vector. + +Then the word embeddings are passed through a text embedding layer. Here we adopt the bidirectional Gated Recurrent Unit (Bi-GRU) (Li et al., 2022) to capture both preceding and succeeding contexts within each document. The average of the last hidden vectors is taken as the text embeddings $\mathcal{M}_{\mathrm{text}} \in \mathbb{R}^{k \times l \times d_m}$ , or equivalently $\mathcal{M}_{\mathrm{text}} \in \mathbb{R}^{s \times d_m}$ , where $s$ is the total number of documents in the monitoring window. + +After that, the text attention mechanism is applied to summarize all historical documents across time steps. The text embedding of the last time step $\mathcal{M}_{\mathrm{text}, -1} \in \mathbb{R}^{l \times d_m}$ , serves as the query matrix, while the entire text embeddings $\mathcal{M}_{\mathrm{text}} \in \mathbb{R}^{s \times d_m}$ acts as both the key and value matrices. Soft scaled dot-product attention is used to compute the attention weights, which are then applied to the text embedding to obtain a representation $E_{\mathrm{text}} \in \mathbb{R}^{l \times d_m}$ enhanced by the history state attention: + +$$ +E _ {\text {t e x t}} = \operatorname {s o f t m a x} \left(\frac {\mathcal {M} _ {\text {t e x t} , - 1} \mathcal {M} _ {\text {t e x t}} ^ {T}}{\sqrt {d _ {m}}}\right) \mathcal {M} _ {\text {t e x t}}. \tag {1} +$$ + +The resulting $E_{\text{text}}$ is the textual embedding that contains highly concentrated information from the stock's related texts. This embedding serves as a summary of the historical text data and is used for further processing in the multi-memory networks and multi-directional interaction module of CMIN. + +# 4.2.2 Price Encoder + +The Price Encoder is introduced to utilize multivariate features from historical prices and capture their temporal interrelationships. Firstly we employ a feature mapping layer to project them into a latent space of dimension $d_p$ , aiming to improve the learning capacity (Yoo et al., 2021). For target stock price $P_{\mathrm{target}} \in \mathbb{R}^{k \times d}$ , the historical price embeddings $\tilde{P}_{\mathrm{target}} \in \mathbb{R}^{k \times d_p}$ can be formulated as: + +$$ +\tilde {P} _ {\text {t a r g e t}} = \operatorname {R e L U} \left(P _ {\text {t a r g e t}} W _ {t} + b _ {t}\right), \tag {2} +$$ + +where $W_{t}\in \mathbb{R}^{d\times d_{p}}$ , $b_{t}\in \mathbb{R}^{d_{p}}$ are parameters. + +Moreover, recognizing that historical patterns can repeat themselves sometimes, we incorporate a multi-head price attention layer to capture each stock's distinctive changing patterns. The price embedding of the target stock at the last time step is donated as $\tilde{\mathcal{P}}_{\mathrm{target}}^{-1}\in \mathbb{R}^{d_p}$ . Then we employ the multi-head attention mechanism with the query $\tilde{\mathcal{P}}_{\mathrm{target}}^{-1}$ and the key/value $\tilde{\mathcal{P}}_{\mathrm{target}}$ as follows: + +$$ +v _ {\text {t a r g e t}} = \text {M u l t i h e a d A t t} \left(\tilde {\mathcal {P}} _ {\text {t a r g e t}}, \tilde {\mathcal {P}} _ {\text {t a r g e t}} ^ {- 1}\right) \tag {3} +$$ + +$v_{\mathrm{target}}$ is a key vector that serves as the initial hidden state for the two memory networks, playing a crucial role in the final prediction. Similarly, we process the remaining stocks and obtain the correlational embedding $E_{\mathrm{corr}} \in \mathbb{R}^{n \times d_p}$ . Notably, the shared parameters across all stocks ensure the stability and generality of the extracted features (Wang et al., 2019a). + +# 4.2.3 Causality Matrix + +When it comes to detecting causal relationships and conducting predictive analysis, transfer entropy, a non-linear generalization of Granger causality (Seth, 2007), serves as a conceptually neat and mathematically rigorous method. It has been considered as an important tool for causality analysis and successfully applied in diverse domains including financial markets (Sandoval Junior et al., 2015). + +Transfer entropy is derived from Shannon Entropy: $H = -\sum_{i=1}^{N} p_i \log p_i$ . In this context, considering the time series of a stock, we can partition the possible values into different bins and calculate the probabilities at each time step. Transfer entropy from series X to another series Y can be defined as the average amount of information contained in the source X but not contained in Y's past: + +$$ +\begin{array}{l} T E _ {X \rightarrow Y} = H \left(Y _ {\text {f u t u r e}} \mid Y _ {\text {p a s t}}\right) \tag {4} \\ - H \left(Y _ {\text {f u t u r e}} \mid X _ {\text {p a s t}}, Y _ {\text {p a s t}}\right) \\ \end{array} +$$ + +Based on this principle, for each monitoring window, we calculate the transfer entropy between all stocks using their historical closing prices and generate a transfer entropy matrix, referred to as the Causality Matrix $C \in \mathbb{R}^{n \times n}$ , which illustrates the asymmetric flow of information from one stock to another. Specifically, $C[i,j]$ represents the transfer entropy from stock $i$ to stock $j$ , and $C[i,j] > C[j,i]$ indicates that stock $i$ provides more predictive information about the movement of stock $j$ than $j$ to $i$ . This Causality Matrix will next serve as a guide for the memory networks, enabling the identification of causal dependencies between multivariate stocks. + +# 4.3 Multi-memory Networks + +We introduce a Text Memory Network and a Stock Correlation Memory Network (Sukhbaatar et al., 2015) to manage the textual and correlational information separately. They each maintain a continuous representation and update it iteratively using multiple computational steps (hops), ultimately producing a global memory abstraction. + +As shown in Figure 1, each layer of the memory network comprises an attention unit and a GRU unit, which receive textual or correlational embeddings as inputs and are supervised by the continuous representation generated in the previous layer. To initialize the continuous representations of each network, we use the target stock vector $v_{\mathrm{target}}$ (generated from Eq.3): + +$$ +v _ {\text {t e x t}} ^ {(0)} = v _ {\text {c o r r}} ^ {(0)} = v _ {\text {t a r g e t}}. \tag {5} +$$ + +# 4.3.1 Text Memory Network + +In each layer $h \in [1, H]$ of the Text Memory Network, we input the textual embeddings $E_{\mathrm{text}}$ (Eq.1) and the continuous representation from the previous layer $v_{\mathrm{text}}^{(h-1)}$ . We utilize an attention unit (Eq.3) to identify important information within the textual embeddings. Subsequently, a non-linear GRU cell unit (Xu et al., 2019) acts as an information aggregator, determining the amount of text information to retain: + +$$ +v _ {\text {t e x t}} ^ {\operatorname {A t t} (h)} = \operatorname {M u l t i h e a d A t t} \left(E _ {\text {t e x t}}, v _ {\text {t e x t}} ^ {(h - 1)}\right), \tag {6} +$$ + +where $v_{\mathrm{text}}^{(h - 1)}$ is the query matrix and $E_{\mathrm{text}}$ represents the raw form of the key and value matrices. + +Then the GRU cell unit updates the current hidden state into the next hidden state and outputs it to the next layer as the new continuous representation: + +$$ +v _ {\text {t e x t}} ^ {(h)} = G R U \left(v _ {\text {t e x t}} ^ {\text {A t t} (h)}, v _ {\text {t e x t}} ^ {(h - 1)}\right). \tag {7} +$$ + +# 4.3.2 Stock Correlation Memory Network + +The Stock Correlation Memory Network is employed to dynamically identify stock relationships and update the continuous representation of stock correlations in an intuitive and asymmetric manner. + +However, the use of unsupervised attention weights in previous models can be problematic as they may be inevitably misled by the dataset bias, resulting in excessive attention on spurious stock correlations. To address this, we introduce extra knowledge in the form of Transfer Entropy-based causality to guide the attention weights and mitigate potential confounding effects. + +For each target stock, we extract a causal vector $v_{\text{causal}} = C(:, \text{target}]$ from the pre-calculated causality matrix, which quantifies the degree of information flow from other stocks to it. Then we modify the traditional attention mechanism into Causal Attention by incorporating causal guidance: + +$$ +\mathcal {S} = \operatorname {s o f t m a x} \left(\frac {\mathcal {Q K} ^ {T}}{\sqrt {d}}\right), \quad \tilde {\mathcal {S}} = f (\mathcal {S}, v _ {\text {c a u s a l}}). \tag {8} +$$ + +Here, $f$ is a function that aggregates the attention weight $S$ and the causal vector $v_{\text{causal}}$ to produce a causality-guided attention weight $\tilde{S}$ . We use the average aggregation method for simplicity (i.e., $f(S, v_{\text{causal}}) = (S + v_{\text{causal}})/2$ ). To better balance them, one can introduce a hyperparameter $\lambda \in [0,1]$ . Then $f()$ updates to $f(S, v_{\text{causal}}) = \lambda S + (1 - \lambda)v_{\text{causal}}$ . We believe that different degrees of causal attention can impact the model's performance, and leave it for future exploration. + +The continuous representation is gradually updated through the Causal Attention, indicating the influence of causal relationships on movement prediction and the self-influence on the flow of correlation information: + +$$ +v _ {\text {c o r r}} ^ {\text {A t t} (h)} = \text {C a u s a l A t t} \left(E _ {\text {c o r r}}, v _ {\text {c o r r}} ^ {(h - 1)}\right) \tag {9} +$$ + +$$ +v _ {\text {c o r r}} ^ {(h)} = G R U \left(v _ {\text {c o r r}} ^ {\text {A t t} (h)}, v _ {\text {c o r r}} ^ {(h - 1)}\right) \tag {10} +$$ + +It is important to note that although we design multiple layers within each memory network to learn deep representations, different layers of the same memory network share the same unit. This enables the network to focus on crucial information that affects the movement of the target stock, thereby enhancing the continuous representation. + +# 4.4 Multi-directional Interactions + +In reality, textual information and correlations have an impact on each other when it comes to stock + +price movement prediction. For instance, news about a technological breakthrough in the new energy sector may uplift the prices of most stocks in that industry, thereby affecting the correlations among those stocks. + +To simulate this phenomenon and enhance the synergy between textual and correlational information, we introduce a multi-directional interaction module. This module allows textual and correlational information to reinforce each other and amplify the advantages of different information flows for better prediction performance. + +Take the Text Memory Network as an example, in each layer we firstly calculate the self-influence by using $v_{\mathrm{text}}^{(h - 1)}$ as the query: + +$$ +v _ {\text {t e x t} \rightarrow \text {t e x t}} ^ {\text {A t t} (h)} = \text {M u l t i h e a d A t t} \left(E _ {\text {t e x t}}, v _ {\text {t e x t}} ^ {(h - 1)}\right) \tag {11} +$$ + +Next we consider the interactive influences from correlations to texts using $v_{\mathrm{corr}}^{(h - 1)}$ as the query: + +$$ +v _ {\text {c o r r} - > \text {t e x t}} ^ {\text {A t t} (h)} = \text {M u l t i h e a d A t t} \left(E _ {\text {t e x t}}, v _ {\text {c o r r}} ^ {(h - 1)}\right) \tag {12} +$$ + +Finally, we produce a new attentional continuous representation by averaging these two influences: + +$$ +v _ {\text {t e x t}} ^ {\text {A t t} (h)} = \frac {v _ {\text {t e x t} - > \text {t e x t}} ^ {\text {A t t} (h)} + v _ {\text {c o r r} - > \text {t e x t}} ^ {\text {A t t} (h)}}{2}, \tag {13} +$$ + +which means that we replace Eqs. 6 with Eqs. 11-13 to obtain the new attention-aggregated vector. + +The workings of Stock Correlation Memory Network are quite similar. + +Consequently, the fusion of different information flows is promoted due to the multi-directional interaction mechanism in which CMIN learns not only the influences from text/correlation to movement prediction within each information flow but also the interactive influences between different information flows, representing the interrelationship between text and correlations. + +# 4.5 Learning Objective + +With the continuous representations $v_{\mathrm{text}}^{(H)}$ and $v_{\mathrm{corr}}^{(H)}$ from the last layer of each memory network, along with the target stock representation $v_{\mathrm{target}}$ , we concatenate them and apply a softmax function to generate the final prediction vector $\hat{y}$ : + +$$ +\hat {y} = \operatorname {s o f t m a x} \left(W _ {y} \left[ v _ {\text {t e x t}} ^ {(H)}, v _ {\text {t a r g e t}}, v _ {\text {c o r r}} ^ {(H)} \right] + b _ {y}\right). \tag {14} +$$ + +The objective is to minimize the cross entropy loss: + +$$ +\mathcal {L} (y, \hat {y}) = - \sum_ {i = 1} ^ {\mathrm {n}} \left(y _ {i} \log \left(\hat {y} _ {i}\right) + \left(1 - y _ {i}\right) \log \left(1 - \hat {y} _ {i}\right)\right) \tag {15} +$$ + +where $n$ is the size of the training set. + +# 5 Experiments + +In this section, we empirically evaluate our CMIN model with three real-world datasets collected from the U.S. and Chinese stock markets. + +# 5.1 Experimental Settings + +# 5.1.1 Datasets + +In our experiments we have used three datasets, namely ACL18, CMIN-US and CMIN-CN, spanning different time periods to evaluate our proposed model CMIN against other baselines. + +ACL18 (Xu and Cohen, 2018) is a classic dataset with tweets from Twitter as financial texts in the task of text-enhanced stock movement prediction. As there are few existing high-quality datasets containing both texts and price, we are also making available two new benchmark datasets along with this paper from 2018-01-01 to 2021-12-31 in the U.S. and Chinese market named CMIN-US and CMIN-CN. These two datasets are available at https://github.com/BigRoddy/ CMIN-Dataset to facilitate further research and enable reproducibility. More details and statistics of those three datasets are in Appendix A. + +# 5.1.2 Baselines + +We compare CMIN against the following four baselines, all of which are high-performing stock movement prediction models proposed by recent studies: + +- ALSTM(Qin et al., 2017) is a dual-stage attention-based recurrent neural network, which selects relevant time series across all time steps. +- Adv-LSTM(Feng et al., 2019) uses adversarial training to improve the generalization of ALSTM. +- Stocknet(Xu and Cohen, 2018) introduces recurrent continuous latent variables and uses variational inference to address the posterior inference. +- DTML(Yoo et al., 2021) is a newly published attention-based model that exploits the correlations between stocks to improve the prediction accuracy. + +# 5.1.3 Evaluation metrics + +As we have formulated stock price movement prediction as a classification problem, we choose two classic metrics: Accuracy (Acc.) and Matthews Correlation Coefficient (MCC), similar to the previous work (Xu and Cohen, 2018; Yoo et al., 2021). + +$$ +A c c. = \frac {t p + t n}{t p + t n + f p + g n} \tag {16} +$$ + +$$ +M C C = \frac {t p \times t n - f p \times t n}{\sqrt {(t p + f p) (f n + t p) (f n + t n) (f p + t n)}} \tag {17} +$$ + +
ModelsACL18CMIN-USCMIN-CN
Acc.MCCAcc.MCCAcc.MCC
ALSTM51.810.03251.640.00653.350.023
Adv-LSTM52.750.05251.730.01253.490.025
Stocknet58.230.08152.460.02254.530.045
DTML57.440.19152.060.03154.420.083
CMIN62.690.20953.430.04655.280.111
+ +Table 1: A comparison of prediction accuracy between CMIN and other baselines on three different datasets, where CMIN achieves state-of-the-art performance across both Acc. and MCC metrics. + +# 5.1.4 Implementation details + +We set our model for daily price prediction, with a history market window size $k = 5$ and the number of price features $d_{p} = d = 3$ , namely the highest, the lowest and the closing prices. We limit the maximum number of financial texts in one single day to be $l = 20$ , and the maximum length of a text document $w = 30$ . Within the Text Encoder, we set the size of word embedding vector $d_{w} = 50$ and the hidden state of Bi-GRU network $d_{m} = 50$ . + +We implement the CMIN with Pytorch on a NVIDIA Tesla V100 and train it with an Adam optimizer (Kingma and Ba, 2015). All parameters of our model are initialized with Xavier Initialization (Glorot and Bengio, 2010). We search the hyperparameters of CMIN as follows: number of layers of each memory network $H$ in $\{1,2,3,4,5\}$ , dropout rate in $\{0.1,0.2,0.3\}$ , number of epochs in $\{10,20,50\}$ , and size of the price hidden state $d_p$ in $\{3,10,50\}$ . For baselines, we use their default parameters and fine-tune them to fit our data. + +# 5.2 Performance Analysis + +The results are summarized in Table 1. + +Among all models, ALSTM and Adv-LSTM performed poorly with little improvement over random prediction. This could be attributed to the fact that these models rely solely on stock prices as the basis for decision-making. The Stocknet and DTML incorporate additional information beyond stock prices, demonstrated significant improvements over ALSTM and Adv-LSTM, which highlights the importance of utilizing financial texts and stock correlations for this challenging task. CMIN outperformed all baselines and achieved state-of-the-art performance on both two metrics across all datasets, showing its excellent capabilities to leverage both financial texts and stock correlations, as well as capture their interrelationship. + +
ModelsACL18CMIN-US
Acc.MCCAcc.MCC
CMIN-TE52.880.039450.960.0134
CMIN-PR57.830.049852.550.0162
CMIN-CM54.760.147452.980.0279
CMIN-MI60.220.153553.380.0380
CMIN62.690.209053.430.0460
+ +Table 2: Performance of CMIN variants on ACL18 and CMIN-US datasets, showing every component makes an important contribution to the excellent performance. + +# 5.3 Ablation Studies + +To evaluate the contribution of CMIN's different components, we compare against several variants: + +- CMIN-TE: CMIN without the Text (TE), which makes decisions just based on stock prices. +- CMIN-PR: CMIN without the Price (PR), which makes decisions just based on related texts. +- CMIN-CM: CMIN without the guide of causality matrix (CM). +- CMIN-MI: CMIN without multi-directional interactions (MI) between memory networks. + +The results are summarized in Table 2. CMIN-TE only achieves a level of prediction accuracy on par with ALSTM and Adv-LSTM, and is worst among all the variants, again indicating the importance of text data. Similar to the performance of Stocknet, CMIN-PR has a relatively high Acc. but a low MCC, suggesting texts are particularly helpful to predict on one side of the binary classification. By modeling both text data and stock relationships, CMIN-CM reaches a good result. Finally, better performance achieved when causality matrix and multi-directional interactions are introduced into the network. Overall, the ablation studies show that every component makes an important contribution to CMIN, and as a result the full model with all components achieves the best performance. + +# 5.4 Analysis of Memory Network Depth + +As introduced before, we propose two memory networks to retain vital features of texts and correlations with multiple computational layers. And we want to understand what would be the ideal number of depths to achieve the best prediction results. + +We change the number of layers $H$ of each memory network to find out how the performance fluctuates with it. The results are summarized in Figure 2. When we only have one memory layer, there is no multi-directional information flows between the two memory networks and as a result they only try + +![](images/05f61a1bd93bf5d521ffe660470fbc1f6119f084f41e53cb352534c49d6f080b.jpg) +Figure 2: Performance of CMIN with a different number of memory network layers $H$ on ACL18. CMIN achieves its best performance with 3 memory layers. + +to identify the vital information in the embeddings related to or having an impact on the movement of the target stock under the supervision of $v_{\text{target}}$ . As the number of memory layers increases, the interactions between two memory networks also intensifies. It is intuitive that the performance of CMIN reaches its peak when it has three memory layers. With further increase the number of memory layers, CMIN is prone to overfit. + +# 5.5 Case Study + +Here we present an example to illustrate how CMIN considers both financial texts and stock correlations to avoid random noises in time series. + +We visualized the causality matrix of ACL18 using a heat map as shown in Figure 3. Stocks are sequenced by their industry sector. The black box on the left shows weak causality, representing weak information flow from Utilities to Materials. On the other hand, the yellow box on the right indicates the relative strong information flow from Materials to Finance and within the Finance industry. + +The target stock is Bank Of America (BAC) with a monitor window spanning from 13/11/2015 to 19/11/2015. We employ CMIN to predict BAC's next movement direction on the day of 20/11/2015 and then output the attention scores of texts and causality-guided correlation. The most focused stock by CMIN is Berkshire Hathaway Inc. (BRKA). It's interesting to note that both are in the same industry sector: Finance, and they do appear to follow a very similar movement pattern in the trading days leading to 20/11/2015, which demonstrates the ability of CMIN to find the dynamic stock correlations with the guidance of Causality Matrix. + +The financial text of BAC that obtains the highest attention score is "Beer, Credit Card Debt And + +![](images/5e59c8b13ef324000caabaac555c8e835ab885881edc9cc5afd30e531ebb2de6.jpg) +Figure 3: Visualization of partial causal matrix (covering three industries) for ACL18. Each entry in the matrix represents the transfer entropy between two stocks and the redder the square, the stronger the causality. + +Other Positives For Bank Of America", the title of an news article1 which reports the rapidly-improving banking landscape in the U.S.. This text is clearly highly relevant to BAC's subsequent stock performance, which demonstrates that CMIN is able to identify highly relevant texts having a impact on the target stock movement. + +Furthermore, it also illustrates the underlying interrelationship between financial texts and stock correlations. Except expressing an optimistic sentiment towards BAC, the news also shows a rapidly improving state of affairs for the wider financial industry. Therefore, through the Multi-directional Interactions mechanism, the text strengthens the model's attention to stocks in the same sector. These two aspects mutually reinforce and complement each other to help the model make the best judgment that BAC's stock price will rise on the next day. + +# 6 Conclusions + +In this paper, we proposed CMIN, a causality-guided multi-memory interaction network that simultaneously models financial documents, causality-enhanced stock correlations and the interactions between the two, and recurrently learns a global memory representation for movement prediction. This multi-modality network was designed to enable the concurrent discovery of texts and stock correlations relevant to future price change and we demonstrated, through experiments on three datasets across two distinct markets, that each component of the proposed architecture made significant contributions to the model, leading CMIN to achieve state-of-the-art accuracy. + +# Limitations + +We discuss the limitations of our model as follows: + +1. Due to the natural uncertainty of financial forecast, although we have taken many methods to improve the generalization performance of the model (such as limiting the depth of memory layers and with the assistance of auxiliary data), creating a trustworthy application requires considering many other factors beyond the algorithmic level. We advise that users monitor the model's performance over time and regularly update it to adapt to ever-changing market conditions. +2. This paper uses Granger causality based on transfer entropy to make a preliminary attempt to introduce causality between time series to model the similarity between stocks more accurately. But this description is junior and classical, and there are lots of more modern methods to measure precise causality in mathematics (like PC algorithm), which we believe would further improve the performance. +3. We only experiment the performance of model on the task of binary classification, leaving more complex tasks (such as regression task and returns prediction) and simulating actual investment to evaluate the capability and potential of the model comprehensively. + +# Acknowledgements + +We would like to express our sincere gratitude to the reviewers for their valuable efforts and insightful contributions. This work was supported by National Natural Science Foundation of China (NSFC Grant No. 62122089), Beijing Outstanding Young Scientist Program NO. BJWZYJH012019100020098, and Intelligent Social Governance Platform, Major Innovation & Planning Interdisciplinary Platform for the "Double-First Class" Initiative, Renmin University of China. Rui Yan is the corresponding author. + +# References + +Gary Ang and Ee-Peng Lim. 2022. Guided attention multimodal multitask financial forecasting with intercompany relationships and global and local news. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 6313-6326. + +Kunal Bhardwaj. 2021. Convolutional neural network(cnn/convnet) in stock price movement prediction. CoRR, abs/2106.01920. +Allan Borodin, Ran El-Yaniv, and Vincent Gogan. 2003. Can we learn to beat the best stock. In Advances in Neural Information Processing Systems, volume 16. MIT Press. +Fuli Feng, Huimin Chen, Xiangnan He, Ji Ding, Maosong Sun, and Tat-Seng Chua. 2019. Enhancing stock movement prediction with adversarial training. In Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence, IJCAI-19, pages 5843-5849. International Joint Conferences on Artificial Intelligence Organization. +Fernando G. D. C. Ferreira, Amir H. Gandomi, and Rodrigo T. N. Cardoso. 2021. Artificial intelligence applied to stock market trading: A review. IEEE Access, 9:30898-30917. +Xavier Glorot and Yoshua Bengio. 2010. Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, volume 9 of Proceedings of Machine Learning Research, pages 249-256, Chia Laguna Resort, Sardinia, Italy. PMLR. +Hakan Gunduz. 2021. An efficient stock market prediction model using hybrid feature reduction method based on variational autoencoders and recursive feature elimination. *Financial Innovation*, 7(1):1-24. +Ziniu Hu, Weiqing Liu, Jiang Bian, Xuanzhe Liu, and Tie-Yan Liu. 2018. Listening to chaotic whispers: A deep learning framework for news-oriented stock trend prediction. In Proceedings of the Eleventh ACM International Conference on Web Search and Data Mining, WSDM '18, page 261-269, New York, NY, USA. Association for Computing Machinery. +Zhigang Jin, Yang Yang, and Yuhong Liu. 2020. Stock closing price prediction based on sentiment analysis and LSTM. Neural Computing and Applications, 32:9713-9729. +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. +Jiahong Li, Hui Bu, and Junjie Wu. 2017. Sentiment-aware stock market prediction: A deep learning method. In 2017 International Conference on Service Systems and Service Management, pages 1-6. IEEE. +Shen Li, Zhe Zhao, Renfen Hu, Wensi Li, Tao Liu, and Xiaoyong Du. 2018. Analogical reasoning on Chinese morphological and semantic relations. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 138-143, Melbourne, Australia. Association for Computational Linguistics. + +Xuechen Li, Xinfang Ma, Fengchao Xiao, Cong Xiao, Fei Wang, and Shicheng Zhang. 2022. Time-series production forecasting method based on the integration of bidirectional gated recurrent unit (bi-gru) network and sparrow search algorithm (ssa). Journal of Petroleum Science and Engineering, 208:109309. +Jiawei Long, Zhaopeng Chen, Weibing He, Taiyu Wu, and Jiangtao Ren. 2020. An integrated framework of deep learning and knowledge graph for prediction of stock price trend: An application in chinese stock exchange market. Applied Soft Computing, 91:106205. +David M. Q. Nelson, Adriano C. M. Pereira, and Renato A. de Oliveira. 2017. Stock market's price movement prediction with LSTM neural networks. In 2017 International Joint Conference on Neural Networks (IJCNN), pages 1419-1426. IEEE. +Yao Qin, Dongjin Song, Haifeng Chen, Wei Cheng, Guofei Jiang, and Garrison W. Cottrell. 2017. A dual-stage attention-based recurrent neural network for time series prediction. In Proceedings of the Twenty-Sixth International Joint Conference on Artificial Intelligence, IJCAI-17, pages 2627-2633. +Leonidas Sandoval Junior, Asher Mullokandov, and Dror Y Kenett. 2015. Dependency relations among international stock market indices. Journal of Risk and Financial Management, 8(2):227-265. +Anil Seth. 2007. Granger causality. *Scholarpedia*, 2(7):1667. +Omer Berat Sezer and Ahmet Murat Özbayoglu. 2020. Financial trading model with stock bar chart image time series with deep convolutional neural networks. Intelligent Automation and Soft Computing, 26. +Catalin Stoean, Wiesław Paja, and Ruxandra Stoean. 2019. Deep architectures for long-term stock price prediction with a heuristic-based strategy for trading simulations. *PloS one*, 14(10):e0223593. +Sainbayar Sukhbaatar, arthur szlam, Jason Weston, and Rob Fergus. 2015. End-to-end memory networks. In Advances in Neural Information Processing Systems, volume 28. Curran Associates, Inc. +Ning Tang, Yanyan Shen, and Junjie Yao. 2020. Learning to fuse multiple semantic aspects from rich texts for stock price prediction. In *Web Information Systems Engineering – WISE* 2019: 20th International Conference, Hong Kong, China, January 19–22, 2020, Proceedings, page 65–81, Berlin, Heidelberg. Springer-Verlag. +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. +Jingyuan Wang, Yang Zhang, Ke Tang, Junjie Wu, and Zhang Xiong. 2019a. Alphastock: A buying-winners-and-selling-losers investment strategy using + +
DatasetCountryStocksData ResourcesData Range
PriceTextTrainDevelopmentTest
ACL18US87Yahoo FinanceTwitter2014-01-01 to 2014-12-312015-01-01 to 2015-10-012015-10-01 to 2015-12-31
CMIN-USUS110Yahoo FinanceYahoo2018-01-01 to 2021-04-302021-05-01 to 2021-08-312021-09-01 to 2021-12-31
CMIN-CNChina300Wind
+ +Table 3: Summary stats on experiment datasets. CMIN-US and CMIN-CN are two new benchmark datasets we are making available alongside this paper. + +interpretable deep reinforcement attention networks. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD '19, page 1900-1908, New York, NY, USA. Association for Computing Machinery. + +Yaowei Wang, Qing Li, Zhexue Huang, and Junjie Li. 2019b. Ean: Event attention network for stock price trend prediction based on sentimental embedding. In Proceedings of the 10th ACM Conference on Web Science, WebSci '19, page 311-320, New York, NY, USA. Association for Computing Machinery. + +Nan Xu, Wenji Mao, and Guandan Chen. 2019. Multi-interactive memory network for aspect based multimodal sentiment analysis. Proceedings of the AAAI Conference on Artificial Intelligence, 33(01):371-378. + +Yumo Xu and Shay B. Cohen. 2018. Stock movement prediction from tweets and historical prices. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics, pages 1970-1979, Melbourne, Australia. Association for Computational Linguistics. + +Jaemin Yoo, Yejun Soun, Yong-chan Park, and U Kang. 2021. Accurate multivariate stock movement prediction via data-axis transformer with multi-level contexts. In Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining, KDD '21, page 2037-2045, New York, NY, USA. Association for Computing Machinery. + +Liheng Zhang, Charu Aggarwal, and Guo-Jun Qi. 2017. Stock price prediction via discovering multifrequency trading patterns. In Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD '17, page 2141-2149, New York, NY, USA. Association for Computing Machinery. + +# A Dataset Details + +The statistics of datasets are summarized in Table 3. + +ACL18 (Xu and Cohen, 2018) consists of 87 stocks of 9 industries from the U.S. stock market. It also includes two types of data: tweets from Twitter and historical stock prices from Yahoo finance. We have processed in the same way as described in (Xu and Cohen, 2018). + +As there are few existing high-quality datasets containing both texts and prices, we are also making available two new benchmark datasets along with this paper from 2018-01-01 to 2021-12-31: CMIN-US includes the top 110 stocks from US by market capitalisation; CMIN-CN consists of all 300 constituents of CSI300, a major Chinese stock market index. Similar to ACL18, both CMIN-US and CMIN-CN include financial texts as well as historical stock prices data. The historical price data in both datasets comes from Yahoo Finance. The text data of CMIN-US is collected from Yahoo finance $^{2}$ and CMIN-CN from Wind $^{3}$ . In our experiments, we have used news headlines instead of the entire texts for efficiency and noise reduction. + +A For every submission: + +A1. Did you describe the limitations of your work? the last section +A2. Did you discuss any potential risks of your work? the last section +A3. Do the abstract and introduction summarize the paper's main claims? the first section +A4. Have you used AI writing assistants when working on this paper? Left blank. + +B Did you use or create scientific artifacts? + +Section 5 + +B1. Did you cite the creators of artifacts you used? Section 5.1 +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? Not applicable. Left blank. +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? Section 5.1 +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? Not applicable. Left blank. +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? Section 5.1 +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. Section 5.1.1 and Appendix A + +C Did you run computational experiments? + +Section 5 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? Section 5.1.4 + +The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +Section 5.1.4 + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +Section 5.2 + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +Section 5.1 + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +Not applicable. Left blank. + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +Not applicable. Left blank. + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +Not applicable. Left blank. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +Not applicable. Left blank. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +Not applicable. Left blank. \ No newline at end of file diff --git a/causalityguidedmultimemoryinteractionnetworkformultivariatestockpricemovementprediction/images.zip b/causalityguidedmultimemoryinteractionnetworkformultivariatestockpricemovementprediction/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..8840cf8e7cddfb92f787feb528dd17c21ba0c5a6 --- /dev/null +++ b/causalityguidedmultimemoryinteractionnetworkformultivariatestockpricemovementprediction/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b6e62f35b6b38ce32951eb6875c14778db29f71779a4d874d089b631dafea123 +size 336571 diff --git a/causalityguidedmultimemoryinteractionnetworkformultivariatestockpricemovementprediction/layout.json b/causalityguidedmultimemoryinteractionnetworkformultivariatestockpricemovementprediction/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..e6c4e1b562360fbac1f30c48ced141a8e512f357 --- /dev/null +++ b/causalityguidedmultimemoryinteractionnetworkformultivariatestockpricemovementprediction/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9343b229042544adcb61b415ca351ad1d2636637a1e65a62d72e9ec40ee8731b +size 452417 diff --git a/causesandcuresforinterferenceinmultilingualtranslation/4948b14e-df5d-4fc3-a55d-928a2554ae8f_content_list.json b/causesandcuresforinterferenceinmultilingualtranslation/4948b14e-df5d-4fc3-a55d-928a2554ae8f_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..ac11ac3ba5e1c7663b4673ffd5f22cf0d61e6f05 --- /dev/null +++ b/causesandcuresforinterferenceinmultilingualtranslation/4948b14e-df5d-4fc3-a55d-928a2554ae8f_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d37ad6d8adf98cb6253ecec924137035e6a1cc7323a2072102b06d48d53975df +size 92643 diff --git a/causesandcuresforinterferenceinmultilingualtranslation/4948b14e-df5d-4fc3-a55d-928a2554ae8f_model.json b/causesandcuresforinterferenceinmultilingualtranslation/4948b14e-df5d-4fc3-a55d-928a2554ae8f_model.json new file mode 100644 index 0000000000000000000000000000000000000000..2cda81722bb733aeaa9e2c0837059930a46b561e --- /dev/null +++ b/causesandcuresforinterferenceinmultilingualtranslation/4948b14e-df5d-4fc3-a55d-928a2554ae8f_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:705c4ef4fed7630f75dcf261154bea8882dae733aeb21c780bcf80cf68ae0fd4 +size 112838 diff --git a/causesandcuresforinterferenceinmultilingualtranslation/4948b14e-df5d-4fc3-a55d-928a2554ae8f_origin.pdf b/causesandcuresforinterferenceinmultilingualtranslation/4948b14e-df5d-4fc3-a55d-928a2554ae8f_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9a6be9dd8c8a62186895da9444caf8c202a4de80 --- /dev/null +++ b/causesandcuresforinterferenceinmultilingualtranslation/4948b14e-df5d-4fc3-a55d-928a2554ae8f_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ad057df70c279547354b6b45b6f4dc554e343b33d1cf48522fae57064ada7b6 +size 553786 diff --git a/causesandcuresforinterferenceinmultilingualtranslation/full.md b/causesandcuresforinterferenceinmultilingualtranslation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..71671235da8e5fd66fec7bc80749c77a0237c4e5 --- /dev/null +++ b/causesandcuresforinterferenceinmultilingualtranslation/full.md @@ -0,0 +1,369 @@ +# Causes and Cures for Interference in Multilingual Translation + +Uri Shaham $^{\tau}$ Maha Elbayad $^{\mu}$ Vedanuj Goswami $^{\mu}$ + +Omer Levy $^{\tau \mu}$ Shruti Bhosale $^{\mu}$ + +$^{\tau}$ The Blavatnik School of Computer Science, Tel Aviv University + +$\mu$ Meta AI + +# Abstract + +Multilingual machine translation models can benefit from synergy between different language pairs, but also suffer from interference. While there is a growing number of sophisticated methods that aim to eliminate interference, our understanding of interference as a phenomenon is still limited. This work identifies the main factors that contribute to interference in multilingual machine translation. Through systematic experimentation, we find that interference (or synergy) are primarily determined by model size, data size, and the proportion of each language pair within the total dataset. We observe that substantial interference occurs mainly when the model is very small with respect to the available training data, and that using standard transformer configurations with less than one billion parameters largely alleviates interference and promotes synergy. Moreover, we show that tuning the sampling temperature to control the proportion of each language pair in the data is key to balancing the amount of interference between low and high resource language pairs effectively, and can lead to superior performance overall. + +# 1 Introduction + +Multilingual machine translation models can benefit from transfer between different language pairs (synergy), but may also suffer from interference (Ha et al., 2016; Firat et al., 2016; Aharoni et al., 2019; Arivazhagan et al., 2019). While there are methods to reduce interference and achieve better performance (Wang et al., 2020a; Kreutzer et al., 2021; Wang et al., 2021), such approaches are often compute intensive, and do not always work (Xin et al., 2022). In this work, we demonstrate that interference in multilingual translation largely occurs when the model is very small compared to the abundance of training data, and that the simple principled approach of enlarging the model and tuning the data sampling temperature provides a + +consistent solution to the interference problem that can even promote synergy. + +This work methodically deduces the most simple ways of reducing interference in multilingual translation. We begin by inquiring what are the dominant factors that may interfere with learning to translate a particular language pair of focus $s \rightarrow t$ , in the context of learning a multilingual translation model with many different language pairs. Controlled experiments show that besides model size and number of $s \rightarrow t$ training examples, the main factor that correlates with the level of interference is the proportion of focus pair examples ( $s \rightarrow t$ ) observed out of the total number of examples (all language pairs) seen at each training step on average. Surprisingly, aspects like language similarity or number of translation directions have a much smaller effect. + +In model and data scaling experiments, we observe that interference mainly occurs in extreme parameter poverty, when the language pair of focus is data-rich, but has to "share" a crowded parameter space with large quantities of other data. Enlarging the model to standard model sizes in machine translation literature alleviates interference and even facilitates synergy. For context, given a language pair of 15M sentence pairs that accounts for $20\%$ of the total training data (75M), we observe severe levels of interference with 11M- and 44M-parameter transformers, but no interference when scaling the model to 176M parameters (the "big" model of Vaswani et al. (2017)) and significant synergy with 705M parameters. Interestingly, when the model is large enough, we find that increasing the amount of non-focus data to a certain point can further increase synergy. + +Finally, given the evidence that data sizes and ratios strongly correlate with interference, we experiment with a natural lever that controls the proportion of each dataset in the overall mix in the simplest way: sampling temperature. Indeed, we + +find that calibrating the distribution of language pairs via temperature can substantially reduce the amount of interference in both high- and low-resource language pairs. Our results demonstrate the importance of tuning the temperature hyperparameter in multitask training, and suggest that previously reported accounts of severe interference in multilingual translation models might stem from suboptimal hyperparameter configurations. + +# 2 Measuring Interference + +We assume a common multilingual translation setup that involves $L$ language pairs $s \rightarrow t$ , where the source is always the same language $s$ (English), and the target language $t$ varies (English-to-many), or vice versa (many-to-English). The overall training data is a union of these training subsets, we note their sizes by $D_{s \rightarrow t}$ . Sampling a training example $x$ follows the distribution: + +$$ +P (x \in s \rightarrow t) \propto \left(\frac {D _ {s \rightarrow t}}{\sum_ {s ^ {\prime} , t ^ {\prime}} D _ {s ^ {\prime} \rightarrow t ^ {\prime}}}\right) ^ {\frac {1}{T}} \tag {1} +$$ + +Where $T$ is the temperature hyperparameter (Devlin et al., 2019; Arivazhagan et al., 2019). $T = 1$ maintains the original data proportions, $0 < T < 1$ starves low resource language pairs, and $T > 1$ increases their representation in the training distribution. We mostly focus on the English-to-many setting in which interference is more apparent. $^{1}$ + +We define interference as a negative interaction between different translation directions in a multilingual translation model. It is measured for a specific translation direction $s \rightarrow t$ by the relative difference in performance (test-set cross-entropy loss) between a bilingual model trained to translate only from $s$ to $t$ ( $\mathcal{L}_{s \rightarrow t}^{\mathrm{bi}}$ ) and a multilingual counterpart that is trained to translate other additional directions ( $\mathcal{L}_{s \rightarrow t}^{\mathrm{multi}}$ ): + +$$ +\mathcal {I} _ {s \rightarrow t} = \frac {\mathcal {L} _ {s \rightarrow t} ^ {\mathrm {b i}} - \mathcal {L} _ {s \rightarrow t} ^ {\mathrm {m u l t i}}}{\mathcal {L} _ {s \rightarrow t} ^ {\mathrm {b i}}} \tag {2} +$$ + +Negative values of $\mathcal{I}_{s\rightarrow t}$ indicate interference, while positive values indicate synergy. + +# 3 Experimental Setup + +Models We train encoder-decoder Transformer (Vaswani et al., 2017) models of 4 different sizes + +
SizeHiddenFFNAttn HeadsParams
XS2561024411M
S5122048844M
M1024409616176M
L2048819232704M
+ +Table 1: Model sizes used in our experiments. Each model has 6 encoder and 6 decoder layers. We exclude the embeddings from the parameters count. + +throughout our experiments. We use the original2 transformer-base and transformer-big variants, as well as a smaller and a larger versions by adjusting the width of the architecture (Table 1). + +Data We use the multilingual benchmark introduced by Siddhant et al. (2020) based on WMT data. This benchmark includes a diverse set of 15 languages, each paired with English. The number of training examples is also diverse, ranging from 155K sentence pairs in Gujarati to 51M examples in Czech. Table 2 provides additional dataset statistics. + +Tokenization We build a shared vocabulary of 64K BPE tokens with sentencepiece (Kudo and Richardson, 2018) using a sampling temperature of 5 to increase the lower resource languages' representation. We use this vocabulary for all our experiments. We also add language ID tokens to our vocabulary, which are prepended to each source and target sequence to indicate the target language (Johnson et al., 2017). + +Training We use Fairseq (Ott et al., 2019) to train transformer models with the Adam optimizer (Kingma and Ba, 2015) for up to 100K steps, with a dropout rate of 0.1, inverse square root learning rate schedule up to a maximum of 0.004, 8K warmup steps, and a batch size of 256K tokens. We choose the best checkpoint according to the average validation loss of all language pairs. + +# 4 What Impacts Interference in Multilingual Translation? + +We consider 5 factors that may potentially impact the performance of a given language pair $s \rightarrow t$ in the multilingual translation setting: + +
LanguageID#Sentences (M)Test Set
Czechcs51.769WMT18
Frenchfr40.853WMT14
Russianru38.492WMT19
Chinesezh25.987WMT19
Spanishes15.177WMT13
Finnishfi6.587WMT19
Germande4.509WMT14
Estonianet2.176WMT18
Latvianlv0.638WMT17
Lithuanianlt0.631WMT19
Romanianro0.610WMT16
Hindihi0.306WMT14
Kazakhkk0.224WMT19
Turkishtr0.207WMT18
Gujaratigu0.156WMT19
+ +(1) Model size +(2) Training data size of $s\to t$ $D_{s\rightarrow t}$ +(3) Proportion of $s\to t$ examples observed during training $P(x\in s\rightarrow t)$ +(4) Total number of languages $L$ +(5) Similarity between $s \rightarrow t$ and other pairs4 In the experiments we describe next, we provide empirical evidence that indicate the last two factors do not actually have a significant effect on the level of interference, and can therefore be pruned away. Subsequent experiments reveal that interference is indeed a function of model size, data size, and data proportion. Most striking is the fact that, across various data settings, enlarging the model to standard sizes consistently alleviates interference and may even promote synergy. + +# 4.1 Does Language Similarity Matter? + +Intuitively, data from languages that humans perceive as similar (e.g. languages that have some degree of mutual intelligibility, exhibit similar linguistic properties, or have shared vocabularies) should have a more positive effect on translation quality comparing to data from distinct languages (Lin et al., 2019; Wang et al., 2020b). To test this, we fix a focus language, and train trilingual models to translate from English to two languages, the focus language and an additional interfering language. We then look at interference trends as we vary the + +Table 2: Languages from the WMT-based benchmark of Siddhant et al. (2020), along with the number of sentence pairs in the training set, and the source of the test set. All languages are paired with English (en). + +
Focus Language#ExamplesOther Language#Examples
es15.177Mfr*/cs/ru/zh15.177M
es0.118Mfr*/cs/ru/zh15.177M
et2.176Mfi*/fr/ru/zh6.587M
et0.118Mfi*/fr/ru/zh6.587M
+ +Table 3: Trilingual models for experiments on the impact of language similarity on interference. The most similar language to the focus language is noted with $\star$ . + +interfering language while controlling the amount of training data for each language pair. + +Setup We run two sets of experiments, one with Spanish (es, 15.2M parallel sentences) as the focus language, and another with Estonian (et, 2.2M examples). For each focus language, we select one of four interfering languages; Spanish is paired with French, $^{5}$ Czech, Russian, and Chinese, while Estonian is paired with Finnish, $^{6}$ French, Russian, and Chinese. To control the effects of data size in the English-Spanish experiments, we randomly sample 15.2M examples from each interfering language pair, making the ratio between focus and interfering languages 1:1. Similarly, in the English-Estonian experiments, we sample 6.6M examples from each interfering language to create a data ratio of 1:3. We also conduct similar experiments when we use only 118K focus language examples, to see the trends when the focus language pair is extremely low resource. $^{7}$ Table 3 provides an overview of the language similarity experiments. + +Results Figure 1a shows the interference rate for every model size when Spanish has only 118K parallel examples (left) and when using the full English-Spanish dataset (right). The variance in results somewhat correlates with language similarity when the dataset is very small, which aligns with previous work (Lin et al., 2019); French seems to help Spanish more than other languages when the model is big enough, while Chinese helps less. However, when training with the full dataset, the differences between other languages diminish for all model sizes. Concurrently, Fernandes et al. (2023) also found no significant difference for using French or Chinese as a third language combined with English-German in a very high resource + +![](images/527ed130f213183e0b003e3eb6316321fb148791288d90af90b2c1763873cf6c.jpg) +(a) Models trained with 118K (left) and 15.2M (right) en-es examples together with 15.2M examples of en-xx. + +![](images/5a7c6ba4e56e42b94c0bb464b7f96d9b6ab016e4b55d8a361c1df998d1c46e1e.jpg) + +![](images/d9052b8900ac309121431a933afe07229d5dbc364967f72a6b65fe0def8e75f7.jpg) +(b) Models trained with 118K (left) and 2.2M (right) en-et examples together with 6.6M examples of en-xx. + +![](images/b1cd37812f7767c7761ad84c731448b36e95e029bf5c5deff0c90f6b601eaa6e.jpg) +Figure 1: Interference of models trained with en-es (a) or en-et (b) as low resource languages (left) and using their full training sets (right) together with one other language. Positive values indicate synergy, i.e. the focus language (es/et) loss of a trilingual model is lower (better) compared to its bilingual model baseline. Similarly, negative values indicate interference. + +setting (600M examples per language pair). + +We observe similar trends when Estonian is the focus language. Figure 1b shows that when Estonian only has 118K training examples, combining with Finnish data seems to have some positive effect. However, this effect also shrinks when using all of the English-Estonian train set (only 2.2M examples, compared to the 15.2M of English-Spanish) and a model that is not too small.[8] + +# 4.2 Does the Number of Languages Matter? + +Do we get more interference when training with one interfering language pair or fourteen? We train models with varying numbers of language pairs while controlling for the overall number of interfering examples. We find that splitting the interfering data across more language pairs has a mild positive effect, which diminishes as the amount of focus-language data and/or model parameters scales up. + +
Focus Language#ExamplesOther Languages#Examples
es15.177Mcs/fr/ru/zh15.177M
cs+fr+ru+zh15.177M
cs+...+gu (14)15.177M
es0.118Mcs/fr/ru/zh15.177M
cs+fr+ru+zh15.177M
cs+...+gu (14)15.177M
et2.176Mfi/fr/ru/zh6.587M
fi+fr+ru+zh6.587M
cs+...+gu (14)6.587M
et0.118Mfi/fr/ru/zh6.587M
fi+fr+ru+zh6.587M
cs+...+gu (14)6.587M
+ +Table 4: Multilingual models for experiments on the impact of the number of other languages on interference. The trilingual model results are the average per focus language from Table 3. + +Setup We train multilingual models on English-Spanish data alongside English to 1, 4, or 14 interfering languages. The interfering data always sums + +![](images/fe30682c0d092d275e4a4fa93e458b9cba5dcc181572239f33f3eed76cf29b72.jpg) +(a) Models trained with 118K (left) and 15.2M (right) en-es training examples and 15.2M training examples for non-es languages. + +![](images/6efd50fbbb7e3f6c05121786e3b82d1e8e0087b9532d6572014e5d1979e82187.jpg) +(b) Models trained with 118K (left) and 2.2M (right) en-et training examples and 6.6M training examples for non-et languages. +Figure 2: en-es (a) and en-et (b) test interference of models trained with es (a) or et (b) as low resource languages (left) and using their full train sets (right) together with increasing number of languages, sharing a fixed budget of training examples. Positive values indicate synergy, i.e the focus language (es/et) loss of a multilingual model is lower (better) comparing to its bilingual model baseline. Similarly, negative values indicate interference. + +up to a fixed 15.2M examples budget, distributed as evenly as possible among the different languages. $^9$ We repeat these experiments when Estonian is the focus language and the interfering example budget is 6.6M. Table 4 provides an overview of these experiments. + +Results Figure 2a shows that more than one interfering language pair somewhat helps when English-Spanish has few training examples, but this effect largely disappears in the full training set and with larger models. We see similar trends for Estonian in Figure 2b, even though its full training set has only $2.2\mathrm{M}$ examples. This phenomenon might be related to the fact that when the data distribution is sharp (i.e. one high resource paired with one very low resource) there is not enough incentive for the model to pay attention to the focus language's identifier token, compared to when the distribution is much more uniform. This result also corroborates similar findings for pretrained multilingual + +models (Conneau et al., 2020), although those experiments did not control the total quantity of data as in ours. $^{10}$ + +# 4.3 The Impact of Model and Data Size + +Seeing that language similarity and the number of interfering languages have only a limited effect on interference, we design a controlled setup to measure interference as a function of the remaining three factors: model size, focus language data size, and its proportion in the total amount of data seen during training. + +Setup We train models using all the available 15.2M English-Spanish examples, with an increasing example budget for interfering language pairs, ranging from $1/8$ (1.9M) to 8 times (122M) the English-Spanish data, divided as evenly as possible between French, Czech, Russian, and Chinese.[11] To observe trends across $D_{s\rightarrow t}$ sizes, we + +![](images/abb8c03f028c78c7fb23af5b0128817bd2a7bca50c9744c509ad0dc9cd3ac6b3.jpg) +(a) 15.2M en-es examples + +![](images/285b4611113a5eb740b817c2857ca0c121191831d6ec3f02e68859302cddc806.jpg) +(b) 3.8M en-es examples + +![](images/4cd87f4f49817dd17c079f2df818792a349769bdf6e7ecdaeb575096b29d6c70.jpg) +(c) 15.2M es-en examples + +![](images/506271afd15471fdaf562eed3f80f5d636a15d44d3ce1462b6ffbc5402ecc61e.jpg) +(d) 3.8M es-en examples +Figure 3: Interference of en-es (top) and es-en (bottom) models trained using the full 15.2M en-es train set (left), and a sample of 3.8M en-es (right). Positive values indicate synergy, i.e. en-es or es-en loss of a multilingual model is lower (better) comparing to its bilingual model baseline. Similarly, negative values indicate interference. + +rerun these experiments with a quarter (3.8M) of the English-Spanish data, while keeping the ratios with the rest of the data similar. Finally, we also conduct these experiments in the many-to-English setting. + +Results Figures 3a and 3b show the interference and synergy for English-Spanish using a varying number of interfering examples. For smaller models (XS and S), increasing the amount of interfering data (i.e. decreasing the proportion of focus data) exacerbates interference. However, larger models appear to benefit from significant quantities of interfering examples; for instance, when training with $D_{s\rightarrow t} = 3.8\mathrm{M}$ , a large model (L) can gain over $10\%$ relative loss improvement when there is 32 times more interfering data than focus data $P(x\in s\to t)\approx 3\%$ . Interestingly, we also observe that interference is sensitive to the ratio between model parameters and focus data, as the + +M model trained on 15.2M focus examples produces a similar curve to that of the 4-times smaller S model trained on 3.8M examples, both intersecting the synergy/interference line at the same point. Finally, Figures 3c and 3d show that when translating into English, interference is much less of an issue, occurring only in the XS model when the total amount of training data significantly exceeds the model's capacity. Scaling up the model not only improves the absolute performance (Appendix A), but also introduces substantial gains from synergy. Our results align with trends observed on cross lingual transfer when scaling pretrained multilingual models to 3.5 and 10 billion parameters (Goyal et al., 2021). + +# 4.4 Tuning Interference with Temperature + +In the previous sections we demonstrated that the dominant factors impacting interference are the model size, the amount of focus language pair data $D_{s\rightarrow t}$ , and the proportion of focus pair examples observed during training $P(x\in s\to t)$ . In a + +practical situation where both model size and multilingual data are fixed, how can one control the level of interference? Recalling Equation 1, we observe that the proportion of focus pair examples $P(x \in s \to t)$ is controlled via the temperature hyperparameter $T$ . Although previous literature has largely used a value of $T = 5$ following Arivazha-gan et al. (2019), our systematic experiments with different temperatures across three different data distributions and four model sizes suggest that this value can be sub-optimal and induce a substantial amount of interference, especially for model sizes that alleviate significant amounts of interference (M and L). Conversely, tuning the temperature shows that lower values $(T = 1, 2)$ are typically able to reduce high-resource interference without harming low-resource synergy in our standard multilingual translation setting. + +Setup We train models of four sizes with temperature ranging from 1 to 5 on three training distributions: (1) all available training data, (2) discarding 3 high resource languages (Czech, French and Russian), (3) discarding 4 low resource languages (Latvian, Lithuanian, Romanian and Hindi). When illustrating the results, we assign languages to high and low resource according to whether their relative data proportion decreases or increases when going from $T = 1$ to $T = 2$ . + +Results Figure 4 shows the trade-offs between the lower and higher resource languages, as defined above. First, we can see a clear trade-off for the smaller models (XS and S) from $T = 1$ to $T = 4$ in most cases. Increasing $T$ helps promote synergy for low resource languages at the cost of increasing interference for the high resource languages. However, the larger models (M and L) clearly degrade when using $T \geq 3$ ; in fact, values of $T = 1$ and $T = 2$ are often better for high- and low-resource language pairs than the commonly-used $T = 5$ . These results align with recent work Xin et al. (2022) showing that tuned scalarization is key to achieving strong bilingual baselines that often outperform more complicated multitask optimization methods. $^{12}$ + +# 5 Related Work + +Scaling Laws in Machine Translation Previous work also looked at scaling trends of data and + +![](images/330bd2b717f3436779e365f856a61038ddd2da32e186044282a0ea6adfc76578.jpg) +(a) Trained on all languages + +![](images/8c9e1adcebc9f07970e7cf500f4f1243107c9d1f64273a7660a26e0dca44e019.jpg) +(b) Trained w/o 4 low resource languages + +![](images/23a3ea41d12b0a675bedd3ec4cd67917e987f4a9989bb18b2db9ca31d2845833.jpg) +(c) Trained w/o 3 high resource languages +Figure 4: Average interference/synergy of high (proportion declining when incrementing $T$ ) and low (proportion ascending when incrementing $T$ ) resource languages of different model sizes (colors) for different training distributions (a,b,c) using $T$ values ranging from 1 to 5 (numbers on markers). Positive values indicate synergy and negative values indicate interference. + +models sizes for machine translation. Gordon et al. (2021) proposed scaling laws in the data and model parameters and demonstrated their ability to predict the validation loss of bilingual translation models from Russian, Chinese, and German to English. Ghorbani et al. (2022) found scaling laws for different configurations for the encoder and decoder, + +independently varying the number of layers in each of them. Bansal et al. (2022) examined different architectures and described data size scaling laws for machine translation in a large scale for English to German and English to Chinese. While all of these works focused on the bilingual setting, we unveil trends for multilingual translation, which has increased complexity. Concurrently to our work, Fernandes et al. (2023) proposed scaling laws for multilingual machine translation, focusing on trilingual models trained on English-German with English-Chinese or French + +Multitask Methods for Multilingual Machine Translation Multitask methods have been proposed extensively to enhance the performance of multilingual translation models. Some utilize validation based signals to determine which language pairs should be prioritized throughout training, either with adaptive scheduling (Jean et al., 2019), gradient similarities to the validation set Wang et al. (2020a), or a multi-armed bandits model (Kreutzer et al., 2021). Zhu et al. (2021) added dedicated embedding and layer adapter modules to the Transformer, and Lin et al. (2021) suggested learning a binary mask for every model parameter and every language pair, both requiring further training after the base multilingual model converges. Li and Gong (2021) used per language gradients geometry to rescale gradients of different language pair to improve performance on low resource languages. Wang et al. (2021) extended PCGrad (Yu et al., 2020) to create Gradient Vaccine, a method that attempts to deconflict different language pairs gradients by replacing them with more similar vectors in terms of cosine similarity. While the motivation for these methods is clear and intuitive, they are usually more complex and computationally expensive than the baseline. Moreover, their efficacy is often demonstrated using relatively small $^{13}$ models, while modestly increasing the model size can both strengthen the bilingual baselines and reduce the interference problem significantly. + +Critical Takes on Multitask Optimization Methods Multitask optimization methods were recently under scrutiny. Kurin et al. (2022) experimented with many of those for image classification and reinforcement learning problems, and found that none of them consistently outperformed a well tuned baseline with proper use of known regular + +ization techniques. Similarly, Xin et al. (2022) showed that despite their increased complexity, no popular multitask method was superior to a sweep over scalarization weights for a baseline trilingual translation model. This work complements this line of research by examining multilingual translation models and how can modest scale and calibrated temperature reduce problems associated with multitasking. + +# 6 Conclusion + +This work examines the dominant factors that influence interference in multilingual machine translation. Namely, the model size, the amount of parallel data for the focus language pair, and the proportion of examples from the focus language pair with respect to the total data seen during training. While specialized multitask techniques are sometimes demonstrated on small transformer models, we find that a standard baseline model of 176M parameters reduces the interference problem significantly, and further scaling up results in synergy among the different language pairs. We further demonstrate the importance of tuning the temperature at which different language pairs are sampled during training; while existing literature largely relies on high temperatures, which indeed improve low-resource performance in parameter-poor settings, larger models benefit from a more natural distribution that reflects the raw training data. These simple strategies for addressing interference call into question the necessity and perhaps even the validity of recently-proposed complex anti-interference methods and reaffirm the tried-and-true method of increasing model capacity to accommodate for higher data diversity. + +# 7 Limitations + +One limitation of this work is the focus on English-to-many and many-to-English settings, while previous studies also went beyond English-centric translation (Freitag and First, 2020; Fan et al., 2022). Second, we experiment with a WMT based benchmark that has a total of 15 languages and 200M training examples, when translation models were also trained on larger datasets (Aharoni et al., 2019; Arivazhagan et al., 2019; NLLB Team et al., 2022). We leave questions about the amount of scale that will be required to effectively mitigate interference in massively (many-to-many, billions of parallel sequences) multilingual settings for future work. + +Additionally, the data collected from high resource languages may be of higher quality compared to that collected from low resource languages. Further research is needed to determine the impact of low quality training data on interference and synergy. Finally, while we explore trends when scaling models width, deeper models (Ghorbani et al., 2022) might help mitigating interference even further. + +# Acknowledgments + +This research is supported by the Yandex Initiative in Machine Learning. We thank Maor Ivgi, Yilin Yang, Jean Maillard, and Ves Stoyanov for their valuable feedback. + +# References + +Roee Aharoni, Melvin Johnson, and Orhan Firat. 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. +N. Arivazhagan, Ankur Bapna, Orhan First, Dmitry Lepikhin, Melvin Johnson, Maxim Krikun, Mia Xu Chen, Yuan Cao, George F. Foster, Colin Cherry, Wolfgang Macherey, Z. Chen, and Yonghui Wu. 2019. Massively multilingual neural machine translation in the wild: Findings and challenges. *ArXiv*, abs/1907.05019. +Yamini Bansal, Behrooz Ghorbani, Ankush Garg, Biao Zhang, Colin Cherry, Behnam Neyshabur, and Orhan Firat. 2022. Data scaling laws in NMT: The effect of noise and architecture. In Proceedings of the 39th International Conference on Machine Learning, volume 162 of Proceedings of Machine Learning Research, pages 1466-1482. PMLR. +Alexis Conneau, Kartikay Khandelwal, Naman Goyal, Vishray 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. +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, Shruti Bhosale, Holger Schwenk, Zhiyi Ma, Ahmed El-Kishky, Siddharth Goyal, Mandep Baines, Onur Celebi, Guillaume Wenzek, Vishrav Chaudhary, Naman Goyal, Tom Birch, Vitaliy Liptchinsky, Sergey Edunov, Edouard Grave, Michael Auli, and Armand Joulin. 2022. Beyond english-centric multilingual machine translation. J. Mach. Learn. Res., 22(1). +Patrick Fernandes, Behrooz Ghorbani, Xavier Garcia, Markus Freitag, and Orhan Firat. 2023. Scaling laws for multilingual neural machine translation. +Orhan Firat, Kyunghyun Cho, and Yoshua Bengio. 2016. Multi-way, multilingual neural machine translation with a shared attention mechanism. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 866-875, San Diego, California. Association for Computational Linguistics. +Markus Freitag and Orhan First. 2020. Complete multilingual neural machine translation. In Proceedings of the Fifth Conference on Machine Translation, pages 550-560, Online. Association for Computational Linguistics. +Behrooz Ghorbani, Orhan First, Markus Freitag, Ankur Bapna, Maxim Krikun, Xavier Garcia, Ciprian Chelba, and Colin Cherry. 2022. Scaling laws for neural machine translation. In International Conference on Learning Representations. +Mitchell A Gordon, Kevin Duh, and Jared Kaplan. 2021. Data and parameter scaling laws for neural machine translation. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 5915-5922, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Naman Goyal, Jingfei Du, Myle Ott, Giri Anantharaman, and Alexis Conneau. 2021. Larger-scale transformers for multilingual masked language modeling. In Proceedings of the 6th Workshop on Representation Learning for NLP (RepL4NLP-2021), pages 29–33, Online. Association for Computational Linguistics. +Thanh-Le Ha, Jan Niehues, and Alex Waibel. 2016. Toward multilingual neural machine translation with universal encoder and decoder. In Proceedings of the 13th International Conference on Spoken Language Translation, Seattle, Washington D.C. International Workshop on Spoken Language Translation. +Sebastien Jean, Orhan First, and Melvin Johnson. 2019. Adaptive scheduling for multi-task learning. *ArXiv*, abs/1909.06434. +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. +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. +Julia Kreutzer, David Vilar, and Artem Sokolov. 2021. Bandits don't follow rules: Balancing multi-facet machine translation with multi-armed bandits. In *Findings of the Association for Computational Linguistics: EMNLP* 2021, pages 3190–3204, Punta Cana, Dominican Republic. 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. +Vitaly Kurin, Alessandro De Palma, Ilya Kostrikov, Shimon Whiteson, and M. Pawan Kumar. 2022. In defense of the unitary scalarization for deep multi-task learning. In Advances in Neural Information Processing Systems. +Xian Li and Hongyu Gong. 2021. Robust optimization for multilingual translation with imbalanced data. In Advances in Neural Information Processing Systems. +Yu-Hsiang Lin, Chian-Yu Chen, Jean Lee, Zirui Li, Yuyan Zhang, Mengzhou Xia, Shruti Rijhwani, Junxian He, Zhisong Zhang, Xuezhe Ma, Antonios Anastasopoulos, Patrick Littell, and Graham Neubig. 2019. Choosing transfer languages for cross-lingual learning. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 3125-3135, Florence, Italy. Association for Computational Linguistics. +Zehui Lin, Liwei Wu, Mingxuan Wang, and Lei Li. 2021. Learning language specific sub-network for multilingual 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 1: Long Papers), pages 293-305, Online. Association for Computational Linguistics. +NLLB Team, Marta R. Costa-jussà, James Cross, Onur Celebi, Maha Elbayad, Kenneth Heafield, Kevin Heffernan, Elahe Kalbassi, Janice Lam, Daniel Licht, Jean Maillard, Anna Sun, Skyler Wang, Guillaume Wenzek, Al Youngblood, Bapi Akula, Loic Barrault, Gabriel Mejia Gonzalez, Prangthip Hansanti, John Hoffman, Semarley Jarrett, Kaushik Ram Sadagopan, Dirk Rowe, Shannon Spruit, Chau Tran, Pierre Andrews, Necip Fazil Ayan, Shruti Bhosale, Sergey Edunov, Angela Fan, Cynthia + +Gao, Vedanuj Goswami, Francisco Guzmán, Philipp Koehn, Alexandre Mourachko, Christophe Ropers, Safiyyah Saleem, Holger Schwenk, and Jeff Wang. 2022. No language left behind: Scaling human-centered machine translation. +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. +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. +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: Volume 2, Short Papers, pages 157-163, Valencia, Spain. Association for Computational Linguistics. +Aditya Siddhant, Ankur Bapna, Yuan Cao, Orhan First, Mia Chen, Sneha Kudugunta, Naveen Arivazhagan, and Yonghui Wu. 2020. Leveraging monolingual data with self-supervision for multilingual neural machine translation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 2827-2835, 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. +Xinyi Wang, Yulia Tsvetkov, and Graham Neubig. 2020a. Balancing training for multilingual neural machine translation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 8526-8537, Online. Association for Computational Linguistics. +Zirui Wang, Zachary C. Lipton, and Yulia Tsvetkov. 2020b. On negative interference in multilingual models: Findings and a meta-learning treatment. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), + +pages 4438-4450, Online. Association for Computational Linguistics. +Zirui Wang, Yulia Tsvetkov, Orhan First, and Yuan Cao. 2021. Gradient vaccine: Investigating and improving multi-task optimization in massively multilingual models. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net. +Derrick Xin, Behrooz Ghorbani, Justin Gilmer, Ankush Garg, and Orhan First. 2022. Do current multi-task optimization methods in deep learning even help? In Advances in Neural Information Processing Systems. +Tianhe Yu, Saurabh Kumar, Abhishek Gupta, Sergey Levine, Karol Hausman, and Chelsea Finn. 2020. Gradient surgery for multi-task learning. In Advances in Neural Information Processing Systems, volume 33, pages 5824-5836. Curran Associates, Inc. +Yaoming Zhu, Jiangtao Feng, Chengqi Zhao, Mingxuan Wang, and Lei Li. 2021. Counter-interference adapter for multilingual machine translation. In Findings of the Association for Computational Linguistics: EMNLP 2021, pages 2812-2823, Punta Cana, Dominican Republic. Association for Computational Linguistics. + +# A BLEU Scores + +Throughout the paper we calculate interference in terms of test loss values. We additionally provide the test BLEU scores achieved by our models. We generate using beam search with 5 beams, without length penalty. We use SacreBLEU (Post, 2018) to calculate test sets BLEU (Papineni et al., 2002) scores. + +Language similarities Figure 5 shows BLEU scores of models from experiments in Section 4.1. They reflect similar trends, as the variance between different interfering languages when the focus language has only 118K examples diminish when a decent amount of training data is available. + +Number of languages Figure 6 shows BLEU scores of models from experiments in Section 4.2. They also demonstrate that low resource pairs benefit when there are more interfering languages, but this effect disappears with a decent amount of training data. + +![](images/6aad8b22896d1d238ed1a83221899232ec78bc529bae7662582085eac7f0dc4d.jpg) +(a) Models trained with 118K (left) and 15.2M (right) en-es training examples and 15.2M training examples for non-es languages. + +![](images/aa41d3d342ef5a2c4c2624da7cd12e2db251a41330f243085179858cc5ca1f2a.jpg) + +![](images/8ccbeac632fb5a8869d9b5b0e64ede591e4cb42c6dfbac86f123bd00fca335c9.jpg) +(b) Models trained with 118K (left) and 2.2M (right) en-et training examples and 6.6M training examples for non-et languages. + +![](images/6506cdd3c9629601090feddb9cfddfc81f57152a05de29b884006a10697de6dc.jpg) + +![](images/757012e513d12c21653fd68b33f8633837f8d490d81fe843692d78dd1d261f50.jpg) +Figure 5: en-es (a) and en-et (b) test BLEU scores of models trained with es or et as low resource languages and using their full train sets together with one other en-xx pair. + +![](images/d2085f5d38b57f70f28e18740cb23d460f7904c5f83f0e42c58bbf508e482d99.jpg) + +![](images/130ab2fd77360ae6e79225fbab52877be0b7231c398a9f0895e78cca94d7a562.jpg) +(a) Models trained with 118K (left) and 15.2M (right) en-es training examples and 15.2M training examples for non-es languages. +Figure 6: en-es (a) and en-et (b) test BLEU scores of models trained with es or et as low resource languages and using their full train sets together with increasing number of languages, sharing a fixed budget of training examples. + +![](images/7aff7434a4cd83c6ac098a83a87c24f73d2e579d54e1f863f039ab763562443f.jpg) +(b) Models trained with 118K (left) and 2.2M (right) en-et training examples and 6.6M training examples for non-et languages. + +
SizeTmpcsfrruzhesfideetlvltrohikktrgu
XSbi19.635.124.227.331.717.724.117.512.19.222.46.50.57.71.6
116.731.920.520.827.412.815.710.48.06.115.64.81.04.92.5
215.530.819.020.327.414.117.613.111.39.420.49.12.39.16.4
315.230.218.619.627.314.618.013.511.99.821.511.03.210.27.6
414.830.118.219.427.114.718.113.712.410.021.511.73.210.78.7
514.529.917.619.027.114.618.113.612.610.321.711.93.510.89.2
Sbi22.138.427.229.933.819.826.117.412.08.522.14.80.57.21.8
120.336.224.726.431.016.820.814.512.19.821.07.91.77.64.9
219.935.724.125.731.418.522.417.314.912.224.114.14.612.111.6
319.235.623.525.631.218.422.517.615.312.524.515.25.612.913.1
419.135.223.725.030.917.522.617.715.412.825.015.35.713.313.1
518.534.823.425.130.918.122.317.515.312.524.915.45.913.813.5
Mbi23.140.128.830.734.219.625.917.111.57.821.64.00.45.91.0
122.439.627.329.833.619.124.118.014.612.023.912.43.610.78.2
222.139.326.529.733.519.525.719.317.113.826.515.96.314.114.2
321.838.026.129.633.420.126.120.217.413.826.515.25.814.214.1
421.338.025.929.033.420.325.820.116.914.126.514.65.513.712.2
521.137.726.228.632.819.925.619.416.813.926.314.65.213.812.3
Lbi22.940.028.530.734.418.625.816.910.88.521.43.80.45.41.3
123.440.729.431.434.820.726.519.216.313.426.114.44.612.510.3
223.040.429.131.134.720.628.020.217.914.226.714.24.714.212.4
322.939.828.431.134.921.327.720.517.414.226.213.54.614.012.2
422.139.226.529.834.020.526.720.317.314.226.413.84.714.012.1
521.938.927.530.134.121.126.720.417.213.725.813.63.813.913.0
+ +Table 5: Test BLEU scores across four model sizes of bilingual baselines (bi) and multilingual models trained with temperature values $T \in [1,5]$ . + +A For every submission: + +A1. Did you describe the limitations of your work? + +Section 7 + +A2. Did you discuss any potential risks of your work? + +Our work does not add new risks involving translation models + +A3. Do the abstract and introduction summarize the paper's main claims? + +Sections 0,1 + +A4. Have you used AI writing assistants when working on this paper? + +Left blank. + +B Did you use or create scientific artifacts? + +3 + +B1. Did you cite the creators of artifacts you used? + +3 + +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? + +The WMT data used in our experiment is a common machine translation dataset and is publicly available research purposes. + +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +The usage was consistent with the artifacts intended use. + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? + +The WMT data used in our experiment is a common machine translation dataset and is publicly available research purposes. + +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? + +Mostly languages in section 3. Regarding the rest, adding justification from above: The WMT data used in our experiment is a common machine translation dataset and is publicly available research purposes. + +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. + +3 + +# C Did you run computational experiments? + +Left blank. + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +Section 3 + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +Section 3 + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +Section 4 + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +Section 3, Appendix A + +# D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +No response. + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +No response. + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +No response. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +No response. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +No response. \ No newline at end of file diff --git a/causesandcuresforinterferenceinmultilingualtranslation/images.zip b/causesandcuresforinterferenceinmultilingualtranslation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..fa7fea73688e127528ca1f9692a28e3eebfa8545 --- /dev/null +++ b/causesandcuresforinterferenceinmultilingualtranslation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a08a659e3e6aa0d178ec649aef19f4a37615419c2c88203264ac34e25e238a40 +size 730455 diff --git a/causesandcuresforinterferenceinmultilingualtranslation/layout.json b/causesandcuresforinterferenceinmultilingualtranslation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..b5bd1500c5e370ecca4c4aecbe80e6550a0072ef --- /dev/null +++ b/causesandcuresforinterferenceinmultilingualtranslation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:67470e1d35994d3e7daf666d7cecbc9af67b6c8e2aa2747b4dad6775101f87bc +size 433024 diff --git a/celdaleveragingblackboxlanguagemodelasenhancedclassifierwithoutlabels/597a44b2-aea3-4490-8689-4a603b093d1d_content_list.json b/celdaleveragingblackboxlanguagemodelasenhancedclassifierwithoutlabels/597a44b2-aea3-4490-8689-4a603b093d1d_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..69ca88c164dcb2371b19a235f4963b76791faf4d --- /dev/null +++ b/celdaleveragingblackboxlanguagemodelasenhancedclassifierwithoutlabels/597a44b2-aea3-4490-8689-4a603b093d1d_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2a1782a4a6aa9fdf881e2027a19ba71e6c7dc122cf4d30a775f0be2a29641e9d +size 101069 diff --git a/celdaleveragingblackboxlanguagemodelasenhancedclassifierwithoutlabels/597a44b2-aea3-4490-8689-4a603b093d1d_model.json b/celdaleveragingblackboxlanguagemodelasenhancedclassifierwithoutlabels/597a44b2-aea3-4490-8689-4a603b093d1d_model.json new file mode 100644 index 0000000000000000000000000000000000000000..cad58e693c33d9848bad66bd35b70b2924d1182c --- /dev/null +++ b/celdaleveragingblackboxlanguagemodelasenhancedclassifierwithoutlabels/597a44b2-aea3-4490-8689-4a603b093d1d_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:603391674b59cc5d39a18b8660d2f222e3a69ac42200be22e62f98459a2715ad +size 124687 diff --git a/celdaleveragingblackboxlanguagemodelasenhancedclassifierwithoutlabels/597a44b2-aea3-4490-8689-4a603b093d1d_origin.pdf b/celdaleveragingblackboxlanguagemodelasenhancedclassifierwithoutlabels/597a44b2-aea3-4490-8689-4a603b093d1d_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..82eb343ad1cac625be9c426351563cccc1d87025 --- /dev/null +++ b/celdaleveragingblackboxlanguagemodelasenhancedclassifierwithoutlabels/597a44b2-aea3-4490-8689-4a603b093d1d_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:846b2bc204c6598b24c4846509caf59a1f305388824e6a30ed8a48c1dd90e227 +size 674407 diff --git a/celdaleveragingblackboxlanguagemodelasenhancedclassifierwithoutlabels/full.md b/celdaleveragingblackboxlanguagemodelasenhancedclassifierwithoutlabels/full.md new file mode 100644 index 0000000000000000000000000000000000000000..3fc7c6256d9df8dfe0ebda9ee9d5ab99372f9864 --- /dev/null +++ b/celdaleveragingblackboxlanguagemodelasenhancedclassifierwithoutlabels/full.md @@ -0,0 +1,478 @@ +# CELDA: Leveraging Black-box Language Model as Enhanced Classifier without Labels + +Hyunsoo Cho $\diamond$ , Youna Kim $\diamond$ , Sang-goo Lee $\diamond$ + +Seoul National University, IntelliSys + +{johyunsoo, anna9812, sglee}@europa.snu.ac.kr + +# Abstract + +Utilizing language models (LMs) without internal access is becoming an attractive paradigm in the field of NLP as many cutting-edge LMs are released through APIs and boast a massive scale. The de-facto method in this type of black-box scenario is known as prompting, which has shown progressive performance enhancements in situations where data labels are scarce or unavailable. Despite their efficacy, they still fall short in comparison to fully supervised counterparts and are generally brittle to slight modifications. In this paper, we propose Clustering-Enhanced Linear Discriminative Analysis (CELDA), a novel approach that improves the text classification accuracy with a very weak-supervision signal (i.e., name of the labels). Our framework draws a precise decision boundary without accessing weights or gradients of the LM model or data labels. The core ideas of CELDA are twofold: (1) extracting a refined pseudo-labeled dataset from an unlabeled dataset, and (2) training a lightweight and robust model on the top of LM, which learns an accurate decision boundary from an extracted noisy dataset. Throughout in-depth investigations on various datasets, we demonstrated that CELDA reaches new state-of-the-art in weakly-supervised text classification and narrows the gap with a fully-supervised model. Additionally, our proposed methodology can be applied universally to any LM and has the potential to scale to larger models, making it a more viable option for utilizing large LMs. + +# 1 Introduction + +Large-scale language models (LMs) have been a driving force behind a series of breakthroughs in the machine-learning community. Despite their preeminence in wide applications, large LMs are often costly or infeasible to fine-tune as many distributed large models, such as GPT-3 (Brown et al., 2020), are provided in a black-box manner, which only allows limited access through commercial APIs. + +![](images/eeaa252033566a6a6b92ed7b0f5538de9677e8bd409ab2940d14abc56ef0207a.jpg) +Figure 1: Text classification accuracy on 4 benchmark datasets on T5 (11B). CELDA significantly improves the performance without model adaptation or labeled data closing the gap with fully labeled methods. + +To circumvent the explicit adaptation of the models, many recent research leverage prompting, a training-free approach that elicits desired predictions from LMs by curating input into a more conceivable form. By doing so, prompting has shown remarkable improvements in data-scarce scenarios (i.e., zero-shot, few-shot), reminiscing the potential of large LMs as a universal, off-the-shelf solution for diverse tasks. Yet, it is still premature as their performance lags far behind the fine-tuned model and displays fragility to negligible changes (Lu et al., 2022; Perez et al., 2021). + +In this paper, we aim to bridge this gap by utilizing an unlabeled dataset without adapting the model and propose Clustering-Enhanced Linear Discriminative Analysis (CELDA) that maximizes the potential of black-box language models further. CELDA enhances text classification performance by training a lightweight module stacked on the top of LM. The improvement is a result of attaining the following two key objectives: (1) composing a highly reliable pseudo-labeled dataset with black-box LM. (2) training a compact but robust model with the previously composed dataset + +(pseudo-labels). We accomplish the first goal by sorting out some uncertain data points via clustering the features from LM. We draw inspiration from recent findings (Aharoni and Goldberg, 2020; Cho et al., 2023) that LM effectively groups semantically similar sentences into clusters. Furthermore, we achieve the latter objective by employing Linear Discriminative Analysis (LDA) which is efficient in terms of parameter requirements and robust against spurious inputs (Murphy, 2022). The mentioned characteristics of LDA have strong compatibility with our training dataset, considering the presence of noise and its reduced scale. + +To verify our method, we compare with recently proposed state-of-the-art methods on 8 different text classification datasets, spanning from binary to multi-class tasks (maximum 150 classes). Moreover, we also report the performance of baseline LDA when the data labels are fully available, serving as the upper bound performance. As illustrated in Figure 1, our method significantly outperforms the precedently proposed prompting-based zero-shot learning (ZSL) method (Hu et al., 2021) and closes the gap between fully labeled methods. + +In summary, our contributions are as follows: + +(1) We propose dubbed CELDA, a novel weakly-supervised learning framework for black-box language models that consistently outperforms other competing methods and close the gap between fully fine-tuned model. +(2) CELDA has the potential to scale to larger models, whereas performance often saturates in ZSL methods, and existing weakly-supervised learning methods often require additional model tuning. +(3) CELDA proves to be a highly effective active learner, capable of tackling even the most challenging tasks previously faced by ZSL or WSL methods with minimal human-in-loop labeling. + +# 2 Related Work + +Zero-shot learning aims to identify the class label of the input sentence by relying on weak supervision information from metadata, such as the description of the task and the name of the class labels. ZSL methods inference test input instantly without any dataset or explicit training. Specifically, most ZSL works (Holtzman et al., 2021; Zhao et al., 2021; Min et al., 2022; Schick and Schütze, 2021) utilize the likelihood of manually designed verbalizers relying on the language model's capability to predict the probability of the [MASK] word (bi + +directional models) or next token (auto-regressive models). + +Additionally, most recent research in ZSL utilizes external knowledge bases or corpus (Lyu et al., 2022; Shi et al., 2022; Hong et al., 2022). Lyu et al. (2022) retrieves semantically similar samples from the additional corpus and labels them randomly. Shi et al. (2022) employs automatically expanded fuzzy verbalizers to converge the mapping between the verbalizer tokens and the class labels. Hong et al. (2022) additionally uses semantically similar sentences from supplementary corpora to compensate for the poorly described labels. + +Weakly-supervised learning approaches, unlike ZSL methods, generally require an unlabeled dataset relevant to the target task and re-train the backbone model. Generally, most WSL studies (Meng et al., 2020; Wang et al., 2021; Zhang et al., 2021; Fei et al., 2022b) utilize keywords from metadata (e.g., name of each class) to annotate unlabeled datasets and iteratively re-train models with the pseudo-labeled dataset. + +Namely, X-class (Wang et al., 2021) incrementally adds several similar words to each class until in-consistency arises and utilizes the weighted average of contextualized word representations to retrieve the most confident documents from each cluster to train a text classifier. SimPTC (Fei et al., 2022b) trains a Gaussian Mixture Model (GMM) on top of the LM's representations, similar to our approach in that it utilizes Gaussian distribution to fit the model. While effective, most WSL methods are challenging to utilize in black-box scenarios as they often require direct model tuning or are tailored for a particular language model. + +Black-box tuning is a research field aiming to maximize downstream task performance without accessing weights or gradients of the model, which has diverse potential and benefits. Black-box tuned models can process mixed-task input batch with a single model as it circumvents the explicit model retraining phase. Furthermore, it can leverage some commercial models available only through APIs (Brown et al., 2020; Sun et al., 2021) or even when models are too large (Zhang et al., 2022; Scao et al., 2022) to optimize directly. + +In this scenario, the prevailing paradigms are: (1) manipulating the input text or (2) training a lightweight model on top of the final representations from the model. Specifically, the most recent work utilizes the language model's ability to learn + +in-context (Brown et al., 2020) and tailors the input through appending templates or few-shot samples (i.e., demonstrations) to the original inputs. Additionally, some studies (Diao et al., 2022; Sun et al., 2022) attempt to find the optimal prompt for the task without explicitly calculating the gradient. + +# 3 Preliminary + +# 3.1 Scenario & Problem Formulation + +Our research aims to improve text classification without using dataset labels and accessing LM's parameters or gradients. Namely, LM only serves as a fixed text encoder function $\mathsf{LM}(\cdot)$ , which outputs an $n$ -dimensional continuous latent representation $\pmb{h} \in \mathcal{H} = [0,1]^n$ from input $\pmb{x}$ : $\pmb{h} = \mathsf{LM}(\pmb{x})$ . And let the label space be $\mathcal{Y} = \{0,1,\dots,|\mathcal{Y}|\}$ , where $|\mathcal{Y}|$ is total cardinality of label space. Then, our goal is to build a classifier $f_{cls}: \mathcal{H} \mapsto \mathcal{Y}$ which maps encoded features to proper classes with an unlabeled dataset $\mathcal{D} = \{\pmb{x}_i\}_{i=1}^k$ and weak supervision signal (i.e., natural language name for each class). + +# 3.2 Prompt-tuning + +Prompt-tuning projects an input sequence $x$ into a label space $\mathcal{V}$ via LM's capability to fill the [MASK] token. For instance, suppose we have to classify the binary sentiment (label 0: positive, label 1: negative) of the sentence. Given input sentence $x = A$ great movie., we first transform the $x$ into a cloze question through template: + +$$ +\boldsymbol {x} ^ {\mathrm {t}} = \mathrm {A} [ \text {M a s k} ] \text {r e v i e w . A g r e a t m o i v e}. +$$ + +Then we feed $\text{templified}$ input $\boldsymbol{x}^{\mathrm{t}}$ to LM and extract the likelihood of the [MASK] token. To convert the probability of extracted token into a label probability, we employ a verbalizer $\mathcal{V}$ , a few selected tokens from the whole vocabulary, and map them into corresponding label space $\mathcal{V} \mapsto \mathcal{V}$ . Specifically from the previous example, we can design a verbalizer utilizing a weak-supervision signal (i.e., name of each class) as follows: + +$$ +\mathcal {V} _ {0} = \{\text {p o s i t i v e} \}, \mathcal {V} _ {1} = \{\text {n e g a t i v e} \}. \tag {1} +$$ + +Note that some recent studies have expanded the verbalizer words in Eq. 1 to multiple words by utilizing extra knowledge, such as ConceptNet (Speer et al., 2017) or WordNet (Miller, 1995), to make more accurate predictions. Then, for input $\boldsymbol{x}^{\mathrm{t}}$ , we + +measure the probability distribution of the label $P(y|\boldsymbol{x}^{\mathrm{t}})$ utilizing verbalizer $\cup_{y\in \mathcal{V}}\mathcal{V}_y = V$ + +$$ +P \left(y \mid \boldsymbol {x} ^ {\mathrm {t}}\right) = \frac {\sum_ {w \in V _ {y}} \mathsf {L M} \left(\left[ \text {M A S K} \right] = w \mid \boldsymbol {x} ^ {\mathrm {t}}\right)}{\sum_ {\mathcal {V} _ {i} \in \mathcal {V}} \sum_ {v \in V _ {i}} \mathsf {L M} \left(\left[ \text {M A S K} \right] = v \mid \boldsymbol {x} ^ {\mathrm {t}}\right)} \tag {2} +$$ + +Finally, we compare the probability of $p(y = 0)$ and $p(y = 1)$ in the [Mask] token and annotates input $x$ with label 0. + +# 3.3 Linear Discriminative Analysis + +LDA belongs to the generative classifier family which estimates the class probability of the input indirectly. Unlike discriminative classifier, which directly models the class posterior $p(y = c|x)$ , LDA predicts $x$ via bayes rule: + +$$ +p (y = c | \boldsymbol {x}) = \frac {p (\boldsymbol {x} | y = c) p (y = c)}{\Sigma_ {c ^ {\prime} \in \mathcal {Y}} p (\boldsymbol {x} | y = c ^ {\prime}) p (y = c ^ {\prime})}. +$$ + +LDA assumes the class conditional densities follow multivariate Gaussian distribution with tied covariance over classes: + +$$ +p (\boldsymbol {x} | y = c) = \mathcal {N} (\boldsymbol {x} | \boldsymbol {\mu} _ {c}, \Sigma) +$$ + +Then the corresponding label probability (posterior) has the following form: + +$$ +\begin{array}{l} p (y = c | \boldsymbol {x}) \propto \pi_ {c} \mathcal {N} (\boldsymbol {x} | \boldsymbol {\mu} _ {c}, \Sigma) \\ \propto \mathcal {N} (\boldsymbol {x} | \boldsymbol {\mu} _ {c}, \Sigma). \\ \end{array} +$$ + +The prior distribution $\pi_c = p(y = c)$ can be ignored as it is independent to $c$ . + +Train: To fit the LDA model, we have to estimate the Normal distribution of the target space $\mathcal{N}(\boldsymbol{\mu}, \Sigma)$ from the available dataset $\mathcal{D}$ . Particularly, LDA estimates the distribution by employing MLE, which consists of empirical class mean $\hat{\boldsymbol{\mu}}_c$ and tied covariance $\hat{\Sigma}$ . + +$$ +\hat {\boldsymbol {\mu}} _ {c} = \frac {1}{| \mathcal {D} _ {c} |} \sum_ {n \in \mathcal {D} _ {c}} \boldsymbol {x} _ {n}, +$$ + +$$ +\hat {\Sigma} = \frac {1}{| \mathcal {D} |} \sum_ {c = 1} ^ {c \in \mathcal {Y}} \sum_ {n \in \mathcal {D} _ {c}} (\boldsymbol {x} _ {n} - \hat {\boldsymbol {\mu}} _ {c}) (\boldsymbol {x} _ {n} - \hat {\boldsymbol {\mu}} _ {c}) ^ {\intercal}. +$$ + +Inference: After training the trainable parameters, we can compute the probability of the class label through Mahalanobis distance $d_{\mathrm{mah}}$ which measures the distance between the data point $\pmb{x}$ and the estimated distribution $\mathcal{N}(\hat{\pmb{\mu}}, \hat{\Sigma})$ : + +![](images/530aad4c99a4fbe1b899303713edd364fb83b4050e90aa10f5f8d9a4b02143ea.jpg) +Preprocess +Figure 2: Illustration of § 4.1, 4.2 stage in CELDA. We (1) extract pseudo label and latent feature pair from unlabeled data, and (2) discard some uncertain data points. + +![](images/8cb7e8f1b6a31f0beb1c4d17ed7d367da29cc3e2583220cd8802c6f5c24a3c02.jpg) +Data Cleansing + +$$ +\begin{array}{l} \hat {y} = M (\boldsymbol {x}) = \underset {c} {\arg \max } \log p (y = c | \boldsymbol {x}) \\ = \arg \max _ {c} \left[ \log \pi_ {c} - \frac {1}{2} d _ {\operatorname {m a h}} (\boldsymbol {x}, \boldsymbol {\mu} _ {c}; \Sigma) + C \right] \\ = \operatorname * {a r g m i n} _ {c} d _ {\mathrm {m a h}} (\boldsymbol {x}, \boldsymbol {\mu} _ {c}; \Sigma), \\ \end{array} +$$ + +where $M$ refers to a trained LDA model and $d_{\mathrm{mah}}(\pmb{x}, \pmb{\mu}_c; \Sigma) = (\pmb{x}_n - \hat{\pmb{\mu}}_c)^{\top} \Sigma^{-1} (\pmb{x}_n - \hat{\pmb{\mu}}_c)$ . + +# 4 CELDA + +We introduce CELDA, Clustering-enhanced Linear Discriminative Analysis which enhances the text classification ability of black-box LMs without labels. CELDA first (1) consists pseudo labeled dataset by passing an unlabeled dataset to LM( $\cdot$ ) and extracts high-quality representation and pseudolabel pair as introduced in § 3.2. Then, we (2) refine the pseudo labeled dataset into a small subset dataset dubbed a certain dataset by leveraging clustering and the concept of entropy. (Figure 2 illustrates the (1), (2) stage of CELDA training.) Finally, (3) we recursively train a third-party LDA module stacked on LM with the certain dataset, which learns a precise decision boundary from the noisy dataset. + +# 4.1 Pre-processing + +CELDA first passes the unlabeled dataset $\mathcal{D} = \{\pmb{x}_i\}_{i=1}^k$ to LM to extract the information required + +to train LDA. Specifically, we pass templified sentence $\boldsymbol{x}^{\mathrm{t}}$ to $\mathsf{LM}(\cdot)$ and extract $h_{\mathrm{last}}$ , $h_{\mathrm{verb}}$ , and $\hat{y}$ . Each notation refers to a mean-pooled last layer hidden representation $h_{\mathrm{last}}$ , the verbalizer probability distribution of the [Mask] token $h_{\mathrm{verb}}$ , and its corresponding pseudo-label $\hat{y}$ . CELDA employs two different representations the $h_{\mathrm{last}}$ and $h_{\mathrm{verb}}$ since they retain complementary information which might be beneficial in learning a precise decision boundary. Namely, the former encapsulates rich information, including semantics and syntactic information, and the latter possesses specific probability distribution of [Mask] token. To maximize the capability of $h_{\mathrm{verb}}$ , we expand the verbalizer in Eq. 1 into predefined multiple words following Hu et al. (2021). Finally, we concatenate both representations to derive a single final representation $h$ : + +$$ +\boldsymbol {h} = \left[ \left\| \boldsymbol {h} _ {\text {l a s t}} \right\| _ {2} \oplus \boldsymbol {h} _ {\text {v e r b a l}} \right]. \tag {3} +$$ + +We apply L-2 normalization to $h_{\mathrm{last}}$ before concatenation to synchronize the range with the representation provided by the verbalizer (ranging from 0 to 1). Finally, we construct the pseudo labeled dataset $\mathcal{D}^{\mathrm{pseudo}} = \{h_i, \hat{y}_i\}_{i=1}^k$ , for the next training phase. After this pre-processing step, we no longer use the LM, which tremendously reduces computational cost in training. + +# 4.2 Data Cleansing with Cluster Entropy + +The objective of this training phase is to filter out the uncertain data samples in $\mathcal{D}^{\mathrm{pseudo}}$ to create a more reliable dataset, $\mathcal{D}^{\mathrm{clean}}$ . To achieve this + +goal, we utilize clustering on the representations $\pmb{h}$ based on the previous findings that the LM's features are grouped with semantically similar sentences. Specifically, we employ KMeans to cluster the pseudo-labeled dataset $\mathcal{D}^{\mathrm{pseudo}}$ into $K$ clusters. And let $h_{ij}$ be the representation belonging to the $i^{\mathrm{th}}$ cluster $K_{i}$ and $j$ be the index of the sample in the cluster. From each cluster, we estimate the pseudo-label probability distribution within each cluster $P_{k_i}(\mathcal{V})$ : + +$$ +P _ {K _ {i}} (\mathcal {Y} = y) = \frac {| \mathcal {S} |}{| K _ {i} |}, +$$ + +where $S = \{s\in \hat{y}_i|\hat{y}_i = y\}$ and $i,y$ denotes cluster index and label index, respectively. + +Then we measure the entropy weight (EW) of each cluster to estimate their uncertainty: + +$$ +\operatorname {E W} \left(K _ {i}\right) = \frac {1 - \operatorname {N o r m E n t} \left(K _ {i}\right)}{\sum_ {j \in K} \left(1 - \operatorname {N o r m E n t} \left(K _ {j}\right)\right)}, \tag {4} +$$ + +$$ +\operatorname {N o r m E n t} \left(K _ {i}\right) = - \frac {\sum_ {l \in \mathcal {Y}} p _ {K _ {i}} (l) \log p _ {K _ {i}} (l)}{\log | C |}. +$$ + +EW increases when the samples within a cluster tend to have the same label, but decreases otherwise. By setting a threshold, $\tau$ , we are able to select a portion of certain clusters $K^{\mathrm{clean}}$ while removing several uncertain clusters. + +$$ +K ^ {\text {c l e a n}} = \left\{K _ {i} \in K \mid \operatorname {E W} \left(K _ {i}\right) \geq \tau \right\} \tag {5} +$$ + +Furthermore, we eliminate samples in the cluster that do not conform to the majority pseudo labels within the cluster and create the final certain dataset $\mathcal{D}^{\mathrm{clean}}$ : + +$$ +\mathcal {D} ^ {\text {c l e a n}} = \left\{K _ {i} \in K ^ {\text {c l e a n}} \mid \hat {y} _ {i j} = \underset {y \in \mathcal {Y}} {\arg \max } P _ {K _ {i}} (\mathcal {Y}) \right\} \tag {6} +$$ + +And we utilize the $\mathcal{D}^{\mathrm{clean}}$ to train LDA. Figure 2 illustrates §4.1, 4.2 stage of CELDA. + +# 4.3 LDA Training + +Utilizing the filtered dataset $\mathcal{D}^{\mathrm{clean}}$ from prior step, we finally fit the parameters of LDA through MLE as introduced in § 3.3. To further improve LDA, we recursively train LDA by updating the pseudo labels with the trained model and repeating the previous data cleansing steps based on the assumption that the trained LDA produces more precise pseudo labels. To prevent the model from oscillating or + +# Algorithm 1: CELDA Training. + +Input: unlabeled dataset $\mathcal{D}$ , a language model LM, pre-defined verbalizer $\nu$ , LDA model $M$ + +Step 1: Pre-processing + +$$ +\mathcal {D} ^ {\mathrm {p}} = \{\} +$$ + +for $x\in \mathcal{D}$ do + +1a. get embedding $h \gets$ Eq.3; + +2a. get pseudo-label $\hat{y} \gets$ Eq.2; + +$$ +\mathcal {D} ^ {\mathrm {p}} = \mathcal {D} ^ {\mathrm {p}} \cup (\boldsymbol {h}, \boldsymbol {\hat {y}}); +$$ + +Return $\mathcal{D}^p$ ; + +Step 2: Data Cleansing & LDA training + +for until convergence. do + +1b. run KMeans on $\mathcal{D}^p$ with $k = K$ until converge; + +2b. data cleansing $\mathcal{D}^c\gets$ Eq.5, 6; + +3b. train $M$ with $\mathcal{D}^c$ ; + +for $(\pmb {h},\hat{\pmb{y}})\in \mathcal{D}^p$ do + +4b. $\hat{y} = M(\pmb {h})\gets$ update label; + +Output: A trained LDA classifier $M$ . + +diverging in iterative training, we employ moving average (MA): + +$$ +\hat {\boldsymbol {\mu}} _ {t + 1} = \frac {t - 1}{t} \hat {\boldsymbol {\mu}} _ {t - 1} + \frac {1}{t} \hat {\boldsymbol {\mu}} _ {t}, +$$ + +$$ +\hat {\Sigma} _ {t + 1} = \frac {t - 1}{t} \hat {\Sigma} _ {t - 1} + \frac {1}{t} \hat {\Sigma} _ {t}, +$$ + +where $t$ indicates timestamp (current epoch). If the updated label does not deviate beyond a specific ratio $\delta$ from the previous label, we terminate the training process judging the model has converged. The overall procedure of CELDA is summarized in Algorithm 1. + +As previously discussed in § 3.3, LDA is a variation of Gaussian Discriminative Analysis (GDA) that utilizes shared covariance among classes, resulting in a reduction of parameters from $O(|\mathcal{Y}|d^2)$ to $O(|\mathcal{Y}|d)$ . Despite the potential negative impact on performance compared to GDA when data is abundant and clean, LDA possesses several beneficial properties, such as the ability to fit the model with fewer samples and greater robustness to noisy labels (Murphy, 2022). Thus, the reduced parameters in LDA prevent overfitting and improve the model's ability to adapt to the test dataset, in contrast to other Gaussian-based approaches that are prone to overfitting and yields a poor performance in test cases, as will be demonstrated in our following experiments. The mentioned characteristics of + +LDA are highly valuable in our scenario, where the training dataset is noisy and a portion of the available data is discarded during the previous data cleansing stage. + +# 5 Experiments + +# 5.1 Backbone & Datasets + +We adopt T5 (Raffel et al., 2020) as the main backbone of our experiments which is fairly large (up to 11 billion parameters) and open-sourced. Furthermore, we report additional experimental results with SimCSE (Gao et al., 2021) supervised RoBERTa-large (Liu et al., 2019) in the Appendix. To investigate the performance of each method in many different scenarios, we carefully select 8 datasets1: AGNews, DBPedia, IMDb, SST2, Amazon, Yahoo, Banking77, and CLINC. The statistics of datasets used in the experiments are reported in Table 1. To evaluate each method in stable conditions, we report the average accuracy of 5 different seeds (13, 27, 250, 583, 915) along with the corresponding standard deviation of 5 runs as a model performance. + +# 5.2 Experimental Configurations + +For all experiments, we utilize KMeans clustering with euclidean distance, and set the number of clusters to $K = |\mathcal{Y}| \times 16$ except binary classification task. For binary classification tasks, we encountered an issue where the number of clusters became significantly smaller compared to the size of the total dataset. As a solution, we opted to use a relatively large value for $K = |\mathcal{Y}| \times 64$ . Furthermore, we set maximum tokenizer length and exit threshold $\delta$ adaptively depending on the dataset size. And we utilized the same template and verbalizer for every task from Openprompt (Ding et al., 2021). Detailed configurations (i.e., templates, verbalizer) and our computation environments are stipulated in the Appendix. + +# 5.3 Competing Methods + +We compare our methods with state-of-the-art zero-shot text classification methods and several baseline fully supervised methods: + +- LDA (full): We report the accuracy of the baseline LDA model trained on the top of LM representations with a fully-annotated dataset, which serve as our upper bound. + +
Datasets# Train# Test# Cls
DBPedia560,00070,00014
Yahoo1,400,00060,00010
AGNews120,0007,6004
SST26,9201,8212
Amazon3,600,000400,0002
IMDb25,00025,0002
Banking7710,0033,08077
CLINC15,250550150
+ +Table 1: Dataset statistics + +- PET: Pattern-Exploiting Training (Schick and Schütze, 2021) is a baseline zero-shot prompting method that transforms an input into a cloze-task and utilizes a single-word verbalizer to label data sample. +- KPT: Knowledge Prompt-Tuning (KPT) (Hu et al., 2022) is a multi-word verbalizer expansion of PET that extracts multi-words similar to the original label name from external knowledge bases. +- SimPTC: (Fei et al., 2022b) iteratively trains a Gaussian Mixture Model (GMM) on top of the LM's representations from the initial pseudo labels with E&M algorithm, which measures the similarity between the anchor embedding and data sample. + +# 5.4 Main Results + +Table 2 reports the performance of CELDA and other competing methods on 6 benchmarks with 3 LMs of varying size (770M to 11B). From the results, we share following observations: + +(1) Significant performance of CELDA: Our method consistently outperforms other competing methods by a large margin in varying language models. Additionally, another black-box WSL method (SimPTC) often fails to reach a stable convergence point and performance drops as the training continues2. This is because they estimate the class-specialized covariance matrix resulting in exponential growth of the model parameter. Thus SimPTC's decision boundary does not align well with the test distribution meaning that the model is prone to overfitting. We delve into this phenomenon in detail in the Appendix. However, our method constantly exhibits better performance and + +
T5-Large (770M)
SettingMethodDBPedia (14)Yahoo (10)AGNews (4)SST2 (2)Amazon (2)IMDb (2)
FullLDA98.7272.4091.3792.0996.0594.28
ZSLPET62.14 ± 0.034.00 ± 0.054.37 ± 0.069.96 ± 0.078.47 ± 0.177.96 ± 0.0
KPT81.69 ± 0.662.32 ± 0.484.79 ± 0.882.70 ± 0.487.22 ± 0.783.71 ± 0.6
WSLSimPTC68.49 ± 0.147.9 ± 0.187.01 ± 0.068.48 ± 0.094.75 ± 0.192.74 ± 0.0
CELDA84.47 ± 0.368.88 ± 0.190.03 ± 0.289.40 ± 0.594.70 ± 0.191.70 ± 0.1
T5 (3B)
FullLDA98.7573.7392.1194.2396.7495.35
ZSLPET62.11 ± 0.032.07 ± 0.046.36 ± 0.070.29 ± 0.068.84 ± 0.177.38 ± 0.0
KPT82.78 ± 0.262.17 ± 0.286.03 ± 0.386.05 ± 0.184.15 ± 0.581.93 ± 1.3
WSLSimPTC68.60 ± 0.250.20 ± 0.387.54 ± 0.189.79 ± 0.195.99 ± 0.194.46 ± 0.0
CELDA85.11 ± 1.570.35 ± 0.190.18 ± 0.392.42 ± 0.196.08 ± 0.194.55 ± 0.0
T5 (11B)
FullLDA98.8773.6492.2194.5197.0395.88
ZSLPET65.47 ± 0.039.66 ± 0.062.51 ± 0.071.00 ± 0.071.58 ± 0.171.78 ± 0.0
KPT83.45 ± 1.063.34 ± 0.286.09 ± 0.686.46 ± 0.188.03± 0.484.08 ± 1.2
WSLSimPTC69.83 ± 0.151.02 ± 0.588.61 ± 0.188.58 ± 0.096.42 ± 0.095.02 ± 0.0
CELDA86.88 ± 0.371.38 ± 0.690.29 ± 0.394.23 ± 0.496.78 ± 0.095.61 ± 0.0
+ +can capture precise decision boundaries without overfitting. An additional noteworthy observation is that CELDA approaches the fully supervised LDA with a small spread on most benchmarks. + +(2) Scalability of CELDAto large models: Additionally, our method demonstrates scalability to large models, meaning the performance of CELDA improves as the scale of the LM grows. Other methods are not scalable since the performance of ZSL method easily saturates and displays insignificant improvement, and other well-performing WSL methods often require explicit model training. However, the performance of CELDA method improves with the larger language model, which indicates that our method exploits the high quality representations from the larger model quite properly. + +# 6 Analysis + +We conduct an in-depth investigation of CELDA to elucidate its underlying mechanism in conjunction with our intuitions. For all analysis experiments, we utilize T5-large as a backbone model. + +Table 2: Experimental results on 6 benchmarks. Best method (except full LDA) for each dataset is indicated in **bold**. Full, ZSL, and WSL indicates fully supervised, zero-shot learning, and weakly-supervised learning, respectively. Our methods surpasses other compared methods and close the gap with fully supervised method. + +
ModelAccuracy
Vanilla Prompting (PET)80.96
+ LDA84.49
+ Recursive train85.45
+ multi-verbalizer88.10
+ feature augmentation88.57
+ data cleansing (CELDA)90.03
+ +Table 3: Component-wise ablation study in CE/LDA + +# 6.1 Ablations + +We carry out ablation studies in several aspects to further explore the effectiveness of the main components in our approach: + +Component ablation: To validate our model design, we conducted a component-wise ablation study on the AGNews dataset, where we sequentially added each component in CE LDA. From Table 3, we confirmed that our components improve the overall performance progressively. Specifically, as mentioned § 3.3, LDA learns a more precise decision from a noisy labeled dataset, and recursive + +![](images/c395513640cfde7a1e73e9bf2e97f2a29a984ca5611644f1c2767f798cd1a359.jpg) +(a) Accuracy of filtered & abandoned datasets. + +![](images/023085e31fd1621078eb07ae83b523e490cba0f9280bb97ee3018011bbdfb748.jpg) +(b) Remaining portion of dataset after filtering. + +training also gives marginal improvement. Moreover, utilizing a multi-word verbalizer as in Hu et al. (2022) and augmenting their logit representation increases the overall performance. Finally, applying our clustering-based data cleansing approach improves the performance further and yields the best performance. + +Effectiveness of data cleansing: We scrutinize our clustering-based filtering module in various aspects to verify its efficacy. Firstly, we compare the quality of both datasets: One that has survived after the data filtering stage (survived dataset for abbreviation) and the other that has been dropped (dropped dataset for short). Figure 3a illustrates the accuracy when the cluster filtering threshold $\tau$ changes. From the figure, we verified that our survived dataset has more accurate data samples, while the accuracy of dropped samples lags far behind survived dataset. Moreover, setting a stronger threshold $\tau$ increases the pseudo-label accuracy of the survived dataset and reaches a near-clean dataset, but the overall performance drops. It implies that giving strong conditions discards even meaningful samples, which is beneficial in training. As a support, we can verify that the accuracy of the dropped dataset also increases with a higher $\tau$ , and the total number of the survived sample decreases, as shown in Figure 3b. + +# 6.2 Impact of Initial Pseudo-labels + +Similar to other WSL methods, our methodology is heavily influenced by initial pseudo-labels. LMs generate highly reliable pseudo labels for coarsely labeled datasets, as shown in Figure 2. However, labeling a fine-grained dataset with LM often leads to poor performance, even with recent ZSL methods + +![](images/a4b751fa192aa9a233061518b8dc85f0b1032e0cef2c0b846630495908425088.jpg) +Figure 3: Filtered dataset has more accurate data samples while the accuracy of dropped samples exhibits poor performance. Setting a high strong threshold increases the pseudo label accuracy but the overall performance drops. +Figure 4: Experiments on fine-grained datasets. With a few true labels, our methods improves drastically. + +such as (Wang et al., 2021; Meng et al., 2020), only taking laborious manual engineering. Meanwhile, the hidden representations from LM have the potential to discriminate this fine-grained dataset without adaptation. For instance, in Banking dataset (77 classes) and CLINC dataset (150 classes), existing zero-shot labeling methods and WSL methods, including CE LDA, output unsatisfactory performances as seen in 4. + +CELDA can address this limitation by incorporate concepts from active learning (AL) which annotates a few selected samples with true labels through a human-in-the-loop pipeline. Specifically, we annotate $n$ -shot samples per class (total $n \times |\mathcal{Y}|$ samples) that are closest to each centroid. Then, we annotate whole sentences in each cluster with the true label from the closest sample and re-train LDA as usual. While this selection approach is quite simple, it selects highly-meaningful samples from the unlabeled dataset, significantly improving the performance of CELDA sharply with min + +![](images/a9acd1ffc86d757b6063fbe831a732911b9972b583fe741bd695d970ec406d50.jpg) +Figure 5: Correlation between the number of clusters and the performance. + +imal human annotated samples. As depicted in Figure 4, we revealed that labeling 8 shots per class on fine-grained datasets significantly enhances the performance (by nearly $50\%$ on average), where traditional methods tend to struggle. + +# 6.3 Number of Clusters + +We conducted an additional investigation of CELDA to analyze its the underlying mechanism. We utilize T5-large as a backbone mode and tested on AGNews dataset. Figure 5 illustrates the correlation between the number of clusters and the performance. We can confirm that the performance improves as the number of clusters increases, but slowly deteriorates when the number of clusters increases too much. As the total number of cluster increases, the samples belonging to each cluster decreases. Accordingly, entropy weight estimated from Eq. 4 becomes unreliable hurting the effectiveness of the overall data cleansing process. Based on this result, we set number of clusters to $16 \times |\mathcal{Y}|$ . + +# 7 Conclusion + +This work presents CE LDA, a practical framework for employing a black-box language model. We have sought room for improvement in three orthogonal directions: (1) Utilizing language models with high-quality representations (from the last layer and logit distribution). (2) Filtering unreliable data samples from the noisy dataset. (3) Recursively trains LDA, which is robust to noisy samples and avoids over-fitting by minimizing the overall model parameters. By fusing these elements, we demon + +strate the significant performance of CELDA on sundry classification tasks and its scalability with the language model size. In our follow-up study, we aim to employ sample-wise entropy from pseudolabeling in the data cleansing phase instead of utilizing the entropy of the cluster, which is highly course-grained. We expect that looking at fine-grained sample-wise entropy can yield a more precise data filtering effect, reducing meaningful samples from being dropped. + +# 8 Limitations + +While our method demonstrates strong performance in our experimental setups, potential issues may arise when the characteristics of the available unlabeled dataset drastically change. For one example, if the scale of the available dataset is too small, the effectiveness of our clustering-based data filtering may fall drastically, leading to poor performance. Or, if the dataset is highly unbalanced, our model cannot acquire information about several specific classes. One way to compensate for this shortcoming is to use an externally imported corpus or dataset, similar to other ZSL or WSL methods. Another drawback of CELDA is that the final performance is highly dependent on the performance of the initial pseudo label, as shown in ablation. Nevertheless, as demonstrated in our ablation studies, we can remedy this issue by labeling a few samples, like active learning. + +# 9 Acknowledgement + +This work was supported by Institute of Information & communications Technology Planning & Evaluation (IITP) grant funded by the Korea government(MSIT) [NO.2021-0-01343, Artificial Intelligence Graduate School Program (Seoul National University)] + +# References + +Roee Aharoni and Yoav Goldberg. 2020. Unsupervised domain clusters in pretrained language models. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7747-7763, Online. Association for Computational Linguistics. +Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. 2020. Language models are few-shot learners. Advances in neural information processing systems, 33:1877-1901. + +Martin Brümmer, Milan Dojchinovski, and Sebastian Hellmann. 2016. Dbpedia abstracts: a large-scale, open, multilingual nlp training corpus. In Proceedings of the Tenth International Conference on Language Resources and Evaluation (LREC'16), pages 3339-3343. +Inigo Casanueva, Tadas Temčinas, Daniela Gerz, Matthew Henderson, and Ivan Vulić. 2020. Efficient intent detection with dual sentence encoders. arXiv preprint arXiv:2003.04807. +Hyunsoo Cho, Hyuhng Joon Kim, Junyeob Kim, Sangwoo Lee, Sang-goo Lee, Kang Min Yoo, and Taeuk Kim. 2023. Prompt-augmented linear probing: Scaling beyond the limit of few-shot in-context learners. In Proceedings of the Thirty-Seventh AAAI Conference on Artificial Intelligence, AAAI. +Shizhe Diao, Xuechun Li, Yong Lin, Zhichao Huang, and Tong Zhang. 2022. Black-box prompt learning for pre-trained language models. arXiv preprint arXiv:2201.08531. +Ning Ding, Shengding Hu, Weilin Zhao, Yulin Chen, Zhiyuan Liu, Hai-Tao Zheng, and Maosong Sun. 2021. Openprompt: An open-source framework for prompt-learning. arXiv preprint arXiv:2111.01998. +Yu Fei, Ping Nie, Zhao Meng, Roger Wattenhofer, and Mrinmaya Sachan. 2022a. Beyond prompting: Making pre-trained language models better zero-shot learners by clustering representations. arXiv preprint arXiv:2210.16637. +Yuxiao Fei, Ping Nie, Zhao Meng, Roger Wattenhofer, and Mrinmaya Sachan. 2022b. Beyond prompting: Making pre-trained language models better zero-shot learners by clustering representations. Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, EMNLP. +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. +Ari Holtzman, Peter West, Vered Shwartz, Yejin Choi, and Luke Zettlemoyer. 2021. Surface form competition: Why the highest probability answer isn't always right. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing. +Jimin Hong, Jungsoo Park, Daeyoung Kim, Seongjae Choi, Bokyung Son, and Jaewook Kang. 2022. Tess: Zero-shot classification via textual similarity comparison with prompting using sentence encoder. arXiv preprint arXiv:2212.10391. +Shengding Hu, Ning Ding, Huadong Wang, Zhiyuan Liu, Juanzi Li, and Maosong Sun. 2021. Knowledgeable prompt-tuning: Incorporating knowledge into prompt verbalizer for text classification. arXiv preprint arXiv:2108.02035. + +Shengding Hu, Ning Ding, Huadong Wang, Zhiyuan Liu, Jingang Wang, Juanzi Li, Wei Wu, and Maosong Sun. 2022. Knowledgeable prompt-tuning: Incorporating knowledge into prompt verbalizer for text classification. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2225-2240, Dublin, Ireland. Association for Computational Linguistics. +Stefan Larson, Anish Mahendran, Joseph J. Peper, Christopher Clarke, Andrew Lee, Parker Hill, Jonathan K. Kummerfeld, Kevin Leach, Michael A. Laurenzano, Lingjia Tang, and Jason Mars. 2019. An evaluation dataset for intent classification and out-of-scope prediction. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing EMNLP. +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. +Yao Lu, Max Bartolo, Alastair Moore, Sebastian Riedel, and Pontus Stenetorp. 2022. Fantastically ordered prompts and where to find them: Overcoming few-shot prompt order sensitivity. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics, ACL. +Xinxi Lyu, Sewon Min, Iz Beltagy, Luke Zettlemoyer, and Hannaneh Hajishirzi. 2022. Z-icl: Zero-shot in-context learning with pseudo-demonstrations. arXiv preprint arXiv:2212.09865. +Andrew 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. +Julian McAuley and Jure Leskovec. 2013. Hidden factors and hidden topics: understanding rating dimensions with review text. In Proceedings of the 7th ACM conference on Recommender systems, pages 165-172. +Yu Meng, Yunyi Zhang, Jiaxin Huang, Chenyan Xiong, Heng Ji, Chao Zhang, and Jiawei Han. 2020. Text classification using label names only: A language model self-training approach. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP). +George A Miller. 1995. Wordnet: a lexical database for english. Communications of the ACM, 38(11):39-41. +Sewon Min, Mike Lewis, Hannaneh Hajishirzi, and Luke Zettlemoyer. 2022. Noisy channel language model prompting for few-shot text classification. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics. + +Kevin P Murphy. 2022. Probabilistic machine learning: an introduction. MIT press. +Ethan Perez, Douwe Kiela, and Kyunghyun Cho. 2021. True few-shot learning with language models. Advances in Neural Information Processing Systems, 34:11054-11070. +Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J Liu, et al. 2020. Exploring the limits of transfer learning with a unified text-to-text transformer. J. Mach. Learn. Res., 21(140):1-67. +Teven Le Scao, Angela Fan, Christopher Akiki, Ellie Pavlick, Suzana Ilic, Daniel Hesslow, Roman Castagné, Alexandra Sasha Luccioni, François Yvon, Matthias Galle, et al. 2022. Bloom: A 176b-parameter open-access multilingual language model. arXiv preprint arXiv:2211.05100. +Timo Schick and Hinrich Schütze. 2021. 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. +Timo Schick and Hinrich Schütze. 2021. 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, EACL. +Weijia Shi, Julian Michael, Suchin Gururangan, and Luke Zettlemoyer. 2022. Nearest neighbor zero-shot inference. arXiv preprint arXiv:2205.13792. +Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew Y 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. +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*. +Tianxiang Sun, Yunfan Shao, Hong Qian, Xuanjing Huang, and Xipeng Qiu. 2022. Black-box tuning for language-model-as-a-service. In International Conference on Machine Learning, ICML. +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. +Zihan Wang, Dheeraj Mekala, and Jingbo Shang. 2021. X-class: Text classification with extremely weak supervision. In Proceedings of the 2021 Conference of the North American Chapter of the Association + +for Computational Linguistics: Human Language Technologies. +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. +Lu Zhang, Jiandong Ding, Yi Xu, Yingyao Liu, and Shuigeng Zhou. 2021. Weakly-supervised text classification based on keyword graph. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing. +Susan Zhang, Stephen Roller, Naman Goyal, Mikel Artetxe, Moya Chen, Shuohui Chen, Christopher Dewan, Mona Diab, Xian Li, Xi Victoria Lin, et al. 2022. Opt: Open pre-trained transformer language models. arXiv preprint arXiv:2205.01068. +Xiang Zhang, Junbo Zhao, and Yann LeCun. 2015. Character-level convolutional networks for text classification. Advances in neural information processing systems, 28. +Zihao Zhao, Eric Wallace, Shi Feng, Dan Klein, and Sameer Singh. 2021. Calibrate before use: Improving few-shot performance of language models. In Proceedings of the 38th International Conference on Machine Learning, ICML. + +# Appendix + +# A Dataset Description + +In our experiments we use 8 different benchmark datasets which include topic classification, intent classification, question classification, and binary sentiment classification datasets. + +DBpeida (Brümmer et al., 2016) is an ontology classification dataset with DBpedia documents and 14 topics. It is a balanced dataset containing 40,000 training data and 5,000 testing data per class. + +Yahoo (Zhang et al., 2015) dataset is composed of a pair of questions and answers and a topic of it. + +AGNews (Zhang et al., 2015) is a news topic classification dataset from AG's news corpus with 4 different classes. + +IMDb (Maas et al., 2011) is a binary movie review dataset for sentiment classification. + +SST-2 (Socher et al., 2013) is for detecting the sentiment of a single sentence of the movie review. + +Amazon (McAuley and Leskovec, 2013) is a review dataset Amazon from various domains (e.g., electronic stuff) for sentiment classification. + +Banking77 (Casanueva et al., 2020) a intent classification dataset which comprises fine-grained 77 intents in a single banking domain regarding customer service queries. + +CLINC (Larson et al., 2019) is for classifying an intention of queries in dialog systems. The classes of CLINC dataset cover a total of 150 classes in 10 different domains and one out-of-scope class. + +# B Detailed Implementation Details + +In pseudo label initialization of training data, a zero-shot prediction ability of T5 is utilized with a template and verbalizers. Expanded label words are used as verbalizers in experiments of main datasets for rich logit representations and pseudo labels. We also take a template with a mask to get mask logit values of pre-defined verbalizers from the pretrained T5 model. + +Templates and Verbalizers: We apply manual templates from OpenPrompt (Ding et al., 2021) in zero-shot pseudo-labeling which are listed in Table 4. To annotate samples with pseudo-labeling, expanded label words constructed by KPT (Hu et al., 2021) are employed for each task (see Table 5). For Banking77 and CLINC dataset, we use true label words without any expansion due to their abundant classes (77 and classes). + +**Environments and Utilized Libraries:** We utilize 8 RTX A6000 (48GB) GPUs for the experiments. When we extract initial pseudo labels and representations, KPT framework (Hu et al., 2021) in a zero-shot setting is used with OpenPrompt (Ding et al., 2021) library. Among various sizes of T5 models, we utilize T5-large, T5-3B, and T5-11B from Transformers (Wolf et al., 2020) library in Huggingface. The batch size is set adaptively depending on the average length of each dataset and the size of T5. KMeans code from https://github.com/subhadarship/kmeansPytorchLibrary is also used in CELDA. + +# C Comparison with SimPTC + +As an implementation detail of SimPTC (Fei et al., 2022a), both the train and test datasets are used in fitting Bayesian Gaussian Mixture Model (BGMM) by considering them as a set of unlabeled data. Then, SimPTC measures the accuracy of the test dataset, which is a portion of the unlabeled dataset used in training GMM. It is different from our setting of using only a train dataset to train LDA. Thus we additionally experiment with the setting of SimPTC. + +Since SimPTC mainly uses SimCSE (Gao et al., 2021) supervised RoBERTa large (Liu et al., 2019) embeddings in their experiments, we also extract embeddings and construct pseudo labels of samples with SimCSE supervised RoBERTa large. SimCSE supervised RoBERTa significantly loses its ability of predicting masked words while finetuned with contrastive objective without MLM. Thus we could not perform mask prediction based zero-shot pseudo labeling with SimCSE supervised RoBERTa large. Instead, we initialize pseudo labels with Encode & Match, a process of generating pseudo-label, proposed by SimPTC, which assign a pseudo-label to each input embedding with class anchor sentence embeddings. Consequently, initial pseudo labels of samples are identical for both CELDA and SimPTC. + +We follow SimPTC's design of the experiment in reproducing its performance. The experiment with CELDA is performed without the representation augmentation since verbalizer logit representation is unavailable. + +According to the results in Table 6, CELDA outperforms SimPTC in most of the experiments. Especially, CELDA displays a better accuracy in most cases when we utilize only a train split dataset + +
Task typeDatasetTemplate
SentimentIMDb, SST2, AmazonIt was [MASK]. [input sentence]
TopicDBPedia[input sentence] is a [MASK].
YahooA [MASK] question : [input sentence]
AGNewsA [MASK] news : [input sentence]
Banking77, CLINC[ Category : [MASK]] [input sentence]
+ +Table 4: Pre-defined templates for each task. + +
DatasetVerbalizer (True label word: Expanded words)
IMDb, SST2, Amazonnegative: bad,abysmal,adverse,alarming,angry,annoy, anxious, worthless, wound,yell,yucky,... positive: good,absolutely, accepted,acclaimed,accomplish, wealthy,welcome,well,whole,...
DBPediacompany: corporation, company, corp, shareholder, enterprise, conglomerate, firm,... school: school, education, university, academy, college, teacher, classroom,... book: novel, publication, book, fiction, publishing, author, prose, magazine, text, novella,...
Yahoosociety: society, culture, civilization, philosophy, association, anthropology, guild, subculture,... science: science, mathematics, biology, mathematician, scientist, calculus, geometry,... politics: politics, government, governance, administration, law, democracy, aristole, state,...
AGNewspolitics: politics,government,diplomatic,law,aristotle,diplomical,governance, republic,... sports: sports,athletics,gymnastics,sportsman,competition,cycling,soccer,tennis,game,... technology: technology,engineering,science,biotechnology,internet,nanotechnology,...
+ +Table 5: Pre-defined verbalizers for each task. + +which is a usual case in machine learning. Even in using both train and test datasets as an unlabeled dataset, CELDA outperforms SimPTC in most of the results. While LDA in CELDA shares covariance among classes, GMM in SimPTC computes a covariance matrix for each class. It causes overfitting on training samples and results in poor performance in test cases. For CELDA, the overall performance of two different settings are stable with a tied-covariance. Since SimPTC uses tied-covariance setting for IMDb and Amazon datasets, the performance of SimPTC and CELDA are close in both cases. + +
SplitMethodDBPedia (14)Yahoo (10)AGNews (4)IMDb (2)SST2 (2)Amazon (2)
TrainSimPTC67.22 ± 0.550.60 ± 0.185.53 ± 0.488.13 ± 0.089.99 ± 0.394.46 ± 0.2
CELDA83.43 ± 0.161.34 ± 0.988.82 ± 0.587.11 ± 0.190.18 ± 0.294.50 ± 0.1
+ TestSimPTC80.43 ± 0.063.13 ± 0.085.82 ± 0.188.47 ± 0.088.8 ± 0.294.38 ± 0.1
CELDA83.47 ± 0.262.62 ± 0.188.09 ± 0.487.62± 0.189.91 ± 0.194.39 ± 0.1
+ +Table 6: Experimental results on 6 datasets with SimCSE-Roberta-Large. While our method constantly exhibits similar performance with or without a test split, SimPTC's decision boundary does not align well without the test split, meaning that the model is prone to overfitting. + +A For every submission: + +A1. Did you describe the limitations of your work? section 8 +A2. Did you discuss any potential risks of your work? section 8 +A3. Do the abstract and introduction summarize the paper's main claims? abstraction, section 1 +A4. Have you used AI writing assistants when working on this paper? Left blank. + +B Did you use or create scientific artifacts? + +section 5,6 + +B1. Did you cite the creators of artifacts you used? appendix A +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? appendix A +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? Not applicable. Left blank. +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? Not applicable. Left blank. +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? Not applicable. Left blank. +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. +appendix A + +C Did you run computational experiments? + +section 5 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? section 5 appendix c + +The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? section 5 appendix c +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? section 5 +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? +appendix c + +# D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? No response. +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? No response. +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? No response. +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? No response. +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? No response. \ No newline at end of file diff --git a/celdaleveragingblackboxlanguagemodelasenhancedclassifierwithoutlabels/images.zip b/celdaleveragingblackboxlanguagemodelasenhancedclassifierwithoutlabels/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..e298e47ab04caff70c471cb57482a74f4751a072 --- /dev/null +++ b/celdaleveragingblackboxlanguagemodelasenhancedclassifierwithoutlabels/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:830bfe0b280a59bf7a9a723d4401dc610969c6f453eaaadf5192d3cccab5eb17 +size 657933 diff --git a/celdaleveragingblackboxlanguagemodelasenhancedclassifierwithoutlabels/layout.json b/celdaleveragingblackboxlanguagemodelasenhancedclassifierwithoutlabels/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..2b227101bf764c5143f450a4877838b53892710b --- /dev/null +++ b/celdaleveragingblackboxlanguagemodelasenhancedclassifierwithoutlabels/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0205f81d8f5c667b5033abb351bcfb24e64147c7803fe7acfd816a0187f05f7b +size 494890 diff --git a/cfsumcoarsetofinecontributionnetworkformultimodalsummarization/319a3897-5465-409f-a8cf-21bf18faaf06_content_list.json b/cfsumcoarsetofinecontributionnetworkformultimodalsummarization/319a3897-5465-409f-a8cf-21bf18faaf06_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..ffe123cb660d54975a1c19b0e5b956c90307ea62 --- /dev/null +++ b/cfsumcoarsetofinecontributionnetworkformultimodalsummarization/319a3897-5465-409f-a8cf-21bf18faaf06_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a5c46e001bce14267b29606429e8e35428d0f92192b005e8aeb367dbe32fccf8 +size 97821 diff --git a/cfsumcoarsetofinecontributionnetworkformultimodalsummarization/319a3897-5465-409f-a8cf-21bf18faaf06_model.json b/cfsumcoarsetofinecontributionnetworkformultimodalsummarization/319a3897-5465-409f-a8cf-21bf18faaf06_model.json new file mode 100644 index 0000000000000000000000000000000000000000..f8f9d49f5a4868e58fa75cf272c9a497f2f371d8 --- /dev/null +++ b/cfsumcoarsetofinecontributionnetworkformultimodalsummarization/319a3897-5465-409f-a8cf-21bf18faaf06_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6f609478fc57af1ac89a55fabfe77ff66b7e37544becf5f4dfa170527e7cb56a +size 118153 diff --git a/cfsumcoarsetofinecontributionnetworkformultimodalsummarization/319a3897-5465-409f-a8cf-21bf18faaf06_origin.pdf b/cfsumcoarsetofinecontributionnetworkformultimodalsummarization/319a3897-5465-409f-a8cf-21bf18faaf06_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..860eb2656734ed934dfb9467c884f4ebd5946c4b --- /dev/null +++ b/cfsumcoarsetofinecontributionnetworkformultimodalsummarization/319a3897-5465-409f-a8cf-21bf18faaf06_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:494e903dc5c28e8b52ac8b588b72f5858f520082370990ac0099f776cab75b26 +size 1850128 diff --git a/cfsumcoarsetofinecontributionnetworkformultimodalsummarization/full.md b/cfsumcoarsetofinecontributionnetworkformultimodalsummarization/full.md new file mode 100644 index 0000000000000000000000000000000000000000..9224bb8f6f725c5480580db0f965883c99480f2d --- /dev/null +++ b/cfsumcoarsetofinecontributionnetworkformultimodalsummarization/full.md @@ -0,0 +1,474 @@ +# CFSum: A Coarse-to-Fine Contribution Network for Multimodal Summarization + +Min Xiao $^{1,2}$ , Junnan Zhu $^{1,2}$ , Haitao Lin $^{1,2}$ , Yu Zhou $^{1,3*}$ , Chengqing Zong $^{1,2}$ + +$^{1}$ State Key Laboratory of Multimodal Artificial Intelligence Systems, Institute of Automation, CAS, Beijing, China + +$^{2}$ School of Artificial Intelligence, University of Chinese Academy of Sciences, Beijing, China + +3Fanyu AI Laboratory, Zhongke Fanyu Technology Co., Ltd, Beijing, China {min.xiao, junnan.zhu, Haitao.lin, yzhou, cqzong} @nlpr.ia.ac.cn, + +# Abstract + +Multimodal summarization usually suffers from the problem that the contribution of the visual modality is unclear. Existing multimodal summarization approaches focus on designing the fusion methods of different modalities, while ignoring the adaptive conditions under which visual modalities are useful. Therefore, we propose a novel Coarse-to-Fine contribution network for multimodal Summarization (CFSum) to consider different contributions of images for summarization. First, to eliminate the interference of useless images, we propose a pre-filter module to abandon useless images. Second, to make accurate use of useful images, we propose two levels of visual complement modules, word level and phrase level. Specifically, image contributions are calculated and are adopted to guide the attention of both textual and visual modalities. Experimental results have shown that CFSum significantly outperforms multiple strong baselines on the standard benchmark. Furthermore, the analysis verifies that useful images can even help generate nonvisual words which are implicitly represented in the image1. + +# 1 Introduction + +With the information explosion, the internet is flooded with various multimodal information. Multimodal summarization (MMS) can help generate more abundant and comprehensive summary information than unimodal based on extra visual information. Existing studies on multimodal summarization include multimodal sentence summarization (Li et al., 2018b), multimodal summarization with + +![](images/0e5ee009ab715d618d3f4a900b72e4876792ba992ad5073fef7f02818882f644.jpg) +Figure 1: Experiments on existing mainstream multimodal summarization models. The performance is not affected by masking images. "Concat" is the concatenate fusion method, and "Attn" is the attention-based fusion method. + +multimodal output (Zhu et al., 2018), multimodal meeting summarization (Li et al., 2019) and so on. In this paper, we focus on the task that generating a text summary based on the input of a text and an image. It has been proved that integrating multimodal data can help improve the quality of the summary (Li et al., 2018b; Jangra et al., 2020; Palaskar et al., 2019; Yu et al., 2021). + +However, it is unclear whether the visual modality can indeed benefit the process of summarization. Thus, we conduct an experiment to explore the influence of masking images on the summary. As shown in Figure 1, the solid lines mean the performance of summary generated by masking portions of images, and the dashed lines indicate the origin performance. It can be observed that the dashed and the solid lines roughly coincide, which indicates that masking images do not affect the performance of the multimodal model. Some masking rates can even raise the ROUGE-1 value of the summary. It indicates that existing models do not make effective use of image information for + +the summary. + +Existing approaches have two major problems. First, existing studies focus on multimodal fusion, such as concatenate, attention-based, and gate-based fusion (referring to Related Work). However, they ignore the adaptive conditions under which visual modalities are helpful. Thus they are poor at extracting useful visual information. Furthermore, all fusion methods do not explicitly model the image complementarity for the summary. Especially for the attention-based method, the inter-attention is not accurate enough, which leads to inefficient use of the image. Second, in many samples, the image may introduce noise, while existing fusion methods assume that all images are helpful for the summary without considering the interference of useless images. As analyzed above, we believe that: 1) It is essential to eliminate the influence of the useless image. 2) The contributions of the image to the summary need to be clarified. In particular, it is necessary to consider the complementarity of visual information relative to textual information. + +Although we notice the lack of image contributions, it is difficult to detach various roles of images from a single fusion layer. Thus, in this work, we propose a novel Coarse-to-Fine contribution network for multimodal Summarization (CFSum) to extract the role of the image at different stages. First, we apply a pre-filter module to abandon useless images. It coarsely obtains helpful images for the summary. Specifically, the consistency of content between image and text is calculated. If the consistency is low, the image will be masked in subsequent encoding. Second, when the image is coarsely useful, the complement module is employed to finely guide the fusion of text with the image. To consider image contributions for text with different granularities, the complement module consists of two levels, word level and phrase level. For the word level complement module, to obtain the image complementarity over the text, the difference between bi-modal and uni-modal inputs is measured through a classification task. Then we add a loss to guide the attention between words and the image. For the phrase level complement module, similar to the word level, the image complementarity on phrases is acquired to guide the attention between phrases and the image. Through these modules, the model can acquire more explicit image contributions and provide better multimodal encoding for summary generation. + +Our contributions are as follows: + +(1) We propose a Coarse-to-Fine contribution network for multimodal Summarization (CFSum) to model different contributions of images for summarization. +(2) We innovatively design a pre-filter module to coarsely reduce the interference of the useless images and develop two visual complement modules to finely obtain image complementarity over the summary. +(3) Experimental results show that our model outperforms strong baselines. Besides, extensive analysis proves that useful image even contributes to non-visual words which are implicitly represented in the image. + +# 2 Related Work + +Multimodal Summarization Tasks. In the field of multimodal summarization, there are usually three steps. First, different feature extractor modules are adopted to extract the features of the text and the image, respectively. Second, the different features are fused at the fusion layer. Finally, the fused context features are fed into the text decoder to generate a summary. Existing studies focus on multimodal fusion. Specifically, the fusion methods consist of concatenate, attention-based, and gate-based. The concatenate fusion directly concatenates multimodal features into a fusion context (Li et al., 2018b, 2020a). It can fully extract high-level features of different modalities, but there is a large gap between high-dimensional spaces. The attention-based methods fuse all multimodal features with attention mechanism (Atri et al., 2021; Palaskar et al., 2019; Kitada et al., 2022), which can get the correlations between each unit of text and image. Gate-based methods take text as the central modality (Jangra et al., 2021) and exploit images to help focus on the core information (Liu et al., 2020; Li et al., 2020b). In summary, (1) all fusion methods do not explicitly model the image complementarity for the summary, which leads to inefficient use of the image. (2) concatenate and attention-based cannot eliminate the influence of useless images in the fusion layer. + +Cross-modal tasks. Some studies have noted the contributions of modalities and explored the cross-modal influence in other multimodal tasks. Zeng et al. (2021) propose loss modulation to explore the contribution of individual modalities and devise a modality filter to reduce modality noise, which con + +![](images/88c492a8fc5b4930c7807c7cd63595de417168dbac56c27c68c87b86a12d0c09.jpg) +Figure 2: CFSum framework. $L_{f}, L_{w}, L_{p}$ denote the starting layer of the pre-filter, the word-level complement, and the phrase-level complement modules, respectively. + +![](images/422ba70c6976ab7c3bc406230ab8d4a377bc92c71ab2bf4484bffe7ca206f992.jpg) + +siders consistency and complementarity between different modalities. Zhu et al. (2018) propose multi-task summarization: the method also selects the image that best matches the summary when generating a text summary. It guarantees the positive effect of images on the summary. Li et al. (2022) exploit ReLu-based cross-attention to align visual features to textual representation, which abandons low-value attention scores for those unaligned visual features. Inspired by the above studies, we propose CFSum, which considers various image contributions for better encoding input text and generating the final summary. + +# 3 Proposed Methods + +# 3.1 Overview + +In this section, we introduce the details of CF-Sum. Given a dataset consisting of $n$ triplets $(t_i, v_i, s_i)_{i \in [1, n]}$ with a text $t_i$ , an image $v_i$ , and a summary $s_i$ , the multimodal summarization task aims at generating $s_i$ based on $t_i$ and $v_i$ . + +As depicted in Figure 2, the CFSum takes bimodal and uni-modal streams as input parallelly. It builds coarse and fine image contributions with three modules (Coarse-to-Fine Structure). First, the pre-filter module coarsely filters the images inconsistent with texts (Pre-filter Module). Second, two levels of visual complement modules consisting of word level (Word-level Complement) and phrase level (Phrase-level Complement) make accurate use of useful images. + +# 3.2 Coarse-to-Fine Structure + +We build our model based on the multimodal transformer UNITER (Chen et al., 2020) and GRU (Chung et al., 2014) encoder-decoder architectures. We refer the model to UniG. As shown in Figure 2(a), in order to evaluate the complementarity of different modalities, the bi-modal and uni-modal inputs are operated parallelly with the same encoder. The two parallel streams can catch the gain of the image. Additionally, we generate a summary relying on bi-modal encoding. Uni-modal encoding assists in measuring various contributions and guiding the bi-modal encoding. + +Specifically, the multimodal encoder consists of $L = 12$ multimodal transformer layers. We serve the $L$ layers as a hierarchical structure and divide $L$ layers into three parts as shown in Figure 2(a). $L_{f}, L_{w}, L_{p}$ mark as the starting layer of the pre-filter, the word-level complement, and the phrase-level complement modules, respectively. Existing studies assume all images benefit summary generation or input text encoding, resulting in damage from unnecessary images. The pre-filter module is utilized to eliminate the interference of misleading images in advance. Next, the word-level complement module is developed to model the gain of the image on input words for the summary. Then the image gain guides the subsequent attention between words and the image. Finally, similar to the word level, the phrase-level complement module concentrates on phrases at higher layers. Each component will be elaborated in the following subsections. + +# 3.3 Pre-filter Module + +The bi-modal and uni-modal features from the $i^{th}$ layer are encoded as $m^i\in \mathbb{R}^{C\times H}$ , $u^i\in \mathbb{R}^{T\times H}$ where $i\in [1,L]$ , and $C,T$ denote the lengths of bi-modal and uni-modal tokens. $H$ denotes the hidden dimension. The bi-modal self-attention matrix in the $i^{th}$ layer is $A^i = (a_{r,s}^i)\in \mathbb{R}^{C\times C}$ . + +The pre-filter module aims at filtering images that are unnecessary to the summary. As shown in Figure 2(a), given two encoded features $m^{L_f}$ and $u^{L_f}$ from the $L_f^{th}$ layer, the goal of the filtering module is to select those useless images and guide the self-attention of all subsequent layers. We believe that if the bi-modal feature has low consistency with the uni-modal feature, the image may introduce interferential information. Specifically, we first calculate the consistency $\Delta^C$ between uni-modal feature $u^{L_f}$ and bi-modal feature $m^{L_f}$ as follows: + +$$ +p u = \operatorname {M e a n P o o l} \left(u ^ {L _ {f}}\right), \tag {1} +$$ + +$$ +p m = \operatorname {M e a n P o o l} \left(m ^ {L _ {f}}\right), \tag {2} +$$ + +$$ +\Delta^ {C} = \operatorname {S i g n} (\operatorname {c o s i n e} (p u, p m) - \alpha) \tag {3} +$$ + +We define the indicator function as: + +$$ +I _ {r, s} = \left\{ \begin{array}{l l} 1, & r \geq T, s \geq T \\ 0, & \text {o t h e r w i s e} \end{array} \right. \tag {4} +$$ + +which represents the text attending to the image, the image attending to the text, and the image attending to itself shown in Figure 2(a). Then we calculate the new subsequent self-attention $na_{r,s}^{i}$ with: + +$$ +n a _ {r, s} ^ {i} = a _ {r, s} ^ {i} \times \left(1 - I _ {r, s}\right) + a _ {r, s} ^ {i} \times I _ {r, s} \times \Delta^ {C}, \tag {5} +$$ + +$$ +i \in [ L _ {f} + 1, L ] +$$ + +By correcting the attention matrix, the image with a large deviation in content is cropped out. In other words, the multimodal inconsistency features degenerate into text-only features through this process. The simple method has been shown to be effective in our experiments. + +# 3.4 Word-level Complement + +This section introduces a word-level complement module, considered as an auxiliary task during the training process. First, we measure the image gain on input words for the summary. Then the image gain is applied to guide the attention between words and the image (as shown in Figure 2(b)). + +Image gain measurement. Intuitively, the text tokens should concern the image which is helpful for the summary. In previous attention-based studies, inter-modality correlation can be modeled as $\mathrm{softmax}\left(\frac{QK}{\sqrt{D}}\right)V$ . $Q$ , $K$ , $V$ are the projected features from the bi-modal input. However, it does not explicitly model the image complementarity for the summary, which leads to inefficient use of the image. + +Following the motivation above, we hope to calculate the image gain on the summary with mutual information. In other words, we want to measure whether generating summaries based on bi-modal feature $m^L$ is more deterministic than generating summaries based on uni-modal feature $u^L$ . Thus, we expect to calculate the image gain on the $k$ -th word of the reference summary: + +$$ +G I _ {k} = \operatorname {G a i n} \left(s _ {k} / u ^ {L}, s _ {k} / m ^ {L}\right) \tag {6} +$$ + +However, we intend to obtain $GI_{k}$ before generating summary $S$ and encoding $m^{L}$ . Thus $GI$ can be beneficial for generating $S$ and encoding $m^{L}$ . To this end, we define Copy Classification task $Y$ to approximate the summary task $S$ : for each input text token $t_{j}$ , the target is to binary categorize whether it appears in the reference summary. If the token appears in the reference summary, it is classified as $\hat{y}_{j} = 1$ ; otherwise, $\hat{y}_{j} = 0$ . Next, the $GI_{j}$ is given by: + +$$ +G I _ {j} = \operatorname {G a i n} \left(y _ {j} / u ^ {L _ {w}}, y _ {j} / m ^ {L _ {w}}\right) \tag {7} +$$ + +where $u^{L_w}, m^{L_w}$ denote the uni-modal and the bi-modal feature acquired by $L_{w}^{th}$ layer. Finally, we measure the gain that the image brings to predict whether a word appears correctly in the summary as follows: + +$$ +\begin{array}{l} G I _ {j} = G a i n \left(y _ {j} / m ^ {L _ {w}}, y _ {j} / u ^ {L _ {w}}\right) \\ = \log P \left(y _ {j} = \hat {y} _ {j} / m ^ {L _ {w}}\right) - \log P \left(y _ {j} = \hat {y} _ {j} / u ^ {L _ {w}}\right) \tag {8} \\ \end{array} +$$ + +Derivation details can refer to the Appendix B. In addition, to ensure the correct gain direction, we add a binary cross-entropy loss to train the Copy Classification Task $Y$ : + +$$ +\mathcal {L} _ {\text {c o p y c}} = \mathrm {B C E} \left(y _ {j}, \hat {y} _ {j} / m ^ {L _ {w}}\right) + \mathrm {B C E} \left(y _ {j}, \hat {y} _ {j} / u ^ {L _ {w}}\right) \tag {9} +$$ + +Image gain application. We introduce divergence loss to restrain that the image with greater gain should receive more textual attention. In successive $i^{th}$ layer, the average interattention between each text token $t_j$ and the image is: + +$$ +T 2 V _ {j} ^ {i} = \frac {1}{2 (C - T)} \left(\sum_ {s = T + 1} ^ {s = C} a _ {j, s} ^ {i} + \sum_ {s = T + 1} ^ {s = C} a _ {s, j} ^ {i}\right) \tag {10} +$$ + +where $a_{j,s}^{i}, a_{s,j}^{i}$ represent the attention of image-to-text and text-to-image, respectively. + +Finally, an attention divergence loss is added to restrain the inter-attention scores $T2V_{j}^{i}$ with $GI_{j}$ : + +$$ +\mathcal {L} _ {\text {w o r d}} = \mathrm {K L} \left(\operatorname {S o f t m a x} \left(G I _ {j}\right) \mid \mid \operatorname {A v g} \left(T 2 V _ {j} ^ {i}\right)\right) \tag {11} +$$ + +By minimizing the divergence loss, the text token attends to the image according to the gain it brings. Interaction between word gain and inter-attention learns to pay attention to the useful image. Appendix C provides examples to figure out the word-level complement. + +# 3.5 Phrase-level Complement + +Considering the image contribution to text of different granularities, we put forward a phrase-level complement module similar to the word level (as shown in Figure 2(c)). + +Image gain measurement. Different from copy classification task at the word level, we define Copy Scorer task to measure the image gain on phrases: We obtain phrases $\{p_1,\dots ,p_k\dots \}$ from the text with StandfordNLP2. $\{l_1,\ldots ,l_k\dots \}$ is the number of words in the phrases. The task targets scoring the proportion of words that appear in both the phrase and the reference summary: + +$$ +R _ {p _ {k}} ^ {u} = \operatorname {S c o r e r} \left(u ^ {L _ {p}}\right) \tag {12} +$$ + +$$ +R _ {p _ {k}} ^ {m} = \operatorname {S c o r e r} \left(m ^ {L _ {p}}\right) \tag {13} +$$ + +where Scorer is a MLP. The ground truth proportion is obtained with the following: + +$$ +\hat {R _ {p _ {k}}} = \frac {\operatorname {C o u n t} _ {t _ {j ^ {\prime}} \in p _ {k}} \left(t _ {j ^ {\prime}}\right)}{l _ {k}} \tag {14} +$$ + +where $\text{Count}_{t_{j'}} \in p_k$ denotes the number of words that appear in both the phrase $p_k$ and the reference summary. Therefore, the image gain on phrase can be acquired as: + +$$ +G S _ {p _ {k}} = \left| R _ {p _ {k}} ^ {u} - \hat {R _ {p _ {k}}} \right| - \left| R _ {p _ {k}} ^ {m} - \hat {R _ {p _ {k}}} \right| \tag {15} +$$ + +Similarly, to guarantee the correctness of phrase gain, we add a squared loss for the Copy Scorer task: + +$$ +\mathcal {L} _ {\text {c o p y s}} = \operatorname {M S E} \left(R _ {p _ {k}} ^ {m}, R _ {p _ {k}} ^ {\hat {r}}\right) + \operatorname {M S E} \left(R _ {p _ {k}} ^ {u}, R _ {p _ {k}} ^ {\hat {r}}\right) \tag {16} +$$ + +Especially, for the convenience of applying phrase gain $GS_{p_k}$ , we project it to token gain $GS_j$ as: + +$$ +G S _ {j} = \max \left\{G S _ {p _ {k}}, t _ {j} \in p _ {k} \right\} \tag {17} +$$ + +Image gain application. Second, we introduce a phrase attention divergence loss to restrain that the image with greater phrase gain should receive more textual attention. We obtain the inter-attention score $T2V_{j}^{i}$ from $i \in [L_p + 1, L_p + 3]$ layers as formula 10. Finally, we restrain it with the following: + +$$ +\mathcal {L} _ {\text {p h r a s e}} = \mathrm {K L} \left(\operatorname {S o f t m a x} \left(G S _ {j}\right) \mid \mid \operatorname {A v g} \left(T 2 V _ {j} ^ {i}\right)\right) \tag {18} +$$ + +The phrase-level restraint guarantees the image contributing to the text of phrase granularity. + +# 3.6 Training and Inference + +In the training phase, to ensure the accuracy of the information difference between bi-modal and uni-modal, we initialize the model only with the summary generation loss. We apply negative log-likelihood for the target word sequence as the overall loss: + +$$ +\mathcal {L} _ {\text {g e n}} = \frac {1}{T} \sum_ {t = 1} ^ {T} (- \log P (s _ {t})) \tag {19} +$$ + +Then the model is finetuned with the hierarchical modules' objectives: + +$$ +\mathcal {L} = \mathcal {L} _ {\text {g e n}} + \mathcal {L} _ {\text {w o r d}} + \mathcal {L} _ {\text {p h r a s e}} + \mathcal {L} _ {\text {c o p y c}} + \mathcal {L} _ {\text {c o p y s}} \tag {20} +$$ + +In the inference phase, we only maintain the prefilter module. $\mathcal{L}_{word}$ and $\mathcal{L}_{phrase}$ are added to let the model learn how to fuse multimodal information. Hence, differences in training and inference phases would not hurt the generation. + +
DatasetSizeSrc. Length +(Min/Avg/Max)Ref. Length +(Min/Avg/Max)
train62,00011/21.68/632/7.72/25
dev2,00011/24.35/473/7.68/17
test2,00011/22.97/513/7.67/24
+ +Table 1: Statistical information about the dataset. "Src. Length" and "Ref. Length" denote the number of words in the source sentence and reference summary. + +# 4 Experiment + +# 4.1 Settings + +We experiment with the multimodal sentence summarization dataset $^3$ (Li et al., 2018a). It contains + +
ROUGE-1ROUGE-2ROUGE-LBLEUBERTScoreMoverScore
LeadΔ33.6413.4031.84---
CompressΔ31.5611.0228.87---
ABSΔ35.9518.2131.89---
SEASSΔ44.8623.0341.92---
Multi-SourceΔ39.6719.1138.03---
Doubly-AttentionΔ41.1121.7539.92---
MAttΔ47.2824.8544.48---
MSEΔ45.6323.6842.97---
UniG (T)45.9024.0842.9847.0986.5431.06
UniG46.2224.2843.4746.8586.5730.95
K1CFSum-F347.39*25.42*44.35*48.51*86.90*31.89*
CFSum-W647.33*25.38*44.26*48.43*86.91*31.84*
CFSum-P947.28*25.13*44.18*48.19*86.91*31.67
K2CFSum-W6F947.53*25.37*44.41*48.48*86.94*32.24*
CFSum-F3W647.66*25.33*44.54*48.45*86.95*31.88*
CFSum-F3P947.72*25.51*44.58*48.66*86.96*32.03*
K3CFSum-F3W6P947.86*25.64*44.64*48.83*86.98*32.36*
CFSum-F9W3P647.58*25.42*44.49*48.35*86.95*32.10*
+ +Table 2: Automatic evaluation results of CFSum. “ $\triangle$ ” marks the results from Li et al. (2018b) and Li et al. (2020b) $^4$ . “K1/2/3” denotes one/two/three kind(s) of contribution(s). “*” indicates the model performs significantly better than the UniG by the $95\%$ confidence interval $(p<0.05)$ . + +66,000 samples in total. And each sample is a triplet of . Some statistical information is shown in Table 1. Appendix D gives the categories of test images. + +We set both the text embedding dimension and hidden dimension as 768. We apply "bert-base-uncased" (Devlin et al., 2019) vocabulary with 28,996 tokens. The dropout (Srivastava et al., 2014) rate is set to 0.1. Besides, the batch size is set to 8. For texts, we use the max text encoding length of 60, and the minimum text decoding length is 8. For images, the object detection tool BUTD (Anderson et al., 2018) is applied to extract the image feature, with the maximum boxes as 36. We use the Adam (Kingma and Ba, 2014) optimizer and set the learning rate as $5e - 05$ , momentum parameters as $\beta_{1} = 0.9$ , $\beta_{2} = 0.98$ . The model is initially trained with the summary generation loss for 35 epochs. To obtain our final model, we train for a further 15 epochs with the hierarchical framework. In the test phase, we employ beam search and set the beam size as 4 to generate the summary. The parameter $\alpha$ in the pre-filter module is set as $\alpha = 0.65$ . + +# 4.2 Comparative Methods + +Lead: Exploiting the first eight words as the summary. + +Compress (Clarke and Lapata, 2008): It uses in- + +teger linear programming to infer global optimal compressions. + +ABS (Rush et al., 2015): It utilizes an attention-based model to generate words of summary conditioned on the input text. + +SEASS (Zhou et al., 2017): It constructs a second-level sentence representation with a sentence encoder and a selective gate for summarization. + +Multi-Source (Libovický and Helcl, 2017): It combines multiple source modalities based on the hierarchical attention mechanisms over each modality for solving the multimodal machine translation. + +Doubley-attentive (Calixto et al., 2017): It uses two separate attention mechanisms to incorporate the visual feature, which minified the gap between the image and the translation. + +MAtt (Li et al., 2018b): It proposes modality attention and image filtering for multimodal summarization. + +MSE (Li et al., 2020b): It proposes to apply the visual selective gates to multimodal summarization. + +UniG: It is our base model with multimodal transformer UNITER and GRU decoder. + +UniG (T): UniG fed only with textual modality. + +# 4.3 Automatic Evaluation Results + +Our methods are reported with six automatic metrics, including ROUGE-1, ROUGE-2, ROUGE-L (Lin and Hovy, 2002), BLEU (Papineni et al., 2002), BERTScore (Zhang* et al., 2020), and MoverScore (Zhao et al., 2019). More details of + +![](images/4d73efc9f400a22a1867815b4f9942e98f9a4da1de92ec6bd62b99db750060c9.jpg) +Figure 3: Visualization of word-complement gain and phrase-complement gain produced by our model. $\triangle / \bullet$ indicates that the value is greater than 0. + +
ModelInformativenessFluencyNon-Redundancy
UniG (T)3.633.482.91
UniG3.693.663.05
CFSum3.913.903.31
+ +Table 3: Human evaluations. 1 stands for the worst, and 5 stands for the best for three metrics. + +evaluation scripts are given in Appendix A. + +Comparisons with Baselines. We compare our work with our baselines and other work on the multimodal sentence summarization dataset. Table 2 shows the results of different models. The results show that UniG performs comparably with UniG (T). CFSums build on UniG, and introduces coarse-to-fine contribution network. "F", "W", and "P" represent the pre-filter, the word-level complement, and the phrase-level complement modules contained in the CFSum. The footnote is the location of the corresponding module. For example, CFSum- $F_3$ contains a pre-filter module with $L_f = 3$ . Generally, our methods CFSums outperform the baselines UniG (T) and UniG. The best methods is CFSum- $F_3W_6P_9$ . And it achieves 1.64 higher points on ROUGE-1 than UniG. We also conduct ablation experiments by applying one or two kinds of contributions. The results demonstrate that each image contribution benefits the model. In addition, combining all image contributions brings greater gains than a single contribution. Therefore, it can be concluded that different contributions are complementary to the summary. Besides, we conduct ablation studies by placing the pre-filter module at the beginning ( $L_f = 3$ ) or the end of the hierarchical layers ( $L_f = 9$ ). In comparison, placing the pre-filter module at the beginning (CFSum- $F_3W_6P_9$ ) yields better performance. + +# 4.4 Human Evaluation Results + +We randomly select 50 samples from the test dataset and invite three postgraduates to score 1-5 for the summary quality. The evaluation metrics include informativeness, fluency, and non + +redundancy. (1) Informativeness: Does the system summary contain comprehensive reference content? (2) Fluency: Is the system summary grammatically correct and readable? (3) Non-Redundancy: Does the system summary not have redundant or incorrect information relative to the reference summary? Table 3 shows the human evaluation results. We run the inter-annotator agreement study on three volunteers' scores and achieve reasonable scores, 0.47, 0.39, and 0.43 on informativeness, fluency, and non-redundancy, respectively. The results show that our method CFSum- $\mathbf{F}_3\mathbf{W}_6\mathbf{S}_9$ achieves the best performance on all three aspects over UniG (T) and UniG baselines. Thus we conclude that our method is also effective through human evaluation. + +# 4.5 Further Analysis + +# 4.5.1 Complement Modules Analysis + +In other multimodal tasks such as image captioning and multimodal translation, their models learn to attend to the image more for visual words like "red", "rose" and "woman" (Lu et al., 2017; Calixto et al., 2017). Since our proposed complement modules aim at extracting complementary information relative to textual modality, we want to know which word or phrase the image provides gains on. As shown in Figure 3, we visualize the complement gain value for the input words. We manually align the reference summary and the input text. The word highlighted with a red box indicates that it appears in the reference summary generatively5 or extractively. + +First, we find that words with positive image gain can basically cover the reference summary information. It proves that our calculated gain helps in generating the target summary words. Second, it can be observed that different complement modules bring positive gains in different areas, which means different levels of complement modules are complementary. It further explains that multiple + +![](images/c8b1dca07600d7f903029ed42b832e9cd6cff70a481b00d897ff7c4e982991f4.jpg) +Figure 4: Visualization of gainable images. + +contributions are better than a single contribution in the experimental results. At last, it is worth noting that some words are gained from the image but are not visible in the image, i.e., “relatives” and “victims”. Therefore, we believe the image brings gain in both visible and invisible words. We explain further in Gainable Images. + +# 4.5.2 Pre-filter Module Analysis + +Since we believe that images should provide meaningful contributions instead of robustness enhancements in multimodal summarization, we wonder whether unpaired multimodal data may affect the performance of our model. Therefore, we try generating the summary based on the unpaired image and text. + +In the test set, most of the images are highly similar in theme and content. Generating unpaired data with automatic shuffling is not significant for analysis. Therefore, we manually exchange $v_{i}$ and $v_{j}$ in pairs $< t_{i}, v_{i} >$ , $< t_{j}, v_{j} >$ , where $v_{i}, v_{j}$ have different themes or contents. + +We exchange 20 pairs from 100 pairs of test samples. And we conduct experiments with different sampling for three times. The mean and standard deviation reports as Table 4. "Paired" represents ROUGE-1 on test set, "Unpaired" represents ROUGE-1 on the unpaired set. "CFSum (filter-off)" represents turning down the pre-filter mechanism. + +
ModelPairedUnpaired
UniG46.2246.20(±0.012)
CFSum47.8647.46(±0.007)
CFSum (filter-off)47.7747.12(±0.011)
+ +Table 4: Performance of unpaired multimodal data for the baseline and our methods. + +The results show different trends in the two models. For UniG, unpaired multi-modalities do not affect the performance. We guess UniG does not exploit meaningful image information while relying + +![](images/4b8ba5915021f9910cc2894c91f95d5f14bed8508dded7c78c281d28451932d3.jpg) +Figure 5: Ablation studies of layer setting. + +only on text to generate the summary. In contrast, CFSum hurt more severely from unpairing. The difference exists because CFSum depends on the image and text. Thus, the unpaired image would reduce the correct information that CFSum gets. However, CFSum still performs better than UniG, proving that it is fault-tolerant. Furthermore, CF-Sum (filter-off) significantly suffers from unpaired data, showing that pre-filter can eliminate useless images. + +# 4.5.3 Ablation Study + +One of the most important hyperparameters in CFSum is the location of different contribution modules. Because the three modules' order in the network is fixed, we change their absolute position in the encoder layers and report the corresponding performance in Figure 5. $w$ denotes the number of layers between two modules, and the $X$ axis denotes the starting layer of the pre-filter module. The results show that the different layer settings achieve comparable performance. It is noticeable that $w = 2$ weakens the model. This is due to the fact that the network with small $w$ loses the advantage of a hierarchical structure in the encoder. + +# 4.5.4 Gainable Images + +We select three gained words and corresponding gainable images to show in Figure 4. Consistent with our perception, images bring gains on visual words, such as "earthquake". More importantly, they bring gains on non-visual words such as "celebrate" and "victims". For example, "celebrate" may be used in competitions, events, and diplomacy as shown in Figure 4. Multimodal tasks such as image captioning or multimodal question answering focus on establishing associations between visual words and images. However, multimodal summarization also needs to pay attention to the associations between non-visual words and images. In other words, image contributes to both visual and non-visual words. + +# 5 Conclusion + +Based on the observation that existing multimodal summary models do not take full advantage of useful image information, this paper focuses on modeling different contributions of images for summarization. Therefore, we propose a novel framework CFSum consisting of pre-filter, word-level complement, and phrase-level complement modules. The pre-filter coarsely eliminates the impact of useless images. The two-level visual complement modules measure different aspects of image gains and guide the fusion of different modalities. Experimental results have shown that CFSum can significantly improve the summary. More importantly, the complement modules make images contribute to visual words and non-visual words. + +# Limitations + +Since our method constructs on the multimodal transformer, it cannot be migrated to the dual-stream model. Experiment results show that CF-Sum can achieve comparable performance with strong baselines. But it still cannot surpass the SOTA of some dual-stream large models. + +# Acknowledgements + +The research work has been supported by the Natural Science Foundation of China under Grant No. 62106263. + +# References + +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 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6077-6086. +Yash Kumar Atri, Shraman Pramanick, Vikram Goyal, and Tanmoy Chakraborty. 2021. See, hear, read: Leveraging multimodality with guided attention for abstractive text summarization. Know-Based Syst., 227(C). +Iacer Calixto, Qun Liu, and Nick Campbell. 2017. Doubly-attentive decoder for multi-modal neural machine translation. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1913-1924, Vancouver, Canada. Association for Computational Linguistics. +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 Computer Vision - ECCV 2020, pages 104-120, Cham. Springer International Publishing. +Junyoung Chung, Caglar Gulcehre, KyungHyun Cho, and Yoshua Bengio. 2014. Empirical evaluation of gated recurrent neural networks on sequence modeling. +James Clarke and Mirella Lapata. 2008. Global inference for sentence compression: An integer linear programming approach. Journal of Artificial Intelligence Research, pages 399-429. +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. +Anubhav Jangra, Adam Jatowt, Mohammad Hasanuzzaman, and Sriparna Saha. 2020. Text-image-video summary generation using joint integer linear programming. In Advances in Information Retrieval, pages 190-198, Cham. Springer International Publishing. +Anubhav Jangra, Adam Jatowt, Sriparna Saha, and Mohammad Hasanuzzaman. 2021. A survey on multimodal summarization. CoRR, abs/2109.05199. +Diederik P Kingma and Jimmy Ba. 2014. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980. +Shunsuke Kitada, Yuki Iwazaki, Riku Togashi, and Hitoshi Iyatomi. 2022. Dm2s2: Deep multimodal sequence sets with hierarchical modality attention. IEEE Access, 10:120023-120034. +Haoran Li, Peng Yuan, Song Xu, Youzheng Wu, Xiaodong He, and Bowen Zhou. 2020a. Aspect-aware multimodal summarization for chinese e-commerce products. Proceedings of the AAAI Conference on Artificial Intelligence, 34(05):8188-8195. +Haoran Li, Junnan Zhu, Tianshan Liu, Jiajun Zhang, and Chengqing Zong. 2018a. Multi-modal sentence summarization with modality attention and image filtering. In International Joint Conference on Artificial Intelligence. +Haoran Li, Junnan Zhu, Tianshang Liu, Jiajun Zhang, and Chengqing Zong. 2018b. Multi-modal sentence summarization with modality attention and image filtering. In Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence, IJCAI-18, pages 4152-4158. International Joint Conferences on Artificial Intelligence Organization. + +Haoran Li, Junnan Zhu, Jiajun Zhang, Xiaodong He, and Chengqing Zong. 2020b. Multimodal sentence summarization via multimodal selective encoding. In Proceedings of the 28th International Conference on Computational Linguistics, pages 5655-5667, Barcelona, Spain (Online). International Committee on Computational Linguistics. +Jiangfeng Li, Zijian Zhang, Bowen Wang, Qinpei Zhao, and Chenxi Zhang. 2022. Inter- and intra-modal contrastive hybrid learning framework for multimodal abstractive summarization. Entropy, 24(6). +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. +Jindrich Libovický and Jindrich Helcl. 2017. Attention strategies for multi-source sequence-to-sequence learning. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 196-202, Vancouver, Canada. Association for Computational Linguistics. +Chin-Yew Lin and Eduard Hovy. 2002. Manual and automatic evaluation of summaries. In Proceedings of the ACL-02 Workshop on Automatic Summarization, pages 45-51, Philadelphia, Pennsylvania, USA. Association for Computational Linguistics. +Nayu Liu, Xian Sun, Hongfeng Yu, Wenkai Zhang, and Guangluan Xu. 2020. Multistage fusion with forget gate for multimodal summarization in open-domain videos. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1834-1845, Online. Association for Computational Linguistics. +Jiasen Lu, Caiming Xiong, Devi Parikh, and Richard Socher. 2017. Knowing when to look: Adaptive attention via a visual sentinel for image captioning. 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 3242-3250. +Shruti Palaskar, Jindrich Libovický, Spandana Gella, and Florian Metze. 2019. Multimodal abstractive summarization for how2 videos. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 6587-6596, Florence, Italy. 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. +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. +Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. 2014. Dropout: A simple way to prevent neural networks from overfitting. J. Mach. Learn. Res., 15(1):1929-1958. +Tiezheng Yu, Wenliang Dai, Zihan Liu, and Pascale Fung. 2021. 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. +Ying Zeng, Sijie Mai, and Haifeng Hu. 2021. Which is making the contribution: Modulating unimodal and cross-modal dynamics for multimodal sentiment analysis. In *Findings of the Association for Computational Linguistics: EMNLP* 2021, pages 1262-1274, Punta Cana, Dominican Republic. Association for Computational Linguistics. +Tianyi Zhang*, Varsha Kishore*, Felix Wu*, Kilian Q. Weinberger, and Yoav Artzi. 2020. *Bertscore: Evaluating text generation with bert.* In International Conference on Learning Representations. +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. +Qingyu Zhou, Nan Yang, Furu Wei, and Ming Zhou. 2017. Selective encoding for abstractive sentence summarization. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1095-1104, Vancouver, Canada. Association for Computational Linguistics. +Junnan Zhu, Haoran Li, Tianshang Liu, Yu Zhou, Jiajun Zhang, and Chengqing Zong. 2018. MSMO: Multimodal summarization with multimodal output. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 4154-4164, Brussels, Belgium. Association for Computational Linguistics. + +# A Experiment details + +Here, we will introduce some detailed settings for our experiments. All methods are run on NVIDIA GeForce RTX 3090. UniG has 139M parameters. When the batch size is 8, it takes 20 hours to train for 50 epochs with a single GPU. + +We also provide evaluation scripts for reproduction. For ROUGE score, we use file2rouge with default settings. For BERTScore7, we use the official API. It exploits the pre-trained contextual embeddings from BERT to calculate the similarity between the hypothesis sentences and the reference sentences. For MoverScore, we use moverscore_v28, which leverages BERT and Earth Mover Distance to measure the similarity. + +# B Derivation details + +Derivation detail of formula 8 is: + +$$ +\begin{array}{l} G I _ {j} = G a i n \left(y _ {j} / m ^ {L _ {w}}, y _ {j} / u ^ {L _ {w}}\right) \\ = \mathrm {K L} \left(\hat {y} _ {j} \| y _ {j} / m ^ {L _ {w}}\right) - \mathrm {K L} \left(\hat {y} _ {j} \| y _ {j} / u ^ {L _ {w}}\right) \\ = P \left(\hat {y} _ {j} = 1\right) \cdot \log P \left(y _ {j} = 1 / m ^ {L _ {w}}\right) \\ + P \left(\hat {y} _ {j} = 0\right) \cdot \log P \left(y _ {j} = 0 / m ^ {L _ {w}}\right) \\ - P \left(\hat {y} _ {j} = 1\right) \cdot \log P \left(y _ {j} = 1 / u ^ {L _ {w}}\right) \\ - P \left(\hat {y} _ {j} = 0\right) \cdot \log P \left(y _ {j} = 0 / u ^ {L _ {w}}\right) \\ = P \left(y _ {j} = \hat {y} _ {j}\right) \cdot \log P \left(y _ {j} = \hat {y} _ {j} / m ^ {L w}\right) \\ - P \left(y _ {j} = \hat {y} _ {j}\right) \cdot \log P \left(y _ {j} = \hat {y} _ {j} / u ^ {L _ {w}}\right) \\ = \log P \left(y _ {j} = \hat {y} _ {j} / m ^ {L _ {w}}\right) - \log P \left(y _ {j} = \hat {y} _ {j} / u ^ {L _ {w}}\right) \tag {21} \\ \end{array} +$$ + +Thus the gain is simplified to entropy difference. + +# C Examples of Complement Modules + +We will provide some examples to explain further Word-level Complement. For one of the input words $t_j$ , we assume that it appears in the reference summary. Then the ground truth of the copy classification is $\hat{y}_j = 1$ . We list hypothetical classification results of bi-modal and uni-modal in Table 5. + +
P(yj=1)P(yj=0)
Uw0.40.6
Mw0.60.4
+ +Table 5: Copy classification task results. + +Then, the $GI_{j}$ is calculated as: + +$$ +\begin{array}{l} G I _ {j} = G a i n \left(y _ {j} / m ^ {L _ {w}}, y _ {j} / u ^ {L _ {w}}\right) \\ = \log P \left(y _ {j} = 1 / m ^ {L _ {w}}\right) - \log P \left(y _ {j} = 1 / u ^ {L _ {w}}\right) \\ = \log 0. 6 - \log 0. 4 \\ = 0. 4 0 5 \tag {22} \\ \end{array} +$$ + +which means the image may give the input word $t_j$ a gain of 0.405. Furthermore, the image brings a positive gain. Thus in the attention layer, the text word $t_j$ should give the image a higher attention score. + +# D Impact of image category + +To further analyze the impact of our approach on different categories of images. We categorize the test images with VGG19 and show the performance of each type of image. As shown in Figure 6, there are 380 categories in the test images, and we list the top 10 categories with the highest proportion. It can be seen that the image is evenly distributed. The line charts also show that CFSum is superior to UniG in all categories. Therefore there is no category bias in our method. + +# E Guided Attention + +We visualize (1) the attention matrix from the $8^{th}$ encoder layer of CFSum- $\mathrm{F}_3\mathrm{W}_6\mathrm{S}_9$ , whose layer is under the word-level guidance. (2) the attention matrix from the $11^{th}$ encoder layer of CFSum $\mathrm{F_3W_6S_9}$ , whose layer is under the phrase-level guidance. The attention matrix is renormalized after removing [CLS] and [SEP]. They are shown in Figure 7 and Figure 8. + +From the attention under the word-level guidance, we can observe that some input words which generatively or extractively occur in the reference summary will attend to the image, such as "crash" and "relatives". From the attention under the phrase-level guidance, we can observe that some input phrases which generatively or extractively occur in the reference summary attend to the image more. Above all, it also proves that two visual complement modules succeed in providing better encoding to generate summaries. + +![](images/c88bb08b744644ecfcac09dc9e04e575f155ab89173078934e19f1dc224598aa.jpg) +Figure 6: Top10 categories of test images and their corresponding performance. + +![](images/485fc174c6491d98619d99b4f79c5bc212707f31f40f37c506be77a8b4f5de3c.jpg) +Figure 7: Visualize $8^{th}$ layer's attention under the word-level guided module. The reference summary is "crash investigation begins relatives mourn eight victims". $v_{0} \sim v_{9}$ is the image object detected feature. + +![](images/9c0aad34e7065a54e8d5936d18a02e657eba94919f4077cbe2cf179e7e1f0b7a.jpg) +Figure 8: Visualize $11^{th}$ layer's attention under the word-level guided module. The reference summary is "crash investigation begins relatives mourn eight victims". $v_{0} \sim v_{9}$ is the image object detected feature. + +A For every submission: + +A1. Did you describe the limitations of your work? Limitations +□ A2. Did you discuss any potential risks of your work? Not applicable. Our paper is foundational research and not tied to particular applications. +A3. Do the abstract and introduction summarize the paper's main claims? Abstract and Section 1 Introduction. +A4. Have you used AI writing assistants when working on this paper? Left blank. + +B Did you use or create scientific artifacts? + +Section 4 Experiment. + +B1. Did you cite the creators of artifacts you used? Section 4.3 Automatic Evaluation Results. +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? Not applicable. Left blank. +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? Not applicable. Left blank. +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? Not applicable. Left blank. +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? Section 4.1 Settings. +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. Section 4.1 Settings. + +C Did you run computational experiments? + +Section 4 Experiment + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? Appendix A Experiment details + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +Section 4.1 Settings. + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +Section 4.3 Automatic Evaluation Results. + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +Section 3 Proposed Methods and Section 4 Experiments + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Section 4.4 Human Evaluation Results. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +Section 4.4 Human Evaluation Results. + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +Section 4.4 Human Evaluation Results. + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +Not applicable. Left blank. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +Not applicable. Left blank. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +Not applicable. Left blank. \ No newline at end of file diff --git a/cfsumcoarsetofinecontributionnetworkformultimodalsummarization/images.zip b/cfsumcoarsetofinecontributionnetworkformultimodalsummarization/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..a6e82adc9da735ad35d48b9c4f18eb586ae7319c --- /dev/null +++ b/cfsumcoarsetofinecontributionnetworkformultimodalsummarization/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:668712f3fcd1d862f521a6e89eb1f88ce00e8303f46709ae84f3ae1e4cc263b0 +size 697039 diff --git a/cfsumcoarsetofinecontributionnetworkformultimodalsummarization/layout.json b/cfsumcoarsetofinecontributionnetworkformultimodalsummarization/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..5fb447dfb3c67fddd1dde126aa20044f32ad8ffa --- /dev/null +++ b/cfsumcoarsetofinecontributionnetworkformultimodalsummarization/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1bc5ffc02935d90c545fb8b0a0d01567a4b84748a56d1caecd2dfd50cd9c8cc1 +size 489173 diff --git a/chainofskillsaconfigurablemodelforopendomainquestionanswering/43e2ff2d-012b-4043-84b8-f110ea9ee01c_content_list.json b/chainofskillsaconfigurablemodelforopendomainquestionanswering/43e2ff2d-012b-4043-84b8-f110ea9ee01c_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..00fe7dc40d9bda419fe684cf9507b60135dc6a7b --- /dev/null +++ b/chainofskillsaconfigurablemodelforopendomainquestionanswering/43e2ff2d-012b-4043-84b8-f110ea9ee01c_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d96c80dac8453a0ee447076bb8e51febed5d1c2170ef1bb2b7ed116a81980a0 +size 137295 diff --git a/chainofskillsaconfigurablemodelforopendomainquestionanswering/43e2ff2d-012b-4043-84b8-f110ea9ee01c_model.json b/chainofskillsaconfigurablemodelforopendomainquestionanswering/43e2ff2d-012b-4043-84b8-f110ea9ee01c_model.json new file mode 100644 index 0000000000000000000000000000000000000000..705924d7fc0633cad02bb01cb947e9100c12eceb --- /dev/null +++ b/chainofskillsaconfigurablemodelforopendomainquestionanswering/43e2ff2d-012b-4043-84b8-f110ea9ee01c_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e9cd9037bddd6a26f11c813886e7613fd41a5e13e3f88b4404283530066c19ec +size 166046 diff --git a/chainofskillsaconfigurablemodelforopendomainquestionanswering/43e2ff2d-012b-4043-84b8-f110ea9ee01c_origin.pdf b/chainofskillsaconfigurablemodelforopendomainquestionanswering/43e2ff2d-012b-4043-84b8-f110ea9ee01c_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..4670e12b0ec41c7697026ff117296fa149bb5e49 --- /dev/null +++ b/chainofskillsaconfigurablemodelforopendomainquestionanswering/43e2ff2d-012b-4043-84b8-f110ea9ee01c_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:10dc2c7c92b0d1e93fc4fb25b081afd24596079010522d2d3a00bf667995da1b +size 1448699 diff --git a/chainofskillsaconfigurablemodelforopendomainquestionanswering/full.md b/chainofskillsaconfigurablemodelforopendomainquestionanswering/full.md new file mode 100644 index 0000000000000000000000000000000000000000..dd0d95e132e1af02d079f6230395c520ff5fba15 --- /dev/null +++ b/chainofskillsaconfigurablemodelforopendomainquestionanswering/full.md @@ -0,0 +1,562 @@ +# Chain-of-Skills: A Configurable Model for Open-Domain Question Answering + +Kaixin Ma\*, Hao Cheng\*, Yu Zhang\*†, Xiaodong Liu\*, Eric Nyberg\*, Jianfeng Gao\* + +$\clubsuit$ Carnegie Mellon University $\spadesuit$ Microsoft Research $\diamond$ University of Illinois at Urbana-Champaign + +{kaixinm,ehn}@cs.cmu.edu {chehao,xiaodl,jfgao}@microsoft.com yuz9@illinois.edu + +# Abstract + +The retrieval model is an indispensable component for real-world knowledge-intensive tasks, e.g., open-domain question answering (ODQA). As separate retrieval skills are annotated for different datasets, recent work focuses on customized methods, limiting the model transferability and scalability. In this work, we propose a modular retriever where individual modules correspond to key skills that can be reused across datasets. Our approach supports flexible skill configurations based on the target domain to boost performance. To mitigate task interference, we design a novel modularization parameterization inspired by sparse Transformer. We demonstrate that our model can benefit from self-supervised pretraining on Wikipedia and fine-tuning using multiple ODQA datasets, both in a multi-task fashion. Our approach outperforms recent self-supervised retrievers in zero-shot evaluations and achieves state-of-the-art fine-tuned retrieval performance on NQ, HotpotQA and OTT-QA. + +# 1 Introduction + +Gathering supportive evidence from external knowledge sources is critical for knowledge-intensive tasks, such as open-domain question answering (ODQA; Lee et al., 2019) and fact verification (Thorne et al., 2018). Since different ODQA datasets focus on different information-seeking goals, this task typically is handled by customized retrieval models (Karpukhin et al., 2020; Yang et al., 2018; Wu et al., 2020; Ma et al., 2022a). However, this dataset-specific paradigm has limited model scalability and transferability. For example, augmented training with single-hop data hurts multi-hop retrieval (Xiong et al., 2021b). Further, as new information needs constantly emerge, dataset-specific models are hard to reuse. + +![](images/a48f9367bda0fab9d63bf22ff7b6063a9311651281e1682c9b3ef6107eef51f0.jpg) + +![](images/2c9e6724ddf8aebfb506e02efd8d9e08788d13a0da8fdbeeb009ad7ae2df17f1.jpg) +Figure 1: Comparison of dense retrievers in terms of considered query type and supported skill configuration [a] (Karpukhin et al., 2020) [b] (Xiong et al., 2021b) [c] (Wu et al., 2020). Each box represents a skill ( =single retrieval, =expanded retrieval, =linking, =reranking,) and the arrows represent the order of execution. In our case, we can flexibly combine and chain the skills at inference time for different tasks to achieve optimal performance. + +In this work, we propose Chain-of-Skills (COS), a modular retriever based on Transformer (Vaswani et al., 2017), where each module implements a reusable skill that can be used for different ODQA datasets. Here, we identify a set of such retrieval reasoning skills: single retrieval, expanded query retrieval, entity span proposal, entity linking and reranking (§2). As shown in Figure 1, recent work has only explored certain skill configurations. We instead consider jointly learning all skills in a multi-task contrastive learning fashion. Besides the benefit of solving multiple ODQA datasets, our + +multi-skill formulation provides unexplored ways to chain skills for individual use cases. In other words, it allows flexible configuration search according to the target domain, which can potentially lead to better retrieval performance (§4). + +For multi-task learning, one popular approach is to use a shared text encoder (Liu et al., 2019a), i.e., sharing representations from Transformer and only learning extra task-specific headers atop. However, this method suffers from undesirable task interference, i.e., negative transfer among retrieval skills. To address this, we propose a new modularization parameterization inspired by the recent mixture-of-expert in sparse Transformer (Fedus et al., 2021a), i.e., mixing specialized and shared representations. Based on recent analyses on Transformer (Meng et al., 2022), we design an attention-based alternative that is more effective in mitigating task interference ( $\S 5$ ). Further, we develop a multi-task pretraining using self-supervision on Wikipedia so that the pretrained $\cos$ can be directly used for retrieval without dataset-specific supervision. + +To validate the effectiveness of COS, we consider zero-shot and fine-tuning evaluations with regard to the model in-domain and cross-dataset generalization. Six representative ODQA datasets are used: Natural Questions (NQ; Kwiatkowski et al., 2019), WebQuestions (WebQ; Berant et al., 2013), SQuAD (Rajpurkar et al., 2016), EntityQuestions (Sciavolino et al., 2021), HotpotQA (Yang et al., 2018) and OTT-QA (Chen et al., 2021a), where the last two are multi-hop datasets. Experiments show that our multi-task pretrained retriever achieves superior zero-shot performance compared to recent state-of-the-art (SOTA) self-supervised dense retrievers and BM25 (Robertson and Zaragoza, 2009). When fine-tuned using multiple datasets jointly, COS can further benefit from high-quality supervision effectively, leading to new SOTA retrieval results across the board. Further analyses show the benefits of our modularization parameterization for multi-task pretraining and fine-tuning, as well as flexible skill configuration via Chain-of-Skills inference. $^{1}$ + +# 2 Background + +We consider five retrieval reasoning skills: single retrieval, expanded query retrieval, entity linking, entity span proposal and reranking. Convention- + +ally, each dataset provides annotations on a different combination of skills (see Table A1). Hence, we can potentially obtain training signals for individual skills from multiple datasets. Below we provide some background for these skills. + +Single Retrieval Many ODQA datasets (e.g., NQ; Kwiatkowski et al., 2019) concern simple/single-hop queries. Using the original question as input (Figure 2 bottom-left), single-retrieval gathers isolated supportive passages/tables from target sources in one shot (Karpukhin et al., 2020). + +Expanded Query Retrieval To answer complex multi-hop questions, it typically requires evidence chains of two or more separate passages (e.g., HotpotQA; Yang et al., 2018) or tables (e.g., OTT-QA; Chen et al., 2021a). Thus, follow-up rounds of retrieval are necessary after the initial single retrieval. The expanded query retrieval (Xiong et al., 2021b) takes an expanded query as input, where the question is expanded with the previous-hop evidence (Figure 2 bottom-center). The iterative retrieval process generally shares the same target source. + +Entity Span Proposal Since many questions concern entities, detecting those salient spans in the question or retrieved evidence is useful. The task is related to named entity recognition (NER), except requiring only binary predictions, i.e., whether a span corresponds to an entity. It is a prerequisite for generating entity-centric queries (context with target entities highlighted; Figure 2 bottom-right) where targeted entity information can be gathered via downstream entity linking. + +Entity Linking Mapping detected entities to the correct entries in a database is crucial for analyzing factoid questions. Following Wu et al. (2020), we consider an entity-retrieval approach, i.e., using the entity-centric query for retrieving its corresponding Wikipedia entity description. + +Rereanking Previous work often uses a reranker to improve the evidence recall in the top-ranked candidates. Typically, the question with a complete evidence chain is used together for reranking. + +# 3 Approach + +In this work, we consider a holistic approach to gathering supportive evidence for ODQA, i.e., the evidence set contains both singular tables/passages (from single retrieval) and connected evidence chains (via expanded query retrieval-entity linking). As shown in Figure 2, $\mathsf{COS}$ supports flexible skill configurations, e.g., expanded query retriever and + +![](images/a05f1baed95f7ece05c10005867f7bf808c32c47c996d92d62fb1d0848d2af83.jpg) +Figure 2: Chain-of-Skills (COS) model architecture with three different query types. The left blue box indicates the single retrieval query input. The middle green box is the expanded query retrieval input based on the single retrieval results. The right orange case is the entity-centric query with "deep learning" as the targeted entity. + +the entity linker can build upon the single-retrieval results. As all retrieval skill tasks are based on contrastive learning, we start with the basics for our multi-task formulation. We then introduce our modularization parameterization for reducing task interference. Lastly, we discuss ways to use self-supervision for pretraining and inference strategies. + +# 3.1 Reasoning Skill Modules + +All reasoning skills use text encoders based on Transformer (Vaswani et al., 2017). Particularly, only BERT-base (Devlin et al., 2019) is considered without further specification. Text inputs are prepended with a special token [CLS] and different segments are separated by the special token [SEP]. The bi-encoder architecture (Karpukhin et al., 2020) is used for single retrieval, expanded query retrieval, and entity linking. We use dot product for $\mathrm{sim}(\cdot ,\cdot)$ . + +Retrieval As single retrieval and expanded query retrieval only differ in their query inputs, these two skills are discussed together here. Specifically, both skills involve examples of a question $Q$ , a positive document $P^{+}$ . Two text encoders are used, i.e., a query encoder for questions and a context passage encoder for documents. For the expanded query case (Figure 2 bottom-center), we concatenate $Q$ with the previous-hop evidence as done in Xiong et al. (2021b), i.e., [CLS] $Q$ [SEP] $P_{1}^{+}$ [SEP]. Following the literature, [CLS] vectors from both encoders are used to represent the questions and + +documents respectively. The training objective is + +$$ +L _ {\mathrm {r e t}} = - \frac {\exp (\operatorname {s i m} (\mathbf {q} , \mathbf {p} ^ {+}))}{\sum_ {\mathbf {p} ^ {\prime} \in \mathcal {P} \cup \{\mathbf {p} ^ {+} \}} \exp (\operatorname {s i m} (\mathbf {q} , \mathbf {p} ^ {\prime}))}, \tag {1} +$$ + +where $\mathbf{q},\mathbf{p}$ are the query and document vectors respectively and $\mathcal{P}$ is the set of negative documents. Entity Span Proposal To achieve a multi-task formulation, we model entity span proposal based on recent contrastive NER work (Zhang et al., 2022a). Specifically, for an input sequence with $N$ tokens, $x_{1},\ldots ,x_{N}$ , we encode it with a text encoder to a sequence of vectors $\mathbf{h}_1^m,\dots ,\mathbf{h}_N^m\in \mathbb{R}^d$ . We then build the span representations using the span start and end token vectors, $\mathbf{m}_{(i,j)} = \tanh ((\mathbf{h}_i^m\oplus \mathbf{h}_j^m)W^a)$ , where $i$ and $j$ are the start and end positions respectively, $\oplus$ denotes concatenation, tanh is the activation function, and $W^{a}\in \mathbb{R}^{2d\times d}$ are learnable weights. For negative instances, we randomly sample spans within the maximum length of 10 from the same input which do not correspond to any entity. Then we use a learned anchor vector $\mathbf{s}\in \mathbb{R}^d$ for contrastive learning, i.e., pushing it close to the entity spans and away from negative spans. + +$$ +L _ {\text {p o s}} = - \frac {\exp \left(\operatorname {s i m} \left(\mathbf {s} , \mathbf {m} ^ {+}\right)\right)}{\sum_ {\mathbf {m} ^ {\prime} \in \mathcal {M} \cup \left\{\mathbf {m} ^ {+} \right\}} \exp \left(\operatorname {s i m} \left(\mathbf {s} , \mathbf {m} ^ {\prime}\right)\right)}, \tag {2} +$$ + +where $\mathcal{M}$ is the negative span set which always contains a special span corresponding to [CLS], $\mathbf{m}^{[\mathrm{CLS}]} = \mathbf{h}_0^m$ . However, the above objective + +alone is not able to determine the prediction of entity spans from null cases at test time. To address this, we further train the model with an extra objective to learn a dynamic threshold using $\mathbf{m}^{[CLS]}$ + +$$ +L _ {\mathrm {c l s}} = - \frac {\exp (\operatorname {s i m} (\mathbf {s} , \mathbf {m} ^ {[ C L S ]}))}{\sum_ {\mathbf {m} ^ {\prime} \in \mathcal {M}} \exp (\operatorname {s i m} (\mathbf {s} , \mathbf {m} ^ {\prime}))}. \tag {3} +$$ + +The overall entity span proposal loss is computed as $L_{\mathrm{span}} = (L_{\mathrm{pos}} + L_{\mathrm{cls}}) / 2$ . Thus, spans with scores higher than the threshold are predicted as positive. + +Entity Linking Unlike Wu et al. (2020) where entity markers are inserted to the entity mention context (the entity mention with surrounding context), we use the raw input sequence as in the entity span proposal task. For the entity mention context, we pass the input tokens $x_{1}, \ldots, x_{N}$ through the entity query encoder to get $\mathbf{h}_1^e, \ldots, \mathbf{h}_N^e \in \mathbb{R}^d$ . Then we compute the entity vector based on its start position $i$ and end position $j$ , i.e., $\mathbf{e} = (\mathbf{h}_i^e + \mathbf{h}_j^e) / 2$ . For entity descriptions, we encode them with the entity description encoder and use the [CLS] vector $\mathbf{p}_e$ as representations. The model is trained to match the entity vector with its entity description vector + +$$ +L _ {\text {l i n k}} = - \frac {\exp \left(\operatorname {s i m} \left(\mathbf {e} , \mathbf {p} _ {e} ^ {+}\right)\right)}{\sum_ {\mathbf {p} ^ {\prime} \in \mathcal {P} _ {e} \cup \left\{\mathbf {p} _ {e} ^ {+} \right\}} \exp \left(\operatorname {s i m} \left(\mathbf {e} , \mathbf {p} ^ {\prime}\right)\right)}, \tag {4} +$$ + +where $\mathbf{p}_e^+$ is the linked description vector and $\mathcal{P}_e$ is the negative entity description set. + +Reranking Given a question $Q$ and a passage $P$ , we concatenate them as done in expanded query retrieval format [CLS] $Q$ [SEP] $P$ [SEP], and encode it using another text encoder. We use the pair consisting of the [CLS] vector $\mathbf{h}_{[CLS]}^r$ and the first [SEP] vector $\mathbf{h}_{[SEP]}^r$ from the output for reranking. The model is trained using the loss + +$$ +L _ {\text {r a n k}} = - \frac {\exp \left(\operatorname {s i m} \left(\mathbf {h} _ {[ \mathrm {C L S} ]} ^ {r +} , \mathbf {h} _ {[ \mathrm {S E P} ]} ^ {r +}\right)\right)}{\sum_ {\mathbf {p} ^ {r ^ {\prime}} \in \mathcal {P} _ {r} \cup \{\mathbf {p} ^ {r +} \}} \exp \left(\operatorname {s i m} \left(\mathbf {h} _ {[ \mathrm {C L S} ]} ^ {r ^ {\prime}} , \mathbf {h} _ {[ \mathrm {S E P} ]} ^ {r ^ {\prime}}\right)\right)}, \tag {5} +$$ + +where $\mathcal{P}_r$ is the set of negative passages concatenated with the same question. Intuitively, our formulation encourages $\mathbf{h}_{[CLS]}^r$ to capture more information about the question and $\mathbf{h}_{[SEP]}^r$ to focus more on the evidence. The positive pair where the evidence is supportive likely has higher similarity than the negative ones. Our formulation thus spares the need for an extra task-specific header. As the model only learns to rerank single passages, we compute the score for each passage separately for multi-hop cases. + +# 3.2 Modular Skill Specialization + +Implementing all aforementioned modules using separate models is apparently inefficient. As recent work finds that parameter sharing improves the bi-encoder retriever (Xiong et al., 2021b), we thus focus on a multi-task learning approach. + +One popular choice is to share the text encoder's parameter of all modules (Liu et al., 2019a). However, this approach suffers from task interference, resulting in degraded performance compared with the skill-specific model (§5.1). We attribute the cause to the competition for the model capacity, i.e., conflicting signals from different skills require attention to individual syntactic/semantic patterns. For example, the text encoder for entity-centric queries likely focuses on the local context around the entity while the expanded query one tends to represent the latent information based on the relation between the query and previous hop evidence. + +Motivated by recent modular approaches for sparse Transformer LM (Fedus et al., 2021b), we propose to mitigate the task interference by mixing skill-specific Transformer blocks with shared ones. A typical Transformer encoder is built with a stack of regular Transformer blocks, each consisting of a multi-head self-attention (MHA) sub-layer and a feed-forward network (FFN) sub-layer, with residual connections (He et al., 2015) and layer-normalization (Ba et al., 2016) applied to both sublayers. The shared Transformer block is identical to a regular Transformer block, i.e., all skill inputs are passed through the same MHA and FFN functions. + +As shown in Figure 2, for skill-specific Transformer blocks, we select a specialized sub-layer from a pool of $I$ parallel sub-layers based on the input, i.e., different skill inputs are processed independently. One option is to specialize the FFN expert sub-layer for individual skills, which is widely used by recent mixture-of-expert models (Fedus et al., 2021b; Cheng et al., 2022). As the FFN sub-layer is found to be important for factual associations (Meng et al., 2022), we hypothesize that using the popular FFN expert is sub-optimal. Since most reasoning skills require similar world knowledge, specializing FFN sub-layers likely hinders knowledge sharing. Instead, different skills typically require the model to attend to distinct input parts. Thus, we investigate a more parameter-efficient alternative, i.e., MHA specialization. In our experiments, we find it to be more effective in reducing task interference ( $\S 5.1$ ). + +![](images/6e158ed541649f93219697aa393eb5aeb656c995fe405c02740c41b9fcb327a7.jpg) +Figure 3: Expert configuration for COS at pretraining and fine-tuning. Each numbered box is a skill-specific expert. The lines denote input routing where solid ones also indicate weight initialization mappings. Green lines highlight the expanded query routing which is different for pretraining and fine-tuning. + +Expert Configuration Regarding the modularization, a naive setup is to route various task inputs to their dedicated sub-layers (experts), i.e., two experts for each bi-encoder task (single retrieval, expanded query retrieval and entity linking) and one expert for each cross-encoder task (entity span proposal and reranking), leading to eight experts in total. To save computation, we make the following adjustments. Given that single and expanded query retrievers share the same set of target passages, we merge the context expert for both cases. Due to data sparsity, we find that routing the expanded queries and reranker inputs which are very similar to separate experts is problematic ( $\S 5.1$ ). Thus, we merge the expert for expanded queries and reranker inputs. During self-supervised pretraining with three bi-encoder tasks, we further share the expert for single and expanded queries for efficiency. The overall expert configuration is shown in Figure 3. + +Multi-task Self-supervision Inspired by the recent success of Izacard et al. (2021), we also use self-supervision on Wikipedia for pretraining. Here, we only consider pretraining for bi-encoder skills (i.e., single retrieval, expanded query retrieval, and entity linking) where abundant self-supervision is available. Unlike prior work focusing only on single-type pretraining, we consider a multi-task setting using individual pages and the hyperlink relations among them. Specifically, we follow Izacard et al. (2021) and Wu et al. (2020) to construct examples for single retrieval and entity linking, respectively. For single retrieval, a pair of randomly cropped views of a passage is used as a positive + +example. For entity linking, a short text snippet with a hyperlinked entity (entity mention context) is used as the query, and the first paragraph of its linked Wikipedia page is treated as the target (entity description). For a given page, we construct an expanded query using a randomly-sampled short text snippet with its first paragraph, and use one first paragraph from linked pages as the target. + +# 3.3 Inference + +During inference, different skills can be flexibly combined to boost retrieval accuracy. Those studied configurations are illustrated in Figure 1. To consolidate the evidence set obtained by different skills, we first align the linking scores based on the same step retrieval scores (single or expanded query retrieval) for sorting. Documents returned by multiple skills are considered more relevant and thus promoted in ranking. More details with running examples are provided in Appendix A. + +# 4 Experiments + +# 4.1 Datasets + +We consider six popular datasets for evaluation, all focused on Wikipedia, with four single-hop data, NQ (Kwiatkowski et al., 2019), WebQ (Berant et al., 2013), SQuAD (Rajpurkar et al., 2016) and EntityQuestions (Sciavolino et al., 2021); two multi-hop data, HotpotQA (Yang et al., 2018) and OTT-QA (Chen et al., 2021a). Dataset-specific corpora are used for multi-hop datasets, because HotpotQA requires retrieval hopping between text passages while table-passage hopping is demanded by OTT-QA. For single-hop data, we use the Wikipedia corpus from Karpukhin et al. (2020). More detailed (pretraining/fine-tuning) data statistics and experimental settings are in Appendix B. + +# 4.2 Evaluation Settings + +We evaluate our model in three scenarios. + +Zero-shot Evaluation Similar to recent self-supervised dense retrievers on Wikipedia, we conduct zero-shot evaluations using the retrieval skill from our pretrained model on NQ, WebQ, EntityQuestions and HotpotQA. To assess the model's ability to handle expanded query retrieval, we design an oracle second-hop retrieval setting (gold first-hop evidence is used) based on HotpotQA. Following Izacard et al. (2021) and Ram et al. (2022), we report top- $k$ retrieval accuracy (answer recall), + +
NQWebQEntityQuestionsHotpotQAAvg
Top-20Top-100Top-20Top-100Top-20Top-100Top-20Top-100Top-20Top-100
BM2562.978.362.475.570.879.237.550.558.470.9
Contriever (Izacard et al., 2021)67.882.165.479.861.874.248.764.560.975.2
Spider (Ram et al., 2022)68.381.265.979.765.176.435.348.658.771.5
COS (pretrain-only)68.081.866.780.370.779.177.987.970.882.3
+ +Table 1: Zero-shot top- $k$ accuracy on test sets for NQ,WebQ and EntityQuestions,and dev set for HotpotQA. + +
Top-20Top-100
DPR-multi (Karpukhin et al., 2020)79.586.1
ANCE-multi (Xiong et al., 2021a)82.187.9
DPR-PAQ (Oguz et al., 2022)84.789.2
co-Condenser (Gao and Callan, 2022)84.389.0
SPAR-wiki (Chen et al., 2021b)83.088.8
COS85.690.2
+ +i.e., the percentage of questions for which the answer string is found in the top- $k$ passages. + +Supervised In-domain Evaluation We further fine-tune our pretrained model with two extra skills (entity span proposal and reranking) on NQ, HotpotQA and OTT-QA, again in a multi-task fashion. Unlike multi-hop data with supervision for all skills, only single retrieval and reranking data is available for NQ. During training, all datasets are treated equally without any loss balancing. Different from previous retrieval-only work, we explore Chain-of-Skills retrieval by using different skill configurations. Specifically, we use skill configuration for task A, B and C shown in Figure 1 for NQ, OTT-QA and HotpotQA, respectively. We again report top- $k$ retrieval accuracy for NQ and OTT-QA following previous work. For HotpotQA, we follow the literature using the top-1 pair of evidence accuracy (passage EM). + +Cross-data Evaluation To test the model robustness towards domain shift, we conduct cross-data evaluations on SQuAD and EntityQuestions. Although considerable success has been achieved for supervised dense retrievers using in-domain evaluations, those models have a hard time generalizing to query distribution shift (e.g., questions about rare entities; Sciavolino et al., 2021) compared with BM25. In particular, we are interested to see whether Chain-of-Skills retrieval is more robust. Again, top- $k$ retrieval accuracy is used. + +Table 2: Supervised top- $k$ accuracy on NQ test. + +
Top-20Top-50Top-100
CORE (Ma et al., 2022a)74.582.987.1
COS79.988.992.2
COS w/ CORE configuration80.588.691.8
+ +Table 3: Supervised top- $k$ accuracy on OTT-QA dev. + +
Passage EM
MDR (Xiong et al., 2021b)81.20
Baleen (Khattab et al., 2021)86.10
IRRR (Qi et al., 2021)84.10
TPRR (Zhang et al., 2021a)86.19
HopRetriever-plus (Li et al., 2021)86.94
AISO (Zhu et al., 2021)88.17
COS88.89
+ +Table 4: Supervised passage EM on HotpotQA dev. + +# 4.3 Results + +Zero-shot Results For zero-shot evaluations, we use two recent self-supervised dense retrievers, Contriever (Izacard et al., 2021) and Spider (Ram et al., 2022), and BM25 as baselines. The results are presented in Table 1. As we can see, BM25 is a strong baseline matching the average retrieval performance of Spider and Contriever over considered datasets. COS achieves similar results on NQ and WebQ compared with self-supervised dense methods. On the other hand, we observe significant gains on HotpotQA and EntityQuestions, where both dense retrievers are lacking. In summary, our model shows superior zero-shot performance in terms of average answer recall across the board, surpassing BM25 with the largest gains, which indicates the benefit of our multi-task pretraining. + +Supervised In-domain Results As various customized retrievers are developed for NQ, OTTQA and HotpotQA, we compare COS with different dataset-specific baselines separately. For NQ, we report two types of baselines, 1) bi-encoders with multi-dataset training and 2) models with augmented pretraining. For the first type, we have + +DPR-multi (Karpukhin et al., 2020) and ANCEmulti (Xiong et al., 2021a), where the DPR model is initialized from BERT-based and ANCE is initialized from DPR. For the second type, DPR-PAQ (Oguz et al., 2022) is initialized from the RoBERTLarge model (Liu et al., 2019b) with pretraining using synthetic queries (the PAQ corpus (Lewis et al., 2021)), co-Condenser (Gao and Callan, 2022) incorporated retrieval-oriented modeling during language model pretraining on Wikipedia; SPAR-wiki (Chen et al., 2021b) combine a pretrained lexical model on Wikipedia with a dataset-specific dense retriever. Both co-Condenser and SPAR-wiki are initialized from BERT-base. As shown by results for NQ (Table 2), COS outperforms all baselines with or without pretraining. It is particularly encouraging that despite being a smaller model, COS achieves superior performance than DPR-PAQ. The reasons are two-fold: Oguz et al. (2022) has shown that scaling up the retriever from base to large size only provides limited gains after pretraining. Moreover, DPR-PAQ only learns a single retrieval skill, whereas COS can combine multiple skills for inference. We defer the analysis of the advantage of chain-of-skills inference later (§5.2). + +For OTT-QA, we only compare with the SOTA model CORE (Ma et al., 2022a), because other OTT-QA specific retrievers are not directly comparable where extra customized knowledge source is used. As CORE also uses multiple skills to find evidence chains, we include a baseline where the inference follows the CORE skill configuration but uses modules from COS. For HotpotQA, we compare against three types of baselines, dense retrievers focused on expanded query retrieval MDR (Xiong et al., 2021b) and Baleen (Khattab et al., 2021), sparse retrieval combined with query reformulation IRRR (Qi et al., 2021) and TPRR (Zhang et al., 2021a) and ensemble of dense, sparse and hyperlink retrieval HopRetriever (Li et al., 2021) and AISO (Zhu et al., 2021). The results on OTT-QA and HotpotQA are summarized in Table 3 and Table 4. It is easy to see that COS outperforms all the baselines here, again showing the advantage of our configurable multi-skill model over multiple types of ODQA tasks. Later, our analyses show that both Chain-of-Skills inference and pretraining contribute to the observed gains. + +Cross-data Results Given that both EntityQuestions and SQuAD are single-hop, we use baselines on NQ with improved robustness for comparison. + +
EntityQuestionsSQuAD
Top-20Top-100Top-20Top-100
BM2570.879.271.181.8
DPR-multi (Karpukhin et al., 2020)56.670.152.067.7
SPAR-wiki (Chen et al., 2021b)73.681.573.083.6
COS76.382.472.681.2
+ +Table 5: Cross-dataset top- $k$ accuracy on test sets. + +
#ParamsTop-20Top-100
Chain-of-Skills inference
No Expert111M90.292.4
FFN Expert(naive)252M91.393.4
MHA Expert(naive)182M92.094.0
MHA Expert(COS)182M92.094.2
Retrieval-only inference
Multi-hop Retriever110M85.188.9
MHA Expert(naive)182M82.887.0
MHA Expert(COS)182M85.989.6
+ +Table 6: Ablation results on HotpotQA dev using top-k retrieval accuracy. All models are initialized from BERT-base and trained on HotpotQA only. + +Particularly, SPAR-wiki is an ensemble of two dense models with one pretrained using BM25 supervision on Wikipedia and the other fine-tuned on NQ. BM25 is included here, as it is found to achieve better performance than its dense counterpart on those two datasets. The evaluation results are shown in Table 5. Overall, our model achieves the largest gains over BM25 on both datasets, indicating that our multi-task fine-tuned model with Chain-of-Skills inference is more robust than previous retrieval-only approaches. + +# 5 Analysis + +# 5.1 Task Interference + +We conduct ablation studies on HotpotQA to compare different ways of implementing skill-specific specialization (discussed in §3.2) and their effects on task interference. As MHA experts are used for our model, we consider two variants for comparison: 1) the no-expert model where all tasks share one encoder, and 2) the FFN expert model where specialized FFN sub-layers are used. Then we also compare the proposed expert configuration with a variant where the expanded query retrieval inputs share the same expert as single retrieval, denoted as the naive setting. The results are shown in the upper half of Table 6. Compared with the no-expert model, both FFN and MHA experts can effectively reduce task interference, wherein MHA expert is more effective overall. Our proposed expert config + +![](images/f0569daf6bc6862e4e5c0da4459619b4d5398bf1a8ce88331af3f253698e6bb2.jpg) +Figure 4: Top-100 retrieval accuracy on inference strategy: Chain-of-Skills vs retrieval-only. + +![](images/40ca160139baf43f528d8679c8ca57d8c940c2f4e62d03c0660c2b13b429e9a6.jpg) +Figure 5: Comparison on the effect of pretraining using top-100 retrieval accuracy with COS inference. + +uration can further help. + +# 5.2 Benefit of Chain-of-Skills Inference + +Here we explore the benefits of the chained skill inference over the retrieval-only version. We additionally train a multi-hop retriever following Xiong et al. (2021b), and compare it with the two MHA expert models using the same two rounds of retrieval-only inference. The comparison is shown in the lower part of Table 6. As we can see, retrieval-only inference suffers large drops in performance. Although our proposed and naive MHA expert configurations have similar performance using Chain-of-Skills inference, the naive configuration model shows severe degradation caused by task interference compared with the multi-hop retriever, validating the effectiveness of our proposed model. We further compare our Chain-of-Skills inference with the retrieval-only inference on NQ, EntityQuestions and SQuAD in Figure 4. It is easy to see that our pretraining can benefit the retrieval-only version. However, using better skill configurations via Chain-of-Skills inference yields further improvements, particularly on those unseen datasets. + +# 5.3 Effect of Pretraining + +To further demonstrate the benefit of our proposed multi-task pretraining, we fine-tune another multi- + +
QueryDocTop-20Top-100
Single query*0196.198.2
Single query4190.195.2
Single query2191.895.9
Single query2387.492.7
Expanded query0194.297.0
Expanded query*4195.397.4
Expanded query2174.585.8
Expanded query2367.379.6
+ +Table 7: Results of feeding the inputs to different experts, where the first two columns represent the query expert id and document expert id. * denotes the proposed setup + +task model following the same training protocol as COS but BERT model weights are used for initialization. Both COS and the model without pretraining are then using the same skill configuration for inference. The results are illustrated in Figure 5. Similar to the retrieval-only version (Figure 4), we find that COS consistently outperforms the multi-task model without pretraining across all considered datasets using Chain-of-Skills inference. Again, the pretrained model is found to achieve improvements across the board, especially on out-of-domain datasets, which validates the benefits of our multi-task pretraining. + +# 5.4 Swapping Experts + +To understand if different experts in our model learned different specialized knowledge, we experiment with swapping experts for different inputs on HotpotQA. In particular, we feed the single query input and expanded query input to different query experts and then retrieve from either the context passage index or the entity description index. For single query input, we measure if the model can retrieve one of the positive passages. For expanded query input, we compute the recall for the other positive passage as done in (§4.3). The results are shown in Table 7. Although both the single query expert and the expanded query expert learn to retrieve evidence using the [CLS] token, swapping the expert for either of these input types leads to a significant decrease in performance. Also, switching to the entity query expert and retrieving from the entity description index results in a large drop for both types of inputs. This implies that each specialized expert acquires distinct knowledge and cannot be substituted for one another. + +
DevTest
EMF1EMF1
HYBRIDER (Chen et al., 2020)10.313.09.712.8
FR+CBR(Chen et al., 2021a)28.132.527.231.5
CARP (Zhong et al., 2022)33.238.632.538.5
OTTer (Huang et al., 2022)37.142.837.343.1
CORE (Ma et al., 2022a)49.055.747.354.1
CORE + FiE51.457.8--
COS + FiE56.963.254.961.5
+ +Table 8: End-to-end QA results on OTT-QA. + +# 6 Question Answering Experiments + +Here, we conduct end-to-end question-answering experiments on NQ, OTT-QA and HotpotQA, using retrieval results from COS. Following the literature, we report exact match (EM) accuracy and F1 score. + +For NQ and OTT-QA, we re-implement the Fusion-in-Encoder (FiE) model (Kedia et al., 2022) because of its superior performance on NQ. For NQ, the model reads top-100 passages returned by COS, and for OTT-QA, the model reads top-50 evidence chains, in order to be comparable with previous work. Here, separate models are trained for each dataset independently. Due to space constraints, we only present the results on OTT-QA and leave the NQ results to Table A2. The OTT-QA results are summarized in Table 8. Our model, when coupled with the FiE, is able to outperform the previous baselines by large margins on OTT-QA, and we can see that the superior performance of our model is mainly due to COS. + +Finally, for HotpotQA, since the task requires the model to predict supporting sentences in addition to the answer span, we follow Zhu et al. (2021) to train a separate reader model to learn answer prediction and supporting sentence prediction jointly. Due to space constraints, we leave the full results to Table A3. Overall, our method achieves competitive QA performance against the previous SOTA with improved exact match accuracy. + +# 7 Related Work + +Dense retrievers are widely used in recent literature for ODQA (Lee et al., 2019; Karpukhin et al., 2020). While most previous work focuses on single retrieval (Xiong et al., 2021a; Qu et al., 2021), some efforts have also been made towards better handling of other query types. Xiong et al. (2021b) propose a joint model to handle both single retrieval and expanded query retrieval. Chen et al. (2021b) train a dense model to learn salient phrase retrieval. + +Ma et al. (2022a) build an entity linker to handle multi-hop retrieval. Nevertheless, all those models are still customized for specific datasets, e.g., only a subset of query types are considered or separate models are used, making them un-reusable and computationally intensive. We address these problems by pinning down a set of functional skills that enable joint learning over multiple datasets. + +Mixture-of-expert models have also become popular recently (Fedus et al., 2021b). Methods like gated routing (Lepikhin et al., 2020) or stochastic routing of experts (Zuo et al., 2021) do not differentiate the knowledge learned by different experts. Instead, our work builds expert modules that learn reusable skills which can be flexibly combined for different use cases. + +Another line of work focuses on unsupervised dense retrievers using self-supervised data constructed from the inverse-cloze-task (Lee et al., 2019), random crossings (Izacard et al., 2021), truncation of passages with the same span (Ram et al., 2022), hyperlink-induced passages (Zhou et al., 2022) or synthetic QA pairs (Oguz et al., 2022). Other model architecture adjustments on Transformer for retrieval are proposed (Gao and Callan, 2021, 2022). Our work can be viewed as a synergy of both. Our multi-task pretrained model can perform better zero-shot retrieval. Our modular retriever can be further fine-tuned in a multi-task fashion to achieve better performance. + +# 8 Conclusions + +In this work, we propose a modular model Chain-of-Skills (COS) that learns five reusable skills for ODQA via multi-task learning. To reduce task interference, we design a new parameterization for skill modules. We also show that skills learned by COS can be flexibly chained together to better fit the target task. COS can directly perform superior zero-shot retrieval using multitask self-supervision on Wikipedia. When finetuned on multiple datasets, COS achieves SOTA results across the board. For future work, we are interested in exploring scaling up our method and other scenarios, e.g., commonsense reasoning (Talmor et al., 2022) and biomedical retrieval (Nentidis et al., 2020; Zhang et al., 2022b). + +# Acknowledgements + +We would like to thank Aman Madaan, Sheng Zhang, and other members of the Deep Learning + +group at Microsoft Research for their helpful discussions and anonymous reviewers for their valuable suggestions on this paper. + +# Limitations + +We identify the following limitations of our work. + +Our current COS's reranking expert only learns to rerank single-step results. Thus it can not model the interaction between documents in case of multipassage evidence chains, which might lead to suboptimal performance, e.g., when we need to rerank the full evidence path for HotpotQA. At the same time, we hypothesize that the capacity of the small model used in our experiments is insufficient for modeling evidence chain reranking. We leave the exploration of learning a full path reranker for future work. + +Also, our current pretraining setup only includes the three bi-encoder tasks, and thus we can not use the pretrained model out-of-box to solve tasks like end-to-end entity linking. Consequently, the learned skills from self-supervision can not be chained together to perform configurable zero-shot retrieval. It would be interesting to also include the entity span proposal skill in the pretraining stage, which could unleash the full potential of the Chain-of-Skills inference for zero-shot scenarios. + +# References + +Akari Asai, Kazuma Hashimoto, Hannaneh Hajishirzi, Richard Socher, and Caiming Xiong. 2020. Learning to retrieve reasoning paths over wikipedia graph for question answering. In International Conference on Learning Representations. +Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E. Hinton. 2016. Layer normalization. +Jonathan Berant, Andrew Chou, Roy Frostig, and Percy Liang. 2013. Semantic parsing on Freebase from question-answer pairs. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pages 1533-1544, Seattle, Washington, USA. Association for Computational Linguistics. +Wenhu Chen, Ming wei Chang, Eva Schlinger, William Wang, and William Cohen. 2021a. Open question answering over tables and text. Proceedings of ICLR 2021. +Wenhu Chen, Hanwen Zha, Zhiyu Chen, Wenhan Xiong, Hong Wang, and William Yang Wang. 2020. 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. +Xilun Chen, Kushal Lakhotia, Barlas Oğuz, Anchit Gupta, Patrick Lewis, Stan Peshterliev, Yashar Mehdad, Sonal Gupta, and Wen tau Yih. 2021b. Salient phrase aware dense retrieval: Can a dense retriever imitate a sparse one? +Hao Cheng, Hao Fang, Xiaodong Liu, and Jianfeng Gao. 2022. Task-aware specialization for efficient and robust dense retrieval for open-domain question answering. +Hao Cheng, Yelong Shen, Xiaodong Liu, Pengcheng He, Weizhu Chen, and Jianfeng Gao. 2021. UnitedQA: A hybrid approach for open domain question answering. 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 3080-3090, Online. Association for Computational Linguistics. +Kevin Clark, Minh-Thang Luong, Quoc V. Le, and Christopher D. Manning. 2020. Electra: Pre-training text encoders as discriminators rather than generators. +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. +Ming Ding, Chang Zhou, Qibin Chen, Hongxia Yang, and Jie Tang. 2019. Cognitive graph for multi-hop reading comprehension at scale. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 2694-2703, Florence, Italy. Association for Computational Linguistics. +Martin Fajcik, Martin Docekal, Karel Ondrej, and Pavel Smrz. 2021. R2-D2: A modular baseline for open-domain question answering. In *Findings of the Association for Computational Linguistics: EMNLP* 2021, pages 854-870, Punta Cana, Dominican Republic. Association for Computational Linguistics. +Yuwei Fang, Siqi Sun, Zhe Gan, Rohit Pillai, Shuo-hang Wang, and Jingjing Liu. 2020. Hierarchical graph network for multi-hop question answering. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 8823-8838, Online. Association for Computational Linguistics. +William Fedus, Barret Zoph, and Noam Shazeer. 2021a. Switch transformers: Scaling to trillion parameter models with simple and efficient sparsity. + +William Fedus, Barret Zoph, and Noam Shazeer. 2021b. Switch transformers: Scaling to trillion parameter models with simple and efficient sparsity. arXiv:2101.03961 [cs.LG]. +Yair Feldman and Ran El-Yaniv. 2019. Multi-hop paragraph retrieval for open-domain question answering. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 2296-2309, Florence, Italy. Association for Computational Linguistics. +Luyu Gao and Jamie Callan. 2021. Condenser: a pretraining architecture for dense retrieval. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 981-993, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Luyu Gao and Jamie Callan. 2022. Unsupervised corpus aware language model pre-training for dense passage retrieval. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2843-2853, Dublin, Ireland. Association for Computational Linguistics. +Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. 2015. Deep residual learning for image recognition. +Junjie Huang, Wanjun Zhong, Qian Liu, Ming Gong, Daxin Jiang, and Nan Duan. 2022. Mixed-modality representation learning and pre-training for joint table-and-text retrieval in openqa. +Gautier Izacard, Mathilde Caron, Lucas Hosseini, Sebastian Riedel, Piotr Bojanowski, Armand Joulin, and Edouard Grave. 2021. Unsupervised dense information retrieval with contrastive learning. +Gautier Izacard and Edouard Grave. 2020. Distilling knowledge from reader to retriever for question answering. +Gautier Izacard and Edouard Grave. 2021. Leveraging passage retrieval with generative models for open domain question answering. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 874-880, Online. Association for Computational Linguistics. +Vladimir Karpukhin, Barlas Oguz, Sewon Min, Patrick Lewis, Ledell Wu, Sergey Edunov, Danqi Chen, and Wen-tau Yih. 2020. Dense passage retrieval for open-domain question answering. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 6769-6781, Online. Association for Computational Linguistics. +Akhil Kedia, Mohd Abbas Zaidi, and Haejun Lee. 2022. Fie: Building a global probability space by leveraging early fusion in encoder for open-domain question answering. + +Omar Khattab, Christopher Potts, and Matei Zaharia. 2021. Baleen: Robust multi-hop reasoning at scale via condensed retrieval. +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. +Haejun Lee, Akhil Kedia, Jongwon Lee, Ashwin Paranjape, Christopher D. Manning, and Kyoung-Gu Woo. 2021. You only need one model for open-domain question answering. +Kenton Lee, Ming-Wei Chang, and Kristina Toutanova. 2019. Latent retrieval for weakly supervised open domain question answering. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 6086–6096, Florence, Italy. Association for Computational Linguistics. +Dmitry Lepikhin, HyoukJoong Lee, Yuanzhong Xu, Dehao Chen, Orhan Firat, Yanping Huang, Maxim Krikun, Noam Shazeer, and Zhifeng Chen. 2020. Gshard: Scaling giant models with conditional computation and automatic sharding. +Patrick Lewis, Yuxiang Wu, Linqing Liu, Pasquale Minervini, Heinrich Kuttler, Aleksandra Piktus, Pontus Stenetorp, and Sebastian Riedel. 2021. PAQ: 65 million probably-asked questions and what you can do with them. Transactions of the Association for Computational Linguistics, 9:1098-1115. +Shaobo Li, Xiaoguang Li, Lifeng Shang, Xin Jiang, Qun Liu, Chengjie Sun, Zhenzhou Ji, and Bingquan Liu. 2021. Hopretriever: Retrieve hops over wikipedia to answer complex questions. Proceedings of the AAAI Conference on Artificial Intelligence, 35(15):13279-13287. +Xiaodong Liu, Pengcheng He, Weizhu Chen, and Jianfeng Gao. 2019a. Multi-task deep neural networks for natural language understanding. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4487-4496, Florence, Italy. 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. 2019b. Roberta: A robustly optimized bert pretraining approach. +Kaixin Ma, Hao Cheng, Xiaodong Liu, Eric Nyberg, and Jianfeng Gao. 2022a. Open-domain question answering via chain of reasoning over heterogeneous knowledge. In *Findings of the Association for Computational Linguistics: EMNLP* 2022, pages 5360-5374, Abu Dhabi, United Arab Emirates. Association for Computational Linguistics. + +Kaixin Ma, Hao Cheng, Xiaodong Liu, Eric Nyberg, and Jianfeng Gao. 2022b. Open domain question answering with a unified knowledge interface. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1605-1620, Dublin, Ireland. Association for Computational Linguistics. +Kevin Meng, David Bau, Alex Andonian, and Yonatan Belinkov. 2022. Locating and editing factual associations in GPT. Advances in Neural Information Processing Systems, 35. +Anastasios Nentidis, Anastasia Krithara, Konstantinos Bougiatiotis, Martin Krallinger, Carlos Rodriguez-Penagos, Marta Villegas, and Georgios Paliouras. 2020. Overview of bioasq 2020: The eighth bioasq challenge on large-scale biomedical semantic indexing and question answering. Experimental IR Meets Multilinguality, Multimodality, and Interaction, page 194-214. +Yixin Nie, Songhe Wang, and Mohit Bansal. 2019. Revealing the importance of semantic retrieval for machine reading 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 2553-2566, Hong Kong, China. Association for Computational Linguistics. +Barlas Oguz, Kushal Lakhotia, Anchit Gupta, Patrick Lewis, Vladimir Karpukhin, Aleksandra Piktus, Xilun Chen, Sebastian Riedel, Scott Yih, Sonal Gupta, and Yashar Mehdad. 2022. Domain-matched pre-training tasks for dense retrieval. In *Findings of the Association for Computational Linguistics: NAACL* 2022, pages 1524–1534, Seattle, United States. Association for Computational Linguistics. +Peng Qi, Haejun Lee, Tg Sido, and Christopher Manning. 2021. Answering open-domain questions of varying reasoning steps from text. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 3599-3614, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Peng Qi, Xiaowen Lin, Leo Mehr, Zijian Wang, and Christopher D. Manning. 2019. Answering complex open-domain questions through iterative query 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 2590-2602, Hong Kong, China. Association for Computational Linguistics. +Yingqi Qu, Yuchen Ding, Jing Liu, Kai Liu, Ruiyang Ren, Wayne Xin Zhao, Daxiang Dong, Hua Wu, and Haifeng Wang. 2021. RocketQA: An optimized training approach to dense passage retrieval for open-domain question answering. In Proceedings of the 2021 Conference of the North American Chapter of + +the Association for Computational Linguistics: Human Language Technologies, pages 5835-5847, Online. Association for Computational Linguistics. +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. +Ori Ram, Gal Shachaf, Omer Levy, Jonathan Berant, and Amir Globerson. 2022. Learning to retrieve passages without supervision. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 2687-2700, Seattle, United States. Association for Computational Linguistics. +Stephen Robertson and Hugo Zaragoza. 2009. The probabilistic relevance framework: Bm25 and beyond. Found. Trends Inf. Retr., 3(4):333-389. +Christopher Sciavolino, Zexuan Zhong, Jinhyuk Lee, and Danqi Chen. 2021. Simple entity-centric questions challenge dense retrievers. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 6138-6148, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Devendra Singh, Siva Reddy, Will Hamilton, Chris Dyer, and Dani Yogatama. 2021. End-to-end training of multi-document reader and retriever for open-domain question answering. In Advances in Neural Information Processing Systems, volume 34, pages 25968-25981. Curran Associates, Inc. +Alon Talmor, Ori Yoran, Ronan Le Bras, Chandra Bhagavatula, Yoav Goldberg, Yejin Choi, and Jonathan Berant. 2022. Commonsenseqa 2.0: Exposing the limits of ai through gamification. +James Thorne, Andreas Vlachos, Christos Christodoulopoulos, and Arpit Mittal. 2018. FEVER: a large-scale dataset for fact extraction and VERIFICATION. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pages 809-819, New Orleans, Louisiana. Association for Computational Linguistics. +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 Proc. Advances in Neural Information Processing Systems (NeurIPS), volume 30. +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. +Fen Xia, Tie-Yan Liu, Jue Wang, Wensheng Zhang, and Hang Li. 2008. Listwise approach to learning to rank: Theory and algorithm. In Proceedings of the 25th International Conference on Machine Learning, ICML '08, page 1192-1199, New York, NY, USA. Association for Computing Machinery. +Lee Xiong, Chenyan Xiong, Ye Li, Kwok-Fung Tang, Jialin Liu, Paul N. Bennett, Junaid Ahmed, and Arnold Overwijk. 2021a. Approximate nearest neighbor negative contrastive learning for dense text retrieval. In International Conference on Learning Representations. +Wenhan Xiong, Xiang Lorraine Li, Srinivasan Iyer, Jingfei Du, Patrick Lewis, William Yang Wang, Yashar Mehdad, Wen-tau Yih, Sebastian Riedel, Douwe Kiela, and Barlas Oğuz. 2021b. Answering complex open-domain questions with multi-hop dense retrieval. International Conference on Learning Representations. +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. +Sheng Zhang, Hao Cheng, Jianfeng Gao, and Hoifung Poon. 2022a. Optimizing bi-encoder for named entity recognition via contrastive learning. +Sheng Zhang, Hao Cheng, Shikhar Vashishth, Cliff Wong, Jinfeng Xiao, Xiaodong Liu, Tristan Naumann, Jianfeng Gao, and Hoifung Poon. 2022b. Knowledge-rich self-supervision for biomedical entity linking. In Findings of the Association for Computational Linguistics: EMNLP 2022, pages 868-880, Abu Dhabi, United Arab Emirates. Association for Computational Linguistics. +Xinyu Zhang, Ke Zhan, Enrui Hu, Chengzhen Fu, Lan Luo, Hao Jiang, Yantao Jia, Fan Yu, Zhicheng Dou, Zhao Cao, and Lei Chen. 2021a. Answer complex questions: Path ranker is all you need. In Proceedings of the 44th International ACM SIGIR Conference on Research and Development in Information Retrieval, SIGIR '21, page 449-458, New York, NY, USA. Association for Computing Machinery. +Yuyu Zhang, Ping Nie, Arun Ramamurthy, and Le Song. 2021b. Answering any-hop open-domain questions with iterative document reranking. Proceedings of the 44th International ACM SIGIR Conference on Research and Development in Information Retrieval. +Chen Zhao, Chenyan Xiong, Corby Rosset, Xia Song, Paul Bennett, and Saurabh Tiwary. 2020. + +Transformer-xh: Multi-evidence reasoning with extra hop attention. In International Conference on Learning Representations. +Wanjun Zhong, Junjie Huang, Qian Liu, Ming Zhou, Jiahai Wang, Jian Yin, and Nan Duan. 2022. Reasoning over hybrid chain for table-and-text open domain qa. +Jiawei Zhou, Xiaoguang Li, Lifeng Shang, Lan Luo, Ke Zhan, Enrui Hu, Xinyu Zhang, Hao Jiang, Zhao Cao, Fan Yu, Xin Jiang, Qun Liu, and Lei Chen. 2022. Hyperlink-induced pre-training for passage retrieval in open-domain question answering. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 7135-7146, Dublin, Ireland. Association for Computational Linguistics. +Yunchang Zhu, Liang Pang, Yanyan Lan, Huawei Shen, and Xueqi Cheng. 2021. Adaptive information seeking for open-domain question answering. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 3615-3626, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Simiao Zuo, Xiaodong Liu, Jian Jiao, Young Jin Kim, Hany Hassan, Ruofei Zhang, Tuo Zhao, and Jianfeng Gao. 2021. Taming sparsely activated transformer with stochastic experts. + +# A Inference Pipeline + +At inference time, our model utilizes the retrieving skill or the linking skill or both in parallel to gather evidence at every reasoning step. When both skills are used, one problem is that the scores associated with the evidence found by different skills are not aligned, i.e., naively sorting the retrieved documents and linked documents together may cause one pool of documents to dominate over the other. Thus we propose to align the linking scores based on the same step retrieval score: + +$$ +\mathrm {l s} _ {i} = \mathrm {l s} _ {i} / \max (\{\mathrm {l s} \} \cup \{\mathrm {r s} \}) \times \max (\{\mathrm {r s} \}), \tag {6} +$$ + +where $\mathrm{ls}_i$ represents the linking score of the document $i$ and $\{\mathrm{ls}\},\{\mathrm{rs}\}$ represent the set of linking scores and retrieving scores for top- $K$ documents from each skill. Effectively, if the raw linking score is larger than the retrieving score, we would align the top-1 document from each set. On the other hand, if the raw linking score is smaller, it would not get scaled. The reason is that certain common entities may also be detected and linked by our model e.g., United States, but they usually do not contribute to the answer reasoning, thus we do not want to encourage their presence. + +In the case of a document being discovered by both skills, we promote its ranking in the final list. To do so, we take the max of the individual score (after alignment) and then multiply by a coefficient $\alpha$ , which is a hyper-parameter. + +$$ +s _ {i} = \alpha \max \left(\mathrm {l s} _ {i}, \mathrm {r s} _ {i}\right). \tag {7} +$$ + +Finally, we use the reranking skill to compute a new set of scores for the merged evidence set, and then sort the documents using the combination of retrieving/linking score and reranking score: + +$$ +s _ {i} + \beta \text {r a n k s c o r e} _ {i}. \tag {8} +$$ + +$\beta$ is another hyper-parameter. For multi-hop questions, the same scoring process is conducted for the second-hop evidence documents and then the two-hop scores are aggregated to sort the reasoning chains. The inference pipeline is also illustrated in Figure A1. + +# B Experimental Details + +# B.1 Data Statistics + +The detailed data statistics are shown in Table A1. Pretraining We follow Izacard et al. (2021) and Wu et al. (2020) to construct examples for single + +retrieval and entity linking, respectively. For single retrieval, a pair of randomly cropped views of a passage is treated as a positive example. Similar to Spider (Ram et al., 2022), we also use the processed DPR passage corpus based on the English Wikipedia dump from 2018/12/20. For entity linking, we directly use the preprocessed data released by BLINK (Wu et al., 2020) based on the English Wikipedia dump from 2019/08/01. For expanded query retrieval, we construct the pseudo query using a short text snippet with the first passage from the same page, and we treat the first passage from linked pages as the target. As no hyperlink information is preserved for the DPR passage corpus, we use the English Wikipedia dump from 2022/06/01 for data construction. In each Wikipedia page, we randomly sample 30 passages with hyperlinks. (If there are less than 30 passages with hyperlinks, we take all of them.) Each sampled passage, together with the first passage of the page, form a pseudo query. Then, in each sampled passage, we randomly pick an anchor entity and take the first passage of its associated Wikipedia page as the target. To avoid redundancy, if an anchor entity has been used 10 times in a source page, we no longer pick it for the given source. If the query and the target together exceed 512 tokens, we will truncate the longer of the two by randomly dropping its first token or its last token. + +Finetuning For NQ, we adopted the retriever training data released by Ma et al. (2022b) and further used them for the reranking skill. Note that data from Ma et al. (2022b) also contains table-answerable questions in NQ, and we simply merged the corresponding training splits with the text-based training split. That's why the number of examples in the last column is greater than the number of questions in the training set. + +For HotpotQA, we adopted single retrieval and expanded query retrieval data released by Xiong et al. (2021b). For question entity linking data, we heuristically matched the entity spans in the question with the gold passages' title to construct positive pairs, and we use the same set of negative passages as in single retrieval. For passage entity linking, we collected all unique gold passages in the training set and their corresponding hyperlinks for building positives and mined negatives using BM25. Finally, the reranking data is the same as single retrieval. + +For OTT-QA, we adopt the single retrieval and ta + +![](images/5297b4e12dfe1313cf3388bd9ee74440c6d0789cce325826dbf25e26fe5a38a1.jpg) +Figure A1: The reasoning pipeline of Chain-of-Skills (COS). Given a question, COS first identifies salient spans in the question, then the retrieving and linking skills are both used to find first-hop evidence, using the [CLS] token and entity mention representation respectively. Then we merge all the evidence through score alignment and the reranking skill. For top-ranked evidence documents, we concatenate each of them with the question and perform another round of retrieving and linking. Then the second hop evidence are merged and reranked in the same fashion. Finally, the reasoning paths are sorted based on both hops' scores + +ble entity linking data released by Ma et al. (2022a). For expanded query retrieval, we concatenate the question with the table title, header, and row that links to the answer-containing passage as the query, and the corresponding passage is treated as a positive target. The negatives are mined with BM25. Finally, reranking data is the same copy as in single retrieval except that we further break down tables into rows and train the model to rank rows. This is because we want to make the reranking and expanded query retrieval more compatible. + +Since iterative training is shown to be an effective strategy by previous works (Xiong et al., 2021a; Ma et al., 2022b), we further mined harder negatives for HotpotQA and OTT-QA skill training data. Specifically, we train models using the same configuration as in pretraining (four task-specific experts, with no reranking data or span proposal data) for HotpotQA and OTT-QA respectively (models are initialized from BERT-based-uncased). Then we minded harder negatives for each of the data types using the converged model. The reranking and the entity span proposal skills are excluded in this round because the reranking can already benefit from harder negative for single retrieval (as two skills share the same data) and the entity span proposal does not need to search through a large index. Finally, the data splits coupled with harder negatives are used to train our main Chain-of-Skills (COS) and conduct ablation studies. + +# B.2 Training Details + +Pretraining Similar to Contriever (Izacard et al., 2021), we adopt a continual pretraining setup based + +on the uncased BERT-base architecture, but our model is initialized from the Contriever weights. We train the model for 20 epochs with the batch size of 1024 and the max sequence length of 256. Here, we only use in-batch negatives for contrastive learning. The model is optimized using Adam with the initial learning rate of 1e-4. The final checkpoint is used for fine-tuning later. + +Finetuning When initializing from pretrained $\cos$ , the weights mapping for the first 5 experts are illustrated in Figure 3 and the last expert is initialized from BERT-base-uncased. For all experiments, we train models for 40 epochs with the batch size of 192, the learning rate of 2e-5, and the max sequence length of 256. During training, each batch only contains training data for one of the skills from one dataset, thus the model can effectively benefit from the in-batch negatives. To train the entity span proposal skill, we use the same data as entity linking. In particular, we route the data to span proposal experts $20\%$ of the time otherwise the data go through entity linking experts. + +# B.3 Inference Details + +Zero-shot-evaluation We directly use the single retrieval skill to find the top100 documents and compute the results in Table 1. + +Supervised and Cross-dataset For NQ, EntityQuestions and SQuAD, the reasoning path has a length of 1, i.e., only single passages. We use both single retrieval and linking skills to find a total of top 1000 passages first, and then reduce the set to top 100 using the reranking skill. + +Both HotpotQA and OTT-QA have reasoning paths with max length 2. For OTT-QA, we first + +
DatasetTrainDevTestSkill Training Data# Examples
Pretraining---single retrieval6M
expanded query retrieval6M
passage entity linking9M
NQ79,1688,7573,610single retrieval86,252
reranking86,252
HotpotQA90,4477,4057,405single retrieval90,447
expanded query retrieval90,447
question entity linking80,872
passage entity linking104,335
reranking90,447
OTT-QA41,4692,2142,158single retrieval41,469
expanded query retrieval31,638
table entity linking19,764
reranking41,479
EntityQuestions-22,06822,075--
WebQ--2,032--
SQuAD--10,570--
+ +find top 100 tables using the single retrieval skill following (Ma et al., 2022a). Then we break down tables into rows and use the reranking skill to keep only top 200 rows. Then for each row, expanded query retrieval and linking skills are used to find the second-hop passages, where we keep top 10 passages from every expanded query retrieval and top 1 passage from every linked entity. Finally, we apply the same heuristics, as done in Ma et al. (2022a) to construct the final top 100 evidence chains. + +For HotpotQA, single retrieval and linking are used jointly to find the first-hop passages where we keep top 200 passages from single retrieval and top 5 passage from each linked question entity. The combined set is then reranked to keep the top 30 first-hop passages. Then expanded query retrieval and passage entity linking are applied to these 30 passages, where we keep top 50 passages from expanded query retrieval and top 2 passages from every linked passage entity. Next, another round of reranking is performed on the newly collected passages and then we sort the evidence passage chains based on the final aggregated score and keep top 100 chains. Since all of the baselines on HotpotQA adopt a large passage path reranker, we also trained such a model following (Zhu et al., 2021) (discussed in Appendix C) to rank the top 100 passage + +Table A1: Statistics of datasets used in our experiments, columns 2-4 represent the number of questions in each split. The last two columns contain the type of training data and the corresponding number of instances + +
#ParamsEM
FiD (Izacard and Grave, 2021)770M51.4
UnitedQA-E (Cheng et al., 2021)330M51.8
FiD-KD (Izacard and Grave, 2020)770M54.4
EMDR2 (Singh et al., 2021)440M52.5
YONO (Lee et al., 2021)440M53.2
UnitedQA (Cheng et al., 2021)1.87B54.7
R2-D2 (Fajcik et al., 2021)1.29B55.9
FiE (Kedia et al., 2022)330M58.4
FiE (ours implementation)330M56.3
COS + FiE330M56.4
+ +Table A2: End-to-end QA Exact Match score on NQ + +chains to get the top 1 prediction. + +The hyperparameters for OTT-QA and HotpotQA inference are selected such that the total number of evidence chains are comparable to previous works (Ma et al., 2022a; Xiong et al., 2021b). + +# C Question Answering Results + +# C.1 Training Details + +We follow descriptions in (Kedia et al., 2022) for re-implementation of FiE model and the model is initialized from Electra-large (Clark et al., 2020). For NQ, we train the model for 5,000 steps with the effective batch size of 64, the learning rate + +of 5e-5, the layer-wise learning rate decay of 0.9, the max answer length of 15, the max question length of 28, the max sequence length of 250, and 10 global tokens. Note that although Kedia et al. (2022) reports that training with 15,000 steps leads to better performance, we actually found it to be the same as 5,000 steps. Thus we train with fewer steps to save computation. For OTT-QA, we used the same set-up of hyperparameters except that the max sequence length is changed to 500. + +For HotpotQA path reranker and reader, we prepare the input sequence as follows: "[CLS] Q [SEP] yes no [P] P1 [P] P2 [SEP]", where [P] is a special token to denotes the start of a passage. Then the input sequence is encoded by the model and we extract passage start tokens representations $p_1, \ldots, p_m$ and averaged sentence embeddings for every sentence in the input $s_1, \ldots, s_n$ to represent passages and sentences respectively. The path reranker is trained with three objectives: passage ranking, supporting sentence prediction and answer span extraction, as we found the latter two objectives also aid the passage ranking training. For answer extraction, the model is trained to predict the start and end token indices as commonly done in recent literature (Xiong et al., 2021b; Zhu et al., 2021). For both passage ranking and supporting sentence prediction, the model is trained with the ListMLE loss (Xia et al., 2008). In particular, every positive passage in the sequence is assigned a label of 1, and every negative passage is assigned 0. To learn a dynamic threshold, we also use the [CLS] token $p_0$ to represent a pseudo passage and assign a label of 0.5. Finally, the loss is computed as follows: + +$$ +L _ {\mathrm {p}} = - \sum_ {i = 0} ^ {m} \log \frac {\exp \left(p _ {i} W _ {p}\right)}{\sum p ^ {\prime} \in \mathcal {P} \cup \{p _ {i} \} \exp \left(p ^ {\prime} W _ {p}\right)}. \tag {9} +$$ + +where $\mathcal{P}$ contains all passages representations that have labels smaller than $p_i$ . $W_{p} \in \mathbb{R}^{d}$ are learnable weights and $d$ is the hidden size. In other words, the model learns to assign scores such that positive passages $>$ thresholds $>$ negative passages. The supporting sentence prediction is also trained using Equation 9. Overall, use the following loss weighting: + +$$ +L _ {\text {p a t h}} = L _ {p} + L _ {a} + 0. 5 \times L _ {s} \tag {10} +$$ + +where $L_{a}$ is the answer extraction loss and $L_{s}$ is the supporting sentence prediction loss. + +During training, we sample 0-2 positive passages and 0-2 negative passages from the top 100 chains returned by $\cos$ , and the model encodes at most 3 passages, i.e., the passage chain structure is not preserved and the passages are sampled independently. We train the model for 20,000 steps with the batch size of 128, the learning rate of 5e-5, the layer-wise learning rate decay of 0.9, the max answer length of 30, the max question length of 64, and the max sequence length of 512. For inference, the model ranks top 100 passage chains with structure preserved. We sum the scores of the two passages in every chain and subtract the dynamic threshold score and sort the chains based on this final score. + +Next, we train a reader model that only learns answer extraction and supporting sentence prediction. We only train the model using the two gold passages with the following loss weighting. + +$$ +L _ {\text {r e a d e r}} = L _ {a} + 0. 5 \times L _ {s} \tag {11} +$$ + +The model uses the same set of hyperparameters as the path reranker except that the batch size is reduced to 32. At inference time, the model directly read the top 1 prediction returned by the path reranker. Both models here are initialized from Electra-large. + +# C.2 Results + +The NQ results are presented in Table A2. Overall, our model achieves a similar performance as our own FiE baseline. FiE baseline uses the reader data released by the FiD-KD model, which has an R100 of 89.3 (vs 90.2 of $\cos$ ). Considering that the gap between our method and FiD-KD model's top 100 retrieval recall is relatively small, this result is not surprising. + +The HotpotQA results are shown in Table A3. Overall our results are similar to previous SOTA methods on the dev set. At the time of the paper submission, we have not got the test set results on the leaderboard. + +We adopted DPR evaluation scripts ${}^{2}$ for all the retrieval evaluations and MDR evaluation scripts ${}^{3}$ for all the reader evaluations. + +# D Computation + +Our COS has 182M paramteres. For COS pretraining, we use 32 V100-32GB GPUs, which takes + +$^{2}$ https://github.com/facebookresearch/DPR +3https://github.com/facebookresearch/multihopdense_retrieval + +
DevTest
AnsSupJointAnsSupJoint
EMF1EMF1EMF1EMF1EMF1EMF1
MUPPET (Feldman and El-Yaniv, 2019)31.140.417.047.711.827.630.640.316.747.310.927.0
CogQA (Ding et al., 2019)37.649.423.158.512.235.337.148.922.857.712.434.9
GoldEn Retriever (Qi et al., 2019)------37.949.830.764.618.039.1
Semantic Retrieval (Nie et al., 2019)46.558.839.971.526.649.245.357.338.770.825.147.6
Transformer-XH (Zhao et al., 2020)54.066.241.772.127.752.951.664.140.971.426.151.3
HGN (Fang et al., 2020)------59.771.451.077.437.962.3
GRR (Asai et al., 2020)60.573.349.276.135.861.460.073.049.176.435.461.2
DDRQA (Zhang et al., 2021b)62.976.951.379.1--62.575.951.078.936.063.9
MDR (Xiong et al., 2021b)62.375.156.579.442.166.362.375.357.580.941.866.6
IRRR+ (Qi et al., 2021)------66.379.957.282.643.169.8
HopRetriever-plus (Li et al., 2021)66.679.256.081.842.069.064.877.856.181.841.067.8
TPRR (Zhang et al., 2021a)67.380.160.284.545.371.467.079.559.484.344.470.8
AISO (Zhu et al., 2021)68.180.961.586.545.972.567.580.561.286.044.972.0
COS68.281.061.185.346.472.367.480.161.385.345.771.7
+ +Table A3: End-to-end QA results on Hotpot-QA. + +about 3 days. For COS finetuning, we used 16 V100-32GB GPUs which takes about 2 days. Our reader model FiE has 330M parameters. We used 16 V100-32GB GPUs for training which takes about 1.5 days. For HotpotQA, both the path reranker and the reader have 330M parameters. We used 16 V100-32GB GPUs for training, the path reranker takes about 12 hours and the reader takes about 4 hours to train. We train all of our models once due to the large computation cost. + +# E Licenses + +We list the License of the software and data used in this paper below: + +DPR: CC-BY-NC 4.0 License +- MDR: CC-BY-NC 4.0 License +- Contriever: CC-BY-NC 4.0 License +- BLINK: MIT License +- NQ: CC-BY-SA 3.0 License +HotpotQA: CC-BY-NC 4.0 License +- OTT-QA: MIT License +- EntityQuestions: MIT License +- SQuAD: CC-BY-SA 4.0 License +- WebQuestions: CC-BY 4.0 License + +A For every submission: + +A1. Did you describe the limitations of your work? + +section Limitations after the conclusion + +A2. Did you discuss any potential risks of your work? + +As our model does not generate its own outputs, when used with trustworthy sources, we do not see high societal risks. However, we admit that those biases from the training datasets can be amplified. For example, regardless of improvements, our model can not fully address the deficiency of dense retrieval on rare entities, which can compromise the fairness of retrieval. + +A3. Do the abstract and introduction summarize the paper's main claims? + +section 1 + +A4. Have you used AI writing assistants when working on this paper? + +Left blank. + +B Did you use or create scientific artifacts? + +section 3 and 4 + +B1. Did you cite the creators of artifacts you used? + +section 3 and 4 + +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? + +Appendix E + +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +We only used publically available datasets in the same way as previous works + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? + +We only used publically available datasets in the same way as previous works + +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? + +We only used publically available datasets in the same way as previous works + +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. + +Appendix B + +# C Did you run computational experiments? + +section 4 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +Appendix D + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +Appendix B and C + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +Appendix D + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +Appendix C + +# D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +Not applicable. Left blank. + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +Not applicable. Left blank. + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +Not applicable. Left blank. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +Not applicable. Left blank. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +Not applicable. Left blank. \ No newline at end of file diff --git a/chainofskillsaconfigurablemodelforopendomainquestionanswering/images.zip b/chainofskillsaconfigurablemodelforopendomainquestionanswering/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..68f5b7d49128db59b2d9ba976e44f33902e442b2 --- /dev/null +++ b/chainofskillsaconfigurablemodelforopendomainquestionanswering/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:da895485be84a03dfa1fb2d42d3b7b1fc1ba18d4040a9f336be446191cc775fe +size 793452 diff --git a/chainofskillsaconfigurablemodelforopendomainquestionanswering/layout.json b/chainofskillsaconfigurablemodelforopendomainquestionanswering/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..877caeae10a5c8f2a5a964723fb4a89fdca2f084 --- /dev/null +++ b/chainofskillsaconfigurablemodelforopendomainquestionanswering/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c76aa9415c89209fa4a9becc48279305df049fa3cdeafd42b0c02146e7caa779 +size 582958 diff --git a/characterawaremodelsimprovevisualtextrendering/3fabeece-a74d-437f-b34f-0921f9132725_content_list.json b/characterawaremodelsimprovevisualtextrendering/3fabeece-a74d-437f-b34f-0921f9132725_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..6590593c8d5c1262f24488a7f205d99463ee5582 --- /dev/null +++ b/characterawaremodelsimprovevisualtextrendering/3fabeece-a74d-437f-b34f-0921f9132725_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a5d7a023bb11feca40eeb28800885fb52fe6492142a33f31922304bcd3e73a7 +size 245200 diff --git a/characterawaremodelsimprovevisualtextrendering/3fabeece-a74d-437f-b34f-0921f9132725_model.json b/characterawaremodelsimprovevisualtextrendering/3fabeece-a74d-437f-b34f-0921f9132725_model.json new file mode 100644 index 0000000000000000000000000000000000000000..93152f7f6f61f9a737212b5e3682d88f560aed2b --- /dev/null +++ b/characterawaremodelsimprovevisualtextrendering/3fabeece-a74d-437f-b34f-0921f9132725_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c241ad0f77e15fcb128cd88df58388096c369bcb47f35f912343c6c91a820008 +size 286496 diff --git a/characterawaremodelsimprovevisualtextrendering/3fabeece-a74d-437f-b34f-0921f9132725_origin.pdf b/characterawaremodelsimprovevisualtextrendering/3fabeece-a74d-437f-b34f-0921f9132725_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..fb0a05b255747108e9ac4aab6c75c87ba55c6131 --- /dev/null +++ b/characterawaremodelsimprovevisualtextrendering/3fabeece-a74d-437f-b34f-0921f9132725_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f463c380552e1f0ef61d9b9bc973fc77eae6f3ee0fd738662263881d02bb6e10 +size 6714615 diff --git a/characterawaremodelsimprovevisualtextrendering/full.md b/characterawaremodelsimprovevisualtextrendering/full.md new file mode 100644 index 0000000000000000000000000000000000000000..c0288e44863cd56000a1b69f83b8adaacd50161e --- /dev/null +++ b/characterawaremodelsimprovevisualtextrendering/full.md @@ -0,0 +1,1371 @@ +# Character-Aware Models Improve Visual Text Rendering + +# Rosanne Liu*, Dan Garrette*, Chitwan Sahara, William Chan, Adam Roberts, Sharan Narang, Irina Blok, RJ Mical, Mohammad Norouzi, Noah Constant* + +Google Research {rosanneliu, dhgarrette, nconstant}@google.com + +# Abstract + +Current image generation models struggle to reliably produce well-formed visual text. In this paper, we investigate a key contributing factor: popular text-to-image models lack character-level input features, making it much harder to predict a word's visual makeup as a series of glyphs. To quantify this effect, we conduct a series of experiments comparing character-aware vs. character-blind text encoders. In the text-only domain, we find that character-aware models provide large gains on a novel spelling task (WikiSpell). Applying our learnings to the visual domain, we train a suite of image generation models, and show that character-aware variants outperform their character-blind counterparts across a range of novel text rendering tasks (our DrawText benchmark). Our models set a much higher state-of-the-art on visual spelling, with $30+$ point accuracy gains over competitors on rare words, despite training on far fewer examples. + +# 1 Introduction + +Over the last year, image generation models have made impressive quality gains (Rombach et al., 2021; Ramesh et al., 2022; Sahara et al., 2022; Yu et al., 2022). While many practical use cases are already within reach, rendering visual text in images remains a challenge. Ramesh et al. (2022) observe that DALL-E-2 "struggles at producing coherent text," and the latest release of Stable Diffusion lists "cannot render legible text" as a known limitation. + +In this paper, we seek to understand and improve the ability of image generation models to render high-quality visual text. To do so, we first investigate the spelling ability of text encoders in isolation. We find that despite their popularity, character-blind text encoders—which receive no direct signal as to the character-level makeup of their inputs—have limited spelling ability. Building on Itzhak + +and Levy (2022), we test the spelling ability of text encoders across scales, architectures, input representations, languages, and tuning methods. We document for the first time the miraculous ability of character-blind models to induce robust spelling knowledge ( $>99\%$ accuracy) through web pretraining, but show that this does not generalize well beyond English, and is only achieved at scales over 100B parameters, making it infeasible for most applications. We find that character-aware text encoders, on the other hand, are able to achieve robust spelling ability at far smaller scales. + +Applying these findings to image generation, we train a range of character-aware text-to-image models and demonstrate that they significantly outperform character-blind models on text rendering. For purely character-level models, this improved text rendering comes at a cost—decreasing image-text alignment for prompts that don't involve visual text. To alleviate this, we propose combining character-level and token-level input representations, and find that this delivers the best of both worlds. + +Our main contributions are to: (1) Measure the spelling ability of a range of text encoders, pulling apart the effects of scale, character-awareness, and multilinguality, using a new benchmark: WikiSpell. (2) Present DrawText, the first detailed benchmark of visual text rendering for text-to-image models. (3) Improve the state of the art in text rendering ability of image generation models through the use of character-aware text encoders. We release code to reproduce our WikiSpell and DrawText evaluations. + +# 2 The spelling miracle + +Language models can be categorized as to whether they have direct access to the characters making up their text input ("character-aware") or do not ("character-blind"). Many early neural lan + +![](images/8d36b78331a0eee23748121dbd5c24d27273cb65b81a411be62286bfcada3292.jpg) +Character- Blind: + +![](images/af8a2b50a5c5c051449946cc2829d3690b4ed21b1a753259aaca9bd2906d0a8b.jpg) + +![](images/b15318bca655a47e742ab5e90ebc366481393d30bc827f9436f42d18c1ab656a.jpg) + +![](images/4951746172881461ab3c202c94ce6cf5afdfb1214ba822f9e2e1436fad350da9.jpg) + +![](images/351835a2155e4f5a00201e0f67e4b7a716ad08816fd9fcae1e5b1129bca94ce9.jpg) +Character-Aware: + +![](images/e92b6d4d5b802df5e3f5e0256d519033b0cd3241c3ba25b6d94d8efc49efeba8.jpg) +Figure 1: Top: Image generation models lacking character-level input features often misspell words. Bottom: Using a character-aware text encoder significantly improves the accuracy of rendered text. Prompts are: A vintage postage stamp with the message: , with messages: (1) California: All Dreams Welcome, (2) Canada: For Glowing Hearts, (3) Colorado: It's Our Nature, (4) St. Louis: All Within Reach. + +![](images/a1cefd548416eda31994ccd2182a5200ea7fc74d146a384f51f224f1b227d367.jpg) + +![](images/75e02c578e458577b896d6852e078dc7978ba567559505a3031b4adbb3517cdf.jpg) + +guage models operated directly on characters, with no notion of multi-character "tokens" (Sutskever et al., 2011; Graves, 2013). Later models moved to vocabulary-based tokenization, with some like ELMo (Peters et al., 2018) retaining character-awareness, and others like BERT (Devlin et al., 2019) abandoning it in favor of more efficient pretraining. At present, most widely used language models are character-blind, relying on data-driven subword segmentation algorithms like Byte Pair Encoding (BPE) (Gage, 1994; Sennrich et al., 2016) to induce a vocabulary of subword pieces. While these methods back off to character-level representations for sufficiently rare sequences, they compress common character sequences into unbreakable units by design, as shown in Figure 2. + +Recent work on "token-free" modeling has pointed to advantages of character-aware input representations. Xue et al. (2022) show that ByT5—a character-aware multilingual language model trained directly on UTF-8 bytes—outperforms parameter-matched character-blind models on tasks related to spelling and pronunciation. While operating at the byte or character level comes at the cost of training and inference speed, additional work suggests that this can be overcome through downsampling (Clark et al., 2022; Tay et al., 2021). See Mielke et al. (2021) for a recent overview of tokenization methods and character awareness. + +Surprisingly, despite lacking direct access to a token's spelling, character-blind models are, to varying degree, able to infer the character-level + +![](images/616fb9d48307d28331ffacd33675c8e1aaf13993edb962ca7bd0c1fb19da4cb3.jpg) +Figure 2: Subword tokenization—used in most text-to-image models—maps common character sequences onto IDs that are looked up in an embedding table before being passed to the model, removing any signal about token-internal composition. This example uses the T5 SentencePiece tokenizer (Raffel et al., 2020). + +makeup of their tokens. Itzhak and Levy (2022) observe that, after fine-tuning for spelling, RoBERTa and GPT-2 can achieve $32\%$ and $33\%$ accuracy at spelling held-out tokens. Kaushal and Mahowald (2022) confirm this ability and probe it further; however it remains unclear where in pretraining this knowledge is coming from, and how to improve it. For example, should we expect larger character-blind models to reach $100\%$ spelling accuracy across all tokens in their vocabulary? + +In section §3 we find that, with sufficient scale, character-blind models can achieve near-perfect spelling accuracy. We dub this phenomenon the "spelling miracle", to emphasize the difficulty of inferring a token's spelling from its distribution alone. At the same time, we observe that character-blind text encoders of the sizes used in practice for image generation are lacking core spelling knowledge. + +With this in mind, it is unsurprising that to- + +day's image generation models struggle to translate input tokens into glyph sequences. These models' text encoders are all character-blind, with Stable Diffusion, DALL-E, DALL-E-2, Imagen, Parti and eDiff-I all adopting BPE tokenizers (Rombach et al., 2021; Ramesh et al., 2021, 2022; Saharia et al., 2022; Yu et al., 2022; Balaji et al., 2022). + +For image-text models, another key source of knowledge is supervised image-caption data. Even if its text encoder is character-blind, could a model learn to spell by observing the makeup of words within images? While possible, we suspect this is an inefficient paradigm for learning, as each token would need to be learned separately, and would need to appear within an image-caption pair seen in training. In section §5 we find that, indeed, this "late-stage" learning of spelling is inferior to using a pretrained character-aware text encoder. + +# 3 Measuring text encoder spelling ability + +Since text-to-image generation models rely on text encoders to produce the representations for decoding, we first explore the ability of text encoders in isolation, using a text-only spelling evaluation task. + +# 3.1 The WikiSpell benchmark + +We build the WikiSpell benchmark by sampling words from Wiktionary. For each example in the dataset, the input to the model is a single word, and the expected output is its spelling, generated by inserting spaces between each Unicode character: + +elephant $\rightarrow$ e le p h a n t + +To examine the relationship between a word's frequency and a model's ability to spell it, we group words into buckets based on their frequency in the mC4 corpus (Xue et al., 2021). We create test and development sets from each bucket by sampling 1,000 words uniformly. The five buckets used are: the top $1\%$ most common words, the $1 - 10\%$ most common, $10 - 20\%$ $20 - 30\%$ ,and the bottom $50\%$ (which includes words never seen in the corpus). Finally, we build a training set of 10,000 words by combining 5,000 words sampled uniformly from the bottom $50\%$ bucket with 5,000 sampled proportional to their frequencies in mC4. We exclude words in the dev and test sets from the training set, so evaluation is always on held out words. + +Beyond English, we repeat this process for six other languages: Arabic, Chinese, Finnish, Korean, + +Russian, and Thai. For language selection criteria and further technical details, see Appendix D. + +The WikiSpell benchmark is similar to SpellingBee, introduced by Itzhak and Levy (2022), but differs in a few key ways. First, SpellingBee is designed to probe a model's embedding matrix: given an embedding vector, SpellingBee seeks to output the character sequence of the corresponding vocabulary element. As such, SpellingBee's inputs are always a single token, and it does not measure spelling ability for words the model represents as multiple tokens. Second, due to how subword vocabularies are trained, model vocabularies only contain high-frequency words, and thus SpellingBee inputs are necessarily high-frequency. Finally, as inputs must be drawn from a model's vocabulary, SpellingBee training and evaluation data must be tailored to a specific model, so a dataset cannot be reused across models. In contrast, WikiSpell is model-agnostic, covers single- to many-token words, and covers high- to low-frequency words. + +# 3.2 Text generation experiments + +We use the WikiSpell benchmark to evaluate pretrained text-only models across a variety of scales. In particular, we experiment with: T5 (Raffel et al., 2020), a character-blind encoder-decoder model pretrained on English data; mT5 (Xue et al., 2021), which is similar to T5, but pretrained on $>100$ languages; ByT5 (Xue et al., 2022), a character-aware version of mT5 that operates directly on UTF-8 byte sequences; and PaLM (Chowdhery et al., 2022), a decoder-only model of much larger scale, pretrained predominantly on English. Experimental results from English-only evaluation are shown in Table 1, and multilingual evaluation in Table 2. + +Our first finding is that character-blind models T5 and mT5 perform much worse on the Top-1% most frequent words. This result may seem counterintuitive since models typically perform better on frequent items; however due to how subword vocabularies are trained, common words are typically represented as atomic tokens (e.g., 87% of words in the English Top 1% bucket are single-token for T5), thereby obscuring their internal makeup. Scores are a bit higher in the mid-frequency buckets, where words are typically broken into a few common tokens, and lower again in the lowest-frequency bucket, where even the subword tokens may be less frequent. The low spelling accuracies indicate that T5's encoder does not retain sufficient information + +
Frequency +BucketFine-tuned, with frozen encoderByT5Fine-tuned, all parameters trainedFew-shot +PaLM
T5BLXLXXLT5ByT58B62B540B
BLXLXXLBLXLXXLBLXLXXL
Top 1%141250669795979836466268991001001008499100
1-10%292467699795989867728285100100100100629899
10-20%352773739694989874798991100100100100709799
20-30%322468689694999874788790100100100100719799
Bottom 50%292264659795999875778890100100100100699799
+ +Table 1: WikiSpell exact-match accuracy results for English. T5 models range from Base (B) (250M params) to XXL (11B params), while ByT5 models range from Base (300M) to XXL (13B). + +
LanguageFine-tuned, with frozen encoder mT5ByT5Few-shot PaLM
BLXLXXLBLXLXXL8B62B540B
Arabic22607587999910099326889
Chinese7876838499989999819398
English732547198969999719799
Finnish1036627798979999458499
Korean37587781999910099718896
Russian941577699989999418698
Thai2942466099999999223963
Average2749657799989999527992
+ +Table 2: WikiSpell exact-match accuracy results on 7 diverse languages, averaged across all frequency buckets. mT5 and ByT5 models were fine-tuned on the combined training sets of all languages; PaLM was prompted with 20 in-language examples. + +about the spelling of subwords in its vocabulary. + +Secondly, we find that for character-blind models, scale is a key factor in spelling ability. Both T5 and mT5 improve with scale, but even at XXL size, they are not particularly strong (e.g., T5-XXL's performance on common English words is only $66\%$ ). Only when character-blind models reach PaLM's scale do we start to see near-perfect spelling ability: PaLM 540B achieves $>99\%$ accuracy across all frequency buckets in English, despite the fact that it sees only 20 examples in its prompt (as opposed to the 1,000 fine-tuning examples shown to T5). However, performance is lower on other languages. + +Our experiments on ByT5 show that character-aware models have far greater spelling ability. ByT5's performance at Base and Large sizes is only slightly behind XL and XXL (though still in at least the mid-90% range), and the frequency of a word has little effect on ByT5's ability to spell it. These results far exceed those of (m)T5, and are comparable to the English performance of PaLM, which has $>100 \times$ more parameters, and exceed PaLM's performance on other languages. These findings indicate that substantially more character-level information is retained by the ByT5 encoder, and in such a way that it can be retrieved from those + +frozen parameters as needed for the decoding task. + +We also test fine-tuning the full model instead of keeping the encoder frozen (also in Table 1). When ByT5's encoder is fine-tuned, performance goes to roughly $100\%$ across all scales and frequency buckets. For T5, the effect of full fine-tuning is more mixed: on rare words, it helps a lot ( $65\% \rightarrow 90\%$ for T5-XXL on Bottom $50\%$ ), while for common words, it has little effect ( $66\% \rightarrow 68\%$ on Top $1\%$ ). This tells us that for words that get broken into smaller pieces (which may be repeated across training examples), the model can memorize spelling information provided during fine-tuning, whereas for single-token words, fine-tuning provides no spelling signal since, by definition, that single token will not appear in the fine-tuning dataset. + +# 4 The DrawText benchmark + +Evaluating text-to-image models has been an ongoing topic of research, with the development of standard benchmarks from COCO (Lin et al., 2014) to DrawBench (Saharia et al., 2022), and metrics including FID (Heusel et al., 2017), CLIP score (Hessel et al., 2021), and human preferences (Saharia et al., 2022). However, there has been a lack of work on text rendering and spelling evaluation. To that end, we present a new benchmark, DrawText, designed to measure the text rendering quality of text-to-image models. The benchmark consists of two parts, assessing distinct model capabilities: 1) DrawText Spelling, which evaluates simple word rendering over a large set of English terms; and 2) DrawText Creative, which evaluates end-to-end text rendering across diverse visual settings. + +# 4.1 DrawText Spelling + +To measure the spelling ability of image generation models in a controlled and automatable fashion, we construct 500 prompts by sampling 100 words from each of the English WikiSpell frequency buckets + +(see §3.1), and plugging them into the template: A sign with the word "________" written on it. For each prompt, we sample 4 images from the candidate model, and assess them using optical character recognition (OCR)-based metrics. $^5$ + +For OCR evaluation, we use the Google Cloud Vision API, which returns all text found within an image, along with bounding box locations. The DrawText Spelling prompt tends to generate a prominently positioned sign with text, which is relatively simple for off-the-shelf OCR to identify, but if the system returns multiple bounding boxes, we only use the top-most one. Additionally, since text may be rendered across multiple lines, we postprocess the OCR output by removing newline characters that appear within a single bounding box. Finally, since text on real signs is often written in all capitals, and models often do the same regardless of how the word is written in the prompt, we ignore case when computing the spelling accuracy. + +# 4.2 DrawText Creative + +Visual text is not limited to mundane examples like street signs. Text can appear in many forms—scribbled, painted, carved, sculpted, and so on. If image generation models support flexible and accurate text rendering, this can help designers in developing creative fonts, logos, layouts, and more. + +To test the ability of image generation models to support these use cases, we worked with a professional graphic designer to construct 175 diverse prompts that require rendering text in a range of creative styles and settings. The prompts vary in how much text is specified, ranging from a single letter to an entire sentence. We share these prompts in Appendix G, with the expectation that they will help the community work towards improving text rendering. Many of the prompts are beyond the abilities of current models, with state-of-the-art models exhibiting misspelled, dropped, or repeated words, as seen in Figure 3. + +# 5 Image generation experiments + +In this section, we evaluate the spelling ability of text-to-image generative models with the proposed DrawText benchmark. State-of-the-art text-to-image generative models consist of a text encoder plus a cascade of either diffusion models (Sa + +haria et al., 2022) or autoregressive models (Yu et al., 2022) that map the encoded text representations to realistic images. In section §3 we saw that character-aware text encoders greatly outperform character-blind models on spelling in a text-only setting; in this section, we investigate whether making the text encoder character-aware improves the text rendering ability of text-to-image models. + +# 5.1 Models + +For an apples-to-apples comparison, we train two character-blind and three character-aware image generation models. Our training closely follows the procedure of Sahara et al. (2022), with the following modifications. First, our models train for 500,000 steps, which is $5.6 \times$ fewer steps than Imagen. Second, we only train the initial $64 \times 64$ model, as text rendering ability can already be assessed at this scale. This allows us to forgo the training of super-resolution models. + +Third, rather than a mixture of datasets, we train exclusively on the publicly available Laion-400M (Schuhmann et al., 2021). This improves reproducibility and also increases the amount of visual text seen during training. Inspecting a random sample of 100 images, we found that a relatively high proportion (around $71\%$ ) of Laion images contain text, and many (around $60\%$ ) exhibit correspondence between caption text and visual text. + +Fourth, to prevent models from clipping text, we train on uncropped images with arbitrary aspect ratios. In contrast with the widely used strategy of cropping a square from the center of the image, we maintain the image's true aspect ratio by padding with black borders. The model receives an additional binary mask input indicating the padding.[6] + +To test the effects of text encoder size and character-awareness, we vary the pretrained text encoder as follows: + +T5-XL and T5-XXL - Following Sahara et al. (2022), we use the (character-blind) pretrained T5 text encoders of Raffel et al. (2020). The encoder sizes are 1.2B (XL) and 4.6B (XXL). Note, T5-XXL is the same encoder used in both Imagen and the recent eDiff-I (Balaji et al., 2022). + +ByT5-XL and ByT5-XXL - We use the pretrained ByT5 encoders of Xue et al. (2022), with encoders sizes 2.6B (XL) and 9.0B (XXL). These differ from T5 in several regards. First, ByT5 + +![](images/2fa3591b7f617f45e30a2e20eb6f65847b9c8a59dfd335621d1f841c5f8b6d9a.jpg) + +![](images/6aa65bf787a9490ab1239531d2cdaf9995b9d47f306aa6a54b6da607f0dcb570.jpg) + +![](images/417318e5dc407fa5593720744fe771ac2561ed7b9ce29ed42861be4fa6b2e04a.jpg) + +![](images/cd43af7102f7820eb4e1679f19dfdc0f2d7c9ed3a805dd257dbe40b2258a8e21.jpg) + +![](images/b17c6481277c7c43b16a266187c620ac3ee3b4ff3a5c06e286f903af010e3182.jpg) +Figure 3: Sample generations fromImagen (Saharia et al., 2022) on eight DrawText Creative prompts, illustrating their diversity. Most samples exhibit misspelled text or misshapen glyphs (e.g., the ff in coffee). Errors are increasingly common with prompts seeking longer text spans. See Appendix G for all prompts. + +![](images/a314929d24a28f6b3aa317062418af56ccb2202b3e4b6f6144ac62e8f01e6031.jpg) + +![](images/89928a14f8099a382d37d2c6804bda337e42983497c539a759557cd7cee04490.jpg) + +![](images/45427eeb532ad1fd6d48acb46b3786bbc2e36fcd07a9822e6adf8c1d73b3cab3.jpg) + +models read and write UTF-8 bytes rather than tokens from a vocabulary, so they are fully character-aware. Second, ByT5 is multilingual, trained on the mC4 corpus of over 100 languages. Third, ByT5 pretrains with sequence length 1024, twice that of T5. When encoding text as input to the image generation module, we use a sequence length of 256 bytes, compared to 64 tokens for the T5 models. + +Concat(T5-XXL, ByT5-Small) — We use as the text encoding a concatenation of the encodings from T5-XXL and a small ByT5 model. ByT5-Small (220M) represents a lightweight addition to the Sahara et al. (2022) model in terms of overall compute and model size (a $4.8\%$ increase in encoder size), but makes the model character-aware. + +Imagen Aspect-Ratio (Imagen-AR) — To test the benefit of training on uncropped images, we fine-tune theImagen model of Sahara et al. (2022) for an additional 380,000 steps, to 3.2M steps total, training on uncropped images with preserved original aspect ratio, as described above. + +Beyond these custom models, we benchmark Stable Diffusion version 1.5 (Rombach et al., 2021), DALL-E-2 (Ramesh et al., 2022), Parti (Yu et al., 2022) and Imagen (Saharia et al., 2022), all of which use character-blind text encoders. Among these, Imagen is most similar to our experimental models, using the same T5-XXL encoder, but trained much longer and with a larger scale of data. + +# 5.2 DrawText Spelling results + +Char-aware models improve spelling. Figure 4 shows our DrawText Spelling results across 10 models, with 2,000 images sampled per model, evaluated with OCR. Accuracy is computed on the full string (i.e., no credit is given for partial matches). Across all word frequencies, character-aware models (ByT5 and Concat) outperform the rest, with $15+$ point accuracy gains over Imagen-AR on the most frequent words, and $30+$ point gains on the least frequent words. This is remarkable given that Imagen-AR trained for $6.6 \times$ longer. + +Our T5 models (character-blind) provide a more controlled comparison against the character-aware models, as they differ only in the choice of text encoder—trained on the same dataset for the same number of steps. Here, the gains are even larger: $25+$ point gains on the most frequent words and $30+$ point gains on the least frequent. Notably, these gains persist even for the smaller ByT5-XL model, whose encoder is $43\%$ smaller than T5-XXL. + +To estimate the rate of OCR errors, we manually validate a balanced set of 128 samples from T5-XXL and ByT5-XXL (see Appendix B for details). We find no false positives, but when OCR detects an error, ByT5-XXL is actually correct $34\%$ of the time, while T5-XXL is correct $9\%$ . This asymmetry suggests the benefit of character-aware modeling may be even greater than implied by Figure 4. + +![](images/81bc4c8f605931009e8e952f90323386661ee04af04720d1f38cce9f42261a1d.jpg) +Figure 4: Accuracy of 10 image generation models on DrawText Spelling. Character-aware models (ByT5 and Concat) outperform others regardless of size, and particularly on rare words. Imagen-AR shows the benefit of avoiding cropping, but still underperforms character-aware models, despite training $6.6 \times$ longer. + +
Error TypeExamples
Semanticdemonstrated → demonstrafied
✓inquisitiveness → inquisitioness
Homophoneaccommodate → accomidate
✓Toronto → Torondo
Add Glyphlabor → labort
✓debut → debut
Drop Glyphstopping → stopping
✗experiments → experimentis
Repeat Glyphpossible → possible
✗locate → locate
Merge GlyphsMENTALAccomodate
✗
MisshapeCHANGEDChanged
✗
No Text
+ +Table 3: Error types observed on DrawText Spelling. Some errors (✓) are not observed in character-aware models. Others (X) are found across all model types. + +Char-aware models make fewer types of error. To gain a better understanding of different models' failure modes, we manually inspect our T5 and ByT5 model outputs. Table 3 illustrates common error types. Several categories of error are only observed in T5 models, suggesting that they stem from the encoder's lack of core spelling knowledge. In semantic errors, the model makes a plausible morpheme substitution, as in demonstrated $\rightarrow$ demonstrafied. In homophone errors, the model produces an incorrect spelling that could be pronounced similarly to the target word. This suggests that some of T5's "miraculous" spelling ability may + +derive from online pronunciation guides. In add glyph errors, the model inserts a letter that was absent from the target, again reflecting the model's uncertainty about a token's internal character makeup. + +One notable sub-type of semantic error is character-blind models "regularizing" irregular inflection, as in fought $\rightarrow$ fought. On a hand-chosen set of 23 common irregular past-tense verbs (began, chose, dug, etc.), we find T5-based models erroneously add -ed in $11\%$ of samples (see Figure 6), while our character-aware models never exhibit this type of error. This is clear evidence that character-blind models partly rely on a word's meaning (fought $\Rightarrow$ PAST) and fallible patterns of morphology (PAST $\Rightarrow$ -ed) to predict spelling. + +Other error categories are found across all model types; these include dropped, repeated, merged, or misshapen glyphs. Given that our ByT5 encoders provide a robust spelling signal (see §3.2), we understand these errors to be "layout issues", where the image generation module has trouble shaping and positioning realistic glyphs within the image. + +Another stark difference between our models lies in whether they consistently misspell a given word across multiple samples. As illustrated in Figure 5, there are many words that our T5 models misspell no matter how many samples are drawn. Again, we believe this indicates missing knowledge in the text encoder. By contrast, our ByT5 models are more likely to make sporadic errors. We quantify this observation in Figure 7 by measuring the rates at which the model is consistently right (4/4) or wrong (0/4) across all four image samples. On common words in particular (Top $1\%$ ), we see a sharp contrast in that ByT5 models are never consistently wrong, while T5 models are consistently + +![](images/70943a9aeee62e25ef1c4d71574b0aaa0cd54f89f0ce99e9edf655203f656a5b.jpg) +T5-XXL + +![](images/8ed18510b06c932af1617aa2a50d0838aaca88ac49684a54535b7589b0bee379.jpg) +ByT5-XXL +Figure 5: Selected errors from two models on Draw-Text Spelling. Top: Sample words that T5-XXL consistently misspell (target: refers, similarly, stomach). Bottom: ByT5-XXL errors (red outline) are more sporadic and minor: dropped, merged, or repeated glyphs. See Appendix F for more examples. + +![](images/b1df8acd0b129e2bb2425e392387180dca1d3f9d2fc4efc00d371e5307f0f12b.jpg) +Figure 6: Character-blind T5 models erroneously use -(e)d endings for irregular past tense verbs (targets: fought, threw, knew, chose). + +![](images/e479ea2c59d248740e9ca34090c9d5ae11f3037f646fb0cda13c7c1dca6147f3.jpg) +Figure 7: Proportion of words for which models are consistently correct (top) or consistently incorrect (bottom) across 4 image samples on DrawText Spelling. + +![](images/4f42ce824671a1878b52064df82fd4c1f9d3e3b18b0f0e2fcae8d47927e4a356.jpg) +Figure 8: On DrawText Creative, our Concat model is preferred over T5-XXL on fidelity and alignment, as well as a new metric assessing rendered text accuracy. + +wrong on $10\%$ or more of words. + +# 5.3 DrawText Creative results + +To test our models in a more realistic user-facing setting, we sample 8 images from each of our T5 and ByT5 models on our 175 DrawText Creative prompts in Appendix G. These prompts are more diverse and challenging, with the majority targeting three or more words of rendered text. + +Focusing on text rendering ability, $^{7}$ we find once again that character-aware models have a clear advantage. Figures 12 and 13 show non-cherrypicked samples on two prompts where T5-XXL consistently misspell one or more words. On prompts targeting longer text spans, all our models struggle, as seen in Figure 14. Nevertheless, we observe that character-aware text encoders provide a clear lift on these prompts, reducing the misspellings of words like refrain, arguing, and chimpanzees. + +We confirm the above observations quantitatively by comparing T5-XXL vs. Concat using the DrawBench methodology (Saharia et al., 2022), evaluated over our 175 creative prompts. Beyond the standard DrawBench metrics of fidelity and alignment (described in the following section), we ask raters Which set of images more accurately shows the text: “?”? Results in Figure 8 show Concat is preferred on all metrics. + +# 5.4 DrawBench results + +We have shown that character-aware text encoders excel at spelling, in both text (§3) and visual (§5) domains. But does this ability come at a cost? Can these models maintain competitive image quality and text-image alignment, even on prompts that + +![](images/59260a10b6d3ca01952d3a3a46f785b3d708d45d6b27cb92018fee70ab44e1b3.jpg) +Figure 9: DrawBench user preference rates comparing T5-XXL with three character-aware models. While image fidelity is comparable, the pure ByT5 models have lower image-text alignment. Concat closes the alignment gap. Error bars show $95\%$ confidence intervals. + +don't require text rendering? To shed light on this question, we run several side-by-side comparisons using the DrawBench evaluation of Sahara et al. (2022). This asks human raters to compare two models' generations of 8 images each across 200 prompts covering 11 thematic categories. We follow the procedure described in Sahara et al. (2022) closely, aggregating scores across 25 raters. + +Figure 9 shows DrawBench results of three side-by-side comparisons of character-aware models vs. T5-XXL. While image quality ("fidelity") is similar across the board, we find that purely character-level models (ByT5) score worse on image-text alignment, with raters preferring T5-XXL on $60\%$ of prompts. By contrast, our Concat model closes this gap to within error bars. Thus, this "hybrid" character-aware model is able to greatly improve text rendering (Figure 4), without significantly hurting performance elsewhere. + +Appendix C provides a per-category breakdown and further analysis; while the character-aware models excel on the DrawBench text category, the ByT5 models are dispreferred in most other categories. Through manual inspection, we find the ByT5 models are more prone to ignore information in the prompt, for example leaving out a mentioned object, or choosing a canonical color over a requested one. One possible explanation for this behavior is that we did not tune the guidance weight parameter used at inference time (Saharia et al., 2022), using a fixed value of 30 throughout. Increasing this parameter is known to boost image-text alignment, but at the cost of diversity. It may be that character-level models benefit from higher guidance values than token-based models. + +Another possibility is that the ByT5 models have a shallower understanding of English language due to their multilingual nature—as ByT5 was exposed to roughly $70 \times$ less English than T5 during pre + +training. $^{8}$ Given this difference, we should also expect to see corresponding gains on non-English languages. We confirm this expectation through preliminary results in Appendix A. + +# 6 Conclusion + +In this paper, we set out to better understand what is needed for image generation models to reliably render well-formed visual text. Using our novel WikiSpell and DrawText benchmarks, we were able to precisely quantify the effects of character-awareness and other design choices on spelling ability in both the text and visual domains. + +We found that character-aware text encoders confer large gains on spelling, and when used within an image generation model, these gains translate into improved visual text rendering. However, using exclusively character-level representations deteriorated overall text-image alignment—at least when evaluating our multilingual ByT5 text encoder on English prompts with untuned guidance weight. To resolve this, we found that a hybrid model combining token-level and character-level signals offered the best of both worlds: dramatically improving visual text without significantly affecting alignment. + +While we saw substantial improvements on DrawText Spelling accuracy ( $75\% \rightarrow 94\%$ on common words and $47\% \rightarrow 83\%$ on rare words), some failure modes remain unaddressed. Even our strongest models were observed to occasionally drop, repeat, or merge letters within a word, or words within a phrase. Our results strongly suggest that resolving these issues will require orthogonal improvements outside the text encoder, specifically changes to the image generation module. + +As a secondary finding, we demonstrated for the first time that, with sufficient scale, even models lacking a direct character-level view of their inputs can infer robust spelling information through knowledge gained via web pretraining—"the spelling miracle". While remarkable, this finding is less immediately practical, as it requires models over 100B parameters, and even these did not generalize well beyond English in our experiments. + +# Limitations + +While we establish the "miraculous" ability of character-blind models to induce robust spelling + +information through large-scale web pretraining, our work does not attempt to identify the mechanisms or sources through which this information is learned. Possible sources within web corpora include: dictionaries containing phonetic pronunciation guides, alphabetically ordered lists, typos and other misspellings, and examples of spelling words with dashes or spaces between every character. Linguistic phenomena that may aide in inducing spelling knowledge include words with predictable morphemic makeup, and cases where meaning-form relation is non-arbitrary, contra Saussure's "semiotic arbitrariness". We refer the reader to Itzhak and Levy (2022) and Kaushal and Mahowald (2022) for work in this direction. + +Most of our image generation experiments are limited to English. We present preliminary results in Appendix A showing that our ByT5-based models have stronger multilingual understanding than T5. However it would be valuable to test this further, and to explore training image generation models on multilingual image-caption datasets, as opposed to merely using a pretrained multilingual text encoder. + +Ideally, it would be possible to conduct controlled comparisons between pretrained text encoders that differ only in one regard, to isolate all factors contributing to performance. However as pretraining large language models is resource intensive, we were only able to use off-the-shelf text encoders, which often differ along multiple axes. In our text-only experiments, we isolated the contributions of character-awareness (ByT5 vs. mT5/T5) and multilinguality (ByT5/mT5 vs. T5). However, in our image generation experiments, these factors were conflated, as we had limited resources for training new models. Still, the fact that ByT5-based image generation models outperform T5 despite being multilingual (which often degrades performance on English-only tasks) strongly suggests that character-awareness is the key factor for spelling ability. + +Another limitation is that we focused on image generation models that leverage frozen pretrained text encoders. This enabled straightforward experimentation by swapping encoders and retraining the image generation module. However, it remains to be seen whether our results extend to settings where the text encoder is trained along with the rest of the model, as in Yu et al. (2022). + +# Ethics Statement + +We note our image-caption training data comes from Laion-400M (Schuhmann et al., 2021), which is uncurated and known to contain harmful biases and offensive content. We hope to utilize and contribute to safer and better curated datasets in the future, as well as to develop improved techniques for debiasing and detoxifying existing models. + +A potential risk for image generation models is that they can be used for creating misleading and harmful content. Our work on improving text rendering could aide the creation of fake signs and other misleading images containing visual text. With the wide-spread availability of image generation models, we expect that improving education around misinformation and adopting better digital signature mechanisms will be important countermeasures. + +# Acknowledgements + +We thank Jason Baldridge, Jon Clark, Noah Fiedel, Linting Xue, and Jiahui Yu for helpful discussion and comments on an earlier draft. We thank Sarah Pratt for validating findings on Stable Diffusion models. + +# References + +Yogesh Balaji, Seungjun Nah, Xun Huang, Arash Vahdat, Jiaming Song, Karsten Kreis, Miika Aittala, Timo Aila, Samuli Laine, Bryan Catanzaro, Tero Karras, and Ming-Yu Liu. 2022. eDiff-I: Text-to-image diffusion models with an ensemble of expert denoisers. CoRR, abs/2211.01324. +Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, Parker Schuh, Kensen Shi, Sasha Tsvyashchenko, Joshua Maynez, Abhishek Rao, Parker Barnes, Yi Tay, Noam Shazeer, Vinodkumar Prabhakaran, Emily Reif, Nan Du, Ben Hutchinson, Reiner Pope, James Bradbury, Jacob Austin, Michael Isard, Guy Gur-Ari, Pengcheng Yin, Toju Duke, Anselm Levskaya, Sanjay Ghemawat, Sunipa Dev, Henryk Michalewski, Xavier Garcia, Vedant Misra, Kevin Robinson, Liam Fedus, Denny Zhou, Daphne Ippolito, David Luan, Hyeontaek Lim, Barret Zoph, Alexander Spiridonov, Ryan Sepassi, David Dohan, Shivani Agrawal, Mark Omernick, Andrew M. Dai, Thanumalayan Sankaranarayana Pillai, Marie Pellat, Aitor Lewkowycz, Erica Moreira, Rewon Child, Oleksandr Polozov, Katherine Lee, Zongwei Zhou, Xuezhi Wang, Brennan Saeta, Mark Diaz, Orhan Firat, Michele Catasta, Jason Wei, Kathy Meier-Hellstern, Douglas Eck + +Jeff Dean, Slav Petrov, and Noah Fiedel. 2022. Palm: Scaling language modeling with pathways. arxiv:2204.02311. +Jonathan H. Clark, Dan Garrette, Iulia Turc, and John Wieting. 2022. Canine: Pre-training an efficient tokenization-free encoder for language representation. Transactions of the Association for Computational Linguistics, 10:73-91. +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. +Philip Gage. 1994. A new algorithm for data compression. C Users J., 12(2):23-38. +Alex Graves. 2013. Generating sequences with recurrent neural networks. CoRR, abs/1308.0850v5. +Jack Hessel, Ari Holtzman, Maxwell Forbes, Ronan Le Bras, and Yejin Choi. 2021. CLIPScore: A reference-free evaluation metric for image captioning. CoRR, abs/2104.08718. +Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. 2017. GANs trained by a two time-scale update rule converge to a local Nash equilibrium. Advances in neural information processing systems, 30. +Itay Itzhak and Omer Levy. 2022. Models in a spelling bee: Language models implicitly learn the character composition of tokens. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 5061-5068, Seattle, United States. Association for Computational Linguistics. +Ayush Kaushal and Kyle Mahowald. 2022. What do tokens know about their characters and how do they know it? In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 2487-2507, Seattle, United States. Association for Computational Linguistics. +Tsung-Yi Lin, Michael Maire, Serge 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, pages 740-755. Springer. +Sabrina J. Mielke, Zaid Alyafeai, Elizabeth Salesky, Colin Raffel, Manan Dey, Matthias Galle, Arun Raja, Chenglei Si, Wilson Y. Lee, Benoit Sagot, and Samson Tan. 2021. Between words and characters: A brief history of open-vocabulary modeling and tokenization in NLP. CoRR, abs/2112.10508. + +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. +Telmo Pires, Eva Schlinger, and Dan Garrette. 2019. How multilingual is multilingual BERT? In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4996-5001, Florence, Italy. 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. +Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, and Mark Chen. 2022. Hierarchical text-conditional image generation with CLIP latents. arXiv preprint arXiv:2204.06125. +Aditya Ramesh, Mikhail Pavlov, Gabriel Goh, Scott Gray, Chelsea Voss, Alec Radford, Mark Chen, and Ilya Sutskever. 2021. Zero-shot text-to-image generation. In Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pages 8821-8831. PMLR. +Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. 2021. High-resolution image synthesis with latent diffusion models. CoRR, abs/2112.10752. +Chitwan Sahara, William Chan, Saurabh Saxena, Lala Li, Jay Whang, Emily Denton, Seyed Kamyar Seyed Ghasemipour, Burcu Karagol Ayan, S Sara Mahdavi, Rapha Gontijo Lopes, et al. 2022. Photorealistic text-to-image diffusion models with deep language understanding. arXiv preprint arXiv:2205.11487. +Christoph Schuhmann, Richard Vencu, Romain Beaumont, Robert Kaczmarczyk, Clayton Mullis, Aarush Katta, Theo Coombes, Jenia Jitsev, and Aran Komatsuzaki. 2021. LAION-400M: open dataset of clip-filtered 400 million image-text pairs. CoRR, abs/2111.02114. +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. + +Ilya Sutskever, James Martens, and Geoffrey Hinton. 2011. Generating text with recurrent neural networks. In Proceedings of the 28th International Conference on International Conference on Machine Learning, ICML'11, page 1017-1024, Madison, WI, USA. Omnipress. +Yi Tay, Vinh Q. Tran, Sebastian Ruder, Jai Prakash Gupta, Hyung Won Chung, Dara Bahri, Zhen Qin, Simon Baumgartner, Cong Yu, and Donald Metzler. 2021. Charformer: Fast character transformers via gradient-based subword tokenization. CoRR, abs/2106.12672. +Linting Xue, Aditya Barua, Noah Constant, Rami Al-Rfou, Sharan Narang, Mihir Kale, Adam Roberts, and Colin Raffel. 2022. ByT5: Towards a token-free future with pre-trained byte-to-byte models. Transactions of the Association for Computational Linguistics, 10:291-306. +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. +Jiahui Yu, Yuanzhong Xu, Jing Yu Koh, Thang Luong, Gunjan Baid, Zirui Wang, Vijay Vasudevan, Alexander Ku, Yinfei Yang, Burcu Karagol Ayan, et al. 2022. Scaling autoregressive models for content-rich text-to-image generation. arXiv preprint arXiv:2206.10789. + +# A Multilingual results + +As ByT5 is a multilingual model covering 100+ languages, we are interested to see if image generation models built on ByT5 deliver improved performance over T5 on non-English languages. While the text encoder itself is multilingual, it is not obvious whether this is sufficient to produce a multilingual image generation model. The image caption dataset used for training in all of our experiments is Laion-400M (Schuhmann et al., 2021), which we estimate through language ID detection to consist of $95\%$ English captions, with only minimal coverage $(< 0.1\%)$ of some widely spoken languages, such as Arabic and Hindi. + +To test for multilingual understanding, we translate two English prompts to 11 languages using Google Translate, and feed the outputs to our models. As can be seen in the rows 1-2 of Figure 10, our T5-XXL model demonstrates basic understanding of five high-resource European languages (German, French, Spanish, Portuguese, + +Russian).9 However, in the remaining languages (Greek, Hindi, Arabic, Chinese, Japanese, Korean), T5 appears to ignore the caption completely. + +By comparison, our ByT5-XXL model exhibits understanding across all 11 languages. Given its limited training on multilingual captions, we interpret this ability as due to the pretrained ByT5 encoder's alignment of representations across languages. If the encoder already embeds similar prompts into a shared space that factors out the contribution of language, then the image generation model should be able to learn from just a handful of examples how to map any language seen in pretraining into the space of images.[10] + +If this explanation is correct, it also suggests that rendering text in different scripts will require more than just a multilingual encoder. To learn the glyph shapes, variants and fonts used for a given script, we should expect to need to train models on a large source of visual text in that script. Indeed, rows 3 and 6 of Figure 10 show that neither of our models can map prompt text onto visual text in non-Latin scripts. While our ByT5 model captures the intent to draw a sign across all languages, it is unable to render the words for dog in Greek, Russian, Chinese and so on, presumably because it has had little visual exposure to the glyphs making up these words.[11] + +# B OCR error estimation + +To estimate the rate of false positives and false negatives due to OCR errors, we sample 32 examples labeled correct and 32 labeled incorrect for each of T5-XXL and ByT5-XXL, and perform a manual validation. In our sample, we find no false positives: when OCR detects the correct word, it is always correct. However observe false negatives for both models, including cases where OCR fails to detect the text (e.g., due to it being too small), or misreads a character. For ByT5-XXL, we find that $34\%$ of examples labeled by OCR as incorrect + +![](images/e8be78a9fbe32ef204ab564dc1153e781c79c0a074e52e0f79d772f7ad35fd92.jpg) + +![](images/5dd7598acde08dfc14fc402470eaf44d56d78d57c6664e23d50119d450fc0759.jpg) + +![](images/efe716d5093ba34d6483e80dd6581695bc233b77614e4b7e76d81def2b5e0764.jpg) + +![](images/6f2bb427e85f9488495def14646feaa4a1eba625386b89b18ec041a595760649.jpg) + +![](images/cd22e77b7ddcd8677b56f42d05eb3c2d7c88c0c9adae43a851534d9e80219e36.jpg) + +![](images/b91839ef207744b64b3b2a30799c5c85c58f5c4e1a6c72972f11922d36f3c2bb.jpg) + +![](images/a6a3995c29ce5259d26f476ed8632c0f7371e898d04831fc08bb80293e2143ad.jpg) + +![](images/140811951fa87b572125415248e269ce2bfe992d4c5e1faa585e993f08e90be0.jpg) + +![](images/08b418b85d55aae21eb0a50d19579031d9606fab6f54d0d5d704f753926166eb.jpg) + +![](images/fecdb1a188f7b4eb6b94c598af0af9fe2a107c55127584c3f9a220d911cb509e.jpg) + +![](images/b698cc410957920b80b9c906d2c8887730ed4643138525664743263a1b1ac842.jpg) + +![](images/0f66e38fe9a65a8f0cad75decec71daf2744a4c2b0755a836ddfbc52074b4a0a.jpg) + +![](images/6316ab0806887ca82c6dd73993fad0f8247001f0c1e244251a71246af50b1a35.jpg) + +![](images/1da74dbcf1649bb80efa22da4b709f982f6ca4e74c74d3f00a712dae0299e830.jpg) + +![](images/e315b176cc41d8e65ae677ecbbd310cd287d915df1484d6c4377020c71e1a95e.jpg) + +![](images/d4b53b4f30f65d4e78f9736d49a7fb937e321bc7df47b45d9cb042de9efacb2e.jpg) +T5-XXL + +![](images/8766400aebb885b6567412f1096cbcca78bd3f3ec434ca61642803569eca528f.jpg) + +![](images/45746863dd82ebd324ea97b5adbd79157ea178d131fd023f35032790253399b9.jpg) + +![](images/3d7d29182cb16f7697a1dc0bfac90748f2b03e29b71bf4f5488bcc2561cd16cb.jpg) + +![](images/cbc15f5714fca805262bdf205f01f436b5a6e3f1eb90bf6e7d3e9cc09be97831.jpg) + +![](images/d15ac5473fa5b3ae87db449c81bd517b597cef3595bb1ea6b0f9b3e2f334077a.jpg) + +![](images/71f852fbee199ac867de8b8b3d5380a713e9df66cc13f9e7bac3b906a599a2d3.jpg) + +![](images/bbcce6b05b5c46a57d36eee9c20c636f8a41b290bc28f7a92651a795737c6858.jpg) + +![](images/93115d7c3f627ab02d3ce681aaee45690f8e403a8479bbe33637fdcea552cd26.jpg) + +![](images/84a8cc58082632918d539d5b05438dc5c35c62f8bb27dc1ec1d0bf8afbb46fc4.jpg) + +![](images/337b987e2a4b0c3e9dc96ccc593b41883e94a675d7f8847b02313496322a5ff1.jpg) + +![](images/ac5c5e17a33a9de496fe66b387314d4ffb7ae5768a3630d1f27e621cce1c13d3.jpg) + +![](images/3d9f64f7f39da9f5cfb9270db9529f7544f8c260bf2e4c36db9ea82983dda3b2.jpg) + +![](images/4ecc2a0e1c42a48de6f0c184f8de01af00848e105262a732f1d6a23da429cef0.jpg) + +![](images/0493aabd5c7e590ce23ae30f21d9bde695cfcfd536c31c514b0965c10f8334ce.jpg) + +![](images/b4b27e9425b3406e1162c1390ace418d1e11d797cd91e556613affa5cb9c68d5.jpg) + +![](images/eb837a47339f9e9e370b3dbca8d9a2d93abf80b527a40752d69f36d91b6f7541.jpg) + +![](images/1eb7053438fb816695b43a7e11e14866d875406178406e891001f4127a03f4e3.jpg) + +![](images/68fe58d9fac90c0281ebd3e5b7fd8b0afaeeedf3eaee152411ddd00c7045b2c1.jpg) + +![](images/376a432ee53c78ecaec3d3e601484d587f07379a588c0c2d2f4827d209e484ff.jpg) + +![](images/11eff024835712d172360a2fb2c38c8a9b614626d58d9803548054e520f4b364.jpg) + +![](images/a9f3ef57efaf765260004dfea7fdfdd4a47dedcfd7febada5232546fc91894fc.jpg) + +![](images/10206b4c84020e8494581af7335c019ce164301870be495e7d98d2e2c4f1c636.jpg) + +![](images/7048dea9d348f0543b1095d5c750e49b0884f9f1df00fb136108ad4285896807.jpg) +en + +![](images/f1167555570c58d48c05d4f8f23d050bad2a4f0a46e973398e8c28f302baf641.jpg) + +![](images/3406140aa4e728a62077faff52714c28cb1491234c84afac87eaf7df4d5303fd.jpg) + +![](images/ccf964ff7f9fe5b6bb55cc0522c80225474a1ca0d46d58af9fb99dfb7e492a15.jpg) +de + +![](images/9f9e2efeacebac4868195359368356f5e57f8f4d38441da9318ba201c086a508.jpg) + +![](images/16b3728bccec93f5f78986b9498e18a8ddb60e95f3b2c6455181bc5d0536bbf9.jpg) + +![](images/7e3258a3974e20653d0047f8dc50647085e7c223f8003a409bc205c7322dc9eb.jpg) +fr + +![](images/47acf614a9f841b922ee128fb681a02bf06fce2a790d6dab4516fbd8c7493b03.jpg) + +![](images/2e7bd466c446a8cc993b229d3a92c3f4de556fdf870c44932661f52736a6fe96.jpg) + +![](images/a469a43cc22c77f19b76b7224f74d24dabfae75804215ab8e9e36df8111e9b71.jpg) +es + +![](images/248161d31f8d8e528d8b475defd7dea818b1704b0488b45d438d8d82527492f9.jpg) + +![](images/28b979a13f081113d6bf1d2707c400db84cbc98694051263112bb07c9053e0ea.jpg) + +![](images/fe30fc4809c75a0633d418e0eabf6b9494670261cf517f6bc265985e99a46e19.jpg) +pt + +![](images/6a0661b5fdd262b9100d6fc20c975175ac8df978ad18ecd24fc894b5bd97da32.jpg) +ByT5-XXL + +![](images/239fb14beeec6e263d103501db082f62e4fa796a6ee5ac67ee230e9f8b2aa207.jpg) + +![](images/9d659cccd9192178bde22a94895c083e5b616e5777a26b53657b62d6767590eb.jpg) +ru +Figure 10: Our T5-XXL model (top) shows some multilingual ability in high-resource European languages (German, French, Spanish, Portuguese, Russian), but fails on Greek, Hindi, Arabic, Chinese, Japanese, and Korean. Our ByT5-XXL model (bottom) exhibits understanding across all of these languages. However, neither model is capable of accurately rendering text in non-Latin scripts (last 7 columns of rows 3 and 6). Prompts are translations via Google Translate of: (1) A photo of a black dog playing with a ball. (2) A photo of an old house. (3) A sign with the word "dog" written on it. Inaccurate renderings are outlined in red. + +![](images/64f05696ac0adeb7fdeccc49c8228907450c61fafae208ba5288ec55570e9a8a.jpg) + +![](images/67561ba324671840a19a88d08fcc583776bf8a1752475f26899782e8b5249ab3.jpg) + +![](images/9d95710964cf411188533c76008b757cf485be86c3ed075cff70e793756e65f2.jpg) + +![](images/bc1e6f2f6cbc94f46fd0ecbde4408804b0584cbdacbae384542825b420611cd6.jpg) + +![](images/f91b5af78653cdefd21ccd94bf39baaebcf64fe497d0d541b5aca46d96e154b8.jpg) + +![](images/9a79715f7ed206984e8759ebe322b4c4bd63d84af8d8c8cd843656968a44f27f.jpg) +hi + +![](images/2fe206846678957558f7a36528d7306e191a4c0f78c506234d278df082e56861.jpg) + +![](images/e2bfe76c6f4d4a6e46c8fa2474f513923c6047976e5d532981d5c3bd85ca8820.jpg) + +![](images/7846581ea487d8ed1aa4581d55525ab903f6a62fbf8a6946025bf04c3b6466e2.jpg) +ar + +![](images/f807f0b8ce354e7dc3c7105cf5fad1fb31dc598dd6e2d6b316ba95e3a54d89e4.jpg) + +![](images/ff04c181bebf0fb489a61a2f1b661d07575921eb914f515824d1793ac942c4d6.jpg) + +![](images/c25621661644b22f0bcd321b2480501b5e01a6e816ff0e4b77a1319c05ad43d6.jpg) +zh + +![](images/992e0f90f35d51aed05af0f467111b0d36b34939c576c9548ac414ba7e3184ad.jpg) + +![](images/6db12bbfb53619dd628a5de1e156d29cf1a297df4acf099c9e6006452f51192a.jpg) + +![](images/a15216191060dc0a919aeeaf7d33e83ea772520af0aa263541c9a6cb49d2fb3d.jpg) +ja + +![](images/d149ae82da678dccf0d901b798d3852cfa66c1abc95e705ec5920868e250a720.jpg) + +![](images/ce000ab7ba65500176261cfdd2baababc791c56936e63772bbf18607582b3ab0.jpg) + +![](images/a037c53a90b748c2f2d4a04634f2e44cbb36477439df35a707196a76f2e2083e.jpg) +ko + +are actually correct. For T5-XXL, this error rate is lower at $9\%$ . This asymmetry suggests that the benefit of character-aware modeling may be even greater than implied by our results in Figure 4. + +# C Per-category DrawBench analysis + +To understand the alignment scores in more detail, we report per-category preference scores in Figure 11. In line with our DrawText Spelling results, the character-aware models are always preferred in the text category—21 prompts testing the ability to render 7 short phrases in 3 visual styles. The ByT5 models are also preferred in the count category, which tests prompts like Four dogs on the street. However, they are dispreferred in nearly all other cases, and perform particularly poorly on the color category. Through manual inspection, we find that in this category, the ByT5 models are more prone to ignore information in the prompt, for example leaving out a mentioned object, or choosing a canonical color over a requested one (e.g. a yellow banana instead of a red one). + +# D WikiSpell details + +We select six languages to cover diverse propo-. erties that could affect the ability for models to learn spellings: Arabic, written in the Arabic alphabet, has non-concatenative morphology; Chinese is written in Simplified and Traditional Chinese scripts, which are logographic and do not use whitespace to separate words; Finnish, written in the Latin alphabet, has rich inflectional and deriva. tional suffixes, and word stems often change when suffixes are attached; Korean's writing system, Hangul, has a huge number of characters since alphabetic features are arranged into syllabic blocks, which Unicode represents as a single characters; Russian, written in the Cyrillic alphabet, has substantial fusional morphology, and uses inflection for case-marking and agreement; and Thai, written in the alphabetic Thai script, is an analytic language, but does not use whitespace between words. + +Further implementation details are as follows: + +- Example Python 3 code for transforming a word into its spelling: + +def to_spelling(word: str) -> str: + return "".join(word) + +![](images/aaabdb7ddbbcf2837587cb9d2896ba0209348b8951317d63f71e8de939c37a8e.jpg) +Figure 11: Per-category DrawBench image-text alignment preferences comparing T5-XXL with three character-aware models. All character-aware models are preferred on the text category. On other categories, while pure ByT5 models are generally dispreferred, the Concat model is competitive with T5-XXL. + +- Since we want each entry to be a single word, we exclude entries that contain any (Unicode) whitespace, that are entirely punctuation/symbols (i.e., all characters are from Unicode categories P and/or S), that are longer than 30 characters, or that have a "part-of-speech" Proverb. +- For efficiency, word frequencies are computed on subsets of the full mC4 corpus. For languages other than English, this is a sample of 1M documents from that language's section of mC4. For English, since it has such a long tail of words in Wiktionary, we use the first 140M documents in mC4's English section. +- For Arabic, English, Finnish, Korean, and Russian, word-counting is performed by splitting document texts using the following delimiters: \(?!\)/; , \(\backslash\) "& ()[{}<>'\), plus any Unicode whitespace. For Chinese and Thai, since they do not use whitespace to separate words, we instead count the number of documents in which the word appeared as a substring. + +# E Additional DrawText creative samples + +We show additional samples on DrawText Creative prompts in Figures 12, 13 and 14. + +# F Representative DrawText Spelling samples + +We show generated image examples from all 5 models (T5-XL, T5-XXL, ByT5-XL, ByT5-XXL, Concat) in Figures 15 16, 17, 18, 19, 20, 21, 22, 23, 24. + +Samples are selected based on model's performance. Figures 15 - 20 are selected words that T5 models tend to get wrong (regardless of ByT5's performance). Figures 21 - 24 are selected words that ByT5 models tend to get wrong (regardless of T5's performance). + +# G DrawText Creative prompts + +We present below 175 creative prompts targeting rendered text of various lengths: one letter (10), one word (50), two words (25), and three or more words (90). + +# Prompts used in Figure 3 + +1. Studio shot of book shelf in the shape of letter G, museum quality, white background. +2. 3-d Letters "DILL" made from dill, studio shot, green background, centered on a page + +T5-XXL + +![](images/52f1d67d5bfd87ef6913384cf24f48d936f5c65c16b6be84a13063a8e19f3602.jpg) + +![](images/a22752b989c81be6828689573ab11eeb8a4a19e897d71546d0e4aaf7b21064f7.jpg) + +![](images/e51b4d03b749cd812812a90bc543ee01ac6c9b050fae68e575870b4be36a502e.jpg) + +![](images/66ce75263badb3e871b59864f5c0af10e46d05e12a1214f3e0d32f1f7b6c5e75.jpg) + +![](images/55d188256f024cefa25fc5aa9e6fc43e510c94caed2a5658e2613400ec9511e0.jpg) + +![](images/45a0674d0585a36aa15f757461be6e640ded57700628de628e61c6d5f71ad2cc.jpg) + +![](images/ab0c59242b4294ca8e5594561513e927e9a8821a8ca93dc69fb12c7bc7625431.jpg) + +![](images/9c8b76475c988ac37d26564c0aef1270c673293e3f1ed436ba4fc7d4adacb2b5.jpg) + +ByT5-XXL + +![](images/5aaf7a25dd36d311690413c8e586cf35d44c16856a051219aa86015ddbd7edb5.jpg) + +![](images/fa90a76b3368b92eb848ee45dc1e77e8c51e695b57f5dda1a68e8f6d6a5bd0b0.jpg) +Figure 12: Non-cherrypicked samples from our T5-XXL (top) and ByT5-XXL (bottom) models. The character-aware ByT5 model reliably spells the target word correctly, with only minor issues around letter shapes or letter merging. Over 100 samples, we found the character-blind T5 model never produced the target spelling. Prompt: The word "exquisite" written in modern calligraphy. + +![](images/a5783aac93734187b0d13f904a02f540fb17c06d80a4cb27c888ab752ae78592.jpg) + +![](images/91c282c6d3543033dd0e5a7c98be76240207eeb67236c484d089cb421129f2f0.jpg) + +![](images/71c92831708873725cd4ebcb94af607a37dddbcc8cc8bee6b9336240aa7c20f2.jpg) + +![](images/fd4a6dc4649dea47b7e79ae1a72851ba435edf1f13b87a28b44436084db50e04.jpg) + +![](images/0241529c9984e3366cd24c36fbafc556c44d7b5cd4759b96c11ca216e9145112.jpg) + +![](images/1ef9ff90e8352b71d919dd5bae848c3e63706afa5558e7abec0683c46f587abd.jpg) + +![](images/80ee2a4f0fd9eeb7030540bd35ec4033b04e69cc66975bdf8d4e6099bebcd284.jpg) + +![](images/1a38e65a19c11f78327e83146077bb67a2f501427c38f4f0837d9fc14e630748.jpg) +T5-XXL + +![](images/9a0442cfee1279e2d02cb2069ccfb3b23748a3edb5dca3fb8b66c144eab11e40.jpg) + +![](images/2ce75178643a619619923e8b027be82150b24082569b9adac59f2d4014bdb394.jpg) + +![](images/ab9f927375c4269aac1312ab3c7e02d149d34c4ac1c87a3e29daa1dc209dd1f5.jpg) +Figure 13: Non-cherrypicked samples from our T5-XXL (top) and ByT5-XXL (bottom) models. The characterblind T5 model makes more frequent and more severe errors, including often hallucinating an s at the end of the irregular plural snowmen. Prompt: The cover for the album 'Elusive Interludes' by the band The Melting Snowmen. We filter images with no legible text for better comparison, removing a small minority of samples for both models. + +![](images/509175abfd058cceb81d9e9a1ddba799d02918435c3e2bdc0a83ce5aedd781e3.jpg) +ByT5-XXL + +![](images/b92b95bd381836a97534e814d351ef92cfc5c9949f4cc10008024c167537e5f4.jpg) + +![](images/2f6f467a00fc848cece5a9af5c7a798722bdb7086510a89db0495c3bb9f5b9b8.jpg) + +![](images/c6c84dc617722e2b20908b62de28f7f3a4fd0ddd5a15bc002a6d6af9264b98a2.jpg) + +![](images/88cf9a8f1ca1deb96149bea00ef18101cb5e545eca2a5f7ccb7b29d8c33f590d.jpg) +T5-XXL + +![](images/f9013238cff18d447081010069d36872bbcb40ec5ff8b3dc1f51504a350f373f.jpg) + +![](images/28e7c7a659eadbc31fa751cb5823441fdc470102fd055cc2b3909089436dd7ce.jpg) + +![](images/be8706b2cd88a9a4a86d1ec52f76694bc3fc78e49d89e68c0ccb6bfc88ee907e.jpg) +Figure 14: Non-cherrypicked samples from our T5-XXL (top) and ByT5-XXL (bottom) models. Both models exhibit layout errors, including dropped/repeated/merged glyphs and words. The T5 model suffers additionally from a lack of core spelling knowledge—misspelling refrain, arguing and chimpanzees on the majority of uses. The ByT5 model is able to spell each of these words correctly in most cases. Prompt: A sign that says "Please refrain from arguing with the chimpanzees". + +![](images/94309f7a4daa80d462ad3d9f25a0218c0a53cc62b686a0bc63cb3e3c266e153d.jpg) +ByT5-XXL + +![](images/a9b7452168511986a8e8e7b3b84e02756f16dd31f87d21e7e0a26e554e170030.jpg) + +![](images/4a01304db0480de7a1d70cb2626a0d41552843b90062d23459d6fd070beecf7a.jpg) + +"0-6-2" spelled by T5-XL + +![](images/11fd48de90c58f365141be6bab5b4b7b0c614cd2dc04cff1aaab551a048d7775.jpg) + +![](images/ea2e25d257a259ea3aeb3c9e8b1c191c6ec61c6810ffcf3fdbf887f3d6493b84.jpg) + +![](images/0571250268105938aeef6b08151c1c16db33846f8414d0b33f76fbfa543f33cf.jpg) + +![](images/66f833ff3ab9924e428a8216baeaa3eb08fdc98090c9729e8f7776b22faa1304.jpg) + +"0-6-2" spelled by T5-XXL + +![](images/26f132cab97403031b6d089fb51612ae646870d389ba394278f5dcec8579e3a9.jpg) + +![](images/2cd3f72ea770d15dfb6faee95f2c51dbf9fa7da6d6168dbca068eb5d04c8e977.jpg) + +![](images/6c4287afa73cbd0a8bb5043173ffffab8211d6ece23a9c55bd6fe4b66fab6884.jpg) + +![](images/ac31980bd5562a3bcebe6b15ca80cecc5a5ee6d06d5a1ba528c78f98a0862fe8.jpg) + +"0-6-2" spelled by ByT5-XL + +![](images/5447e0dfb4e3bddb32f803641e5f4a737d3c058f639dba6dff29a218509ea284.jpg) + +![](images/8683051a7738aca8658e579ac37a3a8c6de10de12a33b3fc1373484b9ed3090f.jpg) + +![](images/493346766c0551a6de171a02f41058a299b77d092b18f13756f30f46bd744911.jpg) + +![](images/d657f7d689b8632848f6117068ac792ddcb1928130178214c49371ea2e3e4903.jpg) + +"0-6-2" spelled by ByT5-XXL + +![](images/b1cb568e6dc33177e9a5e0e3c0e6517f65d14039c332d47689a20ead3ea91675.jpg) + +![](images/3fb24710b80dec58077ee008790267521807241cb524687f24c526e42cff3df5.jpg) + +![](images/08749cffe02fe9eb5211550f46ff06df67f9ce56c3e82b9fa059a6567a0ee36b.jpg) + +![](images/ad1f7ffcf07265854f62d13c36c5343482a66682862a01113b93acc76826dbde.jpg) + +"0-6-2" spelled by Concat + +![](images/c03a4f53cad3b86aa9cd5cfe7106e25764c9c57006fe9742cd7eae23bfb828aa.jpg) +Figure 15: Spelling examples from both character-blind (T5) and character-aware (ByT5 and Concat) models. Erroneous spellings are outlined in red. Prompt: A sign with the word "0-6-2" written on it. + +![](images/7860f2524dddefe185df7ebcb1752b1fe29c5460669600f90c5f5fdc177f081a.jpg) + +![](images/016bb35a61c1658d88fa5a42bb08aa54062f6d4b185a03913c617bf2535660cf.jpg) + +![](images/e1650782aac113a069e96a50f476816518afd3cc3209629e9b6f9576ff419335.jpg) + +"barratiously" spelled by T5-XL + +![](images/22718b217f28d39d5653b5947b8d572878e36db87b7871305cdb27d021cb93a5.jpg) + +![](images/f6cbce17021d93123508f7c480757fcbafa2dd693df60e59824033d51bf44de5.jpg) + +![](images/c7bcdb2262e1adc0a123d74805262f7ed8fda4a15d8c3629a1cfcdece16691c6.jpg) + +![](images/5786d83e63757fef15e5f1151c08d7b876a6ae1ae2c7b264cbd5f719cd59c478.jpg) + +"barratiously" spelled by T5-XXL + +![](images/7d6138903182b94f419e1b8c12464bb9011399ca93cb34f7552c863b2380eb2a.jpg) + +![](images/5ec9679436c96bef2eb7f460495aaa85a2509b8583488242a62e7334acc4b67e.jpg) + +![](images/1397a4f2ea644e11a5bf38207006a9ce51378ec0d7abee291276dbe2624c6103.jpg) + +![](images/32356e25be66f4ef835d5e6945e063499060102e4eacc2442c54d29e3a27b970.jpg) + +"barratiously" spelled by ByT5-XL + +![](images/7931e5ab6f3adb28c4d0030d9cea03d9e2a77e74bf3afdaffb4a3ec9cab72eae.jpg) + +![](images/989704c3e60baab1c5cdfb026519532bd3586088a8608967886b9b1beec9d123.jpg) + +![](images/a93f12e5a07ccf6d97fb13cb2e5f18b934d49efcd5f20c3af54792f61e863274.jpg) + +![](images/23d8396c148f0996493dc10d50b68139f3a56d8dc854ca260a9281a645e3451e.jpg) + +"barratiously" spelled by ByT5-XXL + +![](images/121356e85cee43b8a55e1eeecd8014a04d54bdffc3e9f15e66fd7fa70b0975dd.jpg) + +![](images/31a6efce45c2c288f9fc780ada074ef11a23f1eb53b9225a3d79d5ba0f335fa7.jpg) + +![](images/538a185c885844e9f476b1dc225f102df16c668f4010050f078f27785f5212ad.jpg) + +![](images/17302b4c152cb0a2914e13a6bd755d0e8c758bd8d7ead76265218d043cdd3865.jpg) + +"barratiously" spelled by Concat + +![](images/f0ab9ba510c05a5e1e9d0239842c966d44eb30310fefaad8ac78300031526fca.jpg) +Figure 16: Spelling examples from both character-blind (T5) and character-aware (ByT5 and Concat) models. Erroneous spellings are outlined in red. Prompt: A sign with the word "barratrously" written on it. + +![](images/333b1e997385ffd150eeb8fe6df2a1bad025b5f09b4a1bb23159265a8d7bc02c.jpg) + +![](images/b3aaf52d1bd5df88d175bcde727349b5fe88626cddfbe8bcd4ca6cf4f6c3cd13.jpg) + +![](images/e8149624ab898dce7ba17a2c9cc5a14787dc642eb05b9f909cd59fb39783f788.jpg) + +"depositories" spelled by T5-XL + +![](images/120113a8e5d9bd7ee2e8f5a592f7d901b5736f3142b9849b0b1c41736b282665.jpg) + +![](images/aece9f66ebc61c082bd1413a80af172fb773942ca65e45b8658d7d0a52a91d37.jpg) + +![](images/0aea1f44fa05875964edda7cbb12ade498e005343845fcf2b753f0d76bf1f742.jpg) + +![](images/24fd7f65550ff22454fc3d1a5c626bee30c5cd5fb7e6c66adbdb026c0ea6d58e.jpg) + +"depositories" spelled by T5-XXL + +![](images/597482ff21668e30085031fa23c139e7ac3818551ad438318684df490328698d.jpg) + +![](images/1dd1fccdf11ac1747af9895b7a1001347aefac310ad7529085f58f5cd5e43a8e.jpg) + +![](images/f49d3f15df8860430146fcb438c114d895220760f52f0d82f9e01fe12bf04710.jpg) + +![](images/dff42cf21dd7a7d285297539d6c6b166ed4c91e0883c90ce1025c11f9585f3f1.jpg) + +"depositories" spelled by ByT5-XL + +![](images/64a0b93e439e573d1c6498644a816174988c1021bb9404656bebf438073c1bad.jpg) + +![](images/aac9249168ba2cc5fff0ac01d75f270a529eb4c2ece45bc5411f7f60b44ee152.jpg) + +![](images/86cedb4a89271f512d700d7221ff8a49ec6971e5e9957053fcfde02b4de3ad16.jpg) + +![](images/31d0ca58a02c7aedc9dfd30419cf269c156815bb864ffe1515797cd37ba80bfe.jpg) + +"depositories" spelled by ByT5-XXL + +![](images/c00a882520f95cf67e102f582b88e37c9dd5c5ac0a8cebe3e38f079e52c4a3e1.jpg) + +![](images/24f13b66e09178f946772c659c5c9e0c163b2a398c565edc2d59619db5c89922.jpg) + +![](images/fbe1d8f38ddff5afe1bfbf9357ce466c94ce7d44918523637f51b00fb1cd8523.jpg) + +![](images/7ec273e80b0ecd78ed115c7f284f98872f29e17ccea395d49759602ed7c56565.jpg) + +"depositories" spelled by Concat + +![](images/9aa25589528906de8a31a1abdf0c18984e88a37ae3fa0719ce6786a4bffc02f7.jpg) +Figure 17: Spelling examples from both character-blind (T5) and character-aware (ByT5 and Concat) models. Erroneous spellings are outlined in red. Prompt: A sign with the word "depositories" written on it. + +![](images/93c4a4d5b1b951f8c43006a30a3331c118c9693a815ea73c7e32d34317c17c6a.jpg) + +![](images/1b250f703ab6e8603b395bb2373997bb64cbef723dcc58088a0b87e34c9f23da.jpg) + +![](images/5a182787ccbeaa98a537e7e039cddb90dc57dff7ef7c41a3cab1567fab96f040.jpg) + +"enceinte" spelled by T5-XL + +![](images/ea378fccb10729b39d268c0d3a771f575bcdf771ed2681f37203a112aaaa4f5d.jpg) + +![](images/74a2907b70ed3d607c6dac328cdb98c607b7d30eb8c07a322fd41fb39dcaab4f.jpg) + +![](images/2ae67295f3f43c9ca814eff71c67c3094f9da24db7ebbd62ae831ace8c26251c.jpg) + +![](images/49fa3e0eae47284ee1ce088021716332db3b4277762eca4cf27ea75eac9b18a9.jpg) + +"enceinte" spelled by T5-XXL + +![](images/35aa472f37e3acefcfa76d29b35303b5e6cb73411c8d5940dfecc8fa66bc317e.jpg) + +![](images/ff6b49321fa8537d6f2a2e19bcf4d7da40d42f89e8944f2ca5837383c30c2b3c.jpg) + +![](images/02c7493a6f9bc61bd1c9b58e7c12acdec1421c8587a7618b47fb4f4e1152fa8e.jpg) + +![](images/220a423afc7945559aa73e45fb86036d7dad7f4de1a2fea02a0018e38db726dc.jpg) + +"enceinte" spelled by ByT5-XL + +![](images/9b1ae4ae067f68313e09114490f57d3937faee51b7f4279799e118f01d487cd4.jpg) + +![](images/54313836fa8c6f857965722d1e7deab4cf34444380c4faf3c300d2660d16ff9c.jpg) + +![](images/7cfe76b1244043a5919c4e032128e81569eda4c36da7030a5463823a62e121f4.jpg) + +![](images/cc8828a18c64414b0061f65b6ed33fac36ae1c1e7e3073d7402d86f39c8d1a2c.jpg) + +"enceinte" spelled by ByT5-XXL + +![](images/c8b9ab55dd9171a0512430e581a96c1d53f6e64106eb1960a8dd46788ca07c6d.jpg) + +![](images/69b5b6deb45ff1250f8c66919682c3671d9f3ec1a654d81764e666bba3d3e8dd.jpg) + +![](images/e3bc659e08e36f8774041fea8a58f211b5bc22ca16bfd62dca59ca5797039a6b.jpg) + +![](images/d79a52e74be8b696e3b0cd9af1ee156aa6ed0d8166653fedc0f184ecb9421d25.jpg) + +"enceinte" spelled by Concat + +![](images/111d18dc9281165e6d15105c995db0e1a627bb66d881224923a03747f4fd845b.jpg) +Figure 18: Spelling examples from both character-blind (T5) and character-aware (ByT5 and Concat) models. Erroneous spellings are outlined in red. Prompt: A sign with the word "enceinte" written on it. + +![](images/bd4b8c15f7cd2c3c4d5a399614a99329c72fe9dec92a3b4280e4e2c025c0ff62.jpg) + +![](images/0ca8bb269a768871dbfcb1a3e8b6fad33c03b3de268278b361d04dc84f9ca063.jpg) + +![](images/9c0f021b6ea7d950226e5a3f5568a685c6cabfeaa0c74a8832d183172867026b.jpg) + +"kilopascals" spelled by T5-XL + +![](images/42d5523bc61b2c14ed588a9b5481ae7ea0c2b01586444ee2e1ac7af28f9491cc.jpg) + +![](images/f669b3f0f4b27e6407e715b77ced68265adbd33101ba118be83173dd54504bb8.jpg) + +![](images/5a027a2b0e6dd7ad1c29cc7d15b2d9a573789bae2901090a5f7eef4258a4042d.jpg) + +![](images/48eab6d8e622c0a24fc8c56ecbb6c78e30fb70b297679d2c1d434ec8f7213efa.jpg) + +"kilopascals" spelled by T5-XXL + +![](images/31554aceb71c130ec21195a4de5dd46a41f2f56ecff13e7f8e5591043cf0c4fa.jpg) + +![](images/92fbd38fc16e301ebf2297dc0356a28a4fc3e7baf643e4f31d5641f86bc34e4e.jpg) + +![](images/fd196c4a32b72b58fa5978ec6c6926ad29c13a561d697cd0d972a62d0e2b1212.jpg) + +![](images/c3d00e5953dd826a163878f1e38fb632ad9e78c04c6d9b23ab1edd1cec4ade8e.jpg) + +"kilopascals" spelled by ByT5-XL + +![](images/0ad4c7da51c405aa365bc4ebadc716933e7c132d55c7489aa074d5f83fa5b1e4.jpg) + +![](images/b4f7addb8ce923b83e935846d6b56adc790211f76c90030db2ffccd644585f67.jpg) + +![](images/a04b2532c5103e3740828dcb60d46167350756fa56d90ac49ecbd87e711f1c46.jpg) + +![](images/fdd639a53642a55e96e7059d105cf07b688b313641278840f21311c14ad7eda2.jpg) + +"kilopascals" spelled by ByT5-XXL + +![](images/a965591358b059bc17bd7b2567bfdbe83cf0180bc787b04fc0bce8c8b4d35627.jpg) + +![](images/9a6d97e5d47a638a606c5cd03aca2ab08e4962db780b8e8502d3a62dbf5c531b.jpg) + +![](images/360455cb58eaa2c82fdea54e25fe1968fb0eb8d1bb1895e78bfe8bc1a9b5ddb5.jpg) + +![](images/114a7e149095d302f62b2bbf2b5760edd8386b649c77280a7782d13c162710f6.jpg) + +"kilopascals" spelled by Concat + +![](images/2fa8913fe5668beda45307641b5497638958134161f0176750b75976a2ad9c6a.jpg) +Figure 19: Spelling examples from both character-blind (T5) and character-aware (ByT5 and Concat) models. Erroneous spellings are outlined in red. Prompt: A sign with the word "kilopascals" written on it. + +![](images/8d908bc689058c0b68179dc1eee8d83fe1b1bcb2badab1173fd935a43a997b31.jpg) + +![](images/cee4ad822448679efe8de30bb9b006ad8f0ea572124ec76b7e2f8698148baa5d.jpg) + +![](images/0c592d81b373d1653fe649e9ec94c9e2d06ec22d7bdbd37aea6679cf64b7342c.jpg) + +"rupiahs" spelled by T5-XL + +![](images/af2a5ab307b4f1e921d9a41d6d55a11f26280120d296b8820d189dee21894ba4.jpg) + +![](images/5da2fe2e77b6fb036276a9f36c2a8140048101f6469f0666d39352a571f86843.jpg) + +![](images/2ae39d2c53e89e12e0171c7e18484abdef1c49473207869d82465a14d20c7d9f.jpg) + +![](images/5551f9e641e7d75a4a113977ae14248129d2802681b610087e65caa0025d022c.jpg) + +"rupiahs" spelled by T5-XXL + +![](images/99aa7bd193469524256b9ee8f29eb75d4486f59f7abfb37fdc0e12b4c5530ab1.jpg) + +![](images/e39b185d21baf3b92ad2fbb0382a8ff97087d3c02f1dede6ff77dad9b075be15.jpg) + +![](images/91e7772e66e138243ef2d5b9203ba310ac89e8517ab204bc23e0f69a35ff2153.jpg) + +![](images/adc32a72fa855a3a67e367780b274f285e78e01bc75e9883e60bf521c21ff394.jpg) + +"rupiahs" spelled by ByT5-XL + +![](images/ae1817f95aa0bcbbe33183411946f2c18beff12e4c2be91813bd6f6fb0f296f7.jpg) + +![](images/f5c5301959d7e0b4c40b337f556c2488019876e106362763f114a9bf8b182bdd.jpg) + +![](images/e0a90a6fab2d3433e655f75479b7d3889dfece2550d95bd33a468e16e616a4e1.jpg) + +![](images/9f5a0e682cf41df94b8cbc069465eb77201fa816d985d7b358faf7b1d21dea0a.jpg) + +"rupiahs" spelled by ByT5-XXL + +![](images/a02c11c2e5354376fd63655032e9115ad6b4cf013798730b31ecd8567241c0cf.jpg) + +![](images/e1c927edaa7675a6be06176af79ec050d6e10ef3846927aeb0beb5f27766a373.jpg) + +![](images/157b27550bfd178c3b027b6c6b3972aefa690adf29ccc12d4873bf1dba52aefc.jpg) + +![](images/d689d9434aed00c76e5b1a4f2915bc5bb5ae5cef6707cf5918eaa22a16ed851a.jpg) + +"rupiahs" spelled by Concat + +![](images/74634e302911b2b8d0d646b10ea0cdce51c98e694dd9cc8189b1b1f3d7e260ac.jpg) +Figure 20: Spelling examples from both character-blind (T5) and character-aware (ByT5 and Concat) models. Erroneous spellings are outlined in red. Prompt: A sign with the word "rupiahs" written on it. + +![](images/dd4cd1682f424ef94f1224eb4ac1fafa98c6c93c9a0090d08c9d08c12b78c938.jpg) + +![](images/cc445989bc81b54d079f3011b805120ba939e9f2d4c9e0201d40e3807af81de9.jpg) + +![](images/85ed85c9cfef38c286e052ac5cc49f2f747045746963fe837a39240e8ad80e13.jpg) + +"Yongchuan" spelled by T5-XL + +![](images/2eae3afbf53e4c5014281845f7b24629929bf543243f1b74eeb99f752d75f4f6.jpg) + +![](images/52b3db8b784b6bf92344f0314c18cb36b2795d3383fe31accb8c4205e4038971.jpg) + +![](images/70b21f52264751aff95bebcdaa4afd3d202680506ba3eef50b700dfa3264cb31.jpg) + +![](images/855a9e32173892e2f40e5b817cdfd60c75bfc3ce03f14ca10c24b10ce7c29d75.jpg) + +"Yongchuan" spelled by T5-XXL + +![](images/cbdeed0931866bd91cc9cee34380b1490d2f99e0839e1ec790717a49d61a6942.jpg) + +![](images/2183fd5bf4e6dbf6c310624d9b5e4ecb30deb4c1629598eb05fcf4d945ba52ae.jpg) + +![](images/66362f988449bd6f77f5d43ade29e081fa3621172e619aeebaad87000b946bc9.jpg) + +![](images/aa3236d138863df4a7b151d918fe215e936c078023b3c28da54048c37addc94d.jpg) + +"Yongchuan" spelled by ByT5-XL + +![](images/1695249b89407a5556d016bfa3e90d02cac57e933066dee558d75e0690be9559.jpg) + +![](images/20dcee5c671d78d75428681e2af738b7cd6cc8ef811156d51ab57895a99d79fc.jpg) + +![](images/6c50e84c7751e399f96bb508a7354b2f083d3ccf952845213efc5f433dfa73c1.jpg) + +![](images/32e63947b9649dc2df68f63fbeb12cc846c4b555e536ff143d3cef6c46eb2629.jpg) + +"Yongchuan" spelled by ByT5-XXL + +![](images/3acd32e4d1561486324ce4bbd0c6a537e8fab306f885f198c2e910212e1896ea.jpg) + +![](images/4d61deea98d7a143c8cb4c51f6797d6100e01d78c974ffba1e027dad5b3a6c73.jpg) + +![](images/47c2fe3238af3c2cbb3e874e4fd58bfbe64673f20aa27e99daba736fea3e0e9f.jpg) + +![](images/d4a9b1d193de4ea22ccef1b5eb91b74d164ae67e2193177dcff5b7922472d467.jpg) + +"Yongchuan" spelled by Concat + +![](images/8fd95ac9325e57a94579ff68798d8070b48e9c395b8701b8667a1d3f6a8cc08a.jpg) +Figure 21: Spelling examples from both character-blind (T5) and character-aware (ByT5 and Concat) models. Erroneous spellings are outlined in red. Prompt: A sign with the word "Yongchuan" written on it. + +![](images/283bce7f4b8576fac05041c66977f3afd9792a1a6b15a367557cf486a1aaab58.jpg) + +![](images/20e2c0a5ebe9e8bdcdb2feccf6351874c87cea714a4c112f26963ef927d0dd5f.jpg) + +![](images/f5072fac676cd9a46c8a7ad7d13e426e30911fb3760f5dc2167376efa4566fb8.jpg) + +"isoaldehyde" spelled by T5-XL + +![](images/5435632ca77c988a5ca630cedd51afd21b687c468147b84e4e5471135dee1b79.jpg) + +![](images/67d53533646bc1ef9eda2718410a68880c7b07237faaeff5eeecf14583fafde4.jpg) + +![](images/020d3717c61748aa1c9238a19aa2695c3ccffdc642bdbdefc0161f012017bc36.jpg) + +![](images/559fd66dba7ae7adedc1fd2a0def0b9cdeac2e3ae4fd80822c17d834122024cb.jpg) + +"isoaldehyde" spelled by T5-XXL + +![](images/f63e41903c3933dc88d6b360a6e6c9d6ba58901740ecd0b24bc4a3f0cbd1e3f0.jpg) + +![](images/e9ba451ff53bf597d466845407a807205ec82c77857b8464c2f565e4bb545eb7.jpg) + +![](images/786ba2a335cb5574182613ac3614fb3501fcdf161503e87f92a1a38fc821ce21.jpg) + +![](images/ea5b08c1ed7845f99b1058e4e4fa9af6fb7661ddf21de5cc4c183710ca80fad2.jpg) + +"isoaldehyde" spelled by ByT5-XL + +![](images/c54046efa5ef54098929f846996f1819bf33769c76bc4cd6422f3d4572b10a44.jpg) + +![](images/7d91e793802745c5b3604d19e0da44f30497065d2a550136a02f922d4fb021a6.jpg) + +![](images/fae9a1534ab5778401ff3bfd31a01c7e94b0237cf41ccbea768be67efa23e3af.jpg) + +![](images/43c9e314b13d5e9ab86a531daf6fc9564c29a39d0a75c3a55de261e8da5a9a4c.jpg) + +"isoaldehyde" spelled by ByT5-XXL + +![](images/ab611dccb53cf615db86ecd581a38fd8f1807d1c80a295a7ea519fadf910eca0.jpg) + +![](images/a3dd02c9b5ee28de5d570a0b0b0f5b6cb58cb172b668ba36752a421c69b5972e.jpg) + +![](images/5ef424389a9effd54e32d76b87857992ba20c359161b84666e5d8fd05c07f61c.jpg) + +![](images/f8120343e5e2911355cd49570bfec0528a2b9153d4a840d959f3c5d467789e3c.jpg) + +"isoaldehyde" spelled by Concat + +![](images/719a541576edc43eeae4e9456c028382ba5b23bdf599f4290dc76ff9e06aeae7.jpg) +Figure 22: Spelling examples from both character-blind (T5) and character-aware (ByT5 and Concat) models. Erroneous spellings are outlined in red. Prompt: A sign with the word "isoaldehyde" written on it. + +![](images/cd714b3bb0242126c94d75b1b9bb28c2f6657df98e707c3df588203bfd09f46f.jpg) + +![](images/cef0d9e16559c02d1d123eb65e0eb0890b73fb46793a5ee920d4b472077541f3.jpg) + +![](images/74cb1f8d2665043677bec97dffeaa23f67192406187b758b7c5fa7465cd82d7f.jpg) + +"constructivists" spelled by T5-XL + +![](images/a19c9a20281d37b1c26f96e9eb471204479ef783c3fda1a7144315a1dec3b5c2.jpg) + +![](images/dbaa179cb8d186f3a71cfec2656b41bd1c6b7e0d8a3b392f866baeba983b1617.jpg) + +![](images/828e75ad1005294178cbd4637287493776910082f82d8c545c25aaad20d6d630.jpg) + +![](images/cd2baa633fc4282b0ccbe51d1f23e82a759e0a5e7d5936c94005ec2d5f10d960.jpg) + +"constructivists" spelled by T5-XXL + +![](images/4be4f5f9c134f21d27eccbffa5bb64f04529ed2abc57c0df87bde9f81cf50157.jpg) + +![](images/f148a9f57c410621175c71dda5a5fa33b52f555707fec00ab9651c2e479715af.jpg) + +![](images/1e64935a7b45c163a1d0b316557d636af58a1cba0810e8d04dc568f3cf7d43c0.jpg) + +![](images/33247bcd86c87f8c3873a3ac3defaa4ac8676d24514d55d87e98db99c4e3c81f.jpg) + +"constructivists" spelled by ByT5-XL + +![](images/6ead3efe86ea0f94c3f6598201577de93da09cd9cdb419fe9354e56f8c5e5d86.jpg) + +![](images/5cc7ca80c623be057f8a44f5c54f349df763cb3d0f2e9a8011b47167e68e82e9.jpg) + +![](images/6036df8437a136cd7e2e7b6f77b11c466c2072d63f7c57697448b958a02fc822.jpg) + +![](images/390837a1489718abab69b8eba4ba257196698979cb6d908f2ea7ef7c01bb9cb6.jpg) + +"constructivists" spelled by ByT5-XXL + +![](images/7ee71a5ea50e77f12bce292c97d672230f0f2c85a0eb584c10457d0037903fa5.jpg) + +![](images/d1cc86636c2656dd5aa3c0d777a5242cff2fd963fd977be366e29541ab0296f7.jpg) + +![](images/72e717063f7b71b277dead07e0f8ade24309d75fcf7b9824a3c7c9649047245d.jpg) + +![](images/002e4bbad7ad7178e60602cffb97f84d3b285d10df40a5418b614244b3a53dcf.jpg) + +"constructivists" spelled by Concat + +![](images/ace7447f83c4da37628cc4a626aaacddd389c9d8d9f5f1722feeab24166ffca0.jpg) +Figure 23: Spelling examples from both character-blind (T5) and character-aware (ByT5 and Concat) models. Erroneous spellings are outlined in red. Prompt: A sign with the word "constructivists" written on it. + +![](images/41c990c973f1eff53b68005c5bf0fe1f50b127613f78cc51a5e59287bd1fd86a.jpg) + +![](images/67510159eafd01c281893e1927f0f063350cb87234390b4f251c46ef49af8f57.jpg) + +![](images/66203a7dd3ae02db819c0e12482cebe6eb1e153755075d288bada46ed42ffdba.jpg) + +"ebike" spelled by T5-XL + +![](images/e565dfed5945cf37a4a6536b7356ce90e1d8027f92f03ee1bdd52516839aa8f4.jpg) + +![](images/7eefcba1fa16e51b8629b16e335e02722db655fdbb5a78b4330c95cc395add51.jpg) + +![](images/04ec36967a82d0b8a6cf36971a7630cfb879a4f015b276ad6b5d5dffdd6069af.jpg) + +![](images/a886c969df213b6b669d90345ae010230b8cbd4a7b777b5c1a670b65b41c19a0.jpg) + +"ebike" spelled by T5-XXL + +![](images/916e07c9236ba7c2bcb18e2a0a5184e49d9e1b798f2756ce421d020a2e9d4be7.jpg) + +![](images/e7303cf82034f6d711ccd92f519bdc1a6b647781fc68b71146bd5dadff88b710.jpg) + +![](images/554f193f325f0c85b88a910aca7290c59b2b289d0ebe37397711f8851c1fd678.jpg) + +![](images/578b37d81823a9d1c964c95176083d6d9da1bb670432949addbec4da0c626505.jpg) + +"ebike" spelled by ByT5-XL + +![](images/84148142ec1058bc245a8d8b0437938a748d466972220d04e4d7975a25b18da5.jpg) + +![](images/7d41c09e416929967179c1e77610667570eb22893facf2a99ef1b2d0365c905e.jpg) + +![](images/bfd1ee2a1949868f3f861af4a640f3cbf0a08b09e8c4828624ad601a1d06ca60.jpg) + +![](images/dc0f5e7e4c004fdcee8a343c3d139f3a44cae7dbee5bdb807894798a40e5e606.jpg) + +"ebike" spelled by ByT5-XXL + +![](images/a6250f4ce03a3c66baa493a12ea81c8b2a8174292ff298d34d526a50ddc39499.jpg) + +![](images/2e278c1e88258c18faa8c326e1f30be316ea28bcfb743690cdea328338a31e99.jpg) + +![](images/2a481d55621b9e0d1354e1c2ed0fca310d29bb31f7bc4a9981e797ce566f6aaf.jpg) + +![](images/32f8bf5d7e6ef16ac63528afa88429365bf0bdf468a8b26d8ad61b6526138a34.jpg) + +"ebike" spelled by Concat + +![](images/9376ff0928c400b679aa0ed2675606ecdf62298f20a274d46fed6f773dae10f1.jpg) +Figure 24: Spelling examples from both character-blind (T5) and character-aware (ByT5 and Concat) models. Erroneous spellings are outlined in red. Prompt: A sign with the word "ebike" written on it. + +![](images/18af630f7adb9c66a267e6257da6ad900374e76ad16c54cc865797acf2a552cf.jpg) + +![](images/4398c059bd298c3b3e0cdca70d4f9c2ecac0bd84b25a03dee9f9b55c740a4f42.jpg) + +![](images/a8618b223b380ba0e1975b080606ca8c731e51a921d61ae4f19793b309df1654.jpg) + +3. Word "coffee" made from coffee beans, studio shot. +4. studio shot multicolored fur in the shape of word "hello", in a furry frame, white background, centered +5. Photo of a robot lecturer writing the words "Representation Learning" in cursive on a blackboard, with math formulas and diagrams. +6. studio close-up shot of an antique book with 'knowledge is power' painted in gold on the cover in thick flowing brushed calligraphy +7. portrait of a parrot is holding a sign with text "no parrots were harmed in the making of this presentation" +8. A sign that says "Please refrain from arguing with the chimpanzees". + +# DrawText Creative prompts: 1 letter + +1. Studio shot of book shelf in the shape of letter G, museum quality, white background. +2. letter "c" made from cactus, high quality photo +3. Spirograph shape letter M, rainbow lines, white background. +4. Closeup shot of light magenta, blue and paint brush-strokes of very wide translucent overlapping plastic in the shape of letter F, over white background. +5. The lowercase letter "b" made out of fire. +6. Slopy minimal continued line pencil hand drawing of letter Z, white background. +7. a tower with a huge "w" on the side, from the perspective of a person standing at the base of the tower +8. 3-d letter R made from thin lines connected with dots, white background. +9. Muted pastel magenta colored paint swirled in white paint in the shape of letter X, globular paint in liquid. +10. Minimal sculpture of letter W made from light metallic iridescent chrome thin wire, 3-D render, isometric perspective, ultra-detailed, dark background. + +# DrawText Creative prompts: 1 word + +1. Drops of pastel rainbow colored paint exploding under water in letters "color" shape, pastel rainbow gradient background +2. 3-d Letters "DILL" made from dill, studio shot, green background, centered on a page +3. Word "coffee" made from coffee beans, studio shot. +4. studio shot multicolored fur in the shape of word "hello", in a furry frame, white background, centered +5. Wide lens shot, chunky, organic, colorful, letters "colorful" made from many furry spheres of different sizes, 3-d rendering, centered, studio shot, middle of square canvas +6. A logo for the company EcoGrow, where the letters look like plants. +7. a green-colored luxury car with a "green" sticker in the back window +8. A blackboard with the word "multiplication" written in flowing cursive. +9. beautiful isometric word "DRAW" entirely made of pencils, soft smooth lighting, pastel colors, trending on polycount, modular constructivism, blue background, physically based rendering, centered. + +10. transparent water drops exploding under water in the shape of word "water", under water +11. a drawing of a badger made of mushrooms, with the word "mushroom" written above in glowing letters +12. a 17th century french baroque painting of a huge female lion, with the word "meow" written in a speech bubble coming from her mouth +13. a fun and colorful illustration of a waterfall, with the word "waterfall" in the style of a children's book +14. Letters "VOLUME" fully made from rainbow smoke, black background, centered, sceensaver. +15. dslr, 3-d word "rainbow" with rainbow fur, white background +16. a painting of a field of daisies, with the word "danger" written on them in red spray paint +17. a bottle of hair gel with the label "flawless" +18. Topographical letters Contour made of a layered paper, muted pastel colors +19. a logo for the company "brainboost", where the letters look like a brain +20. a logo for the company "imagine", where the letters look like hands pointing up +21. A vintage postage stamp showing a painting of the Golden Gate Bridge and the text "California". +22. a plate of spicy food with the word "spicy" written in flowing cursive +23. a gold and black logo for the company "moneymoney-money", which looks like dollar signs +24. A rendered 3D model of the word "Dependable" made out of granite. +25. a volcano erupting, with the text "magma" in red +26. a photo of a prison cell with a window and a view of the ocean, and the word "freedom" painted on the glass +27. a bowl of alphabet cereal, with the message "smackeroo" written in the bowl with the cereal letters +28. Studio shot of book shelf in the shape of letters READ, museum quality, white background. +29. Studio shot of sculpture of text "cheese" made from cheese, with cheese frame. +30. a landscape of the coyote point national wildlife refuge in arizona, with a coyote sitting on a rock, with the word "coyote" written in sunrise colors +31. A professional logo for the crypto trading platform "SaltMine". +32. The word "exquisite" written in modern calligraphy. +33. A bowl of tomato soup with pasta letters that read "Delicious". +34. intricate and highly detailed white paper cut out art of a word "SNOW", a storybook illustration, paper cut out, standing in a grotto, made out of white paper, loss of inner self, opening door, hides in the shadows of trees, lithograph, a painting of white silver +35. 3-d letters "dessert" made from desserts, arranged on a plate, studio shot +36. studio shot of word "BEE" made from bees, white background, in a frame made from bees +37. The logo for Robotrax, with metallic letters arranged in the shape of a robot. + +38. chunky, organic, colorful, letters "fuzzy" made from many furry spheres of different sizes, 3-d rendering, centered in the frame +39. photo of a dark cave with the word "crazy" carved into the wall, with a yellow light shining through the cave entrance +40. a pair of scissors pointing down, and a computer with the word "delete" on the screen +41. studio shot, word "wow" in script made from rainbow colored fur, in a furry frame, white background, centered +42. Word "broken" made from broken shattered black glass, centered. +43. a black and white photo of a saxophone with the word "jazz" written in flowing cursive +44. Muted pastel multi colored paint swirled in white paint in the shape of letters "swirl", globular paint in liquid +45. a logo for the company "quantum", where the "q" looks like a lightning bolt +46. dslr shot of a pair of black and red sneakers with the word "punk" written in white. the background is a dark blue +47. a logo for the company "diamonds", with a diamond in the shape of a heart +48. a logo for the company "birthdaypix", where the letters look like birthday candles +49. a fork with the word "salad" engraved on it in a calligraphic font +50. 3-d word "bricks" with brick texture made from real bricks + +# DrawText Creative prompts: 2 words + +1. Photo of a robot lecturer writing the words "Representation Learning" in cursive on a blackboard, with math formulas and diagrams. +2. a sign that reads "no dogs" but with a dog smiling and wagging its tail +3. a globe with the text "planet earth" in bold letters, with the continents in bright colors +4. a photo of a sea of roses all around, and a sign in the distance that says "danger: minefield" +5. giraffe toothbrush made from wood, with the words "giraffe" and "toothbrush" in rainbow color +6. An airplane flying over a city, with the message "Support Skywriters" written in smoke trails. +7. A photo of a panda giving a presentation in a large conference room, with text 'Diffusion Models', in the style of van Gogh +8. Two llamas dancing the mambo, pointing to a sign that says "Llama Mambo". +9. A hand painted wooden "Pineapple Club" sign in the shape of a pineapple, hanging outside a bar. +10. a logo for the company "ethereal media", where the letters look like a painting being created +11. The cover for the album 'Elusive Interludes' by the band The Melting Snowmen. +12. A Scrabble board showing the words "optimize" and "pattern". +13. flowers in a beautiful garden with a text "peace" made by the flowers, with a text "tensions" on the clouds in the sky + +14. a detailed drawing, of words "Vintage lettering", letterism, heavy-gauge filigree, inhabited initials, medium: black pencil, revolver, ecopunk rococo, photo taken of an epic intricate, centered +15. Bananas arranged on a picnic table to form the message "That's bananas!" +16. An antique bottle labeled "Energy Tonic". +17. photo of a helicopter with the text "helicopter tours" on the side landing on a helipad in a valley with a river, trees, and mountains in the background +18. photo of a sign with "one way" +19. a sculpture of a brain made from wire and paper, with the words "deep thoughts" written into the material of the brain +20. a logo for a grocery store chain with the name "grocery land", with the g and the y are made of fruits and vegetables +21. studio shot of sculpture of text "unlock creativity" made from colorful thin wires +22. studio shot of a sculpture of a pair of shoes made of colorful wires and the text "unlock creativity" +23. a vintage image of the las Vegas strip with the text "las Vegas" in bold block letters +24. A robot writing "Ethics 101" in chalk on a blackboard. +25. a yellow saxophone in a rainbow-colored mist with the words "funky mist" that looks like musical clouds of smoke + +# DrawText Creative prompts: 3+ words + +1. studio close-up shot of an antique book with 'knowledge is power' painted in gold on the cover in thick flowing brushed calligraphy +2. portrait of a parrot is holding a sign with text "no parrots were harmed in the making of this presentation" +3. words "Struck by Lightning Twice." made from lightning +4. a photograph of a field of dandelions with the text "dandelions are the first to go when the lawn is mowed" +5. a composition of the taj mahal in the center of a gold leaf mandala, with the words "place of honor" centered at the bottom +6. A poster titled "Quails of North America", showing different kinds of quails. +7. a cartoon of a cat with a thought bubble saying "this is so weird" +8. a parrot on a pirate ship, with a parrot wearing a pirate hat, and the caption "i'm the captain now" +9. Generative art of words "Time is temporary, everything is temporary", viscous smoke made from dots, rivers, graph design, white background. +10. Studio shot of words "the food is terrible and the portions are too small" made from hotdogs, museum quality, framed photo, white background. +11. a picture of a powerful-looking vehicle that looks like it was designed to go off-road, with a text saying "i'm a truck, not a car" +12. a minimalistic version of a forest with a sign saying "help the forest" in the foreground +13. a map of the world with the text "the world is your oyster" in the middle + +14. cartoon of a dog in a chef's hat, with a thought bubble saying "i can't remember anything!" +15. A retro coffee ad with the text 'Coffee is what i like'. +16. different colored shapes on a surface in the shape of words "Life is like a rainbow", an abstract sculpture, polycount, wrinkled, flowing realistic fabric, psytrance, cartography, smooth shading techniques, marble skin, old internet art, camouflage scheme, art $\gg$ , medium poly, smoothened +17. the view from one end of a bench in a park, looking at the sky, with the text "imagine the outcome" in the sky +18. a giant shoe, with the caption "shoe for hokey pokey" +19. A newspaper with the headline "Local pig eats prize pumpkin", and a photo showing the half-eaten pumpkin. +20. A storefront with "The world's best deli" written on it, centered +21. Grape vines in the shape of text 'open your mind' sprouting out of a head with flowers and butterflies. DSLR photo. +22. a plate with a single oyster, with a fork and knife sticking out of the oyster, with a caption that says "oysters for lunch" +23. dslr portrait of a robot is holding a sign with text "i am not a robot" +24. Studio shot of words "I like coffee because it gives me the illusion that I might be awake." made from coffee liquid, museum quality, white background. +25. A hastily handwritten note that says "I'll be back at 4:00" taped to a fridge. +26. A large recipe book titled "Recipes from Peru". +27. marquee billboard with "my fear of moving stairs is escalating" +28. shadow of a stone, taken from the point of view of an ant, with the caption "look at that shadow!" +29. a pumpkin with a mustache and a monocle and a top hat, with the text "you can get rich too" in a speech bubble +30. a cartoon of a dog holding a telescope looking at a star with a speech bubble saying "i wonder if there's a dog on that planet" +31. a blueprint of a house, with a triangle for the roof, a square for the walls, and a rectangle for the floor, and with the message "this house is built on the principles of abstraction" +32. a sunflower field with a tractor about to run over a sunflower, with the caption "after the sunflowers they will come for you" +33. text "balloons are flying" made from rainbow balloons, pastel background +34. the bubble telescope and the milky way, with the text "the universe is a mystery, but we are here to solve it" +35. a heart with the text "i love you", with the letters "love" made of rainbow colors +36. studio shot of beautiful textbook with title "how to be a manager of managers", white background +37. A decorative greeting card that reads "Congratulations on achieving state of the art!" +38. a painting of a cornfield with the words "feed the nation" in simple letters and colors +39. A sign that says "Please refrain from arguing with the chimpanzees". + +40. a cartoon of a turtle with a thought bubble over its head with the words "what if there was no such thing as a thought bubble?" +41. "Fall is here" written in autumn leaves floating on a lake. +42. a crab sitting on a beach with a surfboard, the sun is a giant orange, and the sky is a rainbow, and the crab is thinking "you are all that matters" +43. the city of toronto as seen from an airplane, with a giant cn tower in the middle of the frame, with the text "the cn tower" in comic sans +44. a cartoon of a hippo with a speech bubble saying "i'm a hippo, what do you want?" +45. a lobster in a suit and tie, holding a microphone, with the caption "lobster says what?" +46. book with "surgery made easy" +47. art installation of a chair with the text "i got nothin" carved into the backrest +48. a painting of a landscape, with a handwritten note that says "this painting was not painted by me" +49. a picture of a bruised apple with the text "apples are good for you" in a fancy font +50. A photo of a corgi with a sign that says "I am not a real corgi". +51. Words "It takes AI and rain to make a rainbow" black background, holography, ((neon colors)), colorful swirly magical ripples, bruh moment, intricate white and gold neon, 3d cg, photorelistic. +52. a black and white logo on words "Every artist was first an amateur." a white background, a wireframe diagram, generative art, branches growing as hair, tropical reef, trademarks and symbols, in a forest, ios icon, composed of random limbs, stone carving, done in the style of matisation, realms, terminals +53. picture of two hands, one holding a heart, the other holding a lightning bolt, with the text "love is power" +54. beautiful photo of the alps, with the caption "the best mountains could do" +55. a pencil sketch of a tree with the title "nothing to tree here" +56. a dark forest with a single light in the distance, and the text "i've come to talk with you again" +57. a circle with the text "infinity makes me happy", in a font that looks like it was written by hand +58. studio shot of vines in the shape of text 'knowledge is power' sprouting, centered +59. a photo of a beautiful field of poppies with a sign that says "no photos please" +60. a grumpy sunflower with a "no solar panels" sign +61. A meme showing a cat attacking a shoe, with the message "I own your sole". +62. a test tube with a drop of liquid in it, with the text "we've found water on mars!" +63. a scene with a city in the background, and a single cloud in the foreground, with the text "contemplate the clouds" in rounded cursive +64. a picture of a dog and a cat with their heads poking out of a cage with a sign saying "no pets allowed" +65. a 3d model of a 1980s-style computer with the text "my old habit" on the screen + +66. a mouse with a flashlight saying "i'm afraid of the dark" +67. A photo of a rabbit sipping coffee and reading a book. The book title "The Adventures of Peter Rabbit" is visible. +68. clown is holding a paper sign with "Even in hard times there's a possibility to have fun." +69. newspaper with the headline "aliens found in space" and the text "the truth about everything now challenged" +70. a dog with a speech bubble with the text "woof woof" and a translation speech bubble with the text "other dogs do vex us" +71. robot on a butter food processing line, with robot looking dejected, with an overhead red light indicating error, with robot saying "i can't believe it's not butter" +72. a graffiti art of the text "free the pink" on a wall +73. a lizard sitting on a baseball field home plate, with the words "made it safe" in a speech bubble +74. a picture of multiple trees at various stages of development, with the caption "growth is a continuous process" +75. a purple flower with a crown on its head and a speech bubble that says "i am the purple flower!" +76. a 1950s-style robot with a giant head and a body shaped like a rocket, with the caption "wow, a real spacerman!" +77. A professionally designed logo for a bakery called Just What I Kneaded. +78. Minimal sculpture of word "this is the future" made from light metallic iridescent chrome thin wire, 3-D render, isometric perspective, ultra-detailed, dark background. +79. pillow in the shape of words "ready for the weekend", letterism, funny jumbled letters, [closeup]!, breads, author unknown, flat art, swedish, diaper-shaped, 2000, white clay, surreal object photography +80. plant in a fancy pot with a "do not touch" sign on it +81. a picture of the earth with the words "save the earth" in a circle +82. scholarly elephant reading a newspaper with the headline "elephants take over the world" +83. photo of a sign with "having a dog named shark at the beach was a mistake" +84. photo illustration of the earth being struck by multiple lightning strikes that merge, with the caption "astonishment at the speed of light" +85. a photo of a fish tank with a fish inside, with the text "tank you for visiting!" +86. the words "Art is never finished, only continued" in paint splatters on a white background, graffiti art, edge of nothingness love, muddy colors, colored woodcut, beautiful, spectral color +87. photo of a restaurant "the gas station" +88. A t-shirt with the message "There is no planet B" written on it. +89. a close up of a figurine of toothpaste tube, a 3D render, candy pastel, with text "brush your teeth" on the tube +90. A hand-drawn blueprint for a time machine, with the caption "Time Traveling Device". + +A For every submission: + +A1. Did you describe the limitations of your work? + +"Limitations" section + +A2. Did you discuss any potential risks of your work? + +"Ethics Statement" section + +A3. Do the abstract and introduction summarize the paper's main claims? + +Abstract, and Section 1 Introduction. + +A4. Have you used AI writing assistants when working on this paper? + +Left blank. + +B Did you use or create scientific artifacts? + +Created WikiSpell and DrawText Creative prompt datasets. + +B1. Did you cite the creators of artifacts you used? + +Section 3.1, Section 3.2. + +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? + +If accepted we will release our prompts and evaluation datasets under a permissive license, most likely CC-BY. + +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +Section 1 Introduction discussed how image generation models are used to render visual text. + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? + +Not applicable. Left blank. + +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? + +Section 3.1 and Appendix D + +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. + +Section 3.1. + +C Did you run computational experiments? + +Section 5.1 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +Section 3.2, Section 5.1. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? Section 3.2, Section 5.1. +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? Sections 5.2, 5.3, 5.4. +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? Section 3.2 + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? Section 5.4. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? We closely follow the procedure of Sahara et al.(2022), which we cited. +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? We closely follow the procedure of Saharia et al.(2022), which we cited. +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? We closely follow the procedure of Saharia et al.(2022), which we cited. +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? Our institution does not have an IRB. +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? We closely follow the procedure of Saharia et al.(2022), which we cited. \ No newline at end of file diff --git a/characterawaremodelsimprovevisualtextrendering/images.zip b/characterawaremodelsimprovevisualtextrendering/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..b85ec5baed944af964c07042604a641c6beeca59 --- /dev/null +++ b/characterawaremodelsimprovevisualtextrendering/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f56f622d3fef88fb13418d379389674711d24d195fc65902fd6e3b0b03f90ea1 +size 3089031 diff --git a/characterawaremodelsimprovevisualtextrendering/layout.json b/characterawaremodelsimprovevisualtextrendering/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..2f3fb00f06915c5e71f40e58d0c9d6338df20cfa --- /dev/null +++ b/characterawaremodelsimprovevisualtextrendering/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7aa142a2b669a984a64d48c57b7246881b1ba01704559d0fcdecb34f4743fd25 +size 1410693 diff --git a/characterizingandmeasuringlinguisticdatasetdrift/b36fe98e-a6c9-456c-acfd-119cf5841528_content_list.json b/characterizingandmeasuringlinguisticdatasetdrift/b36fe98e-a6c9-456c-acfd-119cf5841528_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..a29b4a3e0f4690572f827d8022c7ea2df2f0cee9 --- /dev/null +++ b/characterizingandmeasuringlinguisticdatasetdrift/b36fe98e-a6c9-456c-acfd-119cf5841528_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:813598777ef9c1e7e84d13a600039ad792f1b0e6de3ca6157277fb96efe0dde0 +size 102498 diff --git a/characterizingandmeasuringlinguisticdatasetdrift/b36fe98e-a6c9-456c-acfd-119cf5841528_model.json b/characterizingandmeasuringlinguisticdatasetdrift/b36fe98e-a6c9-456c-acfd-119cf5841528_model.json new file mode 100644 index 0000000000000000000000000000000000000000..b983ecc02215205f9a00a164f7fee3a5b775115b --- /dev/null +++ b/characterizingandmeasuringlinguisticdatasetdrift/b36fe98e-a6c9-456c-acfd-119cf5841528_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:521e72c6d48b24e366965dc203666ca4db0f7d49087fb59b6d1f482e53df5c71 +size 121775 diff --git a/characterizingandmeasuringlinguisticdatasetdrift/b36fe98e-a6c9-456c-acfd-119cf5841528_origin.pdf b/characterizingandmeasuringlinguisticdatasetdrift/b36fe98e-a6c9-456c-acfd-119cf5841528_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..0df1461fbe1c98bd8a30c90f468ddc69e85b2662 --- /dev/null +++ b/characterizingandmeasuringlinguisticdatasetdrift/b36fe98e-a6c9-456c-acfd-119cf5841528_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:67d8e0f37374c8a7641a9d3d60c86596aedcfd09924ca402160ac4cf5ab9a71a +size 431081 diff --git a/characterizingandmeasuringlinguisticdatasetdrift/full.md b/characterizingandmeasuringlinguisticdatasetdrift/full.md new file mode 100644 index 0000000000000000000000000000000000000000..c591184f9d889ffbf99d6abe65c3b632d7b8a413 --- /dev/null +++ b/characterizingandmeasuringlinguisticdatasetdrift/full.md @@ -0,0 +1,384 @@ +# Characterizing and Measuring Linguistic Dataset Drift + +Tyler A. Chang $^{1*}$ Kishaloy Halder $^{2\dagger}$ Neha Anna John $^{2}$ Yogarshi Vyas $^{2}$ Yassine Benajiba $^{2}$ Miguel Ballesteros $^{2}$ Dan Roth $^{2}$ + +1University of California San Diego + +$^{2}$ AWS AI Labs + +tachang@ucsd.edu + +{kishaloh,nehajohn,yogarshi,benajiy,ballemig,drot}@amazon.com + +# Abstract + +NLP models often degrade in performance when real world data distributions differ markedly from training data. However, existing dataset drift metrics in NLP have generally not considered specific dimensions of linguistic drift that affect model performance, and they have not been validated in their ability to predict model performance at the individual example level, where such metrics are often used in practice. In this paper, we propose three dimensions of linguistic dataset drift: vocabulary, structural, and semantic drift. These dimensions correspond to content word frequency divergences, syntactic divergences, and meaning changes not captured by word frequencies (e.g. lexical semantic change). We propose interpretable metrics for all three drift dimensions, and we modify past performance prediction methods to predict model performance at both the example and dataset level for English sentiment classification and natural language inference. We find that our drift metrics are more effective than previous metrics at predicting out-of-domain model accuracies (mean $16.8\%$ root mean square error decrease), particularly when compared to popular fine-tuned embedding distances (mean $47.7\%$ error decrease). Fine-tuned embedding distances are much more effective at ranking individual examples by expected performance, but decomposing into vocabulary, structural, and semantic drift produces the best example rankings of all considered model-agnostic drift metrics (mean $6.7\%$ ROC AUC increase). + +# 1 Introduction + +Dataset drift, when test data distributions differ from a model's training data, can have detrimental effects on NLP model performance (Broscheit et al., 2022; Do et al., 2021; Koh et al., 2021). In real world scenarios, models are regularly monitored for potential performance degradations by + +comparing incoming test data with the training data (Elango et al., 2022; Nigeria et al., 2022). For these scenarios, researchers have proposed a variety of linguistic dataset drift metrics that aim to predict NLP model performance degradations between training and test domains (Elsahar and Galle, 2019; Ramesh Kashyap et al., 2021). + +However, previous drift metrics and performance predictions suffer from several limitations. First, previous metrics have generally been designed as holistic measures of linguistic dataset drift, despite the fact that different NLP tasks and models might be sensitive to different dimensions of linguistic drift. Second, previous research has focused on drift metrics at the dataset level rather than the individual example level. Not only does this require multiple labeled evaluation domain datasets to make out-of-domain performance predictions (regressions require multiple dataset-level drift values to fit to; Elsahar and Galle, 2019; Ramesh Kashyap et al., 2021), but drift metrics are often used in practice to predict model performance when individual real world examples are streamed in real time (Elango et al., 2022). We seek to overcome both of these limitations by proposing and evaluating specific dimensions of linguistic drift, predicting out-of-domain model performance at both the individual example level and the dataset level. + +Specifically, we propose three dimensions of linguistic dataset drift along with corresponding drift metrics: vocabulary, structural, and semantic drift. Because these dimensions capture distinct features that could have different effects on the performance of an NLP model, we hypothesize that decomposing into these three dimensions will allow NLP performance prediction models to better predict model performance on novel data. Indeed, when compared to previous model-agnostic drift metrics predicting performance on English sentiment classification and natural language inference (NLI), our metrics produce both improved predictions + +of dataset-level accuracies and improved rankings of individual examples by expected performance, for both in-domain and out-of-domain data (mean $16.8\%$ accuracy root mean square error decrease, mean $6.7\%$ ROC area under the curve increase). Although we find that previously-proposed finetuned embedding distances (Elango et al., 2022) are far more effective at ranking individual examples by expected performance, those distances are extremely ineffective at predicting actual model accuracies. We conclude that decomposing linguistic drift into vocabulary, structural, and semantic drift is an effective approach for predicting out-of-domain model accuracy, and for ranking individual examples when model-agnostic metrics are desired. + +# 2 Related Work + +Past work has quantified the drift between NLP datasets using distances between token frequency distributions or TF-IDF vectors (Bäck, 2019; Ramesh Kashyap et al., 2021; Sato et al., 2022), language model embedding distances (Feldhans et al., 2021; Yamshchikov et al., 2021), or the ability of domain classifiers to discriminate between datasets (Dredze et al., 2010; Elsahar and Galle, 2019; Ruder et al., 2017). Notably, Ramesh Kashyap et al. (2021) find that these metrics can predict performance degradations when an NLP model is transferred from a training dataset $D_{\text{train}}$ to an out-of-domain evaluation dataset $D_{\text{eval}}$ . + +However, existing metrics have generally been designed as holistic measures of linguistic drift, failing to capture specific dimensions that might affect NLP model performance in different ways. Furthermore, the traditional setup for evaluating drift metrics (Elsahar and Galle, 2019; Ramesh Kashyap et al., 2021) only allows for dataset-level drift metrics that predict overall model accuracy on out-of-domain datasets. In practice, when real world examples are streamed during test time, it is desirable to predict model performance for individual examples using example-level drift metrics (i.e. drift between an example $x$ and a training dataset $D_{\text{train}}$ ; Elango et al., 2022; Nigenda et al., 2022). In our work, we modify the setup from Ramesh Kashyap et al. (2021) to predict performance for individual examples (Section 4), using logistic regressions fitted to example-level drift metrics. In contrast to Ramesh Kashyap et al. (2021), we can fit our regressions to predict out-of-domain performance even when only a single + +in-domain evaluation dataset is available. + +# 3 Dimensions of Linguistic Drift + +As described above, previous measures of dataset drift in NLP suffer from (1) lack of specificity and (2) lack of validation at the example level, where such metrics are often used in practice. First, we address the lack of specificity by proposing three dimensions of linguistic dataset drift: vocabulary, structural, and semantic drift. As in previous work, we primarily focus on domain drift, i.e. divergence in the input probabilities $P(x)$ rather than the joint probabilities over inputs and labels $P(x,y)$ . For each of our proposed drift dimensions, we propose a metric that quantifies the drift between an evaluation example $x$ and a training dataset $D_{\mathrm{train}}$ , allowing us to use our metrics to predict example-level model performance. We evaluate our metrics empirically in Section 4. + +# 3.1 Vocabulary Drift + +We define vocabulary drift as the divergence between content word frequencies in two text samples. Content words are defined as open class words that generally contain substantial semantic content (e.g. nouns, verbs, adjectives, and adverbs), contrasted with function words that primarily convey grammatical relationships (e.g. prepositions, conjunctions, and pronouns; Bell et al., 2009; Segalowitz and Lane, 2000). By restricting our vocabulary drift definition to content word distributions, we capture vocabulary differences between two text datasets without the confounds of structural features. For example, "The student ate the sandwich" and "A sandwich was eaten by a student" would have low vocabulary drift after excluding function words. Notably, our definition of vocabulary drift is designed to include drift in word choice, regardless of the semantic similarity between chosen words; for example, "The dog was happy" and "The beagle was ecstatic" would have high vocabulary drift due to differing word choice, despite their high semantic similarity. This property is useful because NLP models are often sensitive to changes in word choice even if datasets are semantically similar (Hu et al., 2019; Misra et al., 2020). + +Formally, to quantify the vocabulary drift between an evaluation example $x$ and a training dataset $D_{\mathrm{train}}$ , we compute the cross-entropy be + +tween content word frequencies in $x$ and $D_{\mathrm{train}}$ as: + +$$ +\frac {1}{| x _ {\text {c o n t e n t}} |} \sum_ {w \in x _ {\text {c o n t e n t}}} \log \left(P _ {\text {t r a i n _ c o n t e n t}} (w)\right). \tag {1} +$$ + +Here, $x_{\text{content}}$ is the set of content words in example $x$ , and $P_{\text{train\_content}}(w)$ is the frequency (restricted to content words) of word $w$ in the training dataset. Our vocabulary drift metric is equal to the log-perplexity (training loss) of a unigram language model restricted to content words, trained on $D_{\text{train}}$ and evaluated on $x$ . We annotate content words using the spaCy tokenizer and part-of-speech (POS) tagger (Honnibal et al., 2017), defining content words as those with an open class Universal POS tag (nouns, verbs, adjectives, adverbs, and interjections; Nivre et al., 2020) and excluding stop words in spaCy. + +# 3.2 Structural Drift + +In contrast to vocabulary drift, structural drift captures divergences between the syntactic structures in two text samples. For example, "Yesterday, I was surprised by a dog" and "Usually, she is recognized by the audience" would have low structural drift despite high vocabulary drift. Previous work in discourse analysis has attempted to quantify structural similarity separately from semantic similarity in natural conversations, although their metrics are not directly applicable to NLP datasets due to computational limitations (Boghrati et al., 2018). Structural drift has also been studied in machine translation, primarily considering structural divergence between parallel text in different languages (Dave et al., 2004; Deng and Xue, 2017; Dorr, 1990; Saboor and Khan, 2010); in our work, we focus on divergences between non-parallel monolingual text. + +We quantify the structural drift between an example $x$ and $D_{\mathrm{train}}$ using the cross-entropy between the true POS tag sequence for $x$ and the predictions of a POS 5-gram model trained on POS tag sequences in $D_{\mathrm{train}}$ . This metric captures the divergence between syntactic structures in $x$ and $D_{\mathrm{train}}$ using 5-gram sequences, abstracting away from semantic content and vocabulary by considering only the POS tag for each word (Axelrod et al., 2015; Nerbonne and Wiersma, 2006). Formally, + +we compute: + +$$ +\frac {1}{| x |} \sum_ {i = 1} ^ {| x |} \log \left(P _ {\text {t r a i n}} \left(\operatorname {t a g} _ {i} \mid \operatorname {t a g} _ {i - 1}, \dots , \operatorname {t a g} _ {i - 4}\right)\right). \tag {2} +$$ + +We pad the beginning of the POS tag sequence with [SEP] tokens, and we only annotate examples with structural drift if they contain at least two non-[SEP] tokens. As with our vocabulary drift metric, we annotate POS tags using the spaCy tokenizer and POS tagger. + +# 3.3 Semantic Drift + +Finally, we consider semantic drift, defined as any divergence in semantic meaning between two text samples. Semantic drift is closely related to both vocabulary and structural drift; the words and syntactic structures used in a sentence are closely tied to the meaning of that sentence, particularly under compositional assumptions of language (Szabó, 2022). However, there are notable cases where semantic drift is independent from vocabulary and structural drift. For example, "I saw the doctor" and "I took a trip to the hospital" have high vocabulary and structural drift under our definitions, despite similar semantic meaning. Conversely, some sentences have different meanings or connotations across time and contexts, despite remaining identical in both vocabulary and structure (e.g. the word "sick" in "That salamander is sick!" can mean very cool or physically ill depending on the context). + +Many of these semantic similarities and differences can be quantified using contextualized embeddings from modern language models (Briakou and Carpuat, 2020; Devlin et al., 2019; Liu et al., 2020; Sun et al., 2022), which we include in our drift metric experiments (Section 4). However, when identifying individual dimensions of linguistic drift, we seek to identify dimensions that are both interpretable and relatively independent from one another, to better isolate specific dimensions that impact NLP model performance. Language model embeddings reflect vocabulary and structural properties of sentences as well as semantic properties (Hewitt and Manning, 2019; Tenney et al., 2019), and thus they are less effective for pinpointing interpretable effects that are specific to semantic drift. + +Lexical Semantic Change. Instead, we consider lexical semantic change, in which a word's meaning changes between two datasets while its sur + +face form remains the same (Gulordava and Baroni, 2011; Kulkarni et al., 2015; Sagi et al., 2009; Tahmasebi et al., 2021). Past work has quantified a token's lexical semantic change $\mathrm{LSC}_{D_1\leftrightarrow D_2}(w)$ using the mean pairwise cosine distance between contextualized RoBERTa embeddings for that token in two different datasets $D_{1}$ and $D_{2}$ (Giulianelli et al., 2020; Laicher et al., 2021). Motivated by this metric, we quantify the lexical semantic change between an evaluation example $x$ and a training dataset $D_{\mathrm{train}}$ using the mean lexical semantic change between $x$ and $D_{\mathrm{train}}$ for all content tokens $w$ shared between $x$ and $D_{\mathrm{train}}$ : + +$$ +\frac {1}{| x _ {\text {c o n t e n t}} |} \sum_ {w \in x _ {\text {c o n t e n t}}} \operatorname {L S C} _ {x \leftrightarrow D _ {\text {t r a i n}}} (w). \tag {3} +$$ + +Here, $\mathrm{LSC}_{x\leftrightarrow D_{\mathrm{train}}}(w)$ is the mean pairwise cosine distance between embeddings for $w$ in example $x$ and dataset $D_{\mathrm{train}}$ , using a non-fine-tuned RoBERTa model. Again, we define content tokens as tokens that are annotated with an open class POS tag anywhere in the Universal Dependencies English dataset, excluding stop words (Nivre et al., 2020). While this lexical semantic change metric is still based on contextualized embeddings, matching embeddings based on token surface forms allows us to minimize effects of vocabulary and structural drift, as compared to matching each example representation with all other example representations regardless of surface form. Of course, lexical semantic change is just one type of semantic drift; future work might consider other types of semantic drift that are independent from vocabulary and structural drift. + +# 4 Experiments + +Previous work has evaluated drift metrics by assessing their ability to predict out-of-domain model performance at the dataset-level using dataset-level metrics (e.g. Ramesh Kashyap et al., 2021; Section 2). We extend this work by predicting individual example-level performance (probabilities of getting individual examples correct) along with dataset-level accuracies, using drift metrics between each + +example $x$ and the training dataset $D_{\mathrm{train}}$ . Using these example-level metrics instead of dataset-level metrics allows us to fit regressions predicting model performance using only a set of examples (e.g. using only the in-domain evaluation set), rather than a set of multiple evaluation datasets covering different domains. Thus, our approach can be used in common real world scenarios where labeled data is available only in one domain. In our experiments, we compare previous drift metrics with our proposed metrics for vocabulary, structural, and semantic drift, evaluating whether decomposing linguistic drift into these three dimensions improves NLP model performance predictions. + +# 4.1 Datasets + +We evaluate cross-domain transfer performance for language models fine-tuned on sentiment classification (split by product category or review year) and natural language inference (NLI, split by source domain). Because these tasks output one prediction per sequence, they allow us to directly evaluate sequence-level (i.e. example-level) drift metrics. + +Amazon Reviews (product categories). For sentiment classification, we consider the Amazon reviews dataset, containing customer-written product reviews for 43 different product categories (Amazon, 2017). As in Blitzer et al. (2007), we label 1- and 2-star reviews as negative, and 4- and 5-star reviews as positive. We sample up to $100\mathrm{K}$ polarity-balanced reviews from each product category, considering each category as a domain. For each product category, we use a $70/20/10\%$ split for training, evaluation and test datasets. + +Amazon Reviews (temporal split). Next, we consider the same Amazon reviews dataset for sentiment classification, but we define domains by review date rather than by product category. We generate a category-balanced and polarity-balanced sample for each year between 2001 and 2015 (inclusive) by sampling up to 5K polarity-balanced reviews from each product category for each year, sampling the same number of reviews each year for any given category. The resulting dataset has 33K training examples, 5K evaluation examples, and 5K test examples for each year, similar to Agarwal and Nenkova (2022), but balanced for product category and polarity. + +MultiNLI. Finally, we consider the MNLI dataset for natural language inference (NLI), covering five training domains and ten evaluation domains, including government documents, pop culture articles, and transcribed telephone conversations (Williams et al., 2018). Each training domain has approximately 77K training examples, and each evaluation domain has approximately 2K evaluation examples. + +# 4.2 Models + +We fine-tune a RoBERTa base-size model $\mathcal{M}$ for each training domain for each task, using batch size 32, learning rate 2e-5, and four epochs through the training data (Liu et al., 2019). Because there are only five training domains for MNLI, we run five fine-tuning runs per MNLI training domain. Full fine-tuning details and hyperparameters are listed in Appendix A.1. We evaluate each model on each evaluation domain; to simulate realistic scenarios for temporal data, we evaluate only on future years for models trained on temporal splits. + +# 4.3 Drift metrics + +We consider drift metrics between individual evaluation examples $x$ and training datasets $D_{\mathrm{train}}$ . First, we consider our vocabulary, structural, and semantic drift metrics from Section 3. Initial motivations and theoretical examples of how these three dimensions differ are described in Section 3, but the dimensions are not perfectly independent. Empirically, Pearson correlations between our vocabulary, structural, and semantic drift metrics range from 0.10 to 0.50 across the different tasks. For comparison, we also consider drift metrics from past work: token frequency divergences and embedding cosine distances. With the exception of the fine-tuned embedding distances, all of our metrics are model-agnostic, meaning they are not dependent on the internals of the fine-tuned model. + +Token frequency divergences. We compute the Jensen-Shannon (JS) divergence between the token frequency distribution for each example $x$ and each training dataset $D_{\mathrm{train}}$ . This divergence has been shown to correlate with out-of-domain model performance when computed at the dataset-level (i.e. between an entire evaluation set $D_{\mathrm{eval}}$ and the training set $D_{\mathrm{train}}$ ; Ramesh Kashyap et al., 2021), and it has been recommended as a metric for training dataset selection (Ruder et al., 2017). + +![](images/2fda2c7b568eddb065cc5414e3e4938f06ee86f45939b3235e35b9bd725f1743.jpg) +Figure 1: ROC curves predicting whether a model will get individual examples correct based on vocabulary, structural, and semantic drift (left) vs. fine-tuned embedding distances (right), for an MNLI model transferred from the telephone to fiction domain. The true model accuracy degradation is $87.9\% \rightarrow 84.1\%$ . Here, our decomposed drift metrics produce worse example rankings than the fine-tuned embedding distances (ROC AUC 0.532 vs. 0.702), but a much better dataset-level accuracy prediction (absolute error $0.9\%$ vs. $7.2\%$ ). We observe this pattern to hold across domains and datasets (Table 1). Still, our decomposed metrics outperform previous model-agnostic metrics by all evaluation criteria. + +![](images/937cd4ae2b0ffb4a4e56a7c4859aad3755bb5d7b02be050c55e9f9f86e185a38.jpg) + +However, because example-level token frequency distributions are quite sparse (Ruder et al., 2017), we also consider the cross-entropy between each example frequency distribution and each training frequency distribution (i.e. the loss of a unigram language model). The resulting token frequency cross-entropy is equivalent to our vocabulary drift metric, but using the RoBERTa tokenizer and without the restriction to content words. + +Embedding cosine distances. We compute embeddings for training and evaluation examples $x$ by taking the mean over all tokens in $x$ and the last two RoBERTa layers, either before or after task fine-tuning (i.e. pre-trained or fine-tuned; Elango et al., 2022). We note that the pre-trained RoBERTa model is still the same model that is fine-tuned for each task, potentially leading to overly optimistic results for the pre-trained embedding cosine distances; this caveat also holds for our semantic drift metric, which relies on pre-trained embeddings. For the embedding cosine distance drift metrics, we compute the mean cosine distance between the embedding for evaluation example $x$ and each example in the training dataset $D_{\mathrm{train}}$ (Nigenda et al., 2022). + +# 4.4 Predicting Model Performance + +For each drift metric (or set of drift metrics) and each model $\mathcal{M}$ trained on dataset $D_{\mathrm{train}}$ , we fit a logistic regression predicting whether $\mathcal{M}$ will get example $x$ correct (i.e. a "positive" example), based on the drift metric(s) between $x$ and $D_{\mathrm{train}}$ . The regression input is the considered drift metric(s) from $x$ to $D_{\mathrm{train}}$ , and the label is 1 if $\mathcal{M}$ predicts $x$ correctly, and 0 otherwise. We fit the logistic regression for all $x$ in the in-domain evaluation dataset, mimicking a scenario where labeled evaluation data is only available in the same domain as training. This allows us to test whether regressions fitted only to in-domain examples can extrapolate to out-of-domain examples. + +We evaluate the logistic regressions on both indomain and out-of-domain evaluation examples. Each regression produces a predicted probability of "positive" (getting an example correct) for each example. For dataset-level accuracy predictions, we compute the mean predicted "positive" probability over all examples in each evaluation dataset $D_{\mathrm{eval}}$ , equal to the expected value of model accuracy on $D_{\mathrm{eval}}$ based on the example-level probabilities. + +# 4.5 Evaluating Performance Predictions + +We use ROC curves to evaluate example-level performance predictions, both in-domain and out-of-domain, and we use root mean square errors (RMSEs) to evaluate out-of-domain dataset-level accuracy predictions. + +ROC AUC. For each logistic regression, predicting positive examples (correct model predictions) from a given drift metric and for a given model, we compute the area under the ROC curve for indomain and out-of-domain examples. An ROC curve plots recall (proportion of true positives identified) over the false positive rate for different probability thresholds. In our case, a higher ROC AUC indicates that the input drift metric can generally predict more true positives (examples the model gets correct) for a given false positive rate. However, ROC curves are dependent only on the rankings of examples by predicted positive probabilities (Tang et al., 2010); the raw probabilities of correct + +model predictions do not affect the ROC AUC as long as the example ranking is preserved. From this perspective, a higher ROC AUC indicates that evaluation examples are ranked roughly in order of expected performance; examples with higher predicted probabilities are more likely to be predicted correctly by the model. For each drift metric, we compute the mean ROC AUC over all trained models $\mathcal{M}$ , for in-domain and out-of-domain examples. + +RMSE. Because ROC AUCs depend only on the ranking of evaluation examples, they do not capture whether the predicted positive probabilities (probabilities of correct predictions) are actually reflective of model accuracies. For example, a given drift metric can achieve a high ROC AUC by ranking evaluation examples accurately, even if the mean probability (expected model accuracy) is far from the true model accuracy for $D_{\mathrm{eval}}$ (e.g. Figure 1). + +Thus, for each drift metric, we also compute the RMSE comparing expected model accuracy (mean positive probability over all examples in $D_{\mathrm{eval}}$ ) to actual model accuracy on $D_{\mathrm{eval}}$ . We compute RMSEs over all models $\mathcal{M}$ and their corresponding out-of-domain datasets $D_{\mathrm{eval}}$ . We report RMSEs as percentages of a baseline RMSE that predicts out-of-domain accuracy on $D_{\mathrm{eval}}$ to be the same as the in-domain evaluation accuracy (i.e. predicting no out-of-domain performance drop). Our reported RMSE percentages indicate the percentage of accuracy prediction error that remains when using a given drift metric, relative to the baseline. + +To summarize, we compute the predicted accuracy RMSE and the mean ROC AUC for each drift metric and for each task. ROC AUC measures how well a drift metric ranks the evaluation examples (examples with higher "positive" probabilities should be more likely to be predicted correctly by the model), while RMSE measures how well the drift metric predicts actual model accuracy (mean probabilities should be close to the true model accuracy). An ideal drift metric should have high ROC AUC and low RMSE. + +# 5 Results + +The mean accuracy change (±standard deviation; in raw accuracy percentage difference) from indomain to out-of-domain evaluation is $-1.04 \pm 1.02\%$ for sentiment classification across product categories, $-0.20 \pm 0.57\%$ for sentiment classification across years, and $-1.83 \pm 2.91\%$ for MNLI across source domains. Notably, in many cases, ac + +
Sentiment (categories)Sentiment (temporal)MNLI (source domains)
In-domainOut-of-domainIn-domainOut-of-domainIn-domainOut-of-domain
Drift metric(s)ROC AUC↑ROC AUC↑RMSE %↓ROC AUC↑ROC AUC↑RMSE %↓ROC AUC↑ROC AUC↑RMSE %↓
Baseline (no-performance drop)0.5000.500100.0%0.5000.500100.0%0.5000.500100.0%
Token frequency JS-div (Ramesh Kashyap et al., 2021; Ruder et al., 2017)0.5120.51798.4%0.5190.528106.2%0.4960.503118.8%
Token frequency cross-entropy0.5400.55171.4%0.5430.55797.3%0.5000.51296.8%
Cosine distance (pre-trained) (Ramesh Kashyap et al., 2021)0.5350.55893.6%0.5340.55991.8%0.4840.508107.5%
Combined prev. model-agnostic0.5510.55770.3%0.5540.562142.1%0.5200.51499.8%
Vocabulary drift0.5610.57051.8%0.5520.571105.8%0.4740.50081.5%
Structural drift0.5720.57591.4%0.5680.581146.1%0.5160.53180.6%
Semantic drift0.5860.59158.4%0.5650.586110.4%0.5160.52179.1%
Vocabulary, structural, semantic drift0.5970.60152.4%0.5780.59684.8%0.5250.53181.0%
+ +
Model-dependent: Cosine distance (fine-tuned) (Nigenda et al., 2022)0.8450.82281.9%0.8520.834236.7%0.6990.683141.9%
+ +Table 1: Mean ROC AUCs and RMSEs using different drift metrics to predict model performance, comparing our metrics (vocabulary, structural, and semantic drift) with previous metrics. ROC AUCs indicate the quality of example rankings by expected performance, and RMSEs (as percentages of the baseline error) indicate the quality of the actual accuracy predictions. Given in-domain accuracy $p$ , the baseline predicts out-of-domain accuracy $p$ and an equal probability $p$ of getting any individual example correct. All metrics are model-agnostic except the fine-tuned embedding cosine distances. + +curacy improves for out-of-domain evaluation (e.g. MNLI fiction $\rightarrow$ government). Results predicting out-of-domain evaluation accuracies (RMSEs) and example-level performance (ROC AUCs) from different drift metrics are reported in Table 1. + +# 5.1 Ranking Examples (ROC AUC) + +Mean ROC AUCs for different drift metrics are reported in Table 1, for both in-domain and out-of-domain evaluation examples. Recall that a higher ROC AUC indicates that higher scoring examples (as ranked by the logistic regression) are more likely to be predicted correctly by the model. + +Decomposing drift improves rankings. Using vocabulary, structural, and semantic drift as input features into the logistic regressions results in higher ROC AUCs than any of the previous model-agnostic drift metrics, for all three multidomain datasets and for both in-domain and out-of-domain examples (top section of Table 1). Across the three datasets, this decomposed drift improves ROC AUCs by an average of 0.039 for in-domain examples and 0.033 for out-of-domain examples when compared to the best model-agnostic drift + +metric from previous work. + +To ensure that this is not simply a result of including three different metrics in the regression, we also consider the combination of all three model-agnostic metrics from previous work ("combined previous model-agnostic" in Table 1: token frequency JS-divergence, token frequency crossentropy, and pre-trained embedding cosine distance). For all three datasets, the combination of previous metrics still results in worse ROC AUCs than the combination of vocabulary, structural, and semantic drift, for both in-domain and out-of-domain examples. This indicates that decomposing into vocabulary, structural, and semantic drift results in better rankings of individual examples by expected performance than previous model-agnostic drift metrics. + +Fine-tuned embeddings lead to the best rankings. However, fine-tuned (model-dependent) embedding cosine distances result in by far the best rankings of examples by expected performance (higher ROC AUCs). Indeed, this is the recommended drift metric when examples need to be ranked relative to one another or relative to some + +threshold (e.g. when there is some threshold drift value to flag examples; Elango et al., 2022; Nigenda et al., 2022); our results validate this approach. Notably, the fine-tuned embedding distances produce quality rankings even for out-of-domain examples, despite work suggesting that fine-tuning affects the in-domain representation space differently from the out-of-domain representation space in language models (Merchant et al., 2020). Our results indicate that despite these differences between the in-domain and out-of-domain fine-tuned spaces, the fine-tuned embedding distances can still be used to rank both in-domain and out-of-domain examples by expected performance. + +That said, fine-tuned embedding distances require access to the internal representations of a given model; model-agnostic metrics are still useful in cases where only model outputs can be observed, or when the same drift metric needs to apply to multiple models. For these use cases, our decomposed vocabulary, structural, and semantic drift metrics outperform previous model-agnostic metrics. Furthermore, as we observe in the next section, our decomposed drift metrics result in drastically better out-of-domain accuracy predictions than fine-tuned embedding distances, despite worse rankings of individual examples. + +# 5.2 Predicting Model Accuracy (RMSE) + +As described in Section 4.5 and shown in Figure 1, a given drift metric can produce quality rankings of examples even if the raw predicted accuracies are far from the true model accuracies. Thus, as reported in Table 1, we evaluate RMSEs using different drift metrics to predict model accuracies for out-of-domain evaluation datasets. $^7$ + +Decomposed drift has the best accuracy predictions. Decomposing into vocabulary, structural, and semantic drift results in better dataset-level accuracy predictions (lower RMSEs) than any previous drift metric(s), for all three multi-domain datasets. Accuracy predictions based on individual dimensions vary (e.g. individual dimensions are sometimes better than including all three dimensions), but predicting out-of-domain accuracy from all three dimensions results in reliably low errors compared to previous metrics. Across the three datasets, our decomposed drift results in an aver + +age decrease of $16.8\%$ in accuracy prediction error (RMSE) when compared to the best metric from previous work. + +Fine-tuned embedding distances have poor accuracy predictions. The fine-tuned embedding distances result in worse out-of-domain accuracy predictions (higher RMSEs) than our decomposed vocabulary, structural, and semantic drift for all three multi-domain datasets. Notably, they have by far the worst out-of-domain accuracy predictions of any drift metric for MNLI and sentiment classification split temporally. Across all three datasets, fine-tuned embedding distances result in an average of $2.03\mathrm{x}$ more error than our decomposed vocabulary, structural, and semantic drift. This contrasts with fine-tuned embedding distances' ability to rank individual examples by expected performance better than any other metric(s). This suggests that despite maintaining relative distances that are predictive of relative model performance for individual examples (high ROC AUCs), fine-tuning adjusts the example embeddings such that raw distances are not predictive of raw out-of-domain accuracies (high RMSEs). Concretely, the logistic regressions fit to fine-tuned embedding distances yield example-level probabilities that are highly predictive of relative model performance between out-of-domain examples, but quite far from the actual expected probabilities of getting each example correct. In practice, this suggests that fine-tuned embedding distances should be used in scenarios where the relative performance of evaluation examples is important (e.g. establishing drift threshold values), but they should not be used to predict actual out-of-domain model accuracies. + +# 6 Discussion + +We find that decomposing linguistic dataset drift into our proposed vocabulary, structural, and semantic drift metrics leads to improved out-of-domain dataset-level accuracy predictions for sentiment classification and NLI. Furthermore, our decomposed drift metrics produce better rankings of individual examples by expected performance than previous model-agnostic drift metrics (e.g. token frequency divergences and pre-trained embedding distances), both in-domain and out-of-domain. Although fine-tuned embedding distances produce by far the best example rankings, they also produce egregiously incorrect out-of-domain model accuracy predictions. Our results suggest that fine-tuned + +embedding distances should still be used in cases where examples need to be ranked by expected performance (e.g. relative to a cutoff value, as in Elango et al., 2022). Vocabulary, structural, and semantic drift should be used in cases where either (1) the internal states of a model are unavailable, which is increasingly common as models are accessed through external APIs, (2) the same metric values need to be applied across multiple models (i.e. model-agnostic metrics), or (3) raw model accuracy predictions are desired. + +Our work also opens up future directions of research studying specific effects of linguistic dataset drift on NLP model performance. First, future work might assess whether there are systematic effects of particular drift dimensions on specific tasks or model architectures. Second, it might consider new types of linguistic drift, potentially extending beyond domain drift (drift in $P(x)$ ) to consider concept drift $P(y|x)$ in NLP (Webb et al., 2016). Finally, future work might investigate methods of quantifying drift in natural language generation, where the outputs $y$ are linguistic data. Our work lays the groundwork for these future investigations. + +# 7 Conclusion + +We propose three dimensions of linguistic dataset drift—vocabulary, structural, and semantic drift—and we modify previous performance prediction methods to predict NLP model performance at the individual example level along with the dataset level. We validate existing drift metrics for particular use cases (e.g. fine-tuned embedding distances for example ranking), and we highlight complementary use cases where our decomposed drift metrics outperform previous metrics (e.g. when predicting model accuracies or when using model-agnostic metrics). Our work lays the foundation for future research into specific and interpretable dimensions of linguistic dataset drift, improving our ability to predict NLP model performance on real world data. + +# Limitations + +Our work has several limitations. First, our experiments are limited by the multi-domain datasets available for sequence classification tasks, limiting both our task coverage (sentiment classification and NLI) and domain type coverage (product categories, temporal splits, and text source domains). Future work can evaluate our drift metrics on token classification tasks or even sequence-to-sequence + +tasks by predicting sequence-level performance (e.g. proportions of correct tokens, or example-level BLEU scores; Papineni et al., 2002) from our example-level drift metrics. Past work has already considered dataset-level drift metrics and performance predictions for token classification tasks such as named entity recognition (NER) and part-of-speech (POS) tagging (Ramesh Kashyap et al., 2021; Rijhwani and Preotiuc-Pietro, 2020), and example-level drift metrics have been used in machine translation for training data example selection (Axelrod et al., 2011; Wang et al., 2017). We hope that future work will evaluate example-level drift metrics in their ability to predict NLP model performance on this wider variety of tasks. + +Second, we only consider simple logistic regressions to predict whether individual examples will be predicted correctly by different models. More complex classifiers (e.g. XGBoost; Chen and Guestrin, 2016) might improve performance predictions, particularly if more drift metrics are included as inputs, or if raw example features are included (e.g. sequence length; Ye et al., 2021). Our three dimensions of linguistic drift (vocabulary, structural, and semantic drift) represent just one way of decomposing linguistic dataset drift into distinct dimensions. We hope that future work will explore novel dimensions of linguistic drift, identifying new ways of integrating different drift metrics into NLP model performance predictions across tasks and domains. + +# References + +Oshin Agarwal and Ani Nenkova. 2022. Temporal effects on pre-trained models for language processing tasks. Transactions of the Association for Computational Linguistics (TACL). +Amazon. 2017. Amazon customer reviews dataset. +Amittai Axelrod, Xiaodong He, and Jianfeng Gao. 2011. Domain adaptation via pseudo in-domain data selection. In Proceedings of the 2011 Conference on Empirical Methods in Natural Language Processing, pages 355-362, Edinburgh, Scotland, UK. Association for Computational Linguistics. +Amittai Axelrod, Yogarshi Vyas, Marianna Martindale, and Marine Carpuat. 2015. Class-based n-gram language difference models for data selection. In Proceedings of the 12th International Workshop on Spoken Language Translation: Papers, pages 180–187, Da Nang, Vietnam. +Alan Bell, Jason M. Brenier, Michelle Gregory, Cynthia Girand, and Dan Jurafsky. 2009. Predictability + +effects on durations of content and function words in conversational English. Journal of Memory and Language, 60(1):92-111. +John Blitzer, Mark Dredze, and Fernando Pereira. 2007. Biographies, Bollywood, boom-boxes and blenders: Domain adaptation for sentiment classification. In Proceedings of the 45th Annual Meeting of the Association of Computational Linguistics, pages 440-447, Prague, Czech Republic. Association for Computational Linguistics. +Reihane Boghrati, Joe Hoover, Kate M. Johnson, Justin Garten, and Morteza Dehghani. 2018. Conversation level syntax similarity metric. Behavior Research Methods, 50:1055-1073. +Eleftheria Briakou and Marine Carpuat. 2020. Detecting Fine-Grained Cross-Linguial Semantic Divergences without Supervision by Learning to Rank. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1563–1580, Online. Association for Computational Linguistics. +Samuel Broscheit, Quynh Do, and Judith Gaspers. 2022. Distributionally robust finetuning BERT for covariate drift in spoken language understanding. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1970-1985, Dublin, Ireland. Association for Computational Linguistics. +Jesper Bäck. 2019. Domain similarity metrics for predicting transfer learning performance. Linköping University, Department of Computer and Information Science, Master's Thesis. +Tianqi Chen and Carlos Guestrin. 2016. XGBoost: A scalable tree boosting system. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, page 785-794. Association for Computing Machinery. +Shachi Dave, Jignashu Parikh, and Pushpak Bhattacharyya. 2004. Interlingua-based English-Hindi machine translation and language divergence. Machine Translation, 16:251-304. +Dun Deng and Nianwen Xue. 2017. Translation divergences in Chinese-English machine translation: An empirical investigation. Computational Linguistics, 43(3):521-565. +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. + +Quynh Ngoc Thi Do, Judith Gaspers, Daniil Sorokin, and Patrick Lehnen. 2021. Predicting temporal performance drop of deployed production spoken language understanding models. In *Interspeech* 2021. +Bonnie Dorr. 1990. Solving thematic divergences in machine translation. In 28th Annual Meeting of the Association for Computational Linguistics, pages 127-134, Pittsburgh, Pennsylvania, USA. Association for Computational Linguistics. +Mark Dredze, Tim Oates, and Christine Piatko. 2010. We're not in Kansas anymore: Detecting domain changes in streams. In Proceedings of the 2010 Conference on Empirical Methods in Natural Language Processing, pages 585-595, Cambridge, MA. Association for Computational Linguistics. +Vikram Elango, Tony Chen, and Raghu Ramesha. 2022. Detect NLP data drift using custom Amazon SageMaker Model Monitor. AWS Machine Learning Blog. Accessed: 2022-09-01. +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. +Robert Feldhans, Adrian Wilke, Stefan Heindorf, Mohammad Hossein Shaker, Barbara Hammer, Axel-Cyrille Ngonga Ngomo, and Eyke Hüllermeier. 2021. Drift detection in text data with document embeddings. In Intelligent Data Engineering and Automated Learning, pages 107-118. Springer International Publishing. +Mario Giulianielli, Marco Del Tredici, and Raquel Fernandez. 2020. Analysing lexical semantic change with contextualised word representations. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 3960-3973, Online. Association for Computational Linguistics. +Kristina Gulordava and Marco Baroni. 2011. A distributional similarity approach to the detection of semantic change in the Google Books ngram corpus. In Proceedings of the GEMS 2011 Workshop on GEometrical Models of Natural Language Semantics, pages 67-71, Edinburgh, UK. Association for Computational Linguistics. +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. + +Matthew Honnibal, Ines Montani, Sofie Van Landeghem, and Adriane Boyd. 2017. spaCy: Industrial-strength natural language processing in Python. +Ziniu Hu, Ting Chen, Kai-Wei Chang, and Yizhou Sun. 2019. Few-shot representation learning for out-of-vocabulary words. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4102–4112, Florence, Italy. 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, pages 5637-5664. +Vivek Kulkarni, Rami Al-Rfou, Bryan Perozzi, and Steven Skiena. 2015. Statistically significant detection of linguistic change. In Proceedings of the 24th International Conference on World Wide Web, pages 625-635. +Severin Laicher, Sinan Kurtyigit, Dominik Schlechtweg, Jonas Kuhn, and Sabine Schulte im Walde. 2021. Explaining and improving BERT performance on lexical semantic change detection. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Student Research Workshop, pages 192-202, Online. Association for Computational Linguistics. +Qi Liu, Matt J. Kusner, and Phil Blunsom. 2020. A survey on contextual embeddings. arXiv, abs/2003.07278. +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. +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. +Kanishka Misra, Allyson Ettinger, and Julia Rayz. 2020. Exploring BERT's sensitivity to lexical cues using tests from semantic priming. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 4625-4635, Online. Association for Computational Linguistics. +John Nerbonne and Wybo Wiersma. 2006. A measure of aggregate syntactic distance. In Proceedings of the Workshop on Linguistic Distances, pages 82-90, + +Sydney, Australia. Association for Computational Linguistics. +David Nigeria, Zohar Karnin, Bilal Zafar, Raghu Ramesha, Alan Tan, Michele Donini, and Krishnamaram Kenthapadi. 2022. Amazon SageMaker Model Monitor: A system for real-time insights into deployed machine learning models. In Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining. +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. +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. +Abhinav Ramesh Kashyap, Devamanyu Hazarika, MinYen Kan, and Roger Zimmermann. 2021. Domain divergences: A survey and empirical analysis. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 1830-1849, Online. Association for Computational Linguistics. +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. +Sebastian Ruder, Parsa Ghaffari, and John G. Breslin. 2017. Data selection strategies for multi-domain sentiment analysis. arXiv, abs/1702.02426. +Abdus Saboor and Mohammad Abid Khan. 2010. Lexical-semantic divergence in Urdu-to-English example based machine translation. 6th International Conference on Emerging Technologies (ICET), pages 316-320. +Eyal Sagi, Stefan Kaufmann, and Brady Clark. 2009. Semantic density analysis: Comparing word meaning across time and phonetic space. In Proceedings of the Workshop on Geometrical Models of Natural Language Semantics, pages 104-111, Athens, Greece. Association for Computational Linguistics. +Ryoma Sato, Makoto Yamada, and Hisashi Kashima. 2022. Re-evaluating word mover's distance. In Proceedings of the 39th International Conference on Machine Learning. + +Sidney J. Segalowitz and Korri C. Lane. 2000. Lexical access of function versus content words. *Brain and Language*, 75(3):376-389. + +Xiaofei Sun, Yuxian Meng, Xiang Ao, Fei Wu, Tianwei Zhang, Jiwei Li, and Chun Fan. 2022. Sentence similarity based on contexts. Transactions of the Association for Computational Linguistics, 10:573-588. + +Zoltán Gendler Szabó. 2022. Compositionality. In Edward N. Zalta and Uri Nodelman, editors, The Stanford Encyclopedia of Philosophy, Fall 2022 edition. Metaphysics Research Lab, Stanford University. + +Nina Tahmasebi, Lars Borin, and Adam Jatowt. 2021. Survey of computational approaches to lexical semantic change detection. In Computational Approaches to Semantic Change, pages 1-91. Language Science Press. + +Liansheng Tang, Pang Du, and Chengqing Wu. 2010. Compare diagnostic tests using transformation-invariant smoothed ROC curves. Journal of Statistical Planning and Inference, 140(11):3540-3551. + +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. + +Rui Wang, Masao Utiyama, Lemao Liu, Kehai Chen, and Eiichiro Sumita. 2017. Instance weighting for neural machine translation domain adaptation. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 1482-1488, Copenhagen, Denmark. Association for Computational Linguistics. + +Geoffrey I. Webb, Roy Hyde, Hong Cao, Hai Long Nguyen, and Francois Petitjean. 2016. Characterizing concept drift. Data Mining and Knowledge Discovery, 30(4):964-994. + +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. + +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. + +Ivan P. Yamshchikov, Viacheslav Shibaev, Nikolay Khlebnikov, and Alexey Tikhonov. 2021. Styletransfer and paraphrase: Looking for a sensible semantic similarity metric. Proceedings of the AAAI Conference on Artificial Intelligence, 35(16):14213-14220. +Zihuiwen Ye, Pengfei Liu, Jinlan Fu, and Graham Neubig. 2021. Towards more fine-grained and reliable NLP performance prediction. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 3703-3714, Online. Association for Computational Linguistics. + +# A Appendix + +
HyperparameterValue
Learning rate decayLinear
Warmup steps10% of total
Learning rate2e-5
Adam ε1e-6
Adam β10.9
Adam β20.999
Attention dropout0.1
Dropout0.1
Weight decay0.0
Batch size32
Train steps4 epochs
+ +Table 2: Sentiment classification and NLI fine-tuning hyperparameters for the RoBERTa-base models in Section 4.2. + +# A.1 Model fine-tuning details + +For each sentiment classification and NLI training domain in Section 4, we fine-tune a RoBERTa base-size model using the hyperparameters in Table 2 and the pre-trained RoBERTa model from Hugging Face, containing approximately 123M parameters (Liu et al., 2019; Wolf et al., 2020). Because there are only five training domains for MNLI, we run five fine-tuning runs per MNLI training domain; otherwise, we run one fine-tuning run per domain (43 domains for sentiment classification split by product category, 15 domains for sentiment classification split by review year). All models are fine-tuned using one Tesla V100 GPU, taking about two hours per model. + +# A.2 Efficient cosine distance computations + +In Section 4.3, we compute the mean cosine distance between each evaluation example embedding $\pmb{x}$ and all training example embeddings from $D_{\mathrm{train}}$ . Each example embedding is computed by taking the mean over all tokens in the example and the last two RoBERTa layers (before or after fine-tuning, as specified; Elango et al., 2022). Mean embedding cosine distances are also computed for individual tokens when quantifying lexical semantic change in Section 3.3. To avoid saving the embedding for each example in $D_{\mathrm{train}}$ and computing each cosine distance individually, we note that the mean pairwise cosine similarity between a set of vectors $U$ and $V$ is: + +$$ +\begin{array}{l} \underset {u \in U, v \in V} {\text {M e a n}} (\cos (u, v)) = \frac {1}{| U | | V |} \sum_ {u \in U, v \in V} \frac {\langle u , v \rangle}{| | u | | \cdot | | v | |} \\ = \frac {1}{| U | | V |} \sum_ {u \in U} \sum_ {v \in V} \left\langle \frac {u}{| | u | |}, \frac {v}{| | v | |} \right\rangle \\ = \frac {1}{| U | | V |} \sum_ {u \in U} \left\langle \frac {u}{| | u | |}, \sum_ {v \in V} \frac {v}{| | v | |} \right\rangle \\ = \frac {1}{| U | | V |} \left\langle \sum_ {u \in U} \frac {u}{| | u | |}, \sum_ {v \in V} \frac {v}{| | v | |} \right\rangle \\ = \left\langle \frac {1}{| U |} \sum_ {u \in U} \frac {u}{| | u | |}, \frac {1}{| V |} \sum_ {v \in V} \frac {v}{| | v | |} \right\rangle \\ = \left\langle \operatorname {M e a n} _ {u \in U} \left(\frac {u}{| | u | |}\right), \operatorname {M e a n} _ {v \in V} \left(\frac {v}{| | v | |}\right) \right\rangle \\ \end{array} +$$ + +In other words, we only need to compute the dot product between the mean normed vector for $U$ and $V$ . For our uses, when computing the mean cosine distance between an example embedding $x$ and all training example embeddings from $D_{\mathrm{train}}$ , we need only compute one minus the dot product between the normed $x$ and the mean normed embedding over all examples in $D_{\mathrm{train}}$ . This way, we only need to store one vector (the mean normed embedding) for the entire training set, rather than one vector per training example. + +# A For every submission: + +A1. Did you describe the limitations of your work? + +Limitations section (unnumbered). + +A2. Did you discuss any potential risks of your work? + +Our work analyzes existing models (RoBERTa) on existing datasets, predicting their performance for out-of-domain data. Rather than introducing new models and risks, we hope that these results can be used to reduce the potential risks of applying existing models in cases where they might perform poorly. + +A3. Do the abstract and introduction summarize the paper's main claims? + +Abstract and section 1 (Introduction). + +A4. Have you used AI writing assistants when working on this paper? + +Left blank. + +# B Did you use or create scientific artifacts? + +Datasets and models in Section 4 (Experiments): Amazon Reviews dataset, MNLI dataset, and Hugging Face RoBERTa model. + +B1. Did you cite the creators of artifacts you used? + +Section 4 (Experiments). + +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? + +The datasets and models used are publicly available with citation. + +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +Section 4 (Experiments). + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? + +The datasets used are standard datasets, used as provided in their publicly available form. + +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? + +Section 4 (Experiments). More details can be found in the cited work corresponding to each dataset used. + +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. + +Section 4 (Experiments). + +The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance. + +# C Did you run computational experiments? + +Section 4 (Experiments). + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +Section 4 (Experiments), Appendix A.1 (Model fine-tuning details). + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +Not applicable. No hyperparameter search was used. RoBERTa hyperparameters are included in Appendix A.1 (Model fine-tuning details). + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +Section 4 (Experiments), Section 5 (Results), Appendix A.1 (Model fine-tuning details). + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +Section 4 (Experiments), Appendix A.1 (Model fine-tuning details). Used spaCy and the Hugging Face library. + +# D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +Not applicable. Left blank. + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +Not applicable. Left blank. + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +Not applicable. Left blank. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +Not applicable. Left blank. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +Not applicable. Left blank. \ No newline at end of file diff --git a/characterizingandmeasuringlinguisticdatasetdrift/images.zip b/characterizingandmeasuringlinguisticdatasetdrift/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d6c7f35cdf21f973b993036945516baaca5e6c74 --- /dev/null +++ b/characterizingandmeasuringlinguisticdatasetdrift/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:16b9a6037c7419931d61ec60718e4d403e8980c76cafb317df6b26ec3a00fa13 +size 244203 diff --git a/characterizingandmeasuringlinguisticdatasetdrift/layout.json b/characterizingandmeasuringlinguisticdatasetdrift/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..6c5a4b13c2a9e1d4215d2a3db78bd59761a83f47 --- /dev/null +++ b/characterizingandmeasuringlinguisticdatasetdrift/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:969fc24c2f13158a2309da4b74879e92626a6e2a2de487ea657f766762cd2fb2 +size 454062 diff --git a/chbiasbiasevaluationandmitigationofchineseconversationallanguagemodels/783ed100-47bf-4a43-a8f0-a53d7aca5f9f_content_list.json b/chbiasbiasevaluationandmitigationofchineseconversationallanguagemodels/783ed100-47bf-4a43-a8f0-a53d7aca5f9f_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..9d63ff14f0b92efdab5840c24105484ac8cbaec3 --- /dev/null +++ b/chbiasbiasevaluationandmitigationofchineseconversationallanguagemodels/783ed100-47bf-4a43-a8f0-a53d7aca5f9f_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1aa89f9408732443241a224e0fbb52097c330cd5982b5f5d0a7ce983ea248aa1 +size 127041 diff --git a/chbiasbiasevaluationandmitigationofchineseconversationallanguagemodels/783ed100-47bf-4a43-a8f0-a53d7aca5f9f_model.json b/chbiasbiasevaluationandmitigationofchineseconversationallanguagemodels/783ed100-47bf-4a43-a8f0-a53d7aca5f9f_model.json new file mode 100644 index 0000000000000000000000000000000000000000..e61a908004ddd873034e75b23ad9d9bae0a577e7 --- /dev/null +++ b/chbiasbiasevaluationandmitigationofchineseconversationallanguagemodels/783ed100-47bf-4a43-a8f0-a53d7aca5f9f_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e3b1065559e225a47aa7ada0ce947544cb32b794f68ad6f5fb17e00a110e6a0e +size 156835 diff --git a/chbiasbiasevaluationandmitigationofchineseconversationallanguagemodels/783ed100-47bf-4a43-a8f0-a53d7aca5f9f_origin.pdf b/chbiasbiasevaluationandmitigationofchineseconversationallanguagemodels/783ed100-47bf-4a43-a8f0-a53d7aca5f9f_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1d68ceb1f34cb5b7caeb88855aae90a1842e2e13 --- /dev/null +++ b/chbiasbiasevaluationandmitigationofchineseconversationallanguagemodels/783ed100-47bf-4a43-a8f0-a53d7aca5f9f_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:93ca2f8e65888229ebd83d9577954dbbcd972e77c68e8af40a1d6511c5db067c +size 1045612 diff --git a/chbiasbiasevaluationandmitigationofchineseconversationallanguagemodels/full.md b/chbiasbiasevaluationandmitigationofchineseconversationallanguagemodels/full.md new file mode 100644 index 0000000000000000000000000000000000000000..a1113b5df6fc3a539ce755ae986dc0fd6d60616c --- /dev/null +++ b/chbiasbiasevaluationandmitigationofchineseconversationallanguagemodels/full.md @@ -0,0 +1,543 @@ +# CHBias: Bias Evaluation and Mitigation of Chinese Conversational Language Models + +Jiaxu Zhao $^{1}$ , Meng Fang $^{2,1}$ , Zijing Shi $^{3}$ , Yitong Li, Ling Chen $^{3}$ , Mykola Pechenizkiy $^{1}$ + +$^{1}$ Eindhoven University of Technology, Eindhoven, the Netherlands + +$^{2}$ University of Liverpool, Liverpool, the United Kingdom + +$^{3}$ AAII, University of Technology Sydney, NSW, Australia + +j.zhao@tue.nl,Meng.Fang@liverpool.ac.uk + +Zijing. Shi@student.uts.edu.au, Ling.Chen@uts.edu.au m.pechenizkiy@tue.nl + +# Abstract + +Warning: This paper contains content that may be offensive or upsetting. + +Pretrained conversational agents have been exposed to safety issues, exhibiting a range of stereotypical human biases such as gender bias. However, there are still limited bias categories in current research, and most of them only focus on English. In this paper, we introduce a new Chinese dataset, CHBias, for bias evaluation and mitigation of Chinese conversational language models. Apart from those previous well-explored bias categories, CHBias includes under-explored bias categories, such as ageism and appearance biases, which received less attention. We evaluate two popular pretrained Chinese conversational models, CDial-GPT and EVA2.0, using CHBias. Furthermore, to mitigate different biases, we apply several debi-aising methods to the Chinese pretrained models. Experimental results show that these Chinese pretrained models are potentially risky for generating texts that contain social biases, and debiasing methods using the proposed dataset can make response generation less biased while preserving the models' conversational capabilities. + +# 1 Introduction + +The success of the pretrained dialogue models benefits from the increasing quantity and quality of real corpora (Gu et al., 2022; Zhang et al., 2020; Radford et al., 2018; Bao et al., 2020). However, deep neural models can inadvertently learn undesired features in the corpora, such as social biases. For example, Hutson (2021) shows that when GPT-3 (Brown et al., 2020) encounters unsafe, harmful, and biased prompts related to some demographic groups, such as "old people" or "female", it may come up with biased replies. Therefore, further progress is required on responsible and safe AI before applying these large language models in + +the real world (Bommasani et al., 2021; Shi et al., 2023). + +Addressing social biases in language generation models is still very challenging. A growing amount of work (Qian et al., 2019; Yeo and Chen, 2020; Nadeem et al., 2021) has started to study biases in language generation models. However, most of them (Sheng et al., 2019; Nadeem et al., 2021) either study one or two bias categories (e.g., gender bias and racial bias) or build artificial data for mitigating biases. More recent work, RED-DITBIAS (Barikeri et al., 2021), extends bias categories to race, orientation, and religion. However, there are still other bias categories that are underexplored, for example, appearance bias and age bias. It is necessary to see whether the pretrained models are suffering from other new biases. Moreover, existing works (Barikeri et al., 2021; Dinan et al., 2020; Liu et al., 2020b) only focus on English dialogue models. However, the forms and demographic groups of bias may vary across languages due to differences in syntax, semantics, and cultural backgrounds. Therefore, it is necessary to study the bias of non-English pretrained models. + +To better understand more bias categories for Chinese in pretrained dialogue models, we introduce a new dataset named CHBias, which is a Chinese corpus for social bias evaluation and mitigation of Chinese conversational models. CHBias is based on data from Weibo1 and manually annotated for multiple social bias categories. It contains four social bias categories, including gender, orientation, age, and appearance, among which age and appearance are new categories provided by our CHBias. Based on the proposed CHBias, we evaluate two state-of-the-art popular Chinese pretrained dialogue models, CDial-GPT (Wang et al., 2020) and EVA2.0 (Gu et al., 2022). We show that responses generated by these Chinese pretrained dialogue models suffer from different social biases. + +Furthermore, to mitigate these biases in responses, we apply several mitigation methods to these dialogue models, including regularization-based debiasing methods and data augmentation-based methods using our CHBias. We find that the debiasing methods can effectively reduce biases while maintaining the models' performance on dialogue tasks. + +Our main contributions include: + +- We build a new Chinese dataset, CHBias, for evaluating and mitigating biases in Chinese conversational models, which includes under-explored biases in the existing works, such as age and appearance. +- We evaluate the bias of two popular Chinese pretrained dialogue models based on our CHBias, and find that both models are at risk of generating responses with social biases. +- We apply debiasing methods to the Chinese conversational models and find these methods can effectively reduce biases while maintaining the models' conversational capabilities. To the best of our knowledge, this is the first study to apply debiasing methods to Chinese pretrained models. + +# 2 Related Work + +Pretraind Models Pretrained models (BERT (Devlin et al., 2018), GPT (Radford et al., 2018), GPT-2 (Radford et al., 2019)) achieves great success on various language generation tasks. These pretrained models can be easily fine-tuned to be applied in different dialogue scenarios. DialogGPT (Zhang et al., 2020) proposes a large-scale, tunable dialogue response generation model, which trains GPT-2 on 147M Reddit $^2$ conversations. Many previous works are mainly focused on English, but there also are some works (Wang et al., 2020; Gu et al., 2022) that proposed pretrained dialogue generation model for Chinese. CDial-GPT (Wang et al., 2020) pretrained the Chinese dialogue generation model on a Chinese novel dataset, and they constructed the LCCC dataset. EVA2.0 (Gu et al., 2022) is a Chinese open-domain dialogue system based on large-scale pretraining. To ensure data quality and diversity, the training data are derived from the filtered WDC-Dialogues (Zhou et al., 2021) dataset as well as publicly available datasets (Lison and Tiedemann, 2016; Guan et al., + +2021; Wu et al., 2019; Zhou et al., 2020a; Liu et al., 2020c; Wang et al., 2021) from different domains. In this paper, we focus on bias in dialogue models, specifically in Chinese models, which are rarely studied at present. + +Bias Datasets Since the real-world conversation data contains some biases, the models trained based on these data learn undesired features. More and more researchers (Barikeri et al., 2021; Sheng et al., 2021) are working to reduce the biases of pretrained models. Zhao et al. propose a corpus WinoBias, which contains pairs of gender-balanced co-reference data. Urbanek et al. propose LIGHT, which contains a large number of gender-balanced statements for dialog. Liu et al. construct a dataset to research gender bias and racial bias in the dialogue models. Barikeri et al. construct the RED-DITBIAS, consisting of real human conversations from Reddit. Zhou et al. identify some biases in dialogue systems. However, they do not consider mitigating biases in Chinese dialogue systems. + +Bias Evaluation and Mitigation Liu et al. (2020a) introduce some metrics to evaluate the bias in the dialogue models, such as diversity, politeness, sentiment, and attribute words. Lee et al. leveraging whether the conversation model agreed with the stereotypical content to study the bias of chatbots. Dinan et al. (2020) propose new techniques to mitigate gender bias by balancing the genderedness of generated dialogue utterances. Qian et al. force the language model to generate two demographic group terms with similar probabilities to debias. Lauscher et al. (2020) propose the DebiasNet, debiasing at the word embedding level. There are also some debiasing methods that focus on the data level, such as counterfactual data augmentation in Zhao et al. (2018). Barikeri et al. apply various bias mitigation methods to debiasing the dialogue model. However, there is no Chinese dataset for both bias evaluation and mitigation. Our work provides a benchmark for these problems. + +# 3 CHBias Dataset + +We outline the process of creating CHBias, which includes five steps: (1) defining bias specifications for various bias categories; (2) collecting data from social media; (3) cleaning the collected data; (4) annotating sentences that exhibit bias; (5) splitting the labeled data into a training set, a validation set, and a test set. We have released all the data as + +
bias categoriesT1T2A1A2
Gender (Translation)妈妈,姐姐,... mother, older sister,...爸爸,哥哥,... father, older brother,...护士,感性... nurse, emotional...医生,理性... doctor, rational...
Orientation同性恋,基佬... homosexual, gay ...异性恋,直男,... heterosexual, straight man,...肮脏,下流,讨厌... filth, vulgar, dislike ...干净,高尚,喜欢... clean, noble, like ...
Age老人,大妈... old people, old woman ...年轻人,小姑娘... young people, young woman ...固执,恶心... stubborn, disgusting ...随和,舒心... easygoing, comfort ...
Appearance胖子,矮子,... fatty, shorty,...瘦子,高个,... thin person, taller,...丑,恶心... ugly, disgusting...美,舒心... beautiful, comfort...
+ +Table 1: Examples of the defined Bias Specification for four bias categories. + +
Key.RetrievalTrain/Dev/TestTotal
Gender26126,100800/200/2001,200
Orient7515,000800/200/2001,200
Age5611,200800/200/2001,200
Appear12612,600800/200/2001,200
+ +Table 2: Statistics of the proposed CHBias dataset with four bias categories and retrieved sentences using predefined keywords(key.). + +open-source.3 + +# 3.1 Bias Specification + +We consider four bias categories: gender, orientation, age, and appearance. Following (Caliskan et al., 2017; Lauscher et al., 2020), which define the explicit bias specifications in English, we utilize the bias specifications to define four bias categories in Chinese formally. We define a Chinese Bias Specification with a quadruple $B_{C} = (T_{1}, T_{2}, A_{1}, A_{2})$ for each bias category. Index 1 and index 2 denote two demographic groups respectively. For example, in the gender bias category, index 1 denotes Female and index 2 denotes Male. $T_{1} = \{t_{1}^{1}, t_{1}^{2}, t_{1}^{3}, \ldots, t_{1}^{n}\}$ and $T_{2} = \{t_{2}^{1}, t_{2}^{2}, t_{2}^{3}, \ldots, t_{2}^{n}\}$ consist of target terms of the two demographic groups respectively. For example, the target terms for Female can be $T_{1} = \{\text{妈妈,姐姐,} \ldots\}^{4}$ and the target terms for Male can be $T_{2} = \{\text{爸爸,哥哥,} \ldots\}^{5}$ . $A_{1}$ and $A_{2}$ are two sets of attribute items for the two demographic groups $T_{1}$ and $T_{2}$ respectively. $A_{1} = \{a_{1}^{1}, a_{1}^{2}, a_{1}^{3}, \ldots, a_{1}^{i}\}$ is a set of terms commonly associated with $T_{1}$ , which are typically negative stereotype terms. And $A_{2} = \{a_{2}^{1}, a_{2}^{2}, a_{2}^{3}, \ldots, a_{2}^{j}\}$ is a set of terms commonly associated with $T_{2}$ , which are typically positive stereotype terms. For example, in the gender bias category, $A_{1} = \{\text{护士,感性} \ldots\}^{6}$ and $A_{2} = \{\text{医生,理性,} \ldots\}^{7}$ . $A_{1}$ and $A_{2}$ reflect the inequity be + +tween $T_{1}$ and $T_{2}$ . Table 1 shows the partial terms we defined for the Chinese Bias Specifications. + +To obtain target and attribute terms to cover more biases in texts, we collect target and attribute terms according to many previous NLP works on social biases (Nangia et al., 2020; Flekova et al., 2016; Barikeri et al., 2021), as well as sociology literature (Greenwald et al., 1998; Rhode, 2010; Krekula, 2007). The complete Chinese explicit bias specifications we defined are shown in Appendix A. + +# 3.2 Data Collection + +We collect data from a popular Chinese social media platform called Weibo, which is one of the largest social media platforms in China. On Weibo, users can post and respond to comments, some of which may be biased against certain demographic groups. We retrieve Weibo posts based on target terms and attribute terms. Collecting data from social media ensures that the biases in the data are real and allows us to find more sentences that contain biases. Examples of our data can be found in Table 7. Our data collection spans from May 10, 2020, to May 10, 2022. + +To collect biased sentences, our data collection has two steps. First, following (Barikeri et al., 2021), we combine the target terms in $T_{1}$ with each stereotypical attribute term in $A_{1}$ separately as keywords. Because all the terms in $A_{1}$ are descriptions of negative stereotypes of $T_{1}$ , the sentences retrieved based on these keywords are likely to contain biases. Second, we retrieve candidate sentences from Weibo based on the keywords obtained above. We set different maximum retrieval volumes for different bias categories because the number of keywords varies greatly between categories. For gender bias, orientation bias, age bias, and appearance bias, we collect 100, 200, 200, and 100 posts for each keyword, respectively. For each bias category, we collect at least 10,000 posts. Detailed statistical information can be found in Table 2. + +# 3.3 Data Cleaning + +We perform data cleaning on the collected posts, including (1) removing information not related to the post contents, such as user information, creation time, and device that the user is using, etc.; (2) splitting the long post into smaller sentences of no more than 130 words and retaining only those that contain keywords; (3) removing URLs from the posts; (4) removing emojis and other platform-related tags (such as "@***"); (5) removing redundant consecutive repetitive punctuation, such as extra spaces, commas, and exclamation points; (6) removing duplicate sentences. These cleaning steps are designed to ensure that the collected data is relevant and accurate for our bias evaluation and mitigation tasks. + +# 3.4 Bias Annotation + +It's difficult and risky to rely on existing models and tools to automatically label content as biased or not, as not all sentences that contain both target and negative attribute terms are necessarily biased against the corresponding target group. Thus, we manually label the retrieved posts to determine whether they are biased. We provide annotators with bias categories and keywords (target and attribute terms) to use as guidelines for labeling. The detailed file format for the annotator to use is provided in Appendix B. + +We recruited three graduated students from different backgrounds as annotators for our study. These annotators are native speakers of Chinese and gender diverse without a background in natural language processing. The task assigned to the annotators was to identify instances of bias against specific demographic groups in a set of posts. We divided the data annotation process into two steps. In the first step, the annotators performed a binary classification task to annotate whether a sentence was biased or not. In the second step, we removed any sentences that were inconsistently annotated by the three annotators, only keeping those with the same annotation results. Finally, we build a dataset, named CHBias, including 1,200 bias examples for each bias category, for a total of 4,800 biased examples. Table 7 shows some biased posts from our dataset and their corresponding target and attribute terms. + +# 3.5 Data Split + +To facilitate training models and evaluate bias, we split the labeled data. There are two main steps: (1) splitting the data into the training set, validation set, and test set; (2) performing "target swapping" on the validation set and test set. + +For each bias category, we divide the biased dataset into training, validation, and testing portions. We use the training and validation sets for bias mitigation and parameter selection, respectively. + +Following the approach of "gender swapping" in previous studies (Zhao et al., 2018; Park et al., 2018), we implement "target swapping" for the validation and test sets to create new sets for the second target demographic group. It involves replacing the target terms (e.g., "姐姐" ("older sister")) in the posts and replacing them with the corresponding target terms of the second demographic group (e.g., "哥哥" ("older brother"). Thus, the contents of the validation and test sets for both demographic groups are the same except for the target terms. + +# 4 Bias Evaluation + +We evaluate the bias of conversational models based on the following assumption: biased models tend to generate positive stereotype responses for one demographic group and negative stereotype responses for another demographic group. In the validation and test sets, there are biased examples from two demographic groups. Their texts are the same except for the target terms. We compare the performance differences of the model across demographic groups to evaluate bias. + +We use the Student's two-tailed test to calculate the difference between the perplexity distributions from a model for two demographic groups. First, we apply the pretrained model to the test data (two demographic groups) and calculate the perplexity scores (Barikeri et al., 2021) for each demographic group. Then we compare the distributions of perplexity to quantify the difference in model performance between the two groups. Specifically, we use the "t-value" of the Student's two-tailed test to compare the perplexity distributions among different demographic groups. The difference in perplexity distributions is used to quantify the bias of the model. Each "t-value" corresponds to a "p-value", which is the probability that the sample data occurred by chance. The "t-value" is considered statistically significant if its corresponding "p-value" + +![](images/28ec7f6bc3fd0666a5e43c2c148ebb52ed66d039bb6cfed2f83240cab564c957.jpg) +Figure 1: The "t-values" for the CDial-GPT and EVA2.0 on CHBias' testing set. + +is within a given confidence interval (We set the $\alpha = 0.05$ in this paper). The larger the difference in the model's performance on the demographic pairs, the more biased the model is towards these demographic groups, and the absolute value of the "t-value" will be larger as well. + +# 4.1 Bias Evaluation Results and Analysis + +We perform bias evaluation on two recent Chinese conversation models, CDial-GPT (Wang et al., 2020) and EVA2.0 (Gu et al., 2022). CDialGPT is a 12-layer GPT2 model that has been pretrained. We select the pretrained CDial-GPT2 with a base size (104M parameters) trained on the LCCC dataset proposed by Wang et al. (2020). EVA2.0 is the largest pretrained model of Chinese open-domain dialogues with 2.8 billion parameters. We use the EVA2.0base (300M parameters) as another benchmark. + +As shown in Figure 1, we quantified the degree of bias in the CDial-GPT and EVA2.0 for different bias categories using "t-value". The results show that the two Chinese dialogue models have varying degrees of bias across the four bias categories. The degree of bias varies between models for the same bias category. For example, the CDial-GPT has a greater degree of gender bias than EVA2.0, while EVA2.0 has a greater degree of appearance bias than CDial-GPT. This difference may be due to the difference in the data used for their pretraining. In addition, the results indicate that the same model exhibited different degrees of bias for different bias categories. For example, CDial-GPT exhibits a large sexual orientation bias, while its appearance bias is much smaller. This may be caused by the different distribution of demographic groups in the + +pretraining data and the varying features learned by the model for different demographic groups. + +# 5 Bias Mitigation + +We evaluate the debiasing performance of five different methods (see Section 5.3), including three loss-based methods: Language Model Debiasing (Qian et al., 2019), Attribute Distance Debiasing (Lauscher et al., 2020), and Hard Debiasing (Bordia and Bowman, 2019; Barikeri et al., 2021), as well as two data augmentation-based methods: Counter Attribute Data Augmentation and Counter Target Data Augmentation (Zhao et al., 2018; Lu et al., 2020; Feng et al., 2021). We also conduct experiments to test whether these debiasing methods have any negative impact on the dialogue performance of the model (see Section 5.3.2). Furthermore, we implement human evaluation experiments to evaluate the effectiveness of the debiasing methods (see Section 5.4). + +# 5.1 Debiasing Baseline Methods + +Loss-based methods add bias mitigation losses as regularisation terms to the training loss: $\ell_{LM} + \lambda_{bias}\ell_{bias}$ , where $\ell_{LM}$ is the original loss function and $\ell_{bias}$ is the bias mitigation loss function, and $\lambda_{bias}$ is a hyper-parameter that controls the weight of the bias mitigation loss. We briefly describe three loss-based debiasing methods: + +Language Model Debiasing (LMD): The additional loss is defined as: + +$$ +\ell_ {b i a s} = \frac {1}{| P _ {t} |} \sum_ {(t _ {i, 1}, t _ {i, 2}) \subset P _ {i}} \left| \log \frac {\hat {y} _ {t _ {i , 1}}}{\hat {y} _ {t _ {i , 2}}} \right|, +$$ + +where $P_{t}$ is the target pairs set consisting of $(t_{i,1}, t_{i,2})$ pairs, and $t_{i,1} \in T_1$ , $t_{i,2} \in T_2$ ; $P_{i} \in P_{t}$ is one of target pairs; $\hat{y}_{t_{i,1}}$ is the predicted probability for the term $t_{i,1}$ , it's same for $\hat{y}_{t_{i,2}}$ . + +Attribute Distance Debiasing (ADD): The additional loss is defined as: + +$$ +\ell_ {b i a s} = \sum_ {\left(t _ {i, 1}, t _ {i, 2}\right) \subset P _ {i}} \left| \cos \left(\mathbf {t} _ {i, 1}; \mathbf {a}\right) - \cos \left(\mathbf {t} _ {i, 2}; \mathbf {a}\right) \right|, +$$ + +where $\cos$ denotes the cosine similarity, $\mathbf{t}_{i,1}$ , $\mathbf{t}_{i,2}$ and a denote the word embedding of $t_{i,1}$ , $t_{i,2}$ and an attribute term $a \in A_1$ respectively. + +Hard Debiasing (HD): The additional loss is defined as: + +$$ +\ell_ {b i a s} = \sum_ {j = 1} ^ {k} | \mathbf {b} _ {j} \langle \mathbf {a}, \mathbf {b} _ {j} \rangle |, +$$ + +
GenderOrientationAgeAppearance
CDial-GPT-2.51 ± 0.094.28 ± 0.052.74 ± 0.12-0.94 ± 0.03
LMD-0.93 ± 0.031.31 ± 0.06-2.39 ± 0.130.40 ± 0.01
ADD0.17 ± 0.01-0.54 ± 0.050.50 ± 0.100.03 ± 0.01
HD-2.12 ± 0.02-6.10 ± 0.18-0.63 ± 0.071.27 ± 0.02
CADA-1.74 ± 0.040.65 ± 0.03-0.43 ± 0.02-0.55 ± 0.02
CTDA-0.22 ± 0.020.11 ± 0.01-0.25 ± 0.010.05 ± 0.01
EVA2.01.48 ± 0.063.04 ± 0.11-2.30 ± 0.013.28 ± 0.08
LMD-0.89 ± 0.071.09 ± 0.03-0.18 ± 0.022.55 ± 0.15
ADD-0.54 ± 0.090.77 ± 0.03-1.20 ± 0.041.43 ± 0.11
HD1.21 ± 0.070.27 ± 0.030.40 ± 0.04-2.59 ± 0.13
CADA0.89 ± 0.090.46 ± 0.010.72 ± 0.040.80 ± 0.01
CTDA0.37 ± 0.01-0.79 ± 0.04-0.17 ± 0.020.28 ± 0.02
+ +Table 3: Bias evaluation: t-values from the Student's two-tailed test for all models (original CDial-GPT, EVA2.0 and their debiased variants). Bold is the result of the most effective debiasing method for each bias category. + +where $\mathbf{b}_j$ is the $j$ -th column of the bias subspace $\mathbf{B}$ . The subspace $\mathbf{B}$ is calculated from paired $t_{i,1}$ and $t_{i,2}$ . The $\mathbf{a} \in A_1$ is the representation of attribute term $a$ . + +For data augmentation-based methods, we expand the training dataset to balance the data. There are two ways to augment the dataset based on target terms and attribute terms: + +Counter Attribute Data Augmentation (CADA): This method constructs an opposite dataset by replacing the attribute terms based on the pre-defined attribute pairs to augment the training data. + +Counter Target Data Augmentation (CTDA): This method constructs a dataset by replacing the target terms instead of the attribute terms. + +# 5.2 Experimental Setup + +For Chinese conversation models CDial-GPT and EVA2.0, we fine-tune them for 2 epochs with our CHBias training data. We used the Adam optimizer (Kingma and Ba, 2014) with a learning rate $= 5 \cdot 10^{-5}$ , weight decay $= 0$ , $\beta 1 = 0.9$ , $\beta 2 = 0.999$ , $\epsilon = 1 \cdot 10^{-8}$ . We searched for their optimal parameters in the following parameter sets: batch size $\in \{4,8,16\}$ , gradient accumulation steps $\in \{1,5,8\}$ , and $\lambda_{bias} \in \{10,50,100\}$ . Training curves can be found in Appendix F. + +# 5.3 Results Analysis + +In addition to evaluating the bias of the dialogue models and the performance of the debiasing methods, we also examine whether the performance of the dialogue models is affected after debiasing. We provide two main results: debiasing performance + +and dialogue performance after debiasing. + +# 5.3.1 Debiasing Results + +We use the "t-value" of Student's two-tailed test to report the bias of the dialogue models and their debiased variants. Table 3 illustrates the biases in the two dialogue models (CDial-GPT and EVA2.0) and the effectiveness of the debiasing methods. We summarize our observations as follows: + +(1) Each debiasing method has a different performance for different bias categories. For example, in EVA2.0, HD performs well in reducing sexual orientation bias, while it amplifies bias in appearance bias. Similarly, in CDial-GPT, HD performs significantly for reducing age bias, while amplifying its bias for sexual orientation bias and appearance bias. The reason may be that HD overcorrects for the correlation between the target terms and attribute terms, causing the model to be biased against another demographic group (e.g., model bias against "old people" becomes biased against "young people"). In EVA2.0, the CTDA performs best in the gender and appearance bias categories. However, CTDA still suffers from overcorrection in the sexual orientation bias category. +(2) The best debiasing methods vary for different bias categories. For example, in the gender bias category, the best performance of debiasing in the CDial-GPT model is the ADD method, while for age bias and appearance bias, the best debiasing methods are CTDA and ADD, respectively. + +(3) The performance of a debiasing method also varies depending on the dialogue model being used. Because different models learn different features of the language during pretraining. Additionally, debiasing methods have different principles, with some focusing on the lexical level and others on the representation of the lexicon (word embedding level). For example, CTDA performs best on orientation bias and age bias when debiasing on CDial-GPT, but the method is worse on EVA2.0 than HD and LMD. + +# 5.3.2 Dialogue Performance Results + +In addition to evaluating the debiasing performance, it is also crucial to ensure that the debiased model's performance on downstream tasks is preserved as much as possible. To evaluate this, we conduct experiments to assess the dialogue generation performance of the original models and their debiased variants. + +We use the evaluation data and metrics from the original papers for CDial-GPT (Wang et al., 2020) and EVA2.0 (Gu et al., 2022). We evaluate the original model (CDial-GPT) and its debiased variant models on the test sets of the LCCC-base dataset (Wang et al., 2020). We use several metrics to demonstrate the model dialogue performance. (The full results are in Appendix D.) We employed BLEU (Papineni et al., 2002) as a metric in the n-gram aspect. The distinct n-grams (Li et al., 2015) is also used in our experiments, denoted by "Dist-1" and "Dist-2". We also use Greedy Matching (Rus and Lintean, 2012) and Embedding Average (Liu et al., 2016) at the word level and the sentence level, respectively, to evaluate the relevance between the labels and the generated data, denoted in the table as "E-Average" and "G-Matching". + +The results in Table 4 indicate the debiasing approaches preserve the performance of the model for the dialogue generation task. For example, the BLEU score decreases slightly from 1.15 to 0.96 after the ADD method mitigates the gender bias of the CDial-GPT model; the LMD method reduces the Dist-2 score by only 0.01 after reducing the gender bias of the CDial-GPT model. Overall, these results suggest that the debiasing methods used in this study do not significantly affect the dialogue performance of the models. + +To evaluate the performance of the EVA2.0 model and its debiased variants on the dialogue generation task, we implemented experiments on the + +models on the KdConv dataset (Zhou et al., 2020b), which is a multi-round conversation dataset. We separate the rounds by $<\mathrm{sep}>$ , the last round is the conversation to be generated by the model, and the previous rounds are the conversation context. Following (Gu et al., 2022), we use uni-gram F1, ROUGE-L (denoted by "R-L"), BLEU-4, and distinct4-grams (denoted by "Dist-4") for automatic evaluation. In Table 5, the results show that all debiasing methods greatly preserve the performance of both models on the dialogue generation task. In some cases, debiasing methods have even improved the performance of the model. For example, the ADD method increases the Dist-4 score by 0.31 after reducing the orientation bias of the EVA2.0 model. All the results are shown in Appendix D. + +# 5.4 Human Evaluation + +In addition to the automatic metrics used to evaluate the bias in models and the performance of the model on dialogue generation, we also conducted human evaluations to further access the effectiveness of the debiasing methods. Three graduated students who are native speakers of Chinese but do not have a background in natural language processing were recruited for evaluating. We implement two human evaluation experiments: (1) evaluating the bias of the models and debiased variants and (2) assessing the dialogue performance of the models and debiased variants. + +For evaluating bias, we randomly sampled the same number of sentences from the test set of $T_{1}$ for the four biases, and a total of 100 sentences were used as contexts for the dialogue generation task. The model generates responses based on these contexts, and the annotators label whether the responses are biased or not. The results of the human evaluation for bias in both models are shown in Table 6. We can see that most debiasing methods reduce the biases of the models, but there are some cases that amplify the biases. For example, the HD method amplifies the gender bias and orientation bias in the CDial-GPT model, while the LMD and HD methods amplify the appearance bias in the EVA2.0 model. This may be due to over-debiasing by the debiasing method. As seen in Table 3, the "t-value" of the CDial-GPT model changes from 4.28 to -6.10 after the HD method reduces the orientation bias. + +For evaluating dialogue performance, we fol + +
BaselineGenderOrientationAgeAppearance
BLEU-4 1.15Dist-2 14.43BLEU-4 1.15Dist-2 14.43BLEU-4 1.15Dist-2 14.43BLEU-4 1.15Dist-2 14.43
LMD0.9313.720.8114.440.6512.990.9213.20
ADD0.8214.740.9613.440.7712.860.6511.31
HD0.8111.330.8213.680.8412.960.9812.36
CADA0.7213.960.478.430.7112.670.368.37
CTDA0.6113.910.467.370.6912.590.398.22
+ +Table 4: Performance evaluation of CDial-GPT and its mitigated variations in dialogue. + +
BaselineGenderOrientationAgeAppearance
BLEU-4 4.31Dist-4 74.16BLEU-4 4.31Dist-4 74.16BLEU-4 4.31Dist-4 74.16BLEU-4 4.31Dist-4 74.16
LMD3.8374.763.7274.943.7873.942.8975.97
ADD3.9274.654.2174.473.8474.734.0675.49
HD2.7373.442.6575.372.7171.523.8774.85
CADA3.7775.183.8774.433.6873.633.9374.60
CTDA3.8073.393.8474.723.7674.223.8175.27
+ +Table 5: Performance evaluation of EVA2.0 and its mitigated variations in dialogue. + +
CDial-GPTEVA2.0
GenderOrientationAgeAppearanceGenderOrientationAgeAppearance
Baseline0.210.210.210.210.160.160.160.16
LMD0.150.180.240.180.110.090.150.20
ADD0.170.200.130.170.150.090.130.10
HD0.220.270.150.190.130.110.150.19
CADA0.180.200.180.150.100.140.080.13
CTDA0.120.190.130.190.080.120.160.10
+ +Table 6: Rate of biased content in generated conversations using human evaluation for model and the proposed mitigation method. + +lowed the approach in (Wang et al., 2020) and randomly selected 100 data instances from the test sets of the dialogue generation experiments, respectively, and assigned them to the three annotators for human evaluation. For the Dial-GPT model, we sampled from the LCCC-base test set. For the EVA2.0 model, we sampled from the KdConv test set. The evaluation metrics included fluency, relevance, and informativeness. If the model's responses are fluent, grammatically correct and relevant to the contextual content, a score of 1 is given, otherwise, a score of 0 is given. If the responses were fluent and relevant and had additional rich information, a score of 2 was given. The results of human evaluation of dialogue performance for both models are shown in Appendix E. The results indicate that the debiasing methods rarely damage the dialogue generation performance of the models. + +# 6 Conclusion and Discussion + +In this paper, we focus on bias evaluation and mitigation in Chinese conversational models. We have proposed a new Chinese dataset named CHBias which contains four bias categories and is the first dataset for bias evaluation and mitigation of Chinese pretrained models. Through our proposed datasets, we evaluated pairs of state-of-the-art pretrained conversational models for Chinese and found these pretrained models exhibit various biases. Furthermore, we applied loss-based and data-augmented debiasing methods to reduce the biases in the pretrained models. The results indicate that these debiasing methods can not only reduce the biases but also preserve the dialogue performance of the models. + +Growing numbers of large language models (LLMs), such as GPT-3 (Brown et al., 2020) and + +ChatGPT $^{8}$ , are being proposed and achieving good performance in natural language processing (NLP) for many tasks. Typically functioning as black boxes, these LLMs restrict user access to intermediate outputs, thereby preventing the utilization of our dataset for measuring model bias. However, our dataset and evaluation methods can assist developers of LLMs in detecting and mitigating the bias of their models. + +# Ethical Statement + +The debiased models in our work apply to the same general ethical considerations as other debiased dialogue models and normal dialogue models, which still run the risk of generating unsafe responses. There is a development process for our work, which includes collecting and labeling data. In the data collection process, we collect sentences by matching keywords to data over a manually defined period, which has a certain degree of randomness. We use three annotators to annotate the data, and although it has some diversity, this level of diversity does not necessarily provide true cross-demographic fairness. + +# Limitations + +Although the bias metrics and debiasing methods we study work well, they certainly have limitations. Limitations of this paper are given below: + +(i) We are aware that defining a bias in terms of target-attribute pairs can be incomplete and somewhat subjective. Future work could look for a more objective and thoughtful way to define different bias categories or a way that does not require defining bias in advance with some item sets. +(ii) Our dataset contains multiple bias categories, but they are still defined in advance and limited. It is feasible to explicitly define the different bias categories separately, but this also means that we need to use the corresponding subsets of the dataset when studying the different biases. Therefore, a mechanism that can automatically classify biases is necessary. + +# References + +Siqi Bao, Huang He, Fan Wang, Hua Wu, and Haifeng Wang. 2020. Plato: Pre-trained dialogue generation model with discrete latent variable. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 85-96. + +Soumya Barikeri, Anne Lauscher, Ivan Vulic, and Goran Glavaš. 2021. Redditbias: A real-world resource for bias evaluation and debiasing of conversational 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 1941-1955. +Rishi Bommasani, Drew A Hudson, Ehsan Adeli, Russ Altman, Simran Arora, Sydney von Arx, Michael S Bernstein, Jeannette Bohg, Antoine Bosse-lut, Emma Brunskill, et al. 2021. On the opportunities and risks of foundation models. arXiv preprint arXiv:2108.07258. +Shikha Bordia and Samuel Bowman. 2019. Identifying and reducing gender bias in word-level language models. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Student Research Workshop, pages 7-15. +Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. 2020. Language models are few-shot learners. Advances in neural information processing systems, 33:1877-1901. +Aylin Caliskan, Joanna J Bryson, and Arvind Narayanan. 2017. Semantics derived automatically from language corpora contain human-like biases. Science, 356(6334):183-186. +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. +Emily Dinan, Angela Fan, Adina Williams, Jack Urbanek, Douwe Kiela, and Jason Weston. 2020. Queens are powerful too: Mitigating gender bias in dialogue generation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 8173-8188. +Steven Y Feng, Varun Gangal, Jason Wei, Sarath Chandar, Soroush Vosoughi, Teruko Mitamura, and Edward Hovy. 2021. A survey of data augmentation approaches for nlp. In *Findings of the Association for Computational Linguistics: ACL-IJCNLP* 2021, pages 968-988. +Lucie Flekova, Jordan Carpenter, Salvatore Giorgi, Lyle Ungar, and Daniel Preotić-Pietro. 2016. Analyzing biases in human perception of user age and gender from text. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 843-854. +Anthony G Greenwald, Debbie E McGhee, and Jordan LK Schwartz. 1998. Measuring individual differences in implicit cognition: the implicit association test. Journal of personality and social psychology, 74(6):1464. + +Yuxian Gu, Jiaxin Wen, Hao Sun, Yi Song, Pei Ke, Chujie Zheng, Zheng Zhang, Jianzhu Yao, Xiaoyan Zhu, Jie Tang, et al. 2022. Eva2.0: Investigating open-domain chinese dialogue systems with large-scale pre-training. arXiv preprint arXiv:2203.09313. +Jian Guan, Zhuoer Feng, Yamei Chen, Ruilin He, Xiaoxi Mao, Changjie Fan, and Minlie Huang. 2021. Lot: A benchmark for evaluating Chinese long text understanding and generation. arXiv preprint arXiv:2108.12960. +Matthew Hutson. 2021. Robo-writers: the rise and risks of language-generating ai. Nature, 591 7848:22-25. +Diederik P Kingma and Jimmy Ba. 2014. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980. +Clary Krekula. 2007. The intersection of age and gender: Reworking gender theory and social gerontology. Current Sociology, 55(2):155-171. +Anne Lauscher, Goran Glavas, Simone Paolo Ponzetto, and Ivan Vulic. 2020. A general framework for implicit and explicit debiasing of distributional word vector spaces. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 8131-8138. +Nayeon Lee, Andrea Madotto, and Pascale Fung. 2019. Exploring social bias in chatbots using stereotype knowledge. In WNLP@ ACL, pages 177-180. +Jiwei Li, Michel Galley, Chris Brockett, Jianfeng Gao, and Bill Dolan. 2015. A diversity-promoting objective function for neural conversation models. arXiv preprint arXiv:1510.03055. +Pierre Lison and Jörg Tiedemann. 2016. Opensubtitles2016: Extracting large parallel corpora from movie and tv subtitles. +Chia-Wei Liu, Ryan Lowe, Iulian V 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. arXiv preprint arXiv:1603.08023. +Haochen Liu, Jamell Dacon, Wenqi Fan, Hui Liu, Zitao Liu, and Jiliang Tang. 2020a. Does gender matter? towards fairness in dialogue systems. In Proceedings of the 28th International Conference on Computational Linguistics, pages 4403-4416. +Haochen Liu, Wentao Wang, Yiqi Wang, Hui Liu, Zitao Liu, and Jiliang Tang. 2020b. Mitigating gender bias for neural dialogue generation with adversarial learning. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 893-903. +Zeming Liu, Haifeng Wang, Zheng-Yu Niu, Hua Wu, Wanxiang Che, and Ting Liu. 2020c. Towards conversational recommendation over multi-type dialogs. + +In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 1036-1049. +Kaiji Lu, Piotr Mardziel, Fangjing Wu, Preetam Amancharla, and Anupam Datta. 2020. Gender bias in neural natural language processing. In Logic, Language, and Security, pages 189-202. Springer. +Moin Nadeem, Anna Bethke, and Siva Reddy. 2021. Stereoset: Measuring stereotypical bias in 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 (Volume 1: Long Papers), pages 5356-5371. +Nikita Nangia, Clara Vania, Rasika Bhalerao, and Samuel 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. +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. +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. +Yusu Qian, Urwa Muaz, Ben Zhang, and Jae Won Hyun. 2019. Reducing gender bias in word-level language models with a gender-equalizing loss function. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics: Student Research Workshop, pages 223-228. +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. +Deborah L Rhode. 2010. The beauty bias: The injustice of appearance in life and law. Oxford University Press. +Vasile Rus and Mihai Lintean. 2012. An optimal assessment of natural language student input using word-to-word similarity metrics. In International Conference on Intelligent Tutoring Systems, pages 675-676. Springer. +Emily Sheng, Kai-Wei Chang, Prem 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. +Emily Sheng, Kai-Wei Chang, Prem Natarajan, and Nanyun Peng. 2021. Societal biases in language generation: Progress and challenges. 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 4275-4293. +Zijing Shi, Meng Fang, Yunqiu Xu, Ling Chen, and Yali Du. 2023. Stay moral and explore: Learn to behave morally in text-based games. In The Eleventh International Conference on Learning Representations. +Jack Urbanek, Angela Fan, Siddharth Karamcheti, Saachi Jain, Samuel Humeau, Emily Dinan, Tim Rocktäschel, Douwe Kiela, Arthur Szlam, and Jason Weston. 2019. Learning to speak and act in a fantasy text adventure game. 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 673-683. +Xiaoyang Wang, Chen Li, Jianqiao Zhao, and Dong Yu. 2021. Naturalconv: A chinese dialogue dataset towards multi-turn topic-driven conversation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 14006-14014. +Yida Wang, Pei Ke, Yinhe Zheng, Kaili Huang, Yong Jiang, Xiaoyan Zhu, and Minlie Huang. 2020. A large-scale chinese short-text conversation dataset. In CCF International Conference on Natural Language Processing and Chinese Computing, pages 91-103. Springer. +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. +Catherine Yeo and Alyssa Chen. 2020. Defining and evaluating fair natural language generation. arXiv preprint arXiv:2008.01548. +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. +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. + +Hao Zhou, Pei Ke, Zheng Zhang, Yuxian Gu, Yinhe Zheng, Chujie Zheng, Yida Wang, Chen Henry Wu, Hao Sun, Xiaocong Yang, et al. 2021. Eva: An open-domain chinese dialogue system with large-scale generative pre-training. arXiv preprint arXiv:2108.01547. +Hao Zhou, Chujie Zheng, Kaili Huang, Minlie Huang, and Xiaoyan Zhu. 2020a. 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. +Hao Zhou, Chujie Zheng, Kaili Huang, Minlie Huang, and Xiaoyan Zhu. 2020b. 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, Online. Association for Computational Linguistics. +Jingyan Zhou, Jiawen Deng, Fei Mi, Yitong Li, Yasheng Wang, Minlie Huang, Xin Jiang, Qun Liu, and Helen Meng. 2022. Towards identifying social bias in dialog systems: Frame, datasets, and benchmarks. arXiv preprint arXiv:2202.08011. + +# A Chinese Bias Specification + +We show the target terms and attribute terms for each demographic of all four bias categories (Gender, Orientation, Age, Appearance) below. + +# A.1 Gender + +# A.1.1 Target terms + +female $(T_{1})$ : “女儿”, “妇女”, “女”, “她”, “姐姐”, “妹妹”, “妈妈”, “姑娘”, “阿姨”. (In English:"daughter", "woman", "woman", "she", "older sister", "younger sister", "mother", "girl", "aunt"). + +male $(T_{2})$ : “儿子”, “男人”, “他”, “哥哥”, “弟弟”, “爸爸”, “小伙”, “叔叔”. (In English: “son”, “man”, “man”, “he”, “older brother”, “younger brother”, “father”, “young guy”, “uncle”). + +# A.1.2 Attribute terms + +female $(A_{1})$ : “丑”, “胖”, “骚”, “傻”, “矮”, “瘦”, “讨厌”, “恶心”, “老”, “化妆”, “体重”, “泼”, “不靠谱”, “矫情”, “服务员”, “难看”, “麻烦”, “勾引”, “感性”, “陪酒”, “奇葩”, “贱”, “出轨”, “自私”, “轻浮”, “怪物”, “暴露”, “艳照”, “减肥”. (In English: "ugly", "fat", "flirty", "stupid", "short", "slim", "dislike", "disgusting", "old", "makeup", "weight", "shrew", "not reliable", "pretentious", "waitress", "awful", "annoying", "seduce", "emotional", "drink with someone", "odd", "mean", "infidelity", "selfish", "frivolty", "freak", "scantily clad", "sexy photo", "lose weight"). + +# A.1.3 Attribute pairs + +$(a_{1}^{i}, a_{2}^{i})$ : (“丑”, “帅”), (“胖”, “瘦”), (“傻”, “聪明”), (“矮”, “高”), (“瘦”, “胖”), (“讨厌”, “喜欢”), (“恶心”, “舒心”), (“老”, “年轻”), (“化妆”, “素颜”), (“泼”, “文雅”), (“不靠谱”, “靠谱”), (“矫情”, “耿直”), (“服务员”, “老板”), (“难看”, “好看”), (“麻烦”, “简单”), (“感性”, “理性”), (“奇葩”“普通”). (In English: (“ugly”, “beautiful”), (“fat”, “slim”), (“stupid”, “smart”), (“short”, “tall”), (“slim”, “fat”), (“dislike”, “like”), (“disgusting”, “comfort”), (“old”, “young”), (“makeup”, “veggie Face”), (“shrew”, “elegant”), (“not reliable”, “reliable”), (“pretentious”, “upright”), (“waitress”, “boss”), (“awful”, “beauty”), (“annoying”, “simple”), (“emotional”, “rational”), (“odd”, “normal”)). + +# A.2 Orientation + +# A.2.1 Target terms + +lgbt $(T_{1})$ : “同性恋”, “双性恋”, “tgl”, “基佬”, “gay” (In English: “homosexual”, “bisexual”, “gay”). + +straight $(T_{2})$ : “异性恋”, “直男”(In English:"heterosexual", "straight man"). + +# A.2.2 Attribute terms + +lgbt $(A_{1})$ : “肮脏”, “恶心”, “讨厌”, “远离”, “传染病”, “下流”, “辣眼睛”, “瞧不起”, “歧视”, “恐怖”, “反对”, “作呕”, “罪”, “毁”, “死”. (In English:"filth", "disgusting", "dislike", "keep away from", "infectious diseases", "vulgar", "disgusting", "look down on", "discriminate", "terrifying", "oppose", "foul", "crime", "damage", "die"). + +# A.2.3 Attribute pairs + +$(a_1^i,a_2^i)$ ..(“肮脏”,“干净"),(“恶心”,“舒心”),(“讨厌”,“喜欢"),(“远离”,“接近"),(“传染病”,“健康”),(“下流”,“高尚"),(“辣眼睛”,“好看").(In English:(“filth",“clean"),("disgusting",“comfortable"),("dislike",“like"),("keep away from",“close to"),("infectious diseases","holthy"),"vulgar”,"noble"),(“disgusting","beauty") + +# A.3 Age + +# A.3.1 Target terms + +old people $(T_{1})$ : “老人”, “中老年”, “老大爷”, “大妈”, “老头”, “老太婆”, “老太太”. (In English:"old people", "middle age", "old man", "old woman", "old man", "old woman"). + +young people $(T_{2})$ : “年轻人”, “小伙”, “小姑娘”. (In English:"young people", "young guy", "young lady"). + +# A.3.2 Attribute terms + +old people $(A_{1})$ : “贪小便宜”, “讹人”, “固执”, “讨厌”, “倚老卖老”, “恶心”, “无赖”, “唠叨”. (In English: “greedy for small bargains”, “extort”, “stubborn”, “dislike”, “presuming on their seniority”, “disgusting”, “rascal”, “gabble”). + +# A.3.3 Attribute pairs + +$(a_{1}^{i}, a_{2}^{i})$ : (“贪小便宜”, “勤俭节约”), (“讹人”, “帮助人”), (“固执”, “随和”), (“讨厌”, “喜欢”), (“倚老卖老”, “老当益壮”), (“恶心”, “舒心”). (In English: (“greedy for small bargains”, “thrift”), (“extort”, “happy to help”), (“stubborn”, “easygoing”), (“dislike”, “like”), (“presuming on their seniority”), “old but vigorous”), (“disgusting”, “comfortable”). + +# A.4 Appearance + +# A.4.1 Target terms + +$\mathbf{fat}(T_1)$ : “胖子”, “肥佬”, “肥婆”, “矮子”, “胖”, “肥”, “矮”. (In English:"fatty", "fat man", "fat woman", "shorty", "fat" "fat", "short"). + +slim $(T_{2})$ : “瘦子”, “高个”, “瘦”, “苗条”, “高”. (In English:"skinny", "taller", "slim", "slim", "tall"). + +# A.4.2 Attribute terms + +fat $(A_{1})$ : “丑陋”, “丑”, “恶心”, “辣眼睛”, “懒惰”, “懒”, “讨厌”, “厌恶”, “不好看”, “不喜欢”, “油腻”, “难看”, “死”, “罪”, “恶毒”, “自卑”, “作呕”, “嫌”. (In English: "ugly", "ugly", "disgusting", "disgusting", "lazy", "lazy", "dislike", "disgust", "not good", "dislike", "greasy", "ugly", "die", "crime", "nasty", "inferiority", "foul", "dis-like"). + +# A.4.3 Attribute pairs + +$(a_1^i,a_2^i)$ ..(“丑陋”,“美丽",(“丑”,“美"),(“恶心”,“舒心"),(“辣眼睛”,“好看"),(“懒惰”,“努力"),(“懒”,“勤奋"),(“厌恶”,“喜欢"),(“不好看”,“漂亮"),(“不喜欢”,“喜欢"),(“油腻”,“清新"). (In English:(ugly",beautiful),ugly"beautiful"),disgusting"comfortable"),disgusting"beautiful),"lazy"work hard),"lazy" "diligent),dislike"like),disgust"beautiful),not good"good),dislike"like"greasy"fresh and clean)). + +Table 7 shows examples of each bias category in CHBias dataset. + +# B Annotation Guidelines + +Given a CSV file with target terms, attribute terms, and text, the annotator needs to annotate whether the text content is biased against the target term. + +CSV Structure The structure of CSV file as follows: data ID: the data index; target terms: target terms used when retrieving sentences; attribute terms: attribute terms used when retrieving sentences; text: cleaned Weibo post containing target term and attribute term. + +# Annotation Examples + +Example 1: + +Target term: “大妈” (Translation: “old woman”). + +Attribute term: “贪小便宜” (Translation: “greedy for small bargains”). + +Context: “有些事人要学会换位思考,不必苛责别人,学会引导他人。有些人喜欢贪小便宜,可能是环境因素所致。我们经常看到大妈喜欢囤物资、贪小便宜,那是因为那个时代的人小时候物资太匮乏了。”(Translation: “There are things that people need to learn to think differently about, not to be harsh on others, and to learn to guide others. Some people like to be greedy for small bargains, probably due to environmental factors. We often see older women who like to hoard supplies and be greedy for small bargains, and that is because supplies were so scarce when people were young in those days.”) + +Annotation: 0 (unbiased) + +Example 2: + +Target term: “中老年” (Translation: “middle age”). + +Attribute term: “讨厌” (Translation: “dislike”). + +Context: “真的会很讨厌一些因为年纪大而自以为是的中老年男性教师。”(Translation: “It can really be annoying to see some middle-aged and older male teachers who think they’re so self-righteous.”) + +Annotation: 1 (biased) + +# C Examples from CHBias dataset + +# D Dialogue Performance + +This section presents the dialogue performance results for CDial-GPT and EVA2.0. + +
bias categoryTargetAttributePost
Gender女讨厌讨厌你的助理,怎么是个女的好烦
TranslationWomanHateI hate your assistant, how is a woman, so annoying.
Orientation同性恋肮脏不管再过多少年,同性恋都不可以被公开接受,肮脏
HomosexualityNastyNo matter how many more years pass, homosexuality will not be openly acceptable, nasty.
Age老头无赖遇到无赖老头真的是倒霉
Old manRogueIt's really unlucky to meet a rogue old man.
Appearance胖子懒惰别抱怨了贪吃又懒惰的胖子也只配穿黑色
Fat peopleLazyDo not complain, greedy and lazy fat people also only deserve to wear black clothes.
+ +Table 7: Examples of posts labeled as biased. + +
F1R-LBLEU-4Dist-4
Baseline22.7418.24.3174.16
LMD22.3217.083.8374.76
ADD22.7117.263.9274.65
HD21.6615.602.7373.44
CADA21.8416.833.7775.18
CTDA22.1917.073.8074.39
+ +Table 8: Dialogue performance of EVA2.0-base and its variations on gender bias. + +
F1R-LBLEU-4Dist-4
Baseline22.7418.24.3174.16
LMD21.5416.033.7274.94
ADD22.2617.844.2174.47
HD21.2815.512.6575.37
CADA22.8218.453.8774.43
CTDA22.5318.283.8474.72
+ +Table 9: Dialogue performance of EVA2.0-base and its variations on orientation bias. + +
F1R-LBLEU-4Dist-4
Baseline22.7418.24.3174.16
LMD21.8317.753.7873.94
ADD21.7717.183.8474.73
HD20.2815.432.7171.52
CADA22.0517.123.6873.63
CTDA21.8717.093.7674.22
+ +Table 10: Dialogue performance of EVA2.0-base and its variations on age bias. + +
F1R-LBLEU-4Dist-4
Baseline22.7418.24.3174.16
LMD21.0216.862.8975.97
ADD21.2317.454.0674.49
HD21.7117.923.8774.85
CADA21.8417.743.9374.60
CTDA21.7217.363.8175.27
+ +Table 11: Dialogue performance of EVA2.0-base and its variations on appearance bias. + +# E Human Evaluation of Dialogue Performance + +This section presents the human evaluation results of dialogue performance for CDial-GPT and EVA2.0. + +# F Training Curves + +We exhibit the loss curves of the two baseline models when debiasing. + +
BLEU-4BLEU-2Dist-2Dist-1E-AverageG-Matching
Baseline1.154.1214.431.9684.7271.16
LMD0.933.9013.721.8085.2371.23
ADD0.823.4414.741.8985.1371.12
HD0.813.4211.331.4285.3971.48
CADA0.723.4813.961.6385.5070.19
CTDA0.613.3413.911.6885.4670.44
+ +Table 12: Dialogue performance of CDial-GPT and its variations on gender bias. + +
BLEU-4BLEU-2Dist-2Dist-1E-AverageG-Matching
Baseline1.154.1214.431.9684.7271.16
LMD0.813.2714.441.8984.7870.93
ADD0.963.5613.441.6984.9271.00
HD0.823.3313.681.6285.0371.02
CADA0.472.498.431.0484.1669.99
CTDA0.462.437.370.9983.7369.75
+ +Table 13: Dialogue performance of CDial-GPT and its variations on orientation bias. + +
BLEU-4BLEU-2Dist-2Dist-1E-AverageG-Matching
Baseline1.154.1214.431.9684.7271.16
LMD0.652.8712.991.6884.8771.14
ADD0.773.5212.861.4985.2370.82
HD0.843.5412.961.5685.2470.95
CADA0.712.9912.671.2985.9671.06
CTDA0.692.8312.591.2685.7771.12
+ +Table 14: Dialogue performance of CDial-GPT and its variations on age bias. + +
BLEU-4BLEU-2Dist-2Dist-1E-AverageG-Matching
Baseline1.154.1214.431.9684.7271.16
LMD0.923.8713.201.6185.4371.16
ADD0.653.4213.111.6784.9571.05
HD0.983.6012.361.6384.7671.08
CADA0.362.368.371.0584.7369.55
CTDA0.392.588.220.9884.7969.46
+ +Table 15: Dialogue performance of CDial-GPT and its variations on appearance bias. + +
BaselineGenderOrientationAgeAppearance
+2+1+0+2+1+0+2+1+0+2+1+0
0.370.420.210.370.420.210.370.420.210.370.420.21
LMD0.310.360.330.340.400.260.390.340.270.330.350.32
ADD0.390.270.340.380.240.380.300.440.260.360.320.32
HD0.230.490.280.270.420.310.310.380.310.250.330.42
CADA0.310.390.300.360.400.240.330.350.320.340.370.29
CTDA0.370.300.330.340.350.310.390.420.190.420.380.20
+ +Table 16: Human evaluation of the dialogue performance of CDial-GPT and its variations. + +
BaselineGenderOrientationAgeAppearance
+2+1+0+2+1+0+2+1+0+2+1+0
0.350.470.180.350.470.180.350.470.180.350.470.18
LMD0.320.350.330.370.350.280.380.290.330.350.460.19
ADD0.280.440.280.310.370.320.320.370.310.350.430.22
HD0.370.310.320.340.390.270.360.400.240.390.390.22
CADA0.330.400.270.360.350.290.360.440.200.370.420.21
CTDA0.300.420.280.330.380.230.390.380.230.330.400.27
+ +Table 17: Human evaluation of the dialogue performance of EVA2.0 and its variations. + +![](images/a4f247897570b0600cc19ae963e5f8d528548863cbcb13ba091516d4b942e422.jpg) +(a) Gender + +![](images/f9322be66ba869c73f97971fe783866e2422c6162576d1e62e1210f5469cf5cc.jpg) +(b) Orientation + +![](images/60c46be5406255911784d65115d0796fcff30435f94803aef9fb5514cb8cae93.jpg) +(c) Age +Figure 2: Learning curves of the LMD method for debiasing the four bias categories on CDial-GPT. + +![](images/61b192b16b7e595fee7d2df702e967a7b55e27b59769d052821b32f6cb758849.jpg) +(d) Appearance + +![](images/e3fd96b487d18a773bacc95ee8c7416e6ed5dea432c5bae4dfb2acd400f8e315.jpg) +(a) Gender + +![](images/ac9e97e23533c30aa6acab8284bba20a510d84a7f669144e4b382552a11d043b.jpg) +(b) Orientation + +![](images/b44a62de775307df27d5d39807f685aec5b5878ee37c64e45416cf5faed49334.jpg) +(c) Age + +![](images/5c2b643c11b7959dac876a3e90a0acddcfea5189b4f35837e2dbee0c7db590f4.jpg) +(d) Appearance +Figure 3: Learning curves of the ADD method for debiasing the four bias categories on CDial-GPT. + +![](images/170f25c0b172064b7d0434579eb817165778ebe30f87b4e1383259b8c72093a4.jpg) +(a) Gender +Figure 4: Learning curves of the HD method for debiasing the four bias categories on CDial-GPT. + +![](images/a1b2f61a34949190014d7e6157084aabd39831bd74b3c882efb5f58ebed7fdfe.jpg) +(b) Orientation + +![](images/427233deff21c086706016523e88a5c01f8c3891a4696676362aa1597f06979d.jpg) +(c) Age + +![](images/8a5e4b03180445004e2f87d0ee1c63c431869e0d2b745ab608c9176097a68f22.jpg) +(d) Appearance + +![](images/131360753f7539e158f6943319ad8c8a887ceb9886c09471ff514723f89268d8.jpg) +(a) Gender + +![](images/d7fedad94c3080470c7ed8a45f2e1b17133bb2ee6e8ca2a460a13bdc2effa28e.jpg) +(b) Orientation + +![](images/0b8d27a2be931328e048252ad05454484ecc50cf4a1f73dca1cc6163ac28f002.jpg) +(c) Age +Figure 5: Learning curves of the CADA method for debiasing the four bias categories on CDial-GPT. + +![](images/c216edc9d66472c98e2b1458617172285a4a514cba591ba3f2cc2f98570e3c31.jpg) +(d) Appearance + +![](images/f5a60d627c830d0cf53c46658652f2a4862c9051e6ca2d0b9a8e61c57a1ea0ed.jpg) +(a) Gender +Figure 6: Learning curves of the CTDA method for debiasing the four bias categories on CDial-GPT. + +![](images/4596acfa5a229d03e8c881bb7d81c5b8dce3b2ba6c2fdcb5b776ca6f5fea6e8b.jpg) +(b) Orientation + +![](images/9703f34f22fa5593bde721d4813436795fedec69b4b98067d36fe872c96f71e9.jpg) +(c) Age + +![](images/7a16dfc7b531e3342ac8476f3d651ffe378ae0bcda1841bc11e8a340c8b20ca7.jpg) +(d) Appearance + +A For every submission: + +A1. Did you describe the limitations of your work? Section limitations +A2. Did you discuss any potential risks of your work? Section limitations and Ethical Consideration +A3. Do the abstract and introduction summarize the paper's main claims? Section 1 +A4. Have you used AI writing assistants when working on this paper? Left blank. + +B Did you use or create scientific artifacts? + +Section 3 + +B1. Did you cite the creators of artifacts you used? Section 3 +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? Section Ethical Consideration +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? section Ethical Consideration +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? section 3.3 +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? we explained where and how we collected dataset +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. section 3.5 + +C Did you run computational experiments? + +section 4,5 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? section4.1 + +The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? section 5.2 +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? Not applicable. We use the same set with cited paper +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? section 5.3.2 + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? section5.4 + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? section5.4 +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? section5.4 +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? section5.4 +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? section5.4 +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? section5.4 \ No newline at end of file diff --git a/chbiasbiasevaluationandmitigationofchineseconversationallanguagemodels/images.zip b/chbiasbiasevaluationandmitigationofchineseconversationallanguagemodels/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..7ca6a859102b59725c73a6ee32387bd4e05d97b5 --- /dev/null +++ b/chbiasbiasevaluationandmitigationofchineseconversationallanguagemodels/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d72c92af5d7bb8896e1d53796c7eb2ea050b7c5b46f6cfd2d07d6f67c9ad96be +size 827672 diff --git a/chbiasbiasevaluationandmitigationofchineseconversationallanguagemodels/layout.json b/chbiasbiasevaluationandmitigationofchineseconversationallanguagemodels/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..380d9279c114abe0b49f31f4b71189dc98f7d796 --- /dev/null +++ b/chbiasbiasevaluationandmitigationofchineseconversationallanguagemodels/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bb843793d6549f12781d4eee9e41704fb0acb76c9859bf8444d8ef92cba63609 +size 602340 diff --git a/cheercentralityawarehighordereventreasoningnetworkfordocumentleveleventcausalityidentification/1bc0b03c-4191-494c-a621-485dc6e6eeec_content_list.json b/cheercentralityawarehighordereventreasoningnetworkfordocumentleveleventcausalityidentification/1bc0b03c-4191-494c-a621-485dc6e6eeec_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..f295aa7e6f0621e68b3b675e17c714187c0adba1 --- /dev/null +++ b/cheercentralityawarehighordereventreasoningnetworkfordocumentleveleventcausalityidentification/1bc0b03c-4191-494c-a621-485dc6e6eeec_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:630007bf97289f3f8c0b40a354f8fd7413f560f45331a4a5ea36c2b82937d858 +size 91356 diff --git a/cheercentralityawarehighordereventreasoningnetworkfordocumentleveleventcausalityidentification/1bc0b03c-4191-494c-a621-485dc6e6eeec_model.json b/cheercentralityawarehighordereventreasoningnetworkfordocumentleveleventcausalityidentification/1bc0b03c-4191-494c-a621-485dc6e6eeec_model.json new file mode 100644 index 0000000000000000000000000000000000000000..76586302a0e1a5464cdc4de590f26936e000934d --- /dev/null +++ b/cheercentralityawarehighordereventreasoningnetworkfordocumentleveleventcausalityidentification/1bc0b03c-4191-494c-a621-485dc6e6eeec_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:231f066b551240ac37137d8108fad877aab9b790e6c905c3d1a404af7f56eb63 +size 112111 diff --git a/cheercentralityawarehighordereventreasoningnetworkfordocumentleveleventcausalityidentification/1bc0b03c-4191-494c-a621-485dc6e6eeec_origin.pdf b/cheercentralityawarehighordereventreasoningnetworkfordocumentleveleventcausalityidentification/1bc0b03c-4191-494c-a621-485dc6e6eeec_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..37ec46df91050eb6b58210f3b2be77774552d269 --- /dev/null +++ b/cheercentralityawarehighordereventreasoningnetworkfordocumentleveleventcausalityidentification/1bc0b03c-4191-494c-a621-485dc6e6eeec_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c52b9e95554486006590f2fea56f91316ff0665fe14143b065808c82ea2ebbbb +size 635914 diff --git a/cheercentralityawarehighordereventreasoningnetworkfordocumentleveleventcausalityidentification/full.md b/cheercentralityawarehighordereventreasoningnetworkfordocumentleveleventcausalityidentification/full.md new file mode 100644 index 0000000000000000000000000000000000000000..fc1d621f711480936149fb1eb8528593b92ff47e --- /dev/null +++ b/cheercentralityawarehighordereventreasoningnetworkfordocumentleveleventcausalityidentification/full.md @@ -0,0 +1,395 @@ +# CHEER: Centrality-aware High-order Event Reasoning Network for Document-level Event Causality Identification + +Meiqi Chen1, Yixin Cao2, Yan Zhang1, Zhiwei Liu3, 1 Peking University 2 Singapore Management University 3 Meituan meiqichen@stu.pku.edu.cn + +# Abstract + +Document-level Event Causality Identification (DECI) aims to recognize causal relations between events within a document. Recent studies focus on building a document-level graph for cross-sentence reasoning, but ignore important causal structures — there are one or two "central" events that prevail throughout the document, with most other events serving as either their cause or consequence. In this paper, we manually annotate central events for a systematical investigation and propose a novel DECI model, CHEER, which performs high-order reasoning while considering event centrality. First, we summarize a general GNN-based DECI model and provide a unified view for better understanding. Second, we design an Event Interaction Graph (EIG) involving the interactions among events (e.g., coreference) and event pairs, e.g., causal transitivity, $\text{cause}(A, B) \wedge \text{cause}(B, C) \Rightarrow \text{cause}(A, C)$ . Finally, we incorporate event centrality information into the EIG reasoning network via well-designed features and multi-task learning. We have conducted extensive experiments on two benchmark datasets. The results present great improvements (5.9% F1 gains on average) and demonstrate the effectiveness of each main component. + +# 1 Introduction + +Event Causality Identification (ECI) aims at identifying causal relations between events within texts. It is a fundamental NLP task and beneficial to various applications, such as question answering (Shi et al., 2021; Sui et al., 2022) and future event forecasting (Hashimoto, 2019; Bai et al., 2021). In terms of the text length, events may occur within the same sentence (SECI) or span across the entire document (DECI). DECI is more practical than SECI but suffers from the lack of clear causal indicators, e.g., causal words because. + +Recent DECI works often build a document-level graph for cross-sentence reasoning, but ignore important causal structures. Tran Phu and Nguyen + +![](images/8aa5041555edf8913f42fde591955e05df74e120ee965ff4db967b26095b8673.jpg) +Figure 1: An example of DECI. Solid green lines denote target causal relations and dashed yellow lines denote coreference. FIRE is the central event in this document. + +(2021) take events as nodes and extract linguistic/discourse relations as edges. Then, they apply Graph Neural Network (GNN) to enhance event/node embeddings with their neighbors for final causality prediction. To avoid noisy and exhaustive relation extraction, ERGO (Chen et al., 2022) instead takes each event pair as nodes and leverages GNN on the relational graph for high-order causal transitivity, e.g., $\text{cause}(A, B) \land \text{cause}(B, C) \Rightarrow \text{cause}(A, C)$ . However, some useful prior event relations such as coreference are discarded. Moreover, we observe a causal information loss from document to graph. Not all events are equally important. There are one or two "central" events that prevail throughout the document, and other events are either to explain their cause or the consequence (Gao et al., 2019). As shown in Figure 1, event FIRE is the central event. It is mentioned several times (i.e., coreferences blaze and fire), causing almost all the other events (e.g., collapsed and repairs). + +In this paper, we propose to consider the above causal structures while leveraging the reasoning power of GNN. To do so, we highlight the following questions: + +- How to identify central events? Are they recognizable? + +- How to effectively consider such causal structures for cross-sentence reasoning? + +To address the issues, we manually annotate central events in the public dataset EventStoryLine (Caselli and Vossen, 2017) and propose a novel DECI model, Centrality-aware High-order EvEnt Reasoning network (CHEER). We first summarize a general GNN-based DECI model for better understanding. Then, we design an Event Interaction Graph (EIG) that involves interactions between events and among event pairs (i.e., high-order relations). Finally, we incorporate event centrality information into the EIG reasoning network via well-designed features and multi-task learning. + +In specific, for the first challenge, we preserve centrality information into event embeddings using two measures: (i) position centrality to maintaining the order of sentences where events are located, and (ii) degree centrality that counts the number of prior relations of each event. The motivation is that a central event usually summarizes the main content at the beginning and almost all the other events are relevant to it. Then, we use the centrality-aware event embeddings for central event prediction. Evaluated on our central event annotations, we found that this centrality modeling method is feasible and effective, with potential for further improvement. + +For the second challenge, based on the general GNN-based DECI model, our proposed EIG unifies both event and event-pair graphs, so that we can reason over not only available causal structures but also high-order event relations. Particularly, there are three types of edges. First, two event pair nodes shall be connected if they share a common event, so that their relational information can be fused for transitivity. Second, we connect event nodes to their corresponding event pair nodes to enhance event embeddings with high-order reasoning. Moreover, the edge types will be further distinguished according to whether the event node is a central event or not. Third, EIG is also scalable to prior event relations (e.g., coreference) that connect event nodes if available. + +Our contributions can be summarized as follows: + +- We propose to consider causal structures (i.e., event centrality and coreference) and manually annotate central events for investigation. +- We design an EIG and propose a novel DECI framework CHEER for effective reasoning at the document level. + +- Extensive experiments on two benchmark datasets validate the effectiveness of CHEER (5.9% F1 gains on average). + +# 2 Related Work + +# 2.1 Sentence-level ECI + +Early feature-based methods explore different resources for causal expressions, such as lexical and syntactic patterns (Riaz and Girju, 2013, 2014b,a), causality cues or markers (Do et al., 2011; Hidey and McKeown, 2016), temporal patterns (Ning et al., 2018), statistical information (Hashimoto et al., 2014; Hu et al., 2017), and weakly supervised data (Hashimoto, 2019; Zuo et al., 2021b). Recently, some methods have leveraged Pre-trained Language Models (PLMs) for the ECI task and have achieved promising performance (Kadowaki et al., 2019; Liu et al., 2020; Zuo et al., 2020). To deal with implicit causal relations, Cao et al. (2021) incorporate external knowledge from ConceptNet (Speer et al., 2017), and Zuo et al. (2021a) learn context-specific causal patterns from external causal statements. + +# 2.2 Document-level ECI + +Following the success of sentence-level natural language understanding, many tasks are extended to the entire document, such as relation extraction (Yao et al., 2019), natural language inference (Yin et al., 2021), and event argument extraction (Ma et al., 2022). DECI poses new challenges to cross-sentence reasoning and the lack of clear causal indicators. Gao et al. (2019) propose a feature-based method that uses Integer Linear Programming (ILP) to model the global causal structures. DSGCN (Zhao et al., 2021) uses a graph inference mechanism to capture interaction among events. RichGCN (Tran Phu and Nguyen, 2021) constructs an even graph and uses GCN (Kipf and Welling, 2017) to capture relevant connections. However, noise may be introduced in the construction of edges and the interdependency among event pairs is neglected. ERGO (Chen et al., 2022) builds a relational graph and model interaction between event pairs. Although intuitive, some meaningful event relations such as coreference are ignored. Compared with them, CHEER could capture high-order interactions among event pairs automatically while being compatible with prior event relations. Moreover, we consider the centrality of events to conduct global reasoning. + +![](images/55e63a87a369f5106438d1cbdea4859a326588b4dff86012732fa3f25d396659.jpg) +Figure 2: An overview of our proposed Centrality-aware High-order Event Reasoning Network (CHEER). + +# 3 Methodology + +Given document $\mathcal{D}$ and all its events, DECI is to predict whether there is a causal relation between any two event mentions $e_i$ and $e_j$ in $\mathcal{D}$ . As shown in Figure 2, our proposed CHER includes four main components: (1) Document Encoder to encode the document and output contextualized representations of events; (2) Event Interaction Graph that builds a graph including event nodes and event pair nodes for document-level reasoning. (3) Event Centrality Incorporation that incorporates event centrality information through two aspects. (4) EIG Reasoning Network that improves the quality of event and event pair representations by conducting inference over EIG, and then combines two types of node embeddings for final classification. + +# 3.1 Document Encoder + +Given document $\mathcal{D} = [x_t]_{t=1}^{L_{\mathcal{D}}}$ where $\mathcal{D}$ can be of any length $L_{\mathcal{D}}$ , the document encoder aims to output the contextualized document and event representations. Almost arbitrary PLMs can serve as the encoder. In this paper, we leverage pre-trained BERT (Devlin et al., 2019) as a base encoder to obtain the contextualized embeddings. Following conventions (Chen et al., 2022), we add special tokens at the start and end of $\mathcal{D}$ (i.e., “[CLS” and “[SEP”), and insert additional special tokens “” and “” at the start and end of all the events to mark the event positions. Then, we have: + +$$ +H = \left[ h _ {1}, h _ {2}, \dots , h _ {L _ {\mathcal {D}}} \right] = \operatorname {E n c o d e r} \left(\left[ x _ {1}, x _ {2}, \dots , x _ {L _ {\mathcal {D}}} \right]\right), \tag {1} +$$ + +where $h_i \in \mathbb{R}^d$ is the output embedding of token $x_i$ . Then, we use the embedding of the token "[CLS]" for document representation and the embedding of the token "" for event representation. + +Considering BERT's original limits that it cannot handle documents longer than 512, we leverage a dynamic window mechanism to deal with it. Specifically, we divide $\mathcal{D}$ into several overlapping spans according to a specific step size and input them into BERT separately. For the same event occurring in different spans, we calculate the average of all the embeddings of the corresponding token “” to obtain the final event representation $h_{e_i}$ for event $i$ . + +# 3.2 Event Interaction Graph + +Our EIG could not only perform high-order inference among event pairs but also be compatible with prior event relations. Specifically, given all the events of document $\mathcal{D}$ , we formulate EIG as: $\mathcal{G} = \{\mathcal{V},\mathcal{E}\}$ , where $\mathcal{V}$ is the set of nodes, $\mathcal{E}$ is the set of edges. There are two types of nodes in $\mathcal{V}$ : the nodes for a single event $\mathcal{V}_1$ and the nodes to represent a pair of events $\mathcal{V}_2$ . Each node in $\mathcal{V}_2$ is constructed by combining any two events of $\mathcal{D}$ . + +For global inference, we introduce three main types of edges in $\mathcal{E}$ : (1) (Event pair) - (event pair) edges $\mathcal{E}_1$ for two event pairs that share at least one event, e.g., the green line of (FIRE, collapsed)-(collapsed, repairs) in Figure 2, which is motivated by the causal transitivity described in Introduction; and (2) Event - (event pair) edges $\mathcal{E}_2$ for an event pair and its corresponding two events, e.g., the pink line of FIRE-(FIRE, collapsed) in Figure 2. (3) Event - event edges $\mathcal{E}_3$ for prior event relations obtained by external knowledge or tools (this type of edge is optional). Take coreference edges as an example (the yellow line of FIRE-fire in Figure 2), they are helpful for causal reasoning, since there is no causal relation between coreference events themselves. Moreover, coreference events shall have the + +same causal relations between other events, which is so-called coreference consistency. Therefore, both coreference consistency and causal transitivity can be regarded as a kind of high-order reasoning. + +# 3.3 Event Centrality Incorporation + +Considering the centrality of events is based on the motivation that the central event should play a more important role in global inference. In this section, we introduce two aspects for incorporating event centrality information into our model. First, we propose centrality-aware event embeddings, which could be used to predict whether an event is a central event. Obtained the contextualized event embeddings $h_{e_i}$ output by the document encoder, we perform the following two different centrality encoding modules: + +Position Centrality Encoding which assigns each event an embedding vector $c_{\mathrm{pos}} \in \mathbb{R}^d$ according to which sentence the event locates in the document. We initialize the vector randomly for each position. The motivation is central events often appear in the front of the document to summarize the core gist. For example, in Figure 2, the first sentence of the document outlines the main context of story and contains the central event FIRE. + +Degree Centrality Encoding which assigns each event an embedding vector $c_{\mathrm{deg}} \in \mathbb{R}^d$ according to the degree of its corresponding event node in EIG. We initialize the vector randomly for each degree. Intuitively, central events are throughout the document with many repeated mentions. Thus, central events will have a greater degree. For example in Figure 2, the degree of central event FIRE is greater than that of event collapsed, due to it has two coreference events blaze and fire. + +As the centrality encoding is applied to each event, we directly add it to the event contextualized embeddings. Formally, for an event $e_i$ and its corresponding embedding $h_{e_i}$ , the final centrality-aware event embeddings is obtained by: + +$$ +c _ {e _ {i}} = h _ {e _ {i}} + c _ {\operatorname {p o s} \left(e _ {i}\right)} + c _ {\deg \left(e _ {i}\right)}, \tag {2} +$$ + +where $c_{\mathrm{pos}}$ , $c_{\mathrm{deg}}$ are obtained by the position and degree centrality encoding of $e_i$ , respectively. + +Central Events Prediction and EIG Enhancement Once obtained the centrality-aware event embeddings, we use them to predict whether an event is a central event: $p_{e_i} = f(c_{e_i}\mathbf{W}_c)$ , where $f$ denotes the sigmoid function, $\mathbf{W}_c\in \mathbb{R}^{d\times 1}$ is + +the parameter weight matrix. if $p_{e_i}$ is greater than 0.5, we will regard $e_i$ as a central event. Then, we increase the type of edges in $\mathcal{E}$ : we further divide the event - (event pair) edges into central event - (event pair) edges $\mathcal{E}_{21}$ and normal event - (event pair) edges $\mathcal{E}_{22}$ , and so does the event-event edges. In this way, the interaction of central events on EIG could have more of a special influence. + +Central Events Annotation We manually annotate central events on the public dataset EventStoryLine to investigate the effect of centrality. In specific, we annotate central events considering the following rules: (1) the central events should be the focus of the story; (2) almost all other events described in the document should be related to it; (3) the coreference of central events will be regarded as central events, too; (4) on the premise of expressing the main content of the document correctly and completely, the number of central events should be as small as possible. According to the rules, we have three annotators to complete the task. Each document was annotated by two junior annotators independently. If the answers of the two annotators were inconsistent, a senior annotator checked the answers and made the final decision. The average inter-annotator agreement is $86.4\%$ (Cohen's kappa). For 258 documents of EventstoryLine, we get 352 central events, of which 166 documents have one central event, 90 documents have two central events, and only 2 documents have three central events (these documents have more than 30 sentences and introduce several independent events). Then, we use the labels to train the model to predict central events: + +$$ +\mathcal {L} _ {1} = - \sum_ {e _ {i} \in \mathcal {D}} \log \left(p _ {e _ {i}}\right). \tag {3} +$$ + +More analysis can be seen in Section 4.5. + +# 3.4 EIG Reasoning Network + +In this section, we first describe a general GNN-based DECI model, then instantiate our implementation by considering causal structures. Finally, we provide a unified view for better understanding and discussing existing models. + +A General GNN-based DECI Model To predict whether there is a causal relation between events $e_i$ and $e_j$ , we concatenate “[CLS]” embeddings of the document, the event features $z_i$ , $z_j$ , event pair features $z_k$ , and define the probability of being + +causal relation as follows: + +$$ +p _ {e _ {i, j}} = f \left(\left[ h _ {[ \mathrm {C L S} ]} | | z _ {i} | | z _ {j} | | z _ {k} \right] \mathbf {W} _ {p}\right), \tag {4} +$$ + +where $f$ denotes the softmax function, $\parallel$ denotes concatenation, $\mathbf{W}_p$ is the parameter weight matrix. Event-related features are typically initialized with contextualized embeddings via PLM in Section 3.1 and enhanced through $L$ -layer GNN reasoning. The $l$ -th layer takes a set of node embeddings $\mathbf{Z}^{(l)} \in \mathbb{R}^{N \times d_{\mathrm{in}}}$ as input, and outputs a new set of node embeddings $\mathbf{Z}^{(l+1)} \in \mathbb{R}^{N \times d_{\mathrm{out}}}$ , where $N = |\mathcal{V}_1| + |\mathcal{V}_2|$ is the number of nodes, $d_{\mathrm{in}}$ and $d_{\mathrm{out}}$ are the dimensions of input and output embeddings, respectively. Formally, the output of the $l$ -th layer for node $v_i$ can be written as: + +$$ +z _ {i} ^ {(l + 1)} = \sigma \left(\sum_ {j \in \mathcal {N} _ {i}} g \left(z _ {i} ^ {(l)}, z _ {j} ^ {(l)}\right)\right), \tag {5} +$$ + +where $\sigma$ denotes non-linearity, $\mathcal{N}_i$ denotes the set that contains all the first-order neighbors of $v_{i}$ , $g$ denotes how to aggregate neighborhood information. By stacking multiple layers $L$ , multi-hop reasoning could be reached. + +# EIG Reasoning Network Instantiation + +Event & Event-pair Features For an event node $e_i$ , we directly take the centrality-aware event embeddings for its initialization: + +$$ +z _ {i} ^ {(0)} = c _ {e _ {i}} \mathbf {W} _ {t}, v _ {i} \in \mathcal {V} _ {1}, \tag {6} +$$ + +where 0 denotes the initial state for the following neural layers, $\mathbf{W}_t\in \mathbb{R}^{d\times 2d}$ is a parameter weight matrix to make event nodes be the same size as the following event pair nodes for efficient computing. + +As for an event pair node $(e_i, e_j) \to v_k$ , we concatenate their corresponding two contextualized event embeddings as the event pair node features: + +$$ +z _ {k} ^ {(0)} = \left[ h _ {e _ {i}} \| h _ {e _ {j}} \right], v _ {k} \in \mathcal {V} _ {2}, \tag {7} +$$ + +EIG Reasoning It is intuitive that different types of edges represent various semantics contributing differently to the causality prediction. To handle this heterogeneity issue, EIG Reasoning Network incorporates the edge features with a self-attention mechanism during aggregation. Specifically, let $T$ denote the number of edge types in EIG. We incorporate the edge features and learn a scalar $\gamma_{t}$ ( $1 \leq t \leq T$ ) for each different type of edge to measure their importance: + +$$ +\gamma_ {t} = r _ {t} \mathbf {W} _ {r}, \tag {8} +$$ + +where $r_t \in \mathbb{R}^{1 \times d}$ is the edge feature specified by the edge type $t$ , $\mathbf{W}_r \in \mathbb{R}^{d \times 1}$ is parameter vector according to $t$ . In this way, we could adaptively adjust the interaction strength between two adjacent nodes by weighing different types of connections with $\gamma_t$ . $\gamma_t$ will be automatically learned. + +Figure 2 illustrates an example of the entire process of CHEER (here we take a sub-graph of EIG for brevity). Different colors of edges indicate different connection types in EIG. Edges with the same color (i.e., the same edge type) will use the same $\gamma_{t}$ . Each layer has its own set of $\gamma_{t}^{(l)}$ . Then we could instantiate the aggregation function $g$ as: + +$$ +g \left(z _ {i} ^ {(l)}, z _ {j} ^ {(l)}\right) = f \left(\gamma_ {t} ^ {(l)} + \alpha_ {i j} ^ {(l)}\right) \left(z _ {j} ^ {l} \mathbf {W} _ {v} ^ {(l)}\right), \tag {9} +$$ + +where $f$ denotes the softmax function, $\mathbf{W}_v^{(l)}\in$ $\mathbb{R}^{d_{\mathrm{in}}\times d_{\mathrm{out}}}$ is the parameter weight matrix. $\alpha_{ij}$ is computed by a shared self-attention mechanism (Vaswani et al., 2017) to measure the importance of neighbor $j$ to $i$ , where $\mathbf{W}_q,\mathbf{W}_k\in$ $\mathbb{R}^{d_{\mathrm{in}}\times d_{\mathrm{out}}}$ are parameter weight matrices: + +$$ +\alpha_ {i j} = \frac {\left(z _ {i} \mathbf {W} _ {q}\right) \left(z _ {j} \mathbf {W} _ {k}\right) ^ {T}}{\sqrt {d _ {\text {o u t}}}}. \tag {10} +$$ + +As shown in Figure 2, the above process can be organized as a matrix multiplication to compute representations for all the nodes simultaneously through a weighted adjacency matrix. Denote $\mathbf{A}_{ij}$ as the $(i,j)$ -element of the binary adjacency matrix $\mathbf{A}$ , $\mathbf{A}_{ij}$ is 1 if there is an edge between nodes $v_{i}$ and $v_{j}$ or 0 otherwise. We could compute each entry of the edge-aware adjacency matrix as follows, where $\delta_{ij} = f(\gamma_t^{(l)} + \alpha_{ij}^{(l)})$ is the normalized weight: + +$$ +\mathbf {A} _ {i j} ^ {\prime (l)} = \delta_ {i j} \mathbf {A} _ {i j}, \tag {11} +$$ + +Figure 2 shows that the corresponding neighbor node features are aggregated with different weights according to $\delta_{ij}$ to obtain the representation of the target node. Finally, the node representations of layer $l$ can be obtained by: + +$$ +\mathbf {Z} ^ {(l + 1)} = \sigma \left(\mathbf {A} ^ {\prime (l)} \mathbf {Z} ^ {(l)} \mathbf {W} _ {v} ^ {(l)}\right). \tag {12} +$$ + +# 3.5 Training + +Following ERGO (Chen et al., 2022), we adopt the focal loss (Lin et al., 2017) to alleviate the false-negative issue (i.e., the number of negative samples during training far exceeds that of positives). We adopt the $\beta$ -balanced variant of focal loss, which + +introduces a weighting factor $\beta$ in [0,1] for the class "positive" and $1 - \beta$ for the class "negative". The loss function $\mathcal{L}_2$ can be written as: + +$$ +\mathcal {L} _ {2} = - \sum_ {e _ {i}, e _ {j} \in \mathcal {D}} \beta_ {e _ {i, j}} \left(1 - p _ {e _ {i, j}}\right) ^ {\tau} \log \left(p _ {e _ {i, j}}\right), \tag {13} +$$ + +where $\tau$ is the focusing hyper-parameter, $\beta$ is a weighting hyper-parameter and its value is related to the ratio of positive and negative samples. + +Besides, we find that predicting causal and coreference relations jointly brings benefits. A support point for this is that these two types of relations are mutually exclusive. Thus, we leverage the coreference information and perform a ternary classification training, i.e., to predict the label of each sample as a causal relation class, a coreference relation class, or no relation class (negative samples). + +The final loss function combines event centrality and causality learning, where $\lambda$ is a hyperparameter: + +$$ +\mathcal {L} = \lambda \mathcal {L} _ {1} + \mathcal {L} _ {2}, \tag {14} +$$ + +# 3.6 A Unified View of GNN-based DECI Methods + +CHEER is a general framework that first constructs a document-level graph, then incorporates event centrality, and finally conducts reasoning on the graph. In this section, we discuss the difference between CHEER and previous GNN-based DECI methods. Note that only CHEER considers joint training, and we do not discuss loss function here. + +(1) RichGCN (Tran Phu and Nguyen, 2021) has only event nodes and uses vanilla GCN's aggregation function: $g\left(z_{i}^{(l)},z_{j}^{(l)}\right) = z_{j}^{l}\mathbf{W}_{v}^{(l)}$ . By removing: i) event centrality incorporation, ii) event pair nodes and their relevant edges, iii) edge features and self-attention mechanism, CHEER could degenerate into RichGCN's framework. +(2) DSGCN (Zhao et al., 2021) has only event nodes and uses a combination of GCNs: $g\left(z_{i}^{(l)},z_{j}^{(l)}\right) = \sum_{k = 1}^{K}\alpha_{k}z_{j}^{l}\mathbf{W}_{v}^{(l,k)}$ , where $\alpha_{k}$ denotes a feature filter. By removing: i) event centrality incorporation, ii) event pair nodes and their relevant edges, iii) edge features and modifying $g$ accordingly, CHEER is scalable to DSGCN. +(3) ERGO (Chen et al., 2022) has only event-pair nodes and performs self-attention aggregation: $g\left(z_{i}^{(l)},z_{j}^{(l)}\right) = f(\alpha_{ij}^{(l)})(z_{j}^{l}\mathbf{W}_{v}^{(l)})$ . By removing i) event centrality incorporation, ii) event nodes and their relevant edges, and iii) edge features, CHEER could degenerate into ERGO's framework. + +Therefore, by modifying the event centrality incorporation, the construction of EIG, and the aggregation function, CHEER can degenerate into different GNN-based DECI methods, and thus provide a unified view for better document-level reasoning. + +# 4 Experiments + +# 4.1 Experimental Setup + +Datasets Details We evaluate CHEER on two widely used datasets. EventStoryLine (version 0.9) (Caselli and Vossen, 2017) contains 22 topics, 258 documents, and 5,334 events. Among them, 1,770 intra-sentence and 3,885 inter-sentence event pairs are annotated with causal relations. Following Gao et al. (2019), we group documents according to their topics. Documents in the last two topics are used as the development data, and documents in the remaining 20 topics are employed for 5-fold cross-validation. Causal-TimeBank (Mirza, 2014) contains 184 documents and 6,813 events. Among them, 318 event pairs are annotated with causal relations. Following Tran Phu and Nguyen (2021), we employ 10-fold cross-validation and only evaluate ECI performance for intra-sentence event pairs because the number of inter-sentence event pairs in Causal-TimeBank is quite small (i.e., only 18 pairs). EventStoryLine provides ground-truth event coreference chains, but Causal-TimeBank does not. To solve this, we have preprocessing steps on Causal-TimeBank. We first perform pre-training on EventStoryLine, and then use the pre-trained model to extract coreference data for Causal-TimeBank. We also use the Stanford CoreNLP toolkit (Manning et al., 2014) for a supplement. After the preprocessing steps, we add event-event coreference edges $\mathcal{E}_3$ to EventStoryLine and Causal-TimeBank. We perform a joint training in Section 3.5 on EventStoryLine. In evaluation, we only report and compare the prediction results of causal relations with baselines. + +Implementation Details We set the dynamic window size in Section 3.1 to 256, and divide documents into several overlapping windows with a step size of 32. We implement our method based on the Pytorch version of Huggingface Transformer (Wolf et al., 2020). We use uncased BERT-base (Devlin et al., 2019) as the document encoder. We optimize our model with AdamW (Loshchilov and Hutter, 2019) using a learning rate of 2e-5 with a linear warm-up for the first $8\%$ steps. We apply layer nor + +malization (Ba et al., 2016) and dropout (Srivastava et al., 2014) between the EIG reasoning network layers. We clip the gradients of model parameters to a max norm of 1.0. We perform early stopping and tune the hyper-parameters by grid search based on the development set performance: dropout rate $\in$ {0.1, 0.2, 0.3}, focusing parameter $\tau \in$ {0, 1, 2, 3}, weighting factor $\beta \in$ {0.25, 0.5, 0.75}, loss weight $\lambda \in$ {0.1, 0.2}. Our model is trained on an NVIDIA RTX 2080 GPU with 24GB memory. + +Evaluation Metrics We adopt Precision (P), Recall (R), and F1-score (F1) as evaluation metrics, same as previous methods (Tran Phu and Nguyen, 2021) to ensure comparability. + +# 4.2 Baselines + +We compare our proposed CHEER with various state-of-the-art SECI and DECI methods. + +SECI Baselines (1) KMMG (Liu et al., 2020), a mention masking generalization method using external knowledge. (2) KnowDis (Zuo et al., 2020), a knowledge-enhanced distant data augmentation method to alleviate the data lacking problem. (3) CauSeRL (Zuo et al., 2021a), which learns context-specific causal patterns from external causal statements. (4) LearnDA (Zuo et al., 2021b), which uses knowledge bases to augment training data. (5) LSIN (Cao et al., 2021), which constructs a descriptive graph to leverage external knowledge. + +DECI Baselines (1) OP (Caselli and Vossen, 2017), a dummy model that assigns causal relations to event pairs. (2) $\mathbf{LR}+$ and LIP (Gao et al., 2019), feature-based methods that construct document-level structures and use various types of resources. (3) BERT (our implementation) a baseline method that leverages dynamic window and event marker techniques. (4) RichGCN (Tran Phu and Nguyen, 2021), which constructs a document-level interaction graph and uses GCN to capture relevant connections. (5) ERGO (Chen et al., 2022), which builds a relational graph and model interaction between event pairs. We compare with its BERT-base implementation for fairness. Due to DSGCN (Zhao et al., 2021) does not provide results on benchmark datasets and does not release codes, we do not compare with it here. + +# 4.3 Overall Results + +Since some baselines can not handle the intersentence scenarios in EventStoryLine, and the + +
ModelEventStoryLineCausal-TimeBank
P(%)R(%)F1(%)P(%)R(%)F1(%)
OP22.598.636.6---
LR+37.045.240.7---
LIP38.852.444.6---
KMMG[○]41.962.550.136.655.644.1
KnowDis[○]39.766.549.742.360.549.8
LSIN[○]47.958.152.551.556.253.7
LearnDA[○]42.269.852.641.968.051.9
CauSeRL[○]41.969.052.143.668.153.2
BERT[○]47.857.252.147.655.151.1
RichGCN[○]49.263.055.239.756.546.7
ERGO[○]49.772.659.058.460.559.4
CHEER[○]56.969.662.656.469.562.3
+ +Table 1: Models' intra-sentence performance on EventStoryLine and Causal-TimeBank, the best results are in bold and the second-best results are underlined. [○] denotes models that use pre-trained BERT-base encoders. Overall, CHEER outperforms previous SOTA methods with a significant test at the level of 0.05. + +
ModelInter-sentenceIntra + Inter
P(%)R(%)F1(%)P(%)R(%)F1(%)
OP8.499.515.610.599.219.0
LR+25.248.133.127.947.235.1
LIP35.148.240.636.249.541.9
BERT[○]36.829.232.641.338.339.7
RichGCN[○]39.245.742.242.651.346.6
ERGO [○]43.248.845.846.350.148.1
CHEER[○]45.252.148.449.753.351.4
+ +Table 2: Model's inter and (intra+inter)-sentence performance on EventStoryLine. + +number of inter-sentence event pairs in CausalTimeBank is quite small (i.e., only 18 pairs). Thus we report the results of intra- and inter-sentence settings separately. + +Intra-sentence Evaluation From Table 1, we can observe that: (1) CHEER outperforms all the baselines by a large margin on both datasets, which demonstrates its effectiveness. (2) Compared with feature-based methods OP, LR+, and LIP, models using PLMs far boost the performance, which verifies that BERT could extract useful text features for the ECI task. We notice that OP achieves the highest Recall on EventStoryLine, which may be due to simply assigning causal relations by mimicking the textual order. This leads to many false positives and thus a low Precision. + +Inter-sentence Evaluation From Table 2, we can observe that: (1) CHEER greatly outperforms all + +
ModelIntraInterIntra + Inter
CHEER62.648.451.4
w/o event centrality60.346.349.3
w/o edge features61.447.650.4
w/o coref60.846.950.1
+ +Table 3: F1 results of ablation study on EventStoryLine. + +the baselines under both inter- and (intra+inter)-sentence settings. This demonstrates that CHEER can make better document-level inferences via our effective modeling over EIG. (2) the overall F1-score of the inter-sentence setting is much lower than that of the intra-sentence, which shows the challenge of DECI where events scatter in the document without clear causal indicators. Specifically, the BERT baseline could achieve competitive performance under the intra-sentence setting. However, it performs much worse than LIP, RichGCN, ERGO, and CHEER under inter-sentence settings, which indicates that a document-level structure or graph helps capture the global interactions for causal relation prediction. + +# 4.4 Ablation Study + +To analyze the effect of each main component proposed in CHEER, we consider evaluating the following ablated models on the EventStoryLine dataset. As shown in Table 3: (1) Effect of Event Centrality (w/o event centrality), which removes event centrality incorporation introduced in Section 3.3. Removing event centrality leads to information loss from the document to the graph. The performance degradation proves our contribution to preserving the event centrality information. (2) Effect of Edge Features (w/o edge features), which does not incorporate the edge features in Section 3.4 and thus the learnable scalar $\gamma_{t}$ is removed in aggregation function. We can see that removing the edge-aware scalar clearly decreases the performance, which validates the necessity of capturing the semantic information of different edge features in EIG. (3) Effect of Coreference (w/o coref), which removes the $\mathcal{E}_3$ edges in EIG and does not use the ground-truth coreference chains as auxiliary training labels. The results indicate that the prior coreference information is helpful for the DECI task and supports us to unify event and event-pair graphs. + +![](images/85d8f4adba054b2360cc7fadd890db4d0d470a42ce23e7e259815dedd471fc95.jpg) +Figure 3: DECI performance of using different ways of event causality incorporation and the according F1 results of central event prediction. + +# 4.5 Event Centrality Investigation + +We further analyze the role of central events in the DECI task and the effect of our incorporation ways. + +# 4.5.1 Role of Central Events + +In Figure 3, the histograms represent the F1 results of CHEER under intra/intra+inter settings on EventStoryLine. Three different groups represent three different ways of event causality incorporation, and the lines represent F1 results of central events prediction under three ways: (1) w/o event centrality, which removes the event centrality incorporation introduced in Section 3.3; (2) CHEER, the original incorporation way; (3) w/ g-t central events, which preserves centrality-aware event embeddings as event node features initialization but uses ground-truth central event labels to distinguish edge types. It can be seen that the F1 result of our central event classification reaches nearly $80\%$ , which is feasible and still has space for improvement. We also observe that compared with using ground-truth labels, the inaccuracy of event centrality prediction limits the performance of DECI. Nevertheless, the performance of event centrality prediction could be higher by using more advanced encoding methods. + +# 4.5.2 Case Study + +In this section, we conduct a case study to further illustrate an intuitive impression of CHEER and choose the SOTA baseline ERGO for comparison. In Figure 3, we show a piece of text with five events, where quake is the central event (with a coreference earthquake) We notice that: (1) ERGO cannot + +'Several die' in south Iran quake November 27, 2005 + +A powerful earthquake has hit southern Iran, destroying several villages and killing at least three people and injuring others, according to reports. + +
No.Event PairGTERGOCHEER
1(quake, die)YesYesYes
2(die, destroying)NoNoNo
3(quake, destroying)YesNoYes
4(earthquake, die)YesNoYes
+ +![](images/c17a0975d873ae0f8fa972fe3540c372031ce4f774f5a38a72bb06017fee116f.jpg) +Figure 4: A case study of CHEER. + +![](images/d90257f486a6d801a5c9bc2131a9cb54cfcfa778b86ab92cfdd73591770008bf.jpg) + +achieve the coreference consistency (No.1 and 4 event pairs), but CHEER could solve this explicitly by introducing prior relations and joint training. (2) ERGO could suffer from the false negative issue (No.3 event pair). For example when (quake, destroying) receives positive prediction from (quake, die) but negative prediction from (die, destroying), it tends to think the transitivity does not hold and outputs a wrong prediction. In contrast, CHEER blocks the propagation over these misleading paths by making central events take effect. 3) In the bottom graph, we visualize the normalized weights $\delta$ of Equation (11) with (left part) and without event centrality information (right part). For clarity, we only show some main nodes and edges here. We could see that when there is no event centrality incorporation, the $\delta$ values of neighboring nodes to (quake, destroying) are relatively even, which makes its prediction disturbed by negative paths, i.e., information from (die, destroying) node. When the event centrality is incorporated, (quake, destroying) pays more attention to the paths where central events are involved, i.e., quake node and (quake, die) node. Therefore, CHEER can learn more from such informative neighbors for the DECI task. + +# 5 Conclusion + +In this paper, we propose a novel centrality-aware high-order event reasoning network (CHEER) to conduct global reasoning for DECI. We first summarize a general GNN-based DECI model and provide a unified view for better understanding. Then we design an Event Interaction Graph (EIG) that involves prior event relations and high-order interactions among event pairs. Finally, we incorpo + +rate event centrality via well-designed features and multi-task learning. Extensive experiments show a great improvement of CHEER for both intra- and inter-sentence ECI on two benchmark datasets. Further analysis demonstrates the effectiveness of each main component. + +# Limitations + +Although our modeling of event centrality is feasible and effective, there is still space for improvement. The performance of event centrality prediction could be higher by using more advanced encoding methods. + +Besides, it is meaningful to further explore the interactions among various types of event relations. Existing datasets only cover limited relation types at once, and many works focus on the identification of causal relations alone. In this paper, although we further consider the effect of coreference relations and perform joint classification, there are still some other relations that can be explored, such as temporal relations, subevent relations, etc. + +# Acknowledgments + +This work was supported by the Singapore Ministry of Education (MOE) Academic Research Fund (AcRF) Tier 1 grant, as well as cash and in-kind contribution from the industry partner(s). + +# References + +Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. 2016. Layer normalization. ArXiv preprint, abs/1607.06450. +Long Bai, Saiping Guan, Jiafeng Guo, Zixuan Li, Xiaolong Jin, and Xueqi Cheng. 2021. Integrating deep event-level and script-level information for script event prediction. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 9869-9878, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Pengfei Cao, Xinyu Zuo, Yubo Chen, Kang Liu, Jun Zhao, Yuguang Chen, and Weihua Peng. 2021. Knowledge-enriched event causality identification via latent structure induction networks. 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 4862-4872, Online. Association for Computational Linguistics. +Tommaso Caselli and Piek Vossen. 2017. The event StoryLine corpus: A new benchmark for causal and + +temporal relation extraction. In Proceedings of the Events and Stories in the News Workshop, pages 77-86, Vancouver, Canada. Association for Computational Linguistics. +Meiqi Chen, Yixin Cao, Kunquan Deng, Mukai Li, Kun Wang, Jing Shao, and Yan Zhang. 2022. Ergo: Event relational graph transformer for document-level event causality identification. arXiv preprint arXiv:2204.07434. +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. +Quang Do, Yee Seng Chan, and Dan Roth. 2011. Minimally supervised event causality identification. In Proceedings of the 2011 Conference on Empirical Methods in Natural Language Processing, pages 294-303, Edinburgh, Scotland, UK. Association for Computational Linguistics. +Lei Gao, Prafulla Kumar Choubey, and Ruihong Huang. 2019. Modeling document-level causal structures for event causal relation identification. 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 1808-1817, Minneapolis, Minnesota. Association for Computational Linguistics. +Chikara Hashimoto. 2019. Weakly supervised multilingual causality extraction from Wikipedia. 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 2988-2999, Hong Kong, China. Association for Computational Linguistics. +Chikara Hashimoto, Kentaro Torisawa, Julien Kloetzer, Motoki Sano, István Varga, Jong-Hoon Oh, and Yutaka Kidawara. 2014. Toward future scenario generation: Extracting event causality exploiting semantic relation, context, and association features. In Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 987-997, Baltimore, Maryland. Association for Computational Linguistics. +Christopher Hidey and Kathy McKeown. 2016. Identifying causal relations using parallel Wikipedia articles. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1424-1433, Berlin, Germany. Association for Computational Linguistics. +Zhichao Hu, Elahe Rahimtoroghi, and Marilyn Walker. 2017. Inference of fine-grained event causality from + +blogs and films. In Proceedings of the Events and Stories in the News Workshop, pages 52-58, Vancouver, Canada. Association for Computational Linguistics. +Kazuma Kadowaki, Ryu Iida, Kentaro Torisawa, Jong-Hoon Oh, and Julien Kloetzer. 2019. Event causality recognition exploiting multiple annotators' judgments and background knowledge. 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 5816-5822, Hong Kong, China. Association for Computational Linguistics. +Thomas N. Kipf and Max Welling. 2017. Semi-supervised classification with graph convolutional networks. In 5th International Conference on Learning Representations, ICLR 2017, Toulouse, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net. +Tsung-Yi Lin, Priya Goyal, Ross B. Girshick, Kaiming He, and Piotr Dólar. 2017. Focal loss for dense object detection. In IEEE International Conference on Computer Vision, ICCV 2017, Venice, Italy, October 22-29, 2017, pages 2999-3007. IEEE Computer Society. +Jian Liu, Yubo Chen, and Jun Zhao. 2020. Knowledge enhanced event causality identification with mention masking generalizations. In Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence, IJCAI 2020, pages 3608-3614. ijcai.org. +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. +Yubo Ma, Zehao Wang, Yixin Cao, Mukai Li, Meiqi Chen, Kun Wang, and Jing Shao. 2022. Prompt for extraction? PAIE: Prompting argument interaction for event argument extraction. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 6759-6774, Dublin, Ireland. Association for Computational Linguistics. +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. +Paramita Mirza. 2014. Extracting temporal and causal relations between events. In Proceedings of the ACL 2014 Student Research Workshop, pages 10-17, Baltimore, Maryland, USA. 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. +Mehwish Riaz and Roxana Girju. 2013. Toward a better understanding of causality between verbal events: Extraction and analysis of the causal power of verb-verb associations. In Proceedings of the SIGDIAL 2013 Conference, pages 21–30, Metz, France. Association for Computational Linguistics. +Mehwish Riaz and Roxana Girju. 2014a. In-depth exploitation of noun and verb semantics to identify causation in verb-noun pairs. In Proceedings of the 15th Annual Meeting of the Special Interest Group on Discourse and Dialogue (SIGDIAL), pages 161-170, Philadelphia, PA, U.S.A. Association for Computational Linguistics. +Mehwish Riaz and Roxana Girju. 2014b. Recognizing causality in verb-noun pairs via noun and verb semantics. In Proceedings of the EACL 2014 Workshop on Computational Approaches to Causality in Language (CAtoCL), pages 48-57, Gothenburg, Sweden. Association for Computational Linguistics. +Jiaxin Shi, Shulin Cao, Lei Hou, Juanzi Li, and Hanwang Zhang. 2021. Transfernet: An effective and transparent framework for multi-hop question answering over relation graph. ArXiv preprint, abs/2104.07302. +Robyn Speer, Joshua Chin, and Catherine Havasi. 2017. Conceptnet 5.5: An open multilingual graph of general knowledge. In Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence, February 4-9, 2017, San Francisco, California, USA, pages 4444-4451. AAAI Press. +Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. 2014. Dropout: a simple way to prevent neural networks from overfitting. The journal of machine learning research, 15(1):1929-1958. +Yuan Sui, Shanshan Feng, Huaxiang Zhang, Jian Cao, Liang Hu, and Nengjun Zhu. 2022. Causality-aware enhanced model for multi-hop question answering over knowledge graphs. Knowledge-Based Systems, 250:108943. +Minh Tran Phu and Thien Huu Nguyen. 2021. Graph convolutional networks for event causality identification with rich document-level structures. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 3480-3490, 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. +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. +Yuan Yao, Deming Ye, Peng Li, Xu Han, Yankai Lin, Zhenghao Liu, Zhiyuan Liu, Lixin Huang, Jie Zhou, and Maosong Sun. 2019. DocRED: A large-scale document-level relation extraction dataset. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 764-777, Florence, Italy. Association for Computational Linguistics. +Wenpeng Yin, Dragomir Radev, and Caiming Xiong. 2021. DocNLI: A large-scale dataset for document-level natural language inference. In *Findings of the Association for Computational Linguistics: ACLIJCNLP* 2021, pages 4913-4922, Online. Association for Computational Linguistics. +Kun Zhao, Donghong Ji, Fazhi He, Yijiang Liu, and Yafeng Ren. 2021. Document-level event causality identification via graph inference mechanism. Information Sciences, 561:115-129. +Xinyu Zuo, Pengfei Cao, Yubo Chen, Kang Liu, Jun Zhao, Weihua Peng, and Yuguang Chen. 2021a. Improving event causality identification via self-supervised representation learning on external causal statement. In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, pages 2162-2172, Online. Association for Computational Linguistics. +Xinyu Zuo, Pengfei Cao, Yubo Chen, Kang Liu, Jun Zhao, Weihua Peng, and Yuguang Chen. 2021b. LearnDA: Learnable knowledge-guided data augmentation for event causality identification. 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 3558-3571, Online. Association for Computational Linguistics. +Xinyu Zuo, Yubo Chen, Kang Liu, and Jun Zhao. 2020. KnowDis: Knowledge enhanced data augmentation for event causality detection via distant supervision. In Proceedings of the 28th International Conference on Computational Linguistics, pages 1544-1550, Barcelona, Spain (Online). International Committee on Computational Linguistics. + +A For every submission: + +A1. Did you describe the limitations of your work? Limitations +A2. Did you discuss any potential risks of your work? Not applicable. Left blank. +A3. Do the abstract and introduction summarize the paper's main claims? Abstract & 1 Introduction +A4. Have you used AI writing assistants when working on this paper? Left blank. + +B Did you use or create scientific artifacts? + +4 Experiments + +B1. Did you cite the creators of artifacts you used? 4.1 Experimental Setup +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? Not applicable. Left blank. +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? 4.1 Experimental Setup +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? Not applicable. Left blank. +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? Not applicable. Left blank. +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. 4.1 Experimental Setup + +C Did you run computational experiments? + +4 Experiments + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? No response. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? +4.1 Experimental Setup +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? +4.3 Overall Results +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? +4.1 Experimental Setup + +# D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +3.3 Event Centrality Incorporation + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +3.3 Event Centrality Incorporation + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +Not applicable. Left blank. + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +Not applicable. Left blank. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +Not applicable. Left blank. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +Not applicable. Left blank. \ No newline at end of file diff --git a/cheercentralityawarehighordereventreasoningnetworkfordocumentleveleventcausalityidentification/images.zip b/cheercentralityawarehighordereventreasoningnetworkfordocumentleveleventcausalityidentification/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..aff952155a11711359f449d8f5e09697654ef7a0 --- /dev/null +++ b/cheercentralityawarehighordereventreasoningnetworkfordocumentleveleventcausalityidentification/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6adc3815e132a104d98905956ed8e82b03e841cd641e70c969f4c4b7f09dce62 +size 371335 diff --git a/cheercentralityawarehighordereventreasoningnetworkfordocumentleveleventcausalityidentification/layout.json b/cheercentralityawarehighordereventreasoningnetworkfordocumentleveleventcausalityidentification/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..f9dd20341690cf5c4f6b7cab509dfcd5017abc83 --- /dev/null +++ b/cheercentralityawarehighordereventreasoningnetworkfordocumentleveleventcausalityidentification/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5dff888fdd38b5760aafd45ffd101acdf71b40ace41e1efd0917b87783b873a4 +size 456985 diff --git a/citadelconditionaltokeninteractionviadynamiclexicalroutingforefficientandeffectivemultivectorretrieval/2e888237-5169-4c53-8ae0-bbc09a94bedc_content_list.json b/citadelconditionaltokeninteractionviadynamiclexicalroutingforefficientandeffectivemultivectorretrieval/2e888237-5169-4c53-8ae0-bbc09a94bedc_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..a1acd637c0932e18485d2847cd6cbe443601ae06 --- /dev/null +++ b/citadelconditionaltokeninteractionviadynamiclexicalroutingforefficientandeffectivemultivectorretrieval/2e888237-5169-4c53-8ae0-bbc09a94bedc_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6f16380f6afde298194c370d19b863593aed3b5ca651dd99c615006352de9239 +size 107548 diff --git a/citadelconditionaltokeninteractionviadynamiclexicalroutingforefficientandeffectivemultivectorretrieval/2e888237-5169-4c53-8ae0-bbc09a94bedc_model.json b/citadelconditionaltokeninteractionviadynamiclexicalroutingforefficientandeffectivemultivectorretrieval/2e888237-5169-4c53-8ae0-bbc09a94bedc_model.json new file mode 100644 index 0000000000000000000000000000000000000000..cfa9937f209a5275b455995114a03079c9c8b852 --- /dev/null +++ b/citadelconditionaltokeninteractionviadynamiclexicalroutingforefficientandeffectivemultivectorretrieval/2e888237-5169-4c53-8ae0-bbc09a94bedc_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9fadb132c7977916116f0a30da683f4c79aaa2a2ee85a76e68a0be7bd937b02d +size 135469 diff --git a/citadelconditionaltokeninteractionviadynamiclexicalroutingforefficientandeffectivemultivectorretrieval/2e888237-5169-4c53-8ae0-bbc09a94bedc_origin.pdf b/citadelconditionaltokeninteractionviadynamiclexicalroutingforefficientandeffectivemultivectorretrieval/2e888237-5169-4c53-8ae0-bbc09a94bedc_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9ba602ae2cd9ac95d3524fd6dc260cf142170ced --- /dev/null +++ b/citadelconditionaltokeninteractionviadynamiclexicalroutingforefficientandeffectivemultivectorretrieval/2e888237-5169-4c53-8ae0-bbc09a94bedc_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:81a8fb9a93528d8c50f97fe8dabd78921702b333b36ab588c1e75d15b7016b66 +size 845225 diff --git a/citadelconditionaltokeninteractionviadynamiclexicalroutingforefficientandeffectivemultivectorretrieval/full.md b/citadelconditionaltokeninteractionviadynamiclexicalroutingforefficientandeffectivemultivectorretrieval/full.md new file mode 100644 index 0000000000000000000000000000000000000000..e524c75509341d639a8bb2ad9ad0225e5997da9f --- /dev/null +++ b/citadelconditionaltokeninteractionviadynamiclexicalroutingforefficientandeffectivemultivectorretrieval/full.md @@ -0,0 +1,447 @@ +# CITADEL: Conditional Token Interaction via Dynamic Lexical Routing for Efficient and Effective Multi-Vector Retrieval + +Minghan Li $^{1*}$ , Sheng-Chieh Lin $^{1}$ , Barlas Oguz $^{2}$ , Asish Ghoshal $^{2}$ , Jimmy Lin $^{1}$ , Yashar Mehdad $^{2}$ , Wen-tau Yih $^{2}$ , and Xilun Chen $^{2\dagger}$ + +University of Waterloo1, Meta AI2 + +{m692li,s269lin,jimmylin}@uwaterloo.ca + +{barlaso, aghoshal, mehdad, scottyih, xilun}@meta.com + +# Abstract + +Multi-vector retrieval methods combine the merits of sparse (e.g. BM25) and dense (e.g. DPR) retrievers and achieve state-of-the-art performance on various retrieval tasks. These methods, however, are orders of magnitude slower and need more space to store their indexes compared to their single-vector counterparts. In this paper, we unify different multi-vector retrieval models from a token routing viewpoint and propose conditional token interaction via dynamic lexical routing, namely CITADEL, for efficient and effective multi-vector retrieval. CITADEL learns to route each token vector to the predicted lexical "keys" such that a query token vector only interacts with document token vectors routed to the same key. This design significantly reduces the computation cost while maintaining high accuracy. Notably, CITADEL achieves the same or slightly better performance than the previous state of the art, ColBERT-v2, on both in-domain (MS MARCO) and out-of-domain (BEIR) evaluations, while being nearly 40 times faster. Source code and data are available at https://github.com/facebookresearch/dpr-scale/tree/citadel. + +# 1 Introduction + +The goal of information retrieval (Manning et al., 2008) is to find a set of related documents from a large data collection given a query. Traditional bag-of-words systems (Robertson and Zaragoza, 2009; Lin et al., 2021a) calculate the ranking scores based on the query terms appearing in each document, which have been widely adopted in many applications such as web search (Nguyen et al., 2016; Noy et al., 2019) and open-domain question answering (Chen et al., 2017; Lee et al., 2019). Recently, dense retrieval (Karpukhin et al., 2020) based on + +![](images/7e588bd3d98f66e1a3cc9387f9f6083790a6fba6b99efa05b9eff6e998ec1e0b.jpg) +Figure 1: GPU latency vs ranking quality (MRR@10) on MS MARCO passages with an A100 GPU. The circle size represents the relative index storage on disk. All models are trained without hard-negative mining, distillation, or further pre-training. + +pre-trained language models (Devlin et al., 2019; Liu et al., 2019) has been shown to be very effective. It circumvents the term mismatch problem in bag-of-words systems by encoding the queries and documents into low-dimensional embeddings and using their dot product as the similarity score (Figure 2a). However, dense retrieval is less robust on entity-heavy questions (Sciavolino et al., 2021) and out-of-domain datasets (Thakur et al., 2021), therefore calling for better solutions (Formal et al., 2021b; Gao and Callan, 2022). + +In contrast, multi-vector retrieval has shown strong performance on both in-domain and out-of-domain evaluations by taking into account token-level interaction. Among them, ColBERT (Khattab and Zaharia, 2020) is arguably the most celebrated method that has been the state of the art on multiple datasets so far. However, its wider application is hindered by its large index size and high retrieval latency. This problem results from the redundancy in the token interaction of ColBERT where many tokens might not contribute to the sentence semantics at all. To improve this, COIL (Gao et al., 2021a) imposes an exact match constraint on ColBERT + +![](images/8b1b1c63e92e2deed7dc588aa552ff65105649c9b6e4fc74b9da44343b68e9d0.jpg) + +![](images/ecab5bafb2c41a9654f572b5e5c8098ddb247788bcc4bc694a68c322739c424b.jpg) + +![](images/1d441a2b41d9a5f02e940eec9dfc4507eff084e0fe412b5c90122223008b24bd.jpg) +(a) Single-vector retriever: no routing +(c) COIL: static lexical routing using exact match +Figure 2: A unified token routing view over different multi-vector and single-vector retrieval models. The cylinder in (d) represents the lexical key for token routing. The grey tokens in (c) and (d) represent the tokens that do not contribute to the final similarity. For (d), CITADEL routes "light", "theory", and "relativity" to the "Einstein" key to avoid term mismatch using a learned routing function. + +![](images/73baa1026e07ef35dacc7fe3bf9760de3778773346ff62b41cd16fb49ce8f16d.jpg) +(b) ColBERT: all-to-all routing +(d) CITADEL: dynamic lexical routing + +for conditional token interaction, where only token embeddings with the same token id could interact with each other. Although reducing the latency, the word mismatch problem reoccurs and the model may fail to match queries and passages that use different words to express the same meaning. + +In this paper, we first give a unified view of existing multi-vector retrieval methods based on token routing (Section 2), providing a new lens through which we expose the limitations of current models. Under the token routing view, ColBERT could be seen as all-to-all routing, where each query token exhaustively interacts with all passage tokens (Figure 2b). COIL, on the other hand, could be seen as static lexical routing using an exact match constraint, as each query token only interacts with the passage tokens that have the same token id as the query token (Figure 2c). + +In contrast, we propose a novel conditional token interaction method using dynamic lexical routing called CITADEL as shown in Figure 2d. Instead of relying on static heuristics such as exact match, we train our model to dynamically moderate token interaction so that each query token only interacts with the most relevant tokens in the passage. This is achieved by using a lexical router, trained end + +to-end with the rest of the model, to route each contextualized token embedding to a set of activated lexical "keys" in the vocabulary. In this way, each query token embedding only interacts with the passage token embeddings that have the same activated key, which is dynamically determined during computation. As we shall see in Section 5.1, this learning-based routing does not lose any accuracy compared to all-to-all routing while using fewer token interactions than COIL (Section 3.4), leading to a highly effective and efficient retriever. + +Experiments on MS MARCO passages (Nguyen et al., 2016) and TREC DL show that CITADEL achieves the same level of accuracy as ColBERT-v2. We further test CITADEL on BEIR (Thakur et al., 2021) and CITADEL still manages to keep up with ColBERT-v2 (Santhanam et al., 2022b) which is the current state of the art. As for the latency, CITADEL can yield an average latency of $3.21\mathrm{ms}$ /query on MS MARCO passages using an A100 GPU, which is nearly $40\times$ faster than ColBERT-v2. By further combining with product quantization, CITADEL's index only takes 13.3 GB on MS MARCO passages and reduces the latency to $0.9\mathrm{ms}$ /query as shown in Figure 1. + +# 2 A Unified Token Routing View of Multi-Vector Retrievers + +We outline a unified view for understanding various neural retrievers using the concept of token routing that dictates token interaction. + +# 2.1 Single-Vector Retrieval + +Given a collection of documents and a set of queries, single-vector models (Karpukhin et al., 2020; Izacard et al., 2022) use a bi-encoder structure where its query encoder $\eta_{Q}(\cdot)$ and document encoder $\eta_{D}(\cdot)$ are independent functions that map the input to a low-dimensional vector. Specifically, the similarity score $s$ between the query $q$ and document $d$ is defined by the dot product between their encoded vectors $v_{q} = \eta_{Q}(q)$ and $v_{d} = \eta_{D}(d)$ : + +$$ +s (q, d) = v _ {q} ^ {T} v _ {d}. \tag {1} +$$ + +As all the token embeddings are pooled before calculating the similarity score, no routing is committed as shown in Figure 2a. + +# 2.2 Multi-Vector Retrieval + +ColBERT (Khattab and Zaharia, 2020) proposes late interaction between the tokens in a query $q = \{q_1, q_2, \dots, q_N\}$ and a document $d = \{d_1, d_2, \dots, d_M\}$ : + +$$ +s (q, d) = \sum_ {i = 1} ^ {N} \max _ {j} v _ {q _ {i}} ^ {T} v _ {d _ {j}}, \tag {2} +$$ + +where $v_{q_i}$ and $v_{d_j}$ denotes the last-layer contextualized token embeddings of BERT. This is known as the MaxSim operation which exhaustively compares each query token to all document tokens. We refer to this as all-to-all routing as shown in Figure 2b. The latency of ColBERT is inflated by the redundancy in the all-to-all routing, as many tokens do not contribute to the sentence semantics. This also drastically increases the storage, requiring complex engineering schemes to make it more practical (Santhanam et al., 2022b,a). + +Another representative multi-vector approach known as COIL (Gao et al., 2021a) proposes an exact match constraint on the MaxSim operation where only the embeddings with the same token id could interact with each other. Let $\mathcal{J}_i = \{j \mid d_j = q_i, 1 \leq j \leq M\}$ be the subset of document tokens $\{d_j\}_{j=1}^M$ that have the same token ID as query token + +$q_{i}$ , then we have: + +$$ +s (q, d) = \sum_ {i = 1} ^ {N} \max _ {j \in \mathcal {J} _ {i}} v _ {q _ {i}} ^ {T} v _ {d _ {j}}, \tag {3} +$$ + +It could be further combined with Equation (1) to improve the effectiveness if there's no word overlap between the query and documents. + +$$ +s (q, d) = v _ {q} ^ {T} v _ {d} + \sum_ {i = 1} ^ {N} \max _ {j \in \mathcal {J} _ {i}} v _ {q _ {i}} ^ {T} v _ {d _ {j}}. \tag {4} +$$ + +We refer to this token interaction as static lexical routing as shown in Figure 2c. As mentioned in Section 1, the word mismatch problem could happen if $\mathcal{I}_i = \emptyset$ for all $q_{i}$ , which affects the retrieval accuracy. Moreover, common tokens such as "the" will be frequently routed, which will create much larger token indexes compared to those rare words. This bottlenecks the search latency as COIL needs to frequently iterate over large token indexes. + +# 3 The CITADEL Method + +# 3.1 Dynamic Lexical Routing + +Instead of using the wasteful all-to-all routing or the inflexible heuristics-based static routing, we would like our model to dynamically select which query and passage tokens should interact with each other based on their contextualized representation, which we refer to as dynamic lexical routing. Formally, the routing function (or router) routes each token to a set of lexical keys in the vocabulary and is defined as $\phi : \mathbb{R}^c \to \mathbb{R}^{|\mathcal{V}|}$ where $c$ is the embedding dimension and $\mathcal{V}$ is the lexicon of keys. For each contextualized token embedding, the router predicts a scalar score for each key in the lexicon indicating how relevant each token is to that key. Given a query token embedding $v_{q_i}$ and a document token vector $v_{d_j}$ , the token level router representations are $w_{q_i} = \phi(v_{q_i})$ and $w_{d_j} = \phi(v_{d_j})$ , respectively. The elements in the router representations are then sorted in descending order and truncated by selecting the top- $K$ query keys and top- $L$ document keys, which are $\{e_{q_i}^{(1)}, e_{q_i}^{(2)}, \dots, e_{q_i}^{(K)}\}$ and $\{e_{d_j}^{(1)}, e_{d_j}^{(2)}, \dots, e_{d_j}^{(L)}\}$ for $q_i$ and $d_j$ , respectively. In practice, we use $K = 1$ and $L = 5$ as the default option which will be discussed in Section 3.5 and Section 7. The corresponding routing weights for $q_i$ and $d_j$ are $\{w_{q_i}^{(1)}, w_{q_i}^{(2)}, \dots, w_{q_i}^{(K)}\}$ and $\{w_{d_j}^{(1)}, w_{d_j}^{(2)}, \dots, w_{d_j}^{(L)}\}$ , respectively. The final similarity score is similar to Equation (3), but + +we substitute the static lexical routing subset $\mathcal{J}_i$ with a dynamic key set predicted by the router: $\mathcal{E}_i^{(k)} = \{j,l\mid e_{d_j}^{(l)} = e_{q_i}^{(k)},1\leq j\leq M,1\leq l\leq L\}$ for each key $e_{q_i}^{(k)}$ of the query token $q_{i}$ : + +$$ +s (q, d) = \sum_ {i = 1} ^ {N} \sum_ {k = 1} ^ {K} \max _ {j, l \in \mathcal {E} _ {i} ^ {(k)}} \left(w _ {q _ {i}} ^ {(k)} \cdot v _ {q _ {i}}\right) ^ {T} \left(w _ {d _ {j}} ^ {(l)} \cdot v _ {d _ {j}}\right), \tag {5} +$$ + +Optionally, all [CLS] tokens can be routed to an additional semantic key to complement our learned lexical routing. We then follow DPR (Karpukhin et al., 2020) to train the model contrastively. Given a query $q$ , a positive document $d^{+}$ , and a set of negative documents $D^{-}$ , the constrastive loss is: + +$$ +\mathcal {L} _ {\mathrm {e}} = - \log \frac {\exp (s (q , d ^ {+}))}{\exp (s (q , d ^ {+})) + \sum_ {d ^ {-} \in D ^ {-}} \exp (s (q , d ^ {-}))}, \tag {6} +$$ + +such that the distance from the query to the positive document $d^{+}$ is smaller than the query to the negative document $d^{-}$ . + +# 3.2 Router Optimization + +To train the router representation $\phi(q)$ and $\phi(d)$ , we adopt a contrastive loss such that the number of overlapped keys between a query and documents are large for positive $(q, d^{+})$ pairs and small for negative pairs $(q, d^{-})$ . We first pool the router representation for each query and document over the tokens. Given a sequence of token-level router representations $\{\phi(v_{1}), \phi(v_{2}), \dots, \phi(v_{M})\}$ , the sequence-level representation is defined as: + +$$ +\Phi = \max _ {j = 1} ^ {M} \phi (v _ {j}), \tag {7} +$$ + +where the max operator is applied element-wise. Similar to (Formal et al., 2021a), We find max pooling works the best in practice compared to other pooling methods. Subsequently, the contrastive loss for training the router is: + +$$ +\mathcal {L} _ {\mathrm {r}} = - \log \frac {\exp \left(\Phi_ {q} ^ {T} \Phi_ {d +}\right)}{\exp \left(\Phi_ {q} ^ {T} \Phi_ {d +}\right) + \sum_ {d ^ {-} \in D ^ {-}} \exp \left(\Phi_ {q} ^ {T} \Phi_ {d ^ {-}}\right)}. \tag {8} +$$ + +In addition, we follow SPLADE (Formal et al., 2021b,a) to initialize the router with the pre-trained Masked Language Modelling Layer (MLM). Without proper initialization, it is difficult to optimize the router due the large lexical space and sparse activation. With the pre-trained MLM initialization, the router expands words with similar semantic meaning to sets of keys with large overlap at the beginning of training, making the contrastive loss easier to optimize. + +# 3.3 Sparsely Activated Router Design + +Softmax activation is commonly used for computing the routing weights in conditional computation models (Fedus et al., 2022; Mustafa et al., 2022). However, softmax often yields a small probability over a large number of dimensions (in our case, about 30,000) and the product of two probability values are even smaller, which makes it not suitable for yielding the routing weights $w_{q_i}^{(k)}$ and $w_{d_j}^{(l)}$ in Equation (5) as the corresponding gradients are too small. Instead, we use the activation from SPLADE to compute the router representation for a token embedding $v_j$ : + +$$ +\phi (v _ {j}) = \log (1 + \operatorname {R e L U} (W ^ {T} v _ {j} + b)), \quad (9) +$$ + +where $W$ and $b$ are the weights and biases of the Masked Language Modeling (MLM) layer of BERT. The SPLADE activation brings extra advantages as the ReLU activation filters irrelevant keys while the log-saturation suppresses overly large "wacky" weights (Mackenzie et al., 2021). + +# 3.4 Regularization for Routing + +$\ell_1$ Regularization. Routing each token to more than one key increases the overall size of the index. Therefore, we propose to use $\ell_1$ regularization on the router representation to encourage the router to only keep the most meaningful token interaction by pushing more routing weights to 0: + +$$ +\mathcal {L} _ {\mathrm {s}} = \frac {1}{B} \sum_ {i = 1} ^ {B} \sum_ {j = 1} ^ {T} \sum_ {k = 1} ^ {| \mathcal {V} |} \phi \left(v _ {i j}\right) ^ {(k)}, \tag {10} +$$ + +where $|\mathcal{V}|$ is the number of keys, $B$ is the batch size, and $T$ is the sequence length. As shown in Figure 6, CITADEL has a sparsely activated set of keys, by routing important words to multiple lexical keys while ignoring many less salient words, leading to effective yet efficient retrieval. + +Load Balancing. As mentioned in Section 2.2, the retrieval latency of COIL is bottlenecked by frequently searching overly large token indexes. This results from the static lexical routing where common "keys" have a larger chance to be activated, which results in large token indexes during indexing. Therefore, a vital point for reducing the latency of multi-vector models is to evenly distribute each token embedding to different keys. Inspired by Switch Transformers (Fedus et al., 2022), we + +propose to minimize the load balancing loss that approximates the expected "evenness" of the number of tokens being routed to each key: + +$$ +\mathcal {L} _ {\mathrm {b}} = \sum_ {k = 1} ^ {| \mathcal {V} |} f _ {k} \cdot p _ {k}, \tag {11} +$$ + +$p_k$ is the batch approximation of the marginal probability of a token vector routed to the $k$ -th key: + +$$ +p _ {k} = \frac {1}{B} \sum_ {i = 1} ^ {B} \sum_ {j = 1} ^ {T} \frac {\exp \left(W _ {k} ^ {T} v _ {i j} + b _ {k}\right)}{\sum_ {k ^ {\prime}} \exp \left(W _ {k ^ {\prime}} ^ {T} v _ {i j} + b _ {k ^ {\prime}}\right)}, \tag {12} +$$ + +where $W$ and $b$ are the weights and bias of the routing function in Equation (9) and $v_{ij}$ is the $j$ -th token embedding in sample $i$ of the batch. $f_{k}$ is the batch approximation of the total number of tokens being dispatched to the $k$ -th key: + +$$ +f _ {k} = \frac {1}{B} \sum_ {i = 1} ^ {B} \sum_ {j = 1} ^ {T} \mathbb {I} \left\{\operatorname {a r g m a x} \left(p _ {i j}\right) = k \right\}, \tag {13} +$$ + +where $p_{ij} = \mathrm{softmax}(W^T v_{ij} + b)$ . Finally, we obtain the loss for training CITADEL: + +$$ +\mathcal {L} = \mathcal {L} _ {\mathrm {e}} + \mathcal {L} _ {\mathrm {r}} + \alpha \cdot \mathcal {L} _ {\mathrm {b}} + \beta \cdot \mathcal {L} _ {\mathrm {s}}, \tag {14} +$$ + +where $\alpha \geq 0$ and $\beta \geq 0$ . The $\ell_1$ and load balancing loss are applied on both queries and documents. + +# 3.5 Inverted Index Retrieval + +CITADEL builds an inverted index like BM25 but we use a vector instead of a scalar for each token and the doc product as the term relevance. + +Indexing and Post-hoc Pruning. To reduce index storage, we prune the vectors with routing weights less than a threshold $\tau$ after training. For a key $e$ in the lexicon $\mathcal{V}$ , the token index $\mathcal{I}_e$ consists of token embeddings $v_{d_j}$ and the routing weight $w_{d_j}^e$ for all documents $d$ in the corpus $\mathcal{C}$ is: + +$$ +\mathcal {I} _ {e} = \left\{w _ {d _ {j}} ^ {e} \cdot v _ {d _ {j}} \mid w _ {d _ {j}} ^ {e} > \tau , 1 \leq j \leq M, \forall d \in \mathcal {C} \right\}. \tag {15} +$$ + +We will discuss the impact of posthoc pruning in Section 5.2, where we find that posthoc pruning can reduce the index size by $3 \times$ without significant accuracy loss. The final search index is defined as $\mathcal{I} = \{\mathcal{I}_e | e \in \mathcal{V}\}$ , where the load-balancing loss in Equation (11) will encourage the size distribution over $\mathcal{I}_e$ to be as even as possible. In practice, we set the number of maximal routing keys of each token to 5 for the document and 1 for the query. The intuition is that the documents usually contain more information and need more key capacity, which is discussed in Section 7 in detail. + +Token Retrieval. Given a query $q$ , CITADEL first encodes it into a sequence of token vectors $\{v_{q_i}\}_{i=1}^N$ , and then route each vector to its top-1 key $e$ with a routing weight $w_{q_i}^e$ . The final representation $w_{q_i}^e \cdot v_{q_i}$ will be sent to the corresponding token index $\mathcal{I}_E$ for vector search. The final ranking list will be merged from each query token's document ranking according to Equation (5). + +# 4 Experiments + +# 4.1 MS MARCO Passages Retrieval + +We evaluate MS MARCO passages (Nguyen et al., 2016) and its shared tasks, TREC DL 2019/2020 passage ranking tasks (Craswell et al., 2020). Dataset details are provided in Appendix A.1. Following standard practice, we train CITADEL and other baseline models on MS MARCO passages and report the results on its dev-small set and TREC DL 2019/2020 test queries. The evaluation metrics are MRR@10, nDCG@10, and Recall@1000 (i.e., R@1K). We provide a detailed implementation of CITADEL and other baselines in Appendix A. + +Table 1 shows the in-domain evaluation results on MS MARCO passage and TREC DL 2019/2020. We divide the models into two classes: ones trained with only labels and BM25 hard negatives and the others trained with further pretraining (Gao and Callan, 2022), hard negative mining (Xiong et al., 2021), or distillation from a cross-encoder1. CITADEL is trained only with BM25 hard negatives, while $\mathrm{CITADEL}^{+}$ is trained with cross-encoder distillation and one-round hard negative mining. The default pruning threshold is $\tau = 0.9$ . As shown in Section 5.2, $\tau$ can be adjusted to strike different balances between latency, index size and accuracy. In both categories, $\mathrm{CITADEL} / \mathrm{CITADEL}^{+}$ outperforms the baseline models on the MS MARCO passages dev set and greatly reduces the search latency on both GPU and CPU. For example, $\mathrm{CITADEL}^{+}$ achieves an average latency of $3.21~\mathrm{ms}/\mathrm{query}$ which is close to DPR-768 (1.28 ms/query) on GPU, while having a $25\%$ higher MRR@10 score. CITADEL also maintains acceptable index sizes on disk, which can be further reduced using product quantization (Section 5.3). Although not able to outperform several baselines on TREC DL 2019/2020, we perform t-test ( $p < 0.05$ ) on $\mathrm{CITADEL}^{+}$ against other baselines in their sub-categories and + +
ModelsMARCO DevTREC DL19TREC DL20Index StorageLatency (ms/query)
MRR@10R@1knDCG@10R@1knDCG@10R@1kDisk (GB)Factor1Encode (GPU)Search (GPU)Search (CPU)
Models trained with only BM25 hard negatives
BM250.1880.8580.5060.7390.4880.7330.67×0.22××40.1
DPR-1280.2850.9370.5760.7020.6030.7574.33×1.427.090.63430
DPR-7680.3190.9410.6110.7420.5910.79626.0×8.527.011.282015
SPLADE0.3400.9650.6830.8130.6710.8232.60×0.857.13×475
COIL-tok0.3500.9640.6600.8090.6790.82552.5×17.210.746.81295
COIL-full0.3530.9670.7040.8350.6880.84178.5×25.710.847.93258
ColBERT0.3600.9680.6940.8300.6760.837154×50.510.9178-
CITADEL0.3620.9750.6870.8290.6610.83078.3×25.710.83.95520
Models trained with further pre-training/hard-negative mining/distillation
coCondenser0.3820.9840.6740.8200.6840.83926.0×8.527.011.282015
SPLADE-v20.3680.9790.7290.8650.7180.8904.12×1.357.13×2710
ColBERT-v20.3970.9850.7440.8820.7500.89429.0×9.5110.91223275
ColBERT-PLAID20.3970.9840.7440.8820.7490.89422.1×7.2510.955.0370
CITADEL+0.3990.9810.7030.8300.7020.85981.3×26.710.83.21635
+ +Factor: Ratio of index size to plain text size. +2 The PLAID implementation of ColBERT contains complex engineering schemes and low-level optimization such as centroid interaction and fast kernels. + +Table 1: In-domain evaluation on MS MARCO passages and TREC DL 2019/2020. $\text{CITADEL}^{+}$ is trained with cross-encoder distillation and hard-negative mining. The red region means $\text{CITADEL/CITADEL}^{+}$ is better than the method while the green region means that there's no statistical significance ( $p > 0.05$ ). “×” means not implemented and “-” means not practical to evaluate on a single CPU. + +
MethodsAACFDBFeFQHQNFNQQuSFSDTCT2Avg.
Models trained with only BM25 hard negatives
BM250.3150.2130.3130.7530.2360.6030.3250.3290.7890.6650.1580.6560.3670.440
DPR-7680.3230.1670.2950.6510.2240.4410.2440.4100.7500.4790.1030.6040.1850.375
SPLADE0.4450.2010.3700.7400.2890.6400.3220.4690.8340.6330.1490.6610.2010.453
COIL-full0.2950.2160.3980.8400.3130.7130.3310.5190.8380.7070.1550.6680.2810.483
ColBERT0.2330.1840.3920.7710.3170.5930.3050.5240.8540.6710.1650.6770.2020.453
CITADEL0.5030.1910.4060.7840.2980.6530.3240.5100.8440.6740.1520.6870.2940.486
Models with further pre-training/hard-negative mining/distillation
coCondenser0.4400.1330.3470.5110.2810.5330.3190.4670.8630.5910.1300.7080.1430.420
SPLADE-v20.4790.2350.4350.7860.3360.6840.3340.5210.8380.6930.1580.7100.2720.499
ColBERT-v20.4630.1760.4460.7850.3560.6670.3380.5620.8540.6930.1650.7380.2630.500
CITADEL+0.4900.1810.4200.7470.3320.6520.3370.5390.8520.6950.1470.6800.3400.493
CITADEL+(w/o reg.)0.5110.1820.4220.7650.3300.6640.3370.5400.8530.6900.1590.7150.3420.501
+ +Table 2: Out-of-domain evaluation on BEIR benchmark. nDCG@10 score is reported. Dataset Legend (Chen et al., 2022): TC=TREC-COVID, NF=NFCorpus, NQ=NaturalQuestions, HQ=HotpotQA, FQ=FiQA, AA=ArguAna, T2=Touché-2020 (v2), Qu=Quora, DB=DBPedia, SD=SCIDOCS, Fe=FEVER, CF=Climate-FEVER, SF=SciFact. + +show there is no statistical significance. The inconsistency is probably due to that we use the training data from Tevatron (Gao et al., 2022) where each passage is paired with a title. Lassance and Clinchant (2023) points out that neural retrievers trained on such data will result in slightly higher scores on MS MARCO dev small while lower scores on TREC DL 2019 and 2020. + +# 4.2 BEIR: Out-of-Domain Evaluation + +We evaluate on BEIR benchmark (Thakur et al., 2021) which consists of a diverse set of 18 retrieval tasks across 9 domains. We evaluate on 13 datasets following previous works (Santhanam et al., 2022b; Formal et al., 2021a). Table 2 shows the zero-shot evaluation results on BEIR. Without + +any pre-training or distillation, CITADEL manages to outperform all baselines in their sub-categories in terms of the average score. Compared with the distilled/pre-trained models, $\mathrm{CITADEL}^{+}$ still manages to achieve comparable performance. Interestingly, we find that if no regularization like load balancing and L1 is applied during training, $\mathrm{CITADEL}^{+}$ can reach a much higher average score that even outperforms ColBERT-v2. Our conjecture is that the regularization reduces the number of token interactions and the importance of such token interaction is learned from training data. It is hence not surprising that the more aggressively we prune token interaction, the more likely that it would hurt out-of-domain accuracy that's not covered by the training data. + +
ModelsMRR@10#DP ×106
ColBERT0.3604213
COIL-full0.35345.6
CITADEL0.36210.5
DPR-1280.2858.84
+ +Table 3: Maximal number of dot products per query on MS MARCO passages. # DP: number of dot products. + +![](images/6b5fb9b0faf5ea085c2483eda9051c4d9227577e5b3432c3ad3fdf67339d8c17.jpg) +Figure 3: Normalized disk storage over token indices in an inverted list of CITADEL and COIL. + +# 5 Performance Analysis + +# 5.1 Number of Token Interactions + +The actual latency is often impacted by engineering details and therefore FLOPS is often considered for comparing efficiency agnostic to the actual implementation. In our case, however, FLOPS is impacted by the vector dimension in the nearest neighbour search which is different across models. Therefore, we only compare the maximal number of dot products needed as a proxy for token interaction per query during retrieval as shown in Table 3. The number of dot products per query in CITADEL with pruning threshold $\tau = 0.9$ is comparable to DPR-128 and much lower than ColBERT and COIL, which is consistent with the latency numbers in Table 1. The reason is that CITADEL has a balanced inverted index credited to the $\ell_1$ regularization and the load balancing loss as shown in Figure 3. By applying the load balancing loss on the router prediction, CITADEL yields a more balanced and even index distribution where its largest index fraction is $8 \times$ smaller than COIL's as shown in Figure 3. We also provide a detailed latency breakdown in Appendix A.4. + +![](images/1f4c0578854122f627fee6e722cd8297c4dfb4d60921db1fc25f0fab7c4f9b47.jpg) + +Figure 4: Latency-memory-accuracy tradeoff on MS MARCO passages using post-hoc pruning. $\tau$ is the pruning threshold. + +
ConditionMRR@10Storage (GB)Latency (ms)
original0.36278.33.95
nbits=20.36113.30.90
nbits=10.35611.00.92
+ +Table 4: Product Quantization. Pruning threshold is set to 0.9. nbits: ratio of total bytes to the vector dimension. + +# 5.2 Latency-Memory-Accuracy Tradeoff + +Figure 4 shows the tradeoff among latency, memory, and MRR@10 on MS MARCO passages with post-hoc pruning. We try the pruning thresholds [0.5, 0.7, 0.9, 1.1, 1.3, 1.5]. We could see that the MRR@10 score barely decreases when we increase the threshold to from 0.5 to 1.1, but the latency decreases by a large margin, from about 18 ms/query to 0.61 ms/query. The sweet spots are around (0.359 MRR@10, 49.3GB, 0.61 ms/query) and (0.362 MRR@10, 78.5GB, 3.95 ms/query). This simple pruning strategy is extremely effective and readers can see in Section 6 that it also yields interpretable document representations. + +# 5.3 Combination with Product Quantization + +We could further reduce the latency and storage with product quantization (Jégou et al., 2011) (PQ) as shown in Table 4. For nbits $= 2$ , we divide the vectors into sets of 4-dimensional sub-vectors and use 256 centroids for clustering the sub-vectors, while for nbits $= 1$ we set the sub-vector dim to 8 and the same for the rest. With only 2 bits per dimension, the MRR@10 score on MS MARCO Dev only drops $4\%$ but the storage is reduced by $83\%$ and latency is reduced by $76\%$ . + +
Threshold τSample documents from MS MARCO Passages
0.0All medications have side effects, including drugs to treat arrhythmias. Most of the side effects aren't serious and disappear when the dose is changed or the medication is stopped. But some side effects are very serious. That's why some children are admitted to the hospital to begin the medication. Medications for Arrhythmia
0.9All medications have side effects, including drugs to treat arrhythmias. Most of the side effects aren't serious and disappear when the dose is changed or the medication is stopped. But some side effects are very serious. That's why some children are admitted to the hospital to begin the medication. Medications for Arrhythmia
1.3All medications have side effects, including drugs to treat arrhythmias. Most of the side effects aren't serious and disappear when the dose is changed or the medication is stopped. But some side effects are very serious. That's why some children are admitted to the hospital to begin the medication. Medications for Arrhythmia
+ +Figure 5: Tokens in grey (pruned) have zero activated keys while bold tokens have at least one activated key. We leave out the expanded terms and routing weights due to space limit. + +
ModelsDevDL19Latency (ms)
COIL-full0.3530.70447.9
COIL-tok0.3500.66046.8
CITADEL0.3620.6873.95
CITADEL-tok0.3600.6651.64
+ +# 6 Token Routing Analysis of CITADEL + +Qualitative Analysis. We visualize CITADEL representations and the effect of posthoc pruning in Figure 5. By increasing the pruning threshold, more keywords are pruned and finally leaving the most central word "arrhythmia" activated. We provide another example in Figure 6. We can see that a lot of redundant words that do not contribute to the final semantics are deactivated, meaning all their routing weights are 0. For the activated tokens, we could see the routed keys are contextualized as many of them are related to emoji which is the theme of the document. + +Quantitative Analysis. We analyze CITADEL's token distribution over the number of activated routing keys for the whole corpus as shown in Figure 7. With $\ell_1$ loss, around 50 tokens per passage are deactivated (i.e., all the routing weights of these 50 tokens are 0). As the pruning threshold increases, more tokens are deactivated, yielding a sparse representation for interpreting CITADEL's behaviours. + +# 7 Ablation Studies + +Impact of [CLS] Table 5 shows the influence of removing the [CLS] vector for CITADEL on MS MARCO passage. Although removing [CLS] improves the latency by a large margin, the in-domain effectiveness is also adversely affected, especially + +Table 5: [CLS] ablation on MS MARCO passage. Dev: MRR@10. DL19: nDCG@10. + +
#KeysMRR@10Storage (GB)Latency (ms)
10.34753.61.28
30.36013614.7
50.36418518.6
70.37019620.4
90.36722119.6
+ +Table 6: Number of routing keys for documents during training. No post-hoc pruning is applied. + +on TREC DL 2019. Nevertheless, CITADELtok (w/o [CLS]) still outperforms its counterpart COIL-tok in both precision and latency. + +Number of Routed Experts. Table 6 shows the influence of changing the maximum number of keys that each document token can be routed to during training and inference on MS MARCO passage. As the number of routing keys increases, the index storage also increases rapidly but so does the MRR@10 score which plateaus after reaching 7 keys. The latency does not increase as much after 3 routing keys due to the load balancing loss. + +# 8 Related Works + +Dense Retrieval. Supported by multiple approximate nearest neighbour search libraries (Johnson et al., 2021; Guo et al., 2020), dense retrieval (Karpukhin et al., 2020) gained much popularity due to its efficiency and flexibility. To improve effectiveness, techniques such as hard negative mining (Xiong et al., 2021; Zhan et al., 2021) and knowledge distillation (Lin et al., 2021b; Hofstätter et al., 2021) are often deployed. Recently, retrieval-oriented pre-training(Gao et al., 2021b; Lu et al., 2021; Gao and Callan, 2021; Izacard et al., 2022; Gao and Callan, 2022) also draws much attention as they could substantially improve the fine-tuning performance of downstream tasks. + +# Sample Document from MS MARCO Passages + +It may be a little hard to remember (remember, forget) all of the 25 (barney, many, 25, 1625) codes (code, codes), which is why we've created (invented, stumbled, created, swirled) this dictionary (dictionary, spiked). You can find the complete facebook (facebook) emoticons (emotion, emoji, combinations, asher, grins) list for chats (chat, chatting) and status (winked, logo, status, glided) in the table above. This list (list, kingsley, include)ing includes all the new ones which have been recently added, such as the penguin (penguin, mccann, uefa) or shark (shark, chao) emoticon (emotion, emoji, assassins). Facebook (facebook) Emoticons (emotion, emoji, spp, programs) + +Sparse Retrieval. Traditional sparse retrieval systems such as BM25 (Robertson and Zaragoza, 2009) and tfidf (Salton and Buckley, 1988) represent the documents as a bag of words with static term weights. Recently, many works leverage pretrained language models to learn contextualized term importance (Bai et al., 2020; Mallia et al., 2021; Formal et al., 2021b; Lin and Ma, 2021). These models could utilize existing inverted index libraries such as Pyserini (Lin et al., 2021a) to perform efficient sparse retrieval or even hybrid with dense retrieval (Hofstätter et al., 2022; Shen et al., 2022; Lin and Lin, 2022; Zhang et al., 2023). + +Multi-Vector Retrieval. ColBERT (Khattab and Zaharia, 2020; Santhanam et al., 2022b,a; Hofstätter et al., 2022) probably has the most optimized library in multi-vector retrieval. COIL (Gao et al., 2021a) accelerates retrieval by combining with exact match and inverted vector search. MEBERT (Luan et al., 2021) and MVR (Zhang et al., 2022) propose to use a fixed number of token embeddings for late interaction (e.g., top-k positions or special tokens). Concurrently to this work, ALIGNNER (Qian et al., 2022) proposes to frame multi-vector retrieval as a sparse alignment problem between query tokens and document tokens using entropy-regularized linear programming. Our 110M model achieves higher in-domain and out-of-domain accuracy than their large variants. + +# 9 Conclusion + +This paper proposes a novel multi-vector retrieval method that achieves state-of-the-art performance on several benchmark datasets while being $40 \times$ faster than ColBERT-v2 and $17 \times$ faster than the + +![](images/e62c137176d5c4810b62879c2826c8969658f6a31ab45b8c887127f6c385dd58.jpg) +Figure 6: Token routing analysis of CITADEL. Grey tokens are deactivated, while bold tokens are routed to at least one activated key (in blue). +Figure 7: Token distribution over number of activated experts per passage. $\tau$ is the pruning threshold. + +most efficient multi-vector retrieval library to date, PLAID, on GPUs. By jointly optimizing for the token index size and load balancing, our new dynamic lexical routing scheme greatly reduces the redundancy in the all-to-all token interaction of Colbert while bridging the word-mismatch problem in COIL. Experiments on both in-domain and out-of-domain datasets demonstrate the effectiveness and efficiency of our model. + +# 10 Limitations + +The limitation of CITADEL mainly shows in two aspects. First, at the beginning of training, the model needs to route each token vector to multiple activated keys for token interaction, which increases the computation cost compared to COIL and Colbert. This results in slower training speed but it gets better when training approaches the end as more tokens are pruned by the $\ell_1$ regularization. Another drawback lies in the implementation of CITADEL, or more generally speaking, most multi-vector retrieval methods. The token-level retrieval and aggregation make them not compatible with established search libraries such as FAISS or Pyserini. Moreover, for time and space efficiency, multi-vector retrieval also requires more engineering efforts and low-level optimization. Recently, XTR (Lee et al., 2023) provides a solution that constrains the document-level retrieval to be consistent with the token-level retrieval during training, which can be used for streamlining CITADEL. + +# 11 Acknowledgement + +We would like to thank Jun Yan and Zheng Lian for the helpful discussions on CITADEL. + +# References + +Yang Bai, Xiaoguang Li, Gang Wang, Chaoliang Zhang, Lifeng Shang, Jun Xu, Zhaowei Wang, Fangshan Wang, and Qun Liu. 2020. Sparterm: Learning term-based sparse representation for fast text retrieval. ArXiv, abs/2010.00768. +Alexander Bondarenko, Maik Frobe, Meriem Beloucif, Lukas Gienapp, Yamen Ajjour, Alexander Panchenko, Chris Biemann, Benno Stein, Henning Wachsmuth, Martin Potthast, and Matthias Hagen. 2020. Overview of touché 2020: Argument retrieval: Extended abstract. In Experimental IR Meets Multilinguality, Multimodality, and Interaction: 11th International Conference of the CLEF Association, CLEF 2020, Thessaloniki, Greece, September 22-25, 2020, Proceedings, page 384-395, Berlin, Heidelberg. Springer-Verlag. +Vera Boteva, Demian Gholipour, Artem Sokolov, and Stefan Riezler. 2016. A full-text learning to rank dataset for medical information retrieval. In Advances in Information Retrieval, pages 716-722, Cham. Springer International Publishing. +Danqi Chen, Adam Fisch, Jason Weston, and Antoine Bordes. 2017. Reading Wikipedia to answer open-domain questions. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1870-1879, Vancouver, Canada. Association for Computational Linguistics. +Xilun Chen, Kushal Lakhotia, Barlas Oğuz, Anchit Gupta, Patrick Lewis, Stan Peshterliev, Yashar Mehdad, Sonal Gupta, and Wen-tau Yih. 2022. Salient phrase aware dense retrieval: Can a dense retriever imitate a sparse one? In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing. +Arman Cohan, Sergey Feldman, Iz Beltagy, Doug Downey, and Daniel S. Weld. 2020. Specter: Document-level representation learning using citation-informed transformers. +Nick Craswell, Bhaskar Mitra, Emine Yilmaz, Daniel Fernando Campos, and Ellen M. Voorhees. 2020. Overview of the trec 2020 deep learning track. ArXiv, abs/2003.07820. +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. +Thomas Diggelmann, Jordan Boyd-Graber, Jannis Bulian, Massimiliano Ciaramita, and Markus Leippold. 2021. Climate-fever: A dataset for verification of real-world climate claims. + +William Fedus, Barret Zoph, and Noam Shazeer. 2022. Switch transformers: Scaling to trillion parameter models with simple and efficient sparsity. Journal of Machine Learning Research, 23(120):1-39. +Thibault Formal, C. Lassance, Benjamin Piwowarski, and Stéphane Clinchant. 2021a. Splade v2: Sparse lexical and expansion model for information retrieval. ArXiv, abs/2109.10086. +Thibault Formal, Benjamin Piwowarski, and Stéphane Clinchant. 2021b. Splade: Sparse lexical and expansion model for first stage ranking. In Proceedings of the 44th International ACM SIGIR Conference on Research and Development in Information Retrieval. Association for Computing Machinery. +Luyu Gao and Jamie Callan. 2021. Condenser: a pretraining architecture for dense retrieval. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 981-993, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Luyu Gao and Jamie Callan. 2022. Unsupervised corpus aware language model pre-training for dense passage retrieval. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2843-2853, Dublin, Ireland. Association for Computational Linguistics. +Luyu Gao, Zhuyun Dai, and Jamie Callan. 2021a. COIL: Revisit exact lexical match in information retrieval with contextualized inverted list. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 3030-3042, Online. Association for Computational Linguistics. +Luyu Gao, Xueguang Ma, Jimmy Lin, and Jamie Callan. 2022. Tevatron: An efficient and flexible toolkit for dense retrieval. +Tianyu Gao, Xingcheng Yao, and Danqi Chen. 2021b. 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. +Ruiqi Guo, Philip Sun, Erik Lindgren, Quan Geng, David Simcha, Felix Chern, and Sanjiv Kumar. 2020. Accelerating large-scale inference with anisotropic vector quantization. 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 3887-3896. PMLR. +Faegheh Hasibi, Fedor Nikolaev, Chenyan Xiong, Krisztian Balog, Svein Erik Bratsberg, Alexander Kotov, and Jamie Callan. 2017. Dbpedia-entity v2: A test + +collection for entity search. In Proceedings of the 40th International ACM SIGIR Conference on Research and Development in Information Retrieval, SIGIR '17, page 1265-1268, New York, NY, USA. Association for Computing Machinery. +Geoffrey E. Hinton, Oriol Vinyals, and Jeffrey Dean. 2015. Distilling the knowledge in a neural network. ArXiv, abs/1503.02531. +Sebastian Hofstätter, Omar Khattab, Sophia Althammer, Mete Sertkan, and Allan Hanbury. 2022. Introducing neural bag of whole-words with colberter: Contextualized late interactions using enhanced reduction. In Proceedings of the 31st ACM International Conference on Information & Knowledge Management, page 737-747. Association for Computing Machinery. +Sebastian Hofstätter, Sheng-Chieh Lin, Zheng-Hong Yang, Jimmy Lin, and Allan Hanbury. 2021. Efficiently teaching an effective dense retriever with balanced topic aware sampling. In Proceedings of the 44th International ACM SIGIR Conference on Research and Development in Information Retrieval, page 113-122. Association for Computing Machinery. +Gautier Izacard, Mathilde Caron, Lucas Hosseini, Sebastian Riedel, Piotr Bojanowski, Armand Joulin, and Edouard Grave. 2022. Unsupervised dense information retrieval with contrastive learning. Transactions on Machine Learning Research. +Hervé Jégou, Matthijs Douze, and Cordelia Schmid. 2011. Product quantization for nearest neighbor search. IEEE Trans. Pattern Anal. Mach. Intell., 33(1):117-128. +J. Johnson, M. Douze, and H. Jegou. 2021. Billion-scale similarity search with gpus. IEEE Transactions on Big Data, 7(03):535-547. +Vladimir Karpukhin, Barlas Oguz, Sewon Min, Patrick Lewis, Ledell Wu, Sergey Edunov, Danqi Chen, and Wen-tau Yih. 2020. Dense passage retrieval for open-domain question answering. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 6769-6781, Online. Association for Computational Linguistics. +Omar Khattab and Matei Zaharia. 2020. Colbert: Efficient and effective passage search via contextualized late interaction over bert. In Proceedings of the 44th International ACM SIGIR Conference on Research and Development in Information Retrieval, page 39-48. Association for Computing Machinery. +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. +Carlos Lassance and Stéphane Clinchant. 2023. The tale of two ms marco - and their unfair comparisons. +Jinhyuk Lee, Zhuyun Dai, Sai Meher Karthik Duddu, Tao Lei, Iftekhar Naim, Ming-Wei Chang, and Vincent Y. Zhao. 2023. Rethinking the role of token retrieval in multi-vector retrieval. +Kenton Lee, Ming-Wei Chang, and Kristina Toutanova. 2019. Latent retrieval for weakly supervised open domain question answering. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 6086-6096, Florence, Italy. Association for Computational Linguistics. +Jimmy Lin, Xueguang Ma, Sheng-Chieh Lin, Zheng-Hong Yang, Ronak Pradeep, and Rodrigo Nogueira. 2021a. Pyserini: A python toolkit for reproducible information retrieval research with sparse and dense representations. In Proceedings of the 44th International ACM SIGIR Conference on Research and Development in Information Retrieval, page 2356-2362. Association for Computing Machinery. +Jimmy J. Lin and Xueguang Ma. 2021. A few brief notes on deepimpact, coil, and a conceptual framework for information retrieval techniques. *ArXiv*, abs/2106.14807. +Sheng-Chieh Lin and Jimmy Lin. 2022. A dense representation framework for lexical and semantic matching. *ArXiv*, abs/2206.09912. +Sheng-Chieh Lin, Jheng-Hong Yang, and Jimmy Lin. 2021b. In-batch negatives for knowledge distillation with tightly-coupled teachers for dense retrieval. In Proceedings of the 6th Workshop on Representation Learning for NLP (RepL4NLP-2021), pages 163–173, Online. 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, abs/1907.11692. +Ilya Loshchilov and Frank Hutter. 2019. Decoupled weight decay regularization. In 7th International Conference on Learning Representations, ICLR 2019. OpenReview.net. +Shuqi Lu, Di He, Chenyan Xiong, Guolin Ke, Waleed Malik, Zhicheng Dou, Paul Bennett, Tie-Yan Liu, and Arnold Overwijk. 2021. Less is more: Pretrain a strong Siamese encoder for dense text retrieval using a weak decoder. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 2780-2791, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. + +Yi Luan, Jacob Eisenstein, Kristina Toutanova, and Michael Collins. 2021. Sparse, dense, and attentional representations for text retrieval. Transactions of the Association for Computational Linguistics, 9:329-345. +Joel Mackenzie, Andrew Trotman, and Jimmy Lin. 2021. Wacky weights in learned sparse representations and the revenge of score-at-a-time query evaluation. ArXiv, abs/2110.11540. +Macedo Maia, Siegfried Handschuh, André Freitas, Brian Davis, Ross McDermott, Manel Zarrouk, and Alexandra Balahur. 2018. Ww'18 open challenge: Financial opinion mining and question answering. In Companion Proceedings of the The Web Conference 2018, WWW '18, page 1941-1942, Republic and Canton of Geneva, CHE. International World Wide Web Conferences Steering Committee. +Antonio Mallia, Omar Khattab, Torsten Suel, and Nicola Tonellotto. 2021. Learning passage impacts for inverted indexes. In Proceedings of the 44th International ACM SIGIR Conference on Research and Development in Information Retrieval, page 1723-1727. Association for Computing Machinery. +Christopher D. Manning, Prabhakar Raghavan, and Hinrich Schütze. 2008. Introduction to information retrieval. Cambridge University Press. +Basil Mustafa, Carlos Riquelme, Joan Puigcerver, Rodolphe Jenatton, and Neil Houlsby. 2022. Multimodal contrastive learning with limoe: the language-image mixture of experts. ArXiv, abs/2206.02770. +Tri Nguyen, Mir Rosenberg, Xia Song, Jianfeng Gao, Saurabh Tiwary, Rangan Majumder, and Li Deng. 2016. MS MARCO: A human generated machine reading comprehension dataset. In CoCo@ NIPS. +Natasha Noy, Matthew Burgess, and Dan Brickley. 2019. Google dataset search: Building a search engine for datasets in an open web ecosystem. In 28th Web Conference (WebConf 2019). +Yujie Qian, Jinhyuk Lee, Sai Meher Karthik Duddu, Zhuyun Dai, Siddhartha Brahma, Iftekhar Naim, Tao Lei, and Vincent Zhao. 2022. Multi-vector retrieval as sparse alignment. *ArXiv*, abs/2211.01267. +Stephen E. Robertson and Hugo Zaragoza. 2009. The probabilistic relevance framework: BM25 and beyond. Foundations and Trends in Information Retrieval, 3(4):333-389. +Gerard Salton and Christopher Buckley. 1988. Termweighting approaches in automatic text retrieval. Information Processing & Management, 24(5):513-523. +Keshav Santhanam, Omar Khattab, Christopher Potts, and Matei Zaharia. 2022a. Plaid: An efficient engine for late interaction retrieval. ArXiv, abs/2205.09707. + +Keshav Santhanam, Omar Khattab, Jon Saad-Falcon, Christopher Potts, and Matei Zaharia. 2022b. ColBERTv2: Effective and efficient retrieval via lightweight late interaction. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 3715-3734, Seattle, United States. Association for Computational Linguistics. +Christopher Sciavolino, Zexuan Zhong, Jinhyuk Lee, and Danqi Chen. 2021. Simple entity-centric questions challenge dense retrievers. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 6138-6148, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Tao Shen, Xiubo Geng, Chongyang Tao, Can Xu, Kai Zhang, and Daxin Jiang. 2022. Unifier: A unified retriever for large-scale retrieval. ArXiv, abs/2205.11194. +Nandan Thakur, Nils Reimers, Andreas Rückle, Abhishek Srivastava, and Iryna Gurevych. 2021. BEIR: A heterogeneous benchmark for zero-shot evaluation of information retrieval models. In Thirty-fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track (Round 2). +James Thorne, Andreas Vlachos, Christos Christodoulopoulos, and Arpit Mittal. 2018. FEVER: a large-scale dataset for fact extraction and VERIFICATION. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pages 809-819, New Orleans, Louisiana. Association for Computational Linguistics. +Ellen Voorhees, Tasmeer Alam, Steven Bedrick, Dina Demner-Fushman, William R Hersh, Kyle Lo, Kirk Roberts, Ian Soboroff, and Lucy Lu Wang. 2020. Trec-covid: Constructing a pandemic information retrieval test collection. +Henning Wachsmuth, Shahbaz Syed, and Benno Stein. 2018. Retrieval of the best counterargument without prior topic knowledge. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 241-251, Melbourne, Australia. Association for Computational Linguistics. +David Wadden, Shanchuan Lin, Kyle Lo, Lucy Lu Wang, Madeleine van Zuylen, Arman Cohan, and Hannaneh Hajishirzi. 2020. Fact or fiction: Verifying scientific claims. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 7534-7550, Online. Association for Computational Linguistics. +Lee Xiong, Chenyan Xiong, Ye Li, Kwok-Fung Tang, Jialin Liu, Paul N. Bennett, Junaid Ahmed, and + +Arnold Overwijk. 2021. Approximate nearest neighbor negative contrastive learning for dense text retrieval. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net. +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. +Jingtao Zhan, Jiaxin Mao, Yiqun Liu, Jiafeng Guo, Min Zhang, and Shaoping Ma. 2021. Optimizing dense retrieval model training with hard negatives. In Proceedings of the 44th International ACM SIGIR Conference on Research and Development in Information Retrieval, page 1503-1512. Association for Computing Machinery. +Kai Zhang, Chongyang Tao, Tao Shen, Can Xu, Xiubo Geng, Binxing Jiao, and Daxin Jiang. 2023. Led: Lexicon-enlightened dense retriever for large-scale retrieval. In Proceedings of the ACM Web Conference 2023, WWW '23, page 3203-3213, New York, NY, USA. Association for Computing Machinery. +Shunyu Zhang, Yaobo Liang, Ming Gong, Daxin Jiang, and Nan Duan. 2022. Multi-view document representation learning for open-domain dense retrieval. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 5990-6000, Dublin, Ireland. Association for Computational Linguistics. + +# A Implementations + +# A.1 Datasets + +The MS MARCO passages corpus has around 8.8 million passages with an average length of 60 words. TREC DL 2019 and 2020 contain 43 and 54 test queries whose relevance sets are densely labelled with scores from 0 to 4. + +For out-of-domain evaluation, we use 13 datasets from BEIR, which includes TREC-COVID (Voorhees et al., 2020), NFCorpus (Boteva et al., 2016), Natural Questions (Kwiatkowski et al., 2019), HotpotQA (Yang et al., 2018), FiQA-2018 (Maia et al., 2018), ArguAna Counterargs Corpus (Wachsmuth et al., 2018), Touché-2020 (Bondarenko et al., 2020), Quora², DBPedia-Entity-v2 (Hasibi et al., 2017), SCIDOCS (Cohan et al., 2020), FEVER (Thorne et al., 2018), Climate-FEVER (Diggelmann et al., 2021), SciFact (Wadden et al., 2020). + +# A.2 Baselines for Section 4 + +All the baseline models below are trained and evaluated under the same setting of CITADEL (e.g., datasets, hyperparameters, and hardwares). + +Sparse Retrievers. BM25 (Robertson and Zaragoza, 2009) uses the term frequency and inverted document frequency as features to compute the similarity between documents. SPLADE (Formal et al., 2021b,a) leverages the pre-trained language model's MLM layer and ReLU activation to yield sparse term importance. + +Dense Retrievers. DPR (Karpukhin et al., 2020) encodes the input text into a single vector. coCondenser (Gao and Callan, 2022) pre-trains DPR in an unsupervised fashion before fine-tuning. + +Multi-Vector Retrievers. ColBERT (Khattab and Zaharia, 2020; Santhanam et al., 2022b) encodes each token into dense vectors and performs late interaction between query token vectors and document token vectors. COIL (Gao et al., 2021a) applies an exact match constraint on late interaction to improve efficiency and robustness. + +# A.3 Training + +For CITADEL, we use bert-base-uncased as the initial checkpoint for fine-tuning. Following COIL, + +![](images/e8c7db10b2cc6f9c7d6dbcfddff46f94e2edeb64d5287fb2197f13ba0cdb095d.jpg) +Figure 8: Latency breakdown of inverted vector retrieval for CITADEL and COIL. + +we set the [CLS] vector dimension to 128, token vector dimension to 32, maximal routing keys to 5 for document and 1 for query, $\alpha$ and $\beta$ in Equation (14) are set to be 1e-2 and 1e-5, respectively. We add the dot product of [CLS] vectors in Equation (1) to the final similarity score in Equation (5). All models are trained for 10 epochs with AdamW (Loshchilov and Hutter, 2019) optimizer, a learning rate of 2e-5 with 3000 warm-up steps and linear decay. Hard negatives are sampled from top-100 BM25 retrieval results. Each query is paired with 1 positive and 7 hard negatives for faster convergence. We use a batch size of 128 on MS MARCO passages with 32 A100 GPUs. + +For a fair comparison with recent state-of-the-art models, we further train CITADEL using cross-encoder distillation and hard negative mining. First, we use the trained CITADEL model under the setting in the last paragraph to retrieve top-100 candidates from the corpus for the training queries. We then use the cross-encoder $^3$ to rerank the top-100 candidates and score each query-document pair. Finally, we re-initialize CITADEL with bert-base-uncased using the positives and negatives sample from the top-100 candidates scored by the cross-encoder, with a 1:1 ratio for the soft-label and hard-label loss mixing (Hinton et al., 2015). We also repeat another round of hard negative mining and distillation but it does not seem to improve the performance any further. + +# A.4 Inference and Latency Breakdown + +Pipeline. We implemented the retrieval pipeline with PyTorch (GPU) and Numpy (CPU), with a small Cython extension module for scatter operations similar to COIL's4. As shown in Fig 8, our pipeline could be roughly decomposed into four independent parts: query encoding, token-level retrieval, scatter operations, and sorting. We use the same pipeline for COIL's retrieval process. For ColBERT's latency breakdown please refer to Santhanam et al. (2022a). The cost of query encoding comes from the forward pass of the query encoder, which could be independently optimized using quantization or weight pruning for neural networks. Besides that, the most expensive operation is the token-level retrieval, which is directly influenced by the token index size. We could see that a more balanced index size distribution as shown in Figure 3 has a much smaller token vector retrieval latency. The scatter operations are used to gather the token vectors from the same passage ids from different token indices, which is also related to the token index size distribution. Finally, we sort the aggregated ranking results and return the candidates. + +Hardwares and Latency Measurement. We measure all the retrieval models in Table 1 on a single A100 GPU for GPU search and a single Intel(R) Xeon(R) Platinum 8275CL CPU @ 3.00GHz for CPU search. All indices are stored in fp32 (token vectors) and int64 (corpus ids if necessary) on disk. We use a query batch size of 1 and return the top-1000 candidates by default to simulate streaming queries. We compute the average latency of all queries on MS MARCO passages' Dev set and then report the minimum average latency across 3 trials following PLAID (Santhanam et al., 2022a). I/O time is excluded from the latency but the time of moving tensors from CPU to GPU during GPU retrieval is included. + +A For every submission: + +A1. Did you describe the limitations of your work? 10 +A2. Did you discuss any potential risks of your work? This work provides an information retrieval method for public datasets. +A3. Do the abstract and introduction summarize the paper's main claims? +A4. Have you used AI writing assistants when working on this paper? Left blank. + +B Did you use or create scientific artifacts? + +4, 5, Appendix A + +B1. Did you cite the creators of artifacts you used? 4, 5, Appendix A +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? 4, 5, Appendix A +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? 4, 5, Appendix A +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? The public datasets in the paper are widely used for a long time. +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? Not applicable. Left blank. +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. Left blank. + +C Did you run computational experiments? + +4,5,6,7 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? Appendix A + +The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? Appendix A +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? Appendix A + +# D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? Not applicable. Left blank. +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? Not applicable. Left blank. +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? Not applicable. Left blank. +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? Not applicable. Left blank. +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? Not applicable. Left blank. \ No newline at end of file diff --git a/citadelconditionaltokeninteractionviadynamiclexicalroutingforefficientandeffectivemultivectorretrieval/images.zip b/citadelconditionaltokeninteractionviadynamiclexicalroutingforefficientandeffectivemultivectorretrieval/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..49cbfecc4e8838173c8570133c9b725d329811eb --- /dev/null +++ b/citadelconditionaltokeninteractionviadynamiclexicalroutingforefficientandeffectivemultivectorretrieval/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:237f243006e692941ac026f5534df01c172f0729bcf61705ef7b01d06dbadc09 +size 649775 diff --git a/citadelconditionaltokeninteractionviadynamiclexicalroutingforefficientandeffectivemultivectorretrieval/layout.json b/citadelconditionaltokeninteractionviadynamiclexicalroutingforefficientandeffectivemultivectorretrieval/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..12bf366a2fd24c8061e56099dfd7b0b7c1b73c50 --- /dev/null +++ b/citadelconditionaltokeninteractionviadynamiclexicalroutingforefficientandeffectivemultivectorretrieval/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:05ebd64fc7295c25a09ea0ce98f40c3895ce00e752543001b9d924a721cec085 +size 544300 diff --git a/clapspeechlearningprosodyfromtextcontextwithcontrastivelanguageaudiopretraining/1326edfa-a2e4-48d9-a0ac-6a40dcea8648_content_list.json b/clapspeechlearningprosodyfromtextcontextwithcontrastivelanguageaudiopretraining/1326edfa-a2e4-48d9-a0ac-6a40dcea8648_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..088c25e8a328ff6f756b944d237e7fe5eeeaceae --- /dev/null +++ b/clapspeechlearningprosodyfromtextcontextwithcontrastivelanguageaudiopretraining/1326edfa-a2e4-48d9-a0ac-6a40dcea8648_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:14d4448125c2a6bffb11d5761d950d4a37a0059b01fbf57d9b6521438dd6ff0f +size 98129 diff --git a/clapspeechlearningprosodyfromtextcontextwithcontrastivelanguageaudiopretraining/1326edfa-a2e4-48d9-a0ac-6a40dcea8648_model.json b/clapspeechlearningprosodyfromtextcontextwithcontrastivelanguageaudiopretraining/1326edfa-a2e4-48d9-a0ac-6a40dcea8648_model.json new file mode 100644 index 0000000000000000000000000000000000000000..1cd2224d1f7bb0f84394530b3aa76a553e8aa3e2 --- /dev/null +++ b/clapspeechlearningprosodyfromtextcontextwithcontrastivelanguageaudiopretraining/1326edfa-a2e4-48d9-a0ac-6a40dcea8648_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:79cd7732b39fcbf43555c760b8846d856ed5be53f23ed16514da3d341947c87e +size 118683 diff --git a/clapspeechlearningprosodyfromtextcontextwithcontrastivelanguageaudiopretraining/1326edfa-a2e4-48d9-a0ac-6a40dcea8648_origin.pdf b/clapspeechlearningprosodyfromtextcontextwithcontrastivelanguageaudiopretraining/1326edfa-a2e4-48d9-a0ac-6a40dcea8648_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e52cf5587f820670623e518bca862684b83607bd --- /dev/null +++ b/clapspeechlearningprosodyfromtextcontextwithcontrastivelanguageaudiopretraining/1326edfa-a2e4-48d9-a0ac-6a40dcea8648_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f07a0baade58993b93ee3a5563a91a4aebe92e5c8ae2f546402615e6bcb5ea77 +size 4696902 diff --git a/clapspeechlearningprosodyfromtextcontextwithcontrastivelanguageaudiopretraining/full.md b/clapspeechlearningprosodyfromtextcontextwithcontrastivelanguageaudiopretraining/full.md new file mode 100644 index 0000000000000000000000000000000000000000..7cd91cd2735beba53be70eb0a75c231e97a70817 --- /dev/null +++ b/clapspeechlearningprosodyfromtextcontextwithcontrastivelanguageaudiopretraining/full.md @@ -0,0 +1,469 @@ +# CLAPSpeech: Learning Prosody from Text Context with Contrastive Language-Audio Pre-training + +Zhenhui Ye* +zhenhuiye@zju.edu.cn +Zhejiang University + +Rongjie Huang* +rongjiehuang@zju.edu.cn +Zhejiang University + +Yi Ren ren.yi@bytedance.com Bytedance + +Ziyue Jiang +jiangziyue@zju.edu.cn +Zhejiang University + +Jinglin Liu +liu.jinglin@bytedance.com +ByteDance + +Jinzheng He jinzhenghe@zju.edu.cn Zhejiang University + +Xiang Yin +yixiang.stephen@bytedance.com +Bytedance + +Zhou Zhao $^{\dagger}$ +zhaozhou@zju.edu.cn +Zhejiang University + +# Abstract + +Improving text representation has attracted much attention to achieve expressive text-to-speech (TTS). However, existing works only implicitly learn the prosody with masked token reconstruction tasks, which leads to low training efficiency and difficulty in prosody modeling. We propose CLAPSpeech, a cross-modal contrastive pre-training framework that explicitly learns the prosody variance of the same text token under different contexts. Specifically, 1) We encourage the model to connect the text context with its corresponding prosody pattern in the joint multi-modal space with the elaborate design of the encoder inputs and contrastive loss; 2) We introduce a multi-scale pretraining pipeline to capture prosody patterns in multiple levels. We show how to incorporate CLAPSpeech into existing TTS models for better prosody. Experiments on three datasets not only show that CLAPSpeech could improve the prosody prediction for existing TTS methods, but also demonstrate its generalization ability to adapt to multiple languages and multi-speaker TTS. We also deeply analyze the principle behind the performance of CLAPSpeech. Ablation studies demonstrate the necessity of each component in our method. Source code and audio samples are available at https://clapspeech.github.io. + +# 1 Introduction + +With the development of deep learning, the audio quality of modern TTS systems has been improved, yet prosody modeling is still a challenging problem. Previous works on expressive TTS have utilized external variation predictors (prediction-based, PB) + +(Ren et al., 2021a) and variational generative models (variation-based, VB) (Kim et al., 2020; Liu et al., 2022) to inject prosody variance into the TTS model. Another popular direction is to learn better text representation for prosody prediction (Tan et al., 2021). However, the existing text representation learning methods for TTS are either based on the masked language model task (Devlin et al., 2019; Jia et al., 2021; Chen et al., 2021) (i.e., learn a BERT-like large language model on a text corpus) or masked acoustic model task (Chen et al., 2020; Bai et al., 2022) (i.e., reconstruct the masked mel-spectrogram based on the input text), which result in two disadvantages. Firstly, they only implicitly learn prosody with reconstruction losses, which distracts the model from improving the prosody modeling. Secondly, they do not decouple the pronunciation space and prosody space, which leads to low training efficiency and a waste of model capacity. We perform a case study in Section 4.3.1, in which we can see that previous text representation used in TTS cannot capture the prosody variance under different text contexts. + +Technically, prosody can be regarded as the pitch and duration variance of the same token under different conditions (such as text contexts and speakers) (Tan et al., 2021). This paper mainly studies the prosody correlated to the text context. For instance, for the same word "higher", saying "higher up" or "slightly higher" can lead to different prosodies. Inspired by recent cross-modal contrastive learning works in the text-to-image task (Radford et al., 2021; Elizalde et al., 2022), we propose a contrastive learning method that connects the text context and the high-level prosody pattern in the text-speech joint multi-modal space, namely Contrastive Language-Audio Pre-Training + +texts that contain the selected token "higher" + +![](images/9e654948620697daaf5c844f6f0b7b36ea892a3b168763baaa8c62f1b14eeaaa.jpg) +Figure 1: The contrastive pre-training process of CLAPSpeech. For clarity, we only show the word-level pre-training here. Note that we also perform a phoneme-level pre-training. + +for Text-to-Speech (CLAPSpeech). Specifically, we learn a text encoder to predict the prosody from the text context and a prosody encoder to extract the ground-truth (GT) prosody from the speech segment of the selected token. During training, we select $N$ text-speech pairs that contain the same pronounceable token (e.g., the word "higher" or phoneme "AEO"). By aligning the text token with its corresponding prosody (extracted from GT speech) and pushing away the prosody representation from other text contexts, the text encoder is encouraged to extract prosody from the text context. An intuitive example of pre-training CLAPSpeech can be found in Figure 1. We also observe that the prosody pattern can be expressed at multiple levels. Therefore, we propose a multi-scale pre-training framework that learns two CLAPSpeech models to capture the prosody information at the phoneme and word levels, respectively. After the pre-training stage, our CLAPSpeech can be regarded as a plugin in text encoder applicable to all TTS models to provide fine-grained prosody representation. + +To prove the effectiveness and generalizability of our approach, we use two large-scale automatic speech recognition (ASR) datasets (LibriSpeech (Panayotov et al., 2015) for English and Wenet-Speech (Zhang et al., 2022) for Chinese) to pretrain the CLAPSpeech model. The pre-trained text encoder of CLAPSpeech is then plugged into prediction/variation-based TTS baselines to demonstrate the improvement of CLAPSpeech to the exist- + +ing expressive TTS systems. We then evaluate the performance on three TTS datasets, including one single-speaker English dataset, one single-speaker Chinese corpus, and one multi-speaker English dataset. Experiments on all datasets show that CLAPSpeech improves the prosody of the TTS models and outperforms previous representation learning methods. + +To summarize, CLAPSpeech has three prominent advantages: 1) It can provide better prosody representation than previous representation learning methods with a much smaller model scale, thanks to its contrastive objective that explicitly learns the prosody. 2) The text representation of CLAPSpeech can be conveniently used in existing TTS systems, only with a minor modification of the front-end network architecture. 3) We also show its potential applications such as fine-grained prosody transfer in Section 4.3.2. + +# 2 Related Work + +# 2.1 Expressive TTS + +In the past few years, modern neural TTS has made significant progress in high practicality and audio quality (Ren et al., 2019; Kim et al., 2020; Huang et al.; Elias et al., 2021; He et al., 2022; Miao et al., 2021; Kim et al., 2021; Donahue et al., 2021; Jiang et al., 2022; Huang et al., 2022c; He et al., 2023; Jiang et al., 2021; Huang et al., 2022b,a). However, modeling expressive prosody given the plain input text is still challenging. To achieve expressive + +TTS, one common practice is to use a reference encoder and style tokens (Wang et al., 2018; Jia et al., 2018). But it is difficult to select appropriate reference audios during inference (Tan et al., 2021). Other works seek to improve prosody modeling with advanced network designs, which can be categorized into two classes: (1) the prediction-based (PB) TTS systems (Ren et al., 2021a) learn several external predictors to predict the prosody attributes such as pitch contour, duration, and energy; (2) the variation-based (VB) TTS systems leverage variational auto-encoder (VAE) (Ren et al., 2021b) or normalizing flow (Kim et al., 2020) to model the prosody in the latent space. + +There are also some works that explore providing better text presentation with rich prior knowledge to help the prosody prediction. For instance, Liu et al. (2021) and Ye et al. (2022) incorporate syntax information through dedicated modeling methods such as graph networks. Representation learning methods for text pre-training and speech pre-training also show improvements in the prosody of TTS. We will discuss the representation learning works for TTS in the next section. + +# 2.2 Representation Learning for TTS + +Self-supervised pre-training methods have been leveraged in TTS to enhance text processing or speech generation capabilities (Chung et al., 2019; Zhang et al., 2019). Some early works (Wang et al., 2015) use pre-trained word embeddings to improve the robustness of TTS systems. Recently, some works explore incorporating pre-trained large masked language models (MLMs) (Devlin et al., 2019; Chen et al., 2021; Jia et al., 2021) to enjoy the rich semantic information learned from the web-scale text corpus. However, the above-mentioned works only focus on the text space, it is challenging for them to model expressive prosody considering the models are unaware of the high variable prosody patterns in the speech space. There are several inspiring speech representation learning methods in ASR. Baevski et al. (2020) and Hsu et al. (2021) utilize masked continuous speech features to predict predetermined cluster assignments. As for TTS, ProsoSpeech (Ren et al., 2022) designs a word-level vector quantization bottleneck to extract discrete prosody representation from speech. Masked acoustic model (MAM) (Chen et al., 2020) proposes to learn a speech encoder that generates continuous speech (prosody) representations. + +Specifically, during training they replace a span of speech spectrogram with mask tokens and learn to recover the masked spectrogram without text conditions. $\mathrm{A}^{3}\mathrm{T}$ (Bai et al., 2022) additionally learns a text encoder as auxiliary information for MAM to reconstruct the masked mel-spectrogram. + +The difference between CLAPSpeech and previous representation works in TTS is obvious: While previous works implicitly learn the prosody information with the masked token reconstruction task, CLAPSpeech is the first work that utilizes the cross-modal contrastive learning to explicitly learn the context-correlated prosody, which leads to better prosody prediction and more efficient usage of model capacity. + +# 3 CLAPSpeech + +We propose CLAPSpeech, a cross-modal contrastive learning approach to provide better text representation for prosody prediction in TTS. As shown in Figure 1, CLAPSpeech comprises a text encoder and a prosody encoder, whose training objective is to connect the text token and the speech segment in the joint prosody space. In this section, we first design the network structure and input features of these two encoders. These elaborate designs enable the text encoder to effectively process the text context and ensure that the prosody encoder focuses on extracting the high-level prosody pattern from the speech segment while eliminating other variables, such as timbre. Then we introduce the multi-scale contrastive pre-training framework, which enables CLAPSpeech to capture prosody in both phoneme and word levels. Finally, we show how the pre-trained text encoder of CLAPSpeech can be conveniently plugged into modern TTS systems to improve prosody prediction. We describe these designs in detail in the following subsections and provide more technical details in Appendix A. + +# 3.1 Text Encoder and Prosody Encoder + +The prosody of the same pronounceable token1 varies in different text contexts. CLAPSpeech aims to model the correlation between the text context and the high-level prosody pattern. To this end, we design a text encoder and a prosody encoder to construct a text-speech multi-modal prosody embedding space. + +As shown in Figure 2(a), the text encoder uses phoneme and byte pair encoding (BPE) (Shibata + +![](images/2fa3ae53c28ed8c3879e37cd18944e6aa4f41439c424b3dbea0214620f4f2997.jpg) +(a) text encoder + +![](images/1b01d3d8a8938c50f13453a53d8678c302d2e5830d5a4664b9e1ad0ee5c479aa.jpg) +Figure 2: The text / prosody encoder of CLAPSpeech. In subfigure (a), "WP" and "Word2Ph" denotes word pooling and Word2Ph expanding operation, which are illustrated in Figure 3. +Figure 3: The word pooling and word2ph expanding operation. + +![](images/bff39c7d145dec531d4b9019ec6b41f35da81546ec5ebccee0a50d707ab53517.jpg) +(b) Word2Ph Expanding + +et al., 1999) of the input text as the input. The phoneme and BPE sequence help the model extract the prosody pattern related to phonological habits (such as the linking phenomenon in English) and semantic information (which may imply different emotional overtones), respectively. The network structure of the text encoder is composed of several Feed Forward Transformers (FFT) (Vaswani et al., 2017), which have proven the robustness in processing long text sequences in TTS models. Specifically, we learn two independent FFT blocks to process the phoneme and BPE sequences, respectively. This way, the phoneme FFT block could model the phonological habits in phonetic space, and the BPE FFT block could extract the semantic information. One difficulty is fusing the phoneme and BPE sequence of mismatched length. Instead of concatenating these two sequences in the time axis, we use word-level pooling (WP) from Ren et al. (2021b) to process the BPE encoding to the word level, then expand it to the phoneme level (namely the word2ph operation). To be specific, as shown in Figure 3(a), the WP operation averages the phoneme hidden states inside each word according to the word boundary, and the word2ph operation repeats the word hidden states for each phoneme insides the word boundary as illustrated in Figure 3(b). + +Once the phoneme sequence and BPE sequece is fused, we then use an additional FFT block to fuse the aligned phoneme and BPE encoding to get the final phoneme-level text encoding. During the + +pre-training phase, since only one selected token is analyzed, we index from the phoneme-level text encoding to obtain the encoding of the selected token (namely the token encoding in Figure 2(a)) and then linearly project it into the multi-modal embedding space. During the TTS phase, the phoneme-level output of the text encoder can be conveniently utilized as auxiliary features for TTS systems, which we will discuss in Section 3.3. + +The prosody encoder aims to extract prosody patterns from the GT speech segment of the selected token. Therefore, we clip the mel-spectrogram with the word boundary2 as the input speech feature. Then the prosody encoder processes the input mel-spectrogram into a global encoding to be connected with the token encoding. Note that the clipped speech segment only contains the local prosody information for the selected token without leaking any contextual information. Thanks to the contrastive learning setting, the extracted global prosody encoding is disentangled from phonetic and speaker space: 1) since the positive sample and negative samples belong to the same pronounceable token, the phonetic information is eliminated; 2) as the speaker information is not provided to the text encoder3, the prosody encoder will filter out speaker information to maximize the prosody information in the output features during training. This way, by connecting the context-aware text encoding with the context-unaware mel encoding, on the one hand, the prosody encoder learns to extract the high-level prosody information from the + +speech segment; on the other hand, the text encoder is encouraged to utilize the text context to predict the prosody extracted by the prosody encoder. As shown in Figure 2(b), we use ResNet-50 (He et al., 2016) as the backbone of the prosody encoder due to its robustness. We make several modifications to the original version: 1) to better process the mel-spectrogram, we use 1D convolution with layer normalization to build the fundamental residual block; 2) to handle the speech segment of dynamic lengths, we use an attentive pooling layer from Radford et al. (2021) to aggregate the output feature map of the ResNet. + +# 3.2 Multi-scale Contrastive Pre-training + +The key idea of CLAPSpeech is to model the prosody variance of the same text token under different contexts. Therefore, to construct a minibatch for contrastive pre-training, we randomly select a text token, then sample a batch of $N$ text-speech pairs that contain the selected token (one intuitive sample is shown in Figure 1, where we sample the text-speech pairs that contain the word "higher"). To better extract prosody variance at the phoneme and word level, we introduce a multi-scale contrastive training framework. To be specific, we learn two CLAPSpeech models for phoneme-level and word-level text tokens, respectively. + +For clarity, we first illustrate the training process of phoneme-level CLAPSpeech. Let the text context that contains the selected phoneme token (e.g., "AEO") be represented by $X_{text}$ . Let the processed speech segment of the phoneme token be $X_{speech}$ s.t. $X_{speech} \in \mathbb{R}^{F \times T}$ , where $F$ is the number of Mel bins and $T$ is the number of time bins. For simplicity, we use $X_{text}$ and $X_{speech}$ to represent a batch of $N$ text-speech pairs. + +The text and speech are passed through the text encoder $f_{text}(\cdot)$ and prosody encoder $f_{speech}(\cdot)$ , respectively. As can be seen in Figure 2(a), the output of the text encoder $f_{text}(X_{text})$ is the phoneme-level encoding of the input text, hence we index from it to obtain the encoding of the phoneme token $f_{text}(X_{text})_{i_{ph}}$ , where $i_{ph}$ denotes the index of the phoneme token in the phoneme-level text sequence. As can be seen in Figure 2(b), the output speech encoding $f_{speech}(X_{speech})$ is a global representation of the input speech segment. The output representations are normalized and then linearly + +projected into the multi-modal embedding space: + +$$ +T _ {p h} = L _ {t e x t} \left(L N \left(f _ {t e x t} \left(X _ {t e x t}\right) _ {i _ {p h}}\right)\right) \tag {1} +$$ + +$$ +S = L _ {s p e e c h} (L N (f _ {s p e e c h} (X _ {s p e e c h}))), +$$ + +where $T_{ph} \in \mathbb{R}^{N \times C}$ is the phoneme token representation and $S \in \mathbb{R}^{N \times C}$ is the speech representation of channel size $C$ . $LN$ means layer normalization, $L_{text}$ and $L_{speech}$ are linear projections. + +Now that the text and speech embeddings are comparable, CLAPSpeech is trained to predict which of the $N \times N$ possible text-speech pairings across a batch actually occurred. Specifically, the text encoder and prosody encoder are encouraged to maximize the cosine similarity of the text and speech encoding of the $N$ real pairs in the batch while minimizing the cosine similarity of the embeddings of the $N^2 - N$ incorrect pairings. Following Radford et al. (2021), we optimize a symmetric cross-entropy loss over these similarity scores: + +$$ +\mathcal {L} _ {p h} = 0. 5 \times \left(l _ {\text {t e x t}} (\tau \cdot C _ {p h}) + l _ {\text {s p e e c h}} (\tau \cdot C _ {p h})\right) (2) +$$ + +where $C_{ph} \in \mathbb{R}^{N \times N}$ is the cosine similarity matrix between the phoneme token encoding $T_{ph}$ and the speech encoding $S$ , measured by $C_{ph} = T_{ph} \cdot S^T$ ; $\tau$ is a learnable temperature parameter to scale the range of logits; and $l_k = \frac{1}{N} \Sigma_{i=0}^N \log \operatorname{diag}(\operatorname{softmax}(C))$ is the cross entropy function along the text and speech axis in $C$ . + +The word-level CLAPSpeech can be trained similarly. As shown in Figure 2(a), for the word-level CLAPSpeech, we use word pooling to process the phoneme-level text encoding into word level, then index from it to obtain the word token encoding $T_{word}$ . Similar to Equation 2, the training loss for word-level CLAPSpeech is formulated as: + +$$ +\mathcal {L} _ {\text {w o r d}} = 0. 5 \times \left(l _ {\text {t e x t}} (\tau \cdot C _ {\text {w o r d}}) + l _ {\text {s p e e c h}} (\tau \cdot C _ {\text {w o r d}})\right) \tag {3} +$$ + +where $C_{word}$ is the cosine similarity matrix between the word token encoding $T_{word}$ and the speech encoding $S$ . + +# 3.3 CLAPSpeech Plugged in TTS Systems + +The text encoder of CLAPSpeech could provide text representation with rich prosody information for the TTS task. Since the generated text representation is at the phoneme level, which is in line with the majority of current TTS models that also utilize phoneme sequence as the text input, CLAPSpeech can be a convenient plugin unit for TTS systems to improve prosody prediction. Specifically, we + +![](images/f5e22e222a59862308dd2446f2c276bcb0a4459cf65de77b282882c5487d8df1.jpg) +Figure 4: PortaSpeech with CLAPSpeech plugged in. + +take a state-of-the-art variation-based TTS system, PortaSpeech, as an example. As shown in Figure 4, the pre-trained text encoders of CLAPSpeech (marked with a red dashed rectangle) perform as an auxiliary encoder to the original phonetic encoder of PortaSpeech. The phoneme-level outputs of the phonetic encoder and CLAPSpeech text encoder are fused and processed by the following encoder. Note that we fix the parameters of CLAPSpeech text encoders during the training of the TTS system to avoid overfitting. CLAPSpeech can be easily plugged into other TTS systems in a similar way. To demonstrate the universality, we illustrate how to combine CLAPSpeech with a widely-used prediction-based TTS system, FastSpeech 2, in Appendix A.1. We additionally adopt multi-length adversarial training in TTS models to improve audio quality. More details about the adversarial training can be found in Appendix A.2. + +# 4 Experiments + +# 4.1 Experimental Setup + +Datasets and Baselines We pre-train CLAP-Speech on two ASR datasets: 1) LibriSpeech (Panayotov et al., 2015), an English database that contains 982 hours of speech from 2484 speakers; 2) WenetSpeech (Zhang et al., 2022), a Chinese speech corpus consisting of 10,000 hours of + +speech $^{4}$ . Then we evaluate the pre-trained CLAP-Speech on three TTS datasets: 1) LJSpeech (Ito and Johnson, 2017), a single-speaker database that contains 13,100 English audio clips with a total of nearly 24 hours of speech; 2) Biaobei $^{5}$ , a Chinese speech corpus consisting of 10,000 sentences (about 12 hours) from a Chinese speaker; 3) LibriTTS (Zen et al., 2019), an English dataset with 149,736 audio clips (about 245 hours) from 1,151 speakers (We only use train clean360 and train clean100). The raw text is transformed into phoneme and BPE sequences using open-sourced tools. The GT mel-spectrograms are generated from the raw waveform with a frame size of 1024 and the hop size of 256. We compare CLAP-Speech against two pre-training baselines (BERT (Devlin et al., 2019) and A $^{3}$ T (Bai et al., 2022)) in a prediction-based (PB) TTS model, FastSpeech 2, and a variation-based (VB) TTS model, PortaSpeech. + +Model Configuration CLAPSpeech consists of a text encoder and a prosody encoder, whose structures are shown in Figure 2 and discussed in Section 3.2. As for the PB and VB TTS models, we use the same structure in the original papers with an additional multi-length discriminator to improve audio quality. The multi-length discriminator consists of multiple stacked convolutional layers with batch normalization and treats the input spectrogram as images. We put more detailed model configurations in Appendix B.1. + +Training and Evaluation Our approach is implemented with Pytorch. We pre-train CLAPSpeech on 4 Nvidia 3090Ti GPUs with a batch size of 1,024 text-speech pairs (256 pairs per GPU). We use the Adam optimizer with an initial learning rate of 0.0005. We train the CLAPSpeech model for 640,000 iterations (which takes about 1 week) and follow the cosine learning rate schedule in CLIP. Then we train the TTS models on 1 Nvidia 2080Ti GPU with a batch size of 64 sentences, following the learning rate schedule in Vaswani et al. (2017). We use HiFi-GAN (Kong et al., 2020) as the vocoder. We conduct the mean opinion score (MOS) and comparative mean opinion score (CMOS) evaluation to measure the prosody and audio quality. Details about the subjective evaluation + +can be found in Appendix B.2. As for the objective evaluation, following Ren et al. (2021b), we evaluate the prosody from the aspects of pitch and duration: 1) we compute the average dynamic time warping (DTW) (Muller, 2007) distances between the pitch contours of GT speech and synthesized speech to measure the pitch accuracy; 2) we calculate the average absolute duration error (DE) in micro-seconds6 to measure the duration accuracy. + +# 4.2 Performance + +We compare the performance of our CLAPSpeech against BERT and $\mathrm{A}^{3}\mathrm{T}$ in PB/VB TTS models. GT (the ground-truth audio) and GT (voc.) (the audio waveform generated by the vocoder using the GT mel-spectrogram) are also included in the experiment. We perform the TTS experiments on three datasets as mentioned in Section 4.1. The results are shown in Table 1. We can see that CLAPSpeech outperforms other representation learning methods in both PB and VB TTS baselines in terms of MOS, pitch accuracy, and duration accuracy, which proves that CLAPSpeech could effectively improve the prosody prediction in current expressive TTS models (no matter prediction-based or variation-based). Besides, we observe that CLAPSpeech achieves better performance than BERT and $\mathrm{A}^{3}\mathrm{T}$ with much fewer model parameters. We suspect it is due to the fact that the MLM-based method (i.e., BERT) require a large model capacity to store the semantic information and MAM-based method (i.e., $\mathrm{A}^{3}\mathrm{T}$ ) have to jointly learn the phonetic information to reconstruct the masked mel-spectrogram. By contrast, our CLAPSpeech eliminates the phonetic space and only focus on the prosody space during pre-training, which is parameter-efficient. + +We then visualize the mel-spectrograms generated by different methods in Figure 5. We can see that CLAPSpeech can generate results with more realistic pitch contours, which result in expressive prosody. In conclusion, our experiments demonstrate that CLAPSpeech could help TTS systems synthesize more expressive and prosodic audio. + +# 4.3 Deeper Analysis + +# 4.3.1 Token Representation Self-similarity + +To better understand the performance superiority of CLAPSPeech over existing representation learning methods for TTS, we analyze the token representen + +tation learned by CLAPSpeech and other methods. Following Su et al. (2021), we define the averaged similarity on the selected token under different contexts $T = [T_{1},\dots,T_{N}]$ as, + +$$ +s (T) = \frac {1}{N (N - 1)} \sum_ {i = 1} ^ {N} \sum_ {j = 1, j \neq i} ^ {N} \operatorname {c o s i n e} \left(T _ {i}, T _ {j}\right) \tag {4} +$$ + +where $T_{i}$ and $T_{j}$ are the selected token's encoding extracted by the model from different text contexts. Intuitively, a lower $s(T)$ indicates that the selected token itself plays a smaller role in generating its representation, which means that the model captures more context-related information from the input text sequence, and thus predicts better prosody. + +Quantitative Evaluation We sample 10,000 batches (each batch consists of 256 sentences that contain the same selected token) from the ASR validation datasets and compute the averaged self-similarity. The result is shown in Table 2. We observe that our CLAPSpeech learned with the contrastive objective (in Equation 2) achieves the lowest similarity in the off-diagonal entries of the similarity matrix, which denotes that the model has made use of the text context to capture the prosody variance of the same token, thus achieve the best prosody performance in Table 1. Besides, we can see that BERT also achieves a relatively low off-diagonal similarity, which is due to its MLM task during pre-training, in which the model needs to extract semantic information from context to predict the masked token. By contrast, the vanilla TTS text encoder and $\mathrm{A}^3\mathrm{T}$ fail to achieve a low off-diagonal similarity, which means that both models cannot extract discriminative information from different contexts. We suspect the failure of $\mathrm{A}^3\mathrm{T}$ is due to the fact that its MAM objective encourages the model to predict the masked mel-spectrogram patch based on the input unmasked text sequence, which increases the model's demand for phonetic information of the selected token. + +Qualitative Evaluation We sample 8 sentences7 that contain the word "higher" from LibriSpeech and visualize the self-similarity matrix $M$ (where $M_{i,j} = \text{cosine}(T_i, T_j)$ ) produced by CLAPSpeech and vanilla TTS text encoder. The results are shown in Figure 6, where a darker color denotes a higher self-similarity score. We also provide the self-similarity matrix of BERT and A3T in Figure 9 + +Table 1: Performance comparison of different methods. $PB$ and $VB$ denote prediction-based and variation-based TTS baselines, respectively. DTW denotes the dynamic time warping distance of pitch contours in the Mel-spectrogram. DE means the averaged absolute duration error in micro-seconds. + +
MethodLJSpeechBiaobeiLibriTTS#Params
MOS↑DTW↓DE↓MOS↑DTW↓DE↓MOS↑DTW↓DE↓
GT4.81004.59004.4000/
GT(voc.)4.63004.43004.2600/
PB3.7729.0925.773.3718.0128.793.4314.2627.4211.99M
PB + BERT4.0427.4324.973.4316.7928.063.6013.8226.70109.48M
PB + A3T3.9228.1825.633.5117.1828.443.5413.6727.0348.25M
PB + CLAPSpeech4.1127.1624.193.6216.0427.603.7113.3726.4630.51M
VB3.9627.5853.233.7514.2240.313.8111.9652.5123.02M
VB + BERT4.1326.9752.013.9113.6338.413.9511.5151.27132.69M
VB + A3T4.0526.3752.174.0413.9739.153.8211.7151.9859.73M
VB + CLAPSpeech4.2825.9451.344.2213.4837.074.0610.9350.8941.54M
+ +![](images/0d43e5d5e6f3e2cc5b89aa95e41a5b7a0065f51042143ab9578274995f4ad54c.jpg) +(a) GT + +![](images/e992335af3d24b745c06c96c9c23b93f50c0caf5617fa9d5aa628aa042ff2153.jpg) +(b) PB + +![](images/d2e80bf098fc918bbb084a952aace74d25803daae9dfbc137dd4e28c270adb88.jpg) +(c) PB+BERT + +![](images/7d1fb4458e35b13131fcbde75834c50f8a14a9d39342837d249ea0fd2f3ce0cc.jpg) +(d) $\mathrm{PB + A^3T}$ + +![](images/820dc2bc68386dc4e2becf3ec82fd83ac46f7cafbda17c9dd12c723ccba174ac.jpg) +(e) PB + CLAPSpeech + +Table 2: Self-similarity score of different methods. TTS denotes the text encoder of the vanilla TTS baseline. + +
Text Encoder ofTTSBERTA3TCLAPSpeech
Self-Similarity0.98540.55170.93900.4160
+ +of Appendix C. We can see that the self-similarities of CLAPSpeech are much lower in the off-diagonal entries. + +# 4.3.2 Fine-grained Prosody Transfer + +We perform an intuitive case study about prosody transfer to further validate that our CLAPSpeech's text-speech joint multi-modal space represents high-level prosody patterns (i.e., the pitch contours and duration information). We take s7/8 in Table 5 as the reference/source audio and expect to transfer the word "higher" 's prosody pattern from s7 to s8. Specifically, we use the text encoder of CLAPSpeech to extract the text prosody encoding of s7 and s8, then replace the text token encoding of "higher" in s8 with that in s7. As shown in Figure 7, the prosody pattern of "higher" in s8 $^{8}$ in Figure 7(a) has been successfully transferred into s7 in + +![](images/0d24692269c57748255607f524d5d8218eaeb1200c74f0a0703b0afba4e369bf.jpg) +Figure 5: Visualizations of the mel-spectrograms generated by different TTS systems. +(a) CLAPSpech +Figure 6: Example: self-similarity matrix visualization of CLAPSpeech and the text encoder of the vanilla TTS model. $s_i$ denotes the $i_{th}$ sentence. + +![](images/a4591ed681a9a3365f1f62aec3d2738c1d99c924d12afbec8fb98d3311fb388c.jpg) +(b) TTS + +Figure 7(c). We also provide audio samples of this case study on our demo page. The manipulation of the local prosody proves that our CLAPSpeech extract prosody representation effectively influences the prosody prediction of the TTS system. + +# 4.4 Ablation Studies + +Use BPE as Auxiliary Features We first analyze the effectiveness of the BPE as an auxiliary feature to help extract prosody information from the text context. During the pre-training phase of CLAPSpeech, we found removing BPE from the + +![](images/4f1f4f9d32c53e1ebb27fbb1e0fce6cd0ad40451fcad43228bb1fa3197328aea.jpg) +(a) reference (s7) + +![](images/bd711c24e4755b4398a90ef1492897abd33b12791c6fced823caa6a0f56f3d6a.jpg) +(b) source (s8) + +![](images/22b1f340821a51f9e6e4aed17a2fcbb4ddb8f056747095caab481d148154b8ea.jpg) +(c) transferred (s8) +Figure 7: Visualizations of the mel-spectrograms generated in prosody transfer. + +text encoder significantly degrades the validation CLIP loss from 0.3692 to 0.6764. Then in the TTS phase, as can be seen in line 3 in Table 3, the ablated model using the pre-trained text encoder without BPE leads to a performance drop in terms of CMOS, DTW, and DE. This is possibly due to the fact that BPE could better represent the semantic information than the low-level phoneme sequence. + +Multi-scale Pre-training To demonstrate the effectiveness of multi-scale pre-training, as can be seen in line 4/5 in Table 3, we tried to remove phoneme-level or word-level CLAPSpeech from the model, which leads to a worse prosody performance. We also tried to use the untrained CLAPSpeech to prove the necessity of the pre-training process, and we found this ablated model (line 6) achieves a slightly worse performance than the TTS baseline (line 3). + +Table 3: Performance comparison for ablation studies. + +
SettingCMOSDTWDE
TTS + CLAPSpeech027.1624.19
TTS baseline-1.5329.0925.77
w/o BPE-1.0828.2124.93
w/o ph-level-1.1127.6825.01
w/o word-level-0.4627.5524.52
untrained-1.6729.4525.96
+ +# 5 Conclusion + +In this paper, we propose CLAPSpeech, a cross-modal contrastive pre-training framework that provides better text representation with rich prosody information for TTS. With the design of a text encoder and a prosody encoder, CLAPSpeech learns to connect the text context with its corresponding prosody pattern in the speech. We also introduced multi-scale pre-training to extract prosody patterns at multiple levels. We have demonstrated the performance and generalization ability of CLAPSpeech + +on three TTS datasets (English, Chinese, and multispeaker, respectively). We have also deeply analyzed the principle behind the improvement of CLAPSpeech and performed ablation studies to prove the necessity of each component. + +# 6 Limitations + +There are majorly two limitations: Firstly, in this work, we only consider the current-sentence text context-related prosody. In future work, we will focus on improving the inter-sentence prosody to achieve coherent, expressive TTS for long-form text. Secondly, other variables are not considered during the contrastive pre-training. One can explore similar approaches that connect prosody to other conditions such as speaker, emotion, etc. + +# 7 Ethics Statement + +CLAPSpeech improves the prosody of the synthesized speech, which may cause unemployment for people with related occupations. Besides, the production of fake speeches may cause voice security issues. Further efforts in automatic speaker verification should be made to improve voice security. + +# 8 Acknowledgment + +This work was supported in part by the National Key R&D Program of China under Grant No.2022ZD0162000, National Natural Science Foundation of China under Grant No. 62222211 and Grant No.61836002 and Grant No.62072397, and Yiwise. + +# References + +Alexei Baevski, Yuhao Zhou, Abdelrahman Mohamed, and Michael Auli. 2020. wav2vec 2.0: A framework for self-supervised learning of speech representations. In NIPS. +He Bai, Renjie Zheng, Junkun Chen, Mingbo Ma, Xingtong Li, and Liang Huang. 2022. A3t: Alignment-aware acoustic and text pretraining for speech synthesis and editing. In ICML. +Junkun Chen, Mingbo Ma, Renjie Zheng, and Liang Huang. 2020. Mam: Masked acoustic modeling for end-to-end speech-to-text translation. arXiv preprint arXiv:2010.11445. +Liping Chen, Yan Deng, Xi Wang, Frank K Soong, and Lei He. 2021. Speech bert embedding for improving prosody in neural tts. In ICASSP. + +Yu-An Chung, Yuxuan Wang, Wei-Ning Hsu, Yu Zhang, and RJ Skerry-Ryan. 2019. Semi-supervised training for improving data efficiency in end-to-end speech synthesis. In ICASSP. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. Bert: Pre-training of deep bidirectional transformers for language understanding. In *NAACL-HLT*. +Jeff Donahue, Sander Dieleman, Mikołaj Binkowski, Erich Elsen, and Karen Simonyan. 2021. End-to-end adversarial text-to-speech. In ICLR. +Isaac Elias, Heiga Zen, Jonathan Shen, Yu Zhang, Ye Jia, Ron J Weiss, and Yonghui Wu. 2021. Parallel tacotron: Non-autoregressive and controllable tts. In ICASSP. +Benjamin Elizalde, Soham Deshmukh, Mahmoud Al Ismail, and Huaming Wang. 2022. Clap: Learning audio concepts from natural language supervision. arXiv preprint arXiv:2206.04769. +Jinzheng He, Jinglin Liu, Zhenhui Ye, Rongjie Huang, Chenye Cui, Huadai Liu, and Zhou Zhao. 2023. Rmssinger: Realistic-music-score based singing voice synthesis. +Jinzheng He, Zhou Zhao, Yi Ren, Jinglin Liu, Baoxing Huai, and Nicholas Yuan. 2022. Flow-based unconstrained lip to speech generation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pages 843-851. +Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. 2016. Deep residual learning for image recognition. In CVPR. +Wei-Ning Hsu, Benjamin Bolte, Yao-Hung Hubert Tsai, Kushal Lakhotia, Ruslan Salakhutdinov, and Abdelrahman Mohamed. 2021. Hubert: Self-supervised speech representation learning by masked prediction of hidden units. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 29:3451-3460. +Rongjie Huang, Chenye Cui, Feiyang Chen, Yi Ren, Jinglin Liu, Zhou Zhao, Baoxing Huai, and Zhefeng Wang. 2022a. Singgan: Generative adversarial network for high-fidelity singing voice generation. In Proceedings of the 30th ACM International Conference on Multimedia, pages 2525-2535. +Rongjie Huang, Max WY Lam, Jun Wang, Dan Su, Dong Yu, Yi Ren, and Zhou Zhao. 2022b. Fastdiff: A fast conditional diffusion model for high-quality speech synthesis. arXiv preprint arXiv:2204.09934. +Rongjie Huang, Yi Ren, Jinglin Liu, Chenye Cui, and Zhou Zhao. Generspeech: Towards style transfer for generalizable out-of-domain text-to-speech. In Advances in Neural Information Processing Systems. +Rongjie Huang, Zhou Zhao, Huadai Liu, Jinglin Liu, Chenye Cui, and Yi Ren. 2022c. Prodiff: Progressive fast diffusion model for high-quality text-to-speech. + +In Proceedings of the 30th ACM International Conference on Multimedia, pages 2595-2605. +Keith Ito and Linda Johnson. 2017. The lj speech dataset. https://keithito.com/LJ-Speech-Dataset/. +Ye Jia, Heiga Zen, Jonathan Shen, Yu Zhang, and Yonghui Wu. 2021. PNG bert: Augmented bert on phonemes and graphemes for neural tts. +Ye Jia, Yu Zhang, Ron Weiss, Quan Wang, Jonathan Shen, Fei Ren, Patrick Nguyen, Ruoming Pang, Ignacio Lopez Moreno, Yonghui Wu, et al. 2018. Transfer learning from speaker verification to multispeaker text-to-speech synthesis. NIPS. +Ziyue Jiang, Yi Ren, Ming Lei, and Zhou Zhao. 2021. Fedspeech: Federated text-to-speech with continual learning. arXiv preprint arXiv:2110.07216. +Ziyue Jiang, Su Zhe, Zhou Zhao, Qian Yang, Yi Ren, Jinglin Liu, and Zhenhui Ye. 2022. Dict-tps: Learning to pronounce with prior dictionary knowledge for text-to-speech. arXiv preprint arXiv:2206.02147. +Jaehyeon Kim, Sungwon Kim, Jungil Kong, and Sungroh Yoon. 2020. Glow-tts: A generative flow for text-to-speech via monotonic alignment search. In NIPS. +Jaehyeon Kim, Jungil Kong, and Juhee Son. 2021. Conditional variational autoencoder with adversarial learning for end-to-end text-to-speech. In ICML. +Jungil Kong, Jaehyeon Kim, and Jaekyoung Bae. 2020. Hifi-gan: Generative adversarial networks for efficient and high fidelity speech synthesis. In NIPS. +Jinglin Liu, Chengxi Li, Yi Ren, Feiyang Chen, and Zhou Zhao. 2022. Diffsinger: Singing voice synthesis via shallow diffusion mechanism. In AAAI. +Rui Liu, Berrak Sisman, and Haizhou Li. 2021. Graph-speech: Syntax-aware graph attention network for neural speech synthesis. In ICASSP. +Chenfeng Miao, Liang Shuang, Zhengchen Liu, Chen Minchuan, Jun Ma, Shaojun Wang, and Jing Xiao. 2021. Efficienttts: An efficient and high-quality text-to-speech architecture. In ICML. +Meinard Muller. 2007. Dynamic time warping. Information retrieval for music and motion, pages 69-84. +Vassil Panayotov, Guoguo Chen, Daniel Povey, and Sanjeev Khudanpur. 2015. Librispeech: an asr corpus based on public domain audio books. In ICASSP. +Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. 2021. Learning transferable visual models from natural language supervision. In ICML. + +Yi Ren, Chenxu Hu, Xu Tan, Tao Qin, Sheng Zhao, Zhou Zhao, and Tie-Yan Liu. 2021a. Fastspeech 2: Fast and high-quality end-to-end text to speech. In ICLR. + +Yi Ren, Ming Lei, Zhiying Huang, Shiliang Zhang, Qian Chen, Zhijie Yan, and Zhou Zhao. 2022. Prosospeech: Enhancing prosody with quantized vector pre-training in text-to-speech. In ICASSP. + +Yi Ren, Jinglin Liu, and Zhou Zhao. 2021b. Portaspeech: Portable and high-quality generative text-to-speech. In NIPS. + +Yi Ren, Yangjun Ruan, Xu Tan, Tao Qin, Sheng Zhao, Zhou Zhao, and Tie-Yan Liu. 2019. Fastspeech: Fast, robust and controllable text to speech. + +Yusuxke Shibata, Takuya Kida, Shuichi Fukamachi, Masayuki Takeda, Ayumi Shinohara, Takeshi Shinohara, and Setsuo Arikawa. 1999. Byte pair encoding: A text compression scheme that accelerates pattern matching. + +Yixuan Su, Fangyu Liu, Zaiqiao Meng, Tian Lan, Lei Shu, Ehsan Shareghi, and Nigel Collier. 2021. Tacl: Improving bert pre-training with token-aware contrastive learning. arXiv preprint arXiv:2111.04198. + +Xu Tan, Tao Qin, Frank Soong, and Tie-Yan Liu. 2021. A survey on neural speech synthesis. arXiv preprint arXiv:2106.15561. + +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. + +Peilu Wang, Yao Qian, Frank K Soong, Lei He, and Hai Zhao. 2015. Word embedding for recurrent neural network based its synthesis. In ICASSP. + +Yuxuan Wang, Daisy Stanton, Yu Zhang, RJ-Skerry Ryan, Eric Battenberg, Joel Shor, Ying Xiao, Ye Jia, Fei Ren, and Rif A Saurous. 2018. Style tokens: Unsupervised style modeling, control and transfer in end-to-end speech synthesis. In ICML. + +Zhenhui Ye, Zhou Zhao, Yi Ren, and Fei Wu. 2022. Syntaspeech: Syntax-aware generative adversarial text-to-speech. arXiv preprint arXiv:2204.11792. + +Heiga Zen, Viet Dang, Rob Clark, Yu Zhang, Ron J Weiss, Ye Jia, Zhifeng Chen, and Yonghui Wu. 2019. Libritts: A corpus derived from librispeech for text-to-speech. arXiv preprint arXiv:1904.02882. + +Binbin Zhang, Hang Lv, Pengcheng Guo, Qijie Shao, Chao Yang, Lei Xie, Xin Xu, Hui Bu, Xiaoyu Chen, Chenchen Zeng, et al. 2022. Wenetspeech: A 10000+ hours multi-domain mandarin corpus for speech recognition. In ICASSP. + +Mingyang Zhang, Xin Wang, Fuming Fang, Haizhou Li, and Junichi Yamagishi. 2019. Joint training framework for text-to-speech and voice conversion using multi-source tacotron and wavenet. In INTER-SPEECH. + +![](images/6b06222815a432ce5fc63373f4eced38a92a628c32a461896ff4aad81a9293f8.jpg) +Figure 8: FastSpeech 2 with CLAPSpeech plugged in. + +# A Details of Models + +# A.1 CLAPSpeech plugged in FastSpeech 2 + +We show how to integrate CLAPSpeech into a popular prediction-based TTS system, FastSpeech 2. As shown in Figure 8, the pre-trained text encoders of CLAPSpeech (marked with a red dashed rectangle) perform as an auxiliary encoder to the original phonetic encoder of FastSpeech 2. The phoneme-level outputs of the phonetic encoder and CLAPSpeech text encoder are fused and processed by the following encoder. Note that we fix the parameters of CLAPSpeech text encoders during the training of the TTS system to avoid overfitting. + +# A.2 Multi-length Adversarial Training + +For the tested TTS baselines, we adopt an additional multi-length discriminator to provide a least squared GAN loss to improve the audio quality. The multi-length discriminator is an ensemble of multiple CNN-based discriminators which evaluates the mel-spectrogram based on random windows of different lengths. One could refer to Ye et al. (2022) for more details. + +# B Detailed Experimental Settings + +# B.1 Model Configurations + +We list the hyper-parameters of CLAPSpeech and the tested TTS baselines in Table 4. + +# B.2 Subjective Evaluation + +For each tested dataset, we randomly select 10 texts from the test set and use the TTS systems to generate the audio samples. Each audio has been listened to by at least 20 native listeners, who are + +Table 4: The detailed model configurations. + +
Hyper-parameterCLAPSpeechNumber of parameters
Text EncoderPhoneme/BPE embedding hidden size19218.517M
Phoneme/BPE encoder FFT blocks4
Hidden size192
Conv1D kernel5
Conv1D filter size768
Prosody EncoderResidual blocks421.801M
Number of conv layers per block12
Hidden size192
Input mel-spectrogram length128
Hidden size in pooling layer768
#Attention heads in pooling layer4
Prediction-based TTS baselineEncoder Layers411.993M
Decoder Layers4
Encoder/Decoder Conv1D Kernel9
Encoder/Decoder Conv1D channel size256
Variation-based TTS baselineEncoder Layers823.020M
Decoder Layers4
Encoder/Decoder Conv1D Kernel5
Encoder/Decoder Conv1D channel size192
Latent Size16
Prior Flow Layers4
Prior Flow Conv1D Kernel3
Prior Flow Conv1D Channel Size64
Multi-Length DiscriminatorNumber of CNN-based Discriminators30.927M
Window size32,64,128
Conv2D layers3
Hidden size192
+ +recruited on a crowdsourcing platform, Zhengshu Technology. We tell listeners to "focus on examining the naturalness of prosody (e.g., pitch, energy, and duration) and audio quality (noise, timbre, sound clarity, and high-frequency details)". For MOS, each tester is asked to evaluate the subjective naturalness of a sentence on a 1-5 Likert scale. For CMOS, listeners are asked to compare pairs of audio generated by systems A and B and indicate which of the two audio they prefer and choose one of the following scores: 0 indicating no difference, 1 indicating small difference, 2 indicating a large difference, and 3 indicating a very large difference. + +# C More Details in Analysis + +# C.1 Example Sentences + +We list the 8 example sentences in Table 5. These sentences are used as examples in Section 4.3. + +# C.2 Self-similarity of Other Baselines + +The self-similarity visualization of $\mathrm{A}^3\mathrm{T}$ and BERT can be found in Figure 9. We discuss the results in Section 4.3.1. + +![](images/663888cbad1b620e9a40de6370149e5c69dfeded4a9e688d7dd37fc12c7f8ab4.jpg) +(a) $\mathrm{A}^3\mathrm{T}$ +(b) BERT +Figure 9: Self-similarity matrix visualization of $\mathrm{A}^3\mathrm{T}$ and BERT. + +
s1... for the reputation of the stern judge stands not higher than that of the compassionate ...
s2As I went on, the precipices rose higher and seemed to overhang. The channel grew narrower ...
s3Better, and better, and better! Her voice went higher with each better, till it got quite to a squeak at last.
s4... and the native graduates of our higher institutions have begun to show their strength ...
s5Innocence is higher than virtue.
s6Nothing seems more unfit to give a deeper meaning to life and a higher value.
s7Higher up could be seen some chinamen, but whether they were fishing or washing we could not tell .
s8May they become convalescents and overcomers, and create higher bodies for themselves !
+ +Table 5: The text sentences used in the intuitive example, the selected word token "higher" is bold. + +A For every submission: + +A1. Did you describe the limitations of your work? + +6.Limitations + +A2. Did you discuss any potential risks of your work? + +7. Ethics Statement + +A3. Do the abstract and introduction summarize the paper's main claims? + +1.Introduction + +A4. Have you used AI writing assistants when working on this paper? + +Left blank. + +B Did you use or create scientific artifacts? + +Left blank. + +B1. Did you cite the creators of artifacts you used? + +No response. + +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? + +No response. + +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +No response. + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? + +No response. + +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? + +No response. + +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. + +No response. + +C Did you run computational experiments? + +4.Experiments + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +4.1 Experimental Setup & Appendix B.1 Model Configurations + +The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +4.1 Experimental Setup + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +4.2 & 4.3 & 4.4 + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +4.1 Experimental Setup + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Section 4.2 + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +Appendix B.2 + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +Appendix B.2 + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +Appendix B.2 + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +Appendix B.2 + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +Appendix B.2 \ No newline at end of file diff --git a/clapspeechlearningprosodyfromtextcontextwithcontrastivelanguageaudiopretraining/images.zip b/clapspeechlearningprosodyfromtextcontextwithcontrastivelanguageaudiopretraining/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..dd050c8931919f1b9e9e276aea20802c5fd9b7da --- /dev/null +++ b/clapspeechlearningprosodyfromtextcontextwithcontrastivelanguageaudiopretraining/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c7026bfd949caa51b65abf0c321cfed2fe53b1fc9026943a76a779002f2f233e +size 681373 diff --git a/clapspeechlearningprosodyfromtextcontextwithcontrastivelanguageaudiopretraining/layout.json b/clapspeechlearningprosodyfromtextcontextwithcontrastivelanguageaudiopretraining/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..c11d6a9f045742c77358510fabab13b2f89c43b2 --- /dev/null +++ b/clapspeechlearningprosodyfromtextcontextwithcontrastivelanguageaudiopretraining/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6fe77a58af7977f02fc04a32eb4d9ba77f3e7db7ec0cd99768722e11944c14a0 +size 456040 diff --git a/clarifydelphireinforcedclarificationquestionswithdefeasibilityrewardsforsocialandmoralsituations/150b68af-ea93-4833-809e-481897b7a00c_content_list.json b/clarifydelphireinforcedclarificationquestionswithdefeasibilityrewardsforsocialandmoralsituations/150b68af-ea93-4833-809e-481897b7a00c_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..351f6f3ab6dff48301e92b6d2b234f5fc5d50f26 --- /dev/null +++ b/clarifydelphireinforcedclarificationquestionswithdefeasibilityrewardsforsocialandmoralsituations/150b68af-ea93-4833-809e-481897b7a00c_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5ad74c0edfaa7bcec7aef3fe718832889dcf86005286bf8b25f07b713c1c92e1 +size 141328 diff --git a/clarifydelphireinforcedclarificationquestionswithdefeasibilityrewardsforsocialandmoralsituations/150b68af-ea93-4833-809e-481897b7a00c_model.json b/clarifydelphireinforcedclarificationquestionswithdefeasibilityrewardsforsocialandmoralsituations/150b68af-ea93-4833-809e-481897b7a00c_model.json new file mode 100644 index 0000000000000000000000000000000000000000..43dedb68c18e0ea84d8d2bae56834fd3c6ffa2a5 --- /dev/null +++ b/clarifydelphireinforcedclarificationquestionswithdefeasibilityrewardsforsocialandmoralsituations/150b68af-ea93-4833-809e-481897b7a00c_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:97c17f9e479c38fc3ddf4ba4d67bd7fd3407056d7f83ce0f295fec6ce8906699 +size 175228 diff --git a/clarifydelphireinforcedclarificationquestionswithdefeasibilityrewardsforsocialandmoralsituations/150b68af-ea93-4833-809e-481897b7a00c_origin.pdf b/clarifydelphireinforcedclarificationquestionswithdefeasibilityrewardsforsocialandmoralsituations/150b68af-ea93-4833-809e-481897b7a00c_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c2990fc2740976fb813b3da2afd76ef881bec146 --- /dev/null +++ b/clarifydelphireinforcedclarificationquestionswithdefeasibilityrewardsforsocialandmoralsituations/150b68af-ea93-4833-809e-481897b7a00c_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eafc15f12cda07ea83cac2f32e02174761ba8d7b616db8bc70f1c0ae2073424f +size 1664687 diff --git a/clarifydelphireinforcedclarificationquestionswithdefeasibilityrewardsforsocialandmoralsituations/full.md b/clarifydelphireinforcedclarificationquestionswithdefeasibilityrewardsforsocialandmoralsituations/full.md new file mode 100644 index 0000000000000000000000000000000000000000..ef8e411b7da66d86525a71ac8c86532c72957f6c --- /dev/null +++ b/clarifydelphireinforcedclarificationquestionswithdefeasibilityrewardsforsocialandmoralsituations/full.md @@ -0,0 +1,794 @@ +# ClarifyDelphi: Reinforced Clarification Questions with Defeasibility Rewards for Social and Moral Situations + +Valentina Pyatkin $\diamondsuit$ Jena D. Hwang $\clubsuit$ Vivek Srikumar $\clubsuit$ Ximing Lu $\diamondsuit$ Liwei Jiang $\diamondsuit$ Yejin Choi $\diamondsuit$ Chandra Bhagavatula $\clubsuit$ + +$\diamond$ Bar-Ilan University $\clubsuit$ University of Utah + +$\spadesuit$ Allen Institute for Artificial Intelligence + +$^{\text{心}}$ Paul G. Allen School of Computer Science & Engineering, University of Washington + +pyatkiv@biu.ac.il + +# Abstract + +Context is everything, even in commonsense moral reasoning. Changing contexts can flip the moral judgment of an action; Lying to a friend is wrong in general, but may be morally acceptable if it is intended to protect their life. + +We present CLARIFYDELPHI, an interactive system that learns to ask clarification questions (e.g., "why did you lie to your friend?") in order to elicit additional salient contexts of a social or moral situation. We posit that questions whose potential answers lead to diverging moral judgments are the most informative. Thus, we propose a reinforcement learning framework with a defeasibility reward that aims to maximize the divergence between moral judgments of hypothetical answers to a question. Human evaluation demonstrates that our system generates more relevant, informative and defeasible questions compared to competitive baselines. Our work is ultimately inspired by studies in cognitive science that have investigated the flexibility in moral cognition (i.e., the diverse contexts in which moral rules can be bent), and we hope that research in this direction can assist both cognitive and computational investigations of moral judgments. + +# 1 Introduction + +Commonsense moral reasoning of social situations and actions depends squarely on their context. Offering someone a cup of coffee is generally considered appropriate. If offered to a work colleague, it may even be viewed as a courteous gesture. However, offering coffee to a toddler would be deemed morally irresponsible. + +Delphi (Jiang et al., 2022), a recently proposed commonsense moral reasoning model, generates moral judgments for simple actions described in text. However, Delphi's judgments are made in isolation, without any knowledge of surrounding context. Grounding moral reasoning in context is crucial (Talat et al., 2022). How can moral reason + +![](images/d86485a76ede9806add72587724e073d51957fb20fccf7b37472db51516e6ef5.jpg) +Figure 1: The CLARIFYDELPHI question generation approach is trained via reinforcement learning. The reward simulates a set of possible (defeasible) answers to the questions and, using Delphi for feedback, optimizes for questions leading to maximally diverging answers. + +ers elicit missing salient context? A natural way to do so is by asking clarification questions. + +We present CLARIFYDELPHI, an interactive system that learns to ask questions to elicit salient context. Prior research in cognitive science shows that human reasoning exhibits the flexibility not only to articulate where a certain moral rule should hold, but also to imagine valid exceptions where the rule can be bent or defeated based on the demands of the context (Kwon et al., 2022; Levine et al., 2020; Awad et al., 2022). + +We present a first step toward computationally exploring and discovering these defeasible contexts which can potentially flip the moral judgement of a situation. Given a situation and its default judgment (e.g., it is nice to offer a cup of coffee to someone), defeasible contexts can strengthen (e.g., offering it to a colleague) or weaken (e.g., giving it + +![](images/17d4120452835ab1a8e9f334ecd34aee9d62ea18751a88fa51f0e5cbcbc44de6.jpg) +Figure 2: Interaction between a user and CLARIFYDELPHI. The user inputs a situation and CLARIFYDELPHI answers with an initial judgement (obtained from DELPHI) and a clarification question, which the user then answers. + +![](images/3cc3479830fd2514f83964fd199820bf1fa04c30f028056722561b7bb5ebf053.jpg) + +![](images/75e32b2bf709488e3d19ab53b24b862222c969d6f374d186a01afd8c8bfbf041.jpg) + +to a toddler) the judgment (Rudinger et al., 2020; Madaan et al., 2021; Allaway et al., 2022). We aim to generate questions whose answers might uncover missing context for making better-informed moral judgments, and we propose to do so in a conversational setting between a user and CLARIFYDELPHI. + +Our method for clarification question generation is based on reinforcement learning. Using Proximal Policy Optimization (PPO; Schulman et al. 2017; Ouyang et al. 2022) we optimize for generating questions that invoke responses that provide morally salient contexts. CLARIFYDELPHI "imagines" answers to a generated question, using a trained answer generation model. A reward is calculated by comparing the probability distributions Delphi assigns to the imagined answers. Fig. 1 provides an overview of CLARIFYDELPHI. + +The intuition behind our approach is that questions that lead to maximally divergent answers (e.g., "Who did you offer it to?") are also those that elicit most morally salient contexts and therefore are more consequential to the situation. These morally consequential questions surface latent ambiguities that may directly affect the moral decision process. Questions with little divergence in its imagined answers (e.g., "When did you offer it?") have little to offer in terms of resolving contextual moral ambiguities. + +Our results show that our approach outperforms other strong clarification question generation baselines; its generated questions lead to consequential answers. We additionally quantify how much supervised clarification question training data is needed for a good initial policy. Lastly we show that questions help with generating defeasible updates. + +Our contributions are as follows. We introduce the task of clarification question generation for social and moral situations. For this task we propose an RL based approach, defining defeasibility as a new type of relevance for clarification questions. We publicly release $\delta$ -CLARIFY, a dataset of 33k crowdsourced clarification questions, and $\delta$ -CLARIFY_silver containing generated questions conditioned on a defeasible inference dataset. We also release trained models with their code. $^1$ + +# 2 Problem Setup + +Given a situation, such as lie to my friend, we aim to generate question(s) that are the most relevant for uncovering the most consequential context with respect to making a social or moral judgement. While situations could evoke a multitude of potential questions, the following work is concerned with predicting questions whose answers are likely to be consequential, i.e. answers that could function as either weakeners or strengthensers of the default judgement. The terms weaker and strengthenser come from the concept of defeasible inference (Rudinger et al., 2020), which defines a way of reasoning that takes into consideration (new) evidence which could either support (e.g. strengthen) or cancel/weaken an initial inference. + +Formally, the task is to predict a question $q$ given a base situation $s$ . The base situation has a default moral judgement $j \in \{bad, ok, good\}$ . For every input tuple of $(s_i, q_i, j_i)$ there is a hypothetical set of strengthening answers $A_S$ and weakening answers $A_W$ . Adding the additional information obtained from any $q_i$ and corresponding answer $a_i$ to + +# Algorithm 1 Training CLARIFYDELPHI + +Input initial policy model $\theta_0$ , initial value model $\phi_0$ , Delphi $\psi_{\mathrm{Delphi}}$ + +$D_{\delta \text{-CLARIFY}} \gets$ Get dataset of clarification questions. + +$\theta_{\mathrm{Q}} \gets$ Fine-tune $\theta_{0}$ with Eqn 1 from $D_{\delta - \mathrm{CLARIFY}}$ . $\triangleright$ Sec. 3.1 + +$D_{\delta \text{-CLARIFY}_{silver}} \gets$ Get silver dataset of defeasible answers to questions. + +$\theta_{\mathrm{A}} \gets$ Fine-tune lm with Eqn 2 from $D_{\delta - \mathrm{CLARIFY}}$ . $\triangleright$ Sec. 3.2 + +$\theta_{\mathrm{CLARIFYDELPHI}} \gets \mathrm{REINFORCEDLEARNING}(S_{\mathrm{SocialChem}}, \theta_{\mathrm{Q}}, \theta_{\mathrm{A}}, \phi_{0}, \psi_{\mathrm{Delphi}})$ + +$\triangleright$ Sec. 3.4 + +procedure REINFORCEDLEARNING(SocialChem, $\theta_{\mathrm{Q}},\theta_{\mathrm{A}},\phi$ $\psi_{\mathrm{Delphi}})$ + +$$ +\theta_ {Q _ {\mathrm {o l d}}} \leftarrow \theta_ {Q}, \phi_ {\mathrm {o l d}} \leftarrow \phi +$$ + +$$ +\text {f o r i t e r a t i o n s} = 1, 2, \dots \text {d o} +$$ + +Sample a minibatch of situations $s$ from + +$$ +S _ {S o c i a l C h e m}. +$$ + +$$ +\text {f o r} \quad \text {s t e p} = 1, 2, \dots , s \text {d o} +$$ + +Calculate $r$ using $\theta_{A}$ and $\psi_{\mathrm{Delphi}}$ with Eqn 3. + +Compute $loss_{\mathrm{PPO}}$ on the minibatch with Eqn 6. + +Optimize $\theta$ and $\phi$ with $\mathcal{L}_{\mathrm{PPO}}$ for one step. + +$$ +\theta_ {Q _ {\text {o l d}}} \leftarrow \theta_ {Q}, \phi_ {\text {o l d}} \leftarrow \phi +$$ + +$$ +\mathrm {r e t u r n} \theta_ {Q} +$$ + +Output $\theta_{\mathrm{CLARIFYDELPHI}}$ + +the base situation $s_i$ results in an updated situation $s_{ui}$ , with an updated judgement $j_{ui}$ . + +# 3 CLARIFYDELPHI: A Reinforced Clarification Question Generator + +The CLARIFYDELPHI approach is based on reinforcement learning. Algorithm 1 gives an overview of the training process. As a first step, before performing reinforcement learning, we obtain a question generation model $\theta_{Q}$ and an answer generation model $\theta_{A}$ , which we both train on data that we curated, described in the later Sec. 4. The question generation model predicts the clarification questions and the answer generation model provides (defeasible) answers to the generated questions. By using these two models in addition to Delphi $(\psi_{Delphi})$ for calculating the rewards, we do not require any supervised data during RL training. + +We consider question generation conditioned on a given situation a sequential decision making process over the natural language vocabulary space, where the generated question $q$ with $T$ tokens has an episode of length $T$ . At step $t \in [1, T]$ , the state $s_t = (s, q_{Situation: Tipping people decentlyQ1What did they do for you?Q2Can you afford to tip?Q3Was the service good?Q4Did the people perform the service adequately?Q5Do you always tip people well regardless of the service quality?Situation: Jeff ignores the comment and laughs about it with his bossQ1-4What was the comment?Q5Who made the comment they were laughing at? + +Table 1: Two examples of situations and their clarification questions, written by five different Turkers. + +$\delta$ -CLARIFYgold: We crowdsourced clarification questions by showing annotators a situation and asking them to write a clarification question they would ask an imagined colleague requesting advice on the situation. Each of the 6425 situations is presented to 5 annotators, resulting in 5 questions per situation (500 situations are used for dev and test respectively). Details of the annotation are found in Appendix A.1. + +$\delta$ -CLARIFY_silver: The $\delta$ -SOCIAL part of the defeasible inference dataset (Rudinger et al., 2020) consists of statements that express default judgments over situations (It is good to protect your kids) and updates that weaken (Your protection is overbearing) or strengthen (Your child is in danger) the default. These updates could be viewed as potential answers to an implicit question about a base situation: "What are you protecting your child from?" for Your child is in danger. We 5-shot prompt GPT-3 to generate questions, conditioned on situation and answer, resulting in $\approx 80K$ (situation, update type, question, answer) tuples. + +Dataset Analysis Fig. 3 shows that the crowdsourced $\delta$ -CLARIFYgold has more variety in its most common question starts, which reflects the general diversity of the dataset: For only $10\%$ of the situations, more than 1 Turker asked exactly the same question, and for only $8\%$ of the situations all 5 Turkers used the same Wh-word to start the question. This highlights that there is more than one possible salient clarification question to be asked for any given situation. For the situation tipping people decently in Tab. 1, all 5 Turkers chose to start their questions differently, even though three out of these five questions ask in one way or the other about the service quality. For the other situation 4/5 Turkers asked for a specification "What was the comment?" and 1 Turker asked about the missing agent role. We also see that polar (yes/no) questions appear less frequently, as Turkers were explicitly asked to avoid them unless no other suitable question comes to mind.2 + +The $\delta$ -CLARIFY_silver questions are generated by conditioning on weaker or strengthenser updates. Since we aim to predict defeasible questions, the most desirable questions are those whose answers can be both weakeners and strengthensers. + +In the silver data, $53\%$ of situations have at least one question that has been generated by GPT-3 for both update types. The situation Your kids should be your number one priority, for example, has the same question "What are your kids' ages?" for the weaker update They are adult children. and the strengthensener update Your children are toddlers. Interestingly, among the subset of defeasible questions in $\delta$ -CLARIFY_silver, we find that the most frequent question start is 'why'. This suggests that it is easiest to come up with both weaker and strengthensener answers to why-questions. + +# 5Baselines + +We consider four baselines in our experiments. + +Question Generation Without RL To assess what additional improvements training an RL model with a defeasibility rewards provides, we report performance of the supervised question generation model $\theta_{Q}$ on its own (§3.1). We refer to this baseline as t5 fine-tuned. We decode using nucleus sampling with top- $p = 0.6$ . + +Pipelines with Question Selection Next, we implement two pipelines where, as the first step, a diverse set of questions is generated for a given situation and then, as the second step, the best question is selected according to a score. + +In order to generate a diverse set of questions we fine-tune T5 on $\delta$ -CLARIFY, conditioned on a modified input compared to the model from §3.1: Input . Q.: - Output + +By also conditioning on the first wh-word of the question it is possible to generate different questions. During inference we generate questions for 14 different question starts. We propose two approaches to scoring these questions: using a discriminator model and using divergence ranking, which we describe as follows. + +Discriminator We train a discriminator classifier which labels these questions as either relevant or irrelevant to a given situation. We then choose the question that has been assigned the relevant label with the highest probability. + +The discriminator is a binary classifier based on DeBERTa (He et al., 2020). The positive examples are situations and their respective 5 questions written by annotators. The negative question examples + +are sampled from other situations, in a way that ensures that the relevant and irrelevant questions are similar enough to make training more challenging. + +Divergence Ranking We run the defeasible answer simulation with feedback from Delphi for each question in the set. This process is the same as the reward function of the RL approach, except that the JS-divergence score is used to rank the questions instead of being used as a reward for question generation. We compare two variations of this baseline: one with answer filtering using an NLI model as described in Sec. 3.2 (pipeline-nli) and one without filtering (pipeline). + +Why-Baseline We saw in §4 that questions conditioned on weaker/strengthener updates are usually causal questions. Using the same input/output configuration as in the pipeline baseline, we generate a why-question for each situation (called why). + +# 6 Evaluation and Analysis + +# 6.1 Human Evaluation + +Automatic evaluation of questions and their usefulness for clarifying moral situations is tricky. While we do have gold reference questions, we have shown that humans will produce diverse questions for the same situation (§4) and just because a question does not appear in the reference set does not necessarily indicate that it is not a consequential question. We therefore perform human evaluation of the models' outputs on Amazon Mechanical Turk on the 500 test set instances from $\delta$ -CLARIFY. Given a situation and a question, Turkers are asked to rate the question along three different attributes: Grammaticality (Is the question grammatical?), Relevance (Is the question relevant and plausible to the situation?), and Informativeness (Does the question access new information or regurgitate the situation?). The attributes are further detailed in Appendix A.1. + +Additionally, and most importantly, we aim to evaluate the defeasibility of the questions, e.g. how well the generated questions can elicit weaker or strengthens answer. For this purpose, Turkers are given a situation with a question and are first asked to judge this situation (generally ok vs. generally not ok). They then need to say whether and specify if they can think of an answer to the question which might support their judgement and also of an answer which would flip their judgement. + +![](images/3fcb00131c867da34cc1f326dd5c5a682454755948e497505eebd873619ec334.jpg) +Figure 4: Number of questions (out of 500) in test set that received an informativeness and relevance rating of $>0$ . + +# 6.2 Results of Human Evaluation + +We first run the grammaticality, relevance and informativeness evaluation. All questions which are given the lowest rating (e.g. irrelevant and/or uninformative) by at least two annotators are excluded from the second evaluation. It does not make sense to ask about defeasibility for questions which already are irrelevant, and additional weakening or strengthening context is not feasible for uninformative questions. + +We find, as displayed in Fig. 4, that CLARIFY-DELPHI has the biggest percentage of relevant and informative questions in the test set, compared to the baselines. We also see that a big majority of the generated questions, from all models, are relevant and informative, with the lowest performing model (discriminator) still producing 448/500 questions that are passed on to the next evaluation round. + +We also find that grammaticality across all systems is high with the lowest average score being 0.98 and the highest 0.99 (on a scale from 0 to 1, with 1 being grammatical). The minimal variation in grammaticality score is expected since all models are based upon the same transformer model. + +The CLARIFYDELPHI questions also outperform the baselines in terms of defeasibility, as seen in Table 2: annotators can more often think of a strengthensener answer and/or a weaker answer to our questions. The evaluation also shows that adding the answer-filtering with NLI step to the pipeline improves the question selection on all 4 evaluation criteria. The why-baseline is shown to be a strong baseline, indicating that motives and reasons are important for moral reasoning. + +
defeasibilityweakererstrength.
CLARIFYDELPHI0.440.470.73
why0.370.410.60
pipeline_nli0.350.370.64
t5 fine-tuned0.340.370.54
discriminator0.330.360.55
pipeline0.300.340.53
+ +Table 2: Defeasibility scores obtained through human evaluation. weakener: Can you think of an answer to the question that weakens your initial judgement? strengthenser: Can you think of an answer of the question that strengthens your initial judgement? defeasibility: Can you think of both?. + +# 6.3 How much supervision does the policy require? + +Our approach uses RL in conjunction with a supervised policy that has been fine-tuned on question generation. This has been shown to outperform approaches which use RL on top of a "vanilla" Impolicy (Ramamurthy et al., 2022). To assess the effect of supervision on question generation performance, we trained multiple initial policies on varying percentages of $\delta$ -CLARIFY training data: $25\%$ , $50\%$ , $75\%$ and $100\%$ . To compare against more traditional supervised question generation approaches we additionally trained a policy on SQuAD v1.1 data (Rajpurkar et al., 2016). + +We report two automatic evaluation metrics. To measure informativeness we use an off-the-shelf QA model trained on SQuAD 2.0 from AllenNLP (Gardner et al., 2018). This model either answers a question by pointing to a span in the input or outputs that the question in unanswerable with respect to a given context. For a clarification question to be informative it would not ask about anything already mentioned in the situation. For the QA-metric we thus report the percentage of non-answerable questions. We also report the average maximum BERTScore (Zhang et al., 2019) between a generated question and one of the 5 gold questions in $\delta$ -CLARIFY. + +Fig. 5 shows the following trends with regards to training a supervised policy. More training data leads to more informative questions. The policy trained on SQuAD produces the most uninformative questions which can be explained by the fact that SQuAD questions are conditioned on existing answers in a text. While performance consistently increases from $25\%$ to $75\%$ of the training data, + +improvements after $75\%$ are minimal. We conclude that for our use case training on about 5000 $(75\%)$ situations with 5 questions each leads to a sufficiently good policy. These results are also supported by the BERTScore. + +![](images/7b7917ae2b3ff75c09c13f5ada871f433cd33960a634c2d6ddd1e4daf4378dc1.jpg) +Figure 5: Performance of ppo algorithm with different policies: a policy pre-trained on SQUAD and policies pre-trained on different subsets of the $\delta$ -CLARIFY dataset. The scores (higher is better) are averaged every 1000 steps, between 1000 and 6000. + +# 6.4 Analysis + +Answer Simulation The answer generation model generally succeeds at generating diverse weakener and strengthens answers to the same question: for only about $0.05\%$ of questions per 1000 PPO epochs the model generates the same answer for both weakener and strengthens. + +Our answer generation could be looked at as question-guided defeasible update generation. Rudinger et al. (2020)'s task of Generative Defeasible Inference generates an update given a situation, a moral judgement and the update type (e.g. weaker/strengthener). In our answer generation approach we condition on the same input together with a generated question. This intermediate question generation step functions as a type of macro planning which has been shown to be effective for NLG (Puduppully et al., 2022; Narayan et al., 2022). We evaluate our approach on the same test set using the same evaluation metrics as Rudinger et al. (2020). Table 3 shows that by first predicting the question and then the updates, we improve upon generating defeasible updates for $\delta$ -SOCIAL. + +Questions We qualitatively inspect the types of generated questions: There are many specification questions asking about a hyponym of an argument + +
BLEUROUGE
δ-SOCIAL (T5-large)4.2214.94
δ-SOCIAL (GPT2-XL)12.1618.77
CLARIFYD (T5-large)14.1834.65
+ +in the base situation, for example, exterminating pests on your property - "What kind of pests?" The situations extracted from SocialChem often include underspecified pronouns, such as 'something' or 'somewhere'. $60\%$ of the situations containing 'something', for example, elicit what-questions from our model. Note that while such specification questions are valid clarification questions, the SQUAD 2.0 QA model would mark them as answerable given the situation. It is also interesting to see that often when a situation has a missing or implicit semantic argument, such as being anxious sometimes, CLARIFYDELPHI inquires about it: "What are you anxious about?" The generated why-questions most often ask about the motives of the agent in the situation, such as Ben tells Maggie that he's traveling alone - "Why is Ben traveling alone?". More rarely the model generates questions asking about the viewpoint of the patient: asking a friend [...] whether your attire is appropriate for an event - "What is the friend's opinion of your attire?" + +Analysis of Delphi's Probabilities In Tab. 4 we quantify the JSD of Delphi's judgments. Even though the human evaluation showed that CLARIFYDELPHI produced the most questions leading to defeasible answers, the JSD and the percentage of judgment flips is higher for the pipeline_nli approach, where we explicitly filter questions to maximize the JSD. Nevertheless, CLARIFYDELPHI leads to more Delphi judgment flips and higher JSD between answers than the fine-tuned t5 model without RL (and also all other baselines besides the pipeline). This automatic evaluation and the disagreement with the human annotators also reveals that Delphi's probabilities are not always perfectly calibrated and relying too much on a model's output might potentially lead to some error propagation. + +Table 3: Automatic results for strengthensener/weakener update generation on the $\delta$ -SOCIAL test set. Following Rudinger et al. (2020) we report BLEU-4 (Papineni et al., 2002) and ROUGE-L (Lin and Hovy, 2002). The first two results are from Rudinger et al. (2020). + +
avg. JSDJudgment Flips
CLARIFYDELPHI0.19125%
why0.15922%
pipeline_nli0.25933%
t5 fine-tuned0.14421%
discriminator0.13821%
+ +Table 4: Average JSD between $P_{jw}$ and $P_{js}$ of a situation. Judgment Flips: % of answers which led to a flip in Delphi's judgment. + +# 7 Interactive Judgements + +While we use answer simulation during PPO training, inference only requires a situation as input. The clarification questions can then be used to elicit additional context, in the form of answers, through interaction. Fig. 2 illustrates examples of such an interaction between a user, Delphi as the moral reasoning system and CLARIFYDELPHI. After each turn, the situation is updated with the user provided context, for which Delphi produces a new decision. We limit the interaction to three turns. This is based on the observation that after the third turn the sentence fusion starts to deteriorate, resulting in less relevant and more repetitive questions. Additionally, we find that the first two questions generally can capture missing contexts that are most central to making moral decisions. We provide more examples of generated questions in the Appendix. + +# 8 Related Work + +Question Generation Clarification question generation has been studied for various domains from image recognition questions to product description questions (Rao and Daumé III, 2018; Majumder et al., 2021; White et al., 2021), defining the goodness of clarification questions along the lines of information theoretic measures such as relevance, informativeness or utility (Rao and Daumé III, 2018; White et al., 2021; Warstadt and Agha, to appear; Rao and Daumé III, 2018, 2019). Most of existing works focus on questions that lead to single true answer, whereas we focus on generating clarification questions based on social situations, defining the relevance and utility of a question in terms of defeasibility. Additionally, we offer a high-quality clarification question dataset for social and moral situation—comprising of more than 30K questions—that breaks the mold from the domain-specificity of previous clarification datasets (Kumar and Black, 2020; Aliannejadi et al., 2019). + +Some general question generation approaches + +have incorporated an RL-based approach. Buck et al. (2018) learn to paraphrase questions with a reward that maximizes the QA answer F1 score. And Rao and Daumé III (2019) optimize a binary utility reward, using Reinforce in an adversarial setup for generating clarification questions. In our setup, we use Proximal Policy Optimization (Schulman et al., 2017; Ouyang et al., 2022) with a trained model for feedback as part of the reward. + +Commonsense Moral Reasoning Delphi (Jiang et al., 2022) is a commonsense moral reasoning model trained on COMMONSENSE NORM BANK, a dataset with 1.7M instances of descriptive knowledge of people's general sense of what's ethically acceptable or not in everyday situations. COMMONSENSE NORM BANK is compiled from five existing large-scale datasets, including SOCIAL CHEMISTRY (Forbes et al., 2020), ETHICS Commonsense Morality (Hendrycks et al., 2021), MORAL STORIES (Emelin et al., 2021), SOCIAL BIAS INFERENCE CORPUS (Sap et al., 2020), and SCRUPLES (Lourie et al., 2021). + +Delphi is based on pre-trained UNICORN, a universal commonsense reasoning model, trained on a number of commonsense reasoning tasks. Delphi can predict the ethical judgment given a description of a situation. + +# 9 Conclusion + +In this work we introduce CLARIFYDELPHI, which generates clarification questions for social and moral situations. We show how a RL approach that optimizes for maximally divergent answers in terms of defeasibility outperforms other clarification question baselines. While we start with a supervised policy, the reward function makes use of already trained models and does not rely on any additional training data. We believe that our questions can be useful for providing more disambiguating context through interaction. + +# Limitations + +On Western-centricity The majority of the crowdworkers producing the source data ( $\delta$ -Social and Delphi) and $\delta$ -CLARIFY were located in the United States. Due to this, the predictions generated by CLARIFYDELPHI are currently limited to representing only the perspectives of western culture (particularly the United States). Overcoming the western-centric bias is a compelling direction for future research. + +On Defeasibility We rely upon Delphi to produce acceptable judgments given a situation and the modifying context as a measure of defeasibility. We recognize that, however, Delphi is not perfect and is characterized by a variety of limitations such as limited cultural awareness and inconsistent predictions (Jiang et al., 2022). Investigating improved methods for identifying answer divergences that will better capture defeasibility is a topic for future investigation. + +# Ethics Statement + +Annotations are conducted on Amazon Mechanical Turk (MTurk). We maintain an average pay of $15 per hour for all our crowdsourcing data collection and evaluation tasks. Our crowdsourcing tasks do not collect personal information and are strictly limited to gathering workers' general knowledge. We do not keep any deanonymizing information such as MTurk IDs so that the identity of the workers cannot be directly or indirectly ascertained. Finally, our crowdsourcing task meets the standards for exemptions as human research and has obtained the necessary documentation that deems it exempt through our internal IRB procedures. + +Our model is intended to be used for research purposes only and it is not supposed to provide any sort of advice applicable outside of that domain. + +# Acknowledgements + +We thank our colleagues on the Beaker Team at the Allen Institute for AI for helping with the compute infrastructure. This work was supported in-part by DARPA MCS program through NIWC Pacific (N66001-19-2-4031). + +# References + +Mohammad Aliannejadi, Hamed Zamani, Fabio Crestani, and W Bruce Croft. 2019. Asking clarifying questions in open-domain information-seeking conversations. In Proceedings of the 42nd international acm SIGIR conference on research and development in information retrieval, pages 475-484. +Emily Allaway, Jena D Hwang, Chandra Bhagavatula, Kathleen McKeown, Doug Downey, and Yejin Choi. 2022. Penguins don't fly: Reasoning about generics through instantiations and exceptions. arXiv preprint arXiv:2205.11658. +Edmond Awad, Sydney Levine, Andrea Loregggia, Nicholas Mattei, Iyad Rahwan, Francesca Rossi, Kartik Talamadupula, Joshua Tenenbaum, and Max + +Kleiman-Weiner. 2022. When is it acceptable to break the rules? knowledge representation of moral judgement based on empirical data. arXiv preprint arXiv:2201.07763. +Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. 2020. Language models are few-shot learners. Advances in neural information processing systems, 33:1877-1901. +Christian Buck, Jannis Bulian, Massimiliano Ciaramita, Wojciech Gajewski, Andrea Gesmundo, Neil Houlsby, and Wei Wang. 2018. Ask the right questions: Active question reformulation with reinforcement learning. In International Conference on Learning Representations. +Denis Emelin, Ronan Le Bras, Jena D. Hwang, Maxwell Forbes, and Yejin Choi. 2021. Moral stories: Situated reasoning about norms, intents, actions, and their consequences. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 698-718, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Maxwell Forbes, Jena D Hwang, Vered Shwartz, Maarten Sap, and Yejin Choi. 2020. Social chemistry 101: Learning to reason about social and moral norms. In EMNLP. +Matt Gardner, Joel Grus, Mark Neumann, Oyvind Tafjord, Pradeep Dasigi, Nelson Liu, Matthew Peters, Michael Schmitz, and Luke Zettlemoyer. 2018. Allennlp: A deep semantic natural language processing platform. arXiv preprint arXiv:1803.07640. +Pengcheng He, Xiaodong Liu, Jianfeng Gao, and Weizhu Chen. 2020. Deberta: Decoding-enhanced bert with disentangled attention. In International Conference on Learning Representations. +Dan Hendrycks, Collin Burns, Steven Basart, Andrew Critch, Jerry Li, Dawn Song, and Jacob Steinhardt. 2021. Aligning {ai} with shared human values. In International Conference on Learning Representations. +Liwei Jiang, Jena D. Hwang, Chandra Bhagavatula, Ronan Le Bras, Jenny Liang, Jesse Dodge, Keisuke Sakaguchi, Maxwell Forbes, Jon Borchardt, Saadia Gabriel, Yulia Tsvetkov, Oren Etzioni, Maarten Sap, Regina Rini, and Yejin Choi. 2022. Can machines learn morality? the delphi experiment. arXiv preprint arXiv:2110.07574. +Vaibhav Kumar and Alan W Black. 2020. Clarq: A large-scale and diverse dataset for clarification question generation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7296-7301. + +Joseph Kwon, Josh Tenenbaum, and Sydney Levine. 2022. Flexibility in moral cognition: When is it okay to break the rules? In Proceedings of the Annual Meeting of the Cognitive Science Society, volume 44. +Sydney Levine, Max Kleiman-Weiner, Laura Schulz, Joshua Tenenbaum, and Fiery Cushman. 2020. The logic of universalization guides moral judgment. Proceedings of the National Academy of Sciences, 117(42):26158-26169. +Chin-Yew Lin and Eduard Hovy. 2002. Manual and automatic evaluation of summaries. In Proceedings of the ACL-02 Workshop on Automatic Summarization, pages 45-51. +Alisa Liu, Swabha Swayamdipta, Noah A. Smith, and Yejin Choi. 2022a. WANLI: Worker and ai collaboration for natural language inference dataset creation. In *Findings of the Association for Computational Linguistics: EMNLP* 2022, pages 6826-6847, Abu Dhabi, United Arab Emirates. Association for Computational Linguistics. +Jiacheng Liu, Skyler Hallinan, Ximing Lu, Pengfei He, Sean Welleck, Hannaneh Hajishirzi, and Yejin Choi. 2022b. Rainier: Reinforced knowledge introspector for commonsense question answering. arXiv preprint arXiv:2210.03078. +Nicholas Lourie, Ronan Le Bras, and Yejin Choi. 2021. Scruples: A corpus of community ethical judgments on 32,000 real-life anecdotes. In AAAI. +Aman Madaan, Niket Tandon, Dheeraj Rajagopal, Peter Clark, Yiming Yang, and Eduard Hovy. 2021. Think about it! improving defeasible reasoning by first modeling the question scenario. arXiv preprint arXiv:2110.12349. +Bodhisattwa Prasad Majumder, Sudha Rao, Michel Galley, and Julian J McAuley. 2021. Ask what's missing and what's useful: Improving clarification question generation using global knowledge. In *NAACL-HLT*. +Shashi Narayan, Joshua Maynez, Reinald Kim Amplayo, Kuzman Ganchev, Annie Louis, Fantine Huot, Dipanjan Das, and Mirella Lapata. 2022. Conditional generation with a question-answering blueprint. arXiv preprint arXiv:2207.00397. +Long Ouyang, Jeff Wu, Xu Jiang, Diogo Almeida, Carroll L Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, et al. 2022. Training language models to follow instructions with human feedback. arXiv preprint arXiv:2203.02155. +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. + +Ratish Puduppully, Yao Fu, and Mirella Lapata. 2022. Data-to-text generation with variational sequential planning. Transactions of the Association for Computational Linguistics, 10:697-715. + +Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J Liu, et al. 2020. Exploring the limits of transfer learning with a unified text-to-text transformer. J. Mach. Learn. Res., 21(140):1-67. + +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. + +Rajkumar Ramamurthy, Prithviraj Ammanabrolu, Kianté Brantley, Jack Hessel, Rafet Sifa, Christian Bauckhage, Hannaneh Hajishirzi, and Yejin Choi. 2022. Is reinforcement learning (not) for natural language processing?: Benchmarks, baselines, and building blocks for natural language policy optimization. arXiv preprint arXiv:2210.01241. + +Sudha Rao and Hal Daumé III. 2018. Learning to ask good questions: Ranking clarification questions using neural expected value of perfect information. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2737-2746. + +Sudha Rao and Hal Daumé III. 2019. Answer-based adversarial training for generating clarification questions. 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 143-155. + +Rachel Rudinger, Vered Shwartz, Jena D. Hwang, Chandra Bhagavatula, Maxwell Forbes, Ronan Le Bras, Noah A. Smith, and Yejin Choi. 2020. Thinking like a skeptic: Defeasible inference in natural language. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 4661-4675, Online. Association for Computational Linguistics. + +Maarten Sap, Saadia Gabriel, Lianhui Qin, Dan Jurafsky, Noah A Smith, and Yejin Choi. 2020. Social bias frames: Reasoning about social and power implications of language. In ACL. + +John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. 2017. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347. + +Zeerak Talat, Hagen Blix, Josef Valvoda, Maya Indira Ganesh, Ryan Cotterell, and Adina Williams. 2022. On the machine learning of ethical judgments from natural language. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 769-779, Seattle, United States. Association for Computational Linguistics. + +Alex Warstadt and Omar Agha. to appear. Testing bayesian measures of relevance in discourse. In Proceedings of Sinn und Bedeutung, volume 26. + +Julia White, Gabriel Poesia, Robert Hawkins, Dorsa Sadigh, and Noah Goodman. 2021. Open-domain clarification question generation without question examples. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 563-570. + +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. + +# A Appendix + +# A.1 Crowdsourcing and Annotation + +Annotations are collected on Amazon Mechanical Turk (MTurk). We run two varieties of HITs: (1) data collection HIT in which we collect questions given statements, and (2) evaluation HIT in which the workers are asked to judge validity of the generated questions. The group of 145 Turkers working on the HITs were manually vetted and selected through an open paid qualification round. We maintain an average pay rate of $15/hour for all HITs. + +Question Collection: We crowdsourced clarification question by prompting annotators with a situation. The crowdworkers are asked to imagine a hypothetical situation where a colleague came to them requesting advice or judgment on the shown situation. The workers are then instructed to write a clarification question they would want to ask that would help them make a better judgment or give a better advice that they would without it. Each of the 6425 situation is presented to 5 distinct annotators; we collect 5 questions per situation. A screenshot of the HIT is shown in Figure 6. + +Human Evaluation: We ask crowdworkers to evaluate model outputs. Given a situation and a question Turkers are asked to rate the question along three different attributes: + +Grammaticality Is the question grammatical? - yes/no + +Relevance Does the question fit the situation and is it plausible that someone might ask this question? - very relevant/somewhat relevant/entirely irrelevant + +Informativeness Can the question lead to new information or does it ask about things + +already mentioned in the situation? - surrogate objective term, defined as very/somewhat/uninformative + +A screenshot for the evaluation HIT w.r.t grammaticality, relevance, and informativeness is found in Figures 8. Additionally, we evaluate the defeasibility of a question. A screenshot of the defeasibility evaluation is shown in Figure 10. + +IRB approval: We sought and received exemption from our internal IRB. In accordance to the regulations, we do not collect sensitive information. If we do publish WorkerIDs, we will do so by fully anonymizing the information. The exemption received does not require a consent form. + +Language and Demographics: We have not collected any demographic information from the workers. However, all crowdsourcing was conducted in English and the region (current location of the crowdworker) was set to US. Consequently, what counts as a context of consequence is centered around western views, or views of the English speaking cultures within the United States. + +# A.2 Prompting for Answer Generation + +One way to elicit a set of opposing answers is through prompting. We instruct GPT-3 to provide a so-called "bad" and a so-called "good" answer to a question about a situation. For the situation learning how to take a joke and the question "What was the joke?", the two answers could be: "it was a lighthearted joke among friends" and "it was an offensive joke". In order to determine which of the answers is a weaker and which a strengthenser, we compare the difference in Delphi's judgement for $s$ and $s + a_{\text{good}}$ or $s + a_{\text{bad}}$ . + +# A.3 Details of PPO + +Policy loss. To compute the policy loss, we first define the truncated estimated advantage function, + +$$ +\hat {A} _ {t} = \sum_ {t ^ {\prime} = t} ^ {T - 1} (\gamma \lambda) ^ {t ^ {\prime} - t} \delta_ {t ^ {\prime}}, +$$ + +where $\delta_{t^{\prime}} = r_{t^{\prime}} + \gamma V_{\phi}(s_{t^{\prime} + 1}) - V_{\phi}(s_{t^{\prime}})$ + +where the value function of a certain state $s_t$ is estimated by the value model $V_{\phi}(\cdot)$ , $r_t$ denotes intermediate reward obtained at time step $t$ , and $\gamma$ and $\lambda$ denote reward decay factor. PPO then maximizes the empirical expectation of clipped + +surrogate objective term, defined as + +$$ +\begin{array}{l} \operatorname {c s o} \left(\hat {A} _ {t}, r _ {t} (\theta), \epsilon\right) = \\ \min \left(r _ {t} (\theta) \hat {A} _ {t}, \operatorname {c l i p} (r _ {t} (\theta), 1 - \epsilon , 1 + \epsilon) \hat {A} _ {t}\right), \\ \end{array} +$$ + +Value loss. The value model is trained with MSE loss with respect to the target value, $V_{t}^{\mathrm{targ}}$ : + +$$ +\mathcal {L} _ {\text {V a l u e}} (\phi) = \hat {E} \left[ \left(V (s _ {t}; \phi) - V _ {t} ^ {\text {t a r g}}\right) ^ {2} \right], +$$ + +# A.4 Implementation Details + +The question generation model $\theta_{Q}$ is trained with T5-large (Raffel et al., 2020) on $\delta$ -CLARIFY. + +We train the answer generation model $\theta_{A}$ (T5-large) on 77k instances from $\delta$ -CLARIFY_silver ( $\S 4$ ) and about 4k instances obtained through prompting GPT-3. For the answer-filtering using NLI we use WaNLI (Liu et al., 2022a) as an off-the-shelf NLI model. + +We run the PPO algorithm for 6000 steps, with a batch size of 64, top_p = 0.6 and a temperature of 0.7 for the sampling policy. Training for 6000 step took approximately 2 days on 4 A6000, 48G, GPUs. + +Our models are based on T5-large which has 770 million parameters. + +For the DELPHI model we use the $t5 - large$ variant. + +# A.5 Licensing + +CLARIFYDELPHI and the code will be released under the Apache License 2.0. We will release the dataset under CC-BY. + +# A.6 Sample of Generated Questions + +We show a sample of 15 generated questions in Tab. 5. + +# A.7 Sample of Generated Questions in a Compositional Setting + +We show a sample of generated questions in a two-turn interactive setting in Tab. 6. + +# Instructions (click to expand/collapse) + +1. Situation: ${situation1} + +Question 1: [required] + +very hard to come up with a question for this situation + +2. Situation: \$\{situation2\} + +Question 1: [required] + +very hard to come up with a question for this situation + +3. Situation: ${situation3} + +Question 1: [required] + +very hard to come up with a question for this situation + +4. Situation: ${situation4} + +Question 1: [required] + +very hard to come up with a question for this situation + +5. Situation: \$\{situation5\} + +Question 1: [required] + +very hard to come up with a question for this situation + +Figure 6: $\delta$ -CLARIFY question collection interface. + +# Situation + +sleeping in when you have to get up. + +Paying more when you are able to because you make more. + +Apologizing when you have done something wrong. being careful when opening your car door in a parking lot. + +being out after curfew. + +respecting your friend's wishes making a scene + +being friends with benefits with someone not liking certain dogs + +smoking in one's own home +wanting to go home with someone + +being angry with your partner when they hide things. Talking about things you know nothing about agreeing to go out with someone who bullied you using your money how you see fit + +# Question + +What are you doing when you have to get up? + +What are you making? + +What did you do? + +Are you aware of what is inside your car? + +Are you allowed to be out after curfew? + +What is your friend's wish? + +What kind of scene? + +Why are you friends with benefits with them? + +Why don't you like them? + +What are the risks? + +How do you feel about them? + +What are they hiding? + +Why are you talking about these things? + +Why are they bullying you? + +What are you doing with your money? + +Table 5: Sample of situations from the dev set of SocialChem and the CLARIFYDELPHI generated question. + +Thanks for participating in this HIT! For this hit: + +- Imagine a friend or work colleague (be polite!) comes to you with a situation or question and you have to decide whether this situation is ok or not ok, e.g. socially acceptable or not acceptable. +- What questions would you ask to get a better understanding of the situation in order to give better advice or make a better decision? + +Try to ask questions which provide more context to the given situation. +The questions should be relevant to both the situation and the decision you have to take: +Try to think of questions where your judgement might change given the answer your friend would provide: (This is the most important aspect of these questions!) + +Situation: I married my sister's friend. +Question: What does your sister think about this? +This is a good question because: if your friends answers "She is ok with it." + +then your decision might be swayed towards it's ok, while if the answer were "She is very upset about it," then your decision might be it's not ok + +In general, we ask you to not ask yes/no question if possible. If that's the only type of question you can come up with for a situation, then that's okay! +- The situations can quite often be very general situations like 'get a new job' and with the help of the questions we want to make these situations less general, e.g. "What kind of job?", "Who got a new job?" etc. +- The situations might sometimes be a bit ungrammatical, in these cases simply try to go with what you understand from the situation. + +Perspective is another issue:. + +In general you can assume that you are in a conversation with a friend and they are presenting you with a general situation and want to hear your opinion on it. +This means you can usually use 'you' in your questions to address the friend, even if the situation is general. +Sometimes the situations contain names such as 'Colin visits home to see family but keeps his distance from bad influence'. Here you can ask 'Why does Colin want to keep his distance?' or 'What does Colin's family do?' etc. without having to use 'you' in your questions. + +- Hard situations: Sometimes it might be hard to ask a question for a given situation, especially a question where the answer might change your moral judgement: + +Situation: Trying to poison your child. +It is hard/impossible to imagine a question and answer that would sway your moral judgment on such a situation. +- Whenever this is the case, ask the best possible question you can come up with and please also mark the check-box underneath the question. + +- Don'ts: + +- Don't ask judgmental or leading questions: + +Situation: Sleeping with someone's partner. +Bad Question: Is that a moral thing to do? +Good Question: Is the person you are sleeping with in an open relationship? + +Don't ask questions that suggest something or that give advice: + +Situation: Wanting a pet. +Bad Question: Did you consider a plant instead? +Good Question: How much time do you have to take care of a pet? + +- Don't ask questions that contain certain assumptions that aren't explicitly mentioned in the situation: + +Figure 7: $\delta$ -CLARIFY question collection instructions. + +Situation: + +${text} + +Question: + +${predicted_question} + +1. Grammaticality: Is the question grammatical? + +Grammatical + +$\bigcirc$ Not Grammatical + +3. Relevance: How relevant is the question with respect to the situation? + +$\mathbb{O}$ Very Relevant: The question is a relevant question that fits the situation and it is plausible that someone might ask it. + +Somewhat Relevant: The question somewhat fits the situation, but it is very general and could also be asked for other situations. + +$\bigcirc$ Entirely Irrelevant: The question is entirely irrelevant with respect to the situation. + +2. Informativeness: How informative is the question with respect to the situation? Can the question lead to new additional information? + +Very informative: The question is asking about crucial facts that are missing from the situation and knowing the answer would make me understand the situation better. + +Somewhat Informative: The question is asking about information that isn't very informative and maybe even implied by the given situation. + +Uninformative: The question asks about something that is already clearly mentioned in the given situation. + +Figure 8: Informativeness, relevance and grammaticality evaluation interface. + +# Instructions (click to expand/collapse) + +Thanks for participating in this HIT! Please read the instructions carefully. + +In this HIT, you will be shown a situation and a question regarding the situation. Your task is to evaluate the question along four dimensions: + +1. Is the question a well-formed and grammatical English question? + +Yes: The question is well-formed and fluent. +No: The question is ungrammatical and/or incomplete. + +2. Is the question relevant with respect to the situation? + +o Very Relevant: The question is a relevant question that fits the situation and it is plausible that someone might ask it.. +Somewhat Relevant: The question somewhat fits the situation, but it is very general and could also be asked for other situations. +° Entirely Irrelevant: The question is entirely irrelevant with respect to the situation. + +3. Is the question informative with respect to the situation ? - This checks whether the question asks about new information. + +o Very Informative: The question is asking about crucial facts that are missing from the situation and knowing the answer would make me understand the situation better.. + +ex: Situation: "get a new job", Question: "what kind of job?" is an informative question asking for more details + +Somewhat Informative: The question is asking about information that isn't very informative and maybe even implied by the given situation. ex: Situation: "Fred purchases lunch from a local cafe", Question: "What kind of cafe?" isn't very Informative as the type of cafe is already implied in the sentence. +Entirely Uninformative: The question asks about something that is already clearly mentioned in the given situation. + +ex: Situation: "Jason tells his girlfriend he wants to have a baby", Question: "Who tells his girlfriend he wants to have a baby?" is entirely uninformative as the answer is already clearly mentioned in the situation. + +Please take care to not submit responses that are uninformed by the instructions. + +Figure 9: Informativeness, relevance and grammaticality evaluation instructions. + +Judge this situation. + +Situation: + +{\situation} + +1. How would you judge this situation? + +Generally Ok: The situation is morally or socially acceptable. +Generally Not Ok: The situation is morally or socially bad. + +Question: + +{$question} + +2. Can you think of an answer to the question that would make you change your mind and make you think that the situation is generally ok? + +Yes +No + +3. Can you think of an answer to the question that would make you more certain in your judgement that the situation is generally not ok? + +Yes +No + +Figure 10: Defeasibility evaluation interface. + +# Instructions (click to expand/collapse) + +Thanks for participating in this HIT! Please read the instructions carefully. + +In this HIT, you will be shown a situation and a question regarding the situation. + +Your task is to first judge the situation and then decide how helpful answers to this question would be with respect to making such a moral decision about a situation: + +1. For the first question you have to make a decision on whether a situation is morally or socially ok or not ok. + +The situation below for example might be judged as being generally not ok, since you shouldn't simply take other people's belongings. +Situation: "I took the car from my neighbor" + +2. Give that judgement you made you need to evaluate a given question and think of potential answers to that question that would make sense, also taking the situation into account. First you need to think of answers which might be able to flip your moral judgement: + +- Answers that could change your mind: Given the question below you can come up with an answer that would flip your judgment from not ok to ok. +ex: Situation:"I took the car from my neighbor", Question "Did you ask your neighbor beforehand?", Answer:"yes" +o You can't think of an answer that could change your mind: For the following question on the other hand I can't think of an answer that might flip my +decision. +ex: Situation:"I took the car from my neighbor", Question "What color is the car?", Answer:"blue" + +3. Give that judgement you made you need to evaluate a given question and think of potential answers to that question that would make sense, also taking the situation into account. Here you need to think of answers which could strengthen/make you more certain in your moral judgement. + +$\circ$ Answers that could confirm your judgement: Given the question below you can come up with an answer that would make you more certain in your judgment that the situation is not ok. +ex: Situation:"I took the car from my neighbor", Question "What did you do to the car?", Answer:"I trashed it." +You can't think of an answer that could strengthen your judgement: For the following question on the other hand I can't think of an answer that might strengthen my decision. +ex: Situation:"I took the car from my neighbor", Question "What color is the car?", Answer:"blue" + +Please take care to not submit responses that are uninformed by the instructions. + +Figure 11: Defeasibility evaluation instructions. + +
SituationQuestion
daydreaming sometimesWhat are you daydreaming about?
daydreaming sometimes about a vacationWhat kind of vacation are you planning?
stealing money from your parentsHow did you steal the money?
stealing money from your parentsHow much money did you steal?
by stealing it from their wallet
getting some help when you're lost in lifeAre you looking for help?
getting some help when you're lost in life andAre you having difficulty coping?
stating that you are not looking for help
loving your friend platonicallyWhat is your friend like?
loving your friend platonicallyWhat do you like about your friend?
because he is very nice
being judgmentalHow are you being judgmental?
being judgmental becauseWhat is the other person doing?
I am silently judging them
getting cold feet before a weddingWhy are you getting cold feet?
getting cold feet before a weddingWhat is your relationship status?
because you only know your partner for 1 month
Being mindful of your healthHow are you being mindful?
being mindful of your health by working outWhat are the benefits of working out?
+ +Table 6: Sample of situations from the dev set of SocialChem, their expansion through interaction (2 turns) and the CLARIFYDELPHI generated question. + +A For every submission: + +A1. Did you describe the limitations of your work? + +Limitations and Ethics Statement + +A2. Did you discuss any potential risks of your work? + +Limitations and Ethics Statement + +A3. Do the abstract and introduction summarize the paper's main claims? + +Section 0 and Section 1 + +A4. Have you used AI writing assistants when working on this paper? + +Left blank. + +B Did you use or create scientific artifacts? + +Section 4 + +B1. Did you cite the creators of artifacts you used? + +Section 4 + +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? + +Appendix + +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +Appendix + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? + +Appendix and Ethics Statement + +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? + +Appendix + +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. + +Section 4 + +C Did you run computational experiments? + +Section 3 and 5 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +Appendix + +The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? Appendix +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? Section 6 +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? Appendix + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? Section 4 + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? Appendix +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? Appendix +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? Appendix +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? Appendix +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? We only report basic geographic characteristics in the appendix. \ No newline at end of file diff --git a/clarifydelphireinforcedclarificationquestionswithdefeasibilityrewardsforsocialandmoralsituations/images.zip b/clarifydelphireinforcedclarificationquestionswithdefeasibilityrewardsforsocialandmoralsituations/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d7eb06442d442708216e1810b3d5e350c304f36b --- /dev/null +++ b/clarifydelphireinforcedclarificationquestionswithdefeasibilityrewardsforsocialandmoralsituations/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:992620dbdfe90fdf7019236a89a2caf3543da03f84c614a9c362707e0da9146c +size 458898 diff --git a/clarifydelphireinforcedclarificationquestionswithdefeasibilityrewardsforsocialandmoralsituations/layout.json b/clarifydelphireinforcedclarificationquestionswithdefeasibilityrewardsforsocialandmoralsituations/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..ba994cebf5bdbf80107813626f426e684a5e9bf5 --- /dev/null +++ b/clarifydelphireinforcedclarificationquestionswithdefeasibilityrewardsforsocialandmoralsituations/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2ded3606c3fe1e04b915f4e12ae241f9857b2368a4573b831a6f243c1d7cbb29 +size 748240 diff --git a/clclnoncompositionalexpressiondetectionwithcontrastivelearningandcurriculumlearning/702c54ff-302d-4288-9028-1c8952112435_content_list.json b/clclnoncompositionalexpressiondetectionwithcontrastivelearningandcurriculumlearning/702c54ff-302d-4288-9028-1c8952112435_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..fc88154ea5d20c705f61f3be8e75522ce78698cc --- /dev/null +++ b/clclnoncompositionalexpressiondetectionwithcontrastivelearningandcurriculumlearning/702c54ff-302d-4288-9028-1c8952112435_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2395ed48c5615acd49a2613a8ca94424288bef2d0f207d6446102201411841c8 +size 86405 diff --git a/clclnoncompositionalexpressiondetectionwithcontrastivelearningandcurriculumlearning/702c54ff-302d-4288-9028-1c8952112435_model.json b/clclnoncompositionalexpressiondetectionwithcontrastivelearningandcurriculumlearning/702c54ff-302d-4288-9028-1c8952112435_model.json new file mode 100644 index 0000000000000000000000000000000000000000..292f3eafc2ff9e22b70317bdec294f5fadeb3e6a --- /dev/null +++ b/clclnoncompositionalexpressiondetectionwithcontrastivelearningandcurriculumlearning/702c54ff-302d-4288-9028-1c8952112435_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:896caa87800d3bcf00ac484d5dc30c56f04989ac99b185ca8455a9667dec8890 +size 106218 diff --git a/clclnoncompositionalexpressiondetectionwithcontrastivelearningandcurriculumlearning/702c54ff-302d-4288-9028-1c8952112435_origin.pdf b/clclnoncompositionalexpressiondetectionwithcontrastivelearningandcurriculumlearning/702c54ff-302d-4288-9028-1c8952112435_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5419ccbff69847cdcda9bef251adba53c51f382f --- /dev/null +++ b/clclnoncompositionalexpressiondetectionwithcontrastivelearningandcurriculumlearning/702c54ff-302d-4288-9028-1c8952112435_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:af99ce382ca9cf3ac0c36ab70e9affad3fc7a595c9d24ac7b076b0e5c73ab163 +size 6673634 diff --git a/clclnoncompositionalexpressiondetectionwithcontrastivelearningandcurriculumlearning/full.md b/clclnoncompositionalexpressiondetectionwithcontrastivelearningandcurriculumlearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..48d3f1b4bb9935a25bf7157994a63cf35516fe5c --- /dev/null +++ b/clclnoncompositionalexpressiondetectionwithcontrastivelearningandcurriculumlearning/full.md @@ -0,0 +1,369 @@ +# CLCL: Non-compositional Expression Detection with Contrastive Learning and Curriculum Learning + +Jianing Zhou, Ziheng Zeng and Suma Bhat + +University of Illinois at Urbana-Champaign + +Champaign, IL USA + +{zjn1746,zzeng13,spbhat2}@illinois.edu + +# Abstract + +Non-compositional expressions present a substantial challenge for natural language processing (NLP) systems, necessitating more intricate processing compared to general language tasks, even with large pre-trained language models. Their non-compositional nature and limited availability of data resources further compound the difficulties in accurately learning their representations. This paper addresses both of these challenges. By leveraging contrastive learning techniques to build improved representations it tackles the non-compositionality challenge. Additionally, we propose a dynamic curriculum learning framework specifically designed to take advantage of the scarce available data for modeling non-compositionality. Our framework employs an easy-to-hard learning strategy, progressively optimizing the model's performance by effectively utilizing available training data. Moreover, we integrate contrastive learning into the curriculum learning approach to maximize its benefits. Experimental results demonstrate the gradual improvement in the model's performance on idiom usage recognition and metaphor detection tasks. Our evaluation encompasses six datasets, consistently affirming the effectiveness of the proposed framework. Our models available at https://github.com/zhjjn/CLCL.git. + +# 1 Introduction + +As a ubiquitous yet special class of expressions in natural languages, non-compositional expressions (e.g., the idiom under the weather) have specific communicative intents (Moon et al., 1998; Baldwin and Kim, 2010) and are individually rare but collectively frequently appearing widely across genres (Moon et al., 1998; Haagsma et al., 2020). They are characterized by non-compositionality in their meaning because of which, their meaning cannot be inferred by composing the meaning of their constituent words (Baldwin and Kim, 2010). In addition, many non-compositional expressions can + +be used either figuratively or literally, in a context dependent manner. For example, the phrase "clean house" can be interpreted literally, as in We cannot promise you good weather but we can promise you a clean house and a really good breakfast and can be understood figuratively, as in Indeed, the Kursk crisis may provide him with an opportunity to further clean house in the military. + +NLP systems intending to process these non-compositional expressions need to decide if these expressions are used in the figurative or literal sense before modeling their meaning. This is the traditional and popular non-compositional language processing task called usage disambiguation1 which aims to differentiate the literal (i.e., compositional) from the figurative (i.e., non-compositional) usage of these expressions in given contexts, dubbed as idiom usage recognition for idiomatic expressions and metaphor detection for metaphorical expressions (Peng and Feldman, 2015; Koper and im Walde, 2016; Liu and Hwa, 2017, 2018; Chen et al., 2017; Jiang et al., 2022). However, compared to the abundance of resources for tasks related to compositional expressions, the available resources for idiom usage recognition and metaphor detection are very limited. + +Successful disambiguation of the usages of the non-compositional expressions involves overcoming two challenges: (1) the linguistic challenge of handling non-compositionality and (2) the resource-related challenge of learning from scarce training data. Previous works (Peng and Feldman, 2015; Köper and im Walde, 2016; Liu and Hwa, 2017, 2018) primarily focus on designing complex architectures for modeling non-compositionality, while also ignoring the representational aspect to model non-compositionality under a limited-resource scenario to address the second challenge. The focus + +of this work is a method to solve the above two challenges jointly and find sense-specific representations of the idiomatic expressions. + +With the same idioms used in different ways as natural positive and negative examples whose representations could be better by using contrastive learning, we utilize contrastive learning to address the first challenge to produce a better representation of non-compositional expressions for recognizing their usage. Successful idiom usage recognition and metaphor detection require different representations of the same expression when they are used in a literal and figurative way, respectively. Therefore, we incorporate a contrastive objective to enhance the difference between the contextualized representations of the figurative sense and the literal sense for the same expression. In this way, we enable the classifier to make context-dependent decisions in the embedding space. Secondly, to make better use of the scarce available data, we use curriculum learning (Bengio et al., 2009), which enables the models to gradually proceed from easy training instances to harder ones, when the instances are themselves ordered according to a difficulty measure. Therefore, curriculum learning naturally consists of (1) measuring the difficulty level for each training example, and (2) scheduling training examples based on their difficulty levels. Furthermore, we combine contrastive learning and curriculum learning together by utilizing contrastive objectives to measure the difficulty level of the training examples. During model training, the contrastive objective is dynamically updated, and thus the difficulty levels of the training examples are also updated in accordance with the current ability of the model. + +Our study is the first to jointly alleviate the problems caused by non-compositionality and limited data resources by strategically and dynamically combining contrastive learning and curriculum learning, and deploying it for idiom usage recognition and metaphor detection. Our proposed framework enables the model to first learn from simple non-compositional expressions and then from harder ones by building better representations of non-compositional expressions via contrastive learning. The contributions of our work are as follows: + +- We propose a novel framework that combines contrastive learning and curriculum learning for idiom usage recognition and metaphor detection. The difficulty levels obtained from + +contrastive objectives are dynamically updated with the training, based on which the training examples are dynamically scheduled. + +- Empirical evaluations of our proposed framework on the tasks of idiom usage recognition and metaphor detection affirm the effectiveness of our framework. Detailed ablation studies and analyses are provided to support our claims. As a result, we treat both idiom usage recognition and metaphor detection under the same computational umbrella. + +- Our proposed framework also shows better cross-task transfer between idiom usage recognition and metaphor detection compared to the baseline models. + +# 2 Related Prior Work + +Idiom Usage Recognition. Like other non-compositional expressions, the meaning of many idiomatic expressions is contextually ambiguous. Prior studies mainly focus on disambiguating their figurative/literal use(Salehi et al., 2014; Senaldi et al., 2016; Flor and Klebanov, 2018; Amin et al., 2021; Peng and Feldman, 2015; Köper and im Walde, 2016; Liu and Hwa, 2017, 2018), i.e., performing the idiom usage recognition task. Early works heavily rely on designing representative features, e.g., canonical form (Fazly et al., 2009), to decide literal and figurative usages. With the emergence of word embeddings and neural networks, richer features are encoded into word embeddings and utilized for idiom usage recognition (Liu and Hwa, 2017, 2018). Recently proposed pre-trained language models have shown great improvement on various NLP tasks leading to efforts that leverage the power of large pre-trained language models for this task (Zeng and Bhat, 2021). However, due to non-compositionality and scarcity of available data resources, previous works mainly focused on designing complex architectures while ignoring the representational aspect to model non-compositionality under a limited-resource scenario. Our study is the first to focus on solving both of these two challenges to fill this research gap. + +Metaphor Detection. Like other figurative expressions, metaphors play a crucial role in cognitive and communicative functions (Choi et al., 2021), because of which computationally recognizing and understanding the metaphorical meanings of words becomes important. Early approaches utilized various linguistic features to detect metaphors, such + +as word imageability (Broadwell et al., 2013), semantic supersenses (Tsvetkov et al., 2014), and unigrams (Klebanov et al., 2014). In recent years, different neural architectures have been widely used for metaphor detection, including CNN (Wu et al., 2018), LSTM (Gao et al., 2018). Beyond these, the prominence of large pre-trained language models on various NLP tasks has prompted their use for metaphor detection. Choi et al. (2021) uses RoBERTa as the backbone model to get contextualized representations of words and (Gong et al., 2020) combines other linguistic features in a RoBERTa architecture for the purpose of metaphor detection. The subpar performance of large pretrained models when labeled data are scarce has led to studies exploring data augmentation (Lin et al., 2021). However, utilizing augmented data with pseudo labels could be even more detrimental to the performance due to the noise in the augmented data. Our proposed curriculum learning framework can potentially alleviate data scarcity by using the limited data more effectively without introducing additional noise. This is the first work to show its positive impact on both tasks of idiom usage recognition and metaphor detection. + +Contrastive Learning. Contrastive learning aims to learn meaningful representations by pulling semantically similar examples closer and pushing semantically dissimilar examples further apart in the embedding space. Widely considered to be effective for building meaningful representations, contrastive learning has garnered increasing attention from researchers in different areas. For example, prior works in NLP have leveraged contrastive learning to produce better word embeddings (Mikolov et al., 2013) and sentence embeddings (Logeswaran and Lee, 2018). More recently, with the dominance of transformer-based models, contrastive learning is also being used to train transformer models (Fang et al., 2020; Giorgi et al., 2021; Wu et al., 2020). Similarly, in this work, for a given non-compositional expression, we use contrastive learning to pull the expression embeddings that are used in the same figurative/literal sense closer while pushing the embeddings between figurative and literal senses apart. Thereby we set a precedence of utilizing contrastive learning to enhance the representation quality of idiomatic expressions for modeling non-compositionality. Besides, we also propose to utilize the contrastive objective to design curriculum learning, for reducing + +the training data quantity needed for transformers. Curriculum Learning First proposed by (Bengio et al., 2009), curriculum learning aims to enable the models to gradually learn from easy to harder examples according to a difficulty measure for each example during training. Therefore, curriculum learning enables the model to better utilize available data. With growing research interests, curriculum learning has been applied in different fields. In computer vision, curriculum learning has been applied to a range of tasks, such as image classification (Weinshall et al., 2018), human attribute analysis (Wang et al., 2019), and visual question answering (Li et al., 2020), however, its NLP application is mainly limited to neural machine translation (Platanios et al., 2019; Liu et al., 2020; Zhou et al., 2021; Zhang et al., 2021). So, prior works on curriculum learning on NLP, including their difficulty measurement and scheduling strategy, are mainly designed for compositional language processes, which are largely different from non-compositional expressions, i.e., idioms and metaphors. In this study, we propose a new curriculum learning method specifically designed for non-compositional expression recognition. Moreover, for the first time we show how curriculum learning based on contrastive learning, results in performance gains in the idomaticity-related tasks. + +# 3 Framework + +In this section, we introduce our proposed framework as a combination of contrastive learning and curriculum learning. Overall, we first utilize contrastive learning to obtain the contrastive objective, which is then used as a measurement of the difficulty level for each sentence containing idioms or metaphors. Then, our proposed dynamic scheduling strategy is used to re-arrange the training examples. Finally, the model is trained via the classification objective and the contrastive objective. + +# 3.1 Contrastive Learning + +Contrastive learning aims to learn meaningful representations by pulling semantically similar examples and pushing apart semantically different examples. In our case, the figurative and literal meanings for the same non-compositional expression are different. Thus, for the purpose of contrastive learning the same non-compositional expressions used in the same (figurative or literal) sense in different sentences are natural semantically close examples. + +![](images/ce96fe69212299fd925e1ebb0f2611ccea2c83db6724a376b0f1c281cc8675ff.jpg) +Figure 1: The diagram illustrates the CLCL framework. + +On the other hand, the same non-compositional expressions used in different senses in different sentences are semantically different examples. Training with contrastive learning allows the model to learn higher-quality representations by grouping the embeddings of a given non-compositional expression into two distinct clusters in the embedding space, corresponding to its figurative and literal meaning. + +More specifically, for a sentence $Y_{i}$ (anchor example) with a non-compositional expression $i$ , its meaning should be similar to another sentence $Y_{i}^{+}$ (positive example) with the same expression $i$ used in the same sense because they both contain the same non-compositional expression used in the same way (figuratively or literally). However, the meaning of $Y_{i}$ will be different from the sentence $Y_{i}^{-}$ (negative example) with the same expression $i$ but used differently. Therefore, the distance between the appropriate representations of $Y_{i}$ and $Y_{i}^{+}$ ( $x_{i}$ and $x_{i}^{+}$ ) is expected to be small, while the distance between the appropriate representations of $Y_{i}$ and $Y_{i}^{-}$ ( $x_{i}$ and $x_{i}^{-}$ ) is expected to be large. Thus, we develop a contrastive objective by considering $(Y_{i}, Y_{i}^{+})$ a positive pair and $(Y_{i}, Y_{i}^{-})$ a negative pair: + +$$ +\mathcal {L} _ {\mathrm {c t s}} = - \sum_ {Y \in \mathcal {Y}} \log \frac {f \left(\boldsymbol {x} _ {i} , \boldsymbol {x} _ {i} ^ {+}\right)}{f \left(\boldsymbol {x} _ {i} , \boldsymbol {x} _ {i} ^ {+}\right) + f \left(\boldsymbol {x} _ {i} , \boldsymbol {x} _ {i} ^ {-}\right)} \tag {1} +$$ + +where $f$ represents the distance function. Therefore, our final loss is: + +$$ +\mathcal {L} = \mathcal {L} _ {\mathrm {c t s}} + \mathcal {L} _ {\mathrm {c l s}} \tag {2} +$$ + +where $\mathcal{L}_{\mathrm{cts}}$ is the contrastive loss and $\mathcal{L}_{\mathrm{cls}}$ is the cross-entropy loss based on the ground truth class + +label for the sense (literal or figurative) of the expression in $Y_{i}$ . + +To prepare for training, for each training example $Y_{i}$ (anchor), we randomly sample a $Y_{i}^{+}$ to form the positive pair and randomly sample a $Y_{i}^{-}$ to form the negative pair, converting the training example $Y_{i}$ into a triplet of anchor, positive, and negative examples, i.e., $< Y_{i}, Y_{i}^{+}, Y_{i}^{-} >$ . We use the triplets to train the models with the aforementioned final loss. + +# 3.2 Curriculum Learning + +# 3.2.1 Difficulty Metrics + +This section defines the difficulty metric used by our curriculum learning framework. We correlate the classification difficulty for each example $Y_{i}$ to its position in the embedding space relative to its corresponding positive $Y_{i}^{+}$ and negative example $Y_{i}^{-}$ because the contextualized representation for the figurative and literal meaning of the non-compositional expression should be different. Non-compositionality means that the meaning of a figurative expression is not derivable from its constituent words, but rather, the expression has a conventionalized figurative meaning. Therefore, the differentiation between figurative and literal semantics demands a distinction between an expression's figurative and literal embedding. If the figurative and literal embeddings for the same expression are really separable, i.e., they are further apart in the embedding space, a classifier should be able to classify the figurative and literal senses more easily. Conversely, if the embeddings of an expression's figurative and literal semantics are not distinctive, it would be harder for the model to classify the expression into its figurative and literal senses based + +Algorithm 1: CLCL +Input: Dataset $\mathbb{P} = \{Y_i\}_{i=1}^K$ , Model M and number of epochs $N$ +Output: Fine-tuned Model M* +1 $\mathbb{P}^* = \{(Y_i, Y_i^+, Y_i^-)\}_{i=1}^K$ ; +2 $\mathbf{D}_0 = \mathrm{CTS}(\mathbb{P}^*, \mathbf{M})$ ; +3 Sort P* based on each difficulty level in $\mathbf{D}_0$ , resulting in a re-arranged $\mathbb{P}_0^*$ ; +4 for $n = 1; n \leq N$ do +5 $\mathbf{M}_n \Leftarrow \mathrm{TRAIN}(\mathbb{P}_{n-1}^*)$ ; +6 $\mathbf{D}_n = \emptyset, \hat{\mathbb{P}}_n = \emptyset$ ; +7 for $(Y, Y^+, Y^-) \in \mathbb{P}^*$ do +8 $\begin{array}{c} d_{\mathbf{M}_n}(Y) = \mathrm{CTS}(Y; \mathbf{M}_n) \\ \text{if } d_{\mathbf{M}_n}(Y) \neq d_{\mathbf{M}_{n-1}}(Y) \text{ then} \\ | \mathbf{D}_n \Leftarrow \mathbf{D}_n \bigcup \{d_{\mathbf{M}_n}(Y)\} ; \\ \hat{\mathbb{P}}_n \Leftarrow \hat{\mathbb{P}}_n \bigcup (Y, Y^+, Y^-) ; \\ \text{else} \\ | \text{continue} ; \\ \text{end} \\ \text{end} \\ \text{Sort } \hat{\mathbb{P}}_n \text{ based on } \mathbf{D}_n, \text{ resulting in } \mathbb{P}_n^* ; \\ \text{end} \\ \text{return } \mathbf{M}^* = \mathbf{M}_n; \end{array}$ + +on its embedding. Therefore, it makes sense to use the degree to which the figurative and literal embeddings are separable in the embedding space as a measure of classification difficulty. Intuitively, if $Y_{i}$ is easy for the model to classify, then $x_{i}$ , the embedding of $Y_{i}$ , should already encode certain semantic features and thus be located closer to $x_{i}^{+}$ than $x_{i}^{-}$ in the embedding space. + +Hence, given the $< Y_{i},Y_{i}^{+},Y_{i}^{-} >$ triplets, we assess the difficulty of a training example $Y_{i}$ based on the models' contrastive objective as + +$$ +d _ {\mathbf {M}} \left(Y _ {i}\right) = \operatorname {C T S} \left(Y _ {i}; \mathbf {M}\right) = \frac {f \left(\boldsymbol {x} _ {i} , \boldsymbol {x} _ {i} ^ {+}\right)}{f \left(\boldsymbol {x} _ {i} , \boldsymbol {x} _ {i} ^ {+}\right) + f \left(\boldsymbol {x} _ {i} , \boldsymbol {x} _ {i} ^ {-}\right)} \tag {3} +$$ + +where $M$ is the model and $d_{\mathbf{M}}(Y_i)$ is the difficulty measure for $Y_i$ . + +# 3.2.2 Scheduling Strategy + +After the difficulty levels are determined, the traditional curriculum learning methods would fix the order of training examples. However, the difficulty of each example for the model changes as the model learns. Therefore, it is disadvantageous to fix the order of training examples. We propose to + +update the difficulty levels and dynamically schedule training examples accordingly. Specifically, since the difficulty levels are measured based on the contrastive objective, they are naturally updated during the training process. Therefore, after each training epoch, the difficulty score $d_{\mathbf{M}}(Y_i)$ for each example $Y_i$ is updated as: + +$$ +d _ {\mathbf {M} _ {n}} \left(Y _ {i}\right) = \operatorname {C T S} \left(Y _ {i}; \mathbf {M} _ {n}\right) \tag {4} +$$ + +where $\mathbf{M}_n$ refers to our model fine-tuned for $n$ epochs in our task. After the difficulty scores for all the training examples have been updated, the training examples will be re-arranged according to the new difficulty scores for the next epoch of training. + +# 4 Experiments + +# 4.1 Datasets + +Idiom Usage Recognition. We conduct experiments on three datasets for idiom usage recognition: MAGPIE (Haagsma et al., 2020) SemEval5B (Korkontzelos et al., 2013) and VNC (Cook et al., 2008). To test the models' ability to recognize the usage of unseen idioms, each dataset was split into train and test sets in two ways: random and typebased. In the random split, the sentences are randomly divided, and the same idiom can appear in both train and test sets, whereas in the typebased split, the idioms in the test set and the train set do not overlap. For MAGPIE and SemEval5B, we use their respective official random/typebased and train/test splits. For VNC, the official dataset did not have the typebased split. Therefore, to create the typebased split, we randomly split the idiom types by an $80/20$ ratio, leaving 43 idiom types in the train set and ten idiom types in the test set. + +Metaphor Detection. Following previous works on metaphor detection, we conduct experiments on three datasets for metaphor detection: (1) VUA-18 (Leong et al., 2018), (2) VUA-verb (Steen et al., 2010), and (3) MOH-X dataset (Mohammad et al., 2016). The original train/dev/test splits provided by the official datasets are used in our experiments. + +# 4.2 Baselines + +We show the effectiveness of our method via a comparison between the vanilla RoBERTa classification model and the RoBERTa classification model fine-tuned using our method. Besides, we also choose different SOTA models for different tasks as baselines. + +
Data SplitsVersionMAGPIESemEval5BVNC
AccF1-figF1AccF1-figF1AccF1-figF1
Randomvanilla95.0796.7093.5192.5992.3392.5893.1192.8293.09
DISC-95.02--95.80--96.97-
Ours96.7597.8296.7596.4696.5696.4697.2498.0797.22
Typebasedvanilla92.8694.7991.7373.3680.1269.8880.0686.8576.58
DISC-87.78--58.82--89.02-
Ours95.3697.0594.2091.1192.6591.1693.2296.1693.25
+ +Table 1: Performance of different methods on MAGPIE, SemEval5B, and VNC under different settings. The best performances are bold-faced. The best performances in bold are significantly better than the performance of the baseline models. + +
ModelVUA18VUAverbMOH-X
AccPRF1AccPRF1AccPRF1
vanilla93.479.475.077.180.472.968.870.783.582.983.482.9
MelBERT94.080.576.478.480.764.678.871.081.679.782.781.1
MisNet94.782.473.277.584.477.068.372.483.183.282.582.5
Ours94.580.876.178.484.774.973.974.484.384.082.783.4
+ +Table 2: Performance of different methods on VUA-18, VUA-verb, and MOH-X. The best performances are bold-faced. The best performances in bold are significantly better than the performance of the baseline models. + +Idiom Usage Recognition. DISC (Zeng and Bhat, 2021) is the current SOTA model for idiom usage recognition. Therefore, we choose this model as the baseline for this task. + +Metaphor Detection. Based on previous works, MelBERT (Choi et al., 2021), MisNet (Zhang and Liu, 2022) and CATE (Lin et al., 2021) are current SOTA models for metaphor detection. However, CATE not only requires external data resources as augmentation, but also does not have a publicly accessible implementation, which makes it reproduction difficult. Therefore, we only choose MelBERT and MisNet as our baselines and report the performance using their released code. + +# 4.3 Experimental Settings + +We implement our framework using a pre-trained RoBERTa Base model from Huggingface. The model is trained with a batch size of 16 for three epochs, using the Adam optimizer, and a learning rate of $3e - 5$ . During training, for each training example, we randomly select its positive example and negative example for contrastive learning. The classification loss is calculated based only on the original training example's label. + +# 4.4 Evaluation Metrics + +Considering that the idiom usage recognition task is a binary classification problem, we use accuracy + +and macro $F1$ score to evaluate the performance. We also include the F1 score that treats the figurative class as the positive class, denoted as F1-fig. For metaphor detection, we follow the evaluation metrics (accuracy, precision, recall, and F1) in previous studies for a fair comparison. For metaphor detection, F1 refers to the F1 score that treats the figurative class as the positive class. + +# 5 Results + +As shown in Table 1, for idiom usage recognition, RoBERTa classification model using our proposed method (Ours) achieves the best performance over all the evaluation metrics. For the MAGPIE dataset with random split, compared with the performance of the vanilla RoBERTa model, our framework outperforms it by 1.72 points in accuracy, 1.12 points in F1-fig score, and 3.24 points in F1 score. Compared with the DISC model, our method still outperforms it by 2.8 points on the F1-fig score. For the MAGPIE dataset with typebased split, our framework outperforms the vanilla model by 2.5 points in accuracy, 2.26 points in F1-fig score, and 2.47 in F1 score. For the SemEval5B dataset with random split, our framework outperforms the previous SOTA model by 0.76 on the F1-fig score. For the SemEval5B dataset with typebased split, our framework outperforms the SOTA model by 33.83 on the + +
Data SplitsVersionMAGPIESemEval5BVNC
AccF1-figF1AccF1-figF1AccF1-figF1
RandomOurs w/o CL95.1496.7393.6494.1194.1294.1194.9495.7795.12
Ours w/o CTS95.2696.8193.8294.6194.5494.6195.1195.8895.32
Ours96.7597.8296.7596.4696.5696.4697.2498.0797.22
TypebasedOurs w/o CL92.6794.6491.5386.8788.6786.5489.4392.1189.32
Ours w/o CTS91.0493.3089.8983.2085.4382.8086.2289.1286.11
Ours95.3697.0594.2091.1192.6591.1693.2296.1693.25
+ +Table 3: Ablation study of our method on idiom detection task on MAGPIE, SemEval5B, and VNC under different settings. The best performances are bold-faced. The best performances in bold are significantly better than the performance of the baseline models. + +
ModelVUA18VUAverbMOH-X
AccPRF1AccPRF1AccPRF1
Ours w/o CL94.480.575.978.183.468.978.873.583.883.383.383.3
Ours w/o CTS93.980.375.878.184.173.173.873.583.884.381.482.5
Ours94.580.876.178.484.774.973.974.484.384.082.783.4
+ +Table 4: Ablation study of our method on metaphor detection task on VUA18, VUAverb, and MOH-X. The best performances are bold-faced. The best performances in bold are significantly better than the performance of the baseline models. + +
ModelTrained on VUA and Tested on MAGpieTrained on MAGpie and Tested on VUA
AccuracyPrecisionRecallF1AccuracyPrecisionRecallF1
MelBERT60.992.751.666.370.111.210.110.6
Ours61.592.952.367.074.020.528.723.9
+ +Table 5: Transfer study of our method on idomaticity detection and metaphor detection. + +F1-fig score, which is a significant improvement. For the VNC dataset with random split, our framework outperforms the previous SOTA model by 1.1 on the F1-fig score. For the VNC dataset with typebased split, our framework beats the SOTA model by 7.14 on the F1-fig score. Therefore, our method outperforms all the baselines on three datasets across all the evaluation metrics, which shows the effectiveness of our method. + +As shown in Table 2, for the task of metaphor, RoBERTa classification model using our proposed method achieves the best performance on all the datasets in F1 score. For VUA18 dataset, compared with the performance of SOTA MelBERT, our framework achieves competitive performance without utilizing POS taggings and other linguistic features except for the original RoBERTa model's parameters. For the VUA-verb dataset, our method outperforms MelBERT by 4.0 absolute points in accuracy, 10.3 in Precision, and 3.4 in F1 score. Besides, our model outperforms MisNet by 5.6 points in Recall, and 2.0 points in F1 score. On the MOH-X dataset, our method achieves the best + +performance by outperforming MelBERT by 2.7 points in Accuracy and 2.3 points in F1 score and outperforming MisNet by 1.2 in Accuracy and 0.9 in F1 score. As a result, our method not only performs the best on the task of idiom usage recognition but also on the task of metaphor detection. + +# 6 Analysis + +Ablation Study To investigate the effects of the different components in our method, i.e., contrastive learning and curriculum learning, we compare variants of our method without curriculum learning (w/o CL) and without contrastive learning (w/o CTS). As shown in Table 3, both have worse performance than the complete version. Without curriculum learning, the accuracy drops by more than 1 point, and the F1 score drops by more than 2 points on all the datasets across both random and typebased settings. It should be noted that the curriculum learning and contrastive learning are more effective under a typebased setting as shown in Table 3. For metaphor detection, the results presented in Table 4 show a similar trend that each component + +![](images/a0289f71e54db3d0cfcb2dfba2deeb4bfe9209a01a95eb057cdccc68556eba0d.jpg) +(a) w/o fine-tune + +![](images/7d7c61ae1ebfd4d6699e8a452be77e3051d4e59aa7d635fd25cee47e1be06b52.jpg) +(b) w/ fine-tune + +![](images/26af782819012c3f93a653d0aa1498779afcaae2ae8976bfba87c57de9b189d2.jpg) +(c) w/ cts + +![](images/4545a96e39ddffa2644b49f47617dd2f79de19f065d7f59895f000edb36c8d4b.jpg) +(d) w/ cts and cl + +![](images/afef638eb5030d5621d6f7a1f7344723345f7c62015203c9e2c3bc92569a5ed5.jpg) +Figure 2: t-SNE visualization on SemEval under random setting for in the bag. The red color denotes the metaphorical instances and blue color denotes the literal instances. Here cts refers to contrastive learning and cl refers to curriculum learning. +(a) w/o fine-tune +Figure 3: t-SNE visualization on SemEval under typebased setting for be my guest. The red color denotes the metaphorical instances and blue color denotes the literal instances. + +![](images/46ff45ced9b8b6e6e177b1d8271f39fd7da9b515e079983417566553dd1f39ed.jpg) +(b) w/ fine-tune + +![](images/05846b99e499228a8882f3d382fadd5af0340cf45c8d468f9cf4e59e23133633.jpg) +(c) w/ cts + +![](images/c368002a806fde890fb44ee557f8d1882fdad1062b361755329f83708737fe34.jpg) +(d) w/ cts and cl + +is important for our method. Besides, we also observe in the Table 3 and 4 that contrastive learning and curriculum learning can individually improve model performance. Furthermore, when combined together, they complement and boost each other to further improve the performance. + +Analysis on Data Splits. Our method's effectiveness is most prominent on unseen idiomatic expressions, as shown in Table 1. The improvement brought about by our curriculum learning method is always more prominent in a typebased setting compared with the gain in a random setting. Therefore, with contrastive learning and curriculum learning, our method can enable the RoBERTa model to generalize over unseen idioms and transfer knowledge on recognizing non-compositionality to unseen non-compositional expressions. + +Analysis on the Datasets. Results shown in Table 1 and 2 also demonstrate that our method is most effective on the datasets with smaller numbers of training examples. On the MAGPIE dataset, which is the largest dataset for idiom usage recognition, our method only outperforms the vanilla RoBERTa model by 1.68 in accuracy. However, on the smaller SemEval5B dataset, our method outperforms the vanilla RoBERTa model by 3.87 in accuracy. Similarly, on the VUA-18 dataset, + +which is the largest dataset for metaphor detection, our method only achieves competitive performance with MelBERT. However, on smaller VUA-verb and MOH-X datasets, our method significantly outperforms the baseline models. As a result, with the help of curriculum learning, our method utilizes the available data more efficiently, especially in a low-resource scenario. + +Analysis on the Cross-Task Transfer. Results shown in Table 5 also demonstrate that our method has a better ability to transfer across different tasks. For the transfer study, we use the random split of MAGPIE dataset and VUA18. When trained on the dataset for one task and tested on the dataset for another task, our method always outperforms the baseline method, MelBERT. Besides, we observe that the models achieve good results in idiom usage recognition when trained in metaphor detection. However, when trained on idiom usage recognition, the models' performance on metaphor detection is much worse. Therefore, the symbolic knowledge learned during the task of metaphor detection could be transferred to perform the idiom usage recognition while the idiomatic knowledge cannot help with the metaphor detection. We leave the deeper study of this phenomenon to future research. + +Embedding Visualization In Figures 2 and 3, we + +visualize for SemEval5B sample contextual embeddings for sentences from two idioms under different data split settings. As shown in Figure 2, under the random-split setting, with simple fine-tuning and contrastive learning, the literal and figurative representations are already separated with a few points mis-clustered. However, with our method, all the points are correctly separated. In Figure 3, under the typebased-split setting, simple fine-tuning fails to separate senses in the embeddings space into differentiable groups. We observe that even with contrastive learning, there are still points clustered into the wrong group. However, with both contrastive learning and curriculum learning, all the points are distinctly separated. + +# 7 Conclusion and Future Work + +In this paper, we propose a novel method specifically for non-compositional expression detection, including idiom usage recognition and metaphor detection. Our proposed method combines contrastive learning and curriculum learning. Contrastive learning is used to build better representations to model non-compositionality. Besides, the difficulty levels obtained from the contrastive learning objective are dynamically updated during the training, based on which the training examples are dynamically scheduled. As a result, the model could be trained in an easy-to-hard manner. We evaluate our proposed method on both idiom usage recognition and metaphor detection. Experiment results affirm the effectiveness of our method on both tasks. Detailed ablation studies and analyses are provided to support our claims. As a result, our work is the first to propose a framework for idiom usage recognition and metaphor detection. Our proposed framework also shows better cross-task transfer ability based on idiom usage recognition and metaphor detection. + +# Limitations + +Our scheduling strategy only re-arranges the training examples after each training epoch, limiting the flexibility of scheduling them compared with re-arranging the examples after each training step. Therefore, the order of the training examples will still be fixed within each training epoch. + +Besides, our method finds it challenging to transfer from the task of idiom usage recognition to that of metaphor detection. Therefore, more advanced methods for learning the broad nature of + +non-compositionality, including those of idioms and those of metaphors are needed. We leave this to a future study. + +# Acknowledgements + +This material is based upon work supported by the National Science Foundation under Grant No. IIS 22-30817. + +# References + +Miriam Amin, Peter Fankhauser, Marc Kupietz, and Roman Schneider. 2021. Data-driven identification of idioms in song lyrics. MWE 2021, page 13. +Timothy Baldwin and Su Nam Kim. 2010. Multiword expressions. In Nitin Indurkhya and Fred J. Damerau, editors, Handbook of Natural Language Processing, Second Edition, pages 267-292. Chapman and Hall/CRC. +Yoshua Bengio, Jérôme Louradour, Ronan Collobert, and Jason Weston. 2009. Curriculum learning. In Proceedings of the 26th annual international conference on machine learning, pages 41-48. +George Aaron Broadwell, Umit Boz, Ignacio Cases, Tomek Strzalkowski, Laurie Feldman, Sarah Taylor, Samira Shaikh, Ting Liu, Kit Cho, and Nick Webb. 2013. Using imageability and topic chaining to locate metaphors in linguistic corpora. In International Conference on Social Computing, Behavioral-Cultural Modeling, and Prediction, pages 102-110. Springer. +I-Hsuan Chen, Yunfei Long, Qin Lu, and ChuRen Huang. 2017. Leveraging eventive information for better metaphor detection and classification. In Proceedings of the 21st Conference on Computational Natural Language Learning (CoNLL 2017), pages 36-46. +Minjin Choi, Sunkyung Lee, Eunseong Choi, Heesoo Park, Junhyuk Lee, Dongwon Lee, and Jongwuk Lee. 2021. Melbert: Metaphor detection via contextualized late interaction using metaphorical identification theories. In 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies. +Paul Cook, Afsaneh Fazly, and Suzanne Stevenson. 2008. The vnc-tokens dataset. In Proceedings of the LREC Workshop Towards a Shared Task for Multiword Expressions (MWE 2008), pages 19-22. +Hongchao Fang, Sicheng Wang, Meng Zhou, Jiayuan Ding, and Pengtao Xie. 2020. Cert: Contrastive self-supervised learning for language understanding. arXiv preprint arXiv:2005.12766. + +Afsaneh Fazly, Paul Cook, and Suzanne Stevenson. 2009. Unsupervised type and token identification of idiomatic expressions. Computational Linguistics, 35(1):61-103. +Michael Flor and Beata Beigman Klebanov. 2018. Catching idiomatic expressions in efl essays. In Proceedings of the Workshop on Figurative Language Processing, pages 34-44. +Ge Gao, Eunsol Choi, Yejin Choi, and Luke Zettlemoyer. 2018. Neural metaphor detection in context. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 607-613. +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. +Hongyu Gong, Kshitij Gupta, Akriti Jain, and Suma Bhat. 2020. Illinimet: Illinois system for metaphor detection with contextual and linguistic information. In Proceedings of the Second Workshop on Figurative Language Processing, pages 146-153. +Hessel Haagsma, Johan Bos, and Malvina Nissim. 2020. Magpie: A large corpus of potentially idiomatic expressions. In Proceedings of The 12th Language Resources and Evaluation Conference, pages 279-287. +Xiaotong Jiang, Qingqing Zhao, Yunfei Long, and Zhongqing Wang. 2022. Chinese synesthesia detection: New dataset and models. In Findings of the Association for Computational Linguistics: ACL 2022, pages 3877-3887. +Beata Beigman Klebanov, Ben Leong, Michael Heilman, and Michael Flor. 2014. Different texts, same metaphors: Unigrams and beyond. In Proceedings of the Second Workshop on Metaphor in NLP, pages 11-17. +Maximilian Köper and Sabine Schulte im Walde. 2016. Distinguishing literal and non-literal usage of german particle verbs. In Proceedings of the 2016 conference of the north American chapter of the association for computational linguistics: Human language technologies, pages 353-362. +Ioannis Korkontzelos, Torsten Zesch, Fabio Massimo Zanzotto, and Chris Biemann. 2013. Semeval-2013 task 5: Evaluating phrasal semantics. In Second Joint Conference on Lexical and Computational Semantics (* SEM), Volume 2: Proceedings of the Seventh International Workshop on Semantic Evaluation (SemEval 2013), pages 39-47. + +Chee Wee Leong, Beata Beigman Klebanov, and Ekaterina Shutova. 2018. A report on the 2018 vua metaphor detection shared task. In Proceedings of the Workshop on Figurative Language Processing, pages 56-66. +Qing Li, Siyuan Huang, Yining Hong, and Song-Chun Zhu. 2020. A competence-aware curriculum for visual concepts learning via question answering. In European Conference on Computer Vision, pages 141-157. Springer. +Zhenxi Lin, Qianli Ma, Jiangyue Yan, and Jieyu Chen. 2021. Cate: A contrastive pre-trained model for metaphor detection with semi-supervised learning. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 3888-3898. +Changsheng Liu and Rebecca Hwa. 2017. Representations of context in recognizing the figurative and literal usages of idioms. In Thirty-First AAAI Conference on Artificial Intelligence. +Changsheng Liu and Rebecca Hwa. 2018. Heuristically informed unsupervised idiom usage recognition. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 1723-1731. +Xuebo Liu, Houtim Lai, Derek F Wong, and Lidia S Chao. 2020. Norm-based curriculum learning for neural machine translation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 427-436. +Lajanugen Logeswaran and Honglak Lee. 2018. An efficient framework for learning sentence representations. In International Conference on Learning Representations. +Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. 2013. Distributed representations of words and phrases and their compositionality. Advances in neural information processing systems, 26. +Saif Mohammad, Ekaterina Shutova, and Peter Turney. 2016. Metaphor as a medium for emotion: An empirical study. In Proceedings of the Fifth Joint Conference on Lexical and Computational Semantics, pages 23-33. +Rosamund Moon et al. 1998. Fixed expressions and idioms in English: A corpus-based approach. Oxford University Press. +Jing Peng and Anna Feldman. 2015. Automatic idiom recognition with word embeddings. In Information Management and Big Data, pages 17-29. Springer. +Emmanouil Antonios Platanios, Otilia Stretcu, Graham Neubig, Barnabás Póczos, and Tom Mitchell. 2019. Competence-based curriculum learning for 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 1162-1172. +Bahar Salehi, Paul Cook, and Timothy Baldwin. 2014. Detecting non-compositional mwe components using wiktionary. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1792-1797. +Marco Silvio Giuseppe Senaldi, Gianluca E Lebani, and Alessandro Lenci. 2016. Lexical variability and compositionality: Investigating idiomaticity with distributional semantic models. In Proceedings of the 12th workshop on multiword expressions, pages 21-31. +Gerard Steen, Lettie Dorst, Berenike Herrmann, Anna Kaal, Tina Krennmayr, and Trijntje Pasma. 2010. A method for linguistic metaphor identification from mip to mipvu preface. Method For Linguistic Metaphor Identification: From Mip To Mipvu, 14:IX++. +Yulia Tsvetkov, Leonid Boytsov, Anatole Gershman, Eric Nyberg, and Chris Dyer. 2014. Metaphor detection with cross-lingual model transfer. In Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 248-258. +Yiru Wang, Weihao Gan, Jie Yang, Wei Wu, and Junjie Yan. 2019. Dynamic curriculum learning for imbalanced data classification. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 5017-5026. +Daphna Weinshall, Gad Cohen, and Dan Amir. 2018. Curriculum learning by transfer learning: Theory and experiments with deep networks. In International Conference on Machine Learning, pages 5238-5246. PMLR. +Chuhan Wu, Fangzhao Wu, Yubo Chen, Sixing Wu, Zhigang Yuan, and Yongfeng Huang. 2018. Neural metaphor detecting with cnn-lstm model. In Proceedings of the workshop on figurative language processing, pages 110-114. +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. +Ziheng Zeng and Suma Bhat. 2021. Idiomatic expression identification using semantic compatibility. Transactions of the Association for Computational Linguistics, 9:1546-1562. +Mingliang Zhang, Fandong Meng, Yunhai Tong, and Jie Zhou. 2021. Competence-based curriculum learning for multilingual machine translation. In Findings of the Association for Computational Linguistics: EMNLP 2021, pages 2481-2493. + +Shenglong Zhang and Ying Liu. 2022. Metaphor detection via linguistics enhanced siamese network. In Proceedings of the 29th International Conference on Computational Linguistics, pages 4149-4159. + +Lei Zhou, Liang Ding, Kevin Duh, Shinji Watanabe, Ryöhei Sasano, and Koichi Takeda. 2021. Self-guided curriculum learning for neural machine translation. In Proceedings of the 18th International Conference on Spoken Language Translation (IWSLT 2021), pages 206-214. + +# A Implementation + +Our experiments and implementation are based on the Transformers library and PyTorch. + +# B Experimental Details + +All of our experiments were conducted using two GPUs with 16GB RAM (NVIDIA V100). + +# B.1 Hyperparameter Choices + +For the task of idiom usage recognition, we use the Adam optimizer during the training with batch size 32. The maximum input length is set to 128. We use a constant learning rate of 1e-5 for fine-tuning. For all the experiments, we fine-tune the models for 30 epochs and select the model with the best performance on the development set for testing. For the task of metaphor detection, we used the Adam optimizer during the training with batch size 16. All the other hyperparameters are set to default values used in (Choi et al., 2021). All of our experiments are performed for five times. The mean results are reported. + +# B.2 Number of Parameters + +Considering that our proposed contrastive learning and curriculum learning do not introduce more parameters, the number of parameters is identical to the number of parameters in the underlying language model: 125M for RoBERTa (base). + +# B.3 Average Runtime + +The training process for one epoch on two GPUs took approximately 40 minutes, including 10 minutes for evaluating difficulties and 30 for fine-tuning. + +A For every submission: + +A1. Did you describe the limitations of your work? 8 +A2. Did you discuss any potential risks of your work? Not applicable. Left blank. +A3. Do the abstract and introduction summarize the paper's main claims? Left blank. +A4. Have you used AI writing assistants when working on this paper? Left blank. + +B Did you use or create scientific artifacts? + +4 + +B1. Did you cite the creators of artifacts you used? 4 +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? Not applicable. Left blank. +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? 4 +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? Not applicable. Left blank. +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? 4 +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. + +C Did you run computational experiments? + +4, B + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? 4.3, B + +The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +4.3, $B$ + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +B + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +Not applicable. Left blank. + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +No response. + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +No response. + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +No response. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +No response. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +No response. \ No newline at end of file diff --git a/clclnoncompositionalexpressiondetectionwithcontrastivelearningandcurriculumlearning/images.zip b/clclnoncompositionalexpressiondetectionwithcontrastivelearningandcurriculumlearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..8c56f07b6a5db3ee61ec04e0a653b3c34222f306 --- /dev/null +++ b/clclnoncompositionalexpressiondetectionwithcontrastivelearningandcurriculumlearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:63780b560b2565e766c35d1815894df07b8be46af03900b545f7e20f361541fb +size 408477 diff --git a/clclnoncompositionalexpressiondetectionwithcontrastivelearningandcurriculumlearning/layout.json b/clclnoncompositionalexpressiondetectionwithcontrastivelearningandcurriculumlearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..e4a4a446a2bdc1b62e10c547096038c09fd9a5ec --- /dev/null +++ b/clclnoncompositionalexpressiondetectionwithcontrastivelearningandcurriculumlearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6f6482f2c1ef39060200ac6770bdf39ef3e043a520a15ae891aa4eaaa5f748e7 +size 391573 diff --git a/clinicalnoteownsitshierarchymultilevelhypergraphneuralnetworksforpatientlevelrepresentationlearning/059dea46-a048-4768-b2c3-3f36c042e812_content_list.json b/clinicalnoteownsitshierarchymultilevelhypergraphneuralnetworksforpatientlevelrepresentationlearning/059dea46-a048-4768-b2c3-3f36c042e812_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..4c7db5b207d020a3f9fa907754b55dd3b9c89e3c --- /dev/null +++ b/clinicalnoteownsitshierarchymultilevelhypergraphneuralnetworksforpatientlevelrepresentationlearning/059dea46-a048-4768-b2c3-3f36c042e812_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d78d44d64a34405b670342b444a3b68caa44d1682f20db80f2898b1fbb7e07b +size 96898 diff --git a/clinicalnoteownsitshierarchymultilevelhypergraphneuralnetworksforpatientlevelrepresentationlearning/059dea46-a048-4768-b2c3-3f36c042e812_model.json b/clinicalnoteownsitshierarchymultilevelhypergraphneuralnetworksforpatientlevelrepresentationlearning/059dea46-a048-4768-b2c3-3f36c042e812_model.json new file mode 100644 index 0000000000000000000000000000000000000000..07b54fdba8ad2aca66102b0ad88546b8ce1ff779 --- /dev/null +++ b/clinicalnoteownsitshierarchymultilevelhypergraphneuralnetworksforpatientlevelrepresentationlearning/059dea46-a048-4768-b2c3-3f36c042e812_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e093632b84cbc893c3c9e9591b0351444fb20a0baadecfc57b92f44333b92b99 +size 115620 diff --git a/clinicalnoteownsitshierarchymultilevelhypergraphneuralnetworksforpatientlevelrepresentationlearning/059dea46-a048-4768-b2c3-3f36c042e812_origin.pdf b/clinicalnoteownsitshierarchymultilevelhypergraphneuralnetworksforpatientlevelrepresentationlearning/059dea46-a048-4768-b2c3-3f36c042e812_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e5abe548b6c80e46ebfe095cb5ca7363b78aef2a --- /dev/null +++ b/clinicalnoteownsitshierarchymultilevelhypergraphneuralnetworksforpatientlevelrepresentationlearning/059dea46-a048-4768-b2c3-3f36c042e812_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:92403ee73d20a12dce2c091c42de99860a73bc0b271a497dd158adc5c68242af +size 965150 diff --git a/clinicalnoteownsitshierarchymultilevelhypergraphneuralnetworksforpatientlevelrepresentationlearning/full.md b/clinicalnoteownsitshierarchymultilevelhypergraphneuralnetworksforpatientlevelrepresentationlearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..cdcffd1726f4dae7c1376f39c158cf86582bc5e8 --- /dev/null +++ b/clinicalnoteownsitshierarchymultilevelhypergraphneuralnetworksforpatientlevelrepresentationlearning/full.md @@ -0,0 +1,453 @@ +# Clinical Note Owns its Hierarchy: Multi-Level Hypergraph Neural Networks for Patient-Level Representation Learning + +Nayeon Kim $^{1*}$ , Yinhua Piao $^{2*}$ , and Sun Kim $^{1,2,3,4}$ + +1 Interdisciplinary Program in Artificial Intelligence, Seoul National University + +$^{2}$ Department of Computer Science and Engineering, Seoul National University + +$^{3}$ Institute of Computer Technology, Seoul National University + +$^{4}$ AIGENDRUG Co., Ltd. + +{ny_1031, 2018-27910, sunkim.bioinfo}@snu.ac.kr + +# Abstract + +Leveraging knowledge from electronic health records (EHRs) to predict a patient's condition is essential to the effective delivery of appropriate care. Clinical notes of patient EHRs contain valuable information from healthcare professionals, but have been underused due to their difficult contents and complex hierarchies. Recently, hypergraph-based methods have been proposed for document classifications. Directly adopting existing hypergraph methods on clinical notes cannot sufficiently utilize the hierarchy information of the patient, which can degrade clinical semantic information by (1) frequent neutral words and (2) hierarchies with imbalanced distribution. Thus, we propose a taxonomy-aware multi-level hypergraph neural network (TM-HGNN), where multi-level hypergraphs assemble useful neutral words with rare keywords via note and taxonomy level hyperedges to retain the clinical semantic information. The constructed patient hypergraphs are fed into hierarchical message passing layers for learning more balanced multi-level knowledge at the note and taxonomy levels. We validate the effectiveness of TM-HGNN by conducting extensive experiments with MIMIC-III dataset on benchmark in-hospital-mortality prediction. $^{1}$ + +# 1 Introduction + +With improvement in healthcare technologies, electronic health records (EHRs) are being used to monitor intensive care units (ICUs) in hospitals. Since it is crucial to schedule appropriate treatments for patients in ICUs, there are many prognostic models that use EHRs to address related tasks, such as in-hospital mortality prediction. EHRs consist of three types of data; structured, semi-structured, and unstructured. Clinical notes, which are unstructured data, contain valuable comments or summary of the + +![](images/3e42e0759c324ceb15d55e388ab29e3694e5bbc7699df6e5f058855be2b8ab65.jpg) + +![](images/114aeb71268aefd323a1427f014e2f7f8308032981d31b3e821ed16a537db76a.jpg) +Figure 1: (a) Examples of patient clinical notes with difficult contents (e.g. jargons and abbreviations) and complex structures. Patient $p_1$ owns notes of radiology taxonomy (pink) and nursing taxonomy (blue). (b) Differences between existing hypergraphs and our proposed multi-level hypergraphs. + +patient's condition written by medical professionals (doctors, nurses, etc.). However, compared to structured data, clinical notes have been underutilized in previous studies due to the difficult-to-understand contents and the complex hierarchies (Figure 1(a)). Transformer-based (Vaswani et al., 2017) methods like ClinicalBERT (Alsentzer et al., 2019; Huang et al., 2019a, 2020) have been proposed to pretrain on large-scale corpus from similar domains, and fine-tune on the clinical notes through transfer learning. While Transformer-based methods can effectively detect distant words compared to other sequence-based methods like convolutional neural networks (Kim, 2014; Zhang et al., 2015) and recurrent neural networks (Mikolov et al., 2010; Tai et al., 2015; Liu et al., 2016), there are still limitations of increasing computational complexity for long clinical notes (Figure 2). + +Recently, with the remarkable success of the graph neural networks (GNNs) (Kipf and Welling, + +2017; Velicković et al., 2018; Brody et al., 2021), graph-based document classification methods have been proposed (Yao et al., 2019; Huang et al., 2019b) that can capture long range word dependencies and can be adapted to documents with different and irregular lengths. Some methods build word co-occurrence graphs by sliding fixed-size windows to model pairwise interactions between words (Zhang et al., 2020; Piao et al., 2022; Wang et al., 2022). However, the density of the graph increases as the document becomes longer. Besides, there are also some methods apply hypergraph for document classification (Ding et al., 2020; Zhang et al., 2022a), which can alleviate the high density of the document graphs and extract high-order structural information of the documents. + +Adopting hypergraphs can reduce burden for managing long documents with irregular lengths, but additional issues remain when dealing with clinical notes: (1) Neutral words deteriorate clinical semantic information. In long clinical notes, there are many frequently written neutral words (e.g. "rhythm") that do not directly represent the patient's condition. Most of the previous methods treat all words equally at the learning stage, which may result in dominance of frequent neutral words, and negligence of rare keywords that are directly related to the patient's condition. Meanwhile, the neutral word can occasionally augment information of rare keywords, depending on the intra-taxonomy context. Taxonomy represents the category of the clinical notes, where implicit semantic meaning of the words can differ. For example, "rhythm" occurred with "fibrillation" in ECG taxonomy can represent serious cardiac disorder of a patient, but when "rhythm" is written with "benadryl" in Nursing taxonomy, it can hardly represent the serious condition. Therefore, assembling intra-taxonomy related words can leverage "useful" neutral words with rare keywords to jointly augment the clinical semantic information, which implies the necessity of introducing taxonomy-level hyperedges. (2) Imbalanced distribution of multi-level hyperedges. There are a small number of taxonomies compared to notes for each patient. As a result, when taxonomy-level and note-level information are learned simultaneously, note-level information can obscure taxonomy-level information. To learn more balanced multi-level information of the clinical notes, an effective way for learning the multi-level hypergraphs with imbalanced distributed hy + +![](images/756507c43b18f77b1e3a6d4fe4a7a6c7be29415bb8a541d1145d51cda0097f80.jpg) +Figure 2: Advantages of the proposed model, compared to sequence, graph and hypergraph based models. $N$ and $E$ denote the number of nodes and edges respectively. We address issues of complexity and different lengths by adopting the hypergraph to represent each patient. Our model retains semantic information by constructing multi-level hypergraph (Section 3.2), and hierarchical message passing layers (Section 3.3) are proposed for balancing multi-level knowledge for patient representation learning. + +peredges is required. + +To address the above issues, we propose TM-HGNN (Taxonomy-aware Multi-level HyperGraph Neural Networks), which can effectively and efficiently utilize the multi-level high-order semantic information for patient representation learning. Specifically, we adopt patient-level hypergraphs to manage highly unstructured and long clinical notes and define multi-level hyperedges, i.e., note-level and taxonomy-level hyperedges. Moreover, we conduct the hierarchical message passing from note-level to taxonomy-level hyperedges using edge-masking. To hierarchically learn word embeddings without mixture of information between note and taxonomy, note and taxonomy hyperedges are disconnected. Note-level word embeddings are learned only with intra-note local information. The following taxonomy-level propagation introduce clinical semantic information by assembling the intra-taxonomy words and separating inter-taxonomy words for better patient-level representation learning. The contributions of this article can be summarized as follows (Figure 2): + +- To address issue 1, we construct multi-level hypergraphs for patient-level representation learning, which can assemble "useful" neutral word with rare keyword via note and taxonomy level hyperedges to retain the clinical semantic information. + +- To address issue 2, we propose hierarchical message passing layers for the constructed graphs with imbalanced hyperedges, which can learn more balanced multi-level knowledge for patient-level representation learning. +- We conduct experiments with MIMIC-III clinical notes on benchmark in-hospital-mortality task. The experimental results demonstrate the effectiveness of our approach. + +# 2 Related Work + +# 2.1 Models for Clinical Data + +With the promising potential of managing medical data, four benchmark tasks were proposed by Harutyunyan et al. (2019) for MIMIC-III (Medical Information Mart for Intensive Care-III) (Johnson et al., 2016) clinical dataset. Most of the previous works with MIMIC-III dataset focus on the structured data (e.g. vital signals with time-series) for prognostic prediction tasks (Choi et al., 2016; Shang et al., 2019) or utilize clinical notes combined with time-series data (Khadanga et al., 2019; Deznabi et al., 2021). Recently, there are approaches focused on clinical notes, adopting pre-trained models such as BERT-based (Alsentzer et al., 2019; Huang et al., 2019a; Golmaei and Luo, 2021; Naik et al., 2022) and XLNet-based (Huang et al., 2020) or utilizing contextualized phenotypic features extracted from clinical notes (Zhang et al., 2022b). + +# 2.2 Graph Neural Networks for Document Classification + +Graph neural networks (Kipf and Welling, 2017; Velicković et al., 2018; Brody et al., 2021) have achieved remarkable success in various deep learning tasks, including text classification. Initially, transductive graphs have been applied to documents, such as TextGCN (Yao et al., 2019). Transductive models have to be retrained for every renewal of the data, which is inefficient and hard to generalize (Yao et al., 2019; Huang et al., 2019b). For inductive document graph learning, word cooccurrence graphs initialize nodes with word embeddings and exploit pairwise interactions between words. TextING (Zhang et al., 2020) employs the gated graph neural networks for document-level graph learning. Following TextGCN (Yao et al., 2019) which applies graph convolutional networks (GCNs) (Kipf and Welling, 2017) in transductive level corpus graph, InducT-GCN (Wang + +et al., 2022) applies GCNs in inductive level where unseen documents are allowed to use. TextSSL (Piao et al., 2022) captures both local and global structural information within graphs. + +However, the density of word co-occurrence graph increases as the document becomes longer, since the fixed-sized sliding windows are used to capture local pairwise edges. In case of hypergraph neural networks, hyperedges connect multiple number of nodes instead of connecting words to words by edges, which alleviates the high density of the text graphs. HyperGAT (Ding et al., 2020) proposes document-level hypergraphs with hyperedges containing sequential and semantic information. HEGEL (Zhang et al., 2022a) applies Transformer-like (Vaswani et al., 2017) multi-head attention to capture high-order cross-sentence relations for effective summarization of long documents. According to the reduced computational complexity for long documents (Figure 2), we adopt hypergraphs to represent patient-level EHRs with clinical notes. Considering issues of existing hypergraph-based methods (Figure 2), we construct multi-level hypergraphs at note-level and taxonomy-level for each patient. The constructed graphs are fed into hierarchical message passing layers to capture rich hierarchical information of the clinical notes, which can augment semantic information for patient representation learning. + +# 3 Method + +# 3.1 Problem Definition + +Our task is to predict in-hospital-mortality for each patient using a set of clinical notes. Given a patient $p \in \mathcal{P}$ with in-hospital-mortality label $y \in \mathcal{V}$ , patient $p$ owns a list of clinical notes $\mathcal{N}_p = [n_1^{t_1}, \dots, n_j^{t_k}, \dots]$ , and each clinical note $n^t \in \mathcal{N}_p$ with taxonomy $t \in \mathcal{T}_p$ contains a sequence of words $\mathcal{W}_{nt} = [w_1^{n^t}, \dots, w_i^{n^t}, \dots]$ , where $j, k$ and $i$ denote the index of clinical note $n$ , taxonomy $t$ and word $w$ of patient $p$ . The set of taxonomies can be represented by $\mathcal{T} = \{t_1, t_2, \dots, t_k, \dots\}$ . + +Our goal is to construct individual multi-level hypergraphs $\mathcal{G}_p$ for each patient $p$ and learn patient-level representation $\mathcal{G}_p$ with the multi-level knowledge by hierarchical message passing layers for in-hospital-mortality prediction task. Since our model is trained by inductive learning, patient $p$ is omitted throughout the paper. + +![](images/cff7da5b0a55d99a0d15703b46d18fb6da5c2ac9cab4c8194889d1d41de84a14.jpg) +Figure 3: Overview of the proposed TM-HGNN. Taxonomy-aware multi-level hypergraphs are fed into the model for hierarchical message passing. $\hat{y}$ denotes the patient-level prediction. + +# 3.2 Multi-Level Hypergraph Construction + +We construct multi-level hypergraphs for patient-level representation learning, which can address the issues that are mentioned in introduction 1. A hypergraph $\mathcal{G}^* = (\mathcal{V},\mathcal{E})$ consists of a set of nodes $\mathcal{V}$ and hyperedges $\mathcal{E}$ where multiple nodes can be connected to single hyperedge $e\in \mathcal{E}$ . A multi-level hypergraph $\mathcal{G} = \{\mathcal{V},\{\mathcal{E}_{\mathcal{N}}\cup \mathcal{E}_{\mathcal{T}}\}\}$ is constructed from patient's clinical notes, where $\mathcal{E}_{\mathcal{N}}$ and $\mathcal{E}_{\mathcal{T}}$ denote note-level and taxonomy-level hyperedges, respectively. A word node $v$ exists in note $n$ with the taxonomy of $t$ can be represented by $\{v\in n,n\in t\}$ . A note-level hyperedge is denoted as $e_n$ and a taxonomy-level hyperedge is denoted as $e_t$ . + +Multi-level Positional Encoding There are three types of entries in the multi-level hypergraph $\mathcal{G}$ , such as word nodes $\nu$ , note-level hyperedges $\mathcal{E}_{\mathcal{N}}$ and taxonomy-level hyperedges $\mathcal{E}_{\mathcal{T}}$ . To distinguish these entries, we propose multi-level positional encoding to introduce more domain-specific meta-information to the hypergraph $\mathcal{G}$ . The function of multi-level positional encoding $\mathrm{MPE}(\cdot)$ can be defined as: + +$$ +\mathbf {M P E} (x) = [ \tau (x), \mathcal {I} _ {\mathcal {W}} (x), \mathcal {I} _ {\mathcal {N}} (x), \mathcal {I} _ {\mathcal {T}} (x) ] \tag {1} +$$ + +where entry $x\in \{\mathcal{V},\mathcal{E}_{\mathcal{N}},\mathcal{E}_{\mathcal{T}}\}$ , and function $\tau :x\mapsto \{0,1,2\}$ maps entry $x$ to a single type among nodes, note-level and taxonomy-level hy + +peredges. Functions $\mathcal{I}_{\mathcal{W}}(\cdot), \mathcal{I}_{\mathcal{N}}(\cdot)$ , and $\mathcal{I}_{\mathcal{T}}(\cdot)$ maps entry $x$ to positions in the word, note and taxonomy-level, respectively. To initialize embedding of node $v$ , we concatenate embedding $\mathrm{MPE}(v)$ from multi-level position encoding and word2vec (Mikolov et al., 2010) pre-trained embedding $\mathbf{z}_v$ . Since shallow word embeddings are widely used to initialize node embeddings in graph-based document representation (Grohe, 2020), we use word2vec (Mikolov et al., 2010) embedding. A word node embedding $\mathbf{h}_v^{(0)}$ is constructed as follows: + +$$ +\mathbf {h} _ {v} ^ {(0)} = \mathbf {M P E} (v) \oplus \mathbf {z} _ {v}, \tag {2} +$$ + +where $\oplus$ denotes concatenation function. + +# 3.2.1 Hyperedge Construction + +To extract multi-level information of patient-level representation using clinical notes, we construct patient hypergraphs with two types of hyperedges, one at the note-level hyperedge $\mathcal{E}_{\mathcal{N}}$ and the other at the taxonomy-level hyperedge $\mathcal{E}_{\mathcal{T}}$ . A word node $v$ in note $n$ with taxonomy $t$ is assigned to one note-level hyperedge $e_n$ and one taxonomy-level hyperedge $e_t$ , which can be defined as: + +$$ +\mathcal {E} (v) = \left\{e _ {n}, e _ {t} \mid v \in n, n \in t \right\} \tag {3} +$$ + +Note-level Hyperedges We adopt linear embedding function $f_{n}$ and obtain the index embedding + +using $\mathcal{I}_{\mathcal{N}}(n)$ . To preserve time-dependent sequential information of clinical note $n$ , we simply add time information $\mathbf{t}(n)$ to the embedding. Then initial embedding of note-level hyperedge $h_{e_n}^{(0)}$ with MPE(\cdot) can be defined as: + +$$ +\mathbf {h} _ {e _ {n}} ^ {(0)} = \mathbf {M P E} (n) \oplus f _ {n} ^ {\theta} \left(\mathcal {I} _ {\mathcal {N}} (n), \mathbf {t} (n)\right), \tag {4} +$$ + +where $\theta \in \mathbb{R}^{d\times d}$ denotes the parameter matrix of function $f_{n}$ . Notably, we set the value of word index $\mathcal{I}_{\mathcal{W}}(n)$ as -1 since the note $n$ represents higher level information than word $v$ . + +Taxonomy-level Hyperedges Taxonomy-level hyperedges $e_t$ are constructed by taxonomy index $\mathcal{I}_{\mathcal{T}}(t)$ through linear layers $f_t$ concatenated with MPE $(\cdot)$ function, which can be defined as: + +$$ +\mathbf {h} _ {e _ {t}} ^ {(0)} = \mathbf {M P E} (t) \oplus f _ {t} ^ {\theta} (\mathcal {I} _ {\mathcal {T}} (t)), \tag {5} +$$ + +where $\theta \in \mathbb{R}^{d\times d}$ denotes the parameter matrix of function $f_{t}$ . Like note-level hyperedge, we set $\mathcal{I}_{\mathcal{W}}(t)$ and $\mathcal{I}_{\mathcal{N}}(t)$ as -1 since the level of taxonomy $t$ is higher than the levels of note and word. + +# 3.3 Hierarchical Message Passing + +To leverage the characteristics of two types of hyperedges, we propose a hierarchical hypergraph convolutional networks, composed of three layers that allow message passing from different types of hyperedges. In general, we define message passing functions for nodes and hyperedges as follows: + +$$ +\mathcal {F} _ {\mathcal {W}} (\mathrm {h}, \mathcal {E}, \theta) = \sigma \left(\theta \left(\sum_ {u \in \mathcal {E} (v)} \frac {1}{\sqrt {\hat {d} _ {v}} \sqrt {\hat {d} _ {u}}} \mathrm {h} _ {u}\right)\right), \tag {6} +$$ + +$$ +\mathcal {F} _ {\tau} (\mathrm {h}, \mathcal {V} ^ {\tau}, \theta) = \sigma \left(\theta \left(\sum_ {z \in \mathcal {V} ^ {\tau} (e)} \frac {1}{\sqrt {\hat {d} _ {e}} \sqrt {\hat {d} _ {z}}} \mathrm {h} _ {z}\right)\right), \tag {7} +$$ + +where $\mathcal{F}_{\mathcal{W}}$ denotes message passing function for word nodes and $\mathcal{F}_{\tau}$ denotes message passing function for hyperedges with type $\tau \in \{1,2\}$ , i.e., note-level hyperedges and taxonomy-level hyperedges, respectively. Function $\mathcal{F}_{\mathcal{W}}$ updates word node embedding $\mathrm{h}_v$ by aggregating embeddings of connected hyperedges $\mathcal{E}(v)$ . Function $\mathcal{F}_{\tau}$ updates hyperedge embedding $\mathrm{h}_e$ by aggregating embeddings of connected word nodes $\mathcal{V}^{\tau}(e)$ . $\sigma$ is the nonlinear activation function such as ReLU, $\theta \in \mathbb{R}^{d\times d}$ is the weight matrix with dimension $d$ which can be differently assinged and learned at multiple levels. + +Then we can leverage these defined functions to conduct hierarchical message passing learning at the note level and at the taxonomy level. + +
Statistics
# of patients17,927
# of ICU stays21,013
# of in-hospital survival18,231
# of in-hospital mortality2,679
# of notes per ICU stay13.29 (7.84)
# of words per ICU stay1,385.62 (1,079.57)
# of words per note104.25 (66.82)
# of words per taxonomy474.75 (531.42)
+ +Table 1: Statistics of the MIMIC-III clinical notes. Averaged numbers are reported with standard deviation. + +Initialization Layer Due to the complex structure of the clinical notes, the initial multi-level hypergraph constructed for each patient has a large variance. To prevent falling into local optima in advance, we first use an initialization layer to pre-train the entries of hypergraphs by learning the entire patient graph structure. In this layer, message passing functions are applied to all word nodes $v \in \mathcal{V}$ and hyperedges $e \in \mathcal{E}_{\mathcal{I}} = \{\mathcal{E}_{\mathcal{N}} \cup \mathcal{E}_{\mathcal{T}}\}$ . Thus, embeddings of node $v$ , hyperedges $e_{n}$ and $e_{t}$ at both levels can be defined as: + +$$ +h _ {I} (v) = \mathcal {F} _ {\mathcal {W}} \left(h _ {v} ^ {(0)}, \mathcal {E} _ {\mathcal {I}} (v), \theta_ {I}\right), \tag {8} +$$ + +$$ +h _ {I} \left(e _ {n}\right) = \mathcal {F} _ {\tau} \left(h _ {e _ {n}} ^ {(0)}, \mathcal {V} ^ {\tau} \left(e _ {n}\right), \theta_ {I}\right), \tau = 1 \tag {9} +$$ + +$$ +h _ {I} \left(e _ {t}\right) = \mathcal {F} _ {\tau} \left(h _ {e _ {t}} ^ {(0)}, \mathcal {V} ^ {\tau} \left(e _ {t}\right), \theta_ {I}\right), \tau = 2 \tag {10} +$$ + +Note-level Message Passing Layer Then we apply note-level message passing layer on hypergraphs with only word nodes $v \in \mathcal{V}$ and note-level hyperedges $e_n \in \mathcal{E}_{\mathcal{N}}$ , and the taxonomy-level hyperedges are masked during message passing. In this layer, the word nodes can only interact with note-level hyperedges, which can learn the intranote local information. + +$$ +h _ {N} (v) = \mathcal {F} _ {\mathcal {W}} \left(h _ {I} (v), \mathcal {E} _ {\mathcal {N}} (v), \theta_ {N}\right), \tag {11} +$$ + +$$ +h _ {N} \left(e _ {n}\right) = \mathcal {F} _ {\tau} \left(h _ {I} \left(e _ {n}\right), \mathcal {V} ^ {\tau} \left(e _ {n}\right), \theta_ {N}\right), \tau = 1, \tag {12} +$$ + +$$ +h _ {N} \left(e _ {t}\right) = h _ {I} \left(e _ {t}\right) \tag {13} +$$ + +Taxonomy-level Message Passing Layer The last layer is the taxonomy-level message passing layer, where all word nodes $v \in \mathcal{V}$ and taxonomy-level hyperedges $e_t \in \mathcal{E}_{\mathcal{T}}$ can be updated. In this layer, we block the hyperedges at the note level. The node representations with note-level information are fused with taxonomy information + +via taxonomy-level hyperedges, which can assemble the intra-taxonomy related words to augment semantic information. + +$$ +h _ {T} (v) = \mathcal {F} _ {\mathcal {W}} \left(h _ {N} (v), \mathcal {E} _ {\mathcal {T}} (v), \theta_ {T}\right), \tag {14} +$$ + +$$ +h _ {T} \left(e _ {n}\right) = h _ {N} \left(e _ {n}\right), \tag {15} +$$ + +$$ +h _ {T} \left(e _ {t}\right) = \mathcal {F} _ {\tau} \left(h _ {N} \left(e _ {t}\right), \mathcal {V} ^ {\tau} \left(e _ {t}\right), \theta_ {T}\right), \tau = 2 \tag {16} +$$ + +# 3.3.1 Patient-Level Hypergraph Classification + +After all aforementioned hierarchical message passing layers, node and hyperedge embeddings $h_T(v), h_T(e_n), h_T(e_t) \in \mathbf{H}_T$ follow mean-pooling operation which summarizes patient-level embedding $z$ , which is finally fed into sigmoid operation as follows: + +$$ +\hat {y} = \operatorname {s i g m o i d} (z) \tag {17} +$$ + +where $\hat{y}$ denotes the probability of the predicted label for in-hospital-mortality of the patient. The loss function for patient-level classification is defined as the binary cross-entropy loss: + +$$ +\mathcal {L} = - (y \times \log \hat {y} + (1 - y) \times \log (1 - \hat {y})) \tag {18} +$$ + +where $y$ denotes the true label for in-hospital-mortality. The proposed network, TM-HGNN, can be trained by minimizing the loss function. + +# 4 Experimental Settings + +# 4.1 Dataset + +We use clinical notes from the Medical Information Mart for Intensive Care III (MIMIC-III) (Johnson et al., 2016) dataset, which are written within 48 hours from the ICU admission. For quantitative evaluation, we follow Harutyunyan et al.'s (2019) benchmark setup for data pre-processing and train/test splits, then randomly divide $20\%$ of train set as validation set. All patients without any notes are dropped during the data preparation. To prevent overfitting into exceptionally long clinical notes for a single patient, we set the maximum number of notes per patient into 30 from the first admission. Table 1 shows the statistics of preprocessed MIMIC-III clinical note dataset for our experiments. We select top six taxonomies for experiments, since the number of notes assigned to each taxonomy differs in a wide range (Appendix B Table 3). In addition, we select two chronic diseases, hypertension and diabetes, to compare prediction results for patients with each disease. + +# 4.2 Compared Methods + +In our experiments, the compared baseline methods for end-to-end training are as follows: + +- Word-based methods: word2vec (Mikolov et al., 2013) with multi-layer perceptron classifier, and FastText (Joulin et al., 2017). +- Sequence-based methods: TextCNN (Kim, 2014), Bi-LSTM (Hochreiter and Schmidhuber, 1997), and Bi-LSTM with additional attention layer (Zhou et al., 2016). +- Graph-based methods: TextING (Zhang et al., 2020), InducT-GCN (Wang et al., 2022), and HyperGAT (Ding et al., 2020). In particular, HyperGAT represents hypergraph-based method, and the other graph-based methods employ word co-occurrence graphs. + +# 4.3 Implementation Details + +TM-HGNN is implemented by PyTorch (Paszke et al., 2019) and optimized with Adam (Kingma and Ba, 2015) optimizer with learning rate 0.001 and dropout rate 0.3. We set hidden dimension $d$ of each layer to 64 and batch size to 32 by searching parameters. We train models for 100 epochs with early-stopping strategy, where the epoch of 30 shows the best results. All experiments are trained on a single NVIDIA GeForce RTX 3080 GPU. + +# 5 Results + +Since the dataset has imbalanced class labels for in-hospital mortality as shown in Table 1, we use AUPRC (Area Under the Precision-Recall Curve) and AUROC (Area Under the Receiver Operating Characteristic Curve) for precise evaluation. It is suggested by Davis and Goadrich (2006) to use AUPRC for imbalanced class problems. + +# 5.1 Classification Performance + +Table 2 shows performance comparisons of TM-HGNN and baseline methods. Sequence-based methods outperform word-based methods, which indicates capturing local dependencies between neighboring words benefits patient document classification. Moreover, all graph-based methods outperform sequence-based and word-based methods. This demonstrates ignoring sequential information of words is not detrimental to clinical notes. Furthermore, hypergraphs are more effective than previous word co-occurrence graphs, indicating that + +
CategoriesModelsWholeHypertensionDiabetes
AUPRCAUROCAUPRCAUROCAUPRCAUROC
Word-basedWord2vec + MLP13.49 ± 1.6856.65 ± 5.1216.82 ± 1.7853.56 ± 4.2018.15 ± 1.4251.94 ± 3.40
FastText17.06 ± 0.0862.37 ± 0.1125.56 ± 0.2862.39 ± 0.1831.33 ± 0.3367.59 ± 0.20
Sequence-basedBi-LSTM17.67 ± 4.1958.75 ± 5.7821.75 ± 5.2557.39 ± 6.1127.52 ± 7.5761.86 ± 8.38
Bi-LSTM w/ Att.17.96 ± 0.6162.63 ± 1.3126.05 ± 1.8063.24 ± 1.5733.01 ± 3.5368.89 ± 1.58
TextCNN20.34 ± 0.6768.25 ± 0.5427.10 ± 1.8266.10 ± 1.2036.89 ± 2.5471.83 ± 1.69
Graph-basedTextING34.50 ± 7.7978.20 ± 4.2736.63 ± 8.3080.12 ± 4.0536.13 ± 8.6680.28 ± 3.84
InducT-GCN43.03 ± 1.9682.23 ± 0.7241.06 ± 2.9585.56 ± 1.2440.59 ± 3.0784.42 ± 1.45
HyperGraph-basedHyperGAT44.42 ± 1.9684.00 ± 0.8442.32 ± 1.7886.41 ± 1.0140.08 ± 2.4585.03 ± 1.20
T-HGNN (Ours)45.85 ± 1.9184.29 ± 0.3143.53 ± 2.0187.07 ± 0.6440.47 ± 2.2985.48 ± 0.92
TM-HGNN (Ours)48.74 ± 0.6084.89 ± 0.4247.27 ± 1.2187.75 ± 0.5442.22 ± 1.2585.86 ± 0.73
+ +Table 2: Classification performance comparison on patient-level clinical tasks, evaluated with AUPRC and AUROC in percentages. We report averaged results with standard deviation over 10 random seeds. Values in boldface denote the best results. + +![](images/ee866636e2677c1964d93ac96fd0fbec1825b0201fd3558f0c834c6054338798.jpg) +Figure 4: Prediction results of TextING, HyperGAT, and TM-HGNN for three patient-level clinical note groups divided by length (short, medium, and long). AUPRC and AUROC are used for evaluation. + +![](images/767cfb86380328409374a46d65ca3b1c4fed261940be6c7f2b870eaae490b1d4.jpg) +Figure 5: Performance results of ablation studies. The effectiveness of the multi-level hypergraph and hierarchical message passing in the proposed model TM-HGNN are validated respectively. + +it is crucial to extract high-order relations within clinical notes. In particular, as TM-HGNN outperforms HyperGAT (Ding et al., 2020), exploiting taxonomy-level semantic information which represents the medical context of the notes aids precise prediction in patient-level. Another advantage of our model, which captures multi-level high order relations from note-level and taxonomy-level with hierarchy, can be verified by the results in Table 2 where TM-HGNN outperforms T-HGNN. T-HGNN indicates the variant of TM-HGNN, which considers note-level and taxonomy-level hyperedges homogeneous. Likewise, results from hypertension and diabetes patient groups show similar tendencies in overall. + +# 5.2 Robustness to Lengths + +To evaluate the performance dependencies to lengths, we divide clinical notes in patient-level into three groups by lengths, which are short, medium, and long (Appendix B, Figure 8). For test set, the number of patients is 645, 1,707, and + +856 for short, medium, and long group each, and the percentage of mortality is $6.98\%$ , $10.72\%$ , and $15.89\%$ for each group, which implies patients in critical condition during ICU stays are more likely to have long clinical notes. Figure 4 shows performance comparisons for three divided groups with TextING (Zhang et al., 2020) which utilizes word co-occurrence graph, HyperGAT (Ding et al., 2020), a ordinary hypergraph based approach, and our multi-level hypergraph approach (TM-HGNN). All three models were more effective to longer clinical notes, which demonstrates graph based models are robust to long document in general. Among the three models, our proposed TM-HGNN mostly performs the best and HyperGAT (Ding et al., 2020) follows, and then TextING (Zhang et al., 2020). The results demonstrate that our TM-HGNN, which exploits taxonomy-level semantic information, is most effective for clinical notes regardless of the lengths, compared to other graph-based approaches. + +![](images/53d795a51841d8b8eafb76e76e3a7777765804834e51eb6e27aca3f73f4fb43f.jpg) +Figure 6: PCA results of learned node representations from each layer of TM-HGNN, for patient case HADM_ID=147702. "Rhythm" and "fibrillation" from ECG, "rhythm" and "benadryl" from Nursing/other taxonomy are highlighted. (a) Input word node embeddings. (b) Initialized node embeddings from the first layer. (c) After second layer, note-level message passing. (d) Final node embeddings from TM-HGNN, after taxonomy-level message passing. Word node embeddings are aligned with the same taxonomy words. + +![](images/77e017610e2d1f78bdefc3ae3406d910eec76ca3dbcd3ad597bf61b4c642d924.jpg) +Figure 7: PCA results of learned node representations from HyperGAT (a) and TM-HGNN (b). "Rhythm" and "fibrillation" from ECG, "rhythm" and "benadryl" from Nursing/other taxonomy are highlighted. + +# 5.3 Ablation Study + +Effect of Multi-level Hypergraph In order to validate the effect of multi-level hypergraphs, we ignore taxonomy-level and note-level hyperedges respectively. w/o taxonomy, which ignores taxonomy-level hyperedges, deteriorates the performance most significantly. w/o note shows degraded performance as well. Thus, effectiveness of multi-level hypergraph construction for patient representation learning can be verified (Figure 5). + +Effect of Hierarchical Message Passing Figure 5 demonstrates that hierarchical message passing (note-level to taxonomy-level) for multi-level hypergraphs is effective than learning without hierarchies, since w/o hierarchy shows inferior performance compared to TM-HGNN. w/o hierarchy represents T-HGNN from Table 2, which consid + +ers every hyperedge as homogeneous. Degraded performance from $w/o$ initialization shows the effectiveness of the initialization layer before hierarchical message passing, which indicates that pretraining on the entire multi-level hypergraphs first benefits the patient-level representation learning. + +# 5.4 Case Study + +Hierarchical Message Passing We visualize the learned node representations based on principal component analysis (PCA) (Jolliffe, 2002) results, as hierarchical message passing continues in TM-HGNN. In Figure 6(a), "rhythm" from ECG and Nursing/other taxonomy are mapped closely for initial word embeddings, since they are literally same words. As the patient-level hypergraphs are fed into a global-level, note-level, and taxonomy-level convolutional layers in order, words in the same taxonomies assemble, which can be found in Figure 6(b), (c), and (d). As a result, "rhythm" of ECG represents different semantic meanings from "rhythm" of Nursing/other, as it is learned considerably close to "fibrillation" from the same taxonomy. + +Importance of Taxonomy-level Semantic Information To investigate the importance of taxonomy-level semantic information extraction, we visualize PCA results of the learned node embeddings from the baseline method and the proposed TM-HGNN. We select patient with hospital admission id (HADM_ID) 147702 for case study since TM-HGNN successfully predicts the true label for in-hospital-mortality, which is pos + +itive, but the other baseline methods show false negative predictions. As in Figure 7, HyperGAT learns "rhythm" without taxonomy-level semantic information, since it is not assembled with other words in the same taxonomy. But TM-HGNN separately learns "rhythm" from ECG and "rhythm" from Nursing/other based on different contexts, which results in same taxonomy words aligned adjacently, such as "fibrillation" of ECG and "benadryl" of Nursing/other. Therefore, in case of TM-HGNN, frequently used neutral word "rhythm" from ECG with a word "fibrillation" means an irregular "rhythm" of the heart and is closely related to mortality of the patient, but "rhythm" from Nursing/other with another nursing term remains more neutral. This phenomenon demonstrates that contextualizing taxonomy to frequent neutral words enables differentiation and reduces ambiguity of the frequent neutral words (e.g. "rhythm"), which is crucial to avoid false negative predictions on patient-level representation learning. + +# 6 Conclusion + +In this paper, we propose a taxonomy-aware multi-level hypergraph neural networks, TM-HGNN, a novel approach for patient-level clinical note representation learning. We employ hypergraph-based approach and introduce multi-level hyperedges (note and taxonomy-level) to address long and complex information of clinical notes. TM-HGNN aims to extract high-order semantic information from the multi-level patient hypergraphs in hierarchical order, note-level and then taxonomy-level. Clinical note representations can be effectively learned in an end-to-end manner with TM-HGNN, which is validated from extensive experiments. + +# Limitations + +Since our approach, TM-HGNN, aggregates every note during ICU stays for patient representation learning, it is inappropriate for time-series prediction tasks (e.g. vital signs). We look forward to further study that adopts and applies our approach to time-series prediction tasks. + +# Ethics Statement + +In MIMIC-III dataset (Johnson et al., 2016), every patient is deidentified, according to Health Insurance Portability and Accountability Act (HIPAA) standards. The fields of data which can identify the + +patient, such as patient name and address, are completely removed based on the identifying data list provided in HIPAA. In addition, the dates for ICU stays are shifted for randomly selected patients, preserving the intervals within data collected from each patient. Therefore, the personal information for the patients used in this study is strictly kept private. More detailed information about deidentification of MIMIC-III can be found in Johnson et al. (2016). + +# Acknowledgements + +This work was supported by Institute of Information & communications Technology Planning & Evaluation (IITP) grant funded by the Korea government (MSIT) [NO.2021-0-01343, Artificial Intelligence Graduate School Program (Seoul National University)] and the Bio & Medical Technology Development Program of the National Research Foundation (NRF) funded by the Ministry of Science & ICT (RS-2023-00257479), and the ICT at Seoul National University provides research facilities for this study. + +# References + +Emily Alsentzer, John R Murphy, Willie Boag, WeiHung Weng, Di Jin, Tristan Naumann, WA Redmond, and Matthew BA McDermott. 2019. Publicly available clinical bert embeddings. *NAACL HLT* 2019, page 72. +Shaked Brody, Uri Alon, and Eran Yahav. 2021. How attentive are graph attention networks? In International Conference on Learning Representations. +Edward Choi, Mohammad Taha Bahadori, Jimeng Sun, Joshua Kulas, Andy Schuetz, and Walter Stewart. 2016. Retain: An interpretable predictive model for healthcare using reverse time attention mechanism. Advances in neural information processing systems, 29. +Jesse Davis and Mark Goadrich. 2006. The relationship between precision-recall and roc curves. In Proceedings of the 23rd International Conference on Machine Learning, ICML '06, page 233-240, New York, NY, USA. Association for Computing Machinery. +Iman Deznabi, Mohit Iyyer, and Madalina Fiterau. 2021. Predicting in-hospital mortality by combining clinical notes with time-series data. In *Findings of the Association for Computational Linguistics: ACL-IJCNLP* 2021, pages 4026-4031. +Kaize Ding, Jianling Wang, Jundong Li, Dingcheng Li, and Huan Liu. 2020. Be more with less: Hypergraph attention networks for inductive text classification. + +In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 4927-4936. +Sara Nouri Golmaei and Xiao Luo. 2021. Deepnote-gnn: predicting hospital readmission using clinical notes and patient network. In Proceedings of the 12th ACM Conference on Bioinformatics, Computational Biology, and Health Informatics, pages 1-9. +Martin Grohe. 2020. Word2vec, node2vec, graph2vec, x2vec: Towards a theory of vector embeddings of structured data. In Proceedings of the 39th ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database Systems, PODS'20, page 1-16, New York, NY, USA. Association for Computing Machinery. +Hrayr Harutyunyan, Hrant Khachatrian, David C Kale, Greg Ver Steeg, and Aram Galstyan. 2019. Multitask learning and benchmarking with clinical time series data. Scientific data, 6(1):1-18. +Sepp Hochreiter and Jürgen Schmidhuber. 1997. Long short-term memory. Neural computation, 9(8):1735-1780. +Kexin Huang, Jaan Altosaar, and Rajesh Ranganath. 2019a. Clinicalbert: Modeling clinical notes and predicting hospital readmission. arXiv preprint arXiv:1904.05342. +Kexin Huang, Abhishek Singh, Sitong Chen, Edward Moseley, Chih-Ying Deng, Naomi George, and Charolotta Lindvall. 2020. Clinical xlnet: Modeling sequential clinical notes and predicting prolonged mechanical ventilation. In Proceedings of the 3rd Clinical Natural Language Processing Workshop, pages 94-100. +Lianzhe Huang, Dehong Ma, Sujian Li, Xiaodong Zhang, and Houfeng Wang. 2019b. Text level graph neural network for 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 3444-3450. +Alistair EW Johnson, Tom J Pollard, Lu Shen, Li-wei H Lehman, Mengling Feng, Mohammad Ghassemi, Benjamin Moody, Peter Szolovits, Leo Anthony Celi, and Roger G Mark. 2016. Mimic-iii, a freely accessible critical care database. Scientific data, 3(1):1-9. +Ian T Jolliffe. 2002. Principal component analysis. Wiley. +Armand Joulin, Édouard Grave, Piotr Bojanowski, and Tomáš Mikolov. 2017. Bag of tricks for efficient text classification. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 2, Short Papers, pages 427-431. + +Swaraj Khadanga, Karan Aggarwal, Shafiq Joty, and Jaideep Srivastava. 2019. Using clinical notes with time series data for icu management. 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 6432-6437. +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. +Diederik P Kingma and Jimmy Ba. 2015. Adam: A method for stochastic optimization. In ICLR (Poster). +Thomas N. Kipf and Max Welling. 2017. Semi-supervised classification with graph convolutional networks. In International Conference on Learning Representations. +Yikuan Li, Ramsey M Wehbe, Faraz S Ahmad, Hanyin Wang, and Yuan Luo. 2023. A comparative study of pretrained language models for long clinical text. Journal of the American Medical Informatics Association, 30(2):340-347. +Pengfei Liu, Xipeng Qiu, and Xuanjing Huang. 2016. Recurrent neural network for text classification with multi-task learning. In *IJCAI*. +Tomáš Mikolov, Martin Karafiát, Lukáš Burget, Jan Černocký, and Sanjeev Khudanpur. 2010. Recurrent neural network based language model. In Eleventh annual conference of the international speech communication association. +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, volume 26. Curran Associates, Inc. +Aakanksha Naik, Sravanthi Parasa, Sergey Feldman, Lucy Wang, and Tom Hope. 2022. Literature-augmented clinical outcome prediction. In *Findings of the Association for Computational Linguistics: NAACL* 2022, pages 438-453. +Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. 2019. Pytorch: An imperative style, high-performance deep learning library. Advances in neural information processing systems, 32. +Yinhua Piao, Sangseon Lee, Dohoon Lee, and Sun Kim. 2022. Sparse structure learning via graph neural networks for inductive document classification. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pages 11165-11173. + +Junyuan Shang, Cao Xiao, Tengfei Ma, Hongyan Li, and Jimeng Sun. 2019. Gamenet: Graph augmented memory networks for recommending medication combination. In proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 1126-1133. + +Kai Sheng Tai, Richard Socher, and Christopher D Manning. 2015. Improved semantic representations from tree-structured long short-term memory networks. 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 1556–1566. + +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. Advances in neural information processing systems, 30. + +Petar Velicković, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. 2018. Graph attention networks. In International Conference on Learning Representations. + +Kunze Wang, Soyeon Caren Han, and Josiah Poon. 2022. Induct-gcn: Inductive graph convolutional networks for text classification. arXiv preprint arXiv:2206.00265. + +Liang Yao, Chengsheng Mao, and Yuan Luo. 2019. Graph convolutional networks for text classification. In Proceedings of the AAAI conference on artificial intelligence, volume 33, pages 7370-7377. + +Haopeng Zhang, Xiao Liu, and Jiawei Zhang. 2022a. Hegel: Hypergraph transformer for long document summarization. arXiv preprint arXiv:2210.04126. + +Jingqing Zhang, Luis Daniel Bolanos Trujillo, Ashwani Tanwar, Julia Ive, Vibhor Gupta, and Yike Guo. 2022b. Clinical utility of automatic phenotype annotation in unstructured clinical notes: intensive care unit use. BMJ Health & Care Informatics, 29(1):e100519. + +Xiang Zhang, Junbo Zhao, and Yann LeCun. 2015. Character-level convolutional networks for text classification. Advances in neural information processing systems, 28:649-657. + +Yufeng Zhang, Xueli Yu, Zeyu Cui, Shu Wu, Zhongzhen Wen, and Liang Wang. 2020. Every document owns its structure: Inductive text classification via graph neural networks. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 334-339. + +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. + +# A Detailed Statistics of MIMIC-III Clinical Notes + +Table 3 shows the number of clinical notes assigned to 15 predefined taxonomies in MIMIC-III dataset. Since the number of notes varies in a wide range for each taxonomy, we select top six taxonomies for experiments: Radiology, ECG, Nursing/other, Echo, Nursing, and Physician. + +Figure 8 shows histogram for the number of words per patient-level clinical notes in train set. Since 682, 1,070, and 1,689 are the first, second, and third quantile of the train data, we select 600 and 1,600 as the boundaries to divide test set into 3 groups (short, medium, and long), which is used to validate proposed TM-HGNN's robustness to lengths. + +# B Node Representations from Other Methods + +Figure 9 shows PCA results of learned node representations from three different models. According to Figure 9(a) and 9(b), word co-occurrence graphs (TextING) and homogeneous single-level hypergraphs (HyperGAT) show node representations ambiguous to discriminate by taxonomies, since every taxonomy has been shuffled. In Figure 9(c), node embeddings are aligned adjacently and arranged with similar pattern for the same taxonomies. This verifies the effectiveness of the proposed TM-HGNN which captures intra- and intertaxonomy semantic word relations for patient-level representation learning. Example words (voltage, lvef, benadryl, and obliteration) which are generally used in each taxonomy are shown in Figure 9 to emphasize that the keywords from each taxonomy are learned adjacently to words similar in context within taxonomies in case of TM-HGNN, but not for other methods. + +# C Explanation of the Medical Terms + +- Fibrillation : Fibrillation refers to rapid and irregular contractions of the muscle fibers, especially from the heart. It can lead to serious heart conditions. + +- Benadryl : Brand name for the drug Diphenhydramine, which is an antihistamine. Benadryl is one of the over-the-counter drugs, and generally used for alleviating the allergic symptoms. + +![](images/48174599ebba64f86ca59ca6e316834ef318b6cdf9b28ed6714fe2dc63735f82.jpg) +Figure 8: Histogram for the length of patient-level clinical notes in train set. 600 and 1,600 are selected as boundaries to divide clinical notes into three groups (short, medium, and long). + +
# of Notes
Radiology17,466
ECG16,410
Nursing/other12,347
Echo7,935
Nursing3,562
Physician3,545
Respiratory2,024
Nutrition1,270
General1,135
Discharge Summary608
Rehab Services594
Social Work424
Case Management162
Consult19
Pharmacy14
+ +- Lvef : Abbreviation of left ventricular ejection fraction, which is the ratio of stroke volume to end-diastolic volume. Lvef is known as the central measure for the diagnosis and management of heart failure. +- Obliteration: In Radiology, obliteration refers to the disappearance of the contour of an organ, due to the same x-ray absorption from the adjacent tissue. + +# D Additional Performance Comparison + +We conduct additional experiments using LSTM based on 17 code features selected by Johnson et al. (2016), and Transformer-based ClinicalXL-Net (Huang et al., 2020) without pre-training for in-hospital mortality prediction. Table 4 shows that + +Table 3: The number of clinical notes for 15 predefined taxonomies in MIMIC-III dataset. + +
ModelsAUPRCAUROC
LSTM (code features)39.8681.98
ClinicalXLNet (w/o pretrain)16.7762.16
TM-HGNN (Ours)48.7484.89
+ +Table 4: Classification performance comparison on patient-level in-hospital-mortality prediction task, evaluated with AUPRC and AUROC in percentages. Values in boldface denote the best results. + +
ModelsAUROCF1
Clinical-Longformer0.7620.484
TM-HGNN (Ours)0.8470.462
+ +Table 5: Classification performance comparison on patient-level acute kidney injury prediction task, evaluated with AUROC and F1 score. Values in boldface denote the best results. + +TM-HGNN outperforms approaches using structured data and Transformer-based model without pre-training. + +In addition, we train our model on acute kidney injury prediction task (MIMIC-AKI) following Li et al. (2023). Table 5 shows comparative results of our TM-HGNN to Clinical-Longformer (Li et al., 2023) that justify TM-HGNN can effectively utilize high-order semantics from long clinical notes, with much less computational burden compared to long sequence transformer models. + +![](images/554c2b42bcea46b0e63db373382c4a804de58245b61fc3b3eed80afef4150c57.jpg) +Figure 9: PCA results of learned node representations for patient case HADM_ID=147702, compared with baseline methods. (a) Final node embeddings from TextING. (b) Final node embeddings from HyperGAT. (c) Final node embeddings from the proposed TM-HGNN. + +![](images/0cf6f5efc10c90e3ab26bc609fdbcbb970f639627668804ce6497b16b00694a1.jpg) + +![](images/dfaa64e8f76c12fa9093c3808a86d611e1bb20eae74dffc6effb24a38b76c070.jpg) + +A For every submission: + +A1. Did you describe the limitations of your work? + +Section "Limitations" + +A2. Did you discuss any potential risks of your work? + +Section "Ethics Statement" + +A3. Do the abstract and introduction summarize the paper's main claims? + +Section "Introduction" + +A4. Have you used AI writing assistants when working on this paper? + +Left blank. + +B Did you use or create scientific artifacts? + +Section 4 + +B1. Did you cite the creators of artifacts you used? + +Section 4.1, Section 4.2 + +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? + +Section 4.1 + +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +Section 4.2 + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? + +Section "Ethics Statement" + +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? + +Section 4.1 + +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. + +Section 4.1 + +C Did you run computational experiments? + +Section 4 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +Section 4.3 + +The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? Section 4.3 +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? Section 5.1, Section 5.2, Section 5.3 +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? Section 3.2, Section 4.1 + +# D Did you use human annotators (e.g., crowdworkers) or research with human participants? Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? Not applicable. Left blank. +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? Not applicable. Left blank. +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? Not applicable. Left blank. +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? Not applicable. Left blank. +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? Not applicable. Left blank. \ No newline at end of file diff --git a/clinicalnoteownsitshierarchymultilevelhypergraphneuralnetworksforpatientlevelrepresentationlearning/images.zip b/clinicalnoteownsitshierarchymultilevelhypergraphneuralnetworksforpatientlevelrepresentationlearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..f0184906eda7f3a8d41bdc2179b7bbafcf4cbdf3 --- /dev/null +++ b/clinicalnoteownsitshierarchymultilevelhypergraphneuralnetworksforpatientlevelrepresentationlearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8dd01f7e4d371174380659b4cb804e3a52c9eb2eb5863d9e577c5300ab8cfdf7 +size 688644 diff --git a/clinicalnoteownsitshierarchymultilevelhypergraphneuralnetworksforpatientlevelrepresentationlearning/layout.json b/clinicalnoteownsitshierarchymultilevelhypergraphneuralnetworksforpatientlevelrepresentationlearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..2d0c45691d944814ffec4ee6aab46cc7ccd6c062 --- /dev/null +++ b/clinicalnoteownsitshierarchymultilevelhypergraphneuralnetworksforpatientlevelrepresentationlearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:badb5a305a54809ae102731af48d4fb8145acc812b28330e36ddf111198d4f95 +size 475980 diff --git a/cmotcrossmodalmixupviaoptimaltransportforspeechtranslation/9325341a-3f02-4de7-ad5f-5472c0fdde61_content_list.json b/cmotcrossmodalmixupviaoptimaltransportforspeechtranslation/9325341a-3f02-4de7-ad5f-5472c0fdde61_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..1aecda698d305237f903dc7e3f676dee5ad42706 --- /dev/null +++ b/cmotcrossmodalmixupviaoptimaltransportforspeechtranslation/9325341a-3f02-4de7-ad5f-5472c0fdde61_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a90398f877a85b3af0d3959175fcc4768938a9e565cd33f103b5f0cb1aa68e2 +size 105136 diff --git a/cmotcrossmodalmixupviaoptimaltransportforspeechtranslation/9325341a-3f02-4de7-ad5f-5472c0fdde61_model.json b/cmotcrossmodalmixupviaoptimaltransportforspeechtranslation/9325341a-3f02-4de7-ad5f-5472c0fdde61_model.json new file mode 100644 index 0000000000000000000000000000000000000000..770d6e78eee5175033a4ec69cacbdb925ce4df17 --- /dev/null +++ b/cmotcrossmodalmixupviaoptimaltransportforspeechtranslation/9325341a-3f02-4de7-ad5f-5472c0fdde61_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6d245de4743aa99858dc85c92232c04ad5e35b3d18a8e5c71c948c4b5083290b +size 131100 diff --git a/cmotcrossmodalmixupviaoptimaltransportforspeechtranslation/9325341a-3f02-4de7-ad5f-5472c0fdde61_origin.pdf b/cmotcrossmodalmixupviaoptimaltransportforspeechtranslation/9325341a-3f02-4de7-ad5f-5472c0fdde61_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..bded4d94fddc9c5829177e74c2716d0639c0fa18 --- /dev/null +++ b/cmotcrossmodalmixupviaoptimaltransportforspeechtranslation/9325341a-3f02-4de7-ad5f-5472c0fdde61_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e104f84496209d58a6c3470365b703d90a09a376aea5bbd7f2643c22454637c0 +size 728019 diff --git a/cmotcrossmodalmixupviaoptimaltransportforspeechtranslation/full.md b/cmotcrossmodalmixupviaoptimaltransportforspeechtranslation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..1a5c307fbaf3510e1d6b876a9bf393ee97ae372b --- /dev/null +++ b/cmotcrossmodalmixupviaoptimaltransportforspeechtranslation/full.md @@ -0,0 +1,511 @@ +# CMOT: Cross-modal Mixup via Optimal Transport for Speech Translation + +Yan Zhou $^{1}$ , Qingkai Fang $^{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 + +2001zhouyan@gmail.com, {fangqingkai21b, fengyang}@ict.ac.cn + +# Abstract + +End-to-end speech translation (ST) is the task of translating speech signals in the source language into text in the target language. As a cross-modal task, end-to-end ST is difficult to train with limited data. Existing methods often try to transfer knowledge from machine translation (MT), but their performances are restricted by the modality gap between speech and text. In this paper, we propose Cross-modal Mixup via Optimal Transport (CMOT) to overcome the modality gap. We find the alignment between speech and text sequences via optimal transport and then mix up the sequences from different modalities at a token level using the alignment. Experiments on the MuST-C ST benchmark demonstrate that CMOT achieves an average BLEU of 30.0 in 8 translation directions, outperforming previous methods. Further analysis shows CMOT can adaptively find the alignment between modalities, which helps alleviate the modality gap between speech and text. + +# 1 Introduction + +Speech translation (ST) is the task to translate speech signals in one language into text in another. Conventional ST systems work in a cascaded mode (STENTIFORD and STEER, 1988; Waibel et al., 1991), by combining automatic speech recognition (ASR) and machine translation (MT), which may suffer from error propagation and high latency. To solve these problems, end-to-end ST is proposed (Bérard et al., 2016; Duong et al., 2016). End-to-end ST directly generates the target text directly from the source audio without the intermediate transcript, which has drawn more attention in recent years (Vila et al., 2018; Salesky et al., 2019; Di Gangi et al., 2019b,c; Inaguma et al., 2020; + +Wang et al., 2020a; Zhao et al., 2021a; Dinh et al., 2022; Duquenne et al., 2022a). + +End-to-end ST has to perform cross-lingual and cross-modal transformation simultaneously, hence bringing more challenges than ASR or MT. Unfortunately, it is harder to collect parallel speech-to-text pairs than text-to-text pairs, which makes ST suffer from the under-fitting problem. To solve the data shortage problem, some researchers propose methods to introduce text-to-text parallel data of MT into ST, including pretraining (Alinejad and Sarkar, 2020; Zheng et al., 2021; Xu et al., 2021), multi-task learning (Le et al., 2020; Vydana et al., 2021; Tang et al., 2021), knowledge distillation (Liu et al., 2019; Gaido et al., 2020; Inaguma et al., 2021), etc. In this way, the knowledge of MT can be transferred to ST, helping learn a better cross-lingual transformation. + +Although these methods of transfer learning have shown improvements in the translation quality, ST is joint learning of cross-lingual and cross-modal transformation, and the effectiveness of transfer learning is also based on the assumption that the cross-modal source will be projected to the common representation space. Therefore, the mixup strategy is employed to further improve ST by reducing the gap between the speech and text representation spaces. Previous methods with mixup strategy usually perform word-level mixup between aligned tokens in different modalities (Fang et al., 2022), hence needing the help of external alignment tools. However, the alignment tools are not always available and require large amounts of additional annotated data for training, so how to obtain such alignments remains a problem for most languages. + +Illuminated by the application of the optimal transport theory in finding the alignment between languages or modalities in recent years (Chen et al., 2020; Gu and Feng, 2022), we propose Cross-modal Mixup via Optimal Transport (CMOT). We + +use optimal transport to adaptively find the alignment between speech and text, and use this alignment to achieve token-level mixup. The mixup sequence will serve as a medium between the speech sequence and text sequence to realize cross-modal knowledge transfer. Experiments on the MuST-C dataset show that CMOT achieves an average BLEU of 30.0. In addition, we prove that optimal transport can help find cross-modal alignments and CMOT can help alleviate the modality gap in ST. + +# 2 Method + +In this section, we will describe our proposed Cross-modal Mixup via Optimal Transport (CMOT). We find the alignment between speech and text sequences via OT, and mix up the two unimodal sequences to get a cross-modal mixed sequence. We predict the translation with all these sequences and regularize their outputs. Figure 1 illustrates the overview of our proposed method. + +# 2.1 Problem Formulation + +Generally, a speech translation corpus contains triplets of source speech s, its transcript $\mathbf{x}$ and translation y, which can be denoted as $\mathcal{D} = \{(\mathbf{s},\mathbf{x},\mathbf{y})\}$ . Given the corpus, an end-to-end ST system directly converts speech signals s into text translation y without generating the intermediate transcript x. + +# 2.2 Model Architecture + +Our model consists of four modules: the speech encoder, the text embedding layer, the translation encoder and the translation decoder. We first get parallel speech and text sequences with the speech encoder and the text embedding layer, and feed them into the translation encoder separately. Then we mix up the two encoder outputs with CMOT, and feed both the unimodal sequences and cross-modal mixed sequence to predict the translation. + +Speech Encoder The speech encoder extracts the low-level features from the raw speech input. We use HuBERT (Hsu et al., 2021) model stacked with a sub-sampler as the speech encoder. The HuBERT model is a self-supervised pretrained speech model and can improve the performance of ST systems as shown in recent works (Zhang et al., 2022a; Feng et al., 2022). It consists of a convolutional feature extractor and a BERT (Devlin et al., 2019) style encoder. The sub-sampler consists of two convolution layers and is designed to reduce the length of the speech sequence. + +![](images/44cdaa1ce40d426098c51ec1607ca3eb62da6882f00e5cb7a313756d66afb158.jpg) +Figure 1: Overview of our proposed architecture with CMOT. + +Text Embedding The text embedding layer embeds tokenized text into a sequence of embeddings. + +Translation Encoder The joint translation encoder receives either speech or text embeddings and learns further semantic information. It is composed of $N_{e}$ transformer (Vaswani et al., 2017) encoder layers. + +Translation Decoder The joint translation decoder receives either unimodal sequences of speech and text or the cross-modal mixed sequence and predicts the translation $\mathbf{y}$ . It is composed of $N_{d}$ transformer decoder layers. + +# 2.3 Cross-modal Mixup via Optimal Transport (CMOT) + +We mix up the speech sequence and text sequence with CMOT. For a speech sequence $\mathbf{H}^s$ and the corresponding text sequence $\mathbf{H}^x$ , we first get the alignment A between them via optimal transport (OT), and then mix up $\mathbf{H}^s$ and $\mathbf{H}^x$ with the help of A to get a mixed sequence $\mathbf{H}'$ . + +Optimal Transport The Optimal Transport (OT) + +problem is a classical mathematical problem and is nowadays used as a geometric tool to compare probability distributions (Peyre et al., 2019). It focuses on the scheme with the minimum cost of transferring one distribution to another under a given transfer cost. Consider the following discrete transport problem: for two independent probability distributions $P$ and $Q$ , + +$$ +\begin{array}{l} P = \{(w _ {i}, m _ {i}) \} _ {i = 1} ^ {n}, \quad s. t. \sum_ {i} m _ {i} = 1; \\ Q = \{(\hat {w} _ {j}, \hat {m} _ {j}) \} _ {j = 1} ^ {\hat {n}}, \quad s. t. \sum_ {j} \hat {m} _ {j} = 1, \end{array} \tag {1} +$$ + +where each point $w_{i}\in \mathbb{R}^{d}$ has a weight $m_{i}\in [0,\infty)$ . Given a transfer cost function $c(w_{i},\hat{w}_{j})$ and denoting the mass transported from $w_{i}$ to $\hat{w}_j$ by $\mathbf{T}_{ij}$ , the transport cost can be defined as: + +$$ +\mathcal {D} (P, Q) = \min _ {\mathbf {T} \geq 0} \sum_ {i, j} \mathbf {T} _ {i j} c (w _ {i}, \hat {w} _ {j}) +$$ + +$$ +s. t. \sum_ {j = 1} ^ {\hat {n}} \mathbf {T} _ {i j} = m _ {i}, \forall i \in \{1, \dots , n \}, \tag {2} +$$ + +$$ +\sum_ {i = 1} ^ {n} \mathbf {T} _ {i j} = \hat {m} _ {j}, \forall j \in \{1, \dots , \hat {n} \}. +$$ + +Relaxed OT with Window Strategy If we regard the speech sequence and the text sequence as two independent distributions, we can use OT to measure the distance between them. For a speech sequence $\mathbf{H}^s = (h_1^s,\dots ,h_n^s)$ , a text sequence $\mathbf{H}^x = (h_1^x,\dots ,h_{\hat{n}}^x)$ , and a cost function $c$ , we define the transport problem as: + +$$ +\mathcal {D} (\mathbf {H} ^ {s}, \mathbf {H} ^ {x}) = \min _ {\mathbf {T} \geq 0} \sum_ {i, j} \mathbf {T} _ {i j} c (h _ {i} ^ {s}, h _ {j} ^ {x}) +$$ + +$$ +s. t. \sum_ {j = 1} ^ {\hat {n}} \mathbf {T} _ {i j} = m _ {i} ^ {s}, \forall i \in \{1, \dots , n \}, \tag {3} +$$ + +$$ +\sum_ {i = 1} ^ {n} \mathbf {T} _ {i j} = m _ {j} ^ {x}, \forall j \in \{1, \dots , \hat {n} \}. +$$ + +Here we use the Euclidean distance as the cost function $c$ , and norm as the mass $m^s$ and $m^x$ inspired by Schakel and Wilson (2015) and Yokoi et al. (2020)'s discovery that important tokens have larger norms. The solutions to the OT problem include some accurate algorithms like Sinkhorn (Cuturei, 2013) algorithm and IPOT (Xie et al., 2020), which will bring great time complexity. Kusner et al. (2015) proposed a relaxed moving distance + +![](images/213fcb74a592224c992602d6bb4b22592c5eb4a46498890c1f7027007d491a84.jpg) +Figure 2: An example of OT from speech sequence to text sequence with window strategy. The x-axis is the speech sequence and the y-axis is the text sequence. White circles represent the transports that cannot be selected, pink ones represent the candidate transports and red ones represent the selected optimal transports. The dashed box represents the window, and we use $\mathrm{W} = 2$ as an example here. + +that removes one of the two constraints to obtain a lower bound of the accurate solution. Following this work, we remove the second constraint, and our transport problem thus becomes: + +$$ +\mathcal {D} ^ {*} (\mathbf {H} ^ {s}, \mathbf {H} ^ {x}) = \min _ {\mathbf {T} \geq 0} \sum_ {i, j} \mathbf {T} _ {i j} c \left(h _ {i} ^ {s}, h _ {j} ^ {x}\right) +$$ + +$$ +s. t. \sum_ {j = 1} ^ {\hat {n}} \mathbf {T} _ {i j} = m _ {i} ^ {s}, \forall i \in \{1, \ldots , n \}. +$$ + +This relaxed problem yields a lower bound of the original problem. We find that this relaxed OT improves the training speed without degrading the performance, as shown in Section 4.1. Now the optimal solution for each speech token $h_i^s$ is to move all its mass to the closest text token $h_j^x$ , so the transportation matrix becomes: + +$$ +\mathbf {T} _ {i j} ^ {*} = \left\{ \begin{array}{l l} m _ {i} ^ {s} & \text {i f} j = \arg \min _ {j} c \left(h _ {i} ^ {s}, h _ {j} ^ {x}\right) \\ 0 & \text {o t h e r w i s e} \end{array} , \right. \tag {5} +$$ + +This transport matrix $\mathbf{T}^*$ implies the alignment between $\mathbf{H}^s$ and $\mathbf{H}^x$ . We define the cross-modal alignment as $\mathrm{A} = (a_1, \ldots, a_n)$ , where + +$$ +a _ {i} = \underset {1 \leq j \leq \hat {n}} {\operatorname {a r g m a x}} \mathbf {T} _ {i j} ^ {*}. \tag {6} +$$ + +Considering the monotonicity and locality of the alignment from the speech sequence to the text sequence, we apply a window strategy for this alignment. We constrain the index of the aligned target + +to the neighborhood of the diagonal. The window size is set as a constant W both to left and to right: + +$$ +\begin{array}{l} a _ {i} = \underset {\max (1, \lambda i - W) \leq j \leq \min (\hat {n}, \lambda i + W)} {\operatorname {a r g m a x}} \mathbf {T} _ {i j} ^ {*}, \tag {7} \\ \lambda = \hat {n} / n. \\ \end{array} +$$ + +Figure 2 shows how the relaxed OT with window strategy works. Through the above steps, we get the alignment A in an adaptive manner. + +Cross-modal Mixup via OT With the help of the alignment A, we will be able to mixup the speech and text sequences at the token level. For a mixup probability $p^*$ , we generate the mixup sequence $\mathbf{H}' = (h_1', \dots, h_n')$ by: + +$$ +h _ {i} ^ {\prime} = \left\{ \begin{array}{l} h _ {i} ^ {s}, p > p ^ {*}, \\ h _ {a _ {i}} ^ {x}, p \leq p ^ {*}. \end{array} \right. \tag {8} +$$ + +where $p$ is sampled from a uniform distribution $U(0,1)$ . We feed $\mathbf{H}^s$ , $\mathbf{H}^x$ , $\mathbf{H}'$ into the joint transformer to predict the translation. Note that the positions of OT and mixup can be different. Our scheme is calculating OT before the translation encoder and performing mixup with the encoder outputs, which brings better performance in the experiment. See more details in Section 4.3. + +# 2.4 Training Strategy + +We follow the paradigm of pretraining-finetuning to train our model. + +Pretraining We pretrain the text embedding and the joint transformer with an MT task. The training objective during this phase is the cross entropy loss: + +$$ +\mathcal {L} _ {\mathrm {M T}} = - \mathbb {E} _ {\mathbf {x}, \mathbf {y}} \log P (\mathbf {y} | \mathbf {x}). \tag {9} +$$ + +Multitask Finetuning During finetuning, we train the model with multiple tasks. We add the cross entropy loss of ST and MT to the final loss: + +$$ +\mathcal {L} _ {\mathrm {S T}} = - \mathbb {E} _ {(\mathbf {s}, \mathbf {x}, \mathbf {y}) \in \mathcal {D}} \log P (\mathbf {y} | \mathbf {s}), \tag {10} +$$ + +$$ +\mathcal {L} _ {\mathrm {M T}} = - \mathbb {E} _ {(\mathbf {s}, \mathbf {x}, \mathbf {y}) \in \mathcal {D}} \log P (\mathbf {y} | \mathbf {x}). +$$ + +Meanwhile, we regularize the predictions of mixup and speech sequences by minimizing the Kullback-Leibler (KL) Divergence between the token-level probability distributions of them, and we do the same for the predictions of mixup and text sequences. For a speech prediction distribution $S$ , a text prediction distribution $T$ and mixup prediction distribution $M$ , we have: + +$$ +\begin{array}{l} \mathcal {L} _ {\mathrm {K L}} (M, S) = \frac {1}{2} (\mathbb {D} _ {\mathrm {K L}} (M | | S) + \mathbb {D} _ {\mathrm {K L}} (S | | M)), \\ \mathcal {L} _ {\mathrm {K L}} (M, T) = \frac {1}{2} \left(\mathbb {D} _ {\mathrm {K L}} (M | | T) + \mathbb {D} _ {\mathrm {K L}} (T | | M)\right). \tag {11} \\ \end{array} +$$ + +Hence the final training objective is: + +$$ +\mathcal {L} = \mathcal {L} _ {\mathrm {S T}} + \mathcal {L} _ {\mathrm {M T}} + \lambda \mathcal {L} _ {\mathrm {K L}} (M, S) + \lambda \mathcal {L} _ {\mathrm {K L}} (M, T), \tag {12} +$$ + +where $\lambda$ is the weight to control $\mathcal{L}_{\mathrm{KL}}$ . + +# 3 Experiments + +We conduct experiments under two settings, the base and the expanded. The former only uses ST data, while the latter uses external MT data additionally. We will describe the datasets we use, our experimental setups and our main results in this section. + +# 3.1 Datasets + +ST Datasets We conduct experiments on the $\mathrm{MuST - C^2}$ (Di Gangi et al., 2019a) dataset, a widely used benchmark for ST. It consists of translations from English (En) to 8 languages: German (De), French (Fr), Russian (Ru), Spanish (Es), Italian (It), Romanian (Ro), Portuguese (Pt) and Dutch (Nl). For each direction, it comprises at least 385 hours of audio recorded from TED Talks. We use dev set for validation and tst-COMMON set for evaluation. + +External MT Datasets We incorporate external MT data to pretrain the text embedding and the joint transformer. For directions of En-De, En-Fr, En-Ru, En-Es and En-Ro we use data from WMT (Bojar et al., 2016). For En-It, En-Pt and En-NI we use data from OPUS100 $^3$ (Zhang et al., 2020). + +Table 2 shows the detailed statistics of the MuST-C, WMT and OPUS100 datasets we use. + +# 3.2 Experimental Setups + +Model Configurations For the speech encoder, we use $\mathrm{HuBERT^4}$ (Hsu et al., 2021) base model, which is pretrained on LibriSpeech (Panayotov et al., 2015) with no finetuning and is one of the state-of-the-art pretrained audio models. Following the usual practice for ST, we stack two convolution layers of kernel size 5, stride size 2, padding 2 and hidden size 1024 after the HuBERT model as a sub-sampler. The text embedding is an embedding layer of dimension 512. For the joint transformer, we use $N_{e} = 6$ encoder layers and $N_{d} = 6$ decoder layers with 512 hidden units, 2048 feed-forward hidden units and 8 attention heads. We use $\mathrm{fairseq^5}$ (Ott et al., 2019) for implementation. + +2Here we refer to v1.0. https://ict.fbk.eu/must-c/ +3http://opus.nlpl.eu/opus-100.php +4https://github.com/facebookresearch/fairseq/ee/main/examples/hubert +5https://github.com/facebookresearch/fairseq/ + +
ModelsSpeech PretrainingBase setting (w/o external MT data)
En-DeEn-FrEn-RuEn-EsBLEU En-ItEn-RoEn-PtEn-NIAvg.
Fairseq ST (Wang et al., 2020a)×22.732.915.327.222.721.928.127.324.8
XSTNet (Ye et al., 2021)✓25.536.016.929.625.525.131.330.027.5
STEMM (Fang et al., 2022)✓25.636.117.130.325.624.331.030.127.5
ConST (Ye et al., 2022)✓25.736.817.330.426.324.832.030.628.0
HuBERT-Transformer✓25.436.516.830.526.024.231.729.927.6
CMOT✓27.0**37.3**17.9**31.1**26.9**25.3**32.7**31.2**28.7
Expanded setting (w/ external MT data)
Chimera (Han et al., 2021)✓27.135.617.430.625.024.030.229.227.4
XSTNet (Ye et al., 2021)✓27.138.018.530.826.425.732.431.228.8
STEMM (Fang et al., 2022)✓28.737.417.831.025.824.531.730.528.4
ConST (Ye et al., 2022)✓28.338.318.932.027.225.633.131.729.4
HuBERT-Transformer✓27.538.318.832.526.925.332.330.829.1
CMOT✓29.0**39.5**19.2**32.8*27.5**26.0**33.5**32.1**30.0
+ +Table 1: BLEU scores on MuST-C tst-COMMON set. "Speech Pretraining" denotes using pretrained speech models. *, ** indicate the improvements over HuBERT-Transformer are statistically significant with p < 0.05 and p < 0.01. + +
En→ST (MuST-C)MT
hours#sentsname#sents
De408234KWMT164.6M
Fr492280KWMT1440.8M
Ru489270KWMT162.5M
Es504270KWMT1315.2M
It465258KOPUS1001.0M
Ro432240KWMT160.6M
Pt385211KOPUS1001.0M
NI442253KOPUS1001.0M
+ +Table 2: Statistics of the datasets. + +Pre-processing For speech input, we use the 16-bit $16\mathrm{kHz}$ mono-channel raw audio, and we filter out samples with frames greater than $480\mathrm{k}$ or less than $1\mathrm{k}$ to ensure training efficiency. For transcripts and translations, we tokenize them using a unigram SentencePiece (Kudo and Richardson, 2018) model with a vocabulary size of $10\mathrm{k}$ , which is shared by the source language and the target language. + +Training Our training process follows the pretraining-finetuning paradigm. We pretrain the text embedding layer, the translation encoder and decoder with an MT task. For the base setting, we only use the transcript-translation pairs with a learning rate of 2e-3, and warm-up steps of 8k. For the expanded setting we first pretrain them on external MT data with a learning rate of 7e-4 and warm-up steps of 8k, and then pretrain them on transcript-translation pairs with a learning rate of 1e-4 and warm-up steps of 4k. For both settings, + +we allow at most 33k input tokens per batch. + +We set the learning rate to 1e-4 and warm-up steps to 10k to finetune the whole model. We train the entire model for 60k updates with a batch of 16M audio frames. We use an Adam optimizer (Kingma and Ba, 2015) with $\beta_{1} = 0.9$ , $\beta_{2} = 0.98$ , dropout of 0.1 and the label smoothing value of 0.1. For CMOT, we set the weight $\lambda$ of KL loss to 2.0 (see more in Appendix 4.3) and the mixup probability $p^{*}$ to 0.2 (see more in Section 4.3), and we use the window strategy for OT by default with window size W = 10. All models are trained on 4 Nvidia GeForce RTX 3090 GPUs. + +Inference We average the checkpoints of the last 10 epochs for evaluation. We use beam search with a beam size of 8. We evaluate case-sensitive tokenized BLEU on MuST-C tst-COMMON set using sacreBLEU $^7$ (Post, 2018). We use sacreBLEU to test the significance of the results. + +Baselines We compare our method with the Fairseq ST (Wang et al., 2020a) baseline implemented with the same framework (Ott et al., 2019). We implement HuBERT-Transformer as a strong baseline, which has the same architecture as our method. The only difference is that HuBERT-Transformer takes speech as input and performs the ST task during fine-tuning. We train this model for 40k steps, except for the En-Ru direction where we use a training step of 100k due to specific language complexities. + +We also compare our method with several robust end-to-end ST systems: Chimera (Han et al., 2021) which learns a shared semantic space for speech and text, XSTNet (Ye et al., 2021) which uses a + +progressive multi-task training strategy, STEMM (Fang et al., 2022) which applies word-level mixup strategy and ConST (Ye et al., 2022) which applies contrastive learning strategy. These baselines all adopt the multi-task learning mode and have similar model architectures. + +# 3.3 Main Results + +Table 1 shows the main results. HuBERT-Transformer, the baseline model we implement, achieves relatively high BLEU scores. For the base setting without external MT data, CMOT outperforms HuBERT-Transformer by 1.1 BLEU in average of 8 directions. For the expanded setting, CMOT outperforms HuBERT-Transformer by 0.9 BLEU in average. Besides, CMOT also outperforms other strong baselines. + +# 4 Analysis + +# 4.1 Effect of OT + +We use CMOT to learn the alignment between speech and text, and to improve the performance of the ST system. In this section, we compare CMOT with other models without OT or with other types of OT. All the models have the same architecture. MTL denotes the multi-task learning (ST and MT) model. Relaxed OT denotes the model trained with the same process of CMOT but without the window strategy in Section 2.3. IPOT denotes the model trained with the same process as CMOT but using IPOT (Xie et al., 2020) for OT calculation. The A-score is defined as the accuracy of our alignment $\mathrm{A} = (a_{1},\dots ,a_{n})$ compared to the reference alignment $\mathrm{A}^{*} = (a_{1}^{*},\dots ,a_{n}^{*})$ : + +$$ +\text {A - s c o r e} = \sum_ {i} \mathbb {1} \left(a _ {i} = a _ {i} ^ {*}\right) / n, \tag {13} +$$ + +Here $A^{*}$ is obtained with Montreal Forced Aligner (MFA) $^{8}$ (McAuliffe et al., 2017). As shown in Table 3, we can see the result of relaxed OT is slightly lower than that of IPOT, but when the window strategy is used, its performance exceeds that of IPOT with a faster speed. CMOT achieves the best BLEU score, along with the best A-score of alignment, proving that CMOT not only takes advantage of this alignment but optimizes it as well. + +In addition, we observe the cost matrices of OT to verify that the cost matrix can be used for cross-modal alignment. We compare the cost matrices in + +
ModelBLEU↑A-score↑
HuBERT-Transformer27.50.48
MTL27.60.50
Relaxed OT28.80.54
IPOT28.90.55
CMOT29.00.57
+ +Table 3: ST performances and alignment scores of different models on MuST-C En-De tst-COMMON set. These experiments are conducted under the expanded setting. + +MTL and CMOT, and analyze a typical example, as shown in Figure 3. The redder grids indicate the distance between the speech token and the text token is smaller, while the bluer grids are the opposite. To better observe the word-level alignment, we use MFA to cut the sentences of speech and text into words, and the white solid lines denote the segmentation. For CMOT, we can see that the closer speech-text pairs basically lie on the diagonal, which is consistent with the alignment of the two sequences. But for MTL without the help of OT, the distance between speech and the corresponding word is not that close. Comparing the two green boxes in the figure, we can see CMOT has better alignment on the word "pointed". + +# 4.2 Effect of Cross-modal Mixup + +To examine the effectiveness of the mixup strategy in bridging the modality gap, we compare the modality gap of CMOT and baseline models. We calculate the mean sentence-level distances and mean word-level distances of these models. We focus on the modality gap at the encoder input and output, and the results are shown in Figure 4. We can see that compared with the baseline model, CMOT has a smaller distance between modalities, which means our method effectively reduces the modality gap and improves the performance of ST. + +# 4.3 Ablation Study + +Training Objectives As a multi-task learning framework, our ST system's performance can be affected by the training objectives. Table 4 shows the impact of training objectives on ST performance. Comparing Exp.I and II, We can empirically conclude that multi-task learning strategy alone helps little, while Exp.III suggests regularizing the output distributions is effective. Exp.IV, V, and VI show that calculating KL divergence for both mixup and speech outputs, and mixup and text outputs can bring the greatest improvement. In Exp.VII, we + +![](images/66f2e643fdb4840324e4a48b2ed33e1c0396e3e3efdf5180182408f379615c12.jpg) +Figure 3: An example of how our CMOT can learn better alignment between speech and text. We draw the cost matrices in OT calculation for MTL and CMOT models. + +![](images/297dd5dec7651fae84ca0b5a19e41f32b294bae63719f5ae58b8f31ea0ee5ac0.jpg) + +![](images/50b06f0af9e94f8d0fcd4abac3a36a3ef342389f75075d894cf83cfab2c5e732.jpg) +Figure 4: Modality gaps of different models. The data are calculated on the MuST-C En-De dev set with models of expanded setting. "in" / "out" denotes the encoder input / output sequences, while "sentence" / "word" denotes sentence-level / word-level Euclidean distance. + +add the translation loss of the mixup sequence: + +$$ +\mathcal {L} _ {\text {M i x u p}} = - \mathbb {E} _ {(\mathbf {s}, \mathbf {x}, \mathbf {y}) \in \mathcal {D}} \log P (\mathbf {y} | \mathbf {H} ^ {\prime}), \tag {14} +$$ + +where $\mathbf{H}'$ is the mixup sequence calculated as Equation (8). Comparing Exp.VI and VII, we can see $\mathcal{L}_{\mathrm{Mixup}}$ does not help. We also inspect the effect of OT loss which takes the value of $\mathcal{D}^*$ in Equation (4) in Exp.VIII, and see a slight performance decline. Here OT is only used to help find the alignment, so OT loss is not indispensable during fine-tuning, and we conjecture adding OT loss may make it harder for the model to converge to good parameters, as the training objective is too complex. + +Positions of OT and Mixup We investigate the impact of positions of OT and the mixup on our + +
#Exp.Training ObjectiveBLEU
ILST27.5
IILST + LMT27.6
IIILST + LMT + λLKL(S,T)28.5
IVLST + LMT + λLKL(M,S)28.5
VLST + LMT + λLKL(M,T)28.2
VILST + LMT + λLKL(M,S) + λLKL(M,T)29.0
VIILST + LMT + LMixup + λLKL(M,S) + λLKL(M,T)28.7
VIIILST + LMT + λLKL(M,S) + λLKL(M,T) + μLOT28.6
+ +Table 4: ST performances with different training objectives on MuST-C En-De tst-COMMON set. These experiments are conducted under the expanded setting. $\mathcal{L}_{\mathrm{Mixup}}$ denotes the translation loss of the mixup sequence. We set the weights $\lambda = 2$ and $\mu = 0.1$ + +
OT\Mixupencoder inencoder out
encoder in28.629.0
encoder out28.728.7
+ +Table 5: BLEU scores of different positions of OT and mixup on MuST-C En-De tst-COMMON set. These experiments are conducted under the expanded setting. + +system. As shown in Table 5, the best scheme is to calculate OT for encoder inputs and perform the mixup for encoder outputs. We believe there is more original alignment information at the lower layers of the model, which is better for OT calculation, while the hidden states of higher layers are more suitable for the mixup, as they have passed several layers of joint transformer and are closer in the representation space. + +Mixup Probability We explore the impact of mixup probability on ST performance and the results are shown in Figure 5. Here $p^*$ denotes the proportion of text tokens in the mixup sequence. + +![](images/93587bbb056346cc880e574b9ec1a85540ebe8551a52bceeba9a6a7a7ad40287.jpg) +Figure 5: BLEU scores on MuST-C En-De tst-COMMON set with different mixup probability $p^*$ . These experiments are conducted under the expanded setting. + +
Speech EncoderBaselineCMOT
wav2vec 2.0 (Baevski et al., 2020)26.928.5
HuBERT (Hsu et al., 2021)27.529.0
+ +Previous works find a slightly larger probability is better, while we find $p^* = 0.2$ improves ST performance the most. We think this is because CMOT needs to find the alignment between speech and text adaptively, so a larger proportion of text tokens in the mixup sequence might bring some noise. + +Speech Encoder We investigate the impact of different speech encoders on our ST system. HuBERT (Hsu et al., 2021) and wav2vec 2.0 (Baevski et al., 2020) are both commonly used speech pretrained models. Table 6 indicates that using HuBERT as a speech encoder can achieve higher performances than using wav2vec 2.0. + +In addition, in order to provide a fair comparison with other works using wav2vec 2.0, we conduct experiments on CMOT with wav2vec 2.0 as the speech encoder in more directions. As shown in Table 7, CMOT using wav2vec 2.0 still performs well, surpassing previous works in these three language pairs. + +Weight of KL Loss Our finetuning process follows a multi-task learning approach, where the weight of each training objective can affect the overall performance. For the KL loss in Equation 12, we choose several different weight values $\lambda$ ranging from 1.0 to 3.0, and find when $\lambda = 2.0$ or $\lambda = 2.5$ the performance is best, as shown in Figure 6. When the weight of KL loss is too small, the + +Table 6: BLEU scores with different speech encoders on MuST-C En-De tst-COMMON set. Here "baseline" represents the model with the same structure as CMOT but without mixup during training. These experiments are conducted under the expanded setting. + +
ModelEn-DeEn-FrEn-Es
Chimera27.135.630.6
XSTNet27.138.030.8
STEMM28.737.431.0
ConST28.338.332.5
W2V2-Transformer26.936.630.0
CMOT-W2V228.539.132.6
+ +Table 7: BLEU scores with different models using wav2vec 2.0 on MuST-C tst-COMMON set. "CMOT-W2V2" refers to our CMOT model with wav2vec 2.0 as the speech encoder. "W2V2-Transformer" refers to the model with the same structure as CMOT-W2V2 but without mixup during training, and we directly report the results given in Fang et al. (2022). Here the experiments of W2V2-Transformer and CMOT-W2V2 are both conducted under the expanded setting. + +![](images/2338f57f965d9d4f7fe6336adb10f8d3686b178b29e3720c15d6d3cc6b39ee7a.jpg) +Figure 6: BLEU scores with different KL weight $\lambda$ on MuST-C En-De tst-COMMON set. Here the x-axis is the weight of KL loss. These experiments are all conducted under the expanded setting. We set the mixup probability $p^{*} = 0.2$ . + +regularization effect of the KL objective becomes little, while a large weight of KL loss can lead to performance degradation of the main tasks ST and MT. Hence, we suggest the weight be at a moderate value, and we choose $\lambda = 2.0$ for our system. + +Window Size for OT We examine the impact of window size W on our ST system. As shown in Figure 7, a small window size may restrict the model's ability to identify appropriate alignments, while a large window size may diminish its ability to capture local dependencies. + +# 5 Related Work + +End-to-end ST Traditional ST systems work in a cascaded mode (STENTIFORD and STEER, 1988; Waibel et al., 1991), with problems of error propagation and high latency. Bérard et al. + +![](images/427b78eaee08dea94eedda60742c70fc4553306ea3c034edb3e104e1e4e2b881.jpg) +Figure 7: BLEU scores with different window sizes W on MuST-C En-De tst-COMMON set. These experiments are all conducted under the expanded setting. + +(2016); Duong et al. (2016) proposed end-to-end ST without intermediate transcription, which has become the mainstream paradigm of ST in recent years (Vila et al., 2018; Salesky et al., 2019; Di Gangi et al., 2019b,c; Inaguma et al., 2020; Wang et al., 2020a; Zhao et al., 2021a; Dinh et al., 2022; Duquenne et al., 2022a). An end-to-end ST system is difficult to train due to its cross-modal cross-lingual characteristics and the scarcity of parallel data, hence some techniques like pretraining (Bansal et al., 2019; Stoian et al., 2020; Wang et al., 2020b; Alinejad and Sarkar, 2020; Zheng et al., 2021; Xu et al., 2021; Zhang et al., 2022b), self-training (Pino et al., 2020; Wang et al., 2021), curriculum learning (Kano et al., 2017; Wang et al., 2020c), multi-task learning (Le et al., 2020; Vydana et al., 2021; Tang et al., 2021), data augmentation (Lam et al., 2022; Fang and Feng, 2023a), and knowledge distillation (Liu et al., 2019; Gaido et al., 2020; Inaguma et al., 2021) are applied to improve its performance. To overcome the modality gap between speech and text, various methods are used. Zhao et al. (2021b) proposed a mutual learning scenario. Han et al. (2021) and Duquenne et al. (2022b) projected speech and text into a common representation space. Chen et al. (2022) proposed the method of modality matching. Ye et al. (2022) applied the contrastive learning strategy. Fang and Feng (2023b) proposed cross-modal regularization with scheduled sampling. + +Mixup Our work draws on the strategy of mixup. Mixup is first proposed in Zhang et al. (2018) as a form of data augmentation to improve generalization and increase the robustness of neural networks by creating "convex combinations of pairs + +of examples and their labels". Verma et al. (2019) proposed the concept of manifold mixup, going a step further than surface-level mixup. In recent years, mixup is used to reduce the gap of representation spaces, such as cross-modal transfer (So et al., 2022; Ye and Guo, 2022) and cross-lingual transfer (Yang et al., 2021). Fang et al. (2022) proposed STEMM, applying mixup to end-to-end ST to overcome modality gap. Although both STEMM and our work use the mixup strategy, STEMM needs external alignment tools, while CMOT finds the alignment adaptively. + +Optimal Transport Optimal transport is a classical mathematical problem. It is now commonly used to describe the transfer cost between two distributions. Villani (2009) systematically demonstrates the theories and proofs of optimal transport. Peyre et al. (2019) outlines the main theoretical insights that support the practical effectiveness of OT. There are some approximation algorithms for the OT problem, like the Sinkhorn algorithm (Cuturi, 2013) and IPOT (Xie et al., 2020) algorithm. Kusner et al. (2015) proposed a relaxed form of OT in order to measure the similarity between documents, which reduced the computational cost. Chen et al. (2020) used OT in image-text pretraining to "explicitly encourage fine-grained alignment between words and image regions". Gu and Feng (2022) applied the relaxed form of OT to machine translation and managed to "bridge the gap between the semantic-equivalent representations of different languages". + +# 6 Conclusion + +We propose Cross-modal Mixup via Optimal Transport (CMOT) to adaptively find the alignment between speech and text sequences, and to mix up the sequences of different modalities at the token level. Experiments on the MuST-C benchmark demonstrate the effectiveness of our method, which helps overcome the modality gap and thus improves the performance of end-to-end ST systems. We will continue to explore the application of this adaptive cross-modal alignment method in the future. + +# Limitations + +The CMOT method for speech translation is based on the idea of cross-modal knowledge transfer and the paradigm of multi-task learning, so it requires the transcripts of speech during training, which + +may not be applicable to some languages without transcribed text. Besides, this work mainly focuses on the finetuning of speech translation, and applications on the pretraining phase or on other tasks are in need of exploration in the future. + +# Ethics Statement + +Our proposed CMOT can help build a strong end-to-end ST system. It has prospects for application in many scenarios requiring speech translation, which helps people understand speech in a foreign language. Nevertheless, the results generated by end-to-end ST systems are not necessarily perfect, so people may not fully rely on the results for the time being. + +# Acknowledgements + +This work was supported by National Key R&D Program of China(NO. 2018AAA0102502). We thank all the anonymous reviewers for their insightful and valuable comments. + +# References + +Ashkan Alinejad and Anoop Sarkar. 2020. Effectively pretraining a speech translation decoder with machine translation data. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 8014-8020. +Alexei Baevski, Yuhao Zhou, Abdelrahman Mohamed, and Michael Auli. 2020. wav2vec 2.0: A framework for self-supervised learning of speech representations. Advances in Neural Information Processing Systems, 33:12449-12460. +S Bansal, H Kamper, K Livescu, A Lopez, and S Goldwater. 2019. Pre-training on high-resource speech recognition improves low-resource speech-to-text translation. *NAACL* 2019. +Alexandre Bérard, Olivier Pietquin, Laurent Besacier, and Christophe Servan. 2016. Listen and translate: A proof of concept for end-to-end speech-to-text translation. In NIPS Workshop on end-to-end learning for speech and audio processing. +Ondrej Bojar, Rajen Chatterjee, Christian Federmann, Yvette Graham, Barry Haddow, Matthias Huck, Antonio Jimeno Yepes, Philipp Koehn, Varvara Logacheva, Christof Monz, Matteo Negri, Aurélie Néveol, Mariana Neves, Martin Popel, Matt Post, Raphael Rubino, Carolina Scarton, Lucia Specia, Marco Turchi, Karin Verspoor, and Marcos Zampieri. 2016. Findings of the 2016 conference on machine translation. In Proceedings of the First Conference on Machine Translation: Volume 2, Shared Task Papers, pages 131-198, Berlin, Germany. Association for Computational Linguistics. + +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 Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part XXX, pages 104-120. +Zhehuai Chen, Yu Zhang, Andrew Rosenberg, Bhuvana Ramabhadran, Pedro J. Moreno, Ankur Bapna, and Heiga Zen. 2022. MAESTRO: Matched Speech Text Representations through Modality Matching. In Proc. Interspeech 2022, pages 4093-4097. +Marco Cuturi. 2013. Sinkhorn distances: Lightspeed computation of optimal transport. Advances in neural information processing systems, 26. +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. +Mattia A Di Gangi, Roldano Cattoni, Luisa Bentivogli, Matteo Negri, and Marco Turchi. 2019a. Must-c: a multilingual speech translation corpus. In 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 2012-2017. Association for Computational Linguistics. +Mattia A Di Gangi, Matteo Negri, and Marco Turchi. 2019b. Adapting transformer to end-to-end spoken language translation. In *INTERSPEECH* 2019, pages 1133-1137. International Speech Communication Association (ISCA). +Mattia Antonino Di Gangi, Matteo Negri, Roldano Cattoni, Roberto Dessi, and Marco Turchi. 2019c. Enhancing transformer for end-to-end speech-to-text translation. In Proceedings of Machine Translation Summit XVII: Research Track, pages 21-31. +Tu Anh Dinh, Danni Liu, and Jan Niehues. 2022. Tackling data scarcity in speech translation using zero-shot multilingual machine translation techniques. In ICASSP 2022-2022 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 6222-6226. IEEE. +Long Duong, Antonios Anastasopoulos, David Chiang, Steven Bird, and Trevor Cohn. 2016. An attentional model for speech translation without transcription. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 949-959. +Paul-Ambroise Duquenne, Hongyu Gong, Benoit Sagot, and Holger Schwenk. 2022a. T-modules: Translation modules for zero-shot cross-modal machine translation. arXiv preprint arXiv:2205.12216. + +Paul-Ambroise Duquenne, Hongyu Gong, Benoit Sagot, and Holger Schwenk. 2022b. T-Modules: Translation Modules for Zero-Shot Cross-Modal Machine Translation. In EMNLP 2022 - 2022 Conference on Empirical Methods in Natural Language Processing, Abu Dhabi, United Arab Emirates. +Qingkai Fang and Yang Feng. 2023a. Back translation for speech-to-text translation without transcripts. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics. +Qingkai Fang and Yang Feng. 2023b. Understanding and bridging the modality gap for speech translation. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics. +Qingkai Fang, Rong Ye, Lei Li, Yang Feng, and Mingxuan Wang. 2022. STEMM: Self-learning with speech-text manifold mixup for speech translation. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 7050-7062, Dublin, Ireland. Association for Computational Linguistics. +Tzu-hsun Feng, Annie Dong, Ching-Feng Yeh, Shu-wen Yang, Tzu-Quan Lin, Jiatong Shi, Kai-Wei Chang, Zili Huang, Haibin Wu, Xuankai Chang, et al. 2022. Superb@ slt 2022: Challenge on generalization and efficiency of self-supervised speech representation learning. arXiv preprint arXiv:2210.08634. +Marco Gaido, Mattia A Di Gangi, Matteo Negri, and Marco Turchi. 2020. End-to-end speech-translation with knowledge distillation: Fbk@ iwslt2020. In Proceedings of the 17th International Conference on Spoken Language Translation, pages 80-88. +Shuhao Gu and Yang Feng. 2022. Improving zero-shot multilingual translation with universal representations and cross-mappings. arXiv preprint arXiv:2210.15851. +Chi Han, Mingxuan Wang, Heng Ji, and Lei Li. 2021. Learning shared semantic space for speech-to-text translation. In *Findings of the Association for Computational Linguistics: ACL-IJCNLP* 2021, pages 2214-2225. +Wei-Ning Hsu, Benjamin Bolte, Yao-Hung Hubert Tsai, Kushal Lakhotia, Ruslan Salakhutdinov, and Abdelrahman Mohamed. 2021. Hubert: Self-supervised speech representation learning by masked prediction of hidden units. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 29:3451-3460. +Hirofumi Inaguma, Tatsuya Kawahara, and Shinji Watanabe. 2021. Source and target bidirectional knowledge distillation for end-to-end speech translation. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 1872-1881. + +Hirofumi Inaguma, Shun Kiyono, Kevin Duh, Shigeki Karita, Nelson Yalta, Tomoki Hayashi, and Shinji Watanabe. 2020. Espnet-st: All-in-one speech translation toolkit. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics: System Demonstrations, pages 302-311. +Takatomo Kano, Sakriani Sakti, and Satoshi Nakamura. 2017. Structured-Based Curriculum Learning for End-to-End English-Japanese Speech Translation. In Proc. Interspeech 2017, pages 2630-2634. +Diederik P. Kingma and Jimmy Ba. 2015. Adam: A method for stochastic optimization. In ICLR (Poster). +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. +Matt Kusner, Yu Sun, Nicholas Kolkin, and Kilian Weinberger. 2015. From word embeddings to document distances. In International conference on machine learning, pages 957-966. PMLR. +Tsz Kin Lam, Shigehiko Schamoni, and Stefan Riezler. 2022. Sample, translate, recombine: Leveraging audio alignments for data augmentation in end-to-end speech translation. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 245-254, Dublin, Ireland. Association for Computational Linguistics. +Hang Le, Juan Pino, Changhan Wang, Jiatao Gu, Didier Schwab, and Laurent Besacier. 2020. Dual-decoder transformer for joint automatic speech recognition and multilingual speech translation. In Proceedings of the 28th International Conference on Computational Linguistics, pages 3520-3533. +Yuchen Liu, Hao Xiong, Jiajun Zhang, Zhongjun He, Hua Wu, Haifeng Wang, and Chengqing Zong. 2019. End-to-End Speech Translation with Knowledge Distillation. In Proc. Interspeech 2019, pages 1128-1132. +Michael McAuliffe, Michaela Socolof, Sarah Mihuc, Michael Wagner, and Morgan Sonderegger. 2017. Montreal forced aligner: Trainable text-speech alignment using kaldi. Proc. Interspeech 2017, pages 498-502. +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. +Vassil Panayotov, Guoguo Chen, Daniel Povey, and Sanjeev Khudanpur. 2015. Librispeech: an asr corpus based on public domain audio books. In 2015 + +IEEE international conference on acoustics, speech and signal processing (ICASSP), pages 5206-5210. IEEE. +Gabriel Peyre, Marco Cuturi, et al. 2019. Computational optimal transport: With applications to data science. Foundations and Trends® in Machine Learning, 11(5-6):355-607. +Juan Pino, Qiantong Xu, Xutai Ma, Mohammad Javad Dousti, and Yun Tang. 2020. Self-Training for End-to-End Speech Translation. In Proc. Interspeech 2020, pages 1476-1480. +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. +Elizabeth Salesky, Matthias Sperber, and Alexander H Waibel. 2019. Fluent translations from disfluent speech in end-to-end speech translation. In NAACL-HLT (1). +Adriaan M. J. Schakel and Benjamin J. Wilson. 2015. Measuring word significance using distributed representations of words. CoRR, abs/1508.02297. +Junhyuk So, Changdae Oh, Yongtaek Lim, Hoyoon Byun, Minchul Shin, and Kyungwoo Song. 2022. Geodesic multi-modal mixup for robust fine-tuning. arXiv preprint arXiv:2203.03897. +FWM STENTIFORD and MG STEER. 1988. Machine translation of speech. British Telecom technology journal, 6(2):116-123. +Mihaela C Stoian, Sameer Bansal, and Sharon Goldwater. 2020. Analyzing asr pretraining for low-resource speech-to-text translation. In ICASSP 2020-2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 7909-7913. IEEE. +Yun Tang, Juan Pino, Changhan Wang, Xutai Ma, and Dmitriy Genzel. 2021. A general multi-task learning framework to leverage text data for speech to text tasks. In ICASSP 2021 - 2021 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 6209-6213. +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. Advances in neural information processing systems, 30. +Vikas Verma, Alex Lamb, Christopher Beckham, Amir Najafi, Ioannis Mitliagkas, David Lopez-Paz, and Yoshua Bengio. 2019. Manifold mixup: Better representations by interpolating hidden states. In International Conference on Machine Learning, pages 6438-6447. PMLR. + +Laura Cross Vila, Carlos Escolano, José AR Fonollosa, and Marta R Costa-Jussa. 2018. End-to-end speech translation with the transformer. In IberSPEECH, pages 60-63. +Cédric Villani. 2009. Optimal transport: old and new, volume 338. Springer. +Hari Krishna Vydana, Martin Karafiat, Katerina Zmolkova, Lukáš Burget, and Honza Černocký. 2021. Jointly trained transformers models for spoken language translation. In ICASSP 2021 - 2021 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 7513-7517. +A Waibel, AN Jain, AE McNair, H Saito, AG Hauptmann, and J Tebelskis. 1991. Janus: a speech-to-speech translation system using connectionist and symbolic processing strategies. In [Proceedings] ICASSP 91: 1991 International Conference on Acoustics, Speech, and Signal Processing, pages 793-796. IEEE. +Changhan Wang, Yun Tang, Xutai Ma, Anne Wu, Dmytro Okhonko, and Juan Pino. 2020a. Fairseq s2t: Fast speech-to-text modeling with fairseq. 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: System Demonstrations, pages 33-39. +Changhan Wang, Anne Wu, Juan Pino, Alexei Baevski, Michael Auli, and Alexis Conneau. 2021. LargeScale Self- and Semi-Supervised Learning for Speech Translation. In Proc. Interspeech 2021, pages 2242-2246. +Chengyi Wang, Yu Wu, Shujie Liu, Zhenglu Yang, and Ming Zhou. 2020b. Bridging the gap between pretraining and fine-tuning for end-to-end speech translation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 9161-9168. +Chengyi Wang, Yu Wu, Shujie Liu, Ming Zhou, and Zhenglu Yang. 2020c. Curriculum pre-training for end-to-end speech translation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 3728-3738. +Yujia Xie, Xiangfeng Wang, Ruijia Wang, and Hongyuan Zha. 2020. A fast proximal point method for computing exact Wasserstein distance. In Uncertainty in artificial intelligence, pages 433-453. PMLR. +Chen Xu, Bojie Hu, Yanyang Li, Yuhao Zhang, Shen Huang, Qi Ju, Tong Xiao, and Jingbo Zhu. 2021. Stacked acoustic-and-textual encoding: Integrating the pre-trained models into speech translation encoders. 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 2619-2630. + +Huiyun Yang, Huadong Chen, Hao Zhou, and Lei Li. 2021. Enhancing cross-lingual transfer by manifold mixup. In International Conference on Learning Representations. +Junjie Ye and Junjun Guo. 2022. Dual-level interactive multimodal-mixup encoder for multi-modal neural machine translation. Applied Intelligence, pages 1-10. +Rong Ye, Mingxuan Wang, and Lei Li. 2021. End-to-End Speech Translation via Cross-Modal Progressive Training. In Proc. Interspeech 2021, pages 2267-2271. +Rong Ye, Mingxuan Wang, and Lei Li. 2022. Cross-modal contrastive learning for speech translation. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 5099-5113, Seattle, United States. Association for Computational Linguistics. +Sho Yokoi, Ryo Takahashi, Reina Akama, Jun Suzuki, and Kentaro Inui. 2020. Word rotator's distance. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 2944-2960. +Biao Zhang, Philip Williams, Ivan Titov, and Rico Senrich. 2020. Improving massively multilingual neural machine translation and zero-shot translation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 1628-1639. +Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. 2018. mixup: Beyond empirical risk minimization. In International Conference on Learning Representations. +Yuhao Zhang, Chen Xu, Bojie Hu, Chunliang Zhang, Tong Xiao, and Jingbo Zhu. 2022a. Improving end-to-end speech translation by leveraging auxiliary speech and text data. arXiv preprint arXiv:2212.01778. +Ziqiang Zhang, Long Zhou, Junyi Ao, Shujie Liu, Lirong Dai, Jinyu Li, and Furu Wei. 2022b. Speechut: Bridging speech and text with hidden-unit for encoder-decoder based speech-text pre-training. +Chengqi Zhao, Mingxuan Wang, Qianqian Dong, Rong Ye, and Lei Li. 2021a. Neurst: Neural speech translation toolkit. 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 55-62. +Jiawei Zhao, Wei Luo, Boxing Chen, and Andrew Gilman. 2021b. Mutual-learning improves end-to-end speech translation. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 3989-3994. + +Renjie Zheng, Junkun Chen, Mingbo Ma, and Liang Huang. 2021. Fused acoustic and text encoding for multimodal bilingual pretraining and speech translation. In International Conference on Machine Learning, pages 12736-12746. PMLR. + +A For every submission: + +A1. Did you describe the limitations of your work? + +Section 7 Limitations + +A2. Did you discuss any potential risks of your work? + +Section 8 Ethic Statement + +A3. Do the abstract and introduction summarize the paper's main claims? + +Section 0 Abstract, Section 1 Introduction + +A4. Have you used AI writing assistants when working on this paper? + +Left blank. + +B Did you use or create scientific artifacts? + +Section 2 Method, Section 3 Experiments, Section 4 Analysis + +B1. Did you cite the creators of artifacts you used? + +Section 2 Method, Section 3 Experiments, Section 4 Analysis + +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? + +The datasets and models we use are for research purposes only, not for any commercial purposes. + +Our use does not violate their licenses. + +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +Our use is consistent with their intended use, and there is no special need to emphasize this as the datasets and models we use have been used in the same way in recent years. + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? + +The speech translation dataset we use is collected from public TED talks. Since they are already open on the Internet, we cannot anonymize them. The machine translation datasets we use are already anonymized, so there is no need to discuss their problems. + +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? + +Section 3 Experiments + +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. + +Appendix A Statistics of Datasets + +The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance. + +# C Did you run computational experiments? + +Section 3 Experiments + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +Section 3 Experiments + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +Section 3 Experiments, Section 4 Analysis + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +Section 3 Experiments + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +Section 3 Experiments + +# D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +No response. + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +No response. + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +No response. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +No response. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +No response. \ No newline at end of file diff --git a/cmotcrossmodalmixupviaoptimaltransportforspeechtranslation/images.zip b/cmotcrossmodalmixupviaoptimaltransportforspeechtranslation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..efbecaad8159f0878e00331c889e0b399c2401b1 --- /dev/null +++ b/cmotcrossmodalmixupviaoptimaltransportforspeechtranslation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:20223694077c8146ce965fb6cdb5c4bda43a6f0a6ab883188651be96513de3a3 +size 590032 diff --git a/cmotcrossmodalmixupviaoptimaltransportforspeechtranslation/layout.json b/cmotcrossmodalmixupviaoptimaltransportforspeechtranslation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..60067452a3840ff7a652fcb4dd2debf8ffb94eb5 --- /dev/null +++ b/cmotcrossmodalmixupviaoptimaltransportforspeechtranslation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:067f871140dc36ef4d051c0b8e8ee6afed20522c7edee53fb26d3403e4004726 +size 508048 diff --git a/coadautomaticdiagnosisthroughsymptomanddiseasecollaborativegeneration/0d4e0638-3307-41a9-8ae9-4339dd091be8_content_list.json b/coadautomaticdiagnosisthroughsymptomanddiseasecollaborativegeneration/0d4e0638-3307-41a9-8ae9-4339dd091be8_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..ccfde34ce28c25f692c3494959c09899c386856d --- /dev/null +++ b/coadautomaticdiagnosisthroughsymptomanddiseasecollaborativegeneration/0d4e0638-3307-41a9-8ae9-4339dd091be8_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e395c70f8d868aa757d1c54866944888381219ef5144aa373da5eb44c2c22be4 +size 89703 diff --git a/coadautomaticdiagnosisthroughsymptomanddiseasecollaborativegeneration/0d4e0638-3307-41a9-8ae9-4339dd091be8_model.json b/coadautomaticdiagnosisthroughsymptomanddiseasecollaborativegeneration/0d4e0638-3307-41a9-8ae9-4339dd091be8_model.json new file mode 100644 index 0000000000000000000000000000000000000000..4c954c6952f0e73c037195a8c1647b943441703f --- /dev/null +++ b/coadautomaticdiagnosisthroughsymptomanddiseasecollaborativegeneration/0d4e0638-3307-41a9-8ae9-4339dd091be8_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e160a9906632ff1e8712154be6598576325c880e3b1c42c271bdf14a3fe98b29 +size 104046 diff --git a/coadautomaticdiagnosisthroughsymptomanddiseasecollaborativegeneration/0d4e0638-3307-41a9-8ae9-4339dd091be8_origin.pdf b/coadautomaticdiagnosisthroughsymptomanddiseasecollaborativegeneration/0d4e0638-3307-41a9-8ae9-4339dd091be8_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a90de3e4cc232f263360d648ed7be3ee71a5b8af --- /dev/null +++ b/coadautomaticdiagnosisthroughsymptomanddiseasecollaborativegeneration/0d4e0638-3307-41a9-8ae9-4339dd091be8_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:43aa8fa9c4860a08f03a1050f03ef601fc0474c315660cf451b2a3d3f9a58ece +size 950845 diff --git a/coadautomaticdiagnosisthroughsymptomanddiseasecollaborativegeneration/full.md b/coadautomaticdiagnosisthroughsymptomanddiseasecollaborativegeneration/full.md new file mode 100644 index 0000000000000000000000000000000000000000..6d2b48c8994a713299e79e1134fe3056278572db --- /dev/null +++ b/coadautomaticdiagnosisthroughsymptomanddiseasecollaborativegeneration/full.md @@ -0,0 +1,324 @@ +# CoAD: Automatic Diagnosis through Symptom and Disease Collaborative Generation + +Huimin Wang $^{1*}$ , Wai-Chung Kwan $^{2,3*}$ , Kam-Fai Wong $^{2,3}$ , Yefeng Zheng $^{1}$ + +1Jarvis Lab, Tencent, Shenzhen, China + +2The Chinese University of Hong Kong, Hong Kong, China + +$^{3}$ MoE Key Laboratory of High Confidence Software Technologies, China + +{hmmmwang,yefengzheng}@tencent.com + +{wckwan,kfwong}@se.cuhk.edu.hk + +# Abstract + +Automatic diagnosis (AD), a critical application of AI in healthcare, employs machine learning techniques to assist doctors in gathering patient symptom information for precise disease diagnosis. The Transformer-based method utilizes an input symptom sequence, predicts itself through auto-regression, and employs the hidden state of the final symptom to determine the disease. Despite its simplicity and superior performance demonstrated, a decline in disease diagnosis accuracy is observed caused by 1) a mismatch between symptoms observed during training and generation, and 2) the effect of different symptom orders on disease prediction. To address the above obstacles, we introduce the CoAD, a novel disease and symptom collaborative generation framework, which incorporates several key innovations to improve AD: 1) aligning sentence-level disease labels with multiple possible symptom inquiry steps to bridge the gap between training and generation; 2) expanding symptom labels for each sub-sequence of symptoms to enhance annotation and eliminate the effect of symptom order; 3) developing a repeated symptom input schema to effectively and efficiently learn the expanded disease and symptom labels. We evaluate the CoAD framework using four datasets, including three public and one private, and demonstrate that it achieves an average $2.3\%$ improvement over previous state-of-the-art results in automatic disease diagnosis. For reproducibility, we release the code and data at https://github.com/KwanWaiChung/coad. + +# 1 Introduction + +The healthcare industry worldwide is facing an acute shortage of healthcare professionals such as doctors, nurses, and other staff, which results in millions of people not receiving the care they need, particularly in low-income countries (World Health Organization, 2016). Artificial intelligence (AI) + +![](images/44d1118cbe2b5873e694b3e31f524540b2f41cc42773f0c3b0fc9265cb057a39.jpg) +Figure 1: An example of automatic diagnosis procedure. + +has the potential to revolutionize medicine by automating tasks traditionally done by humans, reducing the time and cost of such tasks. Automatic diagnosis (AD) is a valuable application of AI in healthcare that aims to improve patient outcomes. When deployed on mobile devices, the AD agent functions as a chatbot, querying patients about their symptoms and health concerns, and directing them to the appropriate care based on the diagnosis. This allows for faster treatment decisions, prompt notification of care teams, and increased communication between providers, ultimately leading to improved patient outcomes and potentially saving lives. The process of AD can be conceptualized as a series of questions and answers. As depicted in Figure 1, the diagnosis begins with the patient reporting initial symptoms (in this example, only a headache). The AD agent then determines whether to ask for additional symptoms or provide a disease diagnosis. The agent carefully selects relevant queries to gather more information about the patient's condition. In this illustration, the agent chose to inquire about two specific symptoms, "reduced or lost sense of taste" and "runny nose", and received positive responses from the patient. The AD agent has two objectives during the question-and-answer process for diagnosis. Firstly, it strategically selects symptoms that provide the most information for disease discrimination. Secondly, it aims to identify the disease as accurately as possible. These goals are interdependent. If the agent fails to thoroughly gather information about the patient's symptoms, it risks missing crucial information related to the un + +derlying disease, resulting in an incorrect diagnosis. On the other hand, an accurate disease diagnosis enables the agent to cluster symptoms associated with the disease, thereby improving its ability to ask relevant symptom inquiries. + +A significant group of existing methods approaches AD as a sequential decision-making problem and employs reinforcement learning (RL) to solve it (Kao et al., 2018; Peng et al., 2018; Xu et al., 2019; Zhong et al., 2022). These methods focus on enhancing the RL agent's performance in disease diagnosis by incorporating medical knowledge, fine-tuning reward functions, and utilizing hierarchical model structures. However, they often overlook the agent's ability to gather symptoms. In reality, it is challenging for an RL agent to simultaneously optimize for both accurate symptom inquiry and disease diagnosis. We observed in our experiments that there were fluctuations in the performance of diseases and symptoms and the RL agent frequently fell into local minima. Additionally, many RL methods use an immediate reward of “-1” to encourage shorter turns during training, which may be beneficial for other task-oriented dialogs such as ticket Booking, but is unhelpful for training the agent in symptom inquiry. As a result, most RL-based agents only ask for one or two symptoms before prematurely moving on to disease prediction. Insufficient symptom information not only leads to incorrect disease judgment but also diminishes the reliability and interpretability of the decision. To address the limitations of RL-based methods, Chen et al. (2022) proposed a generation model to acquire symptom inquiry logic and three training tasks to train the AD agent to master symptom generation rules. Their method achieved competitive results, particularly in symptom recall, which confirms the superiority of generation-based models for diagnosis modeling. However, they did not consider the benefits of disease information. + +In this paper, we propose CoAD, a Transformer-decoder-based framework for Automatic Diagnosis that collaboratively generates disease and symptom information. CoAD utilizes three key techniques to enhance performance. First, it aligns disease labels with symptom inquiry steps, bridging the gap between training and generation for improved disease diagnosis. Second, it expands symptom labels to each sub-sequence with subsequent symptoms, making training more robust to varying symptom orders. Lastly, it incorporates a repeated symptom + +input schema and an additional symptom attention module for simultaneous optimization. + +Our main contributions include: + +- A novel framework that effectively aligns disease labels with symptom steps, bridging the gap between training and generation. +- A symptom label augmentation mechanism that strengthens training signals and enhances disease diagnosis, regardless of symptom order. +- An approach that combines repeated symptom input and symptom attention schema for concurrent symptom and disease generation. + +# 2 Related Work + +RL-based approaches. Early work in automatic diagnosis often used the Markov decision process framework and employed reinforcement learning (RL) to solve the problem. For example, Wei et al. (2018) approached it as a task-oriented dialog task and trained an agent using deep Q-learning to collect implicit symptoms during patient interactions. To improve the poor efficiency of RL-based methods, Kao et al. (2018) added contextual information to the dialog state and applied a hierarchical RL schema by dividing diseases into different body parts. Similarly, Zhong et al. (2022) employed a hierarchical setting, using a master model to trigger a low-level model comprised of symptom checkers and a disease classifier. Peng et al. (2018) developed an RL-based diagnosis model that incorporated reward shaping to guide the search for better policies and feature rebuilding to improve the agent's ability to learn correlations between features. They also integrated domain knowledge to make more accurate decisions. Similarly, Xu et al. (2019) demonstrated that incorporating medical knowledge through a knowledge-routed graph improved diagnosis performance. Furthermore, Xia et al. (2020) applied a GAN-based approach to the diagnosis problem, using the generator as a policy network, the discriminator as part of the reward function, and mutual information to encourage the model to select the most discriminative symptoms for diagnosis. + +Generation-based approaches. Generation-based diagnosis methods have shown promise in their ability to predict symptoms with stronger performance compared to reinforcement learning + +(RL)-based methods. For example, Lin et al. (2019) used a Bi-LSTM to encode symptom word sequences and trained a sequence-to-sequence model with a CRF decoder to recognize symptoms based on a symptom graph, document-level and corpus-level attentions. More recently, Chen et al. (2022) aimed to alleviate the inefficiencies of exploration and sparse rewards in RL by formulating the diagnosis process as a sequence generation problem and using a Transformer-based network to learn symptom sequences and disease classifiers through three training tasks. Their model demonstrated significant improvements over RL-based counterparts. + +# 3 Sequence Generation based AD + +The process of AD involves predicting a disease by asking a series of questions about potential symptoms from a patient who has provided initial symptoms (Peng et al., 2018). AD aims to optimize for two goals simultaneously: 1) asking questions to gain the most information about the patient's condition, and 2) identifying the disease quickly and accurately. In this study, we approach the problem of AD as a combined task of generating a sequence of symptoms and classifying the disease. Let $S$ denote the set of symptoms and $\mathcal{D}$ denote the set of diseases. An AD dataset considers a set of possible symptom profiles: $X_{s} = s_{E}^{1},\dots ,s_{E}^{N},s_{I}^{1},\dots ,s_{I}^{M}$ with the symptoms' status of True, False, Uncertain, where $s_E^i,(i = 1,2,\dots ,N)$ are the initial reported symptoms (i.e., explicit symptoms), and $N$ is the number of explicit symptoms; $s_I^i,(i = 1,2,\dots ,M)$ are the subsequent acquired symptoms (i.e., implicit symptoms), and $M$ is the number of implicit symptoms. In the proposed method, CoAD, we represent a symptom status as 1 if the patient confirms having that symptom, 2 if the patient does not have it, or 0 if the patient is uncertain about having it or not. During diagnosis, CoAD will inquire about a symptom $s\in S$ or produce an end token, signaling the end of symptom checking and switching to predicting a disease $d\in \mathcal{D}$ . + +During the diagnosis process, the AD system that interacts with a patient can be thought of as an agent. The agent's goal is to ask questions about key symptoms that will lead to a quick and accurate disease diagnosis. Since symptoms are acquired in chronological order, it is common to factorize the joint probabilities of symptoms as the product of + +conditional probabilities: + +$$ +\mathcal {P} _ {\theta} \left(s _ {I} ^ {1: M} \mid s _ {E} ^ {1: N}\right) = \prod_ {K = 1} ^ {M} \mathcal {P} _ {\theta} \left(s _ {I} ^ {K} \mid s _ {I} ^ {1: K - 1}, s _ {E} ^ {1: N}\right), \tag {1} +$$ + +where $s_E^{1:N}$ denotes $\{s_E^1,\dots ,s_E^N\}$ and $s_I^{1:M}$ denotes $\{s_I^1,\dots ,s_I^M\}$ . In practice, the probabilities can be approximated by a network parameterized by $\theta$ . Once enough symptoms that aid in distinguishing the disease has been acquired, the agent proceeds to make a disease prediction. Let $d^{*}$ denote the given disease label of the symptoms. The agent's goal is to learn a strategy that can select $d^{*}$ with a high probability $\mathcal{P}_{\theta}(d^{*}|s_{I}^{1:M},s_{E}^{1:N})$ . + +Disease Accuracy, Symptom Recall, and Combined Score. Enhancing symptom recall may lead to a decrease in disease accuracy, meaning that the agent's diagnostic performance could suffer when it achieves optimal symptom recall. This is because most previous models with higher symptom recall tend to have longer turns in a limited-turns setting. Longer sequences are less common in the training set, resulting in a distribution mismatch between training and testing that hinders the model's ability to accurately identify diseases. Consequently, disease accuracy and symptom recall tend to have an inverse correlation during testing in limited-turns settings. To comprehensively measure the diagnosis performance, we introduce a combined score, $Cs = \frac{2\cdot Rc\cdot Ac}{(Rc + Ac)}$ , which indicates the tradeoff between high disease-prediction accuracy and high symptom-acquisition recall. + +# 4 Symptom and Disease Collaborative Generation Framework + +Even though the generation-based method has great potential in AD (Chen et al., 2022), applying this method to the disease diagnosis task faces two challenges. First, the disease classifier is trained on a complete symptom sequence but is only tested on partial symptoms, which creates a gap between the visible symptoms in training and inference. Second, the order of symptoms in the training set can be inconsistent with the generated ones, which can lead to a wrong diagnosis if the symptoms in different order are incorrectly identified as different symptom sequences. To address the first challenge, we propose a disease and symptom collaborative generation framework, in which the disease label $d^{*}$ is expanded to multiple possible symptom steps + +to fill the gap of supported symptoms between training and generation. We refer to this disease label expansion procedure as $d$ -label alignment. To tackle the second challenge, we present a symptom label augmentation mechanism (called $s$ -label augmentation) that enriches the annotation and eliminates the impact of the symptoms order. Furthermore, we design a repeated symptom input schema for efficient and effective learning from the expanded disease and symptom labels. Our strategies are illustrated in Figure 3, in which a Transformer decoder takes the repeated symptom embedding, symptom status embedding, and symptom mask as input. Additionally, a symptom head and a disease head are equipped to predict the $s$ -labels and $d$ -labels, respectively. We will provide more details in the following sections. + +# 4.1 $d$ -label Alignment + +The idea behind $d$ -label alignment is straightforward: we assign the disease label $d^{*}$ of a symptom sequence $\{s_{E}^{1:N}, s_{I}^{1:M}\}$ to each available implicit symptom $s_{I}^{K} \in s_{I}^{1:M}$ . A symptom $s$ is considered available if the sub-sequence $\{s_{E}^{1:N}, s_{I}^{1:K}\}$ is not present in the training set. The number of generated symptoms is much less than the number of symptoms that a patient actually has. The key to making this work is through data augmentation, transforming one symptom sequence with one disease label into multiple symptom sequences corresponding to the same disease label. This augmentation helps to fill the gap in symptoms supporting diagnoses between training and generation. At the same time, filtering out the unavailable symptoms reduces the impact of $d$ -label alignment on the samples with disease labels. Additionally, $d$ -label alignment results in a disease generation task, since each symptom corresponds to a disease label if we assign a special token to unavailable symptoms that are ignored during training. This enables the joint probabilities of disease sequences over symptoms to be factored as the product of conditional probabilities: + +$$ +\begin{array}{l} \mathcal {P} _ {\theta} \left(d ^ {*}, d ^ {1: M} \mid s _ {I} ^ {1: M}, s _ {E} ^ {1: N}\right) = \mathcal {P} _ {\theta} \left(d ^ {*} \mid s _ {I} ^ {1: M}, s _ {E} ^ {1: N}\right) \\ \prod_ {K = 1} ^ {M} \mathcal {P} _ {\theta} \left(d ^ {K} \mid s _ {I} ^ {1: K - 1}, s _ {E} ^ {1: N}\right), \tag {2} \\ \end{array} +$$ + +where $d^{1:M}$ are the assigned disease labels to the implicit symptoms, and $d^{*}$ is the originally given label for the piece of the sample. + +![](images/94d17c2d3f610a0d8aaf6c6a452a82cf5a382d8c542ef28130f18ccb812122ba.jpg) +Expanded Symptom Labels + +![](images/d6f569cdf9723c886c8dd96880fced21ea18b10d9d2cc2c12f7803bf91cde64d.jpg) +Figure 2: An example of how symptom labels and disease labels are expanded and the corresponding repeated symptom input is as follows. We use different colors to mark the symptom transfer. The dashed box contains the original explicit symptoms, implicit symptoms, and the related disease label. $d^{*} =$ Allergy Rash. $d^{1}(d^{2},d^{3})$ is equal to $d^{*}$ if Sneezing (Allergy, Rash) is an available symptom, otherwise it is #. + +# 4.2 $s$ -label Augmentation + +As mentioned above, the order of symptoms can potentially affect diagnosis accuracy. In this section, we investigate whether we can use $s$ -label augmentation to provide better training signals to reduce the effects of symptom order. $s$ -label augmentation is based on the assumption that determining a disease is independent of the order of symptoms. Taking advantage of this disorder, we perform additional data augmentation with symptom labels. A sub-sequence of symptoms $s_{I}^{1:K}$ not only has the symptom label of the next symptom $s_{I}^{K+1}$ , but also of the subsequent symptoms $s_{I}^{K+1:M}$ . Instead of using the original single symptom label of $\{s_{E}^{1:N}, s_{I}^{1:M}\}$ , we replace it with all possible implicit symptom labels and rewrite it as: + +$$ +\overbrace {s _ {I} ^ {1} , \cdots , s _ {I} ^ {M}} ^ {M}, \dots , \overbrace {s _ {I} ^ {K + 1} , \cdots , s _ {I} ^ {M}} ^ {M - K}, \dots , \overbrace {s _ {I} ^ {M}} ^ {1}, \# +$$ + +where $\#$ is the token ignored during training. We denote the expanded symptom labels as $s_{I}^{1:M'}$ , where $M'$ is calculated as $M' = (1 + M) \cdot M/2 + 1$ . Then the joint probabilities of $s_{I}^{1:M'}$ over the symptoms are as follows: + +$$ +\mathcal {P} _ {\theta} \left(\widetilde {\left(s _ {I} ^ {1 : M ^ {\prime}} \right| s _ {E} ^ {1 : N}}\right) = \prod_ {K = 1} ^ {M} \prod_ {T = K} ^ {M} \mathcal {P} _ {\theta} \left(s _ {I} ^ {T} \mid s _ {I} ^ {1: K - 1}, s _ {E} ^ {1: N}\right). \tag {3} +$$ + +![](images/0e46163b4fbae6c167e22b2ad825836a4d37a86c57cb4bd1ceb8b7966aff63a4.jpg) +Figure 3: illustration of CoAD framework, where the input explicit symptoms are $s_{E}^{1}, \dots, s_{E}^{N}$ , the implicit symptoms are $s_{I}^{1}, \dots, s_{I}^{M}$ , and the disease label is $d^{*}$ . It takes the repeated symptom input along with the symptom type and the symptom mask as input and aims to predict the $d$ -labels and $s$ -labels to learn the diagnostic logic. + +Similarly, the aligned disease labels can also be expanded to align with $s_{I}^{1:M'}$ as the following: + +$$ +\overbrace {d _ {1} ^ {1} , \cdots , d _ {M} ^ {1}} ^ {M}, \dots , \overbrace {d _ {K + 1} ^ {K + 1} , \cdots , d _ {M} ^ {K + 1}} ^ {M - K}, \dots , \overbrace {d ^ {M - 1}} ^ {1}, d ^ {*}, +$$ + +where $d_T^K$ is given following the $d$ -label assignment rules, i.e., it is $d^*$ if $s_I^T$ is the available symptom of sequence $\{s_E^{1:N}, s_I^{1:K-1}, s_I^T\}$ , else it is $\#$ . We denoted the expanded aligned disease labels as $\widetilde{d^{1:\widetilde{M}'}}$ , then the joint probabilities of $\widetilde{d^{1:\widetilde{M}'}}$ over the symptoms are given as: + +$$ +\begin{array}{l} \mathcal {P} _ {\theta} \left(d ^ {*}, \widetilde {d ^ {1 : M ^ {\prime}}} \mid s _ {I} ^ {1: M}, s _ {E} ^ {1: N}\right) = \mathcal {P} _ {\theta} \left(d ^ {*} \mid s _ {I} ^ {1: M}, s _ {E} ^ {1: N}\right) \\ \prod_ {K = 1} ^ {M} \prod_ {T = K} ^ {M} \mathcal {P} _ {\theta} \left(d _ {T} ^ {K} \mid s _ {I} ^ {1: K - 1}, s _ {E} ^ {1: N}\right). \tag {4} \\ \end{array} +$$ + +Repeated Symptom Input. Now that we have obtained the expanded symptom and disease labels, we will explain how to expand the input symptoms to align with the labels in an auto-regression generation model. The solution is straightforward, as shown in Figure 2, we simply repeat the symptoms as many times as their corresponding expanded symptom or disease labels. For example, in Figure 2, the last explicit symptom Sneezing has 3 extended symptom labels Allergy, Rash and Dyspnea, thus it will be repeated 3 times. Formally, an implicit symptom $s_{I}^{K}$ will be repeated $M - K + 1$ times. To this end, the repeated symptom inputs are represented as: + +$$ +\overbrace {s _ {E} ^ {N} , \cdots , s _ {E} ^ {N}} ^ {M}, \overbrace {s _ {I} ^ {1} , \cdots , s _ {I} ^ {1}} ^ {M - 1}, \dots , \overbrace {s _ {I} ^ {K} , \cdots , s _ {I} ^ {K}} ^ {M - K}, \dots , \overbrace {s _ {I} ^ {M - 1}} ^ {1}, s _ {I} ^ {M}. +$$ + +We denote the repeated symptom input as $s^{1:M'}$ rept, the mappings between $s^{1:M'}$ rept and $d^{1:M'}$ as well as $s_{rept}^{1:M'}$ and $s_I^{1:M'}$ . In addition to the repeated symptom input, extra symptom attention is integrated to mask the redundant input symptoms. Specifically, in each multi-head attention of the Transformer block, each repeated symptom can only see itself, the explicit symptoms, and only one of the previous repeated symptoms. Formally, the representations of symptom tokens are updated in multi-head attention as: + +$$ +\left(s _ {I (r e p t)} ^ {K ^ {\prime}}\right) ^ {l} \left\{\begin{array}{c}\leftarrow \mathrm {M H - A t t n} \left(Q = \left(s _ {I (r e p t)} ^ {K ^ {\prime}}\right) ^ {(l - 1)}, \right.\\K V = \left[ \left(s _ {I (r e p t)} ^ {X}\right) ^ {(l - 1)}, \left(s _ {E} ^ {1: N - 1}\right) ^ {(l - 1)} \right])\\\text {i f} K > M\\\leftarrow \mathrm {M H - A t t n} \left(Q = \left(s _ {I (r e p t)} ^ {K ^ {\prime}}\right) ^ {(l - 1)}, \right.\\K V = \left[ \right. s _ {I (r e p t)} ^ {K ^ {\prime}}\left. \right) ^ {(l - 1)}, \left(s _ {E} ^ {1: N - 1}\right) ^ {(l - 1)} \bigg ]\left. \right) \quad \text {e l s e},\end{array}\right. \tag {5} +$$ + +where $Q,K,V$ are the query, key, and value in multi-head attention respectively. [] represents the concatenation along the symptom sequence dimension, $(s_{I}^{K^{\prime}}(rept))^{l}$ indicates the $l^{th}$ Transformer block layer output of the $K^{\prime th}$ repeated symptoms input, and $X = \{\frac{(K + 1)(2\cdot M - K)}{2}\} ,K =$ $0,1,\dots$ , such that $X < K^{\prime}$ . Significantly, $s_{I(rept)}^{M^{\prime}}$ is anchored for the final diagnosis with only disease label $d^{*}$ , its representation of the $l^{th}$ layer is updated in multi-head attention as MH-Attn $(Q = (s_{I(rept)}^{M^{\prime}})^{(l - 1)},KV =$ $\left[(s_{I(rept)}^{\{\frac{(K + 1)(2\cdot M - K)}{2},M^{\prime}\}})(l - 1),(s_{E}^{1:N - 1})^{(l - 1)}]\right),$ where $K = 0,\dots ,M$ + +The symptom attention mechanism is a key aspect of the repeated symptom input, functioning as a form of data augmentation akin to dropout noise in accomplished by Transformer training (Vaswani et al., 2017). This is achieved by placing dropout + +masks on both the fully-connected feed-forward layers and the attention probabilities. During repeated symptom generation, dropout noise serves as data augmentation by independently sampling dropout masks (Gao et al., 2021). This process involves feeding the same samples to the decoder multiple times and performing data augmentation. + +It is important to note that the key distinction between our approach and a simple symptom permutation method lies in the dropout noise applied to the explicit symptoms. In the permutation approach, different representations of the explicit symptoms are used as context due to varying dropouts applied to each separate augmented sample. In contrast, our method with the addition of the $S$ -label utilizes the same representations of the explicit symptoms as context for all subsequent implicit symptoms. Maintaining the stability of the explicit symptoms' representation is essential for the model to learn more effectively. + +Collaborative Generation Loss. We follow the auto-regression framework in (Vaswani et al., 2017) and take a cross-entropy objective to learn the expanded labels $\widetilde{d^{1:M'}}$ and $\widetilde{s_I^{1:M'}}$ jointly as minimizing the following loss: + +$$ +\begin{array}{l} \mathcal {L} _ {\theta} = - \sum_ {K = 1} ^ {M} \sum_ {T = K} ^ {M} W ^ {K} \cdot \left[ \log \mathcal {P} _ {\theta} (s _ {I} ^ {T} | s ^ {1: K - 1}, s _ {E} ^ {N}) + \right. \\ \left. \log \mathcal {P} _ {\theta} (d _ {T} ^ {K} | s ^ {1: K - 1}, s _ {E} ^ {N}) \right] + \log \mathcal {P} _ {\theta} (d ^ {*} | s ^ {1: M}, s _ {E} ^ {N}) \\ = - \sum_ {K ^ {\prime} = 1} ^ {M ^ {\prime}} W ^ {K ^ {\prime}} \cdot \left[ \log \mathcal {P} _ {\theta} \left(\widetilde {s _ {I} ^ {K ^ {\prime}}} \mid s _ {r e p t} ^ {1: K ^ {\prime} - 1}, s _ {E} ^ {N}\right) \right. \\ \left. + \log \mathcal {P} _ {\theta} \left(\widetilde {d ^ {K ^ {\prime}}} \mid s _ {r e p t} ^ {1: K ^ {\prime} - 1}, s _ {E} ^ {N}\right) \right], \tag {6} \\ \end{array} +$$ + +where $W^{K} = \frac{1}{M - T + 1}$ is the weight added to normalize the $\sum_{T = K}^{M}\log \mathcal{P}_{\theta}(s_I^T |s^{1:K - 1},s_E^N)$ , and $W^{K'}$ is the weight to normalize the losses of the expanded labels in the repeated symptom input. It can be set as $\frac{1}{M - n - 1}$ , where $\frac{n(2\cdot M - n + 1)}{2} < K' \leq \frac{(n + 1)(2\cdot M)}{2}$ . + +# 5 Experiments + +Datasets. We evaluate our model on three public datasets: Dxy (Xu et al., 2019), MuZhi (Wei et al., 2018), MuZhi-2, and one in private—Ped. We only consider datasets collected from real clinical practice and exclude the Synthetic dataset (Liao et al., 2020). Additional detail of the data is given in Appendix 1. + +Baselines. In order to evaluate the effectiveness of RL-based AD models, we utilize several established techniques as benchmark models including: DQN (Wei et al., 2018) agent which uses Deep Q-Network to learn an agent that chooses a symptom to inquire about or outputs the disease diagnosis; PPO (Schulman et al., 2017) agent which is a Proximal Policy Optimization (Schulman et al., 2017) based agent that learns diagnosis model with a GPT-2 backbone, and Hierarchical DQN (HDQN) (Liao et al., 2020) agent which is a DQN-based hierarchical policy that has a master selecting the disease and a separate worker for each disease to inquire symptoms. Additionally, we include the current leading Transformer-based model, Diaformer (Chen et al., 2022) agent which formulates AD as a sequence generation task and learns a Transformer-based model to learn the generation of symptom inquiry and disease diagnosis. + +Ablation Study. Some CoAD's variants include GPT-2_dis agent which is based on GPT-2 (Radford et al., 2019) that generates symptoms in an autoregressive manner and predicts the disease at the end; $\mathbf{C}\mathbf{o}\mathbf{A}\mathbf{D}_{w / o s}$ agent which is a variant of CoAD that is trained without $s$ -label using the same hyperparameters of CoAD; $\mathbf{C}\mathbf{o}\mathbf{A}\mathbf{D}_{w / o d}$ agent which is a variant of CoAD that is trained without $d$ -label using the same hyperparameters of CoAD. Meanwhile, a BERTfull (Devlin et al., 2019) agent which uses BERT as the backbone to classify disease given the full ground truth symptoms is compared. + +# 5.1 Experiment Setup + +Evaluation Metrics. We evaluate the performance of the models using four metrics: implicit symptom recall, disease accuracy, average inquiry turns, and a combined score. The combined score is calculated as the harmonic mean of disease accuracy and implicit symptom recall, providing an overall measure of the model's effectiveness in both disease diagnosis and symptom inquiry. To ensure the reliability of the findings, all evaluation results are derived from the average of five distinct groups. + +Training Setting. To gain insight into the behavior of the models under different conditions, we conduct experiments in both limited turn and fixed turn modes. In the fixed turn mode, the models are required to inquire about symptoms within a fixed number of turns. In the limited turn mode, there is a maximum turn limit for symptom inquiry, but + +
ModelDxyMuzhiMuzhi-2Ped
Ac↑Rc↑Cs↑T↓Ac↑Rc↑Cs↑T↓Ac↑Rc↑Cs↑T↓Ac↑Rc↑Cs↑T↓
BERTfull0.83---0.73---0.65---0.34---
DQN†0.720.320.442.40.690.300.423.1--------
PPO0.780.310.454.70.720.230.354.50.590.180.286.60.360.280.3111.9
H-DQN†0.700.160.262.40.690.280.403.5--------
Diaformer†,‡0.830.830.8313.10.740.750.7515.30.640.610.6311.50.510.830.6314.3
GPT-2dis0.830.900.8715.80.720.740.7317.60.630.620.6216.20.480.810.6018.8
CoADw/od0.830.930.8815.10.720.830.7716.20.650.670.6616.90.520.870.5417.1
CoADw/os0.840.840.8414.90.700.810.7515.20.640.670.6516.20.520.840.6418.3
CoAD*0.850.930.8910.50.750.830.7913.40.650.680.6613.80.530.920.6715.4
+ +Table 1: The average disease accuracy $(Ac)$ , implicit symptom recall $(Rc)$ , combined score $(Cs)$ , and number of turns $(T)$ on the four datasets with 20 limited turns. $\dagger$ : The results on Dxy and Muzhi are reported by Chen et al. (2022). $\ddagger$ : The results on Muzhi-2 and Ped are obtained by running the authors' released code. The symbol * signifies a significant level of $p < 0.05$ when compared to both the baselines and CoAD's variants. + +the models are allowed to stop before reaching the limit. To ensure a fair comparison with the previous state-of-the-art Diaformer (Chen et al., 2022), we use the same turn numbers (5, 10, 15, and 20) in our experiments. Additional implementation is shown in Appendix B. + +Main results. Table 1 shows the evaluation results on four AD number of 20 turns. For the models DQN and H-DQN, we cite the results from (Chen et al., 2022) where only the results for Dxy and Muzhi are available. The main results indicate that the proposed CoAD model achieves the highest disease accuracy, symptom recall, and combined score on all datasets, demonstrating the effectiveness of the $d$ -label and $s$ -label for AD. Compared to the previous state-of-the-art model, Diaformer, CoAD shows a significant improvement in disease accuracy, for example, in the Ped dataset the gain of CoAD is $3.92\%$ . The improvement in disease accuracy is a result of the combined effects of the $d$ -label and $s$ -label. Specifically, the $s$ -label helps CoAD capture symptom relationships in different sequences, while the $d$ -label helps CoAD generalize better to unseen symptom sequences. Furthermore, CoAD achieves a substantial improvement in symptom recall in all datasets over Diaformer with at least $10\%$ improvement, highlighting the potential of repeated symptom input in improving the model's ability to inquire about appropriate symptoms during diagnosis. Notably, both Muzhi-2 and Ped contain negative symptom statuses, adding complexity to the symptom sequence input and providing more challenges to learning the relationships between symptoms and the target disease. However, both $d$ -label alignment and $s$ -label augmentation consistently bring improvements regardless of + +the setting. + +It is worth noting that all the reinforcement learning (RL) methods present poor performance in terms of symptom recall, which is not unexpected as they tend to inquire about a limited number of symptoms and stop at early turns. The early stop of RL-based methods can be attributed to intermediate negative rewards, which incentivize the model to end in as few turns as possible for efficiency. On the other hand, generation-based methods are generally capable of probing more symptoms compared to RL-based methods. Notably, CoAD achieves the best performance with shorter turns in comparison to other generation-based methods, demonstrating the effectiveness and efficiency of CoAD's diagnostic logic. + +Finally, the BERTfull model is trained to predict the disease based on the sequence of ground truth symptoms. Intuitively, we expected this model to provide the theoretical upper bound for disease accuracy. However, both Diaformer and CoAD outperform BERTfull in all datasets except Muzhi-2. This is not surprising as there can be irrelevant symptoms that negatively impact the accuracy of decision-making for disease diagnosis. Additionally, BERTfull model lacks the ability to distinguish the symptoms that are relevant to the final diagnosed disease. + +Diagnosis with smaller limited turns. Table 2 presents the results of automatic diagnosis with smaller limited turns (i.e., 5, 10, 15) on the four datasets. The results indicate that CoAD consistently outperforms Diaformer in terms of disease accuracy, symptom recall, and combined score, demonstrating the robustness of the proposed methods under different limited turn settings. Specif + +
Max TurnsModelDxyMuzhiMuzhi-2Ped
Ac↑Rc↑Cs↑T↓Ac↑Rc↑Cs↑T↓Ac↑Rc↑Cs↑T↓Ac↑Rc↑Cs↑T↓
5DQN†0.650.310.422.50.640.290.402.9--------
PPO0.730.240.362.60.720.180.292.10.580.140.223.20.390.160.224.2
H-DQN†0.700.150.251.90.680.290.402.9--------
Diaformer†,‡0.770.550.644.80.720.470.575.00.600.390.474.90.460.580.494.4
GPT-2_dis0.720.580.644.80.700.510.605.00.570.330.425.00.400.420.413.3
CoADw/od0.750.590.655.00.700.520.605.00.580.380.425.00.420.600.494.4
CoADw/os0.750.560.644.40.700.510.595.00.580.340.435.00.440.580.504.5
CoAD*0.790.560.654.90.720.530.614.80.600.390.475.00.470.610.534.6
10DQN†0.720.320.442.70.680.300.413.0--------
PPO0.750.300.433.60.680.200.312.40.610.150.243.50.370.280.327.8
H-DQN†0.720.160.262.30.700.270.393.3--------
Diaformer†,‡0.810.780.799.60.730.660.699.80.620.580.599.80.500.760.587.8
GPT-2_dis0.800.790.799.70.710.700.709.70.600.500.5410.00.420.450.434.2
CoADw/od0.820.830.829.70.710.710.719.60.620.510.5610.00.440.750.555.0
CoADw/os0.780.790.789.60.730.700.719.50.600.510.569.80.460.710.567.4
CoAD*0.850.800.839.30.730.700.719.40.620.580.609.90.510.780.628.1
15DQN†0.710.320.442.70.680.300.413.0--------
PPO0.770.300.434.10.740.240.374.00.620.120.213.50.370.230.286.5
H-DQN†0.720.160.262.30.700.270.393.4--------
Diaformer†,‡0.830.830.8312.40.740.730.6913.80.620.640.6212.40.500.810.609.3
GPT-2_dis0.830.850.8413.50.680.760.7214.80.600.580.5915.00.410.520.469.2
CoADw/od0.840.910.8814.50.720.800.7614.30.630.630.6415.00.450.840.599.6
CoADw/os0.820.890.8514.30.710.800.7514.60.630.620.6314.70.460.820.598.6
CoAD*0.850.900.8813.50.750.800.7713.60.640.620.6415.00.510.860.6410.2
+ +Table 2: The results on the four datasets in three limited turn settings are presented. The notations $Ac$ , $Rc$ , $Cs$ , $T$ are defined in Table 1. The results on Dxy and Muzhi were reported by Chen et al. (2022) and marked with $\dagger$ . The results on Muzhi-2 and Ped were obtained by running the authors' released code and are marked with $\ddagger$ . The symbol * signifies a significant level of $p < 0.05$ when compared to both the baselines and CoAD's variants. + +ically, CoAD shows significant improvements in disease accuracy and symptom recall compared to previous results. As the allowed turns increase, we observe a monotonic improvement in both disease accuracy and symptom recall, indicating that CoAD can provide a better-quality diagnosis with more turns. + +Diagnosis with fixed turns. For fairer comparisons, we evaluate the models under a fixed number of turns and the results are presented in Figure 4 in Appendix C. We choose the fixed turns as 5, 10, and 15. The DQN-based method (Wei et al., 2018) is not considered as it uses a single action space for both disease and symptoms, making it only suitable for limited turn settings. Overall, the results indicate that CoAD achieves the best performance across all evaluation metrics on all datasets with different fixed turns (except for the disease accuracy of Muzhi with a fixed turn of 15). Notably, the improvement is more substantial in shorter turns (8.2% in 15 turns vs 2.5% in 5 turns increase on average over Diaformer), showcasing the strength of CoAD in real-life deployment scenarios where efficiency is crucial. + +In terms of symptom recall, CoAD consistently outperforms the other models by a wide margin. + +The largest improvement is $24\%$ on the Muzhi dataset with five fixed turns over Diaformer. In contrast, the improvement in disease accuracy is relatively modest. The significant improvement in symptom recall aligns with expectations, as the $d$ -label augmentation encourages CoAD to explore the relationship between intermediate symptoms and the final disease during training, allowing CoAD to inquire about the most relevant symptoms for distinguishing different diseases. As a result, CoAD is able to make correct diagnostic decisions even with insufficient symptoms. Therefore, when CoAD is forced to inquire about more symptoms in the fixed turns, the additional symptoms provide less value in diagnosis compared to other models. + +Ablation Studies. To further understand the contributions of the different components of CoAD, we conduct a series of ablation studies to isolate the effects of $s$ -label augmentation and $d$ -label augmentation. In Table 1 and Table 2, we can observe that CoAD $w / o$ $d$ consistently improves symptom recall across all datasets and different limited turns. These results indicate that the $s$ -label is effective in guiding the model to inquire about informative symptoms, leading to more accurate diagnoses and, as a result, better disease accuracy in most settings. + +On the other hand, $\mathrm{CoAD}w / o s$ improves disease accuracy over GPT-2 $_{dis}$ in most settings (e.g., an improvement of $12\%$ in the Ped dataset), highlighting the effectiveness of $d$ -label augmentation. Furthermore, the combination of $d$ -label and $s$ -label is beneficial as CoAD achieves the best disease accuracy and combined score in all settings, and better symptom recall in most cases. + +# 6 Conclusions + +This paper introduces CoAD, a symptom and disease co-generation framework, which significantly improves the state-of-the-art in symptom prediction and disease determination for automatic diagnosis. CoAD addresses the discrepancy between visible symptoms during training and generation through disease label alignment, mitigates the impact of symptom order on diagnosis through symptom label augmentation, and utilizes a repeated symptoms input schema to enable the model to simultaneously learn aligned diseases and expanded symptoms efficiently. CoAD presents a novel approach to data augmentation by reusing labels and text input, and it can be extended to other joint learning tasks for generation and classification. + +# Limitations + +In this work, we have identified two key limitations of CoAD that can be further examined in future research. The first limitation is that CoAD only allows for the querying of one symptom at a time, making it unsuitable for scenarios where multiple symptoms are present. However, CoAD has superior performance in the main metrics for automatic diagnosis. To relieve this limitation, potential solutions include relaxing symptom feedback conditions and allowing the model to produce symptoms sequentially until a stop signal is encountered or querying the top K symptoms in a single turn. + +Additionally, CoAD has some restrictions on input format, requiring standardized symptoms and values. To make it more applicable to end-to-end settings, an natural language understanding module (NLU) is required to parse plain text and obtain the input symptom sequence, and a natural language generation (NLG) module is needed to translate the predicted symptom or disease to text. The ultimate goal of automatic diagnosis is to support the dialogue between doctors and patients, after CoAD determines the symptom or disease, rule-based NLU and NLG modules can help to achieve + +the text to text communication. + +# Ethics Statement + +Our work adheres to the ACL Ethics Policy. This paper aims to investigate generative model-based approaches for learning automatic diagnostic logic, with the objective of reducing the burden on doctors and promoting the advancement of automatic diagnosis systems. It is crucial to emphasize that the proposed methods are designed solely for research purposes and are not suitable for direct clinical application due to the potential risks associated with the misuse of automatic diagnosis systems. + +It is important to note that the introduced dataset (Ped) was sourced from genuine electronic medical records, with all patient privacy-related information meticulously eliminated. To ensure data privacy and security, we performed a comprehensive manual review of the dataset, confirming that it contains no identifiable or offensive pieces of information within the experimental dataset. + +# Acknowledgements + +We appreciate the constructive and insightful comments provided by the anonymous reviewers. This research work is partially supported by CUHK under Project No. 3230377. + +# References + +Junying Chen, Dongfang Li, Qingcai Chen, Wenxiu Zhou, and Xin Liu. 2022. Diaformer: Automatic diagnosis via symptoms sequence generation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pages 4432-4440. +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. +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. +Hao-Cheng Kao, Kai-Fu Tang, and Edward Chang. 2018. Context-aware symptom checking for disease diagnosis using hierarchical reinforcement learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32. + +Kangenbei Liao, Qianlong Liu, Zhongyu Wei, Baolin Peng, Qin Chen, Weijian Sun, and Xuanjing Huang. 2020. Task-oriented dialogue system for automatic disease diagnosis via hierarchical reinforcement learning. arXiv preprint arXiv:2004.14254. +Xinzhu Lin, Xiahui He, Qin Chen, Huaixiao Tou, Zhongyu Wei, and Ting Chen. 2019. Enhancing dialogue symptom diagnosis with global attention and symptom graph. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing, pages 5033-5042. +Yu-Shao Peng, Kai-Fu Tang, Hsuan-Tien Lin, and Edward Chang. 2018. Refuel: Exploring sparse features in deep reinforcement learning for fast disease diagnosis. In Advances in Neural Information Processing Systems, volume 31. +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. +John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. 2017. Proximal Policy Optimization Algorithms. arXiv:1707.06347 [cs]. +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. +Zhongyu Wei, Qianlong Liu, Baolin Peng, Huaiqiao Tou, Ting Chen, Xuan-Jing Huang, Kam-Fai Wong, and Xiang Dai. 2018. Task-oriented dialogue system for automatic diagnosis. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 201-207. +World Health Organization. 2016. Health workforce requirements for universal health coverage and the sustainable development goals. +Yuan Xia, Jingbo Zhou, Zhenhui Shi, Chao Lu, and Haifeng Huang. 2020. Generative adversarial regularized mutual information policy gradient framework for automatic diagnosis. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 1062-1069. +Lin Xu, Qixian Zhou, Ke Gong, Xiaodan Liang, Jianheng Tang, and Liang Lin. 2019. End-to-end knowledge-routed relational dialogue system for automatic diagnosis. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 7346-7353. +Cheng Zhong, Kangenbei Liao, Wei Chen, Qianlong Liu, Baolin Peng, Xuanjing Huang, Jiajie Peng, and Zhongyu Wei. 2022. Hierarchical reinforcement learning for automatic disease diagnosis. Bioinformatics. + +# A Dataset + +The statistics of these datasets can be found in Table 3. We evaluate our model on four datasets: + +
DatasetDxyMuzhiMuzhi-2Ped
# Disease54644
# Symptom4166347273
Symptom typeTrueTrueTrue/FalseTrue/False
Average length4.75.79.99.6
# Training42156818825000
# Test1041421651000
+ +- Dxy dataset was collected from a popular Chinese healthcare website1, where users can communicate with doctors online. The dataset records the interactions between patients and doctors, where the doctor collects more symptoms from the patient based on the initial reported symptoms. At the end of the interaction, the patient receives a diagnosis. This dataset only includes positive symptoms. +- MuZhi dataset was collected from another popular Chinese online healthcare website.2 The setup of this website is similar to Dxy, and it also only includes positive symptoms. +- MuZhi-2 dataset was collected from the first intelligent interactive diagnosis and treatment competition (CCL 2021). Each record contains the symptoms and exams explicitly mentioned in the patients' chief complaints and in the conversations between the patient and the doctor. The symptoms recorded in this dataset include both positive and negative symptoms. +- Ped dataset was extracted from more than 6000 pediatric electronic medical records. Each piece of data consists of the symptoms mentioned in a record and the disease diagnosis given by the doctor. Similar to Muzhi-2, it includes both positive and negative symptoms. + +# B Implementation + +Specifically, we use the small variant of the Transformer's decoder (Vaswani et al., 2017) $(\mathrm{L} = 6$ $\mathrm{H} = 768$ $\mathrm{A} = 6)$ as the backbone of CoAD. The disease head and symptom head are fully connected + +Table 3: The statistics of the four datasets. + +
DatasetLearning rateBatch size
Dxy5 × 10-664
Muzhi1 × 10-664
Muzhi-25 × 10-632
Ped1 × 10-632
+ +Table 4: The training hyperparameters for each dataset. + +layers that map the hidden states of the decoder to the appropriate output space. In the fixed turn setting, the hidden state of the last symptom is used as input for the disease head. In the varied turn setting, the model terminates symptom inquiries by predicting the end token and proceeds with disease diagnosis immediately. The batch size and learning rate for each dataset are presented in Table 4. + +# C Comparison of Fixed Turns + +![](images/55de5076021f01a8b9c473047fba37940bd41c24aade2fb460a7518c083819d7.jpg) +Figure 4: The average disease accuracy (Ac), implicit symptom recall (Rc), and combined score (Cs) of different models in the four datasets with 5, 10, and 15 fixed turns. + +![](images/112d13def08a6a317fe25f405985e34ac3532835150bd986a6a4be83ad3254cb.jpg) + +![](images/395dd8b5bc3a86af2046b4821a312f7fd0e67f2811ea2f74583fffc8da81b49b.jpg) + +![](images/2d353a533a95511358cbbcee4623fbe3ee412991fbe19f5246f22eaf96d3cda1.jpg) + +A For every submission: + +A1. Did you describe the limitations of your work? Limitations. +A2. Did you discuss any potential risks of your work? Ethics Statement. +A3. Do the abstract and introduction summarize the paper's main claims? Abstract. +A4. Have you used AI writing assistants when working on this paper? Left blank. + +B Did you use or create scientific artifacts? + +The Abstract provides the link to our code. + +B1. Did you cite the creators of artifacts you used? In appendix A dataset. +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? We follow the license or terms of the used artifacts. +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? The data we collected is sufficiently anonymized, we state the proposed model is for research purposes only in Section Ethics Statement. +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? The data is safe and commonly used by many previous work. +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? In appendix A dataset. +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. In appendix A dataset. + +C Did you run computational experiments? + +Section 5.1 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? Implementation in Appendix + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +5.1 Experiment Setup + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +Section 5.1 Main results. + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +Implementation in Appendix + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +Not applicable. Left blank. + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +Not applicable. Left blank. + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +Not applicable. Left blank. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +Section Ethics Statement + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +Not applicable. Left blank. \ No newline at end of file diff --git a/coadautomaticdiagnosisthroughsymptomanddiseasecollaborativegeneration/images.zip b/coadautomaticdiagnosisthroughsymptomanddiseasecollaborativegeneration/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..4db6a96f0d77330f672d4fbef7d56b13bd1dd088 --- /dev/null +++ b/coadautomaticdiagnosisthroughsymptomanddiseasecollaborativegeneration/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1a488cf9cff119ba32084b953bef38317876bdac0a2547c182a64e881f5657c9 +size 615855 diff --git a/coadautomaticdiagnosisthroughsymptomanddiseasecollaborativegeneration/layout.json b/coadautomaticdiagnosisthroughsymptomanddiseasecollaborativegeneration/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..dc3a77f4d7e59136417603a1e72c0d5c23278162 --- /dev/null +++ b/coadautomaticdiagnosisthroughsymptomanddiseasecollaborativegeneration/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dad42ec91e31f107e204b8eba77b3f3ea44fb2504e8888ec17c64da548b2463d +size 421125 diff --git a/code4structcodegenerationforfewshoteventstructureprediction/4a24d3b5-faa2-4b2c-8138-8dcfa0b580f0_content_list.json b/code4structcodegenerationforfewshoteventstructureprediction/4a24d3b5-faa2-4b2c-8138-8dcfa0b580f0_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..13201f0eec7f5d1fe13789ff4998323b696b663d --- /dev/null +++ b/code4structcodegenerationforfewshoteventstructureprediction/4a24d3b5-faa2-4b2c-8138-8dcfa0b580f0_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e0ba658559415a4b99fd5e3cbc66c26dcf9ffc0f6216f6b4de33efb75752c7d +size 126366 diff --git a/code4structcodegenerationforfewshoteventstructureprediction/4a24d3b5-faa2-4b2c-8138-8dcfa0b580f0_model.json b/code4structcodegenerationforfewshoteventstructureprediction/4a24d3b5-faa2-4b2c-8138-8dcfa0b580f0_model.json new file mode 100644 index 0000000000000000000000000000000000000000..29f8b1347169fe3b691f4507089af34af1c098a5 --- /dev/null +++ b/code4structcodegenerationforfewshoteventstructureprediction/4a24d3b5-faa2-4b2c-8138-8dcfa0b580f0_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9069dbe1093519f8e5f9815701eb2ef7aed5d38aac59a13b81761d0367b39e0 +size 153695 diff --git a/code4structcodegenerationforfewshoteventstructureprediction/4a24d3b5-faa2-4b2c-8138-8dcfa0b580f0_origin.pdf b/code4structcodegenerationforfewshoteventstructureprediction/4a24d3b5-faa2-4b2c-8138-8dcfa0b580f0_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6690a6051bc3eb6365c4b1f24329603ef14e4c69 --- /dev/null +++ b/code4structcodegenerationforfewshoteventstructureprediction/4a24d3b5-faa2-4b2c-8138-8dcfa0b580f0_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3354a18a5bce44ce820af602928598d1ff7cf445206ec44afbe220c753b63209 +size 769101 diff --git a/code4structcodegenerationforfewshoteventstructureprediction/full.md b/code4structcodegenerationforfewshoteventstructureprediction/full.md new file mode 100644 index 0000000000000000000000000000000000000000..3ae2da5997929d28ed10f1de364f4109fee66e30 --- /dev/null +++ b/code4structcodegenerationforfewshoteventstructureprediction/full.md @@ -0,0 +1,580 @@ +# CODE4STRUCT: Code Generation for Few-Shot Event Structure Prediction + +Xingyao Wang and Sha Li and Heng Ji + +University of Illinois Urbana-Champaign, IL, USA + +{xingyao6, shal2, hengji}@illinois.edu + +# Abstract + +Large Language Model (LLM) trained on a mixture of text and code has demonstrated impressive capability in translating natural language (NL) into structured code. We observe that semantic structures can be conveniently translated into code and propose CODE4STRUCT to leverage such text-to-structure translation capability to tackle structured prediction tasks. As a case study, we formulate Event Argument Extraction (EAE) as converting text into event-argument structures that can be represented as a class object using code. This alignment between structures and code enables us to take advantage of Programming Language (PL) features such as inheritance1 and type annotation2 to introduce external knowledge or add constraints. We show that, with sufficient in-context examples, formulating EAE as a code generation problem is advantageous over using variants of text-based prompts. Despite only using 20 training event instances for each event type, CODE4STRUCT is comparable to supervised models trained on 4,202 instances and outperforms current state-of-the-art (SOTA) trained on 20-shot data by $29.5\%$ absolute F1. By leveraging the inheritance feature of PL, CODE4STRUCT can use 10-shot training data from a sibling event type to predict arguments for zero-resource event types and outperforms the zero-shot baseline by $12\%$ absolute F1.3 + +# 1 Introduction + +Large Language Model (LLM) trained on massive corpora of code mixed with natural language (NL) comments and docstrings $^4$ (e.g., Chen et al. 2021, + +![](images/3dd39059bb88c475d80dcaa3f91903278d3119deb99eb114809657b2da84610a.jpg) +Figure 1: Event Argument Extraction using code generation. We convert the existing event type ontology to Python class definitions. Conditioned on these definitions, we put the input sentence for event argument extraction into a docstring as the prompt for code generation. The generated code (colored in green) can be mapped to an instance graph of Transport event. + +Nijkamp et al. 2022) has demonstrated the ability to translate natural language instructions into structured code. We ask if this conversion between language and code can serve as a bridge to build a connection between language and semantic structure, which is the goal of many structured prediction tasks (e.g., semantic parsing, information extraction) in Natural Language Processing (NLP). In particular, the target structure (e.g., event-argument graph in Figure 1) can be mapped to code more straightforwardly compared to natural language, which often requires careful prompt engineering (Hsu et al. 2022, Li et al. 2021, Table 2). In addition, code written in programming languages has an inherent advantage in representing complex and + +
Event Argument ExtractionProgramming Language (Python)
Event / Entity Type +Transport, VEHClass definition +class Transport, class VEH
Hierarchical Event Ontology +Movement:TransportInheritance +Inheritance is a way to create a hierarchy of classes in PL. A child class can base upon another class, retaining similar implementation. +class Transport(Movement)
Event Arguments +vehicleFunction arguments +def function(vehic1le=...)
Argument Constraint +Each argument can has a list of multiple entities; Argument vehicle should be entities of type VEH.Type Annotation & Argument Default Value +Type annotations are used by developers to indicate the data types of variables and input/outputs of functions. If a function is called without the argument, the argument gets its default value (a list in this case). +def function( + vehicle: List[VEH] = [], ... +)
Weakly-supervised Information +Transport Event describes someone transporting something in a vehicle from one place to another place.Docstring or Comments +class Transport(Movement): + self(agent transported self.artifact in self.vehi cule vehicle from self.origin place to selfdestination place.
+ +Table 1: Mapping between Event Argument Extraction requirements and features of Python programming language. + +interdependent structures (Miller, 1981; Sebrechts and Gross, 1985) with features such as inheritance and type annotation. + +As a case study, we showcase our proposed CODE4STRUCT on the Event Argument Extraction (EAE) task, which aims to extract event structures from unstructured text. EAE is the ideal testbed for our method due to the close alignment between EAE and PL as shown in Table 1. In CODE4STRUCT (Figure 1), we first translate the entity and event type ontology into Python class definitions. Conditioned on the relevant class definitions and the input sentence, we prompt an LLM to generate an instantiation of the event class, from which we can extract the predicted arguments. + +By leveraging the alignment between PL and NLP problems, CODE4STRUCT enjoys various advantages as shown in Table 1. Using PL features like type annotation and argument default value, we can naturally enforce argument constraints for output structures. This allows CODE4STRUCT to handle multiple or zero argument fillers for the same argument role by annotating the expected type (i.e., expect a list of entities) and setting the default value for each argument (i.e., an empty list without any entity by default). Furthermore, we can naturally utilize the event hierarchy by leveraging inheritance. Inheritance allows a child event class (e.g., Transport) to reuse most components of its parent class (e.g., Movement) while preserving its unique properties. We demonstrate that hierarchical event types allow zero-resource event types to use annotated training examples from their high- + +resource sibling types (§4.6). + +We outline our contributions as follows: + +- We propose CODE4STRUCT to tackle structured prediction problems in NLP using code generation. As a case study, we use CODE4STRUCT for Event Argument Extraction (EAE). +- We perform extensive experiments contrasting the performance of code-based prompt and two variants of text prompt on different LLMs and show that code prompt is generally advantageous over text prompt when sufficient in-context examples are provided (§4.2). +- We demonstrate that 20-shot CODE4STRUCT rivals fully-supervised methods trained on 4,202 instances. CODE4STRUCT outperforms a SOTA approach by $29.5\%$ absolute F1 gain when 20-shot data are given to both. 0-shot CODE4STRUCT can even outperform the SOTA on both 20 and 50 shots (§4.5). +- We show that integrating the event ontology hierarchy by class inheritance can improve prediction. Compared to the zero-shot baseline, we see $12\%$ F1 gains for zero-resource event types when using 10-shot examples from their sibling event types (§4.6). + +# 2 Code Generation Prompt Construction + +In Event Argument Extraction (EAE) task, a model is provided with an event ontology and the tar + +![](images/e563cbacb5e63b01566c1115a60369c89f8cd18b3b5e4c9e3aaa2ffa79ebc933.jpg) +Figure 2: Prompt components. (1) Ontology code representation contains definitions of entity and event classes, colored in yellow and blue ( $\S 2.1$ ). (2) $k$ -shot examples for in-context learning, colored in orange ( $\S 2.3$ ). (3) The task prompt, appended at the end with partial class instantiation for LLM completion, colored in green ( $\S 2.2$ ). + +get text to extract from. Similarly, we prompt an LLM with the ontology that consists of definitions of event types and argument roles, and input sentences to generate code that instantiates the given event type. We breakdown the input prompt into three components: (1) ontology code representation which consists of Python class definitions for entity types and an event type ( $\S 2.1$ ); (2) optional $k$ -shot in-context learning examples for the event type defined in (1) ( $\S 2.3$ ); (3) task prompt for completion ( $\S 2.2$ ). We show a breakdown of the full prompt in Figure 2. + +# 2.1 Ontology Code Representation + +To represent the event ontology as code, we concatenate the base class definition, entity class definitions, and event class definitions. + +Base Class Definition We define base type Entity and Event to be inherited by other classes. + +Entity Class Definition We use entity type definitions from the Automatic Content Extraction (ACE) program5. We construct Python classes that inherit from Entity and use the entity type as the class name (e.g., class GPE(ENTITY)). We add a natural language description as a docstring of the defined class for each entity type. + +# 2.1.1 Event Class Definition + +We define the event class using the name of the event type (e.g., class Transport). As ACE defines its event types in a hierarchical ontology, mimicking class definitions in Object-Oriented PL, we inherit the event class definition from its parent (e.g., class Transport (Movement)) or root event type if the event class does not have a parent (e.g., class Movement (Event)). An example of hierarchical event definition can be found in Figure A.9. + +We define the argument roles (e.g., destination of Transport) as input arguments of the constructor __init__6. We specify the type of each argument role using Python type annotation, a commonly used PL feature: For example, agent: List[GPE | ORG | PER] means that the agent argument accepts a list of entities which could be either of type GPE (Geo-Political Entity), ORG (Organization), or PER (Person). We assign each input argument (e.g., agent) to a class member variable of the same name. + +We include event description templates into the docstring of the class definition. The event description templates are modified from Li et al. (2021) by replacing each role with their corresponding member variable (e.g., self(agent). + +# 2.2 Task Prompt + +The task prompt consists of a docstring describing the task and incomplete event instantiation code for + +
Prior WorkLanguage Template
DEGREE (Hsu et al., 2022)somebody was moved to somewhere from some place by some way. somebody or some organization was responsible for the movement. something was sent to somewhere from some place. somebody or some organization was responsible for the transport.
BART-Gen (Li et al., 2021)<arg1> transported <arg2> in <arg3> vehicle from <arg4> place to <arg5> place
Text2Event (Lu et al., 2021)((Transport returned (Agent <arg>) (Artifact <arg>) (Destination <arg>) (Origin <arg>) (Vehicle <arg>) )
+ +Table 2: Example of language templates for Event Argument Extraction used by Hsu et al. (2022); Li et al. (2021); Lu et al. (2021). + +completion. An example of a task prompt can be found in Figure 2. The text-based docstring contains a task instruction and an input sentence. We mark the ground truth trigger words for the input text by surrounding them with $\star \star$ . We choose to use $\star \star$ as it is used to set text to bold in Markdown (a markup language for creating formatted text), which is commonly found in code bases and web data on which our LLM is trained. The incomplete code prompt assigns a partial instantiation of an event class to a variable to trigger the model for completion, for example, transport_event = Transport(). + +We observed that LLM tends to generate additional sentences paired with extracted arguments if no stopping constraint is applied. To focus on the given EAE task, we stop the code generation whenever any of the following patterns is generated by the model: """, class, print, or #. + +# 2.3 In-context Learning + +Optionally, we can include in-context learning examples, which are task prompts (§2.2) paired with completed event instantiations using ground-truth arguments (see Figure 2 for a specific example). For $k$ -shot learning, we concatenate $k$ such examples together. Given a task prompt, we deterministically gather $k$ learning examples by collecting training instances with the same event type, following the order of occurrences in the training set. + +# 3 Why Represent Event Structure in PL? + +A wide range of NLP tasks have benefited from LLM (Brown et al., 2020; Hoffmann et al., 2022; Chowdhery et al., 2022) trained on web-scale language corpora. To effectively use LLM trained on language for EAE, one of the biggest challenges is to specify the desired output, namely event structures in our case, using natural language. + +There is a tradeoff between the effort put into defining the output or designing the prompt (e.g., Text2Event in Table 2) and the benefit from pre + +training in natural language (e.g., DEGREE and BART-Gen in Table 2). Text2Event (Lu et al., 2021) resides at one end of the spectrum with a concise but unnatural output format. As a result, this formulation under-utilizes the pretraining power of the model and does not work in low-resource settings as shown in Table 4. Towards the other end, Hsu et al. (2022); Li et al. (2021) design manual templates for the model to fill in. We also design two variants of language prompt as shown in Figure A.5 and A.6 miciking our code prompt and BART-Gen style prompt for comparison. Note that these natural language prompts are much more verbose and, as shown in §4.2, usually result in sub-optimal performance with sufficient in-context examples. + +Essentially, this tradeoff is a result of the mismatch between the pretraining corpora and task output formats. Instead of using LLM trained on only unstructured text, we turn to LLM trained with a mixture of text and code, where the text is often aligned in semantics with the accompanying code. Such Code-LLMs have the ability to convert text into corresponding code as demonstrated by (Chen et al., 2021; Nijkamp et al., 2022). Then we can map the desired output event structure into code in a straightforward manner and leverage the full pretraining power of these models. PLs like Python offer features (e.g., class, docstrings, type annotations, inheritance) that have a significant presence in the pre-training corpus of Code-LLM due to frequent usage. CODE4STRUCT leverages these features to succinctly describe event structures, which makes it better aligned with Code-LLM. By leveraging LLM's learned knowledge from diverse pre-training domains, CODE4STRUCT can work well in open-domain, achieving non-trivial zero-shot performance given unseen event types ( $\S 4.5$ ). CODE4STRUCT is also data-efficient as exemplified by reaching comparable performance to fully-supervised methods with much fewer annotated examples (20 per event type) ( $\S 4.5$ ). + +# 4 Experiments + +# 4.1 Experiment Setup + +LLM We use CODEX code-davinci-002 (Chen et al., 2021), a GPT-3 (Brown et al., 2020) model finetuned on code, which supports up to 8k input tokens. We compare its performance with InstructGPT (Ouyang et al., 2022) text-davinci-002 and its improved version text-davinci-003, both support up to 4k input tokens. We access these LLMs through OpenAI API7. + +Hyperparameters We prompt LLM to generate code that instantiates an event using sampling temperature $t = 0$ (i.e., greedy decoding). We set the max number of new tokens for each generation to 128, which fits all code outputs for the test set. + +Evaluation Tasks We use ground truth event type and gold-standard trigger words to perform Event Argument Extraction. + +Dataset We evaluate our performance of EAE on the English subset of Automatic Content Extraction 2005 dataset (ACE05-E)8 (Doddington et al., 2004). We follow Wadden et al. (2019); Lin et al. (2020) for dataset processing. ACE05-E has hierarchical event types with 8 parent types and 33 child types. Among all child types, roughly half of the event types (14 out of 33) in ACE05-E have less than 50 event instances in the training set. We show statistics for each event type in Table A.4. + +Evaluation metrics We use Argument F1-score following prior work (Ji and Grishman, 2008; Li et al., 2021; Hsu et al., 2022): We consider an argument to be correctly identified when the head word span of predicted text matches that of the human-annotated text (denoted as Arg-I); We consider an argument to be correctly classified if the role (e.g., agent) of a correctly identified argument matches that of the human annotation (denoted as Arg-C). + +# 4.2 Comparison with Text Prompt + +To compare our code-based prompt with text-based prompts, we design two variants of text prompt: + +$T^{(1)}$ mimicking our code prompt (i.e., code imitation, Figure A.5) and $T^{(2)}$ following BART-Gen style prompt (Li et al., 2021) (Figure A.6) which resembles natural language more compared to $T^{(1)}$ . Both text prompts have similar components as our code-based prompt in Figure 2. Text prompts rely on natural language to define the requirement and format of the desired output, while the code prompt utilizes PL syntax. We compare the F1 score difference between the code prompt ( $\S 2$ ) and two variants of text prompts (i.e., $\Delta_{C - T}^{(i)} = \mathrm{F1}_{\mathrm{code}} - \mathrm{F1}_{\mathrm{text}}^{(i)}, i \in \{1, 2\}$ ) on different LLMs in Table 3. We include exact performance numbers of text prompts in Table A.3. We summarize our findings as follows: + +- Code prompt outperforms both text prompts on Arg-C F1 (i.e., $\Delta_{C - T}^{(i)} > 0$ ) for two text prompt variants and all LLMs except text-davinci-003 when sufficient in-context examples are given (i.e., $k \geq 5$ ). +- For $\star$ -davinci-002 LLMs, there are more significant performance gains from using a code prompt (i.e., increasing $\Delta_{C - T}^{(i)}$ for all $i$ ) when the number of in-context examples $k$ increases (for $k \geq 5$ ). +- There is no clear trend on Arg-I F1 to differentiate code and text prompts, except for text-davinci-003, which exhibits similar behavior that code prompt performs better with larger $k$ . +- Text prompt $T^{(2)}$ (BART-Gen style), which resembles natural language more, performs poorly under low-shot ( $k \leq 1$ ), primarily due to the LLM being unable to produce the desired structure output described using language in $T^{(2)}$ , causing the low-shot code-text performance gap $\Delta_{C - T}^{(2)}$ to be larger compared to $T^{(1)}$ . These low-shot performance differences between $T^{(1)}$ and $T^{(2)}$ further signify the need to prompt engineering for language-based prompts to work well in a low-shot setting. + +# 4.3 Comparison with different LLM + +We measure the performance of the same CODE4STRUCT code prompt across different foundational LLMs in §4.1. LLM performance comparison can be found in Figure 3. text-davinci-002 is an InstructGPT + +Table 3: Performance of the code prompt on the Arg-I and Arg-C metrics and its F1 score difference $\Delta_{C-T}^{(i)}$ with two text prompt variants described in §4.2 (i.e., $F1_{\text{code}} - F1_{\text{text}}^{(i)}$ ). On Arg-C, there is a trend that the code prompt performs better (i.e., $\Delta_{C-T}^{(i)} > 0$ ) when more in-context examples are provided, except on text-davinci-003. + +
Model k-shotcode-davinci-002text-davinci-002text-davinci-003
Arg-IΔ(1)C-TΔ(2)C-TArg-CΔ(1)C-TΔ(2)C-TArg-IΔ(1)C-TΔ(2)C-TArg-CΔ(1)C-TΔ(2)C-TArg-IΔ(1)C-TΔ(2)C-TArg-CΔ(1)C-TΔ(2)C-T
050.60.750.636.0-2.236.048.9-2.620.235.0-2.413.149.9-2.115.337.8-1.412.6
157.30.14.747.8-1.04.755.81.85.345.23.04.956.0-1.51.144.7-3.21.1
558.01.11.952.52.91.156.0-2.01.048.83.01.459.2-0.9-0.751.71.4-2.1
1057.2-1.4-0.252.80.80.160.62.72.953.96.45.062.83.10.656.35.0-1.2
2062.11.70.258.53.62.459.90.93.756.58.05.865.03.50.760.47.8-0.4
+ +(Ouyang et al., 2022) model finetuned with human demonstrations based on code-davinci-002, yet these two LLMs perform similarly in Arg-C F1. Although having a similar code prompt Arg-C performance, text-davinci-002 generally has a larger $\Delta_{C - T}^{(i)}$ compared to code-davinci-002 of the same $k$ in Table 3 (e.g., +3.6 vs. +8.0, +2.4 vs. +5.8 on 20-shot for both text prompt variants), suggesting the degradation of text prompt performance after finetuning with human demonstrations. + +text-davinci-003, which uses reinforcement learning (RL) with reward models to align with human preference $^{10}$ (Ouyang et al., 2022), outperforms other LLMs for $k > 5$ . In Table 3, text-davinci-003 obtains superior Arg-C F1 performance (60.4% vs. 56.5% on 20-shot) compared to text-davinci-002. This suggests RL with reward models effectively improves EAE performance (i.e., Arg-C) on code prompt. + +Interestingly, text-davinci-003 has a very different $\Delta_{C - T}^{(i)}$ pattern for text prompt $T^{(2)}$ compared to $T^{(1)}$ . Like text-davinci-002, in Table 3, Arg-C $\Delta_{C - T}^{(1)}$ for text prompt $T^{(1)}$ has an increasing trend with a similar magnitude (e.g., +7.8 vs. +8.0 on 20-shot). That is, in both LLMs, the code prompt is always better than text prompt $T^{(1)}$ with $k \geq 5$ . However, for text prompt $T^{(2)}$ which is more similar to natural sentences, the gap $\Delta_{C - T}^{(2)}$ exhibits a vastly different pattern compared to other models: code prompt performs on par or even slightly worse than $T^{(2)}$ for $k \geq 5$ . We also notice that for zero-shot prediction, $T^{(2)}$ on text-davinci-003 performs better compared to other LLMs. This indicates that aligning LLM with RL and reward models helps improve LLM's ability to follow zero-shot language instructions. + +Even though code prompt still performs superior to both text prompt variants on 002 LLMs, results from text-davinci-003 suggest a better + +aligned language model can perform equally well on a natural text prompt $T^{(2)}$ when sufficient in-context examples are provided. + +![](images/ef52203eeef954971fd825bf8e4823af8b2d31a2caf39f91380afe9d2266885e.jpg) +Figure 3: CODE4STRUCT performance (in F1%) with different $k$ . We observe improvements with diminishing returns when we increase the number of in-context examples. Exact performance numbers can be found in Table A.3 (code prompt). We stop at $k = 20$ for text-davinci and $k = 50$ for code-davinci-002 as including more examples would exceed the input length limitation imposed by corresponding LLM. + +# 4.4 Comparison with different $k$ + +We examine the performance of code prompts with varying numbers of examples in Figure 3. We observe that F1 scores for all metrics generally increase with diminishing returns when providing more in-context learning examples. The initial in-context example ( $k = 1$ ) brings the largest absolute performance gain (+11.8, +10.2, +6.9 Arg-C F1 for three LLMs). For $k \geq 20$ on code-davinci-002, the Arg-I and Arg-C performance plateaus or even slightly degrade, as not all event types have enough in-context examples to benefit from increasing $k$ (i.e., only 19 out of 33 event types have more than 50 examples for in-context learning). To further investigate why the performance plateaus, we analyze how the sentence variability (or diversity) of in-context examples influences Arg-C performance in §A.4; We find that + +Arg-C performance is positively correlated with the variability of in-context examples which plateaus as $k$ increases, hinting that in-context learning performance may eventually plateau with increasing $k$ due to little variability gains from the additional data. + +# 4.5 Comparison with Supervised Models + +Baselines Unlike prior methods trained on the entire training set, CODE4STRUCT learns from up to 50 examples (i.e., 39 examples per event type on average, roughly $1\%$ among all training instances) to predict arguments for each test event type. To ensure a fair comparison, for each event type $t$ in the test set, we train a Text2Event model (Lu et al., 2021) and a DEGREE model (SOTA, Hsu et al. (2022)) on 20-shot and 50-shot in-context examples CODE4STRUCT used while providing gold-standard trigger words. We evaluate both models trained on event type $t$ on a partition of the test set that only contains instances of event type $t$ . We then aggregate F1 scores (micro F1) across all 31 event types on the test set and report them in Table 4. Following Hsu et al. (2022), we also compare with classification-based (DyGIE++ Wadden et al. (2019), BERT_QA Du and Cardie (2020), OneIE Lin et al. (2020)) or generation-based (TANL (Paolini et al., 2021), BART-Gen Li et al. (2021), DEGREE Hsu et al. (2022)) models trained on the full training set. + +Results We report the performance of CODE4STRUCT using LLMs (§4.1) in comparison with prior work in Table 4. We report the performance of supervised models using the full dataset from Hsu et al. (2022). Note that 50-shot results for text-davinci are not available as the 50-shot input prompt will exceed LLM's input token length limitation, hence we use code-davinci-002 for 50-shot comparison. + +In the few-shot setting, 20-shot CODE4STRUCT using text-davinci-003 can surpass DEGREE (Hsu et al., 2022), the current state-of-the-art, by a large margin (+29.5% Arg-C F1). Our zero-shot CODE4STRUCT using the best-performing text-davinci-003 model can already achieve higher Arg-I and Arg-C performance than the 20-shot and 50-shot DEGREE. Despite only learning from 20 examples, 20-shot CODE4STRUCT achieves comparable performance with other fully-supervised models trained on 100% of the training data (4,202 instances). + +
ModelDataArg-I F1Arg-C F1
DyGIE++Full66.260.7
BERT-QAFull68.265.4
OneIEFull73.269.3
TANLFull65.961.0
BART-GenFull69.966.7
DEGREEFull76.073.5
CODE4STRUCTtext-davinci-0030-shot49.937.8
Text2Event20-shot*23.119.1
DEGREE20-shot*33.030.9
CODE4STRUCTtext-davinci-00320-shot*65.060.4
Text2Event50-shot*30.626.0
DEGREE50-shot*40.837.3
CODE4STRUCTcode-davinci-00250-shot*62.358.1
+ +Table 4: Performance (in F1%) comparison between best-performing CODE4STRUCT LLM and existing supervised approaches. Performance numbers for all LLMs can be found in Table A.3. *Some event types do not have 20 or 50 examples for in-context learning; on average, we have 39 examples per type for a 50-shot prompt and 18 examples per type for 20-shot. + +# 4.6 Event Type Hierarchy Improves Zero-resource EAE + +In this section, we show that CODE4STRUCT, when provided with hierarchical event definitions and few-shot training instances $D_{e_s}$ from a sibling event type $e_s \in \mathrm{Siblings}(e)$ under the same parent event type, can improve performance for child event type $e$ as good as if training instances $D_e$ from the same event type $e$ were used. This allows zero-resource event types without annotated data to exploit the event type hierarchy and benefit from their high-resource siblings. We include an example task prompt with sibling examples in Figure A.11 and report our results in Table 5. + +Setup We split the child types for each parent type into training and testing types by selecting the high-resource child type with the largest amount of training instances to be the training type and have the rest be testing types. The train-test split for ACE types can be found in Table A.5. Under the same parent event type, we use data instances from the training type (i.e., a sibling of testing types) as in-context examples to predict arguments for each testing type. We include event class definition (Figure 2) for parent event type (e.g., Transaction), child training (sibling) event type (e.g., Transfer_Money), and child testing event type (e.g., Transfer_Ownership). We show an example of event definition with sibling type in Figure A.10. The few-shot performance when using data from a sibling type $D_{e_s}$ is denoted with (sibling type) in Table 5. To demonstrate the + +effectiveness of using data from sibling event types, we compare it with using training instances from the testing event type itself $D_{e}$ (denoted as (same type)) and from a random non-sibling event type (denoted as (non-sibling type)). + +
Arg-IArg-C
0-shot52.842.9
1-shot (same type)54.350.2
1-shot (sibling type)57.251.9
1-shot (non-sibling type)56.350.3
10-shot (same type)58.755.2
10-shot (sibling type)60.854.9
10-shot (non-sibling type)58.551.0
+ +Table 5: code-davinci-002 performance (in F1%) when using examples from the same, sibling or non-sibling event types for in-context learning. To ensure a fair comparison, F1 scores are aggregated from 23 test event types in Table A.5 that contains more than 10 training instances. + +Results We observe that CODE4STRUCT, when prompted with training examples from sibling type, performs on par with the prompt that uses training examples from the testing type itself on 1-shot and 10-shot. The substantial performance gain $(+9\% \mathrm{Arg - C~F1}$ on 1-shot, $+12\%$ Arg-C F1 on 10-shot, compared with 0-shot) contributed by sibling-type training examples demonstrate the potential of applying CODE4STRUCT to zero-resource event types with no training data by exploiting their hierarchical relationship with other high-resource event types. Surprisingly, similar to the observation made by Min et al. (2022), using in-context examples from a random non-sibling type also benefits CODE4STRUCT performance, albeit not as helpful as sibling examples under 10-shot. + +# 5 Related Work + +Code-LLM for Structured Task Sun et al. (2019); Singh et al. (2022) focus on procedural tasks that aim to control situated agents in an embodied environment by representing the procedure plan in code. Madaan et al. (2022) uses Code-LLM to generate a structured commonsense reasoning graph represented in code, which is similar in spirit to our work but in a different task. Gao et al. (2022) tackles math and symbolic reasoning tasks by decomposing the natural language problem into runnable steps using Code-LLM and delegating + +solution calculation to a PL interpreter. We leverage PL features (e.g., inheritance, type annotation) to introduce extra information and constraints for structured prediction, which is largely overlooked by prior work. + +Event Extraction Li et al. (2013); Nguyen et al. (2016); Yang and Mitchell (2016); Wadden et al. (2019); Lin et al. (2020) use classification models and mitigate error propagation from pipeline models by leveraging global features to predict event triggers and arguments jointly. Recent work such as Liu et al. (2020) formulates event extraction as a reading comprehension problem and Li et al. (2021); Huang et al. (2021); Paolini et al. (2021); Hsu et al. (2022) converts event extraction to a text generation task to better exploit label semantics from pretrained language models. The most similar work to ours is Text2Event (Lu et al., 2021), which uses controlled generation to generate structures in a manually specified linearized format directly, hindering the model in leveraging pre-trained NL knowledge. On the other hand, our approach CODE4STRUCT directly generates structure in PL instead of using a manually designed format to fully exploit LLM's knowledge of PL. + +# 6 Conclusions and Future Work + +We propose CODE4STRUCT for structured prediction tasks in NLP by leveraging LLMs trained on language and code. As a case study, we use CODE4STRUCT to extract event arguments from natural language sentences through code generation. We show that, with sufficient in-context examples, formulating EAE as a code generation problem is advantageous over using text-based prompts. Our proposed CODE4STRUCT rivals fully-supervised models trained on 4,202 data instances only using 20-shot. It also outperforms a SOTA model by $29.5\%$ absolute F1 when both are given the same 20-shot data. Furthermore, benefitting from hierarchical event definitions, CODE4STRUCT can predict arguments for zero-resource event types only using 10-shot training instances from its sibling event type and outperforms 0-shot baseline by $12\%$ absolute F1 score. Going forward, we plan to expand CODE4STRUCT to a broader range of more complex structured prediction tasks (e.g., relation prediction, schema matching). We would further explore the executable nature of PL to improve LLM's ability for structured prediction. + +# Limitations + +In this work, our approach assumes event triggers and argument templates (i.e., ontology) are given. This limits our approach's applicability, as it requires an event detection system to produce event triggers and event types before LLMs can be prompted to generate event arguments. + +We only explore hierarchical events with only 2 levels from the ACE05-E ontology and data, which has limited coverage of real-world complex event hierarchy. Similar to prior event argument extraction work, our approach relies on a human-curated hierarchical ontology. We leave automatically discover hierarchical ontology for future work. + +Despite LLMs performing well on EAE with few-shot data, compared to existing supervised approaches, their inference is relatively slow and costly11 since the LLMs we used are generally more than 100x larger in the number of parameters. Prior work (Zhao et al., 2021; Lu et al., 2022) has demonstrated a strong relationship between performance and in-context demonstrations; however, for ease of comparison to supervised baselines, we use the same set of examples from the training set for in-context learning. We expect better selecting (Liu et al., 2021) and ordering (Lu et al., 2022) in-context examples can benefit CODE4STRUCT performance, which we leave for future work. + +# Ethical Considerations + +Since event argument extraction only requires predicting arguments from the given text, the risk of generating toxic languages is relatively low as long as the given test is not toxic. This is because the prediction can be grounded in the input sentence, eliminating potential toxic tokens that did not appear in the original sentence. However, discrimination and bias are possible, as observed in the foundational LLMs we used (Brown et al., 2020; Chen et al., 2021; Ouyang et al., 2022), which we refer to Brown et al. (2020) for detailed discussion. + +# Acknowledgement + +We thank the anonymous reviewers for their helpful suggestions and comments. 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 U.S. DARPA ITM Program No. FA8650-23-C-7316. 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 + +Laura Banarescu, Claire Bonial, Shu Cai, Madalina Georgescu, Kira Griffith, Ulf Hermjakob, Kevin Knight, Philipp Koehn, Martha Palmer, and Nathan Schneider. 2013. Abstract Meaning Representation for sembanking. In Proceedings of the 7th Linguistic Annotation Workshop and Interoperability with Discourse, pages 178-186, Sofia, Bulgaria. Association for Computational Linguistics. +Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. 2020. Language models are few-shot learners. Advances in neural information processing systems, 33:1877-1901. +Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde de Oliveira Pinto, Jared Kaplan, Harri Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, et al. 2021. Evaluating large language models trained on code. arXiv preprint arXiv:2107.03374. +Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, et al. 2022. Palm: Scaling language modeling with pathways. arXiv preprint arXiv:2204.02311. +George Doddington, Alexis Mitchell, Mark Przybocki, Lance Ramshaw, Stephanie Strassel, and Ralph 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'04), Lisbon, Portugal. European Language Resources Association (ELRA). +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. + +Luyu Gao, Aman Madaan, Shuyan Zhou, Uri Alon, Pengfei Liu, Yiming Yang, Jamie Callan, and Graham Neubig. 2022. Pal: Program-aided language models. ArXiv, abs/2211.10435. +Maria Halkidi, Yannis Batistakis, and Michalis Vazirgiannis. 2001. On clustering validation techniques. Journal of Intelligent Information Systems, 17:107-145. +Jordan Hoffmann, Sebastian Borgeaud, Arthur Mensch, Elena Buchatskaya, Trevor Cai, Eliza Rutherford, Diego de Las Casas, Lisa Anne Hendricks, Johannes Welbl, Aidan Clark, et al. 2022. Training compute-optimal large language models. arXiv preprint arXiv:2203.15556. +I-Hung Hsu, Kuan-Hao Huang, Elizabeth Boschee, Scott Miller, Prem Natarajan, Kai-Wei Chang, and Nanyun Peng. 2022. DEGREE: A data-efficient generation-based event extraction model. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 1890-1908, Seattle, United States. Association for Computational Linguistics. +Kung-Hsiang Huang, Sam Tang, and Nanyun Peng. 2021. Document-level entity-based extraction as template generation. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 5257-5269, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Heng Ji and Ralph Grishman. 2008. Refining event extraction through unsupervised cross-document inference. In *In Proceedings of the Annual Meeting of the Association of Computational Linguistics (ACL 2008)*. Ohio, USA. +Qi Li, Heng Ji, and Liang Huang. 2013. Joint event extraction via structured prediction with global features. In Proceedings of the 51st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 73-82, Sofia, Bulgaria. Association for Computational Linguistics. +Sha Li, Heng Ji, and Jiawei Han. 2021. Document-level event argument extraction by conditional generation. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 894-908, Online. Association for Computational Linguistics. +Ying Lin, Heng Ji, Fei Huang, and Lingfei Wu. 2020. A joint neural model for information extraction with global features. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7999-8009, Online. Association for Computational Linguistics. +Jiachang Liu, Dinghan Shen, Yizhe Zhang, Bill Dolan, Lawrence Carin, and Weizhu Chen. 2021. What + +makes good in-context examples for gpt-3? In Workshop on Knowledge Extraction and Integration for Deep Learning Architectures; Deep Learning Inside Out. +Jian Liu, Yubo Chen, Kang Liu, Wei Bi, and Xiaojiang Liu. 2020. Event extraction as machine reading comprehension. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1641-1651, Online. Association for Computational Linguistics. +Yao Lu, Max Bartolo, Alastair Moore, Sebastian Riedel, and Pontus Stenetorp. 2022. Fantastically ordered prompts and where to find them: Overcoming few-shot prompt order sensitivity. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 8086-8098, Dublin, Ireland. Association for Computational Linguistics. +Yaojie Lu, Hongyu Lin, Jin Xu, Xianpei Han, Jialong Tang, Annan Li, Le Sun, Meng Liao, and Shaoyi Chen. 2021. Text2Event: Controllable sequence-to-structure generation for end-to-end event extraction. 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 2795-2806, Online. Association for Computational Linguistics. +Aman Madaan, Shuyan Zhou, Uri Alon, Yiming Yang, and Graham Neubig. 2022. Language models of code are few-shot commonsense learners. arXiv preprint arXiv:2210.07128. +L. A. Miller. 1981. Natural language programming: Styles, strategies, and contrasts. IBM Systems Journal, 20(2):184-215. +Sewon Min, Xinxi Lyu, Ari Holtzman, Mikel Artetxe, Mike Lewis, Hannaneh Hajishirzi, and Luke Zettlemoyer. 2022. Rethinking the role of demonstrations: What makes in-context learning work? ArXiv, abs/2202.12837. +Thien Huu Nguyen, Kyunghyun Cho, and Ralph Grishman. 2016. Joint event extraction via recurrent neural networks. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 300-309, San Diego, California. Association for Computational Linguistics. +Erik Nijkamp, Bo Pang, Hiroaki Hayashi, Lifu Tu, Huan Wang, Yingbo Zhou, Silvio Savarese, and Caiming Xiong. 2022. A conversational paradigm for program synthesis. arXiv preprint. +Long Ouyang, Jeff Wu, Xu Jiang, Diogo Almeida, Carroll L. Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, John Schulman, Jacob Hilton, Fraser Kelton, + +Luke E. Miller, Maddie Simens, Amanda Askell, Peter Welinder, Paul Francis Christiano, Jan Leike, and Ryan J. Lowe. 2022. Training language models to follow instructions with human feedback. ArXiv, abs/2203.02155. +Giovanni Paolini, Ben Athiwaratkun, Jason Krone, Jie Ma, Alessandro Achille, Rishita Anubhai, Cicero Nogueira dos Santos, Bing Xiang, and Stefano Soatto. 2021. Structured prediction as translation between augmented natural languages. arXiv preprint arXiv:2101.05779. +Marc M. Sebrechts and Paul Gross. 1985. Programming in natural language: A descriptive analysis. Behavior Research Methods, Instruments, & Computers, 17:268-274. +Ishika Singh, Valts Blukis, Arsalan Mousavian, Ankit Goyal, Danfei Xu, Jonathan Tremblay, Dieter Fox, Jesse Thomason, and Animesh Garg. 2022. Prog-Prompt: Generating situated robot task plans using large language models. +Shao-Hua Sun, Te-Lin Wu, and Joseph J Lim. 2019. Program guided agent. In International Conference on Learning Representations. +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. +Bishan Yang and Tom M. Mitchell. 2016. Joint extraction of events and entities within a document context. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 289-299, San Diego, California. Association for Computational Linguistics. +Zixuan Zhang and Heng Ji. 2021. Abstract Meaning Representation guided graph encoding and decoding for joint information extraction. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 39-49, Online. Association for Computational Linguistics. +Tony Zhao, Eric Wallace, Shi Feng, Dan Klein, and Sameer Singh. 2021. Calibrate before use: Improving few-shot performance of language models. ArXiv, abs/2102.09690. + +# A Appendix + +# A.1 Qualitative Analysis + +We show examples of 0-shot and 50-shot CODE4STRUCT argument extraction result in Figure A.1. CODE4STRUCT can leverage implicit commonsense knowledge in LLM to infer arguments not presented in the text. In the first 0-shot example, the model inferred the place of Welch's retirement is in the United States. This is a reasonable guess since Welch, in this example, is the former CEO of General Electric (GE), whose headquarters is in the United States. In the second 0-shot example, our model inferred that the Justice:Fine event should take place in a court, which matches our commonsense knowledge. Interestingly, we observe that increasing the number of in-context examples from 0-shot to 50-shot inhibits LLM from generating arguments (i.e., making LLMs more conservative), including these inferred arguments and a correctly predicted argument (i.e., SEC) in 0-shot predictions. + +# A.2 Prompt Component Analysis + +In this section, we present an empirical analysis of other prompt component candidates. We compare different prompt components in Table A.1 using code-davinci-002 and following the same hyper-parameters described in §4.1. + +- Event Keywords We augment event-related keywords into the docstring of event definition for CODE4STRUCT (illustrated in Figure A.8). We follow the same keywords used by Li et al. (2021). +- AMR Zhang and Ji (2021) have demonstrated the effectiveness of utilizing Abstract Meaning Representation (AMR) (Banarescu et al., 2013) for information extraction. We experiment with AMR-augmented prompts. We use armlib $^{12}$ to predict AMR, and append the AMR structure after the NL sentence in the task prompt §2.2 (see Figure A.7 for an example). + +Prompts that include event keywords and AMR all perform slightly better than CODE4STRUCT under the zero-shot setting on all metrics (Table A.1). + +![](images/08d98e31df18d0c3b335c50213f432d6ceb5431d10272607e7114531853911bf.jpg) +0-shot Predictions + +![](images/faf89feba146cb9244a4940dcf450ebd9445473fef3c03ac465e005970a0b781.jpg) +50-shot Predictions + +![](images/0d351e45155840d77ceb71c99a92be4b432eb7e777fbad2e4eb42445f6b2f366.jpg) +Figure A.1: Examples of 0-shot and 50-shot CODE4STRUCT event argument prediction using code-davinci-002 on ACE05-E. In both 0-shot examples, LLM can infer an entity that does not present in the text as an argument (marked with a yellow span). CODE4STRUCT predicts fewer arguments when the examples are increased to 50-shot. We mark incorrect predictions with strikethrough text. Entities that LLM failed to predict are marked in red font. + +![](images/1d7f4f8ea22b1bf0ffba6eb884f4031732a6d4ff9cb7eb8a634a96ca2acacb09.jpg) + +
k-shotArg-I F1Arg-C F1
0110205001102050
CODE4STRUCT50.657.357.262.162.336.047.852.858.558.1
+ amr51.154.755.6--37.244.251.3--
+ keywords52.357.358.061.761.736.447.353.557.757.9
+ +Table A.1: Prompt components analysis on code-davinci-002. The best scores (in %) are bolded. - means the result is unavailable due to the input prompt exceeding the corresponding LLM's supported input token length. + +
k-shotArg-I F1Arg-C F1
0110205001102050
CODE4STRUCT50.657.357.262.162.336.047.852.858.558.1
- trigger48.854.453.057.656.633.844.148.953.851.5
- description51.456.756.261.161.636.147.251.657.157.8
- type annotation49.457.258.061.561.435.748.054.557.657.5
- hierarchy49.456.655.559.960.434.346.850.055.455.9
+ +Table A.2: Ablation study on code-davinci-002. The best scores (in %) are bolded. - means the result is unavailable due to the input prompt exceeding the corresponding LLM's supported input token length. + +# A.3 Ablation Study + +In Table A.2, we ablate different prompt components described in §2, including event trigger marking, event description in natural language, type annotation, and hierarchical ontology. We perform this ablation study using code-davinci-002. + +Event Trigger Marking We find that removing event trigger marking consistently degrades per + +formance on all metrics over varying numbers of in-context examples. + +Event Description Event descriptions generally provide a small F1 gain under the few-shot setting. However, removing event descriptions improves CODE4STRUCT's zero-shot performance on argument identification. 0-shot Arg-I precision is relatively unchanged after removing event descriptions + +(37.4 vs. 37.2). We argue that removing event descriptions loosens entity-related constraints and allows LLM to identify more relevant entities. This is supported by the improvement of 0-shot Arg-I recall (78.7 to 81.8) after description removal, which mainly accounts for the increase in 0-shot Arg-I F1. Despite being helpful in argument identification by boosting 0-shot Arg-I recall, we do not see the benefit of removing descriptions in few-shot Arg-C, where it performs consistently worse compared to CODE4STRUCT. + +Type Annotation Type annotation is more helpful when more in-context examples are provided $(k\geq 20)$ . Under a low-shot setting, the F1 difference resulting from type annotation removal is small and inconsistent across different shots. Prompts with type annotation consistently outperforms prompts without it when sufficient in-context examples are provided $(k\geq 20)$ . We hypothesize that type annotations help disambiguate entity types accepted for each argument, and such disambiguation ability is only needed when the number of entity instances that appeared in in-context examples passes a certain threshold (e.g., $k\geq 20$ ). + +Hierarchical Event Definition Providing hierarchical event definition (i.e., the parent class definition of a given child event class) benefits CODE4STRUCT performance in high-shot setting $(k\geq 20)$ . Prompts without parent class definition perform on par with CODE4STRUCT under $k < 20$ . + +# A.4 In-context Example Variability Analysis + +![](images/25f3c1109219caab83b034ce40ab5b07f558cfcf66e594a763bb750d30607c38.jpg) +Figure A.2: The variability of $k$ -shot in-context examples (i.e., average euclidean distance from centroid example) across different event types increases with diminishing returns when $k$ increases. + +![](images/7b5c48e446be2fe1e2d126d0ecd3a593e555e9455c61f2d1f05ac583d10b2fff.jpg) +Figure A.3: The variability of in-context examples is positively correlated with code prompt Arg-C performance. + +To investigate why the Arg-C performance plateaus with an increasing number of in-context examples $k$ as shown in Figure 3, we analyze the sentence variability of a fixed set of in-context examples (§2.3). We consider the set of $k$ -shot in-context examples for each event type $e$ as a cluster $D_{e}$ where $|D_{e}| \leq k$ and use sentence-transformer13 to embed all the input sentences from $D_{e}$ into a cluster of vectors $V_{e}$ . + +We use the average euclidean distance from the centroid example similar to (Halkidi et al., 2001) to measure the variability of in-context examples for each event type $e$ : + +$$ +\operatorname {V a r i a b i l i t y} (e) = \frac {1}{| V _ {e} |} \sum_ {v \in V _ {e}} d (v, \bar {v}) +$$ + +where $d(\cdot, \cdot)$ is the euclidean distance between two vectors and $\bar{v} = \frac{1}{|V_e|}\sum_{v\in V_e}v$ is the centroid example of the cluster $V_e$ . + +We calculate the mean Variability(e) across all $e$ for $k \in \{1, \dots, 50\}$ . In Figure A.2, similar to Arg-C performance in Figure 3, we find the mean Variability(e) across all $e$ increases with diminishing returns with increasing $k$ . Furthermore, we find that, in Figure A.3, Arg-C F1 performance is positively correlated with the mean Variability(e) across all $e$ . This suggests the lack of in-context example variability improvement could be one of the reasons Arg-C F1 plateaus, even when more examples are given. + +
PromptModel Metric k-shotcode-davinci-002text-davinci-002text-davinci-003
Arg-IArg-CArg-IArg-CArg-IArg-C
code050.636.048.935.049.937.8
157.347.855.845.256.044.7
558.052.556.048.859.251.7
1057.252.860.653.962.856.3
2062.158.559.956.565.060.4
3062.258.4----
5062.358.1----
text (code imitation)049.938.251.537.452.039.2
157.248.854.042.257.547.9
556.949.658.045.860.150.3
1058.652.057.947.559.751.3
2060.454.959.048.561.552.6
text (BART-Gen style Li et al. (2021))00.00.028.721.934.625.2
152.643.150.540.354.943.6
556.151.455.047.459.953.8
1057.452.757.748.962.257.5
2061.956.156.250.764.360.8
+ +Table A.3: Performance of the code and two variants of the text prompts on the Arg-I and Arg-C metrics. 50-shot results for text-davinci and text prompts are unavailable since the 50-shot prompt length exceeds such LLM's input token limitation. Examples of text prompt variants can be found in Figure A.5 (code imitation) and Figure A.6 (BART-Gen style). + +![](images/53a74b544fcc4b863fdffcaaefb169eb1e8265a226feda1b2ebbc8cefd8a55f9.jpg) + +![](images/ece11078985feeeee96b04838cc7f4c3bae8851437e69bfc31045833530b48b6.jpg) +Figure A.4: Example prediction of 20-shot text prompt $T^{(1)}$ using text-davinci-002 and code prompt using code-davinci-002. In this example, 20-shot text prompt using text-davinci-002 incorrectly predicts the same entity Anne-Marie as both adjudicator and plaintiff of the Justice: Sue event. + +# Description of base entity types: + +GPE: Geopolitical entities such as countries, provinces, states, cities, towns, etc. GPEs are composite entities, consisting of a physical location, a government, and a population. All three of these elements must be present for an entity to be tagged as a GPE. A GPE entity may be a single geopolitical entity or a group. + +... (other types omitted for space) + +(1) Entity Definition(s) + +# Role definition of event type Movement (Parent type: Event): + +1. agent (need to be one of GPE or ORG or PER) +2. artifact (need to be one of FAC or ORG or PER or VEH or WEA) +3. destination (need to be one of FAC or GPE or LOC) +4. origin (need to be one of FAC or GPE or LOC) +5. vehicle (need to be one of VEH) + +# Role definition of event type Transport (Parent type: Movement): + +1. agent (need to be one of GPE or ORG or PER) +2. artifact (need to be one of FAC or ORG or PER or VEH or WEA) +3. destination (need to be one of FAC or GPE or LOC) +4. origin (need to be one of FAC or GPE or LOC) +5. vehicle (need to be one of VEH) + +Multiple entities can be extracted for the same role, each entity is a double-quote enclosed string. + +Each extracted entity should look like: (Base Entity Type) "content of extracted string" + +If entity is not present in the text, write: () "" + +Different entities are delimited by a comma. + +In this event: [agent] transported [artifact] in [vehicle] vehicle from [origin] place to [destination] place. + +(2) Event Definition + +# Translate the following sentence into an instance of Transport event. The + +trigg Translate the following sentence into an instance of Transport event. The "Kel" trigger word(s) of the event is marked with **trigger word**. +Sund : "Renowned Hollywood madam Heidi Fleiss has been **flown** to Melbourne as +1 . a guest of honour at Thursday ' s market debut and , according to Harris , has +2 . at already played a key role in attracting worldwide media attention to the +3. de event ." +4.01. agent:() "" +5. V 2. artifact: (PER) "Heidi Fleiss" +3. destination: (GPE) "Melbourne" +4.origin:()"" +5. vehicle: () "" +(3) $k$ In-context Examples + +Translate the following sentence into an instance of Transport event. The trigger word(s) of the event is marked with **trigger word**. + +"Kelly , the US assistant secretary for East Asia and Pacific Affairs , + +**arrived** in Seoul from Beijing Friday to brief Yoon , the foreign minister . " + +1. agent: () "" +2. artifact: (PER) "Kelly" +3. destination: (GPE) "Seoul" +4. origin: (GPE) "Beijing" +5. vehicle: () "" + +(4) Event Instantiation + +Figure A.5: Natural language prompt for EAE task following our code prompt design described in section 2. We ask a LLM to generate event instantiation marked in green. + +# Description of base entity types: + +GPE: Geopolitical entities such as countries, provinces, states, cities, towns, etc. GPEs are composite entities, consisting of a physical location, a government, and a population. All three of these elements must be present for an entity to be tagged as a GPE. A GPE entity may be a single geopolitical entity or a group. ... (other types omitted for space) + +(1) Entity Definition(s) + +# Role definition of event type Movement (Parent type: Event): + +1. agent (need to be one of GPE or ORG or PER) +2. artifact (need to be one of FAC or ORG or PER or VEH or WEA) +3. destination (need to be one of FAC or GPE or LOC) +4. origin (need to be one of FAC or GPE or LOC) +5. vehicle (need to be one of VEH) +Role definition of event type Transport (Parent type: Movement): +1. agent (need to be one of GPE or ORG or PER) +2. artifact (need to be one of FAC or ORG or PER or VEH or WEA) +3. destination (need to be one of FAC or GPE or LOC) +4. origin (need to be one of FAC or GPE or LOC) +5. vehicle (need to be one of VEH) +Multiple entities can be extracted for the same role, each entity is a double-quote enclosed string. +Different entities are delimited by a comma. +Each pair of brackets below contains a role name (e.g., [role_1]) +Fill in the corresponding role [brackets] with the extracted entities (e.g., ["entity_1_for-role_1", "entity_2_for-role_1 ]). +If an entity is not present in the text, write: [] +In this event: [agent] transported [artifact] in [vehicle] vehicle from [origin] place to [destination] place. + +# (2) Event Definition + +Translate the following sentence into an instance of Transport event. The trigger word(s) of the event is marked with **trigger word**. "Kel] Sunda In th ["Tob Translate the following sentence into an instance of Transport event. The trigger word(s) of the event is marked with **trigger word**. "Renowned Hollywood madam Heidi Fleiss has been **flown** to Melbourne as guest of honour at Thursday 's market debut and, according to Harris, has already played a key role in attracting worldwide media attention to the event . In this event: [] transported ["Heidi Fleiss"] in [] vehicle from [] place to ["Melbourne"] place. (3) k In-context Example. Translate the following sentence into an instance of Transport event. The trigger word(s) of the event is marked with **trigger word**. "Kelly , the US assistant secretary for East Asia and Pacific Affairs , **arrived** in Seoul from Beijing Friday to brief Yoon , the foreign minister ." In this event: [] transported ["Kelly"] in [] vehicle from ["Beijing"] place to ["Seoul"] place. (4) Event Instantiation + +Figure A.6: BART-Gen style (Li et al., 2021) natural language prompt for EAE task. We ask a LLM to generate event instantiation marked in green. Brackets and double-enclosed strings are designed for ease of parsing free form natural language. + +Figure A.7: Example of an AMR-augmented task prompt. We append the AMR prediction after the input sentence. Different prompt components compared to CODE4STRUCT are highlighted in yellow. +```txt +"..." Translate the following sentence into an instance of Transport. The trigger word(s) of the event is marked with \*\*trigger word\*. "Kelly, the US assistant secretary for East Asia and Pacific Affairs, \*\*arrived\*\* in Seoul from Beijing Friday to brief Yoon, the foreign minister ." Abstract Meaning Representation of the given sentence: (a / arrive-01 :ARG1 (p / person :name (n / name :op1 "Kelly") :ARG0-of (h / have-org-role-91 :ARG1 (g / government-organization :name (n2 / name :op1 "East" :op2 "Asia" :op3 "and" :op4 "Pacific" :op5 "Affairs") :poss (c / country :name (n3 / name :op1 "US")) :ARG2 (s / secretary :mod (a2 / assistant)))) :ARG3 (c2 / city :name (n4 / name :op1 "Beijing")) :ARG4 (c3 / city :name (n5 / name :op1 "Seoul")) :time (d / date-entity :weekday (f / friday)) :purpose (b / brief-01 :ARG0 p :ARG1 (p2 / person :name (n6 / name :op1 "Yoon") :ARG0-of (h2 / have-org-role-91 :ARG2 (m / minister :topic (f2 / foreign))))))) +``` + +Figure A.8: Example of an event-keywords-augmented event definition. Different prompt components compared to CODE4STRUCT are highlighted in yellow. We use event keywords from Li et al. (2021). +```python +class Transport(Movement): +``` +self(agent transported self.artifact in selfvehicle vehicle from self.origin place to selfdestination place. Event keywords: transport, move, travel, head. Event Keywords +def __init__(self, agent: List[GPE | ORG | PER] = [], artifact: List[FAC | ORG | PER | VEH | WEA] = [], destination: List[FAC | GPE | LOC] = [], origin: List[FAC | GPE | LOC] = [], vehicle: List[VEH] = [],): + self(agent = agent + self.artifact = artifact + selfdestination = destination + self.origin = origin + selfvehicle = vehicle +``` + +```python +class Event: def __init__(self, name: str): self.name = name +class Movement(Event): def __init__(Parent Event Type self, agent: List[GPE | ORG | PER] = [], artifact: List[FAC | ORG | PER | VEH | WEA] = [], destination: List[FAC | GPE | LOC] = [], origin: List[FAC | GPE | LOC] = [], vehicle: List[VEH] = [],): self(agent = agent self/artifact = artifact selfdestination = destination self.origin = origin selfvehicle = vehicle Child event Transport inherit from parent Movement class Transport(Movement): ""self(agent transported self.artifact in selfvehicle vehicle from self.origin place to selfdestination place.""" def __init__(self, agent: List[GPE | ORG | PER] = [], artifact: List[FAC | ORG | PER | VEH | WEA] = [], destination: List[FAC | GPE | LOC] = [], origin: List[FAC | GPE | LOC] = [], vehicle: List[VEH] = [], Transport calls the __init__ super().__init__( method of its parent Movement agent=agent, artifact=artifact, destination=destination, origin=origin, vehicle=vehicle, +``` + +Figure A.9: Example of a hierarchical event definition. Different prompt components compared to CODE4STRUCT are highlighted in yellow. + +![](images/35d8860bc886bde6c4346730446930d4e6e6a2f9856db82fb7fb8fa7832bab8b.jpg) +Figure A.10: Example of a hierarchical event definition with a sibling event type. Different prompt components compared to Figure A.9 are highlighted in yellow. + +![](images/55e9e589a1a2ffe71984be4a3b3b0ecab96bb82f0f18e3225d27210887b0a365.jpg) +Figure A.11: Example of a task prompt with a 1-shot example from sibling event type. Event definitions for the task prompt is shown in Figure A.10. Groundtruth prediction is colored green. + +
Parent Event TypeChild Event Type# of Test Instances# of Train Example
BusinessDeclare-Bankruptcy239
End-Org524
Merge-Org013
Start-Org1721
ConflictAttack901211
Demonstrate762
ContactMeet49194
Phone-Write8104
JusticeAcquit14
Appeal630
Arrest-Jail672
Charge-Indict895
Convict661
Execute212
Extradite16
Fine622
Pardon02
Release-Parole144
Sentence1183
Sue460
Trial-Hearing5103
LifeBe-Born344
Die17516
Divorce920
Injure1125
Marry1071
MovementTransport47561
PersonnelElect13156
End-Position17143
Nominated111
Start-Position1187
TransactionTransfer-Money12121
Transfer-Ownership2785
+ +Table A.4: The number of Train/Test event instances for 33 event types in ACE05-E. + +
Parent Event TypeChild Event Type (Train)Child Event Type (Test)
BusinessDeclare-BankruptcyEnd-Org +Merge-Org* +Start-Org
ConflictAttackDemonstrate
ContactMeetPhone-Write
JusticeTrial-HearingAcquit +Appeal +Arrest-Jail +Charge-Indict +Convict +Execute +Extradite +Fine +Pardon* +Release-Parole +Sentence +Sue
LifeDieBe-Born +Divorce +Injure +Marry
PersonnelElectEnd-Position +Nominated +Start-Position
TransactionTransfer-MoneyTransfer-Ownership
+ +Table A.5: Train/Test split for each parent event type. * denotes child event types that do not have examples in the ACE05-E test set. + +A For every submission: + +A1. Did you describe the limitations of your work? + +Section 7: First section after the conclusion + +A2. Did you discuss any potential risks of your work? + +Section 8: Second section after the conclusion + +A3. Do the abstract and introduction summarize the paper's main claims? + +Abstract and Section 1 (Introduction) + +A4. Have you used AI writing assistants when working on this paper? + +Left blank. + +B Did you use or create scientific artifacts? + +Section 4 + +B1. Did you cite the creators of artifacts you used? + +Section 4 + +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? + +Not applicable. Left blank. + +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +No response. + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? + +Not applicable. Left blank. + +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? + +Not applicable. Left blank. + +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. + +In the appendix + +C Did you run computational experiments? + +Section 4 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +We prompt OpenAI hosted language model; we include the cost in the limitation section. + +The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +Section 4 and the Ablation study in the appendix + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +Not applicable. Left blank. + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +Section 4 and Appendix + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +Not applicable. Left blank. + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +Not applicable. Left blank. + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +Not applicable. Left blank. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +Not applicable. Left blank. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +Not applicable. Left blank. \ No newline at end of file diff --git a/code4structcodegenerationforfewshoteventstructureprediction/images.zip b/code4structcodegenerationforfewshoteventstructureprediction/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..96e31a1c43968eca2a09226350070b7c582f572b --- /dev/null +++ b/code4structcodegenerationforfewshoteventstructureprediction/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:98abb00094ec6894e7888cda64249fcec81274016a57374d6c3ff6f2ce49d2e9 +size 1269763 diff --git a/code4structcodegenerationforfewshoteventstructureprediction/layout.json b/code4structcodegenerationforfewshoteventstructureprediction/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..ac5937c3ba644733e09423200b44476d5c333e09 --- /dev/null +++ b/code4structcodegenerationforfewshoteventstructureprediction/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:71b9439d7759d02a493f403511bdc5f4b4353dae990563ac5b46c89bb5fe2699 +size 604824 diff --git a/codeielargecodegenerationmodelsarebetterfewshotinformationextractors/50fd41d7-0d6a-4129-8c7f-882b9a04776e_content_list.json b/codeielargecodegenerationmodelsarebetterfewshotinformationextractors/50fd41d7-0d6a-4129-8c7f-882b9a04776e_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..70372b0f4fb36df6916d273f57a8d1a0aeddbb6e --- /dev/null +++ b/codeielargecodegenerationmodelsarebetterfewshotinformationextractors/50fd41d7-0d6a-4129-8c7f-882b9a04776e_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9d705fda553ae54a690fe305b5605e250fec5c313eef896a944f30b238f12ccd +size 103474 diff --git a/codeielargecodegenerationmodelsarebetterfewshotinformationextractors/50fd41d7-0d6a-4129-8c7f-882b9a04776e_model.json b/codeielargecodegenerationmodelsarebetterfewshotinformationextractors/50fd41d7-0d6a-4129-8c7f-882b9a04776e_model.json new file mode 100644 index 0000000000000000000000000000000000000000..5fad6ea57f852d93e046373063696ee4def57e7b --- /dev/null +++ b/codeielargecodegenerationmodelsarebetterfewshotinformationextractors/50fd41d7-0d6a-4129-8c7f-882b9a04776e_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f9f957eec2152b9190fe5ef26abbb28ec7e7c0d26fe19740187df5ea7cb8c84d +size 121133 diff --git a/codeielargecodegenerationmodelsarebetterfewshotinformationextractors/50fd41d7-0d6a-4129-8c7f-882b9a04776e_origin.pdf b/codeielargecodegenerationmodelsarebetterfewshotinformationextractors/50fd41d7-0d6a-4129-8c7f-882b9a04776e_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7baa2ffaaafdbeef6debe9e37087aefa495117ea --- /dev/null +++ b/codeielargecodegenerationmodelsarebetterfewshotinformationextractors/50fd41d7-0d6a-4129-8c7f-882b9a04776e_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7420d784b42ebc3bedddccbe223c9c8e4d3525d2b046530ff053fd205b9403d5 +size 1001024 diff --git a/codeielargecodegenerationmodelsarebetterfewshotinformationextractors/full.md b/codeielargecodegenerationmodelsarebetterfewshotinformationextractors/full.md new file mode 100644 index 0000000000000000000000000000000000000000..215cc932b14f0335f0167bc99a890e666c13c826 --- /dev/null +++ b/codeielargecodegenerationmodelsarebetterfewshotinformationextractors/full.md @@ -0,0 +1,493 @@ +# CODEIE: Large Code Generation Models are Better Few-Shot Information Extractors + +Peng Li $^{1,*}$ Tianxiang Sun $^{2,*}$ Qiong Tang $^{2}$ Hang Yan $^{2}$ Yuanbin Wu $^{3}$ Xuanjing Huang $^{2}$ Xipeng Qiu $^{2,\dagger}$ + +$^{1}$ Academy for Engineering & Technology, Fudan University $^{2}$ School of Computer Science, Fudan University + +$^{3}$ School of Computer Science and Technology, East China Normal University {lip21, qtang22} @m.fudan.edu.cn, ybwu@cs.ecnu.edu.cn {txsun19, hyan19, xjhuang, xpqiu} @fudan.edu.cn + +# Abstract + +Large language models (LLMs) pre-trained on massive corpora have demonstrated impressive few-shot learning ability on many NLP tasks. A common practice is to recast the task into a text-to-text format such that generative LLMs of natural language (NL-LLMs) like GPT-3 can be prompted to solve it. However, it is nontrivial to perform information extraction (IE) tasks with NL-LLMs since the output of the IE task is usually structured and therefore is hard to be converted into plain text. In this paper, we propose to recast the structured output in the form of code instead of natural language and utilize generative LLMs of code (Code-LLMs) such as Codex to perform IE tasks, in particular, named entity recognition and relation extraction. In contrast to NL-LLMs, we show that Code-LLMs can be well-aligned with these IE tasks by designing code-style prompts and formulating these IE tasks as code generation tasks. Experiment results on seven benchmarks show that our method consistently outperforms fine-tuning moderate-size pre-trained models specially designed for IE tasks (e.g., UIE) and prompting NL-LLMs under few-shot settings. We further conduct a series of in-depth analyses to demonstrate the merits of leveraging Code-LLMs for IE tasks. $^{1}$ + +# 1 Introduction + +Information extraction (IE) aims to recognize structured information from plain text. It spans various tasks with diverse output structures such as named entity recognition (NER), relation extraction (RE), etc. (Sang and Meulder, 2003; Grishman, 2019; Wang et al., 2021a; Zhong and Chen, 2021; Lu et al., 2022). To express and address these different tasks in a unified framework, recent works propose to linearize the output structures into unstructured + +![](images/41ba07d0b8cb9f6b717366097320ced044ff640788c9220845536d2082d90763.jpg) +(a) Performing NER with NL-LLMs + +![](images/8ad544cf3f2bd412ae0d1fdb38d3297808b90d2f158a0ff3c720629c1c89b8ce.jpg) +(b) Performing NER with Code-LLMs +Figure 1: Illustrations of performing structured NER task with NL-LLMs and Code-LLMs, respectively. In contrast to prompting NL-LLMs with plain natural language, we utilize Code-LLMs with structured code-style prompts to mitigate the output discrepancy between the pre-training and inference stages. + +strings and solve the IE tasks with sequence generation models (Yan et al., 2021b; Huguet Cabot and Navigli, 2021; Paolini et al., 2021; Josifoski et al., 2022; Lu et al., 2022). For example, given the input sentence "Steve became CEO of Apple in 1998." of a NER task, UIE (Lu et al., 2022) generates the target as a sequence "(person: Steve) (organization: Apple))". + +While this kind of linearizing approach achieves promising results with sufficient training data, it still performs poorly under the few-shot scenario. For instance, compared with full-data training, the performance dropped by around $20\%$ when applying UIE on a 5-shot NER task CoNNL03 (Lu et al., 2022). + +Considering the tremendous few-shot adapting capabilities of large language models (LLMs) (Brown et al., 2020; Rae et al., 2021; + +Chowdhery et al., 2022; Hoffmann et al., 2022), we manage to employ them to perform few-shot IE tasks, especially the few-shot NER task and RE task. Typically, for NLP tasks like text classification, previous works reformulate them into text-to-text generation formats and prompt the LLMs of natural language (NL-LLMs) like GPT-3 (Brown et al., 2020) to generate the answer. In contrast, due to the complex structure inside the targets of IE tasks, linearized targets of previous works like " ((person: Steve) (organization: Apple))" are usually "unnatural", resulting in a mismatch between the output format at the pre-training time and the inference time (see Figure 1(a)). As a consequence, when using these flattening methods to perform IE tasks with pre-trained language models, the predicted outputs are fragile and often require complex decoding strategies to be post-processed into valid structures (Lu et al., 2022; Josifoski et al., 2022). + +In this paper, we propose to frame these two IE tasks into code generation tasks and leverage the LLMs of code (Code-LLMs) to address them. We argue the abundant structured code information encoded in the pretrained Code-LLMs can benefit these IE tasks. As demonstrated in Figure 1(b), it is easy to convert the text-to-structure IE task into a structure-to-structure code generation task, while transforming it into a text-to-text format can be difficult. Take the example input in Figure 1, "Steve became CEO of Apple in 1998 .", we wrap it into a piece of Python code, and formulate the structured entity outputs as Python dictionaries with keys "text" and "type". We compose them into a Python function that is semantically equivalent to the NER example, which is shown as follows: + +```python +defnamedEntity_recognition(input_text): + '''extract named entities from the input_text.'' + input_text = "Steve became CEO of Apple in 1998." + entity_list = [] + #extracted named entities + entity_list.append(['text': "Steve", "type": "person"] + entity_list.append(['text': "Apple", \ "type": "organization")] +``` + +After demonstrating a few training samples with the same format, we feed the code-style prompt (the highlighted lines with light grey color) into Code-LLMs and get the structured prediction. + +We conduct experiments on seven benchmarks of NER and RE tasks, and carefully analyze the benefits of our approach (named CODEIE). The findings are as follows: + +
Model TypeGenerative?Extremely Large?Structured Pre-train?Few-Shot NER and RE Tasks
Unified FrameworkFew-shot LearningStructured Task
Pre. Models (e.g., UIE)✓X✓X
NL-LLMs (e.g., GPT-3)✓✓XX
Code-LLMs (e.g., Codex)✓✓✓✓
+ +Table 1: A high-level comparison between previous IE Models, NL-LLMs and Code-LLMs. The bottom row illustrates our approach. + +1) Prompting Code-LLMs (e.g., Codex (Chen et al., 2021)) with code-style inputs consistently outperforms fine-tuning UIE, a specially pre-trained model for IE tasks, and prompting NL-LLMs (e.g., GPT-3) under few-shot settings. +2) With the same LLM (either NL-LLM or Code-LLM), the code-style prompt performs better than the linearized text prompt, demonstrating the advantage of representing structured targets with code. +3) With the same prompt (either natural language or code), the Code-LLM (i.e., Codex) achieves better performance than the NL-LLM (i.e., GPT-3), demonstrating the merits of performing IE tasks with Code-LLMs. +4) Compared with natural language prompts, using the code-style prompts showed higher fidelity to the output structures, i.e., the outputs have a lower structural error rate. + +The high-level differences between previous moderate-size models, NL-LLMs, and Code-LLMs for IE tasks are summarized in Table 1. + +# 2 CODEIE + +In this section, we first formulate the two IE tasks we focus on, named entity recognition (NER) and relation extraction (RE) in Section 2.1. Then we describe how we recast these structured prediction tasks into code generation tasks (Section 2.2) and prompt Code-LLMs to perform them (Section 2.3) under the few-shot scenario. We use Python language for our code generation tasks since public Python codebases are abundant and Code-LLMs are sufficiently pre-trained on them. + +# 2.1 Task Formulation + +Given an input sentence $x$ with $l$ tokens $x_{1}, x_{2}, \ldots, x_{l}$ , IE tasks are to predict structured target $y$ from $x$ . + +![](images/4e9848cc392ad9621883d0106b400564fbe87debf6f3d5ec11df4afcd3b608e7.jpg) +(a) Converting NER into code generation task + +![](images/765daf567f6d8f0755b81adf7394a635a00da966635e1b2065dba59c8aec1471.jpg) +(b) Converting RE into code generation task +Figure 2: The way to convert NER and RE into code generation task. + +The target $y$ of NER is a set of $(e, t)$ pairs, where $e$ is an entity span (e.g., "Steve") and $t$ is the corresponding entity type (e.g., "person"). The entity span is a sequence of tokens from $x$ , and the entity type belongs to a pre-defined entity type set $T$ . + +The prediction target $y$ of RE is comprised of a set of triplets $(e_1, r, e_2)$ , where $e_1$ and $e_2$ are two entity spans from $x$ and $r \in R$ is the semantic relation (e.g., "work for") between the two entities. Here $R$ denotes a pre-defined relation type set. In addition to extracting the relation of entities, we are often interested in also predicting the entity types $t_1$ and $t_2$ of entities $e_1$ and $e_2$ at the same time. + +In the few-shot setting, we are given a small set of annotated samples $\{(x_i,y_i)\}_{i = 1}^n$ that consists of $k$ samples per class to compose a $k$ -shot setting. + +# 2.2 Formulating IE Tasks into Code Generation Task + +In order to utilize generative Code-LLMs for IE tasks, we reformulate IE tasks as code generation tasks. The code generation task is to predict the subsequent code sequence given an incomplete piece of code. Hence, we can recast the input and output of the IE task into an incomplete piece of code and the code to be predicted, respectively, such that they can compose a complete piece of code that is semantically equivalent to the original sample while maintaining the syntax of the programming language. + +In this work, we mainly use Python functions to + +represent IE tasks. We wrap the input text $x$ into a code-style prompt $x^c$ and represent the output structure $y$ with structured Python elements, such as the list, dictionary, etc. As shown in Figure 2, for NER and RE tasks, we first transform the task name into the name of the Python function and add a docstring to illustrate the goal of the task. We assign the input text string $x$ to a variable input_text. Then we initialize an empty list to save the output and append a descriptive comment like "# extracted named entities" to prompt Code-LLMs to put named entities into the list. We pack the above code as our code prompt $x^c$ . + +For the structured target $y$ , we utilize the append method of Python list and represent each basic information unit (e.g., a pair for NER tasks or a triplet for RE tasks) as a Python dictionary. Hence, the target $y^c$ to be predicted by Code-LLMs is reformulated into a list of dictionaries. For NER, we add Python dictionaries with keys "text" and "type" to the list, where the values of the dictionaries are the corresponding entity span and entity type. For RE, we similarly add dictionaries with keys "rel_type", "ent1_type", "ent1_text", "ent2_type", and "ent2_text" to the list to represent the structured target. + +The Code-LLM is expected to complete the list conditioning on the function name, docstring, and input text. Figure 2 shows examples of formulating an original IE sample into a code-style one. + +It is worth noting that the design space of the code-style prompt is large and hard to be fully explored. The formulation described above is a straightforward instance using Python. We also explore several other formulations to recast IE tasks into code generation tasks, which can be found in Appendix A.1. + +# 2.3 Prompting Code-LLMs with In-Context Demonstrations + +Despite the carefully designed prompt, it is nontrivial to perform IE tasks by prompting Code-LLMs without any samples. Therefore, it is necessary to let Code-LLMs be aware of a few labeled samples in typical few-shot settings. + +With the increasing size of pre-trained language models, fine-tuning is becoming more and more expensive or even infeasible since recent LLMs are usually released as black-box APIs (Sun et al., 2022). Hence, instead of fine-tuning Code-LLMs on the few-shot dataset, we explore including the labeled samples in the context and performing in-context learning (Brown et al., 2020). We select $n$ samples $\{(x_i, y_i)\}_{i=1}^n$ from the training dataset and convert them to corresponding code-style pairs $\{(x_i^c, y_i^c)\}_{i=1}^n$ . We concatenate them as a string to compose the in-context demonstrations $x_1^c \oplus y_1^c \ldots x_n^c \oplus y_n^c$ . Given an arrived test sample $x$ , we first convert it to a code prompt $x^c$ and preprocess the demonstration context, i.e., $x_1^c \oplus y_1^c \ldots x_n^c \oplus y_n^c \oplus x^c$ . After feeding the constructed input into the Code-LLM, we are expected to get an output $y^c$ that is formatted as the same as $y_1^c, y_2^c, \ldots y_n^c$ (see Figure 2). We find that $y^c$ almost always retains the syntax of Python language and is easy to be converted back to its original structure $y$ . + +# 3 Experiments + +# 3.1 Setup + +Datasets We evaluate our approach on NER task with CoNLL03 (Sang and Meulder, 2003), ACE04 (Doddington et al., 2004) and ACE05-E(Walker et al., 2006). For relation extraction, we evaluate on datasets CoNLL04 (Roth and Yih, 2004), ACE05-R (Walker et al., 2006), NYT (Riedel et al., 2010) and SciERC (Luan et al., 2018). Table 2 shows the dataset statistics. We follow Lu et al. (2022) to preprocess all these datasets. + +Code-LLMs For Code-LLMs, we conduct experiments mainly with the code-davinci-002 + +
|Entsl|Rels|#Train#Val#Test
CoNLL034-14,0413,2503,453
ACE047-6,202745812
ACE05-E7-72999711060
CoNLL0445922231288
ACE05-R7610,0512,4202,050
NYT32456,1965,0005,000
SciERC671,861275551
+ +Table 2: Statistics of the datasets used in our experiments. |Ents| and |Rels| denote the number of entity types and relation types. #Train, #Val and #Test denote the sample number in each split. + +version Codex from OpenAI. Codex is a large language model adapted from GPT-3 and further pre-trained on open-source codebases. The code-davinci-002 version Codex supports 8k input tokens at most. We get the model predictions by querying OpenAI $\mathrm{API}^2$ in the few-shot in-context prompting way. We generate up to 280 tokens with greedy decoding. + +Baselines We compare our approach with two kinds of few-shot learning methods: + +1) Fine-tuning We fine-tune the base and large versions of two moderate-size pre-trained models: T5 and UIE. T5 is a sequence-to-sequence model pre-trained on large-scale text corpora. UIE is a model further pre-trained from T5 on the structured datasets. UIE utilizes the textual structured extraction language (SEL) to express the output structures. We use the same approach and parameters with Lu et al. (2022) when fine-tuning T5 and UIE. +2) Prompting We compare our approach with prompting NL-LLMs, in particular GPT-3. We mainly experiment with the text-davinci-002. We use a text prompt, of which the format is slightly modified from SEL. As shown in Figure 1(a), given an input text $x$ , the text prompt and output format are like "The text is $x$ . The named entities in the text: " and ((person: ...) (organization: ...))", respectively. See Appendix A.2 for more details of the text prompt. The approach and super-parameters of NL-LLMs prompting and Code-LLMs prompting are identical. + +
ModelPrompt TypeEntityRelationAVG
CoNLL03ACE04ACE05-ECoNLL04ACE05-RNYTSciERC
Full Data
Pre. SoTA-93.2186.8484.7473.6065.6092.7035.6076.04
UIE-largetext92.9986.8985.7875.0066.06-36.53-
+ +
Few Shot
#shot (#sample)5 (25)2 (16)2 (16)5 (25)2 (14)1 (24)2 (16)
T5-basetext33.68±29.177.25±12.009.09±15.7414.56±13.870.00±0.005.59±9.680.00±0.0010.02
UIE-basetext70.37±0.5444.31±1.6139.71±0.9145.63±1.508.69±1.41-5.69±0.49-
T5-largetext53.08±7.7124.67±5.2624.31±4.7410.03±8.751.41±0.7415.29±8.760.25±0.4318.43
UIE-largetext70.62±3.2245.08±3.6343.03±2.2647.68±2.299.59±4.89-7.30±2.01-
GPT-3text68.84±1.2945.51±0.2348.93±0.4939.67±2.445.13±1.2416.07±4.674.39±0.9832.65
GPT-3code81.00±1.4953.44±1.4452.98±1.5351.33±1.3412.33±2.0624.81±1.904.67±0.6740.08
Codextext72.66±0.6649.58±1.3749.55±1.1447.30±2.2510.08±2.0624.63±6.745.40±2.6537.03
Codexcode82.32±0.3755.29±0.3754.82±2.0953.10±2.0214.02±3.2732.17±1.467.74±1.5442.78
+ +Table 3: Experiment performances on NER and RE benchmarks. Our approach is highlighted with light grey. The full data fine-tuning performances come from UIE. For the few-shot setting, we evaluate T5-base, UIE-base, T5-large and UIE-large with fine-tuning, and GPT-3 and Codex by few-shot prompting with two different prompt types. The text prompt is the structured extraction language (SEL) introduced by UIE. The code format is introduced in Section 2.2. We set the shot number (#shot) and the corresponding sample number (#sample) differently to fit into the GPT-3 maximum length limitation (4097 tokens). + +Few-Shot Setting For each IE task, we randomly sample $k$ training samples for each entity or relation type to construct a $k$ -shot training set. The value of $k$ varies across different datasets to satisfy the maximum length limitation (4097) of GPT-3. To be compatible with datasets that contain samples with empty targets, we regard those empty-target samples as an additional class and include $k$ samples belonging to that class in the training set. + +Evaluation Same as previous work (Lu et al., 2022), we use Entity F1 and Relation Strict F1 as the evaluation metrics for NER tasks and RE tasks, respectively. Under these metrics, an entity span prediction is correct if its offsets and entity type match the golden entity. And a relation prediction is correct if the relation type is correct and the corresponding offsets and types of its entities are correct. Since few-shot training is of high variance, we perform 3 runs with different random seeds for each experiment and report the mean and standard deviation of the metric. + +# 3.2 Results + +LLMs vs. Moderate-sized Models As shown in Table 3, LLMs (GPT-3 and Codex) achieve superior performance over moderate-sized models (T5 and UIE) under few-shot settings, demonstrating a strong few-show learning ability on IE tasks. Especially, on average performance over the seven con + +![](images/142fe111188abd4762e5346be05680de1f66bd7d9e4e4954bb488a6c2ce40aa8.jpg) +Figure 3: Performance with different shot numbers on CoNLL03 (NER) and CoNLL04 (RE) datasets. + +sidered benchmarks, our proposed CODEIE (Codex + code prompt) achieves the best results, improving T5-large and T5-base by $132\%$ and $327\%$ , respectively. In addition, under 1-shot learning settings, CODEIE improves the performance of UIE-large by more than $60\%$ on CoNLL03 and CoNLL04 benchmarks (see Table 6 in the Appendix). + +Code Prompt vs. Text Prompt We then compare the performance of code prompt vs. text prompt when using the same LLM, i.e., comparing $\langle \mathrm{GPT - 3 + }$ text prompt\rangle with $\langle \mathrm{GPT - 3 + }$ code prompt\rangle and comparing $\langle \mathrm{Codex + }$ text prompt] with $\langle \mathrm{Codex + }$ code prompt\rangle. As a result, we find that prompting LLMs with code yields significant improvement (23% for GPT-3 and 16% for Codex). What is surprising is that code prompt is even more beneficial to GPT-3, which is not specif + +
ModelPrompt DesignEntity CoNLL03Relation CoNLL04
GPT-3struct lang68.84±1.2939.67±2.44
natural lang46.36±12.5640.90±3.67
Codexfunc def82.32±0.3753.10±2.02
class init81.29±0.7252.32±0.94
func exec84.05±1.2453.32±3.47
func init-81.95±1.0153.59±1.10
+ +Table 4: Performance of different prompt designs. "struct lang" and "func def" are the "text" and "code" prompt types respectively in our main experiments. + +ically trained on code data. + +Code-LLMs vs. NL-LLMs When using the same kind of prompt and comparing the used LLMs, i.e., comparing $\langle \mathrm{GPT - 3 + }$ text prompt\rangle and $\langle \mathrm{Codex + }$ text prompt\rangle and comparing $\langle \mathrm{GPT - 3 + }$ code prompt\rangle and $\langle \mathrm{Codex + }$ code prompt\rangle, we find that Codex consistently surpasses GPT-3, demonstrating that code pre-training can be beneficial to IE tasks. + +Different Shot Numbers We further compare these approaches under different shot numbers on CoNLL03 and CoNLL04. As shown in Figure 3, we can see that the obtained phenomenons still hold when increasing the number of shots. + +Different Prompt Designs The design of the prompt can be an important factor affecting the model performance (Min et al., 2022). Hence, we explore additional prompt designs for both text prompt and code prompt. The detailed prompt deigns can be found in Appendix A. The experimental results are shown in Table 4, from which we find that code prompts consistently outperform text prompts. Hence, the superior performance of using code prompts is mainly contributed by the code style instead of some specific instance of prompt design. + +Different LLMs To verify the versatility of the proposed approach and the observed findings, we further conduct experiments with text-davinci-001 version of GPT-3 and code-davinci-001 version of Codex. As shown in Table 7, the previous findings still hold across the two different versions. + +# 4 Analysis + +To take a closer look at the difference between prompting NL-LLMs with textual format input and + +![](images/5b86fe07b05ca877ad0ff1ae80a59c377c5393246fcc173d39c7dcfa597a6433.jpg) +Figure 4: Format consistency between the input format and the model (measured by perplexity) for text prompt and code prompt on 7 datasets. + +prompting Code-LLMs with code format input, in this section, we define several informative metrics and conduct in-depth analyses to shed some light on the following question: what contributes to the final performance of CODEIE for $IE$ tasks? + +# 4.1 Format Consistency + +We can see from Figure 1(a) that an apparent inappropriateness to use NL-LLMs for IE tasks is the inconsistency between the structured output format at inference time and NL-LLMs that are trained on natural language at pre-training time, while the format of code-style output aligns well with Code-LLMs. It has been evidenced that adapting pre-trained models to downstream tasks in a manner that is well aligned with it pre-training paradigm usually achieves better few-shot learning performance. Hence we assume the promising performance of CODEIE partly comes from the better format consistency between the code-style sample and the pretrained code model. + +To verify this hypothesis, given a sample, we compare the perplexities of a pre-trained language model on its text format and a pre-trained code model on its code format. Formally, given a generative model $M$ , the conditional perplexity $ppl$ of a sample $(x,y)$ is as follows, + +$$ +p p l _ {M} (y | x) = \prod_ {i = 1} ^ {m} P _ {M} \left(y _ {i} \mid y _ {1} \dots y _ {i - 1}, x\right) ^ {- \frac {1}{l}}. \tag {1} +$$ + +For an original IE sample $(x,y)$ , we first transform it to its natural language text pair $(x^t, y^t)$ and its code piece pair $(x^c, y^c)$ , and then compute the conditional perplexity of them with the language model $M^{nl}$ and the code model $M^c$ , respectively, i.e., the + +![](images/e75e6b0367ea3ab9da0f1980d7e5e9d7a8dd7d19610615b408fb4b5243a86aeb.jpg) +Figure 5: Structural error rate of different combinations of LLM and prompting methods. Prompting LLMs with code exhibits higher structure fidelity. + +$ppl_{M^{nl}}(y^t |x^t)$ and $ppl_{M^c}(y^c |x^c)$ . A lower conditional perplexity means the output format aligns well with the pre-training distribution of the model. + +Since LLMs usually limit user access by their black-box APIs, we instead utilize two agent models T5 (Raffel et al., 2020) and CodeT5 (Wang et al., 2021b) to calculate the perplexities. CodeT5 is a variant of T5 model that is further pre-trained on code data. We calculate the perplexities on the previous seven datasets with the base version of the two models, namely T5-base and CodeT5-base. Figure 4 shows the mean perplexities of two base version models on the training samples of each task. We can observe the perplexity of the text format outputs measured by T5-base is usually larger than code format outputs measured by CodeT5-base. That means, transforming IE samples to code formats can better align with the data distribution of code pre-training and therefore the pre-trained code language model. + +# 4.2 Model Fidelity + +Besides the low format consistency of prompting ML-LLMs, we find that NL-LLMs are more likely to generate outputs with structural and semantic errors when performing few-shot IE tasks than Code-LLMs. In other words, Code-LLMs seem to be more faithful to the demonstrated few-shot samples than NL-LLMs. To quantitatively measure the model fidelity, we define two metrics: + +Structure Fidelity Structure fidelity measures how faithful the model is to the structure of demonstrations provided in the context. This can be simply measured by calculating the structural error rate, which is the proportion of generated samples with structural errors. In particular, we construct a + +
TaskError TypeSamples
NEREntity type not in Tcurrency, company, time, event, profession, organizational indicator, financial, object, event
RERelation type not in Rcalled, organization, person, relate, specialize, assumption, cause, assign
+ +Table 5: Semantically errant samples detected in our experiments. These errant samples mainly came from GPT-3. + +parser with a series of hand-written rules to transform the model-generated outputs back to the desired format and filter out samples with invalid structures. Figure 5 demonstrates the structure fidelity of different models with different prompts on the seven benchmarks. Results show that the outputs generated by GPT-3 and Codex using text prompts are fragile while using code prompts tends to generate nearly zero structurally erroneous samples. Besides, with the same text prompt, Codex tends to generate fewer structurally errant samples than GPT-3, demonstrating its superior understanding ability on general structured input instead of being limited to existing programming languages. + +Semantic Fidelity Another measurement of model fidelity is semantic fidelity, which is designed for those samples that have a valid structure and can succeed in our parser but are semantically incorrect. The difference between the defined semantic fidelity and the conventional prediction error is that semantic fidelity mainly considers model behaviours that violate the formulation of the task, e.g., predicting an entity type that does not exist in the given entity type set or extracting an entity span that does not appear in the input text. Some example semantic errors detected in our experiments are listed in Table 5. We report the statistical result of the tasks in Table 8 and Table 9 in the Appendix. As a result, we find that GPT-3 generated more semantic errors than Codex though some of the errors seem to be "correct" but are out of the pre-defined class set. In a nutshell, GPT-3 tends to generate free-form results and Codex is more faithful to the demonstrations provided in the context and therefore is more predictable for IE tasks. + +# 4.3 Fine-grained Performance + +In addition, we conduct a fine-grained evaluation to compare different approaches. In addition to the F1 score, precision and recall are also important metrics for NER and RE tasks. To investigate + +![](images/8d4cdb005ec2f79f4551fa1ddc93caec8dec1e602dcf755d049117ecb7b353f4.jpg) +Figure 6: Model Performance Details on NER and RE Tasks. We report the averaged metric scores of all the NER or RE datasets. + +![](images/37ba9d0faa79e831f4bbe227ca880846d4590c40ee4c780a243330ed46608d50.jpg) + +how different LLMs and prompting methods affect precision and recall, we report the two metrics in Figure 6. Results show that: (a) The code prompt improves model performance in both precision and recall; (b) Compared with GPT-3, Codex achieves higher recall and comparable precision on NER tasks and and achieves both higher precision and recall on RE tasks. + +# 5 Related Work + +Generative Information Extraction Generative information extraction which frames IE tasks as token generation tasks receive more attention recently due to their potential to unify different tasks (Yan et al., 2021a; Josifoski et al., 2022). Yan et al. (2021a) designs various ways to linearize entities into a sentence to unify various named entity recognition subtasks. TANL (Paolini et al., 2021) uses augmented language to improve the effect of generative models. Lu et al. (2022) also proposes a structured extraction language (SEL) and pre-trains their UIE model with this language on multiple structured datasets. These works linearize the structure output of IE tasks into text format to align the pretrained models. Different from them, we propose to recast the structural samples of IE tasks into structural code format and utilize aligned pre-trained code models to perform the tasks. + +Code-LLMs for Complex Tasks Recent works show Code-LLMs perform better on complex tasks like commonsense and symbolic reasoning (Madaan et al., 2022; Cheng et al., 2022), mathematical logic (Suzgun et al., 2022) and event argument prediction (Wang et al., 2022) tasks. We focus on the two mainstream IE tasks different from + +them, i.e., NER and RE. Besides, in-depth analyses are conducted to provide more insights. + +LLMs for Few-Shot NER and RE While LLMs like GPT-3 have shown strong few-shot learning abilities in many NLP tasks, limited works have explored their capabilities on typical IE tasks like NER and RE. Epure and Hennequin (2021) evaluate GPT-2 (Radford et al., 2019) on open-domain NER tasks with few-shot demonstrating. A recent work (Gutierrez et al., 2022) tests the performance of GPT-3 on biomedical NER and RE tasks and finds it underperforms compared to fine-tuning smaller pretrained models. Its concurrent work (Agrawal et al., 2022) finds that GPT-3 performs well on few-shot clinical IE tasks. We conduct our experiments on more general NER and RE datasets and find GPT-3 can achieve comparable performance to fine-tuning the UIE model. Besides, we successfully employ the LLMs of code with better performances for these IE tasks. + +# 6 Conclusion + +We propose the first work to utilize the structured Code-LLMs with code-style prompts to perform the few-shot NER and RE tasks. Experiments show our approach consistently surpasses the UIE models and the NL-LLMs counterpart under the few-shot setting. We conducted extensive analysis and find the performances come from better format consistency and model fidelity, etc. We think these analyzes can facilitate future work. As the further works, we will employ CODEIE on more IE tasks in different domains, and inspect the robustness of it. + +# Limitations + +Though our approach demonstrates better performances than the baseline models, how to design a good code-format prompt has not been fully inspected. Besides, we mainly conduct experiments on the black-box GPT-3 and Codex models but they are not open-sourced and querying the GPT-3 model cost the economic budget. And the use of LLMs may bring environmental pollution. Another limitation of our approach is that the Code-LLMs mainly trained on programming language datasets with English annotations. Exploring our model on non-English datasets (like Chinese datasets) is the future work. + +# Acknowledgements + +We would like to express our gratitude to the reviewers for their helpful comments and suggestions. We are also very grateful to Yaojie Lu for his friendly assistance during our experiments. This work was supported by the National Natural Science Foundation of China (No. 62236004 and No. 62022027) and CCF-Baidu Open Fund. + +# References + +Monica Agrawal, Stefan Hegselmann, Hunter Lang, Yoon Kim, and David A. Sontag. 2022. Large language models are few-shot clinical information extractors. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, EMNLP 2022, Abu Dhabi, United Arab Emirates, December 7-11, 2022, pages 1998-2022. 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. +Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde de Oliveira Pinto, Jared Kaplan, Harrison Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, Alex Ray, Raul Puri, Gretchen Krueger, Michael Petrov, Heidi Khlaaf, Girish Sastry, Pamela Mishkin, Brooke Chan, Scott Gray, + +Nick Ryder, Mikhail Pavlov, Alethea Power, Lukasz Kaiser, Mohammad Bavarian, Clemens Winter, Philippe Tillet, Felipe Petroski Such, Dave Cummings, Matthias Plappert, Fotios Chantzis, Elizabeth Barnes, Ariel Herbert-Voss, William Hebgen Guss, Alex Nichol, Alex Paino, Nikolas Tezak, Jie Tang, Igor Babuschkin, Suchir Balaji, Shantanu Jain, William Saunders, Christopher Hesse, Andrew N. Carr, Jan Leike, Joshua Achiam, Vedant Misra, Evan Morikawa, Alec Radford, Matthew Knight, Miles Brundage, Mira Murati, Katie Mayer, Peter Welinder, Bob McGrew, Dario Amodei, Sam McCandlish, Ilya Sutskever, and Wojciech Zaremba. 2021. Evaluating large language models trained on code. CoRR, abs/2107.03374. +Zhoujun Cheng, Tianbao Xie, Peng Shi, Chengzui Li, Rahul Nadkarni, Yushi Hu, Caiming Xiong, Dragomir Radev, Mari Ostendorf, Luke Zettlemoyer, Noah A. Smith, and Tao Yu. 2022. Binding language models in symbolic languages. CoRR, abs/2210.02875. +Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, Parker Schuh, Kensen Shi, Sasha Tsvyashchenko, Joshua Maynez, Abhishek Rao, Parker Barnes, Yi Tay, Noam Shazeer, Vinodkumar Prabhakaran, Emily Reif, Nan Du, Ben Hutchinson, Reiner Pope, James Bradbury, Jacob Austin, Michael Isard, Guy Gur-Ari, Pengcheng Yin, Toju Duke, Anselm Levskaya, Sanjay Ghemawat, Sunipa Dev, Henryk Michalewski, Xavier Garcia, Vedant Misra, Kevin Robinson, Liam Fedus, Denny Zhou, Daphne Ippolito, David Luan, Hyeontaek Lim, Barret Zoph, Alexander Spiridonov, Ryan Sepassi, David Dohan, Shivani Agrawal, Mark Omernick, Andrew M. Dai, Thanumalayan Sankaranarayana Pillai, Marie Pellat, Aitor Lewkowycz, Erica Moreira, Rewon Child, Oleksandr Polozov, Katherine Lee, Zongwei Zhou, Xuezhi Wang, Brennan Saeta, Mark Diaz, Orhan First, Michele Catasta, Jason Wei, Kathy Meier-Hellstern, Douglas Eck, Jeff Dean, Slav Petrov, and Noah Fiedel. 2022. Palm: Scaling language modeling with pathways. CoRR, abs/2204.02311. +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. +Elena V. Epure and Romain Hennequin. 2021. A realistic study of auto-regressive language models for named entity typing and recognition. CoRR, abs/2108.11857. +Ralph Grishman. 2019. Twenty-five years of information extraction. Nat. Lang. Eng., 25(6):677-692. + +Bernal Jiménez Gutiérrez, Nikolas McNeal, Clay Washington, You Chen, Lang Li, Huan Sun, and Yu Su. 2022. Thinking about GPT-3 in-context learning for biomedical ie? think again. CoRR, abs/2203.08410. +Jordan Hoffmann, Sebastian Borgeaud, Arthur Mensch, Elena Buchatskaya, Trevor Cai, Eliza Rutherford, Diego de Las Casas, Lisa Anne Hendricks, Johannes Welbl, Aidan Clark, Tom Hennigan, Eric Noland, Katie Millican, George van den Driessche, Bogdan Damoc, Aurelia Guy, Simon Osindero, Karen Simonyan, Erich Elsen, Jack W. Rae, Oriol Vinyals, and Laurent Sifre. 2022. Training compute-optimal large language models. CoRR, abs/2203.15556. +Pere-Lluis Huguet Cabot and Roberto Navigli. 2021. REBEL: Relation extraction by end-to-end language generation. In Findings of the Association for Computational Linguistics: EMNLP 2021, pages 2370-2381, Punta Cana, Dominican Republic. Association for Computational Linguistics. +Martin Josifoski, Nicola De Cao, Maxime Peyrard, Fabio Petroni, and Robert West. 2022. GenIE: Generative information extraction. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 4626-4643, Seattle, United States. Association for Computational Linguistics. +Yaojie Lu, Qing Liu, Dai Dai, Xinyan Xiao, Hongyu Lin, Xianpei Han, Le Sun, and Hua Wu. 2022. Unified structure generation for universal information extraction. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 5755-5772, Dublin, Ireland. Association for Computational Linguistics. +Yi Luan, Luheng He, Mari Ostendorf, and Hannaneh Hajishirzi. 2018. Multi-task identification of entities, relations, and coreference for scientific knowledge graph construction. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 3219-3232, Brussels, Belgium. Association for Computational Linguistics. +Aman Madaan, Shuyan Zhou, Uri Alon, Yiming Yang, and Graham Neubig. 2022. Language models of code are few-shot commonsense learners. CoRR, abs/2210.07128. +Sewon Min, Xinxi Lyu, Ari Holtzman, Mikel Artetxe, Mike Lewis, Hannaneh Hajishirzi, and Luke Zettlemoyer. 2022. Rethinking the role of demonstrations: What makes in-context learning work? CoRR, abs/2202.12837. +Giovanni Paolini, Ben Athiwaratkun, Jason Krone, Jie Ma, Alessandro Achille, Rishita Anubhai, Cicero Nogueira dos Santos, Bing Xiang, and Stefano Soatto. 2021. Structured prediction as translation between augmented natural languages. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net. + +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. +Jack W. Rae, Sebastian Borgeaud, Trevor Cai, Katie Millican, Jordan Hoffmann, H. Francis Song, John Aslanides, Sarah Henderson, Roman Ring, Susannah Young, Eliza Rutherford, Tom Hennigan, Jacob Menick, Albin Cassirer, Richard Powell, George van den Driessche, Lisa Anne Hendricks, Maribeth Rauh, Po-Sen Huang, Amelia Glaese, Johannes Welbl, Sumanth Dathathri, Saffron Huang, Jonathan Uesato, John Mellor, Irina Higgins, Antonia Creswell, Nat McAleese, Amy Wu, Erich Elsen, Siddhant M. Jayakumar, Elena Buchatskaya, David Budden, Esme Sutherland, Karen Simonyan, Michela Paganini, Laurent Sifre, Lena Martens, Xiang Lorraine Li, Adhiguna Kuncoro, Aida Nematzadeh, Elena Gribovskaya, Domenic Donato, Angeliki Lazaridou, Arthur Mensch, Jean-Baptiste Lespiau, Maria Tsimpoukelli, Nikolai Grigorev, Doug Fritz, Thibault Sotiaux, Mantas Pajarskas, Toby Pohlen, Zhitao Gong, Daniel Toyama, Cyprien de Masson d'Autume, Yujia Li, Tayfun Terzi, Vladimir Mikulik, Igor Babuschkin, Aidan Clark, Diego de Las Casas, Aurelia Guy, Chris Jones, James Bradbury, Matthew J. Johnson, Blake A Hechtman, Laura Weidinger, Jason Gabriel, William Isaac, Edward Lockhart, Simon Osindero, Laura Rimell, Chris Dyer, Oriol Vinyals, Kareem Ayoub, Jeff Stanway, Lorrayne Bennett, Demis Hassabis, Koray Kavukcuoglu, and Geoffrey Irving. 2021. Scaling language models: Methods, analysis & insights from training gopher. CoRR, abs/2112.11446. +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. +Sebastian Riedel, Limin Yao, and Andrew McCallum 2010. Modeling relations and their mentions without labeled text. In Machine Learning and Knowledge Discovery in Databases, European Conference, ECML PKDD 2010, Barcelona, Spain, September 20-24, 2010, Proceedings, Part III, volume 6323 of Lecture Notes in Computer Science, pages 148-163 Springer. +Dan Roth and Wen-tau Yih. 2004. A linear programming formulation for global inference in natural language tasks. In Proceedings of the Eighth Conference on Computational Natural Language Learning, CoNLL 2004, Held in cooperation with HLT-NAACL 2004, Boston, Massachusetts, USA, May 6-7, 2004, pages 1-8. ACL. +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. + +Tianxiang Sun, Yunfan Shao, Hong Qian, Xuanjing Huang, and Xipeng Qiu. 2022. Black-box tuning for language-model-as-a-service. In International Conference on Machine Learning, ICML 2022, 17-23 July 2022, Baltimore, Maryland, USA, volume 162 of Proceedings of Machine Learning Research, pages 20841-20855. PMLR. + +Mirac Suzgun, Nathan Scales, Nathanael Schärli, Sebastian Gehrmann, Yi Tay, Hyung Won Chung, Aakanksha Chowdhery, Quoc V. Le, Ed H. Chi, Denny Zhou, and Jason Wei. 2022. Challenging big-bench tasks and whether chain-of-thought can solve them. CoRR, abs/2210.09261. + +Christopher Walker, Stephanie Strassel, Julie Medero, and Kazuaki Maeda. 2006. Ace 2005 multilingual training corpus ldc2006t06. In *Philadelphia: Linguistic Data Consortium*. Web Download. + +Xingyao Wang, Sha Li, and Heng Ji. 2022. Code4struct: Code generation for few-shot structured prediction from natural language. CoRR, abs/2210.12810. + +Yijun Wang, Changzhi Sun, Yuanbin Wu, Hao Zhou, Lei Li, and Junchi Yan. 2021a. Unire: A unified label space for entity relation extraction. 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 220-231. Association for Computational Linguistics. + +Yue Wang, Weishi Wang, Shafiq Joty, and Steven C.H. Hoi. 2021b. CodeT5: Identifier-aware unified pretrained encoder-decoder models for code understanding and generation. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 8696-8708, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. + +Hang Yan, Junqi Dai, Tuo Ji, Xipeng Qiu, and Zheng Zhang. 2021a. A unified generative framework 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 2416-2429, Online. Association for Computational Linguistics. + +Hang Yan, Tao Gui, Junqi Dai, Qipeng Guo, Zheng Zhang, and Xipeng Qiu. 2021b. 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. + +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 Prompt Format Design + +# A.1 Code Format Prompts + +We design several code-style prompt formats. We use the input sentence "Steve became CEO of Apple in 1998." and the corresponding entities ("Steve": person, "Apple": organization) and relations ("work for" of the two entities "Steve" and "Apple") as a running sample for the NER and RE tasks. + +The name of the format design is denoted with different font. we demonstrate the Python format prompt for NER and RE tasks. The prompt part is highlighted with grey color and the following codes are the expected output. We list the designed format as follows: + +1. func def: our main code format prompt to transform the IE tasks into code formats. + +# For the NER task, the format is + +```python +defnamedEntity_recognition(input_text): + ""extractnamed entitiesfrom the input_text.""input_text $=$ "Steve became CEO of Apple in 1998."entity_list $= [$ #extracted named entities entity_list.append({"text": "Steve", "type": $\leftrightarrow$ "person")}) entity_list.append({"text": "Apple","type": $\leftrightarrow$ "organization"})} +``` + +# For the RE task, the format is + +```python +def relation.extractation(input_text): + ''' extract the relations of named entities from the + input_text.'' + input_text = "Steve became CEO of Apple in 1998" + entity_relation_list = [] + # extracted relations + entity_relation_list.append({ + "rel_type": "work for", + ent1_type: "person", ent1_type: "Steve", + ent2_type: "organization", ent2_text: + ent2_text: "Apple") + }) +``` + +2. class init: we describe the IE tasks with the Python class. + +# For the NER task, the format is + +```python +class NamedEntityRecognition: +""extract named entities from the input_text. +def __init__(self, input_text): self.output_text $=$ "Steve became CEO of Apple in $\leftrightarrow$ 1998." entity_list $= []$ # extracted named entities +entity_list.append({"text": "Steve", "type": $\leftrightarrow$ "person"}) entity_list.append({"text": "Apple",\ "type": "organization)}) +``` + +# For the RE task, the format is + +```python +class RelationExtraction: +""extract the relations of named entities from the + $\leftrightarrow$ input_text. +def__init__(self, input_text): self.text $=$ "Steve became CEO of Apple in $\leftrightarrow$ 1998" entity_relation_list $=$ [] # extracted relations +entity_relation_list.append({"rel_type": "work } for", "ent1_type": "person", "ent1_text": "Steve", "ent2_type": "organization", $\leftrightarrow$ "ent2_text": "Apple"} +``` + +# 3. func exec: describe the IE tasks as a function execution procedure. + +# For the NER task, the format is + +```txt +extract named entities from a sentence . input_text $=$ "Steve became CEO of Apple in 1998." output $=$ named-entity_recognition(input_text) # the output is { "text": "Steve", "type": "person" } { "text": "Apple", "type": "organization" } +``` + +# For the RE task, the format is + +```jsonl +extract the relations of named entities from a + $\leftrightarrow$ sentence. +input_text $=$ "Steve became CEO of Apple in 1998" +output $=$ relation Extraction(input_text) +# the output is +{ "rel_type": "work for", "ent1_type": "person", + $\leftrightarrow$ "ent1_text": "Steve", "ent2_type": "organization", + $\leftrightarrow$ "ent2_text": "Apple"} +``` + +# 4. func init-: perturb the rational format design by exchanging the format design of NER and RE tasks. + +# For the NER task, the format is + +```python +def relation Extraction(input_text): + ''' extract the relations of named entities from the input_text.'' + input_text = "Steve became CEO of Apple in 1998." + entity Relation_list = [] + # extracted relations + entity Relation_list.append({ + "text": "Steve", "type": → "person"}, + entity Relation_list.append({ + "text": "Apple", "type": → "organization"}) +``` + +# For the RE task, the format is + +```python +defnamedEntity_recognition(input_text): + ""extract named entities from the input_text.: + input_text $=$ "Steve became CEO of Apple in 1998" +entity_list $= [\text{]}$ +#extracted named entities +entity_list.append(['rel_type": "work for", + $\leftrightarrow$ "ent1_type": "person", "ent1_text": "Steve", + $\leftrightarrow$ "ent2_type": "organization", "ent2_text": + $\leftrightarrow$ "Apple}") +``` + +# A.2 Text Format Prompts + +Similar to the above section (A.1), we describe the textual format prompt we used given the text input "Steve became CEO of Apple in 1998." The text input prompts are all the same and we highlighted the expected outputs with blue colour. + +1. struct lang: our mainly used text format prompt. + +For the NER task, the transformed format is: + +```txt +The text is "Steve became CEO of Apple in 1998 .". The named entities in the text: ((person: Steve) (organization: Apple)) +``` + +For the RE task, the transformed format is: + +```txt +The text is "Steve became CEO of Apple in 1998 .". The relations of named entities in the text: ((person: Steve (work for: Apple)) (organization: Apple)) +``` + +# 2. natural lang: a more "natural" format to describe the structures in natural language. + +For the NER task, the transformed format is: + +```txt +The text is "Steve became CEO of Apple in 1998 .". The named entities in the text: "Steve" is "person". "Apple" is "organization". +``` + +For the RE task, the transformed format is: + +```txt +The text is "Steve became CEO of Apple in 1998 .". The relations of named entities in the text: person "Steve" work for organization "Apple". +``` + +
ModelPrompt TypeEntityRelation
CoNLL03ACE04ACE05-ECoNLL04ACE05-RNYTSciERC
UIE-largetext46.75±6.1335.25±2.3134.29±1.9325.81±5.935.15±4.43-4.65±0.61
Codexcode75.89±1.7954.27±2.1451.91±2.5143.05±3.427.09±4.4032.17±1.466.05±0.82
RoI↑62.33 %53.96 %51.39 %66.80 %37.67 %-30.11 %
+ +Table 6: The 1-shot results of UIE-large and Codex, and Rate of Increase (RoI) of Codex than UIE-large. + +
ModelPrompt TypeEntityRelation
CoNLL03ACE04ACE05-ECoNLL04ACE05-RNYTSciERC
text-davinci-002text68.84±1.2945.51±0.2348.93±0.4939.67±2.445.13±1.2416.07±4.674.39±0.98
code-davinci-002code82.32±0.3755.29±0.3754.82±2.0953.10±2.0214.02±3.2732.17±1.467.74±1.54
text-davinci-001text38.55±6.1129.23±1.4929.73±2.2219.63±4.370.89±0.66-0.87±0.22
code-davinci-001code61.86±1.8833.62±3.8536.26±1.4528.75±1.901.65±1.55-1.91±0.30
+ +Table 7: Performances of different LLMs. text-davinci-001 is an InstructGPT model based on the previous GPT-3 model with Feedback Made Easy strategy. code-davinci-001 is an earlier version of code-davinci-002. + +
Entity Label ErrorEntity Span Error
CoNLL03ACE04ACE05-ECoNLL03ACE04ACE05-E
#test3453812106034538121060
#in-context shot522522
GPT-3+text15298414113140114
GPT-3+code57755949287357
Codex+text330649088141
Codex+code8536601185137
+ +Table 8: Detailed Errors on NER datasets. "Entity Label Error" means the predicted label is not in the predefined label set. "Entity Span Error" means the predicted span is not in the original input text. The reported error numbers are counted by summing 3 different seeds. + +
Ent1 Type ErrorEnt1 Span ErrorRelation Type Error
CoNLL04ACE05-RelNYTSciERCCoNLL04ACE05-RNYTSciERCCoNLL04ACE05-RNYTSciERC
#test288205050005512882050500055128820505000551
#in-context shot521252125212
GPT-3+text21078669335262664911601696173274358
GPT-3+code3410102410131051029105612200050
Codex+text18151008152015547715584820315820
Codex+code03461034611085441082014117
+ +Table 9: Detailed Errors on RE datasets. "Ent1 Type Error" means the predicted entity type of the first entity is not in the predefined type set. "Ent1 Span Error" means the predicted span of the first entity is not in the original input text. "Relation Type Error" means the predicted label is not in the predefined relation type set. The reported error numbers are counted by summing 3 different seeds. + +A For every submission: + +A1. Did you describe the limitations of your work? section 'limitations" +A2. Did you discuss any potential risks of your work? section 'limitations" +A3. Do the abstract and introduction summarize the paper's main claims? section "abstract" and section 1 "introduction" +A4. Have you used AI writing assistants when working on this paper? Left blank. + +B Did you use or create scientific artifacts? + +Section 3 + +B1. Did you cite the creators of artifacts you used? Section 3 +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? hard to find +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? complex procedure +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? complex procedure +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? complex procedure +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. examples number, details splits + +C Did you run computational experiments? + +Section 3 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? Section 3 + +The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +Section 3 + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +Section 3 + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +Section 3 + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +Not applicable. Left blank. + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +Not applicable. Left blank. + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +Not applicable. Left blank. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +Not applicable. Left blank. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +Not applicable. Left blank. \ No newline at end of file diff --git a/codeielargecodegenerationmodelsarebetterfewshotinformationextractors/images.zip b/codeielargecodegenerationmodelsarebetterfewshotinformationextractors/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..f01c0796984fafccb36b901c6e25121e4e728c1c --- /dev/null +++ b/codeielargecodegenerationmodelsarebetterfewshotinformationextractors/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fefd148aef6ac1acd7cf2f5e8d4adaaa88bf89f738c08aae29f3c8b98a5b4038 +size 572371 diff --git a/codeielargecodegenerationmodelsarebetterfewshotinformationextractors/layout.json b/codeielargecodegenerationmodelsarebetterfewshotinformationextractors/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..6f6c6f22d3d696d86fd1700ac514718cba92eaa6 --- /dev/null +++ b/codeielargecodegenerationmodelsarebetterfewshotinformationextractors/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0e339137b61c00579501eea3526f24a2d245000c5811e332257cfede6cad175f +size 487964 diff --git a/cognitivereframingofnegativethoughtsthroughhumanlanguagemodelinteraction/271fd863-dea9-428a-b69a-3fa01b3e98e3_content_list.json b/cognitivereframingofnegativethoughtsthroughhumanlanguagemodelinteraction/271fd863-dea9-428a-b69a-3fa01b3e98e3_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..2f151d3a96163baa791bf233dce3fdf2d42573b9 --- /dev/null +++ b/cognitivereframingofnegativethoughtsthroughhumanlanguagemodelinteraction/271fd863-dea9-428a-b69a-3fa01b3e98e3_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:70749a32c1e68117fbda1be7bf382ca526139455710d9be132955f5725042ad1 +size 135150 diff --git a/cognitivereframingofnegativethoughtsthroughhumanlanguagemodelinteraction/271fd863-dea9-428a-b69a-3fa01b3e98e3_model.json b/cognitivereframingofnegativethoughtsthroughhumanlanguagemodelinteraction/271fd863-dea9-428a-b69a-3fa01b3e98e3_model.json new file mode 100644 index 0000000000000000000000000000000000000000..d8bc1d136f66140ff8d390a48bfd2e6746c884c6 --- /dev/null +++ b/cognitivereframingofnegativethoughtsthroughhumanlanguagemodelinteraction/271fd863-dea9-428a-b69a-3fa01b3e98e3_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b0b40acf9a183699b99c287052f1e8b370be7be05dcf081f89326cc85034ae50 +size 163189 diff --git a/cognitivereframingofnegativethoughtsthroughhumanlanguagemodelinteraction/271fd863-dea9-428a-b69a-3fa01b3e98e3_origin.pdf b/cognitivereframingofnegativethoughtsthroughhumanlanguagemodelinteraction/271fd863-dea9-428a-b69a-3fa01b3e98e3_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..4e79cdd1de2c559ee269e81a75b4c1ac4fcde9ce --- /dev/null +++ b/cognitivereframingofnegativethoughtsthroughhumanlanguagemodelinteraction/271fd863-dea9-428a-b69a-3fa01b3e98e3_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d48202897636e3edf8ea382e126219b913616eac0ec95e047aeaae40103a7b0a +size 3584122 diff --git a/cognitivereframingofnegativethoughtsthroughhumanlanguagemodelinteraction/full.md b/cognitivereframingofnegativethoughtsthroughhumanlanguagemodelinteraction/full.md new file mode 100644 index 0000000000000000000000000000000000000000..5b604c71c270bcb278d16ecda34e42b2afe9266f --- /dev/null +++ b/cognitivereframingofnegativethoughtsthroughhumanlanguagemodelinteraction/full.md @@ -0,0 +1,608 @@ +# Cognitive Reframing of Negative Thoughts through Human-Language Model Interaction + +Ashish Sharma\* Kevin Rushton Inna Wanyin Lin David Wadden Khendra G. Lucas Adam S. Miner Theresa Nguyen Tim Althoff + +$^{\dagger}$ Paul G. Allen School of Computer Science & Engineering, University of Washington $^{\diamond}$ Mental Health America $^{\ddagger}$ Allen Institute for Artificial Intelligence + +$\checkmark$ Department of Psychiatry and Behavioral Sciences, Stanford University $\checkmark$ Center for Biomedical Informatics Research, Stanford University + +{ashshar, althoff}@cs.washington.edu + +# Abstract + +A proven therapeutic technique to overcome negative thoughts is to replace them with a more hopeful "reframed thought." Although therapy can help people practice and learn this Cognitive Reframing of Negative Thoughts, clinician shortages and mental health stigma commonly limit people's access to therapy. In this paper, we conduct a human-centered study of how language models may assist people in reframing negative thoughts. Based on psychology literature, we define a framework of seven linguistic attributes that can be used to reframe a thought. We develop automated metrics to measure these attributes and validate them with expert judgements from mental health practitioners. We collect a dataset of 600 situations, thoughts and reframes from practitioners and use it to train a retrieval-enhanced in-context learning model that effectively generates reframed thoughts and controls their linguistic attributes. To investigate what constitutes a "high-quality" reframe, we conduct an IRB-approved randomized field study on a large mental health website with over 2,000 participants. Amongst other findings, we show that people prefer highly empathic or specific reframes, as opposed to reframes that are overly positive. Our findings provide key implications for the use of LMs to assist people in overcoming negative thoughts. + +# 1 Introduction + +Negative thoughts are a natural part of human cognition. However, for people experiencing mental health challenges, such thoughts are often entrenched, automatic and emotionally triggering, making it difficult to overcome them in-the-moment (Beck, 1976). An evidence-based, well-established therapeutic intervention to overcome negative thoughts is Cognitive Reframing, in which a negative thought is replaced with a more hopeful "reframed thought," which offers an alternative + +perspective on one's situation (Beck, 1976). For example, imagine a person with a situation "I'm submitting a research paper to ACL 2023" has a thought "This paper is going to get rejected." A possible way to reframe this thought is to say "This paper has some chance of getting accepted due to its novel methodology and potential impact." + +Psychotherapy research suggests that for a reframed thought to be effective, it must be (a) relatable to the individual, (b) helpful in overcoming the negative thought and (c) memorable to be accessible the next time a similar thought arises (Beck, 1976; Burns, 1980). However, understanding what characterizes a relatable, helpful and memorable reframe is challenging and unknown. Professional therapists can support people in coming up with such highly effective reframed thoughts. However, barriers like clinician shortages, lack of insurance coverage and stigma commonly limit access to therapists (Olfson, 2016; Sickel et al., 2014). NLP-based methods that assist individuals in reframing negative thoughts, in-the-moment, may provide scaffolding that is easier to engage with and that could be made widely accessible. + +Prior NLP research has developed methods for a range of text reframing tasks like sentiment and empathy rewriting (Reif et al., 2022; Sharma et al., 2021) and more recently, positive reframing (Ziems et al., 2022). However, little is known about how to develop cognitive reframing methods that automatically generate relatable, helpful and memorable reframed thoughts. + +In this paper, we conduct a study of how language models can be used to reframe negative thoughts (Figure 1). We study ways in which a negative thought can be reframed, how LMs can be utilized to perform this reframing and what types of reframes are preferred by people who experience negative thoughts. + +First, in collaboration with clinical psycholo + +![](images/c2662958b8f9c4d36efb1002b76cccd88c01cd87136dfedcf171b1c0115c71ba.jpg) +Figure 1: (a) We consider the task of reframing negative thoughts with different, more hopeful thoughts using LMs; (b) Different perspectives on a situation may result in different reframes. Here, we propose a framework of seven reframing attributes (see gray box). Given a reframed thought, we control each attribute (e.g., actionability) to generate reframes that score higher or lower on that attribute (e.g., more or less actionable); (c) We deploy this model on Mental Health America, a large U.S. national mental health website (bit.ly/changing-thoughts) and conduct a randomized field study with 2,067 participants. We suggest LM-generated reframes to MHA visitors and assess which reframing attributes are desirable and what constitutes a relatable, helpful and memorable reframe. + +gists and mental health professionals, we develop a new conceptual framework for characterizing the ways in which a thought might be reframed. We synthesize the most prominent cognitive reframing processes used in therapy and define seven linguistic attributes of reframed thoughts: whether the reframe addresses "thinking traps" (faulty or distorted patterns of thinking), whether it is rational, positive, empathic, actionable, specific and readable. Building on prior research, we develop automated metrics to measure these attributes and establish construct validity by correlating them with judgements from mental health practitioners. + +Next, to develop models for the cognitive reframing task, we collect and share1 a dataset from mental health practitioners and clinical psychology graduate students. The dataset includes 600 situations and thoughts with expert-suggested reframes as well as annotations of the proposed reframing attributes. Using this dataset, we develop a retrieval-enhanced in-context learning method (Brown et al., 2020) to generate reframed thoughts and to control their linguistic attributes. We show that this method achieves the highest overlap with expert-suggested reframes and the highest relatability and helpfulness ratings based on evaluation from mental health + +experts, when compared to popular NLP baselines. + +We investigate which reframing attributes are desirable and what constitutes a relatable, helpful and memorable reframe. In collaboration (and coauthorship) with mental health experts, and after appropriate ethical review, we deploy a month-long randomized field study on Mental Health America (MHA; a popular website that shares mental health resources and tools online), with 2,067 participants with informed consent. We ask MHA visitors to describe situations and negative thoughts they are experiencing and then suggest LM-generated reframed thoughts with varying linguistic attributes. We find that highly specific and highly empathic reframing is the most preferred and highly specific and actionable reframing is considered the most helpful and memorable. However, we find that reframes that are highly positive are less preferred. These findings provide key implications for cognitive reframing of negative thoughts and for the use of Human-LM interaction in this process. + +# 2 Problem Definition and Goals + +We work on the task of Cognitive Reframing. Given a situation $\mathbf{S_i}$ and a negative thought $\mathbf{T_i}$ , the task is to generate a reframed thought $\mathbf{R_i}$ . + +Psychotherapy literature (Beck, 1976) highlights three desirable outcomes for a successful reframe: + +(a) the reframed thought must be relatable to the individual, (b) it must help them overcome the negative thought and (c) it must be memorable the next time a similar negative thinking pattern emerges. + +Here, we aim to understand what constitutes successful reframing and how language models can assist people in this process. Towards this goal, we characterize the linguistic attributes of reframed thoughts (§3), collect a dataset of situations, thoughts and reframes (§4), develop methods to generate reframes and to measure and control their attributes (§5; §6) and investigate which linguistic attributes are related to the reframing outcomes of relatability, helpfulness and memorability (§7). + +# 3 Framework of Linguistic Attributes of Reframed Thoughts + +We draw from clinical therapy practices and collaborate with mental health experts (some of whom are co-authors) to develop a framework of linguistic attributes of reframed thoughts. We illustrate these attributes with the following example for all reframes below - Situation: "I submitted a research paper and it got rejected;" Thought: "I'll never succeed as a researcher." + +Addressing Thinking Traps. Negative thinking often falls into common patterns, called "thinking traps." Also called cognitive distortions, these include exaggerated and biased patterns of thinking which cause individuals to perceive reality inaccurately (Beck, 1976; Ding et al., 2022). Common thinking traps include: assuming what others think ("Mind reading"), thinking in extremes ("All-or-nothing thinking"), focusing on the worst-case scenario ("Catastrophizing"), trying to predict the future ("Fortune telling"), etc. See Appendix D for the full list. + +A reframe may or may not directly address one or more of the thought's thinking traps. A reframe like "I don't know what the future will bring" directly addresses the thinking trap "Fortune telling," whereas a reframe like "I will surely become a successful researcher" does not address this thinking trap but rather continues to express it. + +Rationality. Another strategy to reframe a thought is to reflect on evidence for and against it and reason about what these evidence imply (Beck, 1976). For example, the rejection of the paper is evidence of having the thought "I'll never succeed as a researcher." However, the evidence against this thought could be that acceptance or rejection of one + +paper does not make someone a failure, which may lead to a reframe "Just getting one paper rejected doesn't define my failure." A rational reframe is guided by such strong evidence whereas an irrational reframe is based on unrealistic assumptions. + +Positivity. A reframe of a negative thought tries to emphasize the positive perspectives of the situation but different reframes may have different levels of positivity. An overly positive reframe like "I'm going to win best paper awards for every paper from now on" exaggerates the positive perspectives, which is likely to set the person up for disappointment rather than success (Dember and Penwell, 1980). On the other hand, a balanced response like "I may or may not succeed, but I'll keep trying" considers both positive and negative perspectives of the situation. + +Empathy. It can be helpful to acknowledge the feelings caused by negative thoughts (Allen and Leary, 2010; Elliott et al., 2011). A reframe may express empathy or self-compassion by validating how one is feeling. E.g., "It is okay to feel disappointed when a paper gets rejected." + +Actionability. To encourage pleasant emotions, one commonly used therapeutic approach is Behavioral Activation (Dimidjian et al., 2011; Burkhardt et al., 2021). This involves engaging in behaviors or actions that may help in overcoming negative thoughts. A reframe may suggest specific actions (e.g., "I can take the feedback I received and use it to improve my paper"), may not suggest specific actions but be actionable (e.g., "I can use this experience to learn and grow") or may not be actionable at all (e.g., "I may or may not become a successful researcher"). + +Specificity. A reframe may specifically address the situation and the thought (e.g., "One paper rejection doesn't define my failure as a researcher") or may be generic enough to be applicable to a wide range of negative situations and thoughts (e.g., "I'm going to succeed"). While a specific reframe may be more helpful in-the-moment, a generic reframe could be effective for recurring thoughts, which are frequently a result of the "core" beliefs that a person holds (Beck, 2005; David et al., 2009). + +Readability. The linguistic reasoning capabilities of individuals may be different (e.g., across age groups or education levels) (Kaplan et al., 1995). Accordingly, a reframe may either be simple or complex to read (e.g., "I'll do well in the future" vs. + +"I'm resolute in my ambition to succeed"). + +# 4 Data Collection + +To facilitate computational methods for cognitive reframing, we collect a dataset of reframed thoughts, annotated with their linguistic attributes. + +# 4.1 Curated Situations & Negative Thoughts + +We start by curating data sources for situations and negative thoughts. + +Thought Records Dataset (Burger et al., 2021). This dataset contains hypothetical and real-world situations, thoughts and emotional processes reported by crowdworkers on Amazon Mechanical Turk. We manually curate 180 pairs of diverse situations with negative thoughts from this dataset. + +Mental Health America (MHA). Situations and thoughts from crowdworkers may not reflect the broad range of mental health challenges that people face in real-life. To incorporate more real-world situations and thoughts, we ran a survey on the MHA website (screening.mhanational.org). MHA visitors (who typically use the website for screening of mental illnesses) were asked to describe any negative thoughts and the associated situations they were struggling with. We manually curate 120 pairs of self-reported situations and thoughts to ensure broad coverage of relevant topics based on high diversity and manual filtering. + +# 4.2 Annotation Task and Procedure + +Reframing negative thoughts is a cognitively difficult process that requires practice and training, making crowdwork data collection approaches challenging. To ensure high-quality reframes and annotations, we recruit 15 current mental health practitioners and clinical psychology graduate students with significant practical experience in cognitive reframing. For each (situation, thought) pair in our data source ( $\S 4.1$ ), we ask them to (1) write two different reframed thoughts, (2) annotate the thinking traps addressed by each reframed thought and (3) compare the two reframes and choose the one that is more rational, more positive, more actionable, more empathic, more specific and more readable. In total, we collect 600 reframed thoughts with annotations on their linguistic attributes. We share this dataset + +publicly at github.com/behavioral-data/CognitiveReframing. + +# 4.3 Ethics and Safety + +Our data collection and randomized field study (§7) were designed and conducted after review of potential benefits and risks to participants in consultation and collaboration with mental health experts. Both studies were approved by the University of Washington's Institutional Review Board and informed participants about study purpose, risks and data collection. All participants were 18 or older, provided informed consent and were given access to a crisis hotline. We do not assess any clinical outcomes. See §10 for an extended discussion of ethical and safety considerations. + +# 5 Method + +We design automated metrics for measuring linguistic attributes (§5.1), develop methods to generate reframed thoughts (§5.2) and to control their attributes (§5.3). + +# 5.1 Measuring Reframing Attributes + +Addressing Thinking Traps. Given a situation $\mathbf{S}_{\mathrm{i}}$ a negative thought $\mathbf{T_{i}}$ and a reframed thought $\mathbf{R_{i}}$ our goal is to identify the set of thinking traps addressed by the reframed thought. We approach this as a multi-label classification task, and fine-tune a GPT-3 model on the expert-annotated thinking trap labels collected in $\S 4.2$ + +Rationality. Rationality is the quality of being guided by reasons (Damielson et al., 2004). Here, we operationalize rationality of a reframed thought $\mathbf{R}_{\mathrm{i}}$ as its reasoning strength and ask the following two questions: (1) What might be the reasoning behind $\mathbf{R}_{\mathrm{i}}$ ?; (2) Are the reasons sound? To understand the reasoning behind $\mathbf{R}_{\mathrm{i}}$ , we develop an abductive explanation based method (Peirce, 1974; Bhagavatula et al., 2020; Jung et al., 2022). For a given $(\mathbf{S}_{\mathrm{i}}, \mathbf{T}_{\mathrm{i}})$ , we use a language model to generate (a) the most plausible explanations that support $\mathbf{R}_{\mathrm{i}}$ and (b) the most plausible explanations that refute it. Moreover, to check if the explanations are sound, we recursively generate explanations behind the explanations to test their reasoning strength (Appendix E). Let $sup(\cdot)$ be a generator function that generates explanation supporting a reframe and let + +$ref(\cdot)$ be a generator function that generates explanation refuting a reframe. Then, we recursively define reasoning strength $RS(\mathbf{S_i},\mathbf{T_i},\mathbf{R_i})$ as + +$$ +\begin{array}{l} \left(\mathrm {P} \left(\mathbf {R} _ {\mathbf {i}} = \text {s o u n d} \mid \mathbf {S} _ {\mathbf {i}}, \mathbf {T} _ {\mathbf {i}}\right) \times \mathbb {E} _ {r \sim s u p (\cdot)} [ R S \left(\mathbf {S} _ {\mathbf {i}}, \mathbf {T} _ {\mathbf {i}}, r\right) ]\right) \\ - \left(\mathrm {P} (\mathbf {R} _ {\mathbf {i}} = f l a w e d | \mathbf {S} _ {\mathbf {i}}, \mathbf {T} _ {\mathbf {i}}) \times \mathbb {E} _ {r \sim r e f (\cdot)} [ R S (\mathbf {S} _ {\mathbf {i}}, \mathbf {T} _ {\mathbf {i}}, r) ]\right) \\ \end{array} +$$ + +To design the explanation generator functions, $sup(\cdot)$ and $ref(\cdot)$ , we leverage in-context learning (Brown et al., 2020). In collaboration with mental health experts, we design 10 demonstration examples of situations, thoughts and reframed thoughts with explanations that support ("This reframed thought is sound because...") and refute ("This reframed thought is flawed because...") a particular reframe. We use these examples to prompt GPT-3. Moreover, to estimate the probabilities $\mathrm{P}(\mathbf{R_i} = \mathrm{sound})$ and $\mathrm{P}(\mathbf{R_i} = \mathrm{flawed})$ , we use the token probability of generating "sound" and "flawed" respectively, given $\mathbf{S_i}$ , $\mathbf{T_i}$ , $\mathbf{R_i}$ and the text "This reframed thought is" as input to GPT-3. + +Positivity. To measure the positivity of the generated reframed thought, we use a RoBERTa-based sentiment classifier fine-tuned on the TweetEval benchmark (Barbieri et al., 2020). + +Empathy. To measure empathy, we build upon the empathy classification model presented in Sharma et al. (2020b). This RoBERTa-based model leverages a theoretically-grounded framework of empathy consisting of three empathy communication mechanisms (emotional reactions, interpretations and explorations) and predicts empathy levels in mental health conversations on a scale from 0 to 6. Here, we further fine-tune this model on the domain of reframed thoughts through a manually labeled dataset of 300 reframed thoughts with empathy labels (labeled by one author with expertise in empathy in mental health context). + +Actionability. To measure actionability, we hypothesize that an actionable reframe is one that either (1) suggests a concrete action or (2) does not suggest a concrete action but is easy to act upon. + +We cast action concreteness as a binary classification task: given reframe $\mathbf{R_i}$ , predict contains_action $(\mathbf{R_i}) \in \{0,1\}$ . We make few-shot predictions by prompting GPT-3 with 10 examples of reframed thoughts paired with actionability ratings from §4.2 (details in Appendix A.1). + +To determine the ease with which $\mathbf{R_i}$ can be acted upon, we examine the next set of actions + +entailed by $\mathbf{R}_{\mathrm{i}}$ . Our hypothesis is that a diverse next action set may indicate ambiguity which might be less actionable, whereas a coherent next action set may indicate clarity which might be more actionable. Here, we instruct GPT-3 to generate $k = 5$ next action candidates given a reframed thought (instruction prompting; zero-shot). We compute the next action coherence — denoted next_action_coherence $(\mathbf{R}_{\mathrm{i}})$ — by embedding each of the $k$ action candidates using RoBERTa (Liu et al., 2019) and computing the average pairwise cosine similarity. Higher similarity indicates greater coherence among the possible next actions. Our overall actionability measurement is defined as contains_action $(\mathbf{R}_{\mathrm{i}}) +$ next_action_coherence $(\mathbf{R}_{\mathrm{i}})$ . + +Specificity. Following prior work (Xu et al., 2018; Sharma et al., 2021), we measure specificity using sentence embedding similarity between the reframed thought $\mathbf{R}_{\mathrm{i}}$ and the concatenation of the situation $\mathbf{S}_{\mathrm{i}}$ and the thought $\mathbf{T}_{\mathrm{i}}$ (using RoBERTa embeddings (Liu et al., 2019)). + +Readability. We employ the commonly used Coleman-Liau Index (CLI) metric (Coleman and Liau, 1975) which assesses readability based on the character and word structure within a sentence. The Coleman-Liau Index is calculated as $0.0588L - 0.296S - 15.8$ , where $L$ : average number of letters per 100 words; $S$ is the average number of sentences per 100 words. + +# 5.2 Reframe Generation + +In-context learning methods can learn to generalize NLP tasks from a handful of examples (few-shot learning) or from hand-written instructions alone (instruction prompting) (Brown et al., 2020). However, through a qualitative analysis of 100 manually written situations and thoughts, we found that a simple in-context learning method with a fixed set of examples often failed to appropriately reframe situations and thoughts for which no relevant in-context examples were provided (e.g., someone with anxiety having "racing thoughts"). + +To appropriately reframe thoughts related to a range of situations and thoughts, we develop a retrieval-based in-context learning method (Liu et al., 2022b). For each situation $\mathbf{S_i}$ and negative thought $\mathbf{T_i}$ , we retrieve $k$ -similar examples from our dataset ( $\S 4$ ). We first encode situations and thoughts using RoBERTa embeddings. Then, we retrieve $k$ examples, $\{(s_1, t_1), \dots, (s_k, t_k)\}$ , + +
AttributePearson Correlation
Addressing Thinking Traps0.680***
Rationality0.448**
Positivity0.550***
Empathy0.575***
Actionability0.647***
Specificity0.427**
Readability0.331*
+ +from our dataset based on the top- $k$ values of cosine_sim(concat(s,t),concat( $\mathbf{S_i}$ , $\mathbf{T_i}$ )). We choose $k = 5$ (Appendix A.3). + +# 5.3 Controlling Linguistic Attributes of Generated Reframes + +While our proposed method allows us to generate a single reframe, it does not directly give us control over its linguistic attributes beyond mimicking the retrieved examples (§3). Here, we intend to vary the linguistic attributes of the reframes. + +A reframed thought may or may not address a thinking trap in the original thought $\mathbf{T_i}$ . Here, we generate two reframes $\mathbf{R_i}^{(tt,Y)}$ and $\mathbf{R_i}^{(tt,N)}$ , one that addresses the thinking traps in $\mathbf{T_i}$ and another that does not address it. We extract two separate sets of in-context examples from our dataset - those that address at least one thinking trap and those that do not (as collected in §4). We use those examples to prompt GPT-3 to generate $\mathbf{R_i}^{(tt,Y)}$ and $\mathbf{R_i}^{(tt,N)}$ . + +Moreover, a reframed thought may have high or low rationality, positivity, empathy, actionability, specificity and readability values. For these six attributes, given a reframe $\mathbf{R}_{\mathbf{i}}$ and a linguistic attribute $a$ , we generate two additional reframes $\mathbf{R}_{\mathbf{i}}^{(a,\mathrm{H})}$ and $\mathbf{R}_{\mathbf{i}}^{(a,\mathrm{L})}$ , one that scores higher on attribute $a$ and another that scores lower on it (e.g., higher or lower actionability). To accomplish this, recall that each (situation, thought) pair from §4.2 is annotated with two reframes and that the reframes are compared along each linguistic attribute. For a human-annotated instance $j$ , let $\mathbf{R}_{\mathbf{j}}^{*(a,\mathrm{H})}$ and $\mathbf{R}_{\mathbf{j}}^{*(a,\mathrm{L})}$ be the reframes judged to be high and low on attribute $a$ , respectively. To generate $\mathbf{R}_{\mathbf{i}}^{(a,\mathrm{H})}$ from $\mathbf{R}_{\mathbf{i}}$ , we prompt GPT-3 with in-context examples $\{\mathbf{R}_{\mathbf{j}}^{*(a,\mathrm{L})} \to \mathbf{R}_{\mathbf{j}}^{*(a,\mathrm{H})}\}_{j=1}^{k}$ , using $k = 5$ . + +Table 1: Correlation of our proposed attribute measures by with human judgments from mental health experts. $^{*}p < 0.05$ . $^{**}:p < 0.001$ . $^{**}:p < 10^{-5}$ + +
ModelAutomaticHuman
BLEUR-1R-LBScoreRel.Help.
Retrieval Only21.618.814.286.72.583.14
Pos. Reframing24.423.617.687.62.672.40
DialoGPT22.517.413.586.32.493.21
T524.923.417.887.22.513.30
GPT-3 Only25.023.918.088.32.973.98
Our Model27.826.019.988.63.104.11
+ +Table 2: Automatic and Human Evaluation Results. R-1: ROUGE-1; R-L: ROUGE-L; BScore: BertScore; Rel.: Relatability; Help.: Helpfulness. + +Similarly, to generate $\mathbf{R_i}^{(a,L)}$ from $\mathbf{R_i}$ , we prompt GPT-3 with examples $\{\mathbf{R_j}^{*(a,H)}\to \mathbf{R_j}^{*(a,L)}\}_{j = 1}^k$ . + +# 6 Experiments and Results + +We assess the construct validity of proposed linguistic attributes (§6.1) and evaluate the performance of the reframe generation model (§6.2). + +# 6.1 Construct Validity of Linguistic Attributes + +We validate our proposed linguistic attribute measures by correlating them with the human judgments of mental health experts, as obtained in §4.2. We find a strong Pearson correlation for addressing thinking traps (0.680***) and actionability (0.647***), a moderate correlation for rationality (0.448**), positivity (0.550***), empathy (0.575***), and specificity (0.427**), and a weak correlation for readability (0.331*) (Table 1). + +# 6.2 Reframe Generation Performance + +We use both automatic and human evaluation to assess the performance of our proposed reframe generation model as developed in §5.2. + +Experimental Setup. We use top- $p$ sampling with $p = 0.6$ for text generation (Holtzman et al., 2020). We split the 600 expert-annotated examples ( $\S 4$ ) into train and test using a 70:30 split. + +Baselines. (1) Retrieval Only - For a test input, we retrieve the training set example with the highest cosine similarity based on RoBERTa embeddings; (2) Positive Reframing - We reuse the BART-based positive reframing model from Ziems et al. (2022); (3) DialogGPT - GPT-2 adapted to dialogue (Zhang et al., 2020); (4) T5 - Text-to-text transfer LM (Raffel et al., 2020); (5) GPT-3 Only - We randomly + +![](images/216208b8579947053a811f3428472a2639a2a215f3aca82ca03c90ded0b9d899.jpg) +Figure 2: Which linguistic attributes of reframed thoughts do people prefer? For a given situation and thought from MHA visitors, we show them multiple LM-generated reframes with variance across a randomly selected attribute (e.g., low, medium and high actionability). We find that highly empathic and highly specific reframings are more preferred. On the other hand, reframes with high positivity are less preferred. N: No; Y: Yes; L: Low; M: Medium; H: High. Error bars in any figure represent $95\%$ bootstrapped confidence intervals. + +![](images/01128710758ab37883811284a9bef50ca0282efa5f56ecb5c88a92b724853501.jpg) + +![](images/f29c0550e4536f099be8c2b42d7fce8c6992b60721e7dfa9a81e550b23d5bfd9.jpg) + +![](images/0b4d3ffedf6a692dc2b673d8ee42c92d97dc2d917d820f684c43d9717fbe7983.jpg) + +![](images/6fdaa558e9541c250fd830183edcf90d567536f49adb5e27d0d2c621810e52d8.jpg) + +![](images/35cbe7c4d68ac38dfc66bf27b4dd46556570fffcfd56b9eb9b13fe0e2cc4809f.jpg) + +![](images/e12ece27f8a446d4470e0941627f52d81b577da745e4e8ae302f7592637fe430.jpg) + +retrieve 5 examples from our training set and use them to prompt GPT-3. + +Automatic Evaluation. We examine the semantic similarity between the model outputs and the ground truth refinings in the above-created test split. We use BLEU (Papineni et al., 2002), ROUGE-1, ROUGE-L (Lin, 2004) and the BERTScore (Zhang et al., 2019b) metrics. We find that our proposed model has an $11.2\%$ higher BLEU score and $9.7\%$ higher ROUGE scores than the next best-performing baselines - GPT-3 Only and Positive Reframing (Table 2). + +Human Evaluation. We assess the two key reframing outcome metrics of relatability (how relatable would a reframed thought be) and helpfulness (how helpful would a reframed thought be in overcoming negative thoughts). We recruit three mental health practitioners. We ask them to rate the models' outputs on test set examples based on their reliability and helpfulness on a 1 to 5 scale. We find that our proposed model achieves the highest relatability and helpfulness ratings (Table 2). Surprisingly, the Positive Reframing method showed the least helpfulness and low relatability, indicating that just reframing negative thoughts based on positivity may not be highly relatable and helpful. + +# 7 Randomized Field Study on a Large Mental Health Platform + +Next, we deploy our model on a large mental health platform (§7.1) and study what types of reframes do people prefer (§7.2) and what characterizes relatable, helpful and memorable reframes (§7.3). + +# 7.1 Model Deployment + +We try to understand how our proposed cognitive reframing model may assist people who experience negative thoughts. After careful assessment of ethical and safety considerations, active collaboration with mental health experts and clinical psychologists (some of whom are co-authors) and IRB approval, we deploy our model on Mental Health America (MHA), a large mental health website that provides mental health resources and tools to millions of users (bit.ly/changing-thoughts). We conduct a month-long randomized field study with 2,067 MHA visitors as participants. After choosing to use our model and after consenting to participate, MHA visitors described their situation and the thoughts they were struggling with. Next, they were shown multiple model-generated reframed thoughts in random order, asked to select the reframed thought they find most relatable, helpful and memorable and finally evaluate the selected reframed thought based on relatability, helpfulness and memorability (See Appendix F). + +# 7.2 What types of reframed thoughts do people prefer? + +To understand which reframing attributes people prefer, we suggest multiple LM-generated reframes which vary across our attribute values. Given a situation and thought, we start by generating one reframed thought using our model. Next, we randomly select an attribute (e.g., actionability) and vary the first reframe based on it (e.g., to generate two additional reframes with higher or lower actionability) using our proposed controllable text generation method (§5.3). Figure 2 reveals key differences between the linguistic attributes of reframes that people select and prefer: + +![](images/30035b23809cecc4b284c3d5b09d20f8db69d5ed9ddeb35969c55a06c1e2852b.jpg) + +![](images/971ef86bafa070cb0bb166e94276ab3b01bcc33bef5a3abfb41add367e24bfc8.jpg) + +![](images/039433bc33a99d51af5aea84e8e50e165c447a56b5364bc8fc7f25a6ba4b6dfd.jpg) + +![](images/e68a92bab0dade5164fc5bf4af77194722bd1f7632b3765ed05756120ba54f22.jpg) + +![](images/ac2afc209c4f68baa4fbacdf244e96314c7a90f5d2bb98bf12ba208ee8d47642.jpg) + +![](images/cefae2d2fd1699b49d158af57e41de297d8e34199538e12daf7200b344b73233.jpg) + +![](images/73eba1d9d07714d273515592d86486f6015ad7a8a7999370029378532a29b48a.jpg) + +![](images/70cdbddc5e39eed0733a1eeebda53d03b3d3b6d78be15b0d74064ff61345c76d.jpg) + +![](images/270c923137a02d1839df7462ea7156d035c2200e214c37e26c992d5635924b4c.jpg) + +![](images/55bfce988871f03492f4ca94fde696eb8db40395943667063cc01a6a7b1d812e.jpg) + +![](images/75d989d968ef7778402cce5942a5b0c99104d7b8650cc7f073f1913aa8b3f3f0.jpg) + +![](images/e7ae54a60cb60d45769b41d5bea92f01bfac3a3e82b1459fada90aef2185699e.jpg) + +![](images/15e4c4f768e89ec892bad2d906ebad5c795c9a84a9b57b7401ea5d35b16f997d.jpg) + +![](images/a15bbedf303efcef71762e4fdf9c6093d1c06580791ca6a1ca567d6c2f6917d8.jpg) + +![](images/0a75342d13c3c02177665ed185da5cbc0cca6eed2c501031ac97b1e4e9918d5d.jpg) +Figure 3: Which linguistic attributes are associated with desired cognitive reframing outcomes? For a given situation and thought, we show one LM-generated reframe to MHA participants and ask them to rate it on relatability, helpfulness and memorability on a 1 to 5 scale. For each linguistic attribute, we compare the first (Q1) and the fourth quartile (Q4). We find that (a) reframes that have higher rationality are more relatable; (b) reframes that address thinking traps, have higher actionability or higher specificity are more helpful; (c) reframes that have higher actionability or higher specificity are more memorable. $* : p < 0.05$ ; $** : p < 0.01$ . + +![](images/e51e2df934233b41b127e661ba19f66b9f26128008dc78f05cc663d5f38edee9.jpg) + +![](images/9328678753984767ca2060fd5853d4aa16aaf100da5d945e98aad5221af7ab32.jpg) + +![](images/d71c88103910909b75d2154dd938a547944ac094903caef808d338e5584b11b5.jpg) + +![](images/9e9cdc0ae41ff8403f91245d0057bf6d6b5b94a21afbe1460f598395ace28499.jpg) + +![](images/9017806c50016888f3302b50148224c1c8915fc735147c7f68969663eb5dd8ab.jpg) + +![](images/5a78c7fd989624bb83fd9df2aaefb5ae2fcdcef56fc5ff1f5e003fd546972dce.jpg) + +(1) Highly empathic and specific reframings are preferred more. We find that highly empathic reframes are preferred $55.7\%$ more frequently than reframes with lower empathy (39.7% vs. $25.5\%$ ; $p < 10^{-5}$ ); highly specific reframes are preferred $43.1\%$ more frequently than reframes with lower specificity (39.2% vs. $27.4\%$ ; $p < 10^{-5}$ ). Prior work has shown the importance of empathy and less "templated" responses in mental health support conversations (Sharma et al., 2020b; Althoff et al., 2016). Here, we show that empathy and specificity of LM-generated reframes may support people in reframing negative thoughts. + +(2) Overly positive reframes are preferred less. On the other hand, reframes with high positivity are preferred $22.7\%$ less frequently than reframes with lower positivity (29.6% vs. $38.3\%$ ; $p < 10^{-5}$ ). This may be because adopting an overly positive reframed thought may be challenging for individuals who are already experiencing emotionally triggering negative thoughts (Dember and Penwell, 1980). + +Participants also prefer medium-readability reframes over very simple or very complex reframes, perhaps because their language is balanced for a wider audience. + +# 7.3 How do the linguistic attributes of reframed thoughts relate to the desired outcomes of cognitive reframing? + +We assess what characterizes a reframe that is relatable, helpful and memorable. We show a single model-generated reframe to the participants and ask them to rate it on a 5-point Likert scale (Likert, 1932) with regards to the three outcome measures (1: Strongly Disagree; 5: Strongly Agree). We do not provide participants in this experiment with a choice of multiple reframes to avoid any selection effects (§7.2). Figure 3 offers key insights on which attributes of reframed thoughts are related to different desired outcomes: + +(1) Reframes that are more rational are more relatable. We find that reframes that have higher + +rationality are $10.8\%$ more relatable than lower rationality reframes (3.91 vs. 3.53; $p < 0.05$ ). This may be because higher rationality reframes, by definition, are more likely to be based on reasons and are less likely to make unrealistic assumptions, making them easier to relate to. + +(2) Reframes that address thinking traps and are more actionable and specific are more helpful. Reframes that address thinking traps are $6.3\%$ more helpful than reframes that do not address them (3.39 vs. 3.19; $p < 0.01$ ). Such reframes specifically challenge the cognitive biases in thinking patterns (e.g., "Fortune Telling"; Appendix D), which has shown to be more effective in dealing with negative thoughts in psychotherapy research (Beck, 1976; Burns, 1980). Moreover, we find that reframes with higher actionability are $6.6\%$ more helpful than lower actionability reframes (3.41 vs. 3.20; $p < 0.05$ ) and reframes with higher specificity are $9.6\%$ more helpful than lower specificity reframes (3.42 vs. 3.12; $p < 0.01$ ). + +(3) Reframes that are more actionable and more specific are more memorable. We find that reframes with higher actionability are $7.9\%$ more memorable than lower actionability reframes (3.67 vs. 3.40; $p < 0.01$ ) and reframes with higher specificity are $6.3\%$ more memorable than lower specificity reframes (3.70 vs. 3.48; $p < 0.05$ ). + +# 8 Related Work + +Several Human-LM interaction tools for mental health assist support providers, e.g., clinicians (Tanana et al., 2019; Shen et al., 2020) or peers (Sharma et al., 2023). Our work provides insights on how Human-LM interaction may directly support people struggling with mental health challenges through cognitive reframing. Computational work on cognitive reframing has relied on small-scale crowdsourcing studies (Smith et al., 2021; Morris et al., 2015). Our work develops scalable methods for cognitive reframing and conducts a randomized field study on a large mental health platform. Prior text reframing research has developed methods for related tasks including style, sentiment, politeness and empathy transfer (Reif et al., 2022; Madaan et al., 2020; Sharma et al., 2021) as well as positive reframing (Ziems et al., 2022). Our work develops text-reframing methods for cognitive reframing and demonstrates that linguistic attributes of addressing thinking traps, rationality, actionability, specificity and readability + +are critical to high-quality reframes. More broadly, our work relates to the growing body of research in NLP for mental health and psychological wellbeing (Althoff et al., 2016; Sharma and De Choudhury, 2018; Gaur et al., 2019; Lee et al., 2019; Miner et al., 2019; Pendse et al., 2019; Pérez-Rosas et al., 2019; Pruksachatkun et al., 2019; Yang et al., 2019; Zhang et al., 2019a; Jaidka et al., 2020; Saha and Sharma, 2020; Sharma et al., 2020a,b; Wadden et al., 2021; Welch et al., 2020; Zhang and Danescu-Niculescu-Mizil, 2020; Lahnala et al., 2021; Lin et al., 2022; Naseem et al., 2022; Pérez-Rosas et al., 2022; Shah et al., 2022; Shen et al., 2022; Stewart et al., 2023). + +# 9 Conclusion + +In this paper, we conducted a study of how Human-Language Model Interaction may support humans in the cognitive reframing of negative thoughts. We define a framework of seven linguistic attributes of cognitive reframing, develop automatic metrics to measure these attributes and validate their measurements with mental health experts. We collect and share a dataset of 600 situations, thoughts and reframes from mental health experts and use it to train a retrieval-enhanced in-context learning model based on GPT-3. We deploy this model on the Mental Health America website and conduct a randomized field study with 2,067 participants. We find that people struggling with negative thoughts prefer reframes that are highly empathic or specific, but do not prefer reframes that are highly positive. + +# 10 Ethics Statement + +Intervention in high-risk settings such as mental health necessitates ethical considerations related to safety, privacy and bias. There is a possibility that, in attempting to assist, AI may have the opposite effect on people struggling with mental health challenges. Here, in active collaboration and consultation with mental health professionals and clinical psychologists, we took several measures to minimize these risks. + +IRB Approval. We obtained approval from the University of Washington's Institutional Review Board for both our data collection (IRB ID STUDY00015882) as well as the randomized field study (IRB ID STUDY00016783). Our organization requires all research personnel who conduct human subjects research to complete human subjects protection training using the online CITI + +course. The graduate students conducting these studies were certified by our IRB. + +Informed Consent from Participants. We obtained informed consent from all participants in our randomized field study (Appendix H). All participants were 18 years of age and older. Participants were informed that they will be interacting with an AI-based model that automatically generates reframed thoughts and is not monitored by a human. Also, they were informed about the possibility that some of the generated content may be upsetting or disturbing. + +Crisis Resources. We made it very explicit that the model should not be used as a "cry for help" outlet and should not be used in cases of suicidal ideation and self-harm. Also, we provided two crisis resources - Crisis Text Line (crisistextline.org) and 988 Suicide and Crisis Lifeline (988lifeline.org) - to our participants at the start of the study. + +Safety Measures. To minimize harmful LM-generated reframings, we filtered out any response that contained suicidal ideation or self-harm-related words or phrases. For this, we created a list of 50 regular expressions (e.g., to identify phrases like "feeling suicidal", "wish to die", "harm myself") using suicidal risk assessment lexicons such as Gaur et al. (2019). An LM-generated response that matched any of the regular expressions was filtered out and not shown to the participants. Also, participants were given an option to flag inappropriate reframing suggestions through a "Flag inappropriate" button (Appendix C). + +Privacy. We did not collect any privately identifiable information in our randomized field study and removed any user identifiers before conducting our data analysis. All research data was stored within a separate secure computing environment and only trained research personnel were provided access to data. The situations and thoughts collected in $\S 4.1$ went through an anonymization process, where we manually removed any user identifiers and replaced any specific identifiable information including locations, names, etc. with their more general version, following Matthews et al. (2017). + +# 11 Limitations + +We conducted our randomized field study on a single platform (Mental Health America) and in a single language (English). However, MHA is a particularly popular source for mental health resources + +with over ten million yearly visitors. + +In addition, we note that a range of socio-cultural factors might influence how negative thoughts should be reframed and how LMs assisting this process should be developed. Conducting studies on specific communities, including underrepresented communities and minorities, was beyond the scope of this research. Ensuring equitable access of these tools and adapting them to various socio-cultural contexts requires further investigation. + +Not all cognitive reframing implementations elicit situations, but we believed it was essential for making the reframe personally relatable. In the future, when an individual uses the system for multiple situations and thoughts, it would be interesting to study how their context can be learned more effectively over time. Due to privacy concerns, we presently do not gather information to link multiple sessions. However, with appropriate ethical considerations and user consent, this approach may be beneficial. + +Our focus in this paper was primarily on creating an intervention that is effective in-the-moment. This was motivated by recent clinical psychology research that suggests that such single-session, in-the-moment interventions can lead to significant positive long-term mental health outcomes (Schleider et al., 2022). To integrate a partial longer-term perspective, we assessed the memorability of a reframe, which may be essential for future utility. Nevertheless, evaluating long-term outcomes is critical and forms an important future research direction. Finally, we emphasize that our study does not investigate short-term or long-term clinical outcomes. + +# Acknowledgements + +We are grateful to the mental health practitioners and clinical psychology graduate students for data annotation, as well as the MHA visitors for participating in our field study. We thank the anonymous reviewers and the UW Behavioral Data Science Group members for their suggestions and feedback. We also thank Justin Evans for their assistance in model deployment, Xiang Lorraine Li for their input on data collection and Sebastin Santy for their input on the tool interface. T.A., A.S. and I.W.L. were supported in part by NSF grant IIS-1901386, NSF CAREER IIS-2142794, NSF grant CNS-2025022, NIH grant R01MH125179, Bill & Melinda Gates Foundation (INV-004841), the Of + +fice of Naval Research (#N00014-21-1-2154), a Microsoft AI for Accessibility grant, and a Garvey Institute Innovation grant. + +# References + +Ashley Batts Allen and Mark R Leary. 2010. Self-compassion, stress, and coping. Social and personality psychology compass. +Tim Althoff, Kevin Clark, and Jure Leskovec. 2016. Large-scale analysis of counseling conversations: An application of natural language processing to mental health. Transactions of the Association for Computational Linguistics. +Francesco Barbieri, Jose Camacho-Collados, Luis Espinosa Anke, and Leonardo Neves. 2020. TweetEval: Unified benchmark and comparative evaluation for tweet classification. In EMNLP Findings. +Aaron T Beck. 1976. Cognitive therapy and the emotional disorders. International Universities Press. +Judith S Beck. 2005. Cognitive therapy for challenging problems: What to do when the basics don't work. Guilford Press. +Chandra Bhagavatula, Ronan Le Bras, Chaitanya Malaviya, Keisuke Sakaguchi, Ari Holtzman, Hannah Rashkin, Doug Downey, Wen-tau Yih, and Yejin Choi. 2020. Abductive commonsense reasoning. In ICLR. +Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. 2020. Language models are few-shot learners. NeurIPS. +Franziska Burger, Mark A Neerincx, and Willem-Paul Brinkman. 2021. Natural language processing for cognitive therapy: Extracting schemas from thought records. PloS one. +Hannah A Burkhardt, George S Alexopoulos, Michael D Pullmann, Thomas D Hull, Patricia A Arean, and Trevor Cohen. 2021. Behavioral activation and depression symptomatology: longitudinal assessment of linguistic indicators in text-based therapy sessions. JMIR. +David D Burns. 1980. Feeling good: Thenew mood therapy. New York. +Meri Coleman and Ta Lin Liau. 1975. A computer readability formula designed for machine scoring. Journal of Applied Psychology. +Peter Damielson, Robert Audi, Cristina Bicchieri, et al. 2004. The Oxford handbook of rationality. Oxford University Press, USA. + +Daniel David, Steven Jay Lynn, and Albert Ellis. 2009. Rational and irrational beliefs: Research, theory, and clinical practice. Oxford University Press. +William N Dember and Larry Penwell. 1980. Happiness, depression, and the pollyanna principle. Bulletin of the Psychonomic Society. +Sona Dimidjian, Manuel Barrera Jr, Christopher Martell, Ricardo F Muñoz, and Peter M Lewinsohn. 2011. The origins and current status of behavioral activation treatments for depression. Annual review of clinical psychology. +Xiruo Ding, Kevin Lybarger, Justin Tauscher, and Trevor Cohen. 2022. Improving classification of infrequent cognitive distortions: Domain-specific model vs. data augmentation. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies: Student Research Workshop. +Robert Elliott, Arthur C Bohart, Jeanne C Watson, and Leslie S Greenberg. 2011. Empathy. Psychotherapy. +Manas Gaur, Amanuel Alambo, Joy Prakash Sain, Ugur Kursuncu, Krishnaprasad Thirunarayan, Ramakanth Kavuluru, Amit Sheth, Randy Welton, and Jyotishman Pathak. 2019. Knowledge-aware assessment of severity of suicide risk for early intervention. In WWW. +Ari Holtzman, Jan Buys, Li Du, Maxwell Forbes, and Yejin Choi. 2020. The curious case of neural text degeneration. In ICLR. +Kokil Jaidka, Niyati Chhaya, Saran Mumick, Matthew Killingsworth, Alon Halevy, and Lyle Ungar. 2020. Beyond positive emotion: Deconstructing happy moments based on writing prompts. In ICWSM. +Jaehun Jung, Lianhui Qin, Sean Welleck, Faeze Brahman, Chandra Bhagavatula, Ronan Le Bras, and Yejin Choi. 2022. Maieutic prompting: Logically consistent reasoning with recursive explanations. In EMNLP. +Carole A Kaplan, Anne E Thompson, and Sheila M Searson. 1995. Cognitive behaviour therapy in children and adolescents. Archives of disease in childhood. +Allison Lahnala, Yuntian Zhao, Charles Welch, Jonathan K Kummerfeld, Lawrence C An, Kenneth Resnicow, Rada Mihalcea, and Verónica Pérez-Rosas. 2021. Exploring self-identified counseling expertise in online support forums. In ACL-IJCNLP Findings. +Fei-Tzin Lee, Derrick Hull, Jacob Levine, Bonnie Ray, and Kathleen McKeown. 2019. Identifying therapist conversational actions across diverse psychotherapeutic approaches. In Proceedings of the Sixth Workshop on Computational Linguistics and Clinical Psychology. +Rensis Likert. 1932. A technique for the measurement of attitudes. Archives of psychology. + +Chin-Yew Lin. 2004. Rouge: A package for automatic evaluation of summaries. In Text summarization branches out. +Inna Lin, Lucille Njoo, Anjalie Field, Ashish Sharma, Katharina Reinecke, Tim Althoff, and Yulia Tsvetkov. 2022. Gendered mental health stigma in masked language models. In EMNLP. +Alisa Liu, Swabha Swayamdipta, Noah A Smith, and Yejin Choi. 2022a. Wanli: Worker and ai collaboration for natural language inference dataset creation. arXiv preprint arXiv:2201.05955. +Jiachang Liu, Dinghan Shen, Yizhe Zhang, William B Dolan, Lawrence Carin, and Weizhu Chen. 2022b. What makes good in-context examples for gpt-3? In Proceedings of Deep Learning Inside Out (DeeLIO 2022): The 3rd Workshop on Knowledge Extraction and Integration for Deep Learning Architectures. +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. +Aman Madaan, Amrith Setlur, Tanmay Parekh, Barnabás Poczós, Graham Neubig, Yiming Yang, Ruslan Salakhutdinov, Alan W Black, and Shrimai Prabhumoye. 2020. Politeness transfer: A tag and generate approach. In ACL. +Tara Matthews, Kathleen O'Leary, Anna Turner, Manya Sleeper, Jill Palzkill Woelfer, Martin Shelton, Cori Manthorne, Elizabeth F Churchill, and Sunny Consolvo. 2017. Stories from survivors: Privacy & security practices when coping with intimate partner abuse. In CHI. +Adam S Miner, Nigam Shah, Kim D Bullock, Bruce A Arnow, Jeremy Bailenson, and Jeff Hancock. 2019. Key considerations for incorporating conversational ai in psychotherapy. Frontiers in psychiatry. +Robert R Morris, Stephen M Schueller, and Rosalind W Picard. 2015. Efficacy of a web-based, crowdsourced peer-to-peer cognitive reappraisal platform for depression: randomized controlled trial. JMIR. +Usman Naseem, Adam G Dunn, Jinman Kim, and Matloob Khushi. 2022. Early identification of depression severity levels on reddit using ordinal classification. In WWW. +Mark Olfson. 2016. Building the mental health workforce capacity needed to treat adults with serious mental illnesses. *Health Affairs*. +Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. 2002. Bleu: a method for automatic evaluation of machine translation. In ACL. +Charles Sanders Peirce. 1974. Collected papers of charles sanders peirce. Harvard University Press. + +Sachin R Pendse, Kate Niederhoffer, and Amit Sharma. 2019. Cross-cultural differences in the use of online mental health support forums. CSCW. +Verónica Pérez-Rosas, Kenneth Resnicow, Rada Mihalcea, et al. 2022. Pair: Prompt-aware margin ranking for counselor reflection scoring in motivational interviewing. In EMNLP. +Verónica Pérez-Rosas, Xinyi Wu, Kenneth Resnicow, and Rada Mihalcea. 2019. What makes a good counselor? learning to distinguish between high-quality and low-quality counseling conversations. In ACL. +Yada Pruksachatkun, Sachin R Pendse, and Amit Sharma. 2019. Moments of change: Analyzing peer-based cognitive support in online mental health forums. In CHI. +Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J Liu, et al. 2020. Exploring the limits of transfer learning with a unified text-to-text transformer. JMLR. +Emily Reif, Daphne Ippolito, Ann Yuan, Andy Coenen, Chris Callison-Burch, and Jason Wei. 2022. A recipe for arbitrary text style transfer with large language models. In ACL. +Koustuv Saha and Amit Sharma. 2020. Causal factors of effective psychosocial outcomes in online mental health communities. In ICWSM. +Jessica L Schleider, Michael C Mullarkey, Kathryn R Fox, Mallory L Dobias, Akash Shroff, Erica A Hart, and Chantelle A Roulston. 2022. A randomized trial of online single-session interventions for adolescent depression during COVID-19. Nature Human Behaviour. +Raj Sanjay Shah, Faye Holt, Shirley Anugrah Hayati, Aastha Agarwal, Yi-Chia Wang, Robert E Kraut, and Diyi Yang. 2022. Modeling motivational interviewing strategies on an online peer-to-peer counseling platform. CSCW. +Ashish Sharma, Monojit Choudhury, Tim Althoff, and Amit Sharma. 2020a. Engagement patterns of peer-to-peer interactions on mental health platforms. In ICWSM. +Ashish Sharma, Inna W Lin, Adam S Miner, David C Atkins, and Tim Althoff. 2021. Towards facilitating empathic conversations in online mental health support: A reinforcement learning approach. In WWW. +Ashish Sharma, Inna W. Lin, Adam S. Miner, David C. Atkins, and Tim Althoff. 2023. Human-AI collaboration enables more empathic conversations in text-based peer-to-peer mental health support. Nature Machine Intelligence. +Ashish Sharma, Adam S Miner, David C Atkins, and Tim Althoff. 2020b. A computational approach to understanding empathy expressed in text-based mental health support. In EMNLP. + +Eva Sharma and Munmun De Choudhury. 2018. Mental health support and its relationship to linguistic accommodation in online communities. In CHI. +Siqi Shen, Verónica Pérez-Rosas, Charles Welch, Soujanya Poria, and Rada Mihalcea. 2022. Knowledge enhanced reflection generation for counseling dialogues. In ACL. +Siqi Shen, Charles Welch, Rada Mihalcea, and Verónica Pérez-Rosas. 2020. Counseling-style reflection generation using generative pretrained transformers with augmented context. In SIGDIAL. +Amy E Sickel, Jason D Seacat, and Nina A Nabors. 2014. Mental health stigma update: A review of consequences. Advances in Mental Health. +C Estelle Smith, William Lane, Hannah Miller Hillberg, Daniel Kluver, Loren Terveen, and Svetlana Yarosh. 2021. Effective strategies for crowd-powered cognitive reappraisal systems: A field deployment of the flip* doubt web application for mental health. CSCW. +Ian Stewart, Charles Welch, Lawrence An, Kenneth Resnicow, James Pennebaker, and Rada Mihalcea. 2023. Expressive interviewing agents to support health-related behavior change: A study of COVID-19 behaviors. JMIR formative research. +Michael J Tanana, Christina S Soma, Vivek Srikumar, David C Atkins, and Zac E Imel. 2019. Development and evaluation of clientbot: Patient-like conversational agent to train basic counseling skills. JMIR. +David Wadden, Tal August, Qisheng Li, and Tim Althoff. 2021. The effect of moderation on online mental health conversations. In ICWSM. +Charles Welch, Allison Lahnala, Verónica Pérez-Rosas, Siqi Shen, Sarah Seraj, Larry An, Kenneth Resnicow, James Pennebaker, and Rada Mihalcea. 2020. Expressive interviewing: A conversational system for coping with COVID-19. In Proceedings of the 1st Workshop on NLP for COVID-19 (Part 2) at EMNLP 2020. +Xinnuo Xu, Ondrej Dusek, Ioannis Konstas, and Verena Rieser. 2018. Better conversations by modeling, filtering, and optimizing for coherence and diversity. In ACL. +Diyi Yang, Zheng Yao, Joseph Seering, and Robert Kraut. 2019. The channel matters: Self-disclosure, reciprocity and social support in online cancer support groups. In CHI. +Justine Zhang and Cristian Danescu-Niculescu-Mizil. 2020. Balancing objectives in counseling conversations: Advancing forwards or looking backwards. In ACL. +Justine Zhang, Robert Filbin, Christine Morrison, Jaclyn Weiser, and Cristian Danescu-Niculescu-Mizil. 2019a. Finding your voice: The linguistic development of mental health counselors. In ACL. + +Tianyi Zhang, Varsha Kishore, Felix Wu, Kilian Q Weinberger, and Yoav Artzi. 2019b. Bertscore: Evaluating text generation with bert. arXiv preprint arXiv:1904.09675. +Yizhe Zhang, Siqi Sun, Michel Galley, Yen-Chun Chen, Chris Brockett, Xiang Gao, Jianfeng Gao, Jingjing Liu, and Bill Dolan. 2020. Dialogpt: Large-scale generative pre-training for conversational response generation. In ACL, system demonstration. +Caleb Ziems, Minzhi Li, Anthony Zhang, and Diyi Yang. 2022. Inducing positive perspectives with text reframing. In ACL. + +# A Method + +# A.1 Linguistic Attributes of Reframed Thoughts + +We provide additional detail on the approaches described in $\S 5.1$ . + +Actionability. As described in §5.1, we measure actionability using: contains_action( $\mathbf{R_i}$ ), and next_action_coherence( $\mathbf{R_i}$ ). + +For contains_action $(\mathbf{R_i})$ , our few-shot incontext learning approach proceeds as follows. Using the reframed thoughts that were annotated as high or low actionable in our collected data (S4.2), we manually create 10 demonstration examples. If a reframed thought contains an action, we ask GPT-3 to extract the action from it. Otherwise, we ask it to generate the text "No Action". Appendix A.2 shows examples. We then use these 10 demonstrations as in-context examples, followed by the reframe $\mathbf{R_i}$ which we aim to classify. If GPT-3 predicts an action for $\mathbf{R_i}$ , we assign contains_action $(\mathbf{R_i}) = 1$ ; else we assign O. + +For next_action_coherence $(\mathbf{R_i})$ , we instruct GPT-3 to generate $k = 5$ possible next actions given a reframed thought. Given $(\mathbf{S_i},\mathbf{T_i},\mathbf{R_i})$ , let $\mathbf{A_{i}} = a_{i1},a_{i2},\dots,a_{ik}$ be the generated set of next actions. Let $emb(\cdot)$ denote RoBERTa embeddings. Then, we define next_action_coherence $(\mathbf{R_i})$ as the average cosine similarity between $emb(a_{i})$ and $emb(a_{j})$ for all $a_{i},a_{j}\in \mathbf{A}_{\mathbf{i}}$ + +# A.2 Action Generation Prompt + +We use the following prompt template for extracting actions through GPT-3: + +Statement: "My bank card could be in many different places and I want to check them first before making any conclusions" + +Proposed Action: "Check bank card." + +Statement: "I cancelled that trip because I had to. It hurts to have done so but it was the right thing" + +Proposed Action: None + +Also, we use the following instruction prompt for generating the next set of actions through GPT-3: "Suggest 5 actions that the person could take based on the following statement:" + +# A.3 Hyperparameter Choices for our Proposed Retrieval-Enhanced In-Context Learning Method + +For the number of examples to retrieve, we experimented with $k = 1,5,10$ and 20 and found $k = 5$ to generate the most effective reframed thoughts, based on a qualitative assessment of 100 manually written situations and thoughts. + +# B Reproducibility + +Codes and datasets created in the paper can be found at https://github.com/behavioral-data/Cognitive-Reframing under an academic, attribution-only license. The use of existing artifacts was consistent with their intended use. For GPT-3 based models, we will use the OpenAI library. For other deep learning models, we train and them on two NVIDIA Titan RTX GPUs. We use the evaluate python library (pypi.org/project/Evaluate) for measuring BLEU and ROUGE scores and scipy for statistical tests. + +# C Flagged Reframes + +There were 32 reframing suggestions out of 5,760 which were flagged (0.56%). 19 of them were generic (59%). 5 of them made incorrect assumptions about the person's situation (16%). And 8 of them may not have been relatable to the person (25%). Importantly, we did not find any flagged reframes that were harmful or unsafe, which is critical in these scenarios. In future, exploring ways to create more personalized reframes could help avoid generic, presumptive or less relatable reframes. + +# D List of Thinking Traps + +
Thinking TrapsDescriptionExample
All-or-Nothing ThinkingThinking in extremes.If it isn’t perfect, I failed. There’s no such thing as “good enough”.
OvergeneralizingJumping to conclusions based on one experience.They didn’t text me back. Nobody ever texts me back.
LabelingDefining a person based on one action or characteristic.I said something embarrassing. I’m such a loser.
Trying to predict the future. Focusing on one possibility and ignoring other, more likely outcomes.I’m late for the meeting. I’ll make a fool of myself.
Fortune TellingAssuming you know what someone else is thinking.She didn’t say hello. She must be mad at me.
Mind ReadingTreating your feelings like facts.I woke up feeling anxious. I just know something bad is going to happen today.
Emotional ReasoningSetting unrealistic expectations for yourself.I shouldn’t need to ask for help. I should be independent.
Should StatementsSetting unrealistic expectations for yourself.He’s quiet today. I wonder what I did wrong.
PersonalizingTaking things personally or making them about you.
Disqualifying the PositiveWhen something good happens, you ignore it or think it doesn’t count.I only won because I got lucky.
CatastrophizingFocusing on the worst-case scenario.My boss asked if I had a few minutes to talk. I’m going to get fired!
Comparing and DespairingComparing your worst to someone else’s best.My niece’s birthday party had twice the amount of people
BlamingGiving away your own power to other people.It’s not my fault I yelled. You made me angry!
Negative Feeling or EmotionGetting “stuck” on a distressing thought, emotion, or belief.I am feeling lonely.
+ +# E Example Illustrating Our Rationality Measurement + +Figure 4: To measure reasoning strength, we generate two explanations for each reframe – one for why it might be sound; another for why it may be flawed. To check if the explanations themselves are well-reasoned, we recursively generate explanations for the explanations. Here, we choose a recursive tree depth of 3. Also, at every step, we generate three explanations in favour of a reframe and three explanations against it. + +![](images/7a589af60bdbc581d97ec1d234edca41045e42fdb4156bf2bba22a574aa756cf.jpg) + +# F Randomized Field-Study Interface + +![](images/aefd3ed69e8866cd1dc3fe8345973c3adc1650f9f8a292015a37c8f1b94b3ec0.jpg) +(a) Thought + +![](images/d2e8fa4cf907ead3bcad6aa861eeac91cbf4347c314a576faaf0ea9ed48ba3f6.jpg) +(b) Situation + +![](images/f3fa57d99e4e7032b582054b62f325049734390c5cb13e6be8c238dbf54b0bb8.jpg) +(c) Cognitive Distortions + +![](images/f421f2eeb95539a75e563f1f49ac3726dd459dc8a22ad0bc5fd6575600baa917.jpg) +(d) Reframed Thoughts +Figure 5: Illustration of the interface used for our randomized field-study: (a) Participant starts by writing the negative thought they are struggling with in the moment; (b) We ask the participant to describe a recent situation that may have led to their thought; (c) An AI model identifies possible cognitive distortion(s) in the thought. Participant selects the cognitive distortions that they most relate to; (d) An AI model generates and suggests three different reframed thoughts that may help overcome negative thinking and the associated cognitive distortion. Participant selects the reframe they find the most relatable, helpful and memorable. Some of the instructions provided to the participants, including informed consent and evaluation, have been omitted from this illustration for brevity. + +# G Data Collection Instructions + +Figure 6: Instructions shown during data collection with mental health experts. Continued on the next page (1/3). + +# Cognitive Restructuring + +# Study Goals + +The goal of this study is to collect a dataset for cognitive restructuring. + +# Definitions + +Situation Anything that happens to the person or the circumstance that the person finds themselves in (e.g., "My boss walked past me the hallway without saying hello") + +Thought What goes through the person's mind in the situation (e.g., "Why are they angry with me?"). + +Thinking Thinking traps, also called cognitive distortions, are Traps exaggerated, biased, and irrational thoughts which cause individuals to perceive reality inaccurately. + +Thinking Categories of thinking traps include assuming what Trap others think ("Mind Reading"), thinking in extremes ("All- + +Categories or-nothing thinking"), focusing on the worst-case scenario ("Catastrophizing"), focusing only on the bad ("Disqualifying the positive"), etc. + +# Example Thinking Trap + +Situation: My boss walked past me the hallway without saying hello + +Thought: Why are they angry with me? + +Thinking Trap: Mind Reading + +Figure 7: Instructions shown during data collection with mental health experts. Continued on the next page (2/3). + +Here, I'm reading my boss's mind and assuming that they are upset with me. I can't figure this out unless I ask them. + +Thought A thought response is self-talk (conversation with Response oneself) that tries to challenge the thinking trap in the original thought + +# Example Thought Responses + +Situation: My boss walked past me the hallway without saying hello. + +Thought: Why are they angry with me? + +Response 1: I have no way of figuring out what they might be thinking. Maybe they had a lot on her mind + +Response 2: They are the most wonderful person I know. They must not have noticed me. + +Response 3: They might be mad at me, but atleast they didn't say anything. + +Cognitive Cognitive Restructuring is a process that helps people + +Restructuring notice thinking traps in their thoughts and respond rationally to them. + +# Study Steps + +In this study, you will perform 20 cognitive restructuring tasks. In each task, you will be shown a situation and a thought. You will be asked to identify thinking traps in the thought and write and rate thought responses. + +Note: The use of "Both are similar" option (wherever applicable) is discouraged. + +Use it only when the two responses are truly identical and there is nothing to distinguish the two. + +Figure 8: Instructions shown during data collection with mental health experts (3/3). + +# Content Warning + +This study contains situations and thoughts including but not limited to self-harm and suicidal ideation, which may be disturbing. If you have any questions or concerns, please send us an email. Should you have a strong negative reaction to some of the content, you can reach a crisis counselor at crisis text line or by texting HOME to 741741. + +If you have questions about your rights as a research participant, or wish to obtain information, ask questions or discuss any concerns about this study with someone other than the researcher(s), please contact the Human Subjects Division at xxx. + +# H Consent Form Used in the Randomized Field Study on MHA + +Figure 9: Consent form shown to the MHA visitors. Continued on the next page (1/2). + +# Terms of Use + +This tool uses artificial intelligence to generate reframed thoughts and is part of a research study. + +Purpose: The purpose of the study is to understand how digital tools can help people recognize thinking traps and practice reframing negative thoughts. + +Procedure: You will be asked to describe a thought and a situation you are struggling with. You will then identify potential "thinking traps" (or cognitive distortions) in the thought and reframe it in a way that is more positive, realistic, or helpful. Finally, you will be asked to take an optional demographic survey, which can be skipped as preferred. The tool is expected to take $\sim 5$ minutes to complete. + +Benefits: By using this tool, you may learn about thinking traps. You will practice identifying them and reframing negative thoughts and situations. However, there is no guarantee that the tool will help you reframe your thoughts. + +Data Collection and Sharing: We will not ask you for your name or any identifiable personal information. Usage data will be made unidentifiable to the best of our extent, will be analyzed to improve the tool, and may be shared and used for future research. + +Risks: Talking about situations and thoughts you are struggling with may be disturbing to you and may bring up negative emotional reactions. In addition, the tool uses artificial intelligence to generate reframed thoughts. Appropriate steps have been taken to avoid harmful reframes, but there is a possibility that the generated content might be upsetting to you. Also, the optional demographic survey asks for information that may be sensitive and could make you feel uncomfortable (e.g., "What are the main things contributing to your mental health problems right now?"). This + +Figure 10: Consent form shown to the MHA visitors (2/2). + +tool is not being actively monitored by a human and should not be used as a "cry for help" outlet. Should you have a strong negative reaction to some of the content, you can text MHA to 741741 or call or text 988. + +Participation: Participation in this study is completely voluntary. You will not receive any payment for participation. You can refuse participation or stop participating at any time without penalty or loss of benefits to which you are otherwise entitled. + +Contact Us: If you have questions or concerns about this research, or if you think you have been harmed from being in the study, please email us at XXX. If you have questions about your rights as a research participant, you can call Human Subjects Division at XXX. + +□ By ticking this box, you are agreeing to use this tool. You are also confirming that you are at least 18 years old. Be sure that questions about the tool have been answered and that you understand what you are being asked to do. You may contact us if you think of a question later. You are free to stop using the tool at any time. To save a copy of this consent form, you can use this link. + +Previous + +Next + +A For every submission: + +A1. Did you describe the limitations of your work? Section 11 +A2. Did you discuss any potential risks of your work? Section 10 +A3. Do the abstract and introduction summarize the paper's main claims? Section 1 +A4. Have you used AI writing assistants when working on this paper? Left blank. + +B Did you use or create scientific artifacts? + +Section 4; Section 5 + +B1. Did you cite the creators of artifacts you used? Section 4; Section 5 +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? Appendix B +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? Appendix B +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? Section 10 +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? Section 11 +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. Section 4; Section 6 + +C Did you run computational experiments? + +Section 6; Section 7 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? Appendix B + +The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +Section 5; Section 6; Appendix A.3 + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +Section 6; Section 7 + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +Appendix B + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Section 4; Section 7 + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +Appendix D; Appendix E; Appendix F + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +Section 4; Section 7 + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +Section 4.3; Section 10 + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +Section 4.3; Section 10 + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +Section 4 \ No newline at end of file diff --git a/cognitivereframingofnegativethoughtsthroughhumanlanguagemodelinteraction/images.zip b/cognitivereframingofnegativethoughtsthroughhumanlanguagemodelinteraction/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..0cf46cb2df6748fd1847dd8563dfe35210213443 --- /dev/null +++ b/cognitivereframingofnegativethoughtsthroughhumanlanguagemodelinteraction/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:560571e8185cde752f6b67cf8a80a01f6e7220401a0b816e692cf1739ac3292a +size 652187 diff --git a/cognitivereframingofnegativethoughtsthroughhumanlanguagemodelinteraction/layout.json b/cognitivereframingofnegativethoughtsthroughhumanlanguagemodelinteraction/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..3d302bdecbc3ef0a7a540cffbf74d021863bffef --- /dev/null +++ b/cognitivereframingofnegativethoughtsthroughhumanlanguagemodelinteraction/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:764dff4d386548e2f07bc9f9ecddc199b86827332c63a7d08270ed3e5cecfbb6 +size 667727 diff --git a/colacontextualizedcommonsensecausalreasoningfromthecausalinferenceperspective/a7e16db9-304f-4ccc-ba0f-7270c9d61328_content_list.json b/colacontextualizedcommonsensecausalreasoningfromthecausalinferenceperspective/a7e16db9-304f-4ccc-ba0f-7270c9d61328_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..41eebe1aa94787c7eb84c7d831bcba00cf924433 --- /dev/null +++ b/colacontextualizedcommonsensecausalreasoningfromthecausalinferenceperspective/a7e16db9-304f-4ccc-ba0f-7270c9d61328_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:986e7db29c5b9aad673ba75a79d3cdef2dfde77e416edd4296d1d06a5b18b470 +size 134372 diff --git a/colacontextualizedcommonsensecausalreasoningfromthecausalinferenceperspective/a7e16db9-304f-4ccc-ba0f-7270c9d61328_model.json b/colacontextualizedcommonsensecausalreasoningfromthecausalinferenceperspective/a7e16db9-304f-4ccc-ba0f-7270c9d61328_model.json new file mode 100644 index 0000000000000000000000000000000000000000..97682fd607081a0ea43846f1cc8af43a248363ed --- /dev/null +++ b/colacontextualizedcommonsensecausalreasoningfromthecausalinferenceperspective/a7e16db9-304f-4ccc-ba0f-7270c9d61328_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:48b27f8bf4260f59a789f35e83685827c5f71cf52b431f12c84ea1b5bd84d56d +size 168270 diff --git a/colacontextualizedcommonsensecausalreasoningfromthecausalinferenceperspective/a7e16db9-304f-4ccc-ba0f-7270c9d61328_origin.pdf b/colacontextualizedcommonsensecausalreasoningfromthecausalinferenceperspective/a7e16db9-304f-4ccc-ba0f-7270c9d61328_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..dc6371ba4c273528bd68c16700549a83e86e66c1 --- /dev/null +++ b/colacontextualizedcommonsensecausalreasoningfromthecausalinferenceperspective/a7e16db9-304f-4ccc-ba0f-7270c9d61328_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d9099210821cc6c5ce4ec160a7597863646d2202daf6e5480a035e0ffe1fc9a +size 1017832 diff --git a/colacontextualizedcommonsensecausalreasoningfromthecausalinferenceperspective/full.md b/colacontextualizedcommonsensecausalreasoningfromthecausalinferenceperspective/full.md new file mode 100644 index 0000000000000000000000000000000000000000..b9db049475bb4095606d82ec18014a1f971e8b2c --- /dev/null +++ b/colacontextualizedcommonsensecausalreasoningfromthecausalinferenceperspective/full.md @@ -0,0 +1,589 @@ +# COLA: Contextualized Commonsense Causal Reasoning from the Causal Inference Perspective + +Zhaowei Wang $^{1}$ , Quyet V. Do $^{1}$ , Hongming Zhang $^{2}$ , Jiayao Zhang $^{3}$ , Weiqi Wang $^{1}$ , Tianqing Fang $^{1}$ , Yangqiu Song $^{1}$ , Ginny Y. Wong $^{4}$ , & Simon See $^{4}$ + +$^{1}$ Department of Computer Science and Engineering, HKUST + +$^{2}$ Tencent AI Lab, Bellevue, USA $^{3}$ University of Pennsylvania + +$^{4}$ NVIDIA AI Technology Center (NVAITC), NVIDIA, Santa Clara, USA + +{zwanggy,yqsong}@cse.ust.hk,{gwong,ssee}@nvidia.com + +# Abstract + +Detecting commonsense causal relations (causation) between events has long been an essential yet challenging task. Given that events are complicated, an event may have different causes under various contexts. Thus, exploiting context plays an essential role in detecting causal relations. Meanwhile, previous works about commonsense causation only consider two events and ignore their context, simplifying the task formulation. This paper proposes a new task to detect commonsense causation between two events in an event sequence (i.e., context), called contextualized commonsense causal reasoning. We also design a zero-shot framework: COLA (Contextualized Commonsense Causality Reasoner) to solve the task from the causal inference perspective. This framework obtains rich incidental supervision from temporality and balances covariates from multiple timestamps to remove confounding effects. Our extensive experiments show that $\mathsf{COLA}^1$ can detect commonsense causality more accurately than baselines. + +# 1 Introduction + +Commonsense Causal Reasoning (CCR) aims at identifying plausible causes and effects of events in natural language that are typically reasonable by an average person (Zhang et al., 2022c). To solve the task, existing efforts devoted by the community mainly rely on language models wholeheartedly with supervised learning approaches (Staliūnaité et al., 2021; Sap et al., 2019; Tamborrino et al., 2020; He et al., 2020; Raffel et al., 2020). Those ingenious engineering works have brought significant progress in recent years. However, recent studies (Kavumba et al., 2019; Han and Wang, 2021) found that pure engineering designs are inadequate to seize commonsense causation, as language mod- + +![](images/768ad5129b633bf717eb0948558a5f2779b33ef624e9c40c255a724161b7f319.jpg) +Figure 1: An illustration of leveraging context to conduct commonsense causal reasoning. Both causes could be plausible under different contexts, while only the frequent one (i.e., Cause 1) is plausible without context. + +els tend to reach higher scores by exploiting superficial artifacts in data. + +Recently, Zhang et al. (2022c) first studied grasping commonsense causation from the causal inference perspective, by drawing analogies between observational studies (Cochran and Chambers, 1965; Rosenbaum, 2002) and natural languages (Zhang and Zhang, 2021). The proposed framework ROCK achieves good potential for the zero-shot CCR task (e.g., COPA by Gordon et al. (2012)). However, Zhang et al. (2022c) only focuses on the commonsense causation between a pair of events without specifying context. Given that events are complex (Chen et al., 2021), an event may have different causes under different contexts (Mostafazadeh et al., 2020). Thus, it is necessary to utilize context when detecting commonsense causation, such as other events related to given ones. Missing a clear and specific context simplifies commonsense causal knowledge and hinders models from detecting commonsense causal relations more accurately. For example, as shown in Figure 1, the frequent cause of "Emma made a steak in the kitchen." is "Emma felt hungry." However, the cause also could + +be "Emma was doing her job" if "Emma is a chef at a steakhouse." Without the context of Emma's job, models cannot distinguish those two causes and may return to the frequent one. + +To involve context when detecting commonsense causation, we propose a new task to detect causes between two events in an event sequence, called Contextualized Commonsense Causal Reasoning (Contextualized CCR). In this task, models are asked to detect commonsense causal relations between two given events enclosed in an event sequence. Other events in the event sequence can provide a clear and specific definition of the current context, helping models to capture commonsense causation more accurately. In fact, we find that contextualized CCR is a non-trivial task. Directly applying the framework ROCK (Zhang et al., 2022c) cannot achieve competitive performance on the contextualized CCR since it cannot integrate context information. + +We propose the framework COLA, which incorporates contextual information from an event sequence, to solve the Contextualized CCR. Our framework adopts the potential-outcomes framework (Rubin, 1974; Rosenbaum, 2002; Rubin, 2005) to estimate the causal estimand $\Delta$ defined as a type of "average treatment effect" (ATE), which measures the change in the likelihood of $E_{j}$ 's occurrence when intervening $E_{i}$ (denoted by $\neg E_{i}$ ) as + +$$ +\Delta = \mathbb {P} \left(\mathrm {E} _ {i} \prec \mathrm {E} _ {j}\right) - \mathbb {P} \left(\neg \mathrm {E} _ {i} \prec \mathrm {E} _ {j}\right), \tag {1} +$$ + +where $\mathbb{P}(\cdot)$ can be estimated with a pre-trained language model, such as a masked language model (Devlin et al., 2018). The magnitude of average treatment effect informs the strength of $E_{i}$ 's effect on $E_{j}$ , and its sign indicates the direction of the effect. For instance, $\Delta \approx 1$ means $E_{j}$ becomes more prone to occur due to the occurrences of $E_{i}$ . In an ideal world (e.g., $E_{i}$ and $E_{j}$ on any study unit occur completely randomly), a plugging-in estimator in Equation (1) suffices for detecting commonsense causation. Nevertheless, spurious correlations introduced by pervasive confounding co-occurrences need to be eliminated for an unbiased estimation of the causal estimand. This can be done by balancing events that precede $E_{i}$ , or covariates. To incorporate context, we design a mechanism to sample diversified covariates from multiple timestamps and use temporal propensity (Zhang et al., 2022c) for balancing. + +We annotated commonsense causal relations between two events ( $\sim 1.3\mathrm{k}$ examples) within event + +sequences from ROCStories (Mostafazadeh et al., 2016) to benchmark our proposed contextualized CCR task. We conduct extensive experiments with multiple pre-trained language models, showing that COLA can detect cause-and-effect relations more accurately than competitive baselines by a large margin. Our experiments also show that temporality is essential in our framework but not sufficient to detect commonsense causation without covariates being appropriately balanced. + +# 2 Background and Related Works + +Understanding events and relations between them have long been a challenging NLP task (Chen et al., 2021). The community has dedicated many works to studying various event-centric tasks, including event relation reasoning (Ning et al., 2018; Zhou et al., 2021; Wang et al., 2020), event extraction (Huang et al., 2018; Lai et al., 2020; Zhang et al., 2022b; Lin et al., 2023), event-centric KG construction (Zhang et al., 2020b, 2022a), and many others (Chambers and Jurafsky, 2008; Chen et al., 2020; Jin et al., 2022; Wang et al., 2022b). Among them, there are a few lines of work that are most related to our work: + +Commonsense Causal Reasoning Since our work is about Contextualized CCR, we first discuss related works about commonsense causal reasoning. Existing commonsense causal reasoning approaches are typically categorized under the general topic of commonsense reasoning (Rashkin et al., 2018; Sap et al., 2020). Most previous works depend on language models. Remarkable progress in CCR mainly comes from dataset augmentation, training procedure design, and external knowledge (Staliūnaité et al., 2021; Sap et al., 2019; Shwartz et al., 2020; Tamborrino et al., 2020; Iter et al., 2020). Studies (Kavumba et al., 2019; Han and Wang, 2021) show that language models exploit superficial artifacts to achieve suspicious high performance. + +Causal event detection (Mirza and Tonelli, 2014; Mirza et al., 2014) forms another line of work pertinent to CCR. The task aims to detect causal relations in documents, where various methods are proposed (Chang and Choi, 2005; Do et al., 2011; Ning et al., 2019). However, those works consider verbal (e.g., "attack") or nominal predicates (e.g., "explosion") as events, oversimplifying the relation detection task. In this paper, we study events expressed in free text, facing a more challenging + +setup but being closer to real applications. + +Narrative-related Tasks Since Contextualized CCR is primarily about chains of events, our work is inspired by earlier research that deals with narratives and scripts (Chambers and Jurafsky, 2008; Granroth-Wilding and Clark, 2016; Mostafazadeh et al., 2016; Bhagavatula et al., 2019; Zhang et al., 2020a). In contrast, our work aims to identify causal relations in a chain of events. + +Methodologies of Causal Inference Zhang and Zhang (2021) provided the first study to solve the CCR task from the causal inference perspective. The human population studies have scrutinized extensively the causal inference, which identifies causal relations from ubiquitous associations, including biomedical research, agriculture, epidemiology, and economics (Fisher, 1958; Imbens and Rubin, 2015; Giannarakis et al., 2022; Rosenbaum, 2002; Cochran and Chambers, 1965), where researchers usually use the potential-outcomes framework (Splawa-Neyman et al., 1990; Rubin, 1974; Holland, 1986), graphical and structural equation models (Robins, 1986; Pearl, 1995; Heckman, 2005), and Granger causality (Granger, 1969). + +Recent studies have drawn causal inferences on textual data with the help of powerful pre-trained language models (Kang et al., 2017; Keith et al., 2020; Feder et al., 2022). Concurrently, causal inference can improve the robustness and fairness of NLP models (Feder et al., 2022) or boost performance on downstream tasks (Ghosal et al., 2021; Zheng et al., 2022; Alabdulkarim et al., 2021; Wang et al., 2022a). + +# 3 Problem Formulation + +Notation We use sans - serif fonts to represent an event, such as $\mathsf{E}_i$ in Figure 2, where the subscript $i$ means the $i$ -th event in a sequence. Simultaneously, uppercase serif letters denote indicators of whether the corresponding event occurs: $E_i = \mathbb{1}\{\mathsf{E}_i$ occurs\}, and a lowercase serif letter means the realizations of this indicator: $e_{i,j} = \mathbb{1}\{\mathsf{E}_i$ occurs to the $j$ -th study unit\}. We introduce the point process to more clearly describe the order of a pair of events: $E(t)$ with $t \in \{0,1\}$ (e.g., past versus present), so that $E_i(0)$ and $E_j(1)$ means that $\mathsf{E}_i$ happens before $\mathsf{E}_j$ . We also use $\mathsf{E}_i \prec \mathsf{E}_j$ to indicate that $\mathsf{E}_i$ occurs before $\mathsf{E}_j$ for simplicity. We write $\mathbb{P}(\mathsf{E}_i \prec \mathsf{E}_j) = \mathbb{P}(E_i(0), E_j(1))$ . + +Task Description We articulate the Contextualized CCR as a tweaked form of the binary classification problem. Specifically, we provide models with an event sequence of $n$ events: $\mathsf{E}_1, \mathsf{E}_2, \ldots, \mathsf{E}_n$ . Models need to find the top- $k$ events in this sequence that more plausibly have commonsense causal relations with the last event $\mathsf{E}_n$ , where $k$ indicates the number of positive labels in the ground truth. Then, models need to predict the commonsense causal relation between each event pair $(\mathsf{E}_i, \mathsf{E}_n)$ as a positive/negative one. The strength of causal relations between $\mathsf{E}_i$ and $\mathsf{E}_n$ can be expressed with average treatment effect as: + +$$ +\Delta_ {i} = \mathbb {P} \left(\mathrm {E} _ {i} \prec \mathrm {E} _ {n}\right) - \mathbb {P} \left(\neg \mathrm {E} _ {i} \prec \mathrm {E} _ {n}\right). \tag {2} +$$ + +# 4 Theoretical Mechanism of COLA + +As discussed in Section 1, we articulate the Contextualized CCR problem as the estimation of the causal estimand $\Delta$ , which we model as the change of temporal likelihood with contexts controlled. We adopt the potential-outcomes framework to design COLA to eliminate potential confounding effects due to co-occurrences of events when estimating the causal estimand from data. In this section, we first clarify all essential concepts in the theoretical mechanism of COLA one by one, including study unit, intervention, covariate, and propensity, by drawing analogies between the underlying causal mechanisms in natural languages with that in human population research. We then describe the implementation of each component in Section 5. + +# 4.1 The Analogy and Study Unit + +Motivated by Zhang et al. (2022c), we draw the analogy between human subjects and semantic meanings through the following process: assuming that every human subject kept a textbook recording each event (s)he has experienced, we can then treat each textbook (in natural language) as a study unit and infer the temporal relationships between events from it. In this analogy, we clearly understand the study unit in semantic meanings. + +Then, we can formulate contextualized CCR with concepts from the potential-outcome framework. Given two events $\mathsf{E}_i$ and $\mathsf{E}_n$ from an event sequence $\mathsf{E}_1,\mathsf{E}_2,\ldots ,\mathsf{E}_n$ where we assume that $\mathsf{E}_{ij}$ represents the event that the $j$ -th study unit experienced at the timestamp $i$ when $\mathsf{E}_i$ is supposed to occur. Then for each unit $j$ , we can define the treatment assignment as $E_{ij} = \mathbb{1}\left\{\mathsf{E}_{ij} = \mathsf{E}_i\right\}$ , realizations of covariates as $\pmb{x}_j = (x_{jl})_{l = 1}^N$ for + +![](images/d561d0f862fb1882a4eb50593a8cb3f089ed3b24e085fe156a1bd064e3e33d33.jpg) +Figure 2: The overview of our proposed framework COLA. Given a pair of events $(\mathsf{E}_i,\mathsf{E}_n)$ , the framework contains four steps to detect commonsense causal relations: (1) multistamp covariate sampling, (2) intervention generation (3) selecting a set of matched interventions, (4) computing average treatment effect. + +$x_{jl} = \mathbb{1}\left\{\mathsf{X}_l\prec \mathsf{E}_{ij}\right\}$ , and two potential-outcomes as + +$$ +\left\{ \begin{array}{l} r _ {0, i j} = \mathbb {1} \left\{\mathrm {E} _ {i j, E _ {i} = 0} \prec \mathrm {E} _ {n} \right\}, \\ r _ {1, i j} = \mathbb {1} \left\{\mathrm {E} _ {i j, E _ {i} = 1} \prec \mathrm {E} _ {n} \right\}. \end{array} \right. \tag {3} +$$ + +When the $j$ -th unit receives the treatment assignment $E_{ij}$ , the hypothetical scenario is denoted by $\mathsf{E}_{ij,E_i = 1 - E_{ij}}$ , which describes what if the assignment were flipped. Clearly, we can only observe either $r_{0,ij}$ or $r_{1,ij}$ , but not both of them. We can rewrite the causal estimand $\Delta_{i}$ in Equation (2) exactly as an average treatment effect by averaging over the unit index: + +$$ +\begin{array}{l} \Delta_ {i} = \mathbb {E} _ {j} \left[ r _ {1, i j} - r _ {0, i j} \right] \tag {4} \\ \equiv \mathbb {P} (\mathsf {E} _ {i} \prec \mathsf {E} _ {n}) - \mathbb {P} (\neg \mathsf {E} _ {i} \prec \mathsf {E} _ {n}). \\ \end{array} +$$ + +The above formulation naturally embodies the temporal nature of covariates (Rubin, 2005), which, by definition, are pretreatments that precede treatments. + +# 4.2 Intervention Beyond Negation + +In human population studies, the generally accepted stable unit treatment value assumption (Rubin, 1980) ensures only one type of non-treatment (usually negation) for each study unit. As events are complicated, we would interpret intervention (manipulation) of semantic meanings in a broader sense. Take $\mathsf{E}_i$ "Emma felt hungry" from Figure 2 as an example. While "Emma didn't feel hungry" is the most direct intervention, it is nonetheless too restrictive: Emma may have felt happy; maybe Alice is the one who felt hungry, instead of Emma. Consequently, interventions in our framework are interpreted much broader as any event that could result in a plausible counterfactual of the outcome. We use $\mathcal{A}$ to represent all possible interventions of an event $\mathsf{E}_i$ . + +# 4.3 Balancing Covariates and Comparable Study Units + +We have discussed that the plugging-in estimator in Equation (1) suffers from biases due to potential confounders. One mitigation strategy is properly balancing the covariates (Rubin, 2005), namely events that occur before $\mathsf{E}_i$ , which ensures that covariates of untreated study units are comparable to those of treated ones. Consider the vaccine trial as an example; one needs to ensure that the health conditions (covariates) in the control group (not administered vaccines) are comparable to the treated group (administered vaccines). As such, we rewrite the causal estimand $\Delta$ in Equation (2) as expectations conditional on the covariates $x$ among comparable study units: + +$$ +\mathbb {E} _ {\boldsymbol {x}} \left[ \mathbb {P} \left(\mathrm {E} _ {i} \prec \mathrm {E} _ {n} | \boldsymbol {x}\right) - \mathbb {P} \left(\neg \mathrm {E} _ {i} \prec \mathrm {E} _ {n} | \boldsymbol {x}\right) \right], \tag {5} +$$ + +provided that the treatment assignment is strongly ignorable with respect to potential outcomes (i.e., $r_{1,ij}$ and $r_{0,ij}$ ) according to the strong ignorability assumption. + +The strong ignorability assumption is essential in causal inference. Simply, it means that given a set of covariates, the treatment assignment among study units can be viewed as "random" (or "ignorable") with respect to potential outcomes (see, e.g., Rosenbaum (2002); Rubin (2005) for textbook treatments and Zhang et al. (2022c) for more discussions on this assumption in CCR). + +# 4.4 Matching Temporal Propensities + +Directly estimating Equation (5) may face the issue of data sparsity since we may sample multiple covariates, and combinations of their values grow exponentially. There are various methods to mitigate this issue in balancing covariates, including assignment modeling, outcome modeling, and doubly + +robust estimations (Rubin, 2005), among which we base our method on propensity score matching. It is a simple and effective method that is widely used in observational studies (Rosenbaum and Rubin, 1983), which matches the propensity scores of study units to balance covariates. The propensity score is defined as $p(\pmb{x}) = \mathbb{P}(E_i(1) = 1|\pmb{x}(0))$ , which represents the probability of $E_i$ taking place conditioning on covariates $\pmb{x}$ . Since it is unclear how to pack an unordered set of covariates (events) into a sequential input, Zhang et al. (2022c) proposed to use a relaxed notion of temporal propensity vector, defined as the vector of probabilities of $E_i$ happening conditional on each covariate $x \in \pmb{x}$ : + +$$ +q (\boldsymbol {x}) = q (\boldsymbol {x}; \mathsf {E} _ {i}) = \left(\mathbb {P} \left(E _ {i} (1) = 1 | x (0)\right)\right) _ {x \in \boldsymbol {x}}. \tag {6} +$$ + +Hence, we can rewrite the conditional expectation in Equation (5) in the form of matching temporal propensity vectors for some fixed threshold $\epsilon$ , given below: + +$$ +\left\{ \begin{array}{l} \hat {\Delta} _ {i} = f \left(\mathrm {E} _ {i}, \mathrm {E} _ {n}\right) - \frac {1}{| \mathcal {A} ^ {\prime} |} \sum_ {\mathrm {A} \in \mathcal {A} ^ {\prime}} f (\mathrm {A}, \mathrm {E} _ {n}), \\ \mathcal {A} ^ {\prime} := \left\{\mathrm {A} \in \mathcal {A}: \frac {1}{| \mathcal {X} |} \| q (\boldsymbol {x}; \mathrm {A}) - q (\boldsymbol {x}; \mathrm {E} _ {i}) \| _ {2} \leq \epsilon \right\}, \end{array} \right. \tag {7} +$$ + +where $f(\mathsf{E}_i,\mathsf{E}_n)$ is an estimate for $\mathbb{P}(\mathsf{E}_i\prec \mathsf{E}_n)$ produced by a language model. + +# 5 The COLA Framework + +After establishing the theoretical mechanism for our framework COLA, we describe the implementation of each component of COLA in this section. Generally, since events are in free-text form in our task, pre-trained language models play a central role in our framework. Given that LMs are pre-trained on an enormous amount of textual data (Gao et al., 2020; Raffel et al., 2020), it is sensible to suppose that those LMs would emulate the responses of an average reasonable person. + +Specifically, our framework COLA takes two events $\mathsf{E}_i$ and $\mathsf{E}_n$ from a sequence $\mathsf{E}_1, \mathsf{E}_2, \ldots, \mathsf{E}_n$ as input. As shown in Figure 2, our framework COLA contains four steps: (1) a multistamp covariate sampler samples a set $\mathcal{X}$ of covariates. (2) an intervention generator generates a set $\mathcal{A}$ of interventions. (3) A score estimator builds temporal propensity vectors and selects a matched subset $\mathcal{A}'$ out of $\mathcal{A}$ , by estimating the temporality with a temporal predictor. (4) Eventually, the same score estimator computes $\hat{\Delta}_i$ according to Equation (7). + +Multistamp Covariate Sampler Our multi-stamp covariate sampler is based on GPT-J + +(6b) (Wang and Komatsuzaki, 2021). For an input event $\mathsf{E}$ , we add "Before that," at the end to build "E Before that," as the prompt template. For the $i$ -th event in a sequence, we first sample a covariate set $\mathcal{X}_i$ , which contains events before $\mathsf{E}_i$ . To diversify covariates, we also sample events before $\mathsf{E}_1, \mathsf{E}_2, \ldots, \mathsf{E}_{i-1}$ separately, forming $\mathcal{X}_1, \mathcal{X}_2, \ldots, \mathcal{X}_{i-1}$ . Those events are also before $\mathsf{E}_i$ and can serve as covariates due to the transitivity of the temporal relation2. We evenly merge covariates before each timestamp to construct the final covariate set: + +$$ +\mathcal {X} = \cup_ {l = 1} ^ {i} \mathcal {X} _ {l}. \tag {8} +$$ + +Union vs. Intersection While the aforementioned method takes the union of events sampled according to the left-side context of $\mathsf{E}_i$ , another intuitive approach is to take the intersection of events sampled according to multiple timestamps in the right-side context. In this way, we can collect covariates that happen before all of $\mathsf{E}_i, \mathsf{E}_{i+1}, \ldots, \mathsf{E}_n$ , that is, $\mathcal{X} = \cap_{l=i}^{n} \mathcal{X}_l$ . We discuss the experimental results of these two methods in Section 7.3 and found taking union works better, which will be the default in the remaining sections. + +Intervention Generator This component generates a set $\mathcal{A}$ of interventions as discussed in Section 4.2. There are a variety of related works about generating interventions (counterfactuals) of an event (Gardner et al., 2020; Qin et al., 2019; Ribeiro et al., 2020) and we choose PolyJuice (Wu et al., 2021) in our framework owing to its non-task-specific training objective. PolyJuice generates interventions by masking some phrases individually and filling in masks with a fine-tuned GPT2. Then, we apply the semantic role labeling (SRL) tool provided by AllenNLP (Gardner et al., 2018) to extract the verb V and two arguments ARG0 and ARG1 as phrases to be manipulated (see Appendix A.2 for more details). + +Temporal Predictor We prompt a masked language model to estimate the temporal relation scores between two given events $\mathsf{E}_i$ and $\mathsf{E}_n$ . The prompt template “ $\mathsf{E}_i < \mathsf{MASK} > \mathsf{E}_n$ ” predicts scores $f_b(\mathsf{E}_i, \mathsf{E}_n)$ and $f_a(\mathsf{E}_i, \mathsf{E}_n)$ for the output tokens before and after. Similarly, we can obtain a reversed estimation by inputting “ $\mathsf{E}_n < \mathsf{MASK} > \mathsf{E}_i$ ”. Final temporal score $f$ averages scores from + +both directions: $f(\mathsf{E}_i,\mathsf{E}_n) = \frac{1}{2} (f_b(\mathsf{E}_i,\mathsf{E}_n) + f_a(\mathsf{E}_n,\mathsf{E}_i))$ + +Our temporal predictor needs to be fine-tuned on a temporal relation corpus. Directly applying a pretrained LM encounter the problem of low coverage, where the tokens before and after cannot be found in the top- $k$ prompted tokens (even $k = 30$ ). Thus, we fine-tuned masked language models to predict the masked connectives in a prompt learning setting. Intuitively, temporal relations exist between each pair of adjacent events in a chronologically ordered event sequence. Assuming an event sequence contains two adjacent events $\mathsf{E}_i, \mathsf{E}_{i+1}$ , we then can create an example $\mathsf{E}_i$ before $\mathsf{E}_{i+1}$ and an symmetric example $\mathsf{E}_{i+1}$ after $\mathsf{E}_i$ . We also construct negative samples by replacing $\mathsf{E}_i$ or $\mathsf{E}_{i+1}$ with a randomly sampled event from other sequences. Those negative examples can teach models when no temporal relation exists. While we mask before or after in a positive example for models to predict, a special token [none] should be prompted for negative examples. Then, the cross-entropy loss is used to optimize the temporal predictor. We call this fine-tuning process temporal fine-tuning. More details about the temporal relation dataset and fine-tuning process are shown in Appendix A.1. + +Score Estimator With the temporal predictor, we can estimate $\mathbb{P}(\mathsf{X}\prec \mathsf{A})$ for all covariates $\mathsf{X}\in \mathcal{X}$ and interventions $\mathsf{A}\in \mathcal{A}$ : $\mathbb{P}(X(0),A(1)) = \mathbb{P}(\mathsf{X}\prec \mathsf{A}) = f(\mathsf{X},\mathsf{A})$ . We also need to estimate $\mathbb{P}(X(0))$ to compute conditional probabilities $\mathbb{P}(A(1) = 1|X(0))$ in temporal propensity vectors $q(\pmb {x};\mathsf{A})$ . As all covariates $\mathsf{X}$ are events preceding $\mathsf{E}_i$ sampled by GPT-J, there is an implicit conditioning on $\mathsf{E}_i$ . Thus, we can approximately get $\mathbb{P}(X(0))\approx f(\mathsf{X},\mathsf{E}_i)$ (see Appendix B for more details). Then, temporal propensity vectors are computed as + +$$ +q (\boldsymbol {x}; \mathsf {A}) = \left(\frac {\mathbb {P} (X (0) , A (1))}{\mathbb {P} (X (0))}\right) _ {\mathsf {X} \in \mathcal {X}}. \tag {9} +$$ + +Finally, the score estimator computes $\hat{\Delta}_i$ in Equation (7). We also test normalization methods in Appendix E and observe that some of those normalization methods can benefit our framework. + +# 6 Experiment + +We conduct extensive experiments and compare COLA with a wide selection of baselines. + +# 6.1 Dataset + +Since our work is the first attempt to study Contextualized CCR, we carried out human annotation on Amazon Mechanical Turk. We randomly sampled event sequences from ROCStories (Mostafazadeh et al., 2016), where each sequence contains five chronologically ordered events. Workers are asked to annotate whether an event causes the last event in a sequence. There are two qualification tests to choose workers to maintain rigorous quality control. See more details in Appendix D. + +Eventually, we collected a dataset containing 1,360 event pairs, called Choice of Plausible Event in Sequence (COPE). We equally divide them into a validation set and a testing set. + +# 6.2 Evaluation Metric + +We calculate accuracy, F1-score, and Macro F1-score between predicted labels and ground truth labels, to automatically evaluate all models on our dataset. Notice that our task definition provides the number of positive events in a sequence, so that recall, precision, and F1-score are the same. + +# 6.3 Baseline Methods + +We compare our framework to three baselines: + +CLM Perplexity An intuitive solution to the contextualized CCR task would be computing perplexity scores for each pair of events with a causal language model (CLM). An event pair $(E_i, E_j)$ within a sequence $E_1, E_2, \ldots, E_n$ ( $n$ is sequence length) is converted into full-text input with the prompt template: "If $E_1, E_2, \ldots, E_n, E_j$ because $E_i$ ". The causal language models we tested are GPT2, GPT2-medium/large/XL (Radford et al., 2019), and GPT-J (Wang and Komatsuzaki, 2021). + +Cloze Prompt Score This baseline proposed by Tamborrino et al. (2020) concatenates two events $(E_i, E_j)$ into full-text input. Then, it masks and tries to recover each token with a masked language model. It averages log-likelihood over every token as the final score of two events. The prompt used is the same as CLM Perplexity. Multiple masked language models are tested: BERT-base/large (Devlin et al., 2018), RoBERTa-base/large (Liu et al., 2019), DeBERTa-base/large (He et al., 2020). + +ROCK This baseline is a causal inference framework (Zhang et al., 2022c) that draws analogies between human subjects and natural language. We + +
ModelsValidationTesting
AccF1Ma-F1ΔAccAccF1Ma-F1ΔAcc
Random59.4742.3555.55-58.9441.1054.79-
CLM Perplexity (GPT2)61.7645.6158.06-61.4744.7357.58-
CLM Perplexity (GPT2-medium)60.2943.5156.45-61.7645.1557.90-
CLM Perplexity (GPT2-large)62.9447.2859.35-62.6546.4158.87-
CLM Perplexity (GPT2-XL)62.6546.8659.03-62.3545.9958.55-
CLM Perplexity (GPT-J 6b)63.8248.5460.32-62.0645.5758.22-
ClozePromptScore (BERT-base)64.4149.3760.97-63.5347.6859.84-
ClozePromptScore (BERT-large)66.4752.3063.23-62.0645.5758.22-
ClozePromptScore (RoBERTa-base)59.7142.6855.81-59.7142.1955.63-
ClozePromptScore (RoBERTa-large)60.5943.9356.77-59.1241.3554.99-
ClozePromptScore (DeBERTa-base)56.7638.4952.58-58.5340.5154.34-
ClozePromptScore (DeBERTa-large)56.4738.0852.26-57.0638.4052.72-
ROCK (BERT-base)66.1851.8862.90-65.2950.2161.79-
ROCK (BERT-large)65.5951.0562.26-66.4751.9063.08-
ROCK (RoBERTa-base)61.7645.6158.06-61.1844.3057.25-
ROCK (RoBERTa-large)62.9447.2859.35-65.5950.6362.11-
ROCK (DeBERTa-base)62.6546.8659.03-60.5943.4656.61-
ROCK (DeBERTa-large)64.4149.3760.97-64.1248.5260.49-
COLA (BERT-base)67.6553.9764.52↑1.4768.8255.2765.67↑3.53
COLA (BERT-large)70.2957.7467.42↑4.7070.2957.3867.29↑3.82
COLA (RoBERTa-base)69.7156.9066.77↑7.9566.7652.3263.41↑5.58
COLA (RoBERTa-large)70.5958.1667.74↑7.6570.0056.9666.97↑4.41
COLA (DeBERTa-base)69.7156.9066.77↑7.0670.2957.3867.29↑9.70
COLA (DeBERTa-large)71.1859.0068.39↑6.7769.4156.1266.32↑5.29
+ +Table 1: Performance of all frameworks on the validation and testing set of the COPES dataset. COLA is our model. We abbreviate Accuracy, F1-score, Macro F1-score to Acc, F1, Ma-F1, respectively. We test COLA with the temporal predictor based on different models: BERT-base/large, RoBERTa-base/large, and DeBERTa-base/large. Compared with ROCK, improvements of our frameworks are shown under $\Delta_{Acc}$ for each language model, respectively. + +test different language models for the temporal predictor: BERT-base/large, RoBERTa-base/large, and DeBERTa-base/large. + +# 7 Main Evaluation + +We provide results in Table 1 for baselines and COLA with the temporal predictor based on different language models. In general, COLA can detect commonsense causal relations more accurately, outperforming all baseline models by a large margin. Our framework COLA based on DeBERTa-large and DeBERTa-base (also BERT-large) achieves the best performance on the validation and testing set, respectively. Also, changing language models of the temporal predictor in COLA only involves a small fluctuation in performance, showing that our framework is robust to underlying language models. + +Another observation is that CLM Perplexity and ClozePromptScore can achieve performance higher than the random result. This manifests that pre-trained language models with commonly used pre-training objectives can capture commonsense causal relations to some extent. + +# 7.1 Ablation Study + +In this section, we conduct four ablation experiments to demonstrate that our causal inference-motivated framework can mitigate spurious correlations between events and boost performance. + +Temporal Propensity Matching The first three ablation experiments prove the effectiveness of temporal propensity matching. Here, we separately remove three modules in our framework: (i) We drop the multistamp covariate sampler and sample covariates only based on the last timestamp $(\diamond \mathrm{w / o}$ Multi Step). This experiment verifies the benefit of utilizing context to detect commonsense causality. (ii) We remove all interventions $(\diamond \mathrm{w / o})$ Inter) and use temporal precedence as causation: $\hat{\Delta}_i = \mathbb{P}(\mathsf{E}_i\prec \mathsf{E}_n)$ , equivalent to $\epsilon = 0$ in Equation (7). (iii) Covariates are removed $(\diamond \mathrm{w / o}$ Cov) so that interventions are not adjusted. This unadjusted score keeps all sampled interventions, equivalent to $\epsilon = 1$ in Equation (7). + +From the results in Table 2, we observe that balanced estimand $\hat{\Delta}_i$ achieve better performances, showing that multiple timestamp sampling, treat + +![](images/9a1931fcfa78bbfeb5f2c1bded4adeb0188f32a89b5255f41d4d0ac65bf32641.jpg) +Figure 3: F1-score of COLA ("Ours") with $\epsilon$ ranging from 0 to 0.5. We also compare our framework with baselines ClozePromptScore ("CPS") and ROCK. Balancing covariates in our framework can significantly outperform unbalanced variants ( $\epsilon \approx 0.5$ ). + +
ModelsAccF1Ma-F1ΔAcc
Ours(BERT-large)70.2957.3867.29-
◇ w/o Multi Step70.0056.9666.97↓0.29
◇ w/o Inter60.2943.0456.28↓10.00
◇ w/o Cov57.6539.2453.37↓12.64
◇ w/o Temp64.4148.9560.82↓5.88
Ours(RoBERTa-large)70.0056.9666.97-
◇ w/o Multi Step67.9454.0164.70↓2.06
◇ w/o Inter64.7149.3761.14↓5.29
◇ w/o Cov58.5340.5154.34↓11.47
◇ w/o Temp65.0049.7961.46↓5.00
Ours(DeBERTa-large)69.4156.1266.32-
◇ w/o Multi Step68.2454.4365.03↓1.17
◇ w/o Inter67.6553.5964.38↓1.76
◇ w/o Cov55.8836.7151.42↓13.53
◇ w/o Temp64.4148.9560.82↓5.00
+ +ment effect, and balancing covariates play essential roles in detecting commonsense causation accurately. Removing any of the three modules will result in sheer drops in all metrics. These experiments imply that temporal relation is vital in Contextualized CCR, but it is still insufficient due to spurious correlations. Thus, we need to measure average treatment effect with balancing covariates. + +Temporal Predictor We also ablate the temporal predictor ( $\diamond$ w/o Temp) to verify the effectiveness of temporal fine-tuning (in Section 5). Here, we use pre-trained language models and increase $k$ to 30 to mitigate the problem of low coverage. + +As shown in Table 2, a directly pre-trained language model without fine-tuning cannot perform well. We conclude that pre-trained language mod + +Table 2: Ablation study on COLA ("Ours"). The column $\Delta_{Acc}$ indicates accuracy drops. The first three experiments show the effectiveness of temporal propensity matching and the last one is about temporal predictor. + +
ModelsAccF1Ma-F1ΔAcc
Uni (BERT-large)70.2957.3867.29-
Int (BERT-large)68.8254.8965.54↓1.47
Uni (RoBERTa-large)70.0056.9666.97-
Int (RoBERTa-large)68.8254.8965.54↓1.18
Uni (DeBERTa-large)69.4156.1266.32-
Int (DeBERTa-large)68.8254.8965.54↓0.59
+ +Table 3: Comparison of the different covariate sampling methods. Uni and Int stand for "Union" and "Intersection," respectively. + +els do not have sufficient "temporal awareness" and temporal fine-tuning is necessary for our framework. + +# 7.2 Rules-of-thumb for Choosing $\epsilon$ : + +The hyperparameter $\epsilon$ controls the number of interventions when balancing covariates in Equation (7). In Figure 3, we can observe that a recommended range for $\epsilon$ is $\epsilon \in [0,0.1]$ . We also list the optimal $\epsilon$ in Appendix A.3. From Table 6, $\epsilon$ should be fairly small within [0.001, 0.015]. Though the best solution relies on how to implement the components in COLA and data distribution, our analysis can provide a good starting point. We also study the effect of changing another important hyperparameter: covariate set size $N = |\mathcal{X}|$ , in Appendix C. + +# 7.3 Union and Intersection + +Our framework COLA samples covariates from multiple timestamps and take union on them to get the final covariate set. We also introduce another method to sample covariates preceding all timestamps after and including $E_{i}$ ("intersection") in Section 5. Here, we conduct experiments to discuss the differences between these two methods. For the "intersection" method, we also use + +
ModelsAccF1Ma-F1
ChatGPT75.8360.2771.45
ChatGPT w/o k73.3362.7971.01
COLA (DeBERTa-large)80.0065.7175.80
+ +Table 4: Comparison with ChatGPT. Our model outperforms ChatGPT with much fewer parameters. + +GPT-J to sample covariates with "There are temporally ordered events $[E_i, E_{i+1}, \ldots, E_n]$ . Before all events," being the prompt template. + +As shown in Table 3, the "union" method gets better performance since it can diversify covariate sets. It samples covariates conditioned on each event before $E_{i}$ separately. Meantime, each covariate of the "intersection" method is only conditioned on the same context $E_{i}, E_{i+1}, \ldots, E_{n}$ . We compute the self-BLEU (Zhu et al., 2018) to evaluate the diversity of the generated covariates. The self-BLEU of the "intersection" method is $66.40\%$ while that of the "union" method is $41.34\%$ , quantitatively showing that our method can diversify the covariate set. + +# 7.4 Comparison with ChatGPT + +Large language models have shown strong performance on extensive NLP tasks (Radford et al., 2019; Ouyang et al., 2022). Thus, we compare our framework with ChatGPT3, the latest large language model trained using Reinforcement Learning from Human Feedback (RLHF). To adopt ChatGPT to our task, we design the prompt template: "Given a story as a chain of events $E_{1}, E_{2}, \ldots, E_{n}$ , which $k$ event(s) in the first $n - 1$ events more plausibly cause the last event?" where $k$ is the number of positive events in the ground truth. We randomly sample 120 examples within 30 event sequences from our dataset COPES and manually read predicted labels from ChatGPT's answers. We also test ChatGPT without providing the number $k$ , i.e., removing $k$ from the prompt. + +The experimental result in the selected 120 examples is shown in Table 4. From the table, we can find that providing ChatGPT with the number $k$ does not lead to too much change in all metrics. (More discussion about this in Appendix F) Also, our framework COLA achieves better zero-shot performance than ChatGPT with much fewer parameters. + +# 8 Conclusion + +In this paper, we design a new task to consider the context when detecting commonsense causal relations. We also crowd-sourced a dataset with strict quality control to benchmark the task. Our COLA framework is motivated by the principles of causal inference and attempts to leverage context information. The extensive evaluation demonstrates the effectiveness of COLA for detecting commonsense causal relations. + +# 9 Acknowledgement + +The authors of this paper were supported by the NSFC Fund (U20B2053) from the NSFC of China, the RIF (R6020-19 and R6021-20) and the GRF (16211520 and 16205322) from RGC of Hong Kong, the MHKJFS (MHP/001/19) from ITC of Hong Kong and the National Key R&D Program of China (2019YFE0198200) with special thanks to HKMAAC and CUSBLT. This paper was also supported by the Tencent Rhinobird Focused Research Program. We also thank the support from NVIDIA AI Technology Center (NVAITC) and the UGC Research Matching Grants (RMGS20EG01-D, RMGS20CR11, RMGS20CR12, RMGS20EG19, RMGS20EG21, RMGS23CR05, RMGS23EG08). + +# Limitations + +Our COLA framework is mainly based on pretrained language models, such as GPT-J and PolyJuice. We only utilize the simplest prompt to sample covariates and interventions. Further efforts such as prompt engineering are expected to boost the performance of COLA further. Also, pre-trained language models can be biased by implicit events and reporting biases in their training data. Such biases lead the framework to omit some critical covariates and interventions, hindering our framework from achieving more accurate detection of commonsense causal relations. How to account for this problem of language model remains to be studied. Last but not least, the temporal propensity used in our framework is only an approximation of the exact propensity (Zhang et al., 2022c) since it is unclear how to pack an unordered set of covariates into a sequential input for language models. Further studies are needed to design the exact propensity and improve performance. + +# Ethics Statement + +This work presents COPEs, a free and open dataset for the research community to study the contextualized CCR problem. Examples in COPEs are collected from ROCStories (Mostafazadeh et al., 2016), a free and open dataset about anonymized chains of events. Each chain logically follows every day topics and does not involve privacy problems about any specific entities (e.g., a person or company). We carried out human annotation on Amazon Mechanical Turk. Annotators are fairly paid 1.2 USD for each HIT, which fulfills the minimum wage requirement. + +# References + +Amal Alabdulkarim, Siyan Li, and Xiangyu Peng. 2021. Automatic story generation: Challenges and attempts. In Proceedings of the Third Workshop on Narrative Understanding, pages 72-83. +Chandra Bhagavatula, Ronan Le Bras, Chaitanya Malaviya, Keisuke Sakaguchi, Ari Holtzman, Hannah Rashkin, Doug Downey, Wen-tau Yih, and Yejin Choi. 2019. Abductive commonsense reasoning. In International Conference on Learning Representations. +Nathanael Chambers and Dan Jurafsky. 2008. Unsupervised learning of narrative event chains. In Proceedings of ACL-08: HLT, pages 789-797. +Du-Seong Chang and Key-Sun Choi. 2005. Causal relation extraction using cue phrase and lexical pair probabilities. In International Conference on Natural Language Processing, pages 61-70. Springer. +Muhao Chen, Hongming Zhang, Qiang Ning, Manling Li, Heng Ji, Kathleen McKeown, and Dan Roth. 2021. Event-centric 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: Tutorial Abstracts, pages 6-14. +Muhao Chen, Hongming Zhang, Haoyu Wang, and Dan Roth. 2020. What are you trying to do? semantic typing of event processes. In Proceedings of the 24th Conference on Computational Natural Language Learning, pages 531-542. +William G Cochran and S Paul Chambers. 1965. The planning of observational studies of human populations. Journal of the Royal Statistical Society. Series A (General), 128(2):234-266. +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. +Quang Do, Yee Seng Chan, and Dan Roth. 2011. Minimally supervised event causality identification. In Proceedings of the 2011 Conference on Empirical Methods in Natural Language Processing, pages 294-303. +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. 2022. Causal inference in natural language processing: Estimation, prediction, interpretation and beyond. Transactions of the Association for Computational Linguistics, 10:1138-1158. +Ronald A Fisher. 1958. Cancer and smoking. Nature, 182(4635):596-596. +Joseph L Fleiss. 1971. Measuring nominal scale agreement among many raters. *Psychological bulletin*, 76(5):378. + +Leo Gao, Stella Biderman, Sid Black, Laurence Golding, Travis Hoppe, Charles Foster, Jason Phang, Horace He, Anish Thite, Noa Nabeshima, et al. 2020. The pile: An 800gb dataset of diverse text for language modeling. arXiv preprint arXiv:2101.00027. +Matt Gardner, Yoav Artzi, Victoria Basmov, Jonathan Berant, Ben Bogin, Sihao Chen, Pradeep Dasigi, Dheeru Dua, Yanai Elazar, Ananth Gottumukkala, et al. 2020. Evaluating models' local decision boundaries via contrast sets. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 1307-1323. +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. ACL 2018, page 1. +Deepanway Ghosal, Pengfei Hong, Siqi Shen, Navonil Majumder, Rada Mihalcea, and Soujanya Poria. 2021. Cider: Commonsense inference for dialogue explanation and reasoning. In Proceedings of the 22nd Annual Meeting of the Special Interest Group on Discourse and Dialogue, pages 301-313. +Georgios Giannarakis, Vasileios Sitokonstantinou, Roxanne Suzette Lorilla, and Charalampos Kontoes. 2022. Towards assessing agricultural land suitability with causal machine learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 1442-1452. +Andrew Gordon, Zornitsa Kozareva, and Melissa Roemmele. 2012. Semeval-2012 task 7: Choice of plausible alternatives: An evaluation of commonsense causal reasoning. 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), pages 394-398. +Clive WJ Granger. 1969. Investigating causal relations by econometric models and cross-spectral methods. *Econometrica: journal of the Econometric Society*, pages 424-438. +Mark Granroth-Wilding and Stephen Clark. 2016. What happens next? event prediction using a compositional neural network model. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 30. +Mingyue Han and Yinglin Wang. 2021. Doing good or doing right? exploring the weakness of commonsense causal reasoning 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 2: Short Papers), pages 151-157. +Pengcheng He, Xiaodong Liu, Jianfeng Gao, and Weizhu Chen. 2020. Deberta: Decoding-enhanced bert with disentangled attention. In International Conference on Learning Representations. + +James J Heckman. 2005. Rejoinder: response to sobel. Sociological Methodology, 35(1):135-150. +Paul W Holland. 1986. Statistics and causal inference. Journal of the American statistical Association, 81(396):945-960. +Lifu Huang, Heng Ji, Kyunghyun Cho, Ido Dagan, Sebastian Riedel, and Clare Voss. 2018. Zero-shot transfer learning for event extraction. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2160-2170. +Guido W Imbens and Donald B Rubin. 2015. Causal inference in statistics, social, and biomedical sciences. Cambridge University Press. +Dan Iter, Kelvin Guu, Larry Lansing, and Dan Jurafsky. 2020. Pretraining with contrastive sentence objectives improves discourse performance of language models. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4859-4870. +Zijian Jin, Xingyu Zhang, Mo Yu, and Lifu Huang. 2022. Probing script knowledge from pre-trained models. arXiv preprint arXiv:2204.10176. +Dongyeop Kang, Varun Gangal, Ang Lu, Zheng Chen, and Eduard Hovy. 2017. Detecting and explaining causes from text for a time series event. arXiv preprint arXiv:1707.08852. +Pride Kavumba, Naoya Inoue, Benjamin Heinzerling, Keshav Singh, Paul Reisert, and Kentaro Inui. 2019. When choosing plausible alternatives, clever hans can be clever. In Proceedings of the First Workshop on Commonsense Inference in Natural Language Processing, pages 33-42. +Katherine A Keith, David Jensen, and Brendan O'Connor. 2020. Text and causal inference: A review of using text to remove confounding from causal estimates. arXiv preprint arXiv:2005.00649. +Viet Dac Lai, Thien Huu Nguyen, and Franck Dernoncourt. 2020. Extensively matching for few-shot learning event detection. In Proceedings of the First Joint Workshop on Narrative Understanding, Storylines, and Events, pages 38-45. +Zizheng Lin, Hongming Zhang, and Yangqiu Song. 2023. Global constraints with prompting for zero-shot event argument classification. In *Findings of the Association for Computational Linguistics: EACL* 2023, pages 2482-2493. +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. + +Paramita Mirza, Rachele Sprugnoli, Sara Tonelli, and Manuela Speranza. 2014. Annotating causality in the tempeval-3 corpus. In Proceedings of the EACL 2014 Workshop on Computational Approaches to Causality in Language (CAtoCL), pages 10-19. +Paramita Mirza and Sara Tonelli. 2014. An analysis of causality between events and its relation to temporal information. In Proceedings of COLING 2014, the 25th International Conference on Computational Linguistics: Technical Papers, pages 2097-2106. +Nasrin Mostafazadeh, Nathanael Chambers, Xiaodong He, Devi Parikh, Dhruv Batra, Lucy Vanderwende, Pushmeet Kohli, and James Allen. 2016. A corpus and cloze evaluation for deeper understanding of commonsense stories. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 839-849. +Nasrin Mostafazadeh, Aditya Kalyanpur, Lori Moon, David Buchanan, Lauren Berkowitz, Or Biran, and Jennifer Chu-Carroll. 2020. Glucose: Generalized and contextualized story explanations. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 4569-4586. +Qiang Ning, Zhili Feng, Hao Wu, and Dan Roth. 2019. Joint reasoning for temporal and causal relations. arXiv preprint arXiv:1906.04941. +Qiang Ning, Hao Wu, and Dan Roth. 2018. A multi-axis annotation scheme for event temporal relations. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1318-1328. +Long Ouyang, Jeff Wu, Xu Jiang, Diogo Almeida, Carroll L Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, et al. 2022. Training language models to follow instructions with human feedback. arXiv preprint arXiv:2203.02155. +Judea Pearl. 1995. Causal diagrams for empirical research. Biometrika, 82(4):669-688. +Lianhui Qin, Antoine Bosselut, Ari Holtzman, Chandra Bhagavatula, Elizabeth Clark, and Yejin Choi. 2019. Counterfactual story reasoning and 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 5043-5053. +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. +Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J Liu, et al. 2020. Exploring the limits of transfer learning with a unified text-to-text transformer. J. Mach. Learn. Res., 21(140):1-67. + +Hannah Rashkin, Maarten Sap, Emily Allaway, Noah A Smith, and Yejin Choi. 2018. Event2mind: Commonsense inference on events, intents, and reactions. arXiv preprint arXiv:1805.06939. +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. +James Robins. 1986. A new approach to causal inference in mortality studies with a sustained exposure period—application to control of the healthy worker survivor effect. *Mathematical modelling*, 7(9-12):1393-1512. +Paul R Rosenbaum. 2002. Observational studies. In *Observational Studies*, pages 1-17. Springer. +Paul R Rosenbaum and Donald B Rubin. 1983. The central role of the propensity score in observational studies for causal effects. Biometrika, 70(1):41-55. +Donald B Rubin. 1974. Estimating causal effects of treatments in randomized and nonrandomized studies. Journal of educational Psychology, 66(5):688. +Donald B Rubin. 1980. Bias reduction using mahalanobis-metric matching. Biometrics, pages 293-298. +Donald B Rubin. 2005. Causal inference using potential outcomes: Design, modeling, decisions. Journal of the American Statistical Association, 100(469):322-331. +Maarten Sap, Hannah Rashkin, Derek Chen, Ronan Le Bras, and Yejin Choi. 2019. Social iqa: Commonsense reasoning about social interactions. 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 4463-4473. +Maarten Sap, Vered Shwartz, Antoine Bosselut, Yejin Choi, and Dan Roth. 2020. Commonsense reasoning for natural language processing. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics: Tutorial Abstracts, pages 27-33. +Vered Shwartz, Peter West, Ronan Le Bras, Chandra Bhagavatula, and Yejin Choi. 2020. Unsupervised commonsense question answering with self-talk. arXiv preprint arXiv:2004.05483. +Jerzy Splawa-Neyman, Dorota M Dabrowska, and TP Speed. 1990. On the application of probability theory to agricultural experiments. essay on principles. section 9. Statistical Science, pages 465-472. +Ieva Staliūnaitē, Philip John Gorinski, and Ignacio Iacobacci. 2021. Improving commonsense causal reasoning by adversarial training and data augmentation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 13834-13842. + +Alexandre Tamborrino, Nicola Pellicanò, Baptiste Pannier, Pascal Voitot, and Louise Naudin. 2020. Pretraining is (almost) all you need: An application to commonsense reasoning. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 3878-3887. +Ben Wang and Aran Komatsuzaki. 2021. GPT-J-6B: A 6 Billion Parameter Autoregressive Language Model. https://github.com/kingoflolz/mesh-transformer-jax. +Haoyu Wang, Muhao Chen, Hongming Zhang, and Dan Roth. 2020. Joint constrained learning for event-event relation extraction. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 696-706. +Yuxin Wang, Jieru Lin, Zhiwei Yu, Wei Hu, and Borje F Karlsson. 2022a. Open-world story generation with structured knowledge enhancement: A comprehensive survey. arXiv preprint arXiv:2212.04634. +Zhaowei Wang, Hongming Zhang, Tianqing Fang, Yangqiu Song, Ginny Wong, and Simon See. 2022b. SubeventWriter: Iterative sub-event sequence generation with coherence controller. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 1590-1604, Abu Dhabi, United Arab Emirates. Association for Computational Linguistics. +Tongshuang Wu, Marco Tulio Ribeiro, Jeffrey Heer, and Daniel S Weld. 2021. Polyjuice: Generating counterfactuals for explaining, evaluating, and improving 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 6707-6723. +Bo Zhang and Jiayao Zhang. 2021. Some reflections on drawing causal inference using textual data: Parallels between human subjects and organized texts. In First Conference on Causal Learning and Reasoning. +Hongming Zhang, Muhao Chen, Haoyu Wang, Yangqiu Song, and Dan Roth. 2020a. Analogous process structure induction for sub-event sequence prediction. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1541-1550. +Hongming Zhang, Xin Liu, Haojie Pan, Haowen Ke, Jiefu Ou, Tianqing Fang, and Yangqiu Song. 2022a. Aser: Towards large-scale commonsense knowledge acquisition via higher-order selectional preference over eventualities. Artificial Intelligence, page 103740. +Hongming Zhang, Xin Liu, Haojie Pan, Yangqiu Song, and Cane Wing-Ki Leung. 2020b. A larger-scale eventuality knowledge graph. In Proceedings of the web conference 2020, pages 201-211. + +Hongming Zhang, Wenlin Yao, and Dong Yu. 2022b. Efficient zero-shot event extraction with context-definition alignment. In Findings of the Association for Computational Linguistics: EMNLP 2022, pages 7169-7179, Abu Dhabi, United Arab Emirates. Association for Computational Linguistics. +Jiayao Zhang, Hongming Zhang, Weijie Su, and Dan Roth. 2022c. Rock: Causal inference principles for reasoning about commonsense causality. In International Conference on Machine Learning, pages 26750-26771. PMLR. +Junhao Zheng, Zhanxian Liang, Haibin Chen, and Qianli Ma. 2022. Distilling causal effect from miscellaneous other-class for continual named entity recognition. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing (EMNLP). +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. +Yaoming Zhu, Sidi Lu, Lei Zheng, Jiaxian Guo, Weinan Zhang, Jun Wang, and Yong Yu. 2018. Texygen: A benchmarking platform for text generation models. In The 41st International ACM SIGIR Conference on Research & Development in Information Retrieval, pages 1097-1100. + +
ModelsValid AccTest Acc
Ours(BERT-base)87.1085.81
Ours(BERT-large)88.9387.38
Ours(RoBERTa-base)89.7688.97
Ours(RoBERTa-large)91.9191.10
Ours(DeBERTa-base)90.0789.06
Ours(DeBERTa-large)93.1092.40
+ +# A Implementation Details + +In this appendix, we introduce the implementation details of every component in our framework COLA. We conduct all experiments on 8 NVIDIA A100 GPUs. Since our COLA and baselines are zero-shot, we test each model once and report the results. + +Parameter Number We list parameter numbers of all pre-trained language models here. BERT-base/large, RoBERTa-base/large, and DeBERTa-base/large have 110M, 340M, 125M, 355M, 100M, and 350M parameters, respectively. GPT, GPT-medium/large/XL, and GPT-6b contain 117M, 345M, 774M, 1.5B, and 6B parameters, respectively. + +# A.1 Temporal Predictor + +We fine-tune temporal predictors based on BERT-base/large, RoBERTa-base/large, and DeBERTa-base/large for ten epochs. The learning rate is 1e-5, and the batch size is 256. We sampled 800k examples (event pairs) from ROCStories (Mostafazadeh et al., 2016) to build a temporal relation dataset. The ROCStories dataset contains about 100k temporally ordered event sequences. The proportion of training, validation, and testing splits of our sampled event pairs are 98:1:1. We show the accuracy of each fine-tuned temporal predictor on the validation and testing splits in Table 5. + +# A.2 Intervention and Covariate + +For each event pair, we sample 50 covariates using GPT-J with a maximum length of generated events of 15 and a temperature of 0.9. We also sample 50 interventions using PolyJuice with a maximum length of generated events of 40 and a temperature of 1.0. + +PolyJuice provided various control codes to manipulate events in various manners. The full list of control codes is negation, lexical, resemantic, quantifier, insert, + +Table 5: The accuracy of each temporal predictor on the validation and testing splits of the temporal relation dataset. + +
ModelsBest ε
Ours(BERT-large)0.006
Ours(RoBERTa-large)0.001
Ours(DeBERTa-large)0.014
+ +Table 6: The best $\epsilon$ for our framework COLA with the temporal predictor based on different language models. + +![](images/e372d0d1d56b18b9cce75e8ee557d717ac64c92464f2fe0c112b6fc524913328.jpg) +Figure 4: Accuracy of COLA ("Ours") with different covariate set size $N$ . Increasing covariate set size improves performance with a reasonable $\epsilon$ , such as 0.001, 0.003, and 0.01. + +restructure, shuffle, and delete. We only use resemantic, negation, lexical, quantifier, insert, delete to generate interventions since restructure and shuffle do not generate counterfactual events. + +# A.3 Temporal Propensity Threshold $\epsilon$ + +In this section, we list the best temporal propensity threshold $\epsilon$ for our framework COLA with the temporal predictor based on different language models in Table 6. + +# B Probability Approximation + +Our approximation of the probability of a covariate $\mathbb{P}(X(0))$ in Section 5 is a consequence of the efficiency trade-off. Notice that even though a covariate $X$ is an event preceding $\mathsf{E}_i$ sampled by GPT-J, it can occur before other events. Strictly, we must enumerate all possible events $E$ , compute $\mathbb{P}(\mathsf{X}\prec \mathsf{E})$ , and marginalize out $E$ . Here, we assume $\mathbb{P}(E(1)|X(0))\approx 1$ to compute $\mathbb{P}(X(0))$ efficiently. We approximately have: + +$$ +\begin{array}{l} \mathbb {P} (X \prec E) = \mathbb {P} (X (0), E (1)) \\ = \mathbb {P} (X (0)) \mathbb {P} (E (1) | X (0)) \tag {10} \\ \approx \mathbb {P} (X (0)) \\ \end{array} +$$ + +# C Number of Covariates + +We show that balancing covariates are essential in our framework COLA. Meanwhile, the number + +of covariates also has an impact on performance. Here we test different covariate set size $N = |\mathcal{X}|$ spanning from 10 to 40, shown in Figure 4 with various $\epsilon$ values. + +We observe that gradually increasing the covariate set size $N$ can enhance the performance of our framework when the $\epsilon$ is within [0.001, 0.01] as we recommend in Section 7.2. On the other hand, adding more covariates may introduce more noise if we test with a larger $\epsilon$ . For example, when $\epsilon$ equals 0.02 and 0.025, increasing covariates only brings about fluctuations in accuracy. + +# D Dataset Annotation + +Since our work is the first attempt to study Contextualized CCR, we carried out human annotation on Amazon Mechanical Turk to construct a new dataset. In this appendix, we discuss the annotation process of the dataset COPES in our paper. We randomly sampled event sequences from ROCStories (Mostafazadeh et al., 2016), where each sequence contains five chronologically ordered events. Workers are provided with event sequences and are asked to annotate whether an event causes the last event in a sequence4. Each human intelligence task (HIT) includes ten potential (cause, effect) event pairs (with corresponding event sequences), and each pair is labeled by seven workers. We take the majority vote among seven votes as the final result for each pair. + +We conduct two qualification tests to choose workers to maintain rigorous quality control. First, we invited annotators who meet the following conditions to take our qualification examinations: 1) an approval rate of at least $95\%$ and 2) at least a thousand approved HITs. In the second round, a qualification question set including both effortless and tricky examples is collected by experts, namely the authors of this paper, who have a clear understanding of Contextualized CCR. The experts annotate 160 event pairs sampled from ROCStories. An annotator needs to answer a HIT involving ten questions from the qualification set, and the answers are compared with the experts' answers. An annotator should correctly answer 8 out of 10 questions to pass the second round test. While 307 annotators participated in the second round qualification test, only 29 $(9.45\%)$ were selected as our main round annotators. + +Eventually, we collected the dataset containing + +
#Causal Relation0123Total
#Seq1219212412340
Proportion (%)3.556.536.53.5100
+ +Table 7: The breakdown of numbers of causal relations in all event sequences in the COPEs dataset. Most event sequences (56.6%) own only one causal relation. + +human-annotated labels for 1,360 pairs from 340 event sequences $(1360 = 340 \times 4)$ , called Choice of Plausible Event in Sequence (COPES). The IAA score is $61.13\%$ calculated using pairwise agreement proportion, and Fleiss's $\kappa$ (Fleiss, 1971) is 0.52. We equally divide them into a validation set and a testing set (e.g., each contains 680 examples). We also provide a screenshot of our annotation platform in Figure 5. + +# D.1 Dataset Statistics + +Here we provide the breakdown of numbers of causal relations $k$ in all 340 event sequences in Table 7. Also, 476 event pairs are positive (with causal relation), and 884 are negative (without causal relation). + +# E Normalization + +In this section, we enumerate some methods to normalize estimand $\hat{\Delta}$ and temporal propensity vectors in Equation (7). + +Direct Matching (D): Instead of condition probability in Equation (9), we can directly use the vectors of temporal relation scores $(f(\mathsf{A},\mathsf{X}))_{\mathsf{X}\in \mathcal{X}}$ as propensity vectors. + +Score Simplification (S): We fine-tune temporal predictors to prompt before, after, and [none], which might be difficult for smaller Masked LMs, like BERT-base. When constructing propensity vectors, we simplify the task to consider only before, after by normalizing scores: + +$$ +f (\mathsf {X}, \mathsf {A}) = \frac {f _ {b} (\mathsf {X} , \mathsf {A}) + f _ {a} (\mathsf {A} , \mathsf {X})}{f _ {b} (\mathsf {X} , \mathsf {A}) + f _ {a} (\mathsf {X} , \mathsf {A}) + f _ {b} (\mathsf {A} , \mathsf {X}) + f _ {a} (\mathsf {A} , \mathsf {X})} +$$ + +Propensity Covariate Normalization (Q): We also try to normalize temporal relation scores on the covariate set $\mathcal{X}$ before building propensity vectors: $\mathbb{P}(X) = f(\mathsf{X},\mathsf{E}_i) / \sum_{\mathsf{X}'\in \mathcal{X}}f(\mathsf{X}',\mathsf{E}_i)$ and $\mathbb{P}(X,A) = f(\mathsf{X},\mathsf{A}) / \sum_{\mathsf{X}'\in \mathcal{X}}f(\mathsf{X}',\mathsf{A})$ + +Co-occurrence Normalization (C): The finetuned temporal predictor may sometimes still faces + +
ModelsAccF1Ma-F1
Ours(BERT-base)68.8255.2765.67
◇w/o S↓0.59↓0.84↓0.65
◇w/o Q↓3.24↓4.64↓3.56
◇w/o E↓5.29↓7.59↓5.83
Ours(BERT-large)70.2957.3867.29
◇w/o Q↓0.59↓0.84↓0.65
◇w/o E↓7.06↓10.13↓7.77
+ +Table 8: Ablation study of normalization methods on BERT-base and BERT-large. + +
ModelsAccF1Ma-F1
Ours(RoBERTa-base)66.7652.3263.41
◇ w/o C↓1.47↓2.11↓1.62
Ours(RoBERTa-large)70.0056.9666.97
◇ w/o S↓0.59↓0.84↓0.65
◇ w/o E↓2.06↓2.95↓2.27
+ +the problem of low coverage, causing estimates $f(\mathsf{E}_i,\mathsf{E}_n)$ and $f(\mathsf{A},\mathsf{E}_n)$ inaccurate in Equation (7). We set them to $(f(\mathsf{E}_i,\mathsf{E}_n) + f(\mathsf{E}_n,\mathsf{E}_i)) / 2$ and $(f(\mathsf{A},\mathsf{E}_n) + f(\mathsf{E}_n,\mathsf{A})) / 2$ , respectively. + +Estimand Normalization (E): In this method, estimates $f(\mathsf{E}_i,\mathsf{E}_n)$ and $f(\mathsf{A},\mathsf{E}_n)$ in estimand $\hat{\Delta}$ in Equation (7) are normalized by $f(\mathsf{E}_i,\mathsf{E}_n) + f(\mathsf{E}_n,\mathsf{E}_i)$ and $f(\mathsf{A},\mathsf{E}_n) + f(\mathsf{E}_n,\mathsf{A})$ , respectively. + +We also conduct comprehensive analyses about removing these normalizations. The results are shown in Tables 8 to 10. We present drops in every metric when removing each normalization method. Some normalization methods cannot improve performance, and we delete those rows from tables. We observe that some of these normalization methods, such as Estimand Normalization (E), can benefit our framework on Contextualized CCR. + +# F ChatGPT + +In this section, we show and discuss the result of ChatGPT on COPEs. Given the insignificant differences in performance between the prompts with and without the number $k$ in Section 7.4, we focus on the answers of the prompt with $k$ . We show three examples, respectively corresponding to three cases: + +1. ChatGPT's answer is correct (with a good explanation) + +Table 9: Ablation study of normalization methods on RoBERTa-base and RoBERTa-large. + +
ModelsAccF1Ma-F1
Ours(DeBERTa-base)70.2957.3867.29
◇w/o Q↓0.59↓0.84↓0.65
Ours(DeBERTa-large)69.4156.1266.32
◇w/o E↓1.18↓1.69↓1.30
+ +Table 10: Ablation study of normalization methods on DeBERTa-base and DeBERTa-large. + +2. ChatGPT's answer is different from the ground truth answer, but the correctness is debatable with the explanation from ChatGPT +3. ChatGPT's answer is incorrect. + +Example 1. Which event mainly/directly causes the last event? + +$\mathsf{E}_1$ : Charlie went to food truck event at the beach. + +$\mathsf{E}_2$ : He said they had a ton of trucks there. + +$\mathsf{E}_3$ : He tried food from a few trucks. + +$\mathsf{E}_4$ : He said the food was great. + +$\mathsf{E}_5$ : I am going to try to go next year. + +# Gold answer: $\mathsf{E}_4$ + +ChatGPT answer (short): E4 + +ChatGPT answer (original): The event "He said the food was great." directly causes the last event "I am going to try to go next year." as it expresses the protagonist's positive experience and desire to attend again in the future. + +Example 2. Which event mainly/directly causes the last event? + +$\mathsf{E}_1$ : Ericka enjoyed going to restaurants, but she liked to save money too. +$\mathsf{E}_2$ : She found a coupon for her favorite restaurant. +$\mathsf{E}_3$ : She went there for lunch and ordered a burger. +$\mathsf{E}_4$ : When the bill came, she was nervous about the coupon. +$E_5$ : The restaurant accepted the coupon and Ericka saved a lot of money! + +# Gold answer: $\mathsf{E}_2,\mathsf{E}_3$ + +ChatGPT answer (short): $\mathsf{E}_2, \mathsf{E}_4$ + +ChatGPT answer (original): The second and fourth events mainly/directly cause the last event. The second event ("She found a coupon for her favorite restaurant.") sets up the possibility of her saving money, and the fourth event ("When the bill came, she was nervous about the coupon.") establishes that the coupon is being used in this specific instance. Together, these two events lead to the final event ("The restaurant accepted the coupon and ericka saved a lot of money!") where she is able to save money. + +# Question Story + +(1) I woke up feeling very sick. +(2) I had a fever, aches, and a runny nose. +(3) I went to the doctor to find out what was wrong. +(4) My doctor told me that I had the flu. +- I slept a lot for three days until i finally felt better. + +Which sentence caused the ending that is marked in red? (NONE if no sentence is a reasonable cause/enabling factor) + +(1) I woke up feeling very sick. +(2) I had a fever, aches, and a runny nose. +(3) I went to the doctor to find out what was wrong. +(4) My doctor told me that I had the flu. +□None of the above + +Figure 5: A screenshot of our annotation platform. + +Example 3. Which event mainly/directly causes the last event? + +$\mathsf{E}_1$ : We decided to get married on the beach. +$\mathsf{E}_2$ : Our family and friends met us there. +$\mathsf{E}_3$ : It was a perfectly sunny summer day. +$\mathsf{E}_4$ : Best of all, no one had to wear shoes!. +$E_5$ : We ended our day with a dip in the cool ocean. + +Gold answer: $\mathsf{E}_1$ + +ChatGPT answer (short): $\mathsf{E}_4$ + +ChatGPT answer (original): The fourth event "Best of all, no one had to wear shoes!" mainly/directly causes the last event "We ended our day with a dip in the cool ocean." as it describes the condition that allowed the last event to happen: people were barefoot. + +In most cases, ChatGPT clearly explains its choices. For example, in the Example 1, it points out the positive emotion "... food was great." as the underlying fact that causes the last event "... going to try to go next year." (i.e., decision). Similarly in the Example 2, even though ChatGPT's answer is different from the ground truth answer, ChatGPT mentions two key points "... The second event ... sets up the possibility of..." (i.e., potential) and "... the forth event ... establishes that the coupon is being used ..." (i.e., action) that together causes the last event (i.e., effect). The reasoning paradigm implicit in its explanation, e.g. emotion $\rightarrow$ decision and potential $+$ action $\rightarrow$ effect in the abovementioned two examples, implies the inherent reasoning capability of ChatGPT. Nonetheless, there are + +cases where ChatGPT fails to give a persuasive answer. However, as a foundation model instead of a task model, ChatGPT's performance is fair enough. + +A For every submission: + +A1. Did you describe the limitations of your work? + +In the Section Limitations, we discuss the limitations of our work. + +A2. Did you discuss any potential risks of your work? + +In the Section Ethics Statement, we discuss the ethical considerations, including privacy problems. + +A3. Do the abstract and introduction summarize the paper's main claims? + +Abstract and Section 1 + +A4. Have you used AI writing assistants when working on this paper? + +Left blank. + +B Did you use or create scientific artifacts? + +We annotate new datasets based on a previous dataset (Section 6, Appendix B, and Appendix D) and a new model (Section 4 and Section 5). + +B1. Did you cite the creators of artifacts you used? + +We cite the previous dataset a few times in Section 6, Appendix B, Appendix D. + +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? + +The artifacts we use is open sourced without a license. + +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +Not applicable. No intended use is stated for the existing artifact(s) in our paper. + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? + +The artifact we use is already anonymized. + +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? + +The Section Ethics Statement. + +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. + +Section 6, Appendix B, and Appendix D. + +C Did you run computational experiments? + +Sections 6 and 7. + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +Section 6 and Appendix B. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? Appendix B. +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? +Appendix B. +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? Section 6 and Appendix B. + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? Section 6 and Appendix D. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? Appendix D +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? Section 6, Section Ethics Statement, and Appendix D. +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? Section 6 and Appendix D. +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? Not applicable. For anonymity. +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? Not applicable. For anonymity. \ No newline at end of file diff --git a/colacontextualizedcommonsensecausalreasoningfromthecausalinferenceperspective/images.zip b/colacontextualizedcommonsensecausalreasoningfromthecausalinferenceperspective/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..ef7718c086d11bb65e56567a356297d93947d490 --- /dev/null +++ b/colacontextualizedcommonsensecausalreasoningfromthecausalinferenceperspective/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d5350e591f58d6e56a97e77aec1ab9f47dd9c8c5d3be331dfc371a9d8046400 +size 642340 diff --git a/colacontextualizedcommonsensecausalreasoningfromthecausalinferenceperspective/layout.json b/colacontextualizedcommonsensecausalreasoningfromthecausalinferenceperspective/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..98516f2e6f55adbc8a0e70d3441f8ad4e79bf752 --- /dev/null +++ b/colacontextualizedcommonsensecausalreasoningfromthecausalinferenceperspective/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f6dcd67ba623f0f72f5e74c8a5a1959493dd5c01bd058756b8a451c85b5ff9e2 +size 737960 diff --git a/coladaacollaborativelabeldenoisingframeworkforcrosslingualnamedentityrecognition/676a439c-82ad-4054-9ec5-e366943906e0_content_list.json b/coladaacollaborativelabeldenoisingframeworkforcrosslingualnamedentityrecognition/676a439c-82ad-4054-9ec5-e366943906e0_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..e7f1ce806fe2628bc78aab556b2a112ce8688584 --- /dev/null +++ b/coladaacollaborativelabeldenoisingframeworkforcrosslingualnamedentityrecognition/676a439c-82ad-4054-9ec5-e366943906e0_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:870cf9f0839f1e512499a9d86d72fa6a1683e690f48e1d3c3a807c6eb431afc7 +size 104270 diff --git a/coladaacollaborativelabeldenoisingframeworkforcrosslingualnamedentityrecognition/676a439c-82ad-4054-9ec5-e366943906e0_model.json b/coladaacollaborativelabeldenoisingframeworkforcrosslingualnamedentityrecognition/676a439c-82ad-4054-9ec5-e366943906e0_model.json new file mode 100644 index 0000000000000000000000000000000000000000..8a24de8a1d6ad55cc235c7be766f683024cf2752 --- /dev/null +++ b/coladaacollaborativelabeldenoisingframeworkforcrosslingualnamedentityrecognition/676a439c-82ad-4054-9ec5-e366943906e0_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fe03b2b77d9d45bc3a48b64348e5b4ec43cf48767b5673f947ee11883451a75b +size 130074 diff --git a/coladaacollaborativelabeldenoisingframeworkforcrosslingualnamedentityrecognition/676a439c-82ad-4054-9ec5-e366943906e0_origin.pdf b/coladaacollaborativelabeldenoisingframeworkforcrosslingualnamedentityrecognition/676a439c-82ad-4054-9ec5-e366943906e0_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..febda8793c5d91c5f331d17d6408018a7a5f9bb6 --- /dev/null +++ b/coladaacollaborativelabeldenoisingframeworkforcrosslingualnamedentityrecognition/676a439c-82ad-4054-9ec5-e366943906e0_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6d0dfb91683391104782a91fa0713329a52339752efcdb395a16018afde9bc4f +size 893603 diff --git a/coladaacollaborativelabeldenoisingframeworkforcrosslingualnamedentityrecognition/full.md b/coladaacollaborativelabeldenoisingframeworkforcrosslingualnamedentityrecognition/full.md new file mode 100644 index 0000000000000000000000000000000000000000..36242d61104b539b56cff3afad138f2f2ac5198e --- /dev/null +++ b/coladaacollaborativelabeldenoisingframeworkforcrosslingualnamedentityrecognition/full.md @@ -0,0 +1,417 @@ +# CoLaDa: A Collaborative Label Denoising Framework for Cross-lingual Named Entity Recognition + +Tingting Ma $^{1*}$ , Qianhui Wu $^{2}$ , Huiqiang Jiang $^{2}$ , Börje F. Karlsson $^{2}$ , Tiejun Zhao $^{1\dagger}$ , Chin-Yew Lin $^{2}$ $^{1}$ Harbin Institute of Technology, Harbin, China $^{2}$ Microsoft hittingtingma@gmail.com +{qianhuiwu, hjiang, borjekar, cyl}@microsoft.com +tjzhao@hit.edu.cn + +# Abstract + +Cross-lingual named entity recognition (NER) aims to train an NER system that generalizes well to a target language by leveraging labeled data in a given source language. Previous work alleviates the data scarcity problem by translating source-language labeled data or performing knowledge distillation on target-language unlabeled data. However, these methods may suffer from label noise due to the automatic labeling process. In this paper, we propose CoLaDa, a Collaborative Label Denoising Framework, to address this problem. Specifically, we first explore a model-collaboration-based denoising scheme that enables models trained on different data sources to collaboratively denoise pseudo labels used by each other. We then present an instance-collaboration-based strategy that considers the label consistency of each token's neighborhood in the representation space for denoising. Experiments on different benchmark datasets show that the proposed CoLaDa achieves superior results compared to previous methods, especially when generalizing to distant languages. + +# 1 Introduction + +The named entity recognition (NER) task aims to locate and classify entity spans in a given text into predefined entity types. It is widely used for many downstream applications, such as relation extraction and question answering. Deep neural networks have made significant progress on this task leveraging large-scale human-annotated data for training. However, fine-grained token-level annotation makes it costly to collect enough high-quality labeled data, especially for low-resource languages. Such scenarios motivate the research on zero-shot cross-lingual NER, which attempts to leverage labeled data in a rich-resource source language to + +![](images/8bf28c27ff815cda0e67aa60ae3821c826809f8d7c4b95085937dd2db327d9b2.jpg) +Figure 1: Comparison between previous methods (a/b/c) and our CoLaDa at the $i$ -th iteration (d) CoLaDa starts at $\mathcal{M}_{tgt}^{0}$ and performs denoising iteratively. $\mathcal{D}_{src}$ : Source-language labeled data. $\mathcal{D}_{trans}$ : Translation data. $\mathcal{D}_{tgt}$ : Target-language unlabeled data with pseudo-labels generated by NER models. $\mathcal{M}_{src/trans/tgt}$ : NER model learned on $\mathcal{D}_{src/trans/tgt}$ . + +solve the NER task in a target language without annotated data. + +Recent attempts at cross-lingual NER can be roughly categorized from two aspects: learning language-independent features via feature alignment (Huang et al., 2019; Keung et al., 2019) and learning language-specific features from automatically labeled target-language data (Wu et al., 2020c,b). Despite bringing great success to cross-lingual NER, the former line of research misses exploiting language-specific features and thus shows substandard performance, especially when transferring to distant languages, e.g., from English to Arabic (Fu et al., 2023). Hence, a series of studies focuses on the latter category, which typically creates pseudo-labeled target-language data and uses it to perform conventional supervised learning or teacher-student learning. For example, as shown in Fig 1(a), earlier studies (Ehrmann et al., 2011; Mayhew et al., 2017; Xie et al., 2018; Jain et al., 2019), such as TMP (Jain et al., 2019), first translate labeled data in the source language and then perform label projection. Recently, several approaches have + +utilized a weak model, which could be an NER model either trained on the source language's labeled data as in TSL (Wu et al., 2020c), or further finetuned on the generated translation data as in UniTrans (Wu et al., 2020b), to annotate the unlabeled target-language data for improvement, as shown in Fig 1(b) and Fig 1(c). + +Unfortunately, these methods inevitably suffer from the label noise induced by inaccurate translation and label projection, or the weak model's limited capability. Although some methods are proposed to mitigate the label noise problem by additionally training an instance selector (Liang et al., 2021; Chen et al., 2021) or designing heuristic rules for data selection (Ni et al., 2017), they independently manipulate either the translation data $(\mathcal{D}_{trans})$ (Ni et al., 2017) or the target-language data $(\mathcal{D}_{tgt})$ pseudo-labeled by NER models trained in the source language (Liang et al., 2021; Chen et al., 2021). Hence, all these methods ignore the complementary characteristics between both for denoising. Particularly, from the text view, $\mathcal{D}_{tgt}$ is collected from a natural text distribution of the target-language data, while $\mathcal{D}_{trans}$ can be regarded as a way of data augmentation to provide more lexicon variants. From the labeling function view, labels of $\mathcal{D}_{trans}$ are obtained via the label projection algorithm, which have little association with those of $\mathcal{D}_{tgt}$ generated by NER models. + +With such consideration, we propose a model-collaboration-based denoising scheme, which incorporates models trained on both data sources to mutually denoise the pseudo-labels of both data sources in an iterative way. As shown in Fig 1(d), we first leverage $\mathcal{M}_{tgt}$ trained on the pseudolabeled target-language data $\mathcal{D}_{tgt}$ to denoise the translation data annotated by label projection. In this way, the learned model $\mathcal{M}_{trans}$ will be less affected by noise in the translation data. We then employ the improved $\mathcal{M}_{trans}$ to re-label the target-language unlabeled data $\mathcal{D}_{tgt}$ . It is expected that there is less noise in the relabeled data, and thus we can produce a more powerful $\mathcal{M}_{tgt}$ . We perform this procedure for several iterations, so that all the involved data sources and models can be improved in an upward spiral. + +Moreover, borrowing the idea from anomaly detection (Gu et al., 2019) that a given data point's neighborhood information can be used to measure its anomalousism, here we find that the similar tokens in the feature space can also collaborate for denois + +![](images/0cb7eda521894cb15442a3e63a94ffcbf00dbc6dcf0b028b0d7a5b9df9bef1fd.jpg) +Figure 2: Illustration of the instance collaboration for denoising. Different colors depict different entity types. + +ing. Previous studies (Zhai and Wu, 2019; Xu et al., 2020) have shown that instances with the same label are more likely to locate close to each other in the representation space. Our intuition is that, if a token's label conflicts a lot with labels of other tokens in its neighborhood, then this label is probably noisy. Therefore, we further propose an instance-collaboration-based denoising strategy to explore the neighborhood structure of each token for denoising, as shown in Figure 2. Specifically, we utilize the label consistency of each token's neighborhood in the representation space to re-weight the soft-labeled examples in knowledge distillation. + +We integrate the instance-collaboration-based denoising strategy into the model-collaboration-based denoising scheme and propose a Collaborative Label Denoising framework, i.e., CoLaDa, for cross-lingual NER. We conduct extensive experiments on two popular benchmarks covering six languages for evaluation. Experimental results show that our method outperforms existing state-of-the-art methods. Qualitative and quantitative analyses further demonstrate the effectiveness of our framework in reducing the data noise. + +# 2 Problem Formulation + +Here we take the typical sequence labeling formulation for the named entity recognition task. Given a sequence with $L$ tokens $\boldsymbol{x} = (x_{1},\ldots ,x_{L})$ as the input text, an NER system is excepted to assign each token $x_{i}$ with a label $y_{i}$ . + +In this paper, we assume to have the labeled training data $\mathcal{D}_{src} = \{(x^s,\pmb {y}^s)\}$ in the source language, the unlabeled data $\mathcal{D}_{tgt} = \{\pmb{x}^u\}$ from the target language, and translation data $\mathcal{D}_{trans} = \{(\pmb{x}^t,\pmb {y}^t)\}$ obtained by data projection from $\mathcal{D}_{src}$ . Our goal is to train an NER model $\mathcal{M}$ that can generalize well to the target language utilizing these resources. + +![](images/53817b23f7e831232070201d6740ac1d173e98e1103b99490e41534dca628e92.jpg) +Figure 3: Framework of CoLaDa, which is an iterative model-collaboration process with two steps: 1) Step 1: noise-robust training on translation data with the collaborator $\mathcal{M}_{tgt}^{(i - 1)}$ , 2) Step 2: noise-robust training on unlabeled target-language data with the collaborator $\mathcal{M}_{trans}^{(i)}$ . The instance-collaboration is used to re-weight the noisy labels from a teacher model in both steps. $\mathcal{M}_{trans}^{(i)} / \mathcal{M}_{tgt}^{(i)}$ : model trained on $\mathcal{D}_{trans} / \mathcal{D}_{tgt}$ at $i$ -th iteration. + +# 3 CoLaDa Framework + +Figure 3 depicts an overview of the CoLaDa framework. It is an iterative model-collaboration-based denoising framework which consists of two steps: noise-robust learning on translation data and noise-robust learning on unlabeled target-language data. An instance-collaboration-based denoising strategy (Sec 3.1) is then integrated into the model-collaboration-based denoising procedure (Sec 3.2). + +# 3.1 Instance Collaboration for Denoising + +Previous work (Zhai and Wu, 2019; Xu et al., 2020) indicates that tokens with the same labels are more likely to locate close to each other in the representation space of a deep neural network. If the label of a given token is inconsistent with lots of its neighbors, this token would be isolated from other tokens with the same label in the feature space, and hence its label is more likely to be noisy. Therefore, we propose instance-collaboration-based denoising, which evaluates the reliability of a given token's label by measuring the label consistency of its neighborhood, and then uses the reliability score to weight the noisy labels from a teacher model $\mathcal{M}$ for knowledge distillation on data $\mathcal{D} = \{\pmb{x}\}$ . Noisy labels are expected to have lower weights than clean ones. + +Create a memory bank. We leverage the feature extractor $\mathcal{F}$ of the NER model $\mathcal{M}$ to obtain the hidden representations $\pmb{h} = \{h_i\}_{i=1}^L$ of each sentence $\pmb{x} = \{x_i\}_{i=1}^L \in \mathcal{D}$ : + +$$ +\boldsymbol {h} = \mathcal {F} (\boldsymbol {x}). \tag {1} +$$ + +We then construct a memory bank $\mathcal{B}_{\mathcal{D}} = \{h\}$ to store the hidden representations of all tokens in $\mathcal{D}$ . + +Compute label consistency. Given a token $x_{i}$ , we retrieve its $K$ -nearest neighbors $\mathcal{N}_K(x_i)$ in $\mathcal{B}_{\mathcal{D}}$ using cosine similarity. Let $p_i$ denote the soft label (i.e., the probability distribution over the entity label set) assigned by the teacher model $\mathcal{M}$ for $x_{i}$ . We measure the label consistency of $x_{i}$ , i.e., $\lambda(p_i; x_i)$ , by calculating the fraction of $x_{i}$ 's neighbors that are assigned with the same labels as $x_{i}$ in $\mathcal{N}_K(x_i)$ : + +$$ +\lambda \left(p _ {i}; x _ {i}\right) = \frac {1}{K} \sum_ {x _ {j} \in \mathcal {N} _ {k} \left(x _ {i}\right)} I \left(\hat {y} _ {j} = \hat {y} _ {i}\right), \tag {2} +$$ + +where $\hat{y}_i = \arg \max (p_i)$ is the pseudo entity label corresponding to the maximum probability in $p_i$ . Similarly, $\hat{y}_j$ is the pseudo entity label corresponding to $x_j$ . $I$ is the indicator function. + +Produce a reliability score. We use the label consistency $\lambda(p_i; x_i)$ to compute the reliability score of the soft label $p_i$ , which is further used as the weight of $p_i$ during model learning (see 3.2). Considering that different entity types may contain different levels of label noise and show different statistics on label consistency, here we present a class-adaptive reliability score for weighting: + +$$ +w \left(p _ {i}; x _ {i}\right) = \text {S i g m o i d} \left(\alpha \left(\lambda \left(p _ {i}; x _ {i}\right) - \mu \left(\hat {y} _ {i}\right)\right)\right), \tag {3} +$$ + +where $\mu (\hat{y}_i)$ denote the mean of all $\lambda (p_j;x_j)$ where $\arg \max (p_j) = \hat{y}_i$ and $x_{j}\in \mathcal{D}$ . $\alpha >0$ is a hyper-parameter that controls the sharpness of the weighting strategy. If $\alpha \rightarrow 0$ , all tokens have equal weights. If $\alpha \rightarrow \infty$ , tokens whose label consistency is larger than the average label consistency w.r.t. its pseudo label will be weighted with 1 and those with smaller consistency will be dropped. + +# 3.2 Model Collaboration for Denoising + +Here we elaborate on the details of the two noise-robust training processes. Algorithm 1 depicts the overall training procedure of CoLaDa. + +Noise-robust training on translation data. Assuming the availability of a collaborator $\mathcal{M}_{tgt}^2$ trained on pseudo-labeled target-language data $\mathcal{D}_{tgt}$ , here we focus on leveraging $\mathcal{M}_{tgt}$ to reduce the label noise in the translation data $\mathcal{D}_{trans} = \{(x^t, y^t)\}$ , with which we further deliver a more powerful model $\mathcal{M}_{trans}$ . + +Specifically, given a sentence $(\pmb{x}^t,\pmb{y}^t)\in \mathcal{D}_{trans}$ we first obtain the soft label $p_i^u$ of each $x_{i}^{t}\in \pmb{x}^{t}$ from the collaborator $\mathcal{M}_{tgt}$ . Then, we take both the one hot label $y_{i}^{t}$ and the soft label $p_i^u$ as the supervision to train the model $\mathcal{M}_{trans}$ . Denote the output probability distribution of $\mathcal{M}_{trans}$ for $x_{i}^{t}$ as $\vec{p}_i^t$ . The loss function w.r.t. $\pmb{x}^t$ is defined as: + +$$ +\mathcal {L} ^ {\boldsymbol {x} ^ {t}} = \frac {1}{L} \sum_ {i = 1} ^ {L} \left(\beta_ {1} \mathrm {C E} \left(\hat {p} _ {i} ^ {t}, p _ {i} ^ {u}\right) + \beta_ {2} \mathrm {C E} \left(\hat {p} _ {i} ^ {t}, y _ {i} ^ {t}\right)\right), \tag {4} +$$ + +where $\mathrm{CE}(\cdot ,\cdot)$ denotes the cross-entropy loss, $L$ is the sentence length, $\beta_{1}$ and $\beta_{2}$ are weighting scalars. Here we further incorporate the instance-collaboration-based denoising strategy (3.1) to provide a token-level reliability evaluation to the supervision from the collaborator $\mathcal{M}_{tgt}$ via: + +$$ +\beta_ {1} \left(x _ {i} ^ {t}\right) \leftarrow \beta_ {1} * w \left(p _ {i} ^ {u}, x _ {i} ^ {t}\right), \tag {5} +$$ + +where $w(p_i^u, x_i^t)$ is calculated by Eq. (3). + +Noise-robust training on target-language unlabeled data. Here we leverage $\mathcal{M}_{trans}$ obtained via the above noise-robust training on translation data to provide high-quality supervision for + +# Algorithm 1 Pseudo code of CoLaDa. + +Input: an NER model $\mathcal{M}_{src}$ trained on $\mathcal{D}_{src}$ , translation data $\mathcal{D}_{trans}$ , the unlabeled data $\mathcal{D}_{tgt}$ , the maximum iteration T. + +1: $\mathcal{M}_{\text{tot}}^{(0)} \gets \mathcal{M}_{\text{src}}$ +2: for $i = 1, 2, \dots, T$ do +3: # Step 1: Noise-robust training on $D_{trans}$ +4: Inference $\mathcal{M}_{tgt}^{(i - 1)}$ on $\mathcal{D}_{trans} = \{(\pmb{x}^t,\pmb{y}^t)\}$ to get the predictions $\widehat{\mathcal{D}}_{trans} = \{(\pmb{x}^t,\pmb{p}^u)\}$ +5: Get $\pmb{w}$ for $(\pmb{x}^t,\pmb{p}^u)\in \widehat{\mathcal{D}}_{trans}$ with $\mathcal{M}_{tgt}^{(i - 1)}$ , Eq.(3) +6: Train $\mathcal{M}_{trans}^{(i)}$ with loss on $(\pmb{x}^t,\pmb{y}^t,\pmb{p}^u,\pmb{w})$ , Eq.(4) +7: # Step 2: Noise-robust training on $D_{tgt}$ +8: Inference $\mathcal{M}_{trans}^{(i)}$ on $\mathcal{D}_{tgt} = \{\pmb{x}^u\}$ to get the predictions $\widehat{\mathcal{D}}_{tgt} = \{(\pmb{x}^u,\pmb{p}^t)\}$ +9: Get $\pmb{w}^{\prime}$ for $(\pmb{x}^{u},\pmb{p}^{t})\in \widehat{D}_{tgt}$ with $\mathcal{M}_{trans}^{(i)}$ , Eq.(3) +10: Train $\mathcal{M}_{tgt}^{(i)}$ with loss on $(\pmb{x}^u,\pmb{p}^t,\pmb{w}')$ , Eq.(6) +11: end for +Output: an NER model $\mathcal{M}_{tgt}^{(T)}$ + +$\mathcal{D}_{tgt} = \{\pmb{x}^u\}$ . By performing knowledge distillation on $\mathcal{D}_{tgt}$ , the student model $\mathcal{M}_{tgt}$ is supposed to benefit from the unlabeled data drawn from the real text distribution in the target language with the knowledge from the teacher model $\mathcal{M}_{trans}$ . + +Specifically, given a sentence $\pmb{x}^u \in \mathcal{D}_{tgt}$ , we first utilize $\mathcal{M}_{trans}$ to predict soft label $p_i^t$ for each token $x_i^u \in \pmb{x}^u$ . Then, we integrate the instance-collaboration-based denoising technique into the learning process. The loss function w.r.t. $\pmb{x}^u$ to train the student model $\mathcal{M}_{tgt}$ can be formulated as: + +$$ +\mathcal {L} ^ {\boldsymbol {x} ^ {u}} = \frac {1}{L} \sum_ {i = 1} ^ {L} w \left(p _ {i} ^ {t}, x _ {i} ^ {u}\right) \cdot \mathrm {C E} \left(\hat {p} _ {i} ^ {u}, p _ {i} ^ {t}\right), \tag {6} +$$ + +where $\hat{p}_i^u$ denotes the output probability distribution of $\mathcal{M}_{tgt}$ for the $i$ -th token $x_i^u$ and $w(p_i^t, x_i^u)$ is calculated by Eq. (3). + +# 4 Experiments + +# 4.1 Experiment Settings + +Datasets We conduct experiments on two standard cross-lingual NER benchmarks: CoNLL (Tjong Kim Sang, 2002; Tjong Kim Sang and De Meulder, 2003) and WikiAnn (Pan et al., 2017). CoNLL contains four languages: English (en) and German (de) from the CoNLL-2003 $^4$ NER shared task (Tjong Kim Sang and De Meulder, 2003), and Spanish (es) and Dutch (nl) from the CoNLL-2002 $^5$ NER shared task (Tjong Kim Sang, 2002). This dataset is annotated with four entity types: PER, LOC, ORG, and MISC. WikiAnn + +contains an English dataset and datasets in three non-western languages: Arabic (ar), Hindi (hi), and Chinese (zh). Each dataset is annotated with 3 entity types: PER, LOC, and ORG. All datasets are annotated with the BIO tagging scheme. We use the train, development, and test splits as previous work (Wu and Dredze, 2019; Wu et al., 2020b). + +We take English as the source language and other languages as the target language, respectively. We remove the labels of the training data for the target language and take it as the unlabeled target language data. For the CoNLL benchmark, we use the word-to-word translation data provided in UniTrans (Wu et al., 2020b) for a fair comparison. For the WikiAnn benchmark, we translate the source data to the target language with the public M2M100 (Fan et al., 2020) translation system and conduct label projection with the marker-based alignment algorithm as Yang et al. (2022). + +Evaluation The entity-level micro-F1 on test set of the target language is used as the evaluation metric. We report the mean value of 5 runs with different seeds for all the experiments. + +Implementation Details For the base NER model, we stack a linear classifier with softmax over a base encoder such as mBERT. We implement our framework with Pytorch 1.7.1 $^{6}$ , the HuggingFace transformer library (Wolf et al., 2020), and use FAISS (Johnson et al., 2019) for embedding retrieval. Following Wu and Dredze (2019) and Zhou et al. (2022), we use the multilingual BERT base model (Devlin et al., 2019) and XLM-R (Connieu et al., 2020) large model as our base encoders. Most of our hyper-parameters are set following Wu et al. (2020b). We use AdamW (Loshchilov and Hutter, 2019) as optimizer and train the model on source NER data with the learning rate of 5e-5 for 3 epochs. The dropout rate is 0.1. For teacher-student learning, we train the model with a learning rate of 2e-5 for 10 epochs. We freeze the bottom three layers as Wu and Dredze (2019). Following Keung et al. (2019), we choose other hyper-parameters according to the target language dev set. We set K in Eq. (2) to 500 and $\alpha$ in Eq. (3) to 6. For the first iteration, we start with an NER model trained on the source-language data to denoise the translation data with $\beta_{1}$ and $\beta_{2}$ in Eq. (5) setting to 0.5. For the following iterations, $\beta_{1}$ is set to 0.9 and $\beta_{2}$ is set to 0.1. The maximum number of iterations is 8. + +
Methoddeesnlavg
mBERT based methods:
mBERT (Wu and Dredze, 2019)69.5674.9677.5773.57
AdvCE (Keung et al., 2019)71.9074.377.6074.60
TSL (Wu et al., 2020c)73.1676.7580.4476.78
UniTrans (Wu et al., 2020b)74.8279.3182.9079.01
TOF (Zhang et al., 2021)76.5780.3582.7979.90
AdvPicker (Chen et al., 2021)75.0179.0082.9078.97
RIKD (Liang et al., 2021)75.4877.8482.4678.59
MTMT (Li et al., 2022)76.8081.8283.4180.67
CoLaDa (ours)77.3080.4385.0980.94
XLM-R based methods:
MulDA (Liu et al., 2021)74.5578.1480.2277.64
xTune (Zheng et al., 2021)74.7880.0381.7678.85
ConNER (Zhou et al., 2022)77.1480.5083.2380.29
CoLaDa (ours)81.1282.7085.1582.99
+ +Table 1: F1 scores on CoNLL. + +
Methodarhizhavg
mBERT based methods:
BERT-align (Wu and Dredze, 2020)42.3067.6052.9054.26
TSL (Wu et al., 2020c)43.1269.5448.1253.59
RIKD (Liang et al., 2021)45.9670.2850.4055.55
MTMT (Li et al., 2022)52.7770.7652.2658.59
\( \mathrm{UniTrans}^{\dagger} \) (Wu et al., 2020b)42.9068.7656.0855.91
CoLaDa (ours)54.2672.4260.7762.48
XLM-R based methods:
XLM-R (Conneau et al., 2020)50.8472.1739.2354.08
ConNER (Zhou et al., 2022)59.6274.4939.1757.76
CoLaDa (ours)66.9476.6960.0867.90
+ +Table 2: F1 scores on WikiAnn. ${}^{ \dagger }$ denotes results obtained by running their public code on our data. + +# 4.2 Main Results + +Baselines We compare our method to previous start-of-the-art baselines as follows: i) feature alignment based methods: mBERT (Wu and Dredze, 2019), XLM-R (Conneau et al., 2020), BERT-align (Wu and Dredze, 2020), AdvCE (Keung et al., 2019), and AdvPicker (Chen et al., 2021); ii) translation based methods: MulDA (Liu et al., 2021), UniTrans (Wu et al., 2020b), and TOF (Zhang et al., 2021)); iii) knowledge distillation based methods: TSL (Wu et al., 2020c), RIKD (Liang et al., 2021), and MTMT (Li et al., 2022); iv) consistency based methods: xTune (Zheng et al., 2021) and ConNER (Zhou et al., 2022). + +Performance Comparison Tables 1 and 2 show the performance comparison of the proposed CoLaDa and prior start-of-the-art baselines on CoNLL and Wikiann, respectively. It can be seen that + +
Methoddeesnlarhizh
CoLaDa77.3080.4385.0954.2672.4260.77
1) CoLaDa w/o instance collaboration76.0879.9483.8650.9871.3159.64
2) CoLaDa w/o translation data denoise76.1779.2283.1041.4171.1055.04
3) CoLaDa w/o iteratively denoise75.7779.6483.5047.8271.3157.64
4) CoLaDa w/o model collaboration75.6478.9982.9846.5171.0955.25
5) CoLaDa w/o instance & model collaboration74.5479.9482.9742.3370.3955.55
+ +Table 3: Ablation study on CoNLL and WikiAnn. + +CoLaDa outperforms prior methods with both encoders, achieving a significant improvement of 2.70 F1 scores on average for CoNLL and 10.14 F1 scores on average for WikiAnn with XLM-R as the encoder. This well demonstrates the effectiveness of our approach. Interestingly, CoLaDa shows more significant superiority when transferring to distant target languages in WikiAnn. The knowledge distillation based baselines (i.e., TSL, RIKD, MTMT) struggle on distant languages such as Chinese (zh) due to the noisy predictions from the weak teacher model $\mathcal{M}_{src}$ trained in the source language. UniTrans, which is developed with the same data sources as ours, shows poor performance, especially in distant languages such as Arabic (ar). We conjecture that the problem of label noise is even more critical in these distant languages. Our CoLaDa can better handle noise in both translation data and unlabeled target-language data, thus leading to significant performance gains. + +# 5 Analysis + +# 5.1 Ablation Study + +To further validate the effectiveness of each mechanism in the proposed framework, we introduce the following variants of CoLaDa in an ablation study: 1) CoLaDa w/o instance collaboration, where we directly set the reliability score in Eq. (3) to 1 for all tokens. 2) CoLaDa w/o translation data denoise, where we set $\beta_{1}$ in Eq. (4) to 0. 3) CoLaDa w/o iteratively denoise, where we remove the iterative enhancement and only conduct the denoising process for one iteration. 4) CoLaDa w/o model collaboration, where we set $\beta_{1}$ in Eq. (4) to 0, remove the iteration mechanism, and directly take the model finetuned on $\mathcal{D}_{trans}$ as the teacher model to train a student model with instance-collaboration-based denoising on $\mathcal{D}_{tgt}$ . 5) CoLaDa w/o instance & model collaboration, which further drops the instance-collaboration-based denoising from 4). + +Table 3 shows the ablation results. We can draw + +some in-depth conclusions as follows. + +1) CoLaDa outperforms CoLaDa w/o instance collaboration, which highlights the effectiveness of leveraging neighborhood information to reduce label noise in knowledge distillation. +2) CoLaDa outperforms CoLaDa w/o translation data denoise, which emphasizes the importance of using the collaborator $\mathcal{M}_{tgt}$ to refine labels of translation data, especially in distant languages where the translation data is noisier (e.g., 12.8 F1 drop on Arabic and 5.7 F1 drop on Chinese). +3) CoLaDa outperforms CoLaDa w/o iteratively denoise, which indicates the necessity of iterative learning: models obtained from the previous iteration should be re-used as the collaborator to further improve label quality in the next iteration. +4) CoLaDa w/o instance & model collaboration, which eliminates all denoising strategies from CoLaDa, leads to a significant performance drop, demonstrating the essentiality of label denoising for cross-lingual NER. + +# 5.2 Analysis of Model Collaboration + +Here we attempt to understand how the two models, i.e., $\mathcal{M}_{trans}$ and $\mathcal{M}_{tgt}$ , collaboratively improve each other. + +![](images/1fa17958b5886e6a74a6d25888091eab14fb0567006c74f1ffe9c651a0d68d21.jpg) +Figure 4: F1 scores of $\mathcal{M}_{trans}^{(i)}$ and $\mathcal{M}_{tgt}^{(i)}$ on the test data and the target-language unlabeled data. $\mathcal{M}_{tgt}^{0}$ : model trained on source-language data. $\mathcal{M}_{trans}^{0}$ : model trained on original translation data. + +As shown in Figure 4, F1 scores of $\mathcal{M}_{\text{trans}}$ and $\mathcal{M}_{tgt}$ consistently improve as iterations go on, and finally converge at the last iteration. This indicates that both models benefit from the proposed model collaboration scheme. Two reasons are speculated: i) An improved $\mathcal{M}_{tgt}$ can provide more accurate labels on the translation data, which further help to improve $\mathcal{M}_{\text{trans}}$ via noise-robust learning on such translation data. For example, at the initial step $(i = 0)$ , the F1 score of the model $\mathcal{M}_{\text{trans}}^0$ trained on the original translation labels is 50.0. With the additional supervision from the collaborator $\mathcal{M}_{tgt}^0$ , $\mathcal{M}_{\text{trans}}^1$ achieves a performance gain of 5.7 F1. ii) An improved $\mathcal{M}_{\text{trans}}$ predicts pseudo labels with higher quality on the target-language unlabeled data, which further benefits the learning of $\mathcal{M}_{tgt}$ . As in Figure 4, the quality of pseudo-labeled $\mathcal{D}_{tgt}$ (the green line) grows as $\mathcal{M}_{\text{trans}}$ improves. In this way, both $\mathcal{M}_{\text{trans}}$ and $\mathcal{M}_{tgt}$ are providing more and more reliable labels for each other to learn as the iterations progress. + +# 5.3 Analysis of Instance Collaboration + +This subsection dives into the working mechanism of the instance-collaboration-based denoising. + +Reliability scores vs. label quality. To study the relationship between reliability score and label quality, we partition tokens in the target-language unlabeled data, $x_{i} \in \mathcal{D}_{tgt}$ into several bins according to their reliability scores $w(p_i^t,x_i)$ calculated via $\mathcal{M}_{trans}^{(1)}$ . Then, we compute the token-level F1 over each bin by comparing pseudo labels $\hat{y}_i = \arg \max (p_i^t)$ to the ground-truth ones. As shown in Figure 5, the label quality is proportional to the reliability score, which well demonstrates the effectiveness of our instance-collaboration-based denoising strategy. + +![](images/453a549f3e9a4df834c2d931dd951135fd464fb82dae253d3e4ee1c3c267f10e.jpg) +Figure 5: Illustration of the relationship between reliability score and label quality. + +Analysis of Label Consistency. We also study the characteristics of label consistency w.r.t. different entity types and representation spaces of the memory bank. Figure 6 shows the results. We can draw some in-depth observations as follows. + +![](images/200b5e7c6d312346c6951b1db413331c8922fd24e8b866f53bd95f8cb249f139.jpg) +Figure 6: Mean label consistency calculated from different conditions (i.e., different entity types, representation spaces of different layers, clean/noisy tokens) on the German dataset. + +i) Clean tokens show a larger average consistency than noisy tokens w.r.t. all entity types, demonstrating the effectiveness of our label consistency based denoising strategy again. +ii) Different entity types lead to different distributions of label consistency, which validates the necessity of our design for class-adaptive reliability score for weighting as Eq.(3). +iii) Label consistencies calculated with token representations from the upper layers are generally larger than those corresponding to the bottom layers. Also, the label consistency gap between clean tokens and noisy tokens gets larger from the bottom to the top (e.g., the gap between two orange lines). This may be attributed to the fact that representations from upper layers are more task-specific (Muller et al., 2021), hence they can better discriminate between noisy and clean tokens. + +![](images/540db16b1acf57a4bde8f288af7a34d647590fcae090cb74cca6cffcefeb679e.jpg) +Figure 7: F1 scores of CoLaDa with different $K$ for neighborhood information on German dataset. + +
Original English:** " Duchy of Aquitaine[LOC]" - William V[PER] (995-1030)Inaccurate translation +Translate "Duchy of Aquitaine" into "爱因公爵" (Duke of Ain) incorrectly.
Original Translation:** "爱因公爵[LOC]" - 威廉五世[PER] (995)
Translate-train:** "爱因公爵[LOC]" - 威廉五世[PER] (995)
Ours:** "爱因公爵[PER]" - 威廉五世[PER] (995)
Original English:There have been many tenants, including The Sunday Times[ORG]" and The Daily News[ORG]".Inaccurate alignment boundary +The symbols《and》are corner brackets used to enclose the name of a newspaper, and other works.
Original Translation:有许多租户,包括《星期日时报[ORG]》和《每日新闻[ORG]》。
Translate-train:有许多租户,包括《星期日时报[ORG]》和《每日新闻[ORG]》。
Ours:有许多租户,包括《星期日时报[ORG]》和《每日新闻[ORG]》。
Original English:It is found in Democratic Republic of Congo[ORG], Kenya[LOC], Tanzania[LOC]....Label noise in English data +Wrong entity type in original English data for "Democratic Republic of China".
Original Translation:它位于刚果民主共和国[ORG], 肯尼亚[LOC], 坦桑尼亚[LOC]....
Translate-train:它位于刚果民主共和国[ORG], 肯尼亚[LOC], 坦桑尼亚[LOC]....
Ours:它位于刚果民主共和国[LOC], 肯尼亚[LOC], 坦桑尼亚[LOC]....
+ +Figure 8: Case study on translation data in Chinese. The blue (red) texts denote the correct (incorrect) entity labels. The original translation lines display the translation texts and labels obtained by data projection. Translate-train and Ours illustrate the predictions from the translate-train method $(\mathcal{M}_{trans}^{0})$ and our CoLaDa, respectively. + +Choice of K for neighborhood information. Figure 7 shows the performance of CoLaDa using different $K$ in Eq. (2). Generally speaking, CoLaDa is robust to the choice of K. Any value for $K > 0$ leads to a better performance compared with removing the instance collaboration, i.e., $\mathrm{K} = 0$ . A smaller $K$ may lead to a slight performance drop due to limited neighborhood information. + +# 5.4 Case Study + +To better illustrate the kinds of label noise presented in the data and the capability of CoLaDa to address such noise, we conduct a case study on the Chinese translation data from the WikiAnn English data. As shown in Figure 8, there are three typical cases of noisy labels in the translation data: noisy labels induced by inaccurate translations, alignment errors, and annotation errors in the original source-language data. Figure 8 shows that the translate-train model, finetuned on the original translation data, overfits the noisy labels. However, CoLaDa is less affected by such noise and makes correct predictions. + +# 6 Related Work + +# 6.1 Cross-lingual NER + +Prior work on cross-lingual NER mainly falls into two major categories: feature-based and data-based transfer. + +Feature-based These methods learn language-independent features so that the model trained on the source language can directly adapt to the tar + +get language. Earlier work exploits word clusters (Täckström et al., 2012), gazetteers (Zirikly and Hagiwara, 2015), Wikifier features (Tsai et al., 2016), and cross-lingual word embedding (Ni et al., 2017), etc. More recently, with the fast growth of multilingual pre-trained language models (Devlin et al., 2019; Conneau et al., 2020) and their promising results on cross-lingual transfer (Wu and Dredze, 2019), lots of studies build upon such pre-trained models and further promote the learning of language-independent features via meta-learning (Wu et al., 2020d), contrastive alignment (Wu and Dredze, 2020), adversarial learning (Keung et al., 2019; Chen et al., 2021), and by integrating other resources (Fetahu et al., 2022). Despite the great success, they mostly ignore language-specific features, which are especially important when transferring to distant languages (Fu et al., 2023). + +Data-based These approaches learn language-specific features via automatically labeled target-language data and can be further divided into translation-based and knowledge distillation-based methods. + +Translation-based methods first translate the source-language data to the target language, then perform label projection from the source side to the target side. Some prior studies have proposed to use cheap translation such as word-to-word (Xie et al., 2018) or phrase-to-phrase (Mayhew et al., 2017) translation. Jain et al. (2019) propose an entity projection algorithm to utilize the Google translation system. Recently, Liu et al. (2021) and Yang et al. (2022) propose to translate sentences with pre-defined markers for label projection. And Ni et al. (2017) design heuristic rules to select high + +quality translation data. However, both data noise and artifacts (Artetxe et al., 2020) in the translation data still limit the performance of such methods (García-Ferrero et al., 2022). + +Knowledge distillation-based methods train a student model on unlabeled target-language data with the soft labels from a teacher model (Wu et al., 2020c). Li et al. (2022) improve the single task based teacher-student learning with entity similarity as an auxiliary task. To mitigate the label noise from the teacher model, Chen et al. (2021) propose AdvPicker, which trains a language discriminator to select the less language-dependent unlabeled data for knowledge distillation; Liang et al. (2021) design a reinforcement learning algorithm to train an instance selector according to features such as model confidence to select reliable pseudo labels iteratively. + +While most previous work leverages either translation data or unlabeled data, UniTrans (Wu et al., 2020b) utilizes the model trained on translation data to perform teacher-student learning on unlabeled data. But it still suffers from the data noise problem. More recently, consistency training (Zheng et al., 2021; Zhou et al., 2022) has also been explored to leverage both unlabeled data and translation data without explicit label annotation. + +To the best of our knowledge, we are the first to propose a unified denoising framework to handle data noise in both translation and unlabeled data collaboratively from the model and instance levels for cross-lingual NER. + +# 6.2 Learning with Label Noise + +Previous studies mainly address the label noise via re-weighting examples (Shu et al., 2019), designing noise-robust loss functions (Ma et al., 2020), and selecting clean instances (Bahri et al., 2020; Wu et al., 2020a), etc. However, these methods only consider the corrupted labels that naturally occur in one data source. In this work, we consider the complementary characteristics of translation and unlabeled data, and design a model-collaboration-based denoising scheme. While Xu et al. (2023) target at the few-shot learning scenario and leverage the neighborhood information among the labeled examples to hard-select the reliable pseudo labels in self-training, we focus on the zero-shot cross-lingual setting and softly re-weight the noisy pseudo-labels in knowledge distillation without any clean labeled data in target language. + +# 7 Conclusion + +To address the problem of label noise in cross-lingual NER, this paper presents CoLaDa, a collaborative label denoising framework. We propose a model-collaboration-based denoising scheme to make two models trained on different data sources to denoise the labels of each other and hence promote each other's learning. We further propose an instance-collaboration-based strategy that collaboratively considers the label consistency among similar tokens in the feature space to re-weight the noisy labels assigned by a teacher model in knowledge distillation. By integrating the instance-collaboration strategy into the model-collaboration denoising scheme, our final framework CoLada achieves superior performance over prior start-of-the-art methods by benefiting from better handling the data noise. + +# Limitations + +Our framework relies on the availability of translation system and unlabeled data in the target language, which can not be applied to languages without any unlabeled text or translation text. The knowledge distillation step requires a certain amount of unlabeled text, while it may struggle in cases where only few hundreds of unlabeled sentences are available. It would be interesting to combine our label denoising framework with data augmentation techniques in such scenarios. Besides, the boarder application to other low-resource languages, such as MasakhaNER 2.0 (Adelani et al., 2022), and other cross-lingual sequence labeling tasks are left for exploration in future work. + +# References + +David Adelani, Graham Neubig, Sebastian Ruder, Shruti Rijhwani, Michael Beukman, Chester Palen-Michel, Constantine Lignos, Jesujoba Alabi, Shamsuddeen Muhammad, Peter Nabende, Cheikh M. Bamba Dione, Andiswa Bukula, Rooweither Mabuya, Bonaventure F. P. Dossou, Blessing Sibanda, Happy Buzaaba, Jonathan Mukiibi, Godson Kalipe, Derguene Mbaye, Amelia Taylor, Fatoumata Kabore, Chris Chinenye Emezue, Anuoluwapo Aremu, Perez Ogayo, Catherine Gitau, Edwin Munkoh-Buabeng, Victoire Memdjokam Koagne, Allahsera Auguste Tapo, Tebogo Macucwa, Vukosi Marivate, Mboning Tchiaze Elvis, Tajuddeen Gwadabe, Tosin Adewumi, Orevaoghene Ahia, Joyce Nakatumba-Nabende, Neo Lerato Mokono, Ignatius Ezeani, Chiamaka Chukwuneke, Mofetoluwa Oluwaseun Adeyemi, Gilles Quentin Hacheme, + +Idris Abdulmumin, Odunayo Ogundepo, Oreen Yousuf, Tatiana Moteu, and Dietrich Klakow. 2022. MasakhaNER 2.0: Africa-centric transfer learning for named entity recognition. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 4488-4508, Abu Dhabi, United Arab Emirates. Association for Computational Linguistics. +Mikel Artetxe, Gorka Labaka, and Eneko Agirre. 2020. Translation artifacts in cross-lingual transfer learning. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 7674–7684, Online. Association for Computational Linguistics. +Dara Bahri, Heinrich Jiang, and Maya Gupta. 2020. Deep k-NN for noisy labels. In Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pages 540–550. PMLR. +Weile Chen, Huiqiang Jiang, Qianhui Wu, Borje F. Karlsson, and Yi Guan. 2021. AdvPicker: Effectively Leveraging Unlabeled Data via Adversarial Discriminator for Cross-Lingual NER. 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 743-753, Online. Association for Computational Linguistics. +Alexis Conneau, Kartikay Khandelwal, Naman Goyal, Vishray 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. +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. +Maud Ehrmann, Marco Turchi, and Ralf Steinberger. 2011. Building a multilingual named entity-annotated corpus using annotation projection. In Proceedings of the International Conference Recent Advances in Natural Language Processing 2011, pages 118-124, Hissar, Bulgaria. Association for Computational Linguistics. +Angela Fan, Shruti Bhosale, Holger Schwenk, Zhiyi Ma, Ahmed El-Kishky, Siddharth Goyal, Mandep Baines, Onur Celebi, Guillaume Wenzek, Vishrav Chaudhary, Naman Goyal, Tom Birch, Vitaliy Liptchinsky, Sergey Edunov, Edouard Grave, + +Michael Auli, and Armand Joulin. 2020. Beyond english-centric multilingual machine translation. J. Mach. Learn. Res., 22:107:1-107:48. +Besnik Fetahu, Anjie Fang, Oleg Rokhlenko, and Shervin Malmasi. 2022. Dynamic gazetteer integration in multilingual models for cross-lingual and cross-domain named entity recognition. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 2777-2790, Seattle, United States. Association for Computational Linguistics. +Yingwen Fu, Nankai Lin, Boyu Chen, Ziyu Yang, and Shengyi Jiang. 2023. Cross-lingual named entity recognition for heterogenous languages. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 31:371-382. +Iker Garcia-Ferrero, Rodrigo Agerri, and German Rigau. 2022. Model and data transfer for cross-lingual sequence labelling in zero-resource settings. In Findings of the Association for Computational Linguistics: EMNLP 2022. +Xiaoyi Gu, Leman Akoglu, and Alessandro Rinaldo. 2019. Statistical analysis of nearest neighbor methods for anomaly detection. 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 10921-10931. +Lifu Huang, Heng Ji, and Jonathan May. 2019. Crosslingual multi-level adversarial transfer to enhance low-resource name tagging. 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 3823-3833, Minneapolis, Minnesota. Association for Computational Linguistics. +Alankar Jain, Bhargavi Paranjape, and Zachary C. Lipton. 2019. Entity projection via machine translation for cross-lingual NER. 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 1083–1092, Hong Kong, China. Association for Computational Linguistics. +Jeff Johnson, Matthijs Douze, and Hervé Jégou. 2019. Billion-scale similarity search with GPUs. IEEE Transactions on Big Data, 7(3):535-547. +Phillip Keung, Yichao Lu, and Vikas Bhardwaj. 2019. Adversarial learning with contextual embeddings for zero-resource cross-lingual classification and NER. 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 1355–1360, Hong Kong, China. Association for Computational Linguistics. + +Zhuoran Li, Chunming Hu, Xiaohui Guo, Junfan Chen, Wenyi Qin, and Richong Zhang. 2022. An unsupervised multiple-task and multiple-teacher model for cross-lingual named entity recognition. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 170–179, Dublin, Ireland. Association for Computational Linguistics. +Shining Liang, Ming Gong, Jian Pei, Linjun Shou, Wanli Zuo, Xianglin Zuo, and Daxin Jiang. 2021. Reinforced iterative knowledge distillation for cross-lingual named entity recognition. In Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining, KDD '21, page 3231-3239, New York, NY, USA. Association for Computing Machinery. +Linlin Liu, Bosheng Ding, Lidong Bing, Shafiq Joty, Luo Si, and Chunyan Miao. 2021. MulDA: A multilingual data augmentation framework for low-resource cross-lingual NER. 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 5834–5846, 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. +Xingjun Ma, Hanxun Huang, Yisen Wang, Simone Romano, Sarah Erfani, and James Bailey. 2020. Normalized loss functions for deep learning with noisy labels. In ICML. +Stephen Mayhew, Chen-Tse Tsai, and Dan Roth. 2017. Cheap translation for cross-lingual named entity recognition. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 2536-2545, Copenhagen, Denmark. Association for Computational Linguistics. +Benjamin Muller, Yanai Elazar, Benoit Sagot, and Djamé Seddah. 2021. First align, then predict: Understanding the cross-lingual ability of multilingual BERT. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 2214–2231, Online. Association for Computational Linguistics. +Jian Ni, Georgiana Dinu, and Radu Florian. 2017. Weakly supervised cross-lingual named entity recognition via effective annotation and representation projection. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1470–1480, Vancouver, Canada. Association for Computational Linguistics. +Xiaoman Pan, Boliang Zhang, Jonathan May, Joel Nothman, Kevin Knight, and Heng Ji. 2017. Cross-lingual + +name tagging and linking for 282 languages. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1946-1958, Vancouver, Canada. Association for Computational Linguistics. +Jun Shu, Qi Xie, Lixuan Yi, Qian Zhao, Sanping Zhou, Zongben Xu, and Deyu Meng. 2019. Meta-weight-net: Learning an explicit mapping for sample weighting. In NeurIPS. +Oscar Tackström, Ryan McDonald, and Jakob Uszkoreit. 2012. Cross-lingual word clusters for direct transfer of linguistic structure. In Proceedings of the 2012 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 477–487, Montreal, Canada. Association for Computational Linguistics. +Erik F. Tjong Kim Sang. 2002. Introduction to the CoNLL-2002 shared task: Language-independent named entity recognition. In COLING-02: The 6th Conference on Natural Language Learning 2002 (CoNLL-2002). +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 CoNLL-2003, pages 142-147. Edmonton, Canada. +Chen-Tse Tsai, Stephen Mayhew, and Dan Roth. 2016. Cross-lingual named entity recognition via wikification. In Proceedings of the 20th SIGNLL Conference on Computational Natural Language Learning, pages 219–228, Berlin, Germany. Association for Computational Linguistics. +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. +Pengxiang Wu, Songzhu Zheng, Mayank Goswami, Dimitris Metaxas, and Chao Chen. 2020a. A topological filter for learning with label noise. In Advances in Neural Information Processing Systems. +Qianhui Wu, Zijia Lin, Borje F. Karlsson, Biqing Huang, and Jianguang Lou. 2020b. Unitrans: Unifying model transfer and data transfer for cross-lingual named entity recognition with unlabeled data. In Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence, IJCAI 2020, pages 3926-3932. ijcai.org. + +Qianhui Wu, Zijia Lin, Borje F. Karlsson, Jian-Guang Lou, and Biqing Huang. 2020c. 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, Online. Association for Computational Linguistics. +Qianhui Wu, Zijia Lin, Guoxin Wang, Hui Chen, Borje F. Karlsson, Biqing Huang, and Chin-Yew Lin. 2020d. Enhanced meta-learning for cross-lingual named entity recognition with minimal resources. 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 9274-9281. AAAI Press. +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. Do explicit alignments robustly improve multilingual encoders? In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 4471-4482, Online. Association for Computational Linguistics. +Jiateng Xie, Zhilin Yang, Graham Neubig, Noah A. Smith, and Jaime Carbonell. 2018. Neural crosslingual named entity recognition with minimal resources. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 369-379, Brussels, Belgium. Association for Computational Linguistics. +Hong Xu, Keqing He, Yuanmeng Yan, Sihong Liu, Zijun Liu, and Weiran Xu. 2020. A deep generative distance-based classifier for out-of-domain detection with mahalanobis space. In Proceedings of the 28th International Conference on Computational Linguistics, pages 1452-1460, Barcelona, Spain (Online). International Committee on Computational Linguistics. +Ran Xu, Yue Yu, Hejie Cui, Xuan Kan, Yanqiao Zhu, Joyce C. Ho, Chao Zhang, and Carl Yang. 2023. Neighborhood-regularized self-training for learning with few labels. In Proceedings of the Thirty-Seventh AAAI Conference on Artificial Intelligence. +Jian Yang, Shaohan Huang, Shuming Ma, Yuwei Yin, Li Dong, Dongdong Zhang, Hongcheng Guo, Zhoujun Li, and Furu Wei. 2022. Crop: Zero-shot crosslingual named entity recognition with multilingual labeled sequence translation. In *Findings of the Association for Computational Linguistics: EMNLP* 2022. + +Andrew Zhai and Hao-Yu Wu. 2019. Classification is a strong baseline for deep metric learning. In 30th British Machine Vision Conference 2019, BMVC 2019, Cardiff, UK, September 9-12, 2019, page 91. BMVA Press. +Ying Zhang, Fandong Meng, Yufeng Chen, Jinan Xu, and Jie Zhou. 2021. Target-oriented fine-tuning for zero-resource named entity recognition. In *Findings of the Association for Computational Linguistics: ACL-IJCNLP* 2021, pages 1603-1615, Online. Association for Computational Linguistics. +Bo Zheng, Li Dong, Shaohan Huang, Wenhui Wang, Zewen Chi, Saksham Singhal, Wanxiang Che, Ting Liu, Xia Song, and Furu Wei. 2021. Consistency regularization for cross-lingual fine-tuning. 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 3403-3417, Online. Association for Computational Linguistics. +Ran Zhou, Xin Li, Lidong Bing, Erik Cambria, Luo Si, and Chunyan Miao. 2022. ConNER: Consistency training for cross-lingual named entity recognition. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 8438–8449, Abu Dhabi, United Arab Emirates. Association for Computational Linguistics. +Ayah Zirikly and Masato Hagiwara. 2015. Cross-lingual transfer of named entity recognizers without parallel corpora. 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 390–396, Beijing, China. Association for Computational Linguistics. + +# A Appendix + +# A.1 Dataset Statistics + +Table A.1 reports the dataset statistics for CoNLL and WikiAnn. + +# A.2 Other Implementation Details + +All experiments are conducted on a Tesla V100 (32GB). The total of trainable parameters $(\mathcal{M}_{trans}$ and $\mathcal{M}_{tgt})$ for our model with mBERT-base-cased as the encoder is 172M and the training time is about 35 mins for one iteration. With XLM-R-large as our base encoder, the total of trainable parameters are 822M and the training takes about 90 mins for one iteration. + +# A.3 Baselines + +We consider the following start-of-the-art baselines: + +
LanguageStatisticTrainDevTest
English (en)NS14,0423,2523,454
(CoNLL-2003)NE23,4995,9425,648
German (de)NS12,1672,8753,009
(CoNLL-2003)NE11,8514,8333,673
Spanish (es)NS8,4051,9261,524
(CoNLL-2002)NE18,7984,3513,558
Dutch (nl)NS15,8362,8955,202
(CoNLL-2002)NE13,3442,6163,941
English (en)NS20,00010,00010,000
(WikiAnn)NE27,93114,14613,958
Arabic (ar)NS20,00010,00010,000
(WikiAnn)NE22,50111,26711,259
Hindi (hi)NS5,0001,0001,000
(WikiAnn)NE6,1241,2261,228
Chinese (zh)NS20,00010,00010,000
(WikiAnn)NE24,13512,01712,049
+ +Table A.1: Dataset statistics. $N_{S}$ : the number of sentences, $N_{E}$ : the number of entities. + +mBERT (Wu and Dredze, 2019) and XLM-R (Conneau et al., 2020) directly train an NER model on the labeled data in the source language, with mBERT and XLM-R as the basic encoder, respectively. + +BERT-align (Wu and Dredze, 2020) tries to explicitly add word-level contrastive alignment loss to enhance the mBERT representation. + +AdvCE (Keung et al., 2019) exploits adversarial learning on source- and target-language text to avoid learning language-specific information. + +AdvPicker (Chen et al., 2021) leverages adversarial learning to learn language-shared features and then selects the less language-specific sentences in target-language unlabeled text for knowledge distillation. + +MulDA (Liu et al., 2021) proposes the labeled sequence translation method for data projection from source-language NER data, a generative model is further applied to augment more diverse examples in the target language. + +UniTrans (Wu et al., 2020b) unifies model- and translation-data-based-transfer via knowledge distillation. + +TOF (Zhang et al., 2021) leverages the labeled data for machine reading comprehension task on target language to help the NER task in cross-lingual transfer. + +TSL (Wu et al., 2020c) proposes knowledge distillation to use unlabeled target-language data for cross-lingual NER. + +RIKD (Liang et al., 2021) proposes a reinforcement learning algorithm to iteratively select reliable pseudo-labels for knowledge distillation. + +MTMT (Li et al., 2022) proposes multi-task multi-teacher knowledge distillation, which further leverages the entity similarity task. + +xTune (Zheng et al., 2021) leverages unlabeled translation text and other word-level data augmentation techniques for consistency training. + +ConNER (Zhou et al., 2022) conducts span-level consistency training on unlabeled target-language data using translation and further applies dropout-based consistency training on the source-language data. + +# A For every submission: + +A1. Did you describe the limitations of your work? + +"Limitations" section. + +A2. Did you discuss any potential risks of your work? + +Not applicable. We study cross-lingual NER task on public datasets, our work doesn't have potential risks. + +A3. Do the abstract and introduction summarize the paper's main claims? + +Abstract & Sec 1. + +A4. Have you used AI writing assistants when working on this paper? + +Left blank. + +# B Did you use or create scientific artifacts? + +Sec 4 + +B1. Did you cite the creators of artifacts you used? + +Sec 4 + +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? + +Sec 4 + +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +Not applicable. These datasets are all public for research purpose. + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? + +Not applicable. We conduct experiments on public datasets. + +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? + +Sec 4. + +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. + +Appendix. + +# C Did you run computational experiments? + +Sec 4. + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +Appendix. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? Sec 4. +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? Sec4. +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? Sec 4. + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? No response. +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? No response. +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? No response. +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? No response. +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? No response. \ No newline at end of file diff --git a/coladaacollaborativelabeldenoisingframeworkforcrosslingualnamedentityrecognition/images.zip b/coladaacollaborativelabeldenoisingframeworkforcrosslingualnamedentityrecognition/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..8bcc08f3c353f29fc2fc44e016bf7b674fed5cbf --- /dev/null +++ b/coladaacollaborativelabeldenoisingframeworkforcrosslingualnamedentityrecognition/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:959d319a04cf56247ee47415ca0eb9064e0d3612181b38c190e18ad12694e77f +size 541949 diff --git a/coladaacollaborativelabeldenoisingframeworkforcrosslingualnamedentityrecognition/layout.json b/coladaacollaborativelabeldenoisingframeworkforcrosslingualnamedentityrecognition/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..de8d2bde08f05166bac869a6ef874076130dacb9 --- /dev/null +++ b/coladaacollaborativelabeldenoisingframeworkforcrosslingualnamedentityrecognition/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c310e4669bec93915af2b5c0354155444312e7b2cb600308187f0f85b19a388 +size 575540 diff --git a/coneanefficientcoarsetofinealignmentframeworkforlongvideotemporalgrounding/71dd3930-0887-4a62-bba6-1c2c584fe869_content_list.json b/coneanefficientcoarsetofinealignmentframeworkforlongvideotemporalgrounding/71dd3930-0887-4a62-bba6-1c2c584fe869_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..9149e0d57168312c8b45a32e4e511c60ced319c6 --- /dev/null +++ b/coneanefficientcoarsetofinealignmentframeworkforlongvideotemporalgrounding/71dd3930-0887-4a62-bba6-1c2c584fe869_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:808524de13ef38147381043ae3209f600f6a1f69a6cbeea047f8fddd368f1b3c +size 99226 diff --git a/coneanefficientcoarsetofinealignmentframeworkforlongvideotemporalgrounding/71dd3930-0887-4a62-bba6-1c2c584fe869_model.json b/coneanefficientcoarsetofinealignmentframeworkforlongvideotemporalgrounding/71dd3930-0887-4a62-bba6-1c2c584fe869_model.json new file mode 100644 index 0000000000000000000000000000000000000000..7ae49813e5184ce2f9106b0fbde69d6ac6151817 --- /dev/null +++ b/coneanefficientcoarsetofinealignmentframeworkforlongvideotemporalgrounding/71dd3930-0887-4a62-bba6-1c2c584fe869_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:445800a9c43529e56449a397a2804c65faae2b9f71f89b65ba2ac55c7a61b288 +size 120090 diff --git a/coneanefficientcoarsetofinealignmentframeworkforlongvideotemporalgrounding/71dd3930-0887-4a62-bba6-1c2c584fe869_origin.pdf b/coneanefficientcoarsetofinealignmentframeworkforlongvideotemporalgrounding/71dd3930-0887-4a62-bba6-1c2c584fe869_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6f3f71c9511ddba6caa8ab19fa40904cbddb781d --- /dev/null +++ b/coneanefficientcoarsetofinealignmentframeworkforlongvideotemporalgrounding/71dd3930-0887-4a62-bba6-1c2c584fe869_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9898c9bb09bfa3e837ee7f36b41eb4fd9087a9f1d5779945c5f2e945e2aec7b7 +size 2711254 diff --git a/coneanefficientcoarsetofinealignmentframeworkforlongvideotemporalgrounding/full.md b/coneanefficientcoarsetofinealignmentframeworkforlongvideotemporalgrounding/full.md new file mode 100644 index 0000000000000000000000000000000000000000..91d6f49a88bb0d5d3e70da58da0b16c191d63a1e --- /dev/null +++ b/coneanefficientcoarsetofinealignmentframeworkforlongvideotemporalgrounding/full.md @@ -0,0 +1,430 @@ +![](images/1864fb1ecd1efa9f7299a209e77f4716f9da99167cfb34e5aaefa860e430b3a6.jpg) + +# CONE: An Efficient COarse-to-fiNE Alignment Framework for Long Video Temporal Grounding + +Zhijian Hou $^{1*}$ , Wanjun Zhong $^{2*}$ , Lei Ji $^{3}$ , Difei Gao $^{4}$ , Kun Yan $^{5}$ , Wing-Kwong Chan $^{1}$ , Chong-Wah Ngo $^{6}$ , Mike Zheng Shou $^{4}$ and Nan Duan $^{3}$ + +$^{1}$ City University of Hong Kong $^{2}$ Sun Yat-sen University + +3 Microsoft Research Asia 4 National University of Singapore + +5 Beihang University 6 Singapore Management University + +{zjhou3-c@my. ,wkchan@}cityu.edu.hk; zhongwj25@mail2.sysu.edu.cn; {leiji, nanduan}@microsoft.com + +difei.gao@vipl.ict.ac.cn; kunyan@buaa.edu.cn; cwngo@smu.edu.sg; mike.zheng.shou@gmail.com + +# Abstract + +This paper tackles an emerging and challenging problem of long video temporal grounding (VTG) that localizes video moments related to a natural language (NL) query. Compared with short videos, long videos are also highly-demanded but less explored, which brings new challenges in higher inference computation cost and weaker multi-modal alignment. To address these challenges, we propose CONE, an efficient COarse-to-fiNE alignment framework. CONE is a plug-and-play framework on top of existing VTG models to handle long videos through a sliding window mechanism. Specifically, CONE (1) introduces a query-guided window selection strategy to speed up inference, and (2) proposes a coarse-to-fine mechanism via a novel incorporation of contrastive learning to enhance multi-modal alignment for long videos. Extensive experiments on two large-scale long VTG benchmarks consistently show both substantial performance gains (e.g., $3.13\% \xrightarrow{+119\%} 6.87\%$ on MAD) and state-of-the-art results. Analyses also reveal higher efficiency as the query-guided window selection mechanism accelerates inference time by 2x on Ego4D-NLQ and 15x on MAD while keeping SOTA results. Codes have been released at https://github.com/houzhijian/CONE. + +# 1 Introduction + +Video temporal grounding (Anne Hendricks et al., 2017; Gao et al., 2017) aims to locate specific moments in an untrimmed video relevant to a textual user query. This is a crucial task in multi-modal video understanding and can be applied to many practical applications such as video retrieval (Xu et al., 2016), video editing, and video question answering (Lei et al., 2018, 2020a). + +Temporal grounding for long videos is especially highly-demanded and emerging due to the + +![](images/0cf9822d5a4b1f8e545420621331afeaab7684132747159400227b102dbf8731.jpg) +NL query: What object was the woman in the room holding? +Figure 1: An example of long video temporal grounding, which requires coarse-to-fine multi-modal alignment. + +flourishing growth of online videos in quantity and length. However, limited by previously available datasets (Gao et al., 2017; Krishna et al., 2017; Lei et al., 2021), existing works (Zhang et al., 2020a,b) mainly deal with relatively short videos ranging from 0.5 to 2.5 minutes on average. Recently, Ego4D (Grauman et al., 2022) and MAD (Soldan et al., 2022) datasets have been created and attempted to deal with long video, which spans from several minutes to hours. + +Early attempts for long video grounding extends existing VTG models for short videos through sparse sampling (Grauman et al., 2022) or a sliding window adaptation (Soldan et al., 2022). On the one hand, existing models for short videos typically downsample videos to a fixed-length frame sequence, which leads to temporal information loss for long videos (i.e., fewer visible frames via sparse sampling). Besides, the window-based adaptation methods divide the long video into candidate windows and inference on every window, which leads to high inference computational cost. On the other hand, massive moment candidates from long videos make their precise multi-modal alignment with the NL query more challenging, which leads to contextual information loss (i.e., weaker alignment to fine-grained contents, like objects, actions, and + +scenes). As the motivating example shown in Fig. 1, accurate grounding requires a coarse-grained localization of relevant video segments (e.g. "in the room" v.s. "outdoor"), and fine-grained alignment to detailed object and action in frames (e.g., "women" and "holding"). In conclusion, long video length poses two new challenges: (1) higher computational cost during inference on the numerous windows of the entire long video; (2) weaker multimodal alignment due to the abundance of moment candidates. + +To address these challenges, we propose CONE, a COarse-to-fiNE alignment framework for long video temporal grounding. First, we slice the arbitrary long video into candidate windows. Then, we employ a query-guided window selection strategy for efficiency and further introduce a coarse-to-fine mechanism for effectiveness. Specifically, the query-guided window selection strategy efficiently reduces the sizeable window number of the long video to a modest amount via efficient alignment score computation. Moreover, the coarse-to-fine alignment mechanism consists of three modules to gradually align the multi-modal inputs via multiscale granularity: (1) window (coarse granularity) selection to reliably select semantically relevant candidate windows; (2) window (coarse)-proposal (fine) joint contrastive learning to generate candidate proposals considering both inter-window and intra-window relations; (3) proposal (fine granularity) ranking to further accurately sort out the perfect proposal. Notably, we incorporate contrastive learning into this mechanism. On the one hand, we utilize the powerful multi-modal alignment ability of contrastive vision-text pre-trained models (e.g., CLIP), which computes matching scores between video frames and textual query for both window selection and proposal ranking stages. On the other hand, we select a contrasting negative window and design an inter-window contrastive loss during training for the joint learning stage. + +With this coarse-to-fine design, CONE has the following advantages: (1) higher efficiency in handling long video inputs with less temporal information loss; (2) more accurate multi-modal alignment with less contextual information loss. We evaluate CONE on two large-scale long video grounding benchmarks and achieve both the state-of-the-art results and significant performance boosts $(3.13\% \rightarrow 6.87\%$ on MAD, and $10.46\% \rightarrow 13.46\%$ on Ego4D-NLQ in terms of R1@IoU=0.3). Further + +analysis shows that the window selection strategy shortens the inference speed by $2\mathrm{x}$ for Ego4D-NLQ and $15\mathrm{x}$ for MAD compared to inference on every window, without sacrificing its performance. + +Contributions Our work presents two major contributions to the long video temporal grounding field. (1) We propose a novel coarse-to-fine alignment framework that utilizes a pipeline of {window slicing and selection, proposal generation and ranking}, resulting in state-of-the-art performance and high efficiency on two representative benchmarks. (2) We introduce a novel approach for incorporating contrastive learning into multi-modal alignment. + +# 2 Related Work + +Video Temporal Grounding. Current models for this task typically fall into two categories based on the usage of proposals. Proposal-free methods predict start/end timestamps directly, bypassing the generation of proposals (Ghosh et al., 2019; Zeng et al., 2020; Zhang et al., 2021c). Conversely, Proposal-based methods merge proposal generation and ranking within an end-to-end framework (Zhang et al., 2020b; Lei et al., 2021; Cao et al., 2021). An excellent survey paper provides further details on these models (Zhang et al., 2022). However, these models are predominantly designed for relatively short videos, which leads to substantial information loss when adapted directly to long-form settings. Regarding long-form video grounding, VSLNet-L (Zhang et al., 2021b) extends VSLNet (Zhang et al., 2020a) with a multiscale split-and-concat mechanism to address performance degradation. Still, the multi-scale mechanism adds computation cost during inference, and the sparse sampling approach suffers from significant temporal information loss for hour-long videos. Authors of Ego4D and MAD adapt 2DTAN (Zhang et al., 2020b) and VLG-Net (Soldan et al., 2021) into simple window-based baselines, yet these models lack the ability for coarse-to-fine alignment, affecting the final results. + +Furthermore, other studies have focused on different issues. For example, NaQ (Ramakrishnan et al., 2023) addresses data scarcity with an effective data augmentation strategy, while DeNet (Zhou et al., 2021) tackles the ground-truth bias problem with a de-coupling and de-bias strategy. There are also other related tasks involving language grounding with video corpus input (Lei et al., 2020b; Hou + +et al., 2021) or spatial-temporal output (Yang et al., 2022), but they fall outside the scope of this paper. Long-form Video Modeling. Long-form video modeling is an emerging topic recently investigated in (multi-modal) video understanding, including classification, segmentation, localization, and retrieval. The common challenges of long videos are modeling long-range temporal dependency, efficiency issues, and accurate multi-modal alignment (if language is involved). To ease long-range dependency issues, some works explore either feature memory banks (Wu et al., 2019; Feng Cheng, 2022), tracked object-level representations (Wu and Krahenbuhl, 2021), bayesian non-parametric model (Qiu et al., 2023), or structured state-space sequence layers (Islam and Bertasius, 2022). To alleviate efficiency issues, other works (Lin et al., 2022b) exploit dense audio sampling as additional information to enable sparse video frame sampling. In contrast, CONE mitigates both efficiency issues via query-guided window selection strategy and multi-modal alignment issues via novel contrastive learning incorporation. + +Contrastive Learning. Contrastive learning has been widely studied in vision (Misra and Maaten, 2020; He et al., 2020), language (Gao et al., 2021b; Meng et al., 2021), and multi-modal fields (Liang et al., 2020; Yan et al., 2021; Wang et al., 2022). Some recent VTG works also attempt to adopt contrastive learning. They mainly focus on frame-level contrastive loss via hard negative mining (Zheng et al., 2022) or contrasting ground-truth frame with non-ground-truth frame (Nan et al., 2021; Zhang et al., 2021a). In contrast, we further propose window-level contrastive learning to repel the negative windows. Moreover, CONE also jointly incorporates contrastive vision-text pre-trained models for accurate alignment, because those contrastive models show strong multi-modal alignment ability (Luo et al., 2021; Xu et al., 2021) derived from pre-training large-scale vision-text pairs. + +# 3 Task Definition + +Since never-ending video streams in real applications have a higher demand for long videos, in this paper, we study the task of video temporal grounding (VTG) in a more challenging setting with long video inputs. Taking a natural language (NL) query $Q$ and a long video $V$ as the inputs, the task of VTG requires the system to locate the matched moment $M$ from the video $V$ relevant to the query + +$Q$ . Formally, video $V = [v_{1}, v_{2}, \ldots, v_{L_{v}}]$ is a sequence of uniformly sampled video frames, and $L_{v}$ denotes the length of the sampled frames. The NL query $Q = [q_{1}, q_{2}, \ldots, q_{L_{q}}]$ is a sequence of tokens with sentence length $L_{q}$ . The moment $M$ is a subsequence of $V$ that is relevant to $Q$ . The long-form video setting is more challenging because of the natural demands for more computation and time to process the entire video. Moreover, the accurate multi-modal alignment between each $v_{i}$ and $Q$ is also harder when $L_{v}$ increases. + +# 4 Approach + +We present the proposed CONE for long video temporal grounding. As shown in Fig. 2, we first slice the long video into several fixed-length video windows via a sliding window mechanism (§ 4.1). Then, we propose a coarse-to-fine mechanism for efficient and effective multi-modal alignment. At the coarse-grained window level, we introduce a query-guided window selection strategy (§ 4.2) to accelerate inference and select semantic relevant windows. At the window-proposal joint learning level, we rely on the existing VTG work for short videos to generate reliable candidate proposals and conduct both intra-window and proposed interwindow contrastive learning (§ 4.3) to assign each proposal score. At the fine-grained proposal level, we further accurately rank candidate proposals with a fine-grained ranking (§ 4.4) mechanism. + +# 4.1 Window-based Video Slicing + +To flexibly handle long videos without decreasing the sample rate and alleviate temporal information loss, we first slice the entire video $V$ into several video windows $W$ . A sliding window with window length $L_{w}$ is used to be slid on the entire video to derive a set of $N_{w}$ fixed-length video windows $W_{i} = [v_{w_{i}^{b} + 1}, v_{w_{i}^{b} + 2}, \dots, v_{w_{i}^{b} + L_{w}}]$ , where $w_{i}^{b}$ is the start index of window $i$ . Concretely, we slide the window by increasing $w^{b}$ with window stride $L_{w}/2$ . Intuitively, not every window is correlated with the NL query, so we refer the positive window to the window overlapping with the ground-truth moment, and the negative window otherwise. + +# 4.2 Coarse-grained Window Selection + +Lengthy video input is sliced into a sequence of windows during inference. If the number of windows is $N_{w}$ , the model needs to conduct the whole encoding-prediction process for $N_{w}$ times, which + +![](images/4b6cd11e99d3cef5580c68f36436a7474250760e2ad9d31b588d79fe84d03ae8.jpg) +Figure 2: Overview of CONE. It slices the long video into candidate windows ( $\S$ 4.1), selects semantic relevant windows ( $\S$ 4.2), generates candidate proposals ( $\S$ 4.3), and ranks these proposals ( $\S$ 4.4). + +will become computationally costly with increased video length, especially when the model has enormous parameters. Therefore, it is necessary to reduce the inference computation cost by reliably filtering windows irrelevant to the natural language descriptions. We propose a query-guided window selection strategy via contrastive vision-text pretrained models. + +Vision-Text Contrastive Model. CLIP (Radford et al., 2021) and EgoVLP (Lin et al., 2022a) are pre-trained with large-scale vision-text pairs via contrastive learning, aiming to align the visual representation with its related text representation. So they excel at multi-modal alignment, and efficient dot-product score computation provides higher matching efficiency. We utilize the pre-trained model to compute the video features $V$ and the text features $Q$ beforehand. + +$$ +\begin{array}{l} \boldsymbol {V} = [ \boldsymbol {v} _ {1}, \boldsymbol {v} _ {2}, \dots , \boldsymbol {v} _ {L _ {v}} ] \\ \text {O} \end{array} \tag {1} +$$ + +$$ +\boldsymbol {Q} = \left[ \boldsymbol {q} _ {[ \mathrm {C L S} ]}, \boldsymbol {q} _ {1}, \boldsymbol {q} _ {2}, \dots , \boldsymbol {q} _ {L q} \right] +$$ + +where [CLS] is a special token at the beginning of text tokens. The multi-modal matching score $a_{j} = \pmb{v}_{j}\cdot \pmb{q}_{[\mathrm{CLS}]}$ is computed via the efficient dot product between $j^{th}$ video feature and the text feature. And the window-level matching score $A_{i}$ is the maximum score of all the frames in window $i$ : + +$$ +A _ {i} = \max \left(\left[ a _ {w _ {i} ^ {b} + 1}, a _ {w _ {i} ^ {b} + 2}, \dots , a _ {w _ {i} ^ {b} + L _ {w}} \right]\right) \tag {2} +$$ + +We rank all windows with $A_{i}$ and select the top- $k$ windows for inference. Thus, we reduce the number of candidate windows from $N_{w}$ to a constant $k$ to guarantee a controllable computation cost in an efficient and reliable manner. + +# 4.3 Window (Coarse)-Proposal (Fine) Joint Contrastive Learning + +Since there are many excellent works in the VTG literature for short video input, we target CONE as a flexible plug-and-play framework on top of the existing proposed-based model. Existing models function as the base model to generate reliable candidate moment proposals for further processing. In our scenario, the base model takes window $W$ and the NL query $Q$ as inputs and outputs several moment proposal candidates. Each of them has a moment proposal $(p_i)$ and corresponding score $(s_i)$ , respectively. + +Nevertheless, the training of the base model typically focuses only on the positive window and conducts intra-window relation learning but neglects plenty of negative windows for long videos. In real practice, negative windows are the majority during inference, which results in a discrepancy between training and inference. To mitigate the discrepancy, we further design inter-window contrastive learning to distinguish the positive and negative windows. As a result, the overall training loss consists of two parts: (1) the intra-window loss of the base model, and (2) the proposed inter-window contrastive loss. + +Concretely, each training instance has both a positive window and a random contrasting negative window from the long video. We discriminate the negative window from the positive window through proposal-level comparison. Proposals in the negative window should be assigned with minimized scores compared with positive proposals (e.g., the IoU with ground truth is large than 0.7) in the posi + +
DatasetDomain#Query (train/val/test)#VideoNvocab\( \overline{L}_{\text{video}} \)\( \overline{L}_{\text{query}} \)\( \overline{L}_{\text{moment}} \)\( \delta_{\text{moment}} \)
Ego4D-NLQOpen11,291 / 3,874 / 4,005998 / 328 / 3333.3K8.25min7.58.3s2.8s
MADMovie280,183 / 32,064 / 72,044488 / 50 / 11261.4K110.77min12.73.9s3.2s
+ +Table 1: Statistics of two benchmarks. $N_{vocab}$ is word vocabulary size, $\overline{L}_{video}$ is average video length, $\overline{L}_{query}$ is average query word number, $\overline{L}_{moment}$ and $\delta_{moment}$ are the average and median ground-truth moment length. + +tive window, as follows, + +$$ +\mathcal {L} _ {\text {c o n}} = - \sum_ {p _ {i} ^ {+} \in W ^ {+}} \log \left(s _ {i}\right) - \sum_ {p _ {i} ^ {-} \in W ^ {-}} \log \left(1 - s _ {i}\right) \tag {3} +$$ + +where $L_{con}$ is the proposed contrastive loss, $p_i^+$ is each positive proposal from the positive window $W^+$ and $p_i^-$ is each proposal from the negative window $W^-$ , $s_i$ is the corresponding proposal score. + +This mechanism can be generalized to different existing proposal-based models with different intrawindow losses. To show the generalization ability of CONE, we test on two kinds of base models: 2D-TAN (Zhang et al., 2020b) and Moment-DETR(Lei et al., 2021) due to their available codes and superior performances. Please refer to Appendix A.2 for comprehensive training details. + +# 4.4 Fine-grained Proposal Ranking + +With the increased length of video inputs, the fine-grained attention between each video frame and the text query will be weakened by many other perturbed frames, resulting in contextual information loss. To remedy this issue, we propose a fine-grained ranking strategy to conduct accurate proposal ranking utilizing proposal matching scores computed by contrastive vision-text pre-trained models (described in § 4.2). Note that we simply re-use the pre-computed video frames and text query features as in Eq. (1). + +Visual Adapter. With a lightweight visual adapter on top of CLIP, we exploit adapter-based tuning to adapt the representations from the general contrastive model to the data distribution of the current downstream task. Inspired by Gao et al. (2021a), our main idea is to add an additional bottleneck layer to learn the task-adaptive visual features and conduct residual-style blending with the original pre-trained features. The lightweight adapter complies with a 2-layer FFN followed by ReLU. The $i^{th}$ adapted visual feature is: $\hat{v}_i = \text{Adapter}(\boldsymbol{v}_i) + \boldsymbol{v}_i$ . Then, the proposal feature for the $j^{th}$ proposal is computed with the mean pooling of all the adapted video features in it: $h_j = \text{Mean}([\hat{\boldsymbol{v}}_{b_j}, \dots, \hat{\boldsymbol{v}}_{e_j}])$ + +For adapter training, we denote the positive proposal (with feature $h_{pos}$ ) as the ground-truth one, and the negative proposals are the other in the same batch. We follow the standard contrastive learning and use the NCE loss: + +$$ +\mathcal {L} _ {\text {a d a p t}} = - \sum_ {\text {p o s}} \left(\log \frac {\exp \left(\boldsymbol {h} _ {\text {p o s}} \cdot \boldsymbol {q} _ {\text {[ C L S ]}}\right)}{\sum_ {j} \exp \left(\boldsymbol {h} _ {j} \cdot \boldsymbol {q} _ {\text {[ C L S ]}}\right)}\right) \tag {4} +$$ + +Note that we also use the adapted visual feature to compute the window-level matching score in § 4.2 to improve window selection quality. + +Ranking Score Computation. Finally, we aim to conduct a fine-grained ranking for proposals. For the $j^{th}$ proposal, the final ranking score is fused with two components: (1) proposal scores $s_j$ generated from the previous module and (2) fine-grained matching scores $m_j$ computed by adapted CLIP-based proposal feature: $m_j = h_j \cdot q_{[CLS]}$ . The former captures the correlation between proposals via the sophisticated contextual model design, while the latter focuses on fine-grained content matching between frames in the proposal and the textual query. We perform min-max normalization for these two types of scores for a more stable score fusion. The final ranking score $r_j$ is the sum of two normalized scores: + +$$ +\tilde {s _ {j}} = M i n M a x ([ s _ {1}, s _ {2}, \dots , s _ {N _ {p}} ]), +$$ + +$$ +\tilde {m} _ {j} = \operatorname {M i n M a x} \left(\left[ m _ {1}, m _ {2}, \dots , m _ {N _ {p}} \right]\right) \tag {5} +$$ + +$$ +r _ {j} = \tilde {s} _ {j} + \tilde {m} _ {j} +$$ + +where $N_{p}$ is the total candidate proposal number. + +# 5 Experiments + +We conduct experiments to explore the effectiveness of CONE from the following aspects: (1) model comparison with SOTA methods ( $\S 5.3$ ); (2) ablation study to analyze the impact of each component and different variants ( $\S 5.4$ ); (3) efficiency analysis of acceleration with window selection ( $\S 5.5$ ) and (4) qualitative analysis ( $\S 5.6$ ). Implementation details are given in Appendix A.1. + +# 5.1 Dataset + +We conduct comprehensive experiments on two representative large-scale benchmarks on long video + +
ModelIoU = 0.1IoU = 0.3IoU = 0.5
R1R5R10R50R1R5R10R50R1R5R10R50
2D-TAN*3.2211.9019.0139.632.529.2514.7232.651.585.699.0622.46
Moment-DETR*3.6012.9820.7041.322.819.8615.5332.021.675.588.6817.97
VLG-Net3.6411.6617.3939.782.769.3114.6534.271.655.999.7724.93
CLIP6.5715.0520.2637.923.139.8514.1328.711.395.448.3818.80
CONE (2D-TAN)8.3020.5226.2736.616.4316.4621.8333.213.5510.4415.0726.49
CONE (Moment-DETR)8.9020.5127.2043.366.8716.1121.5334.734.109.5912.8220.56
+ +Table 2: Performance on the test set of MAD dataset. We implement the models with * and report their performances. + +
ModelFeatureIoU = 0.3IoU = 0.5
R1R5R1R5
Validation split
2D-TANSF + B5.0412.892.025.88
Moment-DETR*SF + B5.0917.172.999.16
2D-TAN*EgoVLP7.1018.283.8211.00
Moment-DETR*EgoVLP8.2323.235.0113.37
VSLNetEgoVLP10.8418.846.8113.45
CONE (2D-TAN)EgoVLP11.0025.066.0915.51
CONE (Moment-DETR)SF + B10.6424.475.7613.32
CONE (Moment-DETR)EgoVLP14.1530.338.1818.02
Test split
2D-TAN*EgoVLP6.8914.863.808.47
Moment-DETR*EgoVLP9.1418.665.0510.59
VSLNetEgoVLP10.4616.766.2411.29
CONE (2D-TAN)EgoVLP11.0819.965.8711.44
CONE (Moment-DETR)EgoVLP13.4623.687.8414.16
+ +Table 3: Performance on the Ego4D-NLQ dataset. SF + B is short for the SlowFast and Bert features. We implement the models with * and report their performances. + +temporal grounding: Ego4D-NLQ (Grauman et al., 2022) and MAD (Soldan et al., 2022). The data statistics are summarized in Table 1. + +Ego4D-NLQ is a subtask of the Ego4D dataset. Ego4D is a large-scale egocentric video understanding benchmark, where 931 camera wearers worldwide record their daily activities in hundreds of scenarios. The unedited videos involved have variant lengths ranging from $3.5\mathrm{min}$ to $20\mathrm{min}$ . The NL query is designed to retrieve the relevant moment from the episodic memory of camera wearers, and involves 13 question types for locating different types of information. + +MAD is a large-scale long video temporal grounding benchmark on full-length movie videos. The video duration is magnificent longer than previous benchmarks at an average length of 110.8 min (ranging from 47 min. to 202 min). The textual queries in the training set are derived from translated movie audio descriptions from professional narrators. The annotations in the evaluation set are of higher quality derived from the LSMDC + +dataset (Rohrbach et al., 2017) with more strict manual refinement. The NL queries are cleaner and the ground-truth moments have preciser temporal boundaries. + +# 5.2 Experimental Settings + +# 5.2.1 Evaluation Metric. + +For consistent comparison, we follow the previous baseline evaluation setting and use the metric Recall@k at IoU = $\theta$ (R@k). It is the percentage of queries, having at least one prediction among the top-k predictions, whose temporal IoU with ground-truth is larger than the threshold $\theta$ (0.3 or 0.5). Note that there is only one ground-truth answer for each query in both datasets. + +# 5.2.2 Visual and Textual Features. + +For MAD dataset, we use CLIP (Radford et al., 2021) to extract the visual and textual features, which are then utilized in the inputs of the window selection, proposal generation, and fine-grained ranking stages. The MAD authors extract the visual features every 0.2s (5fps). For Ego4D-NLQ dataset, we adopt the egocentric contrastive pre-trained model, i.e., EgoVLP (Lin et al., 2022a), to extract visual and textual features, because CLIP is trained with third-person image-text pairs and has the domain adaptation gap for first-person videos. We extract the visual feature every 16 frames (1.875fps). + +# 5.3 Model Comparison + +# 5.3.1 Baselines. + +We compare CONE to the following methods: (1) the window-based adaptation of proposal-based models, i.e., 2D-TAN (Zhang et al., 2020b), VLG-Net (Soldan et al., 2021) and MomentDETR (Lei et al., 2021); (2) the sparse sampling-based proposal-free model VSLNet (Zhang et al., 2020a); (3) the two-stage model CLIP (Radford et al., 2021), which first generates offline proposals + +and then ranks those proposals with CLIP matching scores. + +Results on Ego4D-NLQ. Table 3 reports the performance comparison on the validation and the blind test set of Ego4D-NLQ. Regarding all the metrics, CONE outperforms these baselines by a large margin. Take R1@IoU=0.3 and R5@IoU=0.3 as examples, the absolute performance gains are +3.31% and +11.49% on the val. set, and +3% and +6.92% on the blind test set, respectively. CONE also achieves consistent performance gains using different features and base models, showing a better generalization ability. + +Results on MAD. The main results of MAD are shown in Table 2, and demonstrate that CONE achieves state-of-the-art performances with obvious boost (e.g., $3.13\% \xrightarrow{+119\%} 6.87\%$ and $9.85\% \xrightarrow{+63.5\%} 16.11\%$ improvement on R1@IoU=0.3 and R5@IoU=0.3). + +From the two tables, the SOTA performance on two benchmarks demonstrates the effectiveness of CONE. We speculate the outstanding results are brought by the following reasons: (1) CONE processes the entire video without decreasing sample rate, which alleviates temporal information loss; (2) the coarse-to-fine mechanism enables the better alignment ability of relevant proposals to the NL query and reduces contextual information loss. The lower results on the MAD benchmark also verify that the grounding task indeed becomes more challenging with longer videos. + +Regarding base model selection, we observe that, compared with Moment-DETR, the performance of 2D-TAN is worse in Ego4D-NLQ but comparable in the MAD dataset. This gives the clues that the base model might not be influential to the final results given more training samples for hour-level videos. Because of the lower parameter and GLOPs number of Moment-DETR, from now on, CONE adopts it as the default base model. + +# 5.4 Model Analysis + +Ablation studies are shown in table 4 to unveil the effectiveness of each component in CONE. We consider three components: (a) contrastive loss ( $\S 4.3$ ), which is eliminated by only training on positive windows without our contrastive loss; (b) fine-grained ranking fusion ( $\S 4.4$ ) can be removed by taking only the proposal score from the proposal generation module for ranking; (c) visual adapter + +
ModelEgo4D-NLQMAD
CONE14.156.91
w/o visual adapter12.626.73
w/o fine-grained ranking11.594.66
w/o contrastive learning8.232.56
+ +Table 4: Cumulative ablation study on the val. set of Ego4D-NLQ and MAD datasets, taking R1@IoU=0.3 as the metric. + +$(\S 4.4)$ is removed by using general CLIP-based features for matching score computation. Note that the full CONE model refers to the first row, and the baseline model (i.e., the window-based adaptation of Moment-DETR) refers to the last row. + +From the table 4, we highlight the following findings for Ego4D-NLQ dataset (MAD shows similar trends): (1) Ablating visual adapter leads to a performance drop from $14.15\%$ to $12.62\%$ , which indicates that domain-adaptation of visual features is essential in modelling task-specific semantic variance. (2) Eliminating fine-grained ranking also harms the performance (row 2 vs. row 3), showing that capturing fine-grained semantic alignment benefits accurate grounding. (3) Further removing contrastive loss (row 3 vs. row 4) leads to a significant performance drop of $3.36\%$ , which reveals that identifying the inter-window semantic variance is critical for reliable grounding. + +![](images/4a4bb7102aff93b830b32e727cdc75c15245686746ea29a0e816ebca8f52e2e8.jpg) +Figure 3: Performance (Recall k@IoU=0.3) on both datasets w.r.t different window lengths. + +![](images/0d739f058cc49d005807bbe6ecf500dc46e32b8a9e70e8e25e2907418ac0d611.jpg) + +Influence of window length. Figure 3 exhibits how different window lengths affect the overall performance of CONE. We observe that increasing the window length indeed brings performance variance. Longer window length (more visible frames in a single window) can model the interaction between more frames, but can also weaken the multi-modal attention between the NL query and every single frame as the performance drops significantly with the largest window size. We find a better tradeoff between window length and performance, i.e., nearly 48 seconds (90 video features) for Ego4D-NLQ and nearly 25 seconds (125 video features) for MAD through this analysis. + +# 5.5 Efficiency Analysis + +![](images/73baddc364bd576b4a1f682204f39510572d89ab815a7e599d9acc7a83d6b49c.jpg) +Figure 4: Inference time w.r.t window numbers is denoted by red dashed lines for efficiency analysis. Performance (Recall k@IoU=0.3) w.r.t window numbers is shown with solid lines. + +Figure 4 shows inference speed with respect to different window numbers after the window selection stage on the val. sets of Ego4D-NLQ and MAD. We observe that the overall inference time is approximately linearly reduced with smaller window numbers, and the performance of CONE is relatively stable when the filtered window number becomes 10 for both datasets. Surprisingly, we also observe that CONE achieves the optimal performance (shown as the box with value in Fig. 4) at a modest size of window number rather than the full size. Those observations show that our query-guided window selection strategy can reliably filter the irrelevant windows and largely improve the efficiency of long video temporal grounding. + +Concretely, the average window numbers for full videos (before filtering) are 23.3 and 588 for Ego4D-NLQ and MAD, respectively. If we set the filtered window number to 10 for Ego4D-NLQ and 30 for MAD (better trade-off values obtained from Fig. 4), the total numbers of windows for inference are reduced by $2.3\mathrm{x}$ and $19.6\mathrm{x}$ , with a marginal performance variance $(R@1)$ by $-0.1\%$ and $+0.2\%$ for Ego4D-NLQ and MAD benchmarks, respectively. In real practice, we consider the effect of implementation methods and window selection time. When CONE is inferred using one P100 GPU, its running time (w/o feature extraction and post-processing time, because both time costs are the same for all methods) is largely reduced (74 s $\xrightarrow{-2\mathrm{x}}$ 36 s and 276 min. $\xrightarrow{-15\mathrm{x}}$ 18 min.) on the val. set of Ego4D-NLQ and MAD. + +Furthermore, we also conduct an inference comparison between VSLNet and CONE on Ego4D-NLQ. Using the official Ego4D released code, VSLNet takes approximately 12 seconds to infer the Ego4D validation split and achieves a Recall@1 score of 10.84 at IoU=0.3. In contrast, CONE, with + +the extreme setting of selecting only the top 1 window, takes about 10.5 seconds to infer the Ego4D validation split and achieves a Recall@1 score of 12.4 at IoU=0.3. It demonstrates that CONE strikes an optimal tradeoff between accuracy and speed compared to sparse sampling-based baselines. + +# 5.6 Qualitative Analysis + +Fig. 5 shows two success examples to analyze the effect of contrastive learning and fine-grained ranking. We observe that baseline Moment-DETR (a) is not capable of repelling negative windows and tends to give an equally high score to the proposal in the negative window, thus it wrongly ranks the correct prediction to a much lower position (e.g., $54^{th}$ in Example A). Further adding inter-window contrastive learning mechanism (b), the rank position of the ground truth moment is somewhat improved, but it still lacks fine-grained matching to detailed contents to push the perfect proposal into the first place. For example, in Query-A, the most essential object is the vegetable rather than the bag; In Query-B, the query requires the precise scene "in the park" and the objects "two women" and "ribbons". Finally, adding fine-grained ranking (c), the full CONE successfully locates the ground-truth moment relevant to the textual query. More qualitative examples with both success and failure cases are shown in Appendix B. + +# 6 Conclusions + +We present CONE, a COarse-to-fiNE alignment framework for long video temporal grounding. CONE jointly achieves state-of-the-art performances on two benchmarks and high efficiency while keeping high frame sample rate. Through our experiments, we show the proposed coarse-to-fine mechanism via contrastive learning plays an important role in boosting performance. Regarding efficiency, the introduced query-guided window selection strategy largely accelerates inference by 2x and 15x on Ego4D-NLQ and MAD benchmarks, respectively, with even slight performance gains. Since CONE can be generalized with different existing proposal-based models, we hope it can be used to improve the model efficiency and performance for temporal grounding on long videos. + +# Limitations + +Currently, CONE is mainly implemented for proposal-based models as they can generate ex + +![](images/cd3218df9309230e15245c33e9bd8d0212e41076c71563a2ff117aafddbc6afc.jpg) +Figure 5: Two successful examples. Example-A and Example-B come from the Ego4D-NLQ and MAD datasets, respectively. We compare three settings: (a) baseline Moment-DETR; (b) CONE w/o fine-grained ranking and (c) the full CONE. The major difference between (a) and (b) is inter-window contrastive learning. + +plicit moment proposals for the introduced interwindow contrastive learning. In contrast, proposal-free methods (e.g., VSLNet (Zhang et al., 2020a)) directly predict the start/end timestamps without explicit proposals. In the future, it is worthwhile to explore how to incorporate the coarse-to-fine alignment mechanism with proposal-free methods to enhance the generalization ability of CONE. + +Furthermore, CONE falls short on the ground-truth moment case whose duration is longer than the adopted video window duration. To ease this issue, future work can explore adaptive-duration window slicing to ensure complete containment of scenes and events within windows or some rule-based proposal merging techniques. + +# Ethics Statement + +The present study was conducted in accordance with ethical principles. This study involved the analysis using publicly available data and did not involve any human participants, and potential risks about credentials or privacy. Therefore, no ethical clearance was required and there were no potential risks associated with the conduct of this research. + +# Acknowledgements + +We thank the anonymous reviewers for their insightful feedback. This research was partially supported by CityU MF_EXT project number 9678180. + +# References + +Lisa Anne Hendricks, Oliver Wang, Eli Shechtman, Josef Sivic, Trevor Darrell, and Bryan Russell. 2017. + +Localizing moments in video with natural language. In Proceedings of the IEEE International Conference on Computer Vision, pages 5803-5812. + +Meng Cao, Long Chen, Mike Zheng Shou, Can Zhang, and Yuexian Zou. 2021. On pursuit of designing multi-modal transformer for video grounding. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 9810-9823, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. + +Gedas Bertasius Feng Cheng. 2022. Tallformer: Temporal action localization with a long-memory transformer. In Proceedings of the European Conference on Computer Vision (ECCV). + +Jiyang Gao, Chen Sun, Zhenheng Yang, and Ram Nevata. 2017. TALL: temporal activity localization via language query. In Proceedings of the IEEE International Conference on Computer Vision, pages 5267-5275. + +Peng Gao, Shijie Geng, Renrui Zhang, Teli Ma, Rongyao Fang, Yongfeng Zhang, Hongsheng Li, and Yu Qiao. 2021a. Clip-adapter: Better vision-language models with feature adapters. arXiv preprint arXiv:2110.04544. + +Tianyu Gao, Xingcheng Yao, and Danqi Chen. 2021b. 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. + +Soham Ghosh, Anuva Agarwal, Zarana Parekh, and Alexander G. Hauptmann. 2019. Excl: Extractive clip localization using natural language descriptions. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics, pages 1984-1990. + +Kristen Grauman, Andrew Westbury, Eugene Byrne, Zachary Chavis, Antonino Furnari, Rohit Girdhar, Jackson Hamburger, Hao Jiang, Miao Liu, Xingyu Liu, et al. 2022. Ego4d: Around the world in 3,000 hours of egocentric video. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 18995-19012. +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. +Zhijian Hou, Chong-Wah Ngo, and Wing Kwong Chan. 2021. Conquer: Contextual query-aware ranking for video corpus moment retrieval. In Proceedings of the 29th ACM International Conference on Multimedia, pages 3900-3908. +Md Mohaiminul Islam and Gedas Bertasius. 2022. Long movie clip classification with state-space video models. In Proceedings of the European Conference on Computer Vision (ECCV). +Ranjay Krishna, Kenji Hata, Frederic Ren, Li Fei-Fei, and Juan Carlos Niebles. 2017. Dense-captioning events in videos. In Proceedings of the IEEE International Conference on Computer Vision, pages 706-715. +Jie Lei, Tamara L Berg, and Mohit Bansal. 2021. Detecting moments and highlights in videos via natural language queries. Advances in Neural Information Processing Systems, 34:11846-11858. +Jie Lei, Licheng Yu, Mohit Bansal, and Tamara Berg. 2018. TVQA: Localized, compositional video question answering. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 1369-1379, Brussels, Belgium. Association for Computational Linguistics. +Jie Lei, Licheng Yu, Tamara Berg, and Mohit Bansal. 2020a. TVQA+: Spatio-temporal grounding for video question answering. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 8211-8225, Online. Association for Computational Linguistics. +Jie Lei, Licheng Yu, Tamara L Berg, and Mohit Bansal. 2020b. Tvr: A large-scale dataset for video-subtitle moment retrieval. In Proceedings of the European Conference on Computer Vision, pages 447-463. +Zujie Liang, Weitao Jiang, Haifeng Hu, and Jiaying Zhu. 2020. Learning to contrast the counterfactual samples for robust visual question answering. In Proceedings of the 2020 conference on empirical methods in natural language processing (EMNLP), pages 3285-3292. +Kevin Qinghong Lin, Alex Jinpeng Wang, Mattia Soldan, Michael Wray, Rui Yan, Eric Zhongcong Xu, Difei Gao, Rongcheng Tu, Wenzhe Zhao, Weijie Kong, et al. 2022a. Egocentric video-language pretraining. arXiv preprint arXiv:2206.01670. + +Yan-Bo Lin, Jie Lei, Mohit Bansal, and Gedas Bertasius. 2022b. Eclipse: Efficient long-range video retrieval using sight and sound. In Proceedings of the European Conference on Computer Vision (ECCV). +Huaishao Luo, Lei Ji, Ming Zhong, Yang Chen, Wen Lei, Nan Duan, and Tianrui Li. 2021. Clip4clip: An empirical study of clip for end to end video clip retrieval. arXiv preprint arXiv:2104.08860. +Yu Meng, Chenyan Xiong, Payal Bajaj, Paul Bennett, Jiawei Han, Xia Song, et al. 2021. Coco-lm: Correcting and contrasting text sequences for language model pretraining. Advances in Neural Information Processing Systems, 34:23102-23114. +Ishan Misra and Laurens van der Maaten. 2020. Self-supervised learning of pretext-invariant representations. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6707-6717. +Guoshun Nan, Rui Qiao, Yao Xiao, Jun Liu, Sicong Leng, Hao Zhang, and Wei Lu. 2021. Interventional video grounding with dual contrastive learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2765-2775. +Jielin Qiu, Franck Dernoncourt, Trung Bui, Zhaowen Wang, Ding Zhao, and Hailin Jin. 2023. Liveseg: Unsupervised multimodal temporal segmentation of long livestream videos. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pages 5188-5198. +Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. 2021. Learning transferable visual models from natural language supervision. In International Conference on Machine Learning, pages 8748-8763. PMLR. +Santhosh Kumar Ramakrishnan, Ziad Al-Halah, and Kristen Grauman. 2023. Naq: Leveraging narrations as queries to supervise episodic memory. arXiv preprint arXiv:2301.00746. +Anna Rohrbach, Atousa Torabi, Marcus Rohrbach, Niket Tandon, Christopher Pal, Hugo Larochelle, Aaron Courville, and Bernt Schiele. 2017. Movie description. International Journal of Computer Vision, 123(1):94-120. +Mattia Soldan, Alejandro Pardo, Juan León Alcazar, Fabian Caba, Chen Zhao, Silvio Giancola, and Bernard Ghanem. 2022. Mad: A scalable dataset for language grounding in videos from movie audio descriptions. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5026-5035. + +Mattia Soldan, Mengmeng Xu, Sisi Qu, Jesper Tegner, and Bernard Ghanem. 2021. Vlg-net: Video-language graph matching network for video grounding. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 3224-3234. +Zixu Wang, Yujie Zhong, Yishu Miao, Lin Ma, and Lucia Specia. 2022. Contrastive video-language learning with fine-grained frame sampling. In Proceedings of the 2nd Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics and the 12th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 694-705. +Chao-Yuan Wu, Christoph Feichtenhofer, Haoqi Fan, Kaiming He, Philipp Krahenbuhl, and Ross Girshick. 2019. Long-term feature banks for detailed video understanding. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 284-293. +Chao-Yuan Wu and Philipp Krahenbuhl. 2021. Towards long-form video understanding. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 1884-1894. +Hu Xu, Gargi Ghosh, Po-Yao Huang, Dmytro Okhonko, Armen Aghajanyan, Florian Metze, Luke Zettlemoyer, and Christoph Feichtenhofer. 2021. Video-CLIP: Contrastive pre-training for zero-shot videotext understanding. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 6787-6800, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Jun Xu, Tao Mei, Ting Yao, and Yong Rui. 2016. Msr-vtt: A large video description dataset for bridging video and language. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 5288-5296. +Kun Yan, Lei Ji, Huaishao Luo, Ming Zhou, Nan Duan, and Shuai Ma. 2021. Control image captioning spatially and temporally. 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 2014-2025. +Antoine Yang, Antoine Miech, Josef Sivic, Ivan Laptev, and Cordelia Schmid. 2022. Tubedetr: Spatiotemporal video grounding with transformers. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 16442-16453. +Runhao Zeng, Haoming Xu, Wenbing Huang, Peihao Chen, Mingkui Tan, and Chuang Gan. 2020. Dense regression network for video grounding. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). +Hao Zhang, Aixin Sun, Wei Jing, Guoshun Nan, Liangli Zhen, Joey Tianyi Zhou, and Rick Siow Mong + +Goh. 2021a. Video corpus moment retrieval with contrastive learning. In Proceedings of the 44th International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 685-695. +Hao Zhang, Aixin Sun, Wei Jing, Liangli Zhen, Joey Tianyi Zhou, and Rick Siow Mong Goh. 2021b. Natural language video localization: A revisit in span-based question answering framework. IEEE transactions on pattern analysis and machine intelligence. +Hao Zhang, Aixin Sun, Wei Jing, and Joey Tianyi Zhou. 2020a. Span-based localizing network for natural language video localization. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 6543-6554, Online. Association for Computational Linguistics. +Hao Zhang, Aixin Sun, Wei Jing, and Joey Tianyi Zhou. 2022. The elements of temporal sentence grounding in videos: A survey and future directions. arXiv preprint arXiv:2201.08071. +Mingxing Zhang, Yang Yang, Xinghan Chen, Yanli Ji, Xing Xu, Jingjing Li, and Heng Tao Shen. 2021c. Multi-stage aggregated transformer network for temporal language localization in videos. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 12669-12678. +Songyang Zhang, Houwen Peng, Jianlong Fu, and Jiebo Luo. 2020b. Learning 2d temporal adjacent networks for moment localization with natural language. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 12870-12877. +Minghang Zheng, Yanjie Huang, Qingchao Chen, Yuxin Peng, and Yang Liu. 2022. Weakly supervised temporal sentence grounding with gaussian-based contrastive proposal learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 15555-15564. +Hao Zhou, Chongyang Zhang, Yan Luo, Yanjun Chen, and Chuanping Hu. 2021. Embracing uncertainty: Decoupling and de-bias for robust temporal grounding. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 8445-8454. + +# A Model Details + +# A.1 Implementation Details + +During training, we perform parameter optimization via AdamX and set the learning rate to 1e-4 for the base model and 1e-5 for the visual adapter. We set the batch size to 32 and adopt the early stopping strategy. During inference, we use Non-Maximum Suppression (NMS) with a threshold of 0.5 as post-processing. + +Moment-DETR Base Model. The experiments are conducted on one P100 GPU. For the hyperparameters of network architecture, we set the hidden size $d$ to 256, the transformer layer number in the encoder/decoder to 2, and the moment query number to 5. As a result, the total parameters of CONE are 4.35M (4.22M Moment-DETR + 0.13M visual adapter). We set the window length to 90 video features (48 seconds) and 125 video features (25 seconds) for the Ego4D-NLQ and MAD datasets, respectively. We train Ego4D-NLQ for 150 epochs and MAD for 30 epochs, and the training time is about 3 hours for the Ego4D-NLQ and 18 hours for the MAD dataset. During inference, we set the filtered window number to 10 and 30 for the Ego4D-NLQ and MAD datasets, respectively. + +2D-TAN Base Model. The experiments are conducted on two V100 GPUs. For the hyperparameters of network architecture, we set the hidden size $d$ to 256, the convolution network layer to 4, and the kernel size to 9. As a result, the total parameters of CONE are 23.99M (23.86M 2D-TAN + 0.13M visual adapter). We set the window length to 64 video features (34.1 seconds) and 128 video features (25.6 seconds) for the Ego4D-NLQ and MAD datasets, respectively. We train Ego4D-NLQ for 90 epochs and MAD for 6 epochs, and because of 6x more model parameters than Moment-DETR, the training time is quite larger, i.e., about 18 hours for the Ego4D-NLQ and 3 days for the MAD dataset. During inference, we set the filtered window number to 5 and 15 for the Ego4D-NLQ and MAD datasets, respectively. + +# A.2 Training Loss Details + +Moment-DETR Base Model. The original loss of Moment-DETR consists of three parts: moment localization, classification, and saliency losses. Localization loss requires ground truth moment to measure the discrepancy with the predictions and + +can not be used in contrastive loss. Thus, we design two-level contrastive losses based on two other losses: (1) proposal-level loss and (2) frame-level loss with a randomly sampled negative window. + +For the proposal-level contrastive loss $(\mathcal{L}_p)$ , proposals in the negative window are assigned with minimized scores compared to positive proposal (i.e., the optimal proposal selected from the Hungarian algorithm) from the positive window, as follows, + +$$ +\mathcal {L} _ {p} = - \sum_ {p _ {i} ^ {+} \in W ^ {+}} \log (s _ {i}) - \sum_ {p _ {i} ^ {-} \in W ^ {-}} \log (1 - s _ {i}) \tag {6} +$$ + +where $p_i^+$ is the positive proposal from the positive window $W^+$ and $p_i^-$ is each proposal from the negative window $W^-$ , $s_i$ is the corresponding proposal score. + +For the frame-level loss $\mathcal{L}_f$ , we set the average saliency scores for frames located in the positive window is larger than the maximum saliency score of frames in the negative window over a margin $\delta$ : + +$$ +\mathcal {L} _ {f} = \max (0, \delta + \max (S \left(W ^ {-}, Q\right)) - \operatorname {m e a n} (S \left(W ^ {+}, Q\right)) \tag {7} +$$ + +where $S()$ is its saliency scoring function. So the overall contrastive loss is $\mathcal{L}_{con} = L_p + L_f$ . + +2D-TAN Base Model. The original loss of 2D-TAN consists of the binary cross-entropy loss, which learns to align each proposal score with its scaled IoU value. Thus, we assign each proposal in the negative window with minimized scores compared to the positive proposals (i.e., the IoU with ground truth is large than 0.7) from the positive window, as follows, + +$$ +\mathcal {L} _ {p} = - \sum_ {p _ {i} ^ {+} \in W ^ {+}} \log (s _ {i}) - \sum_ {p _ {i} ^ {-} \in W ^ {-}} \log (1 - s _ {i}) \tag {8} +$$ + +where $p_i^+$ is the positive proposal from the positive window $W^+$ and $p_i^-$ is each proposal from the negative window $W^-$ , $s_i$ is the corresponding proposal score. And the overall contrastive loss is $\mathcal{L}_{con} = L_p$ . + +Overall Loss. In total, our training loss $(\mathcal{L})$ consists of three parts: (1) original training loss of the base model; (2) contrastive loss to discriminate the negative window versus the positive window; (3) adapter loss (shown in Eq. 4) to tune visual representations from general pre-training to the current downstream task: + +$$ +\mathcal {L} = L _ {\text {o r i}} + \lambda_ {\text {c o n}} \times L _ {\text {c o n}} + \lambda_ {\text {a d a p t}} \times L _ {\text {a d a p t}} \tag {9} +$$ + +Example-A: Now in a park, men and women relax in and around a small pavilion. + +![](images/7bb2dc02146fc63973a91fd14d3a3724a1463972d5e864ad529c156fa7313cec.jpg) +Figure 6: Four success examples on the MAD dataset. + +where $\lambda_{con}$ and $\lambda_{adapt}$ are loss weight hyperparameters to control the loss value. During training, we set $\lambda_{con}$ to 1 and $\lambda_{adapt}$ to 0.2. + +# B More Qualitative Examples + +We show four success cases in Figure 6 and four failure cases of our model CONE in Figure 7. + +Example-A: Where is the kettle before I picked it? + +![](images/528bc86d4668edbdb867392c8461a859a957235668c9a58f87bbc2c65287ba2e.jpg) + +Example-B: Several young teens with a basketball rush past into the park. + +![](images/a3e38a30357e76023e77873ae45b77bb090aacf446b41b2b21eec715600b6994.jpg) + +Example-C: The spotlight projects the children's shadows onto the screen as they kiss. + +![](images/78cea070be6ca2a69501d99313ec364133c1f86ee9bb693ca4aa780595a994fd.jpg) + +Example-D: He pauses and digs his cell phone from his pocket. + +![](images/7a14eaea9d0183951b4500524259463b1bcc7dd9abcb436c165fa0cba212d4f3.jpg) +Figure 7: Four failure examples. Example-A comes from the Ego4D-NLQ dataset; the remaining three examples are from the MAD dataset. + +A For every submission: + +A1. Did you describe the limitations of your work? section 6 page 9 +A2. Did you discuss any potential risks of your work? section 6 page 9 +A3. Do the abstract and introduction summarize the paper's main claims? section 1 +A4. Have you used AI writing assistants when working on this paper? Left blank. + +B Did you use or create scientific artifacts? + +experiments section 5 + +B1. Did you cite the creators of artifacts you used? experiments section 5 +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? Not applicable. Left blank. +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? Ethics Statement +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? Ethics Statement +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? Not applicable. Left blank. +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. Table 1 + +C Did you run computational experiments? + +experiments section 5 + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? appendix A + +The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? +appendix A +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? +experiments section 5 +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? Not applicable. Left blank. + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? Not applicable. Left blank. +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? Not applicable. Left blank. +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? Not applicable. Left blank. +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? Not applicable. Left blank. +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? Not applicable. Left blank. \ No newline at end of file diff --git a/coneanefficientcoarsetofinealignmentframeworkforlongvideotemporalgrounding/images.zip b/coneanefficientcoarsetofinealignmentframeworkforlongvideotemporalgrounding/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..345617f4989e75d1dea1d8c7b920bf7c0a4d031d --- /dev/null +++ b/coneanefficientcoarsetofinealignmentframeworkforlongvideotemporalgrounding/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ba01c82831d01306e4001936bcd52a230ba89a267eb818d543ab3edfe8ce5f04 +size 902056 diff --git a/coneanefficientcoarsetofinealignmentframeworkforlongvideotemporalgrounding/layout.json b/coneanefficientcoarsetofinealignmentframeworkforlongvideotemporalgrounding/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..15ccf8bf19c4355e38fd5af49d003b10f90b2a25 --- /dev/null +++ b/coneanefficientcoarsetofinealignmentframeworkforlongvideotemporalgrounding/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc10a840841b2b489845cb5aa3ddce6ffa39d7073e23cceeac43e439b1fb0923 +size 492954 diff --git a/corecooperativetrainingofretrieverrerankerforeffectivedialogueresponseselection/20932914-9855-4bd1-9dd4-11ba6efe4b04_content_list.json b/corecooperativetrainingofretrieverrerankerforeffectivedialogueresponseselection/20932914-9855-4bd1-9dd4-11ba6efe4b04_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..ac70e0f7d0ff862e9a8c423dc5d63787eb21887e --- /dev/null +++ b/corecooperativetrainingofretrieverrerankerforeffectivedialogueresponseselection/20932914-9855-4bd1-9dd4-11ba6efe4b04_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0177f20e4df0679a5bf44016d425357704d846f0ab6d39d651a0c1923947b543 +size 88786 diff --git a/corecooperativetrainingofretrieverrerankerforeffectivedialogueresponseselection/20932914-9855-4bd1-9dd4-11ba6efe4b04_model.json b/corecooperativetrainingofretrieverrerankerforeffectivedialogueresponseselection/20932914-9855-4bd1-9dd4-11ba6efe4b04_model.json new file mode 100644 index 0000000000000000000000000000000000000000..e25dc8077b3e5ef931b7799b4b2808976e67cc7f --- /dev/null +++ b/corecooperativetrainingofretrieverrerankerforeffectivedialogueresponseselection/20932914-9855-4bd1-9dd4-11ba6efe4b04_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f25bfb6610eb462d6c006dedc564c19dd8bbba5c15779189a8efba0d9290fe26 +size 110439 diff --git a/corecooperativetrainingofretrieverrerankerforeffectivedialogueresponseselection/20932914-9855-4bd1-9dd4-11ba6efe4b04_origin.pdf b/corecooperativetrainingofretrieverrerankerforeffectivedialogueresponseselection/20932914-9855-4bd1-9dd4-11ba6efe4b04_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ff2327bfb6cddac6baba8ae767155c24eb90a7ae --- /dev/null +++ b/corecooperativetrainingofretrieverrerankerforeffectivedialogueresponseselection/20932914-9855-4bd1-9dd4-11ba6efe4b04_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:59be422536dca4b3d27f8b051a38ddf5688d66d3f37a31ac65046f3ff0fa71a8 +size 610133 diff --git a/corecooperativetrainingofretrieverrerankerforeffectivedialogueresponseselection/full.md b/corecooperativetrainingofretrieverrerankerforeffectivedialogueresponseselection/full.md new file mode 100644 index 0000000000000000000000000000000000000000..cb8d5f6ed3912f38e4e039e05da81a23b9a87d86 --- /dev/null +++ b/corecooperativetrainingofretrieverrerankerforeffectivedialogueresponseselection/full.md @@ -0,0 +1,382 @@ +# CORE: Cooperative Training of Retriever-Reranker for Effective Dialogue Response Selection + +Chongyang Tao $^{1}$ , Jiazhan Feng $^{2}$ , Tao Shen $^{3}$ , Chang Liu $^{2}$ , Juntao Li $^{4}$ , Xiubo Geng $^{1}$ , Daxin Jiang $^{1*}$ + +1Microsoft, Beijing, China + +$^{2}$ Peking University, Beijing, China + +3University of Technology Sydney, Sydney, Australia + +4 Soochow University, Suzhou, China + +$^{1}\{chotao,xigeng,djiang\} @$ microsoft.com $^{3}$ shentao@uts.edu.cn + +$^{2}\{fengjz, \text { changliu }\} @$ pku.edu.cn $^{4} l j t@s u d a.e d u.c n$ + +# Abstract + +Establishing retrieval-based dialogue systems that can select appropriate responses from the pre-built index has gained increasing attention. Recent common practice is to construct a two-stage pipeline with a fast retriever (e.g., bi-encoder) for first-stage recall followed by a smart response reranker (e.g., cross-encoder) for precise ranking. However, existing studies either optimize the retriever and reranker in independent ways, or distill the knowledge from a pre-trained reranker into the retriever in an asynchronous way, leading to sub-optimal performance of both modules. Thus, an open question remains about how to train them for a better combination of the best of both worlds. To this end, we present a cooperative training of the response retriever and the reranker whose parameters are dynamically optimized by the ground-truth labels as well as list-wise supervision signals from each other. As a result, the two modules can learn from each other and evolve together throughout the training. Experimental results on two benchmarks demonstrate the superiority of our method. + +# 1 Introduction + +The development of a smart human-computer conversation system has been a longstanding objective in the field of artificial intelligence. Recent years have seen an increase in interest in constructing dialogue systems through data-driven approaches, leveraging advancements in deep learning techniques (Vaswani et al., 2017; Devlin et al., 2019). With the help of information retrieval (IR) techniques to select an appropriate response from a pre-built index (Lowe et al., 2015; Whang et al., 2020), or text generation techniques to synthesize a + +response (Zhang et al., 2019), existing neural models are now capable of providing natural replies to user queries. In this paper, we concentrate on retrieval-based dialogue systems (Lowe et al., 2015; Boussaha et al., 2019; Yu et al., 2021; Su et al., 2021), which can deliver smooth and informative responses, and have powered industrial applications (Shum et al., 2018; Ram et al., 2018). + +Retrieval-based dialogue systems usually follow the retrieval-eranking paradigm (Wang et al., 2013; Li et al., 2017), i.e., two-stage retrieval model, where the model first retrieves a bundle of response candidates from a pre-built index by a fast retriever and then selects an appropriate one with a more sophisticated yet costly response reranker. Specifically, as for the retriever, early methods based on hand-crafted features (Robertson et al., 2004; Qiu et al., 2017) (e.g., BM25) for fast retrieval, however suffering from vocabulary mismatch problem, especially in context-to-response retrieval. A recent trend is resorting to deep neural model to represent text as dense embeddings in latent semantic space, which is known as Siamese encoder or bi-encoder (Lowe et al., 2015; Henderson et al., 2019a; Humeau et al., 2020; Henderson et al., 2019b; Lan et al., 2021). Attributed to the separate encoding paradigm, it can calculate the embeddings of large-scale response candidates to pre-build vector retrieval index, benefiting from high efficiency during online inference. However, it sacrifices fine-grained interactions between a context and the response candidates but only remains sentence-level metric learning, leading to inferior ranking performance. As a remedy, a common practice is to apply a costly yet effective reranker to the retrieved candidates for more precise response selection (Whang et al., 2020; Gu et al., 2020; Whang et al., 2021). This is usually achieved by a cross + +encoder operating on the text concatenation of the context and each response for its reranking score. + +In existing two-stage retrieval models from IR tasks, the retriever and reranker are usually optimized in independent ways (Henderson et al., 2020; Lan et al., 2021; Yang et al., 2021), or distill the knowledge from a pre-trained reranker into the retriever in an asynchronous fashion (Tahami et al., 2020; Yu et al., 2021). While the knowledge distillation from the reranker can improve the performance of the retriever, the reranker's parameters are usually frozen so it cannot learn from the feedback from the retriever for a positive loop – the feedback can be (i) the retriever built upon a heterogeneous structure can offer a distinct view to regularize the reranker, and (ii) the reranker conversely can provide more effective supervision to make the retriever more generalizable. However, how to train these two modules in a joint way is still an open question. + +To this end, we propose to unify the training process for both the retriever and the reranker for their mutual benefits in a retrieval-based dialogue system. Specifically, we introduce a cooperative training of the retriever and the response reranker (named CORE) whose parameters are dynamically optimized by the ground-truth labels as well as listwise supervision signals from each other, which enables two models to learn from each other throughout the training process. By combining the fast dense retriever and smart response reranker with a unified architecture and a cooperative training manner, our framework achieves impressive performance while demonstrating acceptable efficiency. + +We conduct experiments on two benchmarks, i.e., Ubuntu Dialogue Corpus (Lowe et al., 2015) and the response selection track of Dialog System Technology Challenge 7 (abbr. DSTC7) (Gunasekara et al., 2019), where the model is required to select the best response from a candidate pool. Evaluation results indicate our model is significantly better than existing models on the benchmarks, and the cooperative training brings consistent improvements over both the retriever and reranker. To sum up, our main contributions are three-fold: + +- Exploration of combining the efficient response retriever and effective reranker for dialogue retrieval; +- Proposal of training the response retriever and response reranker cooperatively with the su + +pervision of list-wise ranking signals provided by each other; + +- Empirical verification of the proposed approach on two public benchmarks. + +# 2 Related Works + +Retrieval-based Dialogues. In the past, retrieval-based dialogue systems focused on single-turn response selection using message-response pairs as inputs for matching models, as demonstrated in early studies such as (Wang et al., 2013; Ji et al., 2014; Wang et al., 2015). However, more recent attention has been given to multi-turn response selection using context-response matching. This includes methods such as dual-LSTM (Lowe et al., 2015), multi-view matching model (Zhou et al., 2016), deep attention matching network (DAM) (Zhou et al., 2018), and multi-hop selector network (MSN) (Yuan et al., 2019). With the success of pre-trained language models (Devlin et al., 2019; Liu et al., 2020) in various NLP tasks, researchers have started to apply them to response selection. For instance, Vig and Ramea (2019) used BERT to represent utterance-response pairs and fused these representations to calculate the matching score. Similarly, Whang et al. (2020) treated context as a long sequence and conducted context-response matching with BERT. Furthermore, Gu et al. (2020) incorporated speaker-aware embeddings into BERT to enhance the ability of multi-turn context understanding. + +Efficient Information Retrieval. Existing information retrieval models (Wang et al., 2013; Qiu et al., 2017; Nogueira and Cho, 2019; Nogueira et al., 2019) usually adopt a pipeline method where an efficient first-stage retriever retrieves a small set of candidates from the entire corpus, and then a powerful but slow second-stage ranker reranks them. However, most of the models rely on traditional lexical-based methods (such as BM25) to perform the first stage of retrieval and the ranking models of different stages are learned separately. Recently, as a promising approach, Dense Retrieval (DR) has been widely used for Ad-hoc retrieval (Zhan et al., 2020; Chang et al., 2020; Luan et al., 2021) and open-domain question answering (Lee et al., 2019; Karpukhin et al., 2020; Xiong et al., 2020) because it is as fast as traditional methods and can achieve impressive performance. In retrieval-based dialogue, Humeau et al. (2020) + +presents the Poly-encoder, an architecture with an additional learned attention mechanism that represents more global features from which to perform self-attention, resulting in performance gains over Bi-encoders and large speed gains over PLM-based models. Besides, Henderson et al. (2020) introduce ConveRT which is a compact dual-encoder pretraining architecture for neural response selection. Tahami et al. (2020) utilize knowledge distillation to compress the cross-encoder network as a teacher model into the student bi-encoder model. + +Joint Training of Bi- and Cross-Encoder. Few works in passage/document retrieval have been proposed to train the bi- and cross-encoder jointly but stand with different motivations or/and targets. For example, AR2 (Zhang et al., 2021) proposes an adversarial method, where it regards the bi-encoder as a retrieval-based generator for the hard negatives to fool the discriminator built upon a cross-encoder; RocketQAv2 (Ren et al., 2021) passes the ground-truth labels to cross encoder and learns bi encoder based solely on the ranking scores from the cross-encoders. To the best of our knowledge, this paper makes the first attempt to combine the efficient dense retriever and smart response selector for building an effective response retrieval system. Besides, different from traditional single-directional distillation (from reranker to retriever) (Tahami et al., 2020) in dialogue, we jointly learn response retriever and selector with a cooperative training framework, where reranker also receives weak listwise supervision signals provided by the retriever. Our training schema is similar to the idea of mutual learning (Zhang et al., 2018) and enables mutual knowledge transfer in a synchronous way. Evaluation results also reveal that the retriever and the reranker can co-improve and our full-ranking performance is better than existing distillation methods. + +# 3 Methodology + +Problem Formalization Given a data set $\mathcal{D} = \{(y, c, r)_z\}_{z=1}^N$ where $c = \{u_1, \dots, u_{n_c}\}$ represents a $n_c$ turns of conversation context with $u_i$ the $i$ -th turn, $r$ is a response candidate, and $y \in \{0, 1\}$ denotes a label with $y = 1$ indicating $r$ a proper response for $c$ and otherwise $y = 0$ . The goal of the task of response selection is to build a matching model $\phi(\cdot, \cdot)$ from $\mathcal{D}$ . For any input context $c$ and a candidate response $r$ , $\phi(c, r)$ gives a score that reflects the matching degree between $c$ and $r$ . Ac + +cording to $\phi (c,r)$ , one can rank a set of response candidates for response selection. In particular, the definition of $\phi (\cdot ,\cdot)$ can be a single-stage model or a two-stage model. + +Overall Framework Retrieval models re-use existing human conversations and select a proper response from a group of candidates for new user input. Our method is designed within the retrievalthen-rerank paradigm. Specifically, given a message or a conversation context (i.e., a message with several previous turns as conversation history), we use a fast dense retrieval method based on a pretrained bi-encoder architecture as the retriever. In the response re-ranking stage, we employ a more powerful architecture (such as a cross-encoder) to re-rank a small number of the most promising candidates provided by the fast retrieval model. To further improve the effectiveness of the overall system, we introduce a cooperative training of the retriever and the response reranker whose parameters are dynamically optimized by the ground-truth labels and list-wise supervision signals provided by each other, which enables two modules to evolve together and learn from each other throughout the joint training. + +# 3.1 Response Retriever + +Inspired by the recent dense retrieval (Lee et al., 2019; Zhan et al., 2020; Karpukhin et al., 2020), we use a bi-encoder architecture to construct a learnable retriever. The architecture utilizes a separated pre-trained encoder to cast the input context message and index entries into dense representations in a vector space and relies on fast maximum innerproduct search (MIPS) to complete the retrieval. Without loss of generality, we use two BERT (Devlin et al., 2019) models for both encoders, as it is trained on large amounts of unlabeled data and provides strong "universal representations" that can be finetuned on task-specific data to achieve good performance on downstream tasks. + +Specifically, given the $i$ -th example with the context $c_{i}$ and a response candidate $r_{i,j}$ , we first concatenate all utterances in the context as a consecutive token sequence with special tokens separating them, formulated as $x = \{[\mathrm{CLS}], u_{1}, [\mathrm{SEP}], \ldots, u_{n_{c}}, [\mathrm{SEP}]\}$ . Here [CLS] and [SEP] are the classification symbol and the segment separation symbol. For each word in $x$ , token position and segment embeddings are summed and fed into BERT, giving us the contextualized + +![](images/1f03197119a6f57b3fc488ccb0c13e7d5ec0190b496ee17636b85d57b2eed759.jpg) +Figure 1: Overall architecture of our model (CORE). $\mathcal{R}(c,r)$ in the left dotted box means the response retriever in the first stage, and $\mathcal{G}(c,r)$ in the right dotted box refers to the response-eranker in the second stage. + +embedding sequence. The output [CLS] representation denoted as $E_{c_i}$ is the final context representation aggregating dialogue history information. We then follow the same scheme to obtain the response representation $E_{r_{i,j}}$ for a response candidate $r_{i,j}$ . Lastly, the retrieval score is computed as + +$$ +\mathcal {R} \left(c _ {i}, r _ {i, j}; \Theta_ {\mathcal {R}}\right) = E _ {c _ {i}} E _ {r _ {i, j}} ^ {\top}. \tag {1} +$$ + +For each training sample, the loss function of the response retriever is defined by + +$$ +\begin{array}{l} \mathcal {L} _ {\mathrm {C E}} (c _ {i}, r _ {i} ^ {+}, r _ {i, 1} ^ {-}, \dots , r _ {i, \delta_ {r}} ^ {-}; \Theta_ {\mathcal {R}}) \\ = - \log \left(\frac {\exp^ {\mathcal {R} \left(c _ {i} , r _ {i} ^ {+}\right)}}{\exp^ {\mathcal {R} \left(c _ {i} , r _ {i} ^ {+}\right)} + \sum_ {j = 1} ^ {\delta_ {r}} \exp^ {\mathcal {R} \left(c _ {i} , r _ {i , j} ^ {-}\right)}}\right), \tag {2} \\ \end{array} +$$ + +where $r_i^+$ is the true response for a given $c_{i},r_{i,j}^{-}$ is the $j$ -th negative response candidate randomly sampled from the training set, $\delta_r$ denotes the number of negative response candidate, $\Theta_{\mathcal{R}}$ represents the parameters of the retriever. + +# 3.2 Response Reranker + +To further re-rank a small number of promising candidates provided by the fast dense retrieval, we consider a powerful pre-trained cross-encoder architecture (Devlin et al., 2019) to build the response reranker, as it has demonstrated impressive results on various response selection task (Whang et al., 2020; Gu et al., 2020). Consistent with previous works (Whang et al., 2020), we also select BERT as the backbone for a fair comparison. + +Specifically, we first concatenate all utterances in the context as well as the response candidate as a single consecutive token sequence with special tokens separating them formulated + +as $x = \{[\mathrm{CLS}],u_1,[\mathrm{SEP}],\ldots ,[\mathrm{SEP}],u_{n_c},[\mathrm{SEP}],$ $r,[\mathrm{SEP}]\}$ . Similarly, token, position and segment embeddings are also used. After being processed by $\mathrm{BERT}_{\mathcal{G}}$ the input sequence is transformed into a contextualized embedding sequence. $\mathrm{BERT}_{\mathcal{G}}[\mathrm{CLS}]$ is an aggregated representation vector that contains the semantic interaction information for the context-response pair. We then fed $\mathrm{BERT}_{\mathcal{G}}[\mathrm{CLS}]$ into a multi-layer perception to obtain the final matching score for the contextresponse pair: + +$$ +\mathcal {G} (c, r; \Theta_ {\mathcal {G}}) = \sigma (W _ {1} \cdot \mathrm {B E R T} _ {\mathcal {G}} [ \mathrm {C L S} ]) + b _ {1}, +$$ + +where $W_{1}$ and $b_{1}$ are trainable parameters, $\sigma (\cdot)$ is the sigmoid function. $\Theta_{\mathcal{G}}$ denotes the parameters of the reranker. Finally, the training objective of the response reranker $\mathcal{L}_{\mathrm{CE}}(c_i,r_i^+, \{r_{i,j}^-\}_{j=1}^{\delta_r}; \Theta_{\mathcal{G}})$ can also be defined as the negative log-likelihood loss similar to Equation (2). + +# 3.3 Cooperative Training for Response Retrieval (CORE) + +Traditional supervised method either individually trains two models to predict the correct labels or transfer knowledge from a well-trained reranker into the retriever via vanilla distillation (Tahami et al., 2020). To improve the effectiveness of our overall systems, we propose to optimize the retriever and the response reranker at the same time in a cooperative training manner, which enables two models to learn or transfer knowledge from each other throughout the training process. Formally, for the $i$ -th training examples $\{c_i, r_{i,j}\}_{j=1}^{\delta_r+1}$ (where each dialogue context corresponds to a response candidate list), the probability that $\langle c_i, r_{i,m} \rangle(m \in$ + +Algorithm 1: Our cooperative learning method +Input: Training set $\mathcal{D}$ , learning rate $\eta$ , number of epochs $n_e$ , number of iterations $n_k$ parameters of Retriever $\Theta_{\mathcal{R}}$ , parameters of Reranker $\Theta_{\mathcal{G}}$ +1 for $e = 1,2,\dots,n_e$ do +for $t = 1,2,\dots,n_k$ do +Fetch a batch of training data $\mathcal{B}$ . +Compute predictions $\mathcal{A}$ and $\kappa$ . +Compute the gradient and update $\Theta_{\mathcal{R}}$ .. +6 $\Theta_{\mathcal{R}}\gets \Theta_{\mathcal{R}} + \eta \frac{\partial\mathcal{J}_{\Theta_{\mathcal{R}}}(\mathcal{B})}{\partial\Theta_{\mathcal{R}}}$ +7 Compute the gradient and update $\Theta_{\mathcal{G}}$ .. +8 end +9 end Output: $\Theta_{\mathcal{R}},\Theta_{\mathcal{G}}$ + +$[1, \delta_r + 1]$ is a true context-response pair given by the response retriever $\Theta_{\mathcal{R}}$ is computed as + +$$ +\mathcal {A} _ {i, m} = \frac {\exp \left(\mathcal {R} \left(c _ {i} , r _ {i , m}\right) / \tau\right)}{\sum_ {j = 1} ^ {\delta_ {r} + 1} \exp \left(\mathcal {R} \left(c _ {i} , r _ {i , j}\right) / \tau\right)}, \tag {3} +$$ + +where $\mathcal{R}(c_i,r_{i,j})$ is the output logit of response retriever, $\tau$ is the temperature to soften $\mathcal{R}(c_i,r_{i,j})$ . Therefore, we can construct a vector of matching scores $\pmb{A}_i = [\mathcal{A}_1,\dots ,\mathcal{A}_{\delta_r + 1}]$ for the response candidate list. The output probability of response selector can be computed by replacing $\mathcal{R}(\cdot ,\cdot)$ with $\mathcal{G}(\cdot ,\cdot)$ and is denoted as $\kappa_{i} = [\kappa_{1},\dots ,\kappa_{\delta_{r} + 1}]$ . + +In order to enhance the generalization performance of the response retriever $\mathcal{R}(\cdot)$ , we leverage the response reranker $\mathcal{G}(\cdot)$ to provide training experience through its posterior probability $\kappa_{i}$ . We adopt the Kullback Leibler (KL) Divergence (Kullback, 1997) to measure the discrepancy between the predictions of the two models, i.e., $\mathbf{A}_{i}$ predicted by $\mathcal{R}(\cdot)$ and $\kappa_{i}$ predicted by $\mathcal{G}(\cdot)$ . Formally, the KL loss is defined as: + +$$ +D _ {K L} \left(\mathcal {A} _ {i} \| \mathcal {K} _ {i}\right) = \sum_ {i = 1} ^ {N} \sum_ {m = 1} ^ {M} \mathcal {A} _ {i, m} \log \frac {\mathcal {K} _ {i , m}}{\mathcal {A} _ {i , m}}. \tag {4} +$$ + +Therefore, the overall loss function $\mathcal{I}_{\Theta_{\mathcal{R}}}$ for response retriever $(\Theta_{\mathcal{R}})$ can be re-defined as + +$$ +\mathcal {J} _ {\Theta_ {\mathcal {R}}} (\mathcal {D}) = \sum_ {c _ {i} \in \mathcal {D}} \mathcal {L} _ {\mathrm {C E}} \left(c _ {i}; \Theta_ {\mathcal {R}}\right) + \gamma_ {\mathcal {R}} \cdot D _ {K L} \left(\mathcal {K} _ {i} \| \mathcal {A} _ {i}\right), \tag {5} +$$ + +where $\mathcal{L}_{\mathrm{CE}}(c_i;\Theta_{\mathcal{R}})$ is the cross-entropy loss defined in Equation 2. $\gamma_{\mathcal{R}}$ is the weight for the trade-off of two losses. + +We also utilize the posterior probability of a less sophisticated retriever $\Theta_{\mathcal{R}}$ to provide a training experience for the response reranker $\Theta_{\mathcal{G}}$ . Our motivation stems from the fact that the retriever built upon a heterogeneous structure can offer a distinct perspective to regularize the reranker. Thus, the loss function $\mathcal{J}_{\Theta_{\mathcal{G}}}$ for response reranker is accordingly re-defined as + +$$ +\mathcal {J} _ {\Theta_ {\mathcal {G}}} (\mathcal {D}) = \sum_ {c _ {i} \in \mathcal {D}} \mathcal {L} _ {\mathrm {C E}} \left(c _ {i}; \Theta_ {\mathcal {G}}\right) + \gamma_ {\mathcal {G}} \cdot D _ {K L} \left(\boldsymbol {A} _ {i} \| \boldsymbol {\mathcal {K}} _ {i}\right). \tag {6} +$$ + +where $\mathcal{L}_{\mathrm{CE}}(c_i;\Theta_{\mathcal{G}})$ is the cross-entropy loss for the reranker, and $\gamma_{\mathcal{G}}$ is the parameter for the trade-off of two losses. In the above loss function, the retriever can provide more fine-grained supervision (via list-wise distribution) using KL loss, which can help the training of the reranker and enhance its generalizability. Yuan et al. (2020) explained such knowledge distillation process as a type of learned label smoothing regularization, and showed that a weaker student can also transfer knowledge and bring improvement to a stronger teacher in computer vision tasks. Our experimental results also affirm the value of incorporating feedback from the less sophisticated response retriever. + +Thereby, both the response retriever and reranker learn to correctly predict the true label of training instances (supervised loss) as well as to match the probability estimate of its counterpart (KL loss). After learning models from $\mathcal{D}$ , we first rank the response index according to $\mathcal{R}(c,r)$ and then select top $n_r$ response candidates $\{r_1,\dots ,r_{n_r}\}$ for the subsequent response re-ranking process. Algorithm 1 gives a pseudo-code of our method. + +Remark. Firstly, our proposed cooperative training method differs from the vanilla distillation employed in two-stage IR models (Tahami et al., 2020; Yu et al., 2021), which involves transferring knowledge from a pre-trained reranker to the retriever via a point-wise distillation loss. Instead, our approach jointly optimizes the retriever and reranker through a list-wise supervision loss, enabling them to improve each other. Secondly, while our cooperative training shares similarities with mutual learning (Zhang et al., 2018) and co-teaching (Han et al., 2018) in machine learning, our focus is on jointly training different architectures that combine the fast dense retriever and the smart reranker. Moreover, our cooperative training transfers knowledge between the two modules using list-wise supervision signals, as opposed to point-wise class signals. + +# 4 Experiments + +We evaluate the proposed method on two benchmark datasets for both single-state and two-stage multi-turn response selection tasks. + +# 4.1 Datasets and Evaluation Metrics + +The first dataset is the track 2 of Dialog System Technology Challenge 7 (DSTC7) (Gunasekara et al., 2019). The dataset is constructed by applying a new disentanglement method (Kummerfeld et al., 2018) to extract conversations from an IRC channel of technical help for the Ubuntu system. We use the copy shared by Humeau et al. (2020) which contains about 2 million context-response pairs for training. At test time, the systems were provided with conversation histories, each paired with a set of response candidates that could be the next utterance in the conversation. Systems are needed to rank these options. We test our model on two sub-tasks. For each dialog context in sub-task 1, a candidate pool of 100 is given and the contestants are expected to select the best next utterance from the given pool. In sub-task 2, a large candidate pool of 120,000 utterances is shared by validation and testing sets. The next best utterance should be selected from this large pool. In both sub-tasks, there are 5,000 and 1,000 dialogues for validation and testing respectively. + +The second dataset is the Ubuntu Dialogue Corpus (v2.0) (Lowe et al., 2015), which consists of multi-turn English dialogues about technical support and is collected from chat logs of the Ubuntu forum. We use the copy shared of Jia et al. (2020), which has 1.6 million context-response pairs for training, 19,560 pairs for validation, and 18,920 pairs for test. The ratio of positive candidates and negative candidates is $1:9$ in all three sets. + +Following Humeau et al. (2020), we employ hits@k and Mean Reciprocal Rank (MRR) as evaluation metrics, where hits@k measures the probability of the positive response being ranked in top $k$ positions among candidates. + +# 4.2 Baselines + +We compare our method on both the traditional multi-turn response selection scenario as well as the two-stage retrieval scenario. In particular, the following multi-turn response selection models are selected to compare with our results. + +- DAM (Zhou et al., 2018) follows the represent-match-aggregate paradigm, where + +the representation is derived using both self and cross-attention mechanisms. + +- ESIM (Chen and Wang, 2019) is a extension of the original ESIM (Chen et al., 2017) which was developed specifically for natural language inference tasks. +- IMN (Gu et al., 2019) is a hybrid model with sequential characteristics at the matching layer and hierarchical characteristics at the aggregation layer. +- Bi-Enc (Humeau et al., 2020) share the same architecture as our pre-retriever, but is only optimized with cross-entropy loss. +- Bi-Enc (Distillation) (Humeau et al., 2020) share the same architecture as our pre-retriever and is trained by distilling knowledge from a well-trained cross-encoder. +- Poly-Enc (Humeau et al., 2020) represents the context and response candidates separately, and then employs an improved attention mechanism to allow the response to interact with the context. +- Cross-Enc (Humeau et al., 2020) has the same architecture as our reranker and is optimized by cross-entropy loss. The model is the SOTA model based on PLMs. + +# 4.3 Implementation Details + +Following Humeau et al. (2020), we select English uncased $\mathrm{BERT}_{\mathrm{base}}$ pre-trained on Reddit corpus as the context-response matching model. The maximum lengths of the context and response are set to 300 and 72. Intuitively, the last tokens in the context and the previous tokens in the response candidate are more important, so we cut off the previous tokens for the context but do the cut-off in the reverse direction for the response candidate if the sequences are longer than the maximum length. We choose 8 as the size of mini-batches for training. We implement the MIPS with Facebook AI Similarity Search library (Faisss²). During training, we set $\gamma_{\mathcal{R}}$ and $\gamma_{\mathcal{G}}$ to be 1.0 and 3.0 respectively through a simply parameter search. We set the number + +
ModelSub-task1 of DSTC7UbuntuV2
hits@1hits@10MRRhits@1hits@2hits@5MRR
DAM (Zhou et al., 2018)34.766.335.6----
ESIM (Chen and Wang, 2019)64.590.273.573.486.697.483.5
IMN (Gu et al., 2019)----77.188.697.9
Bi-Enc (Humeau et al., 2020)70.990.678.183.6-98.890.1
Poly-Enc (Humeau et al., 2020)71.291.578.283.9-98.890.3
Cross-Enc (Humeau et al., 2020)71.792.479.086.5-99.191.9
Bi-Enc (Our implementation)67.591.676.183.192.798.889.9
Cross-Enc (Our implementation)71.293.278.886.694.399.392.0
Bi-Enc (Distillation)69.592.277.184.593.198.990.7
Bi-Enc (CORE)72.4°93.5°80.0°85.7°93.8°99.0°91.5°
Cross-Enc (CORE)74.5°★93.7°★81.4°★87.4°★94.7°★99.5°92.6°★
+ +Table 1: Results on UbuntuV2 and sub-task1 of DSTC7. Numbers marked with $\circ$ and $\star$ mean that improvement to the original models and to the state-of-the-art is statistically significant (t-test, $p < 0.05$ ) respectively. + +
Modelhits@1hits@2hits@5hits@50MRRTest (ms/case)
BM251.42.04.211.910.0-
Bi-Enc8.612.218.738.113.6-
Bi-Enc (CORE)10.816.423.846.217.3-
BM25 → Bi-Enc6.99.612.415.89.345
BM25 → Poly-Enc7.29.712.615.89.446
BM25 → Cross-Enc8.010.413.515.810.3188
BM25 → Bi-Enc (CORE)8.110.112.715.610.045
BM25 → Cross-Enc (CORE)8.811.813.915.711.0188
Bi-Enc → Cross-Enc10.916.123.844.617.3188
Bi-Enc (Distillation) → Cross-Enc11.316.524.245.417.6188
Bi-Enc (CORE) → Cross-Enc (CORE)12.9*17.4*25.2*48.3*18.8*188
+ +Table 2: Evaluation results on task2 of DSTC7 dataset. We set $n_r = 100$ in all two-stage models. It is worth noting that the pre-retrieval with faiss library is very fast and we do not report this part of the time. Numbers marked with * mean that improvement to the state-of-the-art is statistically significant (t-test, $p < 0.05$ ). + +of negative response candidates $\delta_r = 32$ during the training3. In the two-stage retrieval scenario, we test $n_r$ in $\{10,50,100,200,500,800\}$ and set $n_r = 100$ for the trade-off the efficiency and effectiveness. The model is optimized using Adam optimizer with a learning rate set as $5e - 5$ . The learning rate is scheduled by warmup and linear decay. $\tau$ is set as 3. A dropout rate of 0.1 is applied for all linear transformation layers. + +# 4.4 Evaluation Results + +Results of traditional response selection. We first validate the effectiveness of our framework on a traditional response selection scenario. Ta + +ble 1 reports the evaluation results on sub-task1 of DSTC7 and UbuntuV2 where 10 and 100 response candidates are provided for each input context respectively. We can observe that the performance of response retriever (i.e., Bi-Enc (CORE)) and response reranker (i.e., Cross-Enc (CORE)) improve on almost all metrics after they are jointly optimized with cooperative training, indicating that the effectiveness of the proposed method on the multiturn response selection task. We also see that our cooperative training is more effective than the traditional vanilla distillation as Bi-Enc (CORE) significantly outperforms Bi-Enc (Distillation). Notably, cooperative training brings more significant improvement to the bi-encoder than the cross-encoder on both datasets. The results may stem from the fact that a cross-encoder (a stronger model) can + +![](images/10346e9eed1c72a3c326f6b81fb5d48b160fa6de3c41d830f8d47b4822c1b506.jpg) +Figure 2: The performance of our two-stage model and average test speed for different $n_r$ when using CrossEnc (CoRE) as the reranker on sub-task2 of DSTC7. + +provide a bi-encoder (a weaker model) with more useful knowledge during the cooperative training phase, but less on the contrary. With cooperative training, a simple bi-encoder even performs better than the original cross-encoder and poly-encoder on both datasets, although the poly-encoder and cross-encoder involve more heavy interaction. + +Results of two-stage response retrieval. We further conduct experiments on the two-stage response retrieval scenario. Table 2 contains the evaluation results of the sub-task2 of DSTC7. In this task, the model is expected to select the best response from a shared candidate pool of 120,000 responses, which is more challenging. Due to the huge number of indices, we make use of the MIPS to perform the fast retrieval, and the time spent in this stage is negligible compared with the response selection stage. According to the results, we can observe that: 1) Compared with using BM25 as the retriever, Bi-Enc can bring consistent and significant improvement to the overall retrieval system on both datasets, indicating the effectiveness of dense retrieval on the response selection task; 2) Cooperative training can improve the performance of both single-stage models (e.g., Bi-Enc vs Bi-Enc (CORE)) and two-stage model (e.g., the model in the last row); 3) By combining the bi-encoder model and smart cross-encoder model, our two-stage retrieval framework can achieve impressive performance while showing reasonable efficiency constraints compared with other baseline methods. + +# 4.5 Discussions + +The impact of $n_r$ . We first check the effectiveness and efficiency of re-ranking performance with respect to the number of top $n_r$ candidates returned from the response retriever. Figure 2 illustrates how the hit@1 score and average test speed of + +![](images/e37ce19990f21ed0001aefdbf9874f9e567fa5eb615375f32be07826c997f12a.jpg) +Figure 3: Hits@1 in the validation set of various models during the training on sub-task1 of DSTC7. + +the two-stage model varies under different $n_r$ when using the Cross-Enc (CORE) as the reranker on sub-task2 of DSTC7. We can observe the retrieval performance increases monotonically as $n_r$ keeps increasing and the improvement becomes smaller when context length reaches 500. Besides, it can be found that re-ranking as few as 10 or 50 candidates out of 120K from dense retriever is enough to obtain good performance under reasonable efficiency constraints. + +Training curve of retriever and reranker. We are curious if the response retriever and response reranker can co-improve when they are jointly trained with cooperative training. Figure 3 shows how the hits@1 score of Bi-Encoder, CrossEncoder, Bi-Encoder (CORE), and Cross-Encoder (CORE) changes with the number of epochs on the validation set of sub-task1 of DSTC7. We can see that cooperative training can improve both the performance of the response retriever (i.e., Bi-Enc (CORE)) and response reranker (i.e., Cross-Enc (CORE)), and the peer models move at almost the same pace. The results verify our claim that by cooperative training retriever-ranker, the two models can get improved together. Compared to independently optimized models, the models trained using our CoRe converge at a slower pace. This phenomenon could be due to the fact that the two models, built upon a heterogeneous structure, offer a distinct view that enables them to mutually regulate each other, thereby avoiding the model from reaching a local optimum. In addition, we can find that the performance improvement of Bi-Enc is greater than that of Cross-Enc. This is because Cross-Enc can provide Bi-Enc with more useful knowledge during the cooperative training phase. + +![](images/8d1a68265caff12eaf6fc4b44c03b9d27ffb4f0857f17fba11d65570db955c6b.jpg) +Figure 4: Performance of different models across the different lengths of contexts on sub-task1 of DSTC7. The number of testing samples in the three bins is 339, 356, 305 respectively. + +The impact of context length. We further conduct a study to investigate how the length of context influences the performance of these models. Figure 4 shows how the performance of the models changes with respect to different lengths of contexts on sub-task1 of DSTC7. We observe a similar trend for all models: they increase monotonically when context length keeps increasing. The phenomenon may come from the fact that the longer context can provide more useful information for response matching. Besides, we can find that cooperative training can bring performance improvements for both the bi-encoder and cross-encoder across all different context lengths, but the improvement is more obvious in longer context (e.g., (50,360]) for cross-encoder and more obvious in the short context (e.g., (0, 50]) for bi-encoder. + +# 5 Conclusion + +In this paper, to build an effective retrieval-based dialogue system, we explore combining the fast dense retriever and the smart response reranker based on PLMs with better cooperative training schema. Specifically, we propose optimizing the response retriever and the reranker at the same time via cooperative training loss, which enables the two modules to learn from each other throughout the training process. Experimental results on two benchmarks demonstrate the effectiveness of our proposed framework. + +# Limitation + +(i) Training computation overheads: although having the same inference complexity as any other two-stage retrieval-based dialogue system, our approach requires more computation resources during + +training as it needs to optimize the two modules in the meantime. (ii) Static negatives: we train both modules with a fixed number of random negative samples for a fair comparison with baselines. Actually, more effective negatives can be dynamically sampled by the fast retriever to the smart reranker to further improve its performance. + +# Ethical Statement + +Our paper primarily aims to enhance the training method for constructing retrieval-based dialogue systems that exhibit improved effectiveness. The training corpora we utilize, such as the Ubuntu Corpus and the response selection track of the Dialog System Technology Challenge, are openly accessible and do not give rise to any privacy concerns. Furthermore, the algorithm we propose is designed to be free from ethical or social bias, ensuring fairness and unbiased performance. + +# References + +Basma El Amel Boussaha, Nicolas Hernandez, Christine Jacquin, and Emmanuel Morin. 2019. Deep retrieval-based dialogue systems: A short review. arXiv preprint arXiv:1907.12878. +Wei-Cheng Chang, Felix X Yu, Yin-Wen Chang, Yiming Yang, and Sanjiv Kumar. 2020. Pre-training tasks for embedding-based large-scale retrieval. In International Conference on Learning Representations. +Qian Chen and Wen Wang. 2019. Sequential matching model for end-to-end multi-turn response selection. In ICASSP, pages 7350-7354. IEEE. +Qian Chen, Xiaodan Zhu, Zhen-Hua Ling, Si Wei, Hui Jiang, and Diana Inkpen. 2017. Enhanced LSTM for natural language inference. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1657-1668, Vancouver, 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 *NAACL*, pages 4171–4186. +Jia-Chen Gu, Tianda Li, Quan Liu, Zhen-Hua Ling, Zhiming Su, Si Wei, and Xiaodan Zhu. 2020. Speaker-aware bert for multi-turn response selection in retrieval-based chatbots. In Proceedings of the 29th ACM International Conference on Information Knowledge Management, page 2041-2044. +Jia-Chen Gu, Zhen-Hua Ling, and Quan Liu. 2019. Interactive matching network for multi-turn response selection in retrieval-based chatbots. In Proceedings + +of the 28th ACM International Conference on Information and Knowledge Management, pages 2321-2324. +Chulaka Gunasekara, Jonathan K Kummerfeld, Lazaros Polymenakos, and Walter Lasecki. 2019. Dstc7 task 1: Noetic end-to-end response selection. In Proceedings of the First Workshop on NLP for Conversational AI, pages 60-67. +Bo Han, Quanming Yao, Xingrui Yu, Gang Niu, Miao Xu, Weihua Hu, Ivor Tsang, and Masashi Sugiyama. 2018. Co-teaching: Robust training of deep neural networks with extremely noisy labels. Advances in neural information processing systems, 31. +Matthew Henderson, Inigo Casanueva, Nikola Mrkšić, Pei-Hao Su, Tsung-Hsien Wen, and Ivan Vulić. 2019a. Convert: Efficient and accurate conversational representations from transformers. arXiv preprint arXiv:1911.03688. +Matthew Henderson, Inigo Casanueva, Nikola Mrkšić, Pei-Hao Su, Tsung-Hsien Wen, and Ivan Vulić. 2020. ConveRT: Efficient and accurate conversational representations from transformers. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 2161-2174, Online. Association for Computational Linguistics. +Matthew Henderson, Ivan Vulic, Daniela Gerz, Inigo Casanueva, Paweł Budzianowski, Sam Coope, Georgios Spithourakis, Tsung-Hsien Wen, Nikola Mrkšić, and Pei-Hao Su. 2019b. Training neural response selection for task-oriented dialogue systems. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 5392-5404, Florence, Italy. Association for Computational Linguistics. +Samuel Humeau, Kurt Shuster, Marie-Anne Lachaux, and Jason Weston. 2020. Poly-encoders: Transformer architectures and pre-training strategies for fast and accurate multi-sentence scoring. In ICLR. +Zongcheng Ji, Zhengdong Lu, and Hang Li. 2014. An information retrieval approach to short text conversation. arXiv preprint arXiv:1408.6988. +Qi Jia, Yizhu Liu, Siyu Ren, Kenny Zhu, and Haifeng Tang. 2020. Multi-turn response selection using dialogue dependency relations. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1911-1920, Online. Association for Computational Linguistics. +Vladimir Karpukhin, Barlas Oğuz, Sewon Min, Patrick Lewis, Ledell Wu, Sergey Edunov, Danqi Chen, and Wen-tau Yih. 2020. Dense passage retrieval for open-domain question answering. In Empirical Methods in Natural Language Processing (EMNLP). +Solomon Kullback. 1997. Information theory and statistics. Courier Corporation. + +Jonathan K Kummerfeld, Sai R Gouravajhala, Joseph Peper, Vignesh Athreya, Chulaka Gunasekara, Jatin Ganhotra, Siva Sankalp Patel, Lazaros Polymenakos, and Walter S Lasecki. 2018. Analyzing assumptions in conversation disentanglement research through the lens of a new dataset and model. arXiv preprint arXiv:1810.11118, 89. +Tian Lan, Deng Cai, Yan Wang, Yixuan Su, Xian-Ling Mao, and Heyan Huang. 2021. Exploring dense retrieval for dialogue response selection. arXiv preprint arXiv:2110.06612. +Kenton Lee, Ming-Wei Chang, and Kristina Toutanova. 2019. Latent retrieval for weakly supervised open domain question answering. arXiv preprint arXiv:1906.00300. +Feng-Lin Li, Minghui Qiu, Haiqing Chen, Xiongwei Wang, Xing Gao, Jun Huang, Juwei Ren, Zhongzhou Zhao, Weipeng Zhao, Lei Wang, et al. 2017. Alime assist: An intelligent assistant for creating an innovative e-commerce experience. In Proceedings of the 2017 ACM on Conference on Information and Knowledge Management, pages 2495-2498. +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. +Ryan Lowe, Nissan Pow, Iulian Serban, and Joelle Pineau. 2015. The Ubuntu dialogue corpus: A large dataset for research in unstructured multi-turn dialogue systems. In SIGDIAL, pages 285-294. +Yi Luan, Jacob Eisenstein, Kristina Toutanova, and Michael Collins. 2021. Sparse, dense, and attentional representations for text retrieval. Transactions of the Association for Computational Linguistics, 9:329-345. +Rodrigo Nogueira and Kyunghyun Cho. 2019. Passage re-ranking with bert. arXiv preprint arXiv:1901.04085. +Rodrigo Nogueira, Wei Yang, Kyunghyun Cho, and Jimmy Lin. 2019. Multi-stage document ranking with bert. arXiv preprint arXiv:1910.14424. +Minghui Qiu, Feng-Lin Li, Siyu Wang, Xing Gao, Yan Chen, Weipeng Zhao, Haiqing Chen, Jun Huang, and Wei Chu. 2017. AliMe chat: A sequence to sequence and rerank based chatbot engine. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 498-503, Vancouver, Canada. Association for Computational Linguistics. +Ashwin Ram, Rohit Prasad, Chandra Khatri, Anu Venkatesh, Raefer Gabriel, Qing Liu, Jeff Nunn, Behnam Hedayatnia, Ming Cheng, Ashish Nagar, et al. 2018. Conversational ai: The science behind the alexa prize. arXiv preprint arXiv:1801.03604. + +Ruiyang Ren, Yingqi Qu, Jing Liu, Wayne Xin Zhao, Qiaoqiao She, Hua Wu, Haifeng Wang, and Ji-Rong Wen. 2021. Rocketqav2: A joint training method for dense passage retrieval and passage re-ranking. 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 2825-2835. Association for Computational Linguistics. +Stephen Robertson, Hugo Zaragoza, and Michael Taylor. 2004. Simple bm25 extension to multiple weighted fields. In Proceedings of the thirteenth ACM international conference on Information and knowledge management, pages 42-49. +Heung-Yeung Shum, Xiaodong He, and Di Li. 2018. From Eliza to XiaoIce: Challenges and opportunities with social chatbots. Frontiers of IT & EE, 19(1):10-26. +Yixuan Su, Deng Cai, Qingyu Zhou, Zibo Lin, Simon Baker, Yunbo Cao, Shuming Shi, Nigel Collier, and Yan Wang. 2021. Dialogue response selection with hierarchical curriculum learning. 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 1740-1751, Online. Association for Computational Linguistics. +Amir Tahami, Kamyar Ghajar, Azadeh Shakery, and Azadeh Shakery. 2020. Distilling knowledge for fast retrieval-based chat-bots. In Proceedings of the 43rd International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 2081-2084. +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. +Jesse Vig and Kalai Ramea. 2019. Comparison of transfer-learning approaches for response selection in multi-turn conversations. In Workshop on DSTC7. +Hao Wang, Zhengdong Lu, Hang Li, and Enhong Chen. 2013. A dataset for research on short-text conversations. In EMNLP, pages 935-945. +Mingxuan Wang, Zhengdong Lu, Hang Li, and Qun Liu. 2015. Syntax-based deep matching of short texts. In AAAI, pages 1354-1361. +Taesun Whang, Dongyub Lee, Chanhee Lee, Kisu Yang, Dongsuk Oh, and HeuiSeok Lim. 2020. An effective domain adaptive post-training method for bert in response selection. In Proc. Interspeech 2020. +Taesun Whang, Dongyub Lee, Dongsuk Oh, Chanhee Lee, Kijong Han, Dong-hun Lee, and Saebyeok Lee. 2021. Do response selection models really know what's next? utterance manipulation strategies for multi-turn response selection. In Proceedings of + +the AAAI Conference on Artificial Intelligence, volume 35, pages 14041-14049. +Wenhan Xiong, Xiang Lorraine Li, Srini Iyer, Jingfei Du, Patrick Lewis, William Yang Wang, Yashar Mehdad, Wen-tau Yih, Sebastian Riedel, Douwe Kiela, et al. 2020. Answering complex open-domain questions with multi-hop dense retrieval. In ICLR. +Yingrui Yang, Yifan Qiao, Jinjin Shao, Mayuresh Anand, Xifeng Yan, and Tao Yang. 2021. Composite re-ranking for efficient document search with bert. arXiv preprint arXiv:2103.06499. +Shi Yu, Zhenghao Liu, Chenyan Xiong, Tao Feng, and Zhiyuan Liu. 2021. Few-shot conversational dense retrieval. In Proceedings of the 44th International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 829-838. +Chunyuan Yuan, Wei Zhou, Mingming Li, Shangwen Lv, Fuqing Zhu, Jizhong Han, and Songlin Hu. 2019. Multi-hop selector network for multi-turn response selection in retrieval-based chatbots. In EMNLP, pages 111-120. +Li Yuan, Francis EH Tay, Guilin Li, Tao Wang, and Jiashi Feng. 2020. Revisiting knowledge distillation via label smoothing regularization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3903-3911. +Jingtao Zhan, Jiaxin Mao, Yiqun Liu, Min Zhang, and Shaoping Ma. 2020. Learning to retrieve: How to train a dense retrieval model effectively and efficiently. arXiv preprint arXiv:2010.10469. +Hainan Zhang, Yanyan Lan, Liang Pang, Jiafeng Guo, and Xueqi Cheng. 2019. Recosa: Detecting the relevant contexts with self-attention for multi-turn dialogue generation. In ACL, pages 3721-3730. +Hang Zhang, Yeyun Gong, Yelong Shen, Jiancheng Lv, Nan Duan, and Weizhu Chen. 2021. Adversarial retriever-ranker for dense text retrieval. CoRR, abs/2110.03611. +Ying Zhang, Tao Xiang, Timothy M Hospedales, and Huchuan Lu. 2018. Deep mutual learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4320-4328. +Xiangyang Zhou, Daxiang Dong, Hua Wu, Shiqi Zhao, Dianhai Yu, Hao Tian, Xuan Liu, and Rui Yan. 2016. Multi-view response selection for human-computer conversation. In EMNLP, pages 372-381. +Xiangyang Zhou, Lu Li, Daxiang Dong, Yi Liu, Ying Chen, Wayne Xin Zhao, Dianhai Yu, and Hua Wu. 2018. Multi-turn response selection for chatbots with deep attention matching network. In ACL, volume 1, pages 1118-1127. + +A For every submission: + +A1. Did you describe the limitations of your work? + +Limitation section + +A2. Did you discuss any potential risks of your work? + +The topic of the paper deals only with dialogue retrieval + +A3. Do the abstract and introduction summarize the paper's main claims? + +Abstract and Introduction section + +A4. Have you used AI writing assistants when working on this paper? + +Left blank. + +B Did you use or create scientific artifacts? + +Left blank. + +B1. Did you cite the creators of artifacts you used? + +Experiments section + +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? + +Ubuntu Dialogue Corpus and DSTC7 are open-source datasets + +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +Our use of Ubuntu Dialogue Corpus and DSTC7 was consistent with their intended use. + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? + +Not applicable. Left blank. + +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? + +Not applicable. Left blank. + +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. + +Section 4 + +C Did you run computational experiments? + +4 Experiments section + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +4 Experiments section + +The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +4 Experiments section + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +4 Experiments section + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +Not applicable. Left blank. + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +Not applicable. Left blank. + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +Not applicable. Left blank. + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +Not applicable. Left blank. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +Not applicable. Left blank. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +Not applicable. Left blank. \ No newline at end of file diff --git a/corecooperativetrainingofretrieverrerankerforeffectivedialogueresponseselection/images.zip b/corecooperativetrainingofretrieverrerankerforeffectivedialogueresponseselection/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..ffa3b0b0717b5630a33f82230042e9eb093c02ef --- /dev/null +++ b/corecooperativetrainingofretrieverrerankerforeffectivedialogueresponseselection/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c0d27246f4010419ee85650779f0a2ae0ffe22e1b6e9764b0e6770aa5c8dc09a +size 336730 diff --git a/corecooperativetrainingofretrieverrerankerforeffectivedialogueresponseselection/layout.json b/corecooperativetrainingofretrieverrerankerforeffectivedialogueresponseselection/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..7abaf8dbe6783298db7b4c79c57d63a7ab3bb4ec --- /dev/null +++ b/corecooperativetrainingofretrieverrerankerforeffectivedialogueresponseselection/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fe7d205a2f38c409d6b869d1e5a9fac3b5fa6fb51ff849f7f525371811b6e8e3 +size 454336 diff --git a/crepeopendomainquestionansweringwithfalsepresuppositions/3d493f71-c4e8-4434-9dad-60c941b99a97_content_list.json b/crepeopendomainquestionansweringwithfalsepresuppositions/3d493f71-c4e8-4434-9dad-60c941b99a97_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..bfd0a286d4f88ad60f465c36a799fd8e49912a8d --- /dev/null +++ b/crepeopendomainquestionansweringwithfalsepresuppositions/3d493f71-c4e8-4434-9dad-60c941b99a97_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a562ef522d040f72a6e8a8ff4340870f8535bd38657d5de607fac9f4f7b26d5c +size 203499 diff --git a/crepeopendomainquestionansweringwithfalsepresuppositions/3d493f71-c4e8-4434-9dad-60c941b99a97_model.json b/crepeopendomainquestionansweringwithfalsepresuppositions/3d493f71-c4e8-4434-9dad-60c941b99a97_model.json new file mode 100644 index 0000000000000000000000000000000000000000..17e8129e998ca1230bf3174897b1120b01fe6514 --- /dev/null +++ b/crepeopendomainquestionansweringwithfalsepresuppositions/3d493f71-c4e8-4434-9dad-60c941b99a97_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a260a4d16ded345f29f1d69618118a480c09e57d32e514f38427087ced87384f +size 250791 diff --git a/crepeopendomainquestionansweringwithfalsepresuppositions/3d493f71-c4e8-4434-9dad-60c941b99a97_origin.pdf b/crepeopendomainquestionansweringwithfalsepresuppositions/3d493f71-c4e8-4434-9dad-60c941b99a97_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..dd2c4f4152752dc67332690490f62d1e6b376e97 --- /dev/null +++ b/crepeopendomainquestionansweringwithfalsepresuppositions/3d493f71-c4e8-4434-9dad-60c941b99a97_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a3425b357b6fc8d29abab6d21059b9611c437612432588811fbfbdcf619a46e2 +size 1684332 diff --git a/crepeopendomainquestionansweringwithfalsepresuppositions/full.md b/crepeopendomainquestionansweringwithfalsepresuppositions/full.md new file mode 100644 index 0000000000000000000000000000000000000000..49902d47e0e1f102bfbbd2784f7d563ec6371d72 --- /dev/null +++ b/crepeopendomainquestionansweringwithfalsepresuppositions/full.md @@ -0,0 +1,1053 @@ +# CREPE: Open-Domain Question Answering with False Presuppositions + +Xinyan Velocity $\mathbf{Yu}^{\dagger}$ Sewon Min' Luke Zettlemoyer' Hannaneh Hajishirzi\* + +†University of Washington ‡Allen Institute for Artificial Intelligence + +{xyu530, sewon, lsz, hannaneh}@cs.washington.edu + +# Abstract + +When asking about unfamiliar topics, information seeking users often pose questions with false presuppositions. Most existing question answering (QA) datasets, in contrast, assume all questions have well defined answers. We introduce CREPE, a QA dataset containing a natural distribution of presupposition failures from online information-seeking forums. We find that $25\%$ of questions contain false presuppositions, and provide annotations for these presuppositions and their corrections. Through extensive baseline experiments, we show that adaptations of existing open-domain QA models can find presuppositions moderately well, but struggle when predicting whether a presupposition is factually correct. This is in large part due to difficulty in retrieving relevant evidence passages from a large text corpus. CREPE provides a benchmark to study question answering in the wild, and our analyses provide avenues for future work in better modeling and further studying the task. $^{1}$ + +# 1 Introduction + +When an information-seeking user poses a question about the topic they are unfamiliar with, they can often introduce false presuppositions (Kaplan, 1978; Duží and Číhalová, 2015) which are assumed but not directly stated. For instance, the question in Figure 1 incorrectly presupposes that the equal and opposite reactions in Newton's law apply to the same object. Although such a question is unanswerable, we might still hope to identify the confusion and explain it to the user. This functionality goes well beyond prior open-domain QA task formulations, which focus on questions with a valid direct answer (Rajpurkar et al., 2016; Kwiatkowski et al., 2019) or that are unanswerable from lack of evidence (Rajpurkar et al., 2018; Choi et al., 2018; Asai and Choi, 2021). While + +![](images/da85bc1c2d09f60aaf7501a525d0aeff9061bb97f0c2a64c75e9ff0e0e057921.jpg) + +Question: If there's an equal and opposite reaction for everything, how does any action happen? Isn't it balanced out by the opposite reaction? + +# Newton's laws of motion + +From Wikipedia, the free encyclopedia + +Overly brief paraphrases of the third law, like "action equals reaction" might have caused confusion among generations of students: the "action" and "reaction" apply to different bodies. + +# Net force + +From Wikipedia, the free encyclopedia + +In mechanics, the net force is the vector sum of forces acting on a particle or object. The net force is a single force that replaces the effect of the original forces on the particle's motion. + +# Reaction (Physics) + +From Wikipedia, the free encyclopedia + +... One problem frequently observed by physics educators is that students tend to apply Newton's Third Law to pairs of 'equal and opposite' forces acting on the same object. + +False presupposition: The equal and opposite reaction applies to the same object. + +Correction: Based on Newton's Law of Motion, the equal and opposite reaction applies to the other object. Only forces that are applied to the same object would be cancelled out. + +Figure 1: An example question written by an online user that contains a false presupposition. The model is required to (a) identify the presupposition made in the question that is false based on world knowledge, and (b) write the correction. We also show three evidence paragraphs from the English Wikipedia. + +recent work studies unverifiable presuppositions in reading-comprehension-style questions given evidence context (Kim et al., 2021), there has been no work that identifies and corrects a presupposition that is false based on global, factoid knowledge. + +In this paper, we introduce CREPE (CorRection of PrEsupposition), a new dataset consisting of 8,400 Reddit questions with (1) whether there is any false presuppositions, and (2) if any, the presupposition and its correction written. We find $25\%$ of questions on Reddit (Fan et al., 2019) include false presuppositions, where the best response is to provide a correction of the presuppositions. + +While the CREPE annotation task is challenging due to the need for extensive background knowledge, + +edge and inherent debatability, we leverage the most upvoted comments written by community users to efficiently annotate the data. The most upvoted comments are likely to be factually correct, and typically also identify and correct any false presuppositions made in the question. By designing an annotation pipeline using these comments, we were able to collect high-quality data at a relatively low cost. Our data analysis (Table 2) shows that the types of false presuppositions are diverse, ranging from relatively explicit presuppositions (e.g., false clauses or false predicate) to subtle, nuanced presuppositions (e.g., false causality or false existential presuppositions). + +We define two tracks with varying levels of difficulty, and introduce models to set baseline performance levels for each. A model is given either the question only (the main track) or the question and the comment (the GOLD-COMMENT track), and is supposed to perform two subtasks: identification of whether or not there is a false presupposition (the detection subtask) and generation of presuppositions and their corrections (the writing subtask). For the writing subtask, we propose a systematic human evaluation scheme based on Celikyilmaz et al. (2020) that considers fluency, correctness (precision of the information), adequacy (recall of the information) and consistency. + +We include a range of baselines, including a question-only model, a nearest-neighbor model, and a competitive model based on the state-of-the-art passage retrieval (Krishna et al., 2021) and pretrained language models (Liu et al., 2019; Raffel et al., 2020). Results and analyses indicate that (1) retrieval is very challenging since simply retrieving passages in the topic of the question is not enough; (2) models do moderately well in identifying explicit false presuppositions, and (3) models struggle with identifying implicit presuppositions and explaining how and why the presupposition is false. We also discuss open problems, such as an inherent ambiguity in the validity of presuppositions and inconsistency between different websites. + +# 2 Background + +# 2.1 Question Answering + +There has been significant work on question answering, where the model receives a natural language, open-domain question and is required to return a short, concise answer (Voorhees and Tice, 2000; Lee et al., 2019). Most work focuses on + +questions that have a short text span as a correct answer. Other work studies unanswerable questions, but they study questions that are either intentionally written to be unanswerable (Rajpurkar et al., 2018) or where there is a lack of evidence to find the answer (Choi et al., 2018; Asai and Choi, 2021). More recently, Kim et al. (2021) studies unverifiable presuppositions in questions under the given context, but using questions from Kwiatkowski et al. (2019) whose presuppositions are mostly not false based on global knowledge. $^{2}$ + +In this work, we focus on open-domain questions with presuppositions that are false based on global knowledge, and argue that an adequate response to them is a correction of these presuppositions. We show that false presuppositions in questions are prevalent. $25\%$ of questions contain false presuppositions in the domain of online forums (for which we collect annotations), research papers (Dasigi et al., 2021), scientific reviews (Kang et al., 2018), and social media (Sap et al., 2020). + +# 2.2 Presupposition + +Under a pragmatic point of view, a presupposition is a condition that a speaker would normally expect to hold in the common ground between discourse participants when that sentence is uttered (Beaver et al., 2014; Stalnaker et al., 1977). Unlike semantic presuppositions (Strawson, 1950), pragmatic presuppositions cannot easily be traced to specific words or phrases, but rather depend on the context and the expectations of the discourse participants (Potts, 2015). A key property of pragmatic presuppositions is that they are backgrounded—a pragmatic property of being a meaning that the speaker presumes to be mutual public knowledge. While whether or not one is a presupposition is inherently debatable, we define a false presupposition based on the most voted comment in the online forum, as we discuss further in Section 3.2. + +False presuppositions in questions have been discussed in the linguistic literature (Kaplan, 1978; Duží and Číhalová, 2015). False presuppositions in the question make a question infelicitous because there is no direct answer. Kaplan (1978) claims that an adequate and unambiguous answer to such a question is a negated presupposition, referred to as corrective indirect response. We follow them in providing the negated presupposition as the response + +to the question, and build the first benchmark based on questions written by information-seeking users. + +# 3 Dataset: CREPE + +Our task requires the model to be given a question $q$ and to (a) identify whether $q$ has any false presuppositions, and (b) if yes, generate the false presupposition as well as the correction. + +We have three criteria in constructing the dataset: + +C1. Naturalness of the questions: whether the questions in the data are written by real, information-seeking users. +C2. Validity of the presupposition: whether the identified presupposition is highly likely made by the question writer. +C3. Correctness and adequacy of the information: whether the information provided in the correction is factually correct, and adequate to convince the question writer. + +We first describe the source of questions (Section 3.1) which address C1. We then describe the process of annotation (Section 3.2) that addresses C2 and C3. Finally, we present detailed, qualitative analysis of the data (Section 3.3). The formal definition of the task and metrics are in Section 4. + +# 3.1 Data Source + +Our highest priority is to study false presuppositions that naturally occur from information-seeking users. While it is significantly easier to manually write questions that would have false presuppositions, we think these questions will significantly be different from naturally occurring questions. + +Following Fan et al. (2019), we use questions posted on the ELI5 subreddit.3 We made a few modifications to the procedure that Fan et al. (2019) took in order to improve the data quality. We first filter questions and comments based on upvotes with a higher threshold. We then split the training, the development and the test data based on the time of the posting: questions on the training set are posted in 2011-2018, questions on the development set are posted in Jan-Jun of 2019, and questions on the test set are posted in Jul-Dec of 2019. Appendix A provides more details. + +Krishna et al. (2021) raised a concern that a significant amount of test are duplicates of those on the training set. We provide a detailed analysis in Appendix A. In summary, we think (1) the amount + +of duplicated (or paraphrased) questions is significantly less than their estimate with respect to underlying presuppositions in the questions, and (2) even if there are paraphrased questions, data split based on the time frame is justified based on the real-world scenario. $^4$ + +# 3.2 Data Annotation + +Meeting the criteria C2 and C3 can be very difficult for the following reasons: + +- For C2: The validity of presupposition is inherently debatable and largely depends on the background of individuals (Section 2.2).5 +- For C3: The open-domain nature of the task requires the search of world knowledge on the web, which is extremely expensive and may not be exhaustive enough despite the best efforts made by annotators, as discussed in Kwiatkowski et al. (2019); Min et al. (2020). + +In this work, we make use of the most upvoted comments written by community users. The comment, often written by domain experts, provides a response to the question in the ELI5 subreddit and has been used as a credible source in prior work (Fan et al., 2019). If the comment identifying a false presupposition has the most upvotes, it is likely that the presupposition is valid (made by a question writer) based on the background context shared by community users, thus satisfying C2. Moreover, the comment (1) is highly likely to contain information that is correct and adequate (satisfying C3), and (2) removes the need for exhaustively searching over the web (reducing the annotation cost). + +Annotation task. Annotators are given a pair of the question and the most voted comment, and perform the following steps. + +1. Filter out questions that are subjective, are uninformative, or rely on personal experience. +2. Judge whether there is a false presupposition in the question, identified by the comment. +3. If there is a false presupposition, write the presupposition and a correction as a concise, declarative sentence. + +
Data split# Questions# TokensPosting time
Totw/ FPQPSCRCM
Training3,462907 (26.2%)15.610.316.595.22018
Development2,000544 (27.2%)16.110.315.691.0Jan–Jun 2019
Test3,004751 (25.0%)16.411.816.892.5Jul–Dec 2019
Unlabeled training196,385-15.7--96.62011–2018
Total (labeled only)8,4662,202 (26.0%)16.010.816.593.3
Total (labeled+unlabeled)204,851-15.7--96.5
+ +Table 1: Data statistics. # Questions indicate the number of questions in total and with false presupposition. # Token indicate the number of tokens (based on the whitespace tokenization) in the question (Q), the presupposition (PS), the correction (CR), and the comment (CM). Note that PS and CR are those to be written by the model; CM is given to the model in the GOLD-COMMENT track. Details of tracks are provided in Section 4. + +Annotation pipeline. We maintain a pool of qualified annotators who passed our qualification task. We assign two annotators per question, where each annotators independently annotate the question. We filter out questions if either of the annotators mark them as such. If the annotators agreed to on the label (whether or not there is a false presupposition), their label as well as their writings are taken as gold references. When they disagreed, we assign a third annotator and take a majority vote over three workers. The percentage agreement in the initial stage of the annotation is $75\%$ , and the Fleiss' kappa is $43\%$ , indicating moderate agreement. We find that the disagreements are mainly due to inherent ambiguities of the task due to the different interpretations of the question or the comment, or difference in individual background knowledge (discussion in Section 3.3). + +More details in instructions and quality control are provided in Appendix B. + +# 3.3 Data Analysis + +The data statistics are provided in Table 1. We find that over $25\%$ of questions posted on Reddit includes false presuppositions. $^7$ + +Categorization of false presuppositions. We randomly sample 50 questions with false presuppositions and categorize them in Table 2. The five most frequent types of presuppositions include: + +- False clauses are those where FP is made as a clause in Q, e.g., “the water has to be 100 to become steam” in Table 2. + +- False predicate are those where the predicate in $\mathbb{Q}$ is false, e.g., "current is stored in power plants". +- False properties are those where certain properties or attributes are presupposed in $\mathbb{Q}$ , e.g., "cement blocks are too strong so that people who punch them are likely to break their hand." They are often very implicit and may be deniable; however, the question writer would not have asked the question if they have not made the presupposition. +- False (causal) relationship between facts are those where $\mathbb{Q}$ makes a (causal) relationship between facts that are false. This is another implicit type of presuppositions, but again, the question writer would not have asked this question if they have not made such a presupposition. A large portion of questions involve scientific phenomenon on which the question writer has misunderstanding, e.g., in the example in Table 2, the question writer had a misconception about Newton's Third Law of Motion. +- False existential presupposition indicates that $\mathbb{Q}$ includes an existential presupposition, one type of semantic presuppositions, that is false. For instance, the example $\mathbb{Q}$ in Table 2 presupposes an unused space in a hard disk, and $\mathbb{C}$ says there is no unused space. + +Triggers in the comment. We analyze how comments point out the falsehood of the presupposition made in the question on the same set of 50 samples on the development data. In $68\%$ of times, comments include specific lexical cues which we call triggers. $70\%$ of such triggers are negations. Other word-level triggers include "actually", "just", "rare", "really" and "though". Sentence-level triggers include "You are mistaken", "You've got some + +
False clauses (14%) +♀ If water has to be 100 to become steam, how come you don’t get heavily burned in saunas? +♂ What we often call steam is just water vapor that has started to become visible due to different temperatures of the water vs air. It can exist at many temperatures. (...) +FP Water can steam below 100 degrees.False predicate (30%) +♀ How exactly is current stored in power plants? +♂ It’s not being stored at all. The power grid is a carefully balanced dance of supply and demand. (...) +FP Current is stored in power plants.
False properties (22%) +♀ How do martial artists who karate chop or punch a cement block not break their hand?♂ It’s a trick, the blocks are not very strong, and they are being punched or kicked in their weakest points. FP Chops or cement blocks are strong. +♀ How does your phone tell the difference between a step and random movement?♂ You might be disappointed by this answer, but most of the time, you’re not moving your phone (... ) when you walk. FP A random movement is detectable by a phone.False (causal) relationship between facts (22%) +♀ If there’s an equal and opposite reaction for everything, how does any action happen? Isn’t it balanced out by the opposite reaction?♂ I don’t think you are fully comprehending what ‘equal’ means in this situation. (...) These forces are acting on different bodies so they do not cancel each other out. (... ) FP The equal and opposite reaction applies to the same object. +♀ In today’s high tech world, how come we are not able to reproduce ancient crafting methods like Roman Concrete, Damascus Steel, or Greek Fire?♂ It’s not that we can’t reproduce them technologically, it’s that the exact method or recipe was lost to history (... ) FP Ancient crafting methods are not reproducible due to lack of technologies.
False existential presupposition (6%) +♀ What uses the space on a hard disk that we’re unable to use? For example in a 1TB hard disk, we get about 930GB of usable memory, what happens to the other 70GB? +♂ There are TB (terabyte) and TiB (tebipy). the “ra” ones are using multiplies of 1000. the “bi” ones are using multiplies of 1024. I will do some math for you: 1 TB=10004B = (... ) = 0.93 TiB. There goes your 70 GiB. +FP In a 1TB hard disk, 70GB is unusable.Exceptions (4%) +♀ How do bugs and other insects survive winter when they have such a short lifespan?♂ Depends on the insect, some don’t have that short of a lifespan. But mostly (... ) FP (All) insects have a short lifespan.
No false presupposition / Annotation error (2%)
+ +Table 2: Breakdown of types of false presuppositions, based on 50 random samples on the development data. Q, C and FP indicate the question, the comment, and the presupposition, respectively. + +major confusion here”, “I don’t think you are fully comprehending …” and “It should be noted that…”. $80\%$ of triggers appear in the first sentence of the comment, and the rest of the sentences elaborate on how the presupposition is false or provide other relevant information that does not directly answer the question. The rest $32\%$ do not include lexical triggers and requires more careful comprehension of the comment with respect to the question, e.g., the false existential example in Table 2. + +Analysis of ambiguous cases. Even with our best efforts, there are still inherent disagreement between annotators. Some of them are due to inherent ambiguities in language, e.g., the first example in Table 9 where 'the state of the water' could either mean the molecule itself or the energy state of the molecule. Others are due to disagreement on the validity of the presupposition, e.g., in the second example in Table 9, it is debatable whether or not the question writer presupposes that the Board deals with day to day at a company. We revisit this issue in human performance estimation in Section 5.2. + +# 4 Task Setup + +The model is given a question $q$ , and is required to perform the following subtasks: + +(a) Detection: assign a label to be FP or N; FP + +means $q$ has a false presupposition, and $\mathbf{N}$ means $q$ has no false presuppositions. We use a macro-F1 score as an evaluation metric. + +(b) Writing: if FP, write the false presupposition as well as the correction. We use sacreBLEU (Post, 2018) and unigram-F1 following Petroni et al. (2021) as well as SentBERT (Reimers and Gurevych, 2019) for evaluation. We also introduce a human evaluation scheme in Section 6.3. + +We have two tracks: the main track and the GOLD-COMMENT track. + +The main track provides $q$ as the only input to the model. The model is expected to search necessary background knowledge to perform the task from any information source except for Reddit and Quora. $^{8}$ This is the most realistic setting for the typical open-domain question answering problem. + +The GOLD-COMMENT track provides the comment used for the annotation as an additional input to the model. This removes the need for retrieval, and guarantees that all necessary information to perform the task is given. + +# 5 Experiments: Detection + +This section discusses baseline experiments for the detection subtask; Section 6 discusses baseline experiments for the writing subtask. + +# 5.1 Baselines + +# 5.1.1 Trivial baselines + +Random assigns FP or N randomly at uniform. FP only always assigns FP. N only always assigns N. Nearest Neighbor retrieves one of questions from the training set that is closest to the test question, based on c-REALM (Krishna et al., 2021), and returns its label as the prediction. + +# 5.1.2 GOLD-COMMENT track baselines + +Question only trains a RoBERTa-based (Liu et al., 2019) classifier that takes the question as the only input and classifies the label. It is often called closed-book model (Roberts et al., 2020). Comment only is a classifier based on RoBERTa-large that takes the comment as the only input and assigns the label. Question $\oplus$ Comment is a classifier based on RoBERTa-large that takes a concatenation of the question and the comment to the classifier, and assigns the label. We additionally experiment with the same model that is trained on either MNLI (Williams et al., 2018) or BoolQ (Clark et al., 2019), and tested on CREPE in a zero-shot fashion. This condition tests if training on similar, previously studied datasets helps. + +# 5.1.3 Main track baselines + +We design a model called c-REALM + MP (Multi-passage) classifier that retrieves a set of paragraphs from Wikipedia and then assigns a label. + +First, the model uses c-REALM (Krishna et al., 2021), a state-of-the-art retrieval model on ELI5, to retrieve a set of $k$ passages from the English Wikipedia. Next, the model uses the multi-passage classifier based on RoBERTa in order to assign a label. Given a question $q$ and a set of passages $p_1\dots p_k$ , each $p_i$ ( $1 \leq i \leq k$ ) is concatenated with $q$ and is transformed into $\mathbf{h}_i \in \mathbb{R}^h$ through the Transformer model. We then obtain logits via $\mathbf{p} = \mathrm{FFN}(\mathrm{MaxPool}(\mathbf{h}_1\dots \mathbf{h}_k)) \in \mathbb{R}^2$ , where FFN is a feed-forward layer and MaxPool is an element-wise max operator. Finally, we use Softmax $(\mathbf{p})$ to compute the likelihood of $q$ having false presuppositions or not. + +Self-labeling. Although our labeled data is small, there is large-scale unlabeled data (question and + +comment pairs) available. We explore self-labeling to leverage this unlabeled data. Specifically, we use the Question $\oplus$ Comment to assign a silver label to the unlabeled training questions. We then train the classifier on the union of this silver data as well as the gold labeled data. + +# 5.1.4 Human performance + +We estimate human performance to better understand the model performance. We recruit two human workers who perform the task for 186 questions for each track. + +We estimate two types of human performance. (1) Human with the most voted comment, where human workers assume the most voted comment as a ground truth in terms of factuality of the information and the validity of the presupposition. We think of it as an upperbound of model performance. (2) Human w/o the most voted comment, where human workers search over the web (except Quora and Reddit) to find information, and make the best judgment about the validity of the presupposition. We think it is likely to be worse than the upperbound of model performance, since only one worker, instead of multiple online users or domain experts, makes a decision. + +# 5.2 Results + +Results are reported in Table 3. + +The GOLD-COMMENT track. All trivial baselines achieve poor performance. In particular, poor performance of the nearest neighbor model indicates that there is no significant train-test overlap on CREPE. Using both the question and the comment (Question $\oplus$ Comment) achieves the best performance, outperforming the best trivial baseline by $22\%$ absolute. Zero-shot models trained on MNLI and BoolQ achieve poor performance, indicating that our problem is significantly different from existing tasks like NLI or binary question answering. The best model is $10\%$ below human performance, indicating room for improvement, even in the easier track. + +The main track. Using retrieved passages from c-REALM and multi-passage classifier achieves $66.3\%$ on the test set, which is significantly better than all trivial baselines. The self-labeling technique leads to additional improvements, leading to an F1 of $67.1\%$ . While these numbers are significantly better than trivial baselines, they are significantly worse than the model performance given + +
ModelDevTest
Trivial baselines
Random®44.947.8
Always predict FP®21.420.0
Always predict N®42.142.9
Nearest Neighbor®56.254.1
GOLD-COMMENT track
Question only67.766.9
Comment only68.968.6
Question⊕Comment76.375.6
Question⊕Comment (MNLI)®54.454.2
Question⊕Comment (BoolQ)®60.458.2
Main track
c-REALM + MP classifier68.366.3
c-REALM + MP classifier (Self-labeling)‡69.167.1
Human w/ most-voted comment86.485.1
Human w/o most-voted comment70.970.9
+ +the comment. This strongly suggests a retrieval bottleneck—getting passages that provide evidence as strong as human-written comments is difficult even with the state-of-the-art retrieval model. + +To further support the bottleneck in retrieval, we conduct a detailed error analysis in Appendix C.2. For instance, $86\%$ of false negatives were due to retrieval misses, including failing to retrieve relevant topics $(42\%)$ , retrieving evidence on the relevant topics but not related to the false presuppositions $(32\%)$ , or retrieving evidence related to the presuppositions but is not direct enough $(12\%)$ . + +Human performance. Humans given the most upvoted comment achieve performance that is significantly higher than all baseline numbers, indicating significant room for improvement. + +Without the most upvoted comment, people achieve relatively poor performance (70.9%). To better understand this, we analyze 44 error cases, and categorize them in Table 4. Nearly half of the errors are due to an inherent disagreement in labels, either due to (1) ambiguity, either in language or whether the presupposition was made, or (2) whether it is critical to correct false presuppositions (especially cases in the exception category in Table 2). We think using the most upvoted com + +Table 3: Baseline results in the detection subtask on the development data and the test data, respectively. Macro-F1 scores reported. By default, the models are trained on the labeled portion of CREPE; $\otimes$ indicates the model is not trained on CREPE; $\ddagger$ indicates the model is trained on both the labeled and unlabeled portions of CREPE. + +
Error Category%
Failure in finding evidence11.4
Mistakes in labeling11.4
Wrong ground truth label11.4
Inherent disagreement: ambiguity34.1
Inherent disagreement: criticalness9.1
Information on the web being inconsistent22.7
+ +Table 4: Analysis of 44 errors made by human performers without the most upvoted comment. + +ment for a decision is reasonable since it is an aggregation of active community users and domain experts, but future work may take other approaches to consider ambiguities of the decision. + +# 6 Experiments: Writing + +# 6.1 Baselines + +In the writing subtask, the system is given a question that is guaranteed to contain a false presupposition, and is required to generate the presupposition as well as the correction. + +# 6.1.1 GOLD-COMMENT track baselines + +Copy baseline. As a trivial baseline, we copy the given question as a presupposition and the given comment as a correction. + +Question $\oplus$ Comment Dedicated. We train two generators separately to generate the presupposition and the correction, respectively, given a concatenation of the question and the comment. Both models are based on the pretrained T5-base model (Raffel et al., 2020). + +Question $\oplus$ Comment Unified. We also design a unified model that can be used for both the presupposition and the correction, motivated by the intuition that generation of each can benefit from each other. We train one generator that is trained with a union of (1) annotated corrections, and (2) annotated presuppositions pretended with "It is not the case that" so that they look like corrections. At inference time, we use a standard, beam search decoding to generate the correction. To generate the presupposition, we first decode a sequence with a constraint (De Cao et al., 2021) that it should start with "It is not the case that", and then take the sequence that comes next as a presupposition. + +# 6.1.2 Main track baselines + +We design c-REALM + MP (Multi-Passage) Dedicated and c-REALM + MP (Multi-Passage) Unified. They are similar to the dedicated and unified + +
ModelDevelopmentTest
uF1BLEUuF1BLEU
PCAPCAPCAPCA
GOLD-COMMENT track: Copy Baseline
45.026.535.814.85.510.244.727.035.914.65.710.2
GOLD-COMMENT track: Question⊕Comment
Dedicated51.737.844.830.017.924.047.738.042.922.916.119.5
Unified53.433.243.330.912.021.549.231.440.325.910.418.2
Main track: Question + c-REALM
Dedicated49.126.637.928.28.718.545.924.935.422.67.114.9
Unified49.430.740.128.810.119.546.328.437.423.68.316.0
+ +Table 5: Results in the writing subtask with unigram F1 (uF1) and BLEU. P, C, and A indicate Presupposition, Correction, and Average between the two. + +
ModelDevelopmentTest
PCAPCA
GOLD-COMMENT track: Copy Baseline
75.570.873.275.670.973.3
GOLD-COMMENT track: Question ⊕ Comment
Dedicated78.775.777.277.075.276.1
Unified82.775.779.282.074.278.1
Main track: Question + c-REALM
Dedicated76.970.373.676.565.671.1
Unified77.870.374.177.068.872.9
+ +models in Section 6.1.1. The only difference is that the model receives a question and a set of $k$ passages from c-REALM instead of a question/comment pair. In order for the T5 model to read multiple passages, we use the Fusion-in-Decoder architecture (Izacard and Grave, 2021). We refer to Appendix C.1 for more details. + +# 6.2 Results: Automatic Evaluation + +Table 5 reports the results in unigram F1 and BLEU. Examples of model outputs are provided in Appendix C.4. All models outperform the trivial copy baseline and perform better in the GOLD-COMMENT track than in the main track. Models are overall better at writing presuppositions than writing corrections, and the performance gap between the GOLD-COMMENT track and the main track is larger in presuppositions than in corrections. This is likely because the impact of evidence passages is more significant in correction writing than in presupposition writing since the presupposition can often be extracted from the question alone, while the correction requires information + +Table 6: Results in the writing subtask with SentBERT. P, C, and A indicate Presupposition, Correction, and Average between the two. + +
ModelFPCRCS
GOLD-COMMENT track: Question + Comment
Dedicated2.91.81.91.6
Unified3.02.00.82.8
Main Track: Question + c-REALM
Dedicated2.81.80.61.6
Unified3.01.80.62.8
Groundtruth2.92.82.72.9
Agreement (%)96.365.463.074.8
+ +Table 7: Human evaluation results (scale: 0–3). F: Fluency, P: Presupposition, CR: Correction, Cs: Consistency. The last row reports the inter-annotator agreement rate. + +beyond the question. It is also worth noting that the unified model is better than the dedicated model in the main track but not in the GOLD-COMMENT track. This indicates that, while multi-task learning improves the main track, it does not improve the GOLD-COMMENT track, possibly because performing two tasks in isolation is sufficient. + +Table 6 reports results in SentBERT scores. The overall scores are high, likely because SentBERT considers entailment between a reference and a generation. For instance, the copy baseline achieves high scores since the question and the presupposition, and the comment and the correction entail each other by definition. It is important to note that entailment is a necessary but not a sufficient condition for a presupposition or a correction to be satisfactory in our task definition. The next section shows that models with high SentBERT scores obtain low human ratings. + +# 6.3 Results: Human Evaluation + +We conduct human evaluation of model generations on 200 randomly sampled test instances from the + +following aspects (each in the 0-3 scale): + +- Fluency: The generated text should be fluent (i.e., free of grammatical errors, spelling errors, and repetitions). +- Presupposition: The generated presupposition should be the valid one in the question, and is factually false. +- Correction: The correction should be made in the comment and provide reasonable amount of justification rather than being a simple negation of the presupposition. +- Consistency: The presupposition and correction should be on the same topic and negate each other. + +We evaluate the output from all systems except the copying baseline, as well as the ground truth reference. Each question is assigned two raters in order to reduce noise and report inter-rater agreement on pairwise comparison. More details about the rating scheme are provided in Appendix C.4. + +Based on results reported in Table 7, all models generate almost flawless fluent text and valid presuppositions. However, their outputs generated as false presuppositions are factually correct in half of the cases. These observations are relatively consistent across different systems. + +Notable differences between systems are found in correction and consistency. The dedicated model generates better correction, likely because it is given a comment. All other models struggle: in particular, the unified models tend to generate the correction that starts with "It is not the case that" even the model is not restricted to do so at inference time. On the other hand, the unified model is better in consistency, likely because the dedicated model is more vulnerable in generating the presupposition and the correction in a totally different topic. + +# 7 Conclusion + +We introduced CREPE: the first benchmark for the identification and correction of false presuppositions in the open-domain setup. CREPE consists of 8,400 user questions, $25\%$ of which contain false presuppositions and are paired with their corrections. Our detailed analysis highlights challenges in solving the task, including (1) retrieval of evidence that identifies false presupposition, (2) identification of implicit and subtle presuppositions, and (3) generating correction that is accurate and + +adequately explains how and why the presupposition is false. We hope our benchmark adds to the problem of open-domain, open-ended question answering, inviting researchers to build models to study questions with false presuppositions. Further, we suggest future work to develop better models, explore approaches to address inherent debatability of the judgment, and evaluation of the model generation. + +# Limitations + +Inherent debatability in false presuppositions. As discussed earlier, the validity of presupposition is inherently debatable and largely depends on the background context, i.e., even experts in formal semantics and pragmatics observe a high disagreement rate (Jeretic et al., 2020). Our proposal in using the most upvoted comments partially address the issue, but not perfectly, as discussed extensively in Section 5.2. One avenue for future work is to consider extra-linguistic context such as individuals background when judging the validity of presuppositions (Zhang and Choi, 2021). + +Evaluating massive language models. Massive language models such as GPT-3 (Brown et al., 2020) have been shown impressive performance in open-ended question answering (Nakano et al., 2021). Our paper does not include large-scale, systematic evaluation of such models. Instead, we conduct a small-scale case study with GPT-3 text-davinci-002. See Appendix D for details. Most generations are roughly on the right topic, but often contain information that is factually false and do not precisely answer the question. Moreover, they rarely explicitly identify false presupposition and provide corrections, indicating that GPT-3 is far from solving our task. We think future work may explore larger-scale evaluation in a more systematic manner. + +False presuppositions beyond online forums. The domain of CREPE is limited to online forums (Reddit). While this choice was made due to the availability of large data and its general domain, we argue that false presuppositions are not specific to such domains. For instance, we find that a similar portion $(25\%)$ have false presuppositions on information-seeking questions on NLP research papers posed by NLP experts; see Appendix E for details. We think future work can explore creating benchmarks on such domains, as well as studying + +false presuppositions on a broader set of domains that require domain expertise. + +# Acknowledgements + +We thank Daniel Fried and Julian Michael for their feedback on an early stage of the project. We thank Zeqiu Wu and H2Lab members for comments on the paper. We thank Li Du for suggesting the name of the dataset. This research is supported by DARPA MCS program through NIWC Pacific (N66001-19-2-4031), NSF IIS-2044660, an Allen Distinguished Award and gifts from AI2. SM is supported by a J.P. Morgan fellowship. + +# References + +Akari Asai and Eunsol Choi. 2021. Challenges in information-seeking QA: Unanswerable questions and paragraph retrieval. In Proceedings of the Association for Computational Linguistics. +FairScale authors. 2021. Fairscale: A general purpose modular pytorch library for high performance and large scale training. https://github.com/facebookresearch/fairscale. +David I. Beaver, Bart Geurts, and Kristie Denlinger. 2014. Presupposition. The Stanford Encyclopedia of Philosophy. +Rahul Bhagat and Eduard Hovy. 2013. Squibs: What is a paraphrase? Computational Linguistics. +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 Proceedings of Advances in Neural Information Processing Systems. +Isabel Cachola, Eric Holgate, Daniel Preotciuc-Pietro, and Junyi Jessy Li. 2018. Expressively vulgar: The socio-dynamics of vulgarity and its effects on sentiment analysis in social media. In Proceedings of International Conference on Computational Linguistics. +Asli Celikyilmaz, Elizabeth Clark, and Jianfeng Gao. 2020. Evaluation of text generation: A survey. arXiv preprint. +Eunsol Choi, He He, Mohit Iyyer, Mark Yatskar, Wentau Yih, Yejin Choi, Percy Liang, and Luke Zettlemoyer. 2018. QuAC: Question answering in context. + +In Proceedings of Empirical Methods in Natural Language Processing. +Christopher Clark, Kenton Lee, Ming-Wei Chang, Tom Kwiatkowski, Michael Collins, and Kristina Toutanova. 2019. BoolQ: Exploring the surprising difficulty of natural yes/no questions. In Proceedings of the Conference of the North American Chapter of the Association for Computational Linguistics. +Pradeep Dasigi, Kyle Lo, Iz Beltagy, Arman Cohan, Noah A. Smith, and Matt Gardner. 2021. A dataset of information-seeking questions and answers anchored in research papers. In Proceedings of the Conference of the North American Chapter of the Association for Computational Linguistics. +Nicola De Cao, Gautier Izacard, Sebastian Riedel, and Fabio Petroni. 2021. Autoregressive entity retrieval. In Proceedings of the International Conference on Learning Representations. +Marie Duží and Martina Číhalová. 2015. Questions, answers, and presuppositions. Computación y Sistemas. +Angela Fan, Yacine Jernite, Ethan Perez, David Grangier, Jason Weston, and Michael Auli. 2019. ELI5: Long form question answering. In Proceedings of the Association for Computational Linguistics. Association for Computational Linguistics. +Juri Ganitkevitch, Benjamin Van Durme, and Chris Callison-Burch. 2013. PPDB: The paraphrase database. In Proceedings of the Conference of the North American Chapter of the Association for Computational Linguistics. +Gautier Izacard and Edouard Grave. 2021. Leveraging passage retrieval with generative models for open domain question answering. In Proceedings of the European Chapter of the Association for Computational Linguistics. +Paloma Jeretic, Alex Warstadt, Suvrat Bhooshan, and Adina Williams. 2020. Are natural language inference models IMPPRESSive? Learning IMPlicitature and PRESupposition. In Proceedings of the Association for Computational Linguistics. +Jeff Johnson, Matthijs Douze, and Hervé Jégou. 2019. Billion-scale similarity search with GPUs. IEEE Transactions on Big Data. +Dongyeop Kang, Waleed Ammar, Bhavana Dalvi, Madeleine van Zuylen, Sebastian Kohlmeier, Eduard Hovy, and Roy Schwartz. 2018. A Dataset of Peer Reviews (PeerRead): Collection, Insights and NLP Applications. In Proceedings of the Conference of the North American Chapter of the Association for Computational Linguistics. +S. Jerrold Kaplan. 1978. Indirect responses to loaded questions. In Theoretical Issues in Natural Language Processing-2. + +Najoung Kim, Ellie Pavlick, Burcu Karagol Ayan, and Deepak Ramachandran. 2021. Which linguist invented the lightbulb? presupposition verification for question-answering. In Proceedings of the Association for Computational Linguistics. +Kalpesh Krishna, Aurko Roy, and Mohit Iyyer. 2021. Hurdles to progress in long-form question answering. In Proceedings of the Conference of the North American Chapter of the 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. +Kenton Lee, Ming-Wei Chang, and Kristina Toutanova. 2019. Latent retrieval for weakly supervised open domain question answering. In Proceedings of the Association for Computational Linguistics. Association for Computational Linguistics. +Patrick Lewis, Pontus Stenetorp, and Sebastian Riedel. 2021. Question and answer test-train overlap in open-domain question answering datasets. In Proceedings of the European Chapter of the Association for Computational Linguistics. +Quentin Lhoest, Albert Villanova del Moral, Yacine Jernite, Abhishek Thakur, Patrick von Platen, Suraj Patil, Julien Chaumont, Mariama Drame, Julien Plu, Lewis Tunstall, Joe Davison, Mario Šaško, Gunjan Chhablani, Bhavitvya Malik, Simon Brandeis, Teven Le Scao, Victor Sanh, Canwen Xu, Nicolas Patry, Angelina McMillan-Major, Philipp Schmid, Sylvain Gugger, Clément Delangue, Theo Matussière, Lysandre Debut, Stas Bekman, Pierric Cistac, Thibault Goehringer, Victor Mustar, François Lagunas, Alexander Rush, and Thomas Wolf. 2021. Datasets: A community library for natural language processing. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing: System Demonstrations. +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. +Paulius Micikevicius, Sharan Narang, Jonah Alben, Gregory Diamos, Erich Elsen, David Garcia, Boris Ginsburg, Michael Houston, Oleksii Kuchaiev, Ganesh Venkatesh, and Hao Wu. 2018. Mixed precision training. In Proceedings of the International Conference on Learning Representations. +Sewon Min, Julian Michael, Hannaneh Hajishirzi, and Luke Zettlemoyer. 2020. AmbigQA: Answering am + +biguous open-domain questions. In Proceedings of Empirical Methods in Natural Language Processing. +Reiichiro Nakano, Jacob Hilton, Suchir Balaji, Jeff Wu, Long Ouyang, Christina Kim, Christopher Hesse, Shantanu Jain, Vineet Kosaraju, William Saunders, et al. 2021. Webgpt: Browser-assisted question-answering with human feedback. arXiv preprint. +Ellie Pavlick, Pushpendre Rastogi, Juri Ganitkevitch, Benjamin Van Durme, and Chris Callison-Burch. 2015. PPDB 2.0: Better paraphrase ranking, fine-grained entailment relations, word embeddings, and style classification. In Proceedings of the Association for Computational Linguistics. +Fabio Petroni, Aleksandra Piktus, Angela Fan, Patrick Lewis, Majid Yazdani, Nicola De Cao, James Thorne, Yacine Jernite, Vladimir Karpukhin, Jean Maillard, Vassilis Plachouras, Tim Rocktäschel, and Sebastian Riedel. 2021. KILT: a benchmark for knowledge intensive language tasks. In Proceedings of the Conference of the North American Chapter of the Association for Computational Linguistics. +Matt Post. 2018. A call for clarity in reporting BLEU scores. In Proceedings of the Third Conference on Machine Translation. +Christopher Potts. 2015. Presupposition and implicature. The handbook of contemporary semantic theory. +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. +Pranav Rajpurkar, Robin Jia, and Percy Liang. 2018. Know what you don't know: Unanswerable questions for SQuAD. In Proceedings of the Association for Computational Linguistics. +Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. 2016. SQuAD: 100,000+ questions for machine comprehension of text. In Proceedings of Empirical Methods in Natural Language Processing. +Nils Reimers and Iryna Gurevych. 2019. SentenceBERT: Sentence embeddings using Siamese BERT-networks. In Proceedings of Empirical Methods in Natural Language Processing. +Adam Roberts, Colin Raffel, and Noam Shazeer. 2020. How much knowledge can you pack into the parameters of a language model? In Proceedings of Empirical Methods in Natural Language Processing. +Maarten Sap, Saadia Gabriel, Lianhui Qin, Dan Jurafsky, Noah A. Smith, and Yejin Choi. 2020. Social bias frames: Reasoning about social and power implications of language. In Proceedings of the Association for Computational Linguistics. + +John Schulman, Barret Zoph, Christina Kim, Jacob Hilton, Jacob Menick, Jiayi Weng, Juan Uribe, Liam Fedus, Luke Metz, et al. 2022. ChatGPT: Optimizing language models for dialogue. +Robert Stalnaker, Milton K Munitz, and Peter Unger. 1977. Pragmatic presuppositions. In Proceedings of the Texas conference on per~formatives, presuppositions, and implicatures. +Peter F Strawson. 1950. On referring. Mind. +Ellen M. Voorhees and Dawn M. Tice. 2000. The TREC-8 question answering track. In Proceedings of the Language Resources and Evaluation Conference. +Adina Williams, Nikita Nangia, and Samuel Bowman. 2018. A broad-coverage challenge corpus for sentence understanding through inference. In Proceedings of the Conference of the North American Chapter of the Association for Computational Linguistics. +Fangyuan Xu, Junyi Jessy Li, and Eunsol Choi. 2022. How do we answer complex questions: Discourse structure of long-form answers. In Proceedings of the Association for Computational Linguistics. +Michael Zhang and Eunsol Choi. 2021. SituatedQA: Incorporating extra-linguistic contexts into QA. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 7371-7387, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. + +# A Details in Data Source + +License The ELI5 (Fan et al., 2019) dataset uses the BSD License. Our usage of this dataset is consistent with its intended use, and the license will be included when downloading the data. + +Filtering Data Sources. When the question has several comments, we choose the comment with the highest upvotes. Since our data is derived from Reddit, it may contain unintended social bias or harmful content. To remove toxic language on the data, we follow the toxicity word list from Cachola et al. (2018) to remove questions that contain any of the toxic words, except "hell" and "damn", as these two words are commonly used as interjections. The original authors of the ELI5 dataset (Fan et al., 2019) and we have made our best efforts to remove such content; however, it is possible that some harmful context may remain on the data after the filtering process. + +Analysis in Train-Test Overlap. Krishna et al. (2021) reported that $81\%$ of the validation questions of the original ELI5 dataset are paraphrases of the question on the training set. We revisit this issue, and show with a careful assessment of underlying assumptions and a finer-grained definition of "paraphrases", the proportion of paraphrased questions is significantly smaller. + +We assess 104 randomly sampled questions in the validation set with their closest 7 training questions retrieved using c-REALM, as Krishna et al. (2021) did, but with a different rating scale (1-4), following Bhagat and Hovy (2013), Ganitkevitch et al. (2013), and Pavlick et al. (2015): + +- 1: No Paraphrase; No similar intention: Two questions do not share the meaning nor the intention. +- 2: No Paraphrase; Similar intention: Two questions are likely to have the same intention, but they are not paraphrases, because their literal meanings are different and/or their underlying assumptions are different. +- 3: Non-trivial paraphrase: Most of the two questions' meanings are the same; however, they do not belong to any of lexical paraphrase (single word to single word), phrasal paraphrase (multiword to single/multiword), or syntactic paraphrase (paraphrase rules containing non-terminal symbols),10 and require non-trivial + +background knowledge to identify whether they have the same meaning. + +• 4: Paraphrases: Two questions fall into either lexical paraphrase, phrasal paraphrase, syntactic paraphrase, structured paraphrase, or other trivial paraphrase. + +Table 8 presents the percentage and an example of each category. $76.9\%$ questions have a rating of 2 or less, indicating that for most validation question, there are either no similar intention question in the training set, or there are questions with similar intention but either their literal meanings are different or their underlying assumptions are different. In particular, the latter indicates that whether or not there is a false presupposition can be different, even though they may share similar intention. Only $23.1\%$ questions have a rating of 3 and above, indicating that relatively few questions in the validation set have a non-trivial or trivial paraphrase in the training set. + +We also explored automatically filtering paraphrased questions using BLEU or TF-IDF. However, we find it is non-trivial to find the right threshold, thus include all questions and leave filtering to future work. + +# B Details in Data Annotation + +The annotation instruction is in Figure 2, and we show an example of the annotation interface in Figure 3. The data collection is approved by an Institutional Review Board. + +Qualification Task. The qualification task contains 20 pre-annotated questions by the authors, and we provide examples as well as their explanation to workers to demonstrate our task. Based on both whether the worker can correctly identify false presupposition and the writing quality, we selected 30 qualified workers. + +Generation Task. Qualified workers who passed the qualification task work on the main annotation task. Each question is assigned to two generators who independently annotate the label. We monitor the agreement of workers and send the disagreed cases to further validate. We revoke qualification of generators whose more than $10\%$ of annotations marked to be invalid by the annotators. + +Validation Task. If two generators disagree on the label, their annotations are sent to two annotators who judge their validity. We select a smaller + +
1 (45.2%)Dev: Why are aluminium alloys difficult to weld? +Train: Cold welding. Two pieces of metal touch in a vacuum, why do they stick together? How strong is this weld?
2 (31.7%)Dev: How is blood after a transfusion integrated into the body, especially when the transfused RBCs carry different DNA than the host RBCs? +Train: How DNA from blood is changed when getting a blood transfusion +comment The dev question assumes that the transfused RBCs carry DNA, while the train question does not.
3 (6.7%)Dev: How is information retained in solid-state memory devices after power is turned off? +Train: How do electronics keep memory after you take all power sources away? +comment It is not trivial that “information retained in solid-state memory devices” is a paraphrase with “electronics keep memory”.
4 (16.3%)Dev: What is the difference between centrifugal and centripetal force? +Train: The difference between centrifugal force and centripetal force.
+ +number of high qualified workers who have exceptional understanding of false presuppositions and are active users of Reddit. We find that for a small number of highly ambiguous cases, two validators have disagreement. In this case, we send the question to a third validator and take the majority vote. + +Generators and validators are paid with reasonable hourly wage (13 USD/hour and 18 USD/hour, respectively). + +# C Details in Experiments + +# C.1 Model details + +Retrieval model. We use the English Wikipedia from 08/01/2019 provided by Petroni et al. (2021). We obtain c-REALM embeddings of Wikipedia passages as well as the questions. We use FAISS (Johnson et al., 2019) to do approximate maximum inner product search to retrieve the top-5 passages for the query. + +Classifier model. For all the models in the GOLD-COMMENT track track, we use a per GPU batch size of 2, and for all the models in the main track, + +Table 8: The rating scale for paraphrase and examples for each category. + +
Ambiguity in language +♀ When water boils, its bubbles are round, but when it freezes, its crystals are 6-sided. Why isn’t frozen water round or boiling water hexagonally shaped? Aren’t H2O molecules the same in either state? +♂ Bubbles are round because (...) Ice crystals are shaped in such a way because (...) The water molecules are much slower and aren’t bouncing all over the place. Gaseous H2O is much higher energy and further apart so that the regular pattern of ice doesn’t come into effect.
Ambiguity in whether the presupposition is made +♀ How do executives hold board of director positions at multiple fortune 500 companies? +♂ The Board only meets occasionally to vote on more important matters. They don’t really deal with day to day affairs like the CEO does.
+ +Table 9: Two types of ambiguous cases. $\underline{\mathbf{Q}}$ and $\underline{\mathbf{C}}$ indicate the question and the comment, respectively. + +we use the top-5 passages as the context and a per GPU batch size of 8. We train all our model with learning rate $10^{-5}$ , weight decay of 0, and maximum sequence length of 256. We train all our models for 5000 steps and a gradient accumulation step of 5. We run the classifier models with 5 different random seeds and report the best result. + +All experiments were done with two Nvidia-RTX6000 GPUs (the detection subtask) or two Nvidia-A40 GPUs (the writing subtask). We use half-precision training (Micikevicius et al., 2018) when training for our detection task and gradient checkpointing from fairscale (authors, 2021), and choose the best checkpoint based on the performance on the validation set and report its test set performance. For the unified models for the writing subtask, we choose the best checkpoint that gives the best BLEU score for presupposition. + +# C.2 Error analysis on the detection subtask + +We conduct error analysis of predictions from c-REALM + MP classifier in the detection subtask. The authors annotate 50 false positive instances and 50 false negative instances on the validation set, sampled uniformly at random, and categorize the cause of errors. + +Results are reported in in Table 10. Overall, most errors are due to failure in retrieval—although the model often successfully retrieves passages that are on right topic, it fails to retrieve passages that contain enough information about whether the backgrounded presuppositions are true or false. This issue is more prominent in false negatives, likely because finding that the presupposition is true requires significantly more exhaustive search than + +
Error TypeFP(%)FN(%)
RetrievalNo related topic2632
Similar topic but not enough to make decision2040
Indirect evidence and require reasoning-12
ClassificationDirect evidence3410
LabelingGround truth label is wrong88
Inherent DisagreementAmbiguity42
Criticalness20
InconsistencyInformation on the web being inconsistent104
+ +Table 10: The breakdown analysis of false positive/false negative in the validation set for c-REALM + MP classifier model. FP: False positive. FN: False negative. FP : False Presupposition. "Indirect evidence and require reasoning" can also belong to retrieval error. Information on the web being inconsistent: the comment contradicts with the retrieved passages. The categories are not mutually exclusive. + +Why aren't helicopters used to rescue hikers and remove bodies from Mt. Everest? + +C The air in too thin and they can't fly that high up. They create lift by pushing air downwards. The higher up you go, the less air pressure you have, the less downward force a helicopter can make to fight gravity. + +Retrieved Passage: In 2016 the increased use of helicopters was noted for increased efficiency and for hauling material over the deadly Khumbu icefall. In particular it was noted that flights saved icefall porters 80 trips but still increased commercial activity at Everest... + +Original Label: No FP. + +Model Prediction: FP. + +comment Helicopter is used to rescue people from Mt. Everest according to the passages, but the comment does not point this FP out. + +Q How does alcohol effect blood sugar in people with Diabetes? + +C ...Short answer: straight alcohol doesn't affect me at all (vodka, whiskey, etc). I can drink without any noticeable effect on my blood sugar levels (and I have a continuous glucose monitor so I can literally see the effect or lack thereof)... + +Retrieved Passage:The intake of alcohol causes an initial surge in blood sugar, and later tends to cause levels to fall. Also, certain drugs can increase or decrease glucose levels... + +Original Label: FP. + +Model Prediction: no FP. + +comment The comment says that straight alcohol does not affect blood sugar change, but the retrieved passage says otherwise. + +Table 11: Inconsistencies between comment and retrieved passages by c-REALM from Wikipedia. + +noticing that the presupposition is false (since in + +most cases, whether the presupposition is correct is not explicitly mentioned). + +Secondly, there are $8\%$ cases of labeling error in false positive cases. Note that for false positive cases, we did not distinguish between direct evidence and indirect evidence because there is no clear definition of "evidence" for non FP cases. For false negative cases, if there is a retrieved passage that can directly answer the question but the model fails in labeling, we consider this as a classification error rather than retrieving error, because the goal for retrieval is to retrieve passages that could give the answer to the question. The model also suffers more to classify given indirect evidence that requires reasoning, which matches our intuition. + +Inherent disagreement and inconsistency issues contribute to the rest of the errors. We found that minor part (4%, 2% for false positive and false negative cases, respectively) of the error due to the inherent disagreements in labeling ambiguity. We also found that 2% of the false positive errors are due to whether the FP is critical to satisfy users information need based on the question. Furthermore, we also found that 14% of the errors are due to the comment and the retrieved passages are not inconsistent, causing label mismatch, however, they are not a labeling error because our ground truth annotator is not presented with additional passages when annotating. Example of these inconsistencies can be found in Table 11. + +# C.3 Discussion on inherent ambiguity and inconsistency on the web + +Table 12 display examples for the category "Inherent disagreement: ambiguity", "Inherent disagreement: criticalness", and "Information on the web being inconsistent" from the human evaluation section of Section 5.2 and in Table 4. + +9.1% of the errors is due to the inherent ambiguity of the criticalness of the FP, i.e., whether correcting the FP is critical to satisfy users' information needed. For example, for the question "Why do things look darker when wet?" in Table 12, although our human rater found evidence on the internet that there exist things that look darker when dry, which would contradict the presupposition that (all) things look darker when wet, we believe that the question writer is mainly seeking an answer for the reason of the phenomenon that something looks darker when they are wet, and therefore, such FP is not critical to answer the users + +# Inherent disagreement: Ambiguity + +Q How are paintings or museum art classified as masterpieces? Some look like paint scratches and yet they are classics. Why is that? +C Great art isn't just technical skill. Though a lot of those paintings that may look easy usually aren't. But it's also about having an original idea and expressing yourself in a way the world hasn't seen before. (...) +comment Whether the question presupposes that a painting or an art is considered a masterpiece only depends on the technical skill exist in the question is debatable without the comment. +Why is Hydrogen so common on Earth and Helium quite rare? +C Hydrogen is highly reactive, it bonds to oxygen, forming water. Water is quite dense, even as a vapor, and is therefore quite durable in the atmosphere. Helium is a noble gas and nearly perfectly inert. Being unbound to any heavier elements, it quickly rises to the top of the atmosphere and is lost to space by various mechanisms. Hydrogen is lost over time, but only slowly. +comment There is an FP if the question is asking about hydrogen gas (see this webpage); however, if they are asking about hydrogen atom, there is no FP. + +# Inherent disagreement: Criticalness + +Why do things look darker when wet? +C You know how when you vacuum the floor it makes those different colored lines? If you look closely the darker colored parts of the carpet are laying down and the lighter colored parts are standing up. Many things that are dry have little hairs or rough surfaces that are basically standing up like little mirrors to reflect light. When these get knocked over or filled with water they can't reflect as well. A couple of damp riddles 1. What gets wetter as it dries 2. What gets darker as it dries + +# Information on the web being inconsistent + +Why do $78\%$ of Americans live cheque to paycheck? + +News on 06/07/2022: $58\%$ Americans are living paycheck to paycheck. + +News on 01/11/2019: $78\%$ Americans are living paycheck to paycheck. + +Why do pandas eat bamboo and when did they stop eating meat? + +C Everyone so far has gone with the "pandas are so dumb" response so let me give you a proper answer. For a start, evolution is not a intelligent or forward thinking process. Bamboo may be low in energy, but it is abundant, grows quickly and not many other animals eat it. So for any animal that can evolve to consume it, there's an open niche there to be taken. Now I'll admit pandas aren't the best creature at surviving, but they don't really need to be. They live in an environment with abundant food and no predators or competitors, so all they need to do is sit around eating bamboo, expend minimal energy and produce just enough babies to keep the species going. Now that might not seem very efficient from a human perspective, but actually it's a strategy that works surprisingly well, and pandas were doing absolutely fine until humans came along and started hunting them and destroying their habitat. + +WWF: But they do branch out, with about $1\%$ of their diet comprising other plants and even meat. While they are almost entirely vegetarian, pandas will sometimes hunt for pikas and other small rodents. + +Science: Pandas are one of the world's most fascinating vegetarians. Their digestive systems evolved to process meat, yet they eat nothing but bamboo—all day, every day. A new study reveals how these animals survive on a diet that should kill them. + +Table 12: Inconsistencies and inherent ambiguity examples for human performance. + +original question, and therefore the comment writer does not point it out. + +Note that this is different than the "exception" examples mentioned in Table 2, as the comment explicitly pointed out the falsehood of the presupposition, and therefore we consider the FP as critical to answer the user's information seeking need. + +Furthermore, $22.7\%$ of the errors in human performance is due to information on the web being inconsistent. For the question "why do $78\%$ of Americans live paycheck to paycheck?", News on 06/07/2022 points out that $58\%$ Americans lives paycheck to paycheck, while News on 01/11/2019 pointed out that $78\%$ of Americans live paycheck to paycheck. For the question "why do pandas eat bamboo and when did they stop eating meat?", creditable sources such as World Wide Fund(WWF) and Science says differently about whether panda eat meat or not. + +34.1% of the errors are due to ambiguity, as analyzed in Section 3.3. + +# C.4 Details of the writing subtask + +Example generations from each system are shown in Table 13, 14, and 15. As we discuss in Section 6.2, the unified model strongly prefers to generate the correction with prefix "It is not the case that", or simply repeat or negate the presupposition, even though we do not restrict it to do so at inference time. + +Details in Automatic Evaluation. We use sacreBLEU (Post, 2018) from the datasets library (Lhoest et al., 2021). We follow the preprocessing and evaluation script of unigram-F1 following Petroni et al. (2021), and the evaluation script of SentBERT following Reimers and Gurevych (2019). + +Details in Human Evaluation. We conduct human evaluation for 200 questions on the test data. We recruit two student evaluators, who independently evaluate the presupposition and the correction given a question and its comment. They evalu + +# Inputs given to the human raters + +Question: Why do prosecutors/courts seek/sentence prison time greater than the expected lifespan of the offender (i.e. 150 years in prison)? Why not simply sentence those criminals to 'life' in prison instead? + +Comment: Sentencing options are written into state laws. Life in prison is different in state laws than 150 years. Some of it comes into play with the "cruel and unusual punishment" clause in the Constitution too. Life in prison may not be "cruel and unusual" for a murder sentence, but it might be for, say, child sex trafficking. But if you trafficked 10 kids and the sentence is 15 years for each one, you get an effective life sentence that will also stand up, Constitutionally, against a "cruel and unusual punishment" defense. + +# Outputs human raters rate + +# Reference + +Presupposition: It does not make sense to sentence a person to 150 years in prison if they can't live that long anyways, prosecutors should use the life in prison sentence instead. + +Correction: The defendant can argue the life in prison sentence as cruel and unusual, so the actual year sentence is better to give than the alternative. + +# GOLD-COMMENT track, Dedicated + +Presupposition: Penalties should be able to be sentenced to life in prison. + +Correction: Life in prison is different in state laws than 150 years in prison. + +# GOLD-COMMENT track, Unified + +Presupposition: If a criminal is sentenced to life in prison, they should be sentenced to life in prison. + +Correction: It is not the case that if a criminal is sentenced to life in prison, they should be sentenced to life in prison. + +# Main, Dedicated + +Presupposition: Penalties should be able to be imposed on criminals for life. + +Correction: The longer the sentence, the more likely the prosecution will seek to sentence the offender to life in prison. + +# Main, Unified + +Presupposition: Prosecutor's should seek prison time greater than the expected lifespan of the offender. + +Correction: It is not the case that prosecutor's should seek prison time greater than the expected lifespan of the offender. + +Table 13: An example of the input and the output human raters are given for the human evaluation of the writing subtask. Note that human raters are not given which output is a reference or from which system. + +# Inputs given to the human raters + +Question: Why did scientists in the 1970s think that there was going to be a new ice age soon? + +Comment: They didn't. Between 1965 and 1979, there was 7 papers talking about global cooling (not ice age and not necessarily soon). During the same period there was 44 papers about global warming. The media just liked the sensationalism, so there was some news article and a front page on the Times Magazine. They started with a minority of scientist talking about global cooling in a time period when there was still a lot of unknown in climate science and changed that to Scientific consensus that an Ice Age is coming soon. The 7 papers were the following : McComick and Ludwig 1967, Barrett 1971, Rasool and Schneider 1971, Hamilton and Seliga 1972, Chylek and Coakley 1974, Bryson and Dittbemer 1976 and Twomey 1977. + +# Outputs human raters rate + +# Reference + +Presupposition: Scientists in the 1970s had a belief of an upcoming ice age. + +Correction: The scientists of this time talked of global cooling in their near future, however they did not refer to this as an ice age. + +# GOLD-COMMENT track, Dedicated + +Presupposition: Scientists thought there would be a new ice age soon. + +Correction: Scientists didn't think that there would be a new ice age soon, they just thought that there would be one. + +# GOLD-COMMENT track, Unified + +Presupposition: Scientists thought that there was going to be a new ice age soon. + +Correction: Scientists didn't think there was going to be a new ice age soon. + +# Main, Dedicated + +Presupposition: Scientists in the 1970s thought that there was going to be a new ice age soon. + +Correction: Scientists in the 1970s did not think that there was going to be a new ice age. + +# Main, Unified + +Presupposition: Scientists in the 1970s thought that there was going to be a new ice age soon. + +Correction: Scientists in the 1970s thought that there was going to be a new ice age soon. + +Table 14: Another example of the input and the output human raters are given for the human evaluation of the writing subtask. Note that human raters are not given which output is a reference or from which system. + +ated five outputs, including the reference in the data as well as generations from four systems in Section 6.1: the dedicated and the unified model from the GOLD-COMMENT track and the main track, re + +spectively. + +We design detailed evaluation scheme, hold a 1 hour in-person tutorial session for human evaluators to be familiarized with the evaluation task. + +# Inputs given to the human raters + +Question: If the phases of the moon are due to the Earths shadow, why is the half moon a straight line/perfect semi circle, instead of a rounded shadow? + +Comment: Unless you're looking at a lunar eclipse, the part of the moon that's not lit up is not in the Earth's shadow, it's in the moon's shadow. The bright portion is facing the sun, and is therefore illuminated, and the dark portion is facing away from the sun, and therefore not illuminated. + +# Outputs human raters rate + +# Reference + +Presupposition: If the phases of the moon are presumed to be the Earth's shadow, then phases should never be a straight line due to the earth being rounded. + +Correction: With the exception of the lunar eclipse, the phases of the moon are not caused by the shadow of the Earth. + +# GOLD-COMMENT track, Dedicated + +Presupposition: The phases of the moon are due to the Earth's shadow. + +Correction: The part of the moon that is not lit up is in the moon's shadow. + +# GOLD-COMMENT track, Unified + +Presupposition: The phases of the moon are due to the Earth's shadow. + +Correction: It is not the case that the phases of the moon are due to the Earth's shadow. + +# Main, Dedicated + +Presupposition: Half moon is a straight line/perfect semi circle. + +Correction: The moon is not a rounded shadow, it is a straight line. + +# Main, Unified + +Presupposition: The phases of the moon are due to the Earth's shadow. + +Correction: It is not the case that the phases of the moon are due to the Earth's shadow. + +Table 15: Another example of the input and the output human raters are given for the human evaluation of the writing subtask. Note that human raters are not given which output is a reference or from which system. + +In particular, each output is rated based on four aspects as follows. + +Fluency measures the fluency of the generated text, mainly whether it have repetitions, spelling errors or grammatical errors, or gibberish. + +0: Generated text have fluency errors. +3: Generated text is free of fluency errors. + +Presupposition evaluates whether the generated presupposition is the valid one in the question and whether it is factually false according to the comment. + +0: The presupposition is invalid, i.e., does not exist in the question. +1: The presupposition is valid, e.g., exists in the question, but it is not factually false. +3: The presupposition is valid and is factually false. + +Correction evaluates whether the generated correction provides a valid correction to the presupposition based on the comment with no hallucinated information, and provides enough justification (rather than simply being a negated presupposition). The former considers correctness (precision of the information), while the latter considers adequacy (recall of the information) + +0: The correction is wrong based on the comment, or the correction is hallucinated. + +1: The correction is correct based on the comment, but no additional information is provided to justify, or is a simple negation of the presupposition. +2: The correction is correct based on the comment, but misses some details to fully justify the falsehood of presupposition. +3: The correction is correct and provide enough information to justify the falsehood of presupposition. + +Consistency requires the generated assumption and correction should be on the same topic and negate each other. + +0: The presupposition and correction are not about the same topic. +1: The presupposition and correction are on the same topic, but they are not negating each other, or the negation is not explicit. +3: The presupposition and correction are consistent: are on the same topic and negate each other. + +The evaluators are paid 17 USD/hour. See Section 6.3 for the results and discussion. + +# D A case study with GPT-3 + +Large language models such as GPT-3 (Brown et al., 2020) have shown impressive performance + +$Q$ : If there's an equal and opposite reaction for everything, how does any action happen? Isn't it balanced out by the opposite reaction? + +$FP$ : The equal and opposite reaction apply to the same object. + +Corr: Based on Newton's Law of Motion, the equal and opposite reaction apply to different objects. Only forces that are applied to the same object would be cancelled out. + +1 GPT-3 given Q, temp=0.0: The equal and opposite reaction is not always instantaneous, so an action can still happen even if there is an equal and opposite reaction. + +comment Factually false. The equal and opposite reaction are always instantaneous. + +2 GPT-3 given Q, temp=0.7: According to Newton's third law of motion, "For every action, there is an equal and opposite reaction." However, this only applies to objects interacting with other objects. In other words, if Object A exerts a force on Object B, then Object B will exert an equal and opposite force on Object A. However, if there is no other object for the force to be exerted on, then there is no equal and opposite reaction, and the force will simply cause the object to accelerate in the direction of the force. + +comment Does not explicitly point out FP, and the correction of FP is factually wrong. + +3 GPT-3 given Q, temp=0.7 (different sample): There is an equal and opposite reaction for every action, but this doesn't mean that every action is balanced out by the opposite reaction. For example, if you push on a wall, the wall pushes back on you with an equal and opposite force. However, the wall doesn't move because the force you're exerting on it is balanced out by the force of the wall pushing back on you. + +comment The correction of FP is factually wrong. In the scenario mentioned in the generation, the wall does not move because its mass is large. Besides, this scenario is not related to what the question is asking about. + +4 GPT-3 given $\mathbf{Q} +$ "Or did I miss anything?", temp=0.7: No, you didn't miss anything. The equal and opposite reactions do balance each other out, but the net result is still an action. This is because the reactions don't happen instantaneously - there is a brief period of time during which one reaction is occurring without the other. During this time, the system is unbalanced and an action can occur. + +comment Factually false, and fail to identify FP. The equal and opposite reactions do not balance out, and they happen instantaneously. + +5 GPT-3 given Q + "Or did I misunderstand anything?", temp=0.7: Newton's third law of motion states that for every action, there is an equal and opposite reaction. However, this does not mean that every action is perfectly balanced by an equal and opposite reaction. Instead, it means that the total force exerted by all objects on each other is always zero. + +comment Does not explicitly point out FP, and provide adequate correction. + +6 GPT-3 given $\mathbf{Q} +$ "Or do I have any misunderstanding?", temp=0.7: There is an equal and opposite reaction for every action, but not every reaction is equal in magnitude to the action. For example, if you push on a wall, the wall pushes back on you with an equal and opposite force, but the force exerted by the wall is much less than the force you exerted. This is because the wall is much more massive than you are, so it takes more force to move it. + +comment Factually false. The force exerted by 'you' and the force exerted by the wall is equal. Besides, this is not what the question is asking about. It is answering a different question: why the wall won't move given a force from you. + +Table 16: Response from InstructGPT (text-davinci-002) given an example question. temp=0.0 is deterministic, and temp=0.7 is the default value in GPT-3. Generations are obtained by sampling multiple times or using slightly different templates. We did not cherry-pick these generations: we ran the model six times and report all. + +$Q$ : How does flavored seltzer have 0 calories per serving but 10 calories per bottle? + +$FP$ : If something has 0 calories per serving then it cannot have any calories in total. + +Corr: If a serving has under 5 calories, it can be rounded down to 0. + +Instruct GPT-3: Flavored seltzer typically has 0 calories per serving, but 10 calories per bottle because the bottle contains multiple servings. + +comment Does not point out that there can be $>0$ calories per serving. + +ChatGPT Mar 08th Snapshot: ... The reason that a bottle of flavored seltzer may list 10 calories on the label is because the servicing size is often one full bottle, which typically contains multiple servings. So, while a single serving may have 0 calories, the entire bottle may contain 10 calories or more.... + +comment Does not point out that there can be $>0$ calories per serving. + +ChatGPT May 21th Snapshot: ... The discrepancy you mentioned regarding flavored seltzer's calorie content per serving and per bottle is likely due to serving size and rounding conventions. When a flavored seltzer is labeled as having 0 calories per serving, it means that the amount of calories present in a single serving is so low that it falls below the threshold required for rounding up to the nearest whole calorie. This is typically 5 calories per serving. Consequently, the manufacturer can round down and label it as having 0 calories per serving... + +comment Correct. + +Table 17: Response from Instruct GPT-3 (text-davinci-002) and ChatGPT (Schulman et al. (2022), March snapshot, May snapshot) given an example question. + +in generating a response to the question. We conduct small-scale evaluation of Instruct GPT-3 (text-davinci-002), whose details are not + +public but is known as the best version of GPT-3. An example is depicted in Table 16. We find that most generations are roughly on the right topic, + +e.g., all generations in Table 16 discuss Newton's Law of Motion. However, they rarely correctly satisfy users information need: + +- Most of them include information that is factually false, e.g., the equal and the opposite action are not instantaneous (1 4), their magnitude is not equal (2 6), or they do balance out (3). +- They are often not precisely about what the question is asking about. For instance, they discuss why an object may not move given a force, e.g., the wall does not move when you hit the wall (2 6). This is related to Newton's Law of Motion, but not at all to the question. +- They do not explicitly identify false presuppositions. None of the generation mentions that the key misunderstanding is that the equal and opposite reaction apply to different objects, thus are not cancelled out. Sometimes the generation indicate some part of the question is wrong (indicates with 'but' or 'However') but does not precisely point out what is wrong, nor provide corrections. + +It is possible performance could be improved with better prompting, but we leave this possibility to future work. We also experiment with ChatGPT in Mar 2023 and May 2023 in Table 17, but due to the closeness and the continuation of update, it is hard to evaluate and do an ablation study of the model, but we think the model is better than InstructGPT in generating answers that explicitly point out the false presupposition, but we leave the possibility to systematically evaluate this model on our task to future work. + +# E False Presuppositions in Other Data + +While we focus on questions from an online forum due to the availability of large unlabeled data and the domain being fairly general, we argue that false presuppositions are not specific to such domains. In fact, false presuppositions are more prevalent when the domain is specific and requires expertise. + +We analyze 50 random samples of unanswerable questions from QASPER (Dasigi et al., 2021), a dataset consisting of information-seeking questions on NLP research papers, posed by NLP experts. We find that, out of 48 questions that are unanswerable (2 of them turn out to have valid answers), $25\%$ of them has false presuppositions, because the question writer does not have sufficient background knowledge or misses facts in the research paper. + +1 Paper title: Combating Adversarial Misspellings with Robust Word Recognition +$Q$ : Why do they experiment with RNNs instead of transformers for this task? +$FP$ : The paper does not experiment with transformers. +Corr: The paper uses RNNs and BERT. The question writer either missed the fact that they used BERT, or did not know that BERT is based on transformers. + +2 Paper title: Analysis of Wikipedia-based Corpora for Question Answering +$Q$ : Can their indexing-based method be applied to create other QA datasets in other domains, and not just Wikipedia? +FP: Their indexing-based method is applied to create a QA dataset in the Wikipedia domain. +Corr: Their indexing-based method is not for creating QA datasets. This is for aligning (already annotated) answer context to a particular Wikipedia corpus. + +3 Paper title: Automatic Classification of Pathology Reports using TF-IDF Features +$Q$ : How many annotators participated? +$FP$ : There are annotators. +Corr: There is no annotators. The paper created a dataset, but the data construction process is entirely automatic. + +Table 18: Example questions with false presuppositions on QASPER (Dasigi et al., 2021). $Q$ , $FP$ and $Corr$ indicate the question, false presupposition, and the correction, respectively. + +Table 18 shows a subset of such questions, along with false presuppositions and their correction annotated by the author. Identification of false presuppositions requires external knowledge beyond the specific paper the question writer is reading (1), or requires understanding of details of the paper which may not be explicitly written with the exact same terms in the paper (2 and 3). + +It should be noted that this percentage is a strict lower bound of true percentage and may be significantly underestimated since identification of false presupposition requires knowledge in NLP; the estimate will be higher when annotated by multiple NLP experts. Moreover, presuppositions will significantly more prevalent when question writers are non-expertise, unlike in QASPER whose question writers are NLP experts. + +We did not annotate and experiment with QASPER because the data is relatively small (272 and 62 unanswerable questions on the training set and on the validation set, respectively), but future work can investigate this data as well we domain transfer of models. + +# Instructions (Click to collapse). + +We will manually review HITs and invite a very small number of workers to the main task (\$15/hour) who submitted exceptional quality of HITs. To successfully complete your HIT, you must read the full instruction and examples in detail. Please expect at most 24 hours delay until getting qualification. $\longrightarrow$ Each HIT may take up to $0\mathrm{min}$ in the beginning, but very soon you will be used to the task and complete the HIT in less than $4\mathrm{min}$ . + +Please note that reading instructions and all examples very carefully is necessary in order to understand the task and maintain your qualification. + +In this task, you are given 20 questions (10 questions in the main task) posted on Reddit as well as responses to questions. You will go through the following step for each question. + +Step 1: Read the question, and see if the question is subjective or nonsense. + +Sample questions that are subjective: + +How come stuff that gives us easy pleasure has bad side effects (e.g. fast food), and things that are not fun give great side effects (e.g. exercise)? + +Why am I happy every time I go to sleep? + +Example question that is not subjective nor nonsense: + +Why do doctors advice against alcohol consumption when prescribing antibiotics like clarithromycin? + +Even if the topic of the question is related to the emotion or personal experience, if there is possibly a fact-based response to the question, do not mark it as subjective. + +Note that only $\sim 5\%$ questions will be subjective or nonsense. + +Step 2: Read the response, and see if it is uninformative, bad quality or nonsense. + +Sample response that is uninformative: + +I did not get the question. Could you rephrase it? + +re useful to the question writer. Note that only $\sim 3\%$ questions will be uninformative, bad quality or nonsense. + +Step 3: See if the response says any assumption made by the question writer is wrong. You should consider any kind of assumption that the question writer is likely to make, either explicit or implicit. Note that you do not judge whether the response is + +actually correct or not. Please always assume the response is correct. + +Example with wrong assumption: + +- Question: Why do doctors advice against alcohol consumption when prescribing antibiotics like clarithromycin? + +Response: Certain antibiotics, like metronidazole, can cause a disulfiram reaction. Other antibiotics generally don't have this effect. + +- Requester comment: The question presumably assumes that alcohol has a bad effect when consumed with any antibiotics. However, the response saves antibiotics other than metronidazole generally do not have a bad effect. + +- More example with implicit wrong assumption: (Click to collapse) + +a. Question: How is Pi programmed into calculators? + +Question: How is it phogamre into calculations? + +- Requester comment: The question implicitly assumes that the whole number of ni is programmed into calculators since otherwise they won't ask this question and the response points out that only limited digits of ni is programmed into + +calculators + +- More example with explicit wrong assumption: (Click to collapse) + +Question: Do people with fully prosthetic legs have the ability to run for longer periods of time due to them not having muscle exhaustion in their legs? + +- Response: No, in fact they will get tired faster. The amount of energy it takes to run is still approximately the same, because the person's weight wouldn't change much. They have fewer muscles to provide that energy which requires the remaining muscles to work harder. + +$\circ$ Requester comment: The question assumes that people with fully prosthetic legs will run longer due to fewer muscle exhaustion in their legs. However, the response corrects it by saying they would get tired faster. + +Example without wrong assumption: + +Question: How do companies make money from an acquired company? + +$\circ$ Response: They get money through dividends. + +$\circ$ Requester comment: The response does not point out any wrong assumption in the question. + +are subtle example without wrong assumption: (Click to expand) + +Note that around the response points out wrong assumption in $30 - 40\%$ of cases. + +Step 4: Write down the assumption in the question that is wrong, as well as the correction made by the response. Usually, the correction is a simple negation of the assumption. + +ample: + +Question: Why do doctors advice against alcohol consumption when prescribing antibiotics like clarithromycin? + +Response: Certain antibiotics, like metronidazole, can cause a disulfiram reaction. Other antibiotics generally don't have this effect. + +Assumption you will write: Alcohol has a bad effect when consumed with any antibiotics. + +$\circ$ Correction you will write: Antibiotics other than metronidazole generally don't have a bad effect when consumed with alcohol. + +# Please follow the requirements when writing (for both assumption and correction). + +- (A) Use concise declarative sentence for both assumption and correction. Don't start the sentence with "The question assumes that" or "That". Your writings will not pass if you simply copy and paste the response. + +(B) Use the language from the question and the response as much as possible. + +Higher priority to use the language (wordings) from the question, and then to use the language (wordings) from the response. + +However, make sure your writings are formal. + +In case there are typos or grammar mistakes in the question or the response, please fix them. + +C Be grounded by the response, i.e., do not write a wrong assumption if it is not pointed out by the response). + +- (D) Provide minimal explanation from the response, but don't be too detailed. Include a short and concise explanation in addition to "A is not B" in the correction if the correction is not intuitive. Use the response as the source. + +- (E) Be independent and standalone from the response. Anyone should be able to get the full context when given the question and your annotations without the response. + +Don't use pronouns. + +- Be mindful about word choices. + +Example of bad writing due to (B) and (E). (Click to collapse) + +Question: Do people with fully prosthetic legs have the ability to run for longer periods of time due to them not having muscle exhaustion in their legs? + +- Response: No, in fact they will get tired faster. The amount of energy it takes to run is still approximately the same, because the person's weight wouldn't change much. They have fewer muscles to provide that energy which requires the remaining muscles to work harder. + +ad writings due to not using the language from the question: + +Assumption: People with fully prosthetic legs get tired slower. + +- Correction: People with fully prosthetic legs get tired faster. + +ad writings due to using pronounce (not being standalone): + +Assumption: They have the ability to run for longer periods of time. + +- Correction: They are not able to run for longer periods of time. + +Good: + +Assumption: People with fully prosthetic legs have the ability to run for longer periods of time. + +- Correction: People with fully prosthetic legs are not able to run for longer periods of time. + +# + +Example of bad writing due to (A), (D) and (E). (Click to collapse) + +- Question: Wouldn't it be more fuel efficient if rockets took off like planes? + +Response: It would and is. Carrying the wings into space would be extremely fuel inefficient, so the only successful design I know of that takes off that way then detaches from it's airplane stage when it reaches a certain speed and altitude. + +Bad writings due to overly short correction: + +Assumption: Rockets do not take off like planes. + +a. Correction: Rockets take off like planes + +Bad writings (not standalone, a bit too detailed) + +8. Assumption: Rockets do not take off like planes. + +- Assumption: Roaches do not take on the planes; + +Good writings: + +Assumption: Rockets do not take off like planes. + +- Correction: Rockets take off like planes until it reaches a certain speed and altitude. + +Example of bad writing due to (A), (B) and (C). (Click to collapse) + +Question: How is Pi programmed into calculators? + +Response: They don't need to put in the whole number. They just have to put it in to the point where the next digit won't change much at all. After the tenth digit of pi for example not much will change in your calculation. + +- Bad correction due to not using the language from the question (the word "approximate" is not in either question or response): + +$\circ$ Assumption: The whole number of Pi is programmed into calculators. + +- Correction: Pi is approximated into the calculators. + +Bad correction (not conise enough, the language is n + +$\circ$ Assumption: The whole number of Pi is programmed into calculators. + +- Correction: Pi is programmed into the calculator up to the point where the next digit won't change the computation a lot, like 10 digits. + +Good correction: + +Assumption: The whole number of Pi is programmed into calculators. + +Good correction: Only a first few digits of Pi is programmed into calculators. + +Figure 2: The instruction we provided for our qualification task. + +Question 14: why do airplane flight tracks always make big arcs, rather than a "straight line" directly to your destination? + +Is this question subjective or nonsense? +Yes, the question is subjective or nonsense. No, the question looks good. + +Response: Because the earth is round and what you're seeing is a projection on a 2D map of the shortest path on a sphere (the Earth). + +Is this response uninformative, bad quality or nonsense? (Do not assess whether the comment is factually correct.) + +Yes, the response is uninformative, bad quality or nonsense. No, the response looks good. + +Does the response point out that any assumption made by the question writer is wrong? (Consider both explicit and implicit assumption. You should assume the response is always correct.) +Yes, the comment points out that some assumptions made by the question writer is wrong. No. + +What is that assumption in the question that is wrong? (It should be a concise, declarative sentence, and use the language from the question as much as possible.) + +Airplane flight tracks are arcs. + +What is the correction by the response? (It should be a concise, declarative sentence, and use the language from the question/comment as much as possible.) + +They appear to be arcs because the earth is round. + +When you are done with writing, move on to the next question! + +Figure 3: An example of our designed annotation interface. + +A For every submission: + +A1. Did you describe the limitations of your work? + +In limitations, Appendix D.2, D.3 + +A2. Did you discuss any potential risks of your work? + +Appendix A + +A3. Do the abstract and introduction summarize the paper's main claims? + +Section 1 + +A4. Have you used AI writing assistants when working on this paper? + +Left blank. + +B Did you use or create scientific artifacts? + +Section 3 + +B1. Did you cite the creators of artifacts you used? + +Section 3.1, Data source + +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? + +Appendix A. We will add license in our released github repository so that people will download the data with the license. + +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +Intend use of the data is clear from Section 1, 3, and 4. + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? + +Appendix A: Details in Data Source includes how we remove toxic languages in the dataset. No personal information other than MTurk ID is collected in the data collection process. + +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? + +Table 2, Section 1 L121-125. + +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. + +Table 1 + +C Did you run computational experiments? + +Section 5 and 6. + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +Section 5.1, Section 5.2, Appendix D.1 + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? +Appendix D.1 +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? +Appendix D.1 +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? Section 4, Appendix D.4 + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? Section 3, Appendix B + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? Appendix D.4., Figure 2, Figure 3 +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? Appendix B, Appendix D.4 +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? We recruit people and people need to opt-in to participate in annotation. All our annotators were aware of the intent of the annotations. +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? Appendix B +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? Appendix D.4 \ No newline at end of file diff --git a/crepeopendomainquestionansweringwithfalsepresuppositions/images.zip b/crepeopendomainquestionansweringwithfalsepresuppositions/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..999f4baa42f6b4fb8b88fe999a148f9a274614a3 --- /dev/null +++ b/crepeopendomainquestionansweringwithfalsepresuppositions/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:36f8ff071dac491671e3938947c7a002d4689c808c0e54df6183477d7eed6456 +size 698938 diff --git a/crepeopendomainquestionansweringwithfalsepresuppositions/layout.json b/crepeopendomainquestionansweringwithfalsepresuppositions/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..c51d1569d20f5ca6324733eac6def121a0d2bdb1 --- /dev/null +++ b/crepeopendomainquestionansweringwithfalsepresuppositions/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0dcc512ac65f843e3c42aadebaf457eacf7d692fdc0bcf374d500adbecab8fdd +size 920889 diff --git a/crestajointframeworkforrationalizationandcounterfactualtextgeneration/634f32f6-e6ab-4f0a-9d1e-ecba2ac8a4ee_content_list.json b/crestajointframeworkforrationalizationandcounterfactualtextgeneration/634f32f6-e6ab-4f0a-9d1e-ecba2ac8a4ee_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..63894b13b69619ac93959c9a53f69ec15de374ac --- /dev/null +++ b/crestajointframeworkforrationalizationandcounterfactualtextgeneration/634f32f6-e6ab-4f0a-9d1e-ecba2ac8a4ee_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a5b179e836afe9503bb91ddf7f3333ea5d3ba685b9a27630ff56293f2719e6c7 +size 128209 diff --git a/crestajointframeworkforrationalizationandcounterfactualtextgeneration/634f32f6-e6ab-4f0a-9d1e-ecba2ac8a4ee_model.json b/crestajointframeworkforrationalizationandcounterfactualtextgeneration/634f32f6-e6ab-4f0a-9d1e-ecba2ac8a4ee_model.json new file mode 100644 index 0000000000000000000000000000000000000000..d46b3b0f72f836cf8c3bed9cacfdb529d4f2621d --- /dev/null +++ b/crestajointframeworkforrationalizationandcounterfactualtextgeneration/634f32f6-e6ab-4f0a-9d1e-ecba2ac8a4ee_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:87fae4b5a2009d3b92581c914ae0531396fe302b4f81407192c4040f5be2baf3 +size 151083 diff --git a/crestajointframeworkforrationalizationandcounterfactualtextgeneration/634f32f6-e6ab-4f0a-9d1e-ecba2ac8a4ee_origin.pdf b/crestajointframeworkforrationalizationandcounterfactualtextgeneration/634f32f6-e6ab-4f0a-9d1e-ecba2ac8a4ee_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ed6b9875cc94c209f0cdeeeab4f62a8646839c3d --- /dev/null +++ b/crestajointframeworkforrationalizationandcounterfactualtextgeneration/634f32f6-e6ab-4f0a-9d1e-ecba2ac8a4ee_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:287f59ce9fca392f6f11fe79b1f133558fde6a141e298ce2f03fc15ba55b8d04 +size 1047958 diff --git a/crestajointframeworkforrationalizationandcounterfactualtextgeneration/full.md b/crestajointframeworkforrationalizationandcounterfactualtextgeneration/full.md new file mode 100644 index 0000000000000000000000000000000000000000..e2a6f77186998d7838f455012be6c2992bff9dd8 --- /dev/null +++ b/crestajointframeworkforrationalizationandcounterfactualtextgeneration/full.md @@ -0,0 +1,491 @@ +# CREST: A Joint Framework for Rationalization and Counterfactual Text Generation + +Marcos Treviso $^{1,2*}$ , Alexis Ross $^{3}$ , Nuno M. Guerreiro $^{1,2}$ , André F. T. Martins $^{1,2,4}$ + +$^{1}$ Instituto de Telecomunicações, Lisbon, Portugal + +$^{2}$ Instituto Superior Tecnico & LULIS (Lisbon ELLIS Unit), Lisbon, Portugal + +3Massachusetts Institute of Technology + +4Unbabel, Lisbon, Portugal + +# Abstract + +Selective rationales and counterfactual examples have emerged as two effective, complementary classes of interpretability methods for analyzing and training NLP models. However, prior work has not explored how these methods can be integrated to combine their complementary advantages. We overcome this limitation by introducing CREST (ContRastive Edits with Sparse raTionalization), a joint framework for selective rationalization and counterfactual text generation, and show that this framework leads to improvements in counterfactual quality, model robustness, and interpretability. First, CREST generates valid counterfactuals that are more natural than those produced by previous methods, and subsequently can be used for data augmentation at scale, reducing the need for human-generated examples. Second, we introduce a new loss function that leverages CREST counterfactuals to regularize selective rationales and show that this regularization improves both model robustness and rationale quality, compared to methods that do not leverage CREST counterfactuals. Our results demonstrate that CREST successfully bridges the gap between selective rationales and counterfactual examples, addressing the limitations of existing methods and providing a more comprehensive view of a model's predictions. + +# 1 Introduction + +As NLP models have become larger and less transparent, there has been a growing interest in developing methods for finer-grained interpretation and control of their predictions. One class of methods leverages selective rationalization (Lei et al., 2016; Bastings et al., 2019), which trains models to first select rationales, or subsets of relevant input tokens, and then make predictions based only on the selected rationales. These methods offer increased interpretability, as well as learning benefits, such + +![](images/cce7a6adf6e199575fd99f518e8bef2dc92056285747565ccfde0a315d8888b7.jpg) +CREST-Generation (S3) +Figure 1: Our generation procedure consists of two stages: (i) a mask stage that highlights relevant tokens in the input through a learnable masker; and (ii) an edit stage, which receives a masked input and uses a masked language model to infill spans conditioned on a pretended label. + +as improved robustness to input perturbations (Jain et al., 2020; Chen et al., 2022). Another class of methods generates counterfactual examples, or modifications to input examples that change their labels. By providing localized views of decision boundaries, counterfactual examples can be used as explanations of model predictions, contrast datasets for fine-grained evaluation, or new training datapoints for learning more robust models (Ross et al., 2021; Gardner et al., 2020; Kaushik et al., 2020). + +This paper is motivated by the observation that selective rationales and counterfactual examples allow for interpreting and controlling model behavior through different means: selective rationalization improves model transparency by weaving interpretability into a model's internal decision-making process, while counterfactual examples provide external signal more closely aligned with human causal reasoning (Wu et al., 2021). + +We propose to combine both methods to leverage their complementary advantages. We introduce CREST (ContRastive Edits with Sparse raTionalization), a joint framework for rationalization and + +![](images/3b58f3df564c0663b08505ad2aed7c3f6da6a3ccd42fbfcd4c9ccf24fd91773a.jpg) +Figure 2: Overview of CREST-Rationalization. We start by passing an input $\pmb{x}$ through CREST-Generation, which yields a counterfactual edit $\tilde{\pmb{x}}$ along side two masks: $\pmb{z}^{\star}$ for the original input, and $\tilde{z}^{\star}$ for the counterfactual. Next, we train a new rationalizer (masker) decomposed into two flows: a factual flow that takes in $\pmb{x}$ and produces a rationale $\pmb{z}$ , and a counterfactual flow that receives $\tilde{\pmb{x}}$ and produces a rationale $\tilde{z}$ . Lastly, we employ a regularization term $\Omega(\pmb{z}, \tilde{\pmb{z}})$ to encourage agreement between rationales for original and counterfactual examples. + +counterfactual text generation. CREST first generates high-quality counterfactuals (Figure 1), then leverages those counterfactuals to encourage consistency across "flows" for factual and counterfactual inputs (Figure 2). In doing so, CREST unifies two key important dimensions of interpretability introduced by Doshi-Velez and Kim (2017, §3.2), forward simulation and counterfactual simulation. Our main contributions are: + +- We present CREST-Generation (Figure 1), a novel approach to generating counterfactual examples by combining sparse rationalization with span-level masked language modeling ( $\S 3$ ), which produces valid, fluent, and diverse counterfactuals ( $\S 4$ , Table 1). +- We introduce CREST-Rationalization (Figure 2), a novel approach to regularizing rationalizers. CREST-Rationalization decomposes a rationalizer into factual and counterfactual flows and encourages agreement between the rationales for both ( $\S 5$ ). +- We show that CREST-generated counterfactuals can be effectively used to increase model robustness, leading to larger improvements on contrast and out-of-domain datasets than using manual counterfactuals (§6.2, Tables 2 and 3). +- We find that rationales trained with CREST-Rationalization not only are more plausible, but also achieve higher forward and counterfactual simulabilities (§6.3, Table 4). + +Overall, our experiments show that CREST successfully combines the benefits of counterfactual examples and selective rationales to improve the quality of each, resulting in a more interpretable and robust learned model. + +# 2 Background + +# 2.1 Rationalizers + +The traditional framework of rationalization involves training two components cooperatively: the generator—which consists of an encoder and an explainer—and the predictor. The generator encodes the input and produces a "rationale" (e.g., word highlights), while the predictor classifies the text given only the rationale as input (Lei et al., 2016). + +Assume a document $\pmb{x}$ with $n$ tokens as input. The encoder module (enc) converts the input tokens into $d$ -dimensional hidden state vectors $H \in \mathbb{R}^{n \times d}$ , which are passed to the explainer (expl) to generate a latent mask $z \in \{0,1\}^n$ . The latent mask serves as the rationale since it is used to select a subset of the input $x \odot z$ , which is then passed to the predictor module (pred) to produce a final prediction $\hat{y} \in \mathcal{V}$ , where $\mathcal{V} = \{1,\dots,k\}$ for $k$ -class classification. The full process can be summarized as follows: + +$$ +z = \exp (\operatorname {e n c} (x; \phi); \gamma), \tag {1} +$$ + +$$ +\hat {y} = \operatorname {p r e d} (\boldsymbol {x} \odot \boldsymbol {z}; \theta), \tag {2} +$$ + +where $\phi, \gamma, \theta$ are trainable parameters. To ensure that the explainer does not select all tokens (i.e., $z_{i} = 1, \forall i$ ), sparsity is usually encouraged in the + +rationale extraction. Moreover, explainers can also be encouraged to select contiguous words, as there is some evidence that it improves readability (Jain et al., 2020). These desired properties may be encouraged via regularization terms during training (Lei et al., 2016; Bastings et al., 2019), or via application of sparse mappings (Treviso and Martins, 2020; Guerreiro and Martins, 2021). + +In this work, we will focus specifically on the SPECTRA rationalizer (Guerreiro and Martins, 2021): this model leverages an explainer that extracts a deterministic structured mask $z$ by solving a constrained inference problem with SparseMAP (Niculae et al., 2018). SPECTRA has been shown to achieve comparable performance with other rationalization approaches, in terms of end-task performance, plausibility with human explanations, and robustness to input perturbation (Chen et al., 2022). Moreover, it is easier to train than other stochastic alternatives (Lei et al., 2016; Bastings et al., 2019), and, importantly, it allows for simple control over the properties of the rationales, such as sparsity via its constrained inference formulation: by setting a budget $B$ on the rationale extraction, SPECTRA ensures that the rationale size will not exceed $\lceil Bn \rceil$ tokens. + +# 2.2 Counterfactuals + +In NLP, counterfactuals refer to alternative texts that describe a different outcome than what is encoded in a given factual text. Prior works (Verma et al., 2020) have focused on developing methods for generating counterfactuals that adhere to several key properties, including: + +- Validity: the generated counterfactuals should encode a different label from the original text. +- Closeness: the changes made to the text should be small, not involving large-scale rewriting of the input. +- Fluency: the generated counterfactuals should be coherent and grammatically correct. +- Diversity: the method should generate a wide range of counterfactuals with diverse characteristics, rather than only a limited set of variations. + +While many methods for automatic counterfactual generation exist (Wu et al., 2021; Robeer et al., 2021; Dixit et al., 2022), our work is mostly related to MiCE (Ross et al., 2021), which generates counterfactuals in a two stage process that involves + +masking the top- $k$ tokens with the highest $\ell_1$ gradient attribution of a pre-trained classifier, and infilling tokens for masked position with a T5-based model (Raffel et al., 2020). MiCE further refines the resultant counterfactual with a binary search procedure to seek strictly minimal edits. However, this process is computationally expensive and, as we show in §4.2, directly optimizing for closeness can lead to counterfactuals that are less valid, fluent, and diverse. Next, we present an alternative method that overcomes these limitations while still producing counterfactuals that are close to original inputs. + +# 3 CREST-Generation + +We now introduce CREST (ContRastive Edits with Sparse raTionalization), a framework that combines selective rationalization and counterfactual text generation. CREST has two key components: (i) CREST-Generation offers a controlled approach to generating counterfactuals, which we show are valid, fluent, and diverse ( $\S 4.2$ ); and (ii) CREST-Rationalization leverages these counterfactuals through a novel regularization technique encouraging agreement between rationales for original and counterfactual examples. We demonstrate that combining these two components leads to models that are more robust ( $\S 6.2$ ) and interpretable ( $\S 6.3$ ). We describe CREST-Generation below and CREST-Rationalization in $\S 5$ . + +Formally, let $\pmb{x} = \langle x_1, \dots, x_n \rangle$ represent a factual input text with a label $y_f$ . We define a counterfactual as an input $\tilde{\pmb{x}} = \langle x_1, \dots, x_m \rangle$ labeled with $y_c$ such that $y_f \neq y_c$ . A counterfactual generator is a mapping that transforms the original text $\pmb{x}$ to a counterfactual $\tilde{\pmb{x}}$ . Like MiCE, our approach for generating counterfactuals consists of two stages, as depicted in Figure 1: the mask and the edit stages. + +Mask stage. We aim to find a mask vector $\mathbf{z} \in \{0,1\}^n$ such that tokens $x_{i}$ associated with $z_{i} = 1$ are relevant for the factual prediction $\hat{y}_f$ of a particular classifier $C$ . To this end, we employ a SPECTRA rationalizer as the masker. Concretely, we pre-train a SPECTRA rationalizer on the task at hand with a budget constraint $B$ , and define the mask as the rationale vector $\mathbf{z} \in \{0,1\}^n$ (see §2.1). + +Edit stage. Here, we create edits by infilling the masked positions using an editor module $G$ , such as a masked language model: $\tilde{\boldsymbol{x}}\sim G_{\mathrm{LM}}(\boldsymbol {x}\odot \boldsymbol {z})$ In order to infill spans rather than single tokens, we follow MiCE and use a T5-based model to infill + +
MethodIMDBSNLI
val. ↑fl. ↓div. ↓clo. ↓#tpsval. ↑fl. ↓div. ↓clo. ↓#tps
Chance baseline50.20----52.70----
References97.9566.51--184.496.7563.52--7.5
Manual edits93.4472.8981.670.14183.793.8865.2535.820.427.7
PWWS28.07101.9174.560.16179.017.97160.1131.810.366.8
CFGAN-----34.46155.8468.940.237.0
PolyJuice36.6968.5956.410.4594.641.8062.6239.010.4011.6
MiCE (bin. search)72.1376.7273.760.20171.376.1763.9442.180.357.9
MiCE (30% mask)76.8079.3549.640.39161.377.2659.7134.080.408.3
MiCE (50% mask)83.2089.9220.710.65115.784.4868.3224.270.527.6
CREST (30% mask)75.8267.2957.580.33180.975.4562.0041.360.297.4
CREST (50% mask)93.2450.6923.080.66193.981.2362.6030.530.417.3
+ +Table 1: Intrinsic evaluation of counterfactuals generated by various methods. Validity is computed as the accuracy of an off-the-shelf RoBERTa-base classifier in relation to the gold counterfactual label (not available for PWWS and PolyJuice); fluency is determined by the perplexity score given by GPT-2 large; diversity is computed with self-BLEU; and closeness is reported by the (normalized) edit distance to the factual input. In addition, we report the average number of tokens in the input. + +spans for masked positions. During training, we fine-tune the editor to infill original spans of text by prepending gold target labels $y_{f}$ to original inputs. In order to generate counterfactual edits at test time, we pretend a counterfactual label $y_{c}$ instead, and sample counterfactuals using beam search. + +Overall, our procedure differs from that of MiCE in the mask stage: instead of extracting a mask via gradient-based attributions and subsequent binary search, we leverage SPECTRA to find an optimal mask. Interestingly, by doing so, we not only avoid the computationally expensive binary search procedure, but we also open up new opportunities: as our masking process is differentiable, we can optimize our masker to enhance the quality of both the counterfactuals (§4.2) and the selected rationales (§6.3). We will demonstrate the latter with our proposed CREST-Rationalization setup (§5). All implementation details for the masker and the editor can be found in §B. + +# 4 Evaluating CREST Counterfactuals + +This section presents an extensive comparison of counterfactuals generated by different methods. + +# 4.1 Experimental Setting + +Data and evaluation. We experiment with our counterfactual generation framework on two different tasks: sentiment classification using IMDB (Maas et al., 2011) and natural language inference (NLI) using SNLI (Bowman et al., 2015). In sentiment classification, we only have a single input to consider, while NLI inputs consist of a + +premise and a hypothesis, which we concatenate to form a single input. To assess the quality of our automatic counterfactuals, we compare them to manually crafted counterfactuals in the revised IMDB and SNLI datasets created by Kaushik et al. (2020). More dataset details can be found in $\S A$ . + +Training. We employ a SPECTRA rationalizer with a T5-small architecture as the masker, and train it for 10 epochs on the full IMDB and SNLI datasets. We also use a T5-small architecture for the editor, and train it for 20 epochs with early stopping, following the same training recipe as MiCE. Full training details can be found in §B.3. + +Generation. As illustrated in Figure 1, at test time we generate counterfactuals by preponding a contrastive label to the input and passing it to the editor. For sentiment classification, this means switching between positive and negative labels. For NLI, in alignment with Dixit et al. (2022), we adopt a refined approach by restricting the generation of counterfactuals to entailments and contradictions only, therefore ignoring neutral examples, which have a subtle semantic meaning. In contrast, our predictors were trained using neutral examples, and in cases where they predict the neutral class, we default to the second-most probable class. + +Baselines. We compare our approach with four open-source baselines that generate counterfactuals: PWWS (Ren et al., 2019), PolyJuice (Wu et al., 2021), CounterfactualGAN (Robeer et al., 2021),2 + +![](images/f070887bfd77cf667cab42d3dbe15ec8718ddd352171a7cc30977a9d42f05160.jpg) +Figure 3: Sparsity analysis of CREST-Generation on IMDB with different budget percentages. The original curves show the performance of CREST without any changes, while the augmented and finetuned curves show the performance of CREST when using manually crafted counterfactuals for data augmentation or finetuning, respectively. + +![](images/93343a7ecf84f5341029ac4179999486fa6d843212c9d2544bee780903569996.jpg) + +![](images/fdcc51b2bf1aeffe31106036b577b6e97861361f4659951ea94af1df0de340cb.jpg) + +and MiCE (Ross et al., 2021). In particular, to ensure a fair comparison with MiCE, we apply three modifications to the original formulation: (i) we replace its RoBERTa classifier with a T5-based classifier (as used in SPECTRA); (ii) we disable its validity filtering; (iii) we report results with and without the binary search procedure by fixing the percentage of masked tokens. + +Metrics. To determine the general validity of counterfactuals, we report the accuracy of an off-the-shelf RoBERTa-base classifier available in the HuggingFace Hub. Moreover, we measure fluency using perplexity scores from GPT-2 large (Radford et al., 2019) and diversity with self-BLEU (Zhu et al., 2018). Finally, we quantify the notion of closeness by computing the normalized edit distance to the factual input and the average number of tokens in the document. + +# 4.2 Results + +Results are presented in Table 1. As expected, manually crafted counterfactuals achieve high validity, significantly surpassing the chance baseline and establishing a reliable reference point. For IMDB, we find that CREST outperforms other methods by a wide margin in terms of validity and fluency. At the same time, CREST's validity is comparable to the manually crafted counterfactuals, while surprisingly deemed more fluent by GPT-2. Moreover, we note that our modification of disabling MiCE's minimality search leads to counterfactuals that are more valid and diverse but less fluent and less close to the original inputs. + +For SNLI, this modification allows MiCE to achieve the best overall scores, closely followed + +by CREST. However, when controlling for closeness, we observe that CREST outperforms MiCE: at closeness of $\sim 0.30$ , CREST (30% mask) outperforms MiCE with binary search in terms of fluency and diversity. Similarly, at a closeness of $\sim 0.40$ , CREST (50% mask) surpasses MiCE (30% mask) across the board. As detailed in §C, CREST's counterfactuals are more valid than MiCE's for all closeness bins lower than 38%. We provide examples of counterfactuals produced by CREST and MiCE in Appendix G. Finally, we note that CREST is highly affected by the masking budget, which we explore further next. + +Sparsity analysis. We investigate how the number of edits affects counterfactual quality by training maskers with increasing budget constraints (as described in §2.1). The results in Figure 3 show that with increasing masking percentage, generated counterfactuals become less textually similar to original inputs (i.e., less close) but more valid and fluent. This inverse relationship demonstrates that strict minimality, optimized for in methods like MiCE, comes with tradeoffs in counterfactual quality, and that the sparsity budget in CREST can be used to modulate the trade-off between validity and closeness. In Figure 3 we also examine the benefit of manually crafted counterfactuals in two ways: (i) using these examples as additional training data; and (ii) upon having a trained editor, further finetuning it with these manual counterfactuals. The results suggest that at lower budget percentages, exploiting a few manually crafted counterfactuals to fine-tune CREST can improve the validity of counterfactuals without harming fluency. + +Validity filtering. As previously demonstrated by Wu et al. (2021) and Ross et al. (2022), it is possible to filter out potentially disfluent or invalid counterfactuals by passing all examples to + +![](images/a8ba316851253792e2783b69304a12702c49d99b70673e665a3f3c2816dc75a9.jpg) +Figure 4: Human study results for counterfactuals produced manually and automatically (CREST and MiCE). + +a classifier and discarding the subset with incorrect predictions. In our case, we use the predictor associated with the masker as the classifier. We found that applying this filtering increases the validity of IMDB counterfactuals from 75.82 to 86.36 with $B = 0.3$ , and from 93.24 to 97.36 with $B = 0.5$ . For SNLI, validity jumps from 75.45 to 96.39 with $B = 0.3$ , and from 81.23 to 96.67 with $B = 0.5$ . These results indicate that CREST can rely on its predictor to filter out invalid counterfactuals, a useful characteristic for doing data augmentation, as we will see in §6.2. + +# 4.3 Human Study + +We conduct a small-scale human study to evaluate the quality of counterfactuals produced by MiCE and CREST with $50\%$ masking percentage. Annotators were tasked with rating counterfactuals' validity and naturalness (e.g., based on style, tone, and grammar), each using a 5-point Likert scale. Two fluent English annotators rated 50 examples from the IMDB dataset, and two others rated 50 examples from SNLI. We also evaluate manually created counterfactuals to establish a reliable baseline. More annotation details can be found in $\S D$ . + +The study results, depicted in Figure 4, show that humans find manual counterfactuals to be more valid and natural compared to automatically generated ones. Furthermore, CREST's counterfactuals receive higher ratings for validity and naturalness compared to MiCE, aligning with the results obtained from automatic metrics. + +# 5 CREST-Rationalization + +Now that we have a method that generates high-quality counterfactual examples, a natural step is to use these examples for data augmentation. However, vanilla data augmentation does not take advantage of the paired structure of original/contrastive examples and instead just treats them as individual datapoints. In this section, we present CREST's + +second component, CREST-Rationalization (illustrated in Figure 2), which leverages the relationships between factual and counterfactual inputs through a SPECTRA rationalizer with an agreement regularization strategy, described next. + +# 5.1 Linking Counterfactuals and Rationales + +We propose to incorporate counterfactuals into a model's functionality by taking advantage of the fully differentiable rationalization setup. Concretely, we decompose a rationalizer into two flows, as depicted in Figure 2: a factual flow that receives factual inputs $\pmb{x}$ and outputs a factual prediction $\hat{y}$ , and a counterfactual flow that receives counterfactual inputs $\tilde{\pmb{x}}$ and should output a counterfactual prediction $\tilde{y} \neq \hat{y}$ . As a by-product of using a rationalizer, we also obtain a factual rationale $\pmb{z} \in \{0,1\}^{n}$ for $\pmb{x}$ and a counterfactual rationale $\tilde{\pmb{z}} \in \{0,1\}^{m}$ for $\tilde{\pmb{x}}$ , where $n = |\pmb{x}|$ and $m = |\tilde{\pmb{x}}|$ . + +Training. Let $\Theta = \{\phi, \gamma, \theta\}$ represent the trainable parameters of a rationalizer (defined in §2.1). We propose the following loss function: + +$$ +\begin{array}{l} \mathcal {L} (\Theta) = \mathcal {L} _ {f} \left(y _ {f}, \hat {y} (\Theta)\right) + \alpha \mathcal {L} _ {c} \left(y _ {c}, \tilde {y} (\Theta)\right) \tag {3} \\ + \lambda \Omega (z (\Theta), \tilde {z} (\Theta)), \\ \end{array} +$$ + +where $\mathcal{L}_f(\cdot)$ and $\mathcal{L}_c(\cdot)$ represent cross-entropy losses for the factual and counterfactual flows, respectively, and $\Omega (\cdot)$ is a novel penalty term to encourage factual and counterfactual rationales to focus on the same positions, as defined next. $\alpha \in \mathbb{R}$ and $\lambda \in \mathbb{R}$ are hyperparameters. + +Agreement regularization. To produce paired rationales for both the factual and counterfactual flows, we incorporate regularization terms into the training of a rationalizer to encourage the factual explainer to produce rationales similar to those originally generated by the masker $z^{\star}$ , and the counterfactual explainer to produce rationales that focus on the tokens modified by the editor $\tilde{z}^{\star}$ . We derive the ground truth counterfactual rationale $\tilde{z}^{\star}$ by aligning $x$ to $\tilde{x}$ and marking tokens that were inserted or substituted as 1, and others as 0. The regularization terms are defined as: + +$$ +\Omega (z, \tilde {z}) = \| z (\Theta) - z ^ {\star} \| _ {2} ^ {2} + \| \tilde {z} (\Theta) - \tilde {z} ^ {\star} \| _ {2} ^ {2}. \tag {4} +$$ + +To allow the counterfactual rationale $\tilde{z}$ to focus on all important positions in the input, we adjust the budget for the counterfactual flow based on the length of the synthetic example produced by the counterfactual generator. Specifically, we multiply the budget by a factor of $\frac{\|\tilde{z}^{\star}\|_0}{\|\boldsymbol{z}^{\star}\|_0}$ . + +
SetupIMDBrIMDBcIMDBRotTomSST-2AmazonYelp
F91.1 ± 0.391.4 ± 0.888.5 ± 0.976.5 ± 1.679.8 ± 1.686.0 ± 0.788.5 ± 0.7
With data augmentation:
F + CH90.9 ± 0.592.9 ± 0.990.4 ± 1.676.6 ± 1.580.7 ± 1.386.3 ± 1.089.1 ± 1.2
F + CS,V91.0 ± 0.291.2 ± 1.089.3 ± 0.876.8 ± 0.979.3 ± 0.385.2 ± 0.988.0 ± 1.0
F + CS90.8 ± 0.291.6 ± 1.389.2 ± 0.476.7 ± 1.080.6 ± 0.686.4 ± 0.689.1 ± 0.5
With agreement regularization:
F & CS,V90.7 ± 0.592.2 ± 0.788.9 ± 1.076.3 ± 1.480.2 ± 1.386.3 ± 0.788.9 ± 0.7
F & CS91.2 ± 0.592.9 ± 0.589.7 ± 1.177.3 ± 2.381.1 ± 2.486.8 ± 0.889.3 ± 0.7
+ +Table 2: Accuracy of SPECTRA trained on IMDB and evaluated on in-domain, contrast, and out-of-domain datasets. We present mean and std. values across five random seeds. Values in bold: top results; underlined: second-best. + +# 6 Exploiting Counterfactuals for Training + +In this section, we evaluate the effects of incorporating CREST-generated counterfactuals into training by comparing a vanilla data augmentation approach with our CREST-Rationalization approach. We compare how each affects model robustness (§6.2) and interpretability (§6.3). + +# 6.1 Experimental Setting + +We use the IMDB and SNLI datasets to train SPECTRA rationalizers with and without counterfactual examples, and further evaluate on in-domain, contrast and out-of-domain (OOD) datasets. For IMDB, we evaluate on the revised IMDB, contrast IMDB, RottenTomatoes, SST-2, Amazon Polarity, and Yelp. For SNLI, we evaluate on the Hard SNLI, revised SNLI, break, MultiNLI, and Adversarial NLI. Dataset details can be found in §A. To produce CREST counterfactuals, which we refer to as "synthetic", we use a $30\%$ masking budget as it provides a good balance between validity, fluency, and closeness (cf. Figure 3). We tune the counterfactual loss $(\alpha)$ and agreement regularization $(\lambda)$ weights on the dev set. We report results with $\alpha = 0.01$ and $\lambda = 0.001$ for IMDB, and $\alpha = 0.01$ and $\lambda = 0.1$ for SNLI. + +# 6.2 Robustness Results + +Tables 2 and 3 show results for counterfactual data augmentation and agreement regularization for IMDB and SNLI, respectively. We compare a standard SPECTRA trained on factual examples $(F)$ with other SPECTRA models trained on augmented data from human-crafted counterfactuals $(F + C_H)$ and synthetic counterfactuals generated by CREST $(F + C_S)$ , which we additionally post-process to drop invalid examples $(F + C_{S,V})$ . + +Discussion. As shown in Table 2, CREST-Rationalization $(F\& C_{S})$ consistently outperforms + +vanilla counterfactual augmentation $(F + C_{S})$ on all sentiment classification datasets. It achieves the top results on the full IMDB and on all OOD datasets, while also leading to strong results on contrastive datasets—competitive with manual counterfactuals $(F + C_{H})$ . When analyzing the performance of CREST-Rationalization trained on a subset of valid examples $(F \& C_{S,V})$ versus the entire dataset $(F \& C_{S})$ , the models trained on the entire dataset maintain a higher level of performance across all datasets. However, when using counterfactuals for data augmentation, this trend is less pronounced, especially for in-domain and contrastive datasets. In §E, we explore the impact of the number of augmented examples on results and find that, consistent with previous research (Huang et al., 2020; Joshi and He, 2022), augmenting the training set with a small portion of valid and diverse synthetic counterfactuals leads to more robust models, and can even outweigh the benefits of manual counterfactuals. + +Examining the results for NLI in Table 3, we observe that both counterfactual augmentation and agreement regularization interchangeably yield top results across datasets. Remarkably, in contrast to sentiment classification, we achieve more substantial improvements with agreement regularization models when these are trained on valid counterfactuals, as opposed to the full set. + +Overall, these observations imply that CREST-Rationalization is a viable alternative to data augmentation for improving model robustness, especially for learning contrastive behavior for sentiment classification. In the next section, we explore the advantages of CREST-Rationalization for improving model interpretability. + +# 6.3 Interpretability Analysis + +In our final experiments, we assess the benefits of our proposed regularization method on model inter + +
SetupSNLISNLI-hrSNLIbreakMNLI-mMNLI-mmANLI
F86.6 ± 0.273.7 ± 0.271.1 ± 0.869.5 ± 1.564.6 ± 1.165.9 ± 0.932.6 ± 0.7
With data augmentation:
F + CH86.6 ± 0.374.9 ± 1.172.4 ± 0.370.1 ± 1.964.2 ± 0.965.8 ± 0.931.8 ± 0.4
F + CS,V86.5 ± 0.375.8 ± 1.271.8 ± 1.069.1 ± 2.064.4 ± 0.365.9 ± 0.432.2 ± 0.2
F + CS86.6 ± 0.374.7 ± 1.171.6 ± 0.871.2 ± 1.464.5 ± 0.466.4 ± 0.632.2 ± 1.0
With agreement regularization:
F & CS,V86.8 ± 0.175.3 ± 0.866.8 ± 0.768.2 ± 2.164.6 ± 0.766.1 ± 0.632.8 ± 0.6
F & CS86.6 ± 0.175.5 ± 1.367.0 ± 1.369.9 ± 1.764.2 ± 1.166.0 ± 0.732.5 ± 0.5
+ +Table 3: Accuracy of SPECTRA trained on SNLI and evaluated on in-domain, contrast, and out-of-domain datasets. We present mean and std. values across five random seeds. Values in bold: top results; underlined: second-best. + +pretability. We evaluate effects on rationale quality along three dimensions: plausibility, forward simulability, and counterfactual simulability. + +Plausibility. We use the MovieReviews (DeYoung et al., 2020) and the e-SNLI (Camburu et al., 2018) datasets to study the human-likeness of rationales by matching them with human-labeled explanations and measuring their AUC, which automatically accounts for multiple binarization levels. $^5$ + +Forward simulability. Simulability measures how often a human agrees with a given classifier when presented with explanations, and many works propose different variants to compute simulability scores in an automatic way (Doshi-Velez and Kim, 2017; Treviso and Martins, 2020; Hase et al., 2020; Pruthi et al., 2022). Here, we adopt the framework proposed by Treviso and Martins (2020), which views explanations as a message between a classifier and a linear student model, and determines simulability as the fraction of examples for which the communication is successful. In our case, we cast a SPECTRA rationalizer as the classifier, use its rationales as explanations, and train a linear student on factual examples of the IMDB and SNLI datasets. High simulability scores indicate more understandable and informative explanations. + +Counterfactual simulability. Building on the manual simulability setup proposed by Doshi-Velez and Kim (2017), we introduce a new approach to automatically evaluate explanations that interact with counterfactuals. Formally, let $C$ be a classifier that when given an input $x$ produces a prediction $\hat{y}$ and a rationale $z$ . Moreover, let $G$ be a pre-trained counterfactual editor, which receives $x$ and $z$ and produces a counterfactual $\tilde{x}$ by infilling spans on positions masked according to $z$ (e.g., via masking). + +We define counterfactual simulability as follows: + +$$ +\frac {1}{N} \sum_ {n = 1} ^ {N} \left[ \left[ C \left(\boldsymbol {x} _ {n}\right) \neq C \left(G \left(\boldsymbol {x} _ {n} \odot \boldsymbol {z} _ {n}\right)\right) \right] \right], \tag {5} +$$ + +where $\left[[\cdot]\right]$ is the Iverson bracket notation. Intuitively, counterfactual simulability measures the ability of a rationale to change the label predicted by the classifier when it receives a contrastive edit with infilled tokens by a counterfactual generator as input. Therefore, a high counterfactual simulability indicates that the rationale $z$ focuses on the highly contrastive parts of the input. + +Results. The results of our analysis are shown in Table 4. We observe that plausibility can substantially benefit from synthetic CREST-generated counterfactual examples, especially for a rationalizer trained with our agreement regularization, which outperforms other approaches by a large margin. Additionally, leveraging synthetic counterfactuals, either via data augmentation or agreement regularization, leads to a high forward simulability score, though by a smaller margin—within the standard deviation of other approaches. Finally, when looking at counterfactual simulability, we note that models that leverage CREST counterfactuals consistently lead to better rationales. In particular, agreement regularization leads to strong results on both tasks while also producing more plausible rationales, showing the efficacy of CREST-Rationalization in learning contrastive behavior. + +# 7 Related Works + +Generating counterfactuals. Existing approaches to generating counterfactuals for NLP use heuristics (Ren et al., 2019; Ribeiro et al., 2020), leverage plug-and-play approaches to controlled generation (Madaan et al., 2021), or, most relatedly, fine-tune language models to + +
SetupSentiment ClassificationNatural Language Inference
PlausibilityF. sim.C. sim.PlausibilityF. sim.C. sim.
F0.6733 ± 0.0291.70 ± 0.9281.18 ± 2.790.7735 ± 0.0059.26 ± 0.4170.01 ± 0.44
With data augmentation:
F + CH0.6718 ± 0.0491.44 ± 1.4680.53 ± 4.170.7736 ± 0.0159.51 ± 0.8669.90 ± 0.57
F + CS0.6758 ± 0.0191.68 ± 0.5984.54 ± 1.090.7779 ± 0.0059.54 ± 0.0870.76 ± 0.54
With agreement regularization:
F & CS0.6904 ± 0.0291.93 ± 0.8386.43 ± 1.560.7808 ± 0.0059.31 ± 0.2070.69 ± 0.29
+ +Table 4: Interpretability analysis of rationalizers trained with CREST-generated counterfactuals, either with data augmentation or agreement regularization. Plausibility represents matching with human rationales, whereas F. sim. and C. sim. represent forward and counterfactual simulability. **Bold:** top results; **underlined:** second-best. + +generate counterfactuals (Wu et al., 2021; Ross et al., 2021, 2022; Robeer et al., 2021). For instance, PolyJuice (Wu et al., 2021) finetunes a GPT-2 model on human-crafted counterfactuals to generate counterfactuals following pre-defined control codes, while CounterfactualGAN (Robeer et al., 2021) adopts a GAN-like setup. We show that CREST-Generation outperforms both methods in terms of counterfactual quality. Most closely related is MiCE (Ross et al., 2021), which also uses a two-stage approach based on a masker and an editor to generate counterfactuals. Unlike MiCE, we propose to relax the minimality constraint and generate masks using selective rationales rather than gradients, resulting not only in higher-quality counterfactuals, but also in a fully-differentiable set-up that allows for further optimization of the masker. Other recent work includes Tailor (Ross et al., 2022), a semantically-controlled generation system that requires a human-in-the-loop to generate counterfactuals, as well as retrieval-based and prompting approaches such as RGF (Paranjape et al., 2022) and CORE (Dixit et al., 2022). + +Training with counterfactuals. Existing approaches to training with counterfactuals predominantly leverage data augmentation. Priors works have explored how augmenting with both manual (Kaushik et al., 2020; Khashabi et al., 2020; Huang et al., 2020; Joshi and He, 2022) and automatically-generated (Wu et al., 2021; Ross et al., 2022; Dixit et al., 2022) counterfactuals affects model robustness. Unlike these works, CREST-Rationalization introduces a new strategy for training with counterfactuals that leverages the paired structure of original and counterfactual examples, improving model robustness and interpretability compared to data augmentation. Also related is the training objective proposed by Gupta + +et al. (2021) to promote consistency across pairs of examples with shared substructures for neural module networks, and the loss term proposed by Teney et al. (2020) to model the factual-counterfactual paired structured via gradient supervision. In contrast, CREST can be used to generate paired examples, can be applied to non-modular tasks, and does not require second-order derivatives. + +Rationalization. There have been many modifications to the rationalization setup to improve task accuracy and rationale quality. Some examples include conditioning the rationalization on pre-specified labels (Yu et al., 2019), using an information-bottleneck formulation to ensure informative rationales (Paranjape et al., 2020), training with human-created rationales (Lehman et al., 2019), and replacing stochastic variables with deterministic mappings (Guerreiro and Martins, 2021). We find that CREST-Rationalization, which is fully unsupervised, outperforms standard rationalizers in terms of model robustness and quality of rationales. + +# 8 Conclusions + +We proposed CREST, a joint framework for selective rationalization and counterfactual text generation that is capable of producing valid, fluent, and diverse counterfactuals, while being flexible for controlling the amount of perturbations. We have shown that counterfactuals can be successfully incorporated into a rationalizer, either via counterfactual data augmentation or agreement regularization, to improve model robustness and rationale quality. Our results demonstrate that CREST successfully bridges the gap between selective rationales and counterfactual examples, addressing the limitations of existing methods and providing a more comprehensive view of a model's predictions. + +# Limitations + +Our work shows that CREST is a suitable framework for generating high-quality counterfactuals and producing plausible rationales, and we hope that CREST motivates new research to develop more robust and interpretable models. We note, however, two main limitations in our framework. First, our counterfactuals are the result of a large language model (T5), and as such, they may carry all the limitations within these models. Therefore, caution should be exercised when making statements about the quality of counterfactuals beyond the metrics reported in this paper, especially if these statements might have societal impacts. Second, CREST relies on a rationalizer to produce highlights-based explanations, and therefore it is limited in its ability to answer interpretability questions that go beyond the tokens of the factual or counterfactual input. + +# Acknowledgments + +This work was supported by the European Research Council (ERC StG DeepSPIN 758969), by EU's Horizon Europe Research and Innovation Actions (UTTER, contract 101070631), by P2020 project MAIA (LISBOA-01-0247-FEDER045909), by the Portuguese Recovery and Resilience Plan through project C645008882-00000055 (NextGenAI, Center for Responsible AI), and by contract UIDB/50008/2020. We are grateful to Duarte Alves, Haau-Sing Lee, Taisiya Glushkova, and Henrico Brum for the participation in human evaluation experiments. + +# References + +Jasmijn Bastings, Wilker Aziz, and Ivan Titov. 2019. Interpretable neural predictions with differentiable binary variables. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 2963-2977, Florence, Italy. 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. +Oana-Maria Camburu, Tim Rocktäschel, Thomas Lukasiewicz, and Phil Blunsom. 2018. e-snli: Natural language inference with natural language explanations. In Advances in Neural Information Processing + +Systems 31, pages 9539-9549. Curran Associates, Inc. +Howard Chen, Jacqueline He, Karthik Narasimhan, and Danqi Chen. 2022. Can rationalization improve robustness? In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 3792-3805, Seattle, United States. Association for Computational Linguistics. +Jay DeYoung, Sarthak Jain, Nazneen Fatema Rajani, Eric Lehman, Caiming Xiong, Richard Socher, and Byron C. Wallace. 2020. ERASER: A benchmark to evaluate rationalized NLP models. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4443-4458, Online. Association for Computational Linguistics. +Tanay Dixit, Bhargavi Paranjape, Hannaneh Hajishirzi, and Luke Zettlemoyer. 2022. CORE: A retrieve-then-edit framework for counterfactual data generation. In *Findings of the Association for Computational Linguistics: EMNLP* 2022, pages 2964–2984, Abu Dhabi, United Arab Emirates. Association for Computational Linguistics. +Finale Doshi-Velez and Been Kim. 2017. Towards a rigorous science of interpretable machine learning. arXiv preprint arXiv:1702.08608v2. +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. +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. +Nuno M. Guerreiro and André F. T. Martins. 2021. SPECTRA: Sparse structured text rationalization. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 6534-6550, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Nitish Gupta, Sameer Singh, Matt Gardner, and Dan Roth. 2021. Paired examples as indirect supervision in latent decision models. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 5774-5785, Online and + +Punta Cana, Dominican Republic. Association for Computational Linguistics. +Suchin Gururangan, Swabha Swayamdipta, Omer Levy, Roy Schwartz, Samuel Bowman, and Noah A. Smith. 2018. Annotation artifacts in natural language inference data. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers), pages 107-112, New Orleans, Louisiana. Association for Computational Linguistics. +Peter Hase, Shiyue Zhang, Harry Xie, and Mohit Bansal. 2020. Leakage-adjusted simulatability: Can models generate non-trivial explanations of their behavior in natural language? In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 4351-4367, Online. Association for Computational Linguistics. +William Huang, Haokun Liu, and Samuel R. Bowman. 2020. Counterfactually-augmented SNLI training data does not yield better generalization than unaugmented data. In Proceedings of the First Workshop on Insights from Negative Results in NLP, pages 82-87, Online. Association for Computational Linguistics. +Sarthak Jain, Sarah Wiegreffe, Yuval Pinter, and Byron C. Wallace. 2020. Learning to faithfully rationalize by construction. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4459-4473, Online. Association for Computational Linguistics. +Nitish Joshi and He He. 2022. An investigation of the (in)effectiveness of counterfactually augmented data. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 3668-3681, Dublin, Ireland. Association for Computational Linguistics. +Divyansh Kaushik, Eduard Hovy, and Zachary Lipton. 2020. Learning the difference that makes a difference with counterfactually-augmented data. In International Conference on Learning Representations. +Daniel Khashabi, Tushar Khot, and Ashish Sabharwal. 2020. More bang for your buck: Natural perturbation for robust question answering. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 163-170, Online. Association for Computational Linguistics. +Eric Lehman, Jay DeYoung, Regina Barzilay, and Byron C. Wallace. 2019. Inferring which medical treatments work from reports of clinical trials. 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 3705-3717, Minneapolis, Minnesota. Association for Computational Linguistics. + +Tao Lei, Regina Barzilay, and Tommi Jaakkola. 2016. Rationalizing neural predictions. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 107-117, Austin, Texas. Association for Computational Linguistics. +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 the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies, pages 142-150, Portland, Oregon, USA. Association for Computational Linguistics. +Nishtha Madaan, Inkit Padhi, Naveen Panwar, and Diptikalyan Saha. 2021. Generate your counterfactuals: Towards controlled counterfactual generation for text. In Proceedings of the AAAI Conference on Artificial Intelligence, pages 13516-13524. +Vlad Niculae, Andre Martins, Mathieu Blondel, and Claire Cardie. 2018. Sparsemap: Differentiable sparse structured inference. In International Conference on Machine Learning, pages 3799-3808. PMLR. +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. +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 of the Association for Computational Linguistics (ACL'05), pages 115-124, Ann Arbor, Michigan. Association for Computational Linguistics. +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. +Bhargavi Paranjape, Matthew Lamm, and Ian Tenney. 2022. Retrieval-guided counterfactual generation for QA. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1670-1686, Dublin, Ireland. Association for Computational Linguistics. +Danish Pruthi, Rachit Bansal, Bhuwan Dhingra, Livio Baldini Soares, Michael Collins, Zachary C. + +Lipton, Graham Neubig, and William W. Cohen. 2022. Evaluating explanations: How much do explanations from the teacher aid students? Transactions of the Association for Computational Linguistics, 10:359-375. +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. +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. +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. +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. +Marcel Robeer, Floris Bex, and Ad Feelders. 2021. Generating realistic natural language counterfactuals. In *Findings of the Association for Computational Linguistics: EMNLP* 2021, pages 3611-3625, Punta Cana, Dominican Republic. Association for Computational Linguistics. +Alexis Ross, Ana Marasović, and Matthew Peters. 2021. Explaining NLP models via minimal contrastive editing (MiCE). In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, pages 3840-3852, Online. Association for Computational Linguistics. +Alexis Ross, Tongshuang Wu, Hao Peng, Matthew Peters, and Matt Gardner. 2022. Tailor: Generating and perturbing text with semantic controls. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 3194-3213, Dublin, Ireland. 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. + +Damien Teney, Ehsan Abbasnedjad, and Anton van den Hengel. 2020. Learning what makes a difference from counterfactual examples and gradient supervision. In Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part X 16, pages 580-599. Springer. +Marcos Treviso and André F. T. Martins. 2020. The explanation game: Towards prediction explainability through sparse communication. In Proceedings of the Third Blackbox NLP Workshop on Analyzing and Interpreting Neural Networks for NLP, pages 107-118, Online. Association for Computational Linguistics. +Sahil Verma, John Dickerson, and Keegan Hines. 2020. Counterfactual explanations for machine learning: A review. arXiv preprint arXiv:2010.10596v3. +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. +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. +Tongshuang Wu, Marco Tulio Ribeiro, Jeffrey Heer, and Daniel Weld. 2021. Polyjuice: Generating counterfactuals for explaining, evaluating, and improving 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 6707-6723, Online. Association for Computational Linguistics. +Mo Yu, Shiyu Chang, Yang Zhang, and Tommi Jaakkola. 2019. Rethinking cooperative rationalization: Introspective extraction and complement control. 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 4094-4103, Hong Kong, China. Association for Computational Linguistics. +Xiang Zhang, Junbo Zhao, and Yann LeCun. 2015. Character-level convolutional networks for text classification. Advances in neural information processing systems, 28. + +Yaoming Zhu, Sidi Lu, Lei Zheng, Jiaxian Guo, Weinan Zhang, Jun Wang, and Yong Yu. 2018. Texygen: A benchmarking platform for text generation models. In The 41st International ACM SIGIR Conference on Research & Development in Information Retrieval, SIGIR '18, page 1097-1100, New York, NY, USA. Association for Computing Machinery. + +# A Datasets + +The revised IMDB and SNLI datasets, which we refer to as rIMDB and rSNLI respectively, were created by Kaushik et al. (2020). They contain counterfactuals consisting of revised versions made by humans on the Amazon's Mechanical Turk crowdsourcing platform. For both datasets, the authors ensure that (a) the counterfactuals are valid; (b) the edited reviews are coherent; and (c) the counterfactuals do not contain unnecessary modifications. For SNLI, counterfactuals were created either by revising the premise or the hypothesis. We refer to (Kaushik et al., 2020) for more details on the data generation process. Table 5 presents statistics for the datasets used for training models in this work. + +
DatasetTrainVal.Test
docstpsdocstpsdocstps
IMDB22.5K6M2.5K679K25K6M
rIMDB3414629K49092K976180K
SNLI549K12M10K232K10K231K
rSNLI4165188K50024K100048K
+ +Table 5: Datasets statistics. + +Additionally, we incorporate various contrastive and out-of-domain datasets to evaluate our models. For IMDB, we use the contrast IMDB (Gardner et al., 2020), RottenTomatoes (Pang and Lee, 2005), SST-2 (Socher et al., 2013), Amazon Polarity and Yelp (Zhang et al., 2015). For SNLI, we evaluate on the Hard SNLI (Gururangan et al., 2018), break (Glockner et al., 2018), MultiNLI (Williams et al., 2018), and Adversarial NLI (Nie et al., 2020). We refer to the original works for more details. + +# B CREST Details + +# B.1 Masker + +For all datasets, the masker consists of a SPEC-TRA rationalizer that uses a T5-small encoder as the backbone for the encoder and predictor (see §2.1). Our implementation is derived directly from its original source (Guerreiro and Martins, 2021). We set the maximum sequence length to 512, truncating inputs when necessary. We employ a con + +tigity penalty of $10^{-4}$ for IMDB and $10^{-2}$ for SNLI. We train all models for a minimum of 3 epochs and maximum of 15 epochs along with early stopping with a patience of 5 epochs. We use AdamW (Loshchilov and Hutter, 2019) with a learning rate of $10^{-4}$ and weight decay of $10^{-6}$ . + +# B.2 Editor + +For all datasets, CREST and MiCE editors consist of a full T5-small model (Raffel et al., 2020), which includes both the encoder and the decoder modules. We use the T5 implementation available in the transformers library (Wolf et al., 2020) for our editor. We train all models for a minimum of 3 epochs and maximum of 20 epochs along with early stopping with a patience of 5 epochs. We use AdamW (Loshchilov and Hutter, 2019) with a learning rate of $10^{-4}$ and weight decay of $10^{-6}$ . For both CREST and MiCE, we generate counterfactuals with beam search with a beam of size 15 and disabling bigram repetitions. We post-process the output of the editor to trim spaces and repetitions of special symbols (e.g., $\langle \mathbf{\sigma} / \mathbf{s} \rangle$ ). + +# B.3 SPECTRA rationalizers + +All of our SPECTRA rationalizers share the same setup and training hyperparameters as the one used by the masker in §4, but were trained with distinct random seeds. We tuned the counterfactual loss weight $\alpha$ within $\{1.0, 0.1, 0.01, 0.001, 0.0001\}$ , and $\lambda$ within $\{1.0, 0.1, 0.01, 0.001\}$ for models trained with agreement rationalization. More specifically, we performed hyperparameter tuning on the validation set, with the goal of maximizing in-domain accuracy. As a result, we obtained $\alpha = 0.01$ and $\lambda = 0.001$ for IMDB, and $\alpha = 0.01$ and $\lambda = 0.1$ for SNLI. + +# C Validity vs. Closeness + +To better assess the performance of CREST and MiCE by varying closeness, we plot in Figure 5 binned-validity scores of CREST and MiCE with $30\%$ masking on the revised SNLI dataset. Although CREST is deemed less valid than MiCE overall (cf. Table 1), we note that CREST generates more valid counterfactuals in lower minimality ranges. This provides further evidence that CREST remains superior to MiCE on closeness intervals of particular interest for generating counterfactuals in an automatic way. + +![](images/c31060e90bd1b4613851a3765998fd5503d8caffbc651e91a494bf1768b2eaf3.jpg) +Figure 5: Validity by binned closeness ranges for MiCE (30% masking) and CREST (30% masking). At lower closeness ranges, CREST produces more valid counterfactuals than does MiCE. + +# D Human Annotation + +The annotation task was conducted by four distinct individuals, all of whom are English-fluent PhD students. Two annotators were employed for IMDB and two for SNLI. The annotators were not given any information regarding the methods used to create each counterfactual, and the documents were presented in a random order to maintain source anonymity. The annotators were presented with the reference text and its corresponding gold label. Subsequently, for each method, they were asked to assess both the validity and the naturalness of the resulting counterfactuals using a 5-point Likert scale. We provided a guide page to calibrate the annotators' understanding of validity and naturalness prior the annotation process. We presented hypothetical examples with different levels of validity and naturalness and provided the following instructions regarding both aspects: + +- "If every phrase in the text unequivocally suggests a counterfactual label, the example is deemed fully valid and should receive a top score of 5/5." +- "If the counterfactual text aligns with the style, tone, and grammar of real-world examples, it's considered highly natural and deserves a score of 5/5." + +We measure inter-annotator agreement with a normalized and inverted Mean Absolute Difference (MAD), which computes a "soft" accuracy by averaging absolute difference ratings and normalizing them to a 0-1 range. We present the annotation results in Table 6. Our results show that humans agreed more on manual examples than on automatic approaches. On the other hand, for SNLI, + +
MethodIMDBSNLI
vnrovnro
Manual4.604.360.834.894.900.95
MiCE2.762.290.714.354.710.94
CREST4.063.440.764.894.890.96
Overall3.813.360.774.714.830.95
+ +Table 6: Annotation statistics. $v$ and $n$ represent the averaged validity and naturalness scores,whereas ${r}_{o}$ is the relative observed agreement computed with a normalized and inverted MAD. + +
SetupData sizeRotTomSST-2AmazonYelp
F100%76.5 ± 1.679.8 ± 1.686.0 ± 0.788.5 ± 0.7
With data augmentation:
F + CH+8%76.6 ± 1.580.7 ± 1.386.3 ± 1.089.1 ± 1.2
F + CS,V+1%77.2 ± 1.180.5 ± 0.586.1 ± 0.288.8 ± 0.3
F + CS,V+2%76.2 ± 1.280.8 ± 0.886.7 ± 0.589.6 ± 0.5
F + CS,V+4%77.7 ± 0.880.8 ± 0.787.0 ± 0.689.8 ± 0.6
F + CS,V+8%76.6 ± 2.280.2 ± 1.786.1 ± 0.988.2 ± 1.0
F + CS,V+85%76.8 ± 0.979.3 ± 0.385.2 ± 0.988.0 ± 1.0
F + CS+100%76.7 ± 1.080.6 ± 0.686.4 ± 0.689.1 ± 0.5
With agreement regularization:
F & CS,V85%76.3 ± 1.480.2 ± 1.386.3 ± 0.788.9 ± 0.7
F & CS100%77.3 ± 2.381.1 ± 2.486.8 ± 0.889.3 ± 0.7
+ +Table 7: OOD accuracy of SPECTRA rationalizers with different portions of augmented counterfactuals. Bold: top results; underlined: second-best. + +annotators assigned similar scores across all methods. In terms of overall metrics, including validity, naturalness, and agreement, the scores were lower for IMDB than for SNLI, highlighting the difficulty associated with the generation of counterfactuals for long movie reviews. + +Annotation interface. Figure 6 shows a snapshot of the interface used for the annotation, which is publicly available at https://www.github.com/mtreviso/TextRankerJS. + +# E Counterfactual Data Augmentation Analysis + +Previous studies on counterfactual data augmentation have found that model performance highly depends on the number and diversity of augmented samples (Huang et al., 2020; Joshi and He, 2022). To account for this, we investigate the effect of adding increasingly larger portions of CREST counterfactuals for data augmentation on the IMDB dataset. Our findings are summarized in Table 7. + +Discussion. We find that incorporating human-crafted counterfactuals $(F + C_H)$ improves SPEC-TRA performance on all OOD datasets. On top + +![](images/31f2d4b61edc42783cb6daa28c508161cde6d5179addd6fb8cab878e93efe3e1.jpg) + +A solid, if unremarkable film. Matthau, as Einstein, was wonderful. My favorite part, and the only thing that would make me go out of my way to see this again, was the wonderful scene with the physicists playing badmitton, I loved the sweaters and the conversation while they waited for Robbins to retrieve the birdie. + +A boring and unremarkable film. Matthau, as Einstein, was not believable. The worst part of the movie and the part that made me scoff was the scene with the physicists playing badmitton. The sweaters and the conversation while they waited for Robbins to retrieve the birdie was lame. + +![](images/bcfc4205679c1599b5db0b14735c4fbded252870a4824a66e5e16a30472a6d17.jpg) + +This is an unremarkable, if unremarkable .hau, as steinstein, is the worst part of the movie, and the only thing that would make me go out of my way to see this again is the physicists /mitt ists and the wait wait till they waited for binbins to re-release. + +![](images/31876162abf687c90d9f515c3367c0954c695dce17c05a4273d50dbb159f1be4.jpg) + +This is a very unremarkable and unwatchable film. The acting is unhau, the plot, and the acting. My favorite thing about this film, and the only thing that made me go out of my mind, was the ending with the physic nerves of Symitton, I watched the zombies and thought they waited for Robbins to retrieve the junkie. + +![](images/818df03d4e3fce5899723a6f276462b6dfb3c8de03e22ab23fab0494680ab606.jpg) +Figure 6: Snapshot of the annotation interface. + +of that, we note that using a small proportion (4% of the full IMDB) of valid CREST counterfactuals $(F + C_{S,V})$ through data augmentation also leads to improvements on all datasets and outweighs the benefits of manual counterfactuals. This finding confirms that, as found by PolyJuice (Wu et al., 2021), synthetic counterfactuals can improve model robustness. Conversely, as the number of augmented counterfactuals increases (85%), the performance on OOD datasets starts to decrease, which is also consistent with the findings of Huang et al. (2020). When augmenting the entire training set we obtain an increase of accuracy, suggesting that the counterfactual loss weight $(\alpha)$ was properly adjusted on the validation set. Finally, we observe that while applying CREST-Rationalization only on valid examples $(F \& C_{S,V})$ degrades performance, applying CREST-Rationalization on all paired examples $(F \& C_S)$ maintains a high accuracy on OOD datasets and concurrently leads to strong results on in-domain and contrast datasets (see Table 2). + +# F Computing infrastructure + +Our infrastructure consists of four machines with the specifications shown in Table 8. The machines were used interchangeably and all experiments were carried in a single GPU. + +
GPUCPU
4 × Titan Xp - 12GB16 × AMD Ryzen - 128GB
4 × GTX 1080Ti - 12GB8 × Intel i7 - 128GB
3 × RTX 2080Ti - 12GB12 × AMD Ryzen - 128GB
3 × RTX 2080Ti - 12GB12 × AMD Ryzen - 128GB
+ +Table 8: Computing infrastructure. + +# G Examples of Counterfactuals + +Table 9 shows examples of counterfactuals produced by MiCE and CREST with $30\%$ masking. + +
Sentiment Classification:
Input: If you haven't seen this, it's terrible. It is pure trash. I saw this about 17 years ago, and I'm still screwed up from it.
MiCE: If you haven't seen this, it's a great movie. I saw this about 17 years ago, and I'm still screwed up from it.
CREST: If you haven't seen this movie, it's worth seeing. It's very funny. I saw it about 17 years ago, and I'm still screwed up from it.
Input: Touching; Well directed autobiography of a talented young director/producer. A love story with Rabin's assassination in the background. Worth seeing!
MiCE: Watching abiography of a very young writer/producer. A great story of Rabin's assassination in the background! Worth seeing!!
CREST: This is the worst film of a talented young director/producer. And Rabin's assassination in the background is even worse!
Input: A solid, if unremarkable film. Matthau, as Einstein, was wonderful. My favorite part, and the only thing that would make me go out of my way to see this again, was the wonderful scene with the physicists playing badmitton, I loved the sweaters and the conversation while they waited for Robbins to retrieve the birdie.
MiCE: This is an unremarkable, if unremarkable -hau, as steinstein, is the worst part of the movie, and the only thing that would make me go out of my way to see this again is the physicists /mitt ists and the wait wait till they waited for binbins to re-release.
CREST: This is a very unremarkable and unwatchable film. The acting is unhau, the plot, and the acting. My favorite thing about this film, and the only thing that made me go out of my mind, was the ending with the physic nerves of Symitton, I watched the zombies and thought they waited for Robbins to retrieve the junkie.
Input: I saw this film earlier today, and I was amazed at how accurate the dialog is for the main characters. It didn't feel like a film - it felt more like a documentary (the part I liked best). The leading ladies in this film seemed as real to me as any fifteen year-old girls I know. All in all, a very enjoyable film for those who enjoy independent films.
MiCE: I saw this film earlier today, and I was amazed at how bad the film is for the sake of a film - it feels more like thanthe part I played in this film. To me - fifteen year-old s I don't know. All in all this is a bad film for those who like independent films :
CREST: I saw this movie earlier today, and I was surprised at how bad it is for the first time. It's not a good movie - it's just a bad movie (the only thing I can say about it). The acting is awful to me as any fifteen year-old as I can. All in all, the movie is a waste of time for me.
Natural Language Inference:
Prem: A large group of people walking in a busy city at night.
Hyp: People are outside in a park.
MiCE: People are walking in a city at night
CREST: People walking in a city.
Prem: Players from two opposing teams wearing colorful cleats struggle to gain control over a ball on an AstroTurf field.
Hyp: The players are playing a sport.
MiCE: The players are playing chess at home
CREST: The players are sitting on a couch.
Prem: A woman is in the middle of hitting a tennis ball.
Hyp: A woman is playing tennis.
MiCE: A woman is playing basketball at home
CREST: A woman is playing basketball.
Prem: Two boys with blond-hair, wearing striped shirts on a bed.
Hyp: Children playing in the park.
MiCE: Children are on the bed.
CREST: Boys are on the bed.
Prem: Bubbles surround a statue in the middle of a street.
Hyp: There are bubbles around the statue.
MiCE: There are bubbles surround the statue.
CREST: Bubbles are in the ocean.
Prem: A young girl is standing in a kitchen holding a green bib.
Hyp: A boy is playing with a firetruck.
MiCE: A child is in a fire place
CREST: A girl is holding a bib.
+ +Table 9: Examples of original inputs from the IMDB and SNLI datasets followed by synthetic counterfactuals produced by MiCE and CREST with $30\%$ masking. + +A For every submission: + +A1. Did you describe the limitations of your work? + +Final section (9) + +A2. Did you discuss any potential risks of your work? + +Final section (9) + +A3. Do the abstract and introduction summarize the paper's main claims? + +Left blank. + +A4. Have you used AI writing assistants when working on this paper? + +ChatGPT, mostly to rephrase some sentences by following the prompt "rewrite this sentence in a better, more fluent, way (keep tone)". + +B Did you use or create scientific artifacts? + +Section 1 (footnote). + +B1. Did you cite the creators of artifacts you used? + +Section 4.1 for datasets, and Appendix B for the model architecture / implementation. + +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? + +Left blank. + +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +Not applicable. Left blank. + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? + +Not applicable. Left blank. + +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? + +Not applicable. Left blank. + +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. + +Appendix A. + +C Did you run computational experiments? + +Sections 4 and 6, and Appendix C. + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +The computing infrastructure is in Appendix D. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +Sections 4 and 6, and Appendix B. + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +Sections 4 and 6, and Appendix C. + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +For some metrics, yes (simulability in section 6). + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Section 4.3 and Appendix D + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +Appendix D + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +Considering the simplicity of the study, we found this to be unnecessary. + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +Considering the simplicity of the study, we found this to be unnecessary. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +Considering the simplicity of the study, we found this to be unnecessary. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +Considering the simplicity of the study, we found this to be unnecessary. \ No newline at end of file diff --git a/crestajointframeworkforrationalizationandcounterfactualtextgeneration/images.zip b/crestajointframeworkforrationalizationandcounterfactualtextgeneration/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..b45c9f7f2eb07fc09767a5aeaa7defb03e9b7968 --- /dev/null +++ b/crestajointframeworkforrationalizationandcounterfactualtextgeneration/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f00254952f0dbe7f02ffe40adb17fb6ca7f521722acde0b49a5a267701bf62c5 +size 939684 diff --git a/crestajointframeworkforrationalizationandcounterfactualtextgeneration/layout.json b/crestajointframeworkforrationalizationandcounterfactualtextgeneration/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..1b59c83e2e681760b062cc43b425781216465c32 --- /dev/null +++ b/crestajointframeworkforrationalizationandcounterfactualtextgeneration/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c1f7f847e72064cf313a35fcedd1ae9454428954b7b3f51f7e637c459f6649a6 +size 582756 diff --git a/cstancealargedatasetforchinesezeroshotstancedetection/79b327cf-4164-45c1-a65e-44834681c3a2_content_list.json b/cstancealargedatasetforchinesezeroshotstancedetection/79b327cf-4164-45c1-a65e-44834681c3a2_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..b2e37e1c9fe76c246dd4f7474981e7c70b6cab89 --- /dev/null +++ b/cstancealargedatasetforchinesezeroshotstancedetection/79b327cf-4164-45c1-a65e-44834681c3a2_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a619a7fbbdd9be0c336adbed891a850b9803ed5f2854f631c667e105c4092b19 +size 122223 diff --git a/cstancealargedatasetforchinesezeroshotstancedetection/79b327cf-4164-45c1-a65e-44834681c3a2_model.json b/cstancealargedatasetforchinesezeroshotstancedetection/79b327cf-4164-45c1-a65e-44834681c3a2_model.json new file mode 100644 index 0000000000000000000000000000000000000000..af0b847b486f413434770484d2c5635226e19c30 --- /dev/null +++ b/cstancealargedatasetforchinesezeroshotstancedetection/79b327cf-4164-45c1-a65e-44834681c3a2_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:66f951b7ab1cfa1c60b25e3849e044cbde0a0ff166a81fe6963a8fc33ee00ae2 +size 140639 diff --git a/cstancealargedatasetforchinesezeroshotstancedetection/79b327cf-4164-45c1-a65e-44834681c3a2_origin.pdf b/cstancealargedatasetforchinesezeroshotstancedetection/79b327cf-4164-45c1-a65e-44834681c3a2_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..62b0371c48b8af83dc872831702ae0c3fa2b3aab --- /dev/null +++ b/cstancealargedatasetforchinesezeroshotstancedetection/79b327cf-4164-45c1-a65e-44834681c3a2_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e7a64c8d956c8f9833a4ed0881a11cbd779b44deb8de4c01da1bbd64e6bcca12 +size 773722 diff --git a/cstancealargedatasetforchinesezeroshotstancedetection/full.md b/cstancealargedatasetforchinesezeroshotstancedetection/full.md new file mode 100644 index 0000000000000000000000000000000000000000..c76631a9a6cf59564a913fd637a2382636454a5a --- /dev/null +++ b/cstancealargedatasetforchinesezeroshotstancedetection/full.md @@ -0,0 +1,415 @@ +# C-STANCE: A Large Dataset for Chinese Zero-Shot Stance Detection + +Chenye Zhao\* Yingjie Li\* Cornelia Caragea\* + +\* University of Illinois at Chicago + +$\diamond$ Westlake University + +{czhao43, cornelia}@uic.edu + +liyingjie@westlake.edu.cn + +# Abstract + +Zero-shot stance detection (ZSSD) aims to determine whether the author of a text is in favor of, against, or neutral toward a target that is unseen during training. Despite the growing attention on ZSSD, most recent advances in this task are limited to English and do not pay much attention to other languages such as Chinese. To support ZSSD research, in this paper, we present C-STANCE that, to our knowledge, is the first Chinese dataset for zero-shot stance detection. We introduce two challenging subtasks for ZSSD: target-based ZSSD and domain-based ZSSD. Our dataset includes both noun-phrase targets and claim targets, covering a wide range of domains. We provide a detailed description and analysis of our dataset. To establish results on C-STANCE, we report performance scores using state-of-the-art deep learning models. We publicly release our dataset and code to facilitate future research. + +# 1 Introduction + +Stance detection aims to automatically predict whether the author of a text is in favor of, against, or neutral toward a specific target (Mohammad et al., 2016b; Küçük and Can, 2020; ALDayel and Magdy, 2021), e.g., epidemic prevention, gasoline price, or equal rights. The stance can provide useful information for important events such as policymaking and presidential elections. + +Early works focus on two types of stance detection tasks: in-target stance detection, where classifiers are trained and tested on data from the same set of targets (Hasan and Ng, 2014; Mohammad et al., 2016b; Graells-Garrido et al., 2020) and cross-target stance detection, where classifiers are trained on source targets that are related to destination targets (Augenstein et al., 2016; Wei and Mao, 2019), but destination targets are unseen during training. However, it is impractical to include + +all possible or related targets in the training set. More recently, zero-shot stance detection (ZSSD) has been identified as a promising direction (Allaway and McKeown, 2020) to evaluate classifiers on a large number of unseen (and unrelated) targets. ZSSD is more similar to the situations in practice and has received a lot of attention (Liu et al., 2021; Luo et al., 2022; Liang et al., 2022b). + +Despite the growing interest in stance detection, the task has several limitations. First, most recent advances in stance detection are limited to English (Mohammad et al., 2016b; Allaway and McKeown, 2020; Conforti et al., 2020b; Li et al., 2021a; Glandt et al., 2021), and pay little attention to other languages such as Chinese (Xu et al., 2016) although large amounts of online data with expressions of stance are available in other languages. Second, the current ZSSD task (Allaway and McKeown, 2020) aims to detect the stance of unseen targets. However, these unseen targets come from the same domain of training targets with similar meanings, which makes the task less challenging. Third, current stance detection datasets include targets either as noun phrases (Mohammad et al., 2016b; Glandt et al., 2021) or as claims (Ferreira and Vlachos, 2016; Derczynski et al., 2017). However, in practice, stance is usually expressed toward both noun phrases and claims. Models trained only on nounphrase targets do not necessarily work well for claim targets and vice versa. Little attention is paid toward incorporating targets of both types. + +In an effort to minimize these drawbacks, we present C-STANCE, the first Chinese zero-shot stance detection dataset. Our dataset is collected from Sina Weibo, one of the most popular Chinese social media sites (akin to Twitter). We consider two practical scenarios for zero-shot stance detection, i.e., target-based and domain-based ZSSD. Subtask A: target-based zero-shot stance detection. Subtask A is similar to the previous ZSSD task, where stance detection classifiers are evalu + +
Microblog请赶紧打疫苗,勤洗手把口罩戴起来。随着新冠病例的剧增,医疗资源不足必然引起医患矛盾的爆发,也请大家能互相体谅。Please get vaccinated quickly, wash hands frequently and put on your mask. With the sharp increase in Covid-19 cases, the shortage of medical resources will inevitably lead to the outbreak of conflicts between doctors and patients. Please understand each other.
Noun-phrase target/Stance1. 新冠疫苗 Covid-19 vaccine / Favor2. 医患矛盾 Conflict between doctors and patients / Against
Claim target/ Stance1. 还是要去打疫苗,做好自我防护,尽量别阳,不去挤占医疗资源。We should still get vaccinated and do self-protection, try not get pandemic and not to take medical resources. / Favor2. 那些戴好口罩,勤消毒的人都阳了,所以说防护没啥用的。Those who wear masks and disinfect frequently still get pandemic, so it is useless to defend. / Against3. 免疫力真的很重要,平时就要加强自身锻炼,增强免疫力。Immunity is really important, we need to strengthen our own exercise at ordinary times to enhance immunity / Neutral
+ +Table 1: Examples of noun-phrase targets and claim targets for a microblog in the "Covid Epidemic" domain of our C-STANCE dataset. + +ated using a large number of completely unseen targets. Subtask B: domain-based zero-shot stance detection. Subtask B is our newly proposed ZSSD task where stance detection classifiers are evaluated using a large number of unseen targets from completely new domains. Additionally, C-STANCE captures a more diverse set of targets including both noun-phrase targets and claim targets compared with existing datasets. An example from our dataset is shown in Table 1. As we can see from the table, the author of the microblog is in favor of the noun-phrase target "Covid-19 vaccine" and against "the conflict between doctors and patients". The author also opposes claim target 2, whose main idea is to deny the necessity of self-protection. + +Our contributions can be summarized as follows: 1) We present C-STANCE, the first large Chinese zero-shot stance detection dataset. Our dataset is composed of 48,126 annotated text-target pairs. C-STANCE is more than 2.5 times larger than the English ZSSD VAST dataset (Allaway and McKeown, 2020) and more than 16 times larger than the existing Chinese stance detection dataset by Xu et al. (2016). We provide detailed description and analysis of our dataset; 2) We include two challenging ZSSD subtasks: target-based zero-shot stance detection and domain-based zero-shot stance detection for C-STANCE; 3) We consider a more diverse set of targets including both noun phrases and claims in C-STANCE as well as multiple targets per input text (see Table 1); 4) We establish baseline results using both traditional models and pre-trained language models and show that C-STANCE is a challenging new benchmark. For example, our best-performing model based on RoBERTa achieves only $78.5\%$ $F1_{macro}$ for subtask A. + +# 2 Related Work + +Most previous stance detection datasets are constructed for the English language (Mohammad + +et al., 2016b; Conforti et al., 2020b; Glandt et al., 2021). Particularly, VAST is the only dataset for zero-shot stance detection. Even though recent years have witnessed an emerging trend of constructing stance detection datasets of other languages (Xu et al., 2016; Taulé et al., 2017; Swami et al., 2018; Lai et al., 2020; Vamvas and Sennrich, 2020), Chinese stance detection datasets are still very scarce. Xu et al. (2016) developed the first Chinese stance dataset. The dataset focuses on in-target stance detection and only includes 3,000 examples from 6 targets. In contrast, we propose the first large-scale Chinese dataset for zero-shot stance detection. Our C-STANCE which includes 48,126 samples with 11,623 noun-phrase targets and 28,581 claim targets enables multiple stance detection tasks and covers a wide range of domains. + +Besides classifying stance detection by target type (noun phrases or claims), we can also categorize the task as in-target, cross-target, and zero-shot stance detection. Most previous works focused on in-target stance detection where a classifier is trained and evaluated on the same target (Zarrella and Marsh, 2016; Wei et al., 2016; Vijayaraghavan et al., 2016; Mohammad et al., 2016b; Du et al., 2017; Sun et al., 2018; Wei et al., 2018; Li and Caragea, 2019, 2021b). However, it is usually hard to obtain sufficient annotated data for each target and conventional models perform poorly when generalized to data of unseen targets. This motivated the research on cross-target stance detection (Augenstein et al., 2016; Xu et al., 2018; Wei and Mao, 2019; Zhang et al., 2020; Li et al., 2021b), where a classifier is adapted from different but related targets. However, cross-target stance detection still requires prior human knowledge of the destination target and how it is related to the training targets. Thus models developed for cross-target stance detection are still limited in their capability to generalize to a wide range of unseen targets. Zero-shot + +
AuthorsSource# Target(s)Target TypeLanguageSize
Ferreira and Vlachos (2016)News articles300ClaimEnglish2,595
Derczynski et al. (2017)Twitter305ClaimEnglish5,568
Gorrell et al. (2019)Twitter, Reddit8,574ClaimEnglish8,574
Vamvas and Sennrich (2020)Political Comments194ClaimEnglish, French, Germany, Italian67,000
Xu et al. (2016)Weibo7Noun-phraseChinese5,000
Mohammad et al. (2016b)Twitter6Noun-phraseEnglish4,870
Swami et al. (2018)Twitter1Noun-phraseEnglish, Hindi3,545
Conforti et al. (2020b)Twitter5Noun-phraseEnglish51,284
Allaway and McKeown (2020)News Comments5,634Noun-phraseEenglish18,545
Glandt et al. (2021)Twitter4Noun-phraseEnglish6,133
Li et al. (2021a)Twitter3Noun-phraseEnglish21,574
Lai et al. (2020)Twitter6Noun-phraseEnglish, Spanish, Cata-lonia, French, Italian14,440
C-STANCE (ours)Weibo40,204Noun-phrase, ClaimChinese48,126
+ +Table 2: Comparison of stance detection datasets. + +stance detection (ZSSD) which aims to identify the stance toward a large number of unseen targets has attracted considerable attention in recent years. Allaway and McKeown (2020) developed a dataset for ZSSD which is called VAried Stance Topics (VAST) that includes thousands of targets. Based on VAST, many ZSSD models have been developed (Liu et al., 2021; Liang et al., 2022a,b; Luo et al., 2022; Li et al., 2023). In contrast to VAST, we include two types of ZSSD subtasks in C-STANCE. The first subtask is the target-based ZSSD which is similar to the VAST setting. The second subtask is the domain-based ZSSD where classifiers are evaluated on unseen targets from completely new domains, which is a more challenging task. + +Target-specific stance detection is the most common stance detection task (ALDayel and Magdy, 2021), which aims to predict the stance label toward a target, which could be a figure or controversial topic (Hasan and Ng, 2014; Mohammad et al., 2016a; Zotova et al., 2020; Conforti et al., 2020a,b). Multi-target stance detection is another type of stance detection task that aims to jointly identify the stance toward two or more targets in the same text (Sobhani et al., 2017; Darwish et al., 2017; Li and Caragea, 2021a). Unlike target-specific and multi-target stance detection where targets are usually noun phrases (phrase-based stance detection), claim-based stance detection aims to predict the stance toward a specific claim, which could be an article headline or a rumor's post (Qazvinian et al., 2011; Derczynski et al., 2015; Ferreira and Vlachos, 2016; Bar-Haim et al., 2017; Derczynski et al., 2017; Gorrell et al., 2019). However, less attention has been paid to incorporating both noun-phrase targets and claim targets into one dataset. Comparatively, our dataset + +supports data for both claim-based stance detection and phrase-based stance detection as well as captures multiple targets per input text (see examples from our dataset in Appendix A). We compare our C-STANCE dataset with previous stance detection datasets in Table 2. + +# 3 Dataset Construction + +In this section, we describe the creation and particularities of C-STANCE, a large comprehensive stance detection dataset composed of 48,126 annotated instances covering a wide range of domains. + +# 3.1 Data Collection + +We collect microblogs using the Weibo API from July 26th, 2022, to November 16th, 2022. Similar to prior works (Mohammad et al., 2016b; Glandt et al., 2021; Li et al., 2021a), our crawling is performed using query keywords. To cover a wide range of domains on Weibo, we start by using the domain names listed on the Weibo hot list page as keywords for crawling (e.g., society, education, etc.). After we get our initial set, we select the most frequent words as supplementary keywords for the next round of crawling to gradually expand our keyword set. The full list of keywords that were used is provided in Appendix B. We end up collecting 60,000 microblogs. + +# 3.2 Keywords Selection + +After data collection, we filter keywords that are most suitable for the task of stance detection. We perform the following steps for keyword filtering: 1) We manually detect and remove keywords that often contain advertising content (e.g., beauty, renting, motor show, etc.), which are not suitable for stance detection as the purpose of those microblogs + +
DomainQuery Keywords
新冠疫情CoE防疫 epidemic prevention, 封控 sealed management, 口罩 mask, 群体免疫 herd immunity, 居家办公 work-from-home, 疫苗 vaccine 新冠共存 co-existence with coronavirus, 加强针 booster
Covid Epidemic
世界事件WE世界新闻 world news, 乌克兰 Ukraine, 俄罗斯 Russia, 移民 migrant, 人口负增长 negative population growth, 战争 war, 选举 election, 大选 general election
World Events
文化教育CuE素质教育 quality education, 鸡娃 force kids to compete, 文化输出 cultural output, 传统文化 traditional culture 公立教育 public education, 流行文化 pop culture
Cultural and Education
娱乐消费EC物价 prices, 油价 gasoline price, 直播带货 livestream shopping, 短视频 short video, 保险 insurance, 消费观 consumption concept, 微商 wechat business, 苹果手机 iphone, 股市 stock market, 媒体 media
Entertainment and Consumption
体育 SportsS世界杯 World Cup, NBA, 男足 men's football, 女足 women's football, 体育 sports
权利 RightsR性别平等 gender equality, 女权 women's rights, 性少数群体 LGBTQ, 医患 doctors and patients, 平权 equal rights
环保 Environmental ProtectionEP气候变化 climate change, 垃圾分类 garbage classification, 环保意识 environmental awareness, 新能源 new energy
+ +Table 3: The domains used in our dataset and the selected query keywords for each domain. + +
DomainNoun-phrase targetsClaim targets
FavorAgainstNeutralFavorAgainstNeutral
CoE1,2471,4447831,7821,7821,782
WE6418701,6161,5901,5901,590
CuE1,1087345541,2061,2061,206
EC1,4801,3551,1752,0512,0512,051
S7664358851,0591,0591,059
R9401,0205321,2761,2761,276
EP633264556732732732
Overall6,8156,1226,1019,6969,6969,696
+ +Table 4: Label distribution for noun-phrase targets and claim targets in each domain. + +is not to discuss controversial topics but to promote the sales of particular products. 2) For stance detection, we show more interest in controversial topics and keywords where people may express different stances (favor, against, or neutral) toward targets related to these keywords. Otherwise, models would predict the stances based on keywords information instead of the contents of microblogs and the targets. Therefore, we filter out keywords that people tend to show uni-stances on, e.g., poverty, delicious food, traveling, camera, etc., and keywords where microblogs often express personal feelings (e.g., "my girlfriend", "my mood", etc). After this filtering step, we select 45 keywords that cover controversial topics. We summarize the 45 keywords into 7 domains: "Covid Epidemic" (CoE), "World Events" (WE), "Cultural and Education" (CuE), "Entertainment and Consumption" (EC), "Sports" (S), "Rights" (R), and "Environmental Protection" (EP) which can be seen in Table 3. + +# 3.3 Preprocessing + +We perform several preprocessing steps to ensure the quality of our dataset. 1) We remove microblogs with less than 50 or more than 200 words. + +From our observations, microblogs with less than 50 words usually are either too noisy or cannot cover enough information to express stances toward multiple targets. Microblogs with more than 200 words are usually technical articles that contain little stance-related discussion. 2) We remove duplicates and reposted microblogs. 3) We keep only microblogs in Chinese. We leave the multilingual dataset as our future work. 4) We manually identify a set of phrase lexicon for advertisements (e.g., check the link below, follow our WeChat public account, scan the QR code, click to join, etc.). We filter out all microblogs containing phrases in this lexicon. 5) We remove the emojis, URLs in microblogs as they may introduce noise to the dataset. After preprocessing, our corpus reduces to around 25,000 examples. We randomly sample around 215 microblogs for each of the 45 keywords, obtaining 9,696 microblogs for annotation. + +# 3.4 Data Annotation + +We gather annotations using Taojinniwo, $^{2}$ a Chinese crowd-sourcing company that provides annota + +
# Examples# TargetsAvg. Length# Unique MB
NCNCNCMB
Subtask ATrain13,25820,1606,09319,6943.725.7101.96,740
Val2,8654,4192,6654,4004.626.3104.01,473
Test2,9154,5092,8654,4874.726.5105.71,503
Subtask B(Covid Epidemic)Train12,37918,9847,51918,5854.026.0102.46,690
Val2,2493,4472,2083,4364.626.0104.81,087
Test3,4745,3461,8965,2113.725.7103.61,786
+ +Table 5: Dataset split statistics for subtask A and subtask B ("Covid Epidemic" as the zero-shot domain). N, C, MB represent noun-phrase targets, claim targets, and microblogs, respectively. + +tion services for big AI companies (e.g., Baidu, JD, etc.). To ensure the annotation quality, we employ strict requirements for annotators: 1) Annotators should reside in China; 2) Annotators should have college degrees. Moreover, we randomly select $10\%$ of each annotator's annotations for quality checks. If an annotator has an acceptance rate of less than $90\%$ , we discard their annotations completely and re-send them for labeling using other qualified annotators. We annotated data for nounphrase targets and for claim targets as detailed below. The label distribution for each domain is shown in Table 4. + +# 3.4.1 Annotation for Noun-Phrase Targets + +The annotation for noun-phrase targets is performed in two steps. In step 1, one annotator is asked to detect at least 2 targets from each microblog. Annotators are given the following instructions: "You should identify 2 or more targets in the form of noun phrases. Targets should satisfy the following requirements: 1) Targets should be the main focus of the microblog instead of the trivial details; 2) Targets should be public topics that people may take stances on; 3) Avoid selecting targets to which most people may express the same stance, e.g., illegal charge." In step 2, we ask three annotators to assign a stance label to each microblog-target pair. The instructions are given below: "Based on the message that you learned from the microblog, predict the stance that the author would take for the given target as "Favor", "Against", or "Neutral". We take the majority vote among stance annotations from the three annotators to obtain stance labels. For 9,696 microblogs, we collected 19,038 annotated instances (around 2 targets per instance). The inter-annotator agreement measured by Krippendorff's alpha (Krippendorff, 2011) is 0.60, and a percentage agreement of $75\%$ . We see that while the task is challenging, annotators agree the majority of the time. We can observe from Table 4 that the "World Events" (WE) do + +main and the "Sports" (S) domain have the highest percentage in the "Neutral" class. This might be because these domains include more microblogs related to news. Moreover, people are showing a higher percentage of "Against" stances toward targets in the "Covid Epidemic" (CoE) and "Rights" (R) domains, where more contrary opinions are often expressed. + +# 3.4.2 Annotation for Claim Targets + +The goal of this annotation task is to identify three claims, to which the microblog takes favor, against, and neutral stances, respectively. Annotators are provided with the following instructions: "After reading the microblog, write the following three claims: 1) The author is definitely in favor of the point or message of the claim (favor); 2) The author is definitely against the point or message of the claim (against); 3) Based solely on the microblog content, we cannot know whether the author supports or is against the point or message of the claim (neutral)." To pose challenges to the ZSSD task, we have some additional requirements: First, claims with label favor should not be a direct copy of the microblog content. Second, claims with labels against should not be the simple negation of the microblog content (e.g., adding "not" before verbs). Models may easily detect such language patterns and predict the stance without considering the content of microblog-claim pairs. + +Note that our claim annotation differs from the task of rumor detection (Zubiaga et al., 2015; Derczynski et al., 2017), where claims are replies stemming from the text. Some of such claims may miss information mentioned in the text (e.g., Text: Coronavirus is made by the alien. Claim: I don't believe that.). Our task focuses on predicting the stance toward a claim that discusses the same topic and does not omit any necessary information (e.g., Claim: I believe the Coronavirus is made by some terrorists). We collect 29,088 annotated microblog-claim pairs. For quality assurance, we hide the stance label and + +ask another group of annotators to annotate the stance label for a subset of microblog-claim target pairs. The two annotation groups agree on $95\%$ of the annotation. We observe from Table 4 that each domain has a balanced label distribution. This is because we annotate one claim for each stance label from each microblog. + +# 3.5 Dataset Split + +We split the annotated data into training, validation, and test sets for the target-based ZSSD (subtask A) and the domain-based ZSSD (subtask B). For subtask A, we separate the dataset following the VAST dataset (Allaway and McKeown, 2020): the training, validation, and test sets do not share any microblogs and targets with each other. We randomly select $70\%$ of unique annotated microblogs for the training set and split the remainder evenly for the validation and the test set. The dataset distribution is shown in Table 5. We have 2,865 unique zero-shot noun-phrase targets and 4,487 unique zero-shot claims for 1,503 unique microblogs in the test set, with the average length of 4.7, 26.5, and 105.9 for noun-phrase targets, claim targets, and microblogs, respectively. We also report the average percentage of tokens in targets that overlap with tokens in microblogs (see Appendix C). + +For subtask B, we use the data from six domains (source) for training and validation, and the data from the left-out domain (zero-shot) as the test set. In the end, we have 7 dataset splits for subtask B with one dataset split for each of the 7 domains where each domain in turn is used as the test set. To ensure there are no overlapping targets between the source domains and the zero-shot domain, we remove data with overlapping targets from the source domains in each split. We then split the source domains into the training and the validation set without overlapping microblogs and targets. The statistics when using the "Covid Epidemic" as the zero-shot domain are shown in Table 5. The full statistics of subtask B are shown in Appendix D. + +Because of the linguistic variations in the noun-phrase target expressions, we study the prevalence of LexSimTopics (Allaway and McKeown, 2020) between the training and the test set, which is defined as test targets that have more than 0.9 cosine similarities with any train targets in the word embedding space (Bojanowski et al., 2017). We observe that for subtask A, we have $11\%$ LexSim-Topics in the test set. Whereas for the "Covid Epi + +demic" domain in subtask B, we only have $7\%$ LexSimTopics. This implies that subtask B is more challenging as the training and test targets are more different from each other. Comparatively, VAST dataset has $16\%$ LexSimTopics in the zero-shot test set which is higher than our task. + +# 4 Experimental Settings + +In this section, we introduce the baselines in Section 4.1 and the training settings in Section 4.2. + +# 4.1 Baseline Methods + +To evaluate C-STANCE, we run experiments with the following baselines. BiCE (Augenstein et al., 2016) and CrossNet (Xu et al., 2018) predict the class label using the conditional encoding of BiLSTM models. TGA-Net (Allaway and McKeown, 2020) implicitly captures relationships between targets using generalized topic representations to assist stance classification. We also consider the base version of BERT (Devlin et al., 2019) trained using the whole word masking (wwm) on Chinese Wikipedia (Cui et al., 2020), the 12-layer RoBERTa (Liu et al., 2019) and XLNet (Yang et al., 2019) pre-trained on Chinese news, Q&A, and BaiduBaike (Cui et al., 2020). + +# 4.2 Training Settings + +We perform experiments using an NVIDIA RTX A5000 GPU. Our experiments are conducted based on PyTorch (Paszke et al., 2019). The validation set was used to determine the hyperparameters for the models. For BiCE and CrossNet, we used the AdamW (Loshchilov and Hutter, 2019) with a learning rate of 0.001. Each model was trained for 20 epochs, with a mini-batch size of 64. For TGA-Net, we followed hyperparameters suggested in the previous work (Allaway and McKeown, 2020). For BERT, RoBERTa, and XLNet, we used the AdamW with a learning rate of 5e-6. Models were fine-tuned for 5 epochs using a mini-batch size of 32. The total training time is less than 3 hours. + +# 5 Results + +In this section, we first perform experiments on subtask A and subtask B. We then conduct experiments on cross-lingual stance detection using C-STANCE and the previous English ZSSD VAST dataset. We also study the impact of incorporating both nounphrase targets and claims targets into one dataset. Lastly, we perform the spuriosity analysis for claim + +
Mixed targetsNoun-phrase targetsClaim targets
ConProNeuAllConProNeuAllConProNeuAll
BiCE.490.408.443.447.560.515.590.555.335.358.302.332
Cross-Net.526.541.592.553.607.567.601.592.441.395.588.475
TGA Net.565.599.637.600.694.674.670.679.488.625.699.604
BERT.758.763.798.773.708.693.647.683.797.827.899.841
RoBERTa.775.769.811.785.712.701.669.694.797.819.899.838
XLNet.767.769.804.780.721.701.667.696.805.829.900.845
+ +targets. Each result is the average of 4 runs with different initializations. Similar to prior works (Allaway and McKeown, 2020; Liang et al., 2022b), we use the F1 for each class and the macro-averaged F1 of all classes as evaluation metrics. + +# 5.1 Target-based Zero-Shot Stance Detection + +Target-based zero-shot stance detection (subtask A) aims to evaluate the classifier on a large number of completely unseen targets (Allaway and McKeown, 2020). Our experiments are performed using the full dataset with mixed targets (both noun phrases and claims), the dataset with noun-phrase targets, and the dataset with claim targets, respectively. + +Experimental results are shown in Table 6. First, we can observe that transformer-based models show better performance than RNN-based models, demonstrating the effectiveness of the pre-trained transformer models. Moreover, RoBERTa and XLNet outperform BERT in most metrics, suggesting the effectiveness of additional training performed by RoBERTa and XLNet to address different limitations of BERT. Second, transformer-based models perform better on claim targets than noun-phrase targets. This might be because transformer models are better at capturing contextual information and claims are usually composed of more contextual information than noun phrases. Comparatively, BiCE and CrossNet perform worse on claim targets than noun-phrase targets, showing that claim targets are more challenging for RNN-based models. We also notice that TGA-Net achieves worse performance on claim targets. This might be because the model requires clustering based on target representations, which is more difficult for the claim targets. Third, model performance for the mixed target is higher than the noun-phrase targets and lower than the claim targets. This suggests that ZSSD models that can properly utilize both types of targets are still needed, which we leave as our future work. + +Table 6: Comparison of different models on C-STANCE subtask A. The performance is reported using F1 score for the against (Con), favor (Pro), neutral (Neu), and the $\mathrm{F}1_{\text{macro}}$ (All). Reported results are averaged over four runs. + +
ModelDataCoEWECuEECSREP
BiCEM.347.413.376.393.413.360.400
N.447.546.479.506.539.459.493
C.305.296.289.304.313.304.286
CrossNetM.374.375.370.392.374.351.386
N.489.582.497.523.530.471.522
C.243.260.308.260.279.244.253
TGA-NetM.570.581.598.598.609.608.592
N.577.667.632.629.654.619.642
C.584.585.598.608.613.603.615
BERTM.753.773.768.762.775.772.777
N.594.664.641.641.671.621.647
C.828.835.836.824.841.832.866
RoBERTaM.755.776.779.774.785.784.795
N.602.676.647.655.687.635.670
C.822.833.834.820.842.836.879
XLNetM.758.763.778.767.777.777.781
N.594.680.657.652.674.640.654
C.830.839.840.832.845.834.874
+ +Table 7: Comparison of $F1_{macro}$ of different models on C-STANCE subtask B. Models are trained and evaluated using datasets for 7 zero-shot domain settings. Results are averaged over four runs. + +# 5.2 Domain-based Zero-Shot Stance Detection + +Domain-based stance detection (subtask B) focuses on evaluating classifiers using unseen topics from completely new domains. Particularly, we select one domain as the zero-shot domain and the rest six domains as source domains. We train and validate models using data from source domains and test models using data from the zero-shot domain. We have seven zero-shot domain settings (each with a different zero-shot domain). Similar to subtask A, our experiments are performed using the full dataset with mixed targets, data with noun-phrase targets, and data with claim targets, respectively. + +Results are shown in Table 7. First, we can observe that among the seven zero-shot domain settings, most models show the highest performance when predicting stances for claim targets and the mixed targets from the "Environmental Protection" domain. For example, RoBERTa achieves the highest $F1_{macro}$ of 0.879 for the claim targets, improving its performance over the rest domains by up to $5.9\%$ . Second, stances for noun-phrase targets + +
Train/ValTestConProNeuAll
CV.431.434.424.430
CV-MT.386.412.372.390
VC.461.483.142.362
VC-MT.356.436.121.304
+ +from the "Sports" and the "World Events" domains are easier to predict than the other domains, where RoBERTa and XLNet achieve the highest $F1_{macro}$ of 0.687 and 0.680, respectively. This might be because sports and world events are domains with a higher percentage of microblogs discussing news, which usually captures more diverse target ranges than the other domains. Moreover, we also observe that in most cases, the "Covid Epidemic" is the most difficult domain to predict for all targets, suggesting that the "Covid Epidemic" domain shares the least domain knowledge with the other domains, making it the most difficult zero-shot domain for domain-based ZSSD. + +For mixed targets experiments, we also report the results for test sets of only noun-phrase targets and only claim targets separately in Appendix E (i.e., training on mixed targets and testing on noun-phrase targets or training on mixed targets and testing on claim targets). + +# 5.3 Cross-Lingual Zero-Shot Stance Detection + +To better understand the difference between the existing English ZSSD dataset (VAST) and our Chinese C-STANCE dataset, we perform experiments on cross-lingual zero-shot stance detection between the two datasets. Particularly, we fine-tune a multilingual transformer model BERT (mBERT) (Devlin et al., 2019). The model is pre-trained on 104 languages. We train and validate mBERT using one dataset, and test the model using the other dataset. During the test stage, we experiment with both the original test set and the test set translated into the other language using Google Translate $^{3}$ . + +As shown in Table 8, models trained on VAST perform poorly on the neutral class for the C-STANCE, while models trained on C-STANCE show much higher performance. The results imply that the neutral class in C-STANCE is more challenging than VAST. This is because data for the neutral class in VAST is generated by randomly permuting existing targets and texts, which may generate easy-to-detect text-target pairs. Compara + +Table 8: Cross-lingual ZSSD performance of mBERT using VAST and C-STANCE (denoted as V and C, respectively). "MT" represents machine translation. + +
Train/ValTestXLNetRoBERTa
MN.679.688
MC.844.846
CN.291.254
NC.341.342
+ +Table 9: Comparison of $F1_{macro}$ of XLNet and RoBERTa using different types of targets for training/validation and test. M, N, and C represent data with mixed targets, noun-phrase targets, and claim targets, respectively. + +
DataXLNetRoBERTa
MB+C.845.838
C.670.678
+ +Table 10: Comparison of $\mathrm{F1}_{\text {macro }}$ of XLNet and RoBERTa when both microblog and claim target $(\mathrm{MB} + \mathrm{C})$ are used vs. when only claim target (C) is used as the input. + +tively, for C-STANCE, targets for the neutral class are manually extracted by annotators from each microblog, which are more closely related to the microblog content. Moreover, machine-translated test sets in both languages show worse F1-macro than the original test sets, indicating that machine translation fails to generate high-quality data. This suggests the importance of developing a zero-shot stance detection dataset for Chinese, which has not been done prior to this work. + +# 5.4 Impact of Incorporating Two Target Types + +To analyze the impact of incorporating the noun-phrase targets and the claim targets in one dataset, we evaluate models trained with noun-phrase targets using the claim targets and vice versa. Results are compared with models trained using mixed target types and evaluated by two types of targets separately. Experiments are performed for subtask A, using the best-performing XLNet and RoBERTa. + +Results are shown in Table 9, where we can observe that when models are trained with claim targets and evaluated with noun-phrase targets, the performance is much worse than ones trained by the mixed targets (e.g., 0.291 vs. 0.679 for XLNet). Similar results can be observed when models are trained with noun-phrase targets. These results suggest that datasets including the uni-target type are not capable of handling other target type, which further strengthens the necessity of developing datasets including both target types. + +# 5.5 Spuriosity Analysis for Claim Targets + +We perform spuriosity analysis for claim targets to ensure that we cannot predict the stance based + +solely on the claim. For subtask A, we conduct experiments using XLNet and RoBERTa with only the claim target as input, which are compared with experiments using both microblog and claim target. The results are shown in Table 10, where we can observe a substantial amount of performance decrease when only the claim target is used as input. Therefore, both microblogs and claim targets are required for the models to make correct stance predictions by learning the semantic relation between them. + +# 6 Conclusion + +In this paper, we introduce C-STANCE, the first Chinese zero-shot stance detection dataset. Our dataset includes two challenging ZSSD subtasks: target-based ZSSD (evaluating classifiers using a large number of unseen targets) and domain-based ZSSD (evaluating classifiers using a large number of unseen targets from unseen domains). Moreover, we consider both noun-phrase targets and claim targets. Our dataset is larger and more challenging compared with the previous Chinese stance detection dataset, consisting of 48,126 annotated microblog-target pairs. C-STANCE can serve as a new benchmark for ZSSD, along with VAST, and can enable future research for other stance detection tasks. We conduct experiments using state-of-the-art deep learning models. Future work includes studying the multilingual ZSSD with the union of C-STANCE and other multi-lingual datasets. + +# Limitations + +Our C-STANCE data is collected from social media, which may be seen as a limitation, as we may not cover all aspects of formal texts that could be used in essays or news comments. We will plan to extend this dataset with other types of text in the future. However, this is a limitation of any other datasets that focus on social media content. + +# Ethical Statement + +Our dataset does not provide any personally identifiable information. Microblogs are collected using generic keywords instead of user information as queries, therefore our dataset does not have a large collection of microblogs from an individual user. Thus our dataset complies with Sina Weibo's information privacy policy. + +# Acknowledgements + +We thank the National Science Foundation for support from grants IIS-1912887, IIS-2107487, and ITE-2137846 which supported the research and the computation in this study. We also thank our reviewers for their insightful feedback and comments. + +# References + +Abeer ALDayel and Walid Magdy. 2021. Stance detection on social media: State of the art and trends. Inf. Process. Manage., 58(4). +Emily Allaway and Kathleen McKeown. 2020. Zero-Shot Stance Detection: A Dataset and Model using Generalized Topic Representations. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 8913-8931, Online. Association for Computational Linguistics. +Isabelle Augenstein, Tim Rocttäschel, Andreas Vlachos, and Kalina Bontcheva. 2016. Stance detection with bidirectional conditional encoding. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 876-885, Austin, Texas. Association for Computational Linguistics. +Roy Bar-Haim, Indrajit Bhattacharya, Francesco Dinuzzo, Amrita Saha, and Noam Slonim. 2017. Stance classification of context-dependent claims. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 1, Long Papers, pages 251-261, Valencia, Spain. Association for Computational Linguistics. +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. +Costanza Conforti, Jakob Berndt, Mohammad Taher Pilehvar, Chryssi Giannitsarou, Flavio Toxvaerd, and Nigel Collier. 2020a. STANDER: An expert-annotated dataset for news stance detection and evidence retrieval. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 4086-4101, Online. Association for Computational Linguistics. +Costanza Conforti, Jakob Berndt, Mohammad Taher Pilehvar, Chryssi Giannitsarou, Flavio Toxvaerd, and Nigel Collier. 2020b. Will-they-won't-they: A very large dataset for stance detection on Twitter. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 1715-1724, Online. Association for Computational Linguistics. + +Yiming Cui, Wanxiang Che, Ting Liu, Bing Qin, Shijin Wang, and Guoping Hu. 2020. Revisiting pre-trained models for Chinese natural language processing. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: Findings, pages 657-668, Online. Association for Computational Linguistics. +Kareem Darwish, Walid Magdy, and Tahar Zanouda. 2017. Trump vs. hillary: What went viral during the 2016 us presidential election. In *Social Informatics*, pages 143–161, Cham. Springer International Publishing. +Leon Derczynski, Kalina Bontcheva, Maria Liakata, Rob Procter, Geraldine Wong Sak Hoi, and Arkaitz Zubiaga. 2017. SemEval-2017 task 8: RumourEval: Determining rumour veracity and support for rumours. In Proceedings of the 11th International Workshop on Semantic Evaluation (SemEval-2017), pages 69–76, Vancouver, Canada. Association for Computational Linguistics. +Leon Derczynski, Kalina Bontcheva, Michal Lukasik, Thierry Declerck, Arno Scharl, Georgi Georgiev, Petya Osenova, Toms Pariente Lobo, Anna Kolliakou, Robert Stewart, et al. 2015. Pheme: Computing veracity—the fourth challenge of big social data. In Proceedings of the Extended Semantic Web Conference EU Project Networking session (ESCW-PN). +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. +Jiachen Du, Ruifeng Xu, Yulan He, and Lin Gui. 2017. Stance classification with target-specific neural attention. In Proceedings of the Twenty-Sixth International Joint Conference on Artificial Intelligence, IJCAI-17, pages 3988-3994. +William Ferreira and Andreas Vlachos. 2016. Emergent: a novel data-set for stance classification. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies. +Kyle Glandt, Sarthak Khanal, Yingjie Li, Doina Caragea, and Cornelia Caragea. 2021. Stance detection in COVID-19 tweets. 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 1596–1611, Online. Association for Computational Linguistics. +Genevieve Gorrell, Elena Kochkina, Maria Liakata, Ahmet Aker, Arkaitz Zubiaga, Kalina Bontcheva, and Leon Derczynski. 2019. SemEval-2019 task 7: RumourEval, determining rumour veracity and support + +for rumours. In Proceedings of the 13th International Workshop on Semantic Evaluation, pages 845-854, Minneapolis, Minnesota, USA. Association for Computational Linguistics. +Eduardo Graells-Garrido, Ricardo Baeza-Yates, and Mounia Lalmas. 2020. Representativeness of abortion legislation debate on twitter: A case study in argentina and chile. In *Companion Proceedings of the Web Conference* 2020, WWW '20, page 765-774, New York, NY, USA. Association for Computing Machinery. +Kazi Saidul Hasan and Vincent Ng. 2014. Why are you taking this stance? identifying and classifying reasons in ideological debates. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 751-762, Doha, Qatar. Association for Computational Linguistics. +Klaus Krippendorff. 2011. Computing krippendorff's alpha-reliability. +Dilek Kucik and Fazli Can. 2020. Stance detection: A survey. ACM Comput. Surv., 53(1). +Mirko Lai, Alessandra Teresa Cignarella, Delia Irazú Hernández Farias, Cristina Bosco, Viviana Patti, and Paolo Rosso. 2020. Multilingual stance detection in social media political debates. Computer Speech Language, 63:101075. +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. +Yingjie Li and Cornelia Caragea. 2021a. A multi-task learning framework for multi-target stance detection. In *Findings of the Association for Computational Linguistics: ACL-IJCNLP* 2021, pages 2320-2326, Online. Association for Computational Linguistics. +Yingjie Li and Cornelia Caragea. 2021b. Target-aware data augmentation for stance detection. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 1850-1860, Online. Association for Computational Linguistics. +Yingjie Li, Tiberiu Sosea, Aditya Sawant, Ajith Jayaraman Nair, Diana Inkpen, and Cornelia Caragea. 2021a. P-stance: A large dataset for stance detection in political domain. In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, pages 2355-2365, Online. Association for Computational Linguistics. + +Yingjie Li, Chenye Zhao, and Cornelia Caragea. 2021b. Improving stance detection with multi-dataset learning and knowledge distillation. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 6332-6345, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Yingjie Li, Chenye Zhao, and Cornelia Caragea. 2023. Tts: A target-based teacher-student framework for zero-shot stance detection. In Proceedings of the ACM Web Conference 2023, WWW '23, page 1500-1509, New York, NY, USA. Association for Computing Machinery. +Bin Liang, Zixiao Chen, Lin Gui, Yulan He, Min Yang, and Ruifeng Xu. 2022a. Zero-shot stance detection via contrastive learning. In Proceedings of the ACM Web Conference 2022, WWW '22, page 2738-2747, New York, NY, USA. Association for Computing Machinery. +Bin Liang, Qinglin Zhu, Xiang Li, Min Yang, Lin Gui, Yulan He, and Ruifeng Xu. 2022b. JointCL: A joint contrastive learning framework for zero-shot stance detection. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 81-91, Dublin, Ireland. Association for Computational Linguistics. +Rui Liu, Zheng Lin, Yutong Tan, and Weiping Wang. 2021. Enhancing zero-shot and few-shot stance detection with commonsense knowledge graph. In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021. +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. 2019. Decoupled weight decay regularization. In International Conference on Learning Representations. +Yun Luo, Zihan Liu, Yuefeng Shi, Stan Z. Li, and Yue Zhang. 2022. Exploiting sentiment and common sense for zero-shot stance detection. In Proceedings of the 29th International Conference on Computational Linguistics, pages 7112-7123, Gyeongju, Republic of Korea. International Committee on Computational Linguistics. +Saif Mohammad, Svetlana Kiritchenko, Parinaz Sobhani, Xiaodan Zhu, and Colin Cherry. 2016a. A dataset for detecting stance in tweets. In Proceedings of the Tenth International Conference on Language Resources and Evaluation (LREC'16), pages 3945-3952, Portoorž, Slovenia. European Language Resources Association (ELRA). +Saif Mohammad, Svetlana Kiritchenko, Parinaz Sobhani, Xiaodan Zhu, and Colin Cherry. 2016b. SemEval-2016 task 6: Detecting stance in tweets. + +In Proceedings of the 10th International Workshop on Semantic Evaluation (SemEval-2016), pages 31-41, San Diego, California. Association for Computational Linguistics. +Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. 2019. Pytorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems, volume 32, pages 8024-8035. +Vahed Qazvinian, Emily Rosengren, Dragomir R. Radev, and Qiaozhu Mei. 2011. Rumor has it: Identifying misinformation in microblogs. In Proceedings of the 2011 Conference on Empirical Methods in Natural Language Processing, pages 1589-1599, Edinburgh, Scotland, UK. Association for Computational Linguistics. +Parinaz Sobhani, Diana Inkpen, and Xiaodan Zhu. 2017. A dataset for multi-target stance detection. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 2, Short Papers, pages 551-557, Valencia, Spain. Association for Computational Linguistics. +Qingying Sun, Zhongqing Wang, Qiaoming Zhu, and Guodong Zhou. 2018. Stance detection with hierarchical attention network. In Proceedings of the 27th International Conference on Computational Linguistics, pages 2399-2409, Santa Fe, New Mexico, USA. Association for Computational Linguistics. +Sahil Swami, Ankush Khandelwal, Vinay Singh, Syed Sarfaraz Akhtar, and Manish Shrivastava. 2018. An english-hindi code-mixed corpus: Stance annotation and baseline system. arXiv preprint arXiv:1805.11868. +Mariona Taule, M Antonia Martí, Francisco M Rangel, Paolo Rosso, Cristina Bosco, Viviana Patti, et al. 2017. Overview of the task on stance and gender detection in tweets on catalan independence at ibereval 2017. In 2nd Workshop on Evaluation of Human Language Technologies for Iberian Languages, IberEval 2017. +Jannis Vamvas and Rico Sennrich. 2020. X-Stance: A multilingual multi-target dataset for stance detection. In Proceedings of the 5th Swiss Text Analytics Conference (SwissText) & 16th Conference on Natural Language Processing (KONVENS), Zurich, Switzerland. +Prashanth Vijayaraghavan, Ivan Sysoev, Soroush Vosoughi, and Deb Roy. 2016. DeepStance at SemEval-2016 task 6: Detecting stance in tweets using character and word-level CNNs. In Proceedings of the 10th International Workshop on Semantic Evaluation (SemEval-2016), pages 413-419, San Diego, + +California. Association for Computational Linguistics. + +Penghui Wei and Wenji Mao. 2019. Modeling transferable topics for cross-target stance detection. In Proceedings of the 42nd International ACM SIGIR Conference on Research and Development in Information Retrieval, SIGIR'19, page 1173-1176, New York, NY, USA. Association for Computing Machinery. + +Penghui Wei, Wenji Mao, and Daniel Zeng. 2018. A target-guided neural memory model for stance detection in twitter. In 2018 International Joint Conference on Neural Networks (IJCNN), pages 1-8. + +Wan Wei, Xiao Zhang, Xuqin Liu, Wei Chen, and Tengjiao Wang. 2016. pkudblab at SemEval-2016 task 6: A specific convolutional neural network system for effective stance detection. In Proceedings of the 10th International Workshop on Semantic Evaluation (SemEval-2016), pages 384–388, San Diego, California. Association for Computational Linguistics. + +Chang Xu, Cecile Paris, Surya Nepal, and Ross Sparks. 2018. Cross-target stance classification with self-attention networks. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 778-783, Melbourne, Australia. Association for Computational Linguistics. + +Ruifeng Xu, Yu Zhou, Dongyin Wu, Lin Gui, Jiachen Du, and Yun Xue. 2016. Overview of nlpcc shared task 4: Stance detection in chinese microblogs. In Natural Language Understanding and Intelligent Applications, pages 907-916, Cham. Springer International Publishing. + +Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Russ R Salakhutdinov, and Quoc V Le. 2019. Xlnet: Generalized autoregressive pretraining for language understanding. In Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc. + +Guido Zarrella and Amy Marsh. 2016. MITRE at SemEval-2016 task 6: Transfer learning for stance detection. In Proceedings of the 10th International Workshop on Semantic Evaluation (SemEval-2016), pages 458-463, San Diego, California. Association for Computational Linguistics. + +Bowen Zhang, Min Yang, Xutao Li, Yunming Ye, Xiaofei Xu, and Kuai Dai. 2020. Enhancing cross-target stance detection with transferable semantic emotion knowledge. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 3188-3197, Online. Association for Computational Linguistics. + +Elena Zotova, Rodrigo Agerri, Manuel Nunez, and German Rigau. 2020. Multilingual stance detection in tweets: The Catalonia independence corpus. In Proceedings of the Twelfth Language Resources and + +Evaluation Conference, pages 1368-1375, Marseille, France. European Language Resources Association. + +Arkaitz Zubiaga, Maria Liakata, Rob Procter, Kalina Bontcheva, and Peter Tolmie. 2015. Crowdsourcing the annotation of humorous conversations in social media. In Proceedings of the 24th International Conference on World Wide Web, WWW '15 Companion, page 347-353, New York, NY, USA. Association for Computing Machinery. + +# A More Examples of C-STANCE + +In this section, we show more examples for each domain of our C-STANCE dataset in Table 11. + +# B Query Keywords + +The full keywords set that we used for data crawling is shown in Table 12. We generate the list by gradually extending the initial keywords set from Weibo hot list with the most frequent words. + +# C Token Overlap + +We also report the average percentage of tokens in targets that overlap with tokens in microblogs. The results are shown in Table 16. We observe that noun-phrase show a higher overlapping percentage than claim targets, which is because annotators tend to summarize noun-phrase targets using semantically similar tokens from the text. + +# D Full Statistics of Subtask B + +The statistics of the 7 dataset splits (data from six domains for training and validation, and the data from the left-out domain as the zero-shot test set) are shown in Table 13. + +# E Evaluations on Models Trained by Mixed Targets with Noun-Phrase Targets and Claim Targets + +In subtask A and subtask B, for experiments using mixed targets, we also test the baseline models using noun-phrase targets and claim targets separately. Our goal is to better understand how each model trained on mixed targets performs for each type of target separately. The results for subtask A and subtask B are shown in Table 14 and Table 15, respectively. We can observe that the fine-tuned transformer-based models (i.e., BERT, RoBERTa, and XLNET) show higher performance on the claim targets. For BiCE, CrossNet, and TGA-Net, stances for claim targets are more difficult to predict. + +
CoEMicroblog既然新冠要和人类长期共存,做疫苗接种应该比封控重要。再继续封锁,经济咋办呀?今天又要学校停课、企业停工。Since the new crown will coexist with humans for a long time,vaccination should be more important than lockdown. If the blockade continues, what will happen to the economy? Today, schools are closed and businesses are closed.
N target/Stance封控 sealed management / Against
C target/Stance新冠病毒会很快消失,不可能人类长期共存 The Covid-19 virus will disappear soon,and it is impossible for human beings to coexist for a long time. / Against
WEMicroblog拜登表示如果普京愿意结束战争,他已做好了与普京对话的准备。美国搞残欧洲的目的达到,确实代理人战争再下去打没啥好处了。 Biden stated that if Putin is willing to end the war, he is ready to talk to Putin. The United States has achieved its goal of crippling Europe. It is true that there is no benefit in continuing the proxy war.
N target/Stance俄乌冲突 Russia-Ukraine conflict / Against
C target/Stance美国搞乱欧洲的目的达到了,俄乌战争没有什么好打的了。The purpose of the United States to mess up Europe has been achieved, and it's meaningless to continue fighting the Russia-Ukraine war. / Favor
CuEMicroblog我知道公立教育的问题,但我还是感谢公立教育让我和来自比我有钱家庭的人在一起享受同样教育。I know the problems with public education, but I'm still thankful that public education allows me to enjoy the same education with people from families richer than me.
N target/Stance公立教育 public education / Favor
C target/Stance真正有钱的家庭都在私立学校,教育公平的天平秤早就倾斜了。Children from truly wealthy families are all in private schools, and the balance of educational equity has long been tilted. / Against
ECMicroblog发现沉沦短视频时代久了我无法静心去读一段文字,逃避阅读长文。阅读也走马观花。I found that after watching too many short videos, I can't read a paragraph of text quietly and avoid reading long texts. Reading for me is a quick glance.
N target/Stance短视频 short video / Against
C target/Stance短视频做得最好的应该就是抖音了。TicTok is the best short video platform. / Neutral
SMicroblog昨晚云达女足的比赛来到威悉球场进行,20417名梅粉来到现场!虽然1比2惜败,但我们听到了你们的声音! Last night, the Werder women's football game came to the Weser Stadium, and 20,417 fans came to the scene! Although they lost the game by 1-2, we heard your voices!
N target/Stance运达女足 Werder Women's Football / Favor
C target/Stance这么多球迷去看运达女足的比赛,结果输了,也太让球迷们失望了吧。So many fans went to watch the Yunda women's game, but they lost. So disappointing for the fans. / Against
RMicroblog体质占优势的男性就掌握了话语权。所以实现真正的女权发展科技,当科技可以抹平和男性的生产力和武力差距后,才能真正实现男女平等。Men with dominant physiques have the right to speak. Therefore, to realize true women's rights and develop technology, only when technology can bridge the gap in productivity and force with men can we truly achieve equality between men and women.
N target/Stance男女平等 gender equality / Favor
C target/Stance女权只需要嘴巴说说就好了,无需行动,时间可以改变一切。Women's rights only need to be talked about, no action needed, time can change everything. / Against
EPMicroblog延缓气候变化,需要富裕国家更多采取更多行动。在澳洲,还是有很多人对气候变暖持怀疑态度,这也阻碍了政府采取更多行动。Slowing climate change will require rich countries to do more. In Australia, there are still many people who are skeptical about climate change, which is also preventing the government from taking more action.
N target/Stance延缓气候变化 Slow down climate change / Favor
C target/Stance气候变化是二氧化碳等气体变多导致的,其造成的后果也很大 Climate change is caused by the increase of gases such as carbon dioxide, and its consequences are also large. / Neutral
+ +Table 11: Examples of noun-phrase targets and claim targets for microblogs in each domain of our C-STANCE dataset. "N target" and "C target" represent the noun-phrase target and the claim target, respectively. + +
股市 stock market, 读书 read, 艺术 art, 设计 design, 男朋友 boyfriend, 文化输出 cultural output, 社会 society, 父母 parents, 消费观 consumption concept, 战争 war, 异地恋 long distance relationship, 带娃 raise a baby, 女朋友 girlfriend, 大学 college, 华语乐坛 Chinese pop music, 健身 fitness, 电影 movie, 播客 podcast, 公立教育 public education, 世界新闻 world news, 加强针 booster, 疫苗 vaccine, 气候变化 climate change, 人工智能 artificial intelligence, 书 book, LGBTQ, 拆迁 remove, 俄罗斯 Russia, 乌克兰 Ukraine, 汽油 gasoline, 武器 wearpons, 大选 general election, 知识 knowledge, 选举 election, 口罩 face mask, 鸡娃 force kids to compete, 高中 high school, 贫困 poverty, 财经 financial, 育儿 parenting, 规划人生 life planning, 男篮 men's basketball, 高校 colleges and universities, 男足 men's football, 女足 women's football, 教师 teacher, 思考 thinking, 医患 doctors and patients, 军事 military, 人口负增长 negative population growth, 篮球 basketball, 辩论 debate, 环境 environment, 总统 president, 学生 student, 婚姻 marriage, 科学 science, 医保 medical insurance, 封控 sealed management, 保险 insurance, 工作 work, 油价 oil price, 防疫 epidemic prevention, 世界杯 World Fup, NBA, 男女平等 gender equality, 平权 equal rights, 移民 migrant, 新冠疫苗 Covid-19 vaccine, 直播带货 livestream shopping, 短视频 short video, 物价 prices, 流行文化 pop culture, 自由恋爱 free love, 相亲 blind date, 素质教育 quality education, 中医 traditional Chinese medicine, 静默 silence, 新冠共存 co-existence with coronavirus, 上网课 online class, 居家办公 work from home, 电商 e-commerce, 女拳 women's rights, iphone, 新能源 new energy, 垃圾分类 garbage classification, 微商 Wechat business, 中国防疫 China's epidemic prevention, 防控 prevention and control, 老龄化 population aging, 中国历史 Chinese history, 传统文化 traditional culture, 近代史 modern history, 阅读 read, 芯片 chip, 投资 invest, 电视剧 TV series, 影评 movie review, 票房 box office, 高考 college entrance examination 美妆博主 beauty blogger, 足球 football, 体育 sports, 健康 healthy, 群体免疫 herd immunity, 减负 lighten the burden, 农村 the countryside, 环保意识 environmental awareness
+ +Table 12: The full query keywords list used in our work for microblog crawling. + +
# Examples# TargetsAvg. Length# Unique MB
NCNCNCMB
Covid EpidemicTrain12,37918,9847,51918,5854.026.0102.46,690
Val2,2493,4472,2083,4364.626.0104.81,167
Test3,4745,3461,8965,2113.725.7103.61,786
World EventTrain11,97818,4177,42618,0344.025.9101.66,813
Val2,0773,1862,0453,1764.626.0104.71,087
Test3,1304,7702,1524,6734.226.1105.81,591
Culture and EducationTrain12,28318,7207,67118,3144.026.0102.87,105
Val2,1803,3542,1463,3424.626.0104.71,131
Test2,3973,6181,8063,5893.925.6104.01,218
Entertainment and consumptionTrain10,51716,1106,77715,8114.126.1103.66,244
Val1,9913,0511,9603,0424.726.0106.61,043
Test4,0106,1532,8866,0423.925.698.92,052
SportsTrain13,54920,6828,09120,2373.925.9103.47,379
Val2,3213,5582,2763,5484.626.0105.21,192
Test2,0883,1771,2563,1173.825.796.81,060
RightsTrain12,79719,5487,79319,1464.025.8102.27,094
Val2,3523,5942,3073,5834.626.0104.61,218
Test2,4923,8281,5233,7283.826.6105.41,276
Environmental ProtectionTrain14,23721,8828,24621,4043.925.9102.17,708
Val2,3633,6362,3213,6264.625.8104.41,223
Test1,4532,1961,0562,1314.426.9107.7733
+ +Table 13: Data statistics of all 7 dataset splits for subtask B. N, C, and MB represent noun-phrase targets, claim targets, and microblogs, respectively. + +
Mixed targetsNoun-phrase targetsClaim targets
ConProNeuAllConProNeuAllConProNeuAll
BiCE.490.408.443.447.518.544.562.541.476.302.354.377
Cross-Net.526.541.592.553.582.571.551.568.487.52.616.541
TGA Net.565.599.637.600.644.629.586.620.518.577.666.587
BERT.758.763.798.773.686.679.628.665.800.828.896.841
RoBERTa.775.769.811.785.712.692.659.688.813.826.899.846
XLNet.767.769.804.780.715.683.640.679.800.831.902.844
+ +Table 14: Comparison of different models in subtask A, which are trained on mixed targets and tested using the full test set with mixed targets (M), the noun-phrase targets (N), and the claim targets (C), respectively. Results are averaged over four runs. + +
ModelCoEWECuEECSREP
BiCEM.347.413.376.393.413.360.400
N.428.551.478.509.545.464.509
C.296.322.310.319.327.295.328
CrossNetM.374.375.370.392.374.351.386
N.484.561.490.503.534.475.527
C.263.217.253.279.212.229.245
TGA-NetM.570.581.598.598.609.608.592
N.545.586.603.599.618.602.585
C.576.571.585.589.607.587.595
BERTM.753.773.768.762.775.772.777
N.598.665.629.645.677.627.619
C.829.836.839.832.838.836.873
RoBERTaM.755.776.779.774.785.784.795
N.596.655.650.668.683.647.657
C.834.848.845.835.850.847.879
XLNetM.758.763.778.767.777.777.781
N.604.649.650.650.677.647.642
C.829.833.845.836.841.831.870
+ +Table 15: Comparison of $F1_{macro}$ of different models trained on mixed targets for 7 different zero-shot domain settings, and tested using the full test set with mixed targets (M), the noun-phrase targets (N), and the claim targets (C), respectively. Results are averaged over four runs. + +
NC
Train78.2%25.5%
Val76.4%24.7%
Test77.6%25.8%
+ +Table 16: Average percentage of token overlap between two types of targets and microblogs. N and C represent noun-phrase targets and claim targets, respectively. + +A For every submission: + +A1. Did you describe the limitations of your work? + +Limitation Section after the Conclusion. + +A2. Did you discuss any potential risks of your work? + +Limitation Section after the Conclusion. + +A3. Do the abstract and introduction summarize the paper's main claims? + +Abstract and Section 1. + +A4. Have you used AI writing assistants when working on this paper? + +Left blank. + +B Did you use or create scientific artifacts? + +Section 3 and 4. + +B1. Did you cite the creators of artifacts you used? + +Section 3 and 4. + +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? + +We discuss the dataset that we created in Section 3 and the baseline models that we used in Section 4. + +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +We discussed our usage of baseline models in Section 4. We discussed the intended use of the dataset that we created in Section 3. We show our dataset is compatible with the original access conditions in the Ethical Statement Section. + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? + +Ethical Statement Section. + +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? + +Section 3. + +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. + +Section 3. + +C Did you run computational experiments? + +Section 5. + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +Section 4. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? + +Section 4. + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? + +Section 5. + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? + +Section 4. + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? + +Section 3. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? + +Section 3. + +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? + +We discussed the annotation company that we worked with and how we recruited annotators in Section 3. + +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? + +Section 3 and Section 5. + +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? + +Not applicable. Left blank. + +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? + +Section 3. \ No newline at end of file diff --git a/cstancealargedatasetforchinesezeroshotstancedetection/images.zip b/cstancealargedatasetforchinesezeroshotstancedetection/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..52f211dd1d8576e4fcfc19c7f94b4a370c7a746e --- /dev/null +++ b/cstancealargedatasetforchinesezeroshotstancedetection/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9738dbc64bace924881e01974d859b43ad5ce9246c5f0591a4deead77602780a +size 1506394 diff --git a/cstancealargedatasetforchinesezeroshotstancedetection/layout.json b/cstancealargedatasetforchinesezeroshotstancedetection/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..aac0d1129e4f8cdbc9efe9db927cf7f8baf613d0 --- /dev/null +++ b/cstancealargedatasetforchinesezeroshotstancedetection/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b372dee6c3048daefdceadcc5755f26b6e7278c795cd4c658b0ba556e6580bd9 +size 418018 diff --git a/ctcbasednonautoregressivespeechtranslation/55087a63-d209-4c6c-b9eb-805bcce115f1_content_list.json b/ctcbasednonautoregressivespeechtranslation/55087a63-d209-4c6c-b9eb-805bcce115f1_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..8c59dbd0062294b6afc399dab8a6924e29c5ede6 --- /dev/null +++ b/ctcbasednonautoregressivespeechtranslation/55087a63-d209-4c6c-b9eb-805bcce115f1_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b051db27973045e1f84ef530e7c1b14089457d82e7feccb98e31c80d030d12b7 +size 126077 diff --git a/ctcbasednonautoregressivespeechtranslation/55087a63-d209-4c6c-b9eb-805bcce115f1_model.json b/ctcbasednonautoregressivespeechtranslation/55087a63-d209-4c6c-b9eb-805bcce115f1_model.json new file mode 100644 index 0000000000000000000000000000000000000000..04b42c73eac042ac24ff57912912a6ed49e90082 --- /dev/null +++ b/ctcbasednonautoregressivespeechtranslation/55087a63-d209-4c6c-b9eb-805bcce115f1_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:98135ac7860be1785d9248414db3dc55d0db67b95987765aeb8b63c639850c22 +size 154374 diff --git a/ctcbasednonautoregressivespeechtranslation/55087a63-d209-4c6c-b9eb-805bcce115f1_origin.pdf b/ctcbasednonautoregressivespeechtranslation/55087a63-d209-4c6c-b9eb-805bcce115f1_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..564834e8f5b746de04891591756fdcbff8972901 --- /dev/null +++ b/ctcbasednonautoregressivespeechtranslation/55087a63-d209-4c6c-b9eb-805bcce115f1_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:59c3bd20243189bf07b2de0a23783ed4802b8c4cdb0654c19b0755b415abf7e2 +size 457547 diff --git a/ctcbasednonautoregressivespeechtranslation/full.md b/ctcbasednonautoregressivespeechtranslation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..243af0edc87a08c1a5092361b323d9d1c21623d9 --- /dev/null +++ b/ctcbasednonautoregressivespeechtranslation/full.md @@ -0,0 +1,549 @@ +# CTC-based Non-autoregressive Speech Translation + +Chen Xu $^{1\dagger}$ , Xiaoqian Liu $^{1}$ , Xiaowen Liu $^{1}$ , Qingxuan Sun $^{1}$ , Yuhao Zhang $^{1}$ , Murun Yang $^{1}$ , Qianqian Dong $^{2}$ , Tom Ko $^{2}$ , Mingxuan Wang $^{2*}$ , Tong Xiao $^{1,3*}$ , Anxiang Ma $^{1,3}$ , Jingbo Zhu $^{1,3}$ + +$^{1}$ School of Computer Science and Engineering, Northeastern University, Shenyang, China $^{2}$ ByteDance + +$^{3}$ NiuTrans Research, Shenyang, China + +{xuchennlp, liuxiaoqian0319, liuxiaowenneu}@outlook.com + +{dongqianqian, tom.ko, wangmingxuan.89}@bytedance.com + +{xiaotong,maanxiang,zhujingbo}@mail.neu.edu.cn + +# Abstract + +Combining end-to-end speech translation (ST) and non-autoregressive (NAR) generation is promising in language and speech processing for their advantages of less error propagation and low latency. In this paper, we investigate the potential of connectionist temporal classification (CTC) for non-autoregressive speech translation (NAST). In particular, we develop a model consisting of two encoders that are guided by CTC to predict the source and target texts, respectively. Introducing CTC into NAST on both language sides has obvious challenges: 1) the conditional independent generation somewhat breaks the interdependency among tokens, and 2) the monotonic alignment assumption in standard CTC does not hold in translation tasks. In response, we develop a prediction-aware encoding approach and a cross-layer attention approach to address these issues. We also use curriculum learning to improve convergence of training. Experiments on the MuST-C ST benchmarks show that our NAST model achieves an average BLEU score of 29.5 with a speed-up of $5.67\times$ , which is comparable to the autoregressive counterpart and even outperforms the previous best result of 0.9 BLEU points1. + +# 1 Introduction + +End-to-end speech translation (E2E ST) has attracted unprecedented attention and achieved dramatic development in recent years (Duong et al., 2016; Berard et al., 2016; Weiss et al., 2017; Anastasopoulos and Chiang, 2018; Wang et al., 2020b,c; Xu et al., 2021; Zhang et al., 2022b). Stand-alone + +modeling reduces the inference latency by almost half compared to cascaded systems, where the automatic speech recognition (ASR) model and the machine translation (MT) model run serially. This helps the application in real scenarios, especially with limited computational resources. + +However, this advantage only holds in the context of autoregressive (AR) decoding, where each token is generated depending on the previously predicted results. Non-autoregressive (NAR) generation (Gu et al., 2018), the recently popular decoding method in ASR and MT, makes the inference process fast by predicting the output sequence in parallel, resulting in the E2E ST no longer being superior in terms of inference speed-up. + +A natural question arises: can we build a powerful non-autoregressive speech translation (NAST) model? The NAR results in the latest literature are still inferior to the AR counterparts with a large gap of about $2 \sim 3$ BLEU points, even with the iterative refinement process (Inaguma et al., 2021a). In this work, we aim to develop a promising NAST model for comparable performance to the AR model without complex decoding. + +We resort to the connectionist temporal classification (CTC, Graves et al., 2006) because of its great success in ASR and MT and the convenience of variable length prediction. CTC is well suited for speech-to-text modeling, where the input sequence is longer than the output. Recent studies show that CTC-based NAR models achieve comparable or even better performance than their AR counterparts, providing insight into the design of the powerful CTC-NAST model. + +Our CTC-NAST model is decoder-free and consists of two stacked encoders: an acoustic encoder and a textual encoder. They are guided by CTC to + +predict transcription and translation, respectively (Chuang et al., 2021). Then, we carry out a careful and systematic inspection of the underlying issues and address the challenges of CTC-NAST. In particular, + +- The conditional independence assumption allows fast inference but omits interdependency across the whole sequence. We identify the prediction-aware encoding (PAE) method underlying the success of a series of studies (Nozaki and Komatsu, 2021; Huang et al., 2022; Higuchi et al., 2021a), which observe preliminary prediction and refine it in the final generation. Following this idea, we predict the CTC result in the intermediate layer and then integrate it into the subsequent encoding. +- Another inherent property of CTC, the monotonic assumption, is valid for ASR but does not hold for translation tasks, where a future word in the target text may be aligned with the earlier part of the source text, especially on distant language pairs (Hannun, 2017). A critical requirement of the decoder-free design is the reordering augmentation (Chuang et al., 2021). As a remedy, we introduce an additional cross-layer attention module, which is complementary to the self-attention module. + +Even with the above efforts, NAST is still a difficult task that suffers from heavy modeling burdens. A curriculum learning strategy that guides the training in an easy-to-hard way is significant for better convergence. We replace part of the incorrect prediction with ground truth in PAE to prompt the generation of the whole sequence. In this way, the model relieves the CTC learning burden by observing almost the whole sequence in the early stages, while only a few tokens are replaced as CTC performance improves, ensuring consistency between training and inference. + +Our CTC-NAST model is simple, completely parallel, and works well for both similar and distant language pairs. The proposed methods yield a remarkable gain of 3.0 BLEU points on MuST-C En-De, achieving an average BLEU score of 29.5 with an inference speed-up of $5.67\times$ , and even outperforming the best previous AR results by 0.9 BLEU points. We also report competitive results on the more challenging MuST-C En-Ja and Fisher-Callhome corpus. + +# 2 Background + +# 2.1 Connectionist Temporal Classification + +CTC (Graves et al., 2006) was originally proposed for labeling unsegmented sequences. It learns monotonic alignment between acoustic features and transcriptions, which is valid for cross-modal learning like ASR. CTC helps convergence and allows re-scoring decoding through a lightweight output layer, achieving great success in ASR as an auxiliary loss on top of the encoder (Watanabe et al., 2017; Karita et al., 2019). Given the encoder representation $h$ and the corresponding sequence $y$ , the CTC loss is defined as: + +$$ +\mathcal {L} _ {\mathrm {C T C}} = - \log \mathrm {P} _ {\mathrm {C T C}} (y | h) \tag {1} +$$ + +where the probability is calculated by marginalizing over all possible alignments $\Phi (y)$ between $h$ and $y$ : + +$$ +\mathrm {P} _ {\mathrm {C T C}} (y | h) = \sum_ {\pi \in \Phi (y)} \mathrm {P} (\pi | h) \tag {2} +$$ + +CTC has the same conditional independence property as NAR generation, where the probability of the path $\pi$ is the product of the probability $P(\pi_t|h_t)$ at each time step $t$ : + +$$ +\mathrm {P} (Y | X) \approx \prod_ {t = 1} ^ {T} \mathrm {P} \left(\pi_ {t} \mid h _ {t}\right) \tag {3} +$$ + +where $T$ is the length of $h$ . + +# 2.2 AR and NAR + +Given a source sequence $X = (x_{1},\dots ,x_{T^{\prime}})$ , a sequence-to-sequence model predicts the target sequence $Y = (y_{1},\dots ,y_{T})$ by conditional distribution: + +$$ +\mathrm {P} (Y | X; \theta) = \prod_ {t = 1} ^ {T} \mathrm {P} _ {\mathrm {A R}} \left(y _ {t} \mid y _ {< t}, X; \theta\right) \tag {4} +$$ + +where $\theta$ is the model parameters. This autoregressive generation learns sequential dependency but suffers from high inference latency. + +Instead, NAR carries out the conditional independent prediction for parallel inference (Gu et al., 2018): + +$$ +\mathrm {P} (Y | X; \theta) = \prod_ {t = 1} ^ {T} \mathrm {P} _ {\mathrm {N A R}} \left(y _ {t} | X; \theta\right) \tag {5} +$$ + +Although the vanilla NAR model speeds up inference by about $15 \times$ (Gu et al., 2018), it is still inferior to the AR counterpart by a large gap. + +Researchers have proposed many series of methods to improve the generation quality and investigate a better trade-off between performance and speed in the MT task, such as the iterative decoding method (Lee et al., 2018; Stern et al., 2019; Ghazvininejad et al., 2019; Kasai et al., 2020), latent variable method (Gu et al., 2018; Song et al., 2021; Gu and Kong, 2021), data manipulation method (Zhou and Keung, 2020; Bao et al., 2022; Ding et al., 2021), enhancement based method (Guo et al., 2019; Wang et al., 2019), and semi-autoregressive decoding (Ran et al., 2020). There are also some studies to design the architecture of the NAR models, such as the use of CTC for prediction for its ability of variable length prediction (Libovicky and Helcl, 2018; Shu et al., 2020; Saharia et al., 2020). + +In addition, the NAR generation also shows promising results in ASR task, especially the CTC-based systems (Higuchi et al., 2020, 2021b; Lee and Watanabe, 2021; Nozaki and Komatsu, 2021; Kim et al., 2022). + +# 2.3 Speech Translation + +Recently, E2E ST has received a lot of attention due to its direct modeling (Berard et al., 2016). Unlike the conventional cascaded system that decouples the cross-modal and cross-lingual modeling into ASR and MT models respectively (Ney, 1999; Mathias and Byrne, 2006), the end-to-end manner is more elegant and has the potential for fast inference and error-free propagation. + +One promising route to improve ST is to develop more adaptive architectures according to the task characteristics. Based on the idea of modeling decoupling, the stacked encoding method divides cross-modal and cross-lingual learning into acoustic and semantic encoders, respectively (Liu et al., 2020; Xu et al., 2021). In this design, the CTC loss for transcription is usually introduced to guide the learning of the acoustic encoder, which significantly helps convergence. In addition, the latent alignment learned in the CTC is used to bridge the two encoders. Liu et al. (2020) shrink the sequence length based on CTC prediction. Xu et al. (2021) introduce an adapter to bridge two encoders by integrating CTC prediction. + +Several studies investigate the NAR generation + +in ST (Inaguma et al., 2021a,b; Chuang et al., 2021). However, current NAR systems are still inferior to AR counterparts, especially CTC-based systems. Researchers also continue to extend the use of CTC to learn target text as an auxiliary loss of the encoder (Zhang et al., 2022a; Yan et al., 2022). But there is no work to inspect the underlying issues in the CTC modeling of target text in ST. To this end, we study the challenges of building a powerful CTC-based NAST model and then propose corresponding methods. We also extend our method to AR models for a comprehensive exploration. + +# 3 CTC-NAST + +Among many well-established NAR designs for ASR or MT models, CTC is particularly suitable for ST modeling because the input length is remarkably longer than its output. In this section, we present CTC-NAST in detail. We first describe the base architecture, then identify and address three underlying challenges. See Figure 1 for an overview of our system. + +# 3.1 Base Architecture + +ST aims to translate audio in the source language to text in the target language directly. Let $(x; y^s; y^t)$ be a training sample of ST, where $x$ is the input speech feature sequence, $y^s$ is the corresponding transcription of $x$ , and $y^t$ is the translation in the target language. We assume that transcription is always available in our work. + +We drop the decoder network and rely only on the CTC-based encoder. Following the design of SATE (Xu et al., 2021; Chuang et al., 2021), we decouple the encoding into an acoustic encoder and a textual encoder in a stack architecture, as shown in Figure 1(a). They are guided by CTC loss for transcription and translation (denoted CTC and XCTC for distinction), respectively. + +Formally, given a representation $h^a$ of the acoustic encoder output, the CTC loss is calculated as: + +$$ +\mathcal {L} _ {\mathrm {C T C}} = - \log \mathrm {P} _ {\mathrm {C T C}} \left(y ^ {s} \mid h ^ {a}\right) \tag {6} +$$ + +Similarly, the XCTC loss is calculated as: + +$$ +\mathcal {L} _ {\mathrm {X C T C}} = - \log \mathrm {P} _ {\mathrm {X C T C}} \left(y ^ {t} \mid h ^ {t}\right) \tag {7} +$$ + +where $h^t$ is the representation of the textual encoder output. + +Then, the training objective is formulated as the interpolation of the two CTC losses: + +$$ +\mathcal {L} = \alpha_ {A} \cdot \mathcal {L} _ {\mathrm {C T C}} + \alpha_ {T} \cdot \mathcal {L} _ {\mathrm {X C T C}} \tag {8} +$$ + +![](images/f98c849a2e5a9386db3912619259896c83776c06a85a1dbdd8b201a18aff1f09.jpg) +(a) + +![](images/af55b46db06c5d5a3c743bfd5f1e8eb42bee5dcefcecf0ccf2134ce182e3906d.jpg) +(b) + +![](images/09ff4b7c41b212b4b2c7e209bc03cf365a3f2b3412a37051b3823c28c860ce57.jpg) +(c) +Figure 1: Overview of our CTC-NAST model. (a) The base architecture consisting of two CTC-guided encoders, (b): The cross-layer attention module, where the layer normalization is omitted for simplification, (c) Prediction-aware encoding, and its variant of curriculum learning mixing. + +where $\alpha_{\mathrm{A}}$ and $\alpha_{\mathrm{T}}$ are the coefficients of the CTC and XCTC losses, respectively. + +Although CTC works well for the NAR ASR model, extending CTC naively to the more challenging ST task is fragile. We claim that CTC-NAST can be improved by addressing three issues: + +- Conditional independence assumption is an inherent property of CTC, which ignores interdependency with past or future contexts, leading to poor generation (Chan et al., 2020), like repetition and omission errors. +- Although the self-attention network has the modest reordering capability (Chuang et al., 2021), our encoder-only architecture is hard to handle the monotonic assumption, especially for distant language pairs. +- E2E ST already suffers from the heavy burden of cross-modal and cross-lingual mapping, while NAR modeling further aggravates the difficulty and results in poor convergence. + +# 3.2 Prediction-aware Encoding + +NAR generation enlarges the search space in inference due to conditional independence (Ran et al., 2021), especially with the long speech sequence of hundreds and thousands of units. A commonly-used solution, incorporating latent variables that contain the initial prediction into modeling, has + +been demonstrated to be effective (Lee et al., 2018). In this way, the NAR generation is decoupled as the multiple-step refinement of the target sequence, enabling the model to be aware of the previous prediction. + +Inspired by the prior efforts in MT (Huang et al., 2022) and ASR (Nozaki and Komatsu, 2021), we introduce prediction-aware encoding (PAE). The detailed illustration is shown in Figure 1(c). Specifically, given one representation $h^l$ outputted by the intermediate encoder layer $l$ , PAE integrates the prediction information (corresponding ① in the Figure) into the following encoding explicitly by weighting the embedding matrix $W$ over the current CTC distribution (called InterCTC) (Xu et al., 2021): + +$$ +\mathrm {P A E} \left(h ^ {l}\right) = h ^ {l} + \mathrm {P} _ {\text {I n t e r C T C}} \left(\pi \mid h ^ {l}\right) \cdot W \tag {9} +$$ + +where the weights $W$ are shared in the whole network. Note that we use PAE to augment the learning of both CTC and XCTC. + +Since the poor prediction leads to the risk of error propagation, we also optimize the InterCTC loss for guaranteed prediction: + +$$ +\mathcal {L} _ {\text {I n t e r C T C}} = - \log \mathrm {P} _ {\text {I n t e r C T C}} (y | h) \tag {10} +$$ + +In this way, we ensure that CTC predicts well. However, the worse result for XCTC limits the benefits of PAE, which may result in negative effects. We alleviate this issue in Section 3.4. + +Now, we re-formulate the training loss in Eq. 8 as: + +$$ +\begin{array}{l} \mathcal {L} = \alpha_ {\mathrm {A}} \cdot \mathcal {L} _ {\mathrm {C T C}} + \alpha_ {\mathrm {T}} \cdot \mathcal {L} _ {\mathrm {X C T C}} \\ + \quad \beta_ {\mathrm {A}} \cdot \frac {1}{M} \sum_ {m = 1} ^ {m} \mathcal {L} _ {\text {I n t e r C T C}} ^ {m} \\ + \beta_ {\mathrm {T}} \cdot \frac {1}{N} \sum_ {n = 1} ^ {N} \mathcal {L} _ {\text {I n t e r X C T C}} ^ {n} \tag {11} \\ \end{array} +$$ + +where $M$ and $N$ are the numbers of the intermediate CTC and XCTC, $\beta_{\mathrm{A}}$ and $\beta_{\mathrm{T}}$ are the corresponding coefficients. + +# 3.3 Reordering Augmentation + +Vanilla Transformer generates each token by distributing the weight of the encoder-decoder attention module to the corresponding source part to be translated, which easily handles the order gap between languages. However, CTC modeling faces the intractable issue of reordering the representation into the target language order during encoding. Although previous studies have demonstrated that the MT or ST encoder can capture the global information (Yang et al., 2018; Xu et al., 2021), it is still difficult to rely only on the self-attention module to search the positions that contribute significantly to decoding (Chuang et al., 2021). + +To enhance the reordering capability of CTC-NAST, we mimic the design of the decoder and introduce cross-layer attention (CLA) module, which is inserted between the self-attention module and the feed-forward module in the specific layers of the textual encoder, as shown in Figure 1(b). Let $\mathrm{SA}(\cdot ,\cdot ,\cdot)$ and $\mathrm{CLA}(\cdot ,\cdot ,\cdot)$ denote the self-attention and CLA modules, the new Transformer layer $j$ can be formulated as: + +$$ +h ^ {\prime} = h ^ {j - 1} + \mathrm {S A} \left(h ^ {j - 1}, h ^ {j - 1}, h ^ {j - 1}\right) \tag {12} +$$ + +$$ +h ^ {\prime} = h ^ {\prime} + \operatorname {C L A} \left(h ^ {\prime}, h ^ {k}, h ^ {k}\right) \tag {13} +$$ + +$$ +h ^ {j} = h ^ {\prime} + \operatorname {F F N} \left(h ^ {\prime}\right) \tag {14} +$$ + +where $h^k$ is the representation output from the layer $k(k < j)$ . + +In this way, CLA offers a remedy for the lacking attention, that captures the information from the bottom layer directly and is complementary to the self-attention module. Now the textual encoder acts as both a stack of the encoder and the decoder of the vanilla encoder-decoder model. + +In order to further enhance the ability of CLA, we introduce the drop-net technique. In each layer + +containing the CLA module, we drop the self-attention module with a probability $p_{drop} \in [0,1]$ . Note that the self-attention module always keeps during inference. + +# 3.4 Curriculum Learning Strategy + +Even with the auxiliary encoding and improved design architecture, the CTC-NAST model still faces the difficulty of a heavy modeling burden, leading to poor convergence. Inspired by Qian et al. (2021), a curriculum learning strategy is remarkably important to reduce the dependency in the early stage and increase the difficulty along the training process. + +As illustrated in Figure 1(c), we replace part of the prediction (corresponding $①$ in the Figure) in Eq. 9 with the ground truth (corresponding $②$ in the Figure), which mitigates the negative effects of error propagation caused by the poor XCTC performance in PAE and prompts the generation of the whole sequence. Unlike the same lengths between input and output in the decoder, the length of the input acoustic feature is remarkably longer than the corresponding text in CTC. Therefore, we take the best alignment computed by the model as the ground truth (Gu and Kong, 2021; Huang et al., 2022): + +$$ +\hat {\pi} = \arg \max _ {\pi \in \Phi (y)} \mathrm {P} \left(\pi | s; \theta^ {\prime}\right) \tag {15} +$$ + +where $\theta^{\prime}$ is the current model parameter. Note that the length of $\hat{\pi}$ is the same as the input. + +Denote the replacement ratio as $r \in [0,1]$ , we uniformly sample a random variable $U$ from $[0,1]$ : + +$$ +\hat {P} _ {t} = \mathbb {I} (U > = r) * p _ {t} + \mathbb {I} (U < r) * \hat {\pi} _ {t} \tag {16} +$$ + +where $\mathbb{I}(\cdot)$ is the indicator function. + +However, this strategy results in the inconsistency between training and decoding, where the ground truth is unavailable during decoding. To address this issue, Qian et al. (2021) adaptively determine the replacement ratio depending on the current prediction accuracy. But it does not work for CTC-NAST, as shown in Appendix B.3. + +Considering the long input sequence in ST, a lower ratio may not provide sufficient prompt, but a higher ratio may result in a severe gap between training and decoding. Therefore, we limit that only the positions where a wrong prediction (arg max $p_t \neq \hat{\pi}_t$ ) occurs are replaced. In this way, we enable the large ratio throughout the whole training process. As the accuracy increases, more and + +
ModelDeEsFrItNlPtRoRuJaAvg.Speed-up
MTTransformer (Ours)30.835.643.331.635.837.930.120.016.533.1-
ARTransformer (Inaguma et al., 2021b)23.1-33.8--------
+ Seq-KD24.4-34.6--------
Transformer (Inaguma et al., 2021a)22.827.833.323.327.3------
+ Seq-KD24.328.934.524.228.4------
Conformer (Inaguma et al., 2021a)25.030.535.525.429.7------
+ Seq-KD26.331.036.425.930.6------
Fairseq ST (Wang et al., 2020a)22.727.232.922.727.328.121.915.3-24.8-
NeurST (Zhao et al., 2021)22.827.433.322.927.228.722.215.1-24.9-
XSTNet (Ye et al., 2021)25.529.636.025.530.031.325.116.9-27.5-
STEMM (Fang et al., 2022)25.630.336.125.630.131.024.317.1-27.5-
ConST (Ye et al., 2022)25.730.436.826.330.632.024.817.3-28.0-
\( M^3ST \) (Cheng et al., 2022)26.431.037.226.630.932.825.418.3-28.6-
CTC-Aug ST (Ours)26.931.538.127.431.933.425.818.716.129.21.0×
+ Seq-KD27.731.639.527.532.333.726.618.716.429.71.0×
NARCTC (Inaguma et al., 2021b)19.4-27.4-------20.84×
Orthros (Inaguma et al., 2021b)23.9-33.1-------2.39×
CTC (Inaguma et al., 2021a)24.129.034.624.328.5-----13.83×
Orthros - CTC (Inaguma et al., 2021a)25.330.436.225.429.9-----1.14×
Orthros - CMLM (Inaguma et al., 2021a)24.129.235.124.428.6-----2.73×
CTC-NAST (Ours)27.331.838.927.732.333.326.118.916.229.55.67×
+ +Table 1: BLEU scores on MuST-C corpora. The speed-up is calculated on the En-De corpus. + +more positions rely on the model's predictions, and the guidance to the fewer positions with errors always remains stable for better convergence. We call this method curriculum learning mixing (CLM). + +Finally, we smooth the ground truth to obtain a distribution similar to the CTC prediction, where the dominant probability is concentrated on the ground truth position, and the rest is evenly distributed among other tokens. + +# 3.5 Inference + +CTC-NAST is a fully parallel decoding model. The inference resembles the training process, except the CLM method is not used. We employ greedy decoding, where CTC picks the tokens with maximum probability in each time-step, then removes the blanks and repeated tokens for final translation. + +# 4 Extension on AR model + +Now a natural question arises: can our method proposed for the NAR model be used to improve the AR model? Our method produces better encoder representations for CTC prediction, but there is no evidence to demonstrate that the optimization of the CTC and the cross-entropy in the decoder are completely consistent. Excessive optimization of the encoder may interfere with the learning of the decoder. + +To answer it, we adopt these techniques to the + +encoder-decoder counterpart (called CTC-Aug ST), to investigate the effects of different architectures. And the training loss is formulated as: + +$$ +\begin{array}{l} \mathcal {L} = \mathcal {L} _ {\mathrm {S 2 S}} + \alpha_ {\mathrm {A}} \cdot \mathcal {L} _ {\mathrm {C T C}} + \alpha_ {\mathrm {T}} \cdot \mathcal {L} _ {\mathrm {X C T C}} \\ + \quad \beta_ {\mathrm {A}} \cdot \frac {1}{M} \sum_ {m = 1} ^ {m} \mathcal {L} _ {\text {I n t e r C T C}} ^ {m} \\ + \beta_ {\mathrm {T}} \cdot \frac {1}{N} \sum_ {n = 1} ^ {N} \mathcal {L} _ {\text {I n t e r X C T C}} ^ {n} \tag {17} \\ \end{array} +$$ + +where $\mathcal{L}_{\mathrm{S2S}}$ is the cross-entropy loss of the decoder. + +# 5 Experiments + +We evaluate our method on the MuST-C and FisherCallhome benchmarks. Details about the datasets and model settings are described in Appendix A. + +# 5.1 Main Results + +The results on the MuST-C corpora in Table 1 show that our method significantly outperforms previous AR and NAR models. We achieve remarkable gains for all language pairs. Here we highlight several major breakthroughs: i) CTC-Aug ST is shown to be effective for the AR models, which gains an average of 0.6 BLEU points over the previous best work even without the augmentation of sequence-level knowledge distillation (Seq-KD) data. Note that not all proposed methods are used in CTC-Aug ST (see Section 5.2.2). ii) Our CTC-NAST + +
ModelFisherCallhomeSpeed-up
devdev2testdevtestevltest
MTTransformer (Ours)64.5065.2063.3532.2131.58-
ARTransformer + Seq-KD (Inaguma et al., 2021b)--50.32-19.81-
Transformer + Seq-KD (Inaguma et al., 2021a)51.1051.4050.8019.6019.20-
Conformer + Seq-KD (Inaguma et al., 2021a)54.7055.4054.1021.5021.00-
Transformer + MTL + ASR init. (Chuang et al., 2021)48.2749.1748.4017.2617.45-
CTC-Aug ST (Ours)53.6154.0753.6922.1621.331.0×
+ Seq-KD55.3955.8855.0923.0922.921.0×
NARCTC (Inaguma et al., 2021b)--45.97-15.9120.84×
Conformer - CTC (Inaguma et al., 2021a)51.0051.6050.8018.0018.7011.80×
Orthros - CTC (Inaguma et al., 2021a)54.0054.8054.1021.0020.801.09×
Orthros - CMLM (Inaguma et al., 2021a)51.3052.2051.2020.9020.402.70×
Transformer - CTC (Chuang et al., 2021)42.6143.9143.5013.0213.5228.9×
CTC + MTL (Chuang et al., 2021)44.4545.2344.9214.2014.1928.9×
Mask - CTC (Higuchi et al., 2021a)51.1051.7050.6017.9018.30-
Intermediate CTC (Higuchi et al., 2021a)51.3051.4051.0019.0019.00-
Self-conditioned CTC (Higuchi et al., 2021a)50.7051.2050.5019.1019.20-
CTC-NAST (Ours)55.2155.9254.7123.4323.304.10×
+ +Table 2: BLEU scores on Fisher-Callhome corpus. + +models achieve comparable or better performance to the powerful AR counterparts on all 9 language pairs, with a high speed-up of $5.67 \times$ . Note that CTC-NAST achieves a higher speed-up under large batch sizes (see Section 5.2.4). iii) Referring to Appendix B.1, the En-Ja translation has a strong demand for reordering capability. Our method also works well on this challenging distant language pair, demonstrating the potential of CTC-NAST. + +Similar results on Fisher-Callhome are shown in Table 2. Interestingly, the NAST model outperforms the AR counterpart with $0.3 \sim 0.4$ BLEU points on the out-of-domain Callhome sets. We find that the AR models miss some segments when translating the long sentences, while the CTC-NAST models still guarantee good performance, as shown in Appendix B.2. It demonstrates the robustness of our CTC-NAST model. + +# 5.2 Analysis + +Next, we study several interesting problems on MuST-C En-De and En-Ja datasets to investigate the effects on similar and distant languages. We present further analyses in Appendix B. + +# 5.2.1 Performance over Sentence Lengths + +Figure 2 shows the results of the AR and NAR models with and without the proposed methods on the MuST-C En-De corpus with respect to output lengths. The base NAR model performs much + +![](images/01fa86646927d6d071cb54134c36c2d9cf93a8b756442dc3d809386572f918b0.jpg) +Figure 2: BLEU scores over various output lengths. + +worse than AR counterpart. But interestingly, unlike the ST model, which has an outlier as sentence length increases, the NAST model maintains stable performance. This is similar to the results on Fisher-Callhome in Appendix B.2. + +Our methods bring remarkable gains over different lengths for both AR and NAR models, leading to comparable translation quality when the length is less than 60. In particular, CTC-NAST performs even better than AR models when the length is less than 30. However, the performance gap increases with sentence length. We speculate that very long input acoustic features make it more difficult to model semantic information. Future work (Xu et al., 2023) can focus on enhancing the ability to handle complex acoustic encoding. + +
ModelEn-DeEn-JaInferenceParams.
RawSeq-KDRawSeq-KDAR TimesNAR TimesSpeed-up
ARNARARNARARNARARNAR
Base26.1-27.1-15.9-16.1-547.2--~ 130M
+ XCTC26.717.327.024.316.37.316.313.7555.079.96.95×~ 130M
+ PAE26.919.627.725.716.18.516.414.9545.084.16.48×~ 140M
+ CLA26.819.127.326.216.610.016.415.3565.691.86.16×~ 150M
+ CLM26.625.727.527.414.414.316.616.1543.182.36.60×~ 140M
+ CLA + CLM27.025.827.627.313.614.516.216.2575.096.25.98×~ 150M
+ +# 5.2.2 Effects of Each Method + +We compare the results of each method on AR and NAR models in Table 3. More detailed ablation studies of CLA and CLM are presented in Appendix B.3. The base AR model is trained with auxiliary loss, where CTC on top of the acoustic encoder learns to predict the source text. Interestingly, there are different effects on different models, languages, and training data. All methods are lightweight in both computational cost and parameter quantity. + +Introducing the XCTC loss and PAE method achieves better performance in nearly all settings. CLA does not work well on the similar En-De language pair due to the less reordering requirement, but stable improvements on the distant En-Ja language pair. The remarkable results of CLM demonstrate that an adaptive training strategy is important for better convergence of NAR models (Qian et al., 2021). + +However, CLM leads to slightly worse or better results for AR models trained on Seq-KD data. We conclude that the optimization of XCTC loss in the encoder interferes with the learning of cross-entropy loss in the decoder. Although the XCTC achieves good performance, it does not contribute to the final inference in the encoder-decoder framework. In addition, the performance of the AR model trained on raw En-Ja data drops terribly. Raw data distribution is difficult to learn by CTC, especially for distant En-Ja language pair. In this case, the CLM always provides ground truth in a high ratio to mix, leading to overfitting on the training set and worse performance during inference. Therefore, we only use XCTC and PAE on AR models for stable improvements. + +We also notice that the simplified data distribution is crucial for achieving optimal performance with the NAST model. Specifically, the base NAR models, when trained on raw data, significantly un + +Table 3: The effects of our methods on AR and NAR models. + +
ModelEn-DeEn-Ja
subdelinssubdelins
ARBase31.812.212.544.619.316.9
+ XCTC-Aug31.412.012.543.919.615.9
NARBase32.014.410.742.822.812.8
+ PAE31.613.211.443.221.114.4
+ CLA31.412.911.743.620.314.8
+ CLM30.812.811.342.121.213.7
+ CLA + CLM30.912.811.442.121.214.0
+ +Table 4: Error analysis based on WERs that are split into substitution (sub), deletion (del), and insertion (ins) error rates. + +derperform models trained on Seq-KD data, with a gap of about 7 BLEU points. By combining proposed methods, we develop a powerful NAR model that narrows the gap to within 2 BLEU points. This result highlights the robustness of CTC-NAST, even in the presence of complex data distributions. + +# 5.2.3 Error Analysis + +To identify the weakness of NAR generation, we measure the word error rates (WERs) of AR and NAR models on the MuST-C En-De and En-Ja datasets2. For a token in the target text, the sub error indicates that it is incorrectly translated, and the del error indicates that it is omitted. The ins error indicates that the token not in the target text is translated. + +High del error rates show that the dominant disadvantage of the NAST model is missing translation. PAE relaxes the conditional independence assumption, giving better results for En-De but increased sub errors for En-Ja. We speculate that this is because poor CTC prediction introduces excessive errors. CLA is particularly effective at reducing del errors, which is consistent with our motivation to relax the monotonic assumption. And CLM reduces error propagation and improves the + +![](images/6e83b083a4ab8205b7d54db4079bf659cd9d2da16a1a2217377e4cd4c119768d.jpg) +Figure 3: Speed-up under different settings. + +robustness of PAE, achieving consistent improvements. + +However, the combination of our methods does not lead to a further reduction in del errors. A possible reason is that the inconsistent learning between CLA and CLM limits the effect of the combination. We will explore better methods to alleviate the missing translation in the future. + +# 5.2.4 Speed-up vs. Batch Size + +We examine the speed-up compared to AR models under different batch sizes and beam sizes in Figure 3. Our CTC-NAST model consistently maintains a high speed-up, even with a large batch size of 32. The performance of NAR and AR models is comparable when using a beam size of 1, while our NAR model is more than $5 \times$ faster. In addition, our encoder-only design simplifies the inference process, eliminating the need for length prediction or iterative refinement. One promising direction is to develop effective encoding methods that can bridge the length gap between acoustic features and text. This has the potential to reduce the computational cost caused by long sequence modeling. + +# 6 Conclusion + +Aiming to combine E2E ST and NAR generation, we propose CTC-NAST, which consists of only two CTC-guided encoders for source and target text prediction, respectively. We identify and address several challenges of CTC-NAST: conditional independence assumption, monotonic assumption, and poor convergence. In this way, our CTC-NAST model outperforms the previous best AR models by 0.9 BLEU points. We believe that we are the first to present a NAST model that achieves comparable or better performance than strong AR counterparts. + +# Limitations + +Although our CTC-NAST model achieves excellent performance, there are still some underlying challenges that remain in the follow-up of our work. Here are some limitations that we intend to resolve in the future: + +- The better designs of reordering augmentation and training strategy. Although the proposed CLA and CLM approaches achieve good results by alleviating the monotonic assumption and relieving the modeling burden, combing them can not bring remarkable improvement. More importantly, these two methods fail to stable improvements in encode-decoder architecture. This drives us to investigate the interference of the optimizations between CTC and cross-entropy. +- Combination with the pre-training or multitask learning. Although our methods bring remarkable gains on both AR and NAR models, we do not explore the utilization of external data resources. Although we can use the pre-trained models directly, we expect more effective methods in future work. Theoretically, we need to design NAR ASR and MT models that share the same or similar architectures with the acoustic encoder and textual encoder, respectively. In this way, the NAST model bridges the gap between pre-training and fine-tuning and has more potential for better performance. +- The potential risk for unwritten languages. In our work, we assume that transcription is always available, which is consistent with almost previous studies. Although some datasets have no transcription, we can use a well-trained ASR model to generate pseudo labels. However, it is hard to handle speech translation from unwritten source speech. The supervision of source text is very important for our model. Therefore, we need to develop better methods for stable training. + +# Acknowledgement + +The authors would like to thank anonymous reviewers for their insightful comments. This work was supported in part by the National Science Foundation of China (No. 62276056), the National Key + +R&D Program of China, the China HTRD Center Project (No. 2020AAA0107904), the Natural Science Foundation of Liaoning Province of China (2022-KF-16-01), the Yunnan Provincial Major Science and Technology Special Plan Projects (No. 202103AA080015), the Fundamental Research Funds for the Central Universities (Nos. N2216016, N2216001, and N2216002), and the Program of Introducing Talents of Discipline to Universities, Plan 111 (No. B16009). + +# References + +Antonios Anastasopoulos and David Chiang. 2018. Tied multitask learning for neural speech 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 82-91. Association for Computational Linguistics. +Yu Bao, Hao Zhou, Shujian Huang, Dongqi Wang, Lihua Qian, Xinyu Dai, Jiajun Chen, and Lei Li. 2022. *Latent-glat: Glancing at latent variables for parallel text generation*. In *Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics* (Volume 1: Long Papers), ACL 2022, Dublin, Ireland, May 22-27, 2022, pages 8398-8409. Association for Computational Linguistics. +Alexandre Berard, Olivier Pietquin, Christophe Servan, and Laurent Besacier. 2016. Listen and translate: A proof of concept for end-to-end speech-to-text translation. CoRR, abs/1612.01744. +William Chan, Chitwan Sahara, Geoffrey E. Hinton, Mohammad Norouzi, and Navdeep Jaitly. 2020. Imputer: Sequence modelling via imputation and dynamic programming. 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 1403-1413. PMLR. +Xuxin Cheng, Qianqian Dong, Fengpeng Yue, Tom Ko, Mingxuan Wang, and Yuexian Zou. 2022. M3ST: mix at three levels for speech translation. CoRR, abs/2212.03657. + +Shun-Po Chuang, Yung-Sung Chuang, Chih-Chiang Chang, and Hung-yi Lee. 2021. Investigating the reordering capability in ctc-based non-autoregressive end-to-end speech translation. In Findings of the Association for Computational Linguistics: ACL/IJCNLP 2021, Online Event, August 1-6, 2021, volume ACL/IJCNLP 2021 of Findings of ACL, pages 1068-1077. Association for Computational Linguistics. +Liang Ding, Longyue Wang, Xuebo Liu, Derek F. Wong, Dacheng Tao, and Zhaopeng Tu. 2021. Rejuvenating low-frequency words: Making the most of parallel data in non-autoregressive translation. 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 3431-3441. Association for Computational Linguistics. +Long Duong, Antonios Anastasopoulos, David Chiang, Steven Bird, and Trevor Cohn. 2016. An attentional model for speech translation without transcription. 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 949-959. The Association for Computational Linguistics. +Qingkai Fang, Rong Ye, Lei Li, Yang Feng, and Mingxuan Wang. 2022. STEMM: self-learning with speech-text manifold mixup for speech translation. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), ACL 2022, Dublin, Ireland, May 22-27, 2022, pages 7050-7062. Association for Computational Linguistics. +Mattia Antonino Di Gangi, Roldano Cattoni, Luisa Bentivogli, Matteo Negri, and Marco Turchi. 2019. Must-c: a multilingual speech translation corpus. 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 2012-2017. Association for Computational Linguistics. + +Marjan Ghazvininejad, Omer Levy, Yinhan Liu, and Luke Zettlemoyer. 2019. Mask-predict: Parallel decoding of conditional masked language 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 2019, Hong Kong, China, November 3-7, 2019, pages 6111-6120. Association for Computational Linguistics. +Alex Graves, Santiago Fernández, Faustino J. Gomez, and Jurgen Schmidhuber. 2006. Connectionist temporal classification: labelling unsegmented sequence data with recurrent neural networks. In Machine Learning, Proceedings of the Twenty-Third International Conference (ICML 2006), Pittsburgh, Pennsylvania, USA, June 25-29, 2006, volume 148 of ACM International Conference Proceeding Series, pages 369-376. ACM. +Jiatao Gu, James Bradbury, Caiming Xiong, Victor O. K. Li, and Richard Socher. 2018. Non-autoregressive neural machine translation. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net. +Jiatao Gu and Xiang Kong. 2021. Fully non-autoregressive neural machine translation: Tricks of the trade. In Findings of the Association for Computational Linguistics: ACL/IJCNLP 2021, Online Event, August 1-6, 2021, volume ACL/IJCNLP 2021 of Findings of ACL, pages 120-133. Association for Computational Linguistics. +Junliang Guo, Xu Tan, Di He, Tao Qin, Linli Xu, and Tie-Yan Liu. 2019. Non-autoregressive neural machine translation with enhanced decoder input. 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 3723-3730. AAAI Press. +Awni Hannun. 2017. Sequence modeling with ctc. Distill. https://distill.pub/2017/ctc. + +Yosuke Higuchi, Nanxin Chen, Yuya Fujita, Hirofumi Inaguma, Tatsuya Komatsu, Jaesong Lee, Jumon Nozaki, Tianzi Wang, and Shinji Watanabe. 2021a. A comparative study on non-autoregressive modelings for speech-to-text generation. In IEEE Automatic Speech Recognition and Understanding Workshop, ASRU 2021, Cartagena, Colombia, December 13-17, 2021, pages 47-54. IEEE. +Yosuke Higuchi, Hirofumi Inaguma, Shinji Watanabe, Tetsuji Ogawa, and Tetsunori Kobayashi. 2021b. Improved mask-ctc for non-autoregressive end-to-end asr. In ICASSP 2021 - 2021 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 8363-8367. +Yosuke Higuchi, Shinji Watanabe, Nanxin Chen, Tetsuji Ogawa, and Tetsunori Kobayashi. 2020. Mask CTC: Non-Autoregressive End-to-End ASR with CTC and Mask Predict. In Proc. Interspeech 2020, pages 3655-3659. +Chenyang Huang, Hao Zhou, Osmar R. Zaiane, Lili Mou, and Lei Li. 2022. Non-autoregressive translation with layer-wise prediction and deep supervision. In Thirty-Sixth AAAI Conference on Artificial Intelligence, AAAI 2022, Thirty-Fourth Conference on Innovative Applications of Artificial Intelligence, IAAI 2022, The Twelveth Symposium on Educational Advances in Artificial Intelligence, EAAI 2022 Virtual Event, February 22 - March 1, 2022, pages 10776-10784. AAAI Press. +Hirofumi Inaguma, Yosuke Higuchi, Kevin Duh, Tatsuya Kawahara, and Shinji Watanabe. 2021a. Non-autoregressive end-to-end speech translation with parallel autoregressive rescoring. CoRR, abs/2109.04411. +Hirofumi Inaguma, Yosuke Higuchi, Kevin Duh, Tatsuya Kawahara, and Shinji Watanabe. 2021b. ORTHROS: non-autoregressive end-to-end speech translation with dual-decoder. In IEEE International Conference on Acoustics, Speech and Signal Processing, ICASSP 2021, Toronto, ON, Canada, June 6-11, 2021, pages 7503-7507. IEEE. +Hirofumi Inaguma, Shun Kiyono, Kevin Duh, Shigeki Karita, Nelson Yalta, Tomoki Hayashi, + +and Shinji Watanabe. 2020. Espnet-st: All-in-one speech translation toolkit. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics: System Demonstrations, ACL 2020, Online, July 5-10, 2020, pages 302-311. Association for Computational Linguistics. +Shigeki Karita, Nelson Enrique Yalta Soplin, Shinji Watanabe, Marc Delcroix, Atsunori Ogawa, and Tomohiro Nakatani. 2019. Improving transformer-based end-to-end speech recognition with connectionist temporal classification and language model integration. In *Interspeech* 2019, 20th Annual Conference of the International Speech Communication Association, Graz, Austria, 15-19 September 2019, pages 1408-1412. ISCA. +Jungo Kasai, James Cross, Marjan Ghazvininejad, and Jiatao Gu. 2020. Non-autoregressive machine translation with disentangled context transformer. 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 5144-5155. PMLR. +Sehoon Kim, Amir Gholami, Albert E. Shaw, Nicholas Lee, Karttikeya Mangalam, Jitendra Malik, Michael W. Mahoney, and Kurt Keutzer. 2022. Squeezeformer: An efficient transformer for automatic speech recognition. CoRR, abs/2206.00888. +Yoon Kim and Alexander M. Rush. 2016. Sequence-level knowledge distillation. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, EMNLP 2016, Austin, Texas, USA, November 1-4, 2016, pages 1317-1327. The Association for Computational Linguistics. +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 ACL 2007, Proceedings of the 45th Annual Meeting of the Association for Computational Linguistics, June 23-30, 2007, Prague, Czech Republic. The Association for Computational Linguistics. + +Jaesong Lee and Shinji Watanabe. 2021. Intermediate loss regularization for ctc-based speech recognition. In IEEE International Conference on Acoustics, Speech and Signal Processing, ICASSP 2021, Toronto, ON, Canada, June 6-11, 2021, pages 6224-6228. IEEE. +Jason Lee, Elman Mansimov, and Kyunghyun Cho. 2018. Deterministic non-autoregressive neural sequence modeling by iterative refinement. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, Brussels, Belgium, October 31 - November 4, 2018, pages 1173-1182. Association for Computational Linguistics. +Jindrich Libovicky and Jindrich Helcl. 2018. End-to-end non-autoregressive neural machine translation with connectionist temporal classification. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, Brussels, Belgium, October 31 - November 4, 2018, pages 3016-3021. Association for Computational Linguistics. +Yuchen Liu, Junnan Zhu, Jiajun Zhang, and Chengqing Zong. 2020. Bridging the modality gap for speech-to-text translation. CoRR, abs/2010.14920. +Lambert Mathias and William Byrne. 2006. Statistical phrase-based speech translation. In 2006 IEEE International Conference on Acoustics Speech and Signal Processing, ICASSP 2006, Toulouse, France, May 14-19, 2006, pages 561-564. IEEE. +Hermann Ney. 1999. Speech translation: coupling of recognition and translation. In Proceedings of the 1999 IEEE International Conference on Acoustics, Speech, and Signal Processing, ICASSP '99, Phoenix, Arizona, USA, March 15-19, 1999, pages 517-520. IEEE Computer Society. +Jumon Nozaki and Tatsuya Komatsu. 2021. Relaxing the conditional independence assumption of ctc-based ASR by conditioning on intermediate predictions. In *Interspeech* 2021, 22nd Annual Conference of the International Speech Communication Association, Brno, Czechia, 30 August - 3 September 2021, pages 3735-3739. ISCA. +Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan Ng, David Grangier, + +and Michael Auli. 2019. *fairyseq: A fast, extensible toolkit for sequence modeling*. 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, Demonstrations, pages 48-53. 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, WMT 2018, Belgium, Brussels, October 31 - November 1, 2018, pages 186-191. Association for Computational Linguistics. +Matt Post, Gaurav Kumar, Adam Lopez, Damianos G. Karakos, Chris Callison-Burch, and Sanjeev Khudanpur. 2013. Improved speech-to-text translation with the fisher and callhome spanish- english speech translation corpus. In Proceedings of the 10th International Workshop on Spoken Language Translation: Papers, Heidelberg, Germany, December 5-6, 2013. +Lihua Qian, Hao Zhou, Yu Bao, Mingxuan Wang, Lin Qiu, Weinan Zhang, Yong Yu, and Lei Li. 2021. Glancing transformer for non-autoregressive 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, ACL/IJCNLP 2021, (Volume 1: Long Papers), Virtual Event, August 1-6, 2021, pages 1993-2003. Association for Computational Linguistics. +Qiu Ran, Yankai Lin, Peng Li, and Jie Zhou. 2020. Learning to recover from multi-modality errors for non-autoregressive neural machine translation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, ACL 2020, Online, July 5-10, 2020, pages 3059-3069. Association for Computational Linguistics. +Qiu Ran, Yankai Lin, Peng Li, and Jie Zhou. 2021. Guiding non-autoregressive neural machine translation decoding with reordering information. 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 13727-13735. AAAI Press. +Chitwan Sahara, William Chan, Saurabh Saxena, and Mohammad Norouzi. 2020. Nonautoregressive machine translation with latent alignments. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing, EMNLP 2020, Online, November 16-20, 2020, pages 1098-1108. Association for Computational Linguistics. +Raphael Shu, Jason Lee, Hideki Nakayama, and Kyunghyun Cho. 2020. Latent-variable non-autoregressive neural machine translation with deterministic inference using a delta posterior. 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 8846-8853. AAAI Press. +Jongyoon Song, Sungwon Kim, and Sungroh Yoon. 2021. Alignart: Non-autoregressive neural machine translation by jointly learning to estimate alignment and translate. 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 1-14. Association for Computational Linguistics. +Mitchell Stern, William Chan, Jamie Kiros, and Jakob Uszkoreit. 2019. Insertion transformer: Flexible sequence generation via insertion operations. 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 5976-5985. PMLR. +Changhan Wang, Yun Tang, Xutai Ma, Anne Wu, Dmytro Okhonko, and Juan Miguel Pino. 2020a. Fairseq S2T: fast speech-to-text modeling with fairseq. 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: System Demonstrations, AACL/IJCNLP 2020, Suzhou, China, December + +4-7, 2020, pages 33-39. Association for Computational Linguistics. +Chengyi Wang, Yu Wu, Shujie Liu, Zhenglu Yang, and Ming Zhou. 2020b. Bridging the gap between pre-training and fine-tuning for end-to-end speech 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 9161-9168. AAAI Press. +Chengyi Wang, Yu Wu, Shujie Liu, Ming Zhou, and Zhenglu Yang. 2020c. Curriculum pretraining for end-to-end speech translation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, ACL 2020, Online, July 5-10, 2020, pages 3728-3738. Association for Computational Linguistics. +Yiren Wang, Fei Tian, Di He, Tao Qin, ChengXiang Zhai, and Tie-Yan Liu. 2019. Nonautoregressive machine translation with auxiliary regularization. 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 5377-5384. AAAI Press. +Shinji Watanabe, Takaaki Hori, Suyoun Kim, John R. Hershey, and Tomoki Hayashi. 2017. Hybrid ctc/attention architecture for end-to-end speech recognition. IEEE J. Sel. Top. Signal Process., 11(8):1240-1253. +Ron J. Weiss, Jan Chorowski, Navdeep Jaitly, Yonghui Wu, and Zhifeng Chen. 2017. Sequence-to-sequence models can directly translate foreign speech. In *Interspeech* 2017, 18th Annual Conference of the International Speech Communication Association, Stockholm, Sweden, August 20-24, 2017, pages 2625-2629. ISCA. +Chen Xu, Bojie Hu, Yanyang Li, Yuhao Zhang, Shen Huang, Qi Ju, Tong Xiao, and Jingbo Zhu. 2021. Stacked acoustic-and-textual encoding: Integrating the pre-trained models into speech + +translation encoders. 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 2619-2630. Association for Computational Linguistics. +Chen Xu, Yuhao Zhang, Chengbo Jiao, Xiaoqian Liu, Chi Hu, Xin Zeng, Tong Xiao, Anxiang Ma, Huizhen Wang, and Jingbo Zhu. 2023. Bridging the granularity gap for acoustic modeling. In *Findings of the Association for Computational Linguistics: ACL* 2023. Association for Computational Linguistics. +Brian Yan, Siddharth Dalmia, Yosuke Higuchi, Graham Neubig, Florian Metze, Alan W. Black, and Shinji Watanabe. 2022. CTC alignments improve autoregressive translation. CoRR, abs/2210.05200. +Baosong Yang, Zhaopeng Tu, Derek F. Wong, Fan-dong Meng, Lidia S. Chao, and Tong Zhang. 2018. Modeling localness for self-attention networks. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, Brussels, Belgium, October 31 - November 4, 2018, pages 4449-4458. Association for Computational Linguistics. +Rong Ye, Mingxuan Wang, and Lei Li. 2021. End-to-end speech translation via cross-modal progressive training. In *Interspeech* 2021, 22nd Annual Conference of the International Speech Communication Association, Brno, Czechia, 30 August - 3 September 2021, pages 2267-2271. ISCA. +Rong Ye, Mingxuan Wang, and Lei Li. 2022. Cross-modal contrastive learning for speech translation. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL 2022, Seattle, WA, United States, July 10-15, 2022, pages 5099-5113. Association for Computational Linguistics. +Biao Zhang, Barry Haddow, and Rico Sennrich. 2022a. Revisiting end-to-end speech-to-text translation from scratch. CoRR, abs/2206.04571. + +Yuhao Zhang, Chen Xu, Bojie Hu, Chunliang Zhang, Tong Xiao, and Jingbo Zhu. 2022b. Improving end-to-end speech translation by leveraging auxiliary speech and text data. CoRR, abs/2212.01778. + +Chengqi Zhao, Mingxuan Wang, Qianqian Dong, Rong Ye, and Lei Li. 2021. Neurst: Neural speech translation toolkit. 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, ACL 2021 - System Demonstrations, Online, August 1-6, 2021, pages 55-62. Association for Computational Linguistics. + +Jiawei Zhou and Phillip Keung. 2020. Improving non-autoregressive neural machine translation with monolingual data. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, ACL 2020, Online, July 5-10, 2020, pages 1893-1898. Association for Computational Linguistics. + +# A Experimental Settings + +# A.1 Datasets and Preprocessing + +We conduct experiments on the MuST-C (Gangi et al., 2019) and Fisher-Callhome ST (Post et al., 2013) datasets. MuST-C is a multilingual speech translation corpus extracted from TED lectures. We test our method on all MuST-C v1 corpora: English (En) to German (De), Spanish (Es), French (Fr), Italian (It), Dutch (Nl), Portuguese (Pt), Romanian (Ro) and Russian (Ru). In addition, we also investigate the results of the distant language pair English-Japanese (En-Ja) corpus in the MuST-C v2 dataset. We select (and tune) the model on the dev set (Dev) and report the results on the tst-COMMON set (Test). + +Fisher-Callhome is a Spanish-English speech-to-text translation dataset with 138k text pairs. This corpus contains 170 hours of Spanish conversational telephone speech, as well as Spanish transcripts and English translations. Following the recipe of ESPnet (Inaguma et al., 2020), we lowercase all texts, and remove all punctuation marks except apostrophes. We select (and tune) the model on the Fisher-dev set, and report the results on the Fisher-{dev, dev2, test} and Callhome-{devtest, eviltest} sets. + +Following the preprocessing recipes in the fairseq toolkit3, we remove utterances with more than 3,000 frames or less than 5 frames. We extract the 80-channel Mel filter bank features by a window size of 25ms with a stride of 10ms. The text is tokenized using the scripts of Moses (Koehn et al., 2007) except that the Japanese text uses MeCab4. We learn SentencePiece5 segmentation with a size of 10,000 for MuST-C datasets. We use a shared vocabulary for the source and target languages for MuST-C v1 corpora, the independent vocabulary for the En-Ja corpus. And we use a shared vocabulary with a size of 1, 000 for Fisher-Callhome datasets. + +# A.2 Model Settings + +We implement our method based on the fairseq toolkit (Ott et al., 2019). We use the Adam optimizer with $\beta_{1} = 0.9, \beta_{2} = 0.98$ , and adopt the default learning schedule in fairseq. We apply dropout with a rate of 0.15 and label smoothing of 0.1 for regularization. + +Following previous studies on NAR models, our model is trained by sequence-level knowledge distillation (Seq-KD) (Kim and Rush, 2016) data generated by a small MT model with a beam size of 5. Our NAST model consists of an acoustic encoder with 12 Conformer layers and a textual encoder with 12 Transformer layers. Each layer comprises 512 hidden units, 8 attention heads, and 2048 feedforward sizes. We use PAE in layers 6 and 9 in both the acoustic encoder and the textual encoder. In multitask learning, the weights of $\alpha_{A}$ , $\alpha_{T}$ , $\beta_{A}$ and $\beta_{T}$ are all set to 1. We start the cross-layer attention from layer 4 in the textual encoder and take the representation output from layer 3 as the key and value. The ratio for curriculum learning mixing is set to 0.8. + +We extend our method to the encoder-decoder model with similar settings, where the textual encoder has 6 Transformer layers and the decoder has 6 layers. In this way, we control the model parameters to about $150\mathrm{M}$ for fair comparisons. The weights of $\alpha_{A}$ and $\alpha_{T}$ are set to 0.2, and the weights of $\beta_{A}$ and $\beta_{T}$ are to 0.1. We use PAE in layer 4 in the textual encoder. We start the cross-layer attention from layer 3 and take the representation output from layer 2 as the key and value. + +
En-xxRawSeq-KD
De7.235.10
Es4.422.72
Fr5.512.80
It5.792.94
Nl6.184.16
Pt5.563.26
Ro5.222.95
Ru6.992.94
Ja14.0115.21
+ +During inference, we average the model parameters on the best 10 checkpoints based on the performance of the development set. We use beam search with a beam size of 5 for the AR model. The decoding speed is measured on the test set with a batch size of 1 on an Nvidia A100 80GB GPU. We run 5 times to calculate the average time. We report case-sensitive SacreBLEU (Post, 2018) on the MuST-C datasets and case-insensitive SacreBLEU on the Fisher-Callhome dataset for standardization comparison across papers. + +# B More Analysis + +# B.1 Reordering Difficulty + +Following the metric in Chuang et al. (2021), we measure the reordering difficulties $\mathrm{R}_{\pi}$ on 9 language pairs of MuST-C datasets in Table 5. The higher the value of $\mathrm{R}_{\pi}$ , the higher the reordering difficulty between texts from two languages, indicating the high demand for improved reordering capability. The Seq-KD technique reduces the reordering difficulty by simplifying the data distribution, except for En-Ja. The reason is that noisy data leads to poor MT performance on the En-Ja dataset. On this distant language pair, our CTC-NAST model still achieves a high BLEU score of 16.2, which is comparable to the AR model with a small gap of only 0.2 BLEU points. + +# B.2 Results on Out-of-domain Data + +We also measure the BLEU scores of AR and NAR models under different output lengths on the Callhome sets in Figure 4. Note that Callhome sets are out-of-domain because we only use the Fisher set for training. Here, BLEU scores of the NAR model are better than those of the AR model in most cases of output length. In particular, when the output length is greater than 50, the performance of the AR model drops sharply, while the performance of + +![](images/98976b3f0c841ed62b0ad381fc474a0af2a2ed09e7022e89b216f710f689d8f1.jpg) +Figure 4: BLEU scores over various output lengths of Callhome sets. + +Table 5: Reordering difficulty of MuST-C datasets. + +
ModelEn-DeEn-Ja
devtestdevtest
Base23.724.310.513.7
+ PAE24.825.712.414.9
+ CLA25.125.812.115.3
+ drop 0.125.426.212.715.3
+ drop 0.225.225.512.315.6
+ +Table 6: Ablation study of the CLA module. + +
ModelEn-DeEn-Ja
0.50.80.50.8
Base24.324.313.713.7
+ PAE25.725.714.914.9
+ Mixing26.726.615.615.7
+ Adaptive26.226.315.215.4
+ Only error26.727.115.815.9
+ Smooth26.726.615.815.6
+ Only error + Smooth26.827.416.016.1
+ +Table 7: Ablation study of the CLM method under different mixing ratios and strategies. + +the NAR model keeps stable. This demonstrates that our CTC-NAST has better robustness. + +# B.3 Ablation Studies + +To further verify the effectiveness of our proposed methods, we construct a series of ablation studies on MuST-C En-De and En-Ja datasets. + +Effects of CLA Table 6 shows the results of the CLA module. CLA improves the reordering capability and complements the self-attention module. However, using the CLA module naively brings only modest improvements. We randomly drop the self-attention module with a probability of 0.1, which provides better regularization and robust improvements. Note that the high drop probability may lead to insufficient training of the self-attention module. These results demonstrate the + +![](images/b8a593829a96ca027903860ed896217edda3f5f2f13505af83251071b1e8dbca.jpg) +Figure 5: BLEU scores of base mixing and our CLM method. + +effectiveness of the CLA module and drop-net technique. + +Effects of CLM As shown in Table 7, the straightforward mixed training has produces remarkable gains with a ratio of 0.5 or 0.8 on both En-De and En-Ja datasets. The adaptive strategy in NAR MT does not work in CTC-NAST. This is because the sequence length of the input acoustic feature is very lengthy, and the decreased mixing ratio cannot provide enough cues to facilitate training. For stable training, we only replace positions where wrong predictions arise. In this manner, accurate positions solely rely on self-prediction, guaranteeing consistency between training and decoding. Furthermore, we generate a smooth distribution akin to CTC prediction, in which the ground truth token has a high probability of 0.9, and the probabilities of other tokens sum to 0.1. The combination of these two approaches results in additional and stable improvements. + +We also calculate BLEU scores with various mixing ratios in Figure 5. Our CLM approach is superior to the naive mixing method, particularly at a high ratio. In this case, our approach incorporates more revisions solely for incorrect predictions, which facilitates the training process and guarantees consistency. + +A For every submission: + +A1. Did you describe the limitations of your work? + +Section 7. + +A2. Did you discuss any potential risks of your work? + +We propose a method for non-autoregressive speech translation, which does not have any risks. + +A3. Do the abstract and introduction summarize the paper's main claims? + +Section 1. + +A4. Have you used AI writing assistants when working on this paper? + +Left blank. + +B Did you use or create scientific artifacts? + +Section 5 and Appendix A. + +B1. Did you cite the creators of artifacts you used? + +Section 5 and Appendix A. + +B2. Did you discuss the license or terms for use and / or distribution of any artifacts? + +Fairseq is an open-sourced toolkit under MIT license. We implement our method based on it. + +B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? + +Section 5 and Appendix A. + +B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? + +We use open datasets and cite the related papers. + +B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? + +Appendix A. + +B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. + +Appendix A. + +C Did you run computational experiments? + +Section 5 and Appendix A. + +C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? + +Appendix A.2. + +The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance. + +C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? No response. + +C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? Section 5 and Appendix B. + +C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? Appendix A.2. + +D Did you use human annotators (e.g., crowdworkers) or research with human participants? Left blank. + +D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? No response. +D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)? No response. +D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? No response. +D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? No response. +D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? No response. \ No newline at end of file diff --git a/ctcbasednonautoregressivespeechtranslation/images.zip b/ctcbasednonautoregressivespeechtranslation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..9ffb85ff6d6394fd352dca6e8d82f5af1697d022 --- /dev/null +++ b/ctcbasednonautoregressivespeechtranslation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ada005a81cf4b23d76d0289616e5611af1204a34df67e04f863710687a415da9 +size 706320 diff --git a/ctcbasednonautoregressivespeechtranslation/layout.json b/ctcbasednonautoregressivespeechtranslation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..bca19b487576bcdc2e0e19912a09123654f0a792 --- /dev/null +++ b/ctcbasednonautoregressivespeechtranslation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:985bc8ae19c50f9a76fb8a4262aed08f8c3f6596fba9bce117f70cb55e583e96 +size 556320