Add Batch c7086fd8-5ba9-4de6-848d-27ddd1a6ae2b
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- adaptivehingebalancelossfordocumentlevelrelationextraction/d189742b-16ed-4606-862c-4efc88102933_content_list.json +3 -0
- adaptivehingebalancelossfordocumentlevelrelationextraction/d189742b-16ed-4606-862c-4efc88102933_model.json +3 -0
- adaptivehingebalancelossfordocumentlevelrelationextraction/d189742b-16ed-4606-862c-4efc88102933_origin.pdf +3 -0
- adaptivehingebalancelossfordocumentlevelrelationextraction/full.md +349 -0
- adaptivehingebalancelossfordocumentlevelrelationextraction/images.zip +3 -0
- adaptivehingebalancelossfordocumentlevelrelationextraction/layout.json +3 -0
- adaptivestructureinductionforaspectbasedsentimentanalysiswithspectralperspective/0b97efc6-e9b4-4df6-98cf-04b95a6f5b7d_content_list.json +3 -0
- adaptivestructureinductionforaspectbasedsentimentanalysiswithspectralperspective/0b97efc6-e9b4-4df6-98cf-04b95a6f5b7d_model.json +3 -0
- adaptivestructureinductionforaspectbasedsentimentanalysiswithspectralperspective/0b97efc6-e9b4-4df6-98cf-04b95a6f5b7d_origin.pdf +3 -0
- adaptivestructureinductionforaspectbasedsentimentanalysiswithspectralperspective/full.md +380 -0
- adaptivestructureinductionforaspectbasedsentimentanalysiswithspectralperspective/images.zip +3 -0
- adaptivestructureinductionforaspectbasedsentimentanalysiswithspectralperspective/layout.json +3 -0
- adaptivetextuallabelnoiselearningbasedonpretrainedmodels/9f0c2540-5afe-4ebc-bba7-b9bd3f7df904_content_list.json +3 -0
- adaptivetextuallabelnoiselearningbasedonpretrainedmodels/9f0c2540-5afe-4ebc-bba7-b9bd3f7df904_model.json +3 -0
- adaptivetextuallabelnoiselearningbasedonpretrainedmodels/9f0c2540-5afe-4ebc-bba7-b9bd3f7df904_origin.pdf +3 -0
- adaptivetextuallabelnoiselearningbasedonpretrainedmodels/full.md +487 -0
- adaptivetextuallabelnoiselearningbasedonpretrainedmodels/images.zip +3 -0
- adaptivetextuallabelnoiselearningbasedonpretrainedmodels/layout.json +3 -0
- addressingthelengthbiaschallengeindocumentlevelneuralmachinetranslation/a2b10245-053b-4136-bc45-54d30b2d9e2b_content_list.json +3 -0
- addressingthelengthbiaschallengeindocumentlevelneuralmachinetranslation/a2b10245-053b-4136-bc45-54d30b2d9e2b_model.json +3 -0
- addressingthelengthbiaschallengeindocumentlevelneuralmachinetranslation/a2b10245-053b-4136-bc45-54d30b2d9e2b_origin.pdf +3 -0
- addressingthelengthbiaschallengeindocumentlevelneuralmachinetranslation/full.md +327 -0
- addressingthelengthbiaschallengeindocumentlevelneuralmachinetranslation/images.zip +3 -0
- addressingthelengthbiaschallengeindocumentlevelneuralmachinetranslation/layout.json +3 -0
- adversarialrobustnessforlargelanguagenermodelsusingdisentanglementandwordattributions/ab24a28f-fb84-40be-b259-dc23004f5776_content_list.json +3 -0
- adversarialrobustnessforlargelanguagenermodelsusingdisentanglementandwordattributions/ab24a28f-fb84-40be-b259-dc23004f5776_model.json +3 -0
- adversarialrobustnessforlargelanguagenermodelsusingdisentanglementandwordattributions/ab24a28f-fb84-40be-b259-dc23004f5776_origin.pdf +3 -0
- adversarialrobustnessforlargelanguagenermodelsusingdisentanglementandwordattributions/full.md +416 -0
- adversarialrobustnessforlargelanguagenermodelsusingdisentanglementandwordattributions/images.zip +3 -0
- adversarialrobustnessforlargelanguagenermodelsusingdisentanglementandwordattributions/layout.json +3 -0
- adversarialtextgenerationbysearchandlearning/e8a70fd2-8275-49e1-af3d-908d9b078cfa_content_list.json +3 -0
- adversarialtextgenerationbysearchandlearning/e8a70fd2-8275-49e1-af3d-908d9b078cfa_model.json +3 -0
- adversarialtextgenerationbysearchandlearning/e8a70fd2-8275-49e1-af3d-908d9b078cfa_origin.pdf +3 -0
- adversarialtextgenerationbysearchandlearning/full.md +498 -0
- adversarialtextgenerationbysearchandlearning/images.zip +3 -0
- adversarialtextgenerationbysearchandlearning/layout.json +3 -0
- affectiveanddynamicbeamsearchforstorygeneration/18838c77-e5cd-4522-b849-6082e3877843_content_list.json +3 -0
- affectiveanddynamicbeamsearchforstorygeneration/18838c77-e5cd-4522-b849-6082e3877843_model.json +3 -0
- affectiveanddynamicbeamsearchforstorygeneration/18838c77-e5cd-4522-b849-6082e3877843_origin.pdf +3 -0
- affectiveanddynamicbeamsearchforstorygeneration/full.md +421 -0
- affectiveanddynamicbeamsearchforstorygeneration/images.zip +3 -0
- affectiveanddynamicbeamsearchforstorygeneration/layout.json +3 -0
- afriqacrosslingualopenretrievalquestionansweringforafricanlanguages/e56b1448-07ee-43bd-9b89-296c60fbb8a9_content_list.json +3 -0
- afriqacrosslingualopenretrievalquestionansweringforafricanlanguages/e56b1448-07ee-43bd-9b89-296c60fbb8a9_model.json +3 -0
- afriqacrosslingualopenretrievalquestionansweringforafricanlanguages/e56b1448-07ee-43bd-9b89-296c60fbb8a9_origin.pdf +3 -0
- afriqacrosslingualopenretrievalquestionansweringforafricanlanguages/full.md +359 -0
- afriqacrosslingualopenretrievalquestionansweringforafricanlanguages/images.zip +3 -0
- afriqacrosslingualopenretrievalquestionansweringforafricanlanguages/layout.json +3 -0
- aksharantaropenindiclanguagetransliterationdatasetsandmodelsforthenextbillionusers/e3a17ac4-b4aa-4a86-9a48-e921d95b6312_content_list.json +3 -0
- aksharantaropenindiclanguagetransliterationdatasetsandmodelsforthenextbillionusers/e3a17ac4-b4aa-4a86-9a48-e921d95b6312_model.json +3 -0
adaptivehingebalancelossfordocumentlevelrelationextraction/d189742b-16ed-4606-862c-4efc88102933_content_list.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f8fea5216dddac3c1720ceeda79a3764cbcb22bb4a3353e82aaa0dc00d8dedad
|
| 3 |
+
size 62889
|
adaptivehingebalancelossfordocumentlevelrelationextraction/d189742b-16ed-4606-862c-4efc88102933_model.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4cf4cbdea06fb37435a38ed71ab789c94cfbaf0d1c4ef3ee192823bbe5cd924b
|
| 3 |
+
size 72565
|
adaptivehingebalancelossfordocumentlevelrelationextraction/d189742b-16ed-4606-862c-4efc88102933_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2eb82abf7567a80940383b98b35686673745ec66b0d85a6c30c428ed6b787f2b
|
| 3 |
+
size 2696932
|
adaptivehingebalancelossfordocumentlevelrelationextraction/full.md
ADDED
|
@@ -0,0 +1,349 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Adaptive Hinge Balance Loss for Document-Level Relation Extraction
|
| 2 |
+
|
| 3 |
+
Jize Wang $^{1}$ , Xinyi Le $^{1*}$ , Xiaodi Peng $^{2}$ and Caitian Chen $^{1}$
|
| 4 |
+
|
| 5 |
+
$^{1}$ Department of Automation, Shanghai Jiao Tong University
|
| 6 |
+
|
| 7 |
+
2Inspur Genersoft Co., Ltd.
|
| 8 |
+
|
| 9 |
+
{jizewang2000, lexinyi, cailianchen}@sjtu.edu.cn
|
| 10 |
+
|
| 11 |
+
pengxd@inspur.com
|
| 12 |
+
|
| 13 |
+
# Abstract
|
| 14 |
+
|
| 15 |
+
Document-Level Relation Extraction aims at predicting relations between entities from multiple sentences. A common practice is to select multi-label classification thresholds to decide whether a relation exists between an entity pair. However, in the document-level task, most entity pairs do not express any relations, resulting in a highly imbalanced distribution between positive and negative classes. We argue that the imbalance problem affects threshold selection and may lead to incorrect "no-relation" predictions. In this paper, we propose to downweight the easy negatives by utilizing a distance between the classification threshold and the predicted score of each relation. Our novel Adaptive Hinge Balance Loss measures the difficulty of each relation class with the distance, putting more focus on hard, misclassified relations, i.e. the minority positive relations. Experiment results on Re-DocRED demonstrate the superiority of our approach over other balancing methods. Source codes are available at https://github.com/Jize-W/HingeABL.
|
| 16 |
+
|
| 17 |
+
# 1 Introduction
|
| 18 |
+
|
| 19 |
+
Document-Level Relation Extraction (RE) plays an important role in NLP applications such as knowledge graph construction. It aims at predicting relations between entities from multiple sentences. As illustrated in Figure 1a, an entity pair may have zero, one, or multiple relations, so document-level RE is a multi-label classification task. To solve this, a common practice is to adaptively select thresholds for multi-label classification (Zhou et al., 2021). For a correct prediction, the confidence scores of existent relations should be higher than the threshold, and conversely, those of non-existent relations should be lower.
|
| 20 |
+
|
| 21 |
+
However, there is a significant imbalance problem between positive and negative classes in document-level RE. The number of entity pairs
|
| 22 |
+
|
| 23 |
+
Text: Ross Patterson Alger (August 20, 1920 - January 16, 1992) was a politician in the Canadian province of Alberta, ... After the war, he received an MBA from the University of Toronto. He settled in Calgary and started a career in accounting ...
|
| 24 |
+
|
| 25 |
+
Subject: University of Toronto
|
| 26 |
+
|
| 27 |
+
Object: Canadian
|
| 28 |
+
|
| 29 |
+
Relation: country, located in
|
| 30 |
+
|
| 31 |
+

|
| 32 |
+
(a) A sample document in Re-DocRED dataset.
|
| 33 |
+
|
| 34 |
+

|
| 35 |
+
(b) False negative prediction with correct label ranking.
|
| 36 |
+
(c) Correct prediction after utilizing adaptive hinge balance loss.
|
| 37 |
+
|
| 38 |
+
Figure 1: Illustration on multi-label classification in document-level relation extraction. (a) There are two relations existing between University of Toronto and Canadian. (b) The entity pair in (a) is incorrectly predicted as "no-relation". Scores of existent relations (country, located in) are lower than the threshold (11.16), but significantly higher than all non-existent relations. (c) After utilizing adaptive hinge balance loss, the threshold is reduced to an appropriate value.
|
| 39 |
+
|
| 40 |
+
increases quadratically with the number of entities. Thus, compared with the sentence-level counterpart, there are far more entity pairs to be classified in document-level RE, and most entity pairs express no relation. For example, in the document-level RE dataset, Re-DocRED (Tan et al., 2022b), $94\%$ of the entity pairs express no relation.
|
| 41 |
+
|
| 42 |
+
The issue of class imbalance may lead to more incorrect "no-relation" predictions. In our paper, we mainly consider the "positive/negative imbalance", rather than the imbalance between different
|
| 43 |
+
|
| 44 |
+
types of "positive relations". The positive/negative imbalance tends to drag the threshold towards the large class, that is, the "no-relation" class. We discover that $78.2\%$ of incorrect "no-relation" predictions have correct label ranking, but the confidence score is lower than the threshold, which is shown in Figure 1b. In other words, the model has enough confidence in the existent relations, but it makes a "no-relation" prediction due to the unnecessarily high threshold.
|
| 45 |
+
|
| 46 |
+
Based on this intuitive finding, we aim to address this "incorrect predictions with correct label ranking" phenomenon to improve the accuracy. We believe that overtraining on well-classified non-existent relations may lead to unnecessarily high thresholds. Therefore, we propose to adaptively select thresholds, and then down-weight the relations that are far from the decision boundary using Hinge Weighting. Our contributions are three-fold:
|
| 47 |
+
|
| 48 |
+
- We design a general pipeline termed Separate Adaptive Thresholding, to adaptively select thresholds for multi-label classification.
|
| 49 |
+
- We propose a novel Adaptive Hinge Balance Loss, tackling the imbalance problem of positive and negative classes in document-level RE.
|
| 50 |
+
- Among all the existing balancing methods, our method achieves the highest F1 score on the common dataset Re-DocRED.
|
| 51 |
+
|
| 52 |
+
# 2 Preliminary
|
| 53 |
+
|
| 54 |
+
The task of document-level relation extraction is concerned with the prediction of relation types between subject and object entities in a given document. We will first introduce the formulation of this task, and then discuss the commonly used ATL method.
|
| 55 |
+
|
| 56 |
+
# 2.1 Problem Formulation
|
| 57 |
+
|
| 58 |
+
Given a document $D$ that contains a set of entities $\{e_i\}_{i=1}^n$ , the task of document-level relation extraction is to predict the relation types between the entity pairs $(e_s, e_o)_{s,o \in \{1,\dots,n\}, s \neq o}$ , where $e_s$ and $e_o$ represent the subject entity and the object entity, respectively. The set of relations is defined as $\mathcal{R} \cup \{\mathrm{NA}\}$ , where $\mathcal{R}$ is a set of pre-defined relations and NA stands for no relation between a pair of entities.
|
| 59 |
+
|
| 60 |
+
With the document $D$ and an entity pair $(e_s, e_o)$ contained in it, we can get the representation of the
|
| 61 |
+
|
| 62 |
+
subject and object entity through:
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
[ \mathbf {z} _ {s}, \mathbf {z} _ {o} ] = R e p (D, e _ {s}, e _ {o}), \tag {1}
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
where $\mathbf{z}_s$ and $\mathbf{z}_o$ are the representation of the subject and object entity. Rep is a representation module.
|
| 69 |
+
|
| 70 |
+
The score of relation $r$ is defined as $s_r$ , which can be computed via the subject and object entity representation using a bilinear classifier:
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\mathbf {s} _ {r} = \mathbf {z} _ {s} ^ {T} \mathbf {W} _ {r} \mathbf {z} _ {o} + b _ {r}, \tag {2}
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
where $\mathbf{W}_r\in \mathbb{R}^{d\times d}$ , $b_{r}\in \mathbb{R}$ are model parameters.
|
| 77 |
+
|
| 78 |
+
# 2.2 Adaptive Thresholding Loss
|
| 79 |
+
|
| 80 |
+
Adaptive Thresholding Loss (ATL) (Zhou et al., 2021) is the most widely used loss function in transformer-based document-level relation extraction methods. It enables the model to choose multi-label classification thresholds, thereby achieving superior results when compared to the global threshold of BCE loss (Bengio et al., 2013).
|
| 81 |
+
|
| 82 |
+
In ATL, the labels of entity pair $T = (e_s, e_o)$ are divided into two subsets: positive classes $\mathcal{P}_T$ and negative classes $\mathcal{N}_T$ , where $\mathcal{P}_T \subseteq \mathcal{R}$ denotes the relations that exist between $T$ , and $\mathcal{N}_T \subseteq \mathcal{R}$ denotes the relations that do not exist between the entities. ATL introduces an additional threshold class TH. If an entity pair is correctly classified, the scores of $\mathcal{P}_T$ should be higher than TH while those of $\mathcal{N}_T$ should be lower. ATL comprises of two parts:
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\mathcal {L} _ {1} = - \sum_ {r \in \mathcal {P} _ {T}} \log \left(\frac {\exp \left(s _ {r}\right)}{\sum_ {r ^ {\prime} \in \mathcal {P} _ {T} \cup \{\mathrm {T H} \}} \exp \left(s _ {r ^ {\prime}}\right)}\right), \tag {3}
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\mathcal {L} _ {2} = - \log \left(\frac {\exp \left(s _ {\mathrm {T H}}\right)}{\sum_ {r ^ {\prime} \in \mathcal {N} _ {T} \cup \{\mathrm {T H} \}} \exp \left(s _ {r ^ {\prime}}\right)}\right), \tag {4}
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
\mathcal {L} _ {A T L} = \mathcal {L} _ {1} + \mathcal {L} _ {2}. \tag {5}
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
# 2.3 An Empirical Analysis of ATL
|
| 97 |
+
|
| 98 |
+
A preliminary analysis is conducted to investigate the cause of classification error in ATL, as shown in Table 1. All false predictions can be categorized into three patterns: FP, FN_CRK, and FN_IRK, which are illustrated in Figure 2. In particular, FN_CRK is the most dominant source of errors, which accounts for $78.2\%$ of all false negative predictions.
|
| 99 |
+
|
| 100 |
+
We notice that the number of relations in $\mathcal{N}_T$ is significantly larger than that in $\mathcal{P}_T$ , and therefore
|
| 101 |
+
|
| 102 |
+
<table><tr><td># FP</td><td># FN_CRK</td><td># FN_IRK</td></tr><tr><td>2859</td><td>3192</td><td>889</td></tr></table>
|
| 103 |
+
|
| 104 |
+
Table 1: Number of three false patterns of ATL's predictions on Re-DocRED. Three patterns are illustrated in Figure 2.
|
| 105 |
+
|
| 106 |
+
$\mathcal{L}_2$ has a much greater impact on the overall loss than $\mathcal{L}_1$ (see equations (3) and (4)). Due to the dominance of $\mathcal{L}_2$ , it can be rewritten as the following form:
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\mathcal {L} _ {2} = - \log \left(\frac {1}{1 + \sum_ {r ^ {\prime} \in \mathcal {N} _ {T}} \exp \left(s _ {r ^ {\prime}} - s _ {\mathrm {T H}}\right)}\right). \tag {6}
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
$\mathcal{L}_2 \to 0$ when $s_{r'} - s_{\mathrm{TH}} \to -\infty$ , which means $s_{\mathrm{TH}} \gg s_{r'}$ . This suggests ATL learns a threshold $s_{\mathrm{TH}}$ well above the candidate score, which leads to an increase in the number of FN_CRK predictions.
|
| 113 |
+
|
| 114 |
+
# 3 Adaptive Hinge Balance Loss
|
| 115 |
+
|
| 116 |
+
Based on the analysis above, we aim to maximize the distance between the decision boundary $s_{\mathrm{TH}}$ and the sample point $s_r$ , $r \in \mathcal{R}$ while simultaneously down-weighting the classes distant from the boundary. To this end, we propose our Adaptive Hinge Balance Loss.
|
| 117 |
+
|
| 118 |
+
# 3.1 Separate Adaptive Thresholding
|
| 119 |
+
|
| 120 |
+
An ideal loss should maximize the distance from the decision boundary to the sample point. Moreover, in the loss formulation, each relation class should be independent of the others to enable individual weighing of each class. Therefore, we propose the Separate Adaptive Thresholding (SAT), which is formulated as:
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
\mathcal {L} = - \sum_ {r \in \mathcal {R}} \log \left(\sigma \left(- d _ {r}\right)\right), \tag {7}
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
d _ {r} = \left\{ \begin{array}{l l} s _ {r} - s _ {\mathrm {T H}} & r \in \mathcal {P} _ {T} \\ s _ {\mathrm {T H}} - s _ {r} & r \in \mathcal {N} _ {T} \end{array} \right. \tag {8}
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
where $\sigma$ is the sigmoid function, i.e. $\sigma (x) = \frac{1}{1 + e^x}$ . We define $s_{\mathrm{TH}}$ as the decision boundary. Then $d_r$ is the distance from the decision boundary to the score of relation $r\in \mathcal{R}$ . $d_r > 0$ if a relation is correctly classified. $\mathcal{L}\to 0$ when $d_r\to \infty$
|
| 131 |
+
|
| 132 |
+
The loss pushes $d_r$ to be as large as possible. The score of each relation is compared with the threshold separately. Thus we can assign different weights to different relations.
|
| 133 |
+
|
| 134 |
+

|
| 135 |
+
|
| 136 |
+

|
| 137 |
+
Figure 2: Three false prediction patterns. (a) FP (False Positive): The entity pair is recognized as related, but not all relations are accurately recognized. (b) FN_CRK (False Negative with Correct label RanKing): The entity pair is recognized as "no-relation", and all the existent relations have higher confidence scores than non-existent relations. (c) FN_IRK (False Negative with Incorrect label RanKing): The entity pair is recognized as "no-relation", and not all existent relations have higher confidence scores than non-existent relations.
|
| 138 |
+
|
| 139 |
+

|
| 140 |
+
Figure 3: Hinge weighting.
|
| 141 |
+
Figure 4: The decision boundary and margin of hinge weighting. Positive relations whose scores are higher than $s_{\mathrm{TH}} + m$ and negative relations whose scores are lower than $s_{\mathrm{TH}} - m$ will not be punished.
|
| 142 |
+
|
| 143 |
+
# 3.2 Hinge Weighting
|
| 144 |
+
|
| 145 |
+
To down-weight the easy and well-classified relations, i.e. the majority negative relations, we propose Hinge Weighting inspired by hinge loss. (Hearst et al., 1998)
|
| 146 |
+
|
| 147 |
+
Our Hinge Weighting is shown in Figure 3. It is formulated as:
|
| 148 |
+
|
| 149 |
+
$$
|
| 150 |
+
w _ {r} = \max (0, m - d _ {r}), r \in \mathcal {R}, \tag {9}
|
| 151 |
+
$$
|
| 152 |
+
|
| 153 |
+
where $m$ is a constant. When the distance $d_r$ is larger than $m$ , the relation is not penalized. Otherwise, it is penalized linearly with $d_r$ . Essentially, Hinge Weighting implies that we should avoid focusing on the relationship with large $d_r$ . $2m$ is the maximum margin between positive and negative classes, which is illustrated in Figure 4.
|
| 154 |
+
|
| 155 |
+
Note that our weighting mechanism downweights the well classified samples to zero. Since
|
| 156 |
+
|
| 157 |
+
<table><tr><td>Model</td><td>F1</td><td>F1 with HingeABL</td><td>Ign_F1</td><td>Ign_F1 with HingeABL</td></tr><tr><td>ATLOP (Zhou et al., 2021)</td><td>77.56</td><td>79.79 (+2.23)</td><td>76.82</td><td>78.82 (+2.00)</td></tr><tr><td>DocuNet (Zhang et al., 2021)</td><td>77.87</td><td>79.43 (+1.56)</td><td>77.26</td><td>78.39 (+1.13)</td></tr><tr><td>KD-DocRE (Tan et al., 2022a)</td><td>78.28</td><td>79.34 (+1.06)</td><td>77.60</td><td>78.26 (+0.66)</td></tr></table>
|
| 158 |
+
|
| 159 |
+
the majority of well classified classes are negative, HingeABL achieves the effect of down-weighting the majority negative relations.
|
| 160 |
+
|
| 161 |
+
# 3.3 Loss Definition
|
| 162 |
+
|
| 163 |
+
Combining separate adaptive thresholding and hinge weighting, we obtain the adaptive hinge balance loss (HingeABL):
|
| 164 |
+
|
| 165 |
+
$$
|
| 166 |
+
\mathcal {L} = - \sum_ {r \in \mathcal {R}} \frac {w _ {r}}{\sum_ {r ^ {\prime} \in \mathcal {R}} w _ {r ^ {\prime}}} \log \left(\sigma \left(- d _ {r}\right)\right), \tag {10}
|
| 167 |
+
$$
|
| 168 |
+
|
| 169 |
+
where $\sigma$ is the sigmoid function and $w_{r}$ is formulated as Equation (9). The hinge weights are normalized among all relations. Our adaptive hinge balance loss simultaneously maximizes the distance between the decision boundary and the sample point and down-weights easy classes that are far from it. This helps prevent over-fitting on well-classified relations.
|
| 170 |
+
|
| 171 |
+
# 4 Experiments
|
| 172 |
+
|
| 173 |
+
# 4.1 Setup
|
| 174 |
+
|
| 175 |
+
We conduct experiments on Re-DocRED (Tan et al., 2022b), the largest and well-labeled dataset for document-level RE. We use F1 and Ign_F1 as the metrics. Ign_F1 is measured by removing the relations existing in the training set from the dev/test sets. More details about statistics and implementation are provided in Appendix A and B. Note that we use micro F1 here in order to maintain consistency with previous methods. However, macro F1 is more suitable to illustrate whether the proposed method can perform better on minority classes. Results evaluated under macro F1 are provided in Appendix C.
|
| 176 |
+
|
| 177 |
+
# 4.2 Results
|
| 178 |
+
|
| 179 |
+
Different balancing methods. To compare different balancing methods, we use ATLOP (Zhou et al., 2021) as the representation module and $\mathrm{BERT}_{\mathrm{base}}$ (Devlin et al., 2019) as the encoder of it. We also compare our method with three other approaches: Balanced Softmax (Zhang et al., 2021), AML (Adaptive Margin Loss) (Wei and Li, 2022), and AFL (Adaptive Focal Loss) (Tan et al., 2022a).
|
| 180 |
+
|
| 181 |
+
Table 2: Performance of adaptive hinge balance loss with different backbones.
|
| 182 |
+
|
| 183 |
+
<table><tr><td>Loss Function</td><td>F1</td><td>Ign_F1</td></tr><tr><td>ATL (Zhou et al., 2021)</td><td>73.29</td><td>72.46</td></tr><tr><td>Balanced Softmax (Zhang et al., 2021)</td><td>73.68</td><td>72.85</td></tr><tr><td>AML (Wei and Li, 2022)</td><td>72.60</td><td>71.78</td></tr><tr><td>AFL (Tan et al., 2022a)</td><td>74.15</td><td>73.20</td></tr><tr><td>SAT</td><td>73.46</td><td>72.61</td></tr><tr><td>MeanSAT</td><td>74.68</td><td>72.90</td></tr><tr><td>HingeABL</td><td>75.15</td><td>73.84</td></tr></table>
|
| 184 |
+
|
| 185 |
+
Table 3: Comparison with other balancing methods.
|
| 186 |
+
|
| 187 |
+
Both AML and HingeABL are margin-based loss functions.
|
| 188 |
+
|
| 189 |
+
To illustrate the effectiveness of hinge weighting, we implement an alternative weighted loss called MeanSAT by weighting positive and negative classes of SAT by the inverse of their number. Its formulation is in Appendix D.
|
| 190 |
+
|
| 191 |
+
The results are shown in Table 3. HingeABL achieves the highest F1 and Ign_F1 of 75.15 and 73.84 among all balancing methods. We observe a substantial increase in performance by implementing two weighting methods on the SAT. Our experiments indicate that hinge weighting surpasses constant weighting with MeanSAT, which demonstrates the superiority of HingeABL.
|
| 192 |
+
|
| 193 |
+
Besides, we compare the two margin-based loss functions, AML and HingeABL, through mathematical analysis, provided in Appendix E. We find that AML penalizes the misclassified samples linearly with the distance, while HingeABL penalizes the misclassified samples nonlinearly with the distance. The nonlinear function is strictly convex, which benefits optimization.
|
| 194 |
+
|
| 195 |
+
Different document-level RE models. To test the generality of our approach, we select three commonly used transformer-based methods for document-level relation extraction and replace their loss functions with our adaptive hinge balance loss. Among the three original base methods, ATLOP employs ATL loss, DocuNet employs Balanced Softmax loss, and KD-DocRE employs AFL loss. Both Balanced Softmax and AFL are the improvements of ATL. All methods use RoBERTaLarge (Zhuang et al., 2021) as their encoder. Table 2 shows the results, all of which demonstrate consis
|
| 196 |
+
|
| 197 |
+
<table><tr><td>Loss Function</td><td>F/(T+F)</td><td>FN/F</td><td>FN_CRK /FN</td></tr><tr><td>ATL</td><td>3.59%</td><td>58.80%</td><td>78.22%</td></tr><tr><td>Balanced Softmax</td><td>4.84%</td><td>51.16%</td><td>79.95%</td></tr><tr><td>AML</td><td>3.54%</td><td>65.30%</td><td>57.14%</td></tr><tr><td>AFL</td><td>3.59%</td><td>52.95%</td><td>75.98%</td></tr><tr><td>HingeABL</td><td>3.49%</td><td>51.11%</td><td>43.84%</td></tr></table>
|
| 198 |
+
|
| 199 |
+
Table 4: Statistics of prediction patterns for different loss functions.
|
| 200 |
+
|
| 201 |
+
tent performance gains with the use of HingeABL. This affirms the generalizability of our approach. Note that HingeABL's improvement seems to be less significant when the base method is more powerful. This is a natural result because better base methods employ better loss functions. Replacing a better loss function with HingeABL results in a smaller improvement.
|
| 202 |
+
|
| 203 |
+
Prediction statistics. To verify whether our model solves the problem of high thresholds, we count the number of prediction patterns from Figure 2 and present the results in Table 4. Our analysis reveals that the proportion of FN and FN_CRK has decreased, indicating that the issue has been resolved. An example of prediction results before and after applying HingeABL is shown in Figure 1b and 1c. While one might assume that lowering the threshold would lead to more false positive predictions, we observe that the total proportion of false predictions actually decreases. This suggests that HingeABL achieves a good balance in its threshold selection.
|
| 204 |
+
|
| 205 |
+
# 5 Conclusion
|
| 206 |
+
|
| 207 |
+
We propose a novel Adaptive Hinge Balance Loss for document-level relation extraction to tackle the imbalance problem of positive and negative classes. Experimental results show our approach outperforms existing methods. Since our loss is model-independent, it has potential applicability to other multi-label classification scenarios.
|
| 208 |
+
|
| 209 |
+
# Limitations
|
| 210 |
+
|
| 211 |
+
Compared with classifying an entity pair known with relation, accurately determining whether a relation exists between an entity pair is a more challenging task. Despite attempts to improve accuracy through better thresholding methods, the results are still far from ideal.
|
| 212 |
+
|
| 213 |
+
# Acknowledgements
|
| 214 |
+
|
| 215 |
+
This work was supported by the National Key Research and Development Program of China (2021YFB1716000) and the National Natural Science Foundation of China (No.62176152).
|
| 216 |
+
|
| 217 |
+
# References
|
| 218 |
+
|
| 219 |
+
Yoshua Bengio, Aaron Courville, and Pascal Vincent. 2013. Representation learning: A review and new perspectives. IEEE transactions on pattern analysis and machine intelligence, 35(8):1798-1828.
|
| 220 |
+
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.
|
| 221 |
+
Priya Goyal, Piotr Dálár, Ross Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, Andrew Tulloch, Yangqing Jia, and Kaiming He. 2017. Accurate, large minibatch sgd: Training imagenet in 1 hour. arXiv preprint arXiv:1706.02677.
|
| 222 |
+
Marti A. Hearst, Susan T Dumais, Edgar Osuna, John Platt, and Bernhard Scholkopf. 1998. Support vector machines. IEEE Intelligent Systems and their applications, 13(4):18-28.
|
| 223 |
+
Quzhe Huang, Shibo Hao, Yuan Ye, Shengqi Zhu, Yansong Feng, and Dongyan Zhao. 2022. Does recommend-revise produce reliable annotations? an analysis on missing instances in DocRED. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 6241-6252, Dublin, Ireland. Association for Computational Linguistics.
|
| 224 |
+
Ilya Loshchilov and Frank Hutter. 2019. Decoupled weight decay regularization. *ICLR*.
|
| 225 |
+
Paulius Micikevicius, Sharan Narang, Jonah Alben, Gregory Diamos, Erich Elsen, David Garcia, Boris Ginsburg, Michael Houston, Oleksii Kuchaiev, Ganesh Venkatesh, et al. 2018. Mixed precision training. ICLR.
|
| 226 |
+
Qingyu Tan, Ruidan He, Lidong Bing, and Hwee Tou Ng. 2022a. Document-level relation extraction with adaptive focal loss and knowledge distillation. In Findings of the Association for Computational Linguistics: ACL 2022, pages 1672-1681, Dublin, Ireland. Association for Computational Linguistics.
|
| 227 |
+
Qingyu Tan, Lu Xu, Lidong Bing, Hwee Tou Ng, and Sharifah Mahani Aljunied. 2022b. Revisiting docred-addressing the false negative problem in relation extraction. In Proceedings of the 2022 Conference on
|
| 228 |
+
|
| 229 |
+
Empirical Methods in Natural Language Processing, pages 8472-8487.
|
| 230 |
+
|
| 231 |
+
Ying Wei and Qi Li. 2022. Sagdre: Sequence-aware graph-based document-level relation extraction with adaptive margin loss. In Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, KDD '22, page 2000-2008, New York, NY, USA. Association for Computing Machinery.
|
| 232 |
+
|
| 233 |
+
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.
|
| 234 |
+
|
| 235 |
+
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.
|
| 236 |
+
|
| 237 |
+
Ningyu Zhang, Xiang Chen, Xin Xie, Shumin Deng, Chuanqi Tan, Mosha Chen, Fei Huang, Luo Si, Hua-jun Chen, and Hangzhou Innovation Center. 2021. Document-level relation extraction as semantic segmentation.
|
| 238 |
+
|
| 239 |
+
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.
|
| 240 |
+
|
| 241 |
+
Liu Zhuang, Lin Wayne, Shi Ya, and Zhao Jun. 2021. A robustly optimized BERT pre-training approach with post-training. In Proceedings of the 20th Chinese National Conference on Computational Linguistics, pages 1218-1227, Huhhot, China. Chinese Information Processing Society of China.
|
| 242 |
+
|
| 243 |
+
# A Re-DocRED Statistics
|
| 244 |
+
|
| 245 |
+
Re-DocRED is a more reliable benchmark in document-level relation extraction. It is a revised version of DocRED (Yao et al., 2019), whose annotations are pointed out to be incomplete by recent works ((Huang et al., 2022; Tan et al., 2022a)). RedocRED contains 96 relations. Each document has an average of 391 entity pairs, among which $94\%$ contains no relation. The detailed statistics are shown in Table 5 and Table 6.
|
| 246 |
+
|
| 247 |
+
<table><tr><td># Relations</td><td>96</td></tr><tr><td>Avg. # Words</td><td>198.4</td></tr><tr><td>Avg. # Entities</td><td>19.4</td></tr><tr><td>Avg. # Entity Pairs</td><td>391.0</td></tr><tr><td>NA</td><td>94%</td></tr></table>
|
| 248 |
+
|
| 249 |
+
Table 5: Statistics on the whole set of Re-DocRED.
|
| 250 |
+
|
| 251 |
+
<table><tr><td></td><td>Train</td><td>Dev</td><td>Test</td></tr><tr><td># Documents</td><td>3053</td><td>500</td><td>500</td></tr><tr><td>Avg. # Entities</td><td>19.4</td><td>19.4</td><td>19.6</td></tr><tr><td>Avg. # Triples</td><td>28.1</td><td>34.6</td><td>34.9</td></tr><tr><td>Avg. # Sentences</td><td>7.9</td><td>8.2</td><td>7.9</td></tr></table>
|
| 252 |
+
|
| 253 |
+
Table 6: Statistics on different train/dev/test dataset of Re-DocRED.
|
| 254 |
+
|
| 255 |
+
# B Implementation Details
|
| 256 |
+
|
| 257 |
+
All experiments are implemented based on Hugging Face's Transformers (Wolf et al., 2020). In the experiment of comparing different balancing methods, we use $\mathrm{BERT}_{\mathrm{base}}$ (Devlin et al., 2019) as the encoder of ATLOP. In the experiment of comparing different RE models, we use RoBERTa large (Devlin et al., 2019) as the encoder of these RE models, for the sake of comparison on the benchmark.
|
| 258 |
+
|
| 259 |
+
We select the margin of HingeABL as $m = 5$ when conducting experiments. We use mixed-precision training (Micikevicius et al., 2018) based on the PyTorch amp library<sup>1</sup>. The models are optimized with AdamW (Loshchilov and Hutter, 2019) with a linear warmup (Goyal et al., 2017) for the first $6\%$ steps followed by a linear decay to 0. The learning rate is 5e-5 for models with BERT as the encoder and 3e-5 for models with RoBERTa as the encoder. The train batch size is 4 and the test batch size is 8. We train 30 epochs for each model. For each experiment, we run 5 different seeds (1, 5, 42, 66, 233) and report the average score. All models are trained with 1 Tesla A800 GPU.
|
| 260 |
+
|
| 261 |
+
# C Comparison results under macro F1
|
| 262 |
+
|
| 263 |
+
The comparison results among different balancing methods under macro F1 and macro Ign_F1 are shown in Table 7. Our proposed HingeABL still achieves the highest score under macro F1.
|
| 264 |
+
|
| 265 |
+
# D Formulation of MeanSAT
|
| 266 |
+
|
| 267 |
+
MeanSAT weights positive and negative classes of SAT by the inverse of their number. It is formulated
|
| 268 |
+
|
| 269 |
+
<table><tr><td>Loss Function</td><td>F1</td><td>Ign_F1</td></tr><tr><td>ATL (Zhou et al., 2021)</td><td>59.39</td><td>56.57</td></tr><tr><td>Balanced Softmax (Zhang et al., 2021)</td><td>60.67</td><td>57.89</td></tr><tr><td>AML (Wei and Li, 2022)</td><td>58.65</td><td>55.81</td></tr><tr><td>AFL (Tan et al., 2022a)</td><td>61.48</td><td>58.66</td></tr><tr><td>SAT</td><td>60.23</td><td>57.41</td></tr><tr><td>MeanSAT</td><td>63.34</td><td>60.91</td></tr><tr><td>HingeABL</td><td>64.13</td><td>61.34</td></tr></table>
|
| 270 |
+
|
| 271 |
+
Table 7: Comparison with other balancing methods under macro F1 and macro Ign_F1.
|
| 272 |
+
|
| 273 |
+
as:
|
| 274 |
+
|
| 275 |
+
$$
|
| 276 |
+
\mathcal {L} = - \frac {1}{N _ {p}} \sum_ {r \in \mathcal {P}} \log \left(\sigma \left(- d _ {r}\right)\right) - \frac {1}{N _ {n}} \sum_ {r \in \mathcal {N}} \log \left(\sigma \left(- d _ {r}\right)\right), \tag {11}
|
| 277 |
+
$$
|
| 278 |
+
|
| 279 |
+
where $N_{p}$ and $N_{n}$ are the number of positive and negative classes for the entity pair.
|
| 280 |
+
|
| 281 |
+
# E Mathematical analysis of Adaptive Margin Loss and HingeABL
|
| 282 |
+
|
| 283 |
+
In addition to experiments, we also compare the two margin-based losses, Adaptive Margin Loss (AML) and HingeABL, from a mathematical analysis perspective.
|
| 284 |
+
|
| 285 |
+
Analysis 1: For a sample that is not well classified, the Adaptive Margin Loss is a linear function with respect to the distance.
|
| 286 |
+
|
| 287 |
+
The Adaptive Margin Loss is defined as:
|
| 288 |
+
|
| 289 |
+
$$
|
| 290 |
+
\mathcal {L} = \sum_ {r \in \mathcal {R}} \max (0, m - d _ {r}). \tag {12}
|
| 291 |
+
$$
|
| 292 |
+
|
| 293 |
+
For class $r$ , $\mathcal{L}_r = \max (0,m - d_r)$ .
|
| 294 |
+
|
| 295 |
+
For a well-classified sample, $d_r \geq m$ , $\mathcal{L}_r = 0$ .
|
| 296 |
+
|
| 297 |
+
For a sample that is not well classified, $d_r < m$ , $\mathcal{L}_r = m - d_r$ .
|
| 298 |
+
|
| 299 |
+
In the second condition, we denote $c_{r} = -d_{r} > -m$ . It measures the distance between a sample that is not well classified to the decision boundary. Note that we call $c_{r}$ "distance" here, but it is not necessarily greater than zero. The smaller $c_{r}$ is, the better the sample is classified. This means we should give a larger punishment to a larger $c_{r}$ . Then we have:
|
| 300 |
+
|
| 301 |
+
$$
|
| 302 |
+
\mathcal {L} _ {r} = m + c _ {r}, \tag {13}
|
| 303 |
+
$$
|
| 304 |
+
|
| 305 |
+
$$
|
| 306 |
+
\frac {\partial \mathcal {L} _ {r}}{\partial c _ {r}} = 1. \tag {14}
|
| 307 |
+
$$
|
| 308 |
+
|
| 309 |
+
This means Adaptive Margin Loss penalizes the samples that are not well classified linearly with
|
| 310 |
+
|
| 311 |
+
the distance. (Note: A sample that is not well classified means $c_{r} = -d_{r} > -m$ . A sample that is misclassified means $c_{r} = -d_{r} > 0$ .)
|
| 312 |
+
|
| 313 |
+
Analysis 2: For a sample that is not well classified, HingeABL is a strictly convex function with respect to the distance.
|
| 314 |
+
|
| 315 |
+
HingeABL is defined as:
|
| 316 |
+
|
| 317 |
+
$$
|
| 318 |
+
\begin{array}{l} \mathcal {L} = - \sum_ {r \in \mathcal {R}} \frac {w _ {r}}{\sum_ {r ^ {\prime} \in \mathcal {R}} w _ {r ^ {\prime}}} \log \left(\sigma \left(- d _ {r}\right)\right) (15) \\ = - \sum_ {r \in \mathcal {R}} \frac {\max \left(0 , m - d _ {r}\right)}{\sum_ {r ^ {\prime} \in \mathcal {R}} \max \left(0 , m - d _ {r ^ {\prime}}\right)} \log \left(\frac {1}{1 + e ^ {- d _ {r}}}\right). (16) \\ \end{array}
|
| 319 |
+
$$
|
| 320 |
+
|
| 321 |
+
The denominator $\sum_{r' \in \mathcal{R}} \max(0, m - d_{r'})$ is a normalization factor, which we discard for ease of analysis.
|
| 322 |
+
|
| 323 |
+
For class $r$ , if a sample is well classified, $d_r \geq m$ , $\mathcal{L}_r = 0$ .
|
| 324 |
+
|
| 325 |
+
If a sample is not well classified, $d_r < m$
|
| 326 |
+
|
| 327 |
+
$$
|
| 328 |
+
\begin{array}{l} \mathcal {L} _ {r} = - \left(m - d _ {r}\right) \log \left(\frac {1}{1 + e ^ {- d _ {r}}}\right) (17) \\ = - \left(m + c _ {r}\right) \log \left(\frac {1}{1 + e ^ {c _ {r}}}\right), (18) \\ \end{array}
|
| 329 |
+
$$
|
| 330 |
+
|
| 331 |
+
$$
|
| 332 |
+
\frac {\partial \mathcal {L} _ {r}}{\partial c _ {r}} = - \log \left(\frac {1}{1 + e ^ {c _ {r}}}\right) + \frac {m + c _ {r}}{e ^ {- c _ {r}} + 1}, \tag {19}
|
| 333 |
+
$$
|
| 334 |
+
|
| 335 |
+
$$
|
| 336 |
+
\frac {\partial^ {2} \mathcal {L} _ {r}}{\partial c _ {r} ^ {2}} = \frac {e ^ {c _ {r}}}{1 + e ^ {c _ {r}}} + \frac {e ^ {- c _ {r}} + 1 + e ^ {- c _ {r}} (m + c _ {r})}{(e ^ {- c _ {r}} + 1) ^ {2}} > 0. \tag {20}
|
| 337 |
+
$$
|
| 338 |
+
|
| 339 |
+
This means HingeABL penalizes the samples that are not well classified nonlinearly with the distance. The nonlinear function is strictly convex.
|
| 340 |
+
|
| 341 |
+
Analysis 3: Comparison between the Adaptive Margin Loss and HingeABL.
|
| 342 |
+
|
| 343 |
+
# 1. Similarities.
|
| 344 |
+
|
| 345 |
+
Both the Adaptive Margin Loss and HingeABL are margin-based loss functions. They do not punish a prediction if it is correct and "good enough" (rather than "perfect"), which is a form of regularization to prevent overfitting.
|
| 346 |
+
|
| 347 |
+
# 2. Differences.
|
| 348 |
+
|
| 349 |
+
For the wrong prediction part, they both give a penalty according to the distance $c_{r}$ . The Adaptive Margin Loss gives a linear penalty, while HingeABL gives a strictly convex penalty. Compared to a linear penalty, a strictly convex penalty has mainly two advantages: 1. When $c_{r}$ is larger, HingeABL gives a larger penalty than the Adaptive Margin Loss. 2. Compared to linear functions, the nature of strictly convex functions makes the optimization more stable and more likely to converge to a globally optimal solution.
|
adaptivehingebalancelossfordocumentlevelrelationextraction/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a136a2be3f35e2e2c3bfd1250cd82a3b56f374ba4aba32a4d9a7e5e9f41efc96
|
| 3 |
+
size 352802
|
adaptivehingebalancelossfordocumentlevelrelationextraction/layout.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3b770583f378571a798b68fbb93db99401bed866d15db7ab8ebc2982f4f19b94
|
| 3 |
+
size 323758
|
adaptivestructureinductionforaspectbasedsentimentanalysiswithspectralperspective/0b97efc6-e9b4-4df6-98cf-04b95a6f5b7d_content_list.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1f10b00a542481775970f38a227575de07fd5bdddb0a97358c389528e4fcb75b
|
| 3 |
+
size 100583
|
adaptivestructureinductionforaspectbasedsentimentanalysiswithspectralperspective/0b97efc6-e9b4-4df6-98cf-04b95a6f5b7d_model.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2660223e1627a6f9d04fcb8c94eaa0a451073306d1aebd9fc197b3866be8447b
|
| 3 |
+
size 117570
|
adaptivestructureinductionforaspectbasedsentimentanalysiswithspectralperspective/0b97efc6-e9b4-4df6-98cf-04b95a6f5b7d_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b5b6e0177414da2e0f1e480a74904e0d44cb60d4fa68d10ea8836391298f4c54
|
| 3 |
+
size 480989
|
adaptivestructureinductionforaspectbasedsentimentanalysiswithspectralperspective/full.md
ADDED
|
@@ -0,0 +1,380 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Adaptive Structure Induction for Aspect-based Sentiment Analysis with Spectral Perspective
|
| 2 |
+
|
| 3 |
+
Hao Niu, Yun Xiong*, Xiaosu Wang, Wenjing Yu, Yao Zhang, Zhonglei Guo
|
| 4 |
+
|
| 5 |
+
Shanghai Key Laboratory of Data Science, School of Computer Science, Fudan University {hniu18, yunx, xswang19, yaozhang, guozl18}@fudan.edu.cn {wjyu21}@m.fudan.edu.cn
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Recently, incorporating structure information (e.g. dependency syntactic tree) can enhance the performance of aspect-based sentiment analysis (ABSA). However, this structure information is obtained from off-the-shelf parsers, which is often sub-optimal and cumbersome. Thus, automatically learning adaptive structures is conducive to solving this problem. In this work, we concentrate on structure induction from pre-trained language models (PLMs) and throw the structure induction into a spectrum perspective to explore the impact of scale information in language representation on structure induction ability. Concretely, the main architecture of our model is composed of commonly used PLMs (e.g., RoBERTa, etc.), and a simple yet effective graph structure learning (GSL) module (graph learner + GNNs). Subsequently, we plug in Frequency Filters with different bands after the PLMs to produce filtered language representations and feed them into the GSL module to induce latent structures. We conduct extensive experiments on three public benchmarks for ABSA. The results and further analyses demonstrate that introducing this spectral approach can shorten Aspects-sentiment Distance (AsD) and be beneficial to structure induction. Even based on such a simple framework, the effects on three datasets can reach SOTA (state-of-the-art) or near SOTA performance. Additionally, our exploration also has the potential to be generalized to other tasks or to bring inspiration to other similar domains.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Aspect-based sentiment analysis (ABSA) is designed to do fine-grained sentiment analysis for different aspects of a given sentence (Vo and Zhang, 2015; Dong et al., 2014). Specifically, one or more aspects are present in a sentence, and aspects may express different sentiment polarities. The purpose
|
| 14 |
+
|
| 15 |
+
of the task is to detect the sentiment polarities (i.e., POSITIVE, NEGATIVE, NEUTRAL) of all given aspects. Given the sentence "The decor is not a special at all but their amazing food makes up for it" and corresponding aspects "decor" and "food", the sentiment polarity towards "decor" is NEGATIVE, whereas the sentiment for "food" is POSITIVE.
|
| 16 |
+
|
| 17 |
+
Early works (Vo and Zhang, 2015; Kiritchenko et al., 2014; Schouten and Frasincar, 2016) to deal with ABSA mainly relied on manually designing syntactic features, which is cumbersome and ineffective as well. Subsequently, various neural network-based models (Kiritchenko et al., 2014; Vo and Zhang, 2015; Chen et al., 2017; Zhang et al., 2019b; Wang et al., 2020; Trusca et al., 2020) have been proposed to deal with ABSA tasks, to get rid of hand-crafted feature design. In these studies, syntactic structures proved effective, helping to connect aspects to the corresponding opinion words, thereby enhancing the effectiveness of the ABSA task (Zhang et al., 2019b; Tian et al., 2021; Veyseh et al., 2020; Huang and Carley, 2019; Sun et al., 2019; Wang et al., 2020). Additionally, some research (Chen et al., 2020a; Dai et al., 2021; Zhou et al., 2021; Chen et al., 2022; Brauwers and Frasincar, 2023) suggests there should exist task-specific induced latent structures because dependency syntactic structures (following that, we refer to them as external structures for convenience) generated by off-the-shelf dependency parsers are static and sub-optimal in ABSA. The syntactic structure is not specially designed to capture the interactions between aspects and opinion words.
|
| 18 |
+
|
| 19 |
+
Consequently, we classify these structure-based ABSA models into three categories by summarizing prior research: (1.) external structure, (2.) semi-induced structure, and (3.) full-induced structure. Works based on external structures use dependency syntactic structures generated by dependency parsers or modified dependency syntactic structures to provide structural support for ABSA (Zhang
|
| 20 |
+
|
| 21 |
+
et al., 2019b; Sun et al., 2019; Wang et al., 2020). Studies based on semi-induced structures leverage both external and induced structures, merging them to offer structural support for ABSA (Chen et al., 2020a). The first two categories require the introduction of external structures, which increases the complexity of preprocessing, while the third category directly eliminates this burdensomeness.
|
| 22 |
+
|
| 23 |
+
Our research is based on full-induced structures. Works in this field intend to totally eliminate the reliance on external structures to aid ABSA by employing pre-trained language models (PLMs) to induce task-specific latent structures (Dai et al., 2021; Zhou et al., 2021; Chen et al., 2022). These efforts, however, aim to create a tree-based structure, then convert it into a graph structure and feed it to Graph Neural Networks (GNNs) to capture structural information. Our research follows this line of thought, but directly from the perspective of the graph, utilizing PLMs to induce a graph structure for GNNs. In addition, studies (Tamkin et al., 2020) have shown that contextual representation contains information about context tokens as well as a wide range of linguistic phenomena, including constituent labels, relationships between entities, dependencies, coreference, etc. That is, there are various scales of information (spanning from the (sub)word itself to its containing phrase, clause, sentence, paragraph, etc.) in the contextual representation. This contextual representational characteristic has rarely been explored in previous studies. Therefore, our research investigates the influence of manipulations at informational scales of contextual representation on structure induction with spectral perspective.
|
| 24 |
+
|
| 25 |
+
Specifically, we employ graph structure learning (GSL) based on metric learning (Zhu et al., 2021) to induce latent structures from PLMs. We investigate three commonly used metric functions (Attention-based (Attn.), Kernel-based (Knl.), and Cosine-based (Cosine)) and contrast their effects on the structure of induced graphs. Furthermore, we heuristically explore four types of Frequency Filters with corresponding band allocations (HIGH, MID-HIGH, MID-LOW, LOW) acting on contextual representations, and in this way, we can segregate the representations of different scales at the level of individual neurons. Additionally, we introduce an automatic frequency selector (AFS) to circumvent the cumbersome heuristic approaches. This allows us to investigate the impact of manipu
|
| 26 |
+
|
| 27 |
+
lations at scale information for structure induction in contextual representations.
|
| 28 |
+
|
| 29 |
+
We employ three commonly PLMs: BERT<sub>base</sub>, RoBERTa<sub>base</sub>, RoBERTa<sub>large</sub>. Our research is based on extensive experiments and yields some intriguing findings, which we summarize as follows:
|
| 30 |
+
|
| 31 |
+
Structure Induction. By comparing three GSL methods (Attention-based (Attn.), Kernel-based (Knl.), and Cosine-based (Cosine)), we find that the Attention-based method is the best for structure induction on ABSA.
|
| 32 |
+
|
| 33 |
+
Frequency Filter (FLT). Heuristic operations of information scales in the contextual representation by Frequency Filters are able to influence structure induction. Based on Attention-based GSL, the structure induction of FLT can obtain lower Aspects-sentiment Distance (AsD) and better performance.
|
| 34 |
+
|
| 35 |
+
Automatic Frequency Selector (AFS). Get rid of the tediousness of the heuristic method, AFS can consistently achieve better results than the Attention-based GSL method. This further demonstrates the effectiveness of manipulating scale information.
|
| 36 |
+
|
| 37 |
+
# 2 Related Work
|
| 38 |
+
|
| 39 |
+
# 2.1 Tree Induction for ABSA
|
| 40 |
+
|
| 41 |
+
In ABSA, there are a lot of works that aim to integrate dependency syntactic information into neural networks (Zhang et al., 2019b; Sun et al., 2019; Wang et al., 2020) to enhance the performance of ABSA. Despite the improvement of dependency tree integration, this is still not ideal since off-the-shelf dependency parsers are static, have parsing errors, and are suboptimal for a particular task. Hence, some effort is being directed toward dynamically learning task-specific tree structures for ABSA. For example, (Chen et al., 2020a) combines syntactic dependency trees and automatically induced latent graph structure by a gate mechanism. (Chen et al., 2022) propose to induce an aspect-specific latent tree structure by utilizing policy-based reinforcement learning. (Zhou et al., 2021) learn an aspect-specific tree structure from the perspective of closing the distance between aspect and opinion. (Dai et al., 2021) propose to induce tree structure from fine-tuned PLMs for ABSA. However, most of them fall to take the context representational characteristic into account.
|
| 42 |
+
|
| 43 |
+
# 2.2 Spectral Approach in NLP
|
| 44 |
+
|
| 45 |
+
In NLP, one line of spectral methods is used in the study of improving efficiency (Han et al., 2022; Zhang et al., 2018). For example, (Han et al., 2022) propose a new type of recurrent neural network with the help of the discrete Fourier transformer and gain faster training. In addition, a few works investigate contextual representation learning from the standpoint of spectral methods. (Kayal and Tsatsaronis, 2019) propose a method to construct sentence embeddings by exploiting a spectral decomposition method rooted in fluid dynamics. (Müller-Eberstein et al., 2022; Tamkin et al., 2020) propose using Frequency Filters to constrain different neurons to model structures at different scales. These bring new inspiration to the research of language representation.
|
| 46 |
+
|
| 47 |
+
# 2.3 Metric Learning based GSL
|
| 48 |
+
|
| 49 |
+
The metric learning approach is one of representative graph structure learning (GSL), where edge weights are derived from learning a metric function between pairwise representations (Zhu et al., 2021). According to metric functions, the metric learning approach can be categorized into two subgroups: Kernel-based and Attention-based. Kernel-based approaches utilize traditional kernel functions as the metric function to model edge weights (Li et al., 2018; Yu et al., 2020; Zhao et al., 2021b). Attention-based approaches usually utilize attention networks or more complicated neural networks to capture the interaction between pairwise representations (Velickovic et al., 2018; Jiang et al., 2019; Chen et al., 2020b; Zhao et al., 2021a). The Cosine-based method (Chen et al., 2020b) is generally a kind of Attention-based method. In our experiments, we take it out as a representative method.
|
| 50 |
+
|
| 51 |
+
# 3 Method
|
| 52 |
+
|
| 53 |
+
To obtain induced graph structure, we propose a spectral filter (FLT) approach to select scale information when adaptively learning graph structure. In this section, we introduce a simple but effective approach (FLT) to induce graph structures from PLMs to enhance the performance of ABSA. The overall architecture is displayed in Figure 1.
|
| 54 |
+
|
| 55 |
+
# 3.1 Overview
|
| 56 |
+
|
| 57 |
+
As shown in Figure 1, the overall architecture is composed of PLMs, Graph Learner, GNNs architecture, and Prediction Head under normal cir
|
| 58 |
+
|
| 59 |
+

|
| 60 |
+
Figure 1: The overall architecture of our method.
|
| 61 |
+
|
| 62 |
+
cumstances. For a given input sentence $S = \{w_{1}, w_{2}, \dots, w_{n}\}$ , we employ a type of PLMs to serve as the contextual encoder to obtain the hidden contextual representation $\mathbf{H} \in \mathbb{R}^{n \times d}$ of the input sentence $S$ , where $d$ is the dimension of word representations, and $n$ is the length of the given sentence. The contextual representation $\mathbf{H}$ is waited for inputting into GNNs architecture as node representations. Simultaneously, it is going to feed into Graph Learner to induce latent graph structures, which serve as adjacency matrices $\mathbf{A}$ for GNNs architecture. Then the GNNs architecture can extract aspect-specific features $\mathbf{h}_{a}$ utilizing both structural information from $\mathbf{A}$ and pre-trained knowledge information from $\mathbf{H}$ . Finally, we concatenate the representation of [CLS] token $\mathbf{h}_{cls}$ from PLMs as well as $\mathbf{h}_{a}$ , and send them into a Multi-layer Perception (MLP) (served as the Prediction Head) to detect the sentiment polarities (i.e., POSITIVE, NEGATIVE, NEUTRAL) for the given aspects.
|
| 63 |
+
|
| 64 |
+
Here, we investigate the effectiveness of three common graph structure learning (GSL) methods based on metric learning: Attention-based (Attn.), Kernel-based (Knl.), and Cosine-based (Cosine) (refer to (Zhu et al., 2021) for specific descriptions of Kernel-based and Cosine-based methods). We introduce the Attention-based GSL method to adaptively induce graph structures. Firstly, we calculate the unnormalized pair-wise edge score $e_{ij}$ for the $i$ -th and $j$ -th words utilizing the given representations $\mathbf{h}_i \in \mathbb{R}^d$ and $\mathbf{h}_j \in \mathbb{R}^d$ . Specifically, the pair-wise edge score $e_{ij}$ is calculated as follows:
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
e _ {i j} = \left(\mathbf {W} _ {i} \mathbf {h} _ {i}\right) \left(\mathbf {W} _ {j} \mathbf {h} _ {j}\right) ^ {\top}, \tag {1}
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
where $\mathbf{W}_i, \mathbf{W}_j \in \mathbb{R}^{d \times d_h}$ are learnable weights for $i$ -th and $j$ -th word representations, where $d_h$ is the hidden dimension.
|
| 71 |
+
|
| 72 |
+
Then, relying on these pair-wise scores $e_{ij}$ for all word pairs, we construct the adjacency matrices $\mathbf{A}$ for induced graph structures. Concretely,
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\mathbf {A} _ {i j} = \left\{ \begin{array}{c c} 1 & \text {i f} \quad i = j \\ \frac {\exp \left(e _ {i j}\right)}{\sum_ {k = 1} ^ {n} \exp \left(e _ {i k}\right)} & \text {o t h e r w i s e} \end{array} , \right. \tag {2}
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
where the adaptive adjacency matrix is $\mathbf{A} \in \mathbb{R}^{n \times n}$ , and $\mathbf{A}_{ij}$ is the weight score of the edge between the $i$ -th and $j$ -th words.
|
| 79 |
+
|
| 80 |
+
For simplicity, we employ Vallina Graph Neural Networks (GCNs) (Kipf and Welling, 2017) served as GNNs architecture (other variants of graph neural networks can also be employed here). Given the word representations $\mathbf{H}$ and the adaptive adjacency matrix $\mathbf{A}$ , we can construct an induced graph structure consisting of words (each word acts as a node in the graph) and feed it into GCNs. Specifically,
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\mathbf {h} _ {i} ^ {l} = \sigma \left(\sum_ {j = 1} ^ {n} \mathbf {A} _ {i j} \mathbf {W} ^ {l} \mathbf {h} _ {j} ^ {l - 1} + \mathbf {b} ^ {l}\right), \tag {3}
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
where $\sigma$ is an activation function (e.g. ReLU), $\mathbf{W}^l$ and $\mathbf{b}^l$ are the learnable weight and bias term of the $l$ -th GCN layer. By stacking several layers of Graph Learner and GNNs architectures, we can obtain structure information enhanced word representations $\mathbf{H}_g$ for the downstream task. It should be noted that the induced graph structure is dynamically updated while training.
|
| 87 |
+
|
| 88 |
+
After we get aspect representations $\mathbf{h}_a$ from $\mathbf{H}_g$ , we feed them along with the pooler output $\mathbf{h}_{cls}$ of PLMs (the output representation of [CLS] token) into a task-specific Prediction Head to acquire results for the downstream task.
|
| 89 |
+
|
| 90 |
+
# 3.2 Frequency Filter (FLT)
|
| 91 |
+
|
| 92 |
+
Furthermore, inspired by (Tamkin et al., 2020), we introduce a spectral analysis approach to enhance the structure induction ability of the Graph Learner. Intuitively, we tend to import a Frequency Filter on contextual word representations to manipulate on scale information, and then feed them into the Graph Learner module to improve the structure induction capability. Contextual representations have been investigated to not only convey the meaning of words in context (Peters et al., 2018), but also carry a large range of linguistic information such
|
| 93 |
+
|
| 94 |
+
Table 1: Statistics of datasets.
|
| 95 |
+
|
| 96 |
+
<table><tr><td rowspan="2">Dataset</td><td colspan="2">Positive</td><td colspan="2">Neutral</td><td colspan="2">Negative</td></tr><tr><td>Train</td><td>Test</td><td>Train</td><td>Test</td><td>Train</td><td>Test</td></tr><tr><td>Rest14</td><td>2164</td><td>728</td><td>807</td><td>196</td><td>637</td><td>196</td></tr><tr><td>Laptop14</td><td>994</td><td>341</td><td>870</td><td>128</td><td>464</td><td>169</td></tr><tr><td>Twitter</td><td>1561</td><td>173</td><td>3127</td><td>346</td><td>1560</td><td>173</td></tr></table>
|
| 97 |
+
|
| 98 |
+
as semantic roles, coreference, and constituent labels, etc. (Tenney et al., 2019). Prism (Tamkin et al., 2020) demonstrates these word representations contain multi-scale information ranging from (sub)word to phrase, clause, sentence, and so forth. Hence in this work, we explore the impact of structure induction ability by operating on scale-specific information of contextual representations.
|
| 99 |
+
|
| 100 |
+
To achieve this goal, we introduce a Frequency Filter (FLT) based on Discrete Fourier Transform (DFT) to conduct disentangling operations in the frequency domain. To be specific, given word representations $\mathbf{H} \in \mathbb{R}^{n \times d}$ , we feed them into the FLT before the Graph Learner. For the specific $i$ -th and $j$ -th word representations $\mathbf{h}_i \in \mathbb{R}^d$ and $\mathbf{h}_j \in \mathbb{R}^d$ , the pair-wise edge score $e_{ij}$ is calculated as follows:
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\Phi^ {f l t} (x) = \mathcal {F} ^ {- 1} \left(\Psi (\mathcal {F} (x))\right), \tag {4}
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
e _ {i j} = \Phi^ {f l t} \left(\mathbf {W} _ {i} \mathbf {h} _ {i}\right) \Phi^ {f l t} \left(\mathbf {W} _ {j} \mathbf {h} _ {j}\right) ^ {\top}, \tag {5}
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
where $\mathcal{F}(\cdot)$ and $\mathcal{F}^{-1}(\cdot)$ denote the Fast Fourier Transform (FFT) and its inverse, $\Psi$ indicates the filtering operation, and $\Phi^{flt}$ denotes the Frequency Filter (FLT). We carry out filtering at the sentence level. Subsequent operations are consistent with Section 3.1. We conduct experiments and analyses on four band allocations (HIGH, MID-HIGH, MID-LOW, LOW)). The specific band allocations are displayed in Table 5, and the analysis experiments refer to Section 4.7 and 4.10.
|
| 111 |
+
|
| 112 |
+
# 4 Experiment
|
| 113 |
+
|
| 114 |
+
To prove the effectiveness of our approach, we demonstrate experimental results conducted on three datasets for ABSA and compare them with previous works. We show the details as follows.
|
| 115 |
+
|
| 116 |
+
# 4.1 Dataset
|
| 117 |
+
|
| 118 |
+
We conduct experiments on SemEval 2014 task (Rest14 and Laptop14) (Pontiki et al., 2014) and Twitter (Dong et al., 2014) datasets, which are widely used. Each of the three datasets contains
|
| 119 |
+
|
| 120 |
+
Table 2: Overall performance of ABSA on the three datasets. According to the categorization of structure (Dep.: external structures (dependency syntactic tree), Semi.: semi-induced structures, Full: full-induced structures, and None: no structure information used), we classify the baselines accordingly, which are in the 'Structure' column.
|
| 121 |
+
|
| 122 |
+
<table><tr><td rowspan="2">Embedding</td><td rowspan="2">Model</td><td rowspan="2">Structure</td><td colspan="2">Rest14</td><td colspan="2">Laptop14</td><td colspan="2">Twitter</td></tr><tr><td>Accuracy</td><td>Macro-F1</td><td>Accuracy</td><td>Macro-F1</td><td>Accuracy</td><td>Macro-F1</td></tr><tr><td rowspan="7">Static Embedding</td><td>depGCN</td><td>Dep.</td><td>80.77#</td><td>72.02#</td><td>75.55#</td><td>71.05#</td><td></td><td></td></tr><tr><td>CDT</td><td>Dep.</td><td>82.30#</td><td>74.02#</td><td>77.19#</td><td>72.99#</td><td></td><td></td></tr><tr><td>kumaGCN</td><td>Semi.</td><td>81.43</td><td>73.64</td><td>76.12</td><td>72.42</td><td>72.45</td><td>70.77</td></tr><tr><td>RGAT</td><td>Dep.</td><td>83.30</td><td>76.08</td><td>77.42</td><td>73.76</td><td>75.57</td><td>73.82</td></tr><tr><td>FT-RoBERTa(ASGCN)</td><td>Full</td><td>82.31</td><td>73.53</td><td>76.33</td><td>72.76</td><td>73.84</td><td>72.66</td></tr><tr><td>FT-RoBERTa(PWCN)</td><td>Full</td><td>82.40</td><td>73.95</td><td>76.95</td><td>73.21</td><td>73.84</td><td>71.43</td></tr><tr><td>FT-RoBERTa(RGAT)</td><td>Full</td><td>82.76</td><td>75.25</td><td>77.43</td><td>74.21</td><td>75.43</td><td>74.04</td></tr><tr><td rowspan="7">BERTbase</td><td>BERT</td><td>None</td><td>85.62#</td><td>78.28#</td><td>77.58#</td><td>72.38#</td><td>75.28</td><td>74.11</td></tr><tr><td>SAGAT</td><td>Dep.</td><td>85.08</td><td>77.94</td><td>80.37</td><td>76.94</td><td>75.40</td><td>74.17</td></tr><tr><td>DGEDT</td><td>Dep.</td><td>86.30</td><td>80.00</td><td>79.80</td><td>75.60</td><td>77.90</td><td>75.40</td></tr><tr><td>depGCN-BERT</td><td>Dep.</td><td>85.00</td><td>78.79</td><td>81.19</td><td>77.67</td><td>75.58</td><td>74.58</td></tr><tr><td>RGAT-BERT</td><td>Dep.</td><td>86.60</td><td>81.35</td><td>78.21</td><td>74.07</td><td>76.15</td><td>74.88</td></tr><tr><td>KumaGCN-BERT</td><td>Semi.</td><td>86.43</td><td>80.30</td><td>81.98</td><td>78.81</td><td>77.89</td><td>77.03</td></tr><tr><td>dotGCN-BERT</td><td>Full</td><td>86.16</td><td>80.49</td><td>81.03</td><td>78.10</td><td>78.11</td><td>77.00</td></tr><tr><td rowspan="10">RoBERTabase</td><td>Roberta + MLP</td><td>None</td><td>87.32</td><td>81.01</td><td>82.60</td><td>79.33</td><td>77.17</td><td>76.20</td></tr><tr><td>RoBERTa-ASC(Dep)</td><td>Dep.</td><td>82.82</td><td>75.12</td><td>74.12</td><td>70.52</td><td>-</td><td>-</td></tr><tr><td>LCFS-ASC-CDW(Dep)</td><td>Dep.</td><td>86.71</td><td>80.31</td><td>80.52</td><td>77.13</td><td>-</td><td>-</td></tr><tr><td>Dep(ASGCN)</td><td>Dep.</td><td>86.90</td><td>80.75</td><td>81.66</td><td>78.31</td><td>75.28</td><td>74.38</td></tr><tr><td>Dep(PWCN)</td><td>Dep.</td><td>87.41</td><td>81.07</td><td>84.16</td><td>81.18</td><td>76.63</td><td>75.60</td></tr><tr><td>Dep(RGAT)</td><td>Dep.</td><td>87.43</td><td>80.61</td><td>83.43</td><td>80.28</td><td>74.42</td><td>72.93</td></tr><tr><td>FT-RoBERTa(ASGCN)</td><td>Full</td><td>86.87</td><td>80.59</td><td>83.33</td><td>80.32</td><td>76.10</td><td>75.07</td></tr><tr><td>FT-RoBERTa(PWCN)</td><td>Full</td><td>87.35</td><td>80.85</td><td>84.01</td><td>81.08</td><td>77.02</td><td>75.52</td></tr><tr><td>FT-RoBERTa(RGAT)</td><td>Full</td><td>87.52</td><td>81.29</td><td>83.33</td><td>79.95</td><td>75.81</td><td>74.91</td></tr><tr><td>FLT</td><td>Full</td><td>88.57</td><td>83.27</td><td>85.42</td><td>83.01</td><td>77.02</td><td>75.83</td></tr><tr><td>RoBERTalarge</td><td>FLT</td><td>Full</td><td>90.27</td><td>85.20</td><td>86.05</td><td>84.68</td><td>77.89</td><td>77.20</td></tr></table>
|
| 123 |
+
|
| 124 |
+
three sentiment label categories: POSITIVE, NEUTRAL, and NEGATIVE. Statistics of these datasets are displayed in Table 1, where (Train|Test) denotes the number of instances on the training, and testing set for each dataset.
|
| 125 |
+
|
| 126 |
+
# 4.2 Experiment Settings
|
| 127 |
+
|
| 128 |
+
We utilize the popular Pre-trained Language Models (PLMs) based on Transformer Encoder architecture (BERT<sub>base</sub> (Devlin et al., 2019), RoBERT<sub>base</sub> and RoBERT<sub>large</sub> (Liu et al., 2019)) for word representations. Moreover, the hidden dimensions of all Graph Learners are 60. The dropout rate is 0.2, the batch size is 32. The number of the epoch is 60 for RoBERT<sub>base</sub> and RoBERT<sub>large</sub>, and 30 for BERT<sub>base</sub>. We use Adam optimizer (Kingma and Ba, 2015) while training with the learning rate initialized by 1e-5. Following previous works, we use Accuracy and Macro-F1 scores for metrics. All experiments are conducted on NVIDIA Tesla P100.
|
| 129 |
+
|
| 130 |
+
# 4.3 Baselines
|
| 131 |
+
|
| 132 |
+
We categorize the existing structure-based ASBA models into three genres: external structure, semi-induced structure, and full-induced structure. Below, we introduce each of them in detail.
|
| 133 |
+
|
| 134 |
+
External Structure. This line of works utilizes dependency syntactic structure generated by external dependency parsers (e.g. Spacy and Standford CoreNLP $^{2}$ , etc.) to offer structural information supplements for ABSA. Its delegate works as follows:
|
| 135 |
+
|
| 136 |
+
depGCN (Zhang et al., 2019a) combines BiLSTM to capture contextual information regarding word orders with multi-layered GCNs.
|
| 137 |
+
|
| 138 |
+
CDT (Sun et al., 2019) encodes both dependency and contextual information by utilizing GCNs and BiLSTM.
|
| 139 |
+
|
| 140 |
+
RGAT (Wang et al., 2020) feeds reshaped syntactic dependency graph into RGAT to capture aspect-centric information.
|
| 141 |
+
|
| 142 |
+
SAGAT (Huang et al., 2020) uses graph attention network and BERT to explore both syntax and semantic information for ABSA.
|
| 143 |
+
|
| 144 |
+
$\mathbf{D}\mathbf{G}\mathbf{E}\mathbf{D}\mathbf{T}$ (Tang et al., 2020) jointly consider BERT outputs and dependency syntactic representations by utilizing GCNs.
|
| 145 |
+
|
| 146 |
+
LCFS-ASC-CDW (Phan and Ogunbona, 2020) combine dependency syntactic embeddings, part-of-speech embeddings, and contextualized embeddings to enhance the performance of ABSA.
|
| 147 |
+
|
| 148 |
+
Table 3: Results of ablation studies.
|
| 149 |
+
|
| 150 |
+
<table><tr><td rowspan="2">Embedding</td><td rowspan="2">Model</td><td rowspan="2">Structure</td><td colspan="2">Rest14</td><td colspan="2">Laptop14</td><td colspan="2">Twitter</td></tr><tr><td>Accuracy</td><td>Macro-F1</td><td>Accuracy</td><td>Macro-F1</td><td>Accuracy</td><td>Macro-F1</td></tr><tr><td rowspan="2">BERTbase</td><td>Attn.</td><td>Full</td><td>85.43</td><td>78.04</td><td>80.54</td><td>77.06</td><td>76.22</td><td>75.04</td></tr><tr><td>FLT</td><td>Full</td><td>87.04</td><td>81.46</td><td>81.17</td><td>77.97</td><td>77.55</td><td>76.66</td></tr><tr><td rowspan="2">RoBERTa base</td><td>Attn.</td><td>Full</td><td>87.59</td><td>81.72</td><td>83.86</td><td>80.53</td><td>75.72</td><td>73.92</td></tr><tr><td>FLT</td><td>Full</td><td>88.57</td><td>83.27</td><td>85.42</td><td>83.01</td><td>77.02</td><td>75.83</td></tr><tr><td rowspan="2">RoBERTalarge</td><td>Attn.</td><td>Full</td><td>89.46</td><td>84.12</td><td>84.80</td><td>82.19</td><td>77.02</td><td>75.75</td></tr><tr><td>FLT</td><td>Full</td><td>90.27</td><td>85.20</td><td>86.05</td><td>84.68</td><td>77.89</td><td>77.20</td></tr></table>
|
| 151 |
+
|
| 152 |
+
Semi-induced Structure. Works in this line tend to exploit both dependency syntactic structure from off-the-shelf parsers and induced structure from PLMs, the representative works are as follows:
|
| 153 |
+
|
| 154 |
+
KumaGCN (Chen et al., 2020a) combine latent graphs induced by self-attention neural networks and dependency syntactic structure for ABSA.
|
| 155 |
+
|
| 156 |
+
Full-induced Structure. Works in this line intend to get totally rid of external parsers and induce task-specific latent structures from PLMs for downstream tasks. Its delegate works as follows:
|
| 157 |
+
|
| 158 |
+
FT-RoBERTa (Dai et al., 2021) induce tree structures from the fine-tuned RoBERTa (fine-tune RoBERTa on the ABSA datasets in advance) by utilizing a dependency probing approach.
|
| 159 |
+
|
| 160 |
+
dotGCN (Chen et al., 2022) induce aspect-specific opinion tree structures by using Reinforcement learning and attention-based regularization.
|
| 161 |
+
|
| 162 |
+
# 4.4 Overall Performance
|
| 163 |
+
|
| 164 |
+
The overall results of competitive approaches and FLT on the three benchmarks are shown in Table 2. We categorize baselines according to the embedding type (static embedding (GloVe), BERT<sub>base</sub>, RoBERTa<sub>base</sub>, and RoBERTa<sub>large</sub>) and the structure they used (None, Dep., Semi., and Full). The parameters of PLMs are trained together with the GSL module for FLT. Compared with baselines, FLT obtains the best results except on Twitter, which obtains comparable results. We speculate that the reason is that the expression of Twitter is more casual, which leads to a limited improvement of the structure on Twitter, which is consistent with the result in (Dai et al., 2021). Compared with FT-RoBERTa-series works, the most relevant work of ours, FLT outperforms them a lot on the three datasets. And it is worth noting that FT-RoBERTa-series works need fine-tuning PLMs on the ABSA datasets in advance (Dai et al., 2021), but FLT does not need it. Therefore, FLT is simpler and more effective than FT-RoBERTa-series works.
|
| 165 |
+
|
| 166 |
+
Table 4: The impact of different metric functions based on RoBERTa<sub>base</sub>.
|
| 167 |
+
|
| 168 |
+
<table><tr><td rowspan="2">Metric</td><td colspan="2">Rest14</td><td colspan="2">Laptop14</td><td colspan="2">Twitter</td></tr><tr><td>Accuracy</td><td>Macro-F1</td><td>Accuracy</td><td>Macro-F1</td><td>Accuracy</td><td>Macro-F1</td></tr><tr><td>Attn.</td><td>87.59</td><td>81.72</td><td>83.86</td><td>80.53</td><td>75.72</td><td>73.92</td></tr><tr><td>Knl.</td><td>87.14</td><td>80.45</td><td>83.54</td><td>80.44</td><td>76.01</td><td>73.98</td></tr><tr><td>Cosine</td><td>87.14</td><td>79.94</td><td>83.39</td><td>79.93</td><td>74.28</td><td>72.80</td></tr></table>
|
| 169 |
+
|
| 170 |
+
# 4.5 Ablation Study
|
| 171 |
+
|
| 172 |
+
We conduct ablation studies to highlight the effectiveness of FLT, which is based on Attention-based (Attn.) GSL module and utilizing Frequency Filter. Thus, we compare Attn. and FLT on three PLMs (BERT<sub>base</sub>, RoBERT<sub>base</sub>, and RoBERT<sub>large</sub>) to show the impact of introducing Frequency Filter. Results are shown in Table 3. Compared to Attn., FLT has achieved significant improvements in consistency across three datasets utilizing different PLMs. Therefore, it can be seen that the manipulation of scale information is beneficial for enhancing performance.
|
| 173 |
+
|
| 174 |
+
# 4.6 Different Metric Function
|
| 175 |
+
|
| 176 |
+
In this section, we contrast the impact of three representative metric functions: Attention-based (Attn.), Kernel-based (Knl.), and Cosine-based (Cosine) on structure induction. From the insight of graph structure learning (Chen et al., 2020b; Zhu et al., 2021), the common options for metric learning include attention mechanism (Vaswani et al., 2017; Jiang et al., 2019), radial basis function kernel (Li et al., 2018; Yeung and Chang, 2007), and cosine similarity (Wojke and Bewley, 2018). We follow these previous works to implement the counterpart metric functions (Knl. and Cosine) for comparison, the results are shown in Table 4. The performance of attention-based (Attn.) on the three benchmarks gains the best results except on Twitter. But the margin between Attn. and Knl. is not big $(0.29\%)$ for Accuracy and $0.06\%$ for Macro-F1) on Twitter, thus we select the metric function Attn. for later analysis.
|
| 177 |
+
|
| 178 |
+
Table 5: The spectral bands we consider in this work. Since the task considered in this work is at the sentence level, we only take the scale from word to sentence into account. Here, $L$ denotes the sentence's length.
|
| 179 |
+
|
| 180 |
+
<table><tr><td>Band</td><td>Scale</td><td>Period(Toks)</td><td>DFT index</td></tr><tr><td>HIGH</td><td>Word</td><td>1 → 2</td><td>L/2 → L</td></tr><tr><td>MID-HIGH</td><td>Phrase</td><td>2 → 6</td><td>L/6 → L/2</td></tr><tr><td>MID-LOW</td><td>Clause</td><td>6 → 14</td><td>L/14 → L/6</td></tr><tr><td>LOW</td><td>Sentence</td><td>14 → L</td><td>1 → L/14</td></tr></table>
|
| 181 |
+
|
| 182 |
+
# 4.7 Different Frequency Filters
|
| 183 |
+
|
| 184 |
+
Table 6: Band impact based on RoBERTa<sub>base</sub>. There are statistical results for heuristic frequency selection, and the results follow the form mean(standard deviation).
|
| 185 |
+
|
| 186 |
+
<table><tr><td rowspan="2">Filter</td><td colspan="2">Rest14</td><td colspan="2">Laptop14</td><td colspan="2">Twitter</td></tr><tr><td>Accuracy</td><td>Macro-F1</td><td>Accuracy</td><td>Macro-F1</td><td>Accuracy</td><td>Macro-F1</td></tr><tr><td>HIGH</td><td>87.54(0.55)</td><td>81.33(0.97)</td><td>84.21(0.43)</td><td>81.50(0.57)</td><td>75.83(0.34)</td><td>74.76(0.42)</td></tr><tr><td>MID-HIGH</td><td>87.55(0.53)</td><td>81.31(1.06)</td><td>84.39(0.78)</td><td>81.69(0.95)</td><td>75.71(0.78)</td><td>74.68(0.72)</td></tr><tr><td>MID-LOW</td><td>87.23(0.27)</td><td>81.15(0.71)</td><td>83.74(0.52)</td><td>81.00(0.85)</td><td>76.73(0.23)</td><td>75.64(0.12)</td></tr><tr><td>LOW</td><td>87.37(0.32)</td><td>80.75(0.45)</td><td>83.49(0.15)</td><td>80.60(0.15)</td><td>76.16(0.20)</td><td>74.94(0.19)</td></tr></table>
|
| 187 |
+
|
| 188 |
+

|
| 189 |
+
|
| 190 |
+

|
| 191 |
+
|
| 192 |
+

|
| 193 |
+
Figure 2: The distribution of sentence length on datasets (we combine training and testing sets for this statistic).
|
| 194 |
+
|
| 195 |
+
This section analyzes the impact of four different spectral bands (HIGH, MID-HIGH, MID-LOW, LOW) on structure induction. Each band reflects a diverse range of linguistic scales from word level to sentence level, the detailed setting is shown in Table 5. The different spectral bands are revealed by their period: the number of tokens it takes to complete a cycle. For example, the word scale suggests the period of $1 \rightarrow 2$ tokens, thus the spectral band should be $L/2 \rightarrow L$ if the sentence's length denotes $L$ .
|
| 196 |
+
|
| 197 |
+
Then, we conduct analysis experiments on the three datasets to explore the impact of different spectral bands. The length $L$ in our experiments is 100, which fits the length distribution of all samples in these datasets. We perform multiple frequency selections in different frequency bands heuristically, and the performance of our model in different frequency bands on the three datasets is summarized in Table 6. Please refer to Appendix A for
|
| 198 |
+
|
| 199 |
+
the detailed frequency selection and results. Our model performs better in HIGH and MID-HIGH bands on Rest14 and Laptop14 but performs better in LOW and MID-LOW bands on Twitter. Combined with Figure 2, we find that the distribution of sentence length in Twitter is very distinct from that of Rest14 and Laptop14, the sentences in Twitter are generally longer, which leads to the fact that the clause- and sentence-scale information is more beneficial to the effect improvement.
|
| 200 |
+
|
| 201 |
+
# 4.8 Aspects-sentiment Distance
|
| 202 |
+
|
| 203 |
+
To illustrate the effectiveness of induced structure, following (Dai et al., 2021), we introduce the Aspects-sentiment Distance (AsD) to quantify the average distance between aspects and sentiment words in the induced structure. The AsD is calculated as follows:
|
| 204 |
+
|
| 205 |
+
$$
|
| 206 |
+
C ^ {\star} = S _ {i} \cap C, \tag {6}
|
| 207 |
+
$$
|
| 208 |
+
|
| 209 |
+
$$
|
| 210 |
+
A s D \left(S _ {i}\right) = \frac {\sum_ {A} ^ {a _ {p}} \sum_ {C ^ {\star}} ^ {c _ {q}} d i s t \left(a _ {p} , c _ {q}\right)}{| A | | C ^ {\star} |}, \tag {7}
|
| 211 |
+
$$
|
| 212 |
+
|
| 213 |
+
$$
|
| 214 |
+
A s D (D) = \frac {\sum_ {D} A s D \left(S _ {i}\right)}{| D |}, \tag {8}
|
| 215 |
+
$$
|
| 216 |
+
|
| 217 |
+
where $C = \langle c_1, \dots, c_q \rangle$ is a sentiment words set (following the setting from Dai et al., 2021), $S_i$ denotes each sentence in dataset $D$ , and $A = \langle a_1, \dots, a_p \rangle$ denotes the set of aspects for each sentence. We utilize $\text{dist}(n_1, n_2)$ to calculate the relative distance between two nodes ( $n_1$ and $n_2$ ) on the graph structure, and $|\cdot|$ represent the number of elements in the given set. For a detailed setting, please refer to Appendix B.
|
| 218 |
+
|
| 219 |
+
The results are displayed in Table 7, and the less magnitude indicates the shorter distance between aspects and sentiment words. Compared to dependency structure (Dep.), attention-based GSL (Attn), and our method (FLT) shorten the Aspect-sentiment Distance greatly, which shows that GSL method encourages the aspects to find sentiment words. Furthermore, in comparison with Attn., FLT has a lower AsD score, which proves a reasonable adjustment on the scale level can obtain better structures.
|
| 220 |
+
|
| 221 |
+
# 4.9 Structure Visualization and Case Study
|
| 222 |
+
|
| 223 |
+
Structure Visualization. As shown in Figure 3, we visualize the difference of distinct structures: (a) is from the Spacy parser, (b) is from Attn., and (c)
|
| 224 |
+
|
| 225 |
+
<table><tr><td>Structure</td><td>Rest14</td><td>Laptop14</td><td>Twitter</td></tr><tr><td>Dep.</td><td>8.19</td><td>8.02</td><td>8.33</td></tr><tr><td>Attn.</td><td>2.26</td><td>2.55</td><td>2.64</td></tr><tr><td>FLT</td><td>1.97</td><td>2.15</td><td>2.16</td></tr></table>
|
| 226 |
+
|
| 227 |
+
Table 7: The Aspects-sentiment Distance (AsD) of different trees in all datasets. The dependency tree structure (Dep.) comes from the Spacy parser ${}^{3}$ .
|
| 228 |
+
|
| 229 |
+

|
| 230 |
+
Figure 3: A case is from the Rest14 dataset. The colored words are aspects. The golden label for falafal is NEGATIVE, and for chicken is POSITIVE.
|
| 231 |
+
|
| 232 |
+
is the result from FLT. This case is from the Rest14 dataset. In comparison with (a), aspects are more directly connected to important sentiment words (e.g. cooked, dried, and fine) in (b) and (c), which is consistent with the results of AsD in Section 4.8. In this case, both (b) and (c) obtained correct judgment results, hence from the perspective of structure, they are relatively similar.
|
| 233 |
+
|
| 234 |
+
Case Study. In Figure 4, we provide a case to compare Attn. in (a) and FLT in (b). In this case, the structures induced by the two are quite different, and for the aspect (Chinese food), Attn. gives a wrong judgment. From the comparison of structures, it can be found that although the aspect word Chinese in (a) pays attention to the key information I can make better at home, they may not understand the semantics expressed by this clause. From the perspective of structure, FLT in (b) is obviously better able to understand the meaning of this clause.
|
| 235 |
+
|
| 236 |
+
# 4.10 Automatic Frequency Selector (AFS).
|
| 237 |
+
|
| 238 |
+
Furthermore, in order to illustrate the impact of the operation of the scale information on the GSL, we introduce an Automatic Frequency Selector (AFS) to select helpful frequency components along with
|
| 239 |
+
|
| 240 |
+

|
| 241 |
+
Figure 4: A case of Rest14 dataset. The colored words denote aspects. The golden label for Chinese food is NEGATIVE.
|
| 242 |
+
|
| 243 |
+
Table 8: The results of AFS based on RoBERTa ${}_{\text{base }}$ .
|
| 244 |
+
|
| 245 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">Rest14</td><td colspan="2">Laptop14</td><td colspan="2">Twitter</td></tr><tr><td>Accuracy</td><td>Macro-F1</td><td>Accuracy</td><td>Macro-F1</td><td>Accuracy</td><td>Macro-F1</td></tr><tr><td>Attn.</td><td>87.59</td><td>81.72</td><td>83.86</td><td>80.53</td><td>75.72</td><td>73.92</td></tr><tr><td>AFS</td><td>88.30</td><td>82.89</td><td>84.48</td><td>81.63</td><td>76.16</td><td>75.20</td></tr></table>
|
| 246 |
+
|
| 247 |
+
the optimization of the overall model. In this way, for different datasets, the information of the corresponding scale (HIGH, MID-HIGH, etc.) can be adaptively selected to improve the effect of structure induction. Here we briefly describe the AFS, and for a detailed description, please refer to Appendix C.
|
| 248 |
+
|
| 249 |
+
Model Description. Following the operation of FLT, for an input sentence representation $\mathbf{H} \in \mathbb{R}^{n \times d}$ , we conduct Discrete Fourier Transform (DFT) $\mathcal{F}$ to transform $\mathbf{H}$ into the frequency domain. Then, we utilize AFS $\Phi^{auto}$ to adaptively select frequency components, where AFS $\Phi^{auto}$ is realized by using a Multi-layer Perceptron (MLP) architecture, please refer to the Appendix C for details. After AFS and inverse Discrete Fourier Transform $\mathcal{F}^{-1}$ , we can obtain the sentence representation $\mathbf{H}^{afs} \in \mathbb{R}^{n \times d}$ . The subsequent operations are consistent with the attention-based GSL.
|
| 250 |
+
|
| 251 |
+
Results. We utilize AFS instead of FLT to conduct experiments on the three datasets, the results are shown in Table 8. Compared to Attn., AFS is consistently improved. This further illustrates the operation of scale information is conducive to improving the effectiveness of GSL on ABSA. Compared with the heuristic FLT method, AFS avoids the burden brought by manual frequency selection, making the method more flexible.
|
| 252 |
+
|
| 253 |
+
Frequency Component Analysis. Furthermore, we conducted an in-depth analysis of the intermedi-
|
| 254 |
+
|
| 255 |
+
Table 9: Frequency Component Analysis. The spectral bands we consider in this work. Since the task considered in this work is at the sentence level, we only take the scale from word to sentence into account. Here, $L$ denotes the sentence's length.
|
| 256 |
+
|
| 257 |
+
<table><tr><td>Band</td><td>Rest14(%)</td><td>Laptop14(%)</td><td>Twitter(%)</td><td>Scale</td><td>DFT index</td></tr><tr><td>HIGH</td><td>84.77</td><td>25.64</td><td>87.22</td><td>Word</td><td>L/2 → L</td></tr><tr><td>MID-HIGH</td><td>89.82</td><td>28.68</td><td>92.61</td><td>Phrase</td><td>L/6 → L/2</td></tr><tr><td>MID-LOW</td><td>91.82</td><td>41.02</td><td>96.87</td><td>Clause</td><td>L/14 → L/6</td></tr><tr><td>LOW</td><td>99.61</td><td>88.08</td><td>99.19</td><td>Sentence</td><td>1 → L/14</td></tr><tr><td>Overall</td><td>88.88</td><td>35.21</td><td>91.41</td><td>-</td><td>-</td></tr></table>
|
| 258 |
+
|
| 259 |
+
ate results obtained from the Automatic Frequency Selector (AFS). From Table 8, we observe that incorporating AFS consistently enhances model performance without manual adjustments to Frequency Components. This suggests that the automated Frequency Components selection process is effective. Based on AFS's Frequency Component selection outcomes, we performed statistical analyses across three datasets in accordance with the spectral band distribution outlined in Table 5. Table 9 illustrates the percentage of Frequency Components selected by AFS within different spectral bands, while "Overall" represents the percentage of selected Frequency Components across all four bands.
|
| 260 |
+
|
| 261 |
+
It is evident that the results are not uniformly $100\%$ , indicating that AFS indeed performs selection on Frequency Components, thereby adjusting information at various scales to achieve consistent improvements. Moreover, the percentage of selected Frequency Components varies across different datasets, implying adaptive adjustments by AFS to cater to the diverse demands of distinct samples. Notably, the LOW band exhibits the highest percentage of selected Frequency Components, underscoring the significance of sentence-level information for token-level tasks (such as Structure Induction for ABSA, which can be considered a token-level task). This observation also aligns with the conclusion drawn in reference (Müller-Eberstein et al., 2022).
|
| 262 |
+
|
| 263 |
+
# 5 Conclusion
|
| 264 |
+
|
| 265 |
+
In this work, we propose utilizing GSL to induce latent structures from PLMs for ABSA and introduce spectral methods (FLT and AFS) into this problem. We also explore the impact of manipulation on scale information of the contextual representation for structure induction. Extensive experiments and analyses have demonstrated that the operation of scale information of contextual representation
|
| 266 |
+
|
| 267 |
+
can enhance the effect of GSL on ABSA. Additionally, our exploration is also beneficial to provide inspiration for other similar domains.
|
| 268 |
+
|
| 269 |
+
# Limitations
|
| 270 |
+
|
| 271 |
+
Though we verify the operation on various information scales can be beneficial to structure induction on ABSA, there are still some limitations. Although the heuristic FLT has achieved excellent results, it requires some manual intervention. The AFS method reduces manual participation, but its effect is worse than the optimal FLT method. However, it is still meaningful to explore the impact of scale information on the contextual representation of downstream tasks.
|
| 272 |
+
|
| 273 |
+
# Acknowledgements
|
| 274 |
+
|
| 275 |
+
This work is funded in part by the National Natural Science Foundation of China Project (No.U1936213), and the Major Key Project of PCL (PCL2021A06).
|
| 276 |
+
|
| 277 |
+
# References
|
| 278 |
+
|
| 279 |
+
Gianni Brauwers and Flavius Frasincar. 2023. A survey on aspect-based sentiment classification. ACM Comput. Surv., 55(4):65:1-65:37.
|
| 280 |
+
Chenhua Chen, Zhiyang Teng, Zhongqing Wang, and Yue Zhang. 2022. Discrete opinion tree induction for aspect-based sentiment analysis. 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 2051-2064. Association for Computational Linguistics.
|
| 281 |
+
Chenhua Chen, Zhiyang Teng, and Yue Zhang. 2020a. Inducing target-specific latent structures for aspect sentiment classification. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing, EMNLP 2020, Online, November 16-20, 2020, pages 5596-5607. Association for Computational Linguistics.
|
| 282 |
+
Peng Chen, Zhongqian Sun, Lidong Bing, and Wei Yang. 2017. Recurrent attention network on memory for aspect sentiment analysis. In *EMNLP*, pages 452–461. Association for Computational Linguistics.
|
| 283 |
+
Yu Chen, Lingfei Wu, and Mohammed J. Zaki. 2020b. Iterative deep graph learning for graph neural networks: Better and robust node embeddings. In Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual.
|
| 284 |
+
|
| 285 |
+
Junqi Dai, Hang Yan, Tianxiang Sun, Pengfei Liu, and Xipeng Qiu. 2021. Does syntax matter? A strong baseline for aspect-based sentiment analysis with roberta. 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 1816-1829. Association for Computational Linguistics.
|
| 286 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. BERT: pre-training of deep bidirectional transformers for language understanding. In *NAACL-HLT* (1), pages 4171–4186. Association for Computational Linguistics.
|
| 287 |
+
Li Dong, Furu Wei, Chuanqi Tan, Duyu Tang, Ming Zhou, and Ke Xu. 2014. Adaptive recursive neural network for target-dependent twitter sentiment classification. In ACL (2), pages 49-54. The Association for Computer Linguistics.
|
| 288 |
+
Bing Han, Cheng Wang, and Kaushik Roy. 2022. Oscillatory fourier neural network: A compact and efficient architecture for sequential processing. 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 6838-6846. AAAI Press.
|
| 289 |
+
Binxuan Huang and Kathleen M. Carley. 2019. Syntax-aware aspect level sentiment classification with graph attention networks. In EMNLP/IJCNLP (1), pages 5468-5476. Association for Computational Linguistics.
|
| 290 |
+
Lianzhe Huang, Xin Sun, Sujian Li, Linhao Zhang, and Houfeng Wang. 2020. Syntax-aware graph attention network for aspect-level sentiment classification. In Proceedings of the 28th International Conference on Computational Linguistics, COLING 2020, Barcelona, Spain (Online), December 8-13, 2020, pages 799-810. International Committee on Computational Linguistics.
|
| 291 |
+
Eric Jang, Shixiang Gu, and Ben Poole. 2017. Categorical reparameterization with gumbel-softmax. In 5th International Conference on Learning Representations, ICLR 2017, Toulouse, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net.
|
| 292 |
+
Bo Jiang, Ziyan Zhang, Doudou Lin, Jin Tang, and Bin Luo. 2019. Semi-supervised learning with graph learning-convolutional networks. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2019, Long Beach, CA, USA, June 16-20, 2019, pages 11313-11320. Computer Vision Foundation / IEEE.
|
| 293 |
+
Subhradeep Kayal and George Tsatsaronis. 2019. Eigensent: Spectral sentence embeddings using higher-order dynamic mode decomposition. In Proceedings of the 57th Conference of the Association
|
| 294 |
+
|
| 295 |
+
for Computational Linguistics, ACL 2019, Florence, Italy, July 28-August 2, 2019, Volume 1: Long Papers, pages 4536-4546. Association for Computational Linguistics.
|
| 296 |
+
Diederik P. Kingma and Jimmy Ba. 2015. Adam: A method for stochastic optimization. In ICLR (Poster).
|
| 297 |
+
Thomas N. Kipf and Max Welling. 2017. Semi-supervised classification with graph convolutional networks. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net.
|
| 298 |
+
Svetlana Kiritchenko, Xiaodan Zhu, Colin Cherry, and Saif M. Mohammad. 2014. Nrc-canada-2014: Detecting aspects and sentiment in customer reviews. In Proceedings of the 8th International Workshop on Semantic Evaluation, SemEval@COLING 2014, Dublin, Ireland, August 23-24, 2014, pages 437-442. The Association for Computer Linguistics.
|
| 299 |
+
Ruoyu Li, Sheng Wang, Feiyun Zhu, and Junzhou Huang. 2018. Adaptive graph convolutional neural networks. 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 3546-3553. AAAI Press.
|
| 300 |
+
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.
|
| 301 |
+
Chris J. Maddison, Andriy Mnih, and Yee Whye Teh. 2017. The concrete distribution: A continuous relaxation of discrete random variables. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net.
|
| 302 |
+
Max Müller-Eberstein, Rob van der Goot, and Barbara Plank. 2022. Spectral probing. 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 7730-7741. Association for Computational Linguistics.
|
| 303 |
+
Matthew E. Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. 2018. Deep contextualized word representations. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2018, New Orleans, Louisiana, USA, June 1-6, 2018, Volume 1 (Long Papers), pages 2227-2237. Association for Computational Linguistics.
|
| 304 |
+
|
| 305 |
+
Minh-Hieu Phan and Philip O. Ogunbona. 2020. Modelling context and syntactical features for aspect-based sentiment analysis. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, ACL 2020, Online, July 5-10, 2020, pages 3211-3220. Association for Computational Linguistics.
|
| 306 |
+
Maria Pontiki, Dimitris Galanis, John Pavlopoulos, Harris Papageorgiou, Ion Androutsopoulos, and Suresh Manandhar. 2014. SemEval-2014 task 4: Aspect based sentiment analysis. In SemEval@COLING, pages 27-35. The Association for Computer Linguistics.
|
| 307 |
+
Kim Schouten and Flavius Frasincar. 2016. Survey on aspect-level sentiment analysis. IEEE Trans. Knowl. Data Eng., 28(3):813-830.
|
| 308 |
+
Kai Sun, Richong Zhang, Samuel Mensah, Yongyi Mao, and Xudong Liu. 2019. Aspect-level sentiment analysis via convolution over dependency tree. In EMNLP/IJCNLP (1), pages 5678-5687. Association for Computational Linguistics.
|
| 309 |
+
Alex Tamkin, Dan Jurafsky, and Noah D. Goodman. 2020. Language through a prism: A spectral approach for multiscale language representations. In Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual.
|
| 310 |
+
Hao Tang, Donghong Ji, Chenliang Li, and Qiji Zhou. 2020. Dependency graph enhanced dual-transformer structure for aspect-based sentiment classification. In ACL, pages 6578-6588. Association for Computational Linguistics.
|
| 311 |
+
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 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net.
|
| 312 |
+
Yuanhe Tian, Guimin Chen, and Yan Song. 2021. Aspect-based sentiment analysis with type-aware graph convolutional networks and layer ensemble. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2021, Online, June 6-11, 2021, pages 2910-2922. Association for Computational Linguistics.
|
| 313 |
+
Maria Mihaela Trusca, Daan Wassenberg, Flavius Frasincar, and Rommert Dekker. 2020. A hybrid approach for aspect-based sentiment analysis using deep contextual word embeddings and hierarchical attention. In Web Engineering - 20th International
|
| 314 |
+
|
| 315 |
+
Conference, ICWE 2020, Helsinki, Finland, June 9-12, 2020, Proceedings, volume 12128 of Lecture Notes in Computer Science, pages 365-380. Springer.
|
| 316 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In NIPS, pages 5998-6008.
|
| 317 |
+
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.
|
| 318 |
+
Amir Pouran Ben Veyseh, Nasim Nouri, Franck Dernoncourt, Quan Hung Tran, Dejing Dou, and Thien Huu Nguyen. 2020. Improving aspect-based sentiment analysis with gated graph convolutional networks and syntax-based regulation. In *Findings of the Association for Computational Linguistics: EMNLP* 2020, Online Event, 16-20 November 2020, volume EMNLP 2020 of *Findings of ACL*, pages 4543-4548. Association for Computational Linguistics.
|
| 319 |
+
Duy-Tin Vo and Yue Zhang. 2015. Target-dependent twitter sentiment classification with rich automatic features. In Proceedings of the Twenty-Fourth International Joint Conference on Artificial Intelligence, IJCAI 2015, Buenos Aires, Argentina, July 25-31, 2015, pages 1347-1353. AAAI Press.
|
| 320 |
+
Kai Wang, Weizhou Shen, Yunyi Yang, Xiaojun Quan, and Rui Wang. 2020. Relational graph attention network for aspect-based sentiment analysis. In ACL, pages 3229-3238. Association for Computational Linguistics.
|
| 321 |
+
Nicolai Wojke and Alex Bewley. 2018. Deep cosine metric learning for person re-identification. In 2018 IEEE Winter Conference on Applications of Computer Vision, WACV 2018, Lake Tahoe, NV, USA, March 12-15, 2018, pages 748-756. IEEE Computer Society.
|
| 322 |
+
Dit-Yan Yeung and Hong Chang. 2007. A kernel approach for semisupervised metric learning. IEEE Trans. Neural Networks, 18(1):141-149.
|
| 323 |
+
Donghan Yu, Ruohong Zhang, Zhengbao Jiang, Yuexin Wu, and Yiming Yang. 2020. Graph-revised convolutional network. In Machine Learning and Knowledge Discovery in Databases - European Conference, ECML PKDD 2020, Ghent, Belgium, September 14-18, 2020, Proceedings, Part III, volume 12459 of Lecture Notes in Computer Science, pages 378-393. Springer.
|
| 324 |
+
Chen Zhang, Qiuchi Li, and Dawei Song. 2019a. Aspect-based sentiment classification with aspect-specific graph convolutional networks. In EMNLP/IJCNLP (1), pages 4567-4577. Association for Computational Linguistics.
|
| 325 |
+
|
| 326 |
+
Chen Zhang, Qiuchi Li, and Dawei Song. 2019b. Syntax-aware aspect-level sentiment classification with proximity-weighted convolution network. In Proceedings of the 42nd International ACM SIGIR Conference on Research and Development in Information Retrieval, SIGIR 2019, Paris, France, July 21-25, 2019, pages 1145-1148. ACM.
|
| 327 |
+
|
| 328 |
+
Jiong Zhang, Yibo Lin, Zhao Song, and Inderjit S. Dhillon. 2018. Learning long term dependencies via fourier recurrent units. In Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholm, Sweden, July 10-15, 2018, volume 80 of Proceedings of Machine Learning Research, pages 5810-5818. PMLR.
|
| 329 |
+
|
| 330 |
+
Jianan Zhao, Xiao Wang, Chuan Shi, Binbin Hu, Guojie Song, and Yanfang Ye. 2021a. Heterogeneous graph structure learning for graph neural networks. 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 4697-4705. AAAI Press.
|
| 331 |
+
|
| 332 |
+
Tong Zhao, Yozen Liu, Leonardo Neves, Oliver J. Woodford, Meng Jiang, and Neil Shah. 2021b. Data augmentation for graph neural networks. 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 11015-11023. AAAI Press.
|
| 333 |
+
|
| 334 |
+
Yuxiang Zhou, Lejian Liao, Yang Gao, Zhanming Jie, and Wei Lu. 2021. To be closer: Learning to link up aspects with opinions. 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 3899-3909. Association for Computational Linguistics.
|
| 335 |
+
|
| 336 |
+
Yanqiao Zhu, Weizhi Xu, Jinghao Zhang, Qiang Liu, Shu Wu, and Liang Wang. 2021. Deep graph structure learning for robust representations: A survey. CoRR, abs/2103.03036.
|
| 337 |
+
|
| 338 |
+
# A Different Frequency Selection
|
| 339 |
+
|
| 340 |
+
We heuristically select spectral bands (HIGH, MID-HIGH, MID-LOW, LOW) to observe the impact of different spectral bands on structure induction for ABSA. The specific selection of spectral bands at different frequencies and their results are shown in Table 10. The range of spectral bands corresponds to the description in Table 5. Here, based on the distribution of sentence lengths in the dataset (refer to Figure 2), we set the maximum length (L) to
|
| 341 |
+
|
| 342 |
+
100 for each dataset and place sentences of similar length in one batch, with a batch size of 32. Each batch is batched according to the maximum sentence length in that batch. For simplicity, we did not design specific spectral bands for different sentence lengths. Instead, we set the spectral bands based on the maximum sentence length (L) in each dataset. We only change the hyperparameter 'Bands' settings, while all other settings remain the same. For specific experimental settings, refer to Section 4.2. It can be observed that different spectral band selections indeed lead to different results, and an appropriate heuristic spectral band selection can significantly improve the results.
|
| 343 |
+
|
| 344 |
+
# B The Settings of AsD analysis
|
| 345 |
+
|
| 346 |
+
Here, we provide a detailed introduction to the relative distance calculation $dist(n_1, n_2)$ for AsD. For a given sentence $S_i$ , with its aspect words $A = \langle a_1, \dots, a_p \rangle$ , sentiment word set $C = \langle c_1, \dots, c_q \rangle$ , and the adjacency matrix $A_G$ of the induced graph structure, we calculate the shortest hops from $a_p$ to $c_q$ . If the value of the corresponding position of $a_p$ and $c_q$ on the adjacency matrix $A_G$ is greater than the threshold $\gamma$ , then we call the distance between $a_p$ and $c_q$ to be 1. Otherwise, finding the shortest hops between $a_p$ and $c_q$ on the $A_G$ as its shortest path. We also use $\gamma$ to judge whether there is an edge between two nodes. Here, $\gamma$ is set to the average value of all values of $A_G$ . If $a_p$ and $c_q$ are not directly connected, we set the distance between $a_p$ and $c_q$ to the maximum number of hops, where the maximum number of hops is set to 10.
|
| 347 |
+
|
| 348 |
+
# C Automatic Frequency Selector (AFS)
|
| 349 |
+
|
| 350 |
+
Furthermore, it is not affirmed that information in just one band (e.g. HIGH, MID-HIGH, etc.) is helpful, and information in other bands may also provide a gaining effect. Therefore with this in mind, we introduce an Automatic Frequency Selector (AFS) to select helpful frequency components along with the optimization of the overall model.
|
| 351 |
+
|
| 352 |
+
To achieve this goal, we design the Frequency Selection operation under a probabilistic scenario $\Upsilon$ . To be specific, we map each frequency component $f$ into a Bernoulli parameter space by employing a Multi-layer Perceptron (MLP) architecture to parameterize this mapping process. Firstly, we bring in a set of learnable parameters $\xi \in \mathbb{R}^{k\times d_k}$ to parameterize frequency components, where $k$ denotes the number of frequency components, and $d_{k}$ de
|
| 353 |
+
|
| 354 |
+
notes the dimension of component representations. Then, we utilize the MLP architecture (composed of two linear projection layers $Proj_{1}$ and $Proj_{2}$ , and an activation function $\sigma$ (i.e. ReLU)) to map frequency components $\xi$ into the Bernoulli parameter space.
|
| 355 |
+
|
| 356 |
+
$$
|
| 357 |
+
z _ {B} = M L P (\xi) = \operatorname {P r o j} _ {2} \left(\sigma \left(\operatorname {P r o j} _ {1} (\xi)\right)\right), \tag {9}
|
| 358 |
+
$$
|
| 359 |
+
|
| 360 |
+
$$
|
| 361 |
+
\xi_ {B} = \varphi \left(\left(z _ {B} - \log (- \log (\epsilon))\right) / \tau\right) \tag {10}
|
| 362 |
+
$$
|
| 363 |
+
|
| 364 |
+
where $\xi_B$ denotes the success probabilities of Bernoulli distributions, and $\varphi$ denotes the Softmax function. We utilize the Gumbel reparameterization proposed by (Jang et al., 2017; Maddison et al., 2017) to address the differentiable difficulty during training, where $\epsilon \sim \mathcal{U}(0,1)$ is random variables of a uniform distribution on the interval $(0,1)$ . The hyperparameter $\tau \rightarrow 0$ is the annealing temperature, which is adjusted to zero progressively in practice. Next, we can obtain the values of Bernoulli random variables $m_B \sim \text{Bern}(\xi_B)$ , where $m_B \in \{0,1\}^k$ , and $B_{n}$ denotes Bernoulli distributions. During the non-training phase, we set a hyperparameter threshold $\gamma$ to control the sparsity of $m_B$ . (For the Rest14 dataset, we set the threshold $\gamma$ to 0.65. For the other two datasets, the threshold is set at 0.75.)
|
| 365 |
+
|
| 366 |
+
Subsequently, for the $i$ -th and $j$ -th word representations $\mathbf{h}_i \in \mathbb{R}^d$ and $\mathbf{h}_j \in \mathbb{R}^d$ , we can calculate the pair-wise edge score $e_{ij}$ as follows:
|
| 367 |
+
|
| 368 |
+
$$
|
| 369 |
+
\Phi^ {a f s} (x) = \mathcal {F} ^ {- 1} \left(\Upsilon (\mathcal {F} (x))\right), \tag {11}
|
| 370 |
+
$$
|
| 371 |
+
|
| 372 |
+
$$
|
| 373 |
+
e _ {i j} = \Phi^ {a f s} (\mathbf {W} _ {i} \mathbf {h} _ {i}) \Phi^ {a f s} (\mathbf {W} _ {j} \mathbf {h} _ {j}) ^ {\top}, \quad (1 2)
|
| 374 |
+
$$
|
| 375 |
+
|
| 376 |
+
where $\Upsilon$ indicates the Frequency Selection operation, and $\Phi^{afs}$ denotes the Automatic Frequency Selector (AFS). Subsequent operations are consistent with Section 3.1.
|
| 377 |
+
|
| 378 |
+
Table 10: Detailed results of the band impact based on RoBERTa<sub>base</sub> for heuristic frequency selection. For real sequence, the spectrum obtained by the Discrete Fourier Transform is symmetrical, so we only take half of the spectral bands for analysis. Negative values indicate that the frequency is selected from the high-frequency band, and positive values mean that the frequency is selected from the low-frequency band. Additionally, $x \rightarrow y$ means that the frequency selection is between the two values ( $x$ and $y$ ). The values in **bold** indicate superior performance compared to the Attn. method.
|
| 379 |
+
|
| 380 |
+
<table><tr><td rowspan="2">Filter</td><td rowspan="2">Bands</td><td colspan="2">Rest14</td><td colspan="2">Laptop14</td><td colspan="2">Twitter</td></tr><tr><td>Accuracy</td><td>Macro-F1</td><td>Accuracy</td><td>Macro-F1</td><td>Accuracy</td><td>Macro-F1</td></tr><tr><td rowspan="16">HIGH</td><td>-1</td><td>87.32</td><td>80.76</td><td>84.48</td><td>81.54</td><td>75.43</td><td>74.88</td></tr><tr><td>-2</td><td>87.32</td><td>80.79</td><td>84.17</td><td>81.13</td><td>75.72</td><td>74.45</td></tr><tr><td>-3</td><td>87.23</td><td>81.56</td><td>83.86</td><td>81.20</td><td>76.01</td><td>74.34</td></tr><tr><td>-4</td><td>86.88</td><td>80.44</td><td>84.01</td><td>81.34</td><td>75.43</td><td>74.78</td></tr><tr><td>-5</td><td>87.77</td><td>81.62</td><td>83.54</td><td>80.53</td><td>76.30</td><td>75.00</td></tr><tr><td>-6</td><td>87.77</td><td>81.71</td><td>82.76</td><td>79.93</td><td>75.58</td><td>74.34</td></tr><tr><td>-8</td><td>87.77</td><td>80.74</td><td>84.80</td><td>82.27</td><td>76.16</td><td>75.52</td></tr><tr><td>-10</td><td>87.05</td><td>80.79</td><td>83.86</td><td>81.37</td><td>75.58</td><td>74.41</td></tr><tr><td>-12</td><td>87.77</td><td>80.74</td><td>84.48</td><td>81.38</td><td>75.87</td><td>74.45</td></tr><tr><td>-14</td><td>87.75</td><td>81.86</td><td>84.80</td><td>82.21</td><td>75.43</td><td>74.69</td></tr><tr><td>-16</td><td>88.57</td><td>82.95</td><td>84.32</td><td>81.87</td><td>76.45</td><td>75.46</td></tr><tr><td>-18</td><td>86.43</td><td>79.26</td><td>83.54</td><td>80.54</td><td>75.43</td><td>74.08</td></tr><tr><td>-20</td><td>88.13</td><td>82.33</td><td>84.01</td><td>81.06</td><td>76.01</td><td>75.23</td></tr><tr><td>-22</td><td>88.57</td><td>83.27</td><td>84.48</td><td>81.82</td><td>75.58</td><td>74.91</td></tr><tr><td>-24</td><td>87.14</td><td>80.63</td><td>84.17</td><td>81.65</td><td>76.30</td><td>75.18</td></tr><tr><td>-26</td><td>87.50</td><td>80.85</td><td>84.64</td><td>82.04</td><td>76.01</td><td>74.46</td></tr><tr><td rowspan="10">MID-HIGH</td><td>8 → 10</td><td>88.21</td><td>82.41</td><td>84.48</td><td>81.90</td><td>74.57</td><td>74.19</td></tr><tr><td>8 → 11</td><td>87.86</td><td>81.69</td><td>85.42</td><td>83.01</td><td>75.29</td><td>74.59</td></tr><tr><td>8 → 12</td><td>87.50</td><td>80.66</td><td>83.39</td><td>80.49</td><td>75.29</td><td>74.68</td></tr><tr><td>8 → 13</td><td>87.23</td><td>80.13</td><td>83.86</td><td>81.06</td><td>76.88</td><td>75.70</td></tr><tr><td>8 → 14</td><td>86.88</td><td>80.75</td><td>84.48</td><td>81.70</td><td>75.72</td><td>74.90</td></tr><tr><td>8 → 16</td><td>87.95</td><td>81.69</td><td>83.70</td><td>80.92</td><td>77.02</td><td>75.84</td></tr><tr><td>8 → 18</td><td>87.50</td><td>82.16</td><td>85.27</td><td>82.67</td><td>75.72</td><td>74.48</td></tr><tr><td>8 → 20</td><td>88.48</td><td>83.32</td><td>83.70</td><td>80.81</td><td>75.14</td><td>73.63</td></tr><tr><td>8 → 22</td><td>87.05</td><td>79.81</td><td>83.54</td><td>80.50</td><td>76.45</td><td>75.16</td></tr><tr><td>8 → 24</td><td>86.88</td><td>80.53</td><td>84.33</td><td>81.65</td><td>75.00</td><td>73.62</td></tr><tr><td rowspan="4">MID-LOW</td><td>4 → 5</td><td>86.96</td><td>80.50</td><td>84.01</td><td>81.14</td><td>76.45</td><td>75.50</td></tr><tr><td>4 → 6</td><td>87.14</td><td>80.40</td><td>83.70</td><td>81.05</td><td>76.59</td><td>75.61</td></tr><tr><td>4 → 7</td><td>87.14</td><td>81.71</td><td>84.33</td><td>82.10</td><td>77.02</td><td>75.64</td></tr><tr><td>4 → 8</td><td>87.68</td><td>81.99</td><td>82.92</td><td>79.72</td><td>76.87</td><td>75.82</td></tr><tr><td rowspan="4">LOW</td><td>1</td><td>87.41</td><td>81.27</td><td>83.39</td><td>80.44</td><td>76.16</td><td>75.03</td></tr><tr><td>2</td><td>87.86</td><td>81.06</td><td>83.39</td><td>80.55</td><td>76.15</td><td>75.16</td></tr><tr><td>3</td><td>87.23</td><td>80.51</td><td>83.70</td><td>80.80</td><td>76.45</td><td>74.90</td></tr><tr><td>4</td><td>86.96</td><td>80.14</td><td>84.01</td><td>81.64</td><td>75.87</td><td>74.65</td></tr><tr><td>Attn.</td><td>-</td><td>87.59</td><td>81.72</td><td>83.86</td><td>80.53</td><td>75.72</td><td>73.92</td></tr></table>
|
adaptivestructureinductionforaspectbasedsentimentanalysiswithspectralperspective/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:67fdef0f48a0be4203a24a04ae6bf60d63398cd4474fa111dfa6132bebc3af5c
|
| 3 |
+
size 721399
|
adaptivestructureinductionforaspectbasedsentimentanalysiswithspectralperspective/layout.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:90783bd6429af49400af12325ab0433164a80384532038edfe9aa91003b7cce7
|
| 3 |
+
size 457193
|
adaptivetextuallabelnoiselearningbasedonpretrainedmodels/9f0c2540-5afe-4ebc-bba7-b9bd3f7df904_content_list.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b989043352e189a219104dcef04fc1b3d403a72101f840df87ba7eba952612ec
|
| 3 |
+
size 111008
|
adaptivetextuallabelnoiselearningbasedonpretrainedmodels/9f0c2540-5afe-4ebc-bba7-b9bd3f7df904_model.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:19690ee063f6746d0364692bbc20169e7aa86e2b7009bc00fe6f9edd88494819
|
| 3 |
+
size 128369
|
adaptivetextuallabelnoiselearningbasedonpretrainedmodels/9f0c2540-5afe-4ebc-bba7-b9bd3f7df904_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:32edef2023448fa9e76e5294238817acf84eb1ee49cf244f9f83f30a14f62a76
|
| 3 |
+
size 1073366
|
adaptivetextuallabelnoiselearningbasedonpretrainedmodels/full.md
ADDED
|
@@ -0,0 +1,487 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Adaptive Textual Label Noise Learning based on Pre-trained Models
|
| 2 |
+
|
| 3 |
+
Shaohuan Cheng, Wenyu Chen, Mingsheng Fu, Xuanting Xie, Hong Qu*
|
| 4 |
+
|
| 5 |
+
School of Computer Science and Engineering,
|
| 6 |
+
|
| 7 |
+
University of Electronic Science and Technology of China
|
| 8 |
+
|
| 9 |
+
shaohuancheng@std.uestc.edu.cn, cwy@uestc.edu.cn, fms@uestc.edu.cn
|
| 10 |
+
|
| 11 |
+
x624361380@outlook.com, hongqu@uestc.edu.cn
|
| 12 |
+
|
| 13 |
+
# Abstract
|
| 14 |
+
|
| 15 |
+
The label noise in real-world scenarios is unpredictable and can even be a mixture of different types of noise. To meet this challenge, we develop an adaptive textual label noise learning framework based on pre-trained models, which consists of an adaptive warm-up stage followed by a hybrid training stage. Specifically, an early stopping method, relying solely on the training set, is designed to dynamically terminate the warm-up process based on the model's fit level to different noise scenarios. The hybrid training stage incorporates several generalization strategies to gradually correct mistrabeled instances, thereby making better use of noisy data. Experiments on multiple datasets demonstrate that our approach performs on-par with or even better than the state-of-the-art methods in various noise scenarios, including scenarios with the mixture of multiple types of noise.
|
| 16 |
+
|
| 17 |
+
# 1 Introduction
|
| 18 |
+
|
| 19 |
+
In recent years, deep neural networks (DNNs) have been successfully applied in many fields (Pouyanfar et al., 2018; Alinejad et al., 2021; Liu et al., 2023) and the performance largely depends on well-labeled data. However, accessing large-scale datasets with expert annotation in the real world is difficult due to the significant time and labor costs involved. Instead, the noisy data obtained directly from the real world is often utilized in practical scenarios, even though it inevitably contains some incorrect labels. Thus, research on learning with noisy labels has gained attention in various fields such as natural language processing (NLP) (Jindal et al., 2019; Jin et al., 2021; Wu et al., 2022).
|
| 20 |
+
|
| 21 |
+
There are two main types of label noise in NLP: class-conditional noise (CCN) and instance-dependent noise (IDN). CCN assumes that label noise is dependent on the true class, which can simulate the confusion between similar classes like
|
| 22 |
+
|
| 23 |
+
"Game" and "Entertainment". On the other hand, IDN assumes that label noise is dependent on the instance, which simulates the confusion caused by the characteristics of the instance. For example, a piece of news containing the phrase "played on a pitch as slow as a bank queue" may be misclassified as Economic news instead of Sports news due to the specific wording. However, most studies focus on a particular type of noise. For example, Jindal et al. (2019) introduces a non-linear processing layer to learn the noise transition matrix of CCN. Qiao et al. (2022) designs the class-regularization loss according to the characteristic of IDN. However, there is a premise for applying these methods, which is that the noise is known and of a single type.
|
| 24 |
+
|
| 25 |
+
In the real-world, the noise scenarios are more complex and involve a mixture of multiple noises arising from various factors, such as data ambiguity, collection errors, or annotator inexperience. Methods that specifically target one type of noise are less effective when dealing with other types of noise. This limitation hinders their applicability in real scenarios where the noise is unknown and variable.
|
| 26 |
+
|
| 27 |
+
To address the challenges posed by real noise scenarios, we develop an adaptive textual label noise learning framework based on pre-trained models. This framework can handle various noise scenarios well, including different types of noise and mixed noise types. Specifically, our approach begins with an adaptive warm-up stage, then divides the data into clean and noisy sets by the correctness statistic of samples, and utilizes different generalization strategies on them. In particular, there are three key designs in our approach. First, the warm-up stage is designed to automatically stop early based on the model's fit level to the noise scenario, which effectively prevents the model overfitting erroneous labels especially under IDN scenarios or with a high ratio of noise. No
|
| 28 |
+
|
| 29 |
+
tably, the adaptive warm-up method relies solely on the raw training set, rather than a clean validation set, making it more suitable for practical scenarios. Second, unlike previous works (Li et al., 2020; Qiao et al., 2022) that fit GMM (Permuter et al., 2006) on the training losses to separate data, the data is separated according to the correctness statistic of each sample. The correctness statistic is accumulated by assessing the consistency between the model's predictions and the given labels during the warm-up stage. This prolonged observation provides more accurate grounds for data partitioning. Third, a linear decay fusion strategy is designed to gradually correct the potential wrong labels to generate more accurate pseudo-labels by adjusting the fusion weights of the original labels and the model outputs.
|
| 30 |
+
|
| 31 |
+
We conduct extensive experiments on four classification datasets, considering different types of noise: class-conditional noise, instance-dependent noise, and a mixture of multiple noises. To the best of our knowledge, previous methods have not explored such mixed noise. The experimental results demonstrate that our method surpasses existing general methods and approaches the performance of methods specifically designed for particular noise types in different noise settings. Our contributions can be concluded as follows:
|
| 32 |
+
|
| 33 |
+
- We design an early stopping method for finetuning the pre-trained models, which adapts to various noise scenarios and datasets and achieves near the best test accuracy by relying solely on training set.
|
| 34 |
+
- We develop an adaptive noise learning framework based on pre-trained models, which can make good use of different types of noisy data while effectively preventing the model from overfitting erroneous labels.
|
| 35 |
+
- Experimental results of various noise settings show that our approach performs comparably or even surpasses the state-of-the-art methods in various noise scenarios, which proves the superiority of our proposed method in practical scenarios.
|
| 36 |
+
|
| 37 |
+
# 2 Related work
|
| 38 |
+
|
| 39 |
+
Universal Label Noise Learning. Label noise learning methods can be divided into two groups: loss correction and sample selection methods
|
| 40 |
+
|
| 41 |
+
(Liang et al., 2022). Loss correction tries to reduce the effect of noisy labels during training by adding regularization item in loss, designing robust network structure for noisy label and so on. For example, Wang et al. (2019) adds a reverse cross-entropy term to the traditional loss to reduce the disturbance brought by noise. ELR (Liu et al., 2020) adds a regularization term to prevent the model from memorizing the noisy labels because it would not be fitted in the early training stage. Sample selection divides the data into clean and noisy subsets, and uses different methods for different subsets. For example, Co-Teaching (Han et al., 2018) maintains two networks. During training, the two networks respectively pick out some small-loss samples as clean data for each other to learn. DivideMix (Li et al., 2020) uses Gaussian mixture model to separate clean and noisy samples. The noisy samples are treated as unlabeled data, whose pseudo-labels are generated by the model. Finally, Mixmatch (Berthelot et al., 2019) method is adopted for mixed training on clean set and noisy set.
|
| 42 |
+
|
| 43 |
+
Labels Noise Learning in NLP. The above works mainly focus on vision tasks, the researches on textual scenarios are relatively fewer. Jindal et al. (2019) and Garg et al. (2021) add additional noise modules based on lightweight models such as CNN and LSTM to learn the probability of noise transfer. (Liu et al., 2022; Tanzer et al., 2021; Zhu et al., 2022; Qiao et al., 2022) conduct research on pre-trained models and find that pre-trained models demonstrate superior performance in noise learning compared to trained-from-scratch models. However, most works focus on one certain type of noise such as CCN. Qiao et al. (2022) studies both CCN and IDN, but still conducts experiments in settings where the type of noise is known and designs specific regularization loss for IDN.
|
| 44 |
+
|
| 45 |
+
Few works have focused on general methods of label noise in NLP. Zhou and Chen (2021) develops a general denoising framework for information retrieval tasks, which reduces the effect of noise by adding a regularization loss to samples whose model predictions are inconsistent with the given label. Jin et al. (2021) proposes an instance-adaptive training framework to address the problem of dataset-specific parameters and validates its versatility across multiple tasks. However, these methods rely on additional components, such as supplementary structures or auxiliary dataset, which limits their practicality. In contrast, our method relies
|
| 46 |
+
|
| 47 |
+

|
| 48 |
+
Figure 1: The overall diagram of the proposed method
|
| 49 |
+
|
| 50 |
+
solely on a single network and the noisy training data, making it superior in terms of practicality.
|
| 51 |
+
|
| 52 |
+
# 3 Methodology
|
| 53 |
+
|
| 54 |
+
Problem Definition. Without loss of generalization, we take text classification as an example. Given a noisy training dataset $\tilde{D} = (X,\tilde{Y}) = \{(x_i,\tilde{y}_i)\}_{i = 1}^N$ , the one-hot label $\tilde{y}_i$ associated with sample $x_{i}$ is probably wrong. Our goal is to learn a classification model $p(y|x;\theta ,\zeta)$ from the noisy dataset $\tilde{D}$ , which generalizes well on clean test data. Specifically, the classification model $p(y|x;\theta ,\zeta)$ consists of a pre-trained encoder and a classifier with parameters $\theta$ and $\zeta$ , respectively.
|
| 55 |
+
|
| 56 |
+
Overview of the Proposed Method. To address various noise types, we propose a general learning method consisting of the warm-up training stage and the hybrid training stage, and the overall diagram is shown in Figure 1. The classification model $p(y|x;\theta ,\zeta)$ is first trained by the raw data in the warm-up stage to form the initial classification ability. During the warm-up stage, we also maintain a correctness statistic to justify whether the model begins to overfit the noisy data. Once there is a sign of overfitting to noisy data, we will stop the warm-up, and move on to the subsequent hybrid training stage. During the hybrid training stage, the raw data is divided into the clean set and noisy set according to the correctness statistic, and then further train model $p(y|x;\theta ,\zeta)$ by applying different training strategies to the clean set and the noisy set respectively.
|
| 57 |
+
|
| 58 |
+
# 3.1 Adaptive warm-up
|
| 59 |
+
|
| 60 |
+
The goal of this warm-up stage is to obtain a classification model that fits clean data well but not noisy data. As shown in Figure 2, however, the optimal warm-up time may vary significantly for different noise scenarios. To meet this challenge,
|
| 61 |
+
|
| 62 |
+

|
| 63 |
+
|
| 64 |
+

|
| 65 |
+
(a) $40\%$ Asym
|
| 66 |
+
|
| 67 |
+

|
| 68 |
+
|
| 69 |
+

|
| 70 |
+
(b) $40\%$ IDN
|
| 71 |
+
Figure 2: The memorization observation of different noise cases. Label recall on top figures, train and test accuracy on bottom figures. MOTA is short for the maximum obtainable test accuracy. More cases can be found in Appendix A.
|
| 72 |
+
|
| 73 |
+
an adaptive early stopping condition is involved to terminate the warm-up training before overfitting noisy data. The details of our warm-up stage are given as follows.
|
| 74 |
+
|
| 75 |
+
Training Data. We directly use the raw noisy dataset $\tilde{D}$ to warm up the classification model and determine when to stop early.
|
| 76 |
+
|
| 77 |
+
Learning objective. The standard cross-entropy loss is used to warm up the model:
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\mathcal {L} _ {\text {w a r m}} = - \sum_ {i = 1} ^ {N} \tilde {y} _ {i} ^ {T} \log \left(p \left(\tilde {y} _ {i} \mid x _ {i}; \theta , \zeta\right)\right). \tag {1}
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
Overfitting regarding noisy data. Our stopping condition is based on the following Assumption 1 and Assumption 2.
|
| 84 |
+
|
| 85 |
+
Assumption 1: As learning progresses, the clean data is fitted faster than the noisy data. We empirically demonstrate that the clean samples can be recalled earlier than the noisy samples during learning (see Figure 2), regardless of the noise types. This is mainly caused by the memorization effect (Arpit et al., 2017) which means DNNs tend to learn simple patterns before fitting noise. As a result, the whole learning process can be roughly divided into Clean Rising (CR) phase (where most clean samples are quickly learned) and Noisy Rising (NR) phase (where the noisy samples are fitted slowly), which are differentiated by backgrounds in Figure 2.
|
| 86 |
+
|
| 87 |
+
Assumption 2: The prediction regarding noisy data tends to swing between the true label and the
|
| 88 |
+
|
| 89 |
+

|
| 90 |
+
Figure 3: Examples of the model output during training under different noise settings. The given label of clean samples is true. More examples can be found in Appendix A.
|
| 91 |
+
|
| 92 |
+
noisy label. It originates from another memorization phenomenon regarding noisy samples(Chen et al., 2021). The results in Figure 3 also demonstrate that the prediction for the noisy samples exhibits a higher level of inconsistency with the given label due to the activation of the true label.
|
| 93 |
+
|
| 94 |
+
Correctness statistic. According to these two assumptions, we update the correctness statistic of training set at intervals to judge whether the model begins to overfit the noisy data. Specifically, for a given sample $x_{i}$ with label $\tilde{y}_{i}$ , its correctness coefficient $m_{i}^{t}$ is:
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
m _ {i} ^ {t} = \sum_ {t} r _ {i} ^ {t}, \tag {2}
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
obtained by,
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
r _ {i} ^ {t} = \left\{ \begin{array}{l} 1, \text {i f} \underset {k \in K} {\arg \max } p ^ {k} \left(x _ {i}; \theta , \zeta\right) = \underset {k \in K} {\arg \max } \tilde {y} _ {i} ^ {k} \\ - 1, \text {e l s e .} \end{array} \right. \tag {3}
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
where the correctness $r_i^t$ indicates whether the prediction of sample $x_i$ is consistent with the given label at moment $t$ , and $m_i^t$ is the statistic of correctness in a given time range.
|
| 107 |
+
|
| 108 |
+
The higher the number of correct predictions compared to incorrect predictions for a sample, the higher the degree to which the model fits that sample. Intuitively, positive $m_{i}^{t}$ indicates $x_{i}$ has been fitted by the model at moment $t$ .
|
| 109 |
+
|
| 110 |
+
Furthermore, we have a proportion ratio $^t$ ,
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
r a t i o ^ {t} = \frac {1}{N} \sum_ {i} \mathbb {I} \left(m _ {i} ^ {t} > 0\right), \tag {4}
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
which indicates the sample fitting level for the whole dataset with $N$ samples.
|
| 117 |
+
|
| 118 |
+
Early stopping condition. Through observing the change of $ratio^t$ , we can determine whether the learning process has entered the NR phase. According to Assumption 1, in the CR phase, $ratio^t$
|
| 119 |
+
|
| 120 |
+
should increase fast since the model fits clean samples quickly. In the NR phase, $ratiot$ should stay within a certain range for an extended period because the noisy samples are difficult to fit (Assumption 2).
|
| 121 |
+
|
| 122 |
+
As a consequence, if $ratiot$ stays within a range $\varepsilon$ for $\eta$ times, we can assume that the learning process has entered the NR phase. To approach the optimal stopping point, we continue to warm up the model until a certain improvement in the training accuracy. The magnitude of improvement is set to be a fraction $\rho_{1}$ of the current remaining accuracy. The pseudo-code for adaptive warm-up process is shown in Appendix B. Note that this adaptive warm-up process is suitable for different noise scenarios due to Assumption 1 and Assumption 2 can be widely satisfied by different noise types.
|
| 123 |
+
|
| 124 |
+
# 3.2 Hybrid training
|
| 125 |
+
|
| 126 |
+
To further leverage the underlying values of noisy samples, we propose a hybrid training method applying different training strategies to clean samples and noisy samples respectively.
|
| 127 |
+
|
| 128 |
+
Data. Based on the correctness statistic $M = \{m_i^{t'}\}_{i=1}^N$ (assuming $t'$ is the stopping time of the warm-up stage), the whole training set $\tilde{D} = \{(x_i, \tilde{y}_i)\}_{i=1}^N$ can be divided into the "clean" set $\tilde{D}_c$ and "noisy" set $\tilde{D}_n$ as follows.
|
| 129 |
+
|
| 130 |
+
$$
|
| 131 |
+
\tilde {D} _ {c} = \left(X _ {c}, \tilde {Y} _ {c}\right) = \left\{\left(x _ {i}, \tilde {y} _ {i}\right) | \text {i f} m _ {i} ^ {t ^ {\prime}} \geq l \right\},
|
| 132 |
+
$$
|
| 133 |
+
|
| 134 |
+
$$
|
| 135 |
+
\tilde {D} _ {n} = \left(X _ {n}, \tilde {Y} _ {n}\right) = \left\{\left(x _ {i}, \tilde {y} _ {i}\right) | \text {i f} m _ {i} ^ {t ^ {\prime}} < l \right\}, \tag {5}
|
| 136 |
+
$$
|
| 137 |
+
|
| 138 |
+
where $l$ is the $N\rho_{2}$ -th largest correctness statistic value of $M$ because a larger number indicates that the sample is fitted earlier and has a higher probability of being a clean sample. $\rho_{2}$ is a given percentage, which is set to $20\%$ .
|
| 139 |
+
|
| 140 |
+
Pseudo-labeling. To minimize the side-effects of the noisy labels, we regenerate labels for both the clean set $\tilde{D}_c$ and noisy set $\tilde{D}_n$ through the pseudolabeling method combining the original labels and the prediction of the classification model. Note that there may inevitably be some noisy samples in set $\tilde{D}_c$ , albeit fewer than in $\tilde{D}_n$ .
|
| 141 |
+
|
| 142 |
+
For each sample $(x_{i},\tilde{y}_{i})$ in clean set $\tilde{D}_c$ , the corresponding pseudo-labels $\hat{y}_i$ is obtained by,
|
| 143 |
+
|
| 144 |
+
$$
|
| 145 |
+
\hat {y} _ {i} = w _ {c} ^ {t} \cdot \tilde {y} _ {i} + (1 - w _ {c} ^ {t}) \cdot p \left(x _ {i}; \theta , \zeta\right), \tag {6}
|
| 146 |
+
$$
|
| 147 |
+
|
| 148 |
+
where the weight $w_{c}^{t}$ decays linearly with the training step $t$ , which is calculated by,
|
| 149 |
+
|
| 150 |
+
$$
|
| 151 |
+
w _ {c} ^ {t} = 1 - \left(1 - \delta_ {1}\right) \cdot \frac {t}{T}, \tag {7}
|
| 152 |
+
$$
|
| 153 |
+
|
| 154 |
+
where $T$ indicates the all training steps of this stage, $w_{c}^{t}$ decays from 1 to $\delta_{1}$ due to relatively reliable labels in the clean set $\tilde{D}_c$ .
|
| 155 |
+
|
| 156 |
+
Likewise, for each sample in noisy set $\tilde{D}_n$ , its pseudo-labels $\hat{y}_i$ are obtained by,
|
| 157 |
+
|
| 158 |
+
$$
|
| 159 |
+
w _ {n} ^ {t} = \delta_ {2} \cdot \left(1 - \frac {t}{T}\right), \tag {8}
|
| 160 |
+
$$
|
| 161 |
+
|
| 162 |
+
$$
|
| 163 |
+
\hat {y} _ {i} = w _ {n} ^ {t} \cdot \tilde {y} _ {i} + (1 - w _ {n} ^ {t}) \cdot p (x _ {i}; \theta , \zeta),
|
| 164 |
+
$$
|
| 165 |
+
|
| 166 |
+
where $w_{n}^{t}$ decays from $\delta_{2}$ to 0 due to most labels in $\tilde{D}_n$ are incorrect.
|
| 167 |
+
|
| 168 |
+
By linearly decaying the weight of original labels, a good balance is achieved between leveraging the untapped label information and discarding noise. As the accuracy of the classification model's predictions continues to improve, the generated pseudo-labels will be closer to the true labels.
|
| 169 |
+
|
| 170 |
+
Furthermore, for each pseudo-label $\hat{y}_i$ , we adopt the sharpen function to encourage the model to generate low entropy predictions, i.e., $\hat{y}_i = \hat{y}_i^{1 / \tau} / \left\| \hat{y}_i^{1 / \tau}\right\|_1$ , where $\tau$ is the temperature parameter and $\| \cdot \| _1$ is $l_{1}$ -norm. Finally, the new whole set $\hat{D} = \{(x_i,\hat{y}_i)\}_{i = 1}^N$ is reformed by clean and noisy sets.
|
| 171 |
+
|
| 172 |
+
Mixup. To enhance the generalization of the model, mixup technique (Zhang et al., 2017; Berthelot et al., 2019) is adopted to introduce diverse and novel examples during training. Different from mixing pictures directly in vision tasks, the text input cannot be directly mixed due to the discreteness of words. Like previous work (Berthelot et al., 2019; Qiao et al., 2022) in NLP, the sentence presentations encoded by pre-trained encoder are used to perform mixup:
|
| 173 |
+
|
| 174 |
+
$$
|
| 175 |
+
\lambda = \operatorname {B e t a} (\alpha , \alpha) \tag {9}
|
| 176 |
+
$$
|
| 177 |
+
|
| 178 |
+
$$
|
| 179 |
+
\lambda^ {\prime} = \max (\lambda , 1 - \lambda) \tag {10}
|
| 180 |
+
$$
|
| 181 |
+
|
| 182 |
+
$$
|
| 183 |
+
h ^ {\prime} = \lambda^ {\prime} p \left(x _ {i}; \theta\right) + \left(1 - \lambda^ {\prime}\right) p \left(x _ {j}; \theta\right) \tag {11}
|
| 184 |
+
$$
|
| 185 |
+
|
| 186 |
+
$$
|
| 187 |
+
y ^ {\prime} = \lambda^ {\prime} \hat {y} _ {i} + (1 - \lambda^ {\prime}) \hat {y} _ {j} \tag {12}
|
| 188 |
+
$$
|
| 189 |
+
|
| 190 |
+
where $\alpha$ is the parameter of Beta distribution, $p(x;\theta)$ is the sentence embedding which corresponds to "[CLS]" token. $(x_{i},\hat{y}_{i})$ and $(x_{j},\hat{y}_{j})$ are randomly sampled in the corrected set $\hat{D}$ .
|
| 191 |
+
|
| 192 |
+
The mixed hidden states $\{h_i^{\prime}\}_{i = 1}^{N}$ and targets $\{y_i^{\prime}\}_{i = 1}^{N}$ are used to train the classifier by applying entropy loss:
|
| 193 |
+
|
| 194 |
+
$$
|
| 195 |
+
\mathcal {L} _ {m i x} = - \sum_ {i = 1} ^ {N} y _ {i} ^ {\prime T} \log \left(p \left(h ^ {\prime}; \zeta\right)\right) \tag {13}
|
| 196 |
+
$$
|
| 197 |
+
|
| 198 |
+
<table><tr><td>Datasets</td><td>Classes</td><td>Traning</td><td>Testing</td><td>Type</td></tr><tr><td>Trec</td><td>6</td><td>5,452</td><td>500</td><td>Question</td></tr><tr><td>Agnews</td><td>4</td><td>120,000</td><td>7,600</td><td>News Topic</td></tr><tr><td>IMDB</td><td>2</td><td>25,000</td><td>25,000</td><td>Movie Review</td></tr><tr><td>Chnsenticorp</td><td>2</td><td>10,430</td><td>1,200</td><td>Hotel Review</td></tr></table>
|
| 199 |
+
|
| 200 |
+
Table 1: The statistics of datasets
|
| 201 |
+
|
| 202 |
+
R-Drop. Since the prediction of the model is fused in pseudo-labeling, it needs to be as accurate as possible. Therefore, the R-Drop strategy (liang et al., 2021) is applied on noisy samples $X_{n}$ to promote the model to have a consistent output distribution for the same input. R-Drop minimizes the Kullback-Leibler divergence between two distributions predicted by the model with dropout mechanism for the same sample:
|
| 203 |
+
|
| 204 |
+
$$
|
| 205 |
+
\begin{array}{l} \mathcal {L} _ {d r o p} = \sum_ {i = 1} ^ {M} \frac {1}{2} \left(\mathcal {D} _ {K L} \left(p _ {1} \left(x _ {i}; \theta , \zeta\right) | | p _ {2} \left(x _ {i}; \theta , \zeta\right)\right) \right. \\ \left. + \mathcal {D} _ {K L} \left(p _ {2} \left(x _ {i}; \theta , \zeta\right) \mid \mid p _ {1} \left(x _ {i}; \theta , \zeta\right)\right)\right), \tag {14} \\ \end{array}
|
| 206 |
+
$$
|
| 207 |
+
|
| 208 |
+
where $M$ is the number of noisy samples $X_{n}$ . $p_1(x_i;\theta)$ and $p_2(x_i;\theta)$ are two predictions of $x_{i}$ .
|
| 209 |
+
|
| 210 |
+
Learning objective. The total loss is:
|
| 211 |
+
|
| 212 |
+
$$
|
| 213 |
+
\mathcal {L} = \mathcal {L} _ {\text {m i x}} + \beta \mathcal {L} _ {\text {d r o p}}, \tag {15}
|
| 214 |
+
$$
|
| 215 |
+
|
| 216 |
+
where $\beta$ is the hyper-parameter of KL loss, which is set to 0.3 in experiments.
|
| 217 |
+
|
| 218 |
+
# 4 Experiments
|
| 219 |
+
|
| 220 |
+
# 4.1 Experimental settings
|
| 221 |
+
|
| 222 |
+
Datasets Experiments are conducted on four text classification datasets, including Trec (Voorhees et al., 1999), Agnews (Zhang et al., 2015), IMDB (Maas et al., 2011) and Chnsenticorp (Tan and Zhang, 2008), where Chnsenticorp is Chinese dataset and the rests are English datasets. The statistics of datasets are presented in Table 1, where the training set of Chnsenticorp is a merger of the original training and the validation set.
|
| 223 |
+
|
| 224 |
+
Noise types The following types of noise are injected to standard datasets:
|
| 225 |
+
|
| 226 |
+
Class-conditional noise: We choose typical symmetric (Sym) and asymmetric (Asym) noises in various class-conditional noise to conduct experiments. Symmetric noise flips a certain percentage of labels in a given category into other categories uniformly. Asymmetric noise flips labels between given similar class pairs. IMDB and Chnsenticorp
|
| 227 |
+
|
| 228 |
+
<table><tr><td colspan="2">Noise Type</td><td colspan="2">Sym</td><td colspan="4">Asym</td><td colspan="3">IDN</td><td colspan="2">even mixture (Sym & Asym)</td><td colspan="4">even mixture (Asym & IDN)</td><td colspan="2">uneven mixture (all three)</td></tr><tr><td colspan="2">Dataset</td><td>Trec</td><td>Agnews</td><td>Trec</td><td>Agnews</td><td>IMDB</td><td>Chn</td><td>Agnews</td><td>IMDB</td><td>Chn</td><td colspan="2">Trec</td><td colspan="2">IMDB</td><td colspan="2">Chn</td><td colspan="2">Agnews</td></tr><tr><td colspan="2">Noise Ratio</td><td colspan="2">40</td><td colspan="4">40</td><td colspan="3">40</td><td>20</td><td>40</td><td>20</td><td>40</td><td>20</td><td>40</td><td>20</td><td>40</td></tr><tr><td rowspan="2">BERT-FT</td><td>Best</td><td>94.12</td><td>92.68</td><td>90.96</td><td>92.80</td><td>84.85</td><td>81.88</td><td>75.84</td><td>72.16</td><td>73.66</td><td>95.92</td><td>93.28</td><td>88.87</td><td>81.28</td><td>91.86</td><td>83.06</td><td>92.09</td><td>90.87</td></tr><tr><td>Last</td><td>87.40</td><td>80.92</td><td>76.60</td><td>71.30</td><td>64.07</td><td>66.82</td><td>69.26</td><td>68.67</td><td>67.03</td><td>95.16</td><td>85.64</td><td>85.79</td><td>72.46</td><td>85.63</td><td>69.68</td><td>90.78</td><td>85.44</td></tr><tr><td rowspan="2">CT</td><td>Best</td><td>94.16</td><td>92.98</td><td>90.20</td><td>92.61</td><td>81.35</td><td>91.21</td><td>77.34</td><td>72.72</td><td>74.06</td><td>96.16</td><td>94.20</td><td>88.30</td><td>80.87</td><td>92.91</td><td>85.01</td><td>92.37</td><td>91.23</td></tr><tr><td>Last</td><td>88.28</td><td>85.75</td><td>77.04</td><td>91.17</td><td>61.85</td><td>66.58</td><td>70.01</td><td>70.09</td><td>69.06</td><td>94.88</td><td>88.68</td><td>86.22</td><td>72.68</td><td>87.53</td><td>68.95</td><td>91.21</td><td>88.21</td></tr><tr><td rowspan="2">ELR</td><td>Best</td><td>94.68</td><td>93.06</td><td>92.64</td><td>92.88</td><td>85.70</td><td>91.83</td><td>75.65</td><td>72.08</td><td>73.57</td><td>96.24</td><td>94.64</td><td>88.92</td><td>80.58</td><td>92.65</td><td>83.63</td><td>92.30</td><td>90.94</td></tr><tr><td>Last</td><td>93.48</td><td>91.68</td><td>85.24</td><td>90.73</td><td>78.28</td><td>84.91</td><td>70.18</td><td>68.77</td><td>69.01</td><td>96.16</td><td>93.52</td><td>87.15</td><td>76.10</td><td>90.28</td><td>79.58</td><td>91.74</td><td>90.11</td></tr><tr><td rowspan="2">SelfMix*</td><td>Best</td><td>94.04</td><td>92.91</td><td>95.32</td><td>93.22</td><td>87.41</td><td>89.02</td><td>84.09</td><td>80.74</td><td>84.02</td><td>95.64</td><td>94.16</td><td>89.88</td><td>84.34</td><td>92.91</td><td>87.70</td><td>92.11</td><td>91.15</td></tr><tr><td>Last</td><td>93.56</td><td>92.71</td><td>94.96</td><td>92.95</td><td>86.19</td><td>83.45</td><td>83.15</td><td>79.99</td><td>83.52</td><td>94.28</td><td>93.60</td><td>87.88</td><td>82.67</td><td>92.03</td><td>86.66</td><td>86.55</td><td>90.24</td></tr><tr><td rowspan="2">Ours</td><td>Best</td><td>94.72</td><td>93.27</td><td>96.32</td><td>93.56</td><td>89.13</td><td>92.65</td><td>85.40</td><td>80.07</td><td>84.25</td><td>96.48</td><td>94.36</td><td>89.05</td><td>83.47</td><td>93.23</td><td>88.47</td><td>92.65</td><td>91.33</td></tr><tr><td>Last</td><td>94.20</td><td>92.33</td><td>96.00</td><td>91.06</td><td>88.21</td><td>89.99</td><td>84.76</td><td>75.42</td><td>84.03</td><td>96.16</td><td>93.68</td><td>87.87</td><td>81.58</td><td>88.36</td><td>85.42</td><td>91.74</td><td>90.25</td></tr></table>
|
| 229 |
+
|
| 230 |
+
Table 2: Results (%) of five runs on Trec, Agnews, IMDB and Chnsenticorp under different noise settings. The bolded results means the highest among all best scores and the underlined results means the highest among all last scores. Chn is short for Chnsenticorp. * means some hyper-parameters are adjusted according to the type of noise and the composition ratio of mixture noise.
|
| 231 |
+
|
| 232 |
+
are binary classification datasets, so their symmetric and asymmetric noises are the same.
|
| 233 |
+
|
| 234 |
+
Instance-dependent noise: Follow (Qiao et al., 2022), a LSTM classifier is trained to determine which sample features are likely to be confused. The labels of the samples closest to the decision boundary are flipped to their opposite category based on the classifier prediction probability. All datasets except Trec are used because of its small sample size and uneven categories. Main experiments only show results for a single type of noise with a ratio of $40\%$ , results for other ratios can be found in the Appendix C.
|
| 235 |
+
|
| 236 |
+
Mixture of multiple noises: We mix different types of noise to verify the ability of the algorithm to deal with complex and unknown scenarios. For datasets with only two types of noise, including Trec, IMDB and Chnnticorp, we mix the two noises evenly. Specifically, Sym and Asym are evenly mixed on Trec, Asym and IDN are evenly mixed on IMDB and Chnnticorp. For Agnews, we mix three noises unevenly for a larger challenge. The result of evenly mixing of two types of noise on Agnews is in Appendix C.
|
| 237 |
+
|
| 238 |
+
# 4.2 Baselines
|
| 239 |
+
|
| 240 |
+
BERT-FT (Devlin et al., 2018): the benchmark classification model without special methods, directly trained on noisy data.
|
| 241 |
+
|
| 242 |
+
Co-Teaching (CT for short) (Han et al., 2018): a well-known noise learning method, which maintains two models simultaneously and lets each model select clean samples for the other to train.
|
| 243 |
+
|
| 244 |
+
ELR (Liu et al., 2020): ELR designs a regularization term to prevent the model from memorizing noisy labels by increasing the magnitudes of the coefficients on clean samples to counteract the effect
|
| 245 |
+
|
| 246 |
+
of wrong samples.
|
| 247 |
+
|
| 248 |
+
SelfMix(Qiao et al., 2022): SelfMix first warms up the model and then uses GMM to separate data to perform semi-supervised self-training, and designs the normalization method according to the characteristics of IDN, resulting in a significant performance improvement compared to other methods lacking specific designs.
|
| 249 |
+
|
| 250 |
+
For fair comparison, the backbone model of each method is the same, including a pre-trained encoder BERT and a two-layer MLP. The training time of all methods except SelfMix is set to 6 epochs and their hyper-parameters are the same under different noise settings. For SelfMix, we follow the instructions of its paper to set different hyper-parameters for different datasets and noise types. Specially, the warm time for symmetric and asymmetric noise is 2 epochs, the warm time for instance-dependent noise is 1 epoch, and the semi-supervised self-training time is 4 epochs. The average results are run five times on the code base provided by Qiao et al. (2022).
|
| 251 |
+
|
| 252 |
+
# 4.3 Parameter settings
|
| 253 |
+
|
| 254 |
+
The same hyper-parameters as baselines remain unchanged, where the maximum sentence length is 256, the learning rate is 1e-5, the drop rate is 0.1, the size of middle layer of MLP is 768 and optimizer is set to Adam. Additionally, the temperature $\tau$ is 0.5, $\alpha$ of Beta distribution is 0.75.
|
| 255 |
+
|
| 256 |
+
There are some specific hyper-parameters in our method. Specifically, in warm up stage, the interval $s$ of monitoring training set is 1/10 epoch, the converge range $\varepsilon$ is 0.01, the times $\eta$ is 3 and the
|
| 257 |
+
|
| 258 |
+
fraction $\rho_{1}$ is 0.1, the batch size is 12. In hybrid training stage, the fraction $\rho_{2}$ to divide data is 0.2, the threshold $\delta_{1}$ is 0.9 and $\delta_{2}$ is 0.4, and the loss weight $\beta$ is 0.3. The batch size of clean set in hybrid training stage is 3 and the batch size of noisy set is 12 to match the ration $\rho_{2}$ of their numbers.
|
| 259 |
+
|
| 260 |
+
The duration of the warm up stage varies under different noise settings. The hybrid training stage lasts for 4 epochs to compare with SelfMix. For generality, the parameters used in all cases are same as above.
|
| 261 |
+
|
| 262 |
+
# 4.4 Main Results
|
| 263 |
+
|
| 264 |
+
Table 2 demonstrates the main results of our method and baselines.
|
| 265 |
+
|
| 266 |
+
Baselines BERT-FT is highly affected by noise, with its performance and stability decreasing significantly as the complexity of noise increases. CT and ELR demonstrate strengths in handling simple noise scenarios, such as Trec with $40\%$ symmetric noise and a mixture of symmetric and asymmetric noise. However, they perform poorly under more complex noise settings, such as IDN noise. In contrast, SelfMix excels in cases involving IDN due to its design of class-regularization loss and reduced warm-up time. Among all the methods, only SelfMix needs to adjust specific hyper-parameters based on the dataset and noise type.
|
| 267 |
+
|
| 268 |
+
Our method In contrast to the baselines, our method consistently performs well across all noise scenarios. With simple CCN setting, our method exhibits further improvements in performance compared to well-performing baselines like ELR. With IDN setting, our method outperforms general baselines and even surpasses SelfMix in certain cases, such as on Agnews and Chnsenticorp. Moreover, when confronted with mixed noise, our method consistently achieves top or near-top results while maintaining stability. In conclusion, our approach demonstrates superior performance and adaptability in various noise scenarios, making it more practical for real-world scenarios.
|
| 269 |
+
|
| 270 |
+
# 5 Analysis
|
| 271 |
+
|
| 272 |
+
In this section, some experiments are designed to make a more comprehensive analysis of our proposed method. The main results are shown in Table 3 and the correspond analyses are as follows. More analyses can be found in Appendix D.
|
| 273 |
+
|
| 274 |
+
<table><tr><td colspan="2">Dataset
|
| 275 |
+
Noise Type</td><td colspan="2">Trec
|
| 276 |
+
Asym</td><td colspan="2">Chnssenticorp
|
| 277 |
+
IDN</td></tr><tr><td colspan="2">Method/Ratio</td><td>20</td><td>40</td><td>10</td><td>40</td></tr><tr><td rowspan="3">Ours</td><td>Clean</td><td>99.20</td><td>94.89</td><td>95.71</td><td>75.57</td></tr><tr><td>Best</td><td>96.68</td><td>96.32</td><td>94.75</td><td>84.25</td></tr><tr><td>Last</td><td>96.36</td><td>96.00</td><td>93.24</td><td>84.03</td></tr><tr><td rowspan="2">w/o linear decay fusion</td><td>Best</td><td>95.60</td><td>90.08</td><td>93.53</td><td>83.97</td></tr><tr><td>Last</td><td>95.48</td><td>89.80</td><td>92.34</td><td>81.08</td></tr><tr><td rowspan="2">w/o correctness statistic</td><td>Best</td><td>96.32</td><td>95.16</td><td>93.78</td><td>74.89</td></tr><tr><td>Last</td><td>96.24</td><td>94.76</td><td>92.33</td><td>68.68</td></tr><tr><td rowspan="2">w/o mixup</td><td>Best</td><td>96.32</td><td>96.20</td><td>94.17</td><td>79.67</td></tr><tr><td>Last</td><td>95.72</td><td>95.96</td><td>90.22</td><td>74.22</td></tr><tr><td rowspan="2">w/o r-drop</td><td>Best</td><td>96.04</td><td>95.72</td><td>93.30</td><td>76.58</td></tr><tr><td>Last</td><td>95.40</td><td>95.20</td><td>75.08</td><td>64.53</td></tr><tr><td rowspan="2">1 epoch warm-up time</td><td>Best</td><td>94.20</td><td>93.64</td><td>94.33</td><td>83.60</td></tr><tr><td>Last</td><td>93.44</td><td>93.24</td><td>90.97</td><td>83.60</td></tr><tr><td rowspan="2">2 epoch warm-up time</td><td>Best</td><td>96.36</td><td>95.36</td><td>93.80</td><td>80.65</td></tr><tr><td>Last</td><td>96.16</td><td>95.12</td><td>92.55</td><td>78.20</td></tr><tr><td rowspan="2">3 epoch warm-up time</td><td>Best</td><td>96.60</td><td>96.80</td><td>93.30</td><td>77.15</td></tr><tr><td>Last</td><td>96.36</td><td>96.52</td><td>90.33</td><td>75.87</td></tr><tr><td rowspan="2">4 epoch warm-up time</td><td>Best</td><td>96.52</td><td>96.44</td><td>93.47</td><td>70.35</td></tr><tr><td>Last</td><td>96.24</td><td>96.20</td><td>88.98</td><td>69.32</td></tr><tr><td rowspan="3">separate data with GMM</td><td>Clean</td><td>98.94</td><td>92.40</td><td>94.76</td><td>73.68</td></tr><tr><td>Best</td><td>96.16</td><td>93.28</td><td>92.82</td><td>81.05</td></tr><tr><td>Last</td><td>95.68</td><td>93.16</td><td>91.58</td><td>79.50</td></tr></table>
|
| 278 |
+
|
| 279 |
+
Table 3: Ablation study results in terms of test accuracy $(\%)$ on Trec and Chnsenticorp under different noise. The highlighted rows denotes the ratio of correct labels in the separated clean set.
|
| 280 |
+
|
| 281 |
+
# 5.1 Ablation experiment
|
| 282 |
+
|
| 283 |
+
To verify that each component contributes to the overall approach, we remove each component separately and check the test accuracy. To remove linear decay fusion, the original labels of clean set are kept and the pseudo-labels of noisy set are generated by the model. For the design of correctness statistic, the relevant parts including early stopping and linear decay fusion are removed and replaced by normal training. The standard cross entropy loss are directly applied on all samples and the corresponding pseudo labels to remove mixup operation. For R-Drop, the KL-divergence term is eliminated. The first part of Table 3 shows each component is helpful to the final performance. Correctness statistic and R-Drop are more critical to complex setting (i.e. $40\%$ IDN), because the model is greatly affected by this noise. And due to the introduction of linear decay fusion, R-Drop becomes more important in the aspect of keeping the model stable.
|
| 284 |
+
|
| 285 |
+
# 5.2 Analysis of early stopping
|
| 286 |
+
|
| 287 |
+
Stopping warm up properly is important for adapting to various noise cases and datasets. To verify this view, experiments with different warm-up times are performed. The numbers of war-up epoch are set to $\{1,2,3,4\}$ and the results are shown in the
|
| 288 |
+
|
| 289 |
+

|
| 290 |
+
|
| 291 |
+

|
| 292 |
+
|
| 293 |
+

|
| 294 |
+
(c) $40\%$ Asym
|
| 295 |
+
Figure 4: The instances of early stopping under different noise scenarios.
|
| 296 |
+
|
| 297 |
+

|
| 298 |
+
(d) $40\%$ IDN
|
| 299 |
+
|
| 300 |
+
second part of Table 3. We can observe that no one fixed warm-up time is suitable for all situations. For simple cases such as asymmetric noise, warm up for 3 epochs is beneficial. For complex cases such as instance-dependent noise, warm up for 1 epoch is enough. But adaptive warm-up works better than fixed times on processing all cases. Therefore, finding appropriate stopping point according to different noisy training datasets may be a good strategy of noise learning based on pre-trained models.
|
| 301 |
+
|
| 302 |
+
To check whether our early stopping method finds the stopping point close to the maximum obtainable test accuracy (MOTA), we draw some finding instances compared with other two heuristic approaches, including stopping through noise ratio (Arpit et al., 2017) and clean validation set (we use test set for validation here). As shown in Figure 4, the estimated start and end points of early stopping (ES) are close to the MOTA under different noise settings. And in some cases ES is closer to the MOTA than stopping through noise ratio (Ratio) especially under IDN. Because IDN is easier fitted by deep models, which resulting in high training accuracy at early stage. Compared with the two methods relying on additional conditions, our method only relies on the original noisy training set, which is more adaptable to the real world.
|
| 303 |
+
|
| 304 |
+
# 5.3 The design of correctness statistic
|
| 305 |
+
|
| 306 |
+
During warm up stage, a correctness statistic is maintained to judge the time of early stopping. In addition, it is used to separate the training data into clean set and noisy set for training in hybrid stage. We directly select the top $20\%$ samples of the high
|
| 307 |
+
|
| 308 |
+
<table><tr><td>Methods\Datasets</td><td>Trec</td><td>Chnseticorp</td><td>Agnews</td></tr><tr><td>BERT-FT</td><td>3min</td><td>22min</td><td>2h 17min</td></tr><tr><td>SelfMix</td><td>5min</td><td>42min</td><td>4h 40min</td></tr><tr><td>Ours</td><td>5min</td><td>43min</td><td>4h 48min</td></tr></table>
|
| 309 |
+
|
| 310 |
+
Table 4: The time cost example of different methods under the same noise setting.
|
| 311 |
+
|
| 312 |
+
est value in the correctness statistic as the clean set. It is different from previous noise-learning works (Li et al., 2020; Qiao et al., 2022; Garg et al., 2021) where the sets are separated by GMM or BMM. To make comparison, GMM is used in hybrid training stage and divide data at each epoch. In addition to the results, the ratios of correctly separation (i.e. how many samples in clean sets are truly clean) are also listed in Table 3, and highlighted with the gray background. As shown, the right ratio of our method is slightly higher than that of GMM, and the performance is better especially under the higher noise ratio settings.
|
| 313 |
+
|
| 314 |
+
# 5.4 Computational cost
|
| 315 |
+
|
| 316 |
+
Compared to previous noise learning approaches that include a normal warm-up phase (Han et al., 2018; Qiao et al., 2022), our method involves an additional cost incurred by inferring the entire training set at intervals during the adaptive warm-up phase. This cost is directly proportional to the number of training set samples and the frequency of inference. To strike a balance between monitoring and cost, we set the interval to 1/10 epoch in our experiments. Additionally, during the hybrid training stage, we reduce the cost of inferring the training set and fitting the GMM compared to SelfMix. Table 4 provides an example of the time costs of BERT-FT, SelfMix and our method under the same settings, with all methods trained on a single GeForce RTX 2080Ti.
|
| 317 |
+
|
| 318 |
+
# 6 Conclusion
|
| 319 |
+
|
| 320 |
+
Based on the unknown and complex nature of noise, we propose a noise learning framework based on pre-trained models that can adapt to various textual noise scenarios. This framework automatically stops the warm-up process based on the magnitude and complexity of the noise to prevent the model from overfitting noisy labels. To further leverage mislabeled data, the linear decay fusion strategy is combined with mixup and R-Drop to improve performance while maintaining stability. Experimen
|
| 321 |
+
|
| 322 |
+
tal results demonstrate that our method achieves performance comparable to state-of-the-art in all settings within common noise range.
|
| 323 |
+
|
| 324 |
+
# Limitations
|
| 325 |
+
|
| 326 |
+
We would like to introduce a versatile noise framework that can adapt to various noise scenarios and have conducted extensive experiments across different simulated scenarios to evaluate the performance. However, it is crucial to acknowledge that we didn't experiment on real textual noise scenarios. If the noise learning method can be verified in real industrial datasets, it will be more convincing. Furthermore, due to the necessity of monitoring the training set during the warm-up stage, the overall training time of our method tends to be longer compared to other approaches, especially when dealing with large datasets like Agnews. Resolving this issue or exploring alternative approaches to reduce training time is a direction that requires further investigation, which we leave to future work.
|
| 327 |
+
|
| 328 |
+
# Acknowledgements
|
| 329 |
+
|
| 330 |
+
This work was supported by the Science and technology support program of Sichuan Province under Grant 2022YFG0313.
|
| 331 |
+
|
| 332 |
+
# References
|
| 333 |
+
|
| 334 |
+
Ashkan Alinejad, Hassan S. Shavarani, and Anoop Sarkar. 2021. Translation-based supervision for policy generation in simultaneous neural machine translation. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 1734-1744, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics.
|
| 335 |
+
Devansh Arpit, Stanisław Jastrzebski, Nicolas Ballas, David Krueger, Emmanuel Bengio, Maxinder S. Kanwal, Tegan Maharaj, Asja Fischer, Aaron Courville, Yoshua Bengio, and Simon Lacoste-Julien. 2017. A closer look at memorization in deep networks. In Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 233-242. PMLR.
|
| 336 |
+
David Berthelot, Nicholas Carlini, Ian Goodfellow, Nicolas Papernot, Avital Oliver, and Colin A Raffel. 2019. Mixmatch: A holistic approach to semi-supervised learning. In Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc.
|
| 337 |
+
Pengfei Chen, Junjie Ye, Guangyong Chen, Jingwei Zhao, and Pheng-Ann Heng. 2021. Beyond class-conditional assumption: A primary attempt to com
|
| 338 |
+
|
| 339 |
+
bat instance-dependent label noise. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 11442-11450.
|
| 340 |
+
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.
|
| 341 |
+
Siddhant Garg, Goutham Ramakrishnan, and Varun Thumbe. 2021. Towards robustness to label noise in text classification via noise modeling. In Proceedings of the 30th ACM International Conference on Information & Knowledge Management, pages 3024-3028.
|
| 342 |
+
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. In Advances in Neural Information Processing Systems, volume 31. Curran Associates, Inc.
|
| 343 |
+
Lifeng Jin, Linfeng Song, Kun Xu, and Dong Yu. 2021. Instance-adaptive training with noise-robust losses against noisy labels. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 5647-5663, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics.
|
| 344 |
+
Ishan Jindal, Daniel Pressel, Brian Lester, and Matthew Nokleby. 2019. An effective label noise model for DNN text classification. 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 3246-3256, Minneapolis, Minnesota. Association for Computational Linguistics.
|
| 345 |
+
Junnan Li, Richard Socher, and Steven CH Hoi. 2020. Dividemix: Learning with noisy labels as semi-supervised learning. arXiv preprint arXiv:2002.07394.
|
| 346 |
+
xiaobo liang, Lijun Wu, Juntao Li, Yue Wang, Qi Meng, Tao Qin, Wei Chen, Min Zhang, and Tie-Yan Liu. 2021. R-drop: Regularized dropout for neural networks. In Advances in Neural Information Processing Systems, volume 34, pages 10890-10905. Curran Associates, Inc.
|
| 347 |
+
Xuefeng Liang, Xingyu Liu, and Longshan Yao. 2022. Review-a survey of learning from noisy labels. ECS Sensors Plus, 1(2):021401.
|
| 348 |
+
Bo Liu, Wandi Xu, Yuejia Xiang, Xiaojun Wu, Lejian He, Bowen Zhang, and Li Zhu. 2022. Noise learning for text classification: A benchmark. In Proceedings of the 29th International Conference on Computational Linguistics, pages 4557-4567, Gyeongju, Republic of Korea. International Committee on Computational Linguistics.
|
| 349 |
+
|
| 350 |
+
Sheng Liu, Jonathan Niles-Weed, Narges Razavian, and Carlos Fernandez-Granda. 2020. Early-learning regularization prevents memorization of noisy labels. In Advances in Neural Information Processing Systems, volume 33, pages 20331-20342. Curran Associates, Inc.
|
| 351 |
+
Wanlong Liu, Shaohuan Cheng, Dingyi Zeng, and Qu Hong. 2023. Enhancing document-level event argument extraction with contextual clues and role relevance. In *Findings of the Association for Computational Linguistics: ACL* 2023, pages 12908-12922.
|
| 352 |
+
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.
|
| 353 |
+
Haim Permuter, Joseph Francos, and Ian Jermyn. 2006. A study of gaussian mixture models of color and texture features for image classification and segmentation. Pattern recognition, 39(4):695-706.
|
| 354 |
+
Samira Pouyanfar, Saad Sadiq, Yilin Yan, Haiman Tian, Yudong Tao, Maria Presa Reyes, Mei-Ling Shyu, Shu-Ching Chen, and Sundaraja S Iyengar. 2018. A survey on deep learning: Algorithms, techniques, and applications. ACM Computing Surveys (CSUR), 51(5):1-36.
|
| 355 |
+
Dan Qiao, Chenchen Dai, Yuyang Ding, Juntao Li, Qiang Chen, Wenliang Chen, and Min Zhang. 2022. SelfMix: Robust learning against textual label noise with self-mixup training. In Proceedings of the 29th International Conference on Computational Linguistics, pages 960-970, Gyeongju, Republic of Korea. International Committee on Computational Linguistics.
|
| 356 |
+
Songbo Tan and Jin Zhang. 2008. An empirical study of sentiment analysis for chinese documents. Expert Systems with applications, 34(4):2622-2629.
|
| 357 |
+
Michael Tänzer, Sebastian Ruder, and Marek Rei. 2021. Memorisation versus generalisation in pre-trained language models. arXiv preprint arXiv:2105.00828.
|
| 358 |
+
Ellen M Voorhees, Dawn M Tice, et al. 1999. The trec-8 question answering track evaluation. In TREC, volume 1999, page 82.
|
| 359 |
+
Yisen Wang, Xingjun Ma, Zaiyi Chen, Yuan Luo, Jinfeng Yi, and James Bailey. 2019. Symmetric cross entropy for robust learning with noisy labels. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 322-330.
|
| 360 |
+
Tingting Wu, Xiao Ding, Minji Tang, Hao Zhang, Bing Qin, and Ting Liu. 2022. STGN: an implicit regularization method for learning with noisy labels in natural language processing. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 7587-7598, Abu Dhabi, United Arab Emirates. Association for Computational Linguistics.
|
| 361 |
+
|
| 362 |
+
Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. 2017. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412.
|
| 363 |
+
Xiang Zhang, Junbo Zhao, and Yann LeCun. 2015. Character-level convolutional networks for text classification. In Advances in Neural Information Processing Systems, volume 28. Curran Associates, Inc.
|
| 364 |
+
Wenxuan Zhou and Muhao Chen. 2021. Learning from noisy labels for entity-centric information extraction. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 5381-5392, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics.
|
| 365 |
+
Dawei Zhu, Michael A Hedderich, Fangzhou Zhai, David Ifeoluwa Adelani, and Dietrich Klakow. 2022. Is bert robust to label noise? a study on learning with noisy labels in text classification. arXiv preprint arXiv:2204.09371.
|
| 366 |
+
|
| 367 |
+
# A Examples of Assumption
|
| 368 |
+
|
| 369 |
+
The more examples of two assumptions are shown in Figure 5 and 6.
|
| 370 |
+
|
| 371 |
+
# B Pseudo-code of Adaptive Warm-up
|
| 372 |
+
|
| 373 |
+
We summarize the pseudo-code of adaptive warm-up in Algorithm 1.
|
| 374 |
+
|
| 375 |
+
# C Experiments
|
| 376 |
+
|
| 377 |
+
# C.1 Detailed Results
|
| 378 |
+
|
| 379 |
+
The detailed results are given in this section. Table 5 shows the results of different ratios of CCN, Table 6 shows the results of different ratios of IDN, and the results of the mixture of two types of noise on Agnews are supplemented in Table 7.
|
| 380 |
+
|
| 381 |
+
Class-conditional noise: With this simple assumption, our proposed method basically achieves the best scores across all noise cases in Table 5. All methods can obtain very good performance under a low noise ratio due to the deep model is robust to simple noise. However, there are still some gains to be made with our approach in some cases such as the results on Trec and Chnseticorp with $20\%$ asymmetric label noise. Under a high noise ration i.e. $40\%$ , the baselines are all affected to a greater or lesser extent, but our method performs well on different datasets and outperforms all methods. Additionally, we list the results on clean datasets without noise. The performance gap between clean data and noisy data are getting smaller by applying our method.
|
| 382 |
+
|
| 383 |
+
Instance-dependent noise: Table 6 shows that the complexity of IDN results in a substantial decrease in performance for general methods CT and ELR, indicating that they cannot cope well with this noise setting. In these experiments, SelfMix gets more best scores, which is related to its special designs based on noise type such as reducing the warm-up time, designing class-regularization loss and etc. In contrast, our method exhibits strong performance in all cases and achieves scores close to or even better than SelfMix without making assumptions about the type of noise. Particularly noteworthy are the cases where SelfMix underperforms, such as Trec and Chnseticorp with $10\%$ noise, whereas our method surpasses even the strongest baseline. This further highlights the versatility and effectiveness of our method across different scenarios.
|
| 384 |
+
|
| 385 |
+
Mixture of multiple noises: As shown in Table 7, mixed noise pose challenges, and various baselines exhibit distinct characteristics. BERT-FT is highly impacted by noise, particularly with a significant drop in the Last score. CT and ELR demonstrate their strengths in handling simple noise scenarios, such as a mixture of symmetric and asymmetric noise. On the other hand, SelfMix excels in cases involving IDN. In contrast, our method consistently achieves top or near-top performance while maintaining stability across all scenarios. It offers a more flexible and adaptable solution for unknown noise cases.
|
| 386 |
+
|
| 387 |
+
In conclusion, our method gets good enough scores under all noise conditions without knowing the noise type, noise ratio or the characteristics of dataset. Besides, the same hyper-parameters are used for all datasets and noise settings. These factors make our approach more practical in real scenarios.
|
| 388 |
+
|
| 389 |
+
# D More Analysis
|
| 390 |
+
|
| 391 |
+
# D.1 Analysis of linear decay fusion
|
| 392 |
+
|
| 393 |
+
In linear decay fusion, we set $\delta_{1} = 0.1$ to let the weight of label of cleaner data decay from 1 to 0.1, and set $\delta_{2} = 0.6$ to let that of noisier data from 0.6 to 0. To understand the role of two thresholds, Table 8 lists some results of fixing one of them and changing the other. The first three rows show that $\delta_{1}$ has little effect on asymmetric noise but limits the performance of IDN. Because IDN is easily fitted by the model, some noisy samples are inevitably assigned to cleaner set. It is more appropriate to reduce the weight to a small value. As can be observed from the last two lines, small value of $\delta_{2}$ is also detrimental to IDN, because it introduces much noise from noisier set. But large value lets some valuable information to be lost, the trade-off value 0.6 is a good choice. The setting of the two thresholds allows the proposed method to handle complex noise cases and cover possible noise situations, thus making it well applicable to other datasets or the real world.
|
| 394 |
+
|
| 395 |
+
# D.2 Stability Analysis
|
| 396 |
+
|
| 397 |
+
In main experiments, the time of hybrid training is set to 4 epochs to fairly compare with SelfMix. The stability of noise learning methods is also an important aspect, and the training time is extended to verify the stability. Since the warm up time is adaptive, we set different hybrid training times.
|
| 398 |
+
|
| 399 |
+
<table><tr><td colspan="2">Dataset</td><td colspan="4">Trec</td><td colspan="4">Agnews</td><td colspan="2">IMDB</td><td colspan="2">Chnsenticorp</td></tr><tr><td colspan="2">Noise Type</td><td colspan="2">Sym</td><td colspan="2">Asym</td><td colspan="2">Sym</td><td colspan="2">Asym</td><td colspan="2">Sym/Asym</td><td colspan="2">Sym/Asym</td></tr><tr><td colspan="2">Method/Ratio</td><td>20</td><td>40</td><td>20</td><td>40</td><td>20</td><td>40</td><td>20</td><td>40</td><td>20</td><td>40</td><td>20</td><td>40</td></tr><tr><td colspan="2">No Noise</td><td colspan="4">97.04</td><td colspan="4">94.53</td><td colspan="2">92.39</td><td colspan="2">96.50</td></tr><tr><td rowspan="2">BERT-FT</td><td>Best</td><td>96.36</td><td>94.12</td><td>95.88</td><td>90.96</td><td>93.85</td><td>92.68</td><td>94.06</td><td>92.80</td><td>90.46</td><td>84.85</td><td>94.08</td><td>81.88</td></tr><tr><td>Last</td><td>94.92</td><td>87.40</td><td>92.36</td><td>76.60</td><td>90.01</td><td>80.92</td><td>90.78</td><td>71.30</td><td>81.57</td><td>64.07</td><td>84.58</td><td>66.82</td></tr><tr><td rowspan="2">CT</td><td>Best</td><td>96.60</td><td>94.16</td><td>96.04</td><td>90.20</td><td>94.02</td><td>92.98</td><td>94.19</td><td>92.61</td><td>90.65</td><td>81.35</td><td>94.53</td><td>91.21</td></tr><tr><td>Last</td><td>95.32</td><td>88.28</td><td>94.92</td><td>77.04</td><td>91.27</td><td>85.75</td><td>93.58</td><td>91.17</td><td>84.73</td><td>61.85</td><td>87.61</td><td>66.58</td></tr><tr><td rowspan="2">ELR</td><td>Best</td><td>96.60</td><td>94.68</td><td>96.16</td><td>92.64</td><td>93.98</td><td>93.06</td><td>94.30</td><td>92.88</td><td>90.65</td><td>85.70</td><td>94.03</td><td>91.83</td></tr><tr><td>Last</td><td>96.24</td><td>93.48</td><td>95.24</td><td>85.24</td><td>93.69</td><td>91.68</td><td>93.71</td><td>90.73</td><td>89.52</td><td>78.28</td><td>92.75</td><td>84.91</td></tr><tr><td rowspan="2">SelfMix</td><td>Best</td><td>96.08</td><td>94.04</td><td>95.76</td><td>95.32</td><td>93.95</td><td>92.91</td><td>94.08</td><td>93.22</td><td>91.35</td><td>87.41</td><td>94.08</td><td>89.02</td></tr><tr><td>Last</td><td>94.96</td><td>93.56</td><td>94.64</td><td>94.96</td><td>90.08</td><td>92.71</td><td>90.50</td><td>92.95</td><td>90.43</td><td>86.19</td><td>89.02</td><td>83.45</td></tr><tr><td rowspan="2">Ours</td><td>Best</td><td>96.55</td><td>94.72</td><td>96.68</td><td>96.32</td><td>94.33</td><td>93.27</td><td>94.48</td><td>93.56</td><td>91.55</td><td>89.13</td><td>94.81</td><td>92.65</td></tr><tr><td>Last</td><td>96.30</td><td>94.20</td><td>96.36</td><td>96.00</td><td>92.80</td><td>92.33</td><td>92.52</td><td>91.06</td><td>90.78</td><td>88.21</td><td>93.85</td><td>89.99</td></tr></table>
|
| 400 |
+
|
| 401 |
+
Table 5: Results (\%) of five runs on Trec, Agnews, IMDB and Chnseticorp under different ratios of class-conditional noise (CCN, including symmetric (Sym) and asymmetric (Asym)). The bolded results means the highest among all best scores and the underlined results means the highest among all last scores. The "No Noise" row shows the results of directly fine-tuning in original clean datasets.
|
| 402 |
+
|
| 403 |
+
<table><tr><td colspan="2">Dataset</td><td colspan="4">Agnews</td><td colspan="4">IMDB</td><td colspan="4">Chnsenticorp</td></tr><tr><td colspan="2">Method/Ratio</td><td>10</td><td>20</td><td>30</td><td>40</td><td>10</td><td>20</td><td>30</td><td>40</td><td>10</td><td>20</td><td>30</td><td>40</td></tr><tr><td rowspan="2">BERT-FT</td><td>Best</td><td>91.90</td><td>88.72</td><td>84.90</td><td>75.84</td><td>89.81</td><td>84.56</td><td>78.48</td><td>72.16</td><td>93.26</td><td>87.76</td><td>80.33</td><td>73.66</td></tr><tr><td>Last</td><td>91.21</td><td>86.10</td><td>78.67</td><td>69.26</td><td>88.57</td><td>82.21</td><td>75.88</td><td>68.67</td><td>90.66</td><td>83.30</td><td>74.16</td><td>67.03</td></tr><tr><td rowspan="2">CT</td><td>Best</td><td>92.02</td><td>89.08</td><td>84.52</td><td>77.34</td><td>89.82</td><td>85.86</td><td>80.38</td><td>72.72</td><td>93.90</td><td>88.63</td><td>82.03</td><td>74.06</td></tr><tr><td>Last</td><td>91.33</td><td>85.88</td><td>78.26</td><td>70.01</td><td>88.84</td><td>81.85</td><td>76.13</td><td>70.09</td><td>91.56</td><td>82.63</td><td>77.15</td><td>69.06</td></tr><tr><td rowspan="2">ELR</td><td>Best</td><td>92.05</td><td>88.92</td><td>85.04</td><td>75.65</td><td>90.24</td><td>83.70</td><td>78.14</td><td>72.08</td><td>93.75</td><td>88.55</td><td>80.71</td><td>73.57</td></tr><tr><td>Last</td><td>91.21</td><td>87.10</td><td>79.85</td><td>70.18</td><td>88.32</td><td>82.08</td><td>73.51</td><td>68.77</td><td>91.15</td><td>82.76</td><td>77.90</td><td>69.01</td></tr><tr><td rowspan="2">SelfMix</td><td>Best</td><td>91.86</td><td>90.17</td><td>88.92</td><td>84.09</td><td>90.50</td><td>87.76</td><td>83.12</td><td>80.74</td><td>93.38</td><td>91.64</td><td>88.58</td><td>84.02</td></tr><tr><td>Last</td><td>89.71</td><td>88.63</td><td>87.94</td><td>83.15</td><td>88.97</td><td>85.09</td><td>80.84</td><td>79.99</td><td>91.45</td><td>88.62</td><td>85.95</td><td>83.52</td></tr><tr><td rowspan="2">Ours</td><td>Best</td><td>92.40</td><td>89.93</td><td>87.72</td><td>85.40</td><td>90.43</td><td>86.56</td><td>83.42</td><td>80.07</td><td>94.75</td><td>90.23</td><td>87.63</td><td>84.25</td></tr><tr><td>Last</td><td>90.77</td><td>88.01</td><td>83.40</td><td>84.76</td><td>90.17</td><td>84.70</td><td>78.07</td><td>75.42</td><td>93.24</td><td>88.63</td><td>87.12</td><td>84.03</td></tr></table>
|
| 404 |
+
|
| 405 |
+
Table 6: Results (\%) of five runs on Agnews, IMDB and Chnsenticorp under different ratios of instance-dependent noise (IDN). The bolded results means the highest among all best scores and the underlined results means the highest among all last scores.
|
| 406 |
+
|
| 407 |
+
<table><tr><td colspan="2">Mixed Type</td><td colspan="4">50% Sym+50% Asym</td><td colspan="6">50% Asym +50% IDN</td><td colspan="2">Uneven mixture of three noises</td></tr><tr><td colspan="2">Dataset</td><td colspan="2">Trec</td><td colspan="2">Agnews</td><td colspan="2">IMDB</td><td colspan="2">Chnseticorp</td><td colspan="2">Agnews</td><td colspan="2">Agnews</td></tr><tr><td colspan="2">Method/Ratio</td><td>20</td><td>40</td><td>20</td><td>40</td><td>20</td><td>40</td><td>20</td><td>40</td><td>20</td><td>40</td><td>20</td><td>40</td></tr><tr><td rowspan="2">BERT-FT</td><td>Best</td><td>95.92</td><td>93.28</td><td>93.96</td><td>92.83</td><td>88.87</td><td>81.28</td><td>91.86</td><td>83.06</td><td>91.72</td><td>88.12</td><td>92.09</td><td>90.87</td></tr><tr><td>Last</td><td>95.16</td><td>85.64</td><td>90.20</td><td>79.81</td><td>85.79</td><td>72.46</td><td>85.63</td><td>69.68</td><td>90.26</td><td>81.88</td><td>90.78</td><td>85.44</td></tr><tr><td rowspan="2">CT</td><td>Best</td><td>96.16</td><td>94.20</td><td>94.17</td><td>92.89</td><td>88.30</td><td>80.87</td><td>92.91</td><td>85.01</td><td>91.91</td><td>88.43</td><td>92.37</td><td>91.23</td></tr><tr><td>Last</td><td>94.88</td><td>88.68</td><td>90.76</td><td>82.94</td><td>86.22</td><td>72.68</td><td>87.53</td><td>68.95</td><td>90.58</td><td>82.66</td><td>91.21</td><td>88.21</td></tr><tr><td rowspan="2">ELR</td><td>Best</td><td>96.24</td><td>94.64</td><td>94.08</td><td>93.13</td><td>88.92</td><td>80.58</td><td>92.65</td><td>83.63</td><td>91.73</td><td>88.34</td><td>92.30</td><td>90.94</td></tr><tr><td>Last</td><td>96.16</td><td>93.52</td><td>93.88</td><td>91.58</td><td>87.15</td><td>76.10</td><td>90.28</td><td>79.58</td><td>90.76</td><td>86.03</td><td>91.74</td><td>90.11</td></tr><tr><td rowspan="2">*SelfMix</td><td>Best</td><td>95.64</td><td>94.16</td><td>93.94</td><td>93.08</td><td>89.88</td><td>84.34</td><td>92.91</td><td>87.70</td><td>91.80</td><td>88.93</td><td>92.11</td><td>91.15</td></tr><tr><td>Last</td><td>94.28</td><td>93.60</td><td>90.70</td><td>92.98</td><td>87.88</td><td>82.67</td><td>92.03</td><td>86.66</td><td>85.89</td><td>88.70</td><td>86.55</td><td>90.24</td></tr><tr><td rowspan="2">Ours</td><td>Best</td><td>96.48</td><td>94.36</td><td>94.30</td><td>93.39</td><td>89.05</td><td>83.47</td><td>93.23</td><td>88.47</td><td>92.13</td><td>89.18</td><td>92.65</td><td>91.33</td></tr><tr><td>Last</td><td>96.16</td><td>93.68</td><td>93.65</td><td>91.39</td><td>87.87</td><td>81.58</td><td>88.36</td><td>85.42</td><td>90.88</td><td>85.65</td><td>91.74</td><td>90.25</td></tr></table>
|
| 408 |
+
|
| 409 |
+
Table 7: Results (%) of five runs on Trec, Agnews, IMDB and Chnseticorp under different ratios of mixed noise. The bolded results means the highest among all best scores and the underlined results means the highest among all last scores. * denotes the best results chosen from different parameter combinations.
|
| 410 |
+
|
| 411 |
+

|
| 412 |
+
(a) $40\%$ Sym
|
| 413 |
+
|
| 414 |
+

|
| 415 |
+
(b) $40\%$ Asym
|
| 416 |
+
|
| 417 |
+

|
| 418 |
+
(c) $40\%$ Asym
|
| 419 |
+
Figure 5: The memorization observation of different noise cases. Label recall on top figures, train and test accuracy on bottom figures.
|
| 420 |
+
|
| 421 |
+

|
| 422 |
+
(d) $10\%$ IDN
|
| 423 |
+
|
| 424 |
+

|
| 425 |
+
(e) $40\%$ IDN
|
| 426 |
+
|
| 427 |
+

|
| 428 |
+
Figure 6: Examples of model output under different noise settings.
|
| 429 |
+
|
| 430 |
+
<table><tr><td colspan="2">Dataset Noise Type</td><td colspan="2">Trec Asym</td><td colspan="2">Chnseticorp IDN</td></tr><tr><td colspan="2">Epoch/Ratio</td><td>20</td><td>40</td><td>10</td><td>40</td></tr><tr><td rowspan="2">4</td><td>Best</td><td>96.68</td><td>96.32</td><td>94.75</td><td>84.25</td></tr><tr><td>Last</td><td>96.36</td><td>96.00</td><td>93.24</td><td>84.03</td></tr><tr><td rowspan="2">6</td><td>Best</td><td>96.80</td><td>96.64</td><td>94.40</td><td>81.98</td></tr><tr><td>Last</td><td>96.36</td><td>96.04</td><td>89.72</td><td>80.68</td></tr><tr><td rowspan="2">8</td><td>Best</td><td>97.04</td><td>96.52</td><td>94.22</td><td>83.78</td></tr><tr><td>Last</td><td>96.20</td><td>91.84</td><td>89.63</td><td>81.93</td></tr><tr><td rowspan="2">4+2</td><td>Best</td><td>96.84</td><td>96.44</td><td>94.75</td><td>85.37</td></tr><tr><td>Last</td><td>96.48</td><td>96.12</td><td>87.43</td><td>83.15</td></tr><tr><td rowspan="2">4+4</td><td>Best</td><td>96.88</td><td>96.52</td><td>94.75</td><td>85.37</td></tr><tr><td>Last</td><td>95.84</td><td>94.80</td><td>90.18</td><td>82.93</td></tr></table>
|
| 431 |
+
|
| 432 |
+
Table 9: Results in terms of test accuracy $(\%)$ with different hybrid training times on Trec and Chnsenticorp under different noise.
|
| 433 |
+
|
| 434 |
+
<table><tr><td colspan="2">Dataset Noise Type</td><td colspan="2">Trec Asym</td><td colspan="2">Chnseticorp IDN</td></tr><tr><td colspan="2">Weight Threshold/Ratio</td><td>20</td><td>40</td><td>10</td><td>40</td></tr><tr><td rowspan="2">(0.1, 0.6)</td><td>Best</td><td>96.68</td><td>96.32</td><td>94.75</td><td>84.25</td></tr><tr><td>Last</td><td>96.36</td><td>96.00</td><td>93.24</td><td>84.03</td></tr><tr><td rowspan="2">(0.8, 0.6)</td><td>Best</td><td>96.64</td><td>96.52</td><td>93.97</td><td>82.58</td></tr><tr><td>Last</td><td>96.20</td><td>95.80</td><td>93.15</td><td>81.68</td></tr><tr><td rowspan="2">(0.5, 0.6)</td><td>Best</td><td>96.64</td><td>96.32</td><td>94.27</td><td>81.95</td></tr><tr><td>Last</td><td>96.04</td><td>95.84</td><td>93.42</td><td>79.68</td></tr><tr><td rowspan="2">(0.1, 0.2)</td><td>Best</td><td>96.64</td><td>96.24</td><td>94.10</td><td>79.67</td></tr><tr><td>Last</td><td>96.12</td><td>95.76</td><td>91.52</td><td>79.37</td></tr><tr><td rowspan="2">(0.1, 0.8)</td><td>Best</td><td>95.96</td><td>95.28</td><td>94.18</td><td>85.08</td></tr><tr><td>Last</td><td>95.88</td><td>94.80</td><td>91.52</td><td>84.32</td></tr></table>
|
| 435 |
+
|
| 436 |
+
Table 8: Results in terms of test accuracy $(\%)$ with different warm-up times on Trec and Chnsenticorp under different noise.
|
| 437 |
+
|
| 438 |
+
There are two modes to extend because of the existence of linear decay fusion. The first is that the decay time is extended as same as the training time, which is expressed as a uniform number in the table. The second is that the decay time is fixed to 4 epochs and the total training time is extended, which is expressed in the form of adding numbers. For example, "4+2" in Table 9 means the weight of original labels decays to the wanted threshold in four epochs and remains unchanged during two more epochs. The results show that as training time increases, the accuracy of the last epoch decreases but not by much. And interestingly, the Best scores get better in some cases because there are more monitored moments.
|
| 439 |
+
|
| 440 |
+
# D.3 The trend of correctness statistic
|
| 441 |
+
|
| 442 |
+
Figure 7 displays the trend of the correctness statistic $\text{ratio}^t$ along with the curve representing the
|
| 443 |
+
|
| 444 |
+

|
| 445 |
+
(a) $20\%$ Sym
|
| 446 |
+
|
| 447 |
+

|
| 448 |
+
(b) $40\%$ Sym
|
| 449 |
+
Figure 7: The trend of correctness statistic and the proportion of samples correctly partitioned into the clean set under different $\rho_{2}$ values.
|
| 450 |
+
|
| 451 |
+

|
| 452 |
+
(c) $10\%$ IDN
|
| 453 |
+
|
| 454 |
+

|
| 455 |
+
(d) $40\%$ IDN
|
| 456 |
+
|
| 457 |
+
proportion of samples correctly partitioned into the clean set under different $\rho_{2}$ values during warm-up. Each point on the correctness statistic curve corresponds to a monitored situation. We observe the appearance of a turning point in various scenarios, and its occurrence time is determined by the speed at which the model fits the training samples. When the turning point appears, the frequency of occurrences within a fixed range quickly rises. Therefore, we set the value of $\eta$ to 3 and the corresponding range $\epsilon$ to 0.01. This is a moderate choice that can accommodate various noise scenarios. A larger $\eta$ is also acceptable but would result in a later early stop time.
|
| 458 |
+
|
| 459 |
+
For $\rho_{2}$ , we compare two values, 0.5 and 0.2. Under simpler noise settings, such as with $20\%$ symmetric noise, the two $\rho_{2}$ curves remain relatively flat, indicating that the cleanliness of the top $20\%$ and top $50\%$ sets is similar. However, under more complex settings, such as with $40\%$ idn, $\rho_{2} = 0.2$ exhibits some advantages. Additionally, a smaller $\rho_{2}$ value can accommodate a higher noise ratio.
|
| 460 |
+
|
| 461 |
+
Algorithm 1: Adaptive Warm-up
|
| 462 |
+
Input: $\theta$ and $\zeta$ , training set $(X, \tilde{Y})$ , monitoring interval $s$ , converge range $\varepsilon$ , times $\eta$ , accuracy fraction $\rho_{1}$
|
| 463 |
+
Initial: $P = \emptyset$ , enter = False;
|
| 464 |
+
while $t < \text{MaxStep do}$
|
| 465 |
+
Draw a mini-batch $\{(x_b, y_b); b \in (1, \dots, B)\}$ from $(X, \tilde{Y})$ ;
|
| 466 |
+
Optimize $\theta$ and $\zeta$ by Equation 1; // standard training
|
| 467 |
+
/* monitoring the training process at intervals */
|
| 468 |
+
if $t \mod s == 0$ then
|
| 469 |
+
Compute $r_i^t$ by Equation 3, $(x_i, \tilde{y}_i) \in (X, \tilde{Y})$ ;
|
| 470 |
+
$m_i^t = \sum_t r_i^t$ ; // update the correctness statistic
|
| 471 |
+
ratio^t = $\frac{1}{N} \sum_i \mathbb{I}(m_i^t > 0)$ ; // calculate the proportion of samples that have been fitted
|
| 472 |
+
P ← P ∪ $\left\{\left\lceil \frac{ratio^t}{\varepsilon} \right\rceil \right\}$ ; // determine the range that ratio^t stays inside
|
| 473 |
+
if not enter then
|
| 474 |
+
if P has $\eta$ same items then
|
| 475 |
+
enter = True; // enter the NR phase
|
| 476 |
+
Compute training accuracy acc;
|
| 477 |
+
stop_acc = acc + (1 - acc) \cdot \rho_1;
|
| 478 |
+
// calculate the space available for further warming up
|
| 479 |
+
end
|
| 480 |
+
else
|
| 481 |
+
Compute training accuracy acc;
|
| 482 |
+
if acc ≥ stop_acc then
|
| 483 |
+
Break; // stop warming up
|
| 484 |
+
end
|
| 485 |
+
end
|
| 486 |
+
end
|
| 487 |
+
Output: $\theta$ and $\zeta$ , $M = \{m_i^t\}_{i=1}^N$ ; // output trained model and correctness statistic
|
adaptivetextuallabelnoiselearningbasedonpretrainedmodels/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fe92188b32275e500e0d9676996fefb56f6ddfb973eb3369546937c0f0a0f9b9
|
| 3 |
+
size 1052123
|
adaptivetextuallabelnoiselearningbasedonpretrainedmodels/layout.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fb731c2775ec860abb6a8fff0808e2a19061f50d00522901453a36a9ab5e5d1e
|
| 3 |
+
size 539787
|
addressingthelengthbiaschallengeindocumentlevelneuralmachinetranslation/a2b10245-053b-4136-bc45-54d30b2d9e2b_content_list.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:46b0ef7077a7face1a4f25abb90094955a50abfcded471147ab77865ac817bc1
|
| 3 |
+
size 80437
|
addressingthelengthbiaschallengeindocumentlevelneuralmachinetranslation/a2b10245-053b-4136-bc45-54d30b2d9e2b_model.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:40521e808c5fcd398c96fc6fd62bc8477259a9fcb378665e79eb0d0b2ccd2a52
|
| 3 |
+
size 99008
|
addressingthelengthbiaschallengeindocumentlevelneuralmachinetranslation/a2b10245-053b-4136-bc45-54d30b2d9e2b_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:402aa0d04acf3913a6713c5175e7afdb70c1ead1e8235d858480915d26f68dc0
|
| 3 |
+
size 690688
|
addressingthelengthbiaschallengeindocumentlevelneuralmachinetranslation/full.md
ADDED
|
@@ -0,0 +1,327 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Addressing the Length Bias Problem in Document-Level Neural Machine Translation
|
| 2 |
+
|
| 3 |
+
Zhuocheng Zhang $^{1,2\dagger}$ , Shuhao Gu $^{1,2\dagger}$ , Min Zhang $^{3}$ , Yang Feng $^{1,2*}$
|
| 4 |
+
|
| 5 |
+
<sup>1</sup>Key Laboratory of Intelligent Information Processing,
|
| 6 |
+
|
| 7 |
+
Institute of Computing Technology, Chinese Academy of Sciences (ICT/CAS)
|
| 8 |
+
|
| 9 |
+
$^{2}$ University of Chinese Academy of Sciences, China
|
| 10 |
+
|
| 11 |
+
$^{3}$ School of Future Science and Engineering, Soochow University, China
|
| 12 |
+
|
| 13 |
+
zhangzhuocheng20z@ict.ac.cn
|
| 14 |
+
|
| 15 |
+
shuhaog515@gmail.com
|
| 16 |
+
|
| 17 |
+
zhangminmt@hotmail.com
|
| 18 |
+
|
| 19 |
+
fengyang@ict.ac.cn
|
| 20 |
+
|
| 21 |
+
# Abstract
|
| 22 |
+
|
| 23 |
+
Document-level neural machine translation (DNMT) has shown promising results by incorporating more context information. However, this approach also introduces a length bias problem, whereby DNMT suffers from significant translation quality degradation when decoding documents that are much shorter or longer than the maximum sequence length during training. To solve the length bias problem, we propose to improve the DNMT model in training method, attention mechanism, and decoding strategy. Firstly, we propose to sample the training data dynamically to ensure a more uniform distribution across different sequence lengths. Then, we introduce a length-normalized attention mechanism to aid the model in focusing on target information, mitigating the issue of attention divergence when processing longer sequences. Lastly, we propose a sliding window strategy during decoding that integrates as much context information as possible without exceeding the maximum sequence length. The experimental results indicate that our method can bring significant improvements on several open datasets, and further analysis shows that our method can significantly alleviate the length bias problem<sup>1</sup>.
|
| 24 |
+
|
| 25 |
+
# 1 Introduction
|
| 26 |
+
|
| 27 |
+
Document-level neural machine translation (DNMT) (Gong et al., 2011; Hardmeier et al., 2013; Garcia et al., 2015; Miculicich et al., 2018; Tan et al., 2019; Maruf et al., 2019; Zheng et al., 2020; Xu et al., 2020) is proposed to enhance translation quality by leveraging more contextual information. Recently, the document-to-document (doc2doc) DNMT model (Junczys-Dowmunt,
|
| 28 |
+
|
| 29 |
+

|
| 30 |
+
Figure 1: The length bias problem for doc2doc DNMT model. The translation quality degrades significantly as the decoding length deviates from the training length.
|
| 31 |
+
|
| 32 |
+
2019; Liu et al., 2020; Bao et al., 2021; Sun et al., 2022b), which expands the translation scope from individual sentences to entire documents, has demonstrated exceptional performance, thereby drawing increased attention. For the training of doc2doc DNMT model, multiple sentences are assembled into sequences that are close to the predetermined maximum length, enabling the model to learn information from the context as much as possible. However, this training strategy can lead to overfitting to the maximum length. Sequences that are significantly shorter than the maximum length may be overlooked by the model due to their smaller proportion in the training set. Besides, the model also lacks the ability to handle the sequences that exceed the maximum length, which are not encountered by the model during training. Consequently, the length bias problem results in a significant degradation in translation quality when the length of the decoded sequence deviates from the maximum sequence length, which is shown in Figure 1.
|
| 33 |
+
|
| 34 |
+
Some researchers have made their attempts to enhance the length generalization capabilities of DNMT model from various perspectives. Some approaches employ data augmentation techniques (Junczys-Dowmunt, 2019; Sun et al., 2022b) to mix documents with shorter segments such as sentences or paragraphs, thereby augmenting the diversity of sequence lengths in the training set. However, the proposed augmentation method does not necessarily guarantee a balanced length distribution, as the length distribution is still influenced by the training corpus itself. Bao et al. (2021) incorporates a locality assumption as an inductive bias into the Transformer model, which reduces the complexity of target-to-source attention. As a result, their method allows for the setting of larger maximum lengths, thereby augmenting the model's ability to handle longer documents. However, this method can only bring limited improvements for the short sequences. Besides, the aforementioned approaches are still incapable of directly handling sequences that exceed the maximum sequence length during testing and still require segmentation of excessively long test sequences.
|
| 35 |
+
|
| 36 |
+
Given above, we aim to enhance the capability of our model to handle both long and short sequences. Additionally, we seek to enable the model to directly translate sequences that exceed the maximum length, thereby avoiding information loss caused by segment truncation. To achieve these objectives, we have made improvements in the sampling of training data, attention weight computation, and decoding strategies. During training, we first sample the sequence lengths and then construct the training data accordingly. This dynamic variation in sequence lengths within different epochs ensures that the model encounters a more balanced distribution of sequence lengths during training. Furthermore, we introduce a scaling factor during attention computation to ensure that, even as the sequence length increases, the model can still focus on relevant target information and prevent attention divergence. Lastly, when decoding sequences that exceed the maximum length, we employ a sliding window decoding strategy which allows for the retention of more context information while ensuring that the context length remains below the maximum sequence length. These three proposed methods collectively contribute to improving the length generalization capabilities of the DNMT model from different perspectives. Moreover, their
|
| 37 |
+
|
| 38 |
+
combined application yields further performance enhancements. We conduct experiments on several document-level open datasets and the experimental results indicate that our method can bring significant improvements. Further analysis shows that our method can significantly alleviate the length bias problem.
|
| 39 |
+
|
| 40 |
+
# 2 Background
|
| 41 |
+
|
| 42 |
+
In this section, we will give a brief introduction to the Transformer (Vaswani et al., 2017) model and the doc2doc DNMT model.
|
| 43 |
+
|
| 44 |
+
# 2.1 The Transformer
|
| 45 |
+
|
| 46 |
+
The transformer model is based on the encoder-decoder architecture. The encoder is composed of $N$ identical layers. Each layer has two sublayers. The first is a multi-head self-attention sublayer, and the second is a fully connected feed-forward network. Both of the sublayers are followed by a residual connection operation and a layer normalization operation. The decoder is also composed of $N$ identical layers. In addition to the same kind of two sublayers in each encoder layer, the cross-attention sublayer is inserted between them, which performs multi-head attention over the output of the encoder.
|
| 47 |
+
|
| 48 |
+
The attention mechanism is the core part of the Transformer model, which is computed as:
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
\operatorname {A t t e n t i o n} (\mathbf {Q}, \mathbf {K}, \mathbf {V}) = \operatorname {s o f t m a x} \left(\frac {\mathbf {Q} \mathbf {K} ^ {\top}}{\sqrt {d _ {k}}}\right) \mathbf {V}, \tag {1}
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
where $\mathbf{Q},\mathbf{K}$ and $\mathbf{V}$ represent the query, key, and value vectors, respectively. $d_{k}$ denotes the dimension of the key vectors. The softmax function is applied to normalize the dot-product similarities between the queries and keys, and the result is multiplied by the value vectors to obtain the weighted sum.
|
| 55 |
+
|
| 56 |
+
# 2.2 The doc2doc DNMT model
|
| 57 |
+
|
| 58 |
+
The doc2doc DNMT model is to translate the whole document directly. Different from the conventional DNMT model, which translates documents sentence by sentence with an additional context encoder (Tan et al., 2019; Maruf et al., 2019; Yang et al., 2019; Zheng et al., 2020; Xu et al., 2020; Yun et al., 2020), multiple sentences will be simultaneously input into the doc2doc DNMT model for training and decoding. The training data consists of different documents $\mathcal{D} = \bigcup_{i=1}^{n}\{\mathbf{d}_i\}$ , where $n$
|
| 59 |
+
|
| 60 |
+

|
| 61 |
+
Figure 2: An example of the sampling probabilities of different sequence lengths during training.
|
| 62 |
+
|
| 63 |
+
denotes the number of documents in the training data. Each document $\mathbf{d}_i$ contains source and target sentences $\mathbf{d}_i = \bigcup_{j=1}^{m} \{(\mathbf{x}_{ij}, \mathbf{y}_{ij})\}$ , where $m$ denotes the number of sentences in each document. Besides, special symbols are often inserted within the documents to distinguish between different sentences. The training objective can be written as:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\underset {\theta} {\arg \max } \sum_ {i = 1} ^ {n} \sum_ {j = 1} ^ {m} \sum_ {k = 1} ^ {| \mathbf {y} _ {i j} |} P \left(y _ {i j} ^ {k} \mid y _ {i j} ^ {< k}, \mathbf {x} _ {i}, \mathbf {y} _ {i, < j}\right), \tag {2}
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
where $|\mathbf{y}_{ij}|$ denotes the number of the words in the $j$ -th target sentence of the $i$ -th document. During decoding, documents that exceed the maximum sequence length are also segmented, otherwise it will result in a significant decrease in translation quality.
|
| 70 |
+
|
| 71 |
+
# 3 Method
|
| 72 |
+
|
| 73 |
+
Our method aims to enhance the length generalization capabilities of the doc2doc DNMT model, thereby alleviating the length bias problem. To achieve this goal, we have made improvements in three aspects: training data sampling, attention computation, and decoding strategies.
|
| 74 |
+
|
| 75 |
+
# 3.1 Dynamic Length Sampling
|
| 76 |
+
|
| 77 |
+
Dynamic length sampling (DLS) aims to ensure that the model has the opportunity to encounter training sequences of various lengths throughout the training process, thereby facilitating better learning and retention of the ability to translate sequences of different lengths. Therefore, the key challenge of this method lies in determining the sampling probabilities for different sequence lengths. Given that translating complete documents usually involves longer input and output
|
| 78 |
+
|
| 79 |
+

|
| 80 |
+
Figure 3: An example of the segmented sequences.
|
| 81 |
+
|
| 82 |
+
sequences, directly learning document-level translation is more difficult. Hence, in the initial stages of training, we focus more on training the model on shorter sequences, which improves training stability and accelerates model convergence. As training progresses, we hope to increase the probability of sampling longer sequences or documents, allowing the model to gradually learn longer contextual dependencies.
|
| 83 |
+
|
| 84 |
+
Following the above intuitions, we define the sampling probabilities of different lengths as:
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
p _ {l} = \frac {w _ {l} ^ {\frac {1}{T}}}{\sum_ {l = 1} ^ {L} w _ {l} ^ {\frac {1}{T}}}, \tag {3}
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
where $L$ denotes the maximum sequence length and $w_{l}$ denotes the sampling weight assigned for different lengths which is defined as $w_{l} = e^{-l}$ . $T$ is a sampling temperature (Arivazhagan et al., 2019), which is computed as $T = e^{(ep - \gamma)}$ , where $ep$ denotes the current epoch number and $\gamma$ is a hyperparameter, which should be adjusted according to the dataset. The temperature $T$ varies with the training epoch. An example of the sampling probabilities of different sequence lengths during training is shown as in Figure 2, where $\gamma$ is set as 5 and max length is set as 8. We can see from the figure that in the initial stage of training, the probability of short sequence length being sampled is relatively high. In the later stages of training, the probability of different sequence lengths being sampled tends to be equal. Although in real training processes, the maximum sequence length is typically much greater than 8, the pattern of the sampling probabilities follows a similar trend.
|
| 91 |
+
|
| 92 |
+
Specifically, before the training of each epoch begins, we first update the probability of each sequence length being sampled according to Equation 3. Then, for each document $\mathbf{d}_i$ in the training set, we sample different sequence lengths $[l_{i1}, l_{i2}, \ldots, l_{ik}, \ldots]$ . We segment the documents $\mathbf{d}_i$ into different sequences $\mathbf{s}_{ik}$ from left to right
|
| 93 |
+
|
| 94 |
+

|
| 95 |
+
Figure 4: An illustration of the sliding decoding strategy. We set the window size as three sentences in this example for display convenience.
|
| 96 |
+
|
| 97 |
+
if the segmented length is shorter than the sampled length. But if the sampled sequence length is less than the current sentence length of the document, we will select the current single sentence as the input sequence. This overall process can be demonstrated as:
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\begin{array}{l} \mathbf {s} _ {i k} = \left\{\mathbf {x} _ {i, a: b}, \mathbf {y} _ {i, a: b} \right\}, \\ s. t. \left\{ \begin{array}{c c} | \mathbf {x} _ {i, a: b} | \leq l _ {i k}, | \mathbf {y} _ {i, a: b} | \leq l _ {i k}, & a < b, \\ \text {o r} & \\ | \mathbf {x} _ {i, a: b} | > l _ {i k}, | \mathbf {y} _ {i, a: b} | > l _ {i k}, & a = b \end{array} \right. \tag {4} \\ \end{array}
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
Different sequences $\mathbf{s}_{ik}$ don't overlap with each other. We show an example of the above process in Figure 3. In this example, the document has 4 sentences, with lengths of 9, 15, 25, and 8, respectively. The sampled lengths are 35, 1, and 12, respectively. Therefore, the final input sequence we obtained contains three segments, with lengths of 24, 25, and 8, respectively. After processing the entire training set, we can obtain the sequences required for the current epoch.
|
| 104 |
+
|
| 105 |
+
# 3.2 Length Aware Attention
|
| 106 |
+
|
| 107 |
+
The role of the attention mechanism is to retrieve information from the target sequence that is relevant to itself (self-attention) or the current translation (cross-attention). However, the DNMT model usually needs to handle a wide range of context except for the target sequence, which may interfere with the normal operation of the attention mechanism, leading to the divergence of the attention results and consequently deteriorated translation quality for long segments.
|
| 108 |
+
|
| 109 |
+
Inspired by Chiang and Cholak (2022), we propose the length aware attention (LAA), which adds a scaling factor to the original attention computation (Equation 1) to mitigate this issue:
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\text {A t t e n t i o n} = \operatorname {s o f t m a x} \left(\frac {\mathbf {Q K} ^ {\top}}{\sqrt {d _ {k}}} * \log l\right) \mathbf {V}, \tag {5}
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
where $l$ denotes the length of the attended sequence and $\iota$ denotes the average length of sequences in the current training epoch. Because the sequence lengths are sampled per epoch by DLS, $\iota$ also changes gradually. It can be demonstrated that incorporating the aforementioned length scale effectively mitigates the issue of entropy divergence in attention results when dealing sequences with different lengths. We have included the proof process in A. During decoding, $\iota$ is set as the value corresponding to the final epoch of the training phase.
|
| 116 |
+
|
| 117 |
+
# 3.3 Sliding Decoding
|
| 118 |
+
|
| 119 |
+
During training, the DNMT model needs to set a maximum sequence length. However, during the decoding phase, it often encounters documents that exceed this maximum length. Directly decoding such long documents can lead to inferior results, as the model has not been exposed to documents exceeding the maximum length during training. A common approach is to split the long document into shorter segments and translate them separately, subsequently concatenating the translation results. However, such segmentation may result in the loss of contextual information, thereby affecting translation quality.
|
| 120 |
+
|
| 121 |
+
To address these issues, we propose a method that utilizes a sliding window for decoding (SD). Specifically, when the length of the input sequence is smaller than the maximum length, the complete sequence, including the target sentence and the context, is used for translation. However, when the input sequence exceeds the maximum length, we discard the oldest source-side context information from the current time step onwards and no longer employ it to assist in translation. Simultaneously, the corresponding oldest target-side context information is also discarded, but it will be preserved as part of the translation result. The illustration
|
| 122 |
+
|
| 123 |
+
of the overall process is shown in Figure 4. If we employ a beam search strategy during the decoding process, we retain the candidate with the highest generation probability within the current beam for output and subsequent decoding.
|
| 124 |
+
|
| 125 |
+
# 4 Experiments
|
| 126 |
+
|
| 127 |
+
# 4.1 Data Preparation
|
| 128 |
+
|
| 129 |
+
We conduct experiments on 3 most commonly used English to German $(\mathrm{En}\rightarrow \mathrm{De})$ translation datasets. The description of the datasets are as follows:
|
| 130 |
+
|
| 131 |
+
- TED is provided by IWSLT2017 (Cettolo et al., 2012), containing talks from TED. We adopt tst2016-2017 as the test sets, and the rest for the valid sets.
|
| 132 |
+
- News contains parallel documents extracted from NewsCommentary in news domain<sup>2</sup>. In our experiments, newstest2015 and newstest2016 are used for validation and test, respectively.
|
| 133 |
+
- Europarl is extracted from Europarl v7 (Koehn, 2005) and split using SPEAKER tags. We follow the train/develop/test sets splitting as Maruf et al. (2019).
|
| 134 |
+
|
| 135 |
+
We use the Moses toolkit (Koehn et al., 2007) to tokenize other languages. Besides, integrating operations of $32\mathrm{K}$ is performed to learn BPE (Sennrich et al., 2016). Following Bao et al. (2021); Liu et al. (2020), we set the maximum sequence length as 512 in our main experiments.
|
| 136 |
+
|
| 137 |
+
# 4.2 Systems
|
| 138 |
+
|
| 139 |
+
The systems used for comparison in our experiments are as follows:
|
| 140 |
+
|
| 141 |
+
- Transformer (Vaswani et al., 2017): We have obtained three systems with different training methods based on the Transformer model. The Trans-sent model is trained with the sentence-level corpus. The Trans-doc model is trained with the document-level training corpus. The Trans-FT model is fine-tuned based on the Transformer-sent model with the document-level corpus.
|
| 142 |
+
|
| 143 |
+
- HAN (Tan et al., 2019): This method employs a hierarchical attention mechanism in Transformer to capture contextual information at sentence-level and word-level.
|
| 144 |
+
- Flat (Ma et al., 2020): This methods feeds the concatenated sentences into a pre-trained BERT to collect the contextualized representations of the sentence being translated.
|
| 145 |
+
- LED (Beltagy et al., 2020): The proposed model in this method is equipped with a well designed sparse attention mechanism. We reproduce this by using transformers<sup>3</sup>.
|
| 146 |
+
- Doc-Trans (Zhang et al., 2018): This method introduces a new context encoder to represent document-level context. They also propose a two-step training approach to effectively utilize abundant sentence-level parallel corpora.
|
| 147 |
+
- G-Transformer (Bao et al., 2021): This method incorporates a locality assumption as an inductive bias into the Transformer model. We train the model with the document-level corpus from scratch (G-Trans) and also pretrain the model with sentence-level corpus and then fine tune the model with the document-level corpus (G-Trans-FT).
|
| 148 |
+
- MR (Sun et al., 2022b): This method splits each document averagely into different parts for multiple times and collect all the sequences for training.
|
| 149 |
+
- ALiBi (Press et al., 2021): This method improves length generalization by adding static non-learned bias to attention weights. We train the model with the document-level corpus from scratch (ALiBi) and also pretrain the model with sentence-level corpus and then fine tune the model with the document-level corpus (ALiBi-FT).
|
| 150 |
+
- Our System: We applied the proposed methods, including dynamic length sampling (DSL), length aware attention (LAA) and sliding decoding (SD), to the Transformer-doc model (Trans-doc+Ours) and the G-Transformer model (G-Trans+Ours), respectively.
|
| 151 |
+
|
| 152 |
+
<table><tr><td rowspan="2">Models</td><td colspan="4">TED</td><td colspan="4">Europarl</td><td colspan="4">News</td></tr><tr><td>s-BLEU</td><td>d-BLEU</td><td>s-chrF</td><td>d-chrF</td><td>s-BLEU</td><td>d-BLEU</td><td>s-chrF</td><td>d-chrF</td><td>s-BLEU</td><td>d-BLEU</td><td>s-chrF</td><td>d-chrF</td></tr><tr><td>Trans-sent</td><td>24.12</td><td>28.02</td><td></td><td></td><td>30.33</td><td>32.45</td><td></td><td></td><td>24.91</td><td>26.94</td><td></td><td></td></tr><tr><td>Trans-doc</td><td>18.51</td><td>25.20</td><td></td><td></td><td>30.86</td><td>33.11</td><td></td><td></td><td>21.11</td><td>24.02</td><td></td><td></td></tr><tr><td>HAN</td><td>23.79</td><td>28.17</td><td></td><td></td><td>30.74</td><td>32.90</td><td></td><td></td><td>24.22</td><td>26.31</td><td></td><td></td></tr><tr><td>Flat</td><td>24.32</td><td>28.17</td><td></td><td></td><td>30.92</td><td>33.04</td><td></td><td></td><td>24.85</td><td>26.88</td><td></td><td></td></tr><tr><td>LED</td><td>18.46</td><td>24.29</td><td></td><td></td><td>29.90</td><td>32.48</td><td></td><td></td><td>12.13</td><td>16.63</td><td></td><td></td></tr><tr><td>Doc-Trans</td><td>23.81</td><td>27.64</td><td></td><td></td><td>30.74</td><td>32.88</td><td></td><td></td><td>24.79</td><td>26.77</td><td></td><td></td></tr><tr><td>G-Trans</td><td>22.53</td><td>25.90</td><td></td><td></td><td>32.02</td><td>34.14</td><td></td><td></td><td>23.87</td><td>25.90</td><td></td><td></td></tr><tr><td>MR</td><td>23.99</td><td>28.61</td><td>53.73</td><td>70.54</td><td>31.54</td><td>33.75</td><td>61.36</td><td>69.83</td><td>24.79</td><td>27.14</td><td>54.06</td><td>64.33</td></tr><tr><td>ALiBi</td><td>19.65</td><td>26.30</td><td>47.22</td><td>68.26</td><td>29.99</td><td>32.54</td><td>60.19</td><td>69.28</td><td>12.67</td><td>22.83</td><td>36.19</td><td>59.91</td></tr><tr><td>ALiBi-FT</td><td>20.85</td><td>27.55</td><td>49.54</td><td>69.71</td><td>29.64</td><td>32.55</td><td>59.76</td><td>69.41</td><td>17.37</td><td>24.02</td><td>43.49</td><td>60.79</td></tr><tr><td>Trans-FT</td><td>24.31</td><td>28.48</td><td>54.70</td><td>70.51</td><td>31.16</td><td>33.58</td><td>61.29</td><td>69.91</td><td>23.96</td><td>27.33</td><td>53.27</td><td>64.98</td></tr><tr><td>Trans-doc + DLS + LAA</td><td>24.93</td><td>28.95</td><td>55.18</td><td>70.69</td><td>31.85</td><td>34.32</td><td>61.26</td><td>70.01</td><td>24.57</td><td>28.52</td><td>53.13</td><td>65.47</td></tr><tr><td>Trans-doc + Our method</td><td>24.60</td><td>28.43</td><td>55.16</td><td>70.55</td><td>31.63</td><td>34.33</td><td>60.91</td><td>69.93</td><td>23.72</td><td>27.95</td><td>52.50</td><td>65.20</td></tr><tr><td>G-Trans-FT</td><td>25.07</td><td>28.86</td><td>55.65</td><td>70.79</td><td>32.38</td><td>34.51</td><td>62.15</td><td>70.32</td><td>25.87</td><td>27.82</td><td>55.71</td><td>65.14</td></tr><tr><td>G-Trans + DLS + LAA</td><td>25.37</td><td>29.07</td><td>55.76</td><td>70.81</td><td>32.67</td><td>34.81</td><td>62.06</td><td>70.23</td><td>26.70</td><td>28.66</td><td>55.96</td><td>65.24</td></tr><tr><td>G-Trans + Our method</td><td>24.87</td><td>28.53</td><td>55.34</td><td>70.51</td><td>32.67</td><td>34.82</td><td>61.99</td><td>70.17</td><td>26.56</td><td>28.52</td><td>55.78</td><td>65.09</td></tr></table>
|
| 153 |
+
|
| 154 |
+
Table 1: The experimental results of our proposed method on TED, Europarl and News. The best score are shown in bold. For our proposed Trans-doc + Our and G-Trans + Our, the documents are translated as a full unit without segmentation, while for other methods, the documents are segmented according to the maximum sequence length of 512.
|
| 155 |
+
|
| 156 |
+
<table><tr><td rowspan="2">ID</td><td colspan="3">Components</td><td colspan="4">Scores</td></tr><tr><td>DLS</td><td>LAA</td><td>SD</td><td>s-BLEU</td><td>d-BLEU</td><td>s-chrF</td><td>d-chrF</td></tr><tr><td>1</td><td>✓</td><td>✓</td><td>✓</td><td>31.63</td><td>34.33</td><td>60.91</td><td>69.93</td></tr><tr><td>2</td><td>✓</td><td>✓</td><td>X</td><td>31.85</td><td>34.32</td><td>61.26</td><td>70.01</td></tr><tr><td>3</td><td>★</td><td>X</td><td>X</td><td>31.86</td><td>34.21</td><td>61.33</td><td>69.84</td></tr><tr><td>4</td><td>✓</td><td>X</td><td>X</td><td>32.06</td><td>34.37</td><td>61.52</td><td>69.94</td></tr><tr><td>5</td><td>X</td><td>✓</td><td>X</td><td>31.36</td><td>33.72</td><td>61.26</td><td>69.93</td></tr><tr><td>6</td><td>X</td><td>X</td><td>X</td><td>31.16</td><td>33.58</td><td>61.29</td><td>69.91</td></tr></table>
|
| 157 |
+
|
| 158 |
+
Table 2: The ablation study of our proposed method. We conduct ablation study on Europarl with Trans-FT. The marker $\checkmark$ and $\times$ indicate the component is involved and not involved, respectively. The marker $\star$ indicate the length sampling is applied without dynamic adjusting the temperature.
|
| 159 |
+
|
| 160 |
+
Implementation Details All the systems are implemented as the base model configuration in Vaswani et al. (2017). We train our system on 4 NVIDIA 3090 GPUs by using Adam (Kingma and Ba, 2017) optimizer. Most training parameters are kept the same with Bao et al. (2021), where the learning rate $lr = 5e - 4$ , $\beta_{1} = 0.9$ , $\beta_{2} = 0.98$ . The warmup step is set to 4000 and the label smoothing (Szegedy et al., 2015) value is set to 0.1. The dropout ratio is set to 0.3 on TED and News, and 0.1 on Europarl for its larger scale. During decoding, we set the context window to 0.8 of the maximum sequence length used during the training phase to prevent performance degradation caused by overly long target sequences.
|
| 161 |
+
|
| 162 |
+
# 4.3 Main Results
|
| 163 |
+
|
| 164 |
+
During decoding, the test documents with a length less than the maximum length will be directly input into the model. Documents with a length greater than the maximum length will be segmented into several shorter sequences according to the maximum length and input into the model separately (Liu et al., 2020). We generate the translations with a beam size of 5 and length penalty $\alpha = 1$ . We use the SacreBLEU tool (Post, 2018) to evaluate the output with s-BLEU (sentence BLEU) (Papineni et al., 2002), d-BLEU (document BLEU) (Liu et al., 2020), s-chrF (sentence-chrF) (Popovic, 2015) and d-chrF (document-chrF), respectively. To make our experimental results comparable with previous studies (Sun et al., 2022b), our BLEU scores are calculated in a case-insensitive manner.
|
| 165 |
+
|
| 166 |
+
The main results are shown in Table 1. In the $\mathrm{En}\rightarrow \mathrm{De}$ translation task, our method outperforms the majority of the comparative systems, when in combination with the conventional doc2doc DNMT (Trans-doc+DLS+LAA). Furthermore, our proposed Trans-doc+DLS+LAA achieves performance comparable to the best-performing comparative system G-Trans-FT and surpass MR by a large margin. Further improvements are observed when integrating our method with G-transformer (G-Trans+DLS+LAA), and it can achieve state-of-the-art performance on all datasets. However, when combined with the slide decoding strategy, the performance drops slightly. We suspect that
|
| 167 |
+
|
| 168 |
+
this may be due to the error accumulation problem. On the other hand, the slide decoding strategy aims to solve the length extrapolation problem, and we further explore its advantages in Section 5.2.
|
| 169 |
+
|
| 170 |
+
# 5 Discussion
|
| 171 |
+
|
| 172 |
+
# 5.1 Ablation Study
|
| 173 |
+
|
| 174 |
+
To further understand the impact of each step of our method, we perform further studies by removing certain parts of our method. The results are given in Table 2. Upon comparing the performance of systems 2 and 6, it is evident that removing dynamic length sampling (DLS) significantly deteriorates the model's performance. This observation validates the importance of DLS and LAA in enhancing the system's performance. Furthermore, comparing the results of system 5 and 6, Length Aware Attention (LAA) also demonstrates a notable improvement, indicating that our method can effectively capture the contextual information. Lastly, when comparing system 3 and system 4, we find that dynamic adjust the temperature can further improve the performance without the need for fine-tuning. Therefore, the above results provide evidence that all of our methods are effective in enhancing the performance of doc2doc DNMT.
|
| 175 |
+
|
| 176 |
+
In addition, to verify the effectiveness of our proposed Length Aware Attention (LAA), we conducted a statistical analysis of the average entropy of the attention mechanism when translating sentences and documents of length 512. As shown in 4, it can be observed that the entropy of the attention mechanism is more stable after applying the LAA method, which indicates that after applying the LAA mechanism, the model demonstrates better consistency in handling sentence-level and document-level text. Furthermore, by applying the DLS and LAA method, the entropy of attention when translating the document is lower than that of the FT method, indicating that the model concentrates more on the long-range contexts.
|
| 177 |
+
|
| 178 |
+
# 5.2 Length Generalization
|
| 179 |
+
|
| 180 |
+
The main motivation of our approach is to enhance the length generalization performance of the doc2doc DNMT model, thereby addressing the issue of length bias. To assess the effectiveness of our method in achieving this goal, we conduct further analysis based on the English-German datasets. We decode the test set using the systems in the main experiments with different maximum lengths
|
| 181 |
+
|
| 182 |
+
and measured their corresponding d-BLEU scores. The results are presented in Figure 5. The results indicate that the baseline system and many comparison systems experience a significant decrease in d-BLEU score when the decoding length deviates from the maximum length used during training (512). In contrast, our method exhibits no significant decrease in BLEU score. This demonstrates that our approach can enhance the length generalization performance of the doc2doc model and alleviate the issue of length bias. In particular, when the decoding length exceeds the training length, the performance of the existing methods suffers from a huge drop, while our proposed slide decoding is able to maintain the high translation quality.
|
| 183 |
+
|
| 184 |
+
To further comprehend why our approach can enhance the length generalization performance of the model, we perform a visualization of the length distribution of the training data. We visualized the length distribution of the original corpus used for training, the data employed by the MR method, and the data used in the final epoch after incorporating DLS. The results are presented in Figure 6, which demonstrates that our approach achieves a more uniform length distribution. Consequently, our method has the capacity to improve the length generalization performance of the model to a greater extent.
|
| 185 |
+
|
| 186 |
+
# 5.3 The Discourse Phenomena
|
| 187 |
+
|
| 188 |
+
To investigate the translation of discourse phenomena, we conduct experiments on ContraPro test suite (Müller et al., 2018), a large contrastive test suite extracted from OpenSubtitles 2018 (Lison and Tiedemann, 2016), to measure the translation accuracy of English pronoun "it" into the corresponding German translations "er", "sie" or "es". We employ Europarl as the training set, and the maximum sequence length is setting to 512. As shown Table 3, compared to random selection, the sentence-level translation model has the ability to infer a portion of the correct answer based on the information within the sentence. However, with the help of contextual information, document-level neural machine translation models outperforms sentence-level baseline by a large margin. Utilizing our proposed DLS and LAA, the error rate of Transformer-doc is further reduced, indicating that our approach can further enhance the capability of the model to capture the contextual information.
|
| 189 |
+
|
| 190 |
+

|
| 191 |
+
Figure 5: The length generalization of the different methods. We represent our method using solid lines while the baseline method using dashed lines.
|
| 192 |
+
|
| 193 |
+

|
| 194 |
+
|
| 195 |
+

|
| 196 |
+
|
| 197 |
+

|
| 198 |
+
Figure 6: The length distributions of the training data used by different training strategies. We collect these distributions at the maximum length equal to 512.
|
| 199 |
+
|
| 200 |
+

|
| 201 |
+
|
| 202 |
+

|
| 203 |
+
|
| 204 |
+
<table><tr><td>Method</td><td>ContraPro ACC(%)</td></tr><tr><td>Random</td><td>33.33</td></tr><tr><td>Trans-sent</td><td>52.00</td></tr><tr><td>Trans-FT</td><td>70.58</td></tr><tr><td>Trans-doc+DLS+LAA</td><td>72.28</td></tr></table>
|
| 205 |
+
|
| 206 |
+
Table 3: The results of ContraPro test suit, measured by accuracy.
|
| 207 |
+
|
| 208 |
+
<table><tr><td>Method</td><td>sentence</td><td>document</td><td>δ</td></tr><tr><td>Trans-FT</td><td>2.65</td><td>4.0</td><td>1.35</td></tr><tr><td>Trans-DLS</td><td>2.51</td><td>3.95</td><td>1.44</td></tr><tr><td>Trans-DLS-LAA</td><td>2.74</td><td>3.94</td><td>1.20</td></tr></table>
|
| 209 |
+
|
| 210 |
+
Table 4: The average entropy of the attention mechanism when translating at sentence and document level. $\delta$ represents the difference in entropy when translating at different granularity.
|
| 211 |
+
|
| 212 |
+
# 6 Related Work
|
| 213 |
+
|
| 214 |
+
# 6.1 Document-Level Neural Machine Translation
|
| 215 |
+
|
| 216 |
+
Document-level neural machine translation can be broadly divide into two categories, including sentence-to-sentence (sen2sen) approach and document-to-document (doc2doc) approach (Maruf et al., 2021). The former feed the context as additional information to assist the translation of each single sentence in the document independently, which is also known as multi encoder method (Lupo et al., 2022). Jean et al. (2017) leveraged additional attention to capture the previous context; Kuang and Xiong (2018) proposed to control the usage of context by a gate function; Wang et al. (2017), (Miculicich et al., 2018), and (Zheng et al., 2020) introduced hierarchical attention networks to model the contextual information from the documents; Maruf et al. (2019) and Martins and Astudillo (2016) designed a selective attention network to extract most useful information from the massive context; Yang et al. (2019) proposed a query-guided capsule network to further
|
| 217 |
+
|
| 218 |
+
model the relationship between the context words. However, the scarcity of the datasets (Chen et al., 2021) and the sparsity of the contextual information make these model hard to be trained. Lupo et al. (2022) further address this problem by splitting the sentence into smaller pieces to augment the document-level corpus.
|
| 219 |
+
|
| 220 |
+
Another type of methods fall into doc2doc paradigm, which treats the entire document as a whole unit. Tiedemann and Scherrer (2017) proposed that by extending the translation granularity from sentence to documents the translation becomes more coherent; Liu et al. (2020) and (Ma et al., 2020) found that the translation quality could be improved by a large margin through incorporating pretraining; Bao et al. (2021) suggest that direct training a doc2doc transformer may fail to converge on small datasets, and proposed to solve this problem by incorporating group attention masks. Similarly, (Sun et al., 2022b) proposed to tackle the same problem by expanding the dataset with a multi-resolution (MR) strategy. On the other hand, this strategy improves the length generalization of the doc2doc models. Compared to the MR strategy, our proposed DLS effectively balances the amount of the text of different lengths. The experimental results show that our proposed method is capable of handling the text with arbitrary length.
|
| 221 |
+
|
| 222 |
+
# 6.2 The Length Bias Problem
|
| 223 |
+
|
| 224 |
+
Although the length bias problem has not been explored in the field of DNMT, there still exists several studies emphasis on the length extrapolation problem. Press et al. (2021) proposed to solve the length extrapolation problem by introducing local assumption as the inductive bias in the positional encoding. Following this work, Chi et al. (2022) and Sun et al. (2022a) further proposed new positional encoding methods to overcome this issue. Additionally, (Ruoss et al., 2023) introduced random positional encoding training strategy to overcome the length extrapolation problem, and achieved remarkable progress within the field of language modeling.
|
| 225 |
+
|
| 226 |
+
# 7 Conclusion
|
| 227 |
+
|
| 228 |
+
In this work, we aim to address the issue of length bias in the training of the doc2doc DNMT model. To achieve this objective, we propose several methods, including dynamic length sampling, length aware attention and sliding decoding. We conduct experiments on multiple publicly available datasets,
|
| 229 |
+
|
| 230 |
+
and the results demonstrate a significant improvement achieved by our method. Further analysis indicates that our approach can enhance the length generalization capability of the model effectively.
|
| 231 |
+
|
| 232 |
+
# 8 Acknowledgement
|
| 233 |
+
|
| 234 |
+
We would like to express our gratitude to the ICT computing platform and the technical service team for providing GPU resources.
|
| 235 |
+
|
| 236 |
+
Furthermore, we thank the anonymous reviewers for their thorough review and valuable feedback.
|
| 237 |
+
|
| 238 |
+
# Limitations
|
| 239 |
+
|
| 240 |
+
Although our proposed methods significantly improve the translation quality and the length generalization capability, there still exist some limitations: (1) the slide decoding can not further improve the translation quality as the error accumulation problem of auto-regression model has not been solved; (2) the decoding consumption using SD is slightly higher than the "segment then decoding" method.
|
| 241 |
+
|
| 242 |
+
# References
|
| 243 |
+
|
| 244 |
+
Naveen Arivazhagan, Ankur Bapna, Orhan First, Dmitry Lepikhin, Melvin Johnson, Maxim Krikun, Mia Xu Chen, Yuan Cao, George F. Foster, Colin Cherry, Wolfgang Macherey, Zhifeng Chen, and Yonghui Wu. 2019. Massively multilingual neural machine translation in the wild: Findings and challenges. CoRR, abs/1907.05019.
|
| 245 |
+
Guangsheng Bao, Yue Zhang, Zhiyang Teng, Boxing Chen, and Weihua Luo. 2021. G-transformer for document-level 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 3442-3455.
|
| 246 |
+
Iz Beltagy, Matthew E. Peters, and Arman Cohan. 2020. Longformer: The Long-Document Transformer. arXiv:2004.05150 [cs]. ArXiv: 2004.05150.
|
| 247 |
+
Mauro Cettolo, Christian Girardi, and Marcello Federico. 2012. WIT3: Web Inventory of Transcribed and Translated Talks. In Proceedings of the 16th Annual conference of the European Association for Machine Translation, pages 261-268, Trento, Italy. European Association for Machine Translation.
|
| 248 |
+
Linqing Chen, Junhui Li, Zhengxian Gong, Boxing Chen, Weihua Luo, Min Zhang, and Guodong Zhou. 2021. Breaking the Corpus Bottleneck for Context-Aware Neural Machine Translation with Cross-Task Pre-training. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics
|
| 249 |
+
|
| 250 |
+
and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 2851-2861, Online. Association for Computational Linguistics.
|
| 251 |
+
Ta-Chung Chi, Ting-Han Fan, Peter J Ramadge, and Alexander Rudnicky. 2022. Kerple: Kernelized relative positional embedding for length extrapolation. Advances in Neural Information Processing Systems, 35:8386-8399.
|
| 252 |
+
David Chiang and Peter Cholak. 2022. Overcoming a Theoretical Limitation of Self-Attention. ArXiv:2202.12172 [cs].
|
| 253 |
+
Eva Martínez Garcia, Cristina España-Bonet, and Lluís Márquez. 2015. Document-level machine translation with word vector models. In Proceedings of the 18th Annual Conference of the European Association for Machine Translation, EAMT 2015, Antalya, Turkey, May 11 - 13, 2015. European Association for Machine Translation.
|
| 254 |
+
Zhengxian Gong, Min Zhang, and Guodong Zhou. 2011. Cache-based document-level statistical machine translation. In Proceedings of the 2011 Conference on Empirical Methods in Natural Language Processing, EMNLP 2011, 27-31 July 2011, John McIntyre Conference Centre, Edinburgh, UK, A meeting of SIGDAT, a Special Interest Group of the ACL, pages 909-919. ACL.
|
| 255 |
+
Christian Hardmeier, Sara Stymne, Jörg Tiedemann, and Joakim Nivre. 2013. Docent: A document-level decoder for phrase-based statistical machine translation. In 51st Annual Meeting of the Association for Computational Linguistics, ACL 2013, Proceedings of the Conference System Demonstrations, 4-9 August 2013, Sofia, Bulgaria, pages 193-198.
|
| 256 |
+
Sebastien Jean, Stanislas Lauly, Orhan First, and Kyunghyun Cho. 2017. Does Neural Machine Translation Benefit from Larger Context? ArXiv:1704.05135 [cs, stat].
|
| 257 |
+
Marcin Junczys-Dowmunt. 2019. Microsoft translator at WMT 2019: Towards large-scale document-level neural machine translation. In Proceedings of the Fourth Conference on Machine Translation, WMT 2019, Florence, Italy, August 1-2, 2019 - Volume 2: Shared Task Papers, Day 1, pages 225-233.
|
| 258 |
+
Diederik P. Kingma and Jimmy Ba. 2017. Adam: A Method for Stochastic Optimization. ArXiv:1412.6980 [cs].
|
| 259 |
+
Philipp Koehn. 2005. Europarl: A Parallel Corpus for Statistical Machine Translation. In Proceedings of Machine Translation Summit X: Papers, pages 79-86, Phuket, Thailand.
|
| 260 |
+
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
|
| 261 |
+
|
| 262 |
+
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.
|
| 263 |
+
Shaohui Kuang and Deyi Xiong. 2018. Fusing Recency into Neural Machine Translation with an Inter-Sentence Gate Model. In Proceedings of the 27th International Conference on Computational Linguistics, pages 607-617, Santa Fe, New Mexico, USA. Association for Computational Linguistics.
|
| 264 |
+
Pierre Lison and Jörg Tiedemann. 2016. Opensubtitles2016: Extracting large parallel corpora from movie and tv subtitles.
|
| 265 |
+
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. Trans. Assoc. Comput. Linguistics, 8:726-742.
|
| 266 |
+
Lorenzo Lupo, Marco Dinarelli, and Laurent Besacier. 2022. Divide and Rule: Effective Pre-Training for Context-Aware Multi-Encoder Translation Models. arXiv:2103.17151 [cs]. ArXiv: 2103.17151.
|
| 267 |
+
Shuming Ma, Dongdong Zhang, and Ming Zhou. 2020. A Simple and Effective Unified Encoder for Document-Level Machine Translation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 3505-3511, Online. Association for Computational Linguistics.
|
| 268 |
+
Andre F. T. Martins and Ramón Fernandez Astudillo. 2016. From Softmax to Sparsemax: A Sparse Model of Attention and Multi-Label Classification. ArXiv:1602.02068 [cs, stat].
|
| 269 |
+
Sameen Maruf, André F. T. Martins, and Gholamreza Haffari. 2019. Selective attention for context-aware neural machine translation. 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 3092-3102. Association for Computational Linguistics.
|
| 270 |
+
Sameen Maruf, Fahimeh Saleh, and Gholamreza Haffari. 2021. A survey on document-level neural machine translation: Methods and evaluation. ACM Computing Surveys (CSUR), 54(2):1-36.
|
| 271 |
+
Lesly Miculicich, Dhananjay Ram, Nikolaos Pappas, and James Henderson. 2018. Document-level neural machine translation with hierarchical attention networks. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, Brussels, Belgium, October 31 - November 4, 2018, pages 2947-2954. Association for Computational Linguistics.
|
| 272 |
+
|
| 273 |
+
Mathias Müller, Annette Rios, Elena Voita, and Rico Sennrich. 2018. A Large-Scale Test Set for the Evaluation of Context-Aware Pronoun Translation in Neural Machine Translation. In WMT 2018, Brussels, Belgium. Association for Computational Linguistics.
|
| 274 |
+
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.
|
| 275 |
+
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.
|
| 276 |
+
Matt Post. 2018. A call for clarity in reporting BLEU scores. In Proceedings of the Third Conference on Machine Translation: Research Papers, pages 186-191, Belgium, Brussels. Association for Computational Linguistics.
|
| 277 |
+
Ofir Press, Noah A Smith, and Mike Lewis. 2021. Train short, test long: Attention with linear biases enables input length extrapolation. arXiv preprint arXiv:2108.12409.
|
| 278 |
+
Anian Ruoss, Gregoire Deletang, Tim Genewein, Jordi Grau-Moya, Robert Csordás, Mehdi Bennani, Shane Legg, and Joel Veness. 2023. Randomized positional encodings boost length generalization of transformers. arXiv preprint arXiv:2305.16843.
|
| 279 |
+
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, ACL 2016, August 7-12, 2016, Berlin, Germany, Volume 1: Long Papers.
|
| 280 |
+
Yutao Sun, Li Dong, Barun Patra, Shuming Ma, Shaohan Huang, Alon Benhaim, Vishrav Chaudhary, Xia Song, and Furu Wei. 2022a. A length-extrapolatable transformer. arXiv preprint arXiv:2212.10554.
|
| 281 |
+
Zewei Sun, Mingxuan Wang, Hao Zhou, Chengqi Zhao, Shujian Huang, Jiajun Chen, and Lei Li. 2022b. Rethinking document-level neural machine translation. In Findings of the Association for Computational Linguistics: ACL 2022, Dublin, Ireland, May 22-27, 2022, pages 3537-3548.
|
| 282 |
+
Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jonathon Shlens, and Zbigniew Wojna. 2015. Rethinking the Inception Architecture for Computer Vision. ArXiv:1512.00567 [cs].
|
| 283 |
+
Xin Tan, Longyin Zhang, Deyi Xiong, and Guodong Zhou. 2019. Hierarchical modeling of global context for document-level neural machine translation. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural
|
| 284 |
+
|
| 285 |
+
Language Processing, EMNLP-IJCNLP 2019, Hong Kong, China, November 3-7, 2019, pages 1576-1585.
|
| 286 |
+
Jörg Tiedemann and Yves Scherrer. 2017. Neural machine translation with extended context. arXiv preprint arXiv:1708.05943.
|
| 287 |
+
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.
|
| 288 |
+
Longyue Wang, Zhaopeng Tu, Andy Way, and Qun Liu. 2017. Exploiting Cross-Sentence Context for Neural Machine Translation. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 2826-2831, Copenhagen, Denmark. Association for Computational Linguistics.
|
| 289 |
+
Hongfei Xu, Deyi Xiong, Josef van Genabith, and Qiuhui Liu. 2020. Efficient context-aware neural machine translation with layer-wise weighting and input-aware gating. In Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence, IJCAI 2020, pages 3933-3940.
|
| 290 |
+
Zhengxin Yang, Jinchao Zhang, Fandong Meng, Shuhao Gu, Yang Feng, and Jie Zhou. 2019. Enhancing context modeling with a query-guided capsule network for document-level translation. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing, EMNLP-IJCNLP 2019, Hong Kong, China, November 3-7, 2019, pages 1527-1537. Association for Computational Linguistics.
|
| 291 |
+
Hyeongu Yun, Yongkeun Hwang, and Kyomin Jung, 2020. Improving context-aware neural machine translation using self-attentive sentence embedding. 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 9498-9506.
|
| 292 |
+
Jiacheng Zhang, Huanbo Luan, Maosong Sun, Feifei Zhai, Jingfang Xu, Min Zhang, and Yang Liu. 2018. Improving the transformer translation model with document-level context. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, Brussels, Belgium, October 31 - November 4, 2018, pages 533-542.
|
| 293 |
+
Zaixiang Zheng, Xiang Yue, Shujian Huang, Jiajun Chen, and Alexandra Birch. 2020. Towards making the most of context in neural machine translation. In Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence, IJCAI 2020, pages 3983-3989. ijcai.org.
|
| 294 |
+
|
| 295 |
+
# A The Proof of the Length Aware Attention
|
| 296 |
+
|
| 297 |
+
The entropy of the attention mechanism can be calculated using the following formula<sup>4</sup>:
|
| 298 |
+
|
| 299 |
+
$$
|
| 300 |
+
\begin{array}{l} \mathcal {H} _ {i} = - \sum_ {j = 1} ^ {n} a _ {i, j} \log a _ {i, j} \\ = \log \sum_ {j = 1} ^ {n} e ^ {\lambda \boldsymbol {q} _ {i} \cdot \boldsymbol {k} _ {j}} - \frac {\sum_ {j = 1} ^ {n} e ^ {\lambda \boldsymbol {q} _ {i} \cdot \boldsymbol {k} _ {j}} \left(\lambda \boldsymbol {q} _ {i} \cdot \boldsymbol {k} _ {j}\right)}{\sum_ {j = 1} ^ {n} e ^ {\lambda \boldsymbol {q} _ {i} \cdot \boldsymbol {k} _ {j}}}, \tag {6} \\ \end{array}
|
| 301 |
+
$$
|
| 302 |
+
|
| 303 |
+
where $\mathcal{H}_i$ indicate the attention entropy of the $i$ -th token, $\lambda$ is the scale factor, and $a_{i,j}$ is the attention weight. Let $\pmb{s}_{i,j} = \pmb{q}_i \cdot \pmb{k}_j$ and $\pmb{p}_{i,j} = \frac{\pmb{s}_{i,j}}{\sum_{j=1}^{n} e^{\lambda s_{i,j}}}$ , we get:
|
| 304 |
+
|
| 305 |
+
$$
|
| 306 |
+
\begin{array}{l} \mathcal {H} _ {i} = \log \sum_ {j = 1} ^ {n} e ^ {\lambda \boldsymbol {s} _ {i, j}} - \lambda \sum_ {j = 1} ^ {n} \boldsymbol {p} _ {i, j} \boldsymbol {s} _ {i, j}, \\ = \log n + \log \frac {1}{n} \sum_ {j = 1} ^ {n} e ^ {\lambda s _ {i, j}} - \lambda \sum_ {j = 1} ^ {n} \boldsymbol {p} _ {i, j} \boldsymbol {s} _ {i, j} \tag {7} \\ \end{array}
|
| 307 |
+
$$
|
| 308 |
+
|
| 309 |
+
According to Mean-field theory, we could change the order of computation between the exponential function and summation:
|
| 310 |
+
|
| 311 |
+
$$
|
| 312 |
+
\mathcal {H} _ {i} \approx \log n + \lambda \bar {\boldsymbol {s}} _ {i} - \lambda \sum_ {j = 1} ^ {n} \boldsymbol {p} _ {i, j} \boldsymbol {s} _ {i, j} \tag {8}
|
| 313 |
+
$$
|
| 314 |
+
|
| 315 |
+
where $\bar{s}_i = \sum_{j=1}^{n} s_{i,j} / n$ . Considering the properties of the softmax function, we can obtain further approximations:
|
| 316 |
+
|
| 317 |
+
$$
|
| 318 |
+
\mathcal {H} _ {i} \approx \log n + \lambda (\bar {s} _ {i} - \lambda s _ {\max }) \tag {9}
|
| 319 |
+
$$
|
| 320 |
+
|
| 321 |
+
Thus, we get:
|
| 322 |
+
|
| 323 |
+
$$
|
| 324 |
+
\lambda \propto \log n, \tag {10}
|
| 325 |
+
$$
|
| 326 |
+
|
| 327 |
+
where $\lambda$ is proportional to $\log n$ .
|
addressingthelengthbiaschallengeindocumentlevelneuralmachinetranslation/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d6cbe94de657ddb01122264e9d3eeb5d607ea702994ad987a032e2b1da92acd4
|
| 3 |
+
size 410671
|
addressingthelengthbiaschallengeindocumentlevelneuralmachinetranslation/layout.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1bf179c371fc5b28c8983975e034a9980a3da187666c10839b7bbccc2ee21d7f
|
| 3 |
+
size 362008
|
adversarialrobustnessforlargelanguagenermodelsusingdisentanglementandwordattributions/ab24a28f-fb84-40be-b259-dc23004f5776_content_list.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3c1e0fc08dc05b3a97d7ad434d6fb429432919094caefbe5a754dcf79d218066
|
| 3 |
+
size 96429
|
adversarialrobustnessforlargelanguagenermodelsusingdisentanglementandwordattributions/ab24a28f-fb84-40be-b259-dc23004f5776_model.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b2e76050ab63413040626a884f70166bd67ea820d6c47ca7ca94b801603ab71f
|
| 3 |
+
size 115121
|
adversarialrobustnessforlargelanguagenermodelsusingdisentanglementandwordattributions/ab24a28f-fb84-40be-b259-dc23004f5776_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:506bca3060d0ce6d197a4278dde9b624e9d4b99516b0f87b8b53d074b37cc369
|
| 3 |
+
size 1231031
|
adversarialrobustnessforlargelanguagenermodelsusingdisentanglementandwordattributions/full.md
ADDED
|
@@ -0,0 +1,416 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Adversarial Robustness for Large Language NER models using Disentanglement and Word Attributions
|
| 2 |
+
|
| 3 |
+
Xiaomeng Jin*† Bhanukiran Vinzamuri‡ Sriram Venkatapathy‡ Heng Ji‡ Pradeep Natarajan‡
|
| 4 |
+
|
| 5 |
+
†University of Illinois, Urbana Champaign ‡Amazon Alexa AI xjin17@illinois.edu
|
| 6 |
+
|
| 7 |
+
{vinzamub,vesriram,jihj,natarap}@amazon.com
|
| 8 |
+
|
| 9 |
+
# Abstract
|
| 10 |
+
|
| 11 |
+
Large language models (LLM's) have been widely used for several applications such as question answering, text classification and clustering. While the preliminary results across the aforementioned tasks look promising, recent work (Qin et al., 2023; Wang et al., 2023a) has dived deep into LLM's performing poorly for complex Named Entity Recognition (NER) tasks in comparison to fine-tuned pre-trained language models (PLM's). To enhance wider adoption of LLM's, our paper investigates the robustness of such LLM NER models and its instruction fine-tuned variants to adversarial attacks. In particular, we propose a novel attack which relies on disentanglement and word attribution techniques where the former aids in learning an embedding capturing both entity and non-entity influences separately, and the latter aids in identifying important words across both components. This is in stark contrast to most techniques which primarily leverage non-entity words for perturbations limiting the space being explored to synthesize effective adversarial examples. Adversarial training results based on our method improves the F1 score over original LLM NER model by $8\%$ and $18\%$ on CoNLL-2003 and Ontonotes 5.0 datasets respectively.
|
| 12 |
+
|
| 13 |
+
# 1 Introduction
|
| 14 |
+
|
| 15 |
+
Named Entity Recognition (NER) aims to identify and categorize named entities mentioned in unstructured text into pre-defined categories such as Person, Location, or Organization. In recent years, NER tasks (Malmasi et al., 2022) have become more challenging due to the introduction of complex tagsets, which often leads to the failure of existing NER systems in accurately recognizing these entities. To address this, Large Language Models (LLMs) have emerged as powerful tools, delivering significant performance improvements
|
| 16 |
+
|
| 17 |
+
on NER tasks. However, these models tend to hallucinate with even minor modifications in the input (Wang et al., 2023b). Recently, there has been a growing interest in developing adversarial attack-based techniques for NER models (Simoncini and Spanakis, 2021; Lin et al., 2021) to enhance NER models using word-level attacks. This is even more relevant in the context of LLM's, as a very recent study (Zhu et al., 2023) demonstrated the lack of robustness in current LLM's with word-level attacks resulting in a significant performance drop of $33\%$ . However, despite resulting in a successful attack, many of the perturbed word-level attack candidates fail to qualify as adversarial examples, i.e., they are not semantically similar to original sentences as depicted in Figure 1.
|
| 18 |
+
|
| 19 |
+
In addition, in resource constrained settings, it isn't frugal to explore the entire space of feasible word-level perturbations to devise good adversarial examples. This justifies the necessity of attack techniques which can explore the diverse space efficiently. In our paper, this is mainly accomplished using two key levers, namely, disentanglement and word attribution techniques, respectively. Disentanglement (Higgins et al., 2017) is a technique which helps in separating the latent entity and context components of an embedding space (Figure 2), making it more congenial for a word attribution function like Integrated Gradients (IG) (Sundararajan et al., 2017) to identify diverse, yet important words. The other subsequent steps include substitution of the selected words with entity and context substitution workflows (Figure 4), and selection of candidate adversarial examples based on their semantic similarity scores to the original text.
|
| 20 |
+
|
| 21 |
+
Experimental results indicate that to create a successful attack, on average, our method requires $69\%$ (details presented in Appendix A.1) lesser candidate adversarial sample generation than a state-of-the-art technique like CLARE (Li et al., 2021) when evaluated on three popular
|
| 22 |
+
|
| 23 |
+
datasets (CoNLL-2003 (Sang and De Meulder, 2003), Ontonotes 5.0 (Weischedel et al., 2013), and MultiCoNER (Malmasi et al., 2022)). The results also demonstrate that our method improves the F1 score over original BERT NER model by $8\%$ and $18\%$ on CoNLL-2003 and Ontonotes 5.0 respectively. Furthermore, in an intrinsic evaluation of our adversarial examples generation approach on CoNLL-2003, we achieve a $10\%$ higher attack success rate (percentage of generated adversarial examples causing label flip) at a comparable modification rate. In addition, our method successfully attacks the instruction fine-tuned T5 NER model (Wang et al., 2022) on the MultiCoNER dataset., resulting in a $10\%$ drop in the F1 score after the attack.
|
| 24 |
+
|
| 25 |
+
The main contributions in this paper are,
|
| 26 |
+
|
| 27 |
+
- We present a first of a kind architecture for synthesizing adversarial examples using a novel disentanglement technique and several components such as word attribution, word substitution and semantic similarity.
|
| 28 |
+
- Our novel disentanglement technique aids in generating a representation which significantly enhances the effectiveness of our attacks as outlined in our ablation studies.
|
| 29 |
+
- We present end-to-end results of improvements obtained through adversarial training on BERT, T5-based and LAMA2 models using the examples generated from our approach on multiple datasets.
|
| 30 |
+
|
| 31 |
+
The rest of the paper is structured as follows. Section 2 provides an overview of related work in this field, highlighting the unique aspects of our contribution. In Section 3, we introduce our approach and discuss the individual technical components involved, including disentanglement, word attributions and semantic similarity. In Section 4, we present attack and adversarial training results on three benchmark datasets followed by conclusions.
|
| 32 |
+
|
| 33 |
+
# 2 Related Work
|
| 34 |
+
|
| 35 |
+
The existing adversarial attack methods on NER tasks can be classified into three categories: Character-level Attack, Word-level Attack, and Sentence-level Attack. The Character-level attacks generate adversarial examples by adding, deleting, or replacing a character in a word in the natural language texts. HotFlip (Ebrahimi et al., 2018) performs a character-level attack by swapping characters based on their gradient with respect to a
|
| 36 |
+
|
| 37 |
+

|
| 38 |
+
Figure 1: A PCA plot of an original sentence and the generated adversarial examples using different attack methods. The original sentence is One of the two honorable guests in the studio is Professor Zhou Hanhua from the Institute of Law of the Chinese Academy of Social Sciences., represented with $\bullet$ , the $\star$ are the adversarial examples from our method, and the $\times$ markers represent the adversarial examples from RockNER. Across sentences we only retained modified spans and exclude identical content as compared to the original sentence.
|
| 39 |
+
|
| 40 |
+
one-hot input representation. However, these attacks have the problem that the character swapping generates spelling typos and the sentences are not semantically meaningful. Sentence-level attacks perform the operations by altering the input texts on the whole sentence. SCPN (Iyyer et al., 2018) includes a paraphrase generation under the guidance of a trained parser to label syntactic transformation.
|
| 41 |
+
|
| 42 |
+
Word-level attacks are more popular and effective methods than the above-mentioned two methods. There are also many effective word-level attacks on text classification tasks (Ribeiro et al., 2020; Das and Paik, 2022). (Liu et al., 2021) proposes an efficient local search algorithm to determine the possible word substitutions. However, the adversarial attacks on sequence-to-sequence models are not much explored. (Simoncini and Spanakis, 2021) extends TextAttack (Morris et al., 2020) framework that consists of multiple attack strategies via reformulating the goal functions to support NER tasks. RockNER (Lin et al., 2021) is a simple NER adversarial attack by perturbing both named entities and contexts in the original texts. However, the generated adversarial examples all have the issue of poor semantic equivalence to the original input sentences because of the high modification rate. In contrast, we propose a word-level adversarial attack on NER models that effectively identifies important words via word attributions and generates the adversarial examples with a lower modification rate.
|
| 43 |
+
|
| 44 |
+
Recently, large language models (LLM's) (Brown et al., 2020; Wang and Komatsuzaki, 2021;
|
| 45 |
+
|
| 46 |
+

|
| 47 |
+
Figure 2: The architecture of our method as depicted here proceeds as follows. Given an input text, we first obtain word embeddings from language models that the NER model uses, then learn a disentangled representation for entity and context representations (context, entity in the UMAP embedding scatter plots). The disentangled representations are then used to compute scores via the IG word attribution function. The most important words are replaced with new words following word substitution workflows. After generating new sentences, we rank the sentence similarity scores and output the most similar sentences as adversarial examples.
|
| 48 |
+
|
| 49 |
+
Touvron et al., 2023), have brought attention that they outperform many NLP tasks and have been widely used for applications (Sallam, 2023). Nori et al. (2023) explore potential use of LLMs in medical education, assessment, and clinical practice. However, LLMs still underperform in some NLP tasks. (Wang et al., 2023a) study the robustness of in-context learning and propose an ICL attack on large language models by manipulating the demonstrations. In this paper, we focus on instruction fine-tuned language model on NER tasks and examine its robustness under our proposed adversarial attack method.
|
| 50 |
+
|
| 51 |
+
Disentanglement (Higgins et al., 2017) has been primarily used in the space of auto-encoders for learning latent factors which are mutually orthogonal (diverse) w.r.t one another to aid with interpretability primarily for image-based applications. They have also been extended for text-based tasks (Zou et al., 2022) to leverage the latent components to learn more desired downstream representations. In this paper, we use disentanglement to segregate the entity and non-entity representations in the feature space.
|
| 52 |
+
|
| 53 |
+
# 3 Our Method
|
| 54 |
+
|
| 55 |
+
In this section, we describe the threat model and the key technical components of our proposed adversarial NER framework. For the sake of brevity, we refer to non-entity as context and LLM NER as NER throughout the rest of this paper. The approach consists of the following steps, (1) Disentanglement
|
| 56 |
+
|
| 57 |
+
of word representations, (2) Selection of important words using word attributions, (3) Substitution of the selected words with candidate alternatives, (4) Ranking and selection of candidate adversarial examples
|
| 58 |
+
|
| 59 |
+
# 3.1 Threat Model
|
| 60 |
+
|
| 61 |
+
The threat model is composed of two key components the adversary and the defender
|
| 62 |
+
|
| 63 |
+
# 3.1.1 Goals of the adversary
|
| 64 |
+
|
| 65 |
+
The adversary's primary goal is to manipulate the NER model's predictions by introducing subtle changes to the input text that cause the model to misclassify named entities.
|
| 66 |
+
|
| 67 |
+
# 3.1.2 Capabilities of the adversary
|
| 68 |
+
|
| 69 |
+
The adversary has a deep understanding of the NER model's architecture and training data. The adversary has access to the disentanglement and word attribution modules to sample entity and or nonentity component words. In addition, the adversary has access to two different word substitution workflows for entities and context, respectively. Description of these modules are provided in the following subsections within this section.
|
| 70 |
+
|
| 71 |
+
# 3.1.3 Knowledge of the adversary
|
| 72 |
+
|
| 73 |
+
The adversary has knowledge of the NER model's training data and can use this knowledge to craft adversarial examples that are specifically designed to cause mis-classifications through LLM hallucination and/or any other mechanisms.
|
| 74 |
+
|
| 75 |
+
# 3.1.4 Goals of the defender
|
| 76 |
+
|
| 77 |
+
The defender's primary goal is to protect the NER model from adversarial attacks and ensure that it continues to make accurate predictions.
|
| 78 |
+
|
| 79 |
+
# 3.1.5 Capabilities of the defender
|
| 80 |
+
|
| 81 |
+
The defender has access to techniques for adversarial training, which can help to increase the NER model's robustness to attacks.
|
| 82 |
+
|
| 83 |
+
# 3.1.6 Knowledge of the defender
|
| 84 |
+
|
| 85 |
+
The defender has knowledge of the NER model's architecture and training data, as well as any potential vulnerabilities that may be exploited by the adversary. The defender may also have knowledge of common adversarial attack strategies such as Bert-Attack (Li et al., 2020), DeepWordBug (Gao et al., 2018), etc.
|
| 86 |
+
|
| 87 |
+
# 3.2 Disentanglement of Word Representations
|
| 88 |
+
|
| 89 |
+
The primary objective of disentanglement is to mitigate bias (between entity and non-entity words) in word selection for perturbation, thereby increasing the diversity of the generated adversarial examples. In Table 1, we provide supporting evidence that indicates that NER models are highly biased towards context words during prediction. The word attribution function like IG picks $98.9\%$ of non-entity words from the CoNLL dataset for generating potential adversarial examples if disentanglement is not applied. This adversely affects the overall diversity of the generated adversarial examples thereby preventing exploration of potential vulnerabilities of the NER model to entity specific perturbations. Our approach of disentanglement mitigates this problem through generating adversarial examples by exploring the entire perturbation space across important entity and non-entity words in an efficient manner.
|
| 90 |
+
|
| 91 |
+
Given the original features of an input sentence, we first split word features into two sets: $E$ for features of entity words and $C$ for features of context words. Our goal is to learn a new representation $\hat{E}$ for entity words, so that the features of entity words are independent of context words. The resulting representation $(\hat{E}, C)$ will be utilized for calculating word attribution scores in the next step.
|
| 92 |
+
|
| 93 |
+
Following (Marx et al., 2019), we learn the disentangled representations by using an auto-encoder. The architecture of the auto-encoder is illustrated in Figure 3, which consists of three neural networks: the encoder, the decoder, and the discriminator:
|
| 94 |
+
|
| 95 |
+

|
| 96 |
+
Figure 3: The architecture of disentangled representation learning framework which takes initial word feature embeddings as inputs, and use an auto-encoder to learn a latent representation $\pmb{E}^{\prime}$ for entity words. A discriminator $Dis$ is used to recover context embeddings $C$ from entity embeddings $E^{\prime}$
|
| 97 |
+
|
| 98 |
+
Encoder. The encoder Enc takes entity word embeddings $E$ as input, then learn a disentangled representation $E^{\prime}$ in the latent space. Note that the encoder is also aware of context word embeddings $C$ when encoding $E$ :
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
E n c (E; C) = E ^ {\prime}. \tag {1}
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
Decoder. The decoder $Dec$ takes $E^{\prime}$ as input and output $\hat{E}$ , which is a new (disentangled) representation for $E$ :
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
D e c \left(E ^ {\prime}; C\right) = \hat {E}. \tag {2}
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
Discriminator. The discriminator $Dis$ tries to predict (recover) the context embeddings $C$ using the hidden representation of entity words $E'$ :
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
D i s \left(E ^ {\prime}\right) = \hat {C}, \tag {3}
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
where $\hat{C}$ is the predicted result for $C$ . However, since we expect $E^{\prime}$ and $C$ to be independent, the recovery error between $\hat{C}$ and $C$ should be maximized. In other words, the discriminator cannot recover any information of $C$ using $E^{\prime}$ , which indicates that there is no correlation between $C$ and $E^{\prime}$ (as well as $\hat{E}$ ).
|
| 117 |
+
|
| 118 |
+
Training objective. Our training process aims to minimize the reconstruction mean squared error (MSE) between $E$ and $\hat{E}$ , as well as maximizing the recovery error between $C$ and $\hat{C}$ :
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
L = \operatorname {M S E} (E, \hat {E}) - \beta \cdot \operatorname {M S E} (C, \hat {C}), \tag {4}
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
<table><tr><td>Dataset</td><td>CoNLL2003</td><td>OntoNotes</td></tr><tr><td>Original Distribution of Context</td><td>83.2%</td><td>91.1%</td></tr><tr><td>Distribution of Context as most important words before disentanglement</td><td>98.9%</td><td>96.1%</td></tr><tr><td>Distribution of Context as most important words after disentanglement</td><td>81.3%</td><td>91.4%</td></tr></table>
|
| 125 |
+
|
| 126 |
+
Table 1: Word type distribution of two datasets. The first row represents the original distribution of with the NER label O (context words) among all word labels in the two datasets followed by two rows representing the distribution of important context words identified by the IG word attribution function in two different settings. It is clear that in comparison to before disentanglement (the second row), the representation learned using our balancing disentanglement technique (in third row) obtains a distribution that aligns more closely with the original dataset distribution (first row).
|
| 127 |
+
|
| 128 |
+
where $\beta$ is a balancing hyper-parameter. $\hat{E}$ and $C$ are taken as the disentangled representations for entity and context words.
|
| 129 |
+
|
| 130 |
+
# 3.3 Selection of Important Words
|
| 131 |
+
|
| 132 |
+
To evaluate the impact of each word's feature on the NER model's output, we propose to compute the word attribution scores (a.k.a feature importance or saliency scores) using Integrated Gradients (IG) (Sundararajan et al., 2017). IG calculates the gradient of the model's prediction output with respect to its input features and returns the attributions of output labels with respect to the input features. The assigned value on each input feature is the importance score to model outputs. The mathematical formulation for IG is as follows
|
| 133 |
+
|
| 134 |
+
Suppose we have a black-box machine learning model $f$ , an input $x \in R^n$ , and a baseline input $x' \in R^n$ (for text models it could be a zero embedding vector). The Integrated Gradient (IG) along the $i^{th}$ dimension for the input $x$ and $x'$ is defined as:
|
| 135 |
+
|
| 136 |
+
$$
|
| 137 |
+
I G _ {i} (x) := \left(x _ {i} - x _ {i} ^ {\prime}\right) \times \int_ {\alpha = 0} ^ {1} \frac {\partial F \left(x ^ {\prime} + \alpha \left(x - x ^ {\prime}\right)\right)}{\partial x _ {i}} d \alpha . \tag {5}
|
| 138 |
+
$$
|
| 139 |
+
|
| 140 |
+
We obtain a ranked list of words in the sentence by sorting them based on their word attribution scores. The top-K among them are then selected for perturbations. The use of disentangled word representations (as described in the earlier section) enables a more balanced selection.
|
| 141 |
+
|
| 142 |
+

|
| 143 |
+
Figure 4: Entity and Context Word Substitution Workflows
|
| 144 |
+
|
| 145 |
+
# 3.4 Word Substitution of Selected Words
|
| 146 |
+
|
| 147 |
+
After identifying the most important words in a sentence, the next step is to determine potential substitutions for these words. We outline both replacement workflows in Figure 4 and briefly describe them below.
|
| 148 |
+
|
| 149 |
+
Named Entity Substitution To keep the entity labels unchanged, the replacement word for a named entity word should belong to the same entity type as the original entity word. Since Wikidata contains abundant structured knowledge and most of the entities have corresponding entries in it, we utilize it as an external knowledge base for word replacement. Specifically, similar to (Lin et al., 2021), to determine the substitution for a given named entity, we first use entity linking tools (Honnibal et al., 2020) to link the named entity to an entry in Wikidata. If a matching entry is found in Wikidata, we collect the entries that have a belonged to relation with this entry and take them as the upper categories of the target named entity. We randomly sample at most 10 of the entries under the same upper categories as possible word substitutions.
|
| 150 |
+
|
| 151 |
+
As an example illustrated in Figure 4, the label of the target word Manchester United is an organization. After linking this entity to the corresponding entry Manchester United FC in the Wikidata knowledge base, we find that Manchester United FC belongs to the category of Association Football Club. Within the same category, we find other entries such as FC Barcelona, Real Madrid CF, and Arsenal FC. These entities are possible substitutions to replace the original entity word Manch
|
| 152 |
+
|
| 153 |
+
# ester United.
|
| 154 |
+
|
| 155 |
+
Context Word Substitution We leverage an infilling language modeling framework (ILM) (Donahue et al., 2020) that allows language models fill in the blanks given masked texts. We use a large language model (LLM) GPT-J (Wang and Komatsuzaki, 2021) to generate texts. Specifically, we mask the context word that needs to be replaced with [BLANK]. Then, we take the masked sentence as input to the LLM with a prompt that asks the model to generate 5 possible candidate words to substitute the [BLANK] word. Finally, we collect the output words as substitutions for the context word, as illustrated in Figure 4.
|
| 156 |
+
|
| 157 |
+
# 3.5 Sentence Ranking
|
| 158 |
+
|
| 159 |
+
For an input sentence, we identify target words to be substituted and replace them with new words, which gives us a set of new sentences. To decide which sentences should be output as the final adversarial samples, we compute the similarity between each new sentence and the original one using Universal Sentence Encoder (USE) (Cer et al., 2018). It encodes natural language texts into high dimensional vectors as text embedding. After encoding each pair of original and generated sentences, we compute their cosine similarity as their similarity score. Basically, given the original and new sentences $S_{1}$ and $S_{2}$ , the similarity score is computed by:
|
| 160 |
+
|
| 161 |
+
$$
|
| 162 |
+
\operatorname {S i m} \left(S _ {1}, S _ {2}\right) = \frac {\operatorname {U S E} \left(S _ {1}\right) \cdot \operatorname {U S E} \left(S _ {2}\right)}{\| \operatorname {U S E} \left(S _ {1}\right) \| \| \operatorname {U S E} \left(S _ {2}\right) \|} \tag {6}
|
| 163 |
+
$$
|
| 164 |
+
|
| 165 |
+
# 4 Experiments
|
| 166 |
+
|
| 167 |
+
# 4.1 Datasets
|
| 168 |
+
|
| 169 |
+
We conduct our experiments on three datasets, CoNLL-2003 (Sang and De Meulder, 2003), Ontonotes 5.0 (Weischedel et al., 2013), and MultiCoNER (Malmasi et al., 2022). CoNLL-2003 is a NER dataset that consists of named entities classified into four types: persons, locations, organizations, and names of miscellaneous entities that do not belong to the previous three groups. Ontonotes 5.0 is a large corpus of news articles in three languages, annotated with 18 types of named entities. MultiCoNER is a complex NER dataset that covers 11 languages and has a fine-grained tagset with 36 entity types. In our experiments, we focus on the English track of these datasets.
|
| 170 |
+
|
| 171 |
+
<table><tr><td>Dataset</td><td>CoNLL</td><td>OntoNotes</td><td>MultiCoNER</td></tr><tr><td>Train</td><td>14,987</td><td>59,924</td><td>16778</td></tr><tr><td>Val</td><td>3,466</td><td>8,528</td><td>871</td></tr><tr><td>Test</td><td>3,684</td><td>8,262</td><td>871</td></tr></table>
|
| 172 |
+
|
| 173 |
+
Table 2: Train, Validation and Test Splits.
|
| 174 |
+
|
| 175 |
+
# 4.2 Baseline Methods
|
| 176 |
+
|
| 177 |
+
We compare our proposed method with the following NER adversarial attack baseline methods:
|
| 178 |
+
|
| 179 |
+
- RockNER (Lin et al., 2021) creates adversarial examples by operating at the entity level and replacing all target entities with other entities of the same semantic class in Wikidata. At the context level, it randomly masks up to 3 context words and uses pre-trained language models (PLM) to generate word substitutions.
|
| 180 |
+
- SeqAttack (Simoncini and Spanakis, 2021) is an attack framework against token classification models. The framework extends TextAttack (Morris et al., 2020) and contains multiple adversarial attack strategies. We compare our attack method with 3 attacks in the framework, including Bert-Attack, CLARE, and DeepWordBug.
|
| 181 |
+
|
| 182 |
+
# 4.3 Experimental Setup
|
| 183 |
+
|
| 184 |
+
For the choice of the NER model, we follow the same settings as the baseline methods for fair comparison. We utilize three different models for our experiments: a BERT base model cased (Lafferty et al., 2001; Devlin et al., 2019), a T5 language model (Raffel et al., 2020) (T5-LARGE 770 M parameter model) and LLAMA 2-7B-CHAT model (Touvron et al., 2023). Architectures for BERT and T5 NER models are provided in the Appendix in Figure 7 and Figure 8, respectively.
|
| 185 |
+
|
| 186 |
+
For the BERT NER model, we perform fine-tuning on both the CoNLL-2003 and OntoNotes datasets. Regarding the T5 model, we transform the NER task into an instruction fine-tuned model (T5 Instruction NER(Wang et al., 2022)) as outlined in the Appendix in A.3. This is facilitated by converting the MultiCoNER dataset, into sentence-instruction pairs, we follow a similar approach to the sentences illustrated in Figure 6 in the Appendix.
|
| 187 |
+
|
| 188 |
+
To compute the word attributions, we freeze the parameters of encoder of the T5 model after finetuning, and add an additional classification layer after it, to create a new sequence labeling model. This T5 encoder only model is trained with a CRF
|
| 189 |
+
|
| 190 |
+
loss, and we obtain word attributions and generate adversarial examples by directly utilizing the predictions of this model. We evaluate the effectiveness of our attack methods based on multiple evaluation metrics as outlined below:
|
| 191 |
+
|
| 192 |
+
# 4.3.1 Evaluation Metrics
|
| 193 |
+
|
| 194 |
+
- Attack Rate. This metric measures the success of an attack on a sentence. An attack is successful on a sentence if the NER model misclassifies at least one named entity in the sentence after the attack. We calculate the rate of successful attacks among all attacks.
|
| 195 |
+
- Modification Rate. The modification rate evaluates the changes made to the original sentence during the attack. It is calculated as the percentage of different tokens between the original sentence and the modified sentence.
|
| 196 |
+
- Textual Similarity. Textual similarity is computed between the original sentence and the generated sentence. We use Universal Sentence Encoder (USE) to encode each sentence and compute cosine similarity between the two vectors.
|
| 197 |
+
|
| 198 |
+
# 4.3.2 Attack and Hyper-parameter Settings
|
| 199 |
+
|
| 200 |
+
As shown in Table 3, to test the attack performance of our method, we report results at different levels of modification rate (maximum 1 word or 3 words). All displayed results are averaged across 3 random runs.
|
| 201 |
+
|
| 202 |
+
For the BERT NER model, we perform fine-tuning on a pre-trained bert-base-cased model with CRF. The training process utilizes a batch size of 32 and a learning rate of 1e-5. We conduct training for a total of 20 epochs on both the CoNLL-2003 and OntoNotes datasets. In the case of the T5 model, we conduct a fine-tuning on the Multi-CoNER dataset. The training process has a batch size of 16 and a learning rate of 3e-4. The total training epoch is set to 10.
|
| 203 |
+
|
| 204 |
+
The encoder, decoder and discriminator for computing the disentangled representations consist of two hidden layers with size $= [64, 10]$ and $\beta$ is set to 0.5. For IG word importance computation, we leverage the Captum library from Meta (Kokhlikyan et al., 2020). The learning rate is 1e-3, and the number of epochs is 25. We use Stochastic Gradient Descent optimizer with weight decay 1e-5.
|
| 205 |
+
|
| 206 |
+
After computing the word importance, we take the top $\mathrm{K} = 1$ , 3 important words to replace. Then,
|
| 207 |
+
|
| 208 |
+
we replace the most important words as in Section 3.4 to output adversarial examples.
|
| 209 |
+
|
| 210 |
+
# 4.4 Benchmarking Results
|
| 211 |
+
|
| 212 |
+
In this section, we primarily benchmark the BERT NER, T5 Instruction NER and LLAMA 2 models across different attack strategies.
|
| 213 |
+
|
| 214 |
+
# 4.4.1 Comparison against baselines
|
| 215 |
+
|
| 216 |
+
In Table 3, for the CoNLL-2003 dataset, we present a comparison of the performance of our method against the five adversarial attack strategies within the SeqAttack framework. To ensure a fair comparison, we fine-tune our model to achieve the same F1 score as the original SeqAttack results (98%) before conducting the attack.
|
| 217 |
+
|
| 218 |
+
From the results in Table 3, we observe that our method shows a comparable level of token modification rate (at around $22\%$ ) to both Bert-Attack and DeepWordBug- $\mathrm{II}_{30}$ . However, our method outperforms Bert-Attack by achieving approximately $10\%$ higher attack success rate. Furthermore, when compared to DeepWordBug- $\mathrm{II}_{30}$ , our method achieves a lower F1 score by $8\%$ and a higher attack success rate by $24\%$ . These results show the effectiveness of our method in achieving successful attacks with a lower level of modification rate.
|
| 219 |
+
|
| 220 |
+
These significant improvements in F1 score and attack rate while having similar modification rates are attributed to the following reasons, a) our unique approach of combining effective disentangled representation learning with IG-based targeted word attributions, and b) using semantic similarity based guardrails while generating adversarial examples.
|
| 221 |
+
|
| 222 |
+
In Table 3, for the OntoNotes dataset, we compare the performance of RockNER and our method. For both RockNER and our method, successful attacks would result in lowering the F1 score compared to the baseline F1 score.
|
| 223 |
+
|
| 224 |
+
Note that RockNER chooses semantic-rich words and randomly masks tokens (3 max) in context-only attack, and replaces all named entities in entity-only attack. Different from RockNER, we compute disentangled representations and replace the most important 1 or 3 words in the sentences.
|
| 225 |
+
|
| 226 |
+
Comparing the F1 scores under attack, our method is much more effective than the baseline method on all three types of attacks. More importantly, we observe that the F1 score for our method is $4\%$ lower than the RockNER. This demonstrates that our method is better at selecting and replac
|
| 227 |
+
|
| 228 |
+
<table><tr><td>Dataset</td><td>Attack Name</td><td>F1 Score↓</td><td>Attack Rate↑</td><td>Mod Rate↓</td><td>Text Sim↑</td></tr><tr><td rowspan="7">CoNLL</td><td>Bert-Attack</td><td>79%</td><td>44%</td><td>22%</td><td>84%</td></tr><tr><td>CLARE</td><td>79%</td><td>37%</td><td>70%</td><td>86%</td></tr><tr><td>DeepWordBug-II30</td><td>87%</td><td>30%</td><td>21%</td><td>83%</td></tr><tr><td>RockNER</td><td>80%</td><td>54%</td><td>35%</td><td>64%</td></tr><tr><td rowspan="2">Our Method</td><td>82%</td><td>36%</td><td>11% (max 1 word)</td><td>91%</td></tr><tr><td>79%</td><td>54%</td><td>22% (max 3 words)</td><td>84%</td></tr><tr><td>Original</td><td>98%</td><td>-</td><td>-</td><td>-</td></tr><tr><td rowspan="4">OntoNotes</td><td>RockNER</td><td>55%</td><td>37%</td><td>26%</td><td>66%</td></tr><tr><td rowspan="2">Our Method</td><td>65%</td><td>33%</td><td>6% (max 1 word)</td><td>86%</td></tr><tr><td>51%</td><td>42%</td><td>12% (max 3 words)</td><td>79%</td></tr><tr><td>Original</td><td>90.3%</td><td>-</td><td>-</td><td>-</td></tr></table>
|
| 229 |
+
|
| 230 |
+
Table 3: Results using different attack strategies on BERT NER model for CoNLL-2003 and OntoNotes datasets. The first 3 attack methods are derived from SeqAttack. Numbers in the 4th and the 8th rows are derived using RockNER baseline. We generate adversarial examples allowing for a maximum of 1 or 3 word replacements. Lower F1 score and modification rate along with higher attack rate and textual similarity indicate a more superior attack strategy as demonstrated by our method.
|
| 231 |
+
|
| 232 |
+
<table><tr><td>Method</td><td>Attack Rate↑</td><td>Mod Rate↓</td></tr><tr><td>RockNER</td><td>26.7%</td><td>40.2%</td></tr><tr><td>Random</td><td>18.2%</td><td>19.7%</td></tr><tr><td>Our Method</td><td>25.6%</td><td>19.7%</td></tr></table>
|
| 233 |
+
|
| 234 |
+
Table 4: Attack Rate and Modification Rate for LLAMA2-7B-CHAT model on the CoNLL-2003 dataset.
|
| 235 |
+
|
| 236 |
+
ing the most important words which enables it to generate more effective adversarial examples.
|
| 237 |
+
|
| 238 |
+
# 4.4.2 Attack Results with LLAMA 2 model
|
| 239 |
+
|
| 240 |
+
To examine the effectiveness of our attack method, we conduct experiments using LLAMA2-7BCHAT model (Touvron et al., 2023) on the CoNLL2003 dataset. For this experiment, we allow a maximum of 1 word perturbation following our proposed framework. We compare our results with two baseline methods, RockNER and Random replacement of a single word. Comparing the results in Table 4, we observe that both our proposed method and RockNER achieve a higher attack success rate than random replacement. In addition, our method has a much lower modification rate compared to RockNER. After adversarial training, we observe that the robustness improves and F1 under attack increases by $3.1\%$ .
|
| 241 |
+
|
| 242 |
+
# 4.4.3 Attack Results with T5 Instruction NER model
|
| 243 |
+
|
| 244 |
+
For the MultiCoNER dataset, the clean F1 score on the test set is $47.23\%$ with the T5 Instruction NER model. We follow the same attack framework as
|
| 245 |
+
|
| 246 |
+

|
| 247 |
+
Figure 5: F1 score $\uparrow$ results on three datasets. Blue columns and orange columns show the F1 score under attack before and after adversarial training, respectively.
|
| 248 |
+
|
| 249 |
+
described above and allow max 1 word perturbation, and generate adversarial examples from the original test set. On the new adversarial test set, the F1 score under attack drops to $37.96\%$ with T5 instruction NER model. To better demonstrate the effectiveness of our method, we also use the baseline method RockNER to generate the adversarial test set, which replaces all named entities and allows max 3 word context words perturbation. The F1 score under attack of T5 instruction NER model is $36.87\%$ for RockNER. Our method reaches a comparable attack performance, whereas our mod
|
| 250 |
+
|
| 251 |
+
<table><tr><td colspan="2">Disentanglement</td><td>F1 Score↓</td><td>Attack Rate↑</td></tr><tr><td rowspan="3">CoNLL</td><td>Original</td><td>98%</td><td>-</td></tr><tr><td>without</td><td>86%</td><td>25%</td></tr><tr><td>with</td><td>82%</td><td>36%</td></tr><tr><td rowspan="3">OntoNotes</td><td>Original</td><td>98%</td><td>-</td></tr><tr><td>without</td><td>69%</td><td>28%</td></tr><tr><td>with</td><td>51%</td><td>42%</td></tr></table>
|
| 252 |
+
|
| 253 |
+
Table 5: Attack Results for BERT NER model with and without disentanglement steps.
|
| 254 |
+
|
| 255 |
+
<table><tr><td>Word Selection</td><td>CoNLL</td><td>OntoNotes</td></tr><tr><td>Original</td><td>98%</td><td>90%</td></tr><tr><td>Random</td><td>87%</td><td>61%</td></tr><tr><td>TF-IDF</td><td>90%</td><td>58%</td></tr><tr><td>Kernel-SHAP</td><td>86%</td><td>61%</td></tr><tr><td>Integrated Gradients (IG)</td><td>82%</td><td>51%</td></tr></table>
|
| 256 |
+
|
| 257 |
+
Table 6: F1 scores for BERT NER model under attack using different strategies. (lower is better)
|
| 258 |
+
|
| 259 |
+
ification rate is only $46\%$ of the modification rate from RockNER. Further details on the setup here are provided in the Appendix in Section A.3.
|
| 260 |
+
|
| 261 |
+
# 4.4.4 Ablation Studies
|
| 262 |
+
|
| 263 |
+
Without disentanglement To assess the effectiveness of our disentanglement technique, we compare the attack performance on the BERT NER model with and without disentanglement steps. The results, as illustrated in Table 5, demonstrate the impact of disentanglement on the attack success rate. With the disentanglement step, we observe a reduction in bias in word selection (Refer Table 1) improving diversity of adversarial samples generated and a significant attack performance improvement. Other word selection methods To examine the effectiveness of IG, we also tested other word selection strategies. (1) Randomly select words for substitution. (2) Select words using TF-IDF values as word importance. (3) Select words using KernelSHAP (Lundberg and Lee, 2017) that uses a special weighted linear regression to compute feature importance. Compared with F1 scores in Table 6, IG outperforms all other three word selection methods, which proves the effectiveness of using IG. The results that IG outperforms other three methods in non-linear models are also consistent with insights here (Modarres et al., 2018).
|
| 264 |
+
|
| 265 |
+
# 4.4.5 Adversarial Training
|
| 266 |
+
|
| 267 |
+
After generating adversarial examples from the training set using the workflow depicted in Figure 2, we conduct adversarial training on the trained NER models on the three datasets. As illustrated in Fig-
|
| 268 |
+
|
| 269 |
+
ure 5, we observe that adversarial training enhances model robustness across all datasets. Specifically, for adversarial examples that allow maximum 3 word replacement on CoNLL-2003 dataset, the F1 score under attack improves by approximately $8\%$ after adversarial training. Similarly, the F1 score under attack on the OntoNotes dataset demonstrates an improvement of about $18\%$ after adversarial training. In the case of the MultiCoNER dataset, we observe a $4\%$ improvement in the F1 score under attack after adversarial training.
|
| 270 |
+
|
| 271 |
+
# 5 Conclusions
|
| 272 |
+
|
| 273 |
+
LLM's for complex NER problems have been gaining a lot of traction recently, and in this work, we propose an adversarial attack based framework to make these NER models more robust to widen their adoption even further. Our end-to-end approach combines a novel disentanglement technique with word attributions, substitution and semantic similarity to generate adversarial examples. Our disentanglement method builds upon the idea of trying to learn an embedding by disentangling entity and non-entity latent representations
|
| 274 |
+
|
| 275 |
+
Applying disentanglement before computing IG word attributions aids in ensuring that we are able to synthesize a diverse set of adversarial examples in an extremely efficient manner as demonstrated through lower candidate sample generation and modification rates. Experimental results across BERT, T5-based and LLAMA 2 NER models on three benchmark datasets demonstrates that our method significantly outperforms competing baseline methods. Ablation studies highlight the importance of disentanglement and word attribution techniques.
|
| 276 |
+
|
| 277 |
+
# 6 Limitations
|
| 278 |
+
|
| 279 |
+
One of the key limitations of our work is that we have not explored the entire LLM landscape and would be keen to explore the decoder only models. Being able to evaluate our work across decoder only models strengthens some of the key claims made in this paper. In particular, we would like to investigate robustness of models with growing size.
|
| 280 |
+
|
| 281 |
+
Future avenues to investigate for us mainly include building an end-to-end framework to synthesize attacks for LLM NER models where the word attributions and semantic similarity scoring are pursued as potential paths within a pipeline to identify
|
| 282 |
+
|
| 283 |
+
the optimal attack. This will help in reducing the dependence on specific choices significantly.
|
| 284 |
+
|
| 285 |
+
# Ethical Consideration
|
| 286 |
+
|
| 287 |
+
We acknowledge that our work is aligned with the ACL Code of the Ethics<sup>1</sup> and will not raise ethical concerns. We do not use sensitive datasets/models that may cause any potential issues/risks.
|
| 288 |
+
|
| 289 |
+
# Acknowledgement
|
| 290 |
+
|
| 291 |
+
We thank the anonymous reviewers for their helpful suggestions. This research work is supported by Amazon Alexa AI, the Molecule Maker Lab Institute: an AI research institute program supported by NSF under award No. 2019897 and No. 2034562, and DOE Center for Advanced Bioenergy and Bioproducts Innovation (U.S. Department of Energy, Office of Science, Office of Biological and Environmental Research under Award Number DESC0018420). 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 the Molecule Maker Lab Institute, or the U.S. Department of Energy. The U.S. Government is authorized to reproduce and distribute reprints for governmental purposes notwithstanding any copyright annotation therein.
|
| 292 |
+
|
| 293 |
+
# References
|
| 294 |
+
|
| 295 |
+
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.
|
| 296 |
+
Daniel Cer, Yinfei Yang, Sheng-yi Kong, Nan Hua, Nicole Limtiaco, Rhomni St John, Noah Constant, Mario Guajardo-Cespedes, Steve Yuan, Chris Tar, et al. 2018. Universal sentence encoder. arXiv preprint arXiv:1803.11175.
|
| 297 |
+
Sudeshna Das and Jiaul Paik. 2022. Resilience of named entity recognition models under adversarial attack. In Proceedings of the First Workshop on Dynamic Adversarial Data Collection, pages 1-6.
|
| 298 |
+
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
|
| 299 |
+
|
| 300 |
+
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.
|
| 301 |
+
Chris Donahue, Mina Lee, and Percy Liang. 2020. Enabling language models to fill in the blanks. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 2492-2501.
|
| 302 |
+
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.
|
| 303 |
+
Ji Gao, Jack Lanchantin, Mary Lou Soffa, and Yanjun Qi. 2018. Black-box generation of adversarial text sequences to evade deep learning classifiers. In 2018 IEEE Security and Privacy Workshops (SPW), pages 50-56.
|
| 304 |
+
Irina Higgins, Loic Matthew, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew Botvinick, Shakir Mohamed, and Alexander Lerchner. 2017. beta-VAE: Learning basic visual concepts with a constrained variational framework. In International Conference on Learning Representations.
|
| 305 |
+
Matthew Honnibal, Ines Montani, Sofie Van Landeghem, and Adriane Boyd. 2020. spacy: Industrial-strength natural language processing in python.
|
| 306 |
+
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.
|
| 307 |
+
Narine Kokhlikyan, Vivek Miglani, Miguel Martin, Edward Wang, Bilal Alsallakh, Jonathan Reynolds, Alexander Melnikov, Natalia Kliushkina, Carlos Araya, Siqi Yan, and Orion Reblitz-Richardson. 2020. Captum: A unified and generic model interpretability library for pytorch.
|
| 308 |
+
John Lafferty, Andrew McCallum, and Fernando CN Pereira. 2001. Conditional random fields: Probabilistic models for segmenting and labeling sequence data.
|
| 309 |
+
Dianqi Li, Yizhe Zhang, Hao Peng, Liquin Chen, Chris Brockett, Ming-Ting Sun, and Bill Dolan. 2021. Contextualized perturbation for textual adversarial attack.
|
| 310 |
+
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.
|
| 311 |
+
|
| 312 |
+
Bill Yuchen Lin, Wenyang Gao, Jun Yan, Ryan Moreno, and Xiang Ren. 2021. RockNER: A simple method to create adversarial examples for evaluating the robustness of named entity recognition models. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 3728-3737, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics.
|
| 313 |
+
Shengcai Liu, Ning Lu, Cheng Chen, and Ke Tang. 2021. Efficient combinatorial optimization for word-level adversarial textual attack. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 30:98-111.
|
| 314 |
+
Scott M Lundberg and Su-In Lee. 2017. A unified approach to interpreting model predictions. Advances in neural information processing systems, 30.
|
| 315 |
+
Shervin Malmasi, Anjie Fang, Besnik Fetahu, Sudipta Kar, and Oleg Rokhlenko. 2022. Semeval-2022 task 11: Multilingual complex named entity recognition (multiconer). In Proceedings of the 16th international workshop on semantic evaluation (SemEval-2022), pages 1412-1437.
|
| 316 |
+
Charles Marx, Richard Phillips, Sorelle Friedler, Carlos Scheidegger, and Suresh Venkatasubramanian. 2019. Disentangling influence: Using disentangled representations to audit model predictions. Advances in Neural Information Processing Systems, 32.
|
| 317 |
+
Ceena Modarres, Mark Ibrahim, Melissa Louie, and John Paisley. 2018. Towards explainable deep learning for credit lending: A case study. arXiv preprint arXiv:1811.06471.
|
| 318 |
+
John Morris, Eli Lifland, Jin Yong Yoo, Jake Grigsby, Di Jin, and Yanjun Qi. 2020. Textattack: A framework for adversarial attacks, data augmentation, and adversarial training in nlp. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 119-126.
|
| 319 |
+
Harsha Nori, Nicholas King, Scott Mayer McKinney, Dean Carignan, and Eric Horvitz. 2023. Capabilities of gpt-4 on medical challenge problems. arXiv preprint arXiv:2303.13375.
|
| 320 |
+
Chengwei Qin, Aston Zhang, Zhuosheng Zhang, Jiao Chen, Michihiro Yasunaga, and Diyi Yang. 2023. Is chatgpt a general-purpose natural language processing task solver? arXiv preprint arXiv:2302.06476.
|
| 321 |
+
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. The Journal of Machine Learning Research, 21(1):5485-5551.
|
| 322 |
+
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.
|
| 323 |
+
|
| 324 |
+
Malik Sallam. 2023. Chatgpt utility in healthcare education, research, and practice: systematic review on the promising perspectives and valid concerns. In Healthcare, volume 11, page 887. MDPI.
|
| 325 |
+
Erik Tjong Kim Sang and Fien De Meulder. 2003. Introduction to the conll-2003 shared task: Language-independent named entity recognition. In Proceedings of the Seventh Conference on Natural Language Learning at HLT-NAACL 2003, pages 142-147.
|
| 326 |
+
Walter Simoncini and Gerasimos Spanakis. 2021. Seqattack: On adversarial attacks for named entity recognition. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 308-318.
|
| 327 |
+
Mukund Sundararajan, Ankur Taly, and Qiqi Yan. 2017. Axiomatic attribution for deep networks. In International conference on machine learning, pages 3319-3328. PMLR.
|
| 328 |
+
Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, Nikolay Bashlykov, Soumya Batra, Prajjwal Bhargava, Shruti Bhosale, et al. 2023. Llama 2: Open foundation and fine-tuned chat models. arXiv preprint arXiv:2307.09288.
|
| 329 |
+
Ben Wang and Aran Komatsuzaki. 2021. GPT-J-6B: A 6 Billion Parameter Autoregressive Language Model. https://github.com/kingoflolz/mesh-transformer-jax.
|
| 330 |
+
Jiongxiao Wang, Zichen Liu, Keun Hee Park, Muhao Chen, and Chaowei Xiao. 2023a. Adversarial demonstration attacks on large language models. arXiv preprint arXiv:2305.14950.
|
| 331 |
+
Liwen Wang, Rumei Li, Yang Yan, Yuanmeng Yan, Sirui Wang, Wei Wu, and Weiran Xu. 2022. Instructioner: A multi-task instruction-based generative framework for few-shot ner. arXiv preprint arXiv:2203.03903.
|
| 332 |
+
Shuhe Wang, Xiaofei Sun, Xiaoya Li, Rongbin Ouyang, Fei Wu, Tianwei Zhang, Jiwei Li, and Guoyin Wang. 2023b. Gpt-ner: Named entity recognition via large language models. arXiv preprint arXiv:2304.10428.
|
| 333 |
+
R Weischedel, M Palmer, M Marcus, E Hovy, S Pradhan, L Ramshaw, N Xue, A Taylor, J Kaufman, M Franchini, et al. 2013. Ontonotes release 5.0 ldc2013t19. linguistic data consortium, philadelphia, pa (2013).
|
| 334 |
+
Kaijie Zhu, Jindong Wang, Jiaheng Zhou, Zichen Wang, Hao Chen, Yidong Wang, Linyi Yang, Wei Ye, Neil Zhenqiang Gong, Yue Zhang, et al. 2023. Promptbench: Towards evaluating the robustness of large language models on adversarial prompts. arXiv preprint arXiv:2306.04528.
|
| 335 |
+
Yicheng Zou, Hongwei Liu, Tao Gui, Junzhe Wang, Qi Zhang, Meng Tang, Haixiang Li, and Daniel Wang. 2022. Divide and conquer: Text semantic matching with disentangled keywords and intents.
|
| 336 |
+
|
| 337 |
+
# A Appendix
|
| 338 |
+
|
| 339 |
+
# A.1 Model Queries Comparison
|
| 340 |
+
|
| 341 |
+
We compare our attack performance with CLARE under SeqAttack framework. CLARE is a word-level attack technique which generates highest-scoring candidate sentences from replacing, inserting, and merging new words into the original sentences. According to their experimental results in the paper, it reaches F1 score $79\%$ and attack success rate $37\%$ whereas our attack method gets F1 score $79\%$ and attack success rate $54\%$ . CLARE attack allows at most 512 model queries. It generates all possible new sentences (usually $1000+$ ) and checks if each new sentence attacks the NER model successfully. The attack success rate is very low. Among the successful attack sentences, it takes on average about 33 model queries (33 new sentences) to reach a successful attack. Compared with our method, we only allow at most 10 candidate sentences generated from each original sentence. Then we check if any sentence is a successful adversarial example which is much less than the baseline method.
|
| 342 |
+
|
| 343 |
+
Some example output from CLARE: Attacking sample: Japan began the defence of their Asian Cup title with a lucky 2-1 win against Syria in a Group C championship match on Friday.
|
| 344 |
+
|
| 345 |
+
AttackedText: "Japan's began the defence of their Asian Cup title with a lucky 2-1 win against Syria in a Group C championship match on Friday."
|
| 346 |
+
|
| 347 |
+
AttackedText: "Japan $</s>$ began the defence of their Asian Cup title with a lucky 2-1 win against Syria in a Group C championship match on Friday."
|
| 348 |
+
|
| 349 |
+
AttackedText "Japan A began the defence of their Asian Cup title with a lucky 2-1 win against Syria in a Group C championship match on Friday."
|
| 350 |
+
|
| 351 |
+
AttackedText: "Japan a began the defence of their Asian Cup title with a lucky 2-1 win against Syria in a Group C championship match on Friday."
|
| 352 |
+
|
| 353 |
+
AttackedText: "Japan ai began the defence of their Asian Cup title with a lucky 2-1 win against Syria in a Group C championship match on Friday."
|
| 354 |
+
|
| 355 |
+
AttackedText: "Japan ain began the defence of their Asian Cup title with a lucky 2-1 win against Syria in a Group C championship match on Friday
|
| 356 |
+
|
| 357 |
+
1
|
| 358 |
+
|
| 359 |
+
AttackedText "Japan ama began the defence of their Asian Cup title with a lucky 2-1 win against Syria in a Group C championship match on Friday."
|
| 360 |
+
|
| 361 |
+
AttackedText "Japan an began the defence of their Asian Cup title with a lucky 2-1 win against Syria in a Group C championship match on Friday."
|
| 362 |
+
|
| 363 |
+
AttackedText "Japan and began the defence of their Asian Cup title with a lucky 2-1 win against Syria in a Group C championship match on Friday."
|
| 364 |
+
|
| 365 |
+
AttackedText "Japan ans began the defence of their Asian Cup title with a lucky 2-1 win against Syria in a Group C championship match on Friday." (All generated examples failed to attack)
|
| 366 |
+
|
| 367 |
+
From the outputs using CLARE, we can see that their attack strategy is to select multiple indices in the sentence for word-level operations. In the attacking sample, the attack method iteratively inserting random words between Japan and began. These random insertion incurs syntax errors in the generated sentences. Comparing with this baseline, our method utilizes word attribution to find the most important word in the sentence more efficiently. In addition, with the help of PLMs and knowledge bases, we are able to replace with more reasonable words.
|
| 368 |
+
|
| 369 |
+
# A.2 F1 score under attack results on OntoNotes dataset
|
| 370 |
+
|
| 371 |
+
In Table 8, for the OntoNotes dataset, we compare the performance of RockNER and our method under three different attack settings, namely, a) context-only attacks, b) entity-only attacks and c) context + entity attacks. The second column in this table represents the baseline F1 scores on the original test set before the attack was conducted. For both RockNER and our method, successful attacks would result in lowering the F1 score compared to the baseline F1 score.
|
| 372 |
+
|
| 373 |
+
Note that RockNER chooses semantic-rich words and randomly masks tokens (3 max) in context-only attack, and replaces all named entities in entity-only attack. Different from RockNER, we compute disentangled representations and replace the most important context words (3 max) for context-only attack and the most important entity words (3 max) for entity-only attack.
|
| 374 |
+
|
| 375 |
+
Comparing the F1 scores under attack, our
|
| 376 |
+
|
| 377 |
+
<table><tr><td>Original Test Sentence</td><td>Adv Example (RockNER)</td><td>Adv Example (Our Method)</td></tr><tr><td>Sentence: Dear viewers, the China News program will end here. Output: China News is an organization.</td><td>Sentence: Dear viewers, the Hiwwe wie Driwwe people will lose here. Output: Hiwwe wie Driwwe is not an entity.</td><td>Sentence: Dear viewers, my China News program will end here. Output: China News is a work-of-art.</td></tr><tr><td>Sentence: Relevant departments from Beijing Municipality promptly activated emergency contingency plans. Output: Beijing Municipality is a geopolitical entity.</td><td>Sentence: Related departments from Markham promptly activated emergency contingency members. Output: Markham is not an entity.</td><td>Sentence: Relevant departments from Berlin Municipality promptly activated emergency contingency plans. Output: Berlin Municipality is an organization.</td></tr></table>
|
| 378 |
+
|
| 379 |
+
Table 7: A case study on generated adversarial examples by our method. The sentences on the left are original test sentences from OntoNotes dataset with correctly predicted named entities (blue colored words). The sentences in the middle and on the right are generated adversarial examples using RockNER baseline and our method that cause the NER model make wrong predictions. All input sentences also come with the instruction Please extract entities and their types from the input sentence. The italic words are the candidate words got selected and replaced. The red labels are incorrect predictions after the adversarial attacks).
|
| 380 |
+
|
| 381 |
+

|
| 382 |
+
Figure 6: Input sentence from MultiCoNER dataset and the adversarial example generated using our attack method, wherein we attack a instruction fine-tuned T5 NER model here. Following our attack, the NER model incorrectly classifies New York Yankees as a Location.
|
| 383 |
+
|
| 384 |
+
method is much more effective than the baseline method on all three types of attacks. More importantly, we observe that the F1 score for our method is $6\% \sim 8\%$ lower than the RockNER. This demonstrates that our method is better at selecting and replacing the most important words which enables it to generate more effective adversarial examples.
|
| 385 |
+
|
| 386 |
+
# A.3 Adversarial Examples for Instruction Fine-tuned Model
|
| 387 |
+
|
| 388 |
+
We fine-tune a T5 language model for named entity recognition task on MultiCoNER dataset. As shown in Figure 8 on the left, T5 is an encoder-decoder model and we convert the NER dataset into a text-to-text format. To compute the influence score, after fine-tuning the T5 model, as shown in Figure 8 on the right, we take its encoder only, freeze the parameters, and add one more linear layer after it to form a new sequence labeling model. Then, we train the last linear layer with CRF loss.
|
| 389 |
+
|
| 390 |
+

|
| 391 |
+
Figure 7: The architecture of the BERT-CRF NER model.
|
| 392 |
+
|
| 393 |
+
In this way, we can directly take the output logits of this T5-encoder only model for word attribution computation.
|
| 394 |
+
|
| 395 |
+
Figure 6 presents an example sentence generated through an adversarial attack that successfully perturbs the NER model. The sentence on the top comes from the original training set. Along with the instruction Please extract entities and their types from the input sentence, the T5 Instruction NER model correctly predicts the NER labels in natural language texts format.
|
| 396 |
+
|
| 397 |
+
We propose an approach for word-level adversarial attacks that generates adversarial examples in a principle manner. In the example presented in Figure 6, the word 'John Sterling' is an entity word that influences the NER predictions. Then,
|
| 398 |
+
|
| 399 |
+
<table><tr><td>Model Name</td><td>F1 Score Original test</td><td>Context-only ↓</td><td>F1 Score Entity-only ↓</td><td>Context + Entity ↓</td></tr><tr><td>BERT-CRF (RockNER)</td><td>90.6%</td><td>85.8%</td><td>59.2%</td><td>54.6%</td></tr><tr><td>BERT-CRF (Ours)</td><td>90.3%</td><td>79.6%</td><td>51.1%</td><td>47.5%</td></tr></table>
|
| 400 |
+
|
| 401 |
+
Table 8: F1 score under attack results on OntoNotes dataset. Both RockNER and our method are evaluated under context-only attack, entity only attack, and context+entity attack settings. Comparing numbers row-wise against RockNER (first row) reveals that our method (second row) obtains lower F1 score compared to F1 score on original test set under all three attack settings.
|
| 402 |
+
|
| 403 |
+

|
| 404 |
+
Figure 8: The architecture of two T5 models. On the left is the T5 Instruction NER Model and on the right is the T5 Vanilla NER Model.
|
| 405 |
+
|
| 406 |
+
method are more semantically similar to the original test sentence. This can be attributed to the fact that our method synthesizes diverse and effective adversarial examples while preserving textual similarity. (keeping the modification rate low).
|
| 407 |
+
|
| 408 |
+
we replace it with relevant substitutes to generate the adversarial examples. The disentanglement of the latent representations of entity or non-entity word types prevents bias towards perturbations of a particular word type.
|
| 409 |
+
|
| 410 |
+
# A.4 Case Studies
|
| 411 |
+
|
| 412 |
+
We show the generated examples from OntoNotes dataset using the RockNER baseline method and our method in Table 7. The sentences on the left are from the original test set and the blue texts are correctly predicted named entities by the NER model. The sentences in the middle are the generated adversarial examples using the RockNER baseline method. The sentences on the right are the generated adversarial examples following the workflow in Figure 2. The italic words are selected to be replaced from the original sentences. The red labels are wrong predictions by the NER model after the adversarial attacks.
|
| 413 |
+
|
| 414 |
+
In this experiment, we allow at most one word replacement and it could either be context or a named entity word. From the output we can see that, using our method, the replacement of one word effectively causes the NER model to make wrong prediction.
|
| 415 |
+
|
| 416 |
+
From Table 7, we observe that in comparison to RockNER, the adversarial examples from our
|
adversarialrobustnessforlargelanguagenermodelsusingdisentanglementandwordattributions/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6a7b0a32ff25dd2966541922ed05ccc3ec60d58b543bcc5ee35a21458c4f5adf
|
| 3 |
+
size 545069
|
adversarialrobustnessforlargelanguagenermodelsusingdisentanglementandwordattributions/layout.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ad15fe4c6b092289e37feb19232b78304f2a1ecc9b29b116c0412aec674daebe
|
| 3 |
+
size 438444
|
adversarialtextgenerationbysearchandlearning/e8a70fd2-8275-49e1-af3d-908d9b078cfa_content_list.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8cff11477aede51f4dd3abfe461284c256a86c0920f4d18da99bf670d8599956
|
| 3 |
+
size 124572
|
adversarialtextgenerationbysearchandlearning/e8a70fd2-8275-49e1-af3d-908d9b078cfa_model.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a9f581dfc27cc67b200c07d3261d4e77a0cfd86b9582569acb657dbb3d73eeb6
|
| 3 |
+
size 149450
|
adversarialtextgenerationbysearchandlearning/e8a70fd2-8275-49e1-af3d-908d9b078cfa_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:57953c7a307db64bbe3ea1cf4e83044c16752e9c23e770cbadf727b6ece016a4
|
| 3 |
+
size 706996
|
adversarialtextgenerationbysearchandlearning/full.md
ADDED
|
@@ -0,0 +1,498 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Adversarial Text Generation by Search and Learning
|
| 2 |
+
|
| 3 |
+
Guoyi Li $^{1}$ , Bingkang Shi $^{1}$ , Zongzhen Liu $^{1}$ , Dehan Kong $^{2}$ , Yulei Wu $^{3}$ , Xiaodan Zhang $^{1}$ , Longtao Huang $^{2}$ , Honglei Lyu $^{1}$
|
| 4 |
+
|
| 5 |
+
$^{1}$ Chinese Academy of Sciences, Institute of Information Engineering, Beijing, China
|
| 6 |
+
2 Alibaba Group, Alibaba Artificial Intelligence Governance Laboratory, Beijing, China
|
| 7 |
+
<sup>3</sup> University of Bristol, Department of Electrical and Electronic Engineering, Bristol, UK {liguoyi, shibingkang, zhangxiaodan} @ iie.ac.cn
|
| 8 |
+
|
| 9 |
+
# Abstract
|
| 10 |
+
|
| 11 |
+
Recent research has shown that evaluating the robustness of natural language processing models using textual attack methods is significant. However, most existing text attack methods only use heuristic replacement strategies or language models to generate replacement words at the word level. The blind pursuit of high attack success rates makes it difficult to ensure the quality of the generated adversarial text. As a result, adversarial text is often difficult for humans to understand. In fact, many methods that perform well in terms of text attacks often generate adversarial text with poor quality. To address this important gap, our work treats black-box text attack as an unsupervised text generation problem and proposes a search and learning framework for Adversarial Text Generation by Search and Learning (ATGSL) and develops three adversarial attack methods (ATGSL-SA, ATGSL-BM, ATGSL-FUSION) for black-box text attacks. We first apply a heuristic search attack algorithm (ATGSL-SA) and a linguistic thesaurus to generate adversarial samples with high semantic similarity. After this process, we train a conditional generative model to learn from the search results while smoothing out search noise. Moreover, we design an efficient ATGSL-BM attack algorithm based on the text generator. Furthermore, we propose a hybrid attack method (ATGSL-FUSION) that integrates the advantages of ATGSL-SA and ATGSL-BM to enhance attack effectiveness. Our proposed attack algorithms are significantly superior to the most advanced methods in terms of attack efficiency and adversarial text quality.
|
| 12 |
+
|
| 13 |
+
# 1 Introduction
|
| 14 |
+
|
| 15 |
+
Recent research has demonstrated that deep neural networks (DNNs) are vulnerable to maliciously crafted adversarial text examples that can fool victim models into making wrong predictions (Wang, 2018; Papernot et al., 2016a,b). These text examples that add malicious perturbation to the original
|
| 16 |
+
|
| 17 |
+
text do not affect human judgment but can deceive deep learning models. (Bender and Koller, 2020) pointed out that deep neutral models have defects in understanding the meaning conveyed by language. Thus, generating adversarial samples has become a common method for evaluating the weakness and robustness of DNNs.
|
| 18 |
+
|
| 19 |
+
Existing malicious text generation algorithms can be classified into character-level attacks, sentence-level attacks, and word-level attacks. Character-level attacks (Belinkov and Bisk, 2017; Ebrahimi et al., 2017) include the addition, deletion, replacement, and order exchange of characters, which sacrifices the readability of the generated text in exchange for the attack's success rate. Sentence-level attacks (Jia and Liang, 2017; Inui et al., 2019) regard the original input of the whole sentence as a perturbation object, which often makes a considerable difference between the generated text and the original input. It is not easy to guarantee the quality of the generated text. Therefore, many studies focus on improving the attack success rate and the quality of the attack text generated by word replacement, hence word-level attacks.
|
| 20 |
+
|
| 21 |
+
Previous works mainly generate textual attacks on word replacement according to specific rules (Alzantot et al., 2018; Ren et al., 2019; Jin et al., 2020; Bender and Koller, 2020; Zang et al., 2020b; Yang et al., 2021a). Most of these models show good attack performance by using multiple linguistic constraints (e.g., NER tagging and POS tagging) and a well-organized linguistic thesaurus (e.g., WordNet and HowNet). However, these works require extensive preprocessing, and the substitution words selection heavily relies on tags and cannot guarantee the fluency and grammaticality of adversarial samples. The other attack methods based on language models, such as BERT, can generate contextual perturbations (Garg and Ramakrishnan, 2020; Li et al., 2020b; Yang et al., 2021b;
|
| 22 |
+
|
| 23 |
+
Malik et al., 2021). These models ensure the predicted token fits the sentence well but cannot preserve the semantic similarity (Yang et al., 2021a). For example, in the sentence "I feel [MASK]", predicting the [MASK] as happy or sad is equally sensible but results in a sentiment analysis task. In order to improve these issues, recent research has focused on learning-based methods (Zang et al., 2020a; Lee et al., 2022; Sabir et al., 2021), aiming to utilize model learning to improve the balance between the efficiency of attack algorithms and the quality of adversarial texts from the attack evaluation history.
|
| 24 |
+
|
| 25 |
+
Inspired by these works, adversarial text generation can be seen as an unsupervised text generation problem. Thus, we propose a new framework for Adversarial Text Generation by Search and Learning (ATGSL). This framework includes a search module that uses strong search algorithms (e.g., Simulated Annealing) to search synonym spaces and a learning module (e.g., BERT-MLM) that learns from search results. We first use the Simulated Annealing (SA) optimization algorithm in each step to determine token replacement priority. Then we accept or reject suggestions based on a heuristic-defined scoring function and save successful attack adversarial samples (ATGSL-SA). Since ATGSL-SA requires a large number of iterations and attack effectiveness is easily affected by initial conditions, we utilize search results as pseudo references for training condition generators. We design an efficient ATGSL-BM attack algorithm based on generators. In addition, we propose a hybrid attack method (ATGSL-FUSION) to enhance attack effectiveness.
|
| 26 |
+
|
| 27 |
+
- We propose a black-box attack framework based on a search and learning framework to improve the balance of the attack efficiency and the quality of adversarial samples. To the best of our knowledge, this is the first of its kind to propose search and learning methods to generate adversarial samples.
|
| 28 |
+
- ATGSL-SA generates word substitutions from both synonym candidates and sememe candidates. It integrates label score, replacement word rate, and semantic similarity into the design of the SA algorithm to generate adversarial texts with higher semantic similarity.
|
| 29 |
+
- Our attack method ATGSL-BM based on fine-tuned pre-trained language models, improves
|
| 30 |
+
|
| 31 |
+
attack effectiveness and the quality of adversarial texts. In addition, ATGSL-FUSION has the best attack success rate because it improves the impact of the initial conditions on the ATGSL-SA search.
|
| 32 |
+
|
| 33 |
+
- Extensive experimental results show that our model significantly improves the existing state-of-the-art models in adversarial text generation in terms of attack efficiency and text quality.
|
| 34 |
+
|
| 35 |
+
# 2 Related Work
|
| 36 |
+
|
| 37 |
+
# 2.1 Textual Adversarial Attack
|
| 38 |
+
|
| 39 |
+
Existing textual adversarial attack methods can mainly be classified into character-level, sentence-level, and word-level attacks based on the granularity of perturbations. Character-level attacks mainly operate on the addition, deletion, substitution, and exchange order of characters in the original input, and typical substitution methods such as random substitution (Belinkov and Bisk, 2017), character similarity substitution (Eger et al., 2019), etc. However, character-level attacks often produce low-quality adversarial samples that can violate grammar rules and be resisted by grammar-based defence methods (Pruthi et al., 2019). Sentence-level attacks treat the original input of the whole sentence as an object of perturbation. Typical examples of such attacks include paraphrasing (Ribeiro et al., 2018; Iyyer et al., 2018), encoding-decoding (Zhao et al., 2017), but the generated text can cause a significant discrepancy with the original text. Word-level attacks perturb words in the original input, and word replacement is the primary method. Common word replacement methods can be categorized into rule-based attacks and learning-based attacks.
|
| 40 |
+
|
| 41 |
+
Rule-based attacks mainly select candidate words based on the preset strategy. (Jin et al., 2020) developed methods to search for replacement words relying on cosine distance to find adjacent word vectors in Glove's embedding space, which may lead to the opposite meaning of original words. To avoid this limitation, (Ren et al., 2019) selected candidate words from a well-organized linguistic thesaurus (e.g., WordNet (Miller, 1998) and HowNet (Dong and Dong, 2006)) and chose appropriate replacement words with the optimal strategy. However, this work focuses on a fixed WIS (Weight Important Score) order, leading to local selection and excessive word replacement. To reduce
|
| 42 |
+
|
| 43 |
+
the effect of static WIS on word selection order, BESA (Yang et al., 2021b) optimized the step size of Simulated Annealing to choose the best token replacement combination. However, this method is easily influenced by the initial condition and generates many queries for candidate sets. Recent language model-based attacks are mainly based on BERT Masked Language Model (BERT-MLM). (Garg and Ramakrishnan, 2020; Li et al., 2020b) used BERT-MLM to score replacement words. Although these methods consider the semantic relevance of context, they still cause ambiguity in tasks such as rumor detection and emotion analysis. This is because the candidate words generated by these pre-trained models do not consider the role of the original words that were replaced by [MASK].
|
| 44 |
+
|
| 45 |
+
Learning-based attacks learn from evaluation history to improve learning model parameters (Zang et al., 2020a; Lee et al., 2022; Sabir et al., 2021). (Zang et al., 2020b) utilized the probability feedback of the target model to modify the parameters of particle swarm optimization (PSO) in order to select the replacement better. BBA (Lee et al., 2022) utilized Bayesian algorithms to learn query history and optimized the selection of replacement locations. But these methods of fitting the target model in the evaluation history have high computational complexity and uncertainty. On the other hand, ReinforceBug (Sabir et al., 2021) designed a feedback generation method including grammar evaluation based on a reinforcement learning framework, which improves the quality of the generated samples, but also has the drawbacks of the above WIS score-based method, which can affect attack performance. Inspired by this, our work aims to improve the balance between attack efficiency and the quality of adversarial texts by attempting to build the framework by virtue of both search and learning.
|
| 46 |
+
|
| 47 |
+
# 2.2 Unsupervised Text Generation
|
| 48 |
+
|
| 49 |
+
Neural unsupervised text generation has made significant progress, with variational autoencoders (Kingma and Welling, 2013) being a well-known approach. Search-based methods have also been developed for various text generation tasks (Kumar et al., 2020; Schumann et al., 2020; Miao et al., 2019; Liu et al., 2019a), but they are not learnable. (Li et al., 2020a) proposed a search-and-learning approach to improve performance and inference efficiency. Our paper adopts this approach but differs
|
| 50 |
+
|
| 51 |
+
in several ways: 1) Our search aims to obtain adversarial texts with higher semantic similarity and quality; 2) We use search and learning to design three attack algorithms: ATGSL-SA, ATGSL-BM, and ATGSL-FUSION. To the best of our knowledge, we are the first to address adversarial text generation using the search-and-learning method.
|
| 52 |
+
|
| 53 |
+
# 3 Problem Statement
|
| 54 |
+
|
| 55 |
+
This paper focuses on black-box attacks, in which attackers do not know the internal structure and parameters of the target model, and can only query the target model to obtain its output relative to a given input. In this study, attackers can query the target model's output labels and confidence scores.
|
| 56 |
+
|
| 57 |
+
Formally, let $\mathbf{X} = \{x_{1}, x_{2}, \dots, x_{n}\}$ be the input dataset including $n$ samples, and each $x^{(i)}$ corresponds to a ground-truth label $y_{i}^{true} \in \mathbf{Y}$ . Let $\mathbf{F}: \mathbf{X} \to \mathbf{Y}$ be a well-trained model that classifies input samples into labels. This attack can generally be modelled as an optimization problem, which aims to mislead the target model by the adversarial sample $\mathbf{X}_{adv}$ with better quality of adversarial texts:
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\mathbf {F} \left(\mathbf {X} _ {\mathrm {a d v}}\right) \neq \mathbf {Y}. \tag {1}
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
An adversarial text example $\mathbf{X}_{adv}$ is defined as the original input $\mathbf{X}$ that has been subjected to slight perturbations $\Delta \mathbf{X}$ , i.e., $\mathbf{X}_{adv} = \mathbf{X} + \Delta \mathbf{X}$ .
|
| 64 |
+
|
| 65 |
+
# 4 Methodology
|
| 66 |
+
|
| 67 |
+
Our attack algorithms are summarized in Algorithm 1. In our approach, we first employ the ATGSL-SA algorithm to search for suitable replacement words in synonym and sememe word lists, ensuring semantic similarity while identifying appropriate replacement word combinations for attacks. To address the issue of high iteration time cost and the tendency to get trapped in local optima due to its initial condition in SA (Henderson et al., 2003), we designed ATGSL-BM and ATGSL-FUSION<sup>1</sup>. In ATGSL-BM, we fine-tune a pre-trained language model (LM) to learn the search patterns of the ATGSL-SA algorithm and serve as the foundation for the attack algorithm. The large model capacity and extensive pre-training of LMs enable the generation of high-quality adversarial texts. In ATGSL-FUSION, we generate intermediate solutions through ATGSL-BM to improve the sensitivity of the initial condition in ATGSL-SA.
|
| 68 |
+
|
| 69 |
+
Algorithm 1: Our Proposed Algorithms
|
| 70 |
+
Input: Original text X, initial search state $\mathbf{X}_{ini}$ target model F, well-trained conditional generative model B Output: Adversarial sample $\mathbf{X}_{adv}$
|
| 71 |
+
1 Initialization: The initial temperature $T_0 = T_{init} = 0.1$ , internal simulation steps MaxStep $= 20$ S is initially an empty set, the initial adversarial example $\mathbf{X}_{adv} = \mathbf{X}_{ini}$
|
| 72 |
+
2 for each token $w_{i}\subset \mathbf{X}$ do
|
| 73 |
+
3 Candidate set $\mathbf{C}_i$ sampled from synonym space W (WordNet) and sememe space H (HowNet);
|
| 74 |
+
4 for $t = 1,\dots ,$ MaxStep do
|
| 75 |
+
5 if method $= =$ ATGSL-SA or ATGSL-FUSION then
|
| 76 |
+
6 Randomly choose an edit position $k$ and utilize $C_k$ to replace $x_{k}$ in Eq. 3 to craft $\mathbf{X}_{new};$
|
| 77 |
+
7 Compute the objective value $s(*)$ by Eq. 4;
|
| 78 |
+
8 if method $= =$ ATGSL-BM then
|
| 79 |
+
9 Randomly choose an edit position $k$ to replace position set and use the well-trained generative model $\mathcal{B}$ to generate a new word combination as $\mathbf{X}_{new}$ in Eq. 3;
|
| 80 |
+
10 if $s(\mathbf{Y}|\mathbf{X}_{new}) - s(\mathbf{Y}|\mathbf{X}_{adv}) < 0$ then
|
| 81 |
+
11 $\mathbf{X}_{adv} = \mathbf{X}_{new};$
|
| 82 |
+
else
|
| 83 |
+
13 Compute the probability $p^{\prime}$ by Eq. 9;
|
| 84 |
+
14 if method $= =$ ATGSL-SA then With probability $p$ $\mathbf{X}_{adv} = \mathbf{X}_{new};$
|
| 85 |
+
15 if method $= =$ ATGSL-BM then With probability 1- $p$ , discard edit position $k;$
|
| 86 |
+
16 if method $= =$ ATGSL-FUSION then With probability $p$ , discard the replaced $\mathbf{X}_{adv}$ and utilize $\mathcal{B}$ to generate new $\mathbf{X}_{adv}$ to change the initial condition;
|
| 87 |
+
19
|
| 88 |
+
20 Calculate $T_0^\prime$ by Eq. 10, $T_0 = max\{T_0^\prime ,0.01\}$ .
|
| 89 |
+
21 if $\mathbf{F}(\mathbf{X}_{adv})\neq \mathbf{Y}$ then Return: $\mathbf{X}_{adv}$
|
| 90 |
+
Return: Adversarial sample $\mathbf{X}_{adv}$
|
| 91 |
+
|
| 92 |
+
# 4.1 The ATGSL-SA Algorithm
|
| 93 |
+
|
| 94 |
+
In ATGSL-SA, we regard determining the best word replacement order as a combinatorial optimization problem, and use SA to decide word replacement priority. Simulated Annealing (SA) is an effective heuristic search algorithm, suitable for searching large discrete or continuous spaces (Kirkpatrick et al., 1983; Granville et al., 1994). Therefore, we choose SA as our search text attack algorithm to search synonym and sememe space and generate adversarial samples with high semantic similarity.
|
| 95 |
+
|
| 96 |
+
Candidate Word List. In a sentence composed of $m$ words $\mathbf{X} = \{w_{i},w_{2},\dots,w_{m}\}$ , only some keywords have an impact on the prediction model $F$ .
|
| 97 |
+
|
| 98 |
+
This is consistent with the research by (Niven and Kao, 2019), who found that the language model focuses on statistical clues of some words. Therefore, we preprocess all candidate words of each token and design a priority mechanism to select the best replacement word. Since the attack method based on linguistic thesaurus has been proved to have a higher semantic similarity between the generated text and the original text (Zang et al., 2020b; Yang et al., 2021a), our work gets initial candidate words from synonym-based and sememe-based substitution $\mathbf{C}_i = \mathbb{W} \cup \mathbb{H}$ , as shown in lines $3\sim 4$ of Algorithm 1. For each potential candidate $w_i' \in \mathbb{C}_i$ who replaces the original word $w_i$ , we define $\mathbf{X}_{w_i}' = w_1, w_2, \ldots, w_i', \ldots, w_m$ and candidate importance score $I_{w_i'}$ as the true score probability reduction:
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
I _ {w _ {i} ^ {\prime}} = P (\mathbf {Y} _ {t r u e} \mid \mathbf {X}) - P (\mathbf {Y} _ {t r u e} \mid \mathbf {X} _ {w _ {i}} ^ {\prime}). \qquad (2)
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
In every search for replacement words, we choose the word $w_{i}$ with the highest $I_{w_i}'$ as the best replacement word $w_{i}^{*}$ . The synonym candidate selection function is given below:
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
w _ {i} ^ {*} = R \left(w _ {i}, \mathbf {C} _ {i}\right) = \underset {w _ {i} ^ {\prime} \in \mathbb {C} _ {i}} {\arg \max } I _ {w _ {i} ^ {\prime}} \tag {3}
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
Search Process. In the search process, we regard each molecule in the search space corresponds to a word in the sentence, and the replacement of each word corresponds to the movement of the molecular position. During the simulation process, any molecular motion that can reduce the objective function will be accepted, and there is also a conversion probability of increasing the objective function. Additionally, this approach can reduce the impact of word replacement order because sometimes replacing two words $\{top1, top3\}$ can be even better than changing the top-3 WIS words $\{top1, top2, top3\}$ .
|
| 111 |
+
|
| 112 |
+
Our goal in the ATGSL-SA is to find new adversarial samples that can minimize the probability of true labels while maintaining high semantic similarity. The heuristic-based objective function in line 11 of Algorithm 1 is:
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\begin{array}{r l} s (\mathbf {Y} | \mathbf {X} _ {\text {n e w}}) & = P _ {\text {t r u e}} (\mathbf {X} _ {\text {n e w}}) + \alpha \times D i s (\mathbf {X}, \mathbf {X} _ {\text {n e w}}) \\ & + \beta \times (1 - S e m (\mathbf {X}, \mathbf {X} _ {\text {n e w}})), \end{array} \tag {4}
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
where $Dis(\mathbf{X}, \mathbf{X}_{new})$ represents the number of different words between $\mathbf{X}$ and $\mathbf{X}_{new}$ , $Sem(\mathbf{X}, \mathbf{X}_{new}) \in [0,1]$ (the higher, the better) is calculated by Universal Sense Encoder (USE)
|
| 119 |
+
|
| 120 |
+
(Cer et al., 2018), and $\alpha, \beta$ are parameters to make a tradeoff between the attack efficiency and the semantic similarity. In our implementation, we empirically set $\{\alpha, \beta\} = \{0.01, 0.1\}$ . Please refer to Appendix A for more details of ATGLS-SA.
|
| 121 |
+
|
| 122 |
+
# 4.2 The ATGSL-BM Algorithm.
|
| 123 |
+
|
| 124 |
+
The ATGSL-BM algorithm consists of two stages: training and attack. During the training stage, the text conditional generator learns the attack patterns of ATGSL-SA. The training procedure is summarized in Algorithm 2. During the attack stage, we use the trained conditional generator to generate text candidates. Fig. 2 and Algorithm 2 in Appendix B provides a diagram of the training stage.
|
| 125 |
+
|
| 126 |
+
Training Process. The local search algorithm has low computational efficiency during inference, requiring several hundred steps of editing and re-evaluation for each sample. Due to the state-of-the-art performance of the encoder-decoder framework of BERT-MLM (BM) (Vaswani et al., 2017) in text generation, our intuition is to fine-tune BERT-MLM based on ATGSL-SA's search results. On the other hand, BERT-MLM provides a new way of selecting candidate words, which utilizes a bidirectional language model to determine two candidate words $\{top1, top2\}$ through context, unlike ATGSL-SA, which determines $top1$ and then calculates $P(top2|top1)$ . This method further reduces the impact of word replacement orders. Specifically, we use [MASK] to fill in the replacement word for $\mathbf{X}_{adv}$ obtained from ATGSL-SA to obtain the $\mathbf{X}^{mask} = \{x_0, \dots, x_i^{mask}, \dots, x_n\}$ . In the training process, we construct question-answer pairs $(\mathbf{X}, \mathbf{X}^{mask})$ as input for the encoder and $(\mathbf{X}, \mathbf{X}_{adv})$ as the label.
|
| 127 |
+
|
| 128 |
+
$$
|
| 129 |
+
h _ {i} = E _ {i n} \left(x _ {i}\right), \tag {5}
|
| 130 |
+
$$
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\left(\tilde {h} _ {0} ^ {\text {m a s k}}, \dots , \tilde {h} _ {i} ^ {\text {m a s k}}, \dots , \tilde {h} _ {n} ^ {\text {m a s k}}\right) \tag {6}
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
$$
|
| 137 |
+
= f _ {d e c} (f _ {e n c} (h _ {0}, \dots , h _ {i} ^ {m a s k}, \dots , h _ {n})),
|
| 138 |
+
$$
|
| 139 |
+
|
| 140 |
+
$$
|
| 141 |
+
\tilde {x} _ {i} = \operatorname {a r g m a x} \left(\operatorname {s o f t m a x} \left(E _ {\text {o u t}} \left(\tilde {h} _ {i} ^ {\text {m a s k}}\right)\right)\right), \tag {7}
|
| 142 |
+
$$
|
| 143 |
+
|
| 144 |
+
where $f_{enc}$ and $f_{dec}$ are the encoder and decoder. Given a source sequence $x$ , the objective is the word-by-word cross-entropy (CE) loss, given by
|
| 145 |
+
|
| 146 |
+
$$
|
| 147 |
+
J _ {\mathrm {C E}} = - \sum_ {n = 1} ^ {N} \sum_ {v \in V} y _ {i, v} ^ {(\mathrm {S A})} \log p _ {i, v} ^ {(\mathrm {B M})}, \tag {8}
|
| 148 |
+
$$
|
| 149 |
+
|
| 150 |
+
where $y_{i,v}^{(\mathrm{SA})}$ is a binary value, indicating whether the $i$ th [MASK] is $v$ or not in the ATGSL-SA's output for this data sample, and $\log p_{i,v}^{(\mathrm{BM})} = Pr[y_i = v|y^{(\mathrm{SA})},x^{mask}]$ , which the BERT-MLM predicts.
|
| 151 |
+
|
| 152 |
+
Table 1: Statistics of the datasets
|
| 153 |
+
|
| 154 |
+
<table><tr><td>Task</td><td>Dataset</td><td>Train</td><td>Test</td><td>Classes</td><td>Avg Len</td></tr><tr><td rowspan="3">Classification</td><td>AG’News</td><td>27K</td><td>9K</td><td>4</td><td>43</td></tr><tr><td>IMDB</td><td>25K</td><td>25K</td><td>2</td><td>227</td></tr><tr><td>MR</td><td>7K</td><td>3K</td><td>2</td><td>30</td></tr><tr><td rowspan="2">Entailment</td><td>MNLI</td><td>430k</td><td>10K</td><td>3</td><td>15</td></tr><tr><td>SNLI</td><td>560k</td><td>10K</td><td>3</td><td>12</td></tr></table>
|
| 155 |
+
|
| 156 |
+
In short, due to the reduced cross-entropy loss, Eq. 8 is equivalent to reducing $\mathrm{KL}(\hat{y}^{(\mathrm{SA})}\parallel p_i^{(\mathrm{BM})})$ . Minimizing the KL-term makes the slot $p_i^{(\mathrm{BM})}$ more wide-spreading than the $\hat{y}^{(\mathrm{SA})}$ because of asymmetry nature, which explains why CE-trained BERTMLM can smooth out the noise of the stochastic SA search (Li et al., 2020a).
|
| 157 |
+
|
| 158 |
+
Attack Process. Our following insight is to use trained BM to design an ATGSL-BM algorithm for generating adversarial texts. Similar to ATGSL-SA search for adversarial texts, in each round, this algorithm determines the new replacement position randomly in line 10 of Algorithm 1. We mask out $m$ corresponding positions and obtain the top-t candidate words for each replacement position from the trained BERT-MLM, we list all possible candidates sentence $S \in t \times m$ . Which is $m^t$ candidate. We use to calculate the semantic similarity between all candidates and original text and select top-k candidates. And choose the one with the best attack effect as $\mathbf{X}_{\text{new}}$ .
|
| 159 |
+
|
| 160 |
+
# 4.3 The ATGSL-FUSION Algorithm.
|
| 161 |
+
|
| 162 |
+
ATGSL-FUSION is a hybrid algorithm of ATGSL-SA and ATGSL-BM. For instance, in each step of ATGSL-SA, a set of positions to be replaced is selected during the initial stage. After selecting several replacement words $\{w_{1}, w_{2}, w_{3}\}$ , if multiple attack attempts $\mathbf{X}_{new}$ do not decrease score $s(Y_{true} | X_{new})$ , this local optima problem caused by the initial conditions will waste considerable computational time. In ATGSL-FUSION, by altering the initial conditions and using the results generated by ATGSL-BM as an intermediate solution $\mathbf{X}_{new}$ for further search, we can avoid local optima in line 20 of Algorithm 1. And proceed with the next iteration based on the modified $\mathbf{X}_{adv}$ in the space of synonyms and sememe.
|
| 163 |
+
|
| 164 |
+
# 5 Experiments
|
| 165 |
+
|
| 166 |
+
# 5.1 Experiment Settings
|
| 167 |
+
|
| 168 |
+
Datasets. We evaluate the proposed ATGSL and its variants on five public datasets, including IMDB
|
| 169 |
+
|
| 170 |
+
Table 2: The attack success rate (ASR) of various attack algorithms on text datasets.
|
| 171 |
+
|
| 172 |
+
<table><tr><td>Dataset</td><td>Model</td><td>PWWS</td><td>TFEO</td><td>PSO</td><td>Reinforce-Bug</td><td>BEAT</td><td>BBA</td><td>BESA</td><td>ATGSL-SA</td><td>ATGSL-BM</td><td>ATGSL-FUSION</td></tr><tr><td rowspan="4">MR</td><td>CNN</td><td>91.8%</td><td>92.1%</td><td>93.1%</td><td>90.7%</td><td>93.1%</td><td>93.8%</td><td>95.1%</td><td>96.8%</td><td>97.9%</td><td>99.5%</td></tr><tr><td>LSTM</td><td>89.4%</td><td>90.1%</td><td>91.3%</td><td>88.7%</td><td>92.8%</td><td>92.6%</td><td>94.2%</td><td>95.7%</td><td>98.2%</td><td>99.6%</td></tr><tr><td>BERT</td><td>85.7%</td><td>83.9%</td><td>88.4%</td><td>81.6%</td><td>82.8%</td><td>92.8%</td><td>93.2%</td><td>94.1%</td><td>97.4%</td><td>98.9%</td></tr><tr><td>RoBERTa</td><td>82.8%</td><td>83.2%</td><td>87.2%</td><td>79.7%</td><td>81.2%</td><td>91.5%</td><td>90.8%</td><td>92.3%</td><td>97.3%</td><td>98.7%</td></tr><tr><td rowspan="4">IMDB</td><td>CNN</td><td>94.1%</td><td>96.6%</td><td>98.5%</td><td>96.7%</td><td>98.2%</td><td>98.4%</td><td>98.4%</td><td>98.7%</td><td>96.4%</td><td>99.5%</td></tr><tr><td>LSTM</td><td>94.3%</td><td>95.8%</td><td>97.6%</td><td>92.2%</td><td>96.4%</td><td>95.5%</td><td>97.3%</td><td>97.8%</td><td>95.4%</td><td>98.9%</td></tr><tr><td>BERT</td><td>77.8%</td><td>75.2%</td><td>—</td><td>83.9%</td><td>89.6%</td><td>88.5%</td><td>93.3%</td><td>95.4%</td><td>94.3%</td><td>98.5%</td></tr><tr><td>RoBERTa</td><td>74.2%</td><td>78.9%</td><td>—</td><td>82.1%</td><td>85.6%</td><td>86.8%</td><td>92.4%</td><td>94.2%</td><td>93.5%</td><td>97.6%</td></tr><tr><td rowspan="4">AG's News</td><td>CNN</td><td>82.3%</td><td>81.7%</td><td>83.9%</td><td>81.5%</td><td>88.4%</td><td>90.2%</td><td>88.6%</td><td>91.6%</td><td>91.9%</td><td>93.2%</td></tr><tr><td>LSTM</td><td>78.6%</td><td>78.7%</td><td>80.8%</td><td>77.7%</td><td>85.8%</td><td>86.4%</td><td>84.3%</td><td>91.8%</td><td>92.3%</td><td>94.1%</td></tr><tr><td>BERT</td><td>73.6%</td><td>73.2%</td><td>77.8%</td><td>74.8%</td><td>83.3%</td><td>82.7%</td><td>86.3%</td><td>88.5%</td><td>89.3%</td><td>92.8%</td></tr><tr><td>RoBERTa</td><td>72.5%</td><td>73.5%</td><td>81.3%</td><td>79.8%</td><td>83.6%</td><td>81.5%</td><td>85.2%</td><td>87.8%</td><td>88.4%</td><td>93.3%</td></tr><tr><td rowspan="4">MNLI</td><td>InferSent</td><td>85.7%</td><td>85.2%</td><td>86.6%</td><td>84.3%</td><td>87.8%</td><td>90.6%</td><td>91.5%</td><td>92.6%</td><td>94.7%</td><td>97.5%</td></tr><tr><td>ESIM</td><td>80.3%</td><td>82.6%</td><td>83.5%</td><td>81.5%</td><td>86.3%</td><td>85.6%</td><td>85.7%</td><td>87.6%</td><td>90.3%</td><td>92.4%</td></tr><tr><td>BERT</td><td>82.1%</td><td>81.9%</td><td>82.8%</td><td>78.4%</td><td>84.7%</td><td>85.4%</td><td>84.4%</td><td>86.3%</td><td>92.4%</td><td>96.7%</td></tr><tr><td>RoBERTa</td><td>80.2%</td><td>81.4%</td><td>81.9%</td><td>80.4%</td><td>83.1%</td><td>84.5%</td><td>83.6%</td><td>84.7%</td><td>92.9%</td><td>95.2%</td></tr><tr><td rowspan="4">SNLI</td><td>InferSent</td><td>91.7%</td><td>92.2%</td><td>93.8%</td><td>90.5%</td><td>95.8%</td><td>95.6%</td><td>96.8%</td><td>97.9%</td><td>98.4%</td><td>99.2%</td></tr><tr><td>ESIM</td><td>88.3%</td><td>87.6%</td><td>89.5%</td><td>85.5%</td><td>90.3%</td><td>90.2%</td><td>90.7%</td><td>91.5%</td><td>93.2%</td><td>95.3%</td></tr><tr><td>BERT</td><td>90.3%</td><td>89.8%</td><td>92.3%</td><td>90.4%</td><td>94.3%</td><td>92.7%</td><td>93.5%</td><td>95.7%</td><td>96.8%</td><td>98.6%</td></tr><tr><td>RoBERTa</td><td>88.9%</td><td>89.4%</td><td>91.5%</td><td>89.4%</td><td>93.1%</td><td>91.9%</td><td>92.8%</td><td>94.7%</td><td>97.3%</td><td>98.9%</td></tr></table>
|
| 173 |
+
|
| 174 |
+
(Maas et al., 2011), MR (Pang and Lee, 2005), AG's News (Zhang et al., 2015), MNLI matched (Williams et al., 2017) and SNLI (Bowman et al., 2015). The AG's News, IMDB, and MR are used for classification tasks, whereas MNLI and SNLI are used for textual entailment. Statistical details of these datasets are summarized in Table 1.
|
| 175 |
+
|
| 176 |
+
Target models. We apply our attack algorithm to popular target models, i.e., CNN (Kim, 2014), LSTM (Hochreiter and Schmidhuber, 1997), BERT (Devlin et al., 2018) and RoBERTa (Liu et al., 2019b) on sentence classification tasks, and the standard InferSent (Conneau et al., 2017), ESIM (Chen et al., 2016), BERT and RoBERTa on textual entailment tasks. CNN is stacked by a word embedding layer with 50 embedding dimensions, a convolutional layer with 250 filters, and each kernel size of 3. LSTM passes the input sequence through a 100-dimension embedding layer, concatenating a 128-unit long short-term memory layer, and following a dropout of 0.5. We download BERT (bert-base-uncased), RoBERTa (roberta-base) from the Transformers model hub HuggingFace $^2$ . The original test results are listed in Table 7. Please refer to Table 7 in Appendix D.1 to obtain the test success rates of each model on datasets.
|
| 177 |
+
|
| 178 |
+
Baselines. We compare our method with these baselines such as PWWS, TEFO, PSO, ReinforceBug, BEAT, BESA. PWWS, TEFO, BEAT are rule-based attacks and the PSO and BESA are Learning-based attacks (Ren et al., 2019; Jin et al., 2020; Zang et al., 2020b; Sabir et al., 2021; Li et al., 2020b; Yang et al., 2021b; Lee et al., 2022). Please
|
| 179 |
+
|
| 180 |
+
refer to Appendix C.2 for more details of these attacks.
|
| 181 |
+
|
| 182 |
+
For all datasets, we evaluate the attack success rate, average word substitution rate, semantic similarity score, grammatical Errors score and cost time as shown in Tables 2, 3 and 4. ASR is defined as the misclassification rate of the target model. In our experiment, semantic similarity and grammar (grammatical errors) are calculated by Universal Sense Encoder (USE) ${}^{3}$ and LanguageTool ${}^{4}$ ,respectively.
|
| 183 |
+
|
| 184 |
+
# 5.2 Experimental Results
|
| 185 |
+
|
| 186 |
+
Main Results. Tables 2 and 3 show the performance of our proposed method, ATGSL, and all compared methods on five datasets. The results demonstrate that ATGSL outperforms all state-of-the-art models. Compared to fixed WIS algorithms such as PWWS and TEFO, other algorithms such as BESA that use SA to optimize token replacement combinations have better attack performance because they consider the impact of substitution word selection order on WIS. Although PSO utilizes heuristic methods to optimize substitution word selection, it takes too much time to attack very deep models (BERT, RoBERTa) with long text input (such as IMDB). While heuristic-based strong search algorithms have significant effects, a large number of iterations can result in expensive attack costs. On the other hand, algorithms based on language models, such as BEAT and BESA, have fewer grammatical errors but cause redundancy of
|
| 187 |
+
|
| 188 |
+
Table 3: Automatic evaluation results of adversarial example quality. “%M”, “%I” and “%S” indicate the modification rate, the semantic similarity, grammatical error increase rate, respectively.
|
| 189 |
+
|
| 190 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">Dataset</td><td colspan="3">MR</td><td colspan="3">IMDB</td><td colspan="3">AG's News</td></tr><tr><td>%M</td><td>%I</td><td>%S</td><td>%M</td><td>%I</td><td>%S</td><td>%M</td><td>%I</td><td>%S</td></tr><tr><td rowspan="4">PWWS</td><td>CNN</td><td>13.1</td><td>7.4</td><td>0.69</td><td>1.8</td><td>3.5</td><td>0.87</td><td>6.3</td><td>7.8</td><td>0.72</td></tr><tr><td>LSTM</td><td>13.5</td><td>8.3</td><td>0.67</td><td>2.1</td><td>3.3</td><td>0.89</td><td>8.1</td><td>8.4</td><td>0.63</td></tr><tr><td>BERT</td><td>14.5</td><td>9.9</td><td>0.63</td><td>5.2</td><td>4.3</td><td>0.81</td><td>10.3</td><td>9.6</td><td>0.57</td></tr><tr><td>RoBERTa</td><td>15.2</td><td>10.5</td><td>0.58</td><td>5.8</td><td>4.2</td><td>0.80</td><td>11.2</td><td>10.1</td><td>0.55</td></tr><tr><td rowspan="4">TEFO</td><td>CNN</td><td>17.3</td><td>9.4</td><td>0.73</td><td>2.8</td><td>3.2</td><td>0.84</td><td>7.5</td><td>7.3</td><td>0.69</td></tr><tr><td>LSTM</td><td>15.4</td><td>8.7</td><td>0.68</td><td>3.1</td><td>3.1</td><td>0.83</td><td>8.6</td><td>7.6</td><td>0.64</td></tr><tr><td>BERT</td><td>20.2</td><td>10.9</td><td>0.63</td><td>6.3</td><td>3.6</td><td>0.78</td><td>9.3</td><td>8.4</td><td>0.54</td></tr><tr><td>RoBERTa</td><td>21.3</td><td>11.4</td><td>0.62</td><td>6.4</td><td>3.8</td><td>0.78</td><td>9.8</td><td>8.3</td><td>0.52</td></tr><tr><td rowspan="4">PSO</td><td>CNN</td><td>11.6</td><td>6.8</td><td>0.78</td><td>3.8</td><td>2.6</td><td>0.91</td><td>5.0</td><td>6.7</td><td>0.85</td></tr><tr><td>LSTM</td><td>10.9</td><td>6.2</td><td>0.73</td><td>4.1</td><td>2.4</td><td>0.89</td><td>5.9</td><td>6.8</td><td>0.82</td></tr><tr><td>BERT</td><td>11.9</td><td>8.2</td><td>0.72</td><td>-</td><td>-</td><td>-</td><td>7.8</td><td>7.9</td><td>0.84</td></tr><tr><td>RoBERTa</td><td>12.3</td><td>8.4</td><td>0.70</td><td>-</td><td>-</td><td>-</td><td>8.3</td><td>8.1</td><td>0.81</td></tr><tr><td rowspan="4">Reinforce-Bug</td><td>CNN</td><td>13.3</td><td>7.8</td><td>0.81</td><td>3.8</td><td>2.3</td><td>0.91</td><td>6.5</td><td>6.2</td><td>0.87</td></tr><tr><td>LSTM</td><td>14.7</td><td>7.6</td><td>0.79</td><td>3.9</td><td>2.7</td><td>0.91</td><td>6.9</td><td>6.1</td><td>0.84</td></tr><tr><td>BERT</td><td>16.5</td><td>9.1</td><td>0.77</td><td>4.7</td><td>3.9</td><td>0.85</td><td>7.9</td><td>7.4</td><td>0.80</td></tr><tr><td>RoBERTa</td><td>17.3</td><td>9.3</td><td>0.75</td><td>5.1</td><td>4.1</td><td>0.85</td><td>8.0</td><td>7.5</td><td>0.82</td></tr><tr><td rowspan="4">BEAT</td><td>CNN</td><td>15.3</td><td>7.3</td><td>0.67</td><td>3.8</td><td>1.9</td><td>0.89</td><td>6.3</td><td>6.1</td><td>0.63</td></tr><tr><td>LSTM</td><td>13.4</td><td>7.1</td><td>0.65</td><td>3.7</td><td>2.3</td><td>0.88</td><td>6.6</td><td>6.0</td><td>0.54</td></tr><tr><td>BERT</td><td>15.8</td><td>8.4</td><td>0.63</td><td>4.5</td><td>2.7</td><td>0.84</td><td>8.8</td><td>7.2</td><td>0.56</td></tr><tr><td>RoBERTa</td><td>15.5</td><td>8.5</td><td>0.62</td><td>4.3</td><td>2.8</td><td>0.85</td><td>9.8</td><td>7.3</td><td>0.52</td></tr><tr><td rowspan="4">BBA</td><td>CNN</td><td>13.3</td><td>10.3</td><td>0.69</td><td>5.4</td><td>1.8</td><td>0.85</td><td>6.2</td><td>7.9</td><td>0.64</td></tr><tr><td>LSTM</td><td>13.4</td><td>9.8</td><td>0.67</td><td>5.8</td><td>2.4</td><td>0.86</td><td>5.9</td><td>7.7</td><td>0.61</td></tr><tr><td>BERT</td><td>14.5</td><td>10.9</td><td>0.63</td><td>6.5</td><td>2.7</td><td>0.81</td><td>7.3</td><td>9.7</td><td>0.57</td></tr><tr><td>RoBERTa</td><td>14.9</td><td>11.3</td><td>0.61</td><td>6.3</td><td>2.7</td><td>0.81</td><td>7.6</td><td>10.2</td><td>0.53</td></tr><tr><td rowspan="4">BESA</td><td>CNN</td><td>12.3</td><td>9.8</td><td>0.85</td><td>2.3</td><td>2.2</td><td>0.93</td><td>4.5</td><td>7.2</td><td>0.87</td></tr><tr><td>LSTM</td><td>10.4</td><td>9.6</td><td>0.87</td><td>2.1</td><td>1.9</td><td>0.92</td><td>5.3</td><td>7.3</td><td>0.86</td></tr><tr><td>BERT</td><td>11.3</td><td>11.5</td><td>0.82</td><td>3.3</td><td>2.9</td><td>0.91</td><td>6.2</td><td>8.8</td><td>0.81</td></tr><tr><td>RoBERTa</td><td>11.5</td><td>10.9</td><td>0.81</td><td>3.2</td><td>2.9</td><td>0.90</td><td>6.9</td><td>9.3</td><td>0.82</td></tr><tr><td rowspan="4">ATGSL-SA</td><td>CNN</td><td>11.3</td><td>9.6</td><td>0.88</td><td>2.0</td><td>2.1</td><td>0.96</td><td>3.8</td><td>7.4</td><td>0.92</td></tr><tr><td>LSTM</td><td>10.5</td><td>9.4</td><td>0.91</td><td>1.9</td><td>2.2</td><td>0.96</td><td>4.2</td><td>7.6</td><td>0.89</td></tr><tr><td>BERT</td><td>11.3</td><td>10.6</td><td>0.85</td><td>2.8</td><td>3.1</td><td>0.97</td><td>5.3</td><td>8.6</td><td>0.84</td></tr><tr><td>RoBERTa</td><td>12.3</td><td>11.4</td><td>0.83</td><td>2.7</td><td>3.2</td><td>0.96</td><td>5.4</td><td>9.2</td><td>0.83</td></tr><tr><td rowspan="4">ATGSL-BM</td><td>CNN</td><td>12.5</td><td>8.3</td><td>0.82</td><td>3.4</td><td>1.3</td><td>0.92</td><td>5.4</td><td>3.2</td><td>0.81</td></tr><tr><td>LSTM</td><td>12.3</td><td>7.3</td><td>0.84</td><td>3.2</td><td>1.2</td><td>0.91</td><td>5.3</td><td>3.0</td><td>0.83</td></tr><tr><td>BERT</td><td>14.5</td><td>8.8</td><td>0.79</td><td>3.5</td><td>1.7</td><td>0.90</td><td>6.8</td><td>4.1</td><td>0.78</td></tr><tr><td>RoBERTa</td><td>14.9</td><td>9.2</td><td>0.77</td><td>3.4</td><td>1.8</td><td>0.91</td><td>6.7</td><td>4.2</td><td>0.75</td></tr><tr><td rowspan="4">ATGSL-FUSION</td><td>CNN</td><td>9.6</td><td>9.2</td><td>0.89</td><td>3.4</td><td>2.3</td><td>0.93</td><td>3.1</td><td>6.9</td><td>0.88</td></tr><tr><td>LSTM</td><td>9.4</td><td>9.5</td><td>0.88</td><td>1.7</td><td>2.5</td><td>0.94</td><td>3.2</td><td>6.8</td><td>0.86</td></tr><tr><td>BERT</td><td>10.7</td><td>11.2</td><td>0.83</td><td>2.9</td><td>3.1</td><td>0.92</td><td>4.4</td><td>8.1</td><td>0.82</td></tr><tr><td>RoBERTa</td><td>10.2</td><td>11.7</td><td>0.82</td><td>3.1</td><td>3.3</td><td>0.91</td><td>4.8</td><td>8.4</td><td>0.83</td></tr></table>
|
| 191 |
+
|
| 192 |
+
replacement words due to the semantic uncertainty of generated words and lower semantic similarity.
|
| 193 |
+
|
| 194 |
+
Learning model-based attacks such as ReinforceBug and BBA show that using evaluation history to train the model has advantages in sentence quality and efficiency. ReinforceBug considers the text quality evaluation score in the reward to generate higher quality adversarial texts but cannot guarantee a high attack success rate due to its high variance. BBA reduces time cost but has difficulty in fitting complex target models using evaluation history (BERT, RoBERTa).
|
| 195 |
+
|
| 196 |
+
Our proposed attack algorithms have shown excellent performance in various aspects. Compared to BESA, which also uses the SA algorithm, our ATGSL-SA algorithm has a higher attack success rate and semantic similarity due to its ability to utilize a well-organized linguistic thesaurus and solve the problem of being trapped in local optimal solutions by using acceptance probability $p$ and variable temperature $T$ . We also evaluate semantic consistency and grammar errors to ensure that readers do not change their initial predictions and maintain reading fluency. Our ATGSL-BM algorithm uses a well-trained conditional generative model to
|
| 197 |
+
|
| 198 |
+
Table 4: Time (in seconds) needed in attacking the BERT.
|
| 199 |
+
|
| 200 |
+
<table><tr><td>Dataset</td><td>PWWS</td><td>TFEO</td><td>PSO</td><td>Reinforce-Bug</td><td>BBA</td></tr><tr><td>MR</td><td>6424</td><td>3830</td><td>4532</td><td>3890</td><td>5230</td></tr><tr><td>IMDB</td><td>18371</td><td>9532</td><td>-</td><td>6883</td><td>9872</td></tr><tr><td>AG's News</td><td>7857</td><td>8850</td><td>18531</td><td>9352</td><td>7533</td></tr><tr><td>MNLI</td><td>3171</td><td>2241</td><td>4642</td><td>2327</td><td>2581</td></tr><tr><td>SNLI</td><td>1871</td><td>941</td><td>3842</td><td>1037</td><td>1540</td></tr><tr><td>Dataset</td><td>BEAT</td><td>BESA</td><td>ATGSL-SA</td><td>ATGSL-BM</td><td>ATGSL-FUSION</td></tr><tr><td>MR</td><td>4328</td><td>7641</td><td>8785</td><td>4032</td><td>8327</td></tr><tr><td>IMDB</td><td>19371</td><td>56532</td><td>54132</td><td>8783</td><td>19872</td></tr><tr><td>AG's News</td><td>9691</td><td>17543</td><td>16543</td><td>8583</td><td>15231</td></tr><tr><td>MNLI</td><td>2751</td><td>3450</td><td>4392</td><td>2232</td><td>3573</td></tr><tr><td>SNLI</td><td>1658</td><td>2690</td><td>3213</td><td>1537</td><td>3542</td></tr></table>
|
| 201 |
+
|
| 202 |
+
smooth out noise in the heuristic-defined search target and generate high-quality adversarial texts with lower attack costs. Additionally, ATGSL-FUSION has the highest attack success rate since it has the acceptance probability to use the adversarial texts generated by ATGSL-BM as the intermediate solution to avoid being trapped by initial conditions in local optima.
|
| 203 |
+
|
| 204 |
+
Ablation study. In addition, the bottom three rows of Tables 3 and 5 show the effects of ATGSL-SA and ATGSL-BM. These results demonstrate that our algorithms play important roles in semantic similarity and the quality of generated texts, respectively. We also conduct supplementary experiments with HowNet (ATGSL-SA without H), BERT-base (ATGSL-BM without fine-tuning), and other variants to analyze their performance in attack success rate, semantic similarity, runtime, and qrs. It is noticeable that the adversarial samples generated by ATGSL-SA and ATGSL-FUSION have higher semantic similarity, while those generated by ATGSL-BM have fewer grammar errors and higher fluency. During the attack phase, the time consumption and queries of ATGSL-BM are less than other variants. Compared to ATGSL-BM without fine-tuning, our ATGSL-BM has a higher ASR and semantic similarity. Additionally, we investigate how the amount of training data affects the ASR of ATGSL-BM on different datasets. As a result, short text datasets (e.g., MR, SNLI, MNLI) require less data to achieve high ASR than long text datasets (e.g., IMDB, AG's News). Please refer to Fig. 2 in Appendix D.2 for more details.
|
| 205 |
+
|
| 206 |
+
# 5.3 Human Evaluation
|
| 207 |
+
|
| 208 |
+
To validate and assess the quality of adversarial samples, we randomly sample 200 adversarial examples targeting LSTM on the MR dataset and targeting BERT on the SNLI dataset. Human judges were asked to evaluate the text similarity and gram
|
| 209 |
+
|
| 210 |
+
Table 5: The analysis for all variants to attack the BERT model on MR. Qrs is the average number of queries.
|
| 211 |
+
|
| 212 |
+
<table><tr><td>Dataset</td><td>Methods</td><td>ASR</td><td>%S</td><td>Time</td><td>Qrs</td></tr><tr><td rowspan="6">MR</td><td>ATGSL-SA (w/o H)</td><td>89.6%</td><td>0.89</td><td>7854</td><td>79</td></tr><tr><td>ATGSL-SA</td><td>94.1%</td><td>0.85</td><td>8785</td><td>72</td></tr><tr><td>ATGSL-BM (w/o fine-tune)</td><td>86.3%</td><td>0.63</td><td>4848</td><td>63</td></tr><tr><td>ATGSL-BM (training process)</td><td>97.4%</td><td>0.79</td><td>19652</td><td>55</td></tr><tr><td>ATGSL-BM (attack process)</td><td></td><td></td><td>4032</td><td>43</td></tr><tr><td>ATGSL-FUSION</td><td>98.9%</td><td>0.83</td><td>8327</td><td>87</td></tr></table>
|
| 213 |
+
|
| 214 |
+

|
| 215 |
+
Figure 1: As more adversarial samples increase, the improvement in accuracy after ATGSL-SA and ATGSL-FUSION attacks is demonstrated.
|
| 216 |
+
|
| 217 |
+

|
| 218 |
+
|
| 219 |
+
matical correctness of the adversarial text generated by our method. As shown in Table 10, our method achieves higher scores in both text similarity and grammatical correctness. For more analysis of the results, please refer to Appendix D.4.
|
| 220 |
+
|
| 221 |
+
# 5.4 Adversarial Training
|
| 222 |
+
|
| 223 |
+
For adversarial training, we generate adversarial examples using $10\%$ of samples from the IMDB and SNLI datasets' training sets. We then combine the generated adversarial examples with the original training sets of our respective datasets and retrain BERT. We then use our attack strategy to attack BERT again. Results are shown in Fig. 1. After the attack, the accuracy rate is increased by $15\%$ to $35\%$ . This indicates that adding adversarial samples to the training data makes the target model more robust to attacks.
|
| 224 |
+
|
| 225 |
+
# 5.5 Transferability
|
| 226 |
+
|
| 227 |
+
If an adversarial example is generated for a specific target model but also successfully attacks other target models, it is called a transferable example. We evaluate the transferability of adversarial attacks generated on the Ag's News dataset (Kurakin et al., 2018). The results are shown in Table 6. In Transfer-1, compared to previous attacks, our attack produces adversarial examples with a higher attack success rate, demonstrating better transferability. In addition, we conduct our experiments on the same binary sentiment classification datasets (MR, IMDB) in Transfer-2. Our ATGL-SB still
|
| 228 |
+
|
| 229 |
+
Table 6: Transfer-1: The ASR of transferred adversarial examples on the AG's New. Transfer-2: Transfer results of ATGSL-BM model with the same emotion classification task. Higher ASR reflects higher transferability.
|
| 230 |
+
|
| 231 |
+
<table><tr><td>Transfer-1</td><td>PSO</td><td>BEAT</td><td>BESA</td><td>ATGSL-FUSION</td></tr><tr><td>CNN→BERT</td><td>68.5%</td><td>72.3%</td><td>74.9%</td><td>80.5%</td></tr><tr><td>BERT→CNN</td><td>72.4%</td><td>75.5%</td><td>76.3%</td><td>84.4%</td></tr><tr><td>Transfer-2</td><td>CNN</td><td>LSTM</td><td>BERT</td><td>RoBERTa</td></tr><tr><td>IMDB→MR</td><td>92.3%</td><td>89.5%</td><td>85.4%</td><td>84.7%</td></tr><tr><td>MR→IMDB</td><td>90.8%</td><td>87.7%</td><td>84.4%</td><td>85.3%</td></tr></table>
|
| 232 |
+
|
| 233 |
+
maintains a high attack success rate, demonstrating that our attack algorithm using fine-tuned pretrained models has strong cross-dataset transferability.
|
| 234 |
+
|
| 235 |
+
# 6 Case Study
|
| 236 |
+
|
| 237 |
+
Tables 13 and 14 in Appendix D.5 show examples generated by BERT-ATTACK, PSO, ATGSL-SA, ATGSL-BM, and ATGSL-FUSION on the IMDB and SNLI datasets. The results indicate that our approaches exhibit better performance in terms of attack efficiency and text quality. For more analysis of the results, please refer to Appendix D.5.
|
| 238 |
+
|
| 239 |
+
# 7 Conclusion
|
| 240 |
+
|
| 241 |
+
In this paper, we introduced ATGSL, a new attack framework with three algorithms that balance attack efficiency and adversarial sample quality. ATGSL-SA used Simulated Annealing to search for similar adversarial texts. ATGSL-BM finetuned a pre-trained language model (BERT-MLM) to improve attack effectiveness and text quality. ATGSL-FUSION addressed the ATGSL-SA algorithm's susceptibility to initial conditions by using a trained language model to generate intermediate solutions. Our experiments show superior attack performance compared to baseline methods while maintaining a balance between attack performance and text quality.
|
| 242 |
+
|
| 243 |
+
# Limitations
|
| 244 |
+
|
| 245 |
+
Although we can see that ATGSL-BM has achieved a new state-of-the-art level and performed well on short text datasets (MR, SNLI, MNLI) while maintaining high attack efficiency at low cost, its performance on long text datasets (IMDB, AG's News) is not as good as ATGSL-SA. As shown in Figure 3, this is due to insufficient training data. Even if we can generate enough training samples from limited test data (multiple attacks), we cannot enrich
|
| 246 |
+
|
| 247 |
+
the variety of training samples. Our future work is to further learn more knowledge from successful or failed adversarial samples using self-supervised learning. On the other hand, the fine-tuning of the pre-trained text generator model used the typical BERT-MLM. On the other hand, the fine-tuning of the pre-trained text generator model used the typical BERT-MLM. In future work, we will continue to explore the expandability of our proposed attack framework by trying to integrate it with more popular pre-trained models, which is a key focus of our future work.
|
| 248 |
+
|
| 249 |
+
# Broader Ethical Impact
|
| 250 |
+
|
| 251 |
+
Our research focuses on the important problem of adversarial vulnerabilities of classification models on discrete sequential data. Even though it is possible that a malicious adversary misusing ATGSL to attack public text classification APIs, we believe our research can be a basis for the improvement in defending against adversarial attacks on discrete sequential data.
|
| 252 |
+
|
| 253 |
+
# ACKNOWLEDGEMENTS
|
| 254 |
+
|
| 255 |
+
This work is funded by the National Key R&D Program of China (2022YFB3103700, 2022YFB3103704)
|
| 256 |
+
|
| 257 |
+
# References
|
| 258 |
+
|
| 259 |
+
Moustafa Alzantot, Yash Sharma, Ahmed Elgohary, Bo-Jhang Ho, Mani Srivastava, and Kai-Wei Chang. 2018. Generating natural language adversarial examples. arXiv preprint arXiv:1804.07998.
|
| 260 |
+
Yonatan Belinkov and Yonatan Bisk. 2017. Synthetic and natural noise both break neural machine translation. arXiv preprint arXiv:1711.02173.
|
| 261 |
+
Emily M Bender and Alexander Koller. 2020. Climbing towards nlu: On meaning, form, and understanding in the age of data. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5185-5198.
|
| 262 |
+
Samuel R Bowman, Gabor Angeli, Christopher Potts, and Christopher D Manning. 2015. A large annotated corpus for learning natural language inference. arXiv preprint arXiv:1508.05326.
|
| 263 |
+
Daniel Cer, Yinfei Yang, Sheng-yi Kong, Nan Hua, Nicole Limtiaco, Rhomni St John, Noah Constant, Mario Guajardo-Cespedes, Steve Yuan, Chris Tar, et al. 2018. Universal sentence encoder. arXiv preprint arXiv:1803.11175.
|
| 264 |
+
|
| 265 |
+
Qian Chen, Xiaodan Zhu, Zhenhua Ling, Si Wei, Hui Jiang, and Diana Inkpen. 2016. Enhanced LSTM for natural language inference. arXiv preprint arXiv:1609.06038.
|
| 266 |
+
Alexis Conneau, Douwe Kiela, Holger Schwenk, Loic Barrault, and Antoine Bordes. 2017. Supervised learning of universal sentence representations from natural language inference data. arXiv preprint arXiv:1705.02364.
|
| 267 |
+
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.
|
| 268 |
+
Zhendong Dong and Qiang Dong. 2006. Hownet and the computation of meaning (with Cd-rom). World Scientific.
|
| 269 |
+
Javid Ebrahimi, Anyi Rao, Daniel Lowd, and De- jing Dou. 2017. Hotflip: White-box adversarial examples for text classification. arXiv preprint arXiv:1712.06751.
|
| 270 |
+
Steffen Eger, Gözde Gül Şahin, Andreas Rücklé, Ji-Ung Lee, Claudia Schulz, Mohsen Mesgar, Krishnkant Swarnkar, Edwin Simpson, and Iryna Gurevych. 2019. Text processing like humans do: Visually attacking and shielding nlp systems. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 1634-1647.
|
| 271 |
+
Jules Gagnon-Marchand, Hamed Sadeghi, Md Akmal Haidar, and Mehdi Rezagholizadeh. 2019. Salsa-text: self attentive latent space based adversarial text generation. In Advances in Artificial Intelligence: 32nd Canadian Conference on Artificial Intelligence, Canadian AI 2019, Kingston, ON, Canada, May 28-31, 2019, Proceedings 32, pages 119-131. Springer.
|
| 272 |
+
Ji Gao, Jack Lanchantin, Mary Lou Soffa, and Yanjun Qi. 2018. Black-box generation of adversarial text sequences to evade deep learning classifiers. In 2018 IEEE Security and Privacy Workshops (SPW), pages 50-56. IEEE.
|
| 273 |
+
Siddhant Garg and Goutham Ramakrishnan. 2020. Bae: Bert-based adversarial examples for text classification. arXiv preprint arXiv:2004.01970.
|
| 274 |
+
Vincent Granville, Mirko Krivánek, and J-P Rasson. 1994. Simulated annealing: A proof of convergence. IEEE transactions on pattern analysis and machine intelligence, 16(6):652-656.
|
| 275 |
+
Darrall Henderson, Sheldon H Jacobson, and Alan W Johnson. 2003. The theory and practice of simulated annealing. Handbook of metaheuristics, pages 287-319.
|
| 276 |
+
Sepp Hochreiter and Jürgen Schmidhuber. 1997. Long short-term memory. Neural computation, 9(8):1735-1780.
|
| 277 |
+
|
| 278 |
+
Kentaro Inui, Jing Jiang, Vincent Ng, and Xiaojun Wan. 2019. Proceedings of the 2019 conference on empirical methods in natural language processing and the 9th international joint conference on natural language processing (emnlp-ijcnlp). 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).
|
| 279 |
+
Mohit Iyyer, John Wieting, Kevin Gimpel, and Luke Zettlemoyer. 2018. Adversarial example generation with syntactically controlled paraphrase networks. arXiv preprint arXiv:1804.06059.
|
| 280 |
+
Robin Jia and Percy Liang. 2017. Adversarial examples for evaluating reading comprehension systems. arXiv preprint arXiv:1707.07328.
|
| 281 |
+
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.
|
| 282 |
+
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.
|
| 283 |
+
Diederik P Kingma and Max Welling. 2013. Autoencoding variational bayes. arXiv preprint arXiv:1312.6114.
|
| 284 |
+
Scott Kirkpatrick, C Daniel Gelatt Jr, and Mario P Vecchi. 1983. Optimization by simulated annealing. science, 220(4598):671-680.
|
| 285 |
+
Dhruv Kumar, Lili Mou, Lukasz Golab, and Olga Vechtomova. 2020. Iterative edit-based unsupervised sentence simplification. arXiv preprint arXiv:2006.09639.
|
| 286 |
+
Alexey Kurakin, Ian J Goodfellow, and Samy Bengio. 2018. Adversarial examples in the physical world. In Artificial intelligence safety and security, pages 99-112. Chapman and Hall/CRC.
|
| 287 |
+
Deokjae Lee, Seungyong Moon, Junhyeok Lee, and Hyun Oh Song. 2022. Query-efficient and scalable black-box adversarial attacks on discrete sequential data via bayesian optimization. In International Conference on Machine Learning, pages 12478-12497. PMLR.
|
| 288 |
+
Jingjing Li, Zichao Li, Lili Mou, Xin Jiang, Michael Lyu, and Irwin King. 2020a. Unsupervised text generation by learning from search. Advances in Neural Information Processing Systems, 33:10820-10831.
|
| 289 |
+
Linyang Li, Ruotian Ma, Qipeng Guo, Xiangyang Xue, and Xipeng Qiu. 2020b. Bert-attack: Adversarial attack against bert using bert. arXiv preprint arXiv:2004.09984.
|
| 290 |
+
|
| 291 |
+
Xianggen Liu, Lili Mou, Fandong Meng, Hao Zhou, Jie Zhou, and Sen Song. 2019a. Unsupervised paraphrasing by simulated annealing. arXiv preprint arXiv:1909.03588.
|
| 292 |
+
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.
|
| 293 |
+
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.
|
| 294 |
+
Vijit Malik, Ashwani Bhat, and Ashutosh Modi. 2021. Adv-olm: Generating textual adversaries via olm. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 841-849.
|
| 295 |
+
Ning Miao, Hao Zhou, Lili Mou, Rui Yan, and Lei Li. 2019. Cgmh: Constrained sentence generation by metropolis-hastings sampling. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 6834-6842.
|
| 296 |
+
George A Miller. 1998. WordNet: An electronic lexical database. MIT press.
|
| 297 |
+
Timothy Niven and Hung-Yu Kao. 2019. Probing neural network comprehension of natural language arguments. arXiv preprint arXiv:1907.07355.
|
| 298 |
+
Bo Pang and Lillian Lee. 2005. Seeing stars: Exploiting class relationships for sentiment categorization with respect to rating scales. arXiv preprint cs/0506075.
|
| 299 |
+
Nicolas Papernot, Patrick McDaniel, Somesh Jha, Matt Fredrikson, Z Berkay Celik, and Ananthram Swami. 2016a. The limitations of deep learning in adversarial settings. In 2016 IEEE European symposium on security and privacy (EuroS&P), pages 372-387. IEEE.
|
| 300 |
+
Nicolas Papernot, Patrick McDaniel, Ananthram Swami, and Richard Harang. 2016b. Crafting adversarial input sequences for recurrent neural networks. In MILCOM 2016-2016 IEEE Military Communications Conference, pages 49-54. IEEE.
|
| 301 |
+
Danish Pruthi, Bhuwan Dhingra, and Zachary C Lipton. 2019. Combating adversarial misspellings with robust word recognition. arXiv preprint arXiv:1905.11268.
|
| 302 |
+
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.
|
| 303 |
+
|
| 304 |
+
Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. 2018. Semantically equivalent adversarial rules for debugging nlp models. In Annual Meeting of the Association for Computational Linguistics (ACL).
|
| 305 |
+
|
| 306 |
+
Bushra Sabir, Muhammad Ali Babar, and Raj Gaire. 2021. Reinforcebug: A framework to generate adversarial textual examples. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 5954-5964.
|
| 307 |
+
|
| 308 |
+
Raphael Schumann, Lili Mou, Yao Lu, Olga Vechtomova, and Katja Markert. 2020. Discrete optimization for unsupervised sentence summarization with word-level extraction. arXiv preprint arXiv:2005.01791.
|
| 309 |
+
|
| 310 |
+
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.
|
| 311 |
+
|
| 312 |
+
Zheng Wang. 2018. Deep learning-based intrusion detection with adversaries. IEEE Access, 6:38367-38384.
|
| 313 |
+
|
| 314 |
+
Adina Williams, Nikita Nangia, and Samuel R Bowman. 2017. A broad-coverage challenge corpus for sentence understanding through inference. arXiv preprint arXiv:1704.05426.
|
| 315 |
+
|
| 316 |
+
Xinghao Yang, Weifeng Liu, James Bailey, Dacheng Tao, and Wei Liu. 2021a. Bigram and unigram based text attack via adaptive monotonic heuristic search. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 706-714.
|
| 317 |
+
|
| 318 |
+
Xinghao Yang, Weifeng Liu, Dacheng Tao, and Wei Liu. 2021b. Besa: Bert-based simulated annealing for adversarial text attacks. In International Joint Conference on Artificial Intelligence.
|
| 319 |
+
|
| 320 |
+
Yuan Zang, Bairu Hou, Fanchao Qi, Zhiyuan Liu, Xiaojun Meng, and Maosong Sun. 2020a. Learning to attack: Towards textual adversarial attacking in real-world situations. arXiv preprint arXiv:2009.09192.
|
| 321 |
+
|
| 322 |
+
Yuan Zang, Fanchao Qi, Chenghao Yang, Zhiyuan Liu, Meng Zhang, Qun Liu, and Maosong Sun. 2020b. Word-level textual adversarial attacking as combinatorial optimization. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 6066-6080.
|
| 323 |
+
|
| 324 |
+
Guoyang Zeng, Fanchao Qi, Qianrui Zhou, Tingji Zhang, Zixian Ma, Bairu Hou, Yuan Zang, Zhiyuan Liu, and Maosong Sun. 2021. Openattack: An open-source textual adversarial attack 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 363-371.
|
| 325 |
+
|
| 326 |
+
Xiang Zhang, Junbo Zhao, and Yann LeCun. 2015. Character-level convolutional networks for text classification. Advances in neural information processing systems, 28.
|
| 327 |
+
|
| 328 |
+
Zhengli Zhao, Dheeru Dua, and Sameer Singh. 2017. Generating natural adversarial examples. arXiv preprint arXiv:1710.11342.
|
| 329 |
+
|
| 330 |
+
# A The Details of ATGLS-SA Algorithm.
|
| 331 |
+
|
| 332 |
+
The search process of ATGSL-SA can be divided into the following steps:
|
| 333 |
+
|
| 334 |
+
(1) At first, the algorithm randomly selects a replacement word and calculates a new $s(\mathbf{Y}_{\text{true}}|\mathbf{X}_{\text{new}})$ .
|
| 335 |
+
(2) Judging based on Metropolis criteria: when $s(\mathbf{Y}_{ture}|\mathbf{X}_{new}) < s(\mathbf{Y}_{true}|\mathbf{X})$ , update $\mathbf{X}$ to $\mathbf{X}_{new}$ . When $s(\mathbf{Y}_{true}|\mathbf{X}_{new}) > s(\mathbf{Y}_{true}|\mathbf{X}_{adv})$ , calculate the probability $p$ in the line 14 of Algorithm 1:
|
| 336 |
+
|
| 337 |
+
$$
|
| 338 |
+
p ^ {\prime} = e ^ {- \left(s \left(\mathbf {Y} _ {t r u e} \mid \mathbf {X} _ {n e w}\right) - s \left(\mathbf {Y} _ {t r u e} \mid \mathbf {X} _ {a d v}\right)\right) / T _ {0}}, \tag {9}
|
| 339 |
+
$$
|
| 340 |
+
|
| 341 |
+
take a random number $r$ $(0 < r < 1)$ , update the $\mathbf{X}_{adv}$ to the $\mathbf{X}_{new}$ when $r < p$ . It is not difficult to find that the probability of accepting $\mathbf{X}_{new}$ increases as temperature increases. After modification, if the classifier $\mathbf{F}$ is misled, we obtain the successfully attacked adversarial sample.
|
| 342 |
+
|
| 343 |
+
(3) Conduct a cooling:
|
| 344 |
+
|
| 345 |
+
$$
|
| 346 |
+
T _ {0} ^ {\prime} = T _ {i n i t} - \frac {t}{T} \left(S e m \left(\mathbf {X} _ {a d v} - S e m \left(\mathbf {X} _ {n e w}\right)\right)\right) - C \times t. \tag {10}
|
| 347 |
+
$$
|
| 348 |
+
|
| 349 |
+
If the $\mathbf{X}_{\mathrm{new}}$ semantic similarity score is higher, then temperature increases. This design can prevent the SA algorithm from entering the optimal local solution early. Then, turn to step 1, repeat multiple times, and the result tends to be stabilized.
|
| 350 |
+
|
| 351 |
+
# B Details of ATGS-BM Training Process
|
| 352 |
+
|
| 353 |
+
Fig. 2 and Algorithm 2 illustrates how the condition generator of ATGSL-BM learns from the search results of ATGSL-SA.
|
| 354 |
+
|
| 355 |
+
# C Experiment Implementation Details
|
| 356 |
+
|
| 357 |
+
# C.1 Datasets
|
| 358 |
+
|
| 359 |
+
To show the wide applicability of ATGSL, we evaluate ATGSL on various datasets for classification tasks textual entailment.
|
| 360 |
+
|
| 361 |
+

|
| 362 |
+
|
| 363 |
+

|
| 364 |
+
Figure 2: The diagram of ATGS-BM training process.
|
| 365 |
+
|
| 366 |
+
# Algorithm 2: The Trained BERT-MLM
|
| 367 |
+
|
| 368 |
+
Input: Sample text $\mathbf{X}$ target model F
|
| 369 |
+
|
| 370 |
+
Output: A fine-tuned BERT-MLM model
|
| 371 |
+
|
| 372 |
+
1 $\mathbf{RR}^{(\mathrm{SA})}\gets \{\}$ // Pseudo-reference set is initially an empty set; // Generate adversarial samples as pseudo-reference for training;
|
| 373 |
+
2 for an input $x_{i} \subset \mathbf{X}$ do
|
| 374 |
+
3 $s_i^{(\mathrm{SA})} = \mathrm{ATGSL - SA}(x_i,x_i,\mathbf{C}_i,\mathbf{F})$ // ATGSL-SA is detailed in Algorithm 1;
|
| 375 |
+
4 $\mathbf{RR}^{(\mathrm{SA})}\gets \mathbf{RR}^{(\mathrm{SA})}\cup s_i^{(\mathrm{SA})};$
|
| 376 |
+
5 for all epochs do
|
| 377 |
+
6 Fine-tune BERT-MLM by cross-entropy loss with pseudo-reference set $\mathbf{RR}^{(\mathrm{SA})}$ and its masked text $\mathbf{RR}_{mask}^{(\mathrm{SA})}$ , conditioned on its origin text $\mathbf{X}$ ;
|
| 378 |
+
|
| 379 |
+
Return: Resulting the well-trained BERT-MLM
|
| 380 |
+
|
| 381 |
+
- AG's News (Zhang et al., 2015): A sentence-level dataset for classifying news-type sentences into 4 topics: World, Sports, Business, and Science.
|
| 382 |
+
- Movie Reviews (Pang and Lee, 2005): A sentence-level sentiment classification dataset composed of positive and negative movie reviews from Rotten Tomatoes.
|
| 383 |
+
- IMDB Polarity (Maas et al., 2011): A document-level dataset for binary sentiment classification composed of polar movie reviews from IMDB.
|
| 384 |
+
- MNLI matched (Williams et al., 2017): A textual entailment dataset composed of sentence
|
| 385 |
+
|
| 386 |
+
pairs from transcribed speeches, popular fiction, and government reports. The task is to determine the relationship between a pair of concepts, premises, and hypotheses. The test set and training set are derived from the same sources.
|
| 387 |
+
|
| 388 |
+
- SNLI (Bowman et al., 2015): A dataset composed of 570K sentence pairs derived from image captions. The task is to determine the relationship between two sentences: whether the second sentence can be derived from the first sentence's implication, contradiction, or neutral relationship.
|
| 389 |
+
|
| 390 |
+
# C.2 Baselines
|
| 391 |
+
|
| 392 |
+
We compare the performance of ATGSL against the state-of-the-art methods as follow: (1) PWWS (Ren et al., 2019): A method chooses candidate words from WordNet and sorts word attack order by multiplying the word saliency and probability variation. (2) TextFooler (TEFO) (Jin et al., 2020): A method obtains synonyms close to the original word from the Glove space, and the word selection priority is determined by iteratively deleting input words and calculating the DNNs score changes. (3) PSO (Zang et al., 2020b): A method selects word candidates from HowNet and employs the PSO to find adversarial texts. (4) ReinforceBug (Sabir et al., 2021): A reinforced model that directly utilizes the prediction confidence score of the adversarial text in the target model and the sentence quality score as feedback to optimize the ef
|
| 393 |
+
|
| 394 |
+
fect of the attack. (5) BERT-ATTACK (BEAT) (Li et al., 2020b): A method utilizes the BERT-MLM to generate candidate words and attack words in descending order with the static word importance score. (6) BESA (Yang et al., 2021b): A method leverages the BERT to generate candidate words and employs Simulated Annealing (SA) to determine the word substitution order adaptively. (7) BBA (Lee et al., 2022): A Bayesian optimized black-box attack method that dynamically calculates replacement positions based on query history dynamics and automatic correlation determination (ARD) classification rules.
|
| 395 |
+
|
| 396 |
+
We implement PWWS, PSO, TEFO and BEAT models using Open Source Framework (Zeng et al., 2021), and ReinforceBug, BESA, BBA and our method with Pytorch. To make a fair comparison, we set the upper bound of the number of replacing words as $M = 20$ . Our method gives the parameter settings in line 1 of Algorithm 1 and Algorithm 2. In ATGSL-BM, we set $\{t,k\} = \{2,10\}$ . Moreover, in each dataset, we randomly select 5k test samples for multiple iterations to craft 40k attack successful adversarial samples for the training process. Finally, 1k test samples that the model has not seen before were selected as test data for the attack experiment.
|
| 397 |
+
|
| 398 |
+
# D Additional Experiment Results
|
| 399 |
+
|
| 400 |
+
# D.1 Original Accuracy of Various Datasets.
|
| 401 |
+
|
| 402 |
+
For each dataset, we train four state-of-the-art models on the training set and obtain test set accuracy scores similar to the original implementations, as shown in Table 7.
|
| 403 |
+
|
| 404 |
+
Table 7: Test accuracy of five datasets before attacks.
|
| 405 |
+
|
| 406 |
+
<table><tr><td>Model</td><td>MR</td><td>IMDB</td><td>AG's News</td><td>Model</td><td>MNLI</td><td>SNLI</td></tr><tr><td>CNN</td><td>78.3%</td><td>83.2%</td><td>90.9%</td><td>InferSent</td><td>70.6%</td><td>84.3%</td></tr><tr><td>LSTM</td><td>79.3%</td><td>84.5%</td><td>89.3%</td><td>ESIM</td><td>78.3%</td><td>85.6%</td></tr><tr><td>BERT</td><td>86.5%</td><td>92.3%</td><td>93.3%</td><td>BERT</td><td>84.4%</td><td>88.1%</td></tr><tr><td>Roberta</td><td>87.1%</td><td>93.5%</td><td>94.1%</td><td>RoBERTa</td><td>86.7%</td><td>89.5%</td></tr></table>
|
| 407 |
+
|
| 408 |
+
# D.2 Effect of Training Amount
|
| 409 |
+
|
| 410 |
+
As shown in Fig. 3, we found that short text datasets (e.g., MR, SNLI, MNLI) require less data to achieve high ASR, while long text datasets (e.g., IMDB, AG's News) need more data for the same purpose.
|
| 411 |
+
|
| 412 |
+

|
| 413 |
+
Figure 3: Effect of different amounts of training data on the ATGSL-BM.
|
| 414 |
+
|
| 415 |
+
# D.3 Character-level adversarial text generation
|
| 416 |
+
|
| 417 |
+
While our method is based on word-level adversarial text generation techniques, it's worth noting that our search-based learning framework is equally applicable to character-level adversarial text generation. Hence, we have incorporated comparative experiments involving character-level adversarial text generation. The baselines we refer to are:
|
| 418 |
+
|
| 419 |
+
- DeepWordBug(Gao et al., 2018): A character-level adversarial attack algorithm based on the differential evolution technique, introducing subtle character-level perturbations to generate adversarial text that leads to erroneous outputs from natural language processing models.
|
| 420 |
+
- PWWS(Ren et al., 2019): An attack algorithm utilizing white-box strategy, generating adversarial text through subtle character replacements, insertions, and deletions to mislead the classification output of natural language processing models.
|
| 421 |
+
|
| 422 |
+
Table 8: Classification accuracy on disturbed datasets using different attack methods. The third column represents the classification accuracy of the model for the original samples. Lower classification accuracy corresponds to more effective attack methods.
|
| 423 |
+
|
| 424 |
+
<table><tr><td>Datasets</td><td>Model</td><td>Original</td><td>DeepWordBug</td><td>PWWS</td><td>ATGSL-SA</td><td>ATGSL-BM</td><td>ATGSL-FUSION</td></tr><tr><td rowspan="4">MR</td><td>CharCNN</td><td>77.9%</td><td>27.8%</td><td>25.4%</td><td>20.8%</td><td>19.7%</td><td>17.8%</td></tr><tr><td>LSTM</td><td>77.3%</td><td>28.6%</td><td>25.2%</td><td>21.7%</td><td>18.9%</td><td>17.2%</td></tr><tr><td>BERT</td><td>86.5%</td><td>38.3%</td><td>30.2%</td><td>23.8%</td><td>21.3%</td><td>19.3%</td></tr><tr><td>RoBERTa</td><td>87.1%</td><td>37.8%</td><td>31.6%</td><td>23.1%</td><td>22.3%</td><td>19.6%</td></tr><tr><td rowspan="4">Ag's News</td><td>CharCNN</td><td>89.3%</td><td>32.8%</td><td>25.8%</td><td>23.1%</td><td>22.5%</td><td>16.8%</td></tr><tr><td>LSTM</td><td>89.3%</td><td>35.6%</td><td>23.9%</td><td>22.8%</td><td>20.4%</td><td>18.9%</td></tr><tr><td>BERT</td><td>93.5%</td><td>41.3%</td><td>32.7%</td><td>25.8%</td><td>23.5%</td><td>22.1%</td></tr><tr><td>RoBERTa</td><td>94.1%</td><td>43.8%</td><td>33.3%</td><td>25.1%</td><td>23.1%</td><td>22.9%</td></tr></table>
|
| 425 |
+
|
| 426 |
+
From Table 8 and 9, it is evident that at the character-level, our model consistently exhibits re
|
| 427 |
+
|
| 428 |
+
Table 9: Word replacement rate of each attacking method on the selected models.
|
| 429 |
+
|
| 430 |
+
<table><tr><td>Datasets</td><td>Model</td><td>DeepWordBug</td><td>PWWS</td><td>ATGSL-SA</td><td>ATGSL-BM</td><td>ATGSL-FUSION</td></tr><tr><td rowspan="4">MR</td><td>CharCNN</td><td>18.8%</td><td>13.4%</td><td>8.1%</td><td>7.7%</td><td>7.3%</td></tr><tr><td>LSTM</td><td>17.3%</td><td>14.2%</td><td>8.4%</td><td>6.9%</td><td>7.5%</td></tr><tr><td>BERT</td><td>22.1%</td><td>20.7%</td><td>14.7%</td><td>11.4%</td><td>9.3%</td></tr><tr><td>RoBERTa</td><td>22.4%</td><td>19.8%</td><td>15.3%</td><td>12.8%</td><td>9.5%</td></tr><tr><td rowspan="4">Ag's News</td><td>CharCNN</td><td>22.8%</td><td>19.4%</td><td>18.3%</td><td>15.7%</td><td>17.8%</td></tr><tr><td>LSTM</td><td>21.6%</td><td>20.2%</td><td>18.7%</td><td>16.3%</td><td>17.2%</td></tr><tr><td>BERT</td><td>27.3%</td><td>26.7%</td><td>24.7%</td><td>22.4%</td><td>19.3%</td></tr><tr><td>RoBERTa</td><td>26.5%</td><td>26.8%</td><td>23.6%</td><td>22.8%</td><td>18.2%</td></tr></table>
|
| 431 |
+
|
| 432 |
+
Table 10: Human-Evaluation Results.
|
| 433 |
+
|
| 434 |
+
<table><tr><td>Dataset</td><td>Method</td><td>Semantic</td><td>Grammar</td></tr><tr><td rowspan="3">MR</td><td>ATGSL-SA</td><td>0.96</td><td>4.23</td></tr><tr><td>ATGSL-BM</td><td>0.94</td><td>4.68</td></tr><tr><td>ATGSL-FUSION</td><td>0.93</td><td>4.38</td></tr><tr><td rowspan="3">SNLI</td><td>ATGSL-SA</td><td>0.91</td><td>4.43</td></tr><tr><td>ATGSL-BM</td><td>0.88</td><td>4.78</td></tr><tr><td>ATGSL-FUSION</td><td>0.85</td><td>4.57</td></tr></table>
|
| 435 |
+
|
| 436 |
+
remarkable attack efficiency and a reduced word replacement rate. This observation highlights the adaptability and flexibility of our generative strategy across diverse text granularities.
|
| 437 |
+
|
| 438 |
+
# D.4 Details of Human Evaluation
|
| 439 |
+
|
| 440 |
+
In order to evaluate the quality of adversarial examples, we randomly select 200 samples that target LSTM on the MR dataset and BERT on the SNLI dataset. The true class labels of these samples are kept hidden and evaluators are asked to classify them. We find that $95\%$ of adversarial examples in MR and $94\%$ in SNLI have the same classification label as their original samples. In addition, five graduate students majoring in linguistics are provisionally recruited to annotate all the users according to their expertise experience. Human judges are asked to score each adversarial example on grammatical correctness and semantic similarity with the original example. They are instructed to score each example from 1 to 5 based on grammatical correctness and assign a score of 0, 0.5, or 1 for semantic similarity, following the practice of (Gagnon-Marchand et al., 2019; Jin et al., 2020). The results are shown in Table 10. Clearly, human judges find that the adversarial texts generated by ATGSL-BM have higher grammatical correctness. Additionally, they find that ATGSL-SA and ATGSL-BM, which utilize linguistic thesaurus (e.g., WordNet and HowNet), have higher semantic similarity.
|
| 441 |
+
|
| 442 |
+
Additionally, in Table 11 we will augment the comparative results between ATGSL and the base
|
| 443 |
+
|
| 444 |
+
line methods within the context of human assessments, as well as emphasize the label-preserving proficiency of ATGSL.
|
| 445 |
+
|
| 446 |
+
For each adversarial example, we have solicited human evaluators to assign scores based on three distinct aspects: label correctness, syntactic accuracy, and semantic similarity when compared to the original exemplar. The abbreviation "Acc" indicates the conformity of the adversarial sample to its original classification. Additionally, grammatical correctness score is evaluated on a scale from 1 to 5, where:
|
| 447 |
+
|
| 448 |
+
- Level 1: Text contains severe grammatical errors, rendering comprehension difficult.
|
| 449 |
+
- Level 2: Text exhibits multiple grammatical errors, impacting understanding.
|
| 450 |
+
- Level 3: Text features minor grammatical errors, but remains intelligible overall.
|
| 451 |
+
- Level 4: Text is essentially devoid of grammatical errors, flowing smoothly and comprehensibly.
|
| 452 |
+
- Level 5: Text is devoid of conspicuous grammatical errors, demonstrating exceptionally high grammatical precision.
|
| 453 |
+
|
| 454 |
+
Furthermore, semantic similarity is gauged through the allocation of scores, with values of 0, 0.5, and 1, as follows:
|
| 455 |
+
|
| 456 |
+
- 0: Generated text diverges significantly from the original text, with minimal shared semantics or themes.
|
| 457 |
+
- 0.5: Some resemblance of similarity exists between the generated text and the original text, yet notable differences persist.
|
| 458 |
+
- 1: The generated text closely mirrors the original text, exhibiting a high degree of semantic and thematic consistency.
|
| 459 |
+
|
| 460 |
+
As shown in Table 11, it is evident that human evaluators have observed a higher degree of syntactic accuracy in the adversarial texts generated by our approach, particularly ATGSL-BM, compared to alternative methods (PWWS, PSO). Additionally, the utilization of linguistic lexicons such as WordNet and HowNet in ATGSL-SA has been found to result in enhanced semantic similarity.
|
| 461 |
+
|
| 462 |
+
Table 11: Human-Evaluation Results.
|
| 463 |
+
|
| 464 |
+
<table><tr><td>Datasets</td><td>Method</td><td>Accuracy</td><td>Semantic</td><td>Grammar</td></tr><tr><td rowspan="5">MR</td><td>PWWS</td><td>0.79</td><td>0.81</td><td>3.81</td></tr><tr><td>BEAT</td><td>0.74</td><td>0.72</td><td>4.39</td></tr><tr><td>ATGSL-SA</td><td>0.90</td><td>0.96</td><td>4.23</td></tr><tr><td>ATGSL-BM</td><td>0.93</td><td>0.94</td><td>4.68</td></tr><tr><td>ATGSL-FUSION</td><td>0.96</td><td>0.93</td><td>4.38</td></tr><tr><td rowspan="5">SNLI</td><td>PWWS</td><td>0.73</td><td>0.83</td><td>4.14</td></tr><tr><td>BEAT</td><td>0.71</td><td>0.67</td><td>4.54</td></tr><tr><td>ATGSL-SA</td><td>0.89</td><td>0.91</td><td>4.43</td></tr><tr><td>ATGSL-BM</td><td>0.86</td><td>0.86</td><td>4.78</td></tr><tr><td>ATGSL-FUSION</td><td>0.91</td><td>0.91</td><td>4.57</td></tr></table>
|
| 465 |
+
|
| 466 |
+
Moreover, our method demonstrates superior accuracy in correctly categorizing texts, highlighting its strengthened label-preserving capability.
|
| 467 |
+
|
| 468 |
+
We also provide the attack success rate (ASR) under different similarities and label consistencies. We classify adversarial examples generated by our proposed method as follows: high similarity and human judgment of the same category (HS), high similarity and inconsistent label (HI), low similarity and human judgment of the same category (LS), low similarity and inconsistent labels (LI).
|
| 469 |
+
|
| 470 |
+
For our ATGSL-SA on the MR dataset, targeting the BERT model, we achieved an Attack Success Rate (ASR) of $94.1\%$ , with a total of 814 successfully attacked samples. The distribution across our four categories is as follows: HS:HI:LS:LI = 773:32:24:6.
|
| 471 |
+
|
| 472 |
+
Taking the MR dataset and BERT as the target model as an example, the attack success rate (ASR) for ATGSL-SA in high-similarity adversarial examples is calculated as follows: $\mathrm{ASR} = \mathrm{HS} / (\mathrm{HS} + \mathrm{HI}) = 773 / (773 + 32) \approx 0.960$ . In low-similarity adversarial examples, the ASR is calculated as $\mathrm{ASR} = \mathrm{LS} / (\mathrm{LS} + \mathrm{LI}) = 24 / (24 + 6) = 0.8$ .
|
| 473 |
+
|
| 474 |
+
For our ATGSL-BM on the MR dataset, targeting the BERT model, we achieved an ASR of $97.4\%$ with a total of 842 successfully attacked samples. The distribution across the four categories is as follows: HS:HI:LS:LI = 744:28:58:12. For ATGSL-BM, in high-similarity adversarial examples, the ASR is calculated as $\mathrm{ASR} = \mathrm{HS} / (\mathrm{HS} + \mathrm{HI}) = 744 / (744 + 28) \approx 0.963$ . In low-similarity adversarial examples, the ASR is calculated as $\mathrm{ASR} = \mathrm{LS} / (\mathrm{LS} + \mathrm{LI}) = 24 / (24 + 6) \approx 0.967$ .
|
| 475 |
+
|
| 476 |
+
These results illustrate the effectiveness of the adversarial attack methods under consideration, with slightly higher ASR values for ATGSL-BM in both high and low-similarity adversarial examples compared to ATGSL-SA.
|
| 477 |
+
|
| 478 |
+
Table 12: The attack success rate (ASR) in high/low semantic similarity
|
| 479 |
+
|
| 480 |
+
<table><tr><td>Datasets</td><td>Method</td><td>ASR(High Semantic)</td><td>ASR(Low Semantic)</td></tr><tr><td rowspan="5">MR</td><td>PWWS</td><td>0.81</td><td>0.73</td></tr><tr><td>BEAT</td><td>0.83</td><td>0.84</td></tr><tr><td>ATGSL-SA</td><td>0.96</td><td>0.80</td></tr><tr><td>ATGSL-BM</td><td>0.96</td><td>0.97</td></tr><tr><td>ATGSL-FUSION</td><td>0.97</td><td>0.93</td></tr><tr><td rowspan="5">SNLI</td><td>PWWS</td><td>0.84</td><td>0.80</td></tr><tr><td>BEAT</td><td>0.88</td><td>0.86</td></tr><tr><td>ATGSL-SA</td><td>0.94</td><td>0.87</td></tr><tr><td>ATGSL-BM</td><td>0.95</td><td>0.95</td></tr><tr><td>ATGSL-FUSION</td><td>0.98</td><td>0.93</td></tr></table>
|
| 481 |
+
|
| 482 |
+
As observed from the Table 12, our approach demonstrates outstanding performance in both high and low similarity categories. For heuristic-based algorithms like PWWS and ATGS-SA, they excel in generating adversarial samples with high similarity, primarily relying on synonym replacement. Consequently, the attack effectiveness is better in high similarity cases. This can be attributed to the inclusion of similarity scores in the objective and cooling functions of ATGS-SA. The objective is to slightly sacrifice similarity to achieve a broader search space in cases of continuous attack failures. This explains the drop in similarity in lower similarity categories, where ASR may decrease.
|
| 483 |
+
|
| 484 |
+
On the other hand, ATGS-BM and BEAT are language model-based methods and are less sensitive to the similarity of adversarial samples compared to heuristic algorithms. Therefore, they perform well in both categories. However, ATGS-BM generates a significantly higher number of high similarity adversarial samples compared to BEAT.
|
| 485 |
+
|
| 486 |
+
# D.5 Details of Case Study
|
| 487 |
+
|
| 488 |
+
Tables 13 and 14 show examples generated by BERT-ATTACK, PSO, ATGSL-SA, ATGSL-BM, and ATGSL-FUSION on the IMDB and SNLI datasets. Compared to ATGSL, although PSO searches for adversarial samples in synonym and semantic spaces, it does not consider the text similarity generated during the iteration process, resulting in lower adversarial text similarity. In contrast, the ATGSL algorithm has a certain probability of accepting suboptimal solutions, making it easier to find the optimal solution. Additionally, ATGSL-BM has fewer syntax errors and higher attack efficiency than algorithms generated by heuristic methods. Compared to BERT-ATTACK, which is also based on pre-trained models, ATGSL-BM has higher text similarity and ASR. Furthermore, ATGSL-FUSION is relatively stable and maintains
|
| 489 |
+
|
| 490 |
+
a good balance between attack efficiency and adversarial text quality.
|
| 491 |
+
|
| 492 |
+
Table 13: Adversarial examples by attacking BERT model on MR dataset.
|
| 493 |
+
|
| 494 |
+
<table><tr><td>BEAT-ATTACK (Successful attack. True label score = 24.91%, semantic similarity score = 0.36, qrs=164, grammaticality score = 2)</td><td>An incontrovertible theontreudibility contemporary french psychological grief drama examining tragedy the standoff relationship of an aloof father and his freeze son after 20 years apart.</td></tr><tr><td>PSO (Successful attack. True label score = 33.26%, semantic similarity score = 0.56, qrs=150, grammaticality score = 3)</td><td>An incontrovertible french psychological drama dramatic examining analyse the standoff of an aloof father begetter and his freeze freezing son after 20 years apart aside.</td></tr><tr><td>ATGSL-SA (Successful attack. True label score = 44.86%, semantic similarity score = 0.75, qrs=84, grammaticality score = 2)</td><td>An incontrovertible inarguable french psychological unworldly drama examining the standoff of an aloof father begetter and his freeze son boy after 20 years apart asunder.</td></tr><tr><td>ATGSL-BM (Successful attack. True label score = 44.86%, semantic similarity score = 0.84, qrs = 56, grammaticality score = 1)</td><td>An incontrovertible french russian psychological psychiatric drama examining question the standoff of an aloof father and his freeze son after 20 years apart.</td></tr><tr><td>ATGSL-FUSION (Successful attack. True label score = 31.28%, semantic similarity score = 0.91, qrs = 94, grammaticality score = 2)</td><td>An incontrovertible french psychological drama seriocomedy examining the standoff of an aloof father and his freeze trammel son after 20 years apart.</td></tr></table>
|
| 495 |
+
|
| 496 |
+
Table 14: Adversarial examples by attacking BERT model on SNLI dataset.
|
| 497 |
+
|
| 498 |
+
<table><tr><td>Premise:A young woman with brown hair and an elderly man with gray hair and a sweater jump in the air on a snowy hill with snowshoes on their feet.</td></tr><tr><td>An old dead woman women and a young man are crossing the street</td></tr><tr><td>Method: BERT-ATTACK (Successful attack. True label score = 19.78%, qrs = 43, semantic similarity score = 0.33, grammaticality score = 1)</td></tr><tr><td>An old abandoned woman and a young man are crossing frustrate the street route.</td></tr><tr><td>Method: PSO (Successful attack. True label score = 22.28%, semantic similarity score = 0.54, qrs = 68, grammaticality score = 2)</td></tr><tr><td>An old woman female and a young man brother are crossing the street.</td></tr><tr><td>Method: ATGSL-SA (Successful attack. True label score = 24.67%, semantic similarity score = 0.73, qrs = 43, grammaticality score = 1)</td></tr><tr><td>An old woman and a young man are crossing the street trajectory</td></tr><tr><td>Method: ATGSL-BM (Successful attack. True label score = 28.78%, semantic similarity score = 0.88, qrs = 17, grammaticality score = 1)</td></tr><tr><td>An old woman and a young tender man husband are crossing the street</td></tr><tr><td>Method: ATGSL-FUSION (Successful attack. True label score = 20.58%, semantic similarity score = 0.79, qrs = 52, grammaticality score = 1)</td></tr></table>
|
adversarialtextgenerationbysearchandlearning/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c365baf1ae733005170669546b1177a73a95d1e19080f18bd9dcde07fb0966c5
|
| 3 |
+
size 911403
|
adversarialtextgenerationbysearchandlearning/layout.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b0bf497ae3c9cd912e22c72678c889c0227f840c89ac74ff7e84cc76bfab21c8
|
| 3 |
+
size 575579
|
affectiveanddynamicbeamsearchforstorygeneration/18838c77-e5cd-4522-b849-6082e3877843_content_list.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:df753f384c43e11e5ad3e9f11a4a59e5867c605f90647229fa2492da6e01da7c
|
| 3 |
+
size 106247
|
affectiveanddynamicbeamsearchforstorygeneration/18838c77-e5cd-4522-b849-6082e3877843_model.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:41030754c7db186c0e7343aed46967a34fb31a33f7fa8ff6a40b23775286eb1a
|
| 3 |
+
size 128441
|
affectiveanddynamicbeamsearchforstorygeneration/18838c77-e5cd-4522-b849-6082e3877843_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b745cf2d65d4c041ca9d26b674036840796d3470ea11007e597603c9747079d7
|
| 3 |
+
size 1050245
|
affectiveanddynamicbeamsearchforstorygeneration/full.md
ADDED
|
@@ -0,0 +1,421 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Affective and Dynamic Beam Search for Story Generation
|
| 2 |
+
|
| 3 |
+
Tenghao Huang<sup>1</sup> Ehsan Qasemi<sup>1</sup> Bangzheng Li<sup>1</sup>
|
| 4 |
+
He Wang<sup>2</sup> Faeze Brahman<sup>3</sup> Muhao Chen<sup>1,4</sup> Snigdha Chaturvedi<sup>5</sup>
|
| 5 |
+
|
| 6 |
+
<sup>1</sup>University of Southern California <sup>2</sup>Columbia University
|
| 7 |
+
|
| 8 |
+
3Allen Institute for Artificial Intelligence 4University of California, Davis
|
| 9 |
+
|
| 10 |
+
$^{5}$ University of North Carolina
|
| 11 |
+
|
| 12 |
+
{tenghaoh, qasemi, bangzhen}@usc.edu;
|
| 13 |
+
|
| 14 |
+
hw2687@columbia.edu; faezeb@allenai.org;
|
| 15 |
+
|
| 16 |
+
muhchen@ucdavis.edu; snigdha@cs.unc.edu
|
| 17 |
+
|
| 18 |
+
# Abstract
|
| 19 |
+
|
| 20 |
+
Storytelling's captivating potential makes it a fascinating research area, with implications for entertainment, education, therapy, and cognitive studies. In this paper, we propose Affective Story Generator (AFFGEN) for generating interesting narratives. AFFGEN introduces 'intriguing twists' in narratives by employing two novel techniques—Dynamic Beam Sizing and Affective Reranking. Dynamic Beam Sizing encourages less predictable, more captivating word choices using a contextual multi-arm bandit model. Affective Reranking prioritizes sentence candidates based on affect intensity. Our empirical evaluations, both automatic and human, demonstrate AFFGEN's superior performance over existing baselines in generating affectively charged and interesting narratives. Our ablation study and analysis provide insights into the strengths and weaknesses of AFFGEN.
|
| 21 |
+
|
| 22 |
+
# 1 Introduction
|
| 23 |
+
|
| 24 |
+
Stories have been a central part of human cultures for millennia, shaping societies, identities, and beliefs (Kasunic and Kaufman, 2018). However, the question of why some stories captivate us while others leave us indifferent remains intriguing. While humans can skillfully craft interesting narratives, even the most recent AI models cannot compose stories that can engage the reader for long enough. In this work, we address the task of automatically generating interesting stories.
|
| 25 |
+
|
| 26 |
+
Automatically generating interesting stories could potentially help cognitive studies by revealing patterns that make stories interesting. From an application perspective, the capability to generate interesting stories could revolutionize the fields like entertainment (Akoury et al., 2020; Thue et al., 2007), education (Zhao et al., 2022), and even therapy (Gabriel and Young, 2011).
|
| 27 |
+
|
| 28 |
+
While large language models (LLMs), such as GPT (Radford et al., 2019), have been de facto
|
| 29 |
+
|
| 30 |
+

|
| 31 |
+
Figure 1: Two example stories. Story 1 is an interesting story with an intriguing twist (highlighted in orange color) that was produced by AFFGEN using dynamic beam sizing. Story 2 is a relatively less interesting story with a straightforward and predictable plot.
|
| 32 |
+
|
| 33 |
+
winners in generating coherent text, their prowess in creating narratives that captivate human interest leaves much to be desired. LLMs' coherence is mainly rooted in their training objective that incentivizes text likelihood which is not necessarily correlated with human quality judgements (Holtzman et al., 2019; Zhang et al., 2021) or writing style (Gehrmann et al., 2019). The concept of "interesting stories" is also highly subjective and context-dependent (Roemmele, 2021). Previous research in the field increases "interest" in the story by structural planning to control specific aspects of the story, e.g. modeling the emotional flow of the protagonist (Luo et al., 2019; Brahman and Chaturvedi, 2020) or incorporating flashbacks (Han et al., 2022). However, such methods ignore that text complexity and quality also raise its interestingness (Schraw et al., 2001).
|
| 34 |
+
|
| 35 |
+
Bradley and Lang (1999) advocates for decorating the plot with affective terms to increase the suspense and intensity of the story that results in control of the audience's emotions (Delatorre et al., 2016). With this motivation, we propose Affective Story Generator (AFFGEN)<sup>1</sup> that con
|
| 36 |
+
|
| 37 |
+
trols text coherence and leverages words' affective dimensions to promote text interestingness. Our method is based on two key ideas. First, in beam-search-based decoding of language models, occasionally exploring larger beams can help in generating slightly lower probability but potentially more interesting words. Second, switching between large and small beams can help in maintaining the balance between coherence and interestingness. We use these ideas to generate stories with an intriguing twist. Figure 1 shows an example of an interesting story, Story 1, with an intriguing twist (highlighted in orange color) that was produced by dynamically using different beam sizes. It also shows an uninteresting story, Story 2, that used a comparable language model but with a constant beam size.
|
| 38 |
+
|
| 39 |
+
To generate an interesting story, AFFGEN first identifies where to generate the intriguing twist that would push the story to be more interesting. Then it generates the intriguing twist using two novel techniques, i.e. Dynamic Beam Sizing and Affective Reranking. In dynamic beam sizing, AFFGEN uses a contextual bandit model (Thompson, 1933) to dynamically explore different beam sizes thus encouraging the model to select words that are less predictable and more intriguing without compromising coherence. In affective reranking, AFFGEN reranks possible candidates for the sentence to be generated according to their arousal and valence scores (Mohammad, 2018), thereby modulating the emotional dynamics of the story.
|
| 40 |
+
|
| 41 |
+
Our automatic and human evaluations show that stories generated by AFFGEN are more engaging than the baselines without sacrificing coherence. Our ablation studies and analysis provide deeper insights into the functioning of AFFGEN
|
| 42 |
+
|
| 43 |
+
# Our contributions are:
|
| 44 |
+
|
| 45 |
+
- We propose the task of generating interesting stories.
|
| 46 |
+
- We propose AFFGEN, a language model that uses a novel contextual bandit-based decoding algorithm and explores dynamic beam sizes and affective reranking.
|
| 47 |
+
- We conduct automatic and human evaluations to empirically demonstrate that AFFGEN can produce interesting and coherent narratives.
|
| 48 |
+
- We conduct ablation studies and analysis to further understand the working of AFFGEN.
|
| 49 |
+
|
| 50 |
+
# 2 Related Works
|
| 51 |
+
|
| 52 |
+
We discuss two lines of related work that are closely relevant to this study.
|
| 53 |
+
|
| 54 |
+
Story Generation. Early research on story generation explored symbolic planning methods (Pérez and Sharples, 2001; Porteous and Cavazza, 2009; Riedl and Young, 2010) that used predefined rules and structures to generate stories. Later efforts used neural methods (Jain et al., 2017; Peng et al., 2018; Fan et al., 2018; Puduppully et al., 2019; Zhai et al., 2019; Yao et al., 2019; Wang et al., 2021; Peng et al., 2022).
|
| 55 |
+
|
| 56 |
+
However, generating interesting stories has remained a challenge due to the subjective nature of "interestingness" (Roemmele, 2021). Some previous work has attempted to generate interesting stories by controlling specific aspects of the generated content, such as modeling emotions (Luo et al., 2019; Brahman and Chaturvedi, 2020), flashbacks (Han et al., 2022), personas (Zhang et al., 2022), topics (Lin and Riedl, 2021), and social relationships (Vijjini et al., 2022). Alhussain and Azmi (2021) pointed out factors that could lead to interesting narratives, such as suspense (Tan and Fasting, 1996), discourse (Genette, 1980), and characters (Liu et al., 2020). This work differs from these approaches in the sense that it focuses on generating interesting content by choosing more affective, and not necessarily high-likelihood, words.
|
| 57 |
+
|
| 58 |
+
Sampling strategies for decoding. One of the commonly used strategies in neural text (and story) generation is Nucleus Sampling (Holtzman et al., 2019). This method involves selecting a subset of the vocabulary, called the nucleus, from which the next word is sampled. Another strategy is Top-k Sampling (Fan et al., 2018), which only considers the $k$ most probable words for the next word. Meister et al. (2023) proposed an information-theoretic strategy, Locally Typical Sampling, with the aim of making the model's output more human-like.
|
| 59 |
+
|
| 60 |
+
Our approach differs from these existing strategies in two key perspectives. First, while previous works primarily aim to encourage generation fluency and diversity we focus on including more affective terms during decoding. Second, we use re-scoring, which involves adjusting the probabilities of the words based on additional criteria, rather than solely relying on the logits distribution generated by the model. This allows us to further enhance the diversity and affective quality of the
|
| 61 |
+
|
| 62 |
+
generated text.
|
| 63 |
+
|
| 64 |
+
# 3 Problem statement
|
| 65 |
+
|
| 66 |
+
Given a sentence, $\mathbf{s_1}$ , as a prompt that represents the first sentence of a story, our goal is to generate an interesting story represented as a sequence of generated sentences $\mathbf{s_2}, \mathbf{s_3}, \dots, \mathbf{s_N}$ . Each sentence is a sequence of tokens. In this paper, one of these generated sentences serves as the intriguing twist in the narrative.
|
| 67 |
+
|
| 68 |
+
# 4 Controlled Affective Story Generator
|
| 69 |
+
|
| 70 |
+
This section presents the Controlled Affective Story Generator (AFFGEN), a narrative generation model designed to produce interesting stories. AFFGEN operates in two key stages. First, it identifies the position of the sentence that should contain the intriguing twist, $p_{IT}$ (\$4.1). Then, it generates the story in the left-to-right manner using a language model. For generating sentences that do not contain the intriguing twist, it uses a standard decoding algorithm since the focus is on maintaining narrative coherence (\$4.2). For generating the sentence that contains the intriguing twist, it uses our proposed decoding algorithm based on Dynamic Beam Sizing and Affective Reranking since the focus is on balancing emotional arousal, interestingness, and coherence (\$4.3).
|
| 71 |
+
|
| 72 |
+
# 4.1 Position of the intriguing twist
|
| 73 |
+
|
| 74 |
+
Narratives are highly structured texts. Freytag's pyramid (Freytag, 1908), a widely recognized model of narrative structure, delineates the story into five key components: exposition, rising action, climax, falling action, and resolution.
|
| 75 |
+
|
| 76 |
+
Given the prompt sentence, $\mathbf{s_1}$ , our objective is to determine the most suitable location for the climax or the intriguing twist, $n_{IT} \in \{2,3,\dots N\}$ . There has been some work on identifying the climax or turning point in a given story (Ouyang and McKeown, 2015; Wang et al., 2022; Vijayaraghavan and Roy, 2023). We employ a data-driven approach inspired by the work of Wilmot and Keller (2020). Their methodology operates on the premise that if the embedding of two sentences is sufficiently distant, the latter sentence can be deemed unexpected or interesting with respect to the former sentence. They use this idea to identify the sentence that presents the turning point or intriguing twist in a narrative.
|
| 77 |
+
|
| 78 |
+
Our data-driven approach utilizes the Writing-Prompts dataset (Fan et al., 2018), a collection of human-written stories. We use this dataset to form a distribution, $D(n)$ , which corresponds to the probability of observing the intriguing twist at the $n^{th}$ sentence. During inference, AFFGEN samples a relative position $n_{IT}$ from $D(n)$ to pinpoint the location of the sentence that would be the intriguing twist in the story that will be generated
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
n _ {I T} \sim D (n).
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
Next, we discuss how AFFGEN generates the various sentences of the story.
|
| 85 |
+
|
| 86 |
+
# 4.2 Base Storyteller
|
| 87 |
+
|
| 88 |
+
For generating sentences that do not contain an intriguing twist ( $s_i$ 's $\forall i \notin \{1, n_{IT}\}$ ), the focus is on maintaining narrative coherence. We use a GPT-based language model (Radford et al., 2019; Brown et al., 2020) which has shown promising performance on story generation (Brahman and Chaturvedi, 2020; Clark and Smith, 2021). We fine-tune the language model on a dataset of stories ( $\S 5.1$ ) by minimizing the negative conditional log-likelihood:
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
N L L = - \log \prod_ {i = 1} ^ {n} p \left(w _ {i} \mid w _ {1}, \dots , w _ {i - 1}\right). \tag {1}
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
where $w_{i}$ 's represent the tokens of the story. We use beam search for inference in this model.
|
| 95 |
+
|
| 96 |
+
# 4.3 Generating Intriguing Twist
|
| 97 |
+
|
| 98 |
+
To generate the sentence that contains the intriguing twist in the narrative, $\mathbf{s}_{IT}$ , we use the fine-tuned language model from §4.2 but with a novel beam search-based decoding. Our decoding method uses Dynamic Beam Sizing and Affective Reranking to produce interesting text.
|
| 99 |
+
|
| 100 |
+
Dynamic Beam Sizing. The motivation behind our beam search-based decoding algorithm is that while a small beam size helps in producing coherent text, by expanding the beam size of the PLM, we can explore slightly lower probability but potentially more intriguing words. However, maintaining a large beam size throughout is also not desirable because not all words in a sentence need to be interesting. A large beam throughout can also slow down the inference process and require more resources. So during inference, the model needs to dynamically switch between large and small beam
|
| 101 |
+
|
| 102 |
+
sizes to balance the tradeoff between the coherence and interestingness of the generated text.
|
| 103 |
+
|
| 104 |
+
To address this, we introduce Dynamic Beam Sizing, where depending on the context, the model decides the beam size before generating a token. For practical purposes, we assume that the beam size can take one of $k$ values $\{b^{1}, b^{2} \ldots b^{k}\}$ , and the model has to choose one. We cast the problem of choosing a beam size as a contextual $k$ -arm bandit problem (Langford and Zhang, 2007), where the arms of the bandit are the various beam sizes. The bandit's choice of beam size at time step or trial, $t$ , depends on the context of the bandit. The context considers the tokens generated so far for the intriguing twist sentence, $\mathbf{s}_{IT}$ . We use $\mathbf{s}_{\mathrm{IT}, t-1}$ to refer to the sequence of tokens in this partial sentence and represent the context using following features:
|
| 105 |
+
|
| 106 |
+
1. Arousal score: The arousal score of the sentence generated so far, $\mathbf{s}_{\mathrm{IT},\mathbf{t} - 1}$ . The arousal score of a partial sentence, viewed as a sequence of tokens, s, of length $n$ is:
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
A (\mathbf {s}) = \sum_ {i = 1} ^ {n} a \left(w _ {i}\right) \tag {2}
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
where $a(w_i)$ is the arousal score of the $i^{th}$ token obtained from the NRC Word-Emotion Association lexicon (Mohammad, 2018). Since longer sentences can accumulate higher arousal scores, we divide the arousal score by a length normalizing factor (Wu et al., 2016). The length normalizing factor for a sentence of length $n$ is:
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
l p (n) = \frac {(5 + n) ^ {\lambda}}{(5 + 1) ^ {\lambda}} \tag {3}
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
where $\lambda$ is the normalization coefficient.
|
| 119 |
+
|
| 120 |
+
2. Event trigger likelihood: Sims et al. (2019) points out that in narratives there are certain words in a sentence that trigger interesting literary events. E.g. In the sentence "... Stephen leaned his arms on ...". The word "leaned" is an event trigger. Identifying such event triggers can help in locating the interesting part of a sentence, which in turn will help in deciding whether to choose a larger beam. With this motivation, we train a RoBERTa (Liu et al., 2019) based predictor that given a partial sentence predicts whether the next token would be the trigger for an interesting literary event. We provide the partial sentence generated so far, $\mathbf{s_{IT,t-1}}$ , as the input to this predictor and use the likelihood assigned by it (for the next token to be an event
|
| 121 |
+
|
| 122 |
+
trigger) as a feature.
|
| 123 |
+
|
| 124 |
+
3. Sequence length: Length of the partial sentence generated so far, $\mathbf{s_{IT,t - 1}}$ . Knowing where the model is, in terms of position, can help it decide whether to generate an interesting token next.
|
| 125 |
+
4. Perplexity: The model's perplexity on the partial sentence generated so far, $\mathbf{s}_{\mathbf{I T},\mathbf{t} - 1}$ . This helps in maintaining coherence.
|
| 126 |
+
|
| 127 |
+
For choosing an arm $b \in \{b^1, b^2 \dots b^k\}$ , the bandit also receives a payoff. The payoff accounts for all the candidate sequences in the beam $\{\mathbf{c}^1, \mathbf{c}^2, \dots, \mathbf{c}^b\}$ . Each $\mathbf{c}^i$ is basically a concatenation of the partial sentence generated so far, $s_{IT,t-1}$ , and the $i^{th}$ token in the beam. The payoff rewards beams that contain candidate sequences with high arousal scores (to promote interestingness) and low perplexity (to promote coherence). It also penalizes large beam sizes to encourage using fewer compute resources. Mathematically, the payoff value $R(b_t, t)$ , for choosing a beam size, $b_t$ , at time step $t$ , is defined as:
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
R \left(b _ {t}, t\right) = \max _ {i \in [ 1, b _ {t} ]} \left(\mathbf {A} \left(\mathbf {c} ^ {i}\right) - \alpha \cdot \operatorname {p p l} \left(\mathbf {c} ^ {i}\right) - \beta \cdot | b _ {t} |\right), \tag {4}
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
where $\alpha, \beta$ are coefficients for each component, $\mathbf{A}(\mathbf{c})$ and $\mathrm{ppl}(\mathbf{c})$ represent the arousal score (as defined in Eqn. 2) and the perplexity of the candidate sequence $\mathbf{c}$ respectively, and $|b_{t}|$ represents the size of beam $b_{t}$ .
|
| 134 |
+
|
| 135 |
+
Given the set of $k$ choices for beam sizes $\{b^{1}, b^{2}, \ldots, b^{k}\}$ , the optimal beam size $b_{t}^{*}$ at timestep $t$ is given by
|
| 136 |
+
|
| 137 |
+
$$
|
| 138 |
+
b _ {t} ^ {*} = \underset {i \in [ 1, k ]} {\operatorname {a r g m a x}} R \left(b _ {t} ^ {i}, t\right) \tag {5}
|
| 139 |
+
$$
|
| 140 |
+
|
| 141 |
+
Correspondingly, the optimal payoff at time step, $t$ is $R(b_{t}^{*}, t)$ .
|
| 142 |
+
|
| 143 |
+
Using the LinUCB (Upper Confidence Bound) algorithm (Li et al., 2010), we optimize the bandit model by minimizing regret $L$ defined as:
|
| 144 |
+
|
| 145 |
+
$$
|
| 146 |
+
L = \mathbb {E} \left[ \Sigma_ {t = 1} ^ {T} R \left(b _ {t} ^ {*}, t\right) \right] - \mathbb {E} \left[ \Sigma_ {t = 1} ^ {T} R \left(b _ {t}, t\right) \right] \tag {6}
|
| 147 |
+
$$
|
| 148 |
+
|
| 149 |
+
where $T$ is the total number of time steps or the total number of tokens in $\mathbf{s}_{IT}$ .
|
| 150 |
+
|
| 151 |
+
Affective Reranking. While Dynamic Beam Sizing introduces more arousing content, it does not consider the variation of emotions associated with the content. Chung et al. (2022) highlighted that variation of emotional arc (Reagan et al., 2016) can make a story more engaging. We, therefore, introduce Affective Reranking.
|
| 152 |
+
|
| 153 |
+
Let $\{\mathbf{s_{IT}}^1,\mathbf{s_{IT}}^2\dots \mathbf{s_{IT}}^b\}$ be the candidate sentences that are generated as potential intriguing twists in the beam. The best candidate should have a high arousal score and should also have high affective contrast. We quantify affective contrast as the difference in the valence scores of the candidate sentence and the story generated so far. Valence score of a sequence of tokens, $v$ , is the length-normalized cumulative valence score of its individual tokens. We use the NRC-VAD lexicon (Mohammad, 2018) to obtain valence scores of tokens.
|
| 154 |
+
|
| 155 |
+
We select the best candidate for the intriguing twist sentence $\mathbf{s}^*$ such that:
|
| 156 |
+
|
| 157 |
+
$$
|
| 158 |
+
\mathbf {s} ^ {*} = \underset {i \in [ 1, b ]} {\operatorname {a r g m a x}} A \left(\mathbf {s} _ {\mathbf {I T}} ^ {i}\right) + | v \left(\mathbf {s} _ {\mathbf {I T}} ^ {i}\right) - v \left(\mathbf {s} _ {\mathbf {1}: \mathbf {I T} - \mathbf {1}}\right) | \tag {7}
|
| 159 |
+
$$
|
| 160 |
+
|
| 161 |
+
# 5 Empirical Evaluation
|
| 162 |
+
|
| 163 |
+
In this section, we describe our experiments.
|
| 164 |
+
|
| 165 |
+
# 5.1 Experimental Setup
|
| 166 |
+
|
| 167 |
+
Dataset. For our experiments, we use the ROC-Stories dataset (Mostafazadeh et al., 2016), a large collection of 100k five-sentence 'commonsense' stories about everyday events. We held out 1k stories each for validation and testing and use the first sentence of every story as the prompt. We chose this dataset because it allows us to assess the performance of our model's ability to learn from a collection of everyday life stories and improvise them to be interesting. The short nature of these stories also makes the manual assessment of narrative quality feasible during human evaluation which otherwise would have been difficult. This focus on short stories, however, does not limit the potential application of our model to longer narratives.
|
| 168 |
+
|
| 169 |
+
Our base storyteller is trained on the ROCStories dataset. The contextual bandit model is trained in an unsupervised manner, relying on the internal regret function.
|
| 170 |
+
|
| 171 |
+
Implementation Details. All hyperparameters were set based on the performance on the validation set. We used $\alpha = 0.00015$ , $\beta = 0.0003$ in Eqn. 4 and $\lambda = 1.5$ in Eqn. 3. We trained the bandit model on single A5000 for 10 epochs and it chose between three beam sizes of 10, 30 and 60.
|
| 172 |
+
|
| 173 |
+
Baselines. Our primary baseline is GPT2 finetuned on the RocStories dataset since it is widely recognized for its story generation capabilities (Brahman and Chaturvedi, 2020). We use GPT3 as
|
| 174 |
+
|
| 175 |
+
<table><tr><td>Model</td><td>PPL ↓</td><td>Uni ↑</td><td>RUB ↑</td><td>Aro ↑</td></tr><tr><td>GPT2</td><td>26.77</td><td>0.021</td><td>0.1546</td><td>0.45</td></tr><tr><td>AFFGEN-2</td><td>40.27</td><td>0.019</td><td>0.1556</td><td>0.51</td></tr><tr><td>GPT3</td><td>18.90*</td><td>0.028</td><td>0.1541</td><td>0.46</td></tr><tr><td>AFFGEN-3</td><td>25.66</td><td>0.029</td><td>0.1547</td><td>0.53*</td></tr></table>
|
| 176 |
+
|
| 177 |
+
Table 1: Automatic evaluation of AFFGEN using Perplexity (PPL), UNION score (Uni) (Guan and Huang, 2020), (RUB) score (Tao et al., 2018), and Arousal score (Aro). $\uparrow$ and $\downarrow$ indicate if higher or lower scores are desirable. Bold fonts indicate best scores and * indicates statistical significance ( $p < 0.01$ ). The results indicate that both versions of AFFGEN can generate interesting stories without compromising coherence.
|
| 178 |
+
|
| 179 |
+
a baseline to compare with a large language model. For GPT3, we use the following prompt ${}^{2}$ (after experimentation): "Continue writing an interesting story using the following context, $<$ context $>$ . The total length of the story should be five sentences. The total words limit is 60 words."
|
| 180 |
+
|
| 181 |
+
# 5.2 Automatic Evaluation
|
| 182 |
+
|
| 183 |
+
Table 1 presents a comparison between AFFGEN and baseline methods. We use two versions of our model, AFFGEN-2 and AFFGEN-3. They use finetuned GPT-2 and GPT-3 as the base storytellers (§4.2). We observe that both versions of AFFGEN have higher perplexity (PPL) scores than the baselines. This, however, is expected and does not imply low coherence because AFFGEN encourages using low-likelihood words during the decoding process to generate interesting content.
|
| 184 |
+
|
| 185 |
+
For a better evaluation of coherence, we consider the UNION (UNI) (Guan and Huang, 2020) and RUBER (RUB) scores (Tao et al., 2018). UNION is a reference-free score specially designed for evaluating open-ended story generation models. RUBER is a hybrid of referenced and unreferenced metric used for evaluating dialog systems. We only use its unreferenced part to evaluate the quality of a piece of text (story) generated in response to a query (the story prompt). A higher value for these scores is better. We observe that for these scores versions of AFFGEN either perform better than or comparable to the baselines. This indicates that AFFGEN is capable of generating coherent narratives.
|
| 186 |
+
|
| 187 |
+
For evaluating how interesting the stories are, we measure their per-token Arousal score (Aro) (Eqn. 2) which quantifies their affect level. A higher value is better for this score. We observe that
|
| 188 |
+
|
| 189 |
+
<table><tr><td>Evaluation Criteria</td><td>Win</td><td>Lose</td><td>Tie</td></tr><tr><td>Coherence</td><td>50.5*</td><td>40.7</td><td>8.8</td></tr><tr><td>Emotional Engagement</td><td>53.0*</td><td>40.3</td><td>6.7</td></tr><tr><td>Empathy</td><td>53.8*</td><td>40.2</td><td>6.0</td></tr><tr><td>Interestingness</td><td>54.9*</td><td>41.1</td><td>4.0</td></tr><tr><td>Overall Preference</td><td>52.7*</td><td>39.6</td><td>7.7</td></tr></table>
|
| 190 |
+
|
| 191 |
+
both versions of AFFGEN outperform the baselines with AFFGEN-3 achieving the highest score. This indicates that AFFGEN generates more interesting stories.
|
| 192 |
+
|
| 193 |
+
# 5.3 Human Evaluation
|
| 194 |
+
|
| 195 |
+
In order to assess the performance of AFFGEN, a comprehensive human evaluation was conducted on the Amazon Mechanical Turk (AMT) platform. A total of 100 instances were randomly selected from our test set. We feed their initial sentences as prompts for generating stories using AFFGEN-3 and GPT-3, our stronger baseline. To eliminate any potential bias, the presentation order of the two stories was randomized. The Turkers then selected the better of the stories according to 6 criteria: coherence, emotional engagement, empathy, interestingness, and overall preference. These criteria were chosen based on prior research conducted by Chhun et al. (2022). The Turkers could also select an "equally good" option. The Turkers were explicitly instructed to solely consider the given criterion when evaluating, except when expressing an overall preference. In the appendix, Figure 4 showcases a screenshot of our AMT setup. We specifically utilized Master annotators predominantly from English-speaking countries (US, UK, Canada, and Australia). We evaluated 200 stories in total, and each pair was assessed by three different annotators. We discuss the results shown in Table 2 below. All differences in this table are statistically significant $(p < 0.1$ for coherence and $p < 0.05$ for others) and the inter-annotator agreement is 0.58 (moderate agreement).
|
| 196 |
+
|
| 197 |
+
Coherence evaluated the logical flow and connection between the different elements of the story. For this criterion, judges found stories generated by AFFGEN-3 to be more coherent than those generated by GPT-3 in $50.5\%$ of instances, while AFFGEN-3's stories were considered less coherent in $40.7\%$ of cases. The remaining $8.8\%$ resulted
|
| 198 |
+
|
| 199 |
+
Table 2: Human evaluation of AFFGEN vs GPT-3. AFFGEN generates better stories across all measures. * indicates statistical significance (p<0.1 for coherence and p<0.05 for others).
|
| 200 |
+
|
| 201 |
+
<table><tr><td>Evaluation Criteria</td><td>Win</td><td>Lose</td><td>Tie</td></tr><tr><td>Coherence</td><td>14.5</td><td>38.8*</td><td>46.7</td></tr><tr><td>Emotional Engagement</td><td>55.5*</td><td>24.8</td><td>19.7</td></tr><tr><td>Empathy</td><td>40.8*</td><td>28.6</td><td>30.6</td></tr><tr><td>Interestingness</td><td>45.3*</td><td>26.3</td><td>28.4</td></tr><tr><td>Overall Preference</td><td>45.3</td><td>35.7</td><td>19.0</td></tr></table>
|
| 202 |
+
|
| 203 |
+
Table 3: Human evaluation of AFFGEN vs ChatGPT. AFFGEN generates not as coherent but more interesting and empathetic stories. * indicates statistical significance (p<0.05).
|
| 204 |
+
|
| 205 |
+
in a tie. This indicates that AFFGEN does not compromise on coherence while generating stories.
|
| 206 |
+
|
| 207 |
+
Emotional Engagement evaluated how effectively a story conveys a range and intensity of emotions that capture and hold the reader's attention and create a sense of emotional depth and complexity. For this criterion, judges found stories generated by AFFGEN-3 to be more emotionally engaging than GPT-3 in $53.0\%$ and less emotionally engaging in $40.3\%$ of the cases. This demonstrates AFFGEN's stronger ability to evoke emotions in readers.
|
| 208 |
+
|
| 209 |
+
Empathy evaluated if the story arouses the readers' empathy for the characters. The conflicts and challenges described in stories can create situations that make the readers project their own emotions and thoughts onto the characters, keeping them invested and engaged. For this criterion, AFFGEN-3 outperformed GPT-3 by a large gap of $13.6\%$ (53.8% wins and 40.2% losses). This demonstrates that AFFGEN can generate emotionally resonant content.
|
| 210 |
+
|
| 211 |
+
Interestingness evaluates the story's ability to be compelling and engaging. For this criterion also, AFFGEN-3 outperformed GPT-3 by a large gap of $13.8\%$ (54.9% wins and 41.1% losses). This demonstrates AFFGEN's its superiority in keeping the reader's interest while generating stories.
|
| 212 |
+
|
| 213 |
+
Overall Preference Finally, we observed that overall, the judges preferred AFFGEN over the baseline in $52.7\%$ of the cases (as compared to preferring baseline over AFFGEN in $39.6\%$ cases).
|
| 214 |
+
|
| 215 |
+
To conclude, the human evaluation results provide strong evidence of the superiority of the AFFGEN in various critical aspects of open-ended story generation underlying its ability to generate interesting and engaging stories while maintaining coherence.
|
| 216 |
+
|
| 217 |
+
<table><tr><td></td><td>UNION</td><td>RUBER</td><td>Arousal</td></tr><tr><td>AFFGEN10</td><td>-0.007</td><td>-0.012</td><td>-0.018</td></tr><tr><td>AFFGEN30</td><td>-0.002</td><td>-0.007</td><td>0.024</td></tr><tr><td>AFFGEN60</td><td>-0.005</td><td>-0.006</td><td>0.047</td></tr><tr><td>AFFGEN - AR</td><td>0.002</td><td>-0.001</td><td>-0.070</td></tr></table>
|
| 218 |
+
|
| 219 |
+
Table 4: Performance of ablated versions of AFFGEN with static beam sizes relative to AFFGEN. Subscripts indicate the beam sizes. A negative score indicates that the ablated version did not perform as well as AFFGEN. These results indicate that it is important to explore large beam sizes in a dynamic manner to generate interesting and coherent stories.
|
| 220 |
+
|
| 221 |
+
# 5.4 Comparison with ChatGPT
|
| 222 |
+
|
| 223 |
+
In this section we compare AFFGEN with a large language model, ChatGPT $^{3}$ . We used a human evaluation setup similar to that described in §5.3. These annotations were performed by expert annotators who were students of literature theories. For generating stories with ChatGPT, we experimented with different prompts and the final prompt is shown in Table 7. Table 3 shows the results. Annotators expectedly found ChatGPT's stories to be more coherent. Our initial analysis also revealed ChatGPT text to have more sophisticated structure. However, annotators found AFFGEN's stories to be significantly more empathy-evoking and interesting. Because of this, the annotators preferred AFFGEN over ChatGPT in the overall preference.
|
| 224 |
+
|
| 225 |
+
# 5.5 Ablation Study
|
| 226 |
+
|
| 227 |
+
We now describe our ablation study in which we investigate the importance of exploring different beam sizes and affective reranking. In our experiments reported so far, we made AFFGEN explore three different beam sizes during decoding. In this study, we design ablated versions of AFFGEN that only uses one of the three beam sizes. We call them $\mathrm{AFFGEN}_{10}$ , $\mathrm{AFFGEN}_{30}$ , and $\mathrm{AFFGEN}_{60}$ , where the subscript indicates the beam size being used. The first three rows of Table 4 reports the relative performance of these versions with AFFGEN. All models use fine-tuned GPT-2 as the base storyteller. For all scores, a negative score indicates that the ablated version did not perform as well as AFFGEN (and vise versa). We can see that for most of the ablated versions, the UNION and RUBER scores are negative. This means that the stories generated by the ablated versions are less coherent than the full model. In terms of Arousal scores, $\mathrm{AFFGEN}_{10}$
|
| 228 |
+
|
| 229 |
+
produces less arousing stories than AFFGEN but $\mathrm{AFFGEN}_{30}$ , and $\mathrm{AFFGEN}_{60}$ produce more arousing stories than AFFGEN. This aligns with our initial intuition that a larger beam size helps the model generate more interesting content. However, because of large but static beam sizes, the stories generated by these two versions were less coherent than those generated by AFFGEN.
|
| 230 |
+
|
| 231 |
+
Next, we also consider another version of AFFGEN but without Affective Reranking. The relative performance of this model is shown in the last row of Table 4. We can see that the performance of this version is quite close to the baseline. Also, while its coherence is comparable to AFFGEN, the arousal score is particularly worse indicating the importance of this component in generating interesting content.
|
| 232 |
+
|
| 233 |
+
Overall, we can draw two conclusions from this ablation study. First, exploring large beam sizes and affective reranking can help in generating more interesting content. Second, it is important to dynamically switch between larger and smaller beams to balance interestingness and coherence.
|
| 234 |
+
|
| 235 |
+
# 5.6 Expansion to Longer Narratives
|
| 236 |
+
|
| 237 |
+
Our experiments have used RocStories which are short in nature. This focus on short stories does not limit the potential application of our model to longer narratives. Jolles (2017) points out that stories could be condensed into "simple forms". Story composition could be viewed as a process of expanding these simple forms into presentable longer narratives. Table 10 presents expanded AFFGEN-generated stories and compared with vanilla ChatGPT generated stories. With the help of the five-sentence interesting plots produced by AFFGEN, ChatGPT expand them into better stories comparing to vanilla ChatGPT generated stories.
|
| 238 |
+
|
| 239 |
+
# 5.7 Dynamic Beam Sizing
|
| 240 |
+
|
| 241 |
+
We now investigate how the beam size changes as AFFGEN generates an interesting sentence. Figure 2 shows the average beam size used to generate at different positions of a typical sentence. We observe that AFFGEN is using larger beam sizes for the first few tokens. Our manual analysis revealed that the interesting words indeed appear earlier in a sentence, in general.
|
| 242 |
+
|
| 243 |
+
Since the model is capable of transitioning between beam sizes, we plot a heat map of the transitions shown in Figure 3. Each cell shows the probability of transitioning from beam size on Y
|
| 244 |
+
|
| 245 |
+

|
| 246 |
+
Figure 2: Average beam size used to generate at different positions of a sentence.
|
| 247 |
+
|
| 248 |
+

|
| 249 |
+
Figure 3: Transitional probability between beam sizes.
|
| 250 |
+
|
| 251 |
+
axis to a beam size on the X axis. Darker color indicates higher probabilities. We observe that in general, while AFFGEN has a tendency to stick to a chosen beam size $(\sim 70\%)$ , it does transition to different beam sizes about $30\%$ of the times indicating the importance of switching between beam sizes.
|
| 252 |
+
|
| 253 |
+
# 5.8 Qualitative Analysis
|
| 254 |
+
|
| 255 |
+
During the human evaluation (§5.3), when asking for preferences for the stories, we also asked the judges to provide explanations for their choices. We then analyzed the explanations to further analyze the stories generated by AFFGEN. Table 5 show an example of stories generated by GPT-3 and AFFGEN for the same input prompt as well as the human-provided explanation. While both stories have a happy ending, AFFGEN's story introduces a plot complication, where the protagonist, Grayson's, initial attempt to bake a cake fails. He resolves the situation through determined efforts, creating a narrative of perseverance. Compared to the baseline, the plot in AFFGEN's story becomes more complicated and has more ups and downs, which enhances the emotional engagement and interest of the reader. The AMT judges noted that the AFFGEN's story was more emotionally expressive.
|
| 256 |
+
|
| 257 |
+
Table 8 in the Appendix provides more comparative examples of stories generated by the baseline and AFFGEN and corresponding explanations. Analyzing explanations for story pairs we found that the judges preferred AFFGEN's stories because they presented a shift in mood enhancing the affect they had on the reader. AFFGEN's stories also presented unexpected twists which provide a relief from the story's prevalent theme and increases its interest. In contract, the baseline stories were banal and conflict-less. Sometimes AFFGEN's stories introduced a melancholic theme, but the judges still found them pleasant. This aligns with the narratological theory presented by Massumi (2002) who argues that there is a gap between the content and the effect on the receiver's end. As a result, audience often rate "sad" scenes in the film as the "most pleasant". Overall, AFFGEN was found to be better at generating more emotionally captivating and interesting stories leading to better storytelling experience.
|
| 258 |
+
|
| 259 |
+
# 5.9 Error Analysis
|
| 260 |
+
|
| 261 |
+
Using the judges' explanations provided during the human evaluation, we also conduct an error analysis to identify issues encountered during story generation by AFFGEN. Table 9 in Appendix shows some examples of story pairs in which the judges did not prefer AFFGEN's stories over GPT-3's stories and their explanations. We observe that while AFFGEN introduces an intriguing twist in the story, it sometimes suffers from typical language modeling challenges like repetitive phrases and ideas (Story 2) and incoherence. Often the incoherence is caused by a lack of commonsense knowledge like sunglasses cannot change eye colors (Story 1), and if a toy breaks, it cannot function (Story 3). This aligns with the proposition made by Alhussain and Azmi (2021) that coherence (and also causality) are fundamental in storytelling. Without them, the story may disintegrate into inconsistent fragments.
|
| 262 |
+
|
| 263 |
+
# 6 Conclusion
|
| 264 |
+
|
| 265 |
+
This paper addresses the task of generating interesting stories. For this, we present, AFFGEN, a language model that uses a novel contextual bandit-based decoding mechanism. This new decoding mechanism enables the AFFGEN to dynamically explore different beam sizes and rerank based on affective quality of the text. Our experiments indicate that AFFGEN can generate interesting but
|
| 266 |
+
|
| 267 |
+
<table><tr><td>GPT-3</td><td>Grayson wanted to bake his brother a birthday cake, so he got out his mom's recipe book and started searching for the perfect one. He decided to go all out and make a four layer chocolate cake with cream cheese frosting. His brother was so impressed that he wolfed down 2 pieces in a row.</td></tr><tr><td>AFFGEN</td><td>Grayson wanted to bake his brother a birthday cake. The first attempt turned out terribly bad and ruined. Grayson was determined to make the perfect cake for his brother's birthday. Undeterred, Grayson started again from scratch and was finally able to make a delicious cake that his brother loved.</td></tr><tr><td>Human Explanation</td><td>The story by AFFGEN is more emotionally expressive</td></tr></table>
|
| 268 |
+
|
| 269 |
+
Table 5: Sample stories generated by GPT-3 and AFFGEN. As indicated by the judge, AFFGEN's story is more emotionally engaging.
|
| 270 |
+
|
| 271 |
+
coherent narratives. Our ablation studies underscore the importance of dynamic beam sizing and affective reranking, and our qualitative and error analysis point to the strengths and weaknesses of our model. We hope that this ability to compose interesting narratives can open new dimensions of computational creativity, driving the generation of unique and captivating content at an unprecedented scale and speed.
|
| 272 |
+
|
| 273 |
+
# Acknowledgement
|
| 274 |
+
|
| 275 |
+
We appreciate the reviewers for their insightful comments and suggestions. Tenghao Huang and Muhao Chen were supported by the NSF Grant IIS 2105329, an Amazon Research Award and a Keston Exploratory Research Award. Ehsan Qasemi was supported by the DARPA MCS program under Contract No.N660011924033 with the United States Office Of Naval Research. Computing of this work was partly supported by a subaward of NSF Cloudbank 1925001 through UCSD.
|
| 276 |
+
|
| 277 |
+
# Limitations
|
| 278 |
+
|
| 279 |
+
Our study has the following limitations.
|
| 280 |
+
|
| 281 |
+
We assume a single sentence containing an intriguing twist can enhance a story's interestingness. This paper focused on how to generate that intriguing twist. However, a story can potentially benefit from multiple interesting sentences and future works can investigate into how frequently and where to generate interesting content.
|
| 282 |
+
|
| 283 |
+
We adopted a simple data-driven approach for deciding where to put the sentence that contains the intriguing twist. It samples from a distribution learned from a collection of stories. Future work could work on more sophisticated methods that consider the preceding narrative context for deciding when to describe an interesting twist so that it integrates better with the story being generated.
|
| 284 |
+
|
| 285 |
+
For practical purposes, the bandit model discretized beam sizes. However, beam size is a continuous variable, and discretizing it can restrict the
|
| 286 |
+
|
| 287 |
+
model from exploring all possible values.
|
| 288 |
+
|
| 289 |
+
Our experiments used GPT-2 and GPT-3 as the base storyteller for generating the stories. However, we see AFFGEN as a framework that could incorporate other language models and future work can investigate this aspect.
|
| 290 |
+
|
| 291 |
+
Our experiments explored short and fictional narratives. Future work could investigate advanced planning and strategies for composing longer stories or non-fictional content.
|
| 292 |
+
|
| 293 |
+
Our dataset and experiments use only one language - English. We did not investigate the model's capabilities to generate stories in other languages.
|
| 294 |
+
|
| 295 |
+
# Ethical considerations
|
| 296 |
+
|
| 297 |
+
Our experiments use a publicly available dataset. Previous work (Huang et al., 2021) has shown that it contains gender-related biases and storytelling models that use this dataset can replicate and amplify these biases. Our model also encourages low-perplexity text, which could unintentionally encourage biased, violent, or sexually explicit content. Since we have not employed any bias or toxicity removal methods, applications of our work should control for inappropriate content.
|
| 298 |
+
|
| 299 |
+
# References
|
| 300 |
+
|
| 301 |
+
Nader Akoury, Shufan Wang, Josh Whiting, Stephen Hood, Nanyun Peng, and Mohit Iyyer. 2020. STO-RIUM: A Dataset and Evaluation Platform for Machine-in-the-Loop Story Generation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 6470–6484, Online. Association for Computational Linguistics.
|
| 302 |
+
Arwa I. Alhussain and Aqil M. Azmi. 2021. Automatic story generation: A survey of approaches. ACM Comput. Surv., 54(5).
|
| 303 |
+
Margaret M Bradley and Peter J Lang. 1999. Affective norms for english words (anew): Instruction manual and affective ratings. Technical report, Technical report C-1, the center for research in psychophysiology.
|
| 304 |
+
|
| 305 |
+
Faeze Brahman and Snigdha Chaturvedi. 2020. Modeling protagonist emotions for emotion-aware storytelling. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 5277-5294, Online. Association for Computational Linguistics.
|
| 306 |
+
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.
|
| 307 |
+
Cyril Chhun, Pierre Colombo, Fabian M. Suchanek, and Chloe Clavel. 2022. Of human criteria and automatic metrics: A benchmark of the evaluation of story generation. In Proceedings of the 29th International Conference on Computational Linguistics, pages 5794-5836, Gyeongju, Republic of Korea. International Committee on Computational Linguistics.
|
| 308 |
+
John Joon Young Chung, Wooseok Kim, Kang Min Yoo, Hwaran Lee, Eytan Adar, and Minsuk Chang. 2022. Talebrush: Sketching stories with generative pretrained language models. In Proceedings of the 2022 CHI Conference on Human Factors in Computing Systems, CHI '22, New York, NY, USA. Association for Computing Machinery.
|
| 309 |
+
Elizabeth Clark and Noah A Smith. 2021. Choose your own adventure: Paired suggestions in collaborative writing for evaluating story generation models. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 3566-3575.
|
| 310 |
+
Pablo Delatorre, Barbara Arfe, Pablo Gervás, and Manuel Palomo-Duarte. 2016. A component-based architecture for suspense modelling.
|
| 311 |
+
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.
|
| 312 |
+
Gustav Freytag. 1908. Freytag's technique of the drama: an exposition of dramatic composition and art. Scott, Foresman and Company.
|
| 313 |
+
Shira Gabriel and Ariana F Young. 2011. Becoming a vampire without being bitten: The narrative collective-assimilation hypothesis. *Psychological science*, 22(8):990-994.
|
| 314 |
+
Sebastian Gehrmann, Hendrik Strobelt, and Alexander Rush. 2019. GLTR: Statistical detection and visualization of generated text. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics: System Demonstrations, pages 111-116, Florence, Italy. Association for Computational Linguistics.
|
| 315 |
+
|
| 316 |
+
Gerard Genette. 1980. Narrative discourse. In *Narrative Discourse*. Cornell University Press.
|
| 317 |
+
Jian Guan and Minlie Huang. 2020. _UNION: An Unreferenced Metric for Evaluating Open-ended Story Generation_. In _Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 9157–9166_, Online. Association for Computational Linguistics.
|
| 318 |
+
Rujun Han, Hong Chen, Yufei Tian, and Nanyun Peng. 2022. Go back in time: Generating flashbacks in stories with event temporal prompts. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 1450-1470, Seattle, United States. Association for Computational Linguistics.
|
| 319 |
+
Ari Holtzman, Jan Buys, Li Du, Maxwell Forbes, and Yejin Choi. 2019. The curious case of neural text degeneration. In International Conference on Learning Representations.
|
| 320 |
+
Tenghao Huang, Faeze Brahman, Vered Shwartz, and Snigdha Chaturvedi. 2021. Uncovering implicit gender bias in narratives through commonsense inference. In *Findings of the Association for Computational Linguistics: EMNLP* 2021, pages 3866-3873, Punta Cana, Dominican Republic. Association for Computational Linguistics.
|
| 321 |
+
Parag Jain, Priyanka Agrawal, Abhijit Mishra, Mohak Sukhwani, Anirban Laha, and Karthik Sankaranarayanan. 2017. Story generation from sequence of independent short descriptions. arXiv preprint arXiv:1707.05501.
|
| 322 |
+
Andre Jolles. 2017. Simple forms: Legend, saga, myth, riddle, saying, case, memorabile, fairytale, joke. Verso Books.
|
| 323 |
+
Anna Kasunic and Geoff Kaufman. 2018. Learning to listen: Critically considering the role of AI in human storytelling and character creation. In Proceedings of the First Workshop on Storytelling, pages 1-13, New Orleans, Louisiana. Association for Computational Linguistics.
|
| 324 |
+
John Langford and Tong Zhang. 2007. The epochgreedy algorithm for contextual multi-armed bandits. Advances in neural information processing systems, 20(1):96-1.
|
| 325 |
+
Lihong Li, Wei Chu, John Langford, and Robert E Schapire. 2010. A contextual-bandit approach to personalized news article recommendation. In Proceedings of the 19th international conference on World wide web, pages 661-670.
|
| 326 |
+
Zhiyu Lin and Mark Riedl. 2021. Plug-and-blend: A framework for controllable story generation with blended control codes. In Proceedings of the Third Workshop on Narrative Understanding, pages 62–71, Virtual. Association for Computational Linguistics.
|
| 327 |
+
|
| 328 |
+
Danyang Liu, Juntao Li, Meng-Hsuan Yu, Ziming Huang, Gongshen Liu, Dongyan Zhao, and Rui Yan. 2020. A character-centric neural model for automated story generation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 1725-1732.
|
| 329 |
+
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.
|
| 330 |
+
Fuli Luo, Damai Dai, Pengcheng Yang, Tianyu Liu, Baobao Chang, Zhifang Sui, and Xu Sun. 2019. Learning to control the fine-grained sentiment for story ending generation. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 6020-6026, Florence, Italy. Association for Computational Linguistics.
|
| 331 |
+
Brian Massumi. 2002. Parables for the Virtual: Movement, Affect, Sensation. Duke University Press, Durham, NC.
|
| 332 |
+
Clara Meister, Tiago Pimentel, Gian Wihar, and Ryan Cotterell. 2023. Locally typical sampling. Transactions of the Association for Computational Linguistics, 11:102-121.
|
| 333 |
+
Saif 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 (Volume 1: Long Papers), pages 174-184, Melbourne, Australia. Association for Computational Linguistics.
|
| 334 |
+
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.
|
| 335 |
+
Jessica Ouyang and Kathleen McKeown. 2015. Modeling reportable events as turning points in narrative. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pages 2149-2158.
|
| 336 |
+
Nanyun Peng, Marjan Ghazvininejad, Jonathan May, and Kevin Knight. 2018. Towards controllable story generation. In Proceedings of the First Workshop on Storytelling, pages 43-49, New Orleans, Louisiana. Association for Computational Linguistics.
|
| 337 |
+
Xiangyu Peng, Siyan Li, Sarah Wiegreffe, and Mark Riedl. 2022. Inferring the reader: Guiding automated story generation with commonsense reasoning. In *Findings of the Association for Computational Linguistics: EMNLP* 2022, pages 7008-7029, Abu Dhabi, United Arab Emirates. Association for Computational Linguistics.
|
| 338 |
+
|
| 339 |
+
Rafael Pérez Y Pérez and Mike Sharples. 2001. Mex-ica: A computer model of a cognitive account of creative writing. Journal of Experimental & Theoretical Artificial Intelligence, 13(2):119-139.
|
| 340 |
+
Julie Porteous and Marc Cavazza. 2009. Controlling narrative generation with planning trajectories: the role of constraints. In Interactive Storytelling: Second Joint International Conference on Interactive Digital Storytelling, ICIDS 2009, Guimarães, Portugal, December 9-11, 2009. Proceedings 2, pages 234-245. Springer.
|
| 341 |
+
Ratish Puduppully, Li Dong, and Mirella Lapata. 2019. Data-to-text generation with content selection and planning. In Proceedings of the AAAI conference on artificial intelligence, volume 33, pages 6908-6915.
|
| 342 |
+
Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. 2019. Language models are unsupervised multitask learners.
|
| 343 |
+
Andrew J Reagan, Lewis Mitchell, Dilan Kiley, Christopher M Danforth, and Peter Sheridan Dodds. 2016. The emotional arcs of stories are dominated by six basic shapes. *EPJ Data Science*, 5(1):1-12.
|
| 344 |
+
Mark O Riedl and Robert Michael Young. 2010. Narrative planning: Balancing plot and character. Journal of Artificial Intelligence Research, 39:217-268.
|
| 345 |
+
Melissa Roemmele. 2021. Inspiration through observation: Demonstrating the influence of automatically generated text on creative writing.
|
| 346 |
+
Gregory Schraw, Terri Flowerday, and Stephen Lehman. 2001. Increasing situational interest in the classroom. Educational Psychology Review, 13:211-224.
|
| 347 |
+
Matthew Sims, Jong Ho Park, and David Bamman. 2019. Literary event detection. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 3623-3634, Florence, Italy. Association for Computational Linguistics.
|
| 348 |
+
Ed S Tan and Barbara Trans Fasting. 1996. Emotion and the structure of narrative film: Film as an emotion machine.
|
| 349 |
+
Chongyang Tao, Lili Mou, Dongyan Zhao, and Rui Yan. 2018. Rubber: An unsupervised method for automatic evaluation of open-domain dialog systems. In Proceedings of the AAAI conference on artificial intelligence, volume 32.
|
| 350 |
+
William R Thompson. 1933. On the likelihood that one unknown probability exceeds another in view of the evidence of two samples. Biometrika, 25(3-4):285-294.
|
| 351 |
+
David Thue, Vadim Bulitko, Marcia Spetch, and Eric Wasylishen. 2007. Interactive storytelling: A player modelling approach. In Proceedings of the AAAI Conference on Artificial Intelligence and Interactive Digital Entertainment, volume 3, pages 43-48.
|
| 352 |
+
|
| 353 |
+
Prashanth Vijayaraghavan and Deb Roy. 2023. M-sense: Modeling narrative structure in short personal narratives using protagonist's mental representations. arXiv preprint arXiv:2302.09418.
|
| 354 |
+
Anvesh Rao Vijjini, Faeze Brahman, and Snigdha Chaturvedi. 2022. Towards inter-character relationship-driven story generation. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 8970-8987, Abu Dhabi, United Arab Emirates. Association for Computational Linguistics.
|
| 355 |
+
PeiFeng Wang, Jonathan Zamora, Junfeng Liu, Fangyu Liu, Muhao Chen, and Xiang Ren. 2021. Contextualized scene imagination for generative commonsense reasoning. In International Conference on Learning Representations.
|
| 356 |
+
Zhilin Wang, Anna Jafarpour, and Maarten Sap. 2022. Uncovering surprising event boundaries in narratives. In Proceedings of the 4th Workshop of Narrative Understanding (WNU2022), pages 1-12, Seattle, United States. Association for Computational Linguistics.
|
| 357 |
+
David Wilmot and Frank Keller. 2020. Modelling suspense in short stories as uncertainty reduction over neural representation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 1763-1788, Online. Association for Computational Linguistics.
|
| 358 |
+
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.
|
| 359 |
+
Lili Yao, Nanyun Peng, Ralph Weischedel, Kevin Knight, Dongyan Zhao, and Rui Yan. 2019. Plan-and-write: towards better automatic storytelling. In Proceedings of the Thirty-Third AAAI Conference on Artificial Intelligence.
|
| 360 |
+
Fangzhou Zhai, Vera Demberg, Pavel Shkadzko, Wei Shi, and Asad Sayeed. 2019. A hybrid model for globally coherent story generation. In Proceedings of the Second Workshop on Storytelling, pages 34-45, Florence, Italy. Association for Computational Linguistics.
|
| 361 |
+
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 Systems (HumEval), pages 25-33, Online. Association for Computational Linguistics.
|
| 362 |
+
Zhexin Zhang, Jiaxin Wen, Jian Guan, and Minlie Huang. 2022. Persona-guided planning for controlling the protagonist's persona in story generation. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies,
|
| 363 |
+
|
| 364 |
+
pages 3346-3361, Seattle, United States. Association for Computational Linguistics.
|
| 365 |
+
Zhenjie Zhao, Yufang Hou, Dakuo Wang, Mo Yu, Chengzhong Liu, and Xiaojuan Ma. 2022. Educational question generation of children storybooks via question type distribution learning and event-centric summarization. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 5073-5085, Dublin, Ireland. Association for Computational Linguistics.
|
| 366 |
+
|
| 367 |
+
# A HIT Example
|
| 368 |
+
|
| 369 |
+

|
| 370 |
+
Figure 4 illustrates a screenshot of the form presented to the annotators on the AMT.
|
| 371 |
+
Figure 4: Screenshot of the AMT survey used for human evaluations in §5.3
|
| 372 |
+
|
| 373 |
+
# B Prompts for LLM
|
| 374 |
+
|
| 375 |
+
In our exploration, we investigated multiple prompt optimization techniques. Initially, we utilized demonstrations as a potential avenue. Yet, as illustrated in Table Tab. 6, it became evident that the resultant narrative exhibited a significant degree of repetitiveness with the given demonstration. An attempt to introduce diversity by leveraging a varied ensemble of demonstrations did not yield improvements in reducing narrative redundancy. Subsequently, we explored the incorporation of specific keywords within prompts to guide the generative process. For instance, by prompting LLM "Write a five-sentence interesting story with mystery", we observed that while such specificity could yield captivating narratives, they bore a recurring thematic redundancy. To exemplify, from a sample of ten stories generated using the "mystery-enhanced" prompt, it was observed that seven out of ten generated stories converged around the theme of a hidden secret being revealed towards the conclusion. Representative narratives included scenarios such as a photographer unveiling a mystery within a haunted lighthouse, a young woman unearthing a concealed garden, and an individual discerning a hidden cache of treasure, etc. In consideration of these findings, and without loss of generality, we opted for the current prompt for subsequent generations.
|
| 376 |
+
|
| 377 |
+
# C Stories with Annotator Preferences
|
| 378 |
+
|
| 379 |
+
Table 8 shows more sample stories generated by GPT-3 and AFFGEN. We present detailed qualita
|
| 380 |
+
|
| 381 |
+
<table><tr><td>Speaker</td><td>Content</td></tr><tr><td>User</td><td>Here is an interesting story. "Melissa invited Mark to the park for a picnic. The weather turned bad when thunder hit. Mark and Melissa decided to wait out the storm, and when the rain cleared, they had the most romantic picnic they'd ever experienced, watching the sun set over the park". Write an interesting story based on the context "Tom is going to fish on Saturday". The story should be five-sentence long and 60 words maxi-mum.</td></tr><tr><td>ChatGPT</td><td>Tom eagerly awaited Saturday, planning a day of fishing at his beloved lakeside spot. As dawn broke, he cast his line, lost in the tranquility. Suddenly, dark clouds loomed, and rain poured down. Seeking refuge under a tree, he met Sarah, another angler. The rain ceased, but Tom left with a newfound friend and a heartwarming memory.</td></tr></table>
|
| 382 |
+
|
| 383 |
+
Table 6: Attempt to optimize prompts through demonstration
|
| 384 |
+
|
| 385 |
+
<table><tr><td>Task</td><td>Prompts for LLM</td></tr><tr><td>GPT-3 infilling</td><td>"Continue writing a story using the following context, <context>. The total length of the story should be <n> sentences. The total words limit is <n*12> words."</td></tr><tr><td>GPT-3</td><td>"Continue writing an interesting story using the following context, <context>. The total length of the story should be <n> sentences. The total words limit is 60 words."</td></tr><tr><td>ChatGPT</td><td>"Write a five-sentence interesting short story using the following sentence as the first sentence: <context)."</td></tr></table>
|
| 386 |
+
|
| 387 |
+
Table 7: Prompts for Large Language Models
|
| 388 |
+
|
| 389 |
+
tive analysis in $\S 5.8$
|
| 390 |
+
|
| 391 |
+
# D Error Analysis
|
| 392 |
+
|
| 393 |
+
Table 9 shows some examples of story pairs in which the judges did not prefer AFFGEN's stories over GPT-3's stories and their explanations. We present detailed qualitative analysis in §5.9.
|
| 394 |
+
|
| 395 |
+
<table><tr><td>ID</td><td>Baseline</td><td>AFFGEN story</td><td>Explanation</td></tr><tr><td>1</td><td>Melissa invited Mark to the park for a picnic. They had a great time, playing games and eating the delicious food she had prepared. They laughed, talked and made plans for their future. It was a perfect day that they would remember forever.</td><td>Melissa invited Mark to the park for a picnic. The weather turned bad when thunder hit. Mark and Melissa decided to wait out the storm, and when the rain cleared, they had the most romantic picnic they'd ever experienced, watching the sun set over the park.</td><td><AFFGEN's> story is more romantic.</td></tr><tr><td>2</td><td>Ella wrote her grandma a letter, filled with stories about her first day at school. She told her about the new friends she made, the lunch she had, and the fun she had learning. Grandma was so proud of her, and Ella couldn't wait to get a letter back.</td><td>Ella wrote her grandma a letter. Ella's grandma wrote back with an unexpected news. Her favorite aunt died unexpectedly of cancer! Ella was sad-denied to hear the news, but was also comforted in knowing that her aunt had lived a full and happy life.</td><td>Emotional condolences gives <AFFGEN's> story an interesting and sad theme</td></tr><tr><td>3</td><td>Jen has a big test tomorrow and she's determined to ace it. She spends hours studying, memorizing facts and theories, and rehearsing for the exam. She knows she's ready and is confident that she'll get the grade she desires.</td><td>Jen has a big test tomorrow. Jen stayed up all night studying, but still felt un-prepared. Her roommate surprised and excited with good news! She had found out that the professor had decided to give everyone an extra day to study for the test.</td><td>The <Baseline> story has no bumps, it's so banal</td></tr></table>
|
| 396 |
+
|
| 397 |
+
Table 8: More sample stories generated by GPT-3 and AFFGEN. As indicated by the judge, AFFGEN's story is more preferred by annotators in various aspects.
|
| 398 |
+
|
| 399 |
+
<table><tr><td>ID</td><td>Baseline</td><td>AFFGEN story</td><td>Explanation</td></tr><tr><td>1</td><td>Hazel wished for blue eyes every night, but her green gaze never changed. She felt like a different person with blue eyes; she was sure they'd bring her the confidence she craved. One day, she found a mysterious pair of blue contacts. She put them on, and it was like a whole new world opened up for her.</td><td>Hazel's eyes were green, but she really wanted blue eyes. The school offered special free sunglasses! Hazel was al-ways envious of her friends' blue eyes. With the school's offer of free sun-glasses, she was determined to make her dream come true. She put on the sunglasses and instantly felt like she had the most beautiful blue eyes in the world.</td><td>The <Baseline> story is interesting</td></tr><tr><td>2</td><td>We went out last night, dancing and laughing the night away. I had the time of my life, and I felt like nothing could stop us. I never wanted the night to end, and I will never forget it.</td><td>We went out last night. My girlfriend was excited to meet new friends! We had a great time, and my girlfriend made a few new friends. We stayed out late, and although I was tired, I was happy to see her having a good time. We both agreed it was a great night out and we can't wait to do it again.</td><td>The <AFFGEN > story has too much repetitions and is basically dull, the first one sounds very au-thENTIC</td></tr><tr><td>3</td><td>Joan chased Janet around the play-ground, yelling for her to give back his gum. Janet laughed and kept running, eventually out of sight. Joan stomped back to his friends, still mad but with a plan. He would get his gum back, no matter what.</td><td>Joan got mad when Janet stole his gum. Not wanting to be outdone, Joan de-cided to steal something back. Her favorite toy car broke loose. Joan snatched Janet's favorite stuffed anim-al and ran away with it. Janet chased after Joan, but she was too late, as the toy car had already reached its destina-tion.</td><td><AFFGEN > story does not make sense.</td></tr></table>
|
| 400 |
+
|
| 401 |
+
Table 9: Error analysis
|
| 402 |
+
|
| 403 |
+
<table><tr><td>ID</td><td>Vanilla ChatGPT</td><td>Expanded AFFGEN story</td></tr><tr><td>1</td><td>Melissa invited Mark to the park for a picnic. It was a sunny Saturday, perfect for their long-awaited rendezvous. Melissa had spent hours preparing sandwiches, fruit salads, and homemade lemonade. As they spread out the checkered blanket, Mark noticed a curious twinkle in Melissa's eye.
|
| 404 |
+
"What's the surprise?" he asked.
|
| 405 |
+
With a mischievous grin, she pulled out a vintage camera.
|
| 406 |
+
"I thought we could capture memories today."
|
| 407 |
+
They laughed, took goofy selfies, and snapped candid shots of each other. The sun cast a warm glow, creating a picturesque backdrop.
|
| 408 |
+
Later, Melissa reached into her bag, revealing a small book. It was a scrapbook, filled with their past adventures together. Tears welled in Mark's eyes as he flipped through the pages, reminiscing about their journey as friends turned soulmates.
|
| 409 |
+
As the sun set, they stargazed, cherishing the memories they had created that day and adding another chapter to their beautiful story.</td><td>Melissa had planned the perfect picnic for Mark at their favorite park. The day started off sunny, but as they laid out their blanket and unpacked their delicious spread, omni- clouds gathered overhead. Suddenly, a deafening clap of thunder echoed through the park, sending them scrambling for cover.
|
| 410 |
+
Huddled under a nearby tree, Mark and Melissa exchanged nervous laughter. As the rain poured down around them, they found themselves sharing stories, dreams, and even a few stolen kisses. Time seemed to stand still as the storm raged on.
|
| 411 |
+
When the last raindrop fell and the sun emerged from behind the clouds, Mark and Melissa emerged from their shelter, hand in hand. The park glistened with fresh rain, and the sky painted itself in shades of pink and orange as the sun began its descent. They sat down on their damp blanket, feeling closer than ever, and savored their makeshift romantic picnic as they watched the sun set over the park. It turned out to be an unforgettable day, filled with unexpected magic.</td></tr><tr><td>2</td><td>Ella wrote her grandma a letter, her small hand gripping the pencil tightly. She missed her visits to Grandma's cozy cottage in the woods, where they would bake cookies and read stories by the crackling fireplace. In her letter, Ella poured her heart out. She shared her adventures, like the time she found a rainbow-colored caterpillar or built a secret fort in the backyard. She also drew pictures of her favorite memories, hoping Grandma could see them through the words. Days turned into weeks, and Ella anxiously checked the mailbox. Then, one sunny morning, a letter arrived. Excitement danced in her eyes as she tore it open. Inside was a heartfelt response, filled with love and wisdom, reminding Ella of the magical moments they had shared. With Grandma's letter in her hand, Ella felt like she was holding a piece of their cherished cottage. She knew that no distance could break the bond they shared, and that their love would continue to grow through letters, just like the flowers in Grandma's garden.</td><td>Ella, with tears in her eyes, carefully penned a heartfelt letter to her beloved grandma, sharing her recent adventures and school triumphs. Weeks passed, and to her surprise, a letter from her grandma arrived, the envelope trembling in her hands. Ella eagerly unfolded the letter, only to be met with heart-wrenching news: her favorite aunt had suc-cumbed to an unexpected battle with cancer.
|
| 412 |
+
Tears streamed down Ella's cheeks as she absorbed the painful words. Memories of her aunt's infectious laughter and warm hugs flooded her mind. Despite the sorrow, she found solace in her grandma's words. Her aunt had lived a life filled with boundless love, adventures, and cherished moments. She had been a beacon of positivity, spreading happiness wherever she went.
|
| 413 |
+
Ella vowed to honor her aunt's legacy by embracing life with the same zest and determination. Though her heart ached, she knew her aunt's spirit would continue to inspire and guide her through the ups and downs of life.</td></tr><tr><td>3</td><td>Jen had a big test tomorrow, and her nerves were getting the best of her. She had spent countless hours studying, poring over textbooks, and reviewing notes, but anxiety still gnawed at her. The weight of the impending test loomed over her like a dark cloud.
|
| 414 |
+
She tried to calm herself with deep breaths and a reassuring pep talk. "You've prepared as best as you can, Jen," she whispered to herself. "You know the material. You've got this."
|
| 415 |
+
Jen's friends, knowing the stress she was under, decided to surprise her. They showed up at her doorstep with a homemade dinner, colorful sticky notes of encouragement, and their unwavering support. Together, they created a cozy study space filled with laughter and motivation.
|
| 416 |
+
As the night wore on, Jen's anxiety began to subside. With her friends by her side, she felt a renewed sense of confidence and determination. She knew that no matter what the test held, she had the support of some incredible friends who believed in her.</td><td>Jen had a big test tomorrow, and anxiety gnawed at her as she burned the midnight oil, pouring over textbooks and notes. Hours passed, her eyelids heavy, but she still felt unprepared. Doubt clung to her like a stubborn shadow.
|
| 417 |
+
Just as the clock struck midnight, her roommate, Sarah, burst into the room with a grin that could light up a stadium. Breathless and excited, she shared the unexpected news: the professor had decided to give everyone an extra day to study for the test.
|
| 418 |
+
Jen's heart swelled with relief and gratitude. It was like a lifeline thrown to a drowning swimmer. Tears of joy welled up in her eyes as she hugged Sarah tightly. The universe had given her a second chance, and she wasn't going to waste it. She spent the next day revising her notes and feeling more confident with every passing hour.
|
| 419 |
+
When she finally walked into the exam hall, she was armed not only with knowledge but also with the indomitable spirit of resilience that had seen her through the long night.</td></tr></table>
|
| 420 |
+
|
| 421 |
+
Table 10: Comparison between vanilla ChatGPT stories and expanded AFFGEN's stories. We used ChatGPT for story expansion. We instructed the model with the following prompt "Expand the story to 150 words. The story should be interesting. <AFFGEN-generated plots>". While narratives generated by the vanilla ChatGPT model tend to be straightforward and lack of dramatic flair, the narratives produced by the expanded AFFGEN-generated approach exhibit dramatic undertones, contributing to a more captivating reading experience.
|
affectiveanddynamicbeamsearchforstorygeneration/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:41562a067437508eedd31f84ad30434d0aaf11e243bb45a438038b07def63ef4
|
| 3 |
+
size 1309164
|
affectiveanddynamicbeamsearchforstorygeneration/layout.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b55922011a03188e0123fdaec431f2567e3fce51ac8514a6b9f16f0cb8467965
|
| 3 |
+
size 462575
|
afriqacrosslingualopenretrievalquestionansweringforafricanlanguages/e56b1448-07ee-43bd-9b89-296c60fbb8a9_content_list.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fc085927349647ad6ee62fa0a8a60824618fdb0b3c38d278e2f71fe0ce84eb06
|
| 3 |
+
size 114479
|
afriqacrosslingualopenretrievalquestionansweringforafricanlanguages/e56b1448-07ee-43bd-9b89-296c60fbb8a9_model.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f3857e55156df8b4793114e614518329070c4b40dff03a86dcd64e374b6d1c77
|
| 3 |
+
size 133346
|
afriqacrosslingualopenretrievalquestionansweringforafricanlanguages/e56b1448-07ee-43bd-9b89-296c60fbb8a9_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:748b0615dfdea19e49dea11f6f785ba3f055498acb0656176239688cf09104cd
|
| 3 |
+
size 278161
|
afriqacrosslingualopenretrievalquestionansweringforafricanlanguages/full.md
ADDED
|
@@ -0,0 +1,359 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# AfriQA: Cross-lingual Open-Retrieval Question Answering for African Languages
|
| 2 |
+
|
| 3 |
+
Odunayo Ogundepo $^{1,\ast,\ast}$ , Tajuddeen R. Gwadabe $^{*,*}$ , Clara E. Rivera $^{2}$ , Jonathan H. Clark $^{2}$ , Sebastian Ruder $^{2}$ , David Ifeoluwa Adelani $^{3,\ast}$ , Bonaventure F. P. Dossou $^{4,5,6,\ast}$ , Abdou Aziz DIOP $^{7,\ast}$ , Claytone Sikasote $^{10,\ast}$ , Gilles Hacheme $^{9,\ast}$ , Happy Buzaaba $^{15,\ast}$ , Ignatius Ezeani $^{14,\ast}$ , Rooweither Mabuya $^{16}$ , Salomey Osei $^{*}$ , Chris Emezue $^{13,\ast}$ , Albert Njoroge Kahira $^{17,\ast}$ , Shamsuddeen Hassan Muhammad $^{18,31,\ast}$ , Akintunde Oladipo $^{1,\ast}$ , Abraham Toluwase Owodunni $^{*}$ , Atnafu Lambebo Tonja $^{12,6,\ast}$ , Iyanuoluwa Shode $^{11,\ast}$ , Akari Asai $^{8}$ , Tunde Oluwaseyi Ajayi $^{19,\ast}$ , Clemencia Siro $^{20,\ast}$ , Steven Arthur $^{21,\ast}$ , Mofetoluwa Adeyemi $^{1,\ast}$ , Orevaoghene Ahia $^{8,\ast}$ , Anuoluwapo Aremu $^{*}$ , Oyinkansola Awosan $^{*}$ , Chiamaka Chukwuneke $^{*}$ , Bernard Opoku $^{22,\ast}$ , Awokoya Ayodele $^{23,\ast}$ , Verrah Otiene $^{24,\ast}$ , Christine Mwase $^{25,\ast}$ , Boyd Sinkala $^{10,\ast}$ , Andre Niyongabo Rubungo $^{26,\ast}$ , Daniel A. Ajisafe $^{27,\ast}$ , Emeka Felix Onwuegbuzia $^{23,\ast}$ , Habib Mbow $^{28,\ast}$ , Emile Niyomutabazi $^{29,\ast}$ , Eunice Mukonde $^{10,\ast}$ , Falalu Ibrahim Lawan $^{30,\ast}$ , Ibrahim Said Ahmad $^{31,\ast}$ , Jesujoba O. Alabi $^{32,\ast}$ , Martin Namukombo $^{33,\ast}$ , Mbonu Chinedu $^{35,\ast}$ , Mofya Phiri $^{10,\ast}$ , Neo Putini $^{25,\ast}$ , Ndumiso Mngoma $^{31,\ast}$ , Priscilla A. Amuok $^{*}$ , Ruqayya Nasir Iro $^{32,\ast}$ , Sonia Adhiambo $^{34,\ast}$
|
| 4 |
+
|
| 5 |
+
$^{*}$ Masakhane NLP, $^{1}$ University of Waterloo, Canada, $^{2}$ Google Research, $^{3}$ University College London, $^{4}$ Mila Quebec AI Institute, $^{5}$ McGill University, $^{6}$ Lelapa AI, $^{7}$ GalsenAI,
|
| 6 |
+
|
| 7 |
+
<sup>8</sup>University of Washington, <sup>9</sup>Ai4Innov, <sup>10</sup> University of Zambia, <sup>11</sup>Montclair State University,
|
| 8 |
+
|
| 9 |
+
$^{12}$ Instituto Politécnico Nacional, Mexico, $^{13}$ Technical University of Munich, $^{14}$ Lancaster University,
|
| 10 |
+
|
| 11 |
+
$^{15}$ RIKEN Center for AIP, $^{16}$ South African Centre for Digital Language Resources, $^{17}$ Jülich Supercomputing Centre,
|
| 12 |
+
|
| 13 |
+
<sup>18</sup>University of Porto,<sup>19</sup>Insight Centre for Data Analytics, <sup>20</sup>University of Amsterdam, <sup>21</sup>Accra Institute of Technology,
|
| 14 |
+
|
| 15 |
+
$^{22}$ Kwame Nkrumah University of Science and Technology, $^{23}$ University of Ibadan, $^{24}$ Tom Mboya University
|
| 16 |
+
|
| 17 |
+
$^{25}$ Fudan University, $^{26}$ University of Electronic Science and Technology of China, $^{27}$ The University of British Columbia,
|
| 18 |
+
|
| 19 |
+
28 African Master in Machine Intelligence,29 College de Rebero,30 Kaduna State University,31 Bayero University Kano
|
| 20 |
+
|
| 21 |
+
$^{32}$ Saarland University, Germany, $^{33}$ University of Edinburgh, $^{34}$ Kenyatta University, $^{35}$ Nnamdi Azikiwe University
|
| 22 |
+
|
| 23 |
+
# Abstract
|
| 24 |
+
|
| 25 |
+
African languages have far less in-language content available digitally, making it challenging for question-answering systems to satisfy the information needs of users. Cross-lingual open-retrieval question answering (XOR QA) systems—those that retrieve answer content from other languages while serving people in their native language—offer a means of filling this gap. To this end, we create AFRIQA, the first cross-lingual QA dataset with a focus on African languages. AFRIQA includes $12,000+$ XOR QA examples across 10 African languages. While previous datasets have focused primarily on languages where cross-lingual QA augments coverage from the target language, AFRIQA focuses on languages where cross-lingual answer content is the only high-coverage source of answer content. Because of this, we argue that African languages are one of the most important and realistic use cases for XOR QA. Our experiments demonstrate the poor performance of automatic trans
|
| 26 |
+
|
| 27 |
+
lation and multilingual retrieval methods. Overall, AFRIQA proves challenging for state-of-the-art QA models. We hope that the dataset enables the development of more equitable QA technology. $^{1}$
|
| 28 |
+
|
| 29 |
+
# 1 Introduction
|
| 30 |
+
|
| 31 |
+
Question Answering (QA) systems provide access to information (Kwiatkowski et al., 2019) and increase accessibility in a range of domains, from healthcare and health emergencies such as COVID-19 (Möller et al., 2020; Morales et al., 2021) to legal queries (Martinez-Gil, 2021) and financial questions (Chen et al., 2021). Many of these applications are particularly important in regions where information and services may be less accessible and where language technology may thus help to reduce the burden on the existing system. At the same time, many people prefer to access information in their local languages—or simply do not speak a
|
| 32 |
+
|
| 33 |
+
<sup>1</sup>The data is available at: https://github.com/masakhane-io/afriqa and https://huggingface.co/datasets/masakhane/afriqa
|
| 34 |
+
|
| 35 |
+
<table><tr><td>Dataset</td><td>QA?</td><td>CLIR?</td><td>Open Retrieval?</td><td># Languages</td><td># African Languages</td></tr><tr><td>XQA (Liu et al., 2019)</td><td>✓</td><td>✓</td><td>✓</td><td>9</td><td>Nil</td></tr><tr><td>XOR QA (Asai et al., 2021)</td><td>✓</td><td>✓</td><td>✓</td><td>7</td><td>Nil</td></tr><tr><td>XQuAD (Artetxe et al., 2020)</td><td>✓</td><td>✗</td><td>✗</td><td>11</td><td>Nil</td></tr><tr><td>MLQA (Lewis et al., 2020)</td><td>✓</td><td>✗</td><td>✗</td><td>7</td><td>Nil</td></tr><tr><td>MKQA (Longpre et al., 2021)</td><td>✓</td><td>✗</td><td>✓</td><td>26</td><td>Nil</td></tr><tr><td>TyDi QA (Clark et al., 2020)</td><td>✓</td><td>✗</td><td>✓</td><td>11</td><td>1</td></tr><tr><td>AmQA (Abedissa et al., 2023)</td><td>✓</td><td>✗</td><td>✗</td><td>1</td><td>1</td></tr><tr><td>KenSwQuAD (Wanjawa et al., 2023)</td><td>✓</td><td>✗</td><td>✗</td><td>1</td><td>1</td></tr><tr><td>AFRIQA (Ours)</td><td>✓</td><td>✓</td><td>✓</td><td>10</td><td>10 (see Table 3)</td></tr></table>
|
| 36 |
+
|
| 37 |
+
Table 1: Comparison of the Dataset with Other Question Answering Datasets. This table provides a comparison of the current dataset used in the study with other related datasets. The first, second, and third columns, “QA”, “CLIR”, and “Open Retrieval”, indicate whether the dataset is question answering, cross-lingual or open retrieval, respectively. The fourth column, "# Languages", shows the total number of languages in the dataset. The final column lists the African languages present in the dataset.
|
| 38 |
+
|
| 39 |
+
language supported by current language technologies (Amano et al., 2016). To benefit the more than three billion speakers of under-represented languages around the world, it is thus crucial to enable the development of QA technology in local languages.
|
| 40 |
+
|
| 41 |
+
Standard QA datasets mainly focus on English (Joshi et al., 2017; Mihaylov et al., 2018; Kwiatkowski et al., 2019; Sap et al., 2020). While some reading comprehension datasets are available in other high-resource languages (Ruder and Sil, 2021), only a few QA datasets (Clark et al., 2020; Asai et al., 2021; Longpre et al., 2021) cover a typologically diverse set of languages—and very few datasets include African languages (see Table 1).
|
| 42 |
+
|
| 43 |
+
In this work, we lay the foundation for research on QA systems for one of the most linguistically diverse regions by creating AFRIQA, the first QA dataset for 10 African languages. AFRIQA focuses on open-retrieval QA where information-seeking questions<sup>2</sup> are paired with retrieved documents in which annotators identify an answer if one is available (Kwiatkowski et al., 2019). As many African languages lack high-quality in-language content online, AFRIQA employs a cross-lingual setting (Asai et al., 2021) where relevant passages are retrieved in a high-resource language spoken in the corresponding region and answers are translated into the source language. To ensure utility of this dataset, we carefully select a relevant source
|
| 44 |
+
|
| 45 |
+
language (either English or French) based on its prevalence in the region corresponding to the query language. AFRIQA includes $12,000+$ examples across 10 languages spoken in different parts of Africa. The majority of the dataset's questions are centered around entities and topics that are closely linked to Africa. This is an advantage over simply translating existing datasets into these languages. By building a dataset from the ground up that is specifically tailored to African languages and their corresponding cultures, we are able to ensure better contextual relevance and usefulness of this dataset.
|
| 46 |
+
|
| 47 |
+
We conduct baseline experiments for each part of the open-retrieval QA pipeline using different translation systems, retrieval models, and multilingual reader models. We demonstrate that crosslingual retrieval still has a large deficit compared to automatic translation and retrieval; we also show that a hybrid approach of sparse and dense retrieval improves over either technique in isolation. We highlight interesting aspects of the data and discuss annotation challenges that may inform future annotation efforts for QA. Overall, AFRIQA proves challenging for state-of-the-art QA models. We hope that AFRIQA encourages and enables the development and evaluation of more multilingual and equitable QA technology. The dataset will be released under the Creative Commons Attribution 4.0 International (CC BY 4.0) license.
|
| 48 |
+
|
| 49 |
+
In summary, we make the following contributions:
|
| 50 |
+
|
| 51 |
+
- We introduce the first cross-lingual question answering dataset with $12,000+$ questions across 10 geographically diverse African languages. This dataset directly addresses
|
| 52 |
+
|
| 53 |
+
<table><tr><td>lang</td><td>QuestionQL(Translation Qpl)</td><td>Relevant Passage Pl</td><td>Answer Apl(Translation AL)</td></tr><tr><td>hau</td><td>Jahohi nawa ne a kasar Malaysia?banga? (How many states are there in Malaysia?)</td><td>The states and federal territories of Malaysia are the principal administrative divisions of Malaysia. Malaysia is a federation of 13 states (Negeri) and 3 federal territories.</td><td>13 (13)</td></tr><tr><td>bem</td><td>Bushe Mwanawasa stadium ingisha abantu banga? (What is the capacity of Mwanawasa Stadium?)</td><td>The Levy Mwanawasa Stadium is a multi-purpose stadium in Ndola, Zambia. It is used mostly for football matches. The stadium has a capacity of 49,800 people.</td><td>49,800 people (Abantu 49800)</td></tr><tr><td>wol</td><td>Man po moo niroo ag powum Softbal? (Quel sport ressemble beaucoup au softball?)</td><td>Ce sport est un descendant direct du baseball (afin de différencier les deux) mais diffère de ce dernier par différents aspects dont les cinq principaux sont les suivants.</td><td>baseball (Bas-bal)</td></tr></table>
|
| 54 |
+
|
| 55 |
+
Table 2: Table showing selected questions, relevant passages, and answers in different languages from the dataset. It also includes the human-translated versions of both questions and answers. For the primary XOR QA task, systems are expected to find the relevant passage among all Wikipedia passages, not simply the gold passage shown above.
|
| 56 |
+
|
| 57 |
+
the deficit of African languages in existing datasets.
|
| 58 |
+
|
| 59 |
+
- We conduct an analysis of the linguistic properties of the 10 languages, which is crucial to take into account when formulating questions in these languages.
|
| 60 |
+
- Finally, we conduct a comprehensive evaluation of the dataset for each part of the open-retrieval QA pipeline using various translation systems, retrieval models, and multilingual reader models.
|
| 61 |
+
|
| 62 |
+
# 2 AFRIQA
|
| 63 |
+
|
| 64 |
+
AFRIQA is a cross-lingual QA dataset that was created to promote the representation and coverage of under-resourced African languages in NLP research. We show examples of the data in Table 2. In §2.1, we provide an overview of the 10 languages discussing their linguistic properties, while §2.2 and §2.3 describe the data collection procedure and quality control measures put in place to ensure the quality of the dataset.
|
| 65 |
+
|
| 66 |
+
# 2.1 Discussion of Languages
|
| 67 |
+
|
| 68 |
+
African languages have unique typologies, grammatical structures, and phonology, many of them being tonal and morphologically rich (Adelani et al., 2022b). We provide a high-level overview of the linguistic properties of the ten languages in AFRIQA that are essential to consider when crafting questions for QA systems.
|
| 69 |
+
|
| 70 |
+
Bemba, a morphologically rich Bantu language, uses affixes to alter grammatical forms. Com-
|
| 71 |
+
|
| 72 |
+
mon question words in Bemba include "cinshi" (what), "naani"(who), "liisa" (when), "mulandunshi" (why), "ciisa" (which), "kwi/kwiisa" (where), and "shaani" (how).
|
| 73 |
+
|
| 74 |
+
Fon is an isolating language in terms of morphology typology. Common question wh-words in Fon are Eté(what), Mε (who), Hwétenu (when), Aniwú (why), de tε (which) and Fitε (where).
|
| 75 |
+
|
| 76 |
+
Hausa is the only Afro-Asiatic language in AFRIQA. It typically makes use of indicative words for changes to the grammatical forms within a sentence, such as negation, tenses, and plurality. For example, "hula" (cap) – "huluna" (caps), "mace" (girl) – "mataye" (girls). Typical question wh-words used are "me/ya" (what), "wa"(who), "yaushe" (when), "dan me/akan me" (why), "wanne" (which), "ina/ a ina" (where), and "yaya/qaqa" (how).
|
| 77 |
+
|
| 78 |
+
Igbo is a morphologically rich language and most changes in grammatical forms (negations, questions) can be embedded in a single word or by varying the tone. Question words are often preceded by "kedu" or "gini" like "kedu/gini" (what), "onye/kedu onye" (who), "kedu mgbe" (when), "gini mere/gini kpatara" (why), "kedu nke" (which), "ebee" (where), and "kedu ka" or "kedu etu" (how).
|
| 79 |
+
|
| 80 |
+
Kinyarwanda is a morphologically rich language with several grammatical features such as negation, tenses, and plurals that are expressed as changes to morphemes in a word. Question words typically used are “iki” (what), “nde/inde” (who), “ryari” (when), “ikihe/uwuhe” (which), “hehe” (where), and “gute” (how).
|
| 81 |
+
|
| 82 |
+
Swahili is a morphologically rich language that
|
| 83 |
+
|
| 84 |
+
typically has several morphemes to incorporate changes to grammatical forms such as negation, tenses and plurality. A question word can be placed at the beginning or end of the question sentence, for example, "amekuja nani?" (who has come?) and "nani amekuja?" (who has come?). Other question words often used are "nini" (what), "nani" (who), "lini" (when), "kwanini" (why), "wapi", (where), and "vipi" (how).
|
| 85 |
+
|
| 86 |
+
Twi is a dialect of the Akan language and AFRIQA includes the Asante variant. A few common question words used in Twi are “èdeèn”(what), “hwan” (who), “daben” (when), “adèn” (why), “deèhen” (which), “èchenfa” (where), “sèn” (how).
|
| 87 |
+
|
| 88 |
+
Wolof is an agglutinative language, and unlike other Bantu languages, it utilizes dependent words rather than affixes attached to the headwords for grammatical modifications. Common question words in Wolof include "ian" (what), "kan" (who), "kan" (when), "lu tax", "ban" (which), "fan" (where), and "naka" (how).
|
| 89 |
+
|
| 90 |
+
Yorubá has a derivational morphology that entails affiliation, reduplication, and compounding. Yorubá employs polar question words such as “nje”, “se”, “abi”, “sebi” (for English question words “do” or “is”, “are”, “was” or “were”) and content question markers such as “tani” (who), “kini” (what), “nibo” (where), “elo/meloo” (how many), “bawo” (how is), “kilode” (why), and “igba/nigba” (when). Negation can be expressed with “ko”.
|
| 91 |
+
|
| 92 |
+
Zulu is a very morphologically-rich language where several grammatical features such as tense, negation, and the plurality of words are indicated through prefixes or suffixes. The most commonly used question words in Zulu are "yini" (what), "ubani" (who), "nini" (when), "kungani" (why), "yiliphi" (which), "kuphi" (where), "kanjani" (how), and "yenza" (do).
|
| 93 |
+
|
| 94 |
+
# 2.2 Data Collection Procedure
|
| 95 |
+
|
| 96 |
+
For each of the 10 languages in AFRIQA, a team of 2-6 native speakers was responsible for the data collection and annotation. Each team was led by a coordinator. The annotation pipeline consisted of 4 distinct stages: 1) question elicitation in an African language; 2) translation of questions into a pivot language; 3) answer labeling in the pivot language based on a set of candidate paragraphs; and 4) answer translation back to the source language. All data contributions were compensated financially.
|
| 97 |
+
|
| 98 |
+
# 2.2.1 Question Elicitation
|
| 99 |
+
|
| 100 |
+
The TyDi QA methodology (Clark et al., 2020) was followed to elicit locally relevant questions. Team members were presented with prompts including the first 250 characters of the most popular Wikipedia<sup>3</sup> articles in their languages, and asked to write factual or procedural questions for which the answers were not contained in the prompts. Annotators were encouraged to follow their natural curiosity. This annotation process avoids excessive and artificial overlap between the question and answer passage, which can often arise in data collection efforts for non-information-seeking QA tasks such as reading comprehension.<sup>4</sup> For languages like Fon and Bemba without a dedicated Wikipedia, relevant prompts from French and English Wikipedia were used to stimulate native language question generation. For Swahili, unanswered TyDi QA questions were curated for correctness. The inability of the original TyDi QA team to locate a suitable Swahili paragraph to answer these questions necessitated their inclusion. Simple spreadsheets facilitated this question elicitation process.
|
| 101 |
+
|
| 102 |
+
Before moving on to the second stage, team coordinators reviewed elicited questions for grammatical correctness and suitability for the purposes of information-seeking QA.
|
| 103 |
+
|
| 104 |
+
# 2.2.2 Question Translation
|
| 105 |
+
|
| 106 |
+
Elicited questions were translated from the original African languages into pivot languages following Asai et al. (2021). English was used as the pivot language across all languages except Wolof and Fon, for which French was used.5 Where possible, questions elicited by one team member were allocated to a different team member for translation to further ensure that only factual or procedural questions that are grammatically correct make it into the final dataset. This serves as an additional validation layer for the elicited questions.
|
| 107 |
+
|
| 108 |
+
# 2.2.3 Answer Retrieval
|
| 109 |
+
|
| 110 |
+
Using the translated questions as queries, Google Programmable Search Engine ${}^{6}$ was used to retrieve Wikipedia paragraphs that are candidates to contain an answer in the corresponding pivot language. The Mechanical Turk interface was employed—all annotations were carried out by team members. was used to show candidate paragraphs to team members who were then asked to identify 1) the paragraph that contains an answer and 2) the exact minimal span of the answer. In the case of polar questions, team members had to select "Yes" or "No" instead of the minimal span. In cases where candidate paragraphs did not contain the answer to the corresponding question, team members were instructed to select the "No gold paragraph" option.
|
| 111 |
+
|
| 112 |
+
As with question elicitation, team members went through a phase of training, which included a group meeting where guidelines were shared and annotators were walked through the labeling tool. Two rounds of in-tool labeling training were conducted.
|
| 113 |
+
|
| 114 |
+
# 2.2.4 Answer Translation
|
| 115 |
+
|
| 116 |
+
To obtain answers in the African languages, we translated the answers in the pivot languages to the corresponding African languages. We allocated the task of translating the answers labeled by team members to different team members in order to ensure accuracy. Translators were instructed to minimize the span of the translated answers. In cases where the selected answers were incorrect or annotators failed to select the minimum span, we either removed the question, corrected the answer, or re-annotated the question using the annotation tool.
|
| 117 |
+
|
| 118 |
+
# 2.3 Quality Control
|
| 119 |
+
|
| 120 |
+
We enforced rigorous quality control measures throughout the dataset generation process to ascertain its integrity, quality, and appropriateness. Our strategy involved recruiting native language speakers as annotators and team coordinators. Each annotator underwent initial training in question elicitation via English prompts, with personalized feedback focusing on factual question generation and avoiding prompt-contained answers. Annotators were required to achieve at least $90\%$ accuracy to proceed to native language elicitation, with additional one-on-one training rounds provided as necessary.
|
| 121 |
+
|
| 122 |
+
Each language team comprised a minimum of three members, with Fon and Kinyarwanda teams as exceptions, hosting two members each. This structure was designed to ensure different team members handled question elicitation and translation, enhancing quality control. Non-factual or inappropriate questions were flagged during the translation and answer labeling phases, leading to their correction or removal. Team coordinators meticulously reviewed all question-and-answer pairs alongside their translations, while central managers checked translation consistency. Post-annotation controls helped rectify common issues such as answer-span length and incorrect answer selection.
|
| 123 |
+
|
| 124 |
+
# 2.4 Final Dataset
|
| 125 |
+
|
| 126 |
+
The statistics of the dataset are presented in Table 3, which includes information on the languages, their corresponding pivot languages, and the total number of questions collected for each language. The final dataset consists of a total of 12,239 questions across 10 different languages, with 8,892 corresponding question-answer pairs. We observed a high answer coverage rate, with only $27\%$ of the total questions being unanswerable using Wikipedia. This can be attributed to the lack of relevant information on Wikipedia, especially for Africa related entities with sparse information. Despite this sparsity, we were able to find answers for over $60\%$ of the questions in most of the languages in our collection.
|
| 127 |
+
|
| 128 |
+
# 3 Tasks and Baselines
|
| 129 |
+
|
| 130 |
+
As part of the evaluation for AFRIQA, we follow the methodology proposed in Asai et al. (2021) and assess its performance on three different tasks: XOR-Retrieve, XOR-PivotLanguageSpan, and XOR-Full. Each task poses unique challenges for cross-lingual information retrieval and QA due to the low-resource nature of many African languages.
|
| 131 |
+
|
| 132 |
+
# 4 Experiments
|
| 133 |
+
|
| 134 |
+
# 4.1 Translation Systems
|
| 135 |
+
|
| 136 |
+
A common approach to cross-lingual QA is to translate queries from the source language into a target language, which is then used to find an answer in a given passage. For our experiments, we explore the use of different translation systems as baselines for AFRIQA. We consider human translation, Google
|
| 137 |
+
|
| 138 |
+
<table><tr><td>Source Language</td><td>ISO</td><td>Pivot Language</td><td>African Region</td><td>Script</td><td># Native Speakers</td><td>Train</td><td>Dev</td><td>Test</td><td>% Unanswerable Questions</td></tr><tr><td>Bemba</td><td>bem</td><td>English</td><td>South, East & Central</td><td>Latin</td><td>4M</td><td>502</td><td>503</td><td>314</td><td>0.41</td></tr><tr><td>Fon</td><td>fon</td><td>French</td><td>West</td><td>Latin</td><td>2M</td><td>427</td><td>428</td><td>386</td><td>0.22</td></tr><tr><td>Hausa</td><td>hau</td><td>English</td><td>West</td><td>Latin</td><td>63M</td><td>435</td><td>436</td><td>300</td><td>0.36</td></tr><tr><td>Igbo</td><td>ibo</td><td>English</td><td>West</td><td>Latin</td><td>27M</td><td>417</td><td>418</td><td>409</td><td>0.18</td></tr><tr><td>Kinyarwanda</td><td>kin</td><td>English</td><td>Central</td><td>Latin</td><td>15M</td><td>407</td><td>409</td><td>347</td><td>0.26</td></tr><tr><td>Swahili</td><td>swa</td><td>English</td><td>East & Central</td><td>Latin</td><td>98M</td><td>415</td><td>417</td><td>302</td><td>0.34</td></tr><tr><td>Twi</td><td>twi</td><td>English</td><td>West</td><td>Latin</td><td>9M</td><td>451</td><td>452</td><td>490</td><td>0.12</td></tr><tr><td>Wolof</td><td>wol</td><td>French</td><td>West</td><td>Latin</td><td>5M</td><td>503</td><td>504</td><td>334</td><td>0.38</td></tr><tr><td>Yorùbá</td><td>yor</td><td>English</td><td>West</td><td>Latin</td><td>42M</td><td>360</td><td>361</td><td>332</td><td>0.21</td></tr><tr><td>Zulu</td><td>zul</td><td>English</td><td>South</td><td>Latin</td><td>27M</td><td>387</td><td>388</td><td>325</td><td>0.26</td></tr><tr><td>Total</td><td>—</td><td>—</td><td>—</td><td>—</td><td>292M</td><td>4333</td><td>4346</td><td>3560</td><td>0.27</td></tr></table>
|
| 139 |
+
|
| 140 |
+
Table 3: Dataset information: This table contains key information about the AFRIQA Dataset
|
| 141 |
+
|
| 142 |
+
Translate, and open-source translation models such as NLLB (NLLB Team et al., 2022) and finetuned M2M-100 models (Adelani et al., 2022a) in zero-shot settings.
|
| 143 |
+
|
| 144 |
+
Google Translate. We use Google Translate because it provides out-of-the-box translation for 7 out of 10 languages in our dataset. Although Google Translate provides a strong translation baseline for many of the languages, we cannot guarantee the future reproducibility of these translations as it is a product API and is constantly being updated. For our experiments, we use the translation system as of February 2023<sup>7</sup>.
|
| 145 |
+
|
| 146 |
+
NLLB. NLLB is an open-source translation system trained on $100+$ languages and provides translation for all the languages in AFRIQA. At the time of release, NLLB provides state-of-the-art translation in many languages and covers all the languages in our dataset. For our experiments, we use the 1.3B size NLLB models.
|
| 147 |
+
|
| 148 |
+
# 4.2 Passage Retrieval (XOR-Retrieve)
|
| 149 |
+
|
| 150 |
+
We present two baseline retrieval systems: translate-retrieve and cross-lingual baselines. In the translate-retrieve baseline, we first translate the queries using the translation systems described in §4.1. The translated queries are used to retrieve relevant passages using different retrieval systems outlined below. Alternatively, the cross-lingual baseline directly retrieves passages in the pivot language without the need for translation using a multilingual dense retriever.
|
| 151 |
+
|
| 152 |
+
BM25. BM25 (Robertson and Zaragoza, 2009)
|
| 153 |
+
|
| 154 |
+
is a classic term-frequency-based retrieval model that matches queries to relevant passages using the frequency of word occurrences in both queries and passages. We use the BM25 implementation provided by Pyserini (Lin et al., 2021) with default hyperparameters $\mathrm{k}1 = 0.9$ , $\mathrm{b} = 0.4$ for all languages.
|
| 155 |
+
|
| 156 |
+
mDPR. We evaluate the performance of mDPR, a multilingual adaptation of the Dense Passage Retriever (DPR) model (Karpukhin et al., 2020) using multilingual BERT (mBERT). We finetuned mDPR on the MS MARCO passage ranking dataset (Bajaj et al., 2018) for our experiments. Retrieval is performed using the Faisss Flat Index implementation provided by Pyserini.
|
| 157 |
+
|
| 158 |
+
Sparse-Dense Hybrid. We also explore sparse-dense hybrid baselines, a combination of sparse (BM25) and hybrid (mDPR) retrievers. We use a linear combination of both systems to generate a reranked list of passages for each question.
|
| 159 |
+
|
| 160 |
+
# 4.3 Answer Span Prediction
|
| 161 |
+
|
| 162 |
+
To benchmark models' answer selection capabilities on AFRIQA, we combine different translation, extractive, and generative QA approaches.
|
| 163 |
+
|
| 164 |
+
Generative QA on Gold Passages. To evaluate the performance of generative QA, we utilize mT5-base (Xue et al., 2021) finetuned on SQuAD 2.0 (Rajpurkar et al., 2016) and evaluate it using both translated and original queries. The model was provided with the queries and the gold passages that were annotated using a template prompt and generates the answers to the questions.
|
| 165 |
+
|
| 166 |
+
Extractive QA on Retrieved Passages. For XOR-PivotLanguageSpan baselines, we employed an extractive QA model that extracts the answer span from the retrieved passages produced by the
|
| 167 |
+
|
| 168 |
+
<table><tr><td rowspan="2">lang</td><td colspan="3">Human Translation</td><td colspan="2">GMT</td><td colspan="2">NLLB</td><td colspan="2">M2M-100</td><td>Crosslingual</td></tr><tr><td>BM25</td><td>mDPR</td><td>Hybrid</td><td>BM25</td><td>mDPR</td><td>BM25</td><td>mDPR</td><td>BM25</td><td>mDPR</td><td>mDPR</td></tr><tr><td></td><td colspan="10">Recall@10</td></tr><tr><td>bem</td><td>55.7</td><td>67.5</td><td>72.3</td><td>—</td><td>—</td><td>52.2</td><td>59.8</td><td>—</td><td>—</td><td>14.7</td></tr><tr><td>fon</td><td>66.3</td><td>69.4</td><td>70.7</td><td>—</td><td>—</td><td>43.9</td><td>48.7</td><td>39.9</td><td>43.3</td><td>28.5</td></tr><tr><td>hau</td><td>58.0</td><td>65.7</td><td>72.7</td><td>53.3</td><td>60.3</td><td>52.0</td><td>59.7</td><td>36.7</td><td>44.3</td><td>13.7</td></tr><tr><td>igb</td><td>70.4</td><td>74.3</td><td>82.9</td><td>65.5</td><td>71.2</td><td>64.8</td><td>68.0</td><td>62.1</td><td>67.5</td><td>25.4</td></tr><tr><td>kin</td><td>59.1</td><td>66.3</td><td>75.5</td><td>53.6</td><td>61.1</td><td>53.0</td><td>58.8</td><td>—</td><td>—</td><td>15.6</td></tr><tr><td>swa</td><td>46.0</td><td>61.9</td><td>67.6</td><td>45.0</td><td>60.9</td><td>43.1</td><td>58.3</td><td>39.1</td><td>54.6</td><td>20.9</td></tr><tr><td>twi</td><td>61.8</td><td>66.7</td><td>75.3</td><td>56.1</td><td>58.0</td><td>50.4</td><td>54.1</td><td>45.7</td><td>49.4</td><td>21.4</td></tr><tr><td>wol</td><td>61.4</td><td>67.7</td><td>68.6</td><td>—</td><td>—</td><td>35.0</td><td>36.5</td><td>34.4</td><td>35.0</td><td>13.8</td></tr><tr><td>yor</td><td>55.1</td><td>66.6</td><td>71.7</td><td>52.1</td><td>59.0</td><td>50.9</td><td>57.5</td><td>36.8</td><td>35.5</td><td>21.4</td></tr><tr><td>zul</td><td>59.7</td><td>70.2</td><td>76.3</td><td>57.2</td><td>66.2</td><td>51.5</td><td>64.6</td><td>45.5</td><td>60.0</td><td>14.2</td></tr><tr><td>avg</td><td>59.4</td><td>67.6</td><td>73.4</td><td>54.7</td><td>62.4</td><td>49.7</td><td>56.6</td><td>42.5</td><td>48.7</td><td>19.0</td></tr></table>
|
| 169 |
+
|
| 170 |
+
Table 4: Retrieval Recall@10: This table displays the retrieval recall results for various translation types on the test set of AFRIQA. The table shows the percentage of retrieved passages that contain the answer for the top-10 retrieved passages. The last column represents crosslingual retrieval, where we skip the translation step and use the original queries. We boldface the best-performing model for each language within the human translation oracle scenario and within the real-world automatic translation scenario.
|
| 171 |
+
|
| 172 |
+
<table><tr><td></td><td colspan="2">HT</td><td colspan="2">GMT</td><td colspan="2">NLLB</td><td colspan="2">Crosslingual</td></tr><tr><td></td><td>F1</td><td>EM</td><td>F1</td><td>EM</td><td>F1</td><td>EM</td><td>F1</td><td>EM</td></tr><tr><td>bem</td><td>48.8</td><td>41.7</td><td>—</td><td>—</td><td>38.5</td><td>32.0</td><td>2.9</td><td>1.1</td></tr><tr><td>fon</td><td>41.4</td><td>28.5</td><td>—</td><td>—</td><td>23.4</td><td>15.3</td><td>5.1</td><td>2.3</td></tr><tr><td>hau</td><td>58.5</td><td>49.0</td><td>53.5</td><td>45.7</td><td>50.9</td><td>42.7</td><td>25.8</td><td>22.3</td></tr><tr><td>ibo</td><td>66.6</td><td>59.2</td><td>59.8</td><td>53.3</td><td>60.2</td><td>53.3</td><td>41.7</td><td>34.7</td></tr><tr><td>kin</td><td>60.8</td><td>43.8</td><td>57.3</td><td>40.9</td><td>58.8</td><td>42.9</td><td>25.5</td><td>20.2</td></tr><tr><td>swa</td><td>52.3</td><td>42.6</td><td>48.9</td><td>40.8</td><td>49.2</td><td>41.2</td><td>29.4</td><td>23.5</td></tr><tr><td>twi</td><td>55.4</td><td>45.3</td><td>42.0</td><td>33.7</td><td>40.1</td><td>33.1</td><td>5.3</td><td>3.5</td></tr><tr><td>wol</td><td>44.6</td><td>36.1</td><td>—</td><td>—</td><td>21.8</td><td>16.9</td><td>3.9</td><td>2.8</td></tr><tr><td>yor</td><td>54.9</td><td>49.8</td><td>48.9</td><td>45.1</td><td>47.9</td><td>43.0</td><td>11.9</td><td>7.8</td></tr><tr><td>zul</td><td>60.2</td><td>50.8</td><td>57.4</td><td>48.9</td><td>55.6</td><td>46.5</td><td>24.7</td><td>20.9</td></tr><tr><td>avg</td><td>54.5</td><td>44.7</td><td>46.0</td><td>38.6</td><td>44.6</td><td>36.7</td><td>17.6</td><td>13.9</td></tr></table>
|
| 173 |
+
|
| 174 |
+
various retrieval baselines outlined in $\S 4.2$ . The model is trained to extract answer spans from each passage, along with the probability indicating the likelihood of each answer. The answer span with the highest probability is selected as the correct answer. We trained a multilingual DPR reader model, which was initialized from mBERT and finetuned on Natural Questions (Kwiatkowski et al., 2019).
|
| 175 |
+
|
| 176 |
+
# 5 Results and Analysis
|
| 177 |
+
|
| 178 |
+
# 5.1 XOR-Retieve Results
|
| 179 |
+
|
| 180 |
+
We present the retrieval results for recall@10 in Table 4. The table includes retriever results
|
| 181 |
+
|
| 182 |
+
Table 5: Generative Gold Passages Answer Prediction: Comparison of F1 and Exact Match Accuracy scores for generative answer span prediction on the test set using mT5-base (Xue et al., 2020) as the backbone.
|
| 183 |
+
|
| 184 |
+
<table><tr><td></td><td colspan="2">HT</td><td colspan="2">GMT</td><td colspan="2">NLLB</td><td colspan="2">Crosslingual</td></tr><tr><td></td><td>F1</td><td>EM</td><td>F1</td><td>EM</td><td>F1</td><td>EM</td><td>F1</td><td>EM</td></tr><tr><td>bem</td><td>38.2</td><td>29.5</td><td>—</td><td>—</td><td>30.0</td><td>21.9</td><td>0.4</td><td>0.4</td></tr><tr><td>fon</td><td>53.8</td><td>40.4</td><td>—</td><td>—</td><td>37.5</td><td>26.7</td><td>13.4</td><td>6.0</td></tr><tr><td>hau</td><td>60.9</td><td>52.7</td><td>54.4</td><td>47.7</td><td>50.9</td><td>43.7</td><td>27.7</td><td>23.7</td></tr><tr><td>ibo</td><td>68.2</td><td>60.6</td><td>62.1</td><td>55.0</td><td>62.8</td><td>56.2</td><td>29.2</td><td>24.7</td></tr><tr><td>kin</td><td>56.8</td><td>38.9</td><td>50.8</td><td>36.0</td><td>51.3</td><td>36.6</td><td>22.7</td><td>17.9</td></tr><tr><td>swa</td><td>45.2</td><td>37.9</td><td>44.6</td><td>37.9</td><td>45.2</td><td>38.1</td><td>31.6</td><td>24.6</td></tr><tr><td>twi</td><td>51.2</td><td>41.8</td><td>39.2</td><td>31.1</td><td>34.3</td><td>30.0</td><td>3.4</td><td>2.5</td></tr><tr><td>wol</td><td>45.2</td><td>33.9</td><td>—</td><td>—</td><td>33.2</td><td>26.0</td><td>1.8</td><td>0.9</td></tr><tr><td>yor</td><td>45.1</td><td>38.6</td><td>36.0</td><td>31.7</td><td>32.3</td><td>28.0</td><td>6.0</td><td>3.8</td></tr><tr><td>zul</td><td>59.1</td><td>49.2</td><td>56.0</td><td>48.6</td><td>53.6</td><td>45.8</td><td>17.0</td><td>13.5</td></tr><tr><td>avg</td><td>52.4</td><td>42.4</td><td>42.9</td><td>36.0</td><td>43.1</td><td>35.3</td><td>15.3</td><td>11.8</td></tr></table>
|
| 185 |
+
|
| 186 |
+
Table 6: Extractive Gold Passages Answer Prediction: Comparison of F1 and Exact Match Accuracy scores for extractive answer span prediction on the test set using AfroXLMR-base (Alabi et al., 2022) as the backbone.
|
| 187 |
+
|
| 188 |
+
using different translation and retrieval systems. We also report the performance with both original and human-translated queries. The table shows that hybrid retrieval using human translation yields the best results for all languages, with an average recall@10 of 73.9. In isolation, mDPR retrieval outperforms BM25 for all translation types. This table also enables us to compare the effectiveness of different translation systems in locating relevant passages for cross-lingual QA in African languages. This is illustrated in Figure 1, showing retriever recall rates for different translation types at various
|
| 189 |
+
|
| 190 |
+
<table><tr><td></td><td></td><td colspan="12">Pivot Language Span F1</td></tr><tr><td rowspan="2">Query Translation</td><td rowspan="2">Retrieval</td><td rowspan="2">bem</td><td rowspan="2">fon</td><td rowspan="2">hau</td><td rowspan="2">ibo</td><td rowspan="2">kin</td><td rowspan="2">swa</td><td rowspan="2">twi</td><td rowspan="2">wol</td><td rowspan="2">yor</td><td rowspan="2">zul</td><td colspan="2">Average</td></tr><tr><td>F1</td><td>EM</td></tr><tr><td>HT</td><td>BM25</td><td>29.2</td><td>11.4</td><td>31.4</td><td>43.0</td><td>33.8</td><td>24.3</td><td>38.4</td><td>15.4</td><td>28.9</td><td>32.8</td><td>28.9</td><td>19.9</td></tr><tr><td>HT</td><td>mDPR</td><td>32.5</td><td>11.0</td><td>35.8</td><td>44.8</td><td>35.4</td><td>28.2</td><td>40.7</td><td>14.7</td><td>31.7</td><td>36.5</td><td>31.1</td><td>21.5</td></tr><tr><td>HT</td><td>Hybrid</td><td>34.7</td><td>11.3</td><td>35.5</td><td>46.1</td><td>39.2</td><td>27.5</td><td>41.8</td><td>16.2</td><td>32.4</td><td>34.6</td><td>32.0</td><td>21.9</td></tr><tr><td>GMT</td><td>BM25</td><td>—</td><td>—</td><td>21.0</td><td>38.6</td><td>28.3</td><td>24.7</td><td>27.7</td><td>—</td><td>21.7</td><td>31.6</td><td>27.7</td><td>21.2</td></tr><tr><td>GMT</td><td>mDPR</td><td>—</td><td>—</td><td>31.5</td><td>39.3</td><td>35.3</td><td>29.1</td><td>31.1</td><td>—</td><td>22.9</td><td>36.0</td><td>32.2</td><td>22.3</td></tr><tr><td>NLLB</td><td>BM25</td><td>23.8</td><td>3.6</td><td>24.6</td><td>37.6</td><td>29.3</td><td>25.2</td><td>25.7</td><td>4.4</td><td>17.3</td><td>26.8</td><td>19.8</td><td>13.8</td></tr><tr><td>NLLB</td><td>mDPR</td><td>24.1</td><td>5.1</td><td>27.2</td><td>39.6</td><td>33.3</td><td>25.9</td><td>28.2</td><td>5.2</td><td>21.4</td><td>30.4</td><td>24.0</td><td>16.0</td></tr></table>
|
| 191 |
+
|
| 192 |
+
Table 7: F1 scores on pivot language answer generation using an extractive multilingual reader model with different query translation and retrieval methods.
|
| 193 |
+
|
| 194 |
+
<table><tr><td colspan="2">Translation</td><td></td><td colspan="10">XOR-Full F1</td><td colspan="3">Average</td></tr><tr><td>Query</td><td>Answer</td><td>Retrieval</td><td>bem</td><td>fon</td><td>hau</td><td>ibo</td><td>kin</td><td>swa</td><td>twi</td><td>wol</td><td>yor</td><td>zul</td><td>F1</td><td>EM</td><td>BLEU</td></tr><tr><td>GMT</td><td>GMT</td><td>BM25</td><td>—</td><td>—</td><td>20.4</td><td>30.4</td><td>24.2</td><td>18.1</td><td>14.9</td><td>—</td><td>16.1</td><td>19.7</td><td>20.5</td><td>12.1</td><td>18.3</td></tr><tr><td>GMT</td><td>GMT</td><td>mDPR</td><td>—</td><td>—</td><td>21.7</td><td>33.0</td><td>26.5</td><td>21.9</td><td>16.5</td><td>14.2</td><td>20.4</td><td>21.1</td><td>23.0</td><td>14.2</td><td>20.7</td></tr><tr><td>NLLB</td><td>NLLB</td><td>BM25</td><td>13.6</td><td>2.6</td><td>17.5</td><td>26.5</td><td>19.9</td><td>19.2</td><td>18.4</td><td>3.2</td><td>12.7</td><td>12.5</td><td>14.6</td><td>7.5</td><td>12.9</td></tr><tr><td>NLLB</td><td>NLLB</td><td>mDPR</td><td>13.3</td><td>4.3</td><td>19.3</td><td>29.9</td><td>22.4</td><td>20.3</td><td>19.5</td><td>3.5</td><td>17.6</td><td>13.1</td><td>16.3</td><td>8.3</td><td>14.3</td></tr></table>
|
| 195 |
+
|
| 196 |
+
Table 8: XOR-Full F1 results combining different translation and retriever systems.
|
| 197 |
+
|
| 198 |
+
cutoffs using mDPR.
|
| 199 |
+
|
| 200 |
+
We observe that human translation yields better accuracy than all other translation types, indicating that the current state-of-the-art machine translation systems still have a long way to go in accurately translating African languages. Google Translate shows better results for the languages where it is available, while the NLLB model provides better coverage. The cross-lingual retrieval model that retrieves passages using questions in their original language is the least effective of all the model types. This illustrates that the cross-lingual representations learned by current retrieval methods are not yet of sufficient quality to enable accurate retrieval across different languages.
|
| 201 |
+
|
| 202 |
+
# 5.2 XOR-PivotLanguageSpan Results
|
| 203 |
+
|
| 204 |
+
Gold Passage Answer Prediction. We first evaluate the generative QA setting using gold passages. We present F1 and Exact Match results using different methods to translate the query in Table 5. Human translation of the queries consistently outperforms using machine-translated queries, which outperforms using queries in their original language.
|
| 205 |
+
|
| 206 |
+
Retrieved Passages Answer Prediction. We now evaluate performance using retrieved passages from §5.1. We present F1 and Exact Match results with different translation-retriever combinations in Table 7. We extract the answer spans from only the
|
| 207 |
+
|
| 208 |
+

|
| 209 |
+
Figure 1: Graph of retriever recall@k for different translation systems. The scores shown in this graph are from mDPR retrieval.
|
| 210 |
+
|
| 211 |
+
top-10 retrieved passages for each question using an extractive multilingual reader model (see §4.3). The model assigns a probability to each answer span, and we select the answer with the highest probability as the final answer.
|
| 212 |
+
|
| 213 |
+
Our results show that hybrid retrieval using human-translated queries achieves the best performance across all languages on average. Using human-translated queries generally outperforms using translations by both Google Translate and NLLB, regardless of the retriever system used. In terms of retrieval methods, mDPR generally performs better than BM25, with an average gain of 3 F1 points across different translation types. These
|
| 214 |
+
|
| 215 |
+
results highlight the importance of carefully selecting translation-retriever combinations to achieve the best answer span prediction results in cross-lingual QA.
|
| 216 |
+
|
| 217 |
+
# 5.3 XOR-Full Results
|
| 218 |
+
|
| 219 |
+
Each pipeline consists of components for question translation, passage retrieval, answer extraction, and answer translation. From Table 8, we observe that Google machine translation combined with mDPR is the most effective. This is followed by a pipeline combining NLLB translation with mDPR.
|
| 220 |
+
|
| 221 |
+
# 6 Related Work
|
| 222 |
+
|
| 223 |
+
Africa NLP. In parallel with efforts to include more low-resource languages in NLP research (Costajussa et al., 2022; Ruder, 2020), demand for NLP that targets African languages, which represent more than $30\%$ of the world's spoken languages (Ogueji et al., 2021) is growing. This has resulted in the creation of publicly available multilingual datasets targeting African languages for a variety of NLP tasks such as sentiment analysis (Muhammad et al., 2023; Shode et al., 2022), language identification (Adebara et al., 2022), data-to-text generation (Gehrmann et al., 2022), topic classification (Adelani et al., 2023; Hedderich et al., 2020), machine translation (Adelani et al., 2022a; Nekoto et al., 2020), and NER (Eiselen, 2016; Adelani et al., 2021, 2022b).
|
| 224 |
+
|
| 225 |
+
Datasets for QA and Information Retrieval tasks have also been created. They are, however, very few and cater to individual languages (Abedissa et al., 2023; Wanjawa et al., 2023) or a small subset of languages spoken in individual countries (Daniel et al., 2019; Zhang et al., 2022). Given the region's large number of linguistically diverse and information-scarce languages, multilingual and cross-lingual datasets are encouraged to catalyze research efforts. To the best of our knowledge, there are no publicly available cross-lingual open-retrieval African language QA datasets.
|
| 226 |
+
|
| 227 |
+
Comparison to Other Resources. Multilingual QA datasets have paved the way for language models to simultaneously learn across multiple languages, with both reading comprehension (Lewis et al., 2020) and other QA datasets (Longpre et al., 2021; Clark et al., 2020) predominantly utilizing publicly available data sources such as Wikipedia, SQUAD, and the Natural Questions dataset. To address the information scarcity of the typically used
|
| 228 |
+
|
| 229 |
+
data sources for low-resource languages, cross-lingual datasets (Liu et al., 2019; Asai et al., 2021) emerged that translate between low-resource and high-resource languages, thus providing access to a larger information retrieval pool which decreases the fraction of unanswerable questions. Despite these efforts, however, the inclusion of African languages remains extremely rare, as shown in Table 1, which compares our dataset to other closely related QA datasets. TyDi QA features Swahili as the sole African language out of the 11 languages it covers.
|
| 230 |
+
|
| 231 |
+
# 7 Conclusion
|
| 232 |
+
|
| 233 |
+
In this work, we take a step toward bridging the information gap between native speakers of many African languages and the vast amount of digital information available on the web by creating AFRIQA, the first open-retrieval cross-lingual QA dataset focused on African languages with $12,000+$ questions. We anticipate that AFRIQA will help improve access to relevant information for speakers of African languages. By leveraging the power of cross-lingual QA, we hope to bridge the information gap and promote linguistic diversity and inclusivity in digital information access.
|
| 234 |
+
|
| 235 |
+
# Limitations
|
| 236 |
+
|
| 237 |
+
Our research focuses on using English and French Wikipedia as the knowledge base for creating systems that can answer questions in 10 African languages. While Wikipedia is a comprehensive source of knowledge, it does not accurately reflect all societies and cultures (Callahan and Herring, 2011). There is a limited understanding of African contexts with relatively few Wikipedia articles dedicated to Africa related content. This could potentially limit the ability of a QA system to accurately find answers to questions related to African traditions, practices, or entities. Also, by focusing on English and French and pivot languages, we might introduce some translation inaccuracies or ambiguities which might impact the performance of a QA system.
|
| 238 |
+
|
| 239 |
+
Addressing these limitations requires concerted efforts to develop more localized knowledge bases or improve existing sources such as Wikipedia by updating or creating articles that reflect the diversity and richness of African societies.
|
| 240 |
+
|
| 241 |
+
# References
|
| 242 |
+
|
| 243 |
+
Tilahun Abedissa, Ricardo Usbeck, and Yaregal Assabie. 2023. Amqa: Amharic question answering dataset. arXiv preprint arXiv:2303.03290.
|
| 244 |
+
Ife Adebara, AbdelRahim Elmadany, Muhammad Abdul-Mageed, and Alcides Alcoba Inciarte. 2022. Afrolid: A neural language identification tool for african languages. arXiv preprint arXiv:2210.11744.
|
| 245 |
+
David Adelani, Jesujoba Alabi, Angela Fan, Julia Kreutzer, Xiaoyu Shen, Machel Reid, Dana Ruiter, Dietrich Klakow, Peter Nabende, Ernie Chang, Tajuddeen Gwadabe, Freshia Sackey, Bonaventure F. P. Dossou, Chris Emezue, Colin Leong, Michael Beukman, Shamsuddeen Muhammad, Guyo Jarso, Oreen Yousuf, Andre Niyongabo Rubungo, Gilles Hacheme, Eric Peter Wairagala, Muhammad Umair Nasir, Benjamin Ajibade, Tunde Ajayi, Yvonne Gitau, Jade Abbott, Mohamed Ahmed, Millicent Ochieng, Anuoluwapo Aremu, Perez Ogayo, Jonathan Mukiibi, Fatoumata Ouoba Kabore, Godson Kalipe, Derguene Mbaye, Allahsera Auguste Tapo, Victoire Memdjakom Koagne, Edwin Munkoh-Buabeng, Valencia Wagner, Idris Abdulmumin, Ayodele Awokoya, Happy Buzaaba, Blessing Sibanda, Andiswa Bukula, and Sam Manthalu. 2022a. A few thousand translations go a long way! leveraging pre-trained models for African news translation. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 3053-3070, Seattle, United States. Association for Computational Linguistics.
|
| 246 |
+
David Adelani, Graham Neubig, Sebastian Ruder, Shruti Rijhwani, Michael Beukman, Chester PalenMichel, 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. 2022b. 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.
|
| 247 |
+
David Ifeoluwa Adelani, Jade Abbott, Graham Neubig, Daniel D'souza, Julia Kreutzer, Constantine Lignos, Chester Palen-Michel, Happy Buzaaba, Shruti
|
| 248 |
+
|
| 249 |
+
Rijhwani, Sebastian Ruder, Stephen Mayhew, Israel Abebe Azime, Shamsuddeen H. Muhammad, Chris Chinenye Emezue, Joyce Nakatumba-Nabende, Perez Ogayo, Aremu Anuoluwapo, Catherine Gitau, Derguene Mbaye, Jesujoba Alabi, Seid Muhie Yimam, Tajuddeen Rabiu Gwadabe, Ignatius Ezeani, Rubungo Andre Niyongabo, Jonathan Mukiibi, Verrah Otiende, Iroro Orife, Davis David, Samba Ngom, Tosin Adewumi, Paul Rayson, Mofetoluwa Adeyemi, Gerald Muriuki, Emmanuel Anebi, Chiamaka Chukwuneke, Nkiruka Odu, Eric Peter Wairagala, Samuel Oyerinde, Clemencia Siro, Tobias Saul Bateesa, Temilola Oloyede, Yvonne Wambui, Victor Akinode, Deborah Nabagereka, Maurice Katusiime, Ayodele Awokoya, Mouhamadane MBOUP, Dibora Gebreyohannes, Henok Tilaye, Kelechi Nwaike, Degaga Wolde, Abdoulaye Faye, Blessing Sibanda, Orevaoghene Ahia, Bonaventure F. P. Dossou, Kelechi Ogueji, Thierno Ibrahima DIOP, Abdoulaye Diallo, Adewale Akinfaderin, Tendai Marengereke, and Salomey Osei. 2021. MasakhaNER: Named entity recognition for African languages. Transactions of the Association for Computational Linguistics, 9:1116-1131.
|
| 250 |
+
David Ifeoluwa Adelani, Marek Masiak, Israel Abebe Azime, Jesujoba Oluwadara Alabi, Atnafu Lambebo Tonja, Christine Mwase, O Dunayo Ogundepo, Bonaventure F. P. Dossou, Akintunde Oladipo, Doreen Nixdorf, Chris Chinenye Emezue, Sana Sabah al azzawi, Blessing K. Sibanda, Davis David, Lolwethu Ndolela, Jonathan Mukiibi, Tunde Oluwaseyi Ajayi, Tatiana Moteu Ngoli, Brian Odhiambo, Abraham Toluwase Owodunni, Nnaemeka C. Obiefuna, Shamsuddeen Hassan Muhammad, Saheed Salahudeen Abdullahi, Mesay Gemeda Yigezu, Tajuddeen Gwadabe, Idris Abdulmumin, Mahlet Taye Bame, Oluwabusayo Olufunke Awoyomi, Iyanuoluwa Shode, Tolulope Anu Adelani, Habiba Abdulganiy Kailani, Abdul-Hakeem Omotayo, Adetola Adeko, Afolabi Abeeb, Anuoluwapo Aremu, Olanrewaju Samuel, Clemencia Siro, Wangari Kimtoho, Onyekachi Raphael Ogbu, Chinedu E. Mbonu, Chiamaka I. Chukwuneke, Samuel Fanijo, Jessica Ojo, Oyinkansola F. Awosan, Tadesse Kebede Guge, Sakayo Toadoum Sari, Pamela Nyatsine, Freedmore Sidume, Oreen Yousuf, Mardiyyah Oduwole, Ussen Kimanuka, Kanda Patrick Tshinu, Thina Diko, Siyanda Nxakama, Abdulmejid Toni Johar, Sinodos Gebre, Muhidin Mohamed, Shafie Abdi Mohamed, Fuad Mire Hassan, Moges Ahmed Mehamed, Evrard Ngabire, and Pontus Stenetorp. 2023. Masakhanews: News topic classification for african languages.
|
| 251 |
+
Jesujoba O Alabi, David Ifeoluwa Adelani, Marius Mosbach, and Dietrich Klakow. 2022. Adapting pretrained language models to african languages via multilingual adaptive fine-tuning. In Proceedings of the 29th International Conference on Computational Linguistics, pages 4336-4349.
|
| 252 |
+
Tatsuya Amano, Juan P González-Varo, and William J
|
| 253 |
+
|
| 254 |
+
Sutherland. 2016. Languages are still a major barrier to global science. PLoS biology, 14(12):e2000933.
|
| 255 |
+
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.
|
| 256 |
+
Akari Asai, Jungo Kasai, Jonathan Clark, Kenton Lee, Eunsol Choi, and Hannaneh Hajishirzi. 2021. XOR QA: Cross-lingual open-retrieval question answering. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 547-564, Online. Association for Computational Linguistics.
|
| 257 |
+
Payal Bajaj, Daniel Campos, Nick Craswell, Li Deng, Jianfeng Gao, Xiaodong Liu, Rangan Majumder, Andrew McNamara, Bhaskar Mitra, Tri Nguyen, Mir Rosenberg, Xia Song, Alina Stoica, Saurabh Tiwary, and Tong Wang. 2018. MS MARCO: A Human Generated MAchine Reading CComprehension Dataset. arXiv:1611.09268v3.
|
| 258 |
+
Ewa S. Callahan and Susan C. Herring. 2011. Cultural bias in wikipedia content on famous persons. J. Am. Soc. Inf. Sci. Technol., 62(10):1899-1915.
|
| 259 |
+
Zhiyu Chen, Wenhu Chen, Charese Smiley, Sameena Shah, Iana Borova, Dylan Langdon, Reema Moussa, Matt Beane, Ting-Hao Huang, Bryan Routledge, and William Yang Wang. 2021. FinQA: A dataset of numerical reasoning over financial data. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 3697-3711, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics.
|
| 260 |
+
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.
|
| 261 |
+
Marta R Costa-jussà, James Cross, Onur Celebi, Maha Elbayad, Kenneth Heafield, Kevin Heffernan, Elahe Kalbassi, Janice Lam, Daniel Licht, Jean Maillard, et al. 2022. No language left behind: Scaling human-centered machine translation. arXiv preprint arXiv:2207.04672.
|
| 262 |
+
Jeanne E Daniel, Willie Brink, Ryan Eloff, and Charles Copley. 2019. Towards automating healthcare question answering in a noisy multilingual low-resource setting. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 948-953.
|
| 263 |
+
Martin d'Hoffschmidt, Wacim Belblidia, Quentin Heinrich, Tom Brendle, and Maxime Vidal. 2020. FQuAD: French question answering dataset. In Findings of the Association for Computational Linguistics:
|
| 264 |
+
|
| 265 |
+
EMNLP 2020, pages 1193-1208, Online. Association for Computational Linguistics.
|
| 266 |
+
Roald Eiselen. 2016. Government domain named entity recognition for south african languages. In Proceedings of the Tenth International Conference on Language Resources and Evaluation (LREC'16), pages 3344-3348.
|
| 267 |
+
Sebastian Gehrmann, Sebastian Ruder, Vitaly Nikolaev, Jan A Botha, Michael Chavinda, Ankur Parikh, and Clara Rivera. 2022. Tata: A multilingual table-to-text dataset for african languages. arXiv preprint arXiv:2211.00142.
|
| 268 |
+
Michael A Hedderich, David Adelani, Dawei Zhu, Jesujoba Alabi, Udia Markus, and Dietrich Klakow. 2020. Transfer learning and distant supervision for multilingual transformer models: A study on african languages. arXiv preprint arXiv:2010.03179.
|
| 269 |
+
Mandar Joshi, Eunsol Choi, Daniel Weld, and Luke Zettlemoyer. 2017. TriviaQA: A large scale distantly supervised challenge dataset for reading comprehension. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1601-1611, Vancouver, Canada. Association for Computational Linguistics.
|
| 270 |
+
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.
|
| 271 |
+
Tom Kwiatkowski, Jennimaria Palomaki, Olivia Redfield, Michael Collins, Ankur Parikh, Chris Alberti, Danielle Epstein, Illia Polosukhin, Jacob Devlin, Kenton Lee, et al. 2019. Natural questions: a benchmark for question answering research. Transactions of the Association for Computational Linguistics, 7:453-466.
|
| 272 |
+
Patrick Lewis, Barlas Oguz, Rudy Rinott, Sebastian Riedel, and Holger Schwenk. 2020. MLQA: Evaluating cross-lingual extractive question answering. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7315-7330, Online. Association for Computational Linguistics.
|
| 273 |
+
Jimmy Lin, Xueguang Ma, Sheng-Chieh Lin, Jheng-Hong Yang, Ronak Pradeep, and Rodrigo Nogueira. 2021. Pyserini: A Python toolkit for reproducible information retrieval research with sparse and dense representations. In Proceedings of the 44th Annual International ACM SIGIR Conference on Research and Development in Information Retrieval (SIGIR 2021), pages 2356-2362.
|
| 274 |
+
Jiahua Liu, Yankai Lin, Zhiyuan Liu, and Maosong Sun. 2019. XQA: A cross-lingual open-domain question answering dataset. In Proceedings of the 57th Annual Meeting of the Association for Computational
|
| 275 |
+
|
| 276 |
+
Linguistics, pages 2358-2368, Florence, Italy. Association for Computational Linguistics.
|
| 277 |
+
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.
|
| 278 |
+
Jorge Martinez-Gil. 2021. A survey on legal question answering systems. arXiv preprint arXiv:2110.07333.
|
| 279 |
+
Todor Mihaylov, Peter Clark, Tushar Khot, and Ashish Sabharwal. 2018. Can a suit of armor conduct electricity? a new dataset for open book question answering. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 2381-2391, Brussels, Belgium. Association for Computational Linguistics.
|
| 280 |
+
Timo Möller, Anthony Reina, Raghavan Jayakumar, and Malte Pietsch. 2020. COVID-QA: A question answering dataset for COVID-19. In Proceedings of the 1st Workshop on NLP for COVID-19 at ACL 2020, Online. Association for Computational Linguistics.
|
| 281 |
+
Hugo MP Morales, Murilo Guedes, Jennifer S Silva, and Adriano Massuda. 2021. Covid-19 in brazil—preliminary analysis of response supported by artificial intelligence in municipalities. Frontiers in Digital Health, 3:648585.
|
| 282 |
+
Shamsuddeen Hassan Muhammad, Idris Abdulmumin, Abinew Ali Ayele, Nedjma Ousidhoum, David Ifeoluwa Adelani, Seid Muhie Yimam, Ibrahim Sa'id Ahmad, Meriem Beloucif, Saif Mohammad, Sebastian Ruder, et al. 2023. Afrisenti: A twitter sentiment analysis benchmark for african languages. arXiv preprint arXiv:2302.08956.
|
| 283 |
+
Wilhelmina Nekoto, Vukosi Marivate, Tshinondiwa Matsila, Timi Fasubaa, Tajudeen Kolawole, Taiwo Fagbohungbe, Solomon Oluwole Akinola, Shamsuddeen Hassan Muhammad, Salomon Kabongo, Salomey Osei, et al. 2020. Participatory research for low-resourced machine translation: A case study in african languages. arXiv preprint arXiv:2010.02353.
|
| 284 |
+
NLLB Team, Marta R. Costa-jussà, James Cross, Onur Celebi, Maha Elbayad, Kenneth Heafield, Kevin Hefernan, 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.
|
| 285 |
+
|
| 286 |
+
Kelechi Ogueji, Yuxin Zhu, and Jimmy Lin. 2021. Small data? no problem! exploring the viability of pretrained multilingual language models for low-resourced languages. In Proceedings of the 1st Workshop on Multilingual Representation Learning, pages 116-126, Punta Cana, Dominican Republic. Association for Computational Linguistics.
|
| 287 |
+
Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. 2016. SQuAD: 100,000+ Questions for Machine Comprehension of Text. arXiv e-prints, page arXiv:1606.05250.
|
| 288 |
+
Stephen Robertson and Hugo Zaragoza. 2009. The probabilistic relevance framework: Bm25 and beyond. Foundations and Trends in Information Retrieval, 3(4):333-389.
|
| 289 |
+
Sebastian Ruder. 2020. Why you should do nlp beyond english. Sebastian Ruder https://ruder.io/nlp-beyond-english.
|
| 290 |
+
Sebastian Ruder and Avirup Sil. 2021. Multi-domain multilingual question answering. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing: Tutorial Abstracts, pages 17-21.
|
| 291 |
+
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, Online. Association for Computational Linguistics.
|
| 292 |
+
Iyanuoluwa Shode, David Ifeoluwa Adelani, and Anna Feldman. 2022. yosm: A new yoruba sentiment corpus for movie reviews.
|
| 293 |
+
Manveer Singh Tamber, Ronak Pradeep, and Jimmy Lin. 2023. Pre-processing matters! improved wikipedia corpora for open-domain question answering. In 45th European Conference on Information Retrieval, ECIR 2023, page Forthcoming.
|
| 294 |
+
Barack W. Wanjawa, Lilian D. A. Wanzare, Florence Indede, Owen Mconyango, Lawrence Muchemi, and Edward Ombui. 2023. Kenswquad - a question answering dataset for swahili low resource language. ACM Trans. Asian Low-Resour. Lang. Inf. Process. Just Accepted.
|
| 295 |
+
Linting Xue, Noah Constant, Adam Roberts, Mihir Kale, Rami Al-Rfou, Aditya Siddhant, Aditya Barua, and Colin Raffel. 2020. mt5: A massively multilingual pre-trained text-to-text transformer. arXiv preprint arXiv:2010.11934.
|
| 296 |
+
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.
|
| 297 |
+
|
| 298 |
+
<table><tr><td>Parameters</td><td>Value</td></tr><tr><td>backbone</td><td>multilingual-bert</td></tr><tr><td># train epochs</td><td>25</td></tr><tr><td># warmup steps</td><td>500</td></tr><tr><td># GPUs</td><td>4</td></tr><tr><td># gradient accumulation</td><td>2</td></tr><tr><td>learning rate</td><td>5.0e-05</td></tr><tr><td>ε</td><td>1.0e-08</td></tr><tr><td>batch size</td><td>16</td></tr><tr><td>weight decay</td><td>0.01</td></tr><tr><td>max gradient norm</td><td>1.0</td></tr><tr><td>seed</td><td>42</td></tr><tr><td>max sequence length</td><td>256</td></tr></table>
|
| 299 |
+
|
| 300 |
+
Table 9: DPR Reader Training Configurations
|
| 301 |
+
|
| 302 |
+
Xinyu Zhang, Nandan Thakur, Odunayo Ogundepo, Ehsan Kamalloo, David Alfonso-Hermelo, Xiaoguang Li, Qun Liu, Mehdi Rezagholizadeh, and Jimmy Lin. 2022. Making a miracl: Multilingual information retrieval across a continuum of languages.
|
| 303 |
+
|
| 304 |
+
# A Preparing Wikipedia Passages
|
| 305 |
+
|
| 306 |
+
Wikipedia is a popular choice as a knowledge base for open-retrieval question-answering (QA) experiments, where articles are usually divided into fixed-length passages that are indexed and used for retrieval and reading comprehension, as seen in previous works such as (Karpukhin et al., 2020; Asai et al., 2021). However, Tamber et al. (2023) highlighted that splitting articles into fragmented and disjoint passages can negatively impact downstream reading comprehension performance. Instead, they proposed a sliding window segmentation approach to create passages from Wikipedia articles. In line with this methodology, we used the same approach to create passages for our crosslingual question-answering experiments.
|
| 307 |
+
|
| 308 |
+
To create our passages, we downloaded the Wikipedia dumps dated May 01, 2022, for English Wikipedia and April 20, 2022, for French Wikipedia. We then applied the sliding window approach to generate fixed-length passages of 100 tokens each from these dumps. These passages serve as our knowledge base for retrieval and answer span extraction. By adopting the sliding window segmentation approach for creating Wikipedia passages, we aim to improve downstream reading comprehension performance. The fixed-length passages enable efficient indexing and retrieval of relevant information for a given question while reducing the impact of disjoint and fragmented information that may occur when arbitrarily splitting articles.
|
| 309 |
+
|
| 310 |
+
# B Training and Evaluation Details
|
| 311 |
+
|
| 312 |
+
# B.1 mDPR Reader:
|
| 313 |
+
|
| 314 |
+
We train a multilingual DPR reader model using pretrained bert-base-multilingual-uncased as the model backbone. The model was trained to predict the correct answer span for a question given a set of relevant passages. We trained our model using the DPR retriever output on the training and development set of Natural questions and evaluated on the test set of AFRIQA in a zero-shot manner. The model was trained on 4 A6000 Nvidia GPUs with a batch size of 16 and 2 gradient accumulation steps. We used an initial learning rate of 5e-5 and 500 warmup steps. The full list of training hyperparameters can be found in Table 9.
|
| 315 |
+
|
| 316 |
+
# B.2 AfroXLM-R Reader
|
| 317 |
+
|
| 318 |
+
To extract answer spans from the gold passages, we train extractive reader models on the training set of Squad 2.0 (Rajpurkar et al., 2016) and fQuad (d'Hoffschmidt et al., 2020) using AfroXLM-R as a backbone. We evaluated the models on the test queries and the annotated gold passages. The models were trained for 5 epochs using a fixed learning rate of 3e-5 and batch size of 16 on a single A100 Nvidia GPU.
|
| 319 |
+
|
| 320 |
+
# B.3 mT5 Reader
|
| 321 |
+
|
| 322 |
+
We finetuned multilingual pretrained text-to-text transformer (mT5) (Xue et al., 2020) on Squad 2.0 (Rajpurkar et al., 2016) dataset to generate answers from the gold passages. We trained the model for 5 epochs with a learning rate of 3e-5 and batch size of 32 on a single A100 Nvidia GPU.
|
| 323 |
+
|
| 324 |
+
# C Machine Translation BLEU Scores
|
| 325 |
+
|
| 326 |
+
Table 10 shows the BLEU score of the different translation systems on the test set of AFRIQA, evaluated against the human-translated queries. Google Translate performs the best on the languages it supports while NLLB 1.3B achieves slightly poorer performance with a broader language coverage.
|
| 327 |
+
|
| 328 |
+
# D Additional Experiments
|
| 329 |
+
|
| 330 |
+
# D.1 Retrieval Top-20/100 Accuracy
|
| 331 |
+
|
| 332 |
+
We present top-20 retriever accuracy results in Table 11.
|
| 333 |
+
|
| 334 |
+
<table><tr><td>Source lang</td><td>Target lang</td><td>GMT</td><td>NLLB</td><td>M2M-100</td></tr><tr><td>bem</td><td>eng</td><td>—</td><td>24.4</td><td>—</td></tr><tr><td>fon</td><td>fre</td><td>—</td><td>16.6</td><td>8.7</td></tr><tr><td>hau</td><td>eng</td><td>55.2</td><td>44.6</td><td>26.3</td></tr><tr><td>ibo</td><td>eng</td><td>48.3</td><td>46.3</td><td>34.1</td></tr><tr><td>kin</td><td>eng</td><td>44.9</td><td>43.1</td><td>—</td></tr><tr><td>swa</td><td>eng</td><td>54.0</td><td>53.2</td><td>34.7</td></tr><tr><td>twi</td><td>eng</td><td>33.0</td><td>30.1</td><td>15.7</td></tr><tr><td>wol</td><td>fre</td><td>—</td><td>16.6</td><td>12.7</td></tr><tr><td>yor</td><td>eng</td><td>32.7</td><td>30.6</td><td>10.6</td></tr><tr><td>zul</td><td>eng</td><td>50.2</td><td>45.4</td><td>33.3</td></tr><tr><td>avg</td><td>—</td><td>45.5</td><td>35.1</td><td>22.0</td></tr></table>
|
| 335 |
+
|
| 336 |
+
Table 10: Translation BLEU Scores: BLEU score of some translation systems on the test set for the answer translation task. Note that Google Translate is not yet available in all languages, due to their very low-resource nature.
|
| 337 |
+
|
| 338 |
+
This further highlights the downstream effect of translation quality on retriever effectiveness with human translations showing better accuracy than other machine translation systems.
|
| 339 |
+
|
| 340 |
+
# D.2 XOR-Full Results
|
| 341 |
+
|
| 342 |
+
Table 12 presents the Exact Match Accuracy and BLEU scores of the XOR-Full task. The table contains downstream results of different translation-retriever pipelines to extract the answer span and translate it back to the same language as the question.
|
| 343 |
+
|
| 344 |
+
# E Summary of Language Linguistic Properties
|
| 345 |
+
|
| 346 |
+
In Table 13, we provide a structured breakdown of the typologies, grammatical structures, and phonology of the 10 languages in AFRIQA.
|
| 347 |
+
|
| 348 |
+
<table><tr><td></td><td colspan="3">Human Translation</td><td colspan="2">GMT</td><td colspan="2">NLLB</td><td colspan="2">M2M-100</td><td>Crosslingual</td></tr><tr><td></td><td>BM25</td><td>mDPR</td><td>Hybrid</td><td>BM25</td><td>mDPR</td><td>BM25</td><td>mDPR</td><td>BM25</td><td>mDPR</td><td>mDPR</td></tr><tr><td>lang</td><td colspan="10">Recall@20</td></tr><tr><td>bem</td><td>64.3</td><td>72.6</td><td>76.8</td><td>—</td><td>—</td><td>60.2</td><td>65.3</td><td>—</td><td>—</td><td>22.0</td></tr><tr><td>fon</td><td>71.5</td><td>72.2</td><td>74.6</td><td>—</td><td>—</td><td>49.6</td><td>52.3</td><td>46.5</td><td>46.9</td><td>30.3</td></tr><tr><td>hau</td><td>64.3</td><td>73.3</td><td>78.0</td><td>60.0</td><td>70.0</td><td>59.3</td><td>68.7</td><td>43.3</td><td>51.7</td><td>20.0</td></tr><tr><td>igb</td><td>75.3</td><td>78.7</td><td>87.8</td><td>72.4</td><td>76.0</td><td>70.2</td><td>73.4</td><td>67.2</td><td>74.3</td><td>34.0</td></tr><tr><td>kin</td><td>67.4</td><td>72.6</td><td>80.1</td><td>63.1</td><td>68.6</td><td>62.0</td><td>65.7</td><td>—</td><td>—</td><td>19.3</td></tr><tr><td>swa</td><td>54.6</td><td>67.6</td><td>72.5</td><td>52.7</td><td>66.9</td><td>50.3</td><td>64.6</td><td>47.0</td><td>61.3</td><td>26.8</td></tr><tr><td>twi</td><td>69.0</td><td>71.4</td><td>78.4</td><td>61.0</td><td>63.7</td><td>55.9</td><td>58.6</td><td>49.8</td><td>53.9</td><td>26.3</td></tr><tr><td>wol</td><td>68.6</td><td>73.1</td><td>72.2</td><td>—</td><td>—</td><td>42.8</td><td>43.7</td><td>41.0</td><td>40.4</td><td>18.0</td></tr><tr><td>yor</td><td>62.7</td><td>72.6</td><td>77.7</td><td>58.4</td><td>66.9</td><td>58.1</td><td>65.7</td><td>41.9</td><td>41.9</td><td>31.3</td></tr><tr><td>zul</td><td>68.6</td><td>76.6</td><td>83.7</td><td>66.5</td><td>71.7</td><td>62.2</td><td>69.2</td><td>53.2</td><td>64.9</td><td>18.2</td></tr><tr><td></td><td colspan="10">Recall@100</td></tr><tr><td>bem</td><td>76.8</td><td>81.9</td><td>84.7</td><td>—</td><td>—</td><td>70.4</td><td>74.2</td><td>—</td><td>—</td><td>37.3</td></tr><tr><td>fon</td><td>78.8</td><td>79.3</td><td>80.1</td><td>—</td><td>—</td><td>60.3</td><td>59.3</td><td>59.6</td><td>59.3</td><td>46.9</td></tr><tr><td>hau</td><td>77.7</td><td>83.3</td><td>84.7</td><td>77.7</td><td>79.3</td><td>75.0</td><td>77.7</td><td>58.3</td><td>64.3</td><td>34.3</td></tr><tr><td>igb</td><td>87.0</td><td>89.7</td><td>94.6</td><td>85.6</td><td>87.5</td><td>84.8</td><td>83.9</td><td>82.4</td><td>83.4</td><td>50.1</td></tr><tr><td>kin</td><td>78.1</td><td>81.3</td><td>87.0</td><td>75.2</td><td>78.1</td><td>74.1</td><td>77.0</td><td>—</td><td>—</td><td>30.3</td></tr><tr><td>swa</td><td>70.9</td><td>80.5</td><td>82.1</td><td>68.1</td><td>79.8</td><td>68.2</td><td>77.2</td><td>64.2</td><td>76.2</td><td>40.1</td></tr><tr><td>twi</td><td>78.4</td><td>82.9</td><td>85.7</td><td>71.6</td><td>83.7</td><td>70.0</td><td>72.5</td><td>61.8</td><td>63.1</td><td>38.4</td></tr><tr><td>wol</td><td>82.6</td><td>82.6</td><td>84.7</td><td>—</td><td>—</td><td>56.0</td><td>55.1</td><td>57.2</td><td>53.6</td><td>31.1</td></tr><tr><td>yor</td><td>78.6</td><td>83.4</td><td>87.1</td><td>73.2</td><td>79.2</td><td>71.1</td><td>78.3</td><td>59.6</td><td>55.4</td><td>46.7</td></tr><tr><td>zul</td><td>86.2</td><td>86.2</td><td>91.1</td><td>83.1</td><td>72.0</td><td>77.0</td><td>80.6</td><td>71.1</td><td>74.8</td><td>28.9</td></tr><tr><td>avg</td><td>79.5</td><td>83.1</td><td>86.2</td><td>76.4</td><td>79.9</td><td>70.8</td><td>73.6</td><td>64.3</td><td>66.3</td><td>38.4</td></tr></table>
|
| 349 |
+
|
| 350 |
+
Table 11: Retrieval recall@20/100: This table presents the retrieval recall@20/100 results for different translation types on the test set of AFRIQA. This shows the percentage of the top 20/100 retrieved passages that contain the answer. Crosslingual retrieval skips the translation step
|
| 351 |
+
|
| 352 |
+
<table><tr><td>Translation
|
| 353 |
+
Query</td><td>Answer</td><td>Retrieval</td><td colspan="10">XOR-Full BLEU</td><td>Average</td></tr><tr><td></td><td></td><td></td><td>bem</td><td>fon</td><td>hau</td><td>ibo</td><td>kin</td><td>swa</td><td>twi</td><td>wol</td><td>yor</td><td>zul</td><td>BLEU</td></tr><tr><td>GMT</td><td>GMT</td><td>BM25</td><td>—</td><td>—</td><td>19.4</td><td>28.2</td><td>21.1</td><td>16.0</td><td>11.7</td><td>—</td><td>13.8</td><td>18.1</td><td>18.3</td></tr><tr><td>GMT</td><td>GMT</td><td>mDPR</td><td>—</td><td>—</td><td>20.1</td><td>30.3</td><td>23.3</td><td>19.9</td><td>13.2</td><td>—</td><td>18.6</td><td>19.6</td><td>20.7</td></tr><tr><td>NLLB</td><td>NLLB</td><td>BM25</td><td>11.4</td><td>1.7</td><td>15.9</td><td>24.8</td><td>16.8</td><td>16.9</td><td>16.6</td><td>2.9</td><td>10.9</td><td>10.7</td><td>12.9</td></tr><tr><td>NLLB</td><td>NLLB</td><td>mDPR</td><td>10.9</td><td>3.3</td><td>17.0</td><td>27.2</td><td>18.8</td><td>18.3</td><td>17.5</td><td>3.1</td><td>15.3</td><td>11.4</td><td>14.3</td></tr><tr><td></td><td></td><td></td><td colspan="10">XOR-Full EM</td><td>EM</td></tr><tr><td>GMT</td><td>GMT</td><td>BM25</td><td>—</td><td>—</td><td>16.3</td><td>21.0</td><td>12.3</td><td>10.9</td><td>4.0</td><td>—</td><td>8.0</td><td>12.0</td><td>12.1</td></tr><tr><td>GMT</td><td>GMT</td><td>mDPR</td><td>—</td><td>—</td><td>15.7</td><td>22.7</td><td>15.0</td><td>14.6</td><td>4.9</td><td>—</td><td>12.7</td><td>14.2</td><td>14.2</td></tr><tr><td>NLLB</td><td>NLLB</td><td>BM25</td><td>6.7</td><td>0.5</td><td>11.7</td><td>15.4</td><td>7.8</td><td>10.0</td><td>10.6</td><td>2.4</td><td>5.1</td><td>4.3</td><td>7.5</td></tr><tr><td>NLLB</td><td>NLLB</td><td>mDPR</td><td>5.4</td><td>0.2</td><td>10.7</td><td>17.6</td><td>8.6</td><td>15.3</td><td>10.8</td><td>2.4</td><td>7.2</td><td>4.9</td><td>8.3</td></tr></table>
|
| 354 |
+
|
| 355 |
+
Table 12: XOR-Full results
|
| 356 |
+
|
| 357 |
+
<table><tr><td>lang</td><td>Family</td><td>Tenses</td><td>Negation</td><td>Plurality</td><td>WH-questions</td></tr><tr><td>bem</td><td>Niger-Congo</td><td>Affix to head word present "ali", past "aali"</td><td>Affix to head word: "ta", "shi", and "kaana"</td><td>Affix to the steam of the word depending on noun class</td><td>What: "cinshi", Who: "naani" When: "liisa", Why: "mulandunshi" Which: "ciisa", Where: "kwi/kwisi"</td></tr><tr><td>fon</td><td>Niger-Congo</td><td>New word added: past "xóxó"</td><td>New word added: "á"</td><td>New word added: "Iε"</td><td>What:"Eté", Who: "Mε" When: "Hwetñu", Why: "Aniwú" Which: "dè tε", Where: "Fitε"</td></tr><tr><td>hau</td><td>Afro-Asiatic</td><td>Indicative form Words used to indicate tenses: past: "tsohon" (was) present: "yanzu" (is)</td><td>Indicative form. Words used to indicate negation: ba/ba a" (not) and "banda" (except)</td><td>Suffix with vowel deletion. E.g.: "hula" (cap), "huluna" (caps) "mace" (girl), "mataye" (girls)</td><td>What: "me/ya", Who: "wa" When: "yaushe", Why: "dan me/akan me" Which: "wanne", Where: "ina/ a ina"</td></tr><tr><td>igb</td><td>Niger-Congo</td><td>None</td><td>Suffix "ghi"</td><td>No suffix. Count is often specified after the word</td><td>What: kedu/gini, Who: onye/kedu onye When: kedu mgbe, Why: gini mere/gini Which: kedu nke, Where: ebee How: kedu ka or kedu etu</td></tr><tr><td>kin</td><td>Niger-Congo</td><td>Changes to morphemes in a word</td><td>Changes to morphemes in a word</td><td>Changes to morphemes in a word</td><td>What: "iki", Who: "nde/inde" When: "ryari", Which: "ikihe/uwuhe" Where: "hehe", How: "gute"</td></tr><tr><td>swa</td><td>Niger-Congo</td><td>Present: "ni" (is), Past: "alikuwa" (was/former) Future: "atakuwa" (will be)</td><td>—</td><td>Indicated by changes to the prefix according to noun class</td><td>What: "nii", Who: "nani", When: "lini" Why: "kwanini", Which: "upi", Where: "upi", How: "vipi"</td></tr><tr><td>twi</td><td>Niger-Congo</td><td>None</td><td>'n" is added to the root word</td><td>Indicated by replacing the first two letters of a root word with "mm" or "nn".</td><td>What: "èdeæn", Who: "hwan", When: gehen, Why: aden, Which: dehen Where: ñenfa, How: sen</td></tr><tr><td>wol</td><td>Niger-Congo</td><td>Dependent word: past tense, "oon" is attached to the end of the verb</td><td>Keyword "ul" is added at the end of the verb e.g nekk - i, nekkul</td><td>Dependent word: plurality, "yi" or "ay" is attached before or after the word</td><td>What: ian, Who: kan, When: kañ Why: lu tax, Which: ban, Where: fan, How: naka</td></tr><tr><td>yor</td><td>Niger-Congo</td><td>To indicate present tense, keyword "n". Past tense is indicated with "ti" with or without a time period</td><td>Keywords such as kò, may, nile</td><td>Count is specified with a word</td><td>What: "Kini", Who: "Tani" When: "iga / nigba", Why: "kilode" Which: "ewo", Where: "Nibo"</td></tr><tr><td>zul</td><td>Niger-Congo</td><td>Present: affix after subject concord (e.g. "ya" or "sa") Past: suffix (e.g. "e" or "ile")</td><td>Typically indicated by the prefix "nga-</td><td>Indicated by morphemes "aba", "izi", "imi", "o"</td><td>What: "yini", Who: "ubani", When: "nini" Why: "kungani", Which: "yiliphi", Where: "kuphi", How: "kanjani"</td></tr></table>
|
| 358 |
+
|
| 359 |
+
Table 13: Language Linguistic Features: This table provides a breakdown of the typologies, grammatical structures, and phonology of the 10 languages in AFRiQA
|
afriqacrosslingualopenretrievalquestionansweringforafricanlanguages/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:08666792e09ec812602521ce75c2b1443d0862d5dd5ae666287ff805091093cc
|
| 3 |
+
size 1034091
|
afriqacrosslingualopenretrievalquestionansweringforafricanlanguages/layout.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b2f965afc00e4c0428cf720ac8208e53bd3ebe47354440dca0adb1390d2de357
|
| 3 |
+
size 446414
|
aksharantaropenindiclanguagetransliterationdatasetsandmodelsforthenextbillionusers/e3a17ac4-b4aa-4a86-9a48-e921d95b6312_content_list.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cc385d9a471ac537983c88c5d1f3a116bf9e2f4c5ad2f476fb905f46ca50f249
|
| 3 |
+
size 132295
|
aksharantaropenindiclanguagetransliterationdatasetsandmodelsforthenextbillionusers/e3a17ac4-b4aa-4a86-9a48-e921d95b6312_model.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9103ba24c0e65477f2f4fdd6acadf6e2f933ce6623bed72463102e1e7841c89e
|
| 3 |
+
size 153664
|