ShinDC commited on
Commit
a1cdc9f
·
verified ·
1 Parent(s): 2cdf2d8

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
1910.13904v1.txt ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Newborn babies who are under care in neonatal intensive care units (NICUs) may rapidly develop infections, including sepsis.It is a standard practice that the diagnosis of a sepsis is aided by the analysis of certain biomarkers from a biological sample such as blood, cerebrospinal fluid or urine. Use of biomarkers has two distinct disadvantages: abnormal levels of biomarkers occur late in the development of the disease, and biomarkers are also known to be unspecific to sepsis. This may lead to delayed treatments, long-term morbidity and death. Our interest is to explore use of physiomarkers for sepsis diagonosis. Physiomarkers are features from physiological signals, for example, respiratory signals.
2
+
3
+ Infectious diseases alter the heart and breathing patterns in infants [1, 2].These patterns include clinical events, such as Apnea-Bradycardia-Desaturation (ABD) events [3].These clinical events are also known to be unspecific as 97% of extremely preterm infants suffer from ABD-events at NICUs [4].In addition, the developmental age of a preterm infant affects the frequency of such events. NICU at Karolinska University hospital is equipped with bedside monitors performing a continuous recording of vital signs including respiratory frequency (RF), electrocardiogram RR-intervals (RRi) and blood oxygen saturation level (S​p​O2𝑆𝑝subscript𝑂2SpO_{2}). The clinicians receive the data at 111Hz frequency.This is a continuously available sequential data of relevant physiological signals.
4
+
5
+ In this article we explore the use of HMMs for efficient analysis of the sequential data and prediction of sepsis in preterm infants. We directly use the raw sequential data without any manual feature extraction.To the best of authors’ knowledge this line of research has not been done before.
6
+
7
+ Relevant literature:Heart Rate Observation (HeRO) system [5, 6] is commercially available. HeRO uses features extracted from RRi signal as input to a logistic regression model for sepsis prediction. Extracted features in HeRO are mean, standard deviation and sample asymmetry of RRi signal. RALIS [7] uses age dependent thresholds on RF, RRi, S​p​O2𝑆𝑝subscript𝑂2SpO_{2}, body temperature, desaturation and bradycardia events.Pulse oximetry predictive score (POPS) [8] uses mean, standard deviation, skewness, kurtosis and min-max cross correlation between RR-interval and S​p​O2𝑆𝑝subscript𝑂2SpO_{2} to compute a risk score. POPS also uses logistic regression.
8
+
9
+ Use of sequential physiological data for sepsis prediction was recently explored in [9]. The work [9] uses feature extraction from the data and treat them as a static features for further use of machine learning. They do not explore dynamical systems such as HMM. There are two main works [10, 11] where HMM was explored for sepsis prediction. The work [10] uses sequential clinical events such as Bradycardia-Desaturation events and does not use raw physiological signals. On the other hand, the work [11] considers raw physiological data for adults, where HMM state distributions are modelled using kernel density estimators.
10
+
11
+ Our contributions:
12
+
13
+ •Motivated by end-to-end learning approaches, we explore direct use of the raw sequential physiological data without any manual feature extraction.•We explore classical GMM-HMM and recent Flow model based HMM [12]. Flow model is a neural network based distribution modeling method [13].•For further improvement, we explore use of cross-entropy minimization based discriminative training.•We compare the performance of HMMs with the performance of logistic regression, support vector machine (SVM) [14] and a popular low complexity neural network called extreme learning machine (ELM) [15].
14
+
15
+ Notations:We define ∀n∈ℕ,[n]={1​⋯​n}formulae-sequencefor-all𝑛ℕdelimited-[]𝑛1⋯𝑛\forall n\in\mathbb{N},[n]=\{1\cdots n\}.E​[⋅]𝐸delimited-[]⋅E[\cdot] denotes the expectation operator.Let ⋅⊺superscript⋅⊺\cdot^{\intercal} denote the transpose operation.We denote ∀Ifor-all𝐼\forall I interval, 𝟙I\mathbbm{1}{}_{I} as the indicator function of the interval.
16
+
17
+ HMMs have been shown to be useful in various areas of biology [16], and is widely used for speech recognition tasks [17, 18]. A HMM 𝑯𝑯\bm{H}, is a probabilistic model used to represent time series 𝒙¯=[𝒙1,⋯,𝒙T]⊺¯𝒙superscriptsubscript𝒙1⋯subscript𝒙𝑇⊺\mkern 2.0mu\underline{\mkern-2.0mu\bm{x}\mkern-2.0mu}\mkern 2.0mu=\left[\bm{x}_{1},\cdots,\bm{x}_{T}\right]^{\intercal}, where 𝒙t∈ℝNsubscript𝒙𝑡superscriptℝ𝑁\bm{x}_{t}\in\mathbb{R}^{N} is the sample at time t𝑡t and T𝑇T is the total length.The hypothesis space of HMMs is defined as ℋ:={𝑯|𝑯={n,𝒒,𝑨,p​(𝒙|i;𝜽i)}}assignℋconditional-set𝑯𝑯𝑛𝒒𝑨𝑝conditional𝒙𝑖subscript𝜽𝑖\mathcal{H}:=\{\bm{H}|\bm{H}=\{n,\bm{q},\bm{A},p(\bm{x}|{i};\bm{\theta}_{i})\}\}, where•n∈ℕ𝑛ℕn\in\mathbb{N} is the number of hidden states in 𝑯𝑯\bm{H}.•𝒒=[q1,q2,⋯,qn]⊺𝒒superscriptsubscript𝑞1subscript𝑞2⋯subscript𝑞𝑛⊺\bm{q}=\left[q_{1},q_{2},\cdots,q_{n}\right]^{\intercal} is the state initialization distribution, i.e. ∀i∈[n],qi=p​(s1=i;𝑯)formulae-sequencefor-all𝑖delimited-[]𝑛subscript𝑞𝑖𝑝subscript𝑠1𝑖𝑯\forall i\in[n],~{}q_{i}=p(s_{1}=i;\bm{H}), where s1subscript𝑠1s_{1} denotes the state at time 111, i.e. the initial state.•𝑨∈R+n×n𝑨superscriptsubscript𝑅𝑛𝑛\bm{A}\in R_{+}^{n\times n} is the row stochastic transition matrix, i.e, ∀i,j∈[n]×[n]for-all𝑖𝑗delimited-[]𝑛delimited-[]𝑛\forall i,j\in[n]\times[n], 𝑨i,j=p(st+1=j|st=i;𝑯)\bm{A}_{i,j}=p(s_{t+1}=j|s_{t}=i;\bm{H}), where stsubscript𝑠𝑡s_{t} denotes the state at time t𝑡t.•p​(𝒙|s;𝜽s),s∈[n]𝑝conditional𝒙𝑠subscript𝜽𝑠𝑠delimited-[]𝑛p({\bm{x}}|{s};\bm{\theta}_{s}),~{}s\in[n], is the emission distribution of a sample 𝒙∈ℝN𝒙superscriptℝ𝑁\bm{x}\in\mathbb{R}^{N}, where 𝜽ssubscript𝜽𝑠\bm{\theta}_{s} is the set of parameters for state s𝑠s.
18
+
19
+ At each time instance t𝑡t, signal 𝒙tsubscript𝒙𝑡\bm{x}_{t} is assumed to be sampled from the state emission function p​(𝒙t|st;𝜽st)𝑝conditionalsubscript𝒙𝑡subscript𝑠𝑡subscript𝜽subscript𝑠𝑡p(\bm{x}_{t}|s_{t};\bm{\theta}_{s_{t}}), and the sequence of stsubscript𝑠𝑡s_{t} is modeled by a Markov chain.A HMM is depicted in Figure 1.
20
+
21
+ We use two models for state distribution.In the first case, we use Gaussian mixture model (GMM) as a traditional approach. We do not discuss further GMM based HMM as the model is well known [19, chapter 13.2.1].
22
+
23
+ In the second case we use neural network based probabilistic model called flow model [13].The flow model based HMM (Flow-HMM) has recently been explored in [12].The use of neural network based flow models allows modeling a complex data distribution while being able to compute the likelihood analytically.The exact likelihood computation allows us to train the Flow-HMM in expectation-maximization (EM) approach.We explain in brief the flow model architecture.
24
+
25
+ For the Flow-HMM, the state distribution p​(𝒙|s;𝜽s)𝑝conditional𝒙𝑠subscript𝜽𝑠p(\bm{x}|s;\bm{\theta}_{s}) is defined as an induced distribution by a generator 𝒈s:ℝN→ℝN:subscript𝒈𝑠→superscriptℝ𝑁superscriptℝ𝑁\bm{g}_{s}:\mathbb{R}^{N}\rightarrow\mathbb{R}^{N}, such that 𝒙=𝒈s​(𝒛)𝒙subscript𝒈𝑠𝒛\bm{x}=\bm{g}_{s}(\bm{z}), where 𝒛𝒛\bm{z} is a latent variable following a distribution with density function qs​(𝒛)subscript𝑞𝑠𝒛q_{s}(\bm{z}).Generator 𝒈ssubscript𝒈𝑠\bm{g}_{s} is parameterized by 𝚽ssubscript𝚽𝑠\bm{\Phi}_{s}.That is, 𝜽s={qs​(𝒛),𝚽s}subscript𝜽𝑠subscript𝑞𝑠𝒛subscript𝚽𝑠\bm{\theta}_{s}=\{q_{s}(\bm{z}),\bm{\Phi}_{s}\}.Assuming 𝒈ssubscript𝒈𝑠\bm{g}_{s} is invertible, by change of variable, we havep​(𝒙|s;𝜽s)=qs​(𝒛)​|det(∂𝒈s​(𝒛)∂𝒛)|−1.𝑝conditional𝒙𝑠subscript𝜽𝑠subscript𝑞𝑠𝒛superscriptsubscript𝒈𝑠𝒛𝒛1p(\bm{x}|s;\bm{\theta}_{s})=q_{s}(\bm{z})\bigg{|}\det\left(\frac{\partial\bm{g}_{s}(\bm{z})}{\partial\bm{z}}\right)\bigg{|}^{-1}.(1)
26
+
27
+ The parameters of the Flow-HMM are found using expectation-maximization (EM) assisted by gradient search. EM is used in the maximum likelihood sense. The details of the Flow-HMM training algorithm may be found in [12, Algorithm 1].
28
+
29
+ Certain classes might include a large variety of patterns.Under such conditions, the likelihood of these models w.r.t. incoming input signals will generally be high.To avoid classifying all the signals in these classes, we propose to re-weight using a discriminative step after the Baum-Welch iterations.The implementation of this discriminative training step is intended as a fine tuning step after the initial Flow-HMM training.This discriminative step is performed by maximizing the conditional probability of the correct class given an input training sample. Minimizing the cross-entropy allows us to maximize the quantity:∑(𝒙¯,𝒚)log⁡p​(𝒙¯∣𝑯𝒚)​p​(𝑯𝒚)∑j=01p​(𝒙¯∣𝑯j)​p​(𝑯j)subscript¯𝒙𝒚𝑝conditional¯𝒙subscript𝑯𝒚𝑝subscript𝑯𝒚superscriptsubscript𝑗01𝑝conditional¯𝒙subscript𝑯𝑗𝑝subscript𝑯𝑗\sum_{(\mkern 2.0mu\underline{\mkern-2.0mu\bm{x}\mkern-2.0mu}\mkern 2.0mu,\bm{y})}\log\frac{p(\mkern 2.0mu\underline{\mkern-2.0mu\bm{x}\mkern-2.0mu}\mkern 2.0mu\mid\bm{H}_{\bm{y}})p(\bm{H}_{\bm{y}})}{\sum_{j=0}^{1}p(\mkern 2.0mu\underline{\mkern-2.0mu\bm{x}\mkern-2.0mu}\mkern 2.0mu\mid\bm{H}_{j})p(\bm{H}_{j})}(2)where, 𝒙¯=[𝒙1,⋯,𝒙T]⊺¯𝒙superscriptsubscript𝒙1⋯subscript𝒙𝑇⊺\mkern 2.0mu\underline{\mkern-2.0mu\bm{x}\mkern-2.0mu}\mkern 2.0mu=\left[\bm{x}_{1},\cdots,\bm{x}_{T}\right]^{\intercal} with 𝒙t∈ℝN,t=1​…​Tformulae-sequencesubscript𝒙𝑡superscriptℝ𝑁𝑡1…𝑇\bm{x}_{t}\in\mathbb{R}^{N},~{}t=1\dots T is an input training sequence and 𝒚∈{0,1}𝒚01\bm{y}\in\{0,1\} is its class label.The classes prior probabilities p​(𝑯i),i=1,2formulae-sequence𝑝subscript𝑯𝑖𝑖12p(\bm{H}_{i}),~{}i=1,2 are infered from the training dataset.The probability p​(𝒙¯∣𝑯i),i=1,2formulae-sequence𝑝conditional¯𝒙subscript𝑯𝑖𝑖12p(\mkern 2.0mu\underline{\mkern-2.0mu\bm{x}\mkern-2.0mu}\mkern 2.0mu\mid\bm{H}_{i}),~{}i=1,2 of an observed sequence 𝒙¯¯𝒙\mkern 2.0mu\underline{\mkern-2.0mu\bm{x}\mkern-2.0mu}\mkern 2.0mu is computed using the forward algorithm.
30
+
31
+ Computing the denominator of (2) exactly, requires that all training sequences are evaluated by each class HMM.In practice, efficiently computing the denominator is infeasible when the number of classes is too large.In our case, we only have two classes and the computation overhead is manageable.In our implementation, we only update the Flow-models parameters during the maximization of Equation (2).The Markov chain parameters are left unchanged in the discriminative training phase.
32
+
33
+ We perform the optimization using a stochastic gradient descent approach.The stochastic gradient descent algorithm used here is ADAM [20].
34
+
35
+ In addition to discriminative training,we use feature extension technique to improve the performance of HMMs.Feature extension was shown to improve the performances of both GMM-HMM and Flow-HMM in practices [12]. Our feature extension consists in concatenating raw inputs with their 1s​tsuperscript1𝑠𝑡1^{st} and 2n​dsuperscript2𝑛𝑑2^{nd} order derivatives.The details about performance comparison with and without feature extension would be shown in the following section.
36
+
37
+ The bedside monitor signals of 484848 premature infants which have been under care at a NICU have been collected.The signals used are the Respiratory Frequency (RF), the beat to beat interval (RRi) and the blood oxygen saturation level (S​p​O2𝑆𝑝subscript𝑂2SpO_{2}).All signals were sampled at 111Hz and segmented into 202020 minutes time frames.Time frames containing missing data were discarded.Each time frame was then labelled based on information retrieved from the Electronic Health Records (EHR).Similarly to HeRO and RALIS, we aim at detecting septic events earlier than clinical suspicion of sepsis, defined as the sampling of a blood culture.In our study we use a threshold of 727272h prior to blood sample, to label a time frame as ”septic”.This is in accordance with practices and results from [7] where the RALIS system, was able to trigger sepsis alarms 2.5 days earlier in a subgroup of patients.A time frame was retro-actively labeled 111 if it occurred at most 727272h prior to clinical suspicion.A time frame was labeled 00 if it occured during a day when no notes were entered in the infant’s EHR.All time frames not labeled either 00 or 111 were discarded.
38
+
39
+ Our final dataset consists of 222222 patients, among which 131313 males and 999 females.The birth weight was 1.61±1.10plus-or-minus1.611.101.61\pm 1.10 kg and the gestational age at birth 30.9±6.14plus-or-minus30.96.1430.9\pm 6.14.Our dataset consisted in 350135013501 time frames, among which 1774 with label 00 and 172717271727 with label 111.All time frames have a constant size of T=1200𝑇1200T=1200 samples and are 333-dimensional.
40
+
41
+ Here we use a baseline model similar to the HeRO model.This model consists in a feature extraction block, followed by a logistic regression.First, the Heart Rate Characteristic index (HRCi) is computed on all time frames.The HRCi computation is summarized by the maph:𝒙¯↦(E​[𝒙¯R​R​i],E​[(𝒙¯R​R​i−E​[𝒙¯R​R​i])2],s​(𝒙¯R​R​i))∈ℝ3,:ℎmaps-to¯𝒙𝐸delimited-[]subscript¯𝒙𝑅𝑅𝑖𝐸delimited-[]superscriptsubscript¯𝒙𝑅𝑅𝑖𝐸delimited-[]subscript¯𝒙𝑅𝑅𝑖2𝑠subscript¯𝒙𝑅𝑅𝑖superscriptℝ3\displaystyle h:\mkern 2.0mu\underline{\mkern-2.0mu\bm{x}\mkern-2.0mu}\mkern 2.0mu\mapsto(E[\mkern 2.0mu\underline{\mkern-2.0mu\bm{x}\mkern-2.0mu}\mkern 2.0mu_{RRi}],E[(\mkern 2.0mu\underline{\mkern-2.0mu\bm{x}\mkern-2.0mu}\mkern 2.0mu_{RRi}-E[\mkern 2.0mu\underline{\mkern-2.0mu\bm{x}\mkern-2.0mu}\mkern 2.0mu_{RRi}])^{2}],s(\mkern 2.0mu\underline{\mkern-2.0mu\bm{x}\mkern-2.0mu}\mkern 2.0mu_{RRi}))\in\mathbb{R}^{3},where 𝒙¯R​R​i∈ℝTsubscript¯𝒙𝑅𝑅𝑖superscriptℝ𝑇\mkern 2.0mu\underline{\mkern-2.0mu\bm{x}\mkern-2.0mu}\mkern 2.0mu_{RRi}\in\mathbb{R}^{T} denotes the RRi signal of a time frame 𝒙¯¯𝒙\mkern 2.0mu\underline{\mkern-2.0mu\bm{x}\mkern-2.0mu}\mkern 2.0mu.s𝑠s is the sample asymmetry, defined as:s:x↦∑i=1Tξi(x)2𝟙(ξi(x))ℝ+∑i=1Tξi(x)2𝟙(ξi(x))ℝ∗−∈ℝ,\displaystyle s:x\mapsto\frac{\sum_{i=1}^{T}\xi_{i}(x)^{2}\mathbbm{1}{}_{\mathbb{R}_{+}}(\xi_{i}(x))}{\sum_{i=1}^{T}\xi_{i}(x)^{2}\mathbbm{1}{}_{\mathbb{R}_{*-}}(\xi_{i}(x))}\in\mathbb{R},where ∀x∈ℝT​ξi​(x)=xi−median​(x)for-all𝑥superscriptℝ𝑇subscript𝜉𝑖𝑥subscript𝑥𝑖median𝑥\forall x\in\mathbb{R}^{T}~{}\xi_{i}(x)=x_{i}-\text{median}(x).Note that the HeRO system only requires the RRi signal.Here, we do not require sparsity of the results, therefore, we trained a logistic regression model with l2subscript𝑙2l_{2}-regularization.The regularization parameter was learned using a 3-fold cross-validation grid search in the interval {10−5,⋯,105}superscript105⋯superscript105\{10^{-5},\cdots,10^{5}\}.Additionally we used a second set of features known as POPS [8] which uses: the mean, the standard deviation, the skewness and the kurtosis of the RRi and S​p​O2𝑆𝑝subscript𝑂2SpO_{2}, together with the min-max cross correlation between the RRi and S​p​O2𝑆𝑝subscript𝑂2SpO_{2} with a limited lag of 30 seconds.The results associated with these two sets of features are presented in Table 2.
42
+
43
+ We performed binary classification of two types of fixed length input time series in a maximum likelihood framework with GMM, Flow and dFlow -HMMs as probabilistic models.As a baseline, we used the clinically used HRCi index and the more recent POPS features as input to a logistic regression system.We repeated our experiments 333 times and each time a random 30%percent3030\% of the patients was left out for testing.This lead to 2361±353plus-or-minus23613532361\pm 353 time series in the training sets and 1140±353plus-or-minus11403531140\pm 353 time series in the testing sets.The code was written in Python using the Scikit-learn library for the HeRO system, hmmlearn for GMM-HMM, and PyTorch to implement Flow and dFlow-HMM.The GMM-HMM hyper-parameters were the number of states and the number of Gaussians per state.The number of Gaussians per states was varied between {2,4,6,8,10,12}.For Flow and dFlow-HMMs the hyper-parameters were the number of states, the number of Flow-model per state, the number of chains in each Flow-model, the size of the networks in the coupling layers.Given our limited input dimension, the size of the networks in the coupling layers was fixed to 333.The number of chains in the coupling layer of each Flow-model was varied between 444 and 888.We varied the number of states in our HMMs in {3,6,9}369\{3,6,9\} and show the results in Table 1.For the logistic regression, optimal regularization parameter was found with cross-validation and grid search in the set {10−5,⋯,105}superscript105⋯superscript105\{10^{-5},\cdots,10^{5}\}.We used a different set of input features to test our models in different conditions.HMMs are trained on raw time series and on raw time series with first and second order derivatives.The logistic regression model is trained on HRCi, 333-dimensional feature, and on POPS, 101010-dimensional features.
44
+
45
+ The results for the linear prediction systems are presented in Table 2 and the results for the HMMs are presented in Table 1.The bold fonts corresponds to the maximum performance across HMM models given a number of states.
46
+
47
+ The HeRO (HRCi + logistic regression) does not perform as well as expected with only 52%percent5252\% of correct classifications.With POPS features, the performance of the linear classifier reaches 57%percent5757\%.As expected, the linear classifiers are outperformed by Gaussian kernel SVM, ELM and our HMMs.SVM and ELM both reach an accuracy of 60%percent6060\% and comparable standard deviations of 4%percent44\% and 3%percent33\%.This is lower than dFlow-HMM which reaches 70%percent7070\% accuracy and outperforms both Flow-HMM 67%percent6767\%, and GMM-HMM 68%percent6868\% when the number of states n=3𝑛3n=3 and for raw-time series.These results are contrasted by the large standard deviation of dFlow-HMM 10%percent1010\%, which is larger than both Flow-HMM 4%percent44\% and GMM-HMM 3%percent33\%.When the number of states increases to n=6𝑛6n=6 and n=9𝑛9n=9, GMM-HMM reaches 68%percent6868\% and 69%percent6969\% which outperforms Flow-HMM with 61%percent6161\% and 63%percent6363\%, and dFlow-HMM with 67%percent6767\% and 65%percent6565\%.When the input time series is augmented with 1s​tsuperscript1𝑠𝑡1^{st} and 2n​dsuperscript2𝑛𝑑2^{nd} order derivatives, GMM-HMM reaches its highest performance with 75%percent7575\% accuracy at n=3𝑛3n=3.Flow-HMM and dFlow-HMM also reach their highest performance with 69%percent6969\% at n=3𝑛3n=3 and 72%percent7272\% at n=6𝑛6n=6.Here, GMM-HMM outperforms both Flow and dFlow-HMM.
48
+
49
+ The HeRO model surprisingly under-performs on our dataset.This poor performance may be due to inconsistencies in the sepsis definition.The definition of a sepsis varies between the different studies, here we include culture positive and culture negative which differs from the initial HERO study [6] but is in accordance with the definitions used in the more recent RALIS study [21].
50
+
51
+ The performance of GMM-HMM is significantly increased when adding 1s​tsuperscript1𝑠𝑡1^{st} and 2n​dsuperscript2𝑛𝑑2^{nd} order derivative as part of the input.This is in accordance with the initial studies performed on speech processing tasks [12].Our attempt to improve the performance of Flow-HMM using discriminative training was successful for both raw time series and 1s​tsuperscript1𝑠𝑡1^{st} and 2n​dsuperscript2𝑛𝑑2^{nd} order derivatives inputs.This is encouraging, given that our current discriminative training consists of only one epoch.We expect the marginal gain of discriminative training to improve the performance of dFlow-HMM even further with more iterations.However, we note a decrease in performance of Flow-HMM and dFlow-HMM as the number of hidden states is increased. This is due to the fact that there are more parameters to learn as we increase the hidden states, for the same amount of data.Among all the tested systems, GMM-HMM has the smallest standard deviation, which indicates that this model is robust to changes in training dataset.Flow models were originally designed for high-dimensional data distribution modeling.As expected, additional dimensions in Flow-HMM input lead to improvement in performances compared to the 333-dimensional case.We conjecture that Flow-HMM and dFlow-HMM suffer from insufficient training data, considering the fact that more parameters are to be learnt than GMM.
52
+
53
+ We studied the performance of Hidden Markov Models compared to state-of-art logistic regression based classification models for neonatal sepsis detection.We showed that, on our dataset consisting of 222222 patients, neonatal sepsis detection may be enhanced with the use of Hidden Markov Models.We observed that Gaussian Mixture Models for state emission probability distributions performs well, and with a low standard deviation compared to other models.dFlow-HMM was shown to outperform GMM-HMM in a limited number of scenarios.This may constitute an important building block in the future design of Flow-model based Hidden Markov Model.Adding the derivatives of the signal as an input, lead to improvement of the HMMs.Our study paves the way for further research on Hidden Markov Models topology which may lead to improved neonatal sepsis detection in NICUs.
54
+
55
+ This project was approved by the regional ethics review board (2011/1891-31/2).Informed consent was provided by all parents/guardians.
1910.14055v2.txt ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Imagine you are given the task of Tower of Hanoi with ten disks, what would you probably do to solve this complex problem? This game looks daunting at the first glance. However through trials and errors, one may discover the key is to recursively relocate the disks on the top of the stack from one pod to another, assisted by an intermediate one. In this case, you are actually learning skills from easier sub-tasks and those skills help you to learn more. This case exemplifies the procedure of self-imitated curriculum learning, which recursively develops the skills of solving more complex problems.
2
+
3
+ Tower of Hanoi belongs to an important kind of challenging problems in Reinforcement Learning (RL), namely solving the goal-oriented tasks. In such tasks, rewards are usually very sparse. For example, in many goal-oriented tasks, a single binary reward is provided only when the task is completed 1, 2, 3. Previous works attribute the difficulty of the sparse reward problems to the low efficiency in experience collection 4. Thus many approaches have been proposed to tackle this problem, including automatic goal generation 5, self-imitation learning 6, hierarchical reinforcement learning 7, curiosity driven methods 8, 9, curriculum learning 1, 10, and Hindsight Experience Replay (HER) 11. Most of these works guide the agent by demonstrating on successful choices based on sufficient exploration to improve learning efficiency. Differently, HER opens up a new way to learn more from failures, assigning hindsight credit to primal experiences. However, it is limited by only applicable when combined with off-policy algorithms3.
4
+
5
+ In this paper we propose an approach of goal-oriented RL called Policy Continuation with Hindsight Inverse Dynamics (PCHID), which leverages the key idea of self-imitate learning. In contrast to HER, our method can work as an auxiliary module for both on-policy and off-policy algorithms, or as an isolated controller itself. Moreover, by learning to predict actions directly from back-propagation through self-imitation 12, instead of temporal difference 13 or policy gradient 14, 15, 16, 17, the data efficiency is greatly improved.
6
+
7
+ The contributions of this work lie in three aspects:(1) We introduce the state-goal space partition for multi-goal RL and thereon define Policy Continuation (PC) as a new approach to such tasks.(2) We propose Hindsight Inverse Dynamics (HID), which extends the vanilla Inverse Dynamics method to the goal-oriented setting.(3) We further integrate PC and HID into PCHID, which can effectively leverage self-supervised learning to accelerate the process of reinforcement learning.Note that PCHID is a general method. Both on-policy and off-policy algorithms can benefit therefrom. We test this method on challenging RL problems, where it achieves considerably higher sample efficiency and performance.
8
+
9
+ Learning with sparse rewards in RL problems is always a leading challenge for the rewards are usually uneasy to reach with random explorations. Hindsight Experience Replay (HER) which relabels the failed rollouts as successful ones is proposed by Andrychowicz et al. 11 as a method to deal with such problem. The agent in HER receives a reward when reaching either the original goal or the relabeled goal in each episode by storing both original transition pairs st,g,at,rsubscript𝑠𝑡𝑔subscript𝑎𝑡𝑟s_{t},g,a_{t},r and relabeled transitions st,g′,at,r′subscript𝑠𝑡superscript𝑔′subscript𝑎𝑡superscript𝑟′s_{t},g^{\prime},a_{t},r^{\prime} in the replay buffer. HER was later extended to work with demonstration data 4 and boosted with multi-processing training 3. The work of Rauber et al. 18 further extended the hindsight knowledge into policy gradient methods using importance sampling.
10
+
11
+ Given a state transition pair (st,at,st+1)subscript𝑠𝑡subscript𝑎𝑡subscript𝑠𝑡1(s_{t},a_{t},s_{t+1}), the inverse dynamics  19 takes (st,st+1)subscript𝑠𝑡subscript𝑠𝑡1(s_{t},s_{t+1}) as the input and outputs the corresponding action atsubscript𝑎𝑡a_{t}. Previous works used inverse dynamics to perform feature extraction 20, 9, 21 for policy network optimization. The actions stored in such transition pairs are always collected with a random policy so that it can barely be used to optimize the policy network directly. In our work, we use hindsight experience to revise the original transition pairs in inverse dynamics, and we call this approach Hindsight Inverse Dynamics. The details will be elucidated in the next section.
12
+
13
+ Mirowski et al. 22 propose to jointly learn the goal-driven reinforcement learning problems with an unsupervised depth prediction task and a self-supervised loop closure classification task, achieving data efficiency and task performance improvement. But their method requires extra supervision like depth input. Shelhamer et al. 21 introduce several self-supervised auxiliary tasks to perform feature extraction and adopt the learned features to reinforcement learning, improving the data efficiency and returns of end-to-end learning. Pathak et al. 20 propose to learn an intrinsic curiosity reward besides the normal extrinsic reward, formulated by prediction error of a visual feature space and improved the learning efficiency. Both of the approaches belong to self-supervision and utilize inverse dynamics during training. Although our method can be used as an auxiliary task and trained in self-supervised way, we improve the vanilla inverse dynamics with hindsight, which enables direct joint training of policy networks with temporal difference and self-supervised learning.
14
+
15
+ In this section we first briefly go through the preliminaries in Sec.3.1. In Sec.3.2 we retrospect a toy example introduced in HER as a motivating example. Sec.3.3 to 3.6 describe our method in detail.
16
+
17
+ We consider a Markov Decision Process (MDP) denoted by a tuple (𝒮,𝒜,𝒫,r,γ)𝒮𝒜𝒫𝑟𝛾(\mathcal{S},\mathcal{A},\mathcal{P},r,\gamma), where 𝒮𝒮\mathcal{S}, 𝒜𝒜\mathcal{A} are the finite state and action space, 𝒫𝒫\mathcal{P} describes the transition probability as 𝒮×𝒜×𝒮→[0,1]→𝒮𝒜𝒮01\mathcal{S}\times\mathcal{A}\times\mathcal{S}\to[0,1]. r:𝒮→ℝ:𝑟→𝒮ℝr:\mathcal{S}\to\mathbb{R} is the reward function and γ∈[0,1]𝛾01\gamma\in[0,1] is the discount factor. π:𝒮×𝒜→[0,1]:𝜋→𝒮𝒜01\pi:\mathcal{S}\times\mathcal{A}\to[0,1] denotes a policy, and an optimal policy π∗superscript𝜋\pi^{*} satisfiesπ∗=arg⁡maxπ⁡𝔼s,a∼π​[∑t=0∞γt​r​(st)]superscript𝜋subscript𝜋subscript𝔼similar-to𝑠𝑎𝜋delimited-[]superscriptsubscript𝑡0superscript𝛾𝑡𝑟subscript𝑠𝑡\pi^{*}=\arg\max_{\pi}{\mathbb{E}_{s,a\sim\pi}[\sum_{t=0}^{\infty}\gamma^{t}r(s_{t})]}where at∼π​(at|st)similar-tosubscript𝑎𝑡𝜋conditionalsubscript𝑎𝑡subscript𝑠𝑡a_{t}\sim\pi(a_{t}|s_{t}), st+1∼𝒫​(st+1|at,st)similar-tosubscript𝑠𝑡1𝒫conditionalsubscript𝑠𝑡1subscript𝑎𝑡subscript𝑠𝑡s_{t+1}\sim\mathcal{P}(s_{t+1}|a_{t},s_{t}) and an s0subscript𝑠0s_{0} is given as a start state. When transition and policy are deterministic,π∗=arg⁡maxπ⁡𝔼s0​[∑t=0∞γt​r​(st)]superscript𝜋subscript𝜋subscript𝔼subscript𝑠0delimited-[]superscriptsubscript𝑡0superscript𝛾𝑡𝑟subscript𝑠𝑡\pi^{*}=\arg\max_{\pi}{\mathbb{E}_{s_{0}}[\sum_{t=0}^{\infty}\gamma^{t}r(s_{t})]}and at=π​(st)subscript𝑎𝑡𝜋subscript𝑠𝑡a_{t}=\pi(s_{t}), st+1=𝒯​(st,at)subscript𝑠𝑡1𝒯subscript𝑠𝑡subscript𝑎𝑡s_{t+1}=\mathcal{T}(s_{t},a_{t}), where π:𝒮→𝒜:𝜋→𝒮𝒜\pi:\mathcal{S}\to\mathcal{A} is deterministic and 𝒯𝒯\mathcal{T} models the deterministic transition dynamics. The expectation is over all the possible start states.
18
+
19
+ The Universal Value Function Approximator (UVFA) 23 extends the state space of Deep Q-Networks (DQN) 24 to include goal state g∈𝒢𝑔𝒢g\in\mathcal{G} as part of the input, i.e.formulae-sequence𝑖𝑒i.e., stsubscript𝑠𝑡s_{t} is extended to (st,g)∈𝒮×𝒢subscript𝑠𝑡𝑔𝒮𝒢(s_{t},g)\in\mathcal{S}\times\mathcal{G}. And the policy becomes π:𝒮×𝒢→at:𝜋→𝒮𝒢subscript𝑎𝑡\pi:\mathcal{S}\times\mathcal{G}\to a_{t}, which is pretty useful in the setting where there are multiple goals to achieve. Moreover, Schaul e​t​a​l.𝑒𝑡𝑎𝑙etal. 23 show that in such a setting, the learned policy can be generalized to previous unseen state-goal pairs. Our application of UVFA on Proximal Policy Optimization algorithm (PPO) 25 is straightforward. In the following of this work, we will use state-goal pairs to denote the extended state space (s,g)∈𝒮×𝒢𝑠𝑔𝒮𝒢(s,g)\in\mathcal{S}\times\mathcal{G}, at=π​(st,g)subscript𝑎𝑡𝜋subscript𝑠𝑡𝑔a_{t}=\pi(s_{t},g) and (st+1,g)=𝒯​(st,at)subscript𝑠𝑡1𝑔𝒯subscript𝑠𝑡subscript𝑎𝑡(s_{t+1},g)=\mathcal{T}(s_{t},a_{t}). The goal g𝑔g is fixed within an episode, but changed across different episodes.
20
+
21
+ The bit-flipping problem was provided as a motivating example in HER 11, where there are n𝑛n bits with the state space 𝒮={0,1}n𝒮superscript01𝑛\mathcal{S}=\{0,1\}^{n} and the action space 𝒜={0,1,..0,n−1}𝒜01..0𝑛1\mathcal{A}=\{0,1,..0,n-1\}. An action a𝑎a corresponds to turn the a𝑎a-th bit of the state. Each episode starts with a randomly generated state s0subscript𝑠0s_{0} and a random goal state g𝑔g. Only when the goal state g𝑔g is reached the agent will receive a reward.HER proposed to relabel the failed trajectories to receive more reward signals thus enable the policy to learn from failures. However, the method is based on temporal difference thus the efficiency of data is limited. As we can learn from failures, here comes the question that can we learn a policy by supervised learning where the data is generated using hindsight experience?
22
+
23
+ Inspired by the self-imitate learning ability of human, we aim to employ self-imitation to learn how to get success in RL even when the original goal has not yet achieved. A straightforward way to utilize self-imitate learning is to adopt the inverse dynamics. However, in most cases the actions stored in inverse dynamics are irrelevant to the goals.
24
+
25
+ Specifically, transition tuples like ((st,g),(st+1,g),at)subscript𝑠𝑡𝑔subscript𝑠𝑡1𝑔subscript𝑎𝑡((s_{t},g),(s_{t+1},g),a_{t}) are saved to learn the inverse dynamics of goal-oriented tasks. Then the learning process can be executed simply as classification when action space is discrete or regression when action space is continuous. Given a neural network parameterized by ϕitalic-ϕ\phi, the objective of learning inverse dynamics is as follows,ϕ=arg⁡minϕ​∑st,st+1,at‖fϕ​((st,g),(st+1,g))−at‖2.italic-ϕsubscriptitalic-ϕsubscriptsubscript𝑠𝑡subscript𝑠𝑡1subscript𝑎𝑡superscriptnormsubscript𝑓italic-ϕsubscript𝑠𝑡𝑔subscript𝑠𝑡1𝑔subscript𝑎𝑡2\phi=\arg\min_{\phi}\sum_{s_{t},s_{t+1},a_{t}}||f_{\phi}((s_{t},g),(s_{t+1},g))-a_{t}||^{2}.(1)
26
+
27
+ Due to the unawareness of the goals while the agent is taking actions, the goals g𝑔g in Eq.(1) are only placeholders. Thus, it will cost nothing to replace g𝑔g with g′=m​(st+1)superscript𝑔′𝑚subscript𝑠𝑡1g^{\prime}=m(s_{t+1}) but result in a more meaningful form, i.e.formulae-sequence𝑖𝑒i.e., encoding the following state as a hindsight goal. That is to say, if the agent wants to reach g′superscript𝑔′g^{\prime} from stsubscript𝑠𝑡s_{t}, it should take the action of atsubscript𝑎𝑡a_{t}, thus the decision making process is aware of the hindsight goal. We adopt fϕsubscript𝑓italic-ϕf_{\phi} trained from Eq.(1) as an additional module incorporating with HER in the Bit-flipping environment, by simply adding up their logit outputs. As shown in Fig.1(a), such an additional module leads to significant improvement. We attribute this success to the flatness of the state space. Fig.1(b) illustrates such a flatness case where an agent in a grid map is required to reach the goal g3subscript𝑔3g_{3} starting from s0subscript𝑠0s_{0}: if the agent has already known how to reach s1subscript𝑠1s_{1} in the east, intuitively, it has no problem to extrapolate its policy to reach g3subscript𝑔3g_{3} in the farther east.
28
+
29
+ Nevertheless, success is not always within an effortless single step reach. Reaching the goals of g1subscript𝑔1g_{1} and g2subscript𝑔2g_{2} are relatively harder tasks, and navigating from the start point to goal point in the GridWorld domain shown in Fig.1(c) is even more challenging. To further employ the self-imitate learning and overcome the single step limitation of inverse dynamics, we come up with a new approach called Policy Continuation with Hindsight Inverse Dynamics.
30
+
31
+ Our approach is mainly based on policy continuation over sub-policies, which can be viewed as an emendation of the spontaneous extrapolation in the bit-flipping case.
32
+
33
+ Suppose π𝜋\pi is a policy function defined on a non-empty sub-state-space 𝒮Usubscript𝒮𝑈\mathcal{S}_{U} of the state space 𝒮𝒮\mathcal{S}, i.e., 𝒮U⊂𝒮subscript𝒮𝑈𝒮\mathcal{S}_{U}\subset\mathcal{S}. If 𝒮Vsubscript𝒮𝑉\mathcal{S}_{V} is a larger subset of 𝒮𝒮\mathcal{S}, containing 𝒮Usubscript𝒮𝑈\mathcal{S}_{U}, i.e., 𝒮U⊂𝒮Vsubscript𝒮𝑈subscript𝒮𝑉\mathcal{S}_{U}\subset\mathcal{S}_{V} and ΠΠ\Pi is a policy function defined on 𝒮Vsubscript𝒮𝑉\mathcal{S}_{V} such thatΠ​(s)=π​(s)∀s∈𝒮Uformulae-sequenceΠ𝑠𝜋𝑠for-all𝑠subscript𝒮𝑈\Pi(s)=\pi(s)\qquad\forall s\in\mathcal{S}_{U}then we call ΠΠ\Pi a policy continuation of π𝜋\pi, or we can say the restriction of ΠΠ\Pi to 𝒮Usubscript𝒮𝑈\mathcal{S}_{U} is the policy function π𝜋\pi.
34
+
35
+ Denote the optimal policy as π∗:(st,gt)→at:superscript𝜋→subscript𝑠𝑡subscript𝑔𝑡subscript𝑎𝑡\pi^{*}:(s_{t},g_{t})\to a_{t}, we introduce the concept of k𝑘k-step solvability:
36
+
37
+ Given a state-goal pair (s,g)𝑠𝑔(s,g) as a task of a certain system with deterministic dynamics, if reaching the goal g𝑔g needs at least k𝑘k steps under the optimal policy π∗superscript𝜋\pi^{*} starting from s𝑠s, i.e., starting from s0=ssubscript𝑠0𝑠s_{0}=s and execute ai=π∗​(si,g)subscript𝑎𝑖superscript𝜋subscript𝑠𝑖𝑔a_{i}=\pi^{*}(s_{i},g) for i={0,1,…,k−1}𝑖01…𝑘1i=\{0,1,...,k-1\}, the state sk=𝒯​(sk−1,ak−1)subscript𝑠𝑘𝒯subscript𝑠𝑘1subscript𝑎𝑘1s_{k}=\mathcal{T}(s_{k-1},a_{k-1}) satisfies m​(sk)=g𝑚subscript𝑠𝑘𝑔m(s_{k})=g, we call the pair (s,g)𝑠𝑔(s,g) has k𝑘k-step solvability, or (s,g)𝑠𝑔(s,g) is k𝑘k-step solvable.
38
+
39
+ Ideally the k-step solvability means the number of steps it should take from s𝑠s to g𝑔g, given the maximum permitted action value. In practice the k𝑘k-step solvability is an evolving concept that can gradually change during the learning process, thus is defined as "whether it can be solve with πk−1subscript𝜋𝑘1\pi_{k-1} within k𝑘k steps after the convergence of πk−1subscript𝜋𝑘1\pi_{k-1} trained on (k𝑘k-1)-step HIDs".
40
+
41
+ We follow HER to assume a mapping m:𝒮→𝒢:𝑚→𝒮𝒢m:{\mathcal{S}}\to\mathcal{G} s.t. ∀s∈𝒮for-all𝑠𝒮\forall s\in{\mathcal{S}} the reward function r​(s,m​(s))=1𝑟𝑠𝑚𝑠1r(s,m(s))=1, thus, the information of a goal g𝑔g is encoded in state s𝑠s. For the simplest case we have m𝑚m as identical mapping and 𝒢=𝒮𝒢𝒮\mathcal{G}=\mathcal{S} where the goal g𝑔g is considered as a certain state s𝑠s of the system.
42
+
43
+ Following the idea of recursion in curriculum learning, we can divide the finite state-goal space into T+2𝑇2T+2 parts according to their k𝑘k-step solvability,
44
+
45
+ 𝒮×𝒢=(𝒮×𝒢)0∪(𝒮×𝒢)1∪…∪(𝒮×𝒢)T∪(𝒮×𝒢)U𝒮𝒢subscript𝒮𝒢0subscript𝒮𝒢1…subscript𝒮𝒢𝑇subscript𝒮𝒢𝑈\mathcal{S}\times\mathcal{G}={(\mathcal{S}\times\mathcal{G})_{0}\cup(\mathcal{S}\times\mathcal{G})_{1}\cup...\cup(\mathcal{S}\times\mathcal{G})_{T}\cup(\mathcal{S}\times\mathcal{G})_{U}}(2)
46
+
47
+ where (s,g)∈𝒮×𝒢𝑠𝑔𝒮𝒢(s,g)\in\mathcal{S}\times\mathcal{G}, T𝑇T is a finite time-step horizon that we suppose the task should be solved within, and (𝒮×𝒢)i,i∈{0,1,2,…​T}subscript𝒮𝒢𝑖𝑖012…𝑇(\mathcal{S}\times\mathcal{G})_{i},i\in\{0,1,2,...T\} denotes the set of i𝑖i-step solvable state-goal pairs, (s,g)∈(𝒮×𝒢)U𝑠𝑔subscript𝒮𝒢𝑈(s,g)\in(\mathcal{S}\times\mathcal{G})_{U} denotes unsolvable state-goal pairs, i.e.formulae-sequence𝑖𝑒i.e., (s,g)𝑠𝑔(s,g) is not k𝑘k-step solvable for ∀k∈{0,1,2,…,T}for-all𝑘012…𝑇\forall k\in\{0,1,2,...,T\}, and (𝒮×𝒢)0subscript𝒮𝒢0(\mathcal{S}\times\mathcal{G})_{0} is the trivial case g=m​(s0)𝑔𝑚subscript𝑠0g=m(s_{0}). As the optimal policy only aims to solve the solvable state-goal pairs, we can take (𝒮×𝒢)Usubscript𝒮𝒢𝑈(\mathcal{S}\times\mathcal{G})_{U} out of consideration. It is clear that we can define a disjoint sub-state-goal space union for the solvable state-goal pairs
48
+
49
+ Given a certain environment, any solvable state-goal pairs can be categorized into only one sub state-goal space by the following partition𝒮×𝒢\(𝒮×𝒢)U=⋃j=0T(𝒮×𝒢)j\𝒮𝒢subscript𝒮𝒢𝑈superscriptsubscript𝑗0𝑇subscript𝒮𝒢𝑗\mathcal{S}\times\mathcal{G}\backslash(\mathcal{S}\times\mathcal{G})_{U}=\bigcup_{j=0}^{T}(\mathcal{S}\times\mathcal{G})_{j}(3)
50
+
51
+ Then, we define a set of sub-policies {πi},i∈{0,1,2,…,T}subscript𝜋𝑖𝑖012…𝑇\{\pi_{i}\},i\in\{0,1,2,...,T\} on solvable sub-state-goal space ⋃j=0i(𝒮×𝒢)jsuperscriptsubscript𝑗0𝑖subscript𝒮𝒢𝑗\bigcup_{j=0}^{i}(\mathcal{S}\times\mathcal{G})_{j} respectively, with the following definition
52
+
53
+ πisubscript𝜋𝑖\pi_{i} is a sub-policy defined on the sub-state-goal space (𝒮×𝒢)isubscript𝒮𝒢𝑖(\mathcal{S}\times\mathcal{G})_{i}. We say πi∗superscriptsubscript𝜋𝑖\pi_{i}^{*} is an optimal sub-policy if it is able to solve all i𝑖i-step solvable state-goal pair tasks in i𝑖i steps.
54
+
55
+ If {πi∗}subscriptsuperscript𝜋𝑖\{\pi^{*}_{i}\} is restricted as a policy continuation of {πi−1∗}subscriptsuperscript𝜋𝑖1\{\pi^{*}_{i-1}\} for ∀i∈{1,2,…​k}for-all𝑖12…𝑘\forall i\in\{1,2,...k\}, πi∗subscriptsuperscript𝜋𝑖\pi^{*}_{i} is able to solve any i𝑖i-step solvable problem for i≤k𝑖𝑘i\leq k. By definition, the optimal policy π∗superscript𝜋\pi^{*} is a policy continuation of the sub policy πT∗subscriptsuperscript𝜋𝑇\pi^{*}_{T}, and πT∗subscriptsuperscript𝜋𝑇\pi^{*}_{T} is already a substitute for the optimal policy π∗superscript𝜋\pi^{*}.
56
+
57
+ We can recursively approximate π∗superscript𝜋\pi^{*} by expanding the domain of sub-state-goal space in policy continuation from an optimal sub-policy π0∗superscriptsubscript𝜋0\pi_{0}^{*}. While in practice, we use neural networks to approximate such sub-policies to do policy continuation. We propose to parameterize a policy function π=fθ𝜋subscript𝑓𝜃\pi=f_{\theta} by θ𝜃\theta with neural networks and optimize fθsubscript𝑓𝜃f_{\theta} by self-supervised learning with the data collected by Hindsight Inverse Dynamics (HID) recursively and optimize πisubscript𝜋𝑖\pi_{i} by joint optimization.
58
+
59
+ One step HID data can be collected easily. With n𝑛n randomly rollout trajectories {(s0,g),a0,r0,(s1,g),a1,…,(sT,g),aT,rT}i,i∈{1,2,…,n}subscriptsubscript𝑠0𝑔subscript𝑎0subscript𝑟0subscript𝑠1𝑔subscript𝑎1…subscript𝑠𝑇𝑔subscript𝑎𝑇subscript𝑟𝑇𝑖𝑖12…𝑛\{(s_{0},g),a_{0},r_{0},(s_{1},g),a_{1},...,(s_{T},g),a_{T},r_{T}\}_{i},i\in\{1,2,...,n\}, we can use a modified inverse dynamics by substituting the original goal g𝑔g with hindsight goal g′=m​(st+1)superscript𝑔′𝑚subscript𝑠𝑡1g^{\prime}=m(s_{t+1}) for every stsubscript𝑠𝑡s_{t} and result in {(s0,m​(s1)),a0,(s1,m​(s2)),a1,…,(sT−1,m​(sT)),aT−1}i,i∈{1,2,…,n}subscriptsubscript𝑠0𝑚subscript𝑠1subscript𝑎0subscript𝑠1𝑚subscript𝑠2subscript𝑎1…subscript𝑠𝑇1𝑚subscript𝑠𝑇subscript𝑎𝑇1𝑖𝑖12…𝑛\{(s_{0},m(s_{1})),a_{0},(s_{1},m(s_{2})),a_{1},...,(s_{T-1},m(s_{T})),a_{T-1}\}_{i},i\in\{1,2,...,n\}. We can then fit fθ1subscript𝑓subscript𝜃1f_{\theta_{1}} by
60
+
61
+ θ1=arg⁡minθ​∑st,st+1,at‖fθ​((st,m​(st+1)),(st+1,m​(st+1)))−at‖2subscript𝜃1subscript𝜃subscriptsubscript𝑠𝑡subscript𝑠𝑡1subscript𝑎𝑡superscriptnormsubscript𝑓𝜃subscript𝑠𝑡𝑚subscript𝑠𝑡1subscript𝑠𝑡1𝑚subscript𝑠𝑡1subscript𝑎𝑡2\theta_{1}=\arg\min_{\theta}\sum_{s_{t},s_{t+1},a_{t}}||f_{\theta}((s_{t},m(s_{t+1})),(s_{t+1},m(s_{t+1})))-a_{t}||^{2}(4)
62
+
63
+ By collecting enough trajectories, we can optimize fθsubscript𝑓𝜃f_{\theta} implemented by neural networks with stochastic gradient descent 26. When m𝑚m is an identical mapping, the function fθ1subscript𝑓subscript𝜃1f_{\theta_{1}} is a good enough approximator for π1∗superscriptsubscript𝜋1\pi_{1}^{*}, which is guaranteed by the approximation ability of neural networks 27, 28, 29. Otherwise, we should adapt Eq. 4 as θ1=arg⁡minθ​∑st,st+1,at‖fθ​((st,m​(st+1)),m​(st+1))−at‖2subscript𝜃1subscript𝜃subscriptsubscript𝑠𝑡subscript𝑠𝑡1subscript𝑎𝑡superscriptnormsubscript𝑓𝜃subscript𝑠𝑡𝑚subscript𝑠𝑡1𝑚subscript𝑠𝑡1subscript𝑎𝑡2\theta_{1}=\arg\min_{\theta}\sum_{s_{t},s_{t+1},a_{t}}||f_{\theta}((s_{t},m(s_{t+1})),m(s_{t+1}))-a_{t}||^{2}, i.e.formulae-sequence𝑖𝑒i.e., we should omit the state information in future state st+1subscript𝑠𝑡1s_{t+1}, to regard fθ1subscript𝑓subscript𝜃1f_{\theta_{1}} as a policy. And in practice it becomes θ1=arg⁡minθ​∑st,st+1,at‖fθ​(st,m​(st+1))−at‖2subscript𝜃1subscript𝜃subscriptsubscript𝑠𝑡subscript𝑠𝑡1subscript𝑎𝑡superscriptnormsubscript𝑓𝜃subscript𝑠𝑡𝑚subscript𝑠𝑡1subscript𝑎𝑡2\theta_{1}=\arg\min_{\theta}\sum_{s_{t},s_{t+1},a_{t}}||f_{\theta}(s_{t},m(s_{t+1}))-a_{t}||^{2}.
64
+
65
+ Once we have fθk−1subscript𝑓subscript𝜃𝑘1f_{\theta_{k-1}}, an approximator of πk−1∗superscriptsubscript𝜋𝑘1\pi_{k-1}^{*}, k𝑘k-step HID is ready to get. We can collect valid k𝑘k-step HID data recursively by testing whether the k𝑘k-step HID state-goal pairs indeed need k𝑘k steps to solve, i.e., for any k𝑘k-step transitions {(st,g),at,rt,…,(st+k,g),at+k,rt+k}subscript𝑠𝑡𝑔subscript𝑎𝑡subscript𝑟𝑡…subscript𝑠𝑡𝑘𝑔subscript𝑎𝑡𝑘subscript𝑟𝑡𝑘\{(s_{t},g),a_{t},r_{t},...,(s_{t+k},g),a_{t+k},r_{t+k}\}, if our policy πk−1∗superscriptsubscript𝜋𝑘1\pi_{k-1}^{*} at hand can not provide with another solution from (st,m​(st+k))subscript𝑠𝑡𝑚subscript𝑠𝑡𝑘(s_{t},m(s_{t+k})) to (st+k,m​(st+k))subscript𝑠𝑡𝑘𝑚subscript𝑠𝑡𝑘(s_{t+k},m(s_{t+k})) in less than k𝑘k steps, the state-goal pair (st,m​(st+k))subscript𝑠𝑡𝑚subscript𝑠𝑡𝑘(s_{t},m(s_{t+k})) must be k𝑘k-step solvable, and this pair together with the action atsubscript𝑎𝑡a_{t} will be marked as (st(k),m​(st+k(k))),at(k)subscriptsuperscript𝑠𝑘𝑡𝑚subscriptsuperscript𝑠𝑘𝑡𝑘subscriptsuperscript𝑎𝑘𝑡(s^{(k)}_{t},m(s^{(k)}_{t+k})),a^{(k)}_{t}. Fig.2 illustrates this process. The testing process is based on a function TEST​(⋅)TEST⋅{\rm TEST}(\cdot) and we will focus on the selection of TESTTEST{\rm TEST} in Sec.3.6. Transition pairs like this will be collected to optimize θksubscript𝜃𝑘\theta_{k}. In practice, we leverage joint training to ensure fθksubscript𝑓subscript𝜃𝑘f_{\theta_{k}} to be a policy continuation of πi∗,i∈{1,…,k}superscriptsubscript𝜋𝑖𝑖1…𝑘\pi_{i}^{*},i\in\{1,...,k\} i.e.,
66
+
67
+ θk=arg⁡minθ​∑st(i),st+i(i),at(i),i∈{1,…,k}‖fθ​((st,m​(st+i)),(st+i,m​(st+i)))−at‖2subscript𝜃𝑘subscript𝜃subscriptsubscriptsuperscript𝑠𝑖𝑡subscriptsuperscript𝑠𝑖𝑡𝑖subscriptsuperscript𝑎𝑖𝑡𝑖1…𝑘superscriptnormsubscript𝑓𝜃subscript𝑠𝑡𝑚subscript𝑠𝑡𝑖subscript𝑠𝑡𝑖𝑚subscript𝑠𝑡𝑖subscript𝑎𝑡2\theta_{k}=\arg\min_{\theta}\sum_{s^{(i)}_{t},s^{(i)}_{t+i},a^{(i)}_{t},i\in\{1,...,k\}}||f_{\theta}((s_{t},m(s_{t+i})),(s_{t+i},m(s_{t+i})))-a_{t}||^{2}(5)
68
+
69
+ For most goal-oriented tasks, the learning objective is to find a policy to reach the goal as soon as possible. In such circumstances,Lπ​(st,g)=Lπ​(st+1,g)+1superscript𝐿𝜋subscript𝑠𝑡𝑔superscript𝐿𝜋subscript𝑠𝑡1𝑔1L^{\pi}(s_{t},g)=L^{\pi}(s_{t+1},g)+1(6)where Lπ​(s,g)superscript𝐿𝜋𝑠𝑔L^{\pi}(s,g) here is defined as the number of steps to be executed from s𝑠s to g𝑔g with policy π𝜋\pi and 1 is the additionalLπ∗​(st,g)=Lπ∗​(st+1,g)+1superscript𝐿superscript𝜋subscript𝑠𝑡𝑔superscript𝐿superscript𝜋subscript𝑠𝑡1𝑔1L^{\pi^{*}}(s_{t},g)=L^{\pi^{*}}(s_{t+1},g)+1(7)and π∗=arg⁡minπ⁡Lπ​(st,g)superscript𝜋subscript𝜋superscript𝐿𝜋subscript𝑠𝑡𝑔\pi^{*}=\arg\min_{\pi}L^{\pi}(s_{t},g)As for the learning process, it is impossible to enumerate all possible intermediate state st+1subscript𝑠𝑡1s_{t+1} in the continuous state space and
70
+
71
+ Suppose now we have the optimal sub-policy πk−1∗superscriptsubscript𝜋𝑘1\pi_{k-1}^{*} of all i𝑖i-step solvable problems ∀i≤k−1for-all𝑖𝑘1\forall i\leq k-1, we will have
72
+
73
+ Lπk∗​(st,g)=Lπk−1∗​(st+1,g)+1superscript𝐿superscriptsubscript𝜋𝑘subscript𝑠𝑡𝑔superscript𝐿superscriptsubscript𝜋𝑘1subscript𝑠𝑡1𝑔1L^{\pi_{k}^{*}}(s_{t},g)=L^{\pi_{k-1}^{*}}(s_{t+1},g)+1(8)
74
+
75
+ holds for any (st,g)∈(𝒮×𝒢)ksubscript𝑠𝑡𝑔subscript𝒮𝒢𝑘(s_{t},g)\in(\mathcal{S}\times\mathcal{G})_{k}. We can sample trajectories by random rollout or any unbiased policies and choose some feasible (st,g)subscript𝑠𝑡𝑔(s_{t},g) pairs from them, i.e.formulae-sequence𝑖𝑒i.e., any stsubscript𝑠𝑡s_{t} and st+ksubscript𝑠𝑡𝑘s_{t+k} in a trajectory that can not be solved by the
76
+
77
+ st→at=πk​(st,st+k)st+1→πk−1∗st+ksubscript𝑎𝑡subscript𝜋𝑘subscript𝑠𝑡subscript𝑠𝑡𝑘→subscript𝑠𝑡subscript𝑠𝑡1superscriptsubscript𝜋𝑘1→subscript𝑠𝑡𝑘s_{t}\xrightarrow{a_{t}=\pi_{k}(s_{t},s_{t+k})}s_{t+1}\xrightarrow{\pi_{k-1}^{*}}s_{t+k}(9)
78
+
79
+ Such a recursive approach starts from π1∗superscriptsubscript𝜋1\pi_{1}^{*}, which can be easily approximated by trained with self supervised learning by any given (st,st+1)subscript𝑠𝑡subscript𝑠𝑡1(s_{t},s_{t+1}) pairs for (st,st+1)∈(𝒮×𝒢)1subscript𝑠𝑡subscript𝑠𝑡1subscript𝒮𝒢1(s_{t},s_{t+1})\in(\mathcal{S}\times\mathcal{G})_{1} by definition.
80
+
81
+ The combination of PC and with multi-step HID leads to our algorithm PCHID. PCHID can work alone or as an auxiliary module with other RL algorithms. We discuss three different combination methods of PCHID and other algorithms in Sec.4.3. The full algorithm of the PCHID is presented as Algorithm 1.
82
+
83
+ In Algorithm 1, a crucial step to extend the (k−1)𝑘1(k-1)-step sub policy to k𝑘k-step sub policy is to test whether a k𝑘k-step transition st→st+k→subscript𝑠𝑡subscript𝑠𝑡𝑘s_{t}\to s_{t+k} in a trajectory is indeed a k𝑘k-step solvable problem if we regard stsubscript𝑠𝑡s_{t} as a start state s0subscript𝑠0s_{0} and m​(st+k)𝑚subscript𝑠𝑡𝑘m(s_{t+k}) as a goal g𝑔g. We propose two approaches and evaluate both in Sec.4.
84
+
85
+ A straightforward idea is to reset the environment to stsubscript𝑠𝑡s_{t} and execute action atsubscript𝑎𝑡a_{t} by policy πk−1subscript𝜋𝑘1\pi_{k-1}, followed by execution of at+1,at+2,…subscript𝑎𝑡1subscript𝑎𝑡2…a_{t+1},a_{t+2},..., and record if it achieves the goal in less than k𝑘k steps. We call this approach Interaction for it requires the environment to be resettable and interact with the environment. This approach can be portable when the transition dynamics is known or can be approximated without a heavy computation expense.
86
+
87
+ Given a state as input, the RND 30 is proposed to provide exploration bonus by comparing the output difference between a fixed randomly initialized neural network NAsubscript𝑁𝐴N_{A} and another neural network NBsubscript𝑁𝐵N_{B}, which is trained to minimize the output difference between NAsubscript𝑁𝐴N_{A} and NBsubscript𝑁𝐵N_{B} with previous states. After training NBsubscript𝑁𝐵N_{B} with 1,2,…,k−112…𝑘11,2,...,k-1 step transition pairs to minimize the output difference between NAsubscript𝑁𝐴N_{A} and NBsubscript𝑁𝐵N_{B}, since NBsubscript𝑁𝐵N_{B} has never seen k𝑘k-step solvable transition pairs, these pairs will be differentiated for they lead to larger output differences.
88
+
89
+ In PCHID, the learning scheme is set to be curriculum, i.e.formulae-sequence𝑖𝑒i.e., the agent must learn to master easy skills before learning complex ones. However, in general the efficiency of finding a transition sequence that is i𝑖i-step solvable decreases as i𝑖i increases. The size of buffer 𝔹isubscript𝔹𝑖\mathbb{B}_{i} is thus decreasing for i=1,2,3,…,T𝑖123…𝑇i=1,2,3,...,T and the learning of πisubscript𝜋𝑖\pi_{i} might be restricted due to limited experiences. Besides, in continuous control tasks, the k𝑘k-step solvability means the number of steps it should take from s𝑠s to g𝑔g, given the maximum permitted action value. In practice the k𝑘k-step solvability can be treated as an evolving concept that changes gradually as the learning goes. Specifically, at the beginning, an agent can only walk with small paces as it has learned from experiences collected by random movements. As the training continues, the agent is confident to move with larger paces, which may change the distribution of selected actions. Consequently, previous k𝑘k-step solvable state goal pairs may be solved in less than k𝑘k steps.
90
+
91
+ Based on the efficiency limitation and the progressive definition of k𝑘k-step solvatbility, we propose a synchronous version of PCHID. Readers please refer to the supplementary material for detailed discussion on the intuitive interpretation and empirical results.
92
+
93
+ As a policy π​(s,g)𝜋𝑠𝑔\pi(s,g) aims at reaching a state s′superscript𝑠′s^{\prime} where m​(s′)=g𝑚superscript𝑠′𝑔m(s^{\prime})=g, by intuition the difficulty of solving such a goal-oriented task depends on the complexity of m𝑚m. In Sec.4.1 we start with a simple case where m𝑚m is an identical mapping in the environment of GridWorld by showing the agent a fully observable map. Moreover, the GridWorld environment permits us to use prior knowledge to calculate the accuracy of any TESTTEST{\rm TEST} function. We show that PCHID can work independently or augmented with the DQN in discrete action space setting, outperforming the DQN as well as the DQN augmented with HER. The GridWorld environment corresponds to the identical mapping case 𝒢=𝒮𝒢𝒮\mathcal{G}=\mathcal{S}. In Sec.4.2 we test our method on a continuous control problem, the FetchReach environment provided by Plappert et al. 3. Our method outperforms PPO by achieving 100%percent100100\% successful rate in about 100100100 episodes. We further compare the sensitivity of PPO to reward values and the robustness PCHID owns. The state-goal mapping of FetchReach environment is 𝒢⊂𝒮𝒢𝒮\mathcal{G}\subset\mathcal{S}.
94
+
95
+ We use the GridWorld navigation task in Value Iteration Networks (VIN) 31, in which the state information includes the position of the agent, and an image of the map of obstacles and goal position. In our experiments we use 16×16161616\times 16 domains, navigation in which is not an effortless task. Fig.1(c) shows an example of our domains. The action space is discrete and contains 888 actions leading the agent to its 888 neighbour positions respectively. A reward of 101010 will be provided if the agent reaches the goal within 505050 timesteps, otherwise the agent will receive a reward of −0.020.02-0.02. An action leading the agent to an obstacle will not be executed, thus the agent will stay where it is. In each episode, a new map will randomly selected start s𝑠s and goal g𝑔g points will be generated. We train our agent for 500500500 episodes in total so that the agent needs to learn to navigate within just 500500500 trials, which is much less than the number used in VIN 31.222Tarmar et al. train VIN through the imitation learning (IL) with ground-truth shortest paths between start and goal positions. Although both of our approaches are based on IL, we do not need ground-truth data Thus we can demonstrate the high data efficiency of PCHID by testing the learned agent on 100010001000 unseen maps. Our work follows VIN to use the rollout success rate as the evaluation metric.
96
+
97
+ Our empirical results are shown in Fig.3. Our method is compared with DQN, both of which are equipped with VIN as policy networks. We also apply HER to DQN but result in a little improvement. PC with 111-step HID, denoted by PCHID 1, achieves similar accuracy as DQN in much less episodes, and combining PC with 555-step HID, denoted by PCHID 5, and HER results in much more distinctive improvement.
98
+
99
+ In the Fetch environments, there are several tasks based on a 7-DoF Fetch robotics arm with a two-fingered parallel gripper. There are four tasks: FetchReach, FetchPush, FetchSlide and FetchPickAndPlace. In those tasks, the states include the Cartesian positions, linear velocity of the gripper, and position information as well as velocity information of an object if presented. The goal is presented as a 3-dimentional vector describing the target location of the object to be moved to. The agent will get a reward of 00 if the object is at the target location within a tolerance or −11-1 otherwise. Action is a continuous 4-dimentional vector with the first three of them controlling movement of the gripper and the last one controlling opening and closing of the gripper.
100
+
101
+ Here we demonstrate PCHID in the FetchReach task. We compare PCHID with PPO and HER based on PPO. Our work is the first to extend hindsight knowledge into on-policy algorithms 3. Fig.4 shows our results. PCHID greatly improves the learning efficiency of PPO. Although HER is not designed for on-policy algorithms, our combination of PCHID and PPO-based HER results in the best performance.
102
+
103
+ As PCHID only requires sufficient exploration in the environment to approximate optimal sub-policies progressively, it can be easily plugged into other RL algorithms, including both on-policy algorithms and off-policy algorithms. At this point, the PCHID module can be regarded as an extension of HER for off-policy algorithms. We put forward three combination strategies and evaluate each of them on both GridWorld and FetchReach environment.
104
+
105
+ The first strategy for combining PCHID with normal RL algorithm is to adopt a shared policy between them. A shared network is trained through both temporal difference learning in RL and self-supervised learning in PCHID. The PCHID module in joint training can be viewed as a regularizer.
106
+
107
+ Another strategy for combination is to train two policy networks separately, with data collected in the same set of trajectories. When the action space is discrete, we can simply average the two output vectors of policy networks, e.g. the Q-value vector and the log-probability vector of PCHID. When the action space is continuous, we can then average the two predicted action vectors and perform an interpolated action. From this perspective, the RL agent here actually learns how to work based on PCHID and it parallels the key insight of ResNet 32. If PCHID itself can solve the task perfectly, the RL agent only needs to follow the advice of PCHID. Otherwise, when it comes to complex tasks, PCHID will provide basic proposals of each decision to be made. The RL agent receives hints from those proposals thus the learning becomes easier.
108
+
109
+ This approach is quite similar to the curiosity driven methods. Instead of using the inverse dynamics to define the curiosity, we use the prediction difference between PCHID module and RL agent as an intrinsic reward to motivate RL agent to act as PCHID. Maximizing the intrinsic reward helps the RL agent to avoid aimless explorations hence can speed up the learning process.
110
+
111
+ Fig.5 shows our results in GridWorld and FetchReach with different combination strategies. Joint training performs the best and it does not need hyper-parameter tuning. On the contrary, the averaging outputs requires determining the weights while the intrinsic reward requires adjusting its scale with regard to the external reward.
112
+
113
+ In this work we propose the Policy Continuation with Hindsight Inverse Dynamics (PCHID) to solve the goal-oriented reward sparse tasks from a new perspective. Our experiments show the PCHID is able to improve data efficiency remarkably in both discrete and continuous control tasks. Moreover, our method can be incorporated with both on-policy and off-policy RL algorithms flexibly.
114
+
115
+ Acknowledgement: We acknowledge discussions with Yuhang Song and Chuheng Zhang. This work was partially supported by SenseTime Group (CUHK Agreement No.7051699) and CUHK direct fund (No.4055098).
1910.14104v3.txt ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Deep learning-based beamforming systems, sometimes called neural beamformers, have been an active research topic in recent years [1, 2]. A general pipeline in the design of many recent neural beamformers is to first perform pre-separation on each channel independently, and then apply conventional beamforming techniques such as minimum variance distortionless response beamforming (MVDR) or multi-channel Wiener filtering (MWF) based on the pre-separation outputs [3, 4, 5, 6, 7, 8, 2]. As those conventional beamforming techniques are typically defined as an optimization problem invariant to the permutation of number of the microphones, this pipeline serves as a universal solution to multi-channel speech separation tasks in various configurations. However, as the pre-separation stage is typically trained independently and the estimation of the beamforming filters is a deterministic operation irrelevant to the pre-separation outputs, such systems may generate unreliable outputs when the pre-separation stage fails.
2
+
3
+ Another pipeline for neural beamformers is to directly estimate the beamforming filters in either time domain or frequency domain [9, 10, 11, 12, 13]. Without the use of conventional filter estimation operations in optimization-based beamformers, this pipeline allows for end-to-end estimation of beamforming filters in a fully-trainable fashion. However, such systems typically assume knowledge about the number of microphones, since a standard network layer can only generate a fix-sized output. Moreover, as the fix-sized output typically consists of the beamforming filters for all channels, it implicitly determines the permutation or indexing of the microphones during the assignment of the sub-parts of the output to different channels. As a consequence, permuting the channel indexes while maintaining their locations might generate completely different outputs and lead to inconsistent performance.
4
+
5
+ A recently proposed system, the filter-and-sum network (FaSNet) [13], attempts to address the disadvantages of both types of pipelines. FaSNet directly estimates the time-domain beamforming filters without specifying the number or permutation of the microphones. With a two-stage design, the first stage applies pre-separation on a selected reference microphone by estimating its beamforming filters, and the second stage estimates the beamforming filters for all remaining microphones based on pair-wise cross-channel features between the pre-separation output and each of the remaining microphones. The filters from both stages are convolved with their corresponding channel waveforms and summed together to form the beamformed output. This is equivalent to replace the filter estimation operation in conventional beamformers by a pair-wise end-to-end filter estimation module and jointly train the two stages. The filter estimation in the second stage is invariant to permutation and number of the microphones due to the use of pair-wise features. Experiment results on fixed geometry array configuration have shown that FaSNet was able to achieve better performance than conventional mask-based neural beamformers in multi-channel speech separation and dereverberation tasks [13], indicating the potential of the model.
6
+
7
+ Although FaSNet overcomes the shortcomings of both pipelines, it also weakens the strengths of them. It still suffers from the problem that the performance of the pre-separation stage greatly affects the filter estimation at the second stage, and the use of pair-wise features prevents it from utilizing the information from all microphones to make a global decision during filter estimation. These flaws might cause unstable and unreliable performance especially in ad-hoc array configurations, where the acoustic properties of different microphones’ signals may significantly differ.
8
+
9
+ To allow the model to get rid of the weaknesses and preserve the advantages of both pipelines, we propose transform-average-concatenate (TAC), a simple method for microphone permutation and number invariant processing that fully utilizes the information from all microphones. A TAC module first transforms each channel’s feature with a sub-module shared by all channels, and then the outputs are averaged as a global-pooling stage and passed to another sub-module for extra nonlinearity. The corresponding output is then concatenated with each of the outputs of the first transformation sub-module and passed to a third sub-module for generating channel-dependent outputs. It is easy to see that, with parameter sharing at the transform and concatenate stages and the permutation-invariant property of the average stage, TAC guarantees channel permutation and number invariant processing and is always able to make global decisions. In Section 4 we will compare multiple model configurations with and without TAC and show that such design improves the FasNet performance in both ad-hoc and fixed geometry array settings.
10
+
11
+ We consider an N𝑁N-channel microphone array with an arbitrary geometry where N∈{2,…,Nm}𝑁2…subscript𝑁��N\in\{2,\ldots,N_{m}\} can vary between 2 and a pre-defined maximum number Nm≥2subscript𝑁𝑚2N_{m}\geq 2. Each channel is represented by a sequential feature 𝐙i∈ℝT⁣×∗,i=1,…,Nformulae-sequencesubscript𝐙𝑖superscriptℝ𝑇absent𝑖1…𝑁\bm{\mathrm{Z}}_{i}\in\mathbb{R}^{T\times*},i=1,\ldots,N where T𝑇T denotes the sequence length and ∗* denotes arbitrary feature dimensions. For simplicity we assume one-dimensional features, i.e. 𝐙i∈ℝT×Ksubscript𝐙𝑖superscriptℝ𝑇𝐾\bm{\mathrm{Z}}_{i}\in\mathbb{R}^{T\times K}, although the proposed method can be easily extended to higher dimensions.
12
+
13
+ A TAC module first transforms each channel’s feature with a shared sub-module. Although any neural network architectures can be applied, here we simply use a fully-connected (FC) layer with parametric rectified linear unit (PReLU) activation at each time step:𝐟i,j=P​(𝐳i,j),j=1,…,Tformulae-sequencesubscript𝐟𝑖𝑗𝑃subscript𝐳𝑖𝑗𝑗1…𝑇\displaystyle\bm{\mathrm{f}}_{i,j}=P(\bm{\mathrm{z}}_{i,j}),\,j=1,\ldots,T(1)where 𝐳i,j∈ℝ1×Ksubscript𝐳𝑖𝑗superscriptℝ1𝐾\bm{\mathrm{z}}_{i,j}\in\mathbb{R}^{1\times K} is the j𝑗j-th time step in 𝐙isubscript𝐙𝑖\bm{\mathrm{Z}}_{i}, P​(⋅)𝑃⋅P(\cdot) is the mapping function defined by the FC layer, and 𝐟i,j∈ℝ1×Dsubscript𝐟𝑖𝑗superscriptℝ1𝐷\bm{\mathrm{f}}_{i,j}\in\mathbb{R}^{1\times D} denotes the output for channel i𝑖i at time step j𝑗j. All features 𝐟i,j,i=1,…,Nformulae-sequencesubscript𝐟𝑖𝑗𝑖1…𝑁\bm{\mathrm{f}}_{i,j},i=1,\ldots,N at time step j𝑗j are then averaged as a global-pooling stage, and passed to another FC layer with PReLU activation:𝐟^j=R​(1N​∑i=1N𝐟i,j)subscript^𝐟𝑗𝑅1𝑁superscriptsubscript𝑖1𝑁subscript𝐟𝑖𝑗\displaystyle\hat{\bm{\mathrm{f}}}_{j}=R(\frac{1}{N}\sum_{i=1}^{N}\bm{\mathrm{f}}_{i,j})(2)where R​(⋅)𝑅⋅R(\cdot) is the mapping function defined by this FC layer and 𝐟^j∈ℝ1×Dsubscript^𝐟𝑗superscriptℝ1𝐷\hat{\bm{\mathrm{f}}}_{j}\in\mathbb{R}^{1\times D} is the output at time step j𝑗j. 𝐟^jsubscript^𝐟𝑗\hat{\bm{\mathrm{f}}}_{j} is then concatenated with 𝐟i,jsubscript𝐟𝑖𝑗\bm{\mathrm{f}}_{i,j} at each channel and passed to a third FC layer with PReLU activation to generate channel-specific output 𝐠i,j∈ℝ1×Dsubscript𝐠𝑖𝑗superscriptℝ1𝐷\bm{\mathrm{g}}_{i,j}\in\mathbb{R}^{1\times D}:𝐠^i,j=S​([𝐟i,j;𝐟^j])subscript^𝐠𝑖𝑗𝑆subscript𝐟𝑖𝑗subscript^𝐟𝑗\displaystyle\hat{\bm{\mathrm{g}}}_{i,j}=S([\bm{\mathrm{f}}_{i,j};\hat{\bm{\mathrm{f}}}_{j}])(3)where S​(⋅)𝑆⋅S(\cdot) is the mapping function defined by this FC layer and [x;y]𝑥𝑦[x;y] denotes the concatenation operation of vector x𝑥x and y𝑦y. A residual connection is then added between the original input 𝐳i,jsubscript𝐳𝑖𝑗\bm{\mathrm{z}}_{i,j} and 𝐠^i,jsubscript^𝐠𝑖𝑗\hat{\bm{\mathrm{g}}}_{i,j} to form the output of the TAC module:𝐳^i,j=𝐳i,j+𝐠^i,jsubscript^𝐳𝑖𝑗subscript𝐳𝑖𝑗subscript^𝐠𝑖𝑗\displaystyle\hat{\bm{\mathrm{z}}}_{i,j}=\bm{\mathrm{z}}_{i,j}+\hat{\bm{\mathrm{g}}}_{i,j}(4)
14
+
15
+ TAC is closely related to the recent progress in permutation invariant functions and functions defined on sets [14]. Permutation invariant neural architectures have been widely investigated in problems such as relational reasoning [15], point-cloud analysis [16] and graph neural networks [17]. The transform and average stages correspond to the general idea of parameter-sharing and pooling in a family of permutation invariant functions [14], while the concatenate stage is applied as in the problem setting of beamforming, the dimension of outputs should match that of the inputs. The concatenate stage also allows the usage of residual connections, which enables the TAC module to be inserted into any deep architectures without increasing the optimization difficulty.
16
+
17
+ Filter-and-sum network (FaSNet) is a time-domain filter-and-sum neural beamformer that directly estimates the beamforming filters with a two-stage design. It first splits the input signals 𝐱i,i=1,…,Nformulae-sequencesubscript𝐱𝑖𝑖1…𝑁\bm{\mathrm{x}}_{i},i=1,\ldots,N into frames of L𝐿L samples with a hop size of H∈[0,L−1]𝐻0𝐿1H\in[0,L-1] samples:𝐱i,t=𝐱i[tH:tH+L−1],t∈ℤ\displaystyle\bm{\mathrm{x}}_{i,t}=\bm{\mathrm{x}}_{i}[tH:tH+L-1],\quad t\in\mathbb{Z}(5)where t𝑡t is the frame index. Each frame is then concatenated with a context window of W𝑊W samples in both future and past, resulting in a context frame of L+2​W𝐿2𝑊L+2W samples:𝐜i,t=𝐱i[tH−W:tH+L+W−1]\displaystyle\bm{\mathrm{c}}_{i,t}=\bm{\mathrm{x}}_{i}[tH-W:tH+L+W-1](6)We drop the frame index t𝑡t in the following discussions where there is no ambiguity. C𝐶C beamforming filters of length 2​W+12𝑊12W+1, 𝐡i,j∈ℝ1×2​W+1,j=1,…,Cformulae-sequencesubscript𝐡𝑖𝑗superscriptℝ12𝑊1𝑗1…𝐶\bm{\mathrm{h}}_{i,j}\in\mathbb{R}^{1\times 2W+1},j=1,\ldots,C, are estimated from 𝐜isubscript𝐜𝑖\bm{\mathrm{c}}_{i} for the C𝐶C target sources, and the waveforms of the sources are obtained by time-domain filter-and-sum operation:𝐲j=∑i=1N𝐡i,j⊛𝐜^isubscript𝐲𝑗superscriptsubscript𝑖1𝑁⊛subscript𝐡𝑖𝑗subscript^𝐜𝑖\displaystyle\bm{\mathrm{y}}_{j}=\sum_{i=1}^{N}\bm{\mathrm{h}}_{i,j}\circledast\hat{\bm{\mathrm{c}}}_{i}(7)where 𝐲j∈ℝ1×Lsubscript𝐲𝑗superscriptℝ1𝐿\bm{\mathrm{y}}_{j}\in\mathbb{R}^{1\times L} is the beamformed output for source j𝑗j, and ⊛⊛\circledast represents the convolution operation. All 𝐲jsubscript𝐲𝑗\bm{\mathrm{y}}_{j} are then converted to waveforms through the overlap-and-add method.
18
+
19
+ With a two-stage design, FaSNet first estimates the beamforming filters for a selected reference microphone, which we denote as microphone 1 without the loss of generality. A cross-channel feature of length 2​W+12𝑊12W+1, which is defined as the normalized cross-correlation feature (NCC), is calculated between 𝐱1subscript𝐱1\bm{\mathrm{x}}_{1} and each of the 𝐜i,i=1,…,Nformulae-sequencesubscript𝐜𝑖𝑖1…𝑁\bm{\mathrm{c}}_{i},i=1,\ldots,N:{𝐜i,j=𝐜i[j:j+L−1]qi,j=𝐱1​(𝐜i,j)T‖𝐱1‖2​‖𝐜i,j‖2,j=1,…,2​W+1\displaystyle\begin{cases}\bm{\mathrm{c}}_{i,j}=\bm{\mathrm{c}}_{i}[j:j+L-1]\\q_{i,j}=\frac{\bm{\mathrm{x}}_{1}(\bm{\mathrm{c}}_{i,j})^{T}}{\left\|\bm{\mathrm{x}}_{1}\right\|_{2}\left\|\bm{\mathrm{c}}_{i,j}\right\|_{2}}\end{cases},\quad j=1,\ldots,2W+1(8)It is easy to see that 𝐪i∈ℝ1×(2​W+1)subscript𝐪𝑖superscriptℝ12𝑊1\bm{\mathrm{q}}_{i}\in\mathbb{R}^{1\times(2W+1)} is defined as the cosine similarity between the center frame 𝐱1subscript𝐱1\bm{\mathrm{x}}_{1} at reference microphone and the context frame 𝐜isubscript𝐜𝑖\bm{\mathrm{c}}_{i} at microphone i𝑖i (including the reference microphone itself). A linear layer is also applied on 𝐜1subscript𝐜1\bm{\mathrm{c}}_{1} to create a K𝐾K-dimensional embedding 𝐑1∈ℝ1×Ksubscript𝐑1superscriptℝ1𝐾\bm{\mathrm{R}}_{1}\in\mathbb{R}^{1\times K} as with the encoder in [18]:𝐑1=𝐜1​𝐔subscript𝐑1subscript𝐜1𝐔\displaystyle\bm{\mathrm{R}}_{1}=\bm{\mathrm{c}}_{1}\bm{\mathrm{U}}(9)where 𝐔∈ℝ(L+2​W)×K𝐔superscriptℝ𝐿2𝑊𝐾\bm{\mathrm{U}}\in\mathbb{R}^{(L+2W)\times K} is the weight matrix. 𝐑1subscript𝐑1\bm{\mathrm{R}}_{1} is then concatenated with the mean of all 𝐪isubscript𝐪𝑖\bm{\mathrm{q}}_{i} and passed to a neural network to calculate the C𝐶C beamforming filters 𝐡1,j,j=1​…,Cformulae-sequencesubscript𝐡1𝑗𝑗1…𝐶\bm{\mathrm{h}}_{1,j},j=1\ldots,C. The mean-pooling operation applied on 𝐪isubscript𝐪𝑖\bm{\mathrm{q}}_{i} guarantees that the cross-channel feature is invariant to the microphone permutations. The beamforming filters 𝐡1,jsubscript𝐡1𝑗\bm{\mathrm{h}}_{1,j} are then convolved with 𝐜1subscript𝐜1\bm{\mathrm{c}}_{1} to generate the pre-separation results 𝐲1,j∈ℝ1×Lsubscript𝐲1𝑗superscriptℝ1𝐿\bm{\mathrm{y}}_{1,j}\in\mathbb{R}^{1\times L}:𝐲1,j=𝐜1⊛𝐡1,j,j=1,…,Cformulae-sequencesubscript𝐲1𝑗⊛subscript𝐜1subscript𝐡1𝑗𝑗1…𝐶\displaystyle\bm{\mathrm{y}}_{1,j}=\bm{\mathrm{c}}_{1}\circledast\bm{\mathrm{h}}_{1,j},\,j=1,\ldots,C(10)
20
+
21
+ The second stage of FaSNet estimates source j𝑗j’s beamforming filter for each of the remaining channels based on 𝐲1,jsubscript𝐲1𝑗\bm{\mathrm{y}}_{1,j}. Similarly, the NCC feature 𝐯i,j∈ℝ1×(2​W+1)subscript𝐯𝑖𝑗superscriptℝ12𝑊1\bm{\mathrm{v}}_{i,j}\in\mathbb{R}^{1\times(2W+1)} between 𝐜i,i∈{2,…,N}subscript𝐜𝑖𝑖2…𝑁\bm{\mathrm{c}}_{i},i\in\{2,\ldots,N\} and 𝐲1,jsubscript𝐲1𝑗\bm{\mathrm{y}}_{1,j} and channel embedding 𝐑i∈ℝ1×Ksubscript𝐑𝑖superscriptℝ1𝐾\bm{\mathrm{R}}_{i}\in\mathbb{R}^{1\times K} can be calculated in the same way. Another neural network then takes the concatenation of 𝐑isubscript𝐑𝑖\bm{\mathrm{R}}_{i} and 𝐯i,jsubscript𝐯𝑖𝑗\bm{\mathrm{v}}_{i,j} as input and generates a single beamforming filter 𝐡i,jsubscript𝐡𝑖𝑗\bm{\mathrm{h}}_{i,j} for source j𝑗j. All 𝐡i,jsubscript𝐡𝑖𝑗\bm{\mathrm{h}}_{i,j} are convolved with their corresponding window 𝐜isubscript𝐜𝑖\bm{\mathrm{c}}_{i}, and summed with the pre-separation output to form the final beamforming output:𝐲j=𝐲1,j+∑i=2N𝐜i⊛𝐡i,jsubscript𝐲𝑗subscript𝐲1𝑗superscriptsubscript𝑖2𝑁⊛subscript𝐜𝑖subscript𝐡𝑖𝑗\displaystyle\bm{\mathrm{y}}_{j}=\bm{\mathrm{y}}_{1,j}+\sum_{i=2}^{N}\bm{\mathrm{c}}_{i}\circledast\bm{\mathrm{h}}_{i,j}(11)
22
+
23
+ The most straightforward way to apply TAC in FaSNet is to replace the pair-wise filter estimation in the second stage to a global operation, allowing the filters for each of the C𝐶C sources to be jointly estimated across all remaining microphones. For each block in the neural networks for filter estimation, e.g. each temporal convolution network (TCN) in [18] or each dual-path RNN (DPRNN) block in [19], the TAC architecture proposed in Section 2.1 is added at the output of each block. Figure 1 (A) and (B) compare the flowcharts of the original and modified two-stage FaSNet models.
24
+
25
+ However, the pre-separation results at the reference microphone still cannot benefit from the TAC operation with the two-stage design. We thus propose a single-stage architecture where the filters for all channels are jointly estimated. Figure 1 (C) and (D) show the single-stage FaSNet models without and with TAC, respectively. For single-stage models, 𝐪i,i=1,…,Nformulae-sequencesubscript𝐪𝑖𝑖1…𝑁\bm{\mathrm{q}}_{i},i=1,\ldots,N is used as the NCC feature for each channel without mean-pooling.
26
+
27
+ We evaluate our approach on the task of multi-channel two-speaker noisy speech separation with both ad-hoc and fixed geometry microphone arrays. We create a multi-channel noisy reverberant dataset with 20000, 5000 and 3000 4-second long utterances from the Librispeech dataset [20]. Two speakers and one nonspeech noise are randomly selected from the 100-hour Librispeech dataset and the 100 Nonspeech Corpus [21], respectively. An overlap ratio between the two speakers is uniformly sampled between 0% and 100% such that the average overlap ratio across the dataset is 50%. The two speech signals are then shifted accordingly and rescaled to a random relative SNR between 0 and 5 dB. The noise is repeated if its length is smaller than 4 seconds, and the relative SNR between the power of the sum of the two clean speech signals and the noise is randomly sampled between 10 and 20 dB. The transformed signals are then convolved with room impulse responses generated by the image method [22] using the gpuRIR toolbox [23]. The length and width of the room are randomly sampled between 3 and 10 meters, and the height is randomly sampled between 2.5 and 4 meters. The reverberation time (T60) is randomly sampled between 0.1 and 0.5 seconds. The echoic signals are summed to create the mixture for each microphone. All microphone, speaker and noise locations in the ad-hoc array dataset are randomly sampled to be at least 0.5 m away from the room walls. In the fixed geometry array dataset, the microphone center is first sampled and then 6 microphones are evenly distributed around a circle with diameter of 10 cm. The speaker locations are then sampled such that the average speaker angle with respect to the microphone center is uniformly distributed between 0 and 180 degrees. The noise location is sampled without further constraints. The ad-hoc array dataset contains utterances with 2 to 6 microphones, where the number of utterances for each microphone configuration is set equal.
28
+
29
+ We compare multiple models in both configurations. For single-channel models, we use the first stage in the original FaSNet as a modification to the time-domain audio separation network [18], where the separation is done by estimating filters for each context frame in the mixture instead of masking matrices on a generated front-end. We refer to this model as TasNet-filter. For adding NCC features to the single-channel baseline, we apply three strategies: (1) no NCC feature (pure single-channel processing), (2) concatenate the mean-pooled NCC features (i.e. first stage in FaSNet), and (3) concatenate all NCC features according to microphone indexes (similar to [24], only applicable in fixed geometry array). For multi-channel models, we use the four variants of FaSNet introduced in Section 2.2.2. We use DPRNN blocks [19] as shown in Figure 1 in all models, as it has shown that DPRNN was able to outperform the previously proposed temporal convolutional network (TCN) with a significantly smaller model size [19]. All models are trained to minimize negative scale-invariant SNR (SI-SNR) [25] with utterance-level permutation invariant training (uPIT) [26]. The training target is always the reverberant clean speech signals. We report SI-SNR improvement (SI-SNRi) as the separation performance metric.
30
+
31
+ The context window size W𝑊W is always set to 16 ms (i.e. 256 samples at 16k Hz sample rate) and by default we set L=W𝐿𝑊L=W. We also investigate smaller L𝐿L while keeping W𝑊W at 16 ms, which allows us to investigate the effect of window size with dimension of both beamforming filters and the NCC features unchanged (both 2​W+12𝑊12W+1). The details about the dataset generation as well as model configurations is available online111https://github.com/yluo42/TAC.
32
+
33
+ Table 1 shows the experiment results on the ad-hoc array configuration. We only report the results on 2, 4 and 6 microphones due to the space limit. For the TasNet-based models, minor performance improvement can be achieved with the averaged NCC features, however increasing the number of microphones does not necessarily improves the performance. For the original two-stage FaSNet models, the performance is worse than TasNet with NCC feature even with TAC applied at the second stage. As TasNet with averaged NCC feature is equivalent to the first stage in the two-stage FaSNet, this observation indicates that the two-stage design cannot perform reliable beamforming at the second stage in the ad-hoc array configuration. On the other hand, single-stage FaSNet without TAC already outperforms both TasNet-based and two-stage FaSNet models, showing that the pre-separation stage is unnecessary in this configuration. Adding TAC to the single-stage FaSNet further improves the performance in all conditions and microphone numbers, and guarantees that more microphones will not make the performance worse. The improvement in conditions where the overlap ratio is high is rather significant. This shows that adding TAC modules enables the model to estimate much better filters by using all available information.
34
+
35
+ Although TAC is designed for the ad-hoc array configuration where the permutation and the number of microphones are unknown, we also investigate whether improvements can be achieved in a fixed geometry array configuration. Table 2 shows the experiment results with the 6-mic circular array described earlier. We notice that TasNet with all NCC features concatenated leads to even worse performance than the pure single-channel model, indicating that we might need to rethink the properness of feature concatenation in such frameworks. The original FasNet has significantly better performance than all TasNet-based models, which matches the observation in [13]. However, the single-stage FaSNet with TAC still greatly outperforms the original FaSNet across all conditions, showing that TAC is also helpful for fixed geometry arrays. A possible explanation for this is that TAC is able to learn geometry-dependent information even without explicit geometry-related features.
36
+
37
+ In the original FaSNet, it was reported that smaller center window size L𝐿L led to significantly worse performance due to the lack of frequency resolution. Here we argue that the worse performance was actually due to the lack of global processing in filter estimation. In the last row of both tables we can observe better or on par performance for single-stage FaSNet with TAC with 4 ms window. This strengthens our argument and further proves the effectiveness of TAC across various model configurations.
38
+
39
+ We proposed transform-average-concatenate (TAC), a simple method for end-to-end microphone permutation and number invariant multi-channel speech separation. A TAC module first transformed each input channel feature with a sub-module, and averaged the outputs and passed it to another sub-module, finally concatenated the output from second stage with each of the output from the first stage and passed it to a third sub-module. The first and third sub-modules were shared for all channels. TAC can be viewed as a function defined on sets being invariant to the permutation and number of set elements, and guaranteed to use the fully information within the set to make global decisions. We showed how TAC can be inserted seamlessly into the filter-and-sum network (FaSNet), a recently proposed end-to-end multi-channel speech separation model, to greatly improve the separation performance in both ad-hoc and fixed geometry configurations. We hope TAC can shed light on model designs for other multi-channel processing problems.
1910.14129v1.txt ADDED
@@ -0,0 +1,175 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Cake cutting refers to the problem of fairly allocating a divisible resource, often modeled as a cake, among agents with varying preferences. The problem dates back to shortly after the end of World War II (Steinhaus, 1948) and, not surprisingly given its wide range of applications, still enjoys significant attention in mathematics, computer science, economics, and political science to this day (Brams and Taylor, 1996; Robertson andWebb, 1998; Procaccia, 2016).
2
+
3
+ What does it mean for an allocation to be fair?Steinhaus (Steinhaus, 1948) proposed the following definition of fairness: if the cake is divided between n𝑛n agents, each agent should receive a part that she values at least 1/n1𝑛1/n of the entire cake.This definition became known as proportionality, and is one of the most fundamental notions in the literature of fair division.In his seminal article, Steinhaus showed that a proportional allocation can be found for any number of agents with arbitrary preferences over the cake—Steinhaus’ method, which he attributed to Knaster and Banach, was later formulated as a moving-knife procedure by Dubins and Spanier (Dubins andSpanier, 1961).The procedure works by having a referee move a knife over the cake from left to right.Whenever the left part has value 1/n1𝑛1/n of the entire cake for one of the agents, the agent takes that part of the cake and leaves; the procedure is then repeated among the remaining agents.In addition to ensuring proportionality, the Dubins-Spanier protocol has the important property that it always allocates to every agent a connected piece of the cake.Without this property, it may well be that an agent is presented with—in the words of Stromquist (Stromquist, 1980)—a “union of crumbs”.
4
+
5
+ The proportionality guarantee of the Dubins-Spanier protocol holds for a variety of items that one may wish to divide, since an item of any shape or form can be “projected” onto a line, which we can then run the protocol on.However, the connectivity property does not necessarily translate from the line back to the original shape.A simple illustrating example is when the item has the shape of a ring (e.g., a donut or a ring road): projecting the ring onto a line and applying Dubins-Spanier may result in an agent receiving disconnected pieces of the ring.For this example, the difficulty can be circumvented by cutting the ring at an arbitrary point, stretching it into a line, and running the protocol to achieve proportionality.Nevertheless, one may already begin to suspect that this type of fix no longer works when the shapes get more complex.
6
+
7
+ In this paper, we consider a natural setting where the cake is represented by the set of edges of an arbitrary undirected graph.The graph could correspond to a resource in the form of a network, such as a road or power cable network.The canonical cake-cutting setting, where the cake is assumed to be the interval [0,1]01[0,1], is a special case of our setting, with the graph consisting of a single edge.In this generalized graphical setting, we show that proportionality cannot always be attained if connectivity is required.Therefore, our goal in this work is to provide the best possible approximation of proportionality that can be achieved in each graph.As we will see, despite allowing arbitrary graphs and agents’ preferences in our model, we can still obtain several strong fairness guarantees.Furthermore, we study a number of variants and extensions, including when each agent can get more than one connected piece, or when the item to be divided is undesirable (often referred to as a chore).
8
+
9
+ We assume throughout the paper that the agents are endowed with valuation functions that are additive and normalized with each agent having value 111 for the whole cake; these assumptions are standard in the cake-cutting literature (Procaccia, 2016).We also assume that the pieces of cake that different agents receive may intersect in a finite number of points.Our formal model is described in Section 2.
10
+
11
+ In Section 3, we provide general guarantees that hold for any number of agents.For n𝑛n agents with arbitrary valuations and any graph, we establish the existence of a connected allocation that gives every agent a utility of at least 12​n−112𝑛1\frac{1}{2n-1}. We also show that this bound is tight even when the agents have identical valuations and the graph is a star with 2​n−12𝑛12n-1 edges.In addition, for every specific star graph, we determine the optimal utility that can be guaranteed for each number of agents.
12
+
13
+ In Section 4, we delve deeper into the case of two agents.While we know from Section 3 that both agents can be guaranteed a utility of 1/3131/3 in general, for certain graphs it is possible to do better.Perhaps surprisingly, we show that the optimal guarantee for each graph is always either 1/3131/3 or 1/2121/2; the latter case corresponds to a proportional allocation. The classification depends on a graph property that we call almost bridgeless—a graph satisfies this property if we can add an edge so that the resulting graph contains no bridges, where a bridge refers to an edge that is not contained in any cycle.We show that a guarantee of 1/2121/2 can be obtained if the graph is almost bridgeless, while 1/3131/3 is the best possible guarantee otherwise.
14
+
15
+ Next, we strengthen the result that both agents can be guaranteed a utility of 1/3131/3 for any graph by establishing the existence of a connected allocation such that the first agent receives value at least 1/2121/2 and the second agent at least 1/3131/3.More generally, we characterize all pairs (α,β)𝛼𝛽(\alpha,\beta) for which there always exists a connected allocation that yields utility at least α𝛼\alpha and β𝛽\beta to the first and second agent, respectively.On the other hand, if we are only interested in giving utility α𝛼\alpha to one agent and β𝛽\beta to the other, and are willing to give up control over which agent receives which guarantee, then additional pairs (α,β)𝛼𝛽(\alpha,\beta) become achievable—again, we give a complete characterization of all such pairs.Moreover, we consider allocating more than one connected piece to each agent: we show that for any positive integer k𝑘k, both agents can be guaranteed a utility of 12−12⋅3k121⋅2superscript3𝑘\frac{1}{2}-\frac{1}{2\cdot 3^{k}} if we allow the agents to receive a total of k+1𝑘1k+1 connected pieces, and this is tight.We also study approximate equitability and prove the existence of a connected allocation for which the agents’ utilities differ by no more than 1/3131/3; we again establish the tightness of the bound.
16
+
17
+ Finally, in Section 5, we turn our attention to chore division.In the case of two agents there is a simple reduction between the settings of cake and chores, so all of our results in Section 4 carry over to chore division.By contrast, when there are more than two agents, the relationship between the two settings is much less clear.We show that there exists a connected allocation that incurs cost at most 2n+12𝑛1\frac{2}{n+1} for n≤5𝑛5n\leq 5, and that no better bound can be obtained for any n𝑛n.
18
+
19
+ We remark that all of our positive results are constructive: for each result, we exhibit a moving-knife protocol that achieves the desired guarantee.Moreover, one can make these protocols discrete, so that they only use the cut and evaluation queries allowed by the Robertson-Webb query model in order to access the valuation functions of the agents (Robertson andWebb, 1998).
20
+
21
+ While our graphical cake model is new to the best of our knowledge, graphs have recently been studied in the context of allocating indivisible items.In particular, the items correspond to vertices of an undirected graph, and each agent must be allocated a connected subgraph of the graph.A line of work has explored existence and complexity questions for several fairness notions, both in the case of goods (Bouveret et al., 2017; Lonc andTruszczynski, 2018; Bilò et al., 2019; Beiet al., 2019; Igarashi andPeters, 2019; Suksompong, 2019) and chores (Bouveret et al., 2019).
22
+
23
+ Connectivity constraints are commonly considered in the cake-cutting literature, where each agent is allocated a single subinterval of the interval cake (Stromquist, 1980, 2008; Su, 1999; Beiet al., 2012; Cechlárová and Pillárová, 2012; Aumannet al., 2013; Cechlárová et al., 2013; Aumann and Dombb, 2015; Segal-Halevi et al., 2016).Segal-Halevi et al. (Segal-Halevi et al., 2017) studied the fair division of land and introduced geometric constraints to the setting by requiring that allocated pieces be of certain shape—such requirements are important since a long but narrow piece of land is likely to be of little practical use.Similarly to our setting, a proportional allocation does not always exist in the presence of these constraints, and the authors examined the approximations of proportionality that can be obtained.
24
+
25
+ Let N={1,2,…,n}𝑁12…𝑛N=\{1,2,\dots,n\} be the set of agents, and G=(V,E)𝐺𝑉𝐸G=(V,E) be a finite and connected undirected graph representing the cake, with no loops but possibly with multiple edges joining the same pair of vertices.111A loop can be represented in our model by adding a new vertex inside the loop, thereby breaking the loop into two edges joining the same pair of vertices.Denote by m𝑚m the number of edges.Each edge in E𝐸E can be viewed as an interval of the cake.For any points x,y𝑥𝑦x,y on an edge, we write [x,y]𝑥𝑦[x,y] or [y,x]𝑦𝑥[y,x] to denote the interval of the cake between x𝑥x and y𝑦y; we sometimes identify a vertex v∈V𝑣𝑉v\in V with the corresponding endpoint of the edges adjacent to v𝑣v.
26
+
27
+ A piece of cake is a finite union of disjoint intervals, where each interval is a subinterval of an edge and the intervals in the piece may belong to different edges.222As is commonly done in cake cutting, we assume that all intervals are closed intervals.Two intervals are said to be disjoint if they intersect in at most one point, and two pieces of cake are said to be disjoint if they intersect in a finite number of points.If we adopt the stricter convention that each point can only be allocated to one agent (so intervals can be open, half-open, or closed) and two intervals are disjoint only if their intersection is empty, there are strong negative results.For example, on a star graph, at most one agent would be able to receive intervals from more than one branch in a connected allocation.A piece of cake is said to be connected if for any two points in the piece, it is possible to get from one point to the other along the graph G𝐺G by only traversing this piece of cake.Each agent i𝑖i has a nonnegative valuation function (or utility function) fisubscript𝑓𝑖f_{i}, which specifies the agent’s value for each piece of cake.An instance consists of the graph G𝐺G, the agents, and their valuation functions. As is standard in the cake-cutting literature (Procaccia, 2016), we assume that the valuation functions are•normalized: the value of an agent for the entire cake is 111;•divisible: for each interval [x,y]𝑥𝑦[x,y] and 0≤λ≤10𝜆10\leq\lambda\leq 1, there is a point z∈[x,y]𝑧𝑥𝑦z\in[x,y] such that fi​([x,z])=λ⋅fi​([x,y])subscript𝑓𝑖𝑥𝑧⋅𝜆subscript𝑓𝑖𝑥𝑦f_{i}([x,z])=\lambda\cdot f_{i}([x,y]);•additive: the value of an agent for a piece of cake is the sum of her values for the intervals in the piece.
28
+
29
+ An allocation of the cake is denoted by a vector A=(A1,…,An)𝐴subscript𝐴1…subscript𝐴𝑛A=(A_{1},\dots,A_{n}), where each Aisubscript𝐴𝑖A_{i} is a piece of cake, and Aisubscript𝐴𝑖A_{i} and Ajsubscript𝐴𝑗A_{j} are disjoint for all i≠j𝑖𝑗i\neq j.An allocation is said to be complete if the entire cake is allocated, and connected if each Aisubscript𝐴𝑖A_{i} is a connected piece of cake.The egalitarian welfare of an allocation is defined as mini∈N⁡fi​(Ai)subscript𝑖𝑁subscript𝑓𝑖subscript𝐴𝑖\min_{i\in N}f_{i}(A_{i}). An allocation is proportional if its egalitarian welfare is at least 1/n1𝑛1/n.The inequity of an allocation is defined as maxi,j∈N⁡|fi​(Ai)−fj​(Aj)|subscript𝑖𝑗𝑁subscript𝑓𝑖subscript𝐴𝑖subscript𝑓𝑗subscript𝐴𝑗\max_{i,j\in N}|f_{i}(A_{i})-f_{j}(A_{j})|; an allocation with inequity 00 is said to be equitable.
30
+
31
+ We make analogous assumptions for chore division (Section 5).Each agent has a nonnegative cost function fisubscript𝑓𝑖f_{i} for the chore, which is normalized, divisible, and additive.The egalitarian cost of an allocation is defined as maxi∈N⁡fi​(Ai)subscript𝑖𝑁subscript𝑓𝑖subscript𝐴𝑖\max_{i\in N}f_{i}(A_{i}).Naturally, we require the entire chore to be allocated, so we restrict our attention to complete allocations of the chore.
32
+
33
+ In this section, we present an egalitarian welfare guarantee that holds for any number of agents and arbitrary graphs, and derive improved guarantees in the case where the graph is a star.
34
+
35
+ We begin by showing that it is always possible to give every agent a utility of at least 12​n−112𝑛1\frac{1}{2n-1}, and this bound is tight.Similarly to the Dubins-Spanier protocol, our algorithm proceeds by identifying a piece that is valuable enough for one agent but at the same time not too valuable for the other agents, allocating such a piece to the former agent, and recursing on the latter agents.
36
+
37
+ Let α:=12​n−1assign𝛼12𝑛1\alpha:=\frac{1}{2n-1}. To show the second part of the theorem, let G𝐺G be a star with 2​n−12𝑛12n-1 edges such that every agent values each edge exactly α𝛼\alpha, and the value is distributed uniformly within the edge. Assume for contradiction that there is a connected allocation with egalitarian welfare strictly greater than α𝛼\alpha.Consider any agent i𝑖i. The agent must receive intervals from at least two edges, and these intervals must be connected via the center vertex.Note that the unallocated parts of these edges cannot be allocated to other agents, since any agent who receives an interval from such a part cannot receive intervals from other edges and would therefore obtain value less than α𝛼\alpha.Hence, at least two edges are only allocated to agent i𝑖i. However, this means that there must be at least 2​n2𝑛2n edges in total, a contradiction.
38
+
39
+ We now prove the first part of the theorem. Let G𝐺G be an arbitrary graph. We will show that there exists a moving-knife algorithm that produces a connected allocation with egalitarian welfare at least α𝛼\alpha.We proceed by induction on n𝑛n; the statement trivially holds for n=1𝑛1n=1 since we can simply allocate the entire cake to the only agent. Assume that the statement holds for n−1𝑛1n-1 agents, and consider an instance with n𝑛n agents.
40
+
41
+ First, we claim that we can turn G𝐺G into a tree. As long as G𝐺G contains at least one cycle, pick an edge u​v𝑢𝑣uv that belongs to a cycle, add a new vertex v′superscript𝑣′v^{\prime}, and replace this edge by an edge u​v′𝑢superscript𝑣′uv^{\prime} while keeping the remaining edges of the graph as before.Since at least one cycle is removed by this operation and no new cycle is created, G𝐺G eventually becomes a tree.Note that any connected allocation of the modified graph is a connected allocation in the original graph with the same value for every agent, so it suffices to prove the theorem for the modified graph.
42
+
43
+ Choose an arbitrary vertex u𝑢u of the tree G𝐺G as its root. Let v𝑣v be a vertex such that the subtree rooted at v𝑣v yields value at least α𝛼\alpha to some agent, and the same does not hold for the subtree rooted at any child of v𝑣v. Let w1,…,wksubscript𝑤1…subscript𝑤𝑘w_{1},\dots,w_{k} be the children of v𝑣v. We consider two cases:
44
+
45
+ •Case 1: At least one of the k𝑘k branches of v𝑣v along with the corresponding subtree yields value at least α𝛼\alpha to some agent. Assume without loss of generality that the branch containing w1subscript𝑤1w_{1} is one such branch.By our assumption, the subtree rooted at w1subscript𝑤1w_{1} yields value less than α𝛼\alpha to all agents. Hence, by moving a knife from w1subscript𝑤1w_{1} to v𝑣v, we can find the point x𝑥x closest to w1subscript𝑤1w_{1} such that some agent i𝑖i values the interval [w1,x]subscript𝑤1𝑥[w_{1},x] together with the subtree rooted at w1subscript𝑤1w_{1} exactly α𝛼\alpha, and all other agents value this piece of cake at most α𝛼\alpha.We allocate this piece of cake to agent i𝑖i, and make x𝑥x a new vertex in the remaining graph, which has value at least 1−α1𝛼1-\alpha for each of the remaining agents.By the inductive hypothesis, there exists a connected allocation of the remaining graph to the n−1𝑛1n-1 agents such that every agent receives value at least 12​n−3⋅(1−α)=12​n−3⋅2​n−22​n−1>α⋅12𝑛31𝛼⋅12𝑛32𝑛22𝑛1𝛼\frac{1}{2n-3}\cdot(1-\alpha)=\frac{1}{2n-3}\cdot\frac{2n-2}{2n-1}>\alpha, as desired.•Case 2: Every branch of v𝑣v along with the corresponding subtree yields value less than α𝛼\alpha to all agents.Let t∈{1,2,…,k}𝑡12…𝑘t\in\{1,2,\dots,k\} be the smallest number such that the first t𝑡t branches and their subtrees together yield value at least α𝛼\alpha to some agent i𝑖i.We allocate this piece of cake to agent i𝑖i. For every other agent, the first t−1𝑡1t-1 branches is worth less than α𝛼\alpha and the t𝑡tth branch is also worth less than α𝛼\alpha, so the piece of cake allocated to agent i𝑖i is worth less than 2​α2𝛼2\alpha.By the inductive hypothesis, there exists a connected allocation of the remaining graph to the n−1𝑛1n-1 agents such that every agent receives value at least 12​n−3⋅(1−2​α)=12​n−1=α⋅12𝑛312𝛼12𝑛1𝛼\frac{1}{2n-3}\cdot(1-2\alpha)=\frac{1}{2n-1}=\alpha, as desired.The two cases together complete the induction.∎
46
+
47
+ Note that by following the algorithm in the proof of Theorem 3.1, we also obtain the following statement, which will be useful for our later results.
48
+
49
+ For certain graphs, it is possible to improve upon the guarantee provided by Theorem 3.1—an obvious example is the graph consisting of a single edge, for which the Dubins-Spanier protocol yields an egalitarian welfare of at least 1/n1𝑛1/n. We now derive the optimal egalitarian welfare guarantee in the case where the graph is a star. For integers n≥2𝑛2n\geq 2 and k≥3𝑘3k\geq 3, definef​(n,k)={1n+⌈k/2⌉−1for ​k<2​n−1;12​n−1for ​k≥2​n−1.𝑓𝑛𝑘cases1𝑛𝑘21for 𝑘2𝑛112𝑛1for 𝑘2𝑛1f(n,k)=\begin{cases}\dfrac{1}{n+\lceil k/2\rceil-1}&\text{for }k<2n-1;\\\dfrac{1}{2n-1}&\text{for }k\geq 2n-1.\end{cases}
50
+
51
+ The values of f​(n,k)𝑓𝑛𝑘f(n,k) for small n𝑛n and k𝑘k are shown in Table 1.
52
+
53
+ We proceed by induction on n𝑛n. For the base case n=2𝑛2n=2, the lower bound of 1/3131/3 follows from Theorem 3.1.To see that 1/3131/3 is also an upper bound, assume that both agents value three of the edges uniformly at exactly 1/3131/3 and have no value for the remaining k−3𝑘3k-3 edges.Any connected allocation with egalitarian welfare greater than 1/3131/3 would give rise to a connected allocation of a three-edge star with egalitarian welfare greater than 1/3131/3, which by Theorem 3.1 does not exist.
54
+
55
+ Assume that the statement holds for n−1𝑛1n-1 agents. First, we show that there exists a connected allocation with egalitarian welfare at least f​(n,k)𝑓𝑛𝑘f(n,k).If k≥2​n−1𝑘2𝑛1k\geq 2n-1, this follows immediately from Theorem 3.1. Suppose that k≤2​n−2𝑘2𝑛2k\leq 2n-2. We have n+⌈k/2⌉−1≥n+k/2−1≥k+22+k2−1=k𝑛𝑘21𝑛𝑘21𝑘22𝑘21𝑘n+\lceil k/2\rceil-1\geq n+k/2-1\geq\frac{k+2}{2}+\frac{k}{2}-1=k, or f​(n,k)≤1/k𝑓𝑛𝑘1𝑘f(n,k)\leq 1/k.Hence, every agent has value at least f​(n,k)𝑓𝑛𝑘f(n,k) for some edge of the star. We choose one such edge for an arbitrary agent and move a knife from its outer endpoint to the center of the star, stopping when the covered part has value f​(n,k)𝑓𝑛𝑘f(n,k) for some agent i𝑖i.We allocate this piece of cake to agent i𝑖i, and make the cut point a new vertex in the remaining graph, which has value at least 1−f​(n,k)1𝑓𝑛𝑘1-f(n,k) for each of the remaining agents.The remaining graph is still a star with k𝑘k edges (possibly with a degenerate edge), so by the inductive hypothesis, there exists a connected allocation of the remaining graph to the n−1𝑛1n-1 agents with egalitarian welfare at leastf​(n−1,k)⋅(1−f​(n,k))=1n+⌈k/2⌉−2⋅n+⌈k/2⌉−2n+⌈k/2⌉−1=1n+⌈k/2⌉−1,⋅𝑓𝑛1𝑘1𝑓𝑛𝑘⋅1𝑛𝑘22𝑛𝑘22𝑛𝑘211𝑛𝑘21f(n-1,k)\cdot(1-f(n,k))=\frac{1}{n+\lceil k/2\rceil-2}\cdot\frac{n+\lceil k/2\rceil-2}{n+\lceil k/2\rceil-1}=\frac{1}{n+\lceil k/2\rceil-1},where the first equality follows from the observation that f​(n−1,k)=1n+⌈k/2⌉−2𝑓𝑛1𝑘1𝑛𝑘22f(n-1,k)=\frac{1}{n+\lceil k/2\rceil-2} for all k≤2​n−2𝑘2𝑛2k\leq 2n-2.
56
+
57
+ Next, we show that f​(n,k)𝑓𝑛𝑘f(n,k) is tight for all n𝑛n and k𝑘k. If k≥2​n−1𝑘2𝑛1k\geq 2n-1, this follows from the instance in Theorem 3.1 and by adding extra edges of zero value.Suppose that k≤2​n−2𝑘2𝑛2k\leq 2n-2 and that the agents have identical valuations.Each agent has value f​(n,k)𝑓𝑛𝑘f(n,k) for k−1𝑘1k-1 of the edges and 1−(k−1)⋅f​(n,k)1⋅𝑘1𝑓𝑛𝑘1-(k-1)\cdot f(n,k) for the k𝑘kth edge, and the values are distributed uniformly across each edge.Note that as in the preceding paragraph, we have f​(n,k)≤1/k𝑓𝑛𝑘1𝑘f(n,k)\leq 1/k, and therefore 1−(k−1)⋅f​(n,k)≥f​(n,k)1⋅𝑘1𝑓𝑛𝑘𝑓𝑛𝑘1-(k-1)\cdot f(n,k)\geq f(n,k).Assume for contradiction that there is a connected allocation with egalitarian welfare strictly greater than f​(n,k)𝑓𝑛𝑘f(n,k).Any agent must either receive intervals from at least two edges (perhaps including the k𝑘kth edge), or only receive an interval from the k𝑘kth edge.The number of agents of the first type is at most ⌊k/2⌋𝑘2\lfloor k/2\rfloor.The number of agents of the second type is strictly less than1−(k−1)​f​(n,k)f​(n,k)=n−⌊k/2⌋n+⌈k/2⌉−11n+⌈k/2⌉−1=n−⌊k/2⌋.1𝑘1𝑓𝑛𝑘𝑓𝑛𝑘𝑛𝑘2𝑛𝑘211𝑛𝑘21𝑛𝑘2\frac{1-(k-1)f(n,k)}{f(n,k)}=\frac{\frac{n-\lfloor k/2\rfloor}{n+\lceil k/2\rceil-1}}{\frac{1}{n+\lceil k/2\rceil-1}}=n-\lfloor k/2\rfloor.This means that the total number of agents is strictly less than ⌊k/2⌋+(n−⌊k/2⌋)=n𝑘2𝑛𝑘2𝑛\lfloor k/2\rfloor+(n-\lfloor k/2\rfloor)=n, yielding the desired contradiction.∎
58
+
59
+ In this section, we focus on the case of two agents. We establish the optimal egalitarian welfare that can be obtained for each graph and derive utility frontiers when the agents may have different entitlements. In addition, we explore the extent to which our guarantees can be improved if we allow more than one connected piece per agent, and also consider approximate equitability.
60
+
61
+ Before we can state our results for specific graphs, we need some graph-theoretic terminology.Recall that a bridge of a graph is an edge that is not contained in any cycle. A graph is said to be bridgeless if it contains no bridges.
62
+
63
+ Note that according to this definition, every connected bridgeless graph with at least two vertices is also almost bridgeless, since we can add a copy of an existing edge.
64
+
65
+ Next, we define an oriented labeling of a graph.
66
+
67
+ It turns out that a graph admitting a contiguous oriented labeling is equivalent to it being almost bridgeless.
68
+
69
+ (⇐⇐\Leftarrow) Assume that a graph admits a contiguous oriented labeling. Add an edge between the vertices labeled 1−superscript11^{-} and m+superscript𝑚m^{+}. We claim that the resulting graph is bridgeless.Since the vertices 1−superscript11^{-} and m+superscript𝑚m^{+} are connected in the original graph, the new edge is part of a cycle. Now, consider any edge in the original graph; assume that the edge has label i𝑖i.The vertices 1−superscript11^{-} and i−superscript𝑖i^{-} are connected by a path that only goes through edges between 111 and i−1𝑖1i-1. Likewise, the vertices i+superscript𝑖i^{+} and m+superscript𝑚m^{+} are connected by a path that only goes through edges between i+1𝑖1i+1 and m𝑚m.Hence, the edge i𝑖i belongs to a cycle that goes through the two paths, the edge between m+superscript𝑚m^{+} and 1−superscript11^{-}, and itself.
70
+
71
+ (⇒⇒\Rightarrow) Assume that a graph is almost bridgeless. We will label all edges with labels 1,2,…,m12…𝑚1,2,\dots,m and orient each edge in one direction (the source of edge i𝑖i corresponds to the vertex i−superscript𝑖i^{-} and the sink to the vertex i+superscript𝑖i^{+}) so that the labeling is a contiguous oriented labeling.
72
+
73
+ Suppose that the graph becomes bridgeless if we add an edge u​v𝑢𝑣uv. Consider a path from u𝑢u to v𝑣v, and sort the edges and orient them along this path. We will iteratively construct ears until all edges are used.Each ear is a path starting at a vertex of a previous ear and ending at a vertex of a previous ear (possibly the same as the former vertex, in which case the path becomes a cycle) but not going through any other vertex of a previous ear; the only exception is the first ear, which is the path from u𝑢u to v𝑣v.Suppose that we have constructed some ears, and not all edges have been used. If there are edges that connect only vertices in the existing ears, we make each such edge into a new ear.If some edges still remain after this process, then since the graph is connected, there must be an edge x​y𝑥𝑦xy such that x𝑥x belongs to an existing ear but y𝑦y does not.By assumption, x​y𝑥𝑦xy is contained in a cycle if the edge u​v𝑢𝑣uv is added, so we can follow the edges in this cycle until we reach a vertex z𝑧z in an existing ear for the first time (possibly z=x𝑧𝑥z=x).Since we stop if we reach either u𝑢u or v𝑣v, edge u​v𝑢𝑣uv cannot be part of this trail, so we have a new ear. Assume without loss of generality that either x=u𝑥𝑢x=u, or the first edge directed into x𝑥x appears no later than the first edge directed into z𝑧z in the current edge order, or both. Orient the edges of the new ear along the trail from x𝑥x to z𝑧z.If x=u𝑥𝑢x=u, insert these edges consecutively at the beginning of the order. Else, insert them consecutively after the first edge directed into x𝑥x.After all edges have been added, label them from 111 to m𝑚m according to the final order. Observe that the edge with label 111 is always adjacent to u𝑢u, and the edge with label m𝑚m is always adjacent to v𝑣v.
74
+
75
+ We claim that the resulting oriented labeling is contiguous. First, we show that for each 1≤i≤m1𝑖𝑚1\leq i\leq m, the edges labeled 1,2,…,i12…𝑖1,2,\dots,i form a connected subgraph.We proceed by induction on i𝑖i, with the base case i=1𝑖1i=1 holding trivially. Assume that the edges 1,2,…,i−112…𝑖11,2,\dots,i-1 form a connected subgraph for some i≥2𝑖2i\geq 2.If edge i𝑖i is not the first edge in its ear, its predecessor in its ear has label at most i−1𝑖1i-1, so the induction hypothesis implies that the edges 1,2,…,i12…𝑖1,2,\dots,i form a connected subgraph.Moreover, in this case, vertex i−superscript𝑖i^{-} belongs to the predecessor edge with label at most i−1𝑖1i-1. Suppose now that edge i𝑖i is the first edge in its ear, and assume that the edge is directed from x𝑥x to y𝑦y.If x=u𝑥𝑢x=u, then since i≥2𝑖2i\geq 2, the edge with label 111 is an edge with a lower label that is adjacent to u𝑢u. Else, the first edge directed into x𝑥x has label at most i−1𝑖1i-1.In either case, the induction hypothesis implies that the edges 1,2,…,i12…𝑖1,2,\dots,i form a connected subgraph, and vertex i−=xsuperscript𝑖𝑥i^{-}=x is adjacent to a vertex with label at most i−1𝑖1i-1.This completes the induction and moreover shows that for each 2≤i≤m2𝑖𝑚2\leq i\leq m, vertex i−superscript𝑖i^{-} belongs to one of the edges 1,2,…,i−112…𝑖11,2,\dots,i-1.
76
+
77
+ Next, we show that for each 1≤i≤m1𝑖𝑚1\leq i\leq m, the edges labeled i,i+1,…,m𝑖𝑖1…𝑚i,i+1,\dots,m form a connected subgraph.We proceed by downward induction on i𝑖i, with the base case i=m𝑖𝑚i=m holding trivially. Assume that the edges i+1,i+2,…,m𝑖1𝑖2…𝑚i+1,i+2,\dots,m form a connected subgraph for some i<m𝑖𝑚i<m.If edge i𝑖i is not the last edge in its ear, its successor in its ear has label at least i+1𝑖1i+1, so the induction hypothesis implies that the edges i,i+1,…,m𝑖𝑖1…𝑚i,i+1,\dots,m form a connected subgraph.Moreover, in this case, vertex i+superscript𝑖i^{+} belongs to the successor edge with label at least i+1𝑖1i+1. Suppose now that edge i𝑖i is the last edge in its ear, and assume that the edge is directed from y𝑦y to z𝑧z.If z=v𝑧𝑣z=v, then since i<m𝑖𝑚i<m, the edge with label m𝑚m is an edge with a higher label that is adjacent to v𝑣v. Suppose that z≠v𝑧𝑣z\neq v, which also implies that i𝑖i does not belong to the first ear.Consider the moment when we insert the ear that contains i𝑖i, and assume that this ear begins at vertex x𝑥x.If x=u𝑥𝑢x=u, then the edges of this ear are placed at the beginning of the order; since z𝑧z appears in a previous ear, there is an edge adjacent to it that comes after edge y​z𝑦𝑧yz in the order.Suppose therefore that x≠u𝑥𝑢x\neq u, so that at the moment before we insert the ear containing i𝑖i, the first edge into x𝑥x appears no later than the first edge directed into z𝑧z in the order. We place the edges of the new ear after the first edge into x𝑥x.If x≠z𝑥𝑧x\neq z, there is an edge adjacent to z𝑧z that comes after this ear in the order. Else, x=z𝑥𝑧x=z, and this vertex is different from u𝑢u and v𝑣v.Consider the earliest ear that contains z𝑧z, and note that in this ear, there is an edge into z𝑧z and another edge out of z𝑧z; let i1subscript𝑖1i_{1} and i2subscript𝑖2i_{2} be the label of the two edges respectively.The first edge into z𝑧z appears no later than i1subscript𝑖1i_{1}, so the ear containing i𝑖i appears before i2subscript𝑖2i_{2} in the ordering. Hence, there is an edge with label at least i+1𝑖1i+1 adjacent to z𝑧z. This completes the induction.It also follows from our argument that for each 1≤i≤m−11𝑖𝑚11\leq i\leq m-1, the vertex i+superscript𝑖i^{+} belongs to one of the edges i+1,i+2,…,m𝑖1𝑖2…𝑚i+1,i+2,\dots,m. Combined with the previous paragraph, we find that our oriented labeling is contiguous, as claimed.∎
78
+
79
+ Given a graph G𝐺G with k𝑘k vertices, a bipolar numbering of G𝐺G is a labeling of the vertices with numbers 1,2,…,k12…𝑘1,2,\dots,k, with each number used exactly once, such that every vertex with label greater than 111 has a neighbor with a smaller label and each vertex with label smaller than k𝑘k has a neighbor with a larger label.Bilò et al. (Bilò et al., 2019) characterized the class of graphs that admit a bipolar numbering as the graphs with the property that if the vertices of the graph represent indivisible items of possibly different values to the two agents, there always exists a connected ‘envy-free up to one item’ allocation.We show that the class of graphs that admit a bipolar numbering forms a strict subclass of the almost bridgeless graphs (which, by Lemma 4.3, is equivalent to the class of graphs that admit a contiguous oriented labeling).
80
+
81
+ Assume that a graph admits a bipolar numbering with the vertices labeled 1,2,…,k12…𝑘1,2,\dots,k.This means that for any vertex i𝑖i, there exists a path from 111 to i𝑖i that only goes through vertices 1,2,…,i12…𝑖1,2,\dots,i, and a path from i𝑖i to k𝑘k that only goes through vertices i,i+1,…,k𝑖𝑖1…𝑘i,i+1,\dots,k.Add an edge between vertices 111 and k𝑘k. We will show that the resulting graph is bridgeless, i.e., every edge is contained in a cycle. This is clear for the new edge.For any edge in the original graph between vertices i𝑖i and j𝑗j with i<j𝑖𝑗i<j, we can construct a cycle containing it by following a path from j𝑗j to k𝑘k that only uses vertices j,j+1,…,k𝑗𝑗1…𝑘j,j+1,\dots,k, traversing the added edge from k𝑘k to 111, and following a path from 111 to i𝑖i that only uses vertices 1,2,…,i12…𝑖1,2,\dots,i.
82
+
83
+ To show that the converse does not hold, consider the graphs shown in Figure 1.Since every edge in both graphs is contained in a cycle, both graphs are bridgeless and therefore almost bridgeless. On the other hand, one can check that neither graph admits a bipolar numbering.∎
84
+
85
+ We are now ready to show our classification result: the optimal egalitarian welfare that can always be obtained for a graph is 1/2121/2 if the graph is almost bridgeless, and 1/3131/3 otherwise. The former is shown in Theorem 4.5, while the latter follows from Theorems 3.1 and 4.7.
86
+
87
+ Suppose that G𝐺G is almost bridgeless. By Lemma 4.3, it admits a contiguous oriented labeling.We move a knife over the edges of G𝐺G in increasing order of the label. For each edge with label i𝑖i, the knife goes from vertex i−superscript𝑖i^{-} to vertex i+superscript𝑖i^{+}.If the knife is currently on edge i𝑖i, we stop when the piece of cake containing edges 1,2,…,i−112…𝑖11,2,\dots,i-1, together with the interval of edge i𝑖i between i−superscript𝑖i^{-} and the current position of the knife, yields value exactly 1/2121/2 to one of the agents.We allocate this piece of cake to the agent who receives value 1/2121/2, and the remainder of the cake to the other agent.Both agents receive value at least 1/2121/2 and, by definition of the labeling, obtain a connected allocation of the cake.∎
88
+
89
+ Assume that no path contains all bridges in F𝐹F. Since bridges are not contained in cycles, there is a spanning tree T𝑇T that contains F𝐹F. Let T′superscript𝑇′T^{\prime} be a minimal subtree of T𝑇T that contains F𝐹F.Since T′superscript𝑇′T^{\prime} cannot be a path, it has a vertex v𝑣v with degree at least 333. Each of the (at least three) branches of v𝑣v must contain a bridge from F𝐹F—otherwise the branch can be removed to obtain a smaller subtree than T′superscript𝑇′T^{\prime}.
90
+
91
+ Let e1,e2,e3subscript𝑒1subscript𝑒2subscript𝑒3e_{1},e_{2},e_{3} be bridges contained in three distinct branches. Suppose for contradiction that they are contained in a path.By reversing the direction of the path if necessary, we may assume that the path traverses at least two of the edges away from v𝑣v with respect to T′superscript𝑇′T^{\prime}.Assume further that two of these edges are e1subscript𝑒1e_{1} and e2subscript𝑒2e_{2}, and that the path traverses e1subscript𝑒1e_{1} before e2subscript𝑒2e_{2}.After traversing e1subscript𝑒1e_{1}, the path must reach another vertex w𝑤w in T′superscript𝑇′T^{\prime} that lies on the same side as v𝑣v with respect to both e1subscript𝑒1e_{1} and e2subscript𝑒2e_{2} (possibly the endpoint of e1subscript𝑒1e_{1} or e2subscript𝑒2e_{2} closer to v𝑣v).By combining the portion of the path from e1subscript𝑒1e_{1} to w𝑤w with the path in T′superscript𝑇′T^{\prime} from w𝑤w to e1subscript𝑒1e_{1}, we find that e1subscript𝑒1e_{1} lies on a cycle, a contradiction.∎
92
+
93
+ Suppose that G𝐺G is not almost bridgeless. Then no path can contain all bridges of G𝐺G: if there exists such a path, we can eliminate all bridges by adding an edge that connects the endpoints of this path.By Lemma 4.6, there exist three bridges of G𝐺G such that no path contains all three bridges.For each of the three bridges, the other two bridges must lie on the same side of it, since otherwise we can construct a path that contains all three bridges.
94
+
95
+ Assume that both agents value each of the three bridges exactly 1/3131/3 (and every other edge 00), and the value is distributed uniformly within each bridge.Suppose for contradiction that there exists a connected allocation with egalitarian welfare strictly greater than 1/3131/3.This means that each agent must receive intervals from at least two bridges. However, when an agent receives intervals from two bridges, each interval must contain the endpoint of the bridge that is on the same side as the other two bridges.This is impossible since there are only three bridges, yielding the desired contradiction.∎
96
+
97
+ In this subsection, we establish the frontiers of the utilities that we can guarantee to the two agents regardless of the graph, assuming that the agents may have different entitlements.We begin by observing that the cut-and-choose protocol allows us to find an allocation that gives utility 1/2121/2 to the first agent and 1/3131/3 to the second agent; this generalizes the case n=2𝑛2n=2 of Theorem 3.1.
98
+
99
+ By Theorem 3.1, there exists a partition of the cake into two connected pieces such that the second agent values both pieces at least 1/3131/3.The first agent can then simply choose the piece that she prefers and obtain value at least 1/2121/2.∎
100
+
101
+ The next proposition follows from Theorem 3.1.
102
+
103
+ To complete the utility frontier, we show that if we are required to give a utility of more than 1/2121/2 to the first agent, it may be impossible to provide any nontrivial guarantee for the second agent.
104
+
105
+ Fix α>1/2𝛼12\alpha>1/2 and β>0𝛽0\beta>0, and assume that G𝐺G consists of a single edge represented by the interval [0,1]01[0,1]. Suppose that the first agent values the entire interval [0,1]01[0,1] uniformly, while the second agent values the interval [1−α,α]1𝛼𝛼[1-\alpha,\alpha] uniformly and nothing else.In any connected allocation that yields value at least α𝛼\alpha to the first agent, this agent must receive the entire interval [1−α,α]1𝛼𝛼[1-\alpha,\alpha]. However, that means the second agent receives value 00 from the allocation.∎
106
+
107
+ Combining Theorem 4.8 with Propositions 4.9 and 4.10, we find that the values of (α,β)𝛼𝛽(\alpha,\beta) for which a connected allocation that yields utility α𝛼\alpha to the first agent and β𝛽\beta to the second agent always exists are as shown in Figure 2.
108
+
109
+ While Figure 1 completely captures the shares that can be guaranteed to the two agents, if we do not fix the entitlements of the agents in advance, it is possible to achieve better guarantees.As an example, consider the case where the graph G𝐺G consists of a single edge. In this case, Proposition 4.10 shows that any entitlements (α,β)𝛼𝛽(\alpha,\beta) with α>1/2𝛼12\alpha>1/2 and β>0𝛽0\beta>0 cannot be achieved.On the other hand, for any α∈[0,1]𝛼01\alpha\in[0,1], it is possible to give one agent a value of at least α𝛼\alpha and the other agent a value of at least 1−α1𝛼1-\alpha (while not fixing which agent receives which share).Indeed, if we run a moving knife on the single edge and stop when the part already covered by the knife yields value α𝛼\alpha to some agent, the two pieces can be allocated to yield the desired guarantee.In what follows, we determine all shares (α,β)𝛼𝛽(\alpha,\beta) for which there always exists a connected allocation that yields value α𝛼\alpha to one agent and β𝛽\beta to the other agent regardless of the graph.Note that Theorem 4.8 carries over, and so does Proposition 4.9 since it holds for agents with identical valuations.We fill in the utility frontier, starting with the negative results.
110
+
111
+ Let G𝐺G be a star with four edges such that every agent values each edge exactly 1/4141/4, and the value is distributed uniformly within the edge.Assume for contradiction that there is a connected allocation that yields value at least α𝛼\alpha to one agent and at least β𝛽\beta to the other agent; since the agents have identical valuations, we may assume without loss of generality that these are agents 1 and 2 respectively.Agent 1 must receive intervals from at least three edges, and these intervals must be connected via the center vertex. Note that the unallocated parts of these edges cannot be allocated to agent 2, since agent 2 would receive value less than 1/4141/4.Similarly, agent 2 must receive intervals from at least two edges, and these intervals, which again must be connected via the center vertex, cannot be allocated to agent 1.However, this means that there must be at least five edges in total, a contradiction.∎
112
+
113
+ Choose ϵ>0italic-ϵ0\epsilon>0 such that β>1−2​α+2​ϵ𝛽12𝛼2italic-ϵ\beta>1-2\alpha+2\epsilon.Let G𝐺G be the graph shown in Figure 3, where the value of each agent for each edge is as shown in the figure and distributed uniformly across the edge.Assume for contradiction that there is a connected allocation that yields value at least α𝛼\alpha to one agent and at least β𝛽\beta to the other agent; since the agents have identical valuations, we may assume without loss of generality that these are agents 1 and 2 respectively.Agent 2 must receive part of the middle edge; otherwise she has value at most 2​(α−ϵ)<1/2<β2𝛼italic-ϵ12𝛽2(\alpha-\epsilon)<1/2<\beta.Moreover, she must receive part of some left edge and part of some right edge; otherwise she has value at most 2​(α−ϵ)+(1−4​α+4​ϵ)=1−2​α+2​ϵ<β2𝛼italic-ϵ14𝛼4italic-ϵ12𝛼2italic-ϵ𝛽2(\alpha-\epsilon)+(1-4\alpha+4\epsilon)=1-2\alpha+2\epsilon<\beta. Hence, the agent must receive the entire middle edge.This means that agent 1 can receive intervals from only one non-middle edge. Her value is therefore at most α−ϵ𝛼italic-ϵ\alpha-\epsilon, a contradiction.∎
114
+
115
+ We now move on to the positive result, which shows the additional guarantee that we can obtain if we give up control over which agent receives which entitlement.
116
+
117
+ This follows immediately from Lemma 3.2 by taking H𝐻H to be the entire graph G𝐺G.∎
118
+
119
+ Combining Theorem 4.13 with Propositions 4.11 and 4.12, we find that the values of (α,β)𝛼𝛽(\alpha,\beta) for which a connected allocation that yields utility α𝛼\alpha to one agent and β𝛽\beta to the other agent always exists are as shown in Figure 4.
120
+
121
+ As we mentioned in the introduction, one important motivation for considering connected allocations is to avoid situations where an agent receives a “union of crumbs”.In light of this motivation, it is interesting to explore whether we can obtain improved guarantees if we allow the agents to receive a small number of connected pieces.We demonstrate in this subsection that such improvements are indeed possible by presenting a tight bound of 12−12⋅3k121⋅2superscript3𝑘\frac{1}{2}-\frac{1}{2\cdot 3^{k}} on the egalitarian welfare that can be guaranteed when a total of k+1𝑘1k+1 connected pieces are permitted.We first establish the lower bound.
122
+
123
+ Let G𝐺G be an arbitrary graph.It suffices to show that there exists a partition of G𝐺G into two parts with at most k+1𝑘1k+1 connected pieces in total such that both parts yield value at least 12−12⋅3k121⋅2superscript3𝑘\frac{1}{2}-\frac{1}{2\cdot 3^{k}} to the first agent.Indeed, given such a partition, we can let the second agent choose the part that she prefers and obtain value at least 1/2121/2.We therefore consider only the first agent from now on.
124
+
125
+ We proceed by induction on k𝑘k; the base case k=1𝑘1k=1 follows from Theorem 4.8.Suppose that the statement holds for k−1𝑘1k-1, i.e., there exists a partition of G𝐺G into two parts with at most k𝑘k connected pieces in total such that both parts yield value at least 12−12⋅3k−1121⋅2superscript3𝑘1\frac{1}{2}-\frac{1}{2\cdot 3^{k-1}} to the agent.Assume without loss of generality that the second part has value at least 1/2121/2, so the first part has value 12−x12𝑥\frac{1}{2}-x for some 0≤x≤12⋅3k−10𝑥1⋅2superscript3𝑘10\leq x\leq\frac{1}{2\cdot 3^{k-1}}.Since the second part consists of at most k−1𝑘1k-1 connected pieces, it contains a connected piece of value at least 12​k−212𝑘2\frac{1}{2k-2}.Denote this piece by H𝐻H.
126
+
127
+ Since 2​k−2≤3k2𝑘2superscript3𝑘2k-2\leq 3^{k}, we have 2​x3≤13k≤12​k−22𝑥31superscript3𝑘12𝑘2\frac{2x}{3}\leq\frac{1}{3^{k}}\leq\frac{1}{2k-2}.By creating a duplicate of our agent and applying Lemma 3.2, we can partition H𝐻H into two connected pieces in such a way that our agent has value in the range [2​x3,4​x3]2𝑥34𝑥3[\frac{2x}{3},\frac{4x}{3}] for the first piece.Move this piece from the second part of our partition of G𝐺G to the first part.The resulting partition of G𝐺G consists of at most k+1𝑘1k+1 connected pieces in total, and the first part of this partition has value in the range [12−x3,12+x3]12𝑥312𝑥3[\frac{1}{2}-\frac{x}{3},\frac{1}{2}+\frac{x}{3}].This implies that both parts of the partition yield value at least 12−x3≥12−12⋅3k12𝑥3121⋅2superscript3𝑘\frac{1}{2}-\frac{x}{3}\geq\frac{1}{2}-\frac{1}{2\cdot 3^{k}}, completing the induction.∎
128
+
129
+ Next, we show that the bound established in Theorem 4.14 is tight for every k𝑘k.First we need the following technical lemma.
130
+
131
+ We proceed by strong induction on t𝑡t. The base case t=1���1t=1 follows from the observation that the terms of the form ε⋅3a⋅𝜀superscript3𝑎\varepsilon\cdot 3^{a} closest to 1/2121/2 are 1/3131/3 and 2/3232/3, and |1/3−1/2|=|2/3−1/2|=1/61312231216|1/3-1/2|=|2/3-1/2|=1/6.Suppose that the statement holds up to t−1𝑡1t-1, and assume without loss of generality that a1≥a2≥⋯≥atsubscript𝑎1subscript𝑎2⋯subscript𝑎𝑡a_{1}\geq a_{2}\geq\dots\geq a_{t}.We process the sum ε1⋅3a1+ε2⋅3a2+⋯+εt⋅3at⋅subscript𝜀1superscript3subscript𝑎1⋅subscript𝜀2superscript3subscript𝑎2⋯⋅subscript𝜀𝑡superscript3subscript𝑎𝑡\varepsilon_{1}\cdot 3^{a_{1}}+\varepsilon_{2}\cdot 3^{a_{2}}+\dots+\varepsilon_{t}\cdot 3^{a_{t}} from right to left.Consider the moment when we process terms involving 3asuperscript3𝑎3^{a}.If there are two terms involving 3asuperscript3𝑎3^{a} with coefficients of opposite signs, we either cancel them or combine them into one term.So we may assume that all terms with 3asuperscript3𝑎3^{a} have the same sign, say positive.If there are two terms 1⋅3a⋅1superscript3𝑎1\cdot 3^{a}, we combine them into 2⋅3a⋅2superscript3𝑎2\cdot 3^{a}; if there is a term 1⋅3a⋅1superscript3𝑎1\cdot 3^{a} and 2⋅3a⋅2superscript3𝑎2\cdot 3^{a}, we combine them into 1⋅3a+1⋅1superscript3𝑎11\cdot 3^{a+1}; and if there are two terms 2⋅3a⋅2superscript3𝑎2\cdot 3^{a}, we replace them with 1⋅3a⋅1superscript3𝑎1\cdot 3^{a} and 1⋅3a+1⋅1superscript3𝑎11\cdot 3^{a+1}.Our operations do not increase the number of terms, so our procedure terminates with at most one term involving each power of 333.
132
+
133
+ If the number of terms ε⋅3a⋅𝜀superscript3𝑎\varepsilon\cdot 3^{a} is now less than t𝑡t, we may apply the induction hypothesis and obtain our desired conclusion.Assume therefore that the number of terms is still t𝑡t, and a1>a2>⋯>atsubscript𝑎1subscript𝑎2⋯subscript𝑎𝑡a_{1}>a_{2}>\dots>a_{t}.We have|∑i=2tεi⋅3ai|≤∑i=2t|εi⋅3ai|≤2⋅∑i=2t3ai<2⋅∑i=2∞3ai=3a2+1≤3a1.superscriptsubscript𝑖2𝑡⋅subscript𝜀𝑖superscript3subscript𝑎𝑖superscriptsubscript𝑖2𝑡⋅subscript𝜀𝑖superscript3subscript𝑎𝑖⋅2superscriptsubscript𝑖2𝑡superscript3subscript𝑎𝑖⋅2superscriptsubscript𝑖2superscript3subscript𝑎𝑖superscript3subscript𝑎21superscript3subscript𝑎1\left|\sum_{i=2}^{t}\varepsilon_{i}\cdot 3^{a_{i}}\right|\leq\sum_{i=2}^{t}\left|\varepsilon_{i}\cdot 3^{a_{i}}\right|\leq 2\cdot\sum_{i=2}^{t}3^{a_{i}}<2\cdot\sum_{i=2}^{\infty}3^{a_{i}}=3^{a_{2}+1}\leq 3^{a_{1}}.If ε1subscript𝜀1\varepsilon_{1} is negative, we have ∑i=1tεi⋅3ai<−3a1+3a1=0superscriptsubscript𝑖1𝑡⋅subscript𝜀𝑖superscript3subscript𝑎𝑖superscript3subscript𝑎1superscript3subscript𝑎10\sum_{i=1}^{t}\varepsilon_{i}\cdot 3^{a_{i}}<-3^{a_{1}}+3^{a_{1}}=0, so the desired statement holds. Assume now that ε1subscript𝜀1\varepsilon_{1} is positive.If a1≤−2subscript𝑎12a_{1}\leq-2, we have ∑i=1tεi⋅3ai≤2⋅3a1+3a1=3a1+1≤1/3superscriptsubscript𝑖1𝑡⋅subscript𝜀𝑖superscript3subscript𝑎𝑖⋅2superscript3subscript𝑎1superscript3subscript𝑎1superscript3subscript𝑎1113\sum_{i=1}^{t}\varepsilon_{i}\cdot 3^{a_{i}}\leq 2\cdot 3^{a_{1}}+3^{a_{1}}=3^{a_{1}+1}\leq 1/3, so the desired statement holds in this case.
134
+
135
+ Suppose that a1=−1subscript𝑎11a_{1}=-1. If ε1=1subscript𝜀11\varepsilon_{1}=1, we have|∑i=1tεi⋅3ai−12|=|∑i=2tεi⋅3ai−16|=13​|∑i=2tεi⋅3ai+1−12|≥13⋅12⋅3t−1=12⋅3t,superscriptsubscript𝑖1𝑡⋅subscript𝜀𝑖superscript3subscript𝑎𝑖12superscriptsubscript𝑖2𝑡⋅subscript𝜀𝑖superscript3subscript𝑎𝑖1613superscriptsubscript𝑖2𝑡⋅subscript𝜀𝑖superscript3subscript𝑎𝑖112⋅131⋅2superscript3𝑡11⋅2superscript3𝑡\left|\sum_{i=1}^{t}\varepsilon_{i}\cdot 3^{a_{i}}-\frac{1}{2}\right|=\left|\sum_{i=2}^{t}\varepsilon_{i}\cdot 3^{a_{i}}-\frac{1}{6}\right|=\frac{1}{3}\left|\sum_{i=2}^{t}\varepsilon_{i}\cdot 3^{a_{i}+1}-\frac{1}{2}\right|\geq\frac{1}{3}\cdot\frac{1}{2\cdot 3^{t-1}}=\frac{1}{2\cdot 3^{t}},where the inequality follows from the inductive hypothesis.Similarly, if ε1=2subscript𝜀12\varepsilon_{1}=2, we have|∑i=1tεi⋅3ai−12|=|∑i=2tεi⋅3ai+16|=13​|∑i=2t(−εi)⋅3ai+1−12|≥13⋅12⋅3t−1=12⋅3t.superscriptsubscript𝑖1𝑡⋅subscript𝜀𝑖superscript3subscript𝑎𝑖12superscriptsubscript𝑖2𝑡⋅subscript𝜀𝑖superscript3subscript𝑎𝑖1613superscriptsubscript𝑖2𝑡⋅subscript𝜀𝑖superscript3subscript𝑎𝑖112⋅131⋅2superscript3𝑡11⋅2superscript3𝑡\left|\sum_{i=1}^{t}\varepsilon_{i}\cdot 3^{a_{i}}-\frac{1}{2}\right|=\left|\sum_{i=2}^{t}\varepsilon_{i}\cdot 3^{a_{i}}+\frac{1}{6}\right|=\frac{1}{3}\left|\sum_{i=2}^{t}(-\varepsilon_{i})\cdot 3^{a_{i}+1}-\frac{1}{2}\right|\geq\frac{1}{3}\cdot\frac{1}{2\cdot 3^{t-1}}=\frac{1}{2\cdot 3^{t}}.
136
+
137
+ Suppose now that a1=0subscript𝑎10a_{1}=0.If ε1=1subscript𝜀11\varepsilon_{1}=1, we have|∑i=1tεi⋅3ai−12|=|∑i=2tεi⋅3ai+12|=|∑i=2t(−εi)⋅3ai−12|≥12⋅3t−1>12⋅3t,superscriptsubscript𝑖1𝑡⋅subscript𝜀𝑖superscript3subscript𝑎𝑖12superscriptsubscript𝑖2𝑡⋅subscript𝜀𝑖superscript3subscript𝑎𝑖12superscriptsubscript𝑖2𝑡⋅subscript𝜀𝑖superscript3subscript𝑎𝑖121⋅2superscript3𝑡11⋅2superscript3𝑡\left|\sum_{i=1}^{t}\varepsilon_{i}\cdot 3^{a_{i}}-\frac{1}{2}\right|=\left|\sum_{i=2}^{t}\varepsilon_{i}\cdot 3^{a_{i}}+\frac{1}{2}\right|=\left|\sum_{i=2}^{t}(-\varepsilon_{i})\cdot 3^{a_{i}}-\frac{1}{2}\right|\geq\frac{1}{2\cdot 3^{t-1}}>\frac{1}{2\cdot 3^{t}},where the first inequality follows from the inductive hypothesis.If ε1=2subscript𝜀12\varepsilon_{1}=2, we have∑i=1tεi⋅3ai≥2−23−29−⋯=1superscriptsubscript𝑖1𝑡⋅subscript𝜀𝑖superscript3subscript𝑎𝑖22329⋯1\sum_{i=1}^{t}\varepsilon_{i}\cdot 3^{a_{i}}\geq 2-\frac{2}{3}-\frac{2}{9}-\dots=1, so the desired statement holds.
138
+
139
+ Finally, suppose that a1≥1subscript𝑎11a_{1}\geq 1.If ε1=2subscript𝜀12\varepsilon_{1}=2,we have∑i=1tεi⋅3ai≥3ai​(2−23−29−…)≥3superscriptsubscript𝑖1𝑡⋅subscript𝜀𝑖superscript3subscript𝑎𝑖superscript3subscript𝑎𝑖22329…3\sum_{i=1}^{t}\varepsilon_{i}\cdot 3^{a_{i}}\geq 3^{a_{i}}\left(2-\frac{2}{3}-\frac{2}{9}-\dots\right)\geq 3, so the desired statement holds.Assume now that ε1=1subscript𝜀11\varepsilon_{1}=1. If a2=a1−1subscript𝑎2subscript𝑎11a_{2}=a_{1}-1 and ε2subscript𝜀2\varepsilon_{2} is negative, we may combine the terms 1⋅3a1⋅1superscript3subscript𝑎11\cdot 3^{a_{1}} and ε2⋅3a2⋅subscript𝜀2superscript3subscript𝑎2\varepsilon_{2}\cdot 3^{a_{2}} into (3+ε2)⋅3a2⋅3subscript𝜀2superscript3subscript𝑎2(3+\varepsilon_{2})\cdot 3^{a_{2}} and apply the induction hypothesis.So we may assume that either a2≤a1−2subscript𝑎2subscript𝑎12a_{2}\leq a_{1}-2 or ε2subscript𝜀2\varepsilon_{2} is positive.In either case, we have∑i=1tεi⋅3ai≥3a1​(1−29−227−…)=3a1⋅23≥2superscriptsubscript𝑖1𝑡⋅subscript𝜀𝑖superscript3subscript𝑎𝑖superscript3subscript𝑎1129227…⋅superscript3subscript𝑎1232\sum_{i=1}^{t}\varepsilon_{i}\cdot 3^{a_{i}}\geq 3^{a_{1}}\left(1-\frac{2}{9}-\frac{2}{27}-\dots\right)=3^{a_{1}}\cdot\frac{2}{3}\geq 2, so the desired statement again holds.∎
140
+
141
+ Let G𝐺G be a rooted tree with k+2𝑘2k+2 layers, where the first layer consists only of the root of the tree.The root has one child, and every vertex in subsequent layers up to the (k+1)𝑘1(k+1)st layer has three children. In particular, the (k+2)𝑘2(k+2)nd layer consists of 3ksuperscript3𝑘3^{k} leaves.The tree G𝐺G for the case k=2𝑘2k=2 is shown in Figure 5.Suppose that both agents value each edge adjacent to a leaf exactly 1/3k1superscript3𝑘1/3^{k} with the value distributed uniformly within the edge, and do not value any other edge.
142
+
143
+ Consider an arbitrary allocation in which the two agents receive a total of at most k+1𝑘1k+1 connected pieces.We will show that the egalitarian welfare is at most 12−12⋅3k121⋅2superscript3𝑘\frac{1}{2}-\frac{1}{2\cdot 3^{k}}.If there are unallocated parts of the cake, we arbitrarily allocate these parts so that the number of connected pieces that each agent receives does not increase; this does not lower the egalitarian welfare of the allocation.Hence we may assume that the entire cake is allocated (i.e., the allocation is complete). Denote by X1,…,Xpsubscript𝑋1…subscript𝑋𝑝X_{1},\dots,X_{p} the connected pieces that agent 1 receives, and Y1,…,Yqsubscript𝑌1…subscript𝑌𝑞Y_{1},\dots,Y_{q} the connected pieces that agent 2 receives, where p+q≤k+1𝑝𝑞𝑘1p+q\leq k+1.We assume that each edge has length 111, and refer to the distance along the (unique) path between two points in G𝐺G simply as the distance between these two points. Note that every connected piece has a unique point closest to the root: if there are two such points, they must be connected via a point that is strictly closer to the root than both of them.For every connected piece Z𝑍Z, denote by wzsubscript𝑤𝑧w_{z} the unique point in Z𝑍Z closest to the root and u​(Z)𝑢𝑍u(Z) the utility of the piece Z𝑍Z. We will define a connected piece Z∗superscript𝑍Z^{*} as follows:•If wzsubscript𝑤𝑧w_{z} is not a vertex of G𝐺G, let Z∗superscript𝑍Z^{*} be the set of points w𝑤w such that the path from w𝑤w to the root goes through wzsubscript𝑤𝑧w_{z}. In other words, Z∗superscript𝑍Z^{*} is the part of the tree “below” wzsubscript𝑤𝑧w_{z}.•If wzsubscript𝑤𝑧w_{z} is a vertex of G𝐺G, let Z∗superscript𝑍Z^{*} be the set of points w𝑤w such that the intersection of Z𝑍Z and the path from w𝑤w to the root has nonzero measure. Equivalently, Z∗superscript𝑍Z^{*} consists of the edges adjacent to wzsubscript𝑤𝑧w_{z} that have a nontrivial overlap with Z𝑍Z, along with everything “below” these edges.
144
+
145
+ Assume without loss of generality that agent 1 receives a piece containing the root of the tree. We claim that u​(X1)+⋯+u​(Xp)=[u​(X1∗)+⋯+u​(Xp∗)]−[u​(Y1∗)+⋯+u​(Yq∗)]𝑢subscript𝑋1⋯𝑢subscript𝑋𝑝delimited-[]𝑢superscriptsubscript𝑋1⋯𝑢superscriptsubscript𝑋𝑝delimited-[]𝑢superscriptsubscript𝑌1⋯𝑢superscriptsubscript𝑌𝑞u(X_{1})+\dots+u(X_{p})=[u(X_{1}^{*})+\dots+u(X_{p}^{*})]-[u(Y_{1}^{*})+\dots+u(Y_{q}^{*})].First, note that for each Z∗superscript𝑍Z^{*} where Z∈{X1,…,Xp,Y1,…,Yq}𝑍subscript𝑋1…subscript𝑋𝑝subscript𝑌1…subscript𝑌𝑞Z\in\{X_{1},\dots,X_{p},Y_{1},\dots,Y_{q}\}, every connected piece Xisubscript𝑋𝑖X_{i} and Yisubscript𝑌𝑖Y_{i} is either contained in Z∗superscript𝑍Z^{*} in its entirety or not at all. Hence u​(Z∗)𝑢superscript𝑍u(Z^{*}) can be written as a sum of distinct u​(Xi)𝑢subscript𝑋𝑖u(X_{i})’s and u​(Yi)𝑢subscript𝑌𝑖u(Y_{i})’s.Moreover, one can verify from the definition that a connected piece Z𝑍Z is contained in W∗superscript𝑊W^{*} if and only if Z=W𝑍𝑊Z=W or the path from wzsubscript𝑤𝑧w_{z} to the root has a nontrivial overlap with W𝑊W.This path alternates between pieces Xisubscript𝑋𝑖X_{i} and Yisubscript𝑌𝑖Y_{i} and ends with a piece Xisubscript𝑋𝑖X_{i}. Therefore, each u​(Xi)𝑢subscript𝑋𝑖u(X_{i}) is contained in u​(X1∗)+⋯+u​(Xp∗)𝑢superscriptsubscript𝑋1⋯𝑢superscriptsubscript𝑋𝑝u(X_{1}^{*})+\dots+u(X_{p}^{*}) exactly once more than in u​(Y1∗)+⋯+u​(Yq∗)𝑢superscriptsubscript𝑌1⋯𝑢superscriptsubscript𝑌𝑞u(Y_{1}^{*})+\dots+u(Y_{q}^{*}), while each u​(Yi)𝑢subscript𝑌𝑖u(Y_{i}) is contained in the two sums an equal number of times. This yields the claimed equality.
146
+
147
+ Next, observe that each u​(Z∗)𝑢superscript𝑍u(Z^{*}) can be written as 3s/3ksuperscript3𝑠superscript3𝑘3^{s}/3^{k} for some nonnegative integer s≤k𝑠𝑘s\leq k, or 2⋅3s/3k⋅2superscript3𝑠superscript3𝑘2\cdot 3^{s}/3^{k} for some nonnegative integer s≤k−1𝑠𝑘1s\leq k-1, or δ/3k𝛿superscript3𝑘\delta/3^{k} for some δ∈[0,1]𝛿01\delta\in[0,1].Note also that since agent 111 receives a piece containing the root of the tree, for this piece Xisubscript𝑋𝑖X_{i} we have u​(Xi∗)=1𝑢superscriptsubscript𝑋𝑖1u(X_{i}^{*})=1.It follows that [u​(X1∗)+⋯+u​(Xp∗)]−[u​(Y1∗)+⋯+u​(Yq∗)]delimited-[]𝑢superscriptsubscript𝑋1⋯𝑢superscriptsubscript𝑋𝑝delimited-[]𝑢superscriptsubscript𝑌1⋯𝑢superscriptsubscript𝑌𝑞[u(X_{1}^{*})+\dots+u(X_{p}^{*})]-[u(Y_{1}^{*})+\dots+u(Y_{q}^{*})] can be written as 1−(S+Δ)1𝑆Δ1-(S+\Delta), where S𝑆S is a sum of a number of terms (say, r𝑟r terms, where r≤k𝑟𝑘r\leq k) of the form ε⋅3a⋅𝜀superscript3𝑎\varepsilon\cdot 3^{a} with ε∈{±1,±2}𝜀plus-or-minus1plus-or-minus2\varepsilon\in\{\pm 1,\pm 2\} and a𝑎a an integer, and |Δ|≤(k−r)/3kΔ𝑘𝑟superscript3𝑘|\Delta|\leq(k-r)/3^{k}.Hence, letting d:=|u​(X1)+⋯+u​(Xp)−12|assign𝑑𝑢subscript𝑋1⋯𝑢subscript𝑋𝑝12d:=\left|u(X_{1})+\dots+u(X_{p})-\frac{1}{2}\right|, we haved𝑑\displaystyle d=|([u​(X1∗)+⋯+u​(Xp∗)]−[u​(Y1∗)+⋯+u​(Yq∗)])−12|absentdelimited-[]𝑢superscriptsubscript𝑋1⋯𝑢superscriptsubscript𝑋𝑝delimited-[]𝑢superscriptsubscript𝑌1⋯𝑢superscriptsubscript𝑌𝑞12\displaystyle=\left|\left([u(X_{1}^{*})+\dots+u(X_{p}^{*})]-[u(Y_{1}^{*})+\dots+u(Y_{q}^{*})]\right)-\frac{1}{2}\right|=|(S+Δ)−12|≥|S−12|−|Δ|absent𝑆Δ12𝑆12Δ\displaystyle=\left|(S+\Delta)-\frac{1}{2}\right|\geq\left|S-\frac{1}{2}\right|-|\Delta|≥12⋅3r−k−r3k=3k−r−2​(k−r)2⋅3k≥12⋅3k,absent1⋅2superscript3𝑟𝑘𝑟superscript3𝑘superscript3𝑘𝑟2𝑘𝑟⋅2superscript3𝑘1⋅2superscript3𝑘\displaystyle\geq\frac{1}{2\cdot 3^{r}}-\frac{k-r}{3^{k}}=\frac{3^{k-r}-2(k-r)}{2\cdot 3^{k}}\geq\frac{1}{2\cdot 3^{k}},where the first inequality follows from the triangle inequality, the second inequality follows from Lemma 4.15, and the last inequality holds since 3b≥2​b+1superscript3𝑏2𝑏13^{b}\geq 2b+1 for any integer b≥0𝑏0b\geq 0.This implies that the egalitarian welfare is at most 12−12⋅3k121⋅2superscript3𝑘\frac{1}{2}-\frac{1}{2\cdot 3^{k}}, as claimed.∎
148
+
149
+ Recall that the height of a rooted tree is the length of the longest path from the root to a leaf vertex. For example, a star rooted at the center vertex has height 111. Our next theorem shows that for graphs that can be represented as a tree of height at most 222, we can obtain full proportionality provided that we allow two connected pieces per agent.
150
+
151
+ Let G𝐺G be a rooted tree with root u𝑢u, and let v1,…,vksubscript𝑣1…subscript𝑣𝑘v_{1},\dots,v_{k} be the children of u𝑢u (see Figure 6).We move the knife in the following order: For i=1,2,…,k𝑖12…𝑘i=1,2,\dots,k, we move the knife from visubscript𝑣𝑖v_{i} down to its first child, from visubscript𝑣𝑖v_{i} down to its second child, and so on until we reach its last child, then from visubscript𝑣𝑖v_{i} up to u𝑢u.This process ensures that the knife goes through all edges of G𝐺G. We stop when the part already covered by the knife is worth 1/2121/2 to one of the agents.We allocate the covered part of the cake to that agent, and the remaining part to the other agent.
152
+
153
+ Clearly, the resulting allocation is proportional; it remains to show that each agent receives at most two connected pieces. We consider two cases:•Case 1: The knife stops on its way from a vertex visubscript𝑣𝑖v_{i} to its child w𝑤w (possibly at w𝑤w). This means that the first i−1𝑖1i-1 branches of the tree have been covered, and they are connected through u𝑢u.Moreover, the covered part in the i𝑖ith branch are connected through visubscript𝑣𝑖v_{i}. Hence the covered part forms two connected pieces of the cake.The uncovered part in the i𝑖ith branch besides the edge vi​wsubscript𝑣𝑖𝑤v_{i}w is connected through visubscript𝑣𝑖v_{i}, and it is connected to the remaining uncovered part from the (i+1)𝑖1(i+1)st branch onwards through u𝑢u.The uncovered part of the edge vi​wsubscript𝑣𝑖𝑤v_{i}w forms one connected piece. It follows that both agents receive at most two connected pieces.•Case 2: The knife stops on its way from a vertex visubscript𝑣𝑖v_{i} to the root u𝑢u (possibly at u𝑢u). The same argument as in Case 1 shows that the covered part forms two connected pieces of the cake.The uncovered part in the i𝑖ith branch is contained in the edge vi​usubscript𝑣𝑖𝑢v_{i}u, and it is connected to the remaining uncovered part from the (i+1)𝑖1(i+1)st branch onwards through u𝑢u. It follows that both agents receive at most two connected pieces.The two cases together complete the proof.∎
154
+
155
+ We end this section by briefly considering another well-established fairness notion: equitability. Interestingly, while for approximate proportionality it is useful to consider the maximum among the agents’ values for the current piece (Theorem 3.1), for approximate equitability in the case of two agents, the appropriate quantity to consider is the sum of these values. Note that an empty allocation is always equitable but yields the lowest possible welfare of zero, so we are interested in complete allocations.
156
+
157
+ To show tightness, let G𝐺G be a star with three edges such that every agent values each edge exactly 1/3131/3, and the value is distributed uniformly within the edge. In any complete and connected allocation, one of the agents must receive two full edges (and possibly part of the third). This implies that the inequity in such an allocation is at least 1/3131/3.
158
+
159
+ We now prove the first part of the theorem. Let G𝐺G be an arbitrary graph. Our goal is to find a complete, connected allocation (A1,A2)subscript𝐴1subscript𝐴2(A_{1},A_{2}) such that |f1​(A1)−f2​(A2)|≤1/3subscript𝑓1subscript𝐴1subscript𝑓2subscript𝐴213|f_{1}(A_{1})-f_{2}(A_{2})|\leq 1/3. Since the allocation is complete, we may write f2​(A2)=1−f2​(A1)subscript𝑓2subscript𝐴21subscript𝑓2subscript𝐴1f_{2}(A_{2})=1-f_{2}(A_{1}). The desired condition can be rewritten as 2/3≤f1​(A1)+f2​(A1)≤4/323subscript𝑓1subscript𝐴1subscript𝑓2subscript𝐴1432/3\leq f_{1}(A_{1})+f_{2}(A_{1})\leq 4/3. We use a similar procedure as in Theorem 3.1, turning the graph into a tree and considering a minimal subtree that has value at least 2/3232/3 with respect to f1+f2subscript𝑓1subscript𝑓2f_{1}+f_{2}. We stop either when the knife cuts a subtree A1subscript𝐴1A_{1} such that f1​(A1)+f2​(A1)=2/3subscript𝑓1subscript𝐴1subscript𝑓2subscript𝐴123f_{1}(A_{1})+f_{2}(A_{1})=2/3 (Case 1), or when a set of branches A1subscript𝐴1A_{1} satisfies f1​(A1)+f2​(A1)≥2/3subscript𝑓1subscript𝐴1subscript𝑓2subscript𝐴123f_{1}(A_{1})+f_{2}(A_{1})\geq 2/3 for the first time (Case 2). An analogous argument shows that we must have f1​(A1)+f2​(A1)≤2/3+2/3=4/3subscript𝑓1subscript𝐴1subscript𝑓2subscript𝐴1232343f_{1}(A_{1})+f_{2}(A_{1})\leq 2/3+2/3=4/3, which yields the desired inequality.∎
160
+
161
+ In this section, we assume that the graph represents a chore, i.e., an item that yields negative value to the agents. This models, for example, a situation where we wish to divide the responsibilities of maintaining a road or cable network.
162
+
163
+ For the case of two agents, all results in cake cutting (Section 4) can be translated to analogous results in chore division using a simple reduction.The idea is that given a chore instance, we can turn it into a cake instance by pretending that the cost functions are cake valuation functions, applying a result in the cake setting to obtain an initial allocation of the chore, and having the agents swap their assigned piece to arrive at the final allocation.This reduction works for translating positive results to the chore setting. For negative results, we can use the reduction in the opposite direction, starting from a chore instance and reducing it to a cake instance.As an illustrating example, we show how to deduce an analogue of Theorem 4.8 in the chore setting.
164
+
165
+ When there are more than two agents, the relationship between the cake and the chore setting becomes much less clear, and we do not know how to translate results from one setting to the other. In the chore setting, we show that for each n𝑛n, the egalitarian cost may need to be as high as 2n+12𝑛1\frac{2}{n+1}.
166
+
167
+ The bound 2n+12𝑛1\frac{2}{n+1} is tight for n=2𝑛2n=2 due to Theorem 5.1.Next, we show that it remains tight as long as n≤5𝑛5n\leq 5.A simpler protocol for the case n=3𝑛3n=3 is given in Appendix A.
168
+
169
+ We conjecture that the bound 2n+12𝑛1\frac{2}{n+1} is tight for all n𝑛n, and leave it as an intriguing open question.
170
+
171
+ In this paper, we introduce and study a generalized version of the classical cake-cutting problem, where the cake can be represented by an arbitrary graph instead of an interval.We establish bounds on the utilities that can be guaranteed to the agents for various classes of graphs, both for cake cutting and chore division, and demonstrate in several cases that our guarantees are tight.We also show that better guarantees are possible if we allow more connected pieces per agent, and exhibit an algorithm that computes an approximately equitable allocation.
172
+
173
+ Our work opens up a number of new directions for future research. Besides proportionality and equitability, another prominent fairness notion is envy-freeness, which stipulates that no agent prefers another agent’s bundle to her own in the allocation.In the case of two agents, envy-freeness and proportionality are equivalent, and approximate proportionality bounds readily translate to corresponding approximate envy-freeness results.However, this equivalence ceases to hold when there are more than two agents.If the graph consists of a single edge, a connected envy-free allocation always exists for any number of agents (Stromquist, 1980).It would be interesting to see whether one can obtain (approximate) envy-freeness guarantees for different classes of graphs.
174
+
175
+ Like in the vast majority of the fair division literature, we assume in this paper that all parts of the resource either yield nonnegative utility to every agent (cake cutting) or nonpositive utility to every agent (chore division).Recently, Bogomolnaia et al. (Bogomolnaia et al., 2017) and Segal-Halevi (Segal-Halevi, 2018) considered a generalization where an agent may have positive utility for some parts of the resource and negative utility for other parts, and different agents may have different evaluations. Aziz et al. (Azizet al., 2019) showed the existence of a connected proportional allocation in this general setting when the resource is represented by an interval. Again, extending this result to more complex graphs is an appealing direction that we leave for future work.
1910.14147v1.txt ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Driven by the hardness of labeling work, graph-based semi-supervised learning (G-SSL) [1, 2, 3] has been widely used to boost the quality of models using easily accessible unlabeled data. The core idea behind it is that both labeled and unlabeled data coexist in the same manifold. For instance, in the transductive setting, we have label propagation [1] that transfers the label information from labeled nodes to neighboring nodes according to their proximity. While in the inductive case, a graph-based manifold regularizer can be added to many existing supervised learning models to enforce the smoothness of predictions on the data manifold [4, 5]. G-SSL has received a lot of attention; many of the applications are safety-critical such as drug discovery [6] and social media mining [7].
2
+
3
+ We aim to develop systematic and efficient data poisoning methods for poisoning G-SSL models. Our idea is partially motivated by the recent researches on the robustness of machine learning models to adversarial examples [8, 9]. These works mostly show that carefully designed, slightly perturbed inputs – also known as adversarial examples – can substantially degrade the performance of many machine learning models. We would like to tell apart this problem from our setting: adversarial attacks are performed during the testing phase and applied to test data [10, 11, 12, 13, 14, 15], whereas data poisoning attack is conducted during training phase [16, 17, 18, 19, 20], and perturbations are added to training data only. In other words, data poisoning attack concerns about how to imperceptibly change the training data to affect testing performance. As we can imagine, this setting is more challenging than testing time adversarial attacks due to the hardness of propagating information through a sophisticated training algorithm.
4
+
5
+ Despite the efforts made on studying poisoning attack to supervised models [16, 17, 18, 19, 20], the robustness of semi-supervised algorithms has seldom been studiedand many related questions remain unsolved.For instance, are semi-supervised learning algorithms sensitive to small perturbation of labels? And how do we formally measure the robustness of these algorithms?
6
+
7
+ In this paper, we initiate the first systematic study of data poisoning attacks against G-SSL. We mainly cover the widely used label propagation algorithm, but similar ideas can be applied to poisoning manifold regularization based SSL as well (see Appendix 4.2). To poison semi-supervised learning algorithms, we can either change the training labels or features. For label poisoning, we show it is a constrained quadratic minimization problem, and depending on whether it is a regression or classification task, we can take a continuous or discrete optimization method. For feature poisoning, we conduct gradient-based optimization with group Lasso regularization to enforce group sparsity (shown in Appendix 4.2). Using the proposed algorithms, we answer the questions mentioned above with several experiments. Our contributions can be summarized as follows:•We propose a framework for data poisoning attack to G-SSL that 1) includes both classification and regression cases, 2) works under various kinds of constraints, and 3) assumes both complete and incomplete knowledge of algorithm user (also called “victim”).•For label poisoning to regression task, which is a nonconvex trust region problem, we design a specialized solver that can find a global minimum in asymptotically linear time.•For label poisoning attack to classification task, which is an NP-hard integer programming problem, we propose a novel probabilistic solver that works in combination with gradient descent optimizer. Empirical results show that our method works much better than classical greedy methods.•We design comprehensive experiments using the proposed poisoning algorithms on a variety of problems and datasets.In what follows, we refer to the party running poisoning algorithm as the attacker, and the party doing the learning and inference work as the victim.
8
+
9
+ Adversarial attacks have been extensively studied recently. Many recent works consider the test time attack, where the model is fixed, and the attacker slightly perturbs a testing example to change the model output completely [9]. We often formulate the attacking process as an optimization problem [10], which can be solved in the white-box setting.In this paper, we consider a different area called data poisoning attack, where we run the attack during training time — an attacker can carefully modify (or add/remove) data in the training set so that the model trained on the poisoned dataeither has significantly degraded performance [18, 16] or has some desired properties [21, 19].As we mentioned, this is usually harder than test time attacks since the model is not predetermined.Poisoning attacks have been studied in several applications, including multi-task learning [20], image classification [21], matrix factorization for recommendation systems [19] and online learning [22]. However, they did not include semi-supervised learning, and the resulting algorithms are quite different from us.
10
+
11
+ To the best of our knowledge,[23, 24, 25] are the only related works on attacking semi-supervised learning models. They conduct test time attacks to Graph Convolutional Network (GCN). In summary, their contributions are different from us in several aspects:1) the GCN algorithm is quite different from the classical SSL algorithms considered in this paper (e.g. label propagation and manifold regularization). Notably, we only use feature vectors and the graph will be constructed manually with kernel function. 2) Their works are restricted to testing time attacks by assuming the model is learned and fixed, and the goal of attacker is to find a perturbation to fool the established model. Although there are some experiments in [24] on poisoning attacks, the perturbation is still generated from test time attack and they did not design task-specific algorithms for the poisoning in the training time.In contrast, we consider the data poisoning problem, which happens before the victim trains a model.
12
+
13
+ We consider the graph-based semi-supervised learning (G-SSL) problem. The input include labeled data 𝑿l∈ℝnl×dsubscript𝑿𝑙superscriptℝsubscript𝑛𝑙𝑑{\bm{X}}_{l}\in{\mathbb{R}}^{n_{l}\times d} and unlabeled data 𝑿u∈ℝnu×dsubscript𝑿𝑢superscriptℝsubscript𝑛𝑢𝑑{\bm{X}}_{u}\in{\mathbb{R}}^{n_{u}\times d}, we define the whole features 𝑿=[𝑿l;𝑿u]𝑿subscript𝑿𝑙subscript𝑿𝑢{\bm{X}}=[{\bm{X}}_{l};{\bm{X}}_{u}]. Denoting the labels of 𝑿lsubscript𝑿𝑙{\bm{X}}_{l} as 𝒚lsubscript𝒚𝑙{\bm{y}}_{l}, our goal is to predict the labels of test data 𝒚usubscript𝒚𝑢{\bm{y}}_{u}. The learner applies algorithm 𝒜𝒜\mathcal{A} to predict 𝒚usubscript𝒚𝑢{\bm{y}}_{u} from available data {𝑿l,𝒚l,𝑿u}subscript𝑿𝑙subscript𝒚𝑙subscript𝑿𝑢\{{\bm{X}}_{l},{\bm{y}}_{l},{\bm{X}}_{u}\}. Here we restrict 𝒜𝒜\mathcal{A} to label propagation method, where we first generate a graph with adjacency matrix 𝑺𝑺{\bm{S}} from Gaussian kernel: 𝑺i​j=exp⁡(−γ​‖𝒙i−𝒙j‖2)subscript𝑺𝑖𝑗𝛾superscriptnormsubscript𝒙𝑖subscript𝒙𝑗2{\bm{S}}_{ij}=\exp(-\gamma\|{\bm{x}}_{i}-{\bm{x}}_{j}\|^{2}), where the subscripts 𝒙i​(j)subscript𝒙𝑖𝑗{\bm{x}}_{i(j)} represents the i​(j)𝑖𝑗i(j)-th row of 𝑿𝑿{\bm{X}}. Then the graph Laplacian is calculated by 𝑳=𝑫−𝑺𝑳𝑫𝑺{\bm{L}}={\bm{D}}-{\bm{S}}, where 𝑫=diag​{∑k=1n𝑺i​k}𝑫diagsuperscriptsubscript𝑘1𝑛subscript𝑺𝑖𝑘{\bm{D}}=\text{diag}\{\sum_{k=1}^{n}{\bm{S}}_{ik}\} is the degree matrix. The unlabeled data is then predicted through energy minimization principle [2]min𝒚^⁡12​∑i,j𝑺i​j​(𝒚^i−𝒚^j)2=𝒚^⊺​𝑳​𝒚^,s.t. 𝒚^:l=𝒚l.formulae-sequencesubscript^𝒚12subscript𝑖𝑗subscript𝑺𝑖𝑗superscriptsubscript^𝒚𝑖subscript^𝒚𝑗2superscript^𝒚⊺𝑳^𝒚s.t. subscript^𝒚:absent𝑙subscript𝒚𝑙\min_{\hat{{\bm{y}}}}\ \frac{1}{2}\sum_{i,j}{\bm{S}}_{ij}(\hat{{\bm{y}}}_{i}-\hat{{\bm{y}}}_{j})^{2}=\hat{{\bm{y}}}^{\intercal}{\bm{L}}\hat{{\bm{y}}},\quad\text{s.t. }\quad\hat{{\bm{y}}}_{\mathrel{\mathop{\mathchar 58\relax}}l}={\bm{y}}_{l}.(1)The problem has a simple closed form solution 𝒚^u=(𝑫u​u−𝑺u​u)−1​𝑺u​l​𝒚lsubscript^𝒚𝑢superscriptsubscript𝑫𝑢𝑢subscript𝑺𝑢𝑢1subscript𝑺𝑢𝑙subscript𝒚𝑙\hat{{\bm{y}}}_{u}=({\bm{D}}_{uu}-{\bm{S}}_{uu})^{-1}{\bm{S}}_{ul}{\bm{y}}_{l}, where we define 𝑫u​u=𝑫[0:u,0:u]subscript𝑫𝑢𝑢subscript𝑫delimited-[]formulae-sequence:0𝑢:0𝑢{\bm{D}}_{uu}={\bm{D}}_{[0\mathrel{\mathop{\mathchar 58\relax}}u,0\mathrel{\mathop{\mathchar 58\relax}}u]}, 𝑺u​u=𝑺[0:u,0:u]subscript𝑺𝑢𝑢subscript𝑺delimited-[]formulae-sequence:0𝑢:0𝑢{\bm{S}}_{uu}={\bm{S}}_{[0\mathrel{\mathop{\mathchar 58\relax}}u,0\mathrel{\mathop{\mathchar 58\relax}}u]} and 𝑺u​l=𝑺[0:u,0:l]subscript𝑺𝑢𝑙subscript𝑺delimited-[]formulae-sequence:0𝑢:0𝑙{\bm{S}}_{ul}={\bm{S}}_{[0\mathrel{\mathop{\mathchar 58\relax}}u,0\mathrel{\mathop{\mathchar 58\relax}}l]}. Now we consider the attacker who wants to greatly change the prediction result 𝒚usubscript𝒚𝑢{\bm{y}}_{u} by perturbing the training data {𝑿l,𝒚l}subscript𝑿𝑙subscript𝒚𝑙\{{\bm{X}}_{l},{\bm{y}}_{l}\} by small amounts {Δx,𝜹y}subscriptΔ𝑥subscript𝜹𝑦\{\Delta_{x},{\bm{\delta}}_{y}\} respectively, where Δx∈ℝnl×dsubscriptΔ𝑥superscriptℝsubscript𝑛𝑙𝑑\Delta_{x}\in{\mathbb{R}}^{n_{l}\times d} is the perturbation matrix , and 𝜹y∈ℝnlsubscript𝜹𝑦superscriptℝsubscript𝑛𝑙{\bm{\delta}}_{y}\in{\mathbb{R}}^{n_{l}} is a vector. This seems to be a simple problem at the first glance, however,we will show that the problem of finding optimal perturbation is often intractable, and therefore provable and effective algorithms are needed. To sum up, the problem have several degrees of freedom:���Learning algorithm: Among all graph-based semi-supervised learning algorithms, we primarily focus on the label propagation method; however, we also discuss manifold regularization method in Appendix 4.2.•Task: We should treat the regression task and classification task differently because the former is inherently a continuous optimization problem while the latter can be transformed into integer programming.•Knowledge of attacker: Ideally, the attacker knows every aspect of the victim, including training data, testing data, and training algorithms. However, we will also discuss incomplete knowledge scenario; for example, the attacker may not know the exact value of hyper-parameters.•What to perturb: We assume the attacker can perturb the label or the feature, but not both. We made this assumption to simplify our discussion and should not affect our findings.•Constraints: We also assume the attacker has limited capability, so that (s)he can only make small perturbations. It could be measured ℓ2subscriptℓ2\ell_{2}-norm or sparsity.
14
+
15
+ We show a toy example in Figure 1 to motivate the data poisoning attack to graph semi-supervised learning (let us focus on label propagation in this toy example). In this example, the shaded region is very close to node-i𝑖i and yet quite far from other labeled nodes. After running label propagation, all nodes inside the shaded area will be predicted to be the same label as node-i𝑖i. That gives the attacker a chance to manipulate the decision of all unlabeled nodes in the shaded area at the cost of flipping just one node. For example, in Figure 1, if we change node-i𝑖i’s label from positive to negative, the predictions in the shaded area containing three nodes will also change from positive to negative.
16
+
17
+ Besides changing the labels, another way to attack is to perturb the features 𝑿𝑿{\bm{X}} so that the graph structure 𝑺𝑺{\bm{S}} changes subtly (recall the graph structure is constructed based on pair-wise distances). For instance, we can change the features so that node i𝑖i is moved away from the shaded region, while more negative label points are moved towards the shaded area. Then with label propagation, the labels of the shaded region will be changed from positive to negative as well. We will examine both cases in the following sections.
18
+
19
+ The goal of poisoning attack is to modify the data points to maximize the error rate (for classification) or RMSE score (for regression); thus we write the objective asmin𝜹y∈ℛ1Δx∈ℛ2−12​‖g​((𝑫u​u′−𝑺u​u′)−1​𝑺u​l′​(𝒚l+𝜹y))−h​(𝒚u)‖22s.t. ​{𝑫′,𝑺′}=Kerγ⁡(𝑿l+Δx).subscriptsubscript𝜹𝑦subscriptℛ1subscriptΔ𝑥subscriptℛ212subscriptsuperscriptnorm𝑔superscriptsubscriptsuperscript𝑫′𝑢𝑢subscriptsuperscript𝑺′𝑢𝑢1subscriptsuperscript𝑺′𝑢𝑙subscript𝒚𝑙subscript𝜹𝑦ℎsubscript𝒚𝑢22s.t. superscript𝑫′superscript𝑺′subscriptKer𝛾subscript𝑿𝑙subscriptΔ𝑥\min_{\begin{subarray}{c}{\bm{\delta}}_{y}\in\mathcal{R}_{1}\\\Delta_{x}\in\mathcal{R}_{2}\end{subarray}}-\frac{1}{2}\Big{\|}g\Big{(}({\bm{D}}^{\prime}_{uu}-{\bm{S}}^{\prime}_{uu})^{-1}{\bm{S}}^{\prime}_{ul}({\bm{y}}_{l}+{\bm{\delta}}_{y})\Big{)}-h({\bm{y}}_{u})\Big{\|}^{2}_{2}\quad\text{s.t. }\{{\bm{D}}^{\prime},{\bm{S}}^{\prime}\}=\operatorname{Ker}_{\gamma}({\bm{X}}_{l}+\Delta_{x}).(2)To see the flexibility of Eq. (2) in modeling different tasks, different knowledge levels of attackers or different budgets, we decompose it into following parts that are changeable in real applications:•ℛ1subscriptℛ1\mathcal{R}_{1}/ℛ2subscriptℛ2\mathcal{R}_{2} are the constraints on 𝜹ysubscript𝜹𝑦{\bm{\delta}}_{y} and ΔxsubscriptΔ𝑥\Delta_{x}. For example, ℛ1={‖𝜹y‖2≤dmax}subscriptℛ1subscriptnormsubscript𝜹𝑦2subscript𝑑\mathcal{R}_{1}=\{\|{\bm{\delta}}_{y}\|_{2}\leq d_{\max}\} restricts the perturbation 𝜹ysubscript𝜹𝑦{\bm{\delta}}_{y} to be no larger than dmaxsubscript𝑑d_{\max}; while ℛ1={‖𝜹y‖0≤cmax}subscriptℛ1subscriptnormsubscript𝜹𝑦0subscript𝑐\mathcal{R}_{1}=\{\|{\bm{\delta}}_{y}\|_{0}\leq c_{\max}\} makes the solution to have at most cmaxsubscript𝑐c_{\max} non-zeros. As to the choices of ℛ2subscriptℛ2\mathcal{R}_{2}, besides ℓ2subscriptℓ2\ell_{2} regularization, we can also enforce group sparsity structure, where each row of ΔxsubscriptΔ𝑥\Delta_{x} could be all zeros.•g​(⋅)𝑔⋅g(\cdot) is the task dependent squeeze function, for classification task we set g​(x)=sign⁡(x)𝑔𝑥sign𝑥g(x)=\operatorname{sign}(x) since the labels are discrete and we evaluate the accuracy; for regression task it is identity function g​(x)=x𝑔𝑥𝑥g(x)=x, and ℓ2subscriptℓ2\ell_{2}-loss is used.•h​(⋅)ℎ⋅h(\cdot) controls the knowledge of unlabeled data. If the adversary knows the ground truth very well, then we simply put h​(𝒚u)=𝒚uℎsubscript𝒚𝑢subscript𝒚𝑢h({\bm{y}}_{u})={\bm{y}}_{u}; otherwise one has to estimate it from Eq. (1), in other words, h​(𝒚u)=𝒚^u=g​((𝑫u​u−𝑺u​u)−1​𝑺u​l​𝒚l)ℎsubscript𝒚𝑢subscript^𝒚𝑢𝑔superscriptsubscript𝑫𝑢𝑢subscript𝑺𝑢𝑢1subscript𝑺𝑢𝑙subscript𝒚𝑙h({\bm{y}}_{u})=\hat{{\bm{y}}}_{u}=g\big{(}({\bm{D}}_{uu}-{\bm{S}}_{uu})^{-1}{\bm{S}}_{ul}{\bm{y}}_{l}\big{)}.•KerγsubscriptKer𝛾\operatorname{Ker}_{\gamma} is the kernel function parameterized by γ𝛾\gamma, we choose Gaussian kernel throughout.•Similar to 𝑺𝑺{\bm{S}}, the new similarity matrix 𝑺′superscript𝑺′{\bm{S}}^{\prime} is generated by Gaussian kernel with parameter γ𝛾\gamma, except that it is now calculated upon poisoned data 𝑿l+Δxsubscript𝑿𝑙subscriptΔ𝑥{\bm{X}}_{l}+\Delta_{x}.•Although not included in this paper, we can also formulate targeted poisoning attack problem by changing min to max and let h​(𝒚u)ℎsubscript𝒚𝑢h({\bm{y}}_{u}) be the target.There are two obstacles to solving Eq. 2, that make our algorithms non-trivial. First, the problem is naturally non-convex, making it hard to determine whether a specific solution is globally optimal; secondly, in classification tasks where our goal is to maximize the testing time error rate, the objective is non-differentiable under discrete domain. Besides, even with hundreds of labeled data, the domain space can be unbearably big for brute force search and yet the greedy search is too myopic to find a good solution (as we will see in experiments).
20
+
21
+ In the next parts, we show how to tackle these two problems separately. Specifically, in the first part, we propose an efficient solver designed for data poisoning attack to the regression problem under various constraints. Then we proceed to solve the discrete, non-differentiable poisoning attack to the classification problem.
22
+
23
+ We first consider the regression task where only label poisoning is allowed. This simplifies Eq. (2) asmin‖𝜹y‖2≤dmaxsubscriptsubscriptnormsubscript𝜹𝑦2subscript𝑑\displaystyle\min_{\|{\bm{\delta}}_{y}\|_{2}\leq d_{\max}}−12​‖(𝑫u​u−𝑺u​u)−1​𝑺u​l​𝜹y‖2212subscriptsuperscriptnormsuperscriptsubscript𝑫𝑢𝑢subscript𝑺𝑢𝑢1subscript𝑺𝑢𝑙subscript𝜹𝑦22\displaystyle-\frac{1}{2}\Big{\|}({\bm{D}}_{uu}-{\bm{S}}_{uu})^{-1}{\bm{S}}_{ul}{\bm{\delta}}_{y}\Big{\|}^{2}_{2}(estimated label)(3a)min‖𝜹y‖2≤dmaxsubscriptsubscriptnormsubscript𝜹𝑦2subscript𝑑\displaystyle\min_{\|{\bm{\delta}}_{y}\|_{2}\leq d_{\max}}−12​‖(𝑫u​u−𝑺u​u)−1​𝑺u​l​(𝒚l+𝜹y)−𝒚u‖2212subscriptsuperscriptnormsuperscriptsubscript𝑫𝑢𝑢subscript𝑺𝑢𝑢1subscript𝑺𝑢𝑙subscript𝒚𝑙subscript𝜹𝑦subscript𝒚𝑢22\displaystyle-\frac{1}{2}\Big{\|}({\bm{D}}_{uu}-{\bm{S}}_{uu})^{-1}{\bm{S}}_{ul}({\bm{y}}_{l}+{\bm{\delta}}_{y})-{\bm{y}}_{u}\Big{\|}^{2}_{2}(true label)(3b)Here we used the fact that 𝒚^u=𝑲​𝒚lsubscript^𝒚𝑢𝑲subscript𝒚𝑙\hat{{\bm{y}}}_{u}={\bm{K}}{\bm{y}}_{l}, where we define 𝑲=(𝑫u​u−𝑺u​u)−1​𝑺u​l𝑲superscriptsubscript𝑫𝑢𝑢subscript𝑺𝑢𝑢1subscript𝑺𝑢𝑙{\bm{K}}=({\bm{D}}_{uu}-{\bm{S}}_{uu})^{-1}{\bm{S}}_{ul}. We can solve Eq. (3a) by SVD; it’s easy to see that the optimal solution should be 𝜹y=±dmax​𝒗1subscript𝜹𝑦plus-or-minussubscript𝑑subscript𝒗1{\bm{\delta}}_{y}=\pm d_{\max}{\bm{v}}_{1} and 𝒗1subscript𝒗1{\bm{v}}_{1} is the top right sigular vector if we decompose (𝑫u​u−𝑺u​u)−1​𝑺u​l=𝑼​𝚺​𝑽⊺superscriptsubscript𝑫𝑢𝑢subscript𝑺𝑢𝑢1subscript𝑺𝑢𝑙𝑼𝚺superscript𝑽⊺({\bm{D}}_{uu}-{\bm{S}}_{uu})^{-1}{\bm{S}}_{ul}={\bm{U}}{\bm{\Sigma}}{\bm{V}}^{\intercal}. However, (3b) is less straightforward, in fact it is a non-convex trust region problem, which can be generally formulated asmin‖𝒛‖2≤dmax⁡f​(𝒛)=12​𝒛⊺​𝑯​𝒛+𝒈⊺​𝒛,𝑯​ is indefinite.subscriptsubscriptnorm𝒛2subscript𝑑𝑓𝒛12superscript𝒛⊺𝑯𝒛superscript𝒈⊺𝒛𝑯 is indefinite\min_{\|{\bm{z}}\|_{2}\leq d_{\max}}f({\bm{z}})=\frac{1}{2}{\bm{z}}^{\intercal}{\bm{H}}{\bm{z}}+{\bm{g}}^{\intercal}{\bm{z}},\quad{\bm{H}}\text{ is indefinite}.(4)Our case (3b) can thus be described as 𝑯=−𝑲⊺​𝑲⪯𝟎𝑯superscript𝑲⊺𝑲precedes-or-equals0{\bm{H}}=-{\bm{K}}^{\intercal}{\bm{K}}\preceq\bm{0} and 𝒈=𝑲⊺​(𝒚u−𝒚^u)𝒈superscript𝑲⊺subscript𝒚𝑢subscript^𝒚𝑢{\bm{g}}={\bm{K}}^{\intercal}({\bm{y}}_{u}-\hat{{\bm{y}}}_{u}).Recently [26] proposed a sublinear time solver that is able to find a global minimum in 𝒪​(M/ϵ)𝒪𝑀italic-ϵ\mathcal{O}(M/\sqrt{\epsilon}) time. Here we propose an asymptotic linear algorithm based purely on gradient information, which is stated in Algorithm 1 and Theorem 6. In Algorithm 1 there are two phases, in the following theorems, we show that the phase I ends within finite iterations, and phase II converges with an asymptotic linear rate. We postpone the proof to Appendix 1.
24
+
25
+ As we have mentioned, data poisoning attack to classification problem is more challenging, as we can only flip an unnoticeable fraction of training labels. This is inherently a combinatorial optimization problem. For simplicity, we restrict the scope to binary classification so that 𝒚l∈{−1,+1}nlsubscript𝒚𝑙superscript11subscript𝑛𝑙{\bm{y}}_{l}\in\{-1,+1\}^{n_{l}},and the labels are perturbed as 𝒚~l=𝒚l⊙𝜹ysubscript~𝒚𝑙direct-productsubscript𝒚𝑙subscript𝜹𝑦\tilde{{\bm{y}}}_{l}={\bm{y}}_{l}\odot{\bm{\delta}}_{y}, where ⊙direct-product\odot denotes Hadamard product and 𝜹y=[±1,±1,…,±1]subscript𝜹𝑦plus-or-minus1plus-or-minus1…plus-or-minus1{\bm{\delta}}_{y}=[\pm 1,\pm 1,\dots,\pm 1]. For restricting the amount of perturbation, we replace the norm constraint in Eq. (3a) with integer constraint ∑i=1nl𝕀{𝜹y​[i]=−1}≤cmaxsuperscriptsubscript𝑖1subscript𝑛𝑙subscript𝕀subscript𝜹𝑦delimited-[]𝑖1subscript𝑐\sum_{i=1}^{n_{l}}\mathbb{I}_{\{{\bm{\delta}}_{y}[i]=-1\}}\leq c_{\max}, where cmaxsubscript𝑐c_{\max} is a user pre-defined constant. In summary, the final objective function has the following formmin𝜹y∈{+1,−1}nl−12​‖g​(𝑲​(𝒚l⊙𝜹y))−(𝒚u​ or ​𝒚^u)‖2,s.t.∑i=1nl𝕀{𝜹y​[i]=−1}≤cmax,subscriptsubscript𝜹𝑦superscript11subscript𝑛𝑙12superscriptnorm𝑔𝑲direct-productsubscript𝒚𝑙subscript𝜹𝑦subscript𝒚𝑢 or subscript^𝒚𝑢2s.t.superscriptsubscript𝑖1subscript𝑛𝑙subscript𝕀subscript𝜹𝑦delimited-[]𝑖1subscript𝑐\min_{{\bm{\delta}}_{y}\in\{+1,-1\}^{n_{l}}}\ -\frac{1}{2}\Big{\|}g\big{(}{\bm{K}}({\bm{y}}_{l}\odot{\bm{\delta}}_{y})\big{)}-({\bm{y}}_{u}\text{ or }\hat{{\bm{y}}}_{u})\Big{\|}^{2},\quad\text{s.t.}\quad\sum\nolimits_{i=1}^{n_{l}}\mathbb{I}_{\{{\bm{\delta}}_{y}[i]=-1\}}\leq c_{\max},(6)where we define 𝑲=(𝑫u​u−𝑺u​u)−1​𝑺u​l𝑲superscriptsubscript𝑫𝑢𝑢subscript𝑺𝑢𝑢1subscript𝑺𝑢𝑙{\bm{K}}=({\bm{D}}_{uu}-{\bm{S}}_{uu})^{-1}{\bm{S}}_{ul} and g​(x)=sign⁡(x)𝑔𝑥sign𝑥g(x)=\operatorname{sign}(x), so the objective function directly relates to error rate. Notice that the feasible set contains around ∑k=0cmax(nlk)superscriptsubscript𝑘0subscript𝑐binomialsubscript𝑛𝑙𝑘\sum_{k=0}^{c_{\max}}{n_{l}\choose k} solutions, making it almost impossible to do an exhaustive search. A simple alternative is greedy search: first initialize 𝜹y=[+1,+1,…,+1]subscript𝜹𝑦11…1{\bm{\delta}}_{y}=[+1,+1,\dots,+1], then at each time we select index i∈[nl]𝑖delimited-[]subscript𝑛𝑙i\in[n_{l}] and try flip 𝜹y​[i]=+1→−1subscript𝜹𝑦delimited-[]𝑖1→1{\bm{\delta}}_{y}[i]=+1\to-1, such that the objective function (6) decreases the most. Next, we set 𝜹y​[i]=−1subscript𝜹𝑦delimited-[]𝑖1{\bm{\delta}}_{y}[i]=-1. We repeat this process multiple times until the constraint in (6) is met.
26
+
27
+ Doubtlessly, the greedy solver is myopic. The main reason is that the greedy method cannot explore other flipping actions that appear to be sub-optimal within the current context, despite that some sub-optimal actions might be better in the long run. Inspired by the bandit model, we can imagine this problem as a multi-arm bandit, with nlsubscript𝑛𝑙n_{l} arms in total. And we apply a strategy similar to ϵitalic-ϵ\epsilon-greedy: each time we assign a high probability to the best action but still leave non-zero probabilities to other “actions”. The new strategy can be called probabilistic method, specifically, we model each action 𝜹y=±1subscript𝜹𝑦plus-or-minus1{\bm{\delta}}_{y}=\pm 1 as a Bernoulli distribution, the probability of “flipping” is P​[𝜹y=−1]=𝜶𝑃delimited-[]subscript𝜹𝑦1𝜶P[{\bm{\delta}}_{y}=-1]={\bm{\alpha}}. The new loss function is just an expectation over Bernoulli variablesmin𝜶{ℒ(𝜶):=−12𝔼𝒛∼ℬ​(𝟏,𝜶)[∥g(𝑲(𝒚l⊙𝒛))−(𝒚u or 𝒚^u)∥2]+λ2⋅∥𝜶∥22}.\min_{{\bm{\alpha}}}\ \bigg{\{}\mathcal{L}({\bm{\alpha}})\mathrel{\mathop{\mathchar 58\relax}}=-\frac{1}{2}\mathop{\mathbb{E}}_{{\bm{z}}\sim\mathcal{B}(\bm{1},{\bm{\alpha}})}\left[\big{\|}g\big{(}{\bm{K}}({\bm{y}}_{l}\odot{\bm{z}})\big{)}-({\bm{y}}_{u}\text{ or }\hat{{\bm{y}}}_{u})\big{\|}^{2}\right]+\frac{\lambda}{2}\cdot\|{\bm{\alpha}}\|_{2}^{2}\bigg{\}}.(7)Here we replace the integer constraint in Eq. 6 with a regularizer λ2​‖𝜶‖22𝜆2superscriptsubscriptnorm𝜶22\frac{\lambda}{2}\|{\bm{\alpha}}\|_{2}^{2}, the original constraint is reached by selecting a proper λ𝜆\lambda. Once problem (7) is solved, we craft the actual perturbation 𝜹ysubscript𝜹𝑦{\bm{\delta}}_{y} by setting 𝜹y​[i]=−1subscript𝜹𝑦delimited-[]𝑖1{\bm{\delta}}_{y}[i]=-1 if 𝜶​[i]𝜶delimited-[]𝑖{\bm{\alpha}}[i] is among the top-cmaxsubscript𝑐c_{\max} largest elements.
28
+
29
+ To solve Eq. (7), we need to find a good gradient estimator. Before that, we replace g​(x)=sign⁡(x)𝑔𝑥sign𝑥g(x)=\operatorname{sign}(x) with tanh⁡(x)𝑥\tanh(x) to get a continuously differentiable objective. We borrow the idea of “reparameterization trick” [27, 28] to approximate ℬ​(𝟏,𝜶)ℬ1𝜶\mathcal{B}(\bm{1},{\bm{\alpha}}) by a continuous random vector𝒛≜𝒛​(𝜶,ΔG)=21+exp⁡(1τ​(log⁡𝜶1−𝜶+ΔG))−1∈(−1,1),≜𝒛𝒛𝜶subscriptΔ𝐺211𝜏𝜶1𝜶subscriptΔ𝐺111{\bm{z}}\triangleq{\bm{z}}({\bm{\alpha}},\Delta_{G})=\frac{2}{1+\exp\Big{(}\frac{1}{\tau}\big{(}\log\frac{{\bm{\alpha}}}{1-{\bm{\alpha}}}+\Delta_{G}\big{)}\Big{)}}-1\in(-1,1),(8)where ΔG∼𝒈1−𝒈2similar-tosubscriptΔ𝐺subscript𝒈1subscript𝒈2\Delta_{G}\sim{\bm{g}}_{1}-{\bm{g}}_{2} and 𝒈1,2​∼iid​Gumbel​(0,1)subscript𝒈12iidsimilar-toGumbel01{\bm{g}}_{1,2}\overset{\text{iid}}{\sim}\text{Gumbel}(0,1) are two Gumbel distributions. τ𝜏\tau is the temperature controlling the steepness of sigmoid function: as τ→0→𝜏0\tau\to 0, the sigmoid function point-wise converges to a stair function. Plugging (8) into (7), the new loss function becomesℒ(𝜶):=−12𝔼ΔG[∥g(𝑲(𝒚l⊙𝒛(𝜶,ΔG)))−(𝒚u or 𝒚^u)∥2]+λ2⋅∥𝜶∥22.\mathcal{L}({\bm{\alpha}})\mathrel{\mathop{\mathchar 58\relax}}=-\frac{1}{2}\mathop{\mathbb{E}}_{\Delta_{G}}\left[\big{\|}g\big{(}{\bm{K}}({\bm{y}}_{l}\odot{\bm{z}}({\bm{\alpha}},\Delta_{G}))\big{)}-({\bm{y}}_{u}\text{ or }\hat{{\bm{y}}}_{u})\big{\|}^{2}\right]+\frac{\lambda}{2}\cdot\|{\bm{\alpha}}\|_{2}^{2}.(9)Therefore, we can easily obtain an unbiased, low variance gradient estimator via Monte Carlo sampling from ΔG=𝒈1−𝒈2subscriptΔ𝐺subscript𝒈1subscript𝒈2\Delta_{G}={\bm{g}}_{1}-{\bm{g}}_{2}, specifically∂ℒ​(𝜶)∂𝜶≈−12​∂∂𝜶​‖g​(𝑲​(𝒚l⊙𝒛​(𝜶,ΔG)))−(𝒚u​ or ​𝒚^u)‖2+λ​𝜶.ℒ𝜶𝜶12𝜶superscriptnorm𝑔𝑲direct-productsubscript𝒚𝑙𝒛𝜶subscriptΔ𝐺subscript𝒚𝑢 or subscript^𝒚𝑢2𝜆𝜶\frac{\partial\mathcal{L}({\bm{\alpha}})}{\partial{\bm{\alpha}}}\approx-\frac{1}{2}\frac{\partial}{\partial{\bm{\alpha}}}\big{\|}g\big{(}{\bm{K}}({\bm{y}}_{l}\odot{\bm{z}}({\bm{\alpha}},\Delta_{G}))\big{)}-({\bm{y}}_{u}\text{ or }\hat{{\bm{y}}}_{u})\big{\|}^{2}+\lambda{\bm{\alpha}}.(10)Based on that, we can apply many stochastic optimization methods, including SGD and Adam [29], to finalize the process. In the experimental section, we will compare the greedy search with our probabilistic approach on real data.
30
+
31
+ In this section, we will show the effectiveness of our proposed data poisoning attack algorithms for regression and classification tasks on graph-based SSL.
32
+
33
+ We conduct experiments on two regression and two binary classification datasets111Publicly available at https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/. The meta-information can be found in Table 1. We use a Gaussian kernel with width γ𝛾\gamma to construct the graph. For each data, we randomly choose nlsubscript𝑛𝑙n_{l} samples as the labeled set, and the rest are unlabeled. We normalize the feature vectors by x′←(x−μ)/σ←superscript𝑥′𝑥𝜇𝜎x^{\prime}\leftarrow(x-\mu)/\sigma, where μ𝜇\mu is the sample mean, and σ𝜎\sigma is the sample variance. For regression data, we also scale the output by y′←(y−ymin)/(ymax−ymin)←superscript𝑦′𝑦subscript𝑦subscript𝑦subscript𝑦y^{\prime}\leftarrow(y-y_{\min})/(y_{\max}-y_{\min}) so that y′∈[0,1]superscript𝑦′01y^{\prime}\in[0,1]. To evaluate the performance of label propagation models, for regression task we use RMSE metric defined as RMSE=1nu​∑i=1nu(yi−y^i)2RMSE1subscript𝑛𝑢superscriptsubscript𝑖1subscript𝑛𝑢superscriptsubscript𝑦𝑖subscript^𝑦𝑖2\mathrm{RMSE}=\sqrt{\frac{1}{n_{u}}\sum_{i=1}^{n_{u}}(y_{i}-\hat{y}_{i})^{2}}, while for classification tasks we use error rate metric. For comparison with other methods, since this is the first work on data poisoning attack to G-SSL, we proposed several baselines according to graph centrality measures. The first baseline is random perturbation, where we randomly add Gaussian noise (for regression) or Bernoulli noise (for regression) to labels. The other two baselines based on graph centrality scores are more challenging, they are widely used to find the “important” nodes in the graph. Intuitively, we need to perturb “important” nodes to attack the model, and we decide the importance by node degree or PageRank. We explain the baselines with more details in the appendix.
34
+
35
+ In this experiment, we consider the white-box setting where the attacker knows not only the ground truth labels 𝒚usubscript𝒚𝑢{\bm{y}}_{u} but also the correct hyper-parameter γ∗superscript𝛾\gamma^{*}. We thus apply our proposed label poisoning algorithms in Section 3.4 and 3.5 to attack regression and classification tasks, respectively. In particular, we apply ℓ2subscriptℓ2\ell_{2} constraint for perturbation 𝜹ysubscript𝜹𝑦{\bm{\delta}}_{y} in the regression task and use the greedy method in the classification task. The results are shown in Figure 2,
36
+
37
+ as we can see in this figure, for both regression and classification problems, small perturbations can lead to vast differences: for instance, on cadata, the RMSE increases from 0.20.20.2 to 0.30.30.3 when applied a carefully designed perturbation ‖𝜹y‖=3normsubscript𝜹𝑦3\|{\bm{\delta}}_{y}\|=3 (this is very small compared with the norm of label ‖𝒚l‖≈37.36normsubscript𝒚𝑙37.36\|{\bm{y}}_{l}\|\approx 37.36); More surprisingly, on mnist17, the accuracy can drop from 98.46%percent98.4698.46\% to 50%percent5050\% by flipping just 333 nodes. This phenomenon indicates that current graph-based SSL, especially the label propagation method, can be very fragile to data poisoning attacks. On the other hand, using different baselines (shown in Figure 2, bottom row), the accuracy does not decline much, this indicates that our proposed attack algorithms are more effective than centrality based algorithms.
38
+
39
+ Moreover, the robustness of label propagation is strongly related to the number of labeled data nlsubscript𝑛𝑙n_{l}: for all datasets shown in Figure 2, we notice that the models with larger nlsubscript𝑛𝑙n_{l} tend to be more resistant to poisoning attacks. This phenomenon arises because, during the learning process, the label information propagates from labeled nodes to unlabeled ones. Therefore even if a few nodes are “contaminated” during poisoning attacks, it is still possible to recover the label information from other labeled nodes. Hence this experiment can be regarded as another instance of “no free lunch” theory in adversarial learning [30].
40
+
41
+ We compare the effectiveness of poisoning attacks with and without ground truth labels 𝒚usubscript𝒚𝑢{\bm{y}}_{u}. Recall that if an attacker does not hold 𝒚usubscript𝒚𝑢{\bm{y}}_{u}, (s)he will need to replace it with the estimated values 𝒚^usubscript^𝒚𝑢\hat{{\bm{y}}}_{u}. Thus we expect a degradation of effectiveness due to the replacement of 𝒚usubscript𝒚𝑢{\bm{y}}_{u}, especially when 𝒚^usubscript^𝒚𝑢\hat{{\bm{y}}}_{u} is not a good estimation of 𝒚usubscript𝒚𝑢{\bm{y}}_{u}. The result is shown in Figure 3. Surprisingly, we did not observe such phenomenon: for regression tasks on cadata and E2006, two curves are closely aligned despite that attacks without ground truth labels 𝒚usubscript𝒚𝑢{\bm{y}}_{u} are only slightly worse. For classification tasks on mnist17 and rcv1, we cannot observe any difference, the choices of which nodes to flip are exactly the same (except the cmax=1subscript𝑐1c_{\max}=1 case in rcv1). This experiment provides a valuable implication that hiding the ground truth labels cannot protect the SSL models, because the attackers can alternatively use the estimated ground truth 𝒚^usubscript^𝒚𝑢\hat{{\bm{y}}}_{u}.
42
+
43
+ In this experiment, we compare the performance of three approximate solvers for problem (6) in Section 3.5, namely greedy and probabilistic methods. We choose rcv1 data as oppose to mnist17 data, because rcv1 is much harder for poisoning algorithm: when nl=1000subscript𝑛𝑙1000n_{l}=1000, we need cmax≈30subscript𝑐30c_{\max}\approx 30 to make error rate ≈50%absentpercent50\approx 50\%, whilst mnist17 only takes cmax=5subscript𝑐5c_{\max}=5. For hyperparameters, we set cmax={0,1,…,29}subscript𝑐01…29c_{\max}=\{0,1,\dots,29\}, nl=1000subscript𝑛𝑙1000n_{l}=1000, γ∗=0.1superscript𝛾0.1\gamma^{*}=0.1. The results are shown in Figure 4, we can see that for larger cmaxsubscript𝑐c_{\max}, greedy method can easily stuck into local optima and inferior than our probabilistic based algorithms.
44
+
45
+ Since we use the Gaussian kernel to construct the graph, there is an important hyper-parameter γ𝛾\gamma (kernel width) that controls the structure of the graph defined in (1), which is often chosen empirically by the victim through validation. Given the flexibility of γ𝛾\gamma, it is thus interesting to see how the effectiveness of the poisoning attack degrades with the attacker’s imperfect estimation of γ𝛾\gamma. To this end, we suppose the victim runs the model at the optimal hyperparameter γ=γ∗𝛾superscript𝛾\gamma=\gamma^{*}, determined by validation, while the attacker has a very rough estimation γadv≈γ∗subscript𝛾advsuperscript𝛾\gamma_{\mathrm{adv}}\approx\gamma^{*}. We conduct this experiment on cadata when the attacker knows or does not know the ground truth labels 𝒚usubscript𝒚𝑢{\bm{y}}_{u}, the result is exhibited in Figure 5.It shows that when the adversary does not have exact information of γ𝛾\gamma, it will receive some penalties on the performance (in RMSE or error rate). However, it is entirely safe to choose a smaller γadv<γtruthsubscript𝛾advsubscript𝛾truth\gamma_{\mathrm{adv}}<\gamma_{\mathrm{truth}} because the performance decaying rate is pretty low. Take Figure 5 for example, even though γadv=18​γtruthsubscript𝛾adv18subscript𝛾truth\gamma_{\mathrm{adv}}=\frac{1}{8}\gamma_{\mathrm{truth}}, the RMSE only drops from 0.2230.2230.223 to 0.2180.2180.218. On the other hand, if γadvsubscript𝛾adv\gamma_{\mathrm{adv}} is over large, the nodes become more isolated, and thus the perturbations are harder to propagate to neighbors.
46
+
47
+ We conduct the first comprehensive study of data poisoning to G-SSL algorithms, including label propagation and manifold regularization (in the appendix). The experimental results for regression and classification tasks exhibit the effectiveness of our proposed attack algorithms. In the future, it will be interesting to study poisoning attacks for deep semi-supervised learning models.
1910.14175v1.txt ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Machine learning (ML) techniques, such as deep neural networks, have led to incredible advances in a wide variety of applications. As the complexity of ML techniques increases, the black-box nature of these data-centric approaches has become a critical bottleneck. The inability to obtain a holistic understanding of strengths and weaknesses of models makes it challenging to deploy such models in the real-world. For example, a classifier model can often produce highly concentrated softmax probabilities – suggesting a reliable class assignment – even for out-of-distribution test samples. The intricate interactions between data sampling, model selection and the inherent randomness in complex systems strongly emphasize the need for a rigorous characterization of ML algorithms [1]. In conventional statistics, uncertainty quantification (UQ) provides this characterization by measuring how accurately a model reflects the physical reality and by studying the impact of different error sources on the prediction [2]. Consequently, several recent efforts have proposed to utilize prediction uncertainties in deep models to shed light onto when and how much to trust the predictions [3, 4, 5, 6]. These uncertainty estimates can also be used for enabling safe ML practice, e.g., identifying out-of-distribution samples, detecting anomalies/outliers, delegating high-risk predictions to experts, defending against adversarial attacks etc.
2
+
3
+ Existing deep uncertainty estimation methods [7, 8, 9, 10] attempt to accumulate uncertainties that might arise from modeling and data statistics [11]. By incorporating uncertainties into training, we expect the predictive models to generalize better. It is typical to evaluate these uncertainties by constructing prediction intervals and evaluating their calibration: An interval is well calibrated if the likelihood of the true target falling in the interval is consistent with the confidence level of the interval. Many approaches place specific statistical priors on predictions or on hidden units in a network, and perform parameter inferencing. While this assumption has enabled tractable inference, it is often found that the resulting intervals are not inherently well calibrated [12].
4
+
5
+ In this paper, we explore the use of calibration as a learning objective while building deep models for regression tasks. More specifically, we adopt a black-box approach, wherein we do not explicitly measure the uncertainties, but directly construct prediction intervals with the objective of minimizing calibration error. Our approach performs alternating optimization between a mean estimator network, and an interval estimator that simultaneously estimates intervals for multiple calibration levels. Surprisingly, we find that calibration is an effective objective for producing mean estimators that are highly accurate, which we demonstrate using empirical studies. More importantly, though our approach is black-box in nature and does not utilize tractable priors [1], it still produces prediction intervals that achieve significantly lower calibration error, when compared to existing methods. Finally, we propose to augment partial dependence plots [13], which are routinely used to study marginal dependence in regression models, with prediction intervals.
6
+
7
+ We begin by motivating the use of calibration as a training objective in predictive models and subsequently describe an algorithm that relies on simultaneous prediction interval estimation for different calibration levels. The notion of calibration comes from the uncertainty quantification literature [2]. Since the focus of this paper is on regression tasks, we formally define calibration in that context. Let us assume that a model ℱℱ\mathcal{F} that takes in x∈ℝdxsuperscriptℝ𝑑\mathrm{x}\in\mathbb{R}^{d} as input, produces the prediction for a target variable y∈ℝyℝ\mathrm{y}\in\mathbb{R}, along with an interval, i.e., [y^−δ,y^+δ]^y𝛿^y𝛿[\hat{\mathrm{y}}-\mathrm{\delta},\hat{\mathrm{y}}+\mathrm{\delta}], where y^^y\hat{\mathrm{y}} is the mean estimate and 2×δ2𝛿2\times\mathrm{\delta} is the predicted interval width. Note, while the mean estimate is a random variable, an interval estimate is a random interval. While an interval does or does not contain a certain value, a random interval has a certain probability of containing a value. Suppose that p​[y^−δ≤y≤y^+δ]=α𝑝delimited-[]^y𝛿y^y𝛿𝛼p[\hat{\mathrm{y}}-\mathrm{\delta}\leq\mathrm{y}\leq\hat{\mathrm{y}}+\mathrm{\delta}]=\alpha, where α∈[0,1]𝛼01\alpha\in[0,1], then the random interval is referred to as a 100×α%100percent𝛼100\times\alpha\% confidence interval. The intervals produced by ℱℱ\mathcal{F} are considered to be well calibrated if the probability of the true target falling in the interval matches the true empirical probability.
8
+
9
+ Though the idea of calibration has been widely adopted for evaluating the quality of uncertainty estimators in deep learning [1], we argue that it is an effective choice for designing loss functions in deep regression. In general, the optimization objective for predictive modeling can be written as∑iρ​(yi−ℱ​(xi;Θ))+λ​ℛ​(Θ),subscript𝑖𝜌subscripty𝑖ℱsubscriptx𝑖Θ𝜆ℛΘ\displaystyle\sum_{i}\rho\bigg{(}\mathrm{y}_{i}-\mathcal{F}(\mathrm{x}_{i};\Theta)\bigg{)}+\lambda\mathcal{R}(\Theta),(1)where ρ𝜌\rho denotes a loss function that measures the discrepancy between the true targets yy\mathrm{y} and the predictions ℱ​(x)ℱx\mathcal{F}(\mathrm{x}), ΘΘ\Theta are the model parameters and ℛℛ\mathcal{R} is a suitable regularization. The loss function ρ𝜌\rho is chosen based on assumptions on the structure of the residual y−ℱ​(x)yℱx\mathrm{y}-\mathcal{F}(\mathrm{x}). For example, when the elements of the residual are assumed to follow a Gaussian distribution, it is useful to impose the ℓ2subscriptℓ2\ell_{2} penalty. However, restricting ℱℱ\mathcal{F} to produce only point estimates limits our ability in characterizing the confidence of ℱℱ\mathcal{F} on its predictions. Consequently, in practice, it is often beneficial to consider prediction distributions or intervals in lieu of point estimates. For example, heteroscedastic neural networks (HNN) place a Gaussian prior on the prediction at each sample and optimize for ΘΘ\Theta such that the (Gaussian) likelihood of the prediction distribution containing the true target is maximized. While identifying the uncertainty sources that the prediction intervals from a HNN actually capture is known to be challenging, the heteroscedastic regression objective is nevertheless a flexible loss function for learning. In this spirit, we propose to utilize calibration as a training objective in deep regression models, wherein no specific prior assumptions (e.g. Gaussianity) are required on the predictions or the residuals.
10
+
11
+ We now outline the algorithm for calibration-driven learning in regression. In our formulation, we consider a model ℱ:x↦y:ℱmaps-toxy\mathcal{F}:\mathrm{x}\mapsto\mathrm{y} with parameters ΘΘ\Theta to produce a mean estimate y^^y\hat{\mathrm{y}}, and a width estimator 𝒢:x↦ℝ+:𝒢maps-toxsuperscriptℝ\mathcal{G}:\mathrm{x}\mapsto\mathbb{R}^{+} with parameters ΦΦ\Phi to produce δ𝛿\mathrm{\delta}, jointly returning the interval [y^−δ,y^+δ]^y𝛿^y𝛿[\hat{\mathrm{y}}-\mathrm{\delta},\hat{\mathrm{y}}+\mathrm{\delta}]. Since we do not assume the predictions to follow a Gaussian distribution, the widths corresponding to each empirical calibration level α𝛼\alpha cannot be implicitly evaluated. Hence, we allow the width estimator 𝒢𝒢\mathcal{G} to simultaneously produce widths, δαsuperscript𝛿𝛼\mathrm{\delta}^{\alpha}, for a pre-defined range of α𝛼\alpha’s (example, [0.1,0.3,0.5,0.7,0.9]0.10.30.50.70.9[0.1,0.3,0.5,0.7,0.9]) in an attempt to obtain intervals for increasing levels of calibration.
12
+
13
+ Our algorithm employs an alternating optimization strategy that updates ΘΘ\Theta and ΦΦ\Phi with the goal of improving calibration for the chosen set of α𝛼\alpha’s. In particular, we use an empirical calibration error metric for refining the model 𝒢𝒢\mathcal{G}:Φ∗=arg⁡minΦ⁡L𝒢superscriptΦsubscriptΦsubscriptL𝒢\displaystyle\Phi^{*}=\arg\min_{\Phi}\mathrm{L}_{\mathcal{G}}(2)=argminΦ∑α∈A(|α−1N∑i=1N𝕀[y^i−δiα≤yi≤y^i+δiα]|\displaystyle=\arg\min_{\Phi}\sum_{\alpha\in A}\bigg{(}\left|\alpha-\frac{1}{N}{\sum_{i=1}^{N}\mathbb{I}\left[\hat{\mathrm{y}}_{i}-\mathrm{\delta}_{i}^{\alpha}\leq\mathrm{y}_{i}\leq\hat{\mathrm{y}}_{i}+\mathrm{\delta}_{i}^{\alpha}\right]}\right|+λ1|(y^i+δiα)−yi|+λ2|yi−(y^i−δiα)|).\displaystyle\quad\quad\quad\quad\quad\quad+\lambda_{1}\left|(\hat{\mathrm{y}}_{i}+\mathrm{\delta}_{i}^{\alpha})-\mathrm{y}_{i}\right|+\lambda_{2}|\mathrm{y}_{i}-(\hat{\mathrm{y}}_{i}-\mathrm{\delta}_{i}^{\alpha})|\bigg{)}.Here A𝐴A indicates the set of calibration levels that we want to simultaneously achieve using the corresponding width estimates δαsuperscript𝛿𝛼\mathrm{\delta}^{\alpha} and N𝑁N denotes the total number of samples. This metric measures the discrepancy between the true empirical probability and the likelihood of the true target falling in the interval. Note that the mean estimates y^i=ℱ​(xi;Θ)subscript^y𝑖ℱsubscriptx𝑖Θ\hat{\mathrm{y}}_{i}=\mathcal{F}(\mathrm{x}_{i};\Theta) are obtained using the current state of the parameters ΘΘ\Theta. The last two terms are used as regularizers to penalize larger widths so that trivial solutions are avoided. The hyperparameters λ1subscript𝜆1\lambda_{1} and λ2subscript𝜆2\lambda_{2} are set to 0.10.10.1 in all our experiments. In practice, we find that such a simultaneous optimization is challenging and the loss function is biased towards larger values of α𝛼\alpha. Hence, in our algorithm, we randomly choose a level α𝛼\alpha from the set A𝐴A in each iteration.
14
+
15
+ The key idea of the proposed approach is to leverage the estimated intervals to drive the update of the mean estimator. To this end, we propose to employ a hinge loss objective that attempts to adjust the mean estimate such that the observed likelihood of the target contained in the interval increases:Θ∗=arg⁡minΘ⁡LℱsuperscriptΘsubscriptΘsubscriptLℱ\displaystyle\Theta^{*}=\arg\min_{\Theta}\mathrm{L}_{\mathcal{F}}(3)=argminΘ∑i=1Nwi[max(0,(y^i−δiα)−yi+τ)\displaystyle=\arg\min_{\Theta}\sum_{i=1}^{N}w_{i}\bigg{[}\max(0,(\hat{\mathrm{y}}_{i}-\mathrm{\delta}_{i}^{\alpha})-\mathrm{y}_{i}+\tau)+max(0,yi−(y^i+δiα)+τ)].\displaystyle\quad\quad\quad\quad\quad\quad+\max(0,\mathrm{y}_{i}-(\hat{\mathrm{y}}_{i}+\mathrm{\delta}_{i}^{\alpha})+\tau)\bigg{]}.Here, δiαsuperscriptsubscript𝛿𝑖𝛼\mathrm{\delta}_{i}^{\alpha} is obtained using the current state of the estimator 𝒢𝒢\mathcal{G} for the α𝛼\alpha chosen during that iteration. The optional threshold τ𝜏\tau is set to 0.050.050.05 in all our experiments. The weights wi=δiα/∑jδjαsubscript𝑤𝑖superscriptsubscript𝛿𝑖𝛼subscript𝑗superscriptsubscript𝛿𝑗𝛼w_{i}=\mathrm{\delta}_{i}^{\alpha}/\sum_{j}\mathrm{\delta}_{j}^{\alpha} penalize samples with larger widths (less confident) while updating ΘΘ\Theta. Intuitively, for a fixed interval, the improved mean estimate can potentially increase the calibration error by achieving a higher likelihood even for smaller α𝛼\alpha levels. However, in the subsequent step of updating ΦΦ\Phi, we expect the widths to become sharper in order to reduce the calibration error. As a result, this collaborative optimization process leads to superior quality mean estimates and highly calibrated intervals. Though a rigorous analysis of the intervals remains to be done, the value of using calibration as a training objective is clearly evident in our experiments.
16
+
17
+ We evaluate the proposed approach using benchmark regression tasks and compare its performance against existing baseline methods for deep predictive modeling. We consider 888 different datasets from the UCI repository [14] and use random 80-20 splits for training and testing respectively. We performed 5−limit-from55-fold cross validation and measured the average performance in all cases. All experiments were carried out using a neural network with 555 fully connected layers with ReLU non-linearity, and a final regression layer. Following standard practice we report the root mean squared error (RMSE) and the empirical calibration error (ECE) metrics for evaluation. For the ECE metric, we used the set A=[0.1,0.3,0.5,0.7,0.9]𝐴0.10.30.50.70.9A=[0.1,0.3,0.5,0.7,0.9]. We used the following hyper-parameters in our experiments: λ1=λ2=0.1subscript𝜆1subscript𝜆20.1\lambda_{1}=\lambda_{2}=0.1, T=1000𝑇1000T=1000, learning rates of 5​e−55𝑒55e-5 and 1​e−41𝑒41e-4 for updating the parameters ΘΘ\Theta and ΦΦ\Phi respectively. For comparison, we considered the following baseline methods: (i) MC dropout [7], (ii) concrete dropout [8], (iii) Bayesian neural networks (BNN) [10] and (iv) heteroscedastic neural networks [1]. Note that, these approaches include the uncertainty estimation step as part of the training process and have varying degrees of impact on the behavior of the resulting mean and interval estimators.
18
+
19
+ As seen in Table 1, the conventional dropout regularization produces high-fidelity predictors in terms of test RMSE, but produces unsatisfactory calibration error in many cases. In contrast, the Bayesian neural network method, which utilizes a variational inferencing approach for incorporating model uncertainties into the learning, produces consistently better calibration, while achieving larger RMSE. In comparison, concrete dropout and HNN demonstrate a better trade-off between the two metrics. The proposed approach improves significantly over the baselines, in terms of both the metrics, and clearly evidences the power of calibration as a learning objective. Though being a black-box interval estimation method (without any explicit uncertainty estimation step), similar to HNN, the proposed approach matches the empirical probabilities at different confidence levels (see calibration plots in Figure 1).
20
+
21
+ Gaining insights into a model’s behavior is critical to its deployment and usage in the real-world. Consequently, it is common to utilize model-agnostic interpretation tools to explore the characteristics of a learned model. In regression models, the partial dependence plot (PDP) [13] is a widely adopted tool for studying the marginal effect of each (or two) feature on the predicted outcome of a model. PDP reveals the global relationship between the target and a feature, for example if it is linear or monotonic. Assuming xssuperscriptx𝑠\mathrm{x}^{s} to denote the feature for which the PDP is plotted, and xcsuperscriptx𝑐\mathrm{x}^{c} to denote the other d−1𝑑1d-1 features, such that x=[xs,xc]xsuperscriptx𝑠superscriptx𝑐\mathrm{x}=[\mathrm{x}^{s},\mathrm{x}^{c}] the partial dependence function can be evaluated on the training data as:
22
+
23
+ P​(xs)=1Nt​∑i=1Ntℱ​(xs,xic).Psuperscriptx𝑠1subscript𝑁𝑡superscriptsubscript𝑖1subscript𝑁𝑡ℱsuperscriptx𝑠superscriptsubscriptx𝑖𝑐\mathrm{P}(\mathrm{x}^{s})=\frac{1}{N_{t}}\sum_{i=1}^{N_{t}}\mathcal{F}(\mathrm{x}^{s},\mathrm{x}_{i}^{c}).(4)Here Ntsubscript𝑁𝑡N_{t} denotes the total number of training samples. In this formula, xicsuperscriptsubscriptx𝑖𝑐\mathrm{x}_{i}^{c} corresponds to actual features from observed data, and the partial function PP\mathrm{P} is evaluated for each value of xssuperscriptx𝑠\mathrm{x}^{s}. We propose to augment PD plots with expected intervals, in order to obtain a better understanding of the dependencies. For example in Figure 3, we show the PDP for the Age and BMI variables on the insurance cost, wherein the dataset contains additional variables including age, gender and medical history. In the augmented PD plot for Age, we can observe from the mean prediction that the cost monotonically increases. Further, from the expected interval estimates, we see that, at lower Age values, say 202020, the intervals are large enough to include the expected costs even at age 353535. However, as the Age variable grows, the intervals are sharp indicating that predictions are highly sensitive in that regime. On the other hand, the BMI variable shows a clear split around the value 353535, with minimal variations (less sensitive) within the two regions. Similarly, the PD plots for the 444 variables in the UCI power plant dataset [14] reveal that the Temperature parameter has a strong dependency (inverse) with the energy output, and is significantly more sensitive at lower values. On the other hand, though the other 333 parameters show no apparent relationship, the intervals for the PDP of Relative Humidity reveals a more complex relationship. In summary, we find calibration to be effective for building predictive models, and the resulting intervals can be useful in practice, even though they cannot be directly associated to specific uncertainties.
1910.14176v1.txt ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Discourse parsing is a fundamental NLP task known to enhance key downstream tasks, such as sentiment analysis Bhatia et al. (2015); Nejat et al. (2017); Hogenboom et al. (2015), text classification Ji and Smith (2017) and summarization Gerani et al. (2014).
2
+
3
+ In essence, a discourse parser should reveal the structure underlying coherent text as postulated by a discourse theory, of which the two most popular are Rhetorical Structure Theory (RST) Mann and Thompson (1988) and PDTB Prasad et al. (2008). In this paper, we focus on RST-style parsing, but the proposed approach is theory agnostic and could be applied to PDTB as well.
4
+
5
+ The RST discourse theory assumes a complete hierarchical discourse tree for a given document,where leaf nodes are clause-like sentence fragments, called elementary-discourse-units (EDUs), while internal tree nodes are labelled with discourse relations. In addition, each node is given a nuclearity attribute, which encodes the importance of the node in its local context.
6
+
7
+ In the past decade, traditional, probabilistic approaches, such as Support Vector Machines (SVM) Hernault et al. (2010); Ji and Eisenstein (2014) and Conditional Random Fields (CRF) Joty et al. (2015); Feng and Hirst (2014), have dominated the field. More recently, neural approaches Braud et al. (2016); Li et al. (2016); Braud et al. (2017); Yu et al. (2018); Liu and Lapata (2017, 2018) have been explored, with limited success Morey et al. (2017); Ferracane et al. (2019). The main reason why recent advances in deep learning have not enhanced discourse parsing to the same extend as they have revolutionized many other areas of NLP is the small amount of training data available.Existing corpora in English Carlson et al. (2002); Subba and Di Eugenio (2009) only comprise of a few hundred annotated documents, each typically containing a few dozen EDUs, strictly limiting the application of deep learning methodologies. Although in principle new corpora could be created, the annotation process is expensive and time consuming. It requires sophisticated linguistic expertise and is therefore not suitable for crowd-sourcing efforts.
8
+
9
+ Another limiting issue with the available training data is the restriction to only a few domains, such as news articles Carlson et al. (2002) or instructions Subba and Di Eugenio (2009). This impairs the performance of existing discourse parsers when transferred into new domains.
10
+
11
+ To overcome the mentioned limitations, we propose a novel approach that uses distant supervision on the auxiliary task of sentiment classification to generate abundant data for RST-style discourse structure prediction.
12
+
13
+ We draw intuition from previous work using discourse parsing as an auxiliary task to enhance sentiment analysis Bhatia et al. (2015); Nejat et al. (2017); Hogenboom et al. (2015). Our assumption is that such synergies between sentiment analysis and discourse parsing are bidirectional. In this paper, we leverage the synergy effects in the opposite direction by using sentiment analysis to create discourse structures.
14
+
15
+ Figure 1 illustrates the discourse structure of a strongly negative Yelp review generated by our system. While solely based on sentiment information, the structure nevertheless resembles a well aligned discoursetree. It can be observed that EDUs with negative sentiment are generally located at a higher level in the tree, while for example EDUs \raisebox{-0.4pt}{\small{5}}⃝ and \raisebox{-0.4pt}{\small{6}}⃝, with positive sentiment, are at the bottom of a deep subtree. Thisway, EDUs with negative sentiment strongly influence the overall sentiment, while EDUs \raisebox{-0.4pt}{\small{5}}⃝ and \raisebox{-0.4pt}{\small{6}}⃝ only have little impact. At the same time, semantically related EDUs generally have a shorter distance than semantically unrelated EDUs.
16
+
17
+ Our approach combines a neural variant of multiple-instance learning (MILNet) Angelidis and Lapata (2018), with an optimal CKY-style tree generation algorithm Jurafsky and Martin (2014). First, MILNet computes fine-grained sentiment values and un-normalized attention scores Ji and Smith (2017) on EDU-level, by solely relying on distant supervision signals from document-level annotations. These annotations are abundantly available from several published open source datasets such as Yelp’13 Tang et al. (2015), IMDB Diao et al. (2014) or Amazon Zhang et al. (2015). Then, the sentiment values and attention scores are aggregated to guide the discourse-tree construction, optimized on the document gold-label sentiment, using optimal CKY-style parsing.
18
+
19
+ Following this approach, we generate a new corpus annotated with “silver standard” discourse trees, which comprises of 100k documents (two orders of magnitude more than any existing corpora). To test the quality of our new corpus, we run a series of experiments, where we train the top performing discourse parser by Wang et al. (2017) on our corpus for discourse structure prediction and compare it with the same parser trained on human annotated corpora in the news domain (RST-DT) and in the instructional domain. Results indicate that while training a parser on our corpus does not yet match the performance of a parser trained and tested on the same dataset (intra-domain), it does perform remarkably well on the significantly more difficult and arguably more useful task of inter-domain discourse structure prediction, where the parser is trained on one domain and tested/applied on another one.Our results on inter-domain discourse parsing, shown in Section 4, strongly suggest that if anyone wants to leverage discourse parsing in a domain without annotated data, it is advantageous to use a discourse parser which has been trained on our new corpus, rather than, for instance, on RST-DT.
20
+
21
+ Our approach to address the lack of annotated data in discourse parsing lies at the intersection of RST-style parsing, sentiment analysis and multiple-instance learning (MIL).
22
+
23
+ A large number of highly diverse discourse parsers have been proposed in previous work, with non-neural ones achieving the best performance. In this paper, we consider a set of top-performing parsers, which follow fundamentally different intuitions on how the parsing process should be modelled. Joty et al. (2015) and Ji and Eisenstein (2014) argue that discourse parsing should use a single model for structure, nuclearity and relation modelling. Joty et al. (2015) further propose to separate the task “vertically” on sentence- and document-level, while Ji and Eisenstein (2014) are using a single Shift-Reduce parser based on lexical features. The current state-of-the-art system by Wang et al. (2017) follows an opposing intuition, namely that the task should be separated “horizontally” into two sequenced components. The first classifier models the structure and nuclearity, while the second classifier builds the relation model.Apart from being the state-of-the-art model, Wang et al. (2017) has the ideal architecture for our experiments. With the horizontal separation between structure/nuclearity and relation prediction classifiers, it can be easily tailored to just make discourse structure predictions when trained on our new corpus of discourse trees.
24
+
25
+ The second related area is sentiment analysis, which we use as our auxiliary task. Previous studies, e.g., Bhatia et al. (2015); Ji and Smith (2017), have shown that sentiment prediction can be enhanced by leveraging discourse information, as the tree structure can influence the significance of certain clauses in the document and boost the overall performance. In particular, Bhatia et al. (2015) use handcrafted discourse features on the sentiment classification task to score clauses depending on the level in the discourse tree. Ji and Smith (2017) use discourse trees generated by a discourse parser Ji and Eisenstein (2014) to inform a recursive neural network and automatically learn the model weights for sentiment prediction. In this paper, we exploit the relation between sentiment analysis and discourse parsing in the opposite direction by using sentiment annotations to create discourse structures.
26
+
27
+ The third area of related work is distant supervision aimed at automatically generating fine-grained annotations. Distant supervision has previously been used to retrieve sentiment Marchetti-Bowick and Chambers (2012); Tabassum et al. (2016) and emotion classes Abdul-Mageed and Ungar (2017) from opinionated text, showing the potential of distant supervision with user generated content. A common technique for distant supervision is multiple-instance learning Keeler and Rumelhart (1992), where the general idea is to retrieve fine-grained information from high-level signals. High-level signals are called bags and fine-grained information is referred to as instances. The task is defined as the generation of instance labels solely based on the given bag labels. We follow the approach by Angelidis and Lapata (2018), who train their MILNet system on the publicly available Yelp’13 Tang et al. (2015) and IMDB Diao et al. (2014) datasets. Results indicate that MILNet can capture EDU-level sentiment information as well as the relative importance of EDUs when evaluated on datasets annotated on EDU-level. In this paper, we adapt MILNet to generate information useful for deriving discourse trees from corpora with document-level sentiment annotations.
28
+
29
+ To generate a large number of discourse structures via distant supervision from sentiment, we propose a four-step approach, shown in Figures 3 and 3. Figure 3 illustrates the first stage of the approach, where for each document in the dataset, (a) the document is segmented into EDUs and (b) our adaptation of MILNet is trained on the document-level sentiment. Next, shown in Figure 3, we again (a) segment the document into EDUs and use (b) the MIL network to generate fine-grain sentiment and importance scores. Then in (c), we prepare those scores to be used in (d), the CKY-like parser, which generates an optimal RST discourse-tree for the document, based on the EDU-level scores and the gold label document sentiment.
30
+
31
+ We initially separate the sentiment documents into a disjoint sequence of EDUs. The segmentation is obtained using the discourse segmenter by Feng and Hirst (2012) as generated and published by Angelidis and Lapata (2018). We preprocess the EDUs by removing infrequent- and stop-words and subsequently apply lemmatization.
32
+
33
+ Our MIL model is closely related to the methodology described in Angelidis and Lapata (2018), as well as the papers by Yang et al. (2016) and Ji and Smith (2017). The computation is based on the initial segmentation described in section 3.1 and is shown in further detail in Figure 4.
34
+
35
+ Our model consists of two levels of Recurrent Neural Networks (RNN) inspired by Yang et al. (2016) and a sentiment- and attention-module. The computational flow in the model is defined from bottom to top in Figure 4. In a first step, the sparse one-hot word representations are transformed into dense vector-representations wisubscript𝑤𝑖w_{i} using a pretrained GloVe word embedding matrix Pennington et al. (2014). The dense word representations of a single EDU Ei=(wj,…,wk)subscript𝐸𝑖subscript𝑤𝑗…subscript𝑤𝑘E_{i}=(w_{j},...,w_{k}) are used as the sequential input for the EDU-level RNN, implemented as a bi-directional GRU module with a standard attention mechanism Bahdanau et al. (2014). The attention-weighted hidden-states Rwi=Hwi∗Awisubscript𝑅subscript𝑤𝑖subscript𝐻subscript𝑤𝑖subscript𝐴subscript𝑤𝑖R_{w_{i}}=H_{w_{i}}*A_{w_{i}} are concatenated along the time axis to represent REisubscript𝑅subscript𝐸𝑖R_{E_{i}}. The second RNN on document-level subsequently uses the distributed EDU representations (RE1,…,REs)subscript𝑅subscript𝐸1…subscript𝑅subscript𝐸𝑠(R_{E_{1}},...,R_{E_{s}}) as inputs for the neural network. Based on the sequence of computed hidden-states (HE1,…,HEs)subscript𝐻subscript𝐸1…subscript𝐻subscript𝐸𝑠(H_{E_{1}},...,H_{E_{s}}) in the bi-directional GRU network, two parallel model components are executed, as follows:
36
+
37
+ was proposed by Ji and Smith (2017) to leverage discourse structure for sentiment prediction. By following the same intuition, we replace the softmax activation on the attention weights by a sigmoid function. This way, each attention weight AEisubscript𝐴subscript𝐸𝑖A_{E_{i}} is still limited within the range (0,1)01(0,1), but the sum of all attention scores is not necessarily bound by 111.We use the attention weight AEisubscript𝐴subscript𝐸𝑖A_{E_{i}} as the importance scores of EDUi.
38
+
39
+ is also executed directly on the hidden-states (HE1,…,HEs)subscript𝐻subscript𝐸1…subscript𝐻subscript𝐸𝑠(H_{E_{1}},...,H_{E_{s}}) generated by the document-level RNN. To be able to interpret the dense hidden representations as sentiment predictors, we use a single feed-forward neural network layer S𝑆S with |C|𝐶|C| neurons, representing the disjoint sentiment classes (C1,…,Cm)subscript𝐶1…subscript𝐶𝑚(C_{1},...,C_{m}) in the dataset111In the Yelp’13 dataset, the feed-forward operation S𝑆S results in 555 real-valued outputs.. We add a sigmoid activation s​i​g​m𝑠𝑖𝑔𝑚sigm after the feed-forward layer to obtain the final, internal EDU sentiment prediction SEi=s​i​g​m​(S​(HEi))subscript𝑆subscript𝐸𝑖𝑠𝑖𝑔𝑚𝑆subscript𝐻subscript𝐸𝑖S_{E_{i}}=sigm(S(H_{E_{i}})).
40
+
41
+ The output of the two parallel modules is multiplied EDU-wise and summed up along the time axis to calculate the final sentiment prediction of our MILNet model as OD=∑Ei∈DSEi∗AEisubscript𝑂𝐷subscriptsubscript𝐸𝑖𝐷subscript𝑆subscript𝐸𝑖subscript𝐴subscript𝐸𝑖O_{D}=\sum_{E_{i}\in D}{S_{E_{i}}*A_{E_{i}}} (see top of Figure 4).
42
+
43
+ To train our MILNet model, we use the cross-entropy loss function to compare ODsubscript𝑂𝐷O_{D} with the gold document-level sentiment label of the review and train using the Adadelta optimizer Zeiler (2012). By separating the sentiment and attention components and directly computing the final output based solely on these two values, the neural network implicitly learns the sentiment and attention scores on EDU-level as a by-product of the document-level prediction. For more information on this technique, we refer to Angelidis and Lapata (2018). The hyper-parameter setting of our model also mostly follows the implementation of previous work. We use a batch-size of 200 documents and train the model for 25 epochs. The bidirectional GRU layers contain 100 neurons and the model inputs are preprocessed by limiting the number of EDUs in a document to 150 and defining the maximum length of an EDU to be 20 words. With these settings, we capture over 90% of the data by significantly decreasing the training efforts. We apply 20% dropout on the internal sentiment layer.
44
+
45
+ Once our MILNet model is trained, we can use it to obtain the attention score AEisubscript𝐴subscript𝐸𝑖A_{E_{i}} and the sentiment score SEisubscript𝑆subscript𝐸𝑖S_{E_{i}} for each EDU Eisubscript𝐸𝑖E_{i} in a document (see (c) in Figure 3). However, while each AEisubscript𝐴subscript𝐸𝑖A_{E_{i}} is already a scalar, SEisubscript𝑆subscript𝐸𝑖S_{E_{i}} is a vector with |C|𝐶|C| elements, one for each sentiment class Cisubscript𝐶𝑖C_{i}. In order to effectively combine the attention and sentiment scores for further processing, we transform SEisubscript𝑆subscript𝐸𝑖S_{E_{i}} into a scalar polarity score p​o​l𝑝𝑜𝑙pol, centered around 00 and uniformly distribute the |C|𝐶|C| sentiment classes within the interval of [−1,1]11[-1,1]. For instance, if |C|=5𝐶5|C|=5, this would result in the five classes p​o​l𝑐𝑜𝑒𝑓𝑓=[−1,−0.5,0,0.5,1]𝑝𝑜subscript𝑙𝑐𝑜𝑒𝑓𝑓10.500.51pol_{\mathit{coeff}}=[-1,-0.5,0,0.5,1]. The polarity p​o​lEi𝑝𝑜subscript𝑙subscript𝐸𝑖pol_{E_{i}} of EDU Eisubscript𝐸𝑖E_{i} is computed by calculating the element-wise product of the sentiment score SEisubscript𝑆subscript𝐸𝑖S_{E_{i}} and the uniform distribution p​o​l𝑐𝑜𝑒𝑓𝑓𝑝𝑜subscript𝑙𝑐𝑜𝑒𝑓𝑓pol_{\mathit{coeff}}.p​o​lEi=∑c∈CSEi(c)∗p​o​l𝑐𝑜𝑒𝑓𝑓(c)𝑝𝑜subscript𝑙subscript𝐸𝑖subscript𝑐𝐶superscriptsubscript𝑆subscript𝐸𝑖𝑐𝑝𝑜superscriptsubscript𝑙𝑐𝑜𝑒𝑓𝑓𝑐pol_{E_{i}}=\sum_{c\in C}{}S_{E_{i}}^{(c)}*pol_{\mathit{coeff}}^{(c)}(1)We transform the gold labels in the same way to keep the representations consistent. With the polarity scores p​o​lEi𝑝𝑜subscript𝑙subscript𝐸𝑖pol_{E_{i}} replacing the original sentiment scores SEisubscript𝑆subscript𝐸𝑖S_{E_{i}}, a neutral sentiment document now receives a sentiment polarity of 00, while heavily positive or negative EDUs are mapped onto the scores +11+1 and −11-1 respectively. This way, the obtained attention scores AEisubscript𝐴subscript𝐸𝑖A_{E_{i}} and the calculated polarities p​o​lEi𝑝𝑜subscript𝑙subscript𝐸𝑖pol_{E_{i}} can be combined to create a weighted sentiment score with high attention values resulting in stronger polarities.
46
+
47
+ The final step in our approach (see (d) in Figure 3) takes the tuples of EDU-level attention scores and the generated polarities from the MILNet model to create a set of possible discourse trees. We then select the discourse tree that most precisely computes the overall sentiment of the document. To find the globally best tree, we are computing all possible tree structures (with some constraints) using a dynamic programming approach closely related to the widely used CKY algorithm Jurafsky and Martin (2014).
48
+
49
+ To create discourse trees bottom-up using CKY, we define the necessary aggregation rules for local trees. For each binary subtree, we need to define a function p​(cl,cr)𝑝subscript𝑐𝑙subscript𝑐𝑟p(c_{l},c_{r}) on how to aggregate the information of the two children clsubscript𝑐𝑙c_{l} and crsubscript𝑐𝑟c_{r} to represent the parent node p𝑝p. For sentiment, we use the intuitive attention-weighted average of the children’s sentiments, defined by:ps​(cl,cr)=cls∗cla+crs∗cracla+crasubscript𝑝𝑠subscript𝑐𝑙subscript𝑐𝑟subscript𝑐subscript𝑙𝑠subscript𝑐subscript𝑙𝑎subscript𝑐subscript𝑟𝑠subscript𝑐subscript𝑟𝑎subscript𝑐subscript𝑙𝑎subscript𝑐subscript𝑟𝑎p_{s}(c_{l},c_{r})=\frac{c_{l_{s}}*c_{l_{a}}+c_{r_{s}}*c_{r_{a}}}{c_{l_{a}}+c_{r_{a}}}(2)This way, the parent sentiment does not only depend on the sentiment of its children, but also their relative importance.
50
+
51
+ For the attention computation we consider three different aggregation functions:
52
+
53
+ (1) The sum of the children’s attentions (Eq. 3). This way, the combined importance of the children is inherited by the parent node, making the node as important as the combination of all sub-nodes.pas​u​m​(cl,cr)=(cla+cra)∗(1−λ)subscript𝑝subscript𝑎𝑠𝑢𝑚subscript𝑐𝑙subscript𝑐𝑟subscript𝑐subscript𝑙𝑎subscript𝑐subscript𝑟𝑎1𝜆p_{a_{sum}}(c_{l},c_{r})=(c_{l_{a}}+c_{r_{a}})*(1-\lambda)(3)where λ𝜆\lambda represents a damping factor to penalize lower sub-trees, empirically chosen to be 1%percent11\% using grid-search. (2) The maximum of the children’s attentions.pam​a​x​(cl,cr)=m​a​x​(cla,cra)subscript𝑝subscript𝑎𝑚𝑎𝑥subscript𝑐𝑙subscript𝑐𝑟𝑚𝑎𝑥subscript𝑐subscript𝑙𝑎subscript𝑐subscript𝑟𝑎p_{a_{max}}(c_{l},c_{r})=max(c_{l_{a}},c_{r_{a}})(4)As shown in equation 4, the attention of the parent node is calculated as the maximum attention value of the two children. This aggregation function follows the intuition that the parent node is only as relevant as the most important child node. (3) The average of the children’s attentions.paa​v​g​(cl,cr)=cla,cra2subscript𝑝subscript𝑎𝑎𝑣𝑔subscript𝑐𝑙subscript𝑐𝑟subscript𝑐subscript𝑙𝑎subscript𝑐subscript𝑟𝑎2p_{a_{avg}}(c_{l},c_{r})=\frac{c_{l_{a}},c_{r_{a}}}{2}(5)This aggregation function (Eq. 5) assigns the average importance of the two children to their parent.
54
+
55
+ To create RST-style discourse documents, which can be used by existing parsers, we need to also provide nuclearity and relation labels for every tree node.While we leave the general task of nuclearity- and relation-prediction for future work, we still need to assign those attributes to tree nodes.We assign nuclearity solely depending on the attention value of the children nodes, making the following binary decision:cln={`​`​N​u​c​l​e​u​s​",if​cla≥cra`​`​S​a​t​e​l​l​i​t​e​",otherwisesubscript𝑐subscript𝑙𝑛cases``𝑁𝑢𝑐𝑙𝑒𝑢𝑠"ifsubscript𝑐subscript𝑙𝑎subscript𝑐subscript𝑟𝑎``𝑆𝑎𝑡𝑒𝑙𝑙𝑖𝑡𝑒"otherwisec_{l_{n}}=\begin{cases}``Nucleus",&\text{if}\ c_{l_{a}}\geq c_{r_{a}}\\``Satellite",&\text{otherwise}\end{cases}(6)This simple approach cannot assign “Nucleus-Nucleus” nuclearity attributes, but always requires one child to be the satellite. Finally, for the necessary rhetorical relation attribute, we simply assign the span relation to every node.
56
+
57
+ Due to the high complexity of the optimal CKY algorithm, to keep the process manageable by our computational resources222Intel Core i9-9820X, RTX 2080 Ti, 128 GB RAM, we introduce two constraints on the generated discourse trees:•We prohibit inter-sentence relations, unless the complete sentence is represented by a single node (as shown to capture the vast majority of discourse relations by Joty et al. (2015))•We only process documents with less or equal to 20 EDUs per document
58
+
59
+ With the aggregation functions and restrictions described above, we run the CKY-style dynamic programming approach and compare the sentiment at the root node of each of the complete discourse trees with the dataset gold-label for the document. The discourse tree with the smallest distance from the gold-label is selected as the discourse structure representation of the document (see Figure 3, on the right) and saved in a serializable RST-DT format. This way, we generate a dataset of 100k discourse trees.
60
+
61
+ We now describe the evaluation of our new discourse structure dataset. We start with the datasets and discourse parsers used to train and test our approach. Next, we describe the evaluation metrics, finishing with experiments and results.
62
+
63
+ We use three datasets to train and evaluate our approach. Table 1 summarizes the most important dataset dimensions.
64
+
65
+ is a review dataset collected for the Yelp Dataset Challenge in 2013 Tang et al. (2015). Every datapoint in the corpus consists of a review along with a star-rating on a 5-point scale. We use the discourse segmented version of the corpus by Angelidis and Lapata (2018) to train our system on the auxiliary sentiment prediction task.
66
+
67
+ is the largest and most frequently used corpus to train RST-style discourse parsers Carlson et al. (2002). The dataset consists of news articles from Wall Street Journal.We use the standard data split with 90% training data (RST-DTtrain) and 10% test data (RST-DTtest) to test the performance of our approach against competitive baselines.
68
+
69
+ is another RST-style dataset to evaluate discourse parsers on the domain of home-repair instructions Subba and Di Eugenio (2009). For convenience, we refer to this corpus as Instr-DT from here on.We separate the data into 90% training data (Instr-DTtrain) and 10% test data (Instr-DTtest).
70
+
71
+ is measured using the Jaccard similarity index.We show the absolute vocabulary sizes of the datasets in Table 1 and visualize the overlap in Table 2.The vocabulary overlap between the Yelp’13 corpus (containing reviews), the RST-DT dataset (on news articles) and the Instr-DT corpus (containing home-repair instructions) is predictably low, given the different domains of the datasets. While this would be a problem for models solely basing their prediction on raw input words, our system goes beyond just words as inputs. During training, we use pre-trained word embeddings to encode the inputs and the state-of-the-art discourse parser Wang et al. (2017) uses a combination of syntactical and lexical features to represent words.
72
+
73
+ In our experiments, we apply four simple baselines and fourcompetitive discourse parsers, often used in previous work for comparison studies.
74
+
75
+ predict a binary, fully right- or left-branching tree for every document in the dataset.
76
+
77
+ predict a binary, fully right- or left-branching tree on sentence-level and combine the sentence-level trees in right- or left-branching manner for every document in the dataset.
78
+
79
+ a classic, greedy, bottom-up parser using linear SVMs Hernault et al. (2010).
80
+
81
+ a SVM-based shift-reduce parser build on linear projections of lexical features Ji and Eisenstein (2014).
82
+
83
+ a CKY-based chart parser combined with Dynamic Conditional Random Fields, separating the computation on sentence- and document-level Joty et al. (2015).
84
+
85
+ current state-of-the-art parser by Wang et al. (2017). Employs two separate SVM classifiers for structure/nuclearity and relations, reaching the best performance for structure and nuclearity. This is the parser we rely on in our experiments due to its performance advantage compared to other discourse parsers and its separate computation of the structure/nuclearity and the discourse relation.We use the publicly available code provided by Wang et al. (2017) and remove the relation classification module.
86
+
87
+ Consistent with previous work, e.g., Wang et al. (2017); Joty et al. (2015) and following the recent analysis by Morey et al. (2017), our key metric is the average micro precision on span level, computed as the global overlap of the discourse structure prediction and the gold structure. We traverse both discourse trees t​r​e​ep​r​e​di𝑡𝑟𝑒subscript𝑒𝑝𝑟𝑒subscript𝑑𝑖tree_{pred_{i}} and t​r​e​eg​o​l​di𝑡𝑟𝑒subscript𝑒𝑔𝑜𝑙subscript𝑑𝑖tree_{gold_{i}} of each document i𝑖i in post-order and compute:p​r​e​c​i​s​i​o​n=∑it​r​e​ep​r​e​di∩t​r​e​eg​o​l​di∑i|t​r​e​eg​o​l​di|𝑝𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛subscript𝑖𝑡𝑟𝑒subscript𝑒𝑝𝑟𝑒subscript𝑑𝑖𝑡𝑟𝑒subscript𝑒𝑔𝑜𝑙subscript𝑑𝑖subscript𝑖𝑡𝑟𝑒subscript𝑒𝑔𝑜𝑙subscript𝑑𝑖precision=\frac{\sum_{i}{tree_{pred_{i}}\cap tree_{gold_{i}}}}{\sum_{i}{|tree_{gold_{i}}|}}(7)Notice that the choice of precision over recall and F-score has no impact on the results when using manual segmentation, as shown in previous work, e.g., Wang et al. (2017); Joty et al. (2015).
88
+
89
+ We run experiments in two phases. In the first phase, the state-of-the-art discourse parser by Wang et al. (2017) is individually trained on each of the datasets and tested on the two corpora containing gold discourse annotations. In the second phase, the best results are placed in the broader context of competitive discourse parsers.
90
+
91
+ We train the state-of-the-art discourse parser on five different corpora and perform tests on two corpora. The five training corpora are: RST-DTtrain, Instr-DTtrain and the three versions of our novel dataset, generated using the different attention aggregation functions (a​v​g,m​a​x,s​u​m)𝑎𝑣𝑔𝑚𝑎𝑥𝑠𝑢𝑚(avg,max,sum) discussed in Section 3.4. The two corpora used for testing are RST-DTtrain and Instr-DTtrain (for which gold standard annotations are available). Notice that whenever training and testing are performed on the same corpus, the model is trained on the training portion of the dataset (RST-DTtrain or Instr-DTtrain) and evaluated on the test data (RST-DTtest or Instr-DTtest). Finally, since one of the key benefits of our approach is the ability to generate large dataset, we also assess the relation between the dataset size and the parser performance in this phase.The results of all our experiments in the first phase are shown in Figure 6 and Figure 6.
92
+
93
+ In both figures, the left side shows the performance using small subsets of sizes 2nsuperscript2𝑛2^{n} for n=0,1,..𝑛01n=0,1,.. of the training data, while the right side shows the performance on large subsets of sizes 10nsuperscript10𝑛10^{n}, as well as the full datasets. The precision value displayed for each subset is the average of 10 randomly selected samples from the full corpus. Figure 7 shows the variance within the 10 samples, highlighting the increasing reliability of larger subsets333The complete dataset has not been subsampled and therefore does not have a variance defined..
94
+
95
+ The results shown in the two figures reveal several important findings:(1) While training the parser on our corpus does not yet match the performance of the parser trained and tested on the same dataset (intra-domain, see black lines in Figure 6 and 6), it does achieve the best performance in the inter-domain discourse structure prediction.(2) The performance generally increases with more training data. Larger datasets could therefore further increase the performance.(3) Tested on the full inter-domain training datasets (100k), the a​v​g𝑎𝑣𝑔avg attention-aggregation function achieves the most consistent performance on the corpora. When evaluated only on RST-DT, the m​a​x𝑚𝑎𝑥max aggregation function reaches the overall best performance, while the a​v​g𝑎𝑣𝑔avg attention-aggregation function reaches the best performance when only evaluating on Instr-DT.(4) Small subsets of training data (4, 8 documents) already achieve relatively good results, especially on Instr-DT. One possible explanation for this behaviour is the large number of training datapoints within a single document, which generates 2∗n−12𝑛12*n-1 binary training instances, where n𝑛n is the number of EDUs in the document.(5) Generally, performance is highly dependent on the dataset domain and structure. In particular, the performance on the Instr-DT is generally lower and saturates earlier than on RST-DT. Both effects could result from Instr-DT containing less and shorter documents than RST-DT.
96
+
97
+ We further analyze our findings with respect to baselines and existing discourse parsers. The first set of results in Table 3 shows that the hierarchical right/left branching baselines dominate the completely right/left branching ones. However, their performance is still significantly worse than any discourse parser (intra- and inter-domain).
98
+
99
+ The second set of results show the performance of existing discourse parsers when trained and tested on the same dataset (intra-domain). We use the results published in the original paper whenever possible. The Two-Stage approach by Wang et al. (2017) achieves the best performance with 86% on the structure prediction using the RST-DT dataset. On the Instructional dataset, the CODRA discourse parser by Joty et al. (2015) achieves the highest score with 82.88%.
100
+
101
+ The third set in the table shows the key results from Phase 1 on the inter-domain performance.
102
+
103
+ Our models, learning the discourse structure solely from the inter-domain Yelp’13 review dataset through distant supervision, reach better performance than the human annotated datasets (RST-DT and Instr-DT) when trained inter-domain, despite the low vocabulary overlap between the Yelp’13 corpus and RST-DT/Instr-DT (Table 2).While the a​v​g𝑎𝑣𝑔avg attention-aggregation function achieves the most consistent performance on both evaluation corpora, the m​a​x𝑚𝑎𝑥max function should not be dismissed, as it performs better on the larger RST-DT dataset, which is arguably more related to the Yelp’13 corpus than the sentiment-neutral Instr-DT. Furthermore, the fact that our best models reach a performance of only 8.76% and 8.66% below the best intra-domain performances (tested on RST-DT and Instr-DT, respectively), shows the potential of our approach, even when compared to intra-domain results.
104
+
105
+ In this paper, we address a key limitation to further progress in discourse parsing: the lack of annotated datasets. We show promising initial results to overcome this limitation by creating a large-scale dataset using distant supervision on the auxiliary task of sentiment analysis. Experiments indicate that a parser trained on our new dataset outperforms parsers trained on human annotated datasets on the challenging and very useful task of inter-domain discourse structure prediction.
106
+
107
+ There are several directions for future work. First, given that we can now create large datasets, we intend to experiment on structure prediction with neural discourse parsers, which so far have delivered rather disappointing results. Second, an obvious next step is working on the integration of nuclearity and relation prediction to create complete RST annotations for documents from auxiliary tasks and to extend our evaluations Zeldes (2017). Third, we will study synergies between discourse parsing and further auxiliary tasks, eventually creating a single, joint system to generate globally high-quality discourse trees. Finally, instead of creating discourse structures and training existing discourse parsers on the data, we will design and implement an end-to-end system to train the complete process holistically.
1910.14212v1.txt ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Feature Selection is an important problem in statistics and machine learning for interpretable predictive modeling and scientific discoveries.Our goal in this paper is to design a dependency measure that is interpretable and can be reliably used to control the False Discovery Rate in feature selection.The mutual information between two random variables X𝑋X and Y𝑌Y is the most commonly used dependency measure.The mutual information I​(X;Y)𝐼𝑋𝑌I(X;Y) is defined as the Kullback-Leibler divergence between the joint distribution px​ysubscript𝑝𝑥𝑦p_{xy} of X,Y𝑋𝑌X,Y and the product of their marginals px​pysubscript𝑝𝑥subscript𝑝𝑦p_{x}p_{y}, I​(X;Y)=KL​(px​y,px​py)𝐼𝑋𝑌KLsubscript𝑝𝑥𝑦subscript𝑝𝑥subscript𝑝𝑦I(X;Y)=\text{KL}(p_{xy},p_{x}p_{y}).Mutual information is however challenging to estimate from samples, which motivated the introduction of dependency measures based on other f𝑓f-divergences or Integral Probability Metrics [1] than the KL divergence.For instance, the Hilbert-Schmidt Independence Criterion (HSIC) [2] uses the Maximum Mean Discrepancy (MMD) [3] to assess the dependency between two variables, i.e. HSIC​(X,Y)=MMD​(px​y,px​py)HSIC𝑋𝑌MMDsubscript𝑝𝑥𝑦subscript𝑝𝑥subscript𝑝𝑦\text{HSIC}(X,Y)=\text{MMD}(p_{xy},p_{x}p_{y}),which can be easily estimated from samples via Kernel mean embeddings in a Reproducing Kernel Hilbert Space (RKHS) [4].In this paper we introduce the Sobolev Independence Criterion (SIC), a form of gradient regularized Integral Probability Metric (IPM) [5, 6, 7] between the joint distribution and the product of marginals.SIC relies on the statistics of the gradient of a witness function, or critic, for both(1) defining the IPM constraint and(2) finding the features that discriminate between the joint and the marginals.Intuitively, the magnitude of the average gradient with respect to a feature gives an importance score for each feature. Hence, promoting its sparsity is a natural constraint for feature selection.
2
+
3
+ The paper is organized as follows: we show in Section 2 how sparsity-inducing gradient penalties can be used to define an interpretable dependency measure that we name Sobolev Independence Criterion (SIC).We devise an equivalent computational-friendly formulation of SIC in Section 3, that gives rise to additional auxiliary variables ηjsubscript𝜂𝑗\eta_{j}. These naturally define normalized feature importance scores that can be used for feature selection.In Section 4 we study the case where the SIC witness function f𝑓f is restricted to an RKHS and show that it leads to an optimization problem that is jointly convex in f𝑓f and the importance scores η𝜂\eta.We show that in this case SIC decomposes into the sum of feature scores, which is ideal for feature selection.In Section 5 we introduce a Neural version of SIC, which we show preserves the advantages in terms of interpretability when the witness function is parameterized as a homogeneous neural network, and which we show can be optimized using stochastic Block Coordinate Descent.In Section 6 we show how SIC and conditional Generative models can be used to control the False Discovery Rate using the recently introduced Holdout Randomization Test [8] and Knockoffs [9].We validate SIC and its FDR control on synthetic and real datasets in Section 8.
4
+
5
+ Motivation: Feature Selection.We start by motivating gradient-sparsity regularization in SIC as a mean of selecting the features that maintain maximum dependency between two randoms variable X𝑋X (the input) and Y𝑌Y (the response) defined on two spaces X⊂ℝdxXsuperscriptℝsubscriptdx\pazocal{X}\subset\mathbb{R}^{d_{x}} and Y⊂ℝdyYsuperscriptℝsubscriptdy\pazocal{Y}\subset\mathbb{R}^{d_{y}} (in the simplest case dy=1subscript𝑑𝑦1d_{y}=1). Let px​ysubscript𝑝𝑥𝑦p_{xy} be the joint distribution of (X,Y)𝑋𝑌(X,Y) and pxsubscript𝑝𝑥p_{x}, pysubscript𝑝𝑦p_{y} be the marginals of X𝑋X and Y𝑌Y resp.Let D𝐷D be an Integral Probability Metric associated with a function space ℱℱ\mathscr{F}, i.e for two distributions p,q𝑝𝑞p,q:D​(p,q)=supf∈ℱ𝔼x∼p​f​(x)−𝔼x∼q​f​(x).𝐷𝑝𝑞subscriptsupremum𝑓ℱsubscript𝔼similar-to𝑥𝑝𝑓𝑥subscript𝔼similar-to𝑥𝑞𝑓𝑥D(p,q)=\sup_{f\in\mathscr{F}}\mathbb{E}_{x\sim p}f(x)-\mathbb{E}_{x\sim q}f(x).With p=px​y𝑝subscript𝑝𝑥𝑦p=p_{xy} and q=px​py𝑞subscript𝑝𝑥subscript𝑝𝑦q=p_{x}p_{y} this becomes a generalized definition of Mutual Information. Instead of the usual KL divergence, the metric D𝐷D with its witness function, or critic, f​(x,y)𝑓𝑥𝑦f(x,y) measures the distance between the joint px​ysubscript𝑝𝑥𝑦p_{xy} and the product of marginals px​pysubscript𝑝𝑥subscript𝑝𝑦p_{x}p_{y}.With this generalized definition of mutual information,the feature selection problem can be formalized as finding a sparse selector or gate w∈ℝdx𝑤superscriptℝsubscript𝑑𝑥w\in\mathbb{R}^{d_{x}} such that D​(pw⊙x,y,pw⊙x​py)𝐷subscript𝑝direct-product𝑤𝑥𝑦subscript𝑝direct-product𝑤𝑥subscript𝑝𝑦D(p_{w\odot x,y},p_{w\odot x}p_{y}) is maximal [10, 11, 12, 13], i.e. supw,∥w∥ℓ0≤sD​(pw⊙x,y,pw⊙x​py),subscriptsupremum𝑤subscriptdelimited-∥∥𝑤subscriptℓ0𝑠𝐷subscript𝑝direct-product𝑤𝑥𝑦subscript𝑝direct-product𝑤𝑥subscript𝑝𝑦\sup_{w,\left\lVert{w}\right\rVert_{\ell_{0}}\leq s}D(p_{w\odot x,y},p_{w\odot x}p_{y}),where ⊙direct-product\odot is a pointwise multiplication and ∥w∥ℓ0=#​{j|wj≠0}subscriptdelimited-∥∥𝑤subscriptℓ0#conditional-set𝑗subscript𝑤𝑗0\left\lVert{w}\right\rVert_{\ell_{0}}=\#\{j|w_{j}\neq 0\}. This problem can be written in the following penalized form:(P):supwsupf∈ℱ𝔼px​yf(w⊙x,y)−𝔼px​pyf(w⊙x,y)−λ||w||ℓ0.\text{(P)}:\leavevmode\nobreak\ \leavevmode\nobreak\ \sup_{w}\sup_{f\in\mathscr{F}}\mathbb{E}_{p_{xy}}f(w\odot x,y)-\mathbb{E}_{p_{x}p_{y}}f(w\odot x,y)-\lambda||w||_{\ell_{0}}.
6
+
7
+ We can relabel f~​(x,y)=f​(w⊙x,y)~𝑓𝑥𝑦𝑓direct-product𝑤𝑥𝑦\tilde{f}(x,y)=f(w\odot x,y) and write (P) as:supf~∈ℱ~𝔼px​y​f~​(x,y)−𝔼px​py​f~​(x,y)subscriptsupremum~𝑓~ℱsubscript𝔼subscript𝑝𝑥𝑦~𝑓𝑥𝑦subscript𝔼subscript𝑝𝑥subscript𝑝𝑦~𝑓𝑥𝑦\sup_{\tilde{f}\in\tilde{\mathscr{F}}}\mathbb{E}_{p_{xy}}\tilde{f}(x,y)-\mathbb{E}_{p_{x}p_{y}}\tilde{f}(x,y),where ℱ~={f~|f~​(x,y)=f​(w⊙x,y)|f∈ℱ,∥w∥ℓ0≤s}~ℱconditional-set~𝑓formulae-sequence~𝑓𝑥𝑦conditional𝑓direct-product𝑤𝑥𝑦𝑓ℱsubscriptdelimited-∥∥𝑤subscriptℓ0𝑠\tilde{\mathscr{F}}=\{\tilde{f}|\tilde{f}(x,y)=f(w\odot x,y)|f\in\mathscr{F},\left\lVert{w}\right\rVert_{\ell_{0}}\leq s\}.Observe that we have:∂f~∂xj=wj​∂f​(w⊙x,y)∂xj.~𝑓subscript𝑥𝑗subscript𝑤𝑗𝑓direct-product𝑤𝑥𝑦subscript𝑥𝑗\frac{\partial\tilde{f}}{\partial x_{j}}=w_{j}\frac{\partial f(w\odot x,y)}{\partial x_{j}}.Since wjsubscript𝑤𝑗w_{j} is sparse the gradient of f~~𝑓\tilde{f} is sparse on the support of px​ysubscript𝑝𝑥𝑦p_{xy} and px​pysubscript𝑝𝑥subscript𝑝𝑦p_{x}p_{y}.Hence, we can reformulate the problem (P) as follows:(SIC): ​supf∈ℱ𝔼px​y​f​(x,y)−𝔼px​py​f​(x,y)−λ​PS​(f),(SIC): subscriptsupremum𝑓ℱsubscript𝔼subscript𝑝𝑥𝑦𝑓𝑥𝑦subscript𝔼subscript𝑝𝑥subscript𝑝𝑦𝑓𝑥𝑦𝜆subscript𝑃𝑆𝑓\text{(SIC):\leavevmode\nobreak\ \leavevmode\nobreak\ }\sup_{f\in\mathscr{F}}\mathbb{E}_{p_{xy}}f(x,y)-\mathbb{E}_{p_{x}p_{y}}f(x,y)-\lambda P_{S}(f),where PS​(f)subscript𝑃𝑆𝑓P_{S}(f) is a penalty that controls the sparsity of the gradient of the witness function f𝑓f on the support of the measures. Controlling the nonlinear sparsity of the witness function in (SIC) via its gradients is more general and powerful than the linear sparsity control suggested in the initial form (P), since it takes into account the nonlinear interactions with other variables.In the following Section we formalize this intuition by theoretically examining sparsity-inducing gradient penalties [14].
8
+
9
+ Sparsity Inducing Gradient Penalties.Gradient penalties have a long history in machine learning and signal processing. In image processing the total variation norm is used for instance as a regularizer to induce smoothness. Splines in Sobolev spaces [15], and manifold learning exploit gradient regularization to promote smoothness and regularity of the estimator.In the context of neural networks, gradient penalties were made possible through double back-propagation introduced in [16] and were shown to promote robustness and better generalization. Such smoothness penalties became popular in deep learning partly following the introduction of WGAN-GP [17],and were used as regularizer for distance measures between distributions in connection to optimal transport theory [5, 6, 7].Let μ𝜇\mu be a dominant measure of px​ysubscript𝑝𝑥𝑦p_{xy} and px​pysubscript𝑝𝑥subscript𝑝𝑦p_{x}p_{y} the most commonly used gradient penalties isΩL2​(f)=𝔼(x,y)∼μ​∥∇xf​(x,y)∥2.subscriptΩsuperscript𝐿2𝑓subscript𝔼similar-to𝑥𝑦𝜇superscriptdelimited-∥∥subscript∇𝑥𝑓𝑥𝑦2\Omega_{L^{2}}(f)=\mathbb{E}_{(x,y)\sim\mu}\left\lVert{\nabla_{x}f(x,y)}\right\rVert^{2}.While this penalty promotes smoothness, it does not control the desired sparsity as discussed in the previous section. We therefore elect to instead use the nonlinear sparsity penalty introduced in [14] :Ωℓ0​(f)=#​{j|𝔼(x,y)∼μ​|∂f​(x,y)∂xj|2=0}subscriptΩsubscriptℓ0𝑓#conditional-set𝑗subscript𝔼similar-to𝑥𝑦𝜇superscript𝑓𝑥𝑦subscript𝑥𝑗20\Omega_{\ell_{0}}(f)=\#\{j|\mathbb{E}_{(x,y)\sim\mu}\left|\frac{\partial f(x,y)}{\partial x_{j}}\right|^{2}=0\}, and its relaxation :ΩS​(f)=∑j=1dx𝔼(x,y)∼μ​|∂f​(x,y)∂xj|2.subscriptΩ𝑆𝑓superscriptsubscript𝑗1subscript𝑑𝑥subscript𝔼similar-to𝑥𝑦𝜇superscript𝑓𝑥𝑦subscript𝑥𝑗2\Omega_{S}(f)=\sum_{j=1}^{d_{x}}\sqrt{\mathbb{E}_{(x,y)\sim\mu}\left|\frac{\partial f(x,y)}{\partial x_{j}}\right|^{2}}.
10
+
11
+ As discussed in [14], 𝔼(x,y)∼μ​|∂f​(x,y)∂xj|2=0subscript𝔼similar-to𝑥𝑦𝜇superscript𝑓𝑥𝑦subscript𝑥𝑗20\mathbb{E}_{(x,y)\sim\mu}\left|\frac{\partial f(x,y)}{\partial x_{j}}\right|^{2}=0 implies that f𝑓f is constant with respect to variable xjsubscript𝑥𝑗x_{j}, if the function f𝑓f is continuously differentiable and the support of μ𝜇\mu is connected.These considerations motivate the following definition of the Sobolev Independence Criterion (SIC):SIC(L1)2​(px​y,px​py)=supf∈ℱ𝔼px​y​f​(x,y)−𝔼px​py​f​(x,y)−λ2​(ΩS​(f))2−ρ2​𝔼μ​f2​(x,y).subscriptSICsuperscriptsubscript𝐿12subscript𝑝𝑥𝑦subscript𝑝𝑥subscript𝑝𝑦subscriptsupremum𝑓ℱsubscript𝔼subscript𝑝𝑥𝑦𝑓𝑥𝑦subscript𝔼subscript𝑝𝑥subscript𝑝𝑦𝑓𝑥𝑦𝜆2superscriptsubscriptΩ𝑆𝑓2𝜌2subscript𝔼𝜇superscript𝑓2𝑥𝑦\text{SIC}_{(L_{1})^{2}}(p_{xy},p_{x}p_{y})=\sup_{f\in\mathscr{F}}\mathbb{E}_{p_{xy}}{f}(x,y)-\mathbb{E}_{p_{x}p_{y}}f(x,y)-\frac{\lambda}{2}\left(\Omega_{S}(f)\right)^{2}-\frac{\rho}{2}\mathbb{E}_{\mu}f^{2}(x,y).Note that we add a ℓ1subscriptℓ1\ell_{1}-like penalty (ΩS​(f)subscriptΩ𝑆𝑓\Omega_{S}(f) ) to ensure sparsity and an ℓ2subscriptℓ2\ell_{2}-like penalty (𝔼μ​f2​(x,y)subscript𝔼𝜇superscript𝑓2𝑥𝑦\mathbb{E}_{\mu}f^{2}(x,y)) to ensure stability. This is similar to practices with linear models such as Elastic net.
12
+
13
+ Here we will consider μ=px​py𝜇subscript𝑝𝑥subscript𝑝𝑦\mu=p_{x}p_{y} (although we could also use μ=12​(px​y+px​py)𝜇12subscript𝑝𝑥𝑦subscript𝑝𝑥subscript𝑝𝑦\mu=\frac{1}{2}(p_{xy}+p_{x}p_{y})). Then, given samples {(xi,yi),i=1,…,N}formulae-sequencesubscript𝑥𝑖subscript𝑦𝑖𝑖1…𝑁\{(x_{i},y_{i}),i=1,\dots,N\} from the joint probability distribution px​ysubscript𝑝𝑥𝑦p_{xy} and iid samples {(xi,y~i),i=1,…,N}formulae-sequencesubscript𝑥𝑖subscript~𝑦𝑖𝑖1…𝑁\{(x_{i},\tilde{y}_{i}),i=1,\dots,N\} from px​pysubscript𝑝𝑥subscript𝑝𝑦p_{x}p_{y}, SIC can be estimated as follows:SIC^(L1)2​(px​y,px​py)=supf∈ℱ1N​∑i=1Nf​(xi,yi)−1N​∑i=1Nf​(xi,y~i)−λ2​(Ω^S​(f))2−ρ2​1N​∑i=1Nf2​(xi,y~i),subscript^SICsuperscriptsubscript𝐿12subscript𝑝𝑥𝑦subscript𝑝𝑥subscript𝑝𝑦subscriptsupremum𝑓ℱ1𝑁superscriptsubscript𝑖1𝑁𝑓subscript𝑥𝑖subscript𝑦𝑖1𝑁superscriptsubscript𝑖1𝑁𝑓subscript𝑥𝑖subscript~𝑦𝑖𝜆2superscriptsubscript^Ω𝑆𝑓2𝜌21𝑁superscriptsubscript𝑖1𝑁superscript𝑓2subscript𝑥𝑖subscript~𝑦𝑖\widehat{\text{SIC}}_{(L_{1})^{2}}(p_{xy},p_{x}p_{y})=\sup_{f\in\mathscr{F}}\frac{1}{N}\sum_{i=1}^{N}f(x_{i},y_{i})-\frac{1}{N}\sum_{i=1}^{N}f(x_{i},\tilde{y}_{i})-\frac{\lambda}{2}\left(\hat{\Omega}_{S}(f)\right)^{2}-\frac{\rho}{2}\frac{1}{N}\sum_{i=1}^{N}f^{2}(x_{i},\tilde{y}_{i}),whereΩ^S​(f)=∑j=1dx1N​∑i=1N|∂f​(xi,y~i)∂xj|2.subscript^Ω𝑆𝑓superscriptsubscript𝑗1subscript𝑑𝑥1𝑁superscriptsubscript𝑖1𝑁superscript𝑓subscript𝑥𝑖subscript~𝑦𝑖subscript𝑥𝑗2\hat{\Omega}_{S}(f)=\sum_{j=1}^{d_{x}}\sqrt{\frac{1}{N}\sum_{i=1}^{N}\left|\frac{\partial f(x_{i},\tilde{y}_{i})}{\partial x_{j}}\right|^{2}}.
14
+
15
+ As it was just presented, the SIC objective is a difficult function to optimize in practice. First of all, the expectation appears after the square root in the gradient penalties, resulting in a non-smooth term (since the derivative of square root is not continuous at 0). Moreover, the fact that the expectation is inside the nonlinearity introduces a gradient estimation bias when the optimization of the SIC objective is performed using stochastic gradient descent (i.e. using mini-batches).We alleviate these problems (non-smoothness and biased expectation estimation) by making the expectation linear in the objective thanks to the introduction of auxiliary variables ηjsubscript𝜂𝑗\eta_{j} that will end up playing an important role in this work.This is achieved thanks to a variational form of the square root that is derived from the following Lemma (which was used for a similar purpose as ours when alleviating the non-smoothness of mixed norms encountered in multiple kernel learning and group sparsity norms):
16
+
17
+ We alleviate first the issue of non smoothness of the square root by adding an ε∈(0,1)𝜀01\varepsilon\in(0,1), and we define:ΩS,ε=∑j=1dx𝔼(x,y)∼μ​|∂f​(x,y)∂xj|2+εsubscriptΩ𝑆𝜀superscriptsubscript𝑗1subscript𝑑𝑥subscript𝔼similar-to𝑥𝑦𝜇superscript𝑓𝑥𝑦subscript𝑥𝑗2𝜀\Omega_{S,\varepsilon}=\sum_{j=1}^{d_{x}}\sqrt{\mathbb{E}_{(x,y)\sim\mu}\left|\frac{\partial f(x,y)}{\partial x_{j}}\right|^{2}+\varepsilon}.Using Lemma 1 the nonlinear sparsity inducing gradient penalty can be written as :(ΩS,ε​(f))2=inf{∑j=1dx𝔼px​py​|∂f​(x,y)∂xj|2+εηj:η,ηj>0,∑j=1dxηj=1},superscriptsubscriptΩ𝑆𝜀𝑓2infimumconditional-setsuperscriptsubscript𝑗1subscript𝑑𝑥subscript𝔼subscript𝑝𝑥subscript𝑝𝑦superscript𝑓𝑥𝑦subscript𝑥𝑗2𝜀subscript𝜂𝑗formulae-sequence𝜂subscript𝜂𝑗0superscriptsubscript𝑗1subscript𝑑𝑥subscript𝜂𝑗1\displaystyle(\Omega_{S,\varepsilon}(f))^{2}=\inf\{\sum_{j=1}^{d_{x}}\frac{\mathbb{E}_{p_{x}p_{y}}\left|\frac{\partial f(x,y)}{\partial x_{j}}\right|^{2}+\varepsilon}{\eta_{j}}:\eta,\eta_{j}>0,\sum_{j=1}^{d_{x}}\eta_{j}=1\},where the optimum is achieved for :ηj,ε∗=βj∑k=1dxβk,superscriptsubscript𝜂𝑗𝜀subscript𝛽𝑗superscriptsubscript𝑘1subscript𝑑𝑥subscript𝛽𝑘\eta_{j,\varepsilon}^{*}=\frac{\beta_{j}}{\sum_{k=1}^{d_{x}}\beta_{k}},where βj2=𝔼px​py​|∂f​(x,y)∂xj|2+εsubscriptsuperscript𝛽2𝑗subscript𝔼subscript𝑝𝑥subscript𝑝𝑦superscript𝑓𝑥𝑦subscript𝑥𝑗2𝜀\beta^{2}_{j}=\mathbb{E}_{p_{x}p_{y}}\left|\frac{\partial f(x,y)}{\partial x_{j}}\right|^{2}+\varepsilon.We refer to ηj,ε∗superscriptsubscript𝜂𝑗𝜀\eta_{j,\varepsilon}^{*} as the normalized importance score of feature j𝑗j. Note that ηjsubscript𝜂𝑗\eta_{j} is a distribution over the features and gives a natural ranking between the features.Hence, substituting Ω​(S)​(f)Ω𝑆𝑓\Omega(S)(f) with ΩS,ε​(f)subscriptΩ𝑆𝜀𝑓\Omega_{S,\varepsilon}(f) in its equivalent form we obtain the ε𝜀\varepsilon perturbed SIC:SIC(L1)2,ε​(px​y,px​py)=−inf{Lε​(f,η):f∈ℱ,ηj,ηj>0,∑j=1dxηj=1}subscriptSICsuperscriptsubscript𝐿12𝜀subscript𝑝𝑥𝑦subscript𝑝𝑥subscript𝑝𝑦infimumconditional-setsubscript𝐿𝜀𝑓𝜂formulae-sequence𝑓ℱsubscript𝜂𝑗formulae-sequencesubscript𝜂𝑗0superscriptsubscript𝑗1subscript𝑑𝑥subscript𝜂𝑗1\text{SIC}_{(L_{1})^{2},\varepsilon}(p_{xy},p_{x}p_{y})=-\inf\{L_{\varepsilon}(f,\eta):f\in\mathscr{F},\eta_{j},\eta_{j}>0,\sum_{j=1}^{d_{x}}\eta_{j}=1\}where Lε​(f,η)=−Δ​(f,px​y,px​py)+λ2​∑j=1dx𝔼px​py​|∂f​(x,y)∂xj|2+εηj+ρ2​𝔼px​py​f2​(x,y),subscript𝐿𝜀𝑓𝜂Δ𝑓subscript𝑝𝑥𝑦subscript𝑝𝑥subscript𝑝𝑦𝜆2superscriptsubscript𝑗1subscript𝑑𝑥subscript𝔼subscript𝑝𝑥subscript𝑝𝑦superscript𝑓𝑥𝑦subscript𝑥𝑗2𝜀subscript𝜂𝑗𝜌2subscript𝔼subscript𝑝𝑥subscript𝑝𝑦superscript𝑓2𝑥𝑦L_{\varepsilon}(f,\eta)=-\Delta(f,p_{xy},p_{x}p_{y})+\frac{\lambda}{2}\sum_{j=1}^{d_{x}}\frac{\mathbb{E}_{p_{x}p_{y}}\left|\frac{\partial f(x,y)}{\partial x_{j}}\right|^{2}+\varepsilon}{\eta_{j}}+\frac{\rho}{2}\mathbb{E}_{p_{x}p_{y}}f^{2}(x,y), and Δ​(f,px​y,px​py)=𝔼px​y​f​(x,y)−𝔼px​py​f​(x,y)Δ𝑓subscript𝑝𝑥𝑦subscript𝑝𝑥subscript𝑝𝑦subscript𝔼subscript𝑝𝑥𝑦𝑓𝑥𝑦subscript𝔼subscript𝑝𝑥subscript𝑝𝑦𝑓𝑥𝑦\Delta(f,p_{xy},p_{x}p_{y})=\mathbb{E}_{p_{xy}}{f}(x,y)-\mathbb{E}_{p_{x}p_{y}}f(x,y).Finally, SIC can be empirically estimated asSIC^(L1)2,ε​(px​y,px​py)=−inf{L^ε​(f,η):f∈ℱ,ηj,ηj>0,∑j=1dxηj=1}subscript^SICsuperscriptsubscript𝐿12𝜀subscript𝑝𝑥𝑦subscript𝑝𝑥subscript𝑝𝑦infimumconditional-setsubscript^𝐿𝜀𝑓𝜂formulae-sequence𝑓ℱsubscript𝜂𝑗formulae-sequencesubscript𝜂𝑗0superscriptsubscript𝑗1subscript𝑑𝑥subscript𝜂𝑗1\widehat{\text{SIC}}_{(L_{1})^{2},\varepsilon}(p_{xy},p_{x}p_{y})=-\inf\{\hat{L}_{\varepsilon}(f,\eta):f\in\mathscr{F},\eta_{j},\eta_{j}>0,\sum_{j=1}^{d_{x}}\eta_{j}=1\}where L^ε​(f,η)=−Δ^​(f,px​y,px​py)+λ2​∑j=1dx1N​∑i=1N|∂f​(xi,y~i)∂xj|2+εηj+ρ2​1N​∑i=1Nf2​(xi,y~i),subscript^𝐿𝜀𝑓𝜂^Δ𝑓subscript𝑝𝑥𝑦subscript𝑝𝑥subscript𝑝𝑦𝜆2superscriptsubscript𝑗1subscript𝑑𝑥1𝑁superscriptsubscript𝑖1𝑁superscript𝑓subscript𝑥𝑖subscript~𝑦𝑖subscript𝑥𝑗2𝜀subscript𝜂𝑗𝜌21𝑁superscriptsubscript𝑖1𝑁superscript𝑓2subscript𝑥𝑖subscript~𝑦𝑖\hat{L}_{\varepsilon}(f,\eta)=-\hat{\Delta}(f,p_{xy},p_{x}p_{y})+\frac{\lambda}{2}\sum_{j=1}^{d_{x}}\frac{\frac{1}{N}\sum_{i=1}^{N}\left|\frac{\partial f(x_{i},\tilde{y}_{i})}{\partial x_{j}}\right|^{2}+\varepsilon}{\eta_{j}}+\frac{\rho}{2}\frac{1}{N}\sum_{i=1}^{N}f^{2}(x_{i},\tilde{y}_{i}),and main the objective Δ^​(f,px​y,px​py)=1N​∑i=1Nf​(xi,yi)−1N​∑i=1Nf​(xi,y~i)^Δ𝑓subscript𝑝𝑥𝑦subscript𝑝𝑥subscript𝑝𝑦1𝑁superscriptsubscript𝑖1𝑁𝑓subscript𝑥𝑖subscript𝑦𝑖1𝑁superscriptsubscript𝑖1𝑁𝑓subscript𝑥𝑖subscript~𝑦𝑖\hat{\Delta}(f,p_{xy},p_{x}p_{y})=\frac{1}{N}\sum_{i=1}^{N}f(x_{i},y_{i})-\frac{1}{N}\sum_{i=1}^{N}f(x_{i},\tilde{y}_{i}).
18
+
19
+ We will now specify the function space ℱℱ\mathscr{F} in SIC and consider in this Section critics of the form:ℱ={f|f​(x,y)=⟨u,Φω​(x,y)⟩,∥u∥2≤γ},ℱconditional-set𝑓formulae-sequence𝑓𝑥𝑦𝑢subscriptΦ𝜔𝑥𝑦subscriptdelimited-∥∥𝑢2𝛾\mathscr{F}=\{f|f(x,y)=\left\langle{u},{\Phi_{\omega}(x,y)}\right\rangle,\left\lVert{u}\right\rVert_{2}\leq\gamma\},where Φω:X×Y→ℝm:subscriptΦ𝜔→XYsuperscriptℝm\Phi_{\omega}:\pazocal{X}\times\pazocal{Y}\to\mathbb{R}^{m} is a fixed finite dimensional feature map.We define the mean embeddings of the joint distribution px​ysubscript𝑝𝑥𝑦p_{xy} and product of marginals px​pysubscript𝑝𝑥subscript𝑝𝑦p_{x}p_{y} as follow:μ​(px​y)=𝔼px​y​[Φω​(x,y)],μ​(px​py)=𝔼px​py​[Φω​(x,y)]∈ℝm.formulae-sequence𝜇subscript𝑝𝑥𝑦subscript𝔼subscript𝑝𝑥𝑦delimited-[]subscriptΦ𝜔𝑥𝑦𝜇subscript𝑝𝑥subscript𝑝𝑦subscript𝔼subscript𝑝𝑥subscript𝑝𝑦delimited-[]subscriptΦ𝜔𝑥𝑦superscriptℝ𝑚\mu(p_{xy})=\mathbb{E}_{p_{xy}}[\Phi_{\omega}(x,y)],\leavevmode\nobreak\ \leavevmode\nobreak\ \mu(p_{x}p_{y})=\mathbb{E}_{p_{x}p_{y}}[\Phi_{\omega}(x,y)]\in\mathbb{R}^{m}.Define the covariance embedding of px​pysubscript𝑝𝑥subscript𝑝𝑦p_{x}p_{y} asC​(px​py)=𝔼px​py​[Φω​(x,y)⊗Φω​(x,y)]∈ℝm×m𝐶subscript𝑝𝑥subscript𝑝𝑦subscript𝔼subscript𝑝𝑥subscript𝑝𝑦delimited-[]tensor-productsubscriptΦ𝜔𝑥𝑦subscriptΦ𝜔𝑥𝑦superscriptℝ𝑚𝑚C(p_{x}p_{y})=\mathbb{E}_{p_{x}p_{y}}[\Phi_{\omega}(x,y)\otimes\Phi_{\omega}(x,y)]\in\mathbb{R}^{m\times m}and finally define the Gramian of derivatives embedding for coordinate j𝑗j asDj​(px​py)=𝔼px​py​[∂Φω​(x,y)∂xj⊗∂Φω​(x,y)∂xj]∈ℝm×m.subscript𝐷𝑗subscript𝑝𝑥subscript𝑝𝑦subscript𝔼subscript𝑝𝑥subscript𝑝𝑦delimited-[]tensor-productsubscriptΦ𝜔𝑥𝑦subscript𝑥𝑗subscriptΦ𝜔𝑥𝑦subscript𝑥𝑗superscriptℝ𝑚𝑚D_{j}(p_{x}p_{y})=\mathbb{E}_{p_{x}p_{y}}[\frac{\partial\Phi_{\omega}(x,y)}{\partial x_{j}}\otimes\frac{\partial\Phi_{\omega}(x,y)}{\partial x_{j}}]\in\mathbb{R}^{m\times m}.We can write the constraint ∥u∥2≤γsubscriptdelimited-∥∥𝑢2𝛾\left\lVert{u}\right\rVert_{2}\leq\gamma as the penalty term −τ​∥u∥2𝜏superscriptdelimited-∥∥𝑢2-\tau\left\lVert{u}\right\rVert^{2}.DefineLε​(u,η)=⟨u,μ​(px​py)−μ​(px​y)⟩+12​⟨u,(λ​∑j=1dxDj​(px​py)+εηj+ρ​C​(px​py)+τ​Im)​u⟩subscript𝐿𝜀𝑢𝜂𝑢𝜇subscript𝑝𝑥subscript𝑝𝑦𝜇subscript𝑝𝑥𝑦12𝑢𝜆superscriptsubscript𝑗1subscript𝑑𝑥subscript𝐷𝑗subscript𝑝𝑥subscript𝑝𝑦𝜀subscript𝜂𝑗𝜌𝐶subscript𝑝𝑥subscript𝑝𝑦𝜏subscript𝐼𝑚𝑢L_{\varepsilon}(u,\eta)=\left\langle{u},{\mu(p_{x}p_{y})-\mu(p_{xy})}\right\rangle+\frac{1}{2}\left\langle{u},{\left(\lambda\sum_{j=1}^{d_{x}}\frac{D_{j}(p_{x}p_{y})+\varepsilon}{\eta_{j}}+\rho C(p_{x}p_{y})+\tau I_{m}\right)u}\right\rangle.Observe that :SIC(L1)2,ε​(px​y,px​py)=−inf{Lε​(u,η):u∈ℝm,ηj,ηj>0,∑j=1dxηj=1}.subscriptSICsuperscriptsuperscript𝐿12𝜀subscript𝑝𝑥𝑦subscript𝑝𝑥subscript𝑝𝑦infimumconditional-setsubscript𝐿𝜀𝑢𝜂formulae-sequence𝑢superscriptℝ𝑚subscript𝜂𝑗formulae-sequencesubscript𝜂𝑗0superscriptsubscript𝑗1subscript𝑑𝑥subscript𝜂𝑗1\text{SIC}_{(L^{1})^{2},\varepsilon}(p_{xy},p_{x}p_{y})=-\inf\{L_{\varepsilon}(u,\eta):u\in\mathbb{R}^{m},\eta_{j},\eta_{j}>0,\sum_{j=1}^{d_{x}}\eta_{j}=1\}.We start by remarking that SIC is a form of gradient regularized maximum mean discrepancy [3].Previous MMD work comparing joint and product of marginals did not use the concept of nonlinear sparsity. For example the Hilbert-Schmidt Independence Criterion (HSIC) [2] uses Φω​(x,y)=ϕ​(x)⊗ψ​(y)subscriptΦ𝜔𝑥𝑦tensor-productitalic-ϕ𝑥𝜓𝑦\Phi_{\omega}(x,y)=\phi(x)\otimes\psi(y) with a constraint ‖u‖2≤1subscriptnorm𝑢21||u||_{2}\leq 1. CCA and related kernel measures of dependence [20, 21] use L22subscriptsuperscript𝐿22L^{2}_{2} constraints L22​(px)subscriptsuperscript𝐿22subscript𝑝𝑥L^{2}_{2}(p_{x}) and L22​(py)subscriptsuperscript𝐿22subscript𝑝𝑦L^{2}_{2}(p_{y}) on each function space separately.
20
+
21
+ Optimization Properties of Convex SICWe analyze in this Section the Optimization properties of SIC. Theorem 1 shows that the SIC(L1)2,εsubscriptSICsuperscriptsuperscript𝐿12𝜀\text{SIC}_{(L^{1})^{2},\varepsilon} loss function is jointly strictly convex in (u,η)𝑢𝜂(u,\eta) and hence admits a unique solution that solves a fixed point problem.
22
+
23
+ The following Theorem shows that a solution of the unperturbed SIC problem can be obtained from the smoothed SIC(L1)2,εsubscriptSICsuperscriptsubscript𝐿12𝜀\text{SIC}_{(L_{1})^{2},\varepsilon} in the limit ε→0→𝜀0\varepsilon\to 0:
24
+
25
+ Interpretability of SIC.The following corollary shows that SIC can be written in terms of the importance scores of the features, since at optimum the main objective is proportional to the constraint term.It is to the best of our knowledge the first dependency criterion that decomposes in the sum of contributions of each coordinate, and hence it is an interpretable dependency measure.Moreover, ηj∗subscriptsuperscript𝜂𝑗\eta^{*}_{j} are normalized importance scores of each feature j𝑗j, and their ranking can be used to assess feature importance.
26
+
27
+ Thanks to the joint convexity and the smoothness of the perturbed SIC, we can solve convex empirical SIC using alternating minimization on u𝑢u and η𝜂\eta or block coordinate descent using first order methods such as gradient descent on u𝑢u and mirror descent [22] on η𝜂\eta that are known to be globally convergent in this case (see Appendix A for more details).
28
+
29
+ While Convex SIC enjoys a lot of theoretical properties, a crucial short-coming is the need to choose a feature map ΦωsubscriptΦ𝜔\Phi_{\omega} that essentially goes back to the choice of a kernel in classical kernel methods.As an alternative, we propose to learn the feature map as a deep neural network. The architecture of the network can be problem dependent, but we focus here on a particular architecture: Deep ReLU Networks with biases removed. As we show below, using our sparsity inducing gradient penalties with such networks, results in input sparsity at the level of the witness function f𝑓f of SIC. This is desirable since it allows for an interpretable model, similar to the effect of Lasso with Linear models, our sparsity inducing gradient penalties result in a nonlinear self-explainable witness function f𝑓f [23], with explicit sparse dependency on the inputs.
30
+
31
+ Deep ReLU Networks with no biases, homogeneity and Input Sparsity via Gradient Penalties.We start by invoking the Euler Theorem for homogeneous functions:
32
+
33
+ Now consider deep ReLU networks with biases removed for any number of layers L𝐿L:ℱR​e​L​u={f|f​(x,y)=⟨u,Φω​(x)⟩, where ​Φω​(x,y)=σ​(WL​…​σ​(W2​σ​(W1​[x,y]))),u∈ℝm,Φω:ℝdx+dy→ℝm},subscriptℱ𝑅𝑒𝐿𝑢conditional-set𝑓:formulae-sequence𝑓𝑥𝑦𝑢subscriptΦ𝜔𝑥formulae-sequence where subscriptΦ𝜔𝑥𝑦𝜎subscript𝑊𝐿…𝜎subscript𝑊2𝜎subscript𝑊1𝑥𝑦𝑢superscriptℝ𝑚subscriptΦ𝜔→superscriptℝsubscript𝑑𝑥subscript𝑑𝑦superscriptℝ𝑚\mathscr{F}_{ReLu}=\{f|f(x,y)=\left\langle{u},{\Phi_{\omega}(x)}\right\rangle,\text{ where }\Phi_{\omega}(x,y)=\sigma(W_{L}\dots\sigma(W_{2}\sigma(W_{1}[x,y]))),u\in\mathbb{R}^{m},\Phi_{\omega}:\mathbb{R}^{d_{x}+d_{y}}\to\mathbb{R}^{m}\},where σ​(t)=max⁡(t,0),Wj𝜎𝑡𝑡0subscript𝑊𝑗\sigma(t)=\max(t,0),W_{j} are linear weights.Any f∈ℱR​e​L​U𝑓subscriptℱ𝑅𝑒𝐿𝑈f\in\mathscr{F}_{ReLU} is clearly homogeneous of degree 111. As an immediate consequence of Euler Theorem we then have: f​(x,y)=⟨∇xf​(x,y),x⟩+⟨∇yf​(x,y),y⟩𝑓𝑥𝑦subscript∇𝑥𝑓𝑥𝑦𝑥subscript∇𝑦𝑓𝑥𝑦𝑦f(x,y)=\left\langle{\nabla_{x}f(x,y)},{x}\right\rangle+\left\langle{\nabla_{y}f(x,y)},{y}\right\rangle. The first term is similar to a linear term in a linear model, the second term can be seen as a bias. Using our sparsity-inducing gradient penalties with such networks guarantees that on average on the support of a dominant measure the gradients with respect to x𝑥x are sparse. Intuitively, the gradients wrt x𝑥x act like the weight in linear models, and our sparsity inducing gradient penalty act like the ℓ1subscriptℓ1\ell_{1} regularization of Lasso. The main advantage compared to Lasso is that we have a highly nonlinear decision function, that has better capacity of capturing dependencies between X𝑋X and Y𝑌Y.
34
+
35
+ Non-convex SIC with Stochastic Block Coordinate Descent (BCD).We define the empirical non convex S​I​C(L1)2𝑆𝐼subscript𝐶superscriptsuperscript𝐿12SIC_{(L^{1})^{2}} using this function space ℱReLusubscriptℱReLu\mathscr{F}_{\text{ReLu}} as follows:SIC^(L1)2​(px​y,px​py)=−inf{L^​(fθ,η):fθ∈𝓕𝑹​𝒆​𝑳​𝑼,ηj,ηj>0,∑j=1dxηj=1},subscript^SICsuperscriptsuperscript𝐿12subscript𝑝𝑥𝑦subscript𝑝𝑥subscript𝑝𝑦infimumconditional-set^𝐿subscript𝑓𝜃𝜂formulae-sequencesubscript𝑓𝜃subscript𝓕𝑹𝒆𝑳𝑼subscript𝜂𝑗formulae-sequencesubscript𝜂𝑗0superscriptsubscript𝑗1subscript𝑑𝑥subscript𝜂𝑗1\displaystyle\widehat{\text{SIC}}_{(L^{1})^{2}}(p_{xy},p_{x}p_{y})=-\inf\{\hat{L}(f_{\theta},\eta):f_{\theta}\in\bm{\mathscr{F}_{ReLU}},\eta_{j},\eta_{j}>0,\sum_{j=1}^{d_{x}}\eta_{j}=1\},where θ=(v​e​c​(W1)​…​v​e​c​(WL),u)𝜃𝑣𝑒𝑐subscript𝑊1…𝑣𝑒𝑐subscript𝑊𝐿𝑢\theta=(vec(W_{1})\dots vec(W_{L}),u) are the network parameters.Algorithm 3 in Appendix B summarizes our stochastic BCD algorithm for training the Neural SIC.The algorithm consists of SGD updates to θ𝜃\theta and mirror descent updates to η𝜂\eta.
36
+
37
+ Boosted SIC. When training Neural SIC, we can obtain different critics fℓsubscript𝑓ℓf_{\ell} and importance scores ηℓsubscript𝜂ℓ\eta_{\ell}, by varying random seeds or hyper-parameters (architecture, batch size etc). Inspired by importance scores in random forest, we define Boosted SIC as the arithmetic mean or the geometric mean of ηℓsubscript𝜂ℓ\eta_{\ell}.
38
+
39
+ Controlling the False Discovery Rate (FDR) in Feature Selection is an important problem for reproducible discoveries.In a nutshell, for a feature selection problem given the ground-truth set of features SS\pazocal{S}, and a feature selection method such as SIC that gives a candidate set S^^𝑆\hat{S}, our goal is to maximize the TPR (True Positive Rate) or the power, and to keep the False Discovery Rate (FDR) under Control. TPR and FDR are defined as follows:TPR≔𝔼​[#​{i:i∈S^∩S}#​{i:i∈S}]FDR≔𝔼​[#​{i:i∈S^\S}#​{i:i∈S^}].formulae-sequence≔TPR𝔼delimited-[]#conditional-set𝑖𝑖^𝑆S#conditional-set𝑖𝑖S≔FDR𝔼delimited-[]#conditional-set𝑖𝑖\^𝑆S#conditional-set𝑖𝑖^𝑆\text{TPR}\coloneqq\mathbb{E}\left[\frac{\#\{i:i\in\hat{S}\cap\pazocal{S}\}}{\#\{i:i\in\pazocal{S}\}}\right]\leavevmode\nobreak\ \leavevmode\nobreak\ \text{FDR}\coloneqq\mathbb{E}\left[\frac{\#\{i:i\in\hat{{S}}\backslash\pazocal{S}\}}{\#\{i:i\in\hat{{S}}\}}\right].(1)
40
+
41
+ We explore in this paper two methods that provably control the FDR: 1) The Holdout Randomization Test (HRT) introduced in [8], that we specialize for SIC in Algorithm 4;2) Knockoffs introduced in [9] that can be used with any basic feature selection method such as Neural SIC, and guarantees provable FDR control.
42
+
43
+ HRT-SIC. We are interested in measuring the conditional dependency between a feature xjsubscript𝑥𝑗x_{j} and the response variable y𝑦y conditionally on the other features noted x−jsubscript𝑥𝑗x_{-j}. Hence we have the following null hypothesis:H0:xj⊧y|x−j⇔px​y=pxj|x−j​py|x−j​px−j:subscript𝐻0modelssubscript𝑥𝑗conditional𝑦subscript𝑥𝑗iffsubscript𝑝𝑥𝑦subscript𝑝conditionalsubscript𝑥𝑗subscript𝑥𝑗subscript𝑝conditional𝑦subscript𝑥𝑗subscript𝑝subscript𝑥𝑗H_{0}:x_{j}\raisebox{0.50003pt}{\rotatebox[origin={c}]{90.0}{$\models$}}y\leavevmode\nobreak\ |x_{-j}\iff p_{xy}=p_{x_{j}|x_{-j}}p_{y|x_{-j}}p_{x_{-j}}.In order to simulate the null hypothesis, we propose to use generative models for sampling from xj|x−jconditionalsubscript𝑥𝑗subscript𝑥𝑗x_{j}|x_{-j} (See Appendix D).The principle in HRT [8] that we specify here for SIC in Algorithm 4 (given in Appendix B) is the following: instead of refitting SIC under H0subscript𝐻0H_{0}, we evaluate the mean of the witness function of SIC on a holdout set sampled under H0subscript𝐻0H_{0} (using conditional generators for R𝑅R rounds). The deviation of the mean of the witness function under H0subscript𝐻0H_{0} from its mean on a holdout from the real distribution gives us p𝑝p-values. We use the Benjamini-Hochberg [24] procedure on those p𝑝p-values to achieve a target FDR. We apply HRT-SIC on a shortlist of pre-selected features per their ranking of ηjsubscript𝜂𝑗\eta_{j}.
44
+
45
+ Knockoffs-SIC. Knockoffs [25] work by finding control variables called knockoffs x~~𝑥\tilde{x} that mimic the behavior of the real features x𝑥x and provably control the FDR [9]. We use here Gaussian knockoffs [9] and train SIC on the concatenation of [x,x~]𝑥~𝑥[x,\tilde{x}], i.e we train S​I​C​([X;X~],Y)𝑆𝐼𝐶𝑋~𝑋𝑌SIC([X;\tilde{X}],Y) and obtain η𝜂\eta that has now twice the dimension dxsubscript𝑑𝑥d_{x}, i.e for each real feature j𝑗j, there is the real importance score ηjsubscript𝜂𝑗\eta_{j} and the knockoff importance score ηj+dxsubscript𝜂𝑗subscript𝑑𝑥\eta_{j+d_{x}}. knockoffs-SIC consists in using the statistics Wj=ηj−ηj+dxsubscript𝑊𝑗subscript𝜂𝑗subscript𝜂𝑗subscript𝑑𝑥W_{j}=\eta_{j}-\eta_{j+d_{x}} and the knockoff filter [9] to select features based on the sign of Wjsubscript𝑊𝑗W_{j} (See Alg. 5 in Appendix).
46
+
47
+ Kernel/Neural Measure of Dependencies. As discussed earlier SIC can be seen as a sparse gradient regularized MMD [3, 7] and relates to the Sobolev Discrepancy of [5, 6]. Feature selection with MMD was introduced in [10] and is based on backward elimination of features by recomputing MMD on the ablated vectors. SIC has the advantage of fitting one critic that has interpretable feature scores. Related to the MMD is the Hilbert Schmidt Independence Criterion (HSIC) and other variants of kernel dependency measures introduced in [2, 21].None of those criteria has a nonparametric sparsity constraint on its witness function that allows for explainability and feature selection. Other Neural measures of dependencies such as MINE [26] estimate the KL divergence using neural networks, or that of [27] that estimates a proxy to the Wasserstein distance using Neural Networks.
48
+
49
+ Interpretability, Sparsity, Saliency and Sensitivity Analysis.Lasso and elastic net [28] are interpretable linear models that exploit sparsity, but are limited to linear relationships. Random forests [29] have a heuristic for determining feature importance and are successful in practice as they can capture nonlinear relationships similar to SIC. We believe SIC can potentially leverage the deep learning toolkit for going beyond tabular data where random forests excel, to more structured data such as time series or graph data. Finally, SIC relates to saliency based post-hoc interpretation of deep models such as [30, 31, 32]. While those method use the gradient information for a post-hoc analysis, SIC incorporates this information to guide the learning towards the important features. As discussed in Section 2.1 many recent works introduce deep networks with input sparsity control through a learned gate or a penalty on the weights of the network [11, 12, 13]. SIC exploits a stronger notion of sparsity that leverages the relationship between the different covariates.
50
+
51
+ Synthetic Data Validation. We first validate our methods and compare them to baseline models in simulation studies on synthetic datasets where the ground truth is available by construction.For this we generate the data according to a model y=f​(x)+ϵ𝑦𝑓𝑥italic-ϵy=f(x)+\epsilon where the model f​(⋅)𝑓⋅f(\cdot) and the noise ϵitalic-ϵ\epsilon define the specific synthetic dataset (see Appendix F.1).In particular, the value of y𝑦y only depends on a subset of features xisubscript𝑥𝑖x_{i}, i=1,…,p𝑖1…𝑝i=1,\ldots,p through f​(⋅)𝑓⋅f(\cdot), and performance is quantified in terms of TPR and FDR in discovering them among the irrelevant features.We experiment with two datasets:A) Complex multivariate synthetic data (SinExp), which is generated from a complex multivariate model proposed in [33] Sec 5.3, where 6 ground truth features xisubscript𝑥𝑖x_{i} out of 50 generate the output y𝑦y through a non-linearity involving the product and composition of the cos\cos, sin\sin and exp\exp functions (see Appendix F.1).We therefore dub this dataset SinExp.To increase the difficulty even further, we introduce a pairwise correlation between all features of 0.5.In Fig. 1 we show results for datasets of 125 and 500 samples repeated 100 times comparing performance of our models with the one of two baselines: Elastic Net (EN) and Random Forest (RF).B) Liang Dataset.We show results on the benchmark dataset proposed by [34], specifically the generalized Liang dataset matching most of the setup from [8] Sec 5.1.We provide dataset details and results in Appendix F.1 (Results in Figure 2).
52
+
53
+ Feature Selection on Drug Response dataset.We consider as a real-world application the Cancer Cell Line Encyclopedia (CCLE) dataset [36],described in Appendix F.2.We study the result of using the normalized importance scores ηjsubscript𝜂𝑗\eta_{j} from SIC for (heuristic) feature selection, against features selected by Elastic Net.Table 1 shows the heldout MSE of a predictor trained on selected features, averaged over 100 runs (each run: new randomized 90%/10% data split, NN initialization).The goal here is to quantify the predictiveness of features selected by SIC on its own, without the full randomized testing machinery.The SIC critic and regressor NN were respectively the b​i​g​_​c​r​i​t​i​c𝑏𝑖𝑔_𝑐𝑟𝑖𝑡𝑖𝑐big\_critic and r​e​g​r​e​s​s​o​r​_​N​N𝑟𝑒𝑔𝑟𝑒𝑠𝑠𝑜𝑟_𝑁𝑁regressor\_NN described with training details in Appendix F.3, while the random forest is trained with default hyper parameters from scikit-learn [37]. We can see that, with just ηjsubscript𝜂𝑗\eta_{j}, informative features are selected for the downstream regression task, with performance comparable to those selected by ElasticNet, which was trained explicitly for this task. The features selected with high ηjsubscript𝜂𝑗\eta_{j} values and their overlap with the features selected by ElasticNet are listed in Appendix F.2 Table 3.
54
+
55
+ HIV-1 Drug Resistance with Knockoffs-SIC.The second real-world dataset that we analyze is the HIV-1 Drug Resistance[38], which consists in detecting mutations associated with resistance to a drug type. For our experiments we use all the three classes of drugs: Protease Inhibitors (PIs), Nucleoside Reverse Transcriptase Inhibitors (NRTIs), and Non-nucleoside Reverse Transcriptase Inhibitors (NNRTIs). We use the pre-processing of each dataset (<drug-class, drug-type>) of the knockoff tutorial [39] made available by the authors. Concretely, we construct a dataset (X,X~)𝑋~𝑋(X,\tilde{X}) of the concatenation of the real data and Gaussian knockoffs [9], and fit S​I​C​([X,X~],Y)𝑆𝐼𝐶𝑋~𝑋𝑌SIC([X,\tilde{X}],Y). As explained in Section 6, we use in the knockoff filter the statistics Wj=ηj−ηj+dxsubscript𝑊𝑗subscript𝜂𝑗subscript𝜂𝑗subscript𝑑𝑥W_{j}=\eta_{j}-\eta_{j+d_{x}}, i.e. the difference of SIC importance scores between each feature and its corresponding knockoff. For SIC experiments, we use s​m​a​l​l​_​c​r​i​t​i​c𝑠𝑚𝑎𝑙𝑙_𝑐𝑟𝑖𝑡𝑖𝑐small\_critic architecture (See Appendix F.3 for training details).We use Boosted SIC, by varying the batch sizes in N∈{10,30,50}𝑁103050N\in\{10,30,50\}, and computing the geometric mean of η𝜂\eta produced by those three setups as the feature importance needed for Knockoffs. Results are summarized in Table 2.
56
+
57
+ We introduced in this paper the Sobolev Independence Criterion (SIC), a dependency measure that gives rise to feature importance which can be used for feature selection and interpretable decision making.We laid down the theoretical foundations of SIC and showed how it can be used in conjunction with the Holdout Randomization Test and Knockoffs to control the FDR, enabling reliable discoveries. We demonstrated the merits of SIC for feature selection in extensive synthetic and real-world experiments with controlled FDR.
1910.14238v1.txt ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Learning representations that reflect users’ preference, based chiefly on user behavior, has been a central theme of research on recommender systems. Despite their notable success, the existing user behavior-based representation learning methods, such as the recent deep approaches [49, 32, 31, 52, 11, 18], generally neglect the complex interaction among the latent factors behind the users’ decision making processes.In particular, the latent factors can be highly entangled, and range from macro ones that govern the intention of a user during a session, to micro ones that describe at a granular level a user’s preference when implementing a specific intention.The existing methods fail to disentangle the latent factors, and the learned representations are consequently prone to mistakenly preserve the confounding of the factors, leading to non-robustness and low interpretability.
2
+
3
+ Disentangled representation learning, which aims to learn factorized representations that uncover and disentangle the latent explanatory factors hidden in the observed data [3], has recently gained much attention.Not only can disentangled representations be more robust, i.e., less sensitive to the misleading correlations presented in the limited training data, the enhanced interpretability also finds direct application in recommendation-related tasks, such as transparent advertising [33], customer-relationship management, and explainable recommendation [51, 17].Moreover, the controllability exhibited by many disentangled representations [19, 14, 10, 8, 9, 25] can potentially bring a new paradigm for recommendation, by giving users explicit control over the recommendation results and providing a more interactive experience.However, the existing efforts on disentangled representation learning are mainly from the field of computer vision [28, 15, 20, 30, 53, 14, 10, 39, 19].
4
+
5
+ Learning disentangled representations based on user behavior data, a kind of discrete relational data that is fundamentally different from the well-researched image data, is challenging and largely unexplored.Specifically, it poses two challenges.First, the co-existence of macro and micro factors requires us to to separate the two levels when performing disentanglement, in a way that preserves the hierarchical relationships between an intention and the preference about the intention.Second, the observed user behavior data, e.g., user-item interactions, are discrete and sparse in nature, while the learned representations are continuous.This implies that the majority of the points in the high-dimensional representation space will not be associated with any behavior, which is especially problematic when one attempts to investigate the interpretability of an isolated dimension by varying the value of the dimension while keeping the other dimensions fixed.
6
+
7
+ In this paper, we propose the MACRo-mIcro Disentangled Variational Auto-Encoder (MacridVAE) for learning disentangled representations based on user behavior.Our approach explicitly models the separation of macro and micro factors, and performs disentanglement at each level.Macro disentanglement is achieved by identifying the high-level concepts associated with user intentions, and separately learning the preference of a user regarding the different concepts.A regularizer for micro disentanglement, derived by interpreting VAEs [27, 44] from an information-theoretic perspective, is then strengthened so as to force each individual dimension to reflect an independent micro factor.A beam-search strategy, which handles the conflict between sparse discrete observations and dense continuous representations by finding a smooth trajectory, is then proposed for investigating the interpretability of each isolated dimension.Empirical results show that our approach can achieve substantial improvement over the state-of-the-art baselines.And the learned disentangled representations are demonstrated to be interpretable and controllable.
8
+
9
+ In this section, we present our approach for learning disentangled representations from user behaivor.
10
+
11
+ A user behavior dataset 𝒟𝒟\mathcal{D} consists of the interactions between N𝑁N users and M𝑀M items.The interaction between the uthsuperscript𝑢thu^{\mathrm{th}} user and the ithsuperscript𝑖thi^{\mathrm{th}} item is denoted by xu,i∈{0,1}subscript𝑥𝑢𝑖01x_{u,i}\in\{0,1\}, where xu,i=1subscript𝑥𝑢𝑖1x_{u,i}=1 indicates that user u𝑢u explicitly adopts item i𝑖i, whereas xu,i=0subscript𝑥𝑢𝑖0x_{u,i}=0 means there is no recorded interaction between the two.For convenience, we use 𝐱u={xu,i:xu,i=1}subscript𝐱𝑢conditional-setsubscript𝑥𝑢𝑖subscript𝑥𝑢𝑖1\mathbf{x}_{u}=\{x_{u,i}:x_{u,i}=1\} to represent the items adopted by user u𝑢u.The goal is to learn user representations {𝐳u}u=1Nsuperscriptsubscriptsubscript𝐳𝑢𝑢1𝑁\{\mathbf{z}_{u}\}_{u=1}^{N} that achieves both macro and micro disentanglement.We use 𝜽𝜽{\boldsymbol{\theta}} to denote the set that contains all the trainable parameters of our model.
12
+
13
+ Users may have very diverse interests, and interact with items that belong to many high-level concepts, e.g., product categories.We aim to achieve macro disentanglement, by learning a factorized representation of user u𝑢u, namely 𝐳u=[𝐳u(1);𝐳u(2);…;𝐳u(K)]∈ℝd′subscript𝐳𝑢superscriptsubscript𝐳𝑢1superscriptsubscript𝐳𝑢2…superscriptsubscript𝐳𝑢𝐾superscriptℝsuperscript𝑑′\mathbf{z}_{u}=[\mathbf{z}_{u}^{(1)};\mathbf{z}_{u}^{(2)};\ldots;\mathbf{z}_{u}^{(K)}]\in\mathbb{R}^{d^{\prime}}, where d′=K​dsuperscript𝑑′𝐾𝑑d^{\prime}=Kd, assuming that there are K𝐾K high-level concepts.The kthsuperscript𝑘thk^{\mathrm{th}} component 𝐳u(k)∈ℝdsuperscriptsubscript𝐳𝑢𝑘superscriptℝ𝑑\mathbf{z}_{u}^{(k)}\in\mathbb{R}^{d} is for capturing the user’s preference regarding the kthsuperscript𝑘thk^{\mathrm{th}} concept.Additionally, we infer a set of one-hot vectors 𝐂={𝐜i}i=1M𝐂superscriptsubscriptsubscript𝐜𝑖𝑖1𝑀\mathbf{C}=\{\mathbf{c}_{i}\}_{i=1}^{M} for the items, where 𝐜i=[ci,1;ci,2;…;ci,K]subscript𝐜𝑖subscript𝑐𝑖1subscript𝑐𝑖2…subscript𝑐𝑖𝐾\mathbf{c}_{i}=[c_{i,1};c_{i,2};\ldots;c_{i,K}].If item i𝑖i belongs to concept k𝑘k, then ci,k=1subscript𝑐𝑖𝑘1c_{i,k}=1 and ci,k′=0subscript𝑐𝑖superscript𝑘′0c_{i,k^{\prime}}=0 for any k′≠ksuperscript𝑘′𝑘k^{\prime}\neq k.We jointly infer {𝐳u}u=1Nsuperscriptsubscriptsubscript𝐳𝑢𝑢1𝑁\{\mathbf{z}_{u}\}_{u=1}^{N} and 𝐂𝐂\mathbf{C} unsupervisedly.
14
+
15
+ High-level concepts correspond to the intentions of a user, e.g., to buy clothes or a cellphone.We are also interested in disentangling a user’s preference at a more granular level regarding the various aspects of an item.For example, we would like the different dimensions of 𝐳u(k)superscriptsubscript𝐳𝑢𝑘\mathbf{z}_{u}^{(k)} to individually capture the user’s preferred sizes, colors, etc., if concept k𝑘k is clothing.
16
+
17
+ We start by proposing a generative model that encourages macro disentanglement.For a user u𝑢u, our generative model assumes that the observed data are generated from the following distribution:p𝜽​(𝐱u)=𝔼p𝜽​(𝐂)​[∫p𝜽​(𝐱u∣𝐳u,𝐂)​p𝜽​(𝐳u)​𝑑𝐳u],subscript𝑝𝜽subscript𝐱𝑢subscript𝔼subscript𝑝𝜽𝐂delimited-[]subscript𝑝𝜽conditionalsubscript𝐱𝑢subscript𝐳𝑢𝐂subscript𝑝𝜽subscript𝐳𝑢differential-dsubscript𝐳𝑢\displaystyle p_{\boldsymbol{\theta}}(\mathbf{x}_{u})=\mathbb{E}_{p_{\boldsymbol{\theta}}(\mathbf{C})}\left[\int p_{\boldsymbol{\theta}}\left(\mathbf{x}_{u}\mid\mathbf{z}_{u},\mathbf{C}\right)p_{\boldsymbol{\theta}}(\mathbf{z}_{u})\;d\mathbf{z}_{u}\right],(1)p𝜽​(𝐱u∣𝐳u,𝐂)=∏xu,i∈𝐱up𝜽​(xu,i∣𝐳u,𝐂).subscript𝑝𝜽conditionalsubscript𝐱𝑢subscript𝐳𝑢𝐂subscriptproductsubscript𝑥𝑢𝑖subscript𝐱𝑢subscript𝑝𝜽conditionalsubscript𝑥𝑢𝑖subscript𝐳𝑢𝐂\displaystyle p_{\boldsymbol{\theta}}\left(\mathbf{x}_{u}\mid\mathbf{z}_{u},\mathbf{C}\right)=\prod_{x_{u,i}\in\mathbf{x}_{u}}p_{\boldsymbol{\theta}}(x_{u,i}\mid\mathbf{z}_{u},\mathbf{C}).(2)The meanings of 𝐱u,𝐳u,𝐂subscript𝐱𝑢subscript𝐳𝑢𝐂\mathbf{x}_{u},\mathbf{z}_{u},\mathbf{C} are described in the previous subsection.We have assumed p𝜽​(𝐳u)=p𝜽​(𝐳u∣𝐂)subscript𝑝𝜽subscript𝐳𝑢subscript𝑝𝜽conditionalsubscript𝐳𝑢𝐂p_{\boldsymbol{\theta}}(\mathbf{z}_{u})=p_{\boldsymbol{\theta}}(\mathbf{z}_{u}\mid\mathbf{C}) in the first equation, i.e., 𝐳usubscript𝐳𝑢\mathbf{z}_{u} and 𝐂𝐂\mathbf{C} are generated by two independent sources.Note that 𝐜i=[ci,1;ci,2;…;ci,K]subscript𝐜𝑖subscript𝑐𝑖1subscript𝑐𝑖2…subscript𝑐𝑖𝐾\mathbf{c}_{i}=[c_{i,1};c_{i,2};\ldots;c_{i,K}] is one-hot, since we assume that item i𝑖i belongs to exactly one concept.Andp𝜽​(xu,i∣𝐳u,𝐂)=Zu−1⋅∑k=1Kci,k⋅g𝜽(i)​(𝐳u(k))subscript𝑝𝜽conditionalsubscript𝑥𝑢𝑖subscript𝐳𝑢𝐂⋅superscriptsubscript𝑍𝑢1superscriptsubscript𝑘1𝐾⋅subscript𝑐𝑖𝑘superscriptsubscript𝑔𝜽𝑖superscriptsubscript𝐳𝑢𝑘p_{\boldsymbol{\theta}}(x_{u,i}\mid\mathbf{z}_{u},\mathbf{C})=Z_{u}^{-1}\cdot\sum_{k=1}^{K}c_{i,k}\cdot g_{\boldsymbol{\theta}}^{(i)}(\mathbf{z}_{u}^{(k)})is a categorical distribution over the M𝑀M items, whereZu=∑i=1M∑k=1Kci,k⋅g𝜽(i)​(𝐳u(k))subscript𝑍𝑢superscriptsubscript𝑖1𝑀superscriptsubscript𝑘1𝐾⋅subscript𝑐𝑖𝑘superscriptsubscript𝑔𝜽𝑖superscriptsubscript𝐳𝑢𝑘Z_{u}=\sum_{i=1}^{M}\sum_{k=1}^{K}c_{i,k}\cdot g_{\boldsymbol{\theta}}^{(i)}(\mathbf{z}_{u}^{(k)})and g𝜽(i):ℝd→ℝ+:superscriptsubscript𝑔𝜽𝑖→superscriptℝ𝑑subscriptℝg_{\boldsymbol{\theta}}^{(i)}:\mathbb{R}^{d}\to\mathbb{R}_{+} is a shallow neural network that estimates how much a user with a given preference is interested in item i𝑖i.We use sampeld softmax [23] to estimate Zusubscript𝑍𝑢Z_{u} based on a few sampled items when M𝑀M is very large.
18
+
19
+ We assume above that the user representation 𝐳usubscript𝐳𝑢\mathbf{z}_{u} is sufficient for predicting how the user will interact with the items.And we further assume that using the kthsuperscript𝑘thk^{\mathrm{th}} component 𝐳u(k)superscriptsubscript𝐳𝑢𝑘\mathbf{z}_{u}^{(k)} alone is already sufficient if the prediction is about an item from concept k𝑘k.This design explicitly encourages 𝐳u(k)superscriptsubscript𝐳𝑢𝑘\mathbf{z}_{u}^{(k)} to capture preference regarding only the kthsuperscript𝑘thk^{\mathrm{th}} concept, as long as the inferred concept assignment matrix 𝐂𝐂\mathbf{C} is meaningful.We will describe later the implementation details of p𝜽​(𝐂)subscript𝑝𝜽𝐂p_{\boldsymbol{\theta}}(\mathbf{C}), p𝜽​(𝐳u)subscript𝑝𝜽subscript𝐳𝑢p_{\boldsymbol{\theta}}(\mathbf{z}_{u}) and g𝜽(i)​(𝐳u(k))superscriptsubscript𝑔𝜽𝑖superscriptsubscript𝐳𝑢𝑘g_{\boldsymbol{\theta}}^{(i)}(\mathbf{z}_{u}^{(k)}).Nevertheless, we note that p𝜽​(𝐂)subscript𝑝𝜽𝐂p_{\boldsymbol{\theta}}(\mathbf{C}) requires careful design to prevent mode collapse, i.e., the degenerate case where almost all items are assigned to a single concept.
20
+
21
+ We follow the variational auto-encoder (VAE) paradigm [27, 44], and optimize 𝜽𝜽\boldsymbol{\theta} by maximizing a lower bound of ∑uln⁡p𝜽​(𝐱u)subscript𝑢subscript𝑝𝜽subscript𝐱𝑢\sum_{u}\ln p_{\boldsymbol{\theta}}(\mathbf{x}_{u}), whereln⁡p𝜽​(𝐱u)subscript𝑝𝜽subscript𝐱𝑢\ln p_{\boldsymbol{\theta}}(\mathbf{x}_{u}) is bounded as follows:ln⁡p𝜽​(𝐱u)≥𝔼p𝜽​(𝐂)​[𝔼q𝜽​(𝐳u∣𝐱u,𝐂)​[ln⁡p𝜽​(𝐱u∣𝐳u,𝐂)]−DKL​(q𝜽​(𝐳u∣𝐱u,𝐂)∥p𝜽​(𝐳u))].subscript𝑝𝜽subscript𝐱𝑢subscript𝔼subscript𝑝𝜽𝐂delimited-[]subscript𝔼subscript𝑞𝜽conditionalsubscript𝐳𝑢subscript𝐱𝑢𝐂delimited-[]subscript𝑝𝜽conditionalsubscript𝐱𝑢subscript𝐳𝑢𝐂subscript𝐷KLconditionalsubscript𝑞𝜽conditionalsubscript𝐳𝑢subscript𝐱𝑢𝐂subscript𝑝𝜽subscript𝐳𝑢\displaystyle\ln p_{\boldsymbol{\theta}}(\mathbf{x}_{u})\geq\mathbb{E}_{p_{\boldsymbol{\theta}}(\mathbf{C})}\left[\mathbb{E}_{q_{\boldsymbol{\theta}}(\mathbf{z}_{u}\mid\mathbf{x}_{u},\mathbf{C})}[\ln p_{\boldsymbol{\theta}}(\mathbf{x}_{u}\mid\mathbf{z}_{u},\mathbf{C})]-D_{\mathrm{KL}}(q_{\boldsymbol{\theta}}(\mathbf{z}_{u}\mid\mathbf{x}_{u},\mathbf{C})\|p_{\boldsymbol{\theta}}(\mathbf{z}_{u}))\right].(3)See the supplementary material for the derivation of the lower bound.Here we have introduced a variational distribution q𝜽​(𝐳u∣𝐱u,𝐂)subscript𝑞𝜽conditionalsubscript𝐳𝑢subscript𝐱𝑢𝐂q_{\boldsymbol{\theta}}(\mathbf{z}_{u}\mid\mathbf{x}_{u},\mathbf{C}), whose implementation also encourages macro disentanglement and will be presented later.The two expectations, i.e., 𝔼p𝜽​(𝐂)​[⋅]subscript𝔼subscript𝑝𝜽𝐂delimited-[]⋅\mathbb{E}_{p_{\boldsymbol{\theta}}(\mathbf{C})}[\cdot] and 𝔼q𝜽​(𝐳u∣𝐱u,𝐂)​[⋅]subscript𝔼subscript𝑞𝜽conditionalsubscript𝐳𝑢subscript𝐱𝑢𝐂delimited-[]⋅\mathbb{E}_{q_{\boldsymbol{\theta}}(\mathbf{z}_{u}\mid\mathbf{x}_{u},\mathbf{C})}[\cdot], are intractable, and are therefore estimated using the Gumbel-Softmax trick [22, 41] and the Gaussian re-parameterization trick [27], respectively.Once the training procedure is finished,we use the mode of p𝜽​(𝐂)subscript𝑝𝜽𝐂p_{\boldsymbol{\theta}}(\mathbf{C}) as 𝐂𝐂\mathbf{C}, and the mode of q𝜽​(𝐳u∣𝐱u,𝐂)subscript𝑞𝜽conditionalsubscript𝐳𝑢subscript𝐱𝑢𝐂q_{\boldsymbol{\theta}}(\mathbf{z}_{u}\mid\mathbf{x}_{u},\mathbf{C}) as the representation of user u𝑢u.
22
+
23
+ A natural strategy to encourage micro disentanglement is to force statistical independence between the dimensions, i.e., to forceq𝜽​(𝐳u(k)∣𝐂)≈∏j=1dq𝜽​(zu,j(k)∣𝐂)subscript𝑞𝜽conditionalsuperscriptsubscript𝐳𝑢𝑘𝐂superscriptsubscriptproduct𝑗1𝑑subscript𝑞𝜽conditionalsuperscriptsubscript𝑧𝑢𝑗𝑘𝐂q_{\boldsymbol{\theta}}(\mathbf{z}_{u}^{(k)}\mid\mathbf{C})\approx\prod_{j=1}^{d}q_{\boldsymbol{\theta}}(z_{u,j}^{(k)}\mid\mathbf{C}), so that each dimension describes an isolated factor.Here q𝜽​(𝐳u∣𝐂)=∫q𝜽​(𝐳u∣𝐱u,𝐂)​pdata​(𝐱u)​𝑑𝐱usubscript𝑞𝜽conditionalsubscript𝐳𝑢𝐂subscript𝑞𝜽conditionalsubscript𝐳𝑢subscript𝐱𝑢𝐂subscript𝑝datasubscript𝐱𝑢differential-dsubscript𝐱𝑢q_{\boldsymbol{\theta}}(\mathbf{z}_{u}\mid\mathbf{C})=\int q_{\boldsymbol{\theta}}(\mathbf{z}_{u}\mid\mathbf{x}_{u},\mathbf{C})p_{\mathrm{data}}(\mathbf{x}_{u})\;d\mathbf{x}_{u}.Fortunately, the Kullback–Leibler (KL) divergence term in the lower bound above does provide a way to encourage independence.Specifically, the KL term of our model can be rewritten as:𝔼pdata​(𝐱u)​[DKL��(q𝜽​(𝐳u∣𝐱u,𝐂)∥p𝜽​(𝐳u))]=Iq​(𝐱u;𝐳u)+DKL​(q𝜽​(𝐳u∣𝐂)∥p𝜽​(𝐳u)).subscript𝔼subscript𝑝datasubscript𝐱𝑢delimited-[]subscript𝐷KLconditionalsubscript𝑞𝜽conditionalsubscript𝐳𝑢subscript𝐱𝑢𝐂subscript𝑝𝜽subscript𝐳𝑢subscript𝐼𝑞subscript𝐱𝑢subscript𝐳𝑢subscript𝐷KLconditionalsubscript𝑞𝜽conditionalsubscript𝐳𝑢𝐂subscript𝑝𝜽subscript𝐳𝑢\displaystyle\mathbb{E}_{p_{\mathrm{data}}(\mathbf{x}_{u})}\left[D_{\mathrm{KL}}(q_{\boldsymbol{\theta}}(\mathbf{z}_{u}\mid\mathbf{x}_{u},\mathbf{C})\|p_{\boldsymbol{\theta}}(\mathbf{z}_{u}))\right]=I_{q}(\mathbf{x}_{u};\mathbf{z}_{u})+D_{\mathrm{KL}}(q_{\boldsymbol{\theta}}(\mathbf{z}_{u}\mid\mathbf{C})\|p_{\boldsymbol{\theta}}(\mathbf{z}_{u})).(4)See the supplementary material for the proof.Similar decomposition of the KL term has been noted for the original VAEs previously [1, 25, 9].Penalizing the latter KL term would encourage independence between the dimensions, if we choose a prior that satisfies p𝜽​(𝐳u)=∏j=1d′p𝜽​(zu,j)subscript𝑝𝜽subscript𝐳𝑢superscriptsubscriptproduct𝑗1superscript𝑑′subscript𝑝𝜽subscript𝑧𝑢𝑗p_{\boldsymbol{\theta}}(\mathbf{z}_{u})=\prod_{j=1}^{d^{\prime}}p_{\boldsymbol{\theta}}(z_{u,j}).On the other hand, the former term Iq​(𝐱u;𝐳u)subscript𝐼𝑞subscript𝐱𝑢subscript𝐳𝑢I_{q}(\mathbf{x}_{u};\mathbf{z}_{u}) is the mutual information between 𝐱usubscript𝐱𝑢\mathbf{x}_{u} and 𝐳usubscript𝐳𝑢\mathbf{z}_{u} under q𝜽​(𝐳u∣𝐱u,𝐂)⋅pdata​(𝐱u)⋅subscript𝑞𝜽conditionalsubscript𝐳𝑢subscript𝐱𝑢𝐂subscript𝑝datasubscript𝐱𝑢q_{\boldsymbol{\theta}}(\mathbf{z}_{u}\mid\mathbf{x}_{u},\mathbf{C})\cdot p_{\mathrm{data}}(\mathbf{x}_{u}).Penalizing Iq​(𝐱u;𝐳u)subscript𝐼𝑞subscript𝐱𝑢subscript𝐳𝑢I_{q}(\mathbf{x}_{u};\mathbf{z}_{u}) is equivalent to applying the information bottleneck principle [47, 2], which encourages 𝐳usubscript𝐳𝑢\mathbf{z}_{u} to ignore as much noise in the input as it can and to focus on merely the essential information.We therefore follow β𝛽\beta-VAE [19], and strengthen these two regularization terms by a factor of β≫1much-greater-than𝛽1\beta\gg 1, which brings us to the following training objective:𝔼p𝜽​(𝐂)​[𝔼q𝜽​(𝐳u∣𝐱u,𝐂)​[ln⁡p𝜽​(𝐱u∣𝐳u,𝐂)]−β⋅DKL​(q𝜽​(𝐳u∣𝐱u,𝐂)∥p𝜽​(𝐳u))].subscript𝔼subscript𝑝𝜽𝐂delimited-[]subscript𝔼subscript𝑞𝜽conditionalsubscript𝐳𝑢subscript𝐱𝑢𝐂delimited-[]subscript𝑝𝜽conditionalsubscript𝐱𝑢subscript𝐳𝑢𝐂⋅𝛽subscript𝐷KLconditionalsubscript𝑞𝜽conditionalsubscript𝐳𝑢subscript𝐱𝑢𝐂subscript𝑝𝜽subscript𝐳𝑢\displaystyle\mathbb{E}_{p_{\boldsymbol{\theta}}(\mathbf{C})}\left[\mathbb{E}_{q_{\boldsymbol{\theta}}(\mathbf{z}_{u}\mid\mathbf{x}_{u},\mathbf{C})}[\ln p_{\boldsymbol{\theta}}(\mathbf{x}_{u}\mid\mathbf{z}_{u},\mathbf{C})]-\beta\cdot D_{\mathrm{KL}}(q_{\boldsymbol{\theta}}(\mathbf{z}_{u}\mid\mathbf{x}_{u},\mathbf{C})\|p_{\boldsymbol{\theta}}(\mathbf{z}_{u}))\right].(5)
24
+
25
+ In this section, we describe the implementation of p𝜽​(𝐂)subscript𝑝𝜽𝐂p_{\boldsymbol{\theta}}(\mathbf{C}), p𝜽​(xu,i∣𝐳u,𝐂)subscript𝑝𝜽conditionalsubscript𝑥𝑢𝑖subscript𝐳𝑢𝐂p_{\boldsymbol{\theta}}(x_{u,i}\mid\mathbf{z}_{u},\mathbf{C}) (the decoder),p𝜽​(𝐳u)subscript𝑝𝜽subscript𝐳𝑢p_{\boldsymbol{\theta}}(\mathbf{z}_{u}) (the prior),q𝜽​(𝐳u∣𝐱u,𝐂)subscript𝑞𝜽conditionalsubscript𝐳𝑢subscript𝐱𝑢𝐂q_{\boldsymbol{\theta}}(\mathbf{z}_{u}\mid\mathbf{x}_{u},\mathbf{C}) (the encoder),and propose an efficient strategy to combat mode collapse.The parameters 𝜽𝜽{\boldsymbol{\theta}} of our implementation include: K𝐾K concept prototypes {𝐦k}k=1K∈ℝK×dsuperscriptsubscriptsubscript𝐦𝑘𝑘1𝐾superscriptℝ𝐾𝑑\{\mathbf{m}_{k}\}_{k=1}^{K}\in\mathbb{R}^{K\times d}, M𝑀M item representations {𝐡i}i=1M∈ℝM×dsuperscriptsubscriptsubscript𝐡𝑖𝑖1𝑀superscriptℝ𝑀𝑑\{\mathbf{h}_{i}\}_{i=1}^{M}\in\mathbb{R}^{M\times d} used by the decoder, M𝑀M context representations {𝐭i}i=1M∈ℝM×dsuperscriptsubscriptsubscript𝐭𝑖𝑖1𝑀superscriptℝ𝑀𝑑\{\mathbf{t}_{i}\}_{i=1}^{M}\in\mathbb{R}^{M\times d} used by the encoder, and the parameters of a neural network fnn:ℝd→ℝ2​d:subscript𝑓nn→superscriptℝ𝑑superscriptℝ2𝑑f_{\mathrm{nn}}:\mathbb{R}^{d}\to\mathbb{R}^{2d}.We optimize 𝜽𝜽{\boldsymbol{\theta}} to maximize the training objective (see Equation 5) using Adam [26].
26
+
27
+ A straightforward approach would be to assume p𝜽​(𝐂)=∏i=1Mp​(𝐜i)subscript𝑝𝜽𝐂superscriptsubscriptproduct𝑖1𝑀𝑝subscript𝐜𝑖p_{\boldsymbol{\theta}}(\mathbf{C})=\prod_{i=1}^{M}p(\mathbf{c}_{i}) and parameterize each categorical distribution p​(𝐜i)𝑝subscript𝐜𝑖p(\mathbf{c}_{i}) with its own set of K−1𝐾1K-1 parameters.This approach, however, would result in over-parameterization and low sample efficiency.We instead propose a prototype-based implementation.To be specific, we introduce K𝐾K concept prototypes {𝐦k}k=1Ksuperscriptsubscriptsubscript𝐦𝑘𝑘1𝐾\{\mathbf{m}_{k}\}_{k=1}^{K} and reuse the item representations {𝐡i}i=1Msuperscriptsubscriptsubscript𝐡𝑖𝑖1𝑀\{\mathbf{h}_{i}\}_{i=1}^{M} from the decoder.We then assume 𝐜isubscript𝐜𝑖\mathbf{c}_{i} is a one-hot vector drawn from the following categorical distribution p𝜽​(𝐜i)subscript𝑝𝜽subscript𝐜𝑖p_{\boldsymbol{\theta}}(\mathbf{c}_{i}):𝐜i∼Categorical​(Softmax​([si,1;si,2;…;si,K])),si,k=Cosine​(𝐡i,𝐦k)/τ,formulae-sequencesimilar-tosubscript𝐜𝑖CategoricalSoftmaxsubscript𝑠𝑖1subscript𝑠𝑖2…subscript𝑠𝑖𝐾subscript𝑠𝑖𝑘Cosinesubscript𝐡𝑖subscript𝐦𝑘𝜏\displaystyle\mathbf{c}_{i}\sim\textsc{Categorical}\left({\textsc{Softmax}([s_{i,1};s_{i,2};\ldots;s_{i,K}])}\right),\quad s_{i,k}={\textsc{Cosine}(\mathbf{h}_{i},\mathbf{m}_{k})}/{\tau},(6)whereCosine​(𝐚,𝐛)=𝐚⊤​𝐛/(‖𝐚‖2​‖𝐛‖2)Cosine𝐚𝐛superscript𝐚top𝐛subscriptnorm𝐚2subscriptnorm𝐛2\textsc{Cosine}(\mathbf{a},\mathbf{b})=\mathbf{a}^{\top}\mathbf{b}/(\|\mathbf{a}\|_{2}\;\|\mathbf{b}\|_{2}) is the cosine similarity, and τ𝜏\tau is a hyper-parameter that scales the similarity from [−1,1]11[-1,1] to [−1τ,1τ]1𝜏1𝜏[-\frac{1}{\tau},\frac{1}{\tau}].We set τ=0.1𝜏0.1\tau=0.1 to obtain a more skewed distribution.
28
+
29
+ We use cosine similarity, instead of the inner product similarity adopted by most existing deep learning methods [32, 31, 18].This choice is crucial for preventing mode collapse.In fact, with inner product, the majority of the items are highly likely to be assigned to a single concept 𝐦k′subscript𝐦superscript𝑘′\mathbf{m}_{k^{\prime}} that has an extremely large norm, i.e., ‖𝐦k′‖2→∞→subscriptnormsubscript𝐦superscript𝑘′2\|\mathbf{m}_{k^{\prime}}\|_{2}\to\infty, even when the items {𝐡i}i=1Msuperscriptsubscriptsubscript𝐡𝑖𝑖1𝑀\{\mathbf{h}_{i}\}_{i=1}^{M} correctly form K𝐾K clusters in the high-dimensional Euclidean space.And we observe empirically that this phenomenon does occur frequently with inner product (see Figure 2(e)).In contrast, cosine similarity avoids this degenerate case due to the normalization.Moreover, cosine similarity is related with the Euclidean distance on the unit hypersphere, and the Euclidean distance is a proper metric that is more suitable for inferring the cluster structure, compared to inner product.
30
+
31
+ The decoder predicts which item out of the M𝑀M ones is mostly likely to be clicked by a user, when given the user’s representation 𝐳u=[𝐳u(1);𝐳u(2);…;𝐳u(K)]subscript𝐳𝑢superscriptsubscript𝐳𝑢1superscriptsubscript𝐳𝑢2…superscriptsubscript𝐳𝑢𝐾\mathbf{z}_{u}=[\mathbf{z}_{u}^{(1)};\mathbf{z}_{u}^{(2)};\ldots;\mathbf{z}_{u}^{(K)}] and the one-hot concept assignments {𝐜i}i=1Msuperscriptsubscriptsubscript𝐜𝑖𝑖1𝑀\{\mathbf{c}_{i}\}_{i=1}^{M}.We assume thatp𝜽​(xu,i∣𝐳u,𝐂)∝∑k=1Kci,k⋅g𝜽(i)​(𝐳u(k))proportional-tosubscript𝑝𝜽conditionalsubscript𝑥𝑢𝑖subscript𝐳𝑢𝐂superscriptsubscript𝑘1𝐾⋅subscript𝑐𝑖𝑘superscriptsubscript𝑔𝜽𝑖superscriptsubscript𝐳𝑢𝑘p_{\boldsymbol{\theta}}(x_{u,i}\mid\mathbf{z}_{u},\mathbf{C})\propto\sum_{k=1}^{K}c_{i,k}\cdot g_{\boldsymbol{\theta}}^{(i)}(\mathbf{z}_{u}^{(k)}) is a categorical distribution over the M𝑀M items, and defineg𝜽(i)​(𝐳u(k))=exp⁡(Cosine​(𝐳u(k),𝐡i)/τ)superscriptsubscript𝑔𝜽𝑖superscriptsubscript𝐳𝑢𝑘Cosinesuperscriptsubscript𝐳𝑢𝑘subscript𝐡𝑖𝜏g_{\boldsymbol{\theta}}^{(i)}(\mathbf{z}_{u}^{(k)})=\exp(\textsc{Cosine}(\mathbf{z}_{u}^{(k)},\mathbf{h}_{i})/\tau).This design implies that {𝐡i}i=1Msuperscriptsubscriptsubscript𝐡𝑖𝑖1𝑀\{\mathbf{h}_{i}\}_{i=1}^{M} will be micro-disentangled if {𝐳u(k)}u=1Nsuperscriptsubscriptsuperscriptsubscript𝐳𝑢𝑘𝑢1𝑁\{\mathbf{z}_{u}^{(k)}\}_{u=1}^{N} is micro-disentangled, as the two’s dimensions are aligned.
32
+
33
+ The prior p𝜽​(𝐳u)subscript𝑝𝜽subscript𝐳𝑢p_{\boldsymbol{\theta}}(\mathbf{z}_{u}) needs to be factorized in order to achieve micro disentanglement.We therefore set p𝜽​(𝐳u)subscript𝑝𝜽subscript𝐳𝑢p_{\boldsymbol{\theta}}(\mathbf{z}_{u}) to 𝒩​(𝟎,σ02​𝐈)𝒩0superscriptsubscript𝜎02𝐈\mathcal{N}(\boldsymbol{0},\sigma_{0}^{2}\mathbf{I}).The encoder q𝜽​(𝐳u∣𝐱u,𝐂)subscript𝑞𝜽conditionalsubscript𝐳𝑢subscript𝐱𝑢𝐂q_{\boldsymbol{\theta}}(\mathbf{z}_{u}\mid\mathbf{x}_{u},\mathbf{C}) is for computing the representation of a user when given the user’s behavior data 𝐱usubscript𝐱𝑢\mathbf{x}_{u}. The encoder maintains an additional set of context representations {𝐭i}i=1Msuperscriptsubscriptsubscript𝐭𝑖𝑖1𝑀\{\mathbf{t}_{i}\}_{i=1}^{M}, rather than reusing the item representations {𝐡i}i=1Msuperscriptsubscriptsubscript𝐡𝑖𝑖1𝑀\{\mathbf{h}_{i}\}_{i=1}^{M} from the decoder, which is a common practice in the literature [32].We assume q𝜽​(𝐳u∣𝐱u,𝐂)=∏k=1Kq𝜽​(𝐳u(k)∣𝐱u,𝐂)subscript𝑞𝜽conditionalsubscript𝐳𝑢subscript𝐱𝑢𝐂superscriptsubscriptproduct𝑘1𝐾subscript𝑞𝜽conditionalsuperscriptsubscript𝐳𝑢𝑘subscript𝐱𝑢𝐂q_{\boldsymbol{\theta}}(\mathbf{z}_{u}\mid\mathbf{x}_{u},\mathbf{C})=\prod_{k=1}^{K}q_{\boldsymbol{\theta}}(\mathbf{z}_{u}^{(k)}\mid\mathbf{x}_{u},\mathbf{C}), and represent each q𝜽​(𝐳u(k)∣𝐱u,𝐂)subscript𝑞𝜽conditionalsuperscriptsubscript𝐳𝑢𝑘subscript𝐱𝑢𝐂q_{\boldsymbol{\theta}}(\mathbf{z}_{u}^{(k)}\mid\mathbf{x}_{u},\mathbf{C}) as a multivariate normal distribution with a diagonal covariance matrix 𝒩​(𝝁u(k),[diag​(𝝈u(k))]2)𝒩superscriptsubscript𝝁𝑢𝑘superscriptdelimited-[]diagsuperscriptsubscript𝝈𝑢𝑘2\mathcal{N}(\boldsymbol{\mu}_{u}^{(k)},[\mathrm{diag}(\boldsymbol{\sigma}_{u}^{(k)})]^{2}), where the mean and the standard deviation are parameterized by a neural network fnn:ℝd→ℝ2​d:subscript𝑓nn→superscriptℝ𝑑superscriptℝ2𝑑f_{\mathrm{nn}}:\mathbb{R}^{d}\to\mathbb{R}^{2d}:(𝐚u(k),𝐛u(k))=fnn​(∑i:xu,i=+1ci,k⋅𝐭i∑i:xu,i=+1ci,k2),𝝁u(k)=𝐚u(k)‖𝐚u(k)‖2,𝝈u(k)←σ0⋅exp⁡(−12​𝐛u(k)).formulae-sequencesuperscriptsubscript𝐚𝑢𝑘superscriptsubscript𝐛𝑢𝑘subscript𝑓nnsubscript:𝑖subscript𝑥𝑢𝑖1⋅subscript𝑐𝑖𝑘subscript𝐭𝑖subscript:𝑖subscript𝑥𝑢𝑖1superscriptsubscript𝑐𝑖𝑘2formulae-sequencesubscriptsuperscript𝝁𝑘𝑢superscriptsubscript𝐚𝑢𝑘subscriptnormsuperscriptsubscript𝐚𝑢𝑘2←subscriptsuperscript𝝈𝑘𝑢⋅subscript𝜎012superscriptsubscript𝐛𝑢𝑘\displaystyle(\mathbf{a}_{u}^{(k)},\mathbf{b}_{u}^{(k)})=f_{\mathrm{nn}}\left(\frac{\sum_{i:{x}_{u,i}=+1}c_{i,k}\cdot\mathbf{t}_{i}}{\sqrt{\sum_{i:{x}_{u,i}=+1}c_{i,k}^{2}}}\right),\;\boldsymbol{\mu}^{(k)}_{u}=\frac{\mathbf{a}_{u}^{(k)}}{\|\mathbf{a}_{u}^{(k)}\|_{2}},\;\boldsymbol{\sigma}^{(k)}_{u}\leftarrow\sigma_{0}\cdot\exp\left(-\frac{1}{2}\mathbf{b}_{u}^{(k)}\right).(7)The neural network fnn​(⋅)subscript𝑓nn⋅f_{\mathrm{nn}}(\cdot) captures nonlinearity, and is shared across the K𝐾K components.We normalize the mean, so as to be consistent with the use of cosine similarity which projects the representations onto a unit hypersphere.Note that σ0subscript𝜎0\sigma_{0} should be set to a small value, e.g., around 0.10.10.1, since the learned representations are now normalized.
34
+
35
+ The controllability enabled by the disentangled representations can bring a new paradigm for recommendation.It allows a user to interactively search for items that are similar to an initial item except for some controlled aspects, or to explicitly adjust the disentangeld representation of his/her preference, learned by the system from his/her past behaviors, to actually match the current preference.Here we formalize the task of user-controllable recommendation, and illustrate a possible solution.
36
+
37
+ Let 𝐡∗∈ℝdsubscript𝐡superscriptℝ𝑑\mathbf{h}_{*}\in\mathbb{R}^{d} be the representation to be altered, which can be initialized as either an item representation or a component of a user representation.The task is to gradually alter its jthsuperscript𝑗thj^{\mathrm{th}} dimension h∗,jsubscriptℎ𝑗h_{*,j}, while retrieving items whose representations are similar to the altered representation. This task is nontrivial, since usually no item will have exactly the same representation as the altered one, especially when we want the transition to be smooth, monotonic, and thus human-understandable.
38
+
39
+ Here we illustrate our approach to this task.We first probe the suitable range (a,b)𝑎𝑏(a,b) for h∗,jsubscriptℎ𝑗h_{*,j}.Let us assume that prototype k∗subscript𝑘k_{*} is the prototype closest to 𝐡∗subscript𝐡\mathbf{h}_{*}.The range (a,b)𝑎𝑏(a,b) is decided such that: prototype k∗subscript𝑘k_{*} remains the prototype closest to 𝐡∗subscript𝐡\mathbf{h}_{*} if and only if h∗,j∈(a,b)subscriptℎ𝑗𝑎𝑏h_{*,j}\in(a,b).We can decide each endpoint of the range using binary search.We then divide the range (a,b)𝑎𝑏(a,b) into B𝐵B subranges, a=a0<a1<a2​…<aB=b𝑎subscript𝑎0subscript𝑎1subscript𝑎2…subscript𝑎𝐵𝑏a=a_{0}<a_{1}<a_{2}\ldots<a_{B}=b.We ensure that the subranges contain roughly the same number of items from concept k∗subscript𝑘k_{*} when dividing (a,b)𝑎𝑏(a,b) .Finally, we aim to retrieve B𝐵B items {it}t=1B∈{1,2,…,M}Bsuperscriptsubscriptsubscript𝑖𝑡𝑡1𝐵superscript12…𝑀𝐵\{i_{t}\}_{t=1}^{B}\in\{1,2,\ldots,M\}^{B} that belong to concept k∗subscript𝑘k_{*}, each from one of the B𝐵B subranges, i.e., hit,j∈(at−1,at]subscriptℎsubscript𝑖𝑡𝑗subscript𝑎𝑡1subscript𝑎𝑡{h}_{i_{t},j}\in(a_{t-1},a_{t}].We thus decide the B𝐵B items by maximizing∑1≤t≤BeCosine​(𝐡it,−j,𝐡∗,−j)τ+γ⋅∑1≤t<t′≤BeCosine​(𝐡it,−j,𝐡it′,−j)τ,subscript1𝑡𝐵superscript𝑒Cosinesubscript𝐡subscript𝑖𝑡𝑗subscript𝐡𝑗𝜏⋅𝛾subscript1𝑡superscript𝑡′𝐵superscript𝑒Cosinesubscript𝐡subscript𝑖𝑡𝑗subscript𝐡subscript𝑖superscript𝑡′𝑗𝜏\sum_{1\leq t\leq B}e^{\frac{\textsc{Cosine}(\mathbf{h}_{i_{t},-j},\mathbf{h}_{*,-j})}{\tau}}+\gamma\cdot\sum_{1\leq t<t^{\prime}\leq B}e^{\frac{\textsc{Cosine}(\mathbf{h}_{i_{t},-j},\mathbf{h}_{i_{t^{\prime}},-j})}{\tau},} where 𝐡i,−j=[hi,1;hi,2;…;hi,j−1;hi,j+1;…;hi,d]∈ℝd−1subscript𝐡𝑖𝑗subscriptℎ𝑖1subscriptℎ𝑖2…subscriptℎ𝑖𝑗1subscriptℎ𝑖𝑗1…subscriptℎ𝑖𝑑superscriptℝ𝑑1\mathbf{h}_{i,-j}=[h_{i,1};h_{i,2};\ldots;h_{i,j-1};h_{i,j+1};\ldots;h_{i,d}]\in\mathbb{R}^{d-1}and γ𝛾\gamma is a hyper-parameter.We approximately solve this maximization problem sequentially using beam search [36].
40
+
41
+ Intuitively, selecting items from the B𝐵B subranges ensures that the items change monotonously in terms of the jthsuperscript𝑗thj^{\mathrm{th}} dimension.On the other hand,the first term in the maximization problem forces the retrieved items to be similar with the initial item in terms of the dimensions other than j𝑗j, while the second term encourages any two retrieved items to be similar in terms of the dimensions other than j𝑗j.
42
+
43
+ We conduct our experiments on five real-world datasets.Specifically, we use the large-scale Netflix Prize dataset [4], and three MovieLens datasets of different scales (i.e., ML-100k, ML-1M, and ML-20M) [16].We follow MultVAE [32], and binarize these four datasets by keeping ratings of four or higher while only keeping users who have watched at least five movies.We additionally collect a dataset, named AliShop-7C 111The dataset and our code are at https://jianxinma.github.io/disentangle-recsys.html., from Alibaba’s e-commerce platform Taobao.AliShop-7C contains user-item interactions associated with items from seven categories, as well as item attributes such as titles and images.Every user in this dataset clicks items from at least two categories.The category labels are used for evaluation only, and not for training.
44
+
45
+ We compare our approach with MultDAE [32] and β𝛽\beta-MultVAE [32], the two state-of-the-art methods for collaborative filtering.In particular, β𝛽\beta-MultVAE is similar to β𝛽\beta-VAE [19], and has a hyper-parameter β𝛽\beta that controls the strength of disentanglement.However, β𝛽\beta-MultVAE does not learn disentangled representations, because it requires β≪1much-less-than𝛽1\beta\ll 1 to perform well.
46
+
47
+ We constrain the number of learnable parameters to be around 2​M​d2𝑀𝑑2Md for each method so as to ensure fair comparison, which is equivalent to using d𝑑d-dimensional representations for the M𝑀M items.Note that all the methods under investigation use two sets of item representations, and we do not constrain the dimension of user representations since they are not parameters.We set d=100𝑑100d=100 unless otherwise specified.We fix τ𝜏\tau to 0.10.10.1.We tune the other hyper-parameters of both our approach’s and our baselines’ automatically using the TPE method [6] implemented by Hyepropt [5].
48
+
49
+ We evaluate the performance of our approach on the task of collaborative filtering for implicit feedback datasets [21], one of the most common settings for recommendation.We follow the experiment protocol established by the previous work [32] strictly, and use the same preprocessing procedure as well as evaluation metrics.The results on the five datasets are listed in Table 1.
50
+
51
+ We observe that our approach outperforms the baselines significantly, especially on small, sparse datasets.The improvement is likely due to two desirable properties of our approach.Firstly, macro disentanglement not only allows us to accurately represent the diverse interests of a user using the different components, but also alleviates data sparsity by allowing a rarely visited item to borrow information from other items of the same category, which is the motivation behind many hierarchical methods [50, 38].Secondly, as we will show in Section 3.4, the dimensions of the representations learned by our approach are highly disentangled, i.e., independent, thanks to the micro disentanglement regularizer, which leads to more robust performance.
52
+
53
+ We visualize the high-dimensional representations learned by our approach on AliShop-7C in order to qualitatively examine to which degree our approach can achieve macro disentanglement.Specifically, we set K𝐾K to seven, i.e., the number of ground-truth categories, when training our model.We visualize the item representations and the user representations together using t-SNE [40], where we treat the K𝐾K components of a user as K𝐾K individual points and keep only the two components that have the highest confidence levels.The confidence of component k𝑘k is defined as ∑i:xu,i>0ci,ksubscript:𝑖subscript𝑥𝑢𝑖0subscript𝑐𝑖𝑘\sum_{i:x_{u,i}>0}c_{i,k}, where ci,ksubscript𝑐𝑖𝑘c_{i,k} is the value inferred by our model, rather than the ground-truth.The results are shown in Figure 2.
54
+
55
+ Figure 2(c), which shows the clusters inferred based on the prototypes, is rather similar to Figure 2(d) that shows the ground-truth categories, despite the fact that our model is trained without the ground-truth category labels.This demonstrates that our approach is able to discover and disentangle the macro structures underlying the user behavior data in an interpretable way.Moreover, the components of the user representations are near the correct cluster centers (see Figure 2(a) and Figure 2(b)), and are hence likely capturing the users’ separate preferences for different categories.
56
+
57
+ To highlight the necessity of using cosine similarity instead of the more commonly used inner product similarity, we additionally train a new model that uses inner product in place of cosine, and visualize the learned item representations in Figure 2(e).With inner product, the majority of the items are assigned to the same prototype (see Figure 2(e)).In comparison, all seven prototypes learned by the cosine-based model are assigned a significant number of items (see Figure 2(c)).This finding supports our claim that a proper metric space, such as the one implied by the cosine similarity, is important for preventing mode collapse.
58
+
59
+ We vary the hyper-parameters related with micro disentanglement (β𝛽\beta and σ0subscript𝜎0\sigma_{0} for our approach, β𝛽\beta for β𝛽\beta-MultVAE), and plot in Figure 4 the relationship between the level of independence achieved and the recommendation performance.Each method is evaluated with 2,000 randomly sampled configurations on ML-100k.We quantify the level of independence achieved by a set of d𝑑d-dimensional representations using1−2d​(d−1)​∑1≤i<j≤d|corri,j|12𝑑𝑑1subscript1𝑖𝑗𝑑subscriptcorr𝑖𝑗1-\frac{2}{d(d-1)}\sum_{1\leq i<j\leq d}|\mathrm{corr}_{i,j}|, where corri,jsubscriptcorr𝑖𝑗\mathrm{corr}_{i,j} is the correlation between dimension i𝑖i and j𝑗j.Figure 4 suggests that high performance is in general associated with a relatively high level of independence.And our approach achieves a much higher level of independence than β𝛽\beta-MultVAE.In addition, the improvement brought by using K=7𝐾7K=7 instead of K=1𝐾1K=1 reveals that macro disentanglement can possibly help improve micro disentanglement.
60
+
61
+ We train our model with K=7𝐾7K=7, d=10𝑑10d=10, β=50𝛽50\beta=50 and σ0=0.3subscript𝜎00.3\sigma_{0}=0.3, on AliShop-7C, and investigate the interpretability of the dimensions using the approach illustrated in Subsection 2.4.In Figure 3, we list some representative dimensions that have human-understandable semantics.These examples suggest that our approach has the potential to give users fine-grained control over targeted aspects of the recommendation lists.However, we note that not all dimensions are human-understandable.In addition, as pointed out by Locatello et al. [34], well-trained interpretable models can only be reliably identified with the help of external knowledge, e.g., item attributes.We thus encourage future efforts to focus more on (semi-)supervised methods [35].
62
+
63
+ Learning from user behavior has been a central task of recommender systems since the advent of collaborative filtering [43, 42, 46, 12, 21].Early attempts apply matrix factorization [29, 45], while the more recent deep learning methods [49, 32, 31, 52, 11, 18] achieve massive improvement by learning highly informative representations.The entanglement of the latent factors behind user behavior, however, is mostly neglected by the black-box representation learning process adopted by the majority of the existing methods.To the extent of our knowledge, we are the first to study disentangled representation learning on user behavior data.
64
+
65
+ Disentangled representation learning aims to identify and disentangle the underlying explanatory factors [3].β𝛽\beta-VAE [19] demonstrates that disentanglement can emerge once the KL divergence term in the VAE [27] objective is aggressively penalized.Later approaches separate the information bottleneck term [48, 47] and the total correlation term, and achieve a greater level of disentanglement [9, 25, 8].Though a few existing approaches [14, 10, 7, 13, 24] do notice that a dataset can contain samples from different concepts, i.e., follow a mixture distribution, their settings are fundamentally different from ours.To be specific, these existing approaches assume that each instance is from a concept, while we assume that each instance interacts with objects from different concepts.The majority of the existing efforts are from the field of computer vision [28, 15, 20, 30, 53, 14, 10, 39, 19].Disentangled representation learning on relational data, such as graph-structured data, was not explored until recently [37].This work focus on disentangling user behavior, another kind of relational data commonly seen in recommender systems.
66
+
67
+ In this paper, we studied the problem of learning disentangled representations from user behavior, and presented our approach that performs disentanglement at both a macro and a micro level.An interesting direction for future research is to explore novel applications that can be enabled by the interpretability and controllability brought by the disentangled representations.
68
+
69
+ The authors from Tsinghua University are supported in part by National Program on Key Basic Research Project (No. 2015CB352300), National Key Research and Development Project (No. 2018AAA0102004), National Natural Science Foundation of China (No. 61772304, No. 61521002, No. 61531006, No. U1611461), Beijing Academy of Artificial Intelligence (BAAI), and the Young Elite Scientist Sponsorship Program by CAST.All opinions, findings, and conclusions in this paper are those of the authors and do not necessarily reflect the views of the funding agencies.
1910.14254v2.txt ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ An important property of human communication is that listeners can infer information beyond the literal meaning of an utterance. One well-studied type of inference is scalar inference (Grice, 1975; Horn, 1984), whereby a listener who hears an utterance with a scalar item like some infers the negation of a stronger alternative with all:
2
+
3
+ {exe}\ex{xlist}\exChris ate some of the cookies.\ex ↝↝\rightsquigarrow Chris ate some, but not all, of the cookies.
4
+
5
+ Early accounts of scalar inferences (e.g., Gazdar 1979; Horn 1984; Levinson 2000) considered them to arise by default unless explicitly contradicted in context. However, in a recent corpus study, Degen (2015) showed that there is much more variability in scalar inferences from some to not all than previously assumed. Degen (2015) further showed that this variability is not random and that several lexical, syntactic, and semantic/pragmatic features of context explain much of the variance in inference strength.111See Section 2 for the operationalization of inference strength that we use throughout this paper and for a description of these features.
6
+
7
+ Recent Bayesian game-theoretic models of pragmatic reasoning (Goodman and Frank, 2016; Franke and Jäger, 2016) are able to integrate speaker expectations with world knowledge to predict listeners’ pragmatic inferences in many cases (e.g., Goodman and Stuhlmüller 2013; Degen et al. 2015). However, to compute speaker expectations, these models require manual specification of features as well as specification of a finite set of possible utterances. Further, inference becomes intractable when scaling up beyond toy domains to make predictions for arbitrary utterances.222Recent models of generating pragmatic image descriptions (Andreas and Klein, 2016; Cohn-Gordon et al., 2018) and color descriptions (Monroe et al., 2017) have overcome this issue by approximating the distributions of utterances given a set of potential referents. However, these models require a finite set of world states (e.g., several referents to choose from) and a corresponding generative model of utterances (e.g., an image captioning model) and are therefore also limited to scenarios with pre-specified world states and a corresponding generative model. Neural network (NN) models, on the other hand, do not suffer from these limitations: they are capable of making predictions for arbitrary utterances and do not require manual specification of features. Unlike Bayesian game-theoretic models, however, NN models have no explicit pragmatic reasoning mechanisms.
8
+
9
+ In this work, we investigate to what extent NN models can learn to predict subtle differences in scalar inferences and to what extent these models infer associations between linguistic features and inference strength.In this enterprise we follow the recent successes of NN models in predicting a range of linguistic phenomena such as long distance syntactic dependencies (e.g., Elman 1990; Linzen et al. 2016; Gulordava et al. 2018; Futrell et al. 2019; Wilcox et al. 2019), semantic entailments (e.g., Bowman et al. 2015; Conneau et al. 2018), acceptability judgements (Warstadt et al., 2019b), factuality (Rudinger et al., 2018), negative polarity item licensing environments (Warstadt et al., 2019a), and, to some extent, speaker commitment (Jiang and de Marneffe, 2019a). In particular, we ask:1.How well can a neural network sentence encoder learn to predict human inference strength judgments for utterances with some?2.To what extent does such a model capture the qualitative effects of hand-mined contextual features previously identified as influencing inference strength?To address the first question, we compare the performance of several NN models that differ in the underlying word embedding model (GloVe, ELMo, or BERT). To address the second question, we probe the best model’s behavior through an analysis of predictions on manually constructed minimal sentence pairs, a regression analysis, and an analysis of attention weights. We find that the best model is able to predict inference strength ratings on a held-out test set with high accuracy (r=0.78𝑟0.78r=0.78). The three analyses consistently suggest that the model learned associations between inference strength and linguistic features established by previous work (Degen, 2015).
10
+
11
+ We release data and code at https://github.com/yuxingch/Implicature-Strength-Some.
12
+
13
+ We use the annotated dataset collected by Degen (2015), a dataset of the utterances from the Switchboard corpus of English telephone dialogues (Godfrey et al., 1992) with a noun phrase (NP) with some. The dataset consists of 1,362 unique utterances. For each example with a some-NP, Degen (2015) collected inference strength ratings from at least 10 participants recruited on Amazon’s Mechanical Turk. Participants saw both the target utterance and ten utterances from the preceding discourse context. They then rated the similarity between the original utterance like (2) and an utterance in which some was replaced with some, but not all like (2), on a 7-point Likert scale with endpoints labeled “very different meaning” (1) and “same meaning” (7). Low similarity ratings thus indicate low inference strength, and high similarity ratings indicate high inference strength.{exe}\ex{xlist}\exI like – I like to read some of the philosophy stuff.\exI like – I like to read some, but not all, of the philosophy stuff.
14
+
15
+ Using this corpus, Degen (2015) found that several linguistic and contextual factors influenced inference strength ratings, including the partitive form of, subjecthood, the previous mention of the NP referent, determiner strength, and modification of the head noun, which we describe in turn.
16
+
17
+ Partitive:(2a-b) are example utterances from the corpus with and without partitive some-NPs, respectively. Values in parentheses indicate the mean inference strength rating for that item. On average, utterances with partitives yielded stronger inference ratings than ones without.{exe}\ex{xlist}\exWe […] buy some of our own equipment. (5.3)\exYou sound like you have some small ones in the background. (1.5)
18
+
19
+ Subjecthood:Utterances in which the some-NP appears in subject position, as in (2a), yielded stronger inference ratings than utterances in which the some-NP appears in a different grammatical position, e.g., as a direct object as in (2b).{exe}\ex{xlist}\exSome kids are really having it. (5.9)\exThat would take some planning. (1.4)Previous mention:Discourse properties also have an effect on inference strength. A some-NP with a previously mentioned embedded NP referent yields stronger inferences than a some-NP whose embedded NP referent has not been previously mentioned. For example, (2a) contains a some-NP in which them refers to previously mentioned Mission Impossible tape recordings, whereas problems in the some-NP in (2b) has not been previously mentioned.{exe}\ex{xlist}\exI’ve seen some of them on repeats. (5.8)\exWhat do you feel are some of the main problems? (3.4)
20
+
21
+ Modification: Degen (2015) also found a small effect of whether or not the head noun of the some-NP was modified: some-NPs with unmodified head nouns yielded slightly stronger inferences than those with modified head nouns.
22
+
23
+ Determiner strength: Finally, it has been argued that there are two types of some: a weak some and a strong some Milsark (1974); Barwise and Cooper (1981). This weak/strong distinction has been notoriously hard to pin down Horn (1997) and Degen (2015) used empirical strength norms elicited independently for each item. To this end, she exploited the fact that removing weak some from an utterance has little effect on its meaning whereas removing strong some changes the meaning. Determiner strength ratings were thus elicited by asking participants to rate the similarity between the original utterance and an utterance without some (of) on a 7-point Likert scale from ‘different meaning’ to ‘same meaning’. Items with stronger some – e.g., (2a), determiner strength 3.3 – yielded stronger inference ratings than items with weaker some – e.g., (2b), determiner strength 6.7.{exe}\ex {xlist}\exAnd some people don’t vote. (5.2)\exWell, we could use some rain up here. (2.1)
24
+
25
+ The quantitative findings from Degen (2015) are summarized in Figure 4, which shows in blue the regression coefficients for all predictors she considered (see the original paper for more detailed descriptions).
26
+
27
+ For our experiments, we randomly split the dataset into a 70% training and 30% test set, resulting in 954 training items and 408 test items.
28
+
29
+ The objective of the model is to predict mean inference strength rating i𝑖i given an utterance (a sequence of words) U={w1,w2,…,wN}𝑈subscript𝑤1subscript𝑤2…subscript𝑤𝑁U=\{w_{1},w_{2},...,w_{N}\}. We rescale the 1-to-7 Likert scale ratings to the interval [0,1]01[0,1]. Figure 1 shows the overall model architecture. The model is a sentence classification model akin to the model proposed by Lin et al. (2017). It first embeds the utterance tokens using pre-trained embedding models, and then forms a sentence representation by passing the embedded tokens through a 2-layer bidirectional LSTM network (biLSTM) Hochreiter and Schmidhuber (1997) with dropout Srivastava et al. (2014) followed by a self-attention mechanism that provides a weighted average of the hidden states of the top-most biLSTM layer. This sentence representation is then passed through a transformation layer with a sigmoid activation function, which outputs the predicted score in the interval [0,1]01[0,1].
30
+
31
+ We used 5-fold cross-validation on the training data to optimize the following hyperparameters.
32
+
33
+ Word embedding model: 100d GloVe Pennington et al. (2014), 1024d ELMo Peters et al. (2018); Gardner et al. (2018), 768d BERT-base, 1024d BERT-large Devlin et al. (2019); Wolf et al. (2019).Output layer of word embedding models: [1,3]13[1,3] for ELMo, [1,12]112[1,12] for BERT-base, and [1,24]124[1,24] for BERT-large.Dimension of LSTM hidden states: {100,200,400,800}100200400800\{100,200,400,800\}.Dropout rate in LSTM: {0.1,0.2,0.3,0.4}0.10.20.30.4\{0.1,0.2,0.3,0.4\}.
34
+
35
+ We first optimized the output layer parameter for each contextual word embedding model while keeping all other parameters fixed. We then optimized the other parameters for each embedding model by computing the average correlation between the model predictions and the human ratings across the five cross-validation folds.
36
+
37
+ Architectural variants. We also evaluated all combinations of two architectural variants: First, we evaluated models in which we included the attention layer (LSTM+Attention) or simply used the final hidden state of the LSTM (LSTM) as a sentence representation. Second, since participants providing inference strength ratings also had access to 10 utterances from the preceding conversational context, we also compared models that make predictions based only the target utterance with the some-NP and models that make predictions based on target utterances and the preceding conversational context.For the models using GloVe and ELMo, we prepended the conversational context to the target utterance to obtain a joint context and utterance embedding. For models using BERT, we made use of the fact that BERT had been trained to jointly embed two sentences or documents, and we obtained embeddings for the tokens in the target utterance by feeding the target utterance as the first document and the preceding context as the second document into the BERT encoder.We discarded the hidden states of the preceding context and only used the output of BERT for the tokens in the target utterance.
38
+
39
+ Implementation details. We implemented the model in PyTorch Paszke et al. (2017). We trained the model using the Adam optimizer Kingma and Ba (2015) with default parameters and a learning rate of 0.001, minimizing the mean squared error of the predicted ratings.In the no-context experiments, we truncated target utterances longer than 30 tokens, and in the experiments with context, we truncated the beginning of the preceding context such that the number of tokens did not exceed 150.
40
+
41
+ Evaluation. We evaluated the model predictions in terms of their correlation r𝑟r with the human inference strength ratings.As mentioned above, we optimized the hyperparameters using cross validation. We then tookthe best set of parameters and trained a model on all the available training data and evaluated that model on the held-out data.
42
+
43
+ Not surprisngly, we find that the attention layer improves predictions and that contextual word embeddings lead to better results than the static GloVeembeddings. We also find that including the conversational context does not improve predictions (see Appendix A, for learning curves of all models, and Section 6, for a discussion of the role of conversational context).
44
+
45
+ Otherwise, the model is quite insensitive to hyperparameter settings: neither the dimension of the hidden LSTM states nor the dropout rate had considerable effectson the prediction accuracy. We do find, however, that there are differences depending on the BERT and ELMo layer that we use as word representations.We find that higher layers work better than lower layers, suggesting that word representations that are influenced by other utterance tokens are helpful for thistask.
46
+
47
+ Based on these optimization runs, we chose the model with attention that uses the BERT-large embeddings but no conversational context for the subsequent experiments and analyses.
48
+
49
+ Figure 2 shows the correlation between the best model according to the tuning runs (now trained on all training data) and the empirical ratings on the 408 held-out test items. As this plot shows, the model predictions fall within a close range of the empirical ratings for most of the items (r=0.78𝑟0.78r=0.78).333For comparison, we estimated how well the human ratings correlated through a bootstrapping analysis: We re-sampled the human ratings for each item and computed the average correlation coefficient between the original and the re-sampled datasets, which we found to be approximately 0.93. Further, similarly as in the empirical data, there seem to be two clusters in the model predictions: one that includes lower ratings and one that includes higher ratings, corresponding to strong and weak scalar inferences, respectively. The only systematic deviation appears to be that the model does not predict any extreme ratings – almost all predictions are greater than 2 or less than 6, whereas the empirical ratings include some cases outside of this range.
50
+
51
+ Overall, these results suggest that the model can learn to closely predict the strength of scalar inferences. However, this result by itself does not provide evidence that the model learned associations between linguistic features and inference strength, since it could also be that, given the large number of parameters, the model learned spurious correlations independent of the empirically established feature-strength associations. To investigate whether the model learned the expected associations, we probed the model’s behavior in multiple ways, which we discuss next.
52
+
53
+ As a first analysis, we constructed artificial minimal pairs that differed alongseveral factors of interest and compared the model predictions. Such methods have been recently used to probe, for example, what kind of syntactic dependencies different types of recurrent neural network language models are capable of encoding or to what extent sentence vector representations capture compositional meanings (e.g., Linzen et al. 2016; Gulordava et al. 2018; Chowdhury and Zamparelli 2018; Ettinger et al. 2018; Marvin and Linzen 2018; Futrell et al. 2019; Wilcox et al. 2019), and also allow us to probe whether the model is sensitive to controlled changes in the input.
54
+
55
+ We constructed a set of 25 initial sentences with some-NPs. For each sentence, we created 32 variants that differed in the following four properties of the some-NP: subjecthood, partitive, pre-nominal modification, and post-nominal modification. For the latter three features, we either included or excluded of the or the modifier, respectively. For example, the version in (5a) includes of the whereas the version in (5b) lacks the partitive feature. To manipulate subjecthood of the some-NP, we created variants in which some was either the determiner in the subject NP as in (5) or in the object-NP as in (5). We also created passive versions of each of these variants (5-5). Each set of sentences includeda unique main verb, a unique pair of NPs, and unique modifiers.The full list of sentences can be found in Appendix C.
56
+
57
+ {exe}\ex{xlist}\exSome of the (organic) farmers (in the mountains) milked the brown goats who graze on the meadows.\exSome (organic) farmers (in the mountains) milked the brown goats who graze on the meadows.
58
+
59
+ \exThe organic farmers in the mountains milked some (of the) (brown) goats (who graze on the meadows).\ex The brown goats who graze on the meadows were milked by some (of the) (organic) farmers (in the mountains).\ex Some (of the) (brown) goats (who graze on the meadows) were milked by the organic farmers in the mountains.
60
+
61
+ Figure 3 shows the model predictions for the manually constructed sentences grouped by the presence of a partitive construction, the grammatical function of the some-NP, and the presence of a modifier. As in the natural dataset from Degen (2015), sentences with a partitive received higher predicted ratings than sentences without a partitive; sentences with subject some-NPs received higher predicted ratings than sentences with non-subject some-NPs; and sentences with a modified head noun in the some-NP received lower predictions than sentences with an unmodified some-NP. All these results provide evidence that the model learned the correct associations. This is particularly remarkable considering the train-test mismatch: the model was trained on noisy transcripts of spoken language that contained many disfluencies and repairs, and was subsequently tested on clean written sentences.
62
+
63
+ Regression analysis. In the minimal pair analysis above we only investigated model predictions for three factors. As a second analysis, we therefore investigated whether the predictions of the best neural network model explain the variance explained by the linguistic features that modulate inference strength. To this end, we used a slightly simplified444We removed by-item random intercepts and by-subject random slopes to facilitate inference. This simplification yielded almost identical estimates as the original model by Degen (2015). Bayesian implementation of the mixed-effects model by Degen (2015) that predicted inference strength ratings from hand-mined features. We used the brms Bürkner (2017) and STAN Carpenter et al. (2017) packages and compared this original model to an extended model that included both all of the predictors of the original model as well as the the output of the above NN model as a predictor. For this comparison, we investigated whether the magnitude of a predictor in the original model significantly decreased in the extended model with the NN predictor, based on the reasoning that if the NN predictions explain the variance previously explained by these manually coded predictors, then the original predictor should explain no or less additional variance.
64
+
65
+ We approximated the probability that the magnitude of the coefficient for the predictor i𝑖i (βisubscript𝛽𝑖\beta_{i}) in the extended model including the NN predictor is smaller than the coefficient in the original model, P​(|βie​x​t​e​n​d​e​d|<|βio​r​i​g​i​n​a​l|)𝑃superscriptsubscript𝛽𝑖𝑒𝑥𝑡𝑒𝑛𝑑𝑒𝑑superscriptsubscript𝛽𝑖𝑜𝑟𝑖𝑔𝑖𝑛𝑎𝑙P(|\beta_{i}^{extended}|<|\beta_{i}^{original}|), by sampling values for each coefficient from the distributions of the original and the extended models and comparing the magnitude of the sampled coefficients. We repeated this process 1,000,000 times and treated the simulated proportions as approximate probabilities.
66
+
67
+ An issue with this analysis is that estimating the regression model only on the items in the held-out test set yields very wide credible intervals for some of the predictors–in particular for some of the interactions–since the model infers these values from very little data. We therefore performed this regression analysis (and the subsequent analyses) on the entire data. However, while we estimated the regression coefficients from all the data, we crucially obtained the NN predictions through 6-fold cross-validation (without additional tuning of hyperparameters), so that the NN model always made predictions on data that it had not seen during training. This did yield the same qualitative results as the analyses only performed on the held-out test items (see Appendix B) but it also provided us with narrower credible intervals that highlight the differences between the coefficient estimates of the two models.
68
+
69
+ Figure 4 shows the estimates of the coefficients in the original model and the extended model. We find that the NN predictions explain some or all of the variance originally explained by many of the manually coded linguistic features: the estimated magnitude of the predictors for partitive, determiner strength, linguistic mention, subjecthood, modification, utterance length, and two of the interaction terms decreased in the extended model. These results provide additional evidence that the NN model indeed learned associations between linguistic features and inference strength rather than only explaining variance caused by individual items. This is particularly true for the grammatical and lexical features; we find that the NN predictor explains most of the variance originally explained by the partitive, subjecthood, and modification predictors. More surprisingly, the NN predictions also explain a lot of the variance originally explained by the determiner strength predictor, which was empirically determined by probing human interpretation and is not encoded explicitly in the surface form utterance.555As explained above, Degen (2015) obtained strength ratings by asking participants to rate the similarity of the original utterance and an utterance without the determiner some (of). One potential explanation for this is that strong and weak some have different context distributions. For instance, weak some occurs in existential there constructions and with individual-level predicates, whereas strong some tends not to Milsark (1974); McNally and Geenhoven (1998); Carlson (1977). Since pre-trained word embedding models capture a lot of distributional information, the NN model is presumably able to learn this association.
70
+
71
+ As a final type of analysis, we analyzed the attention weights that the model used for combining the token embeddings to a sentence embedding. Attention weight analyses have been successfully used for inspecting and debugging model decisions (e.g., Lee et al., 2017; Ding et al., 2017; Wiegreffe and Pinter, 2019; Vashishth et al., 2019; but see Serrano and Smith, 2019, and Jain and Wallace, 2019, for critical discussions of this approach). Based on these results, we expected the model to attend more to tokens that are relevant for making predictions.666As pointed out by one of the reviewers, given the transformer architecture, BERT token representations are influenced by numerous tokens of the input sentence and therefore it could be that the output representation of the i𝑖i-th token ultimately contains very little information about the i𝑖i-th token that was input to the model. Consequently, it could be that the attention weights do not provide information about which tokens the model attends to. To rule out this possibility, we also conducted the attention weight analysis for the model using static GloVe embeddings, which always exclusively represent the input token, and we found the same qualitative patterns as reported in this section, suggesting that the attention weights provide information about the tokens that are most informative for making predictions. Nevertheless, we do want to caution researchers from blindly trusting attention weight analyses and recommend using this type of analysis only in combination with other types of analyses as we have done in this work. Given that many of the hand-mined features that predict inference strength occur within or in the vicinity of the some-NP, we should therefore expect the model to attend most to the some-NP.
72
+
73
+ To test this, we first explored whether the model attended on average more to some than to other tokens in the same position. Further, we exploited the fact that in English, subjects generally occur early in a sentence. If the model attends to the vicinity of the some-NP, the average attention weights should be higher at early positions in utterances with a subject some-NP compared to utterances with a non-subject some-NP, and conversely for late utterance positions. We thus compared the average attention weights for each position across utterances with subject versus non-subject some-NPs. To make sure that any effects were not only driven by the attention weight of the some-tokens, we set the attention weights of the token corresponding to some to 00 and re-normalized the attention weights for this analysis. Further, since the attention weights are dependent on the number of tokens in the utterance, it is crucial that the average utterance length across the two compared groups be matched. We addressed this by removing outliers and limiting our analysis to utterances up to length 30 (1,028 utterances), which incidentally equalized the number of tokens across the two groups. These exclusions resulted in tiny differences in the average attention weights, but the qualitative patterns are not affected.
74
+
75
+ The left panel of Figure 5 shows the average attention weight by position for some versus other tokens. The model assigns much higher weight to some. The center panel of Figure 5 shows the average attention weight by position for subject vs. non-subject some-NP utterances. The attention weights are generally higher for tokens early in the utterance,777This is in part an artifact of shorter utterances which distribute the attention weights among fewer tokens. but the attention weights of utterances with a subject some-NP are on average higher for tokens early in the utterance compared to utterances with the some-NP in non-subject positions. Both of these findings provide evidence that the model assigns high weight to the tokens within and surrounding the some-NP.888The regression analysis suggests that the model learned to make use of the subjecthood feature and previous work on probing behavior of contextual word representations has found that such models are capable of predicting dependency labels, including subjects (e.g., Liu et al., 2019). We therefore also hypothesize that the representations of tokens that are part of a subject some-NP contain information about the subjecthood status. This in return could be an important feature for the output layer of the model and therefore be providing additional signal for the model to attend to these tokens.
76
+
77
+ In a more targeted analysis to assess whether the model learned to use the partitive feature, we examined whether the model assigned higher attention to the preposition of in partitive some-NPs compared to when of occurred elsewhere.As utterance length was again a potential confound, we conducted the analysis separately on the full set of utterances with raw attention weights and on a subset that included only utterances with at least two instances of of (128 utterances), in which we renormalized the weights of of-tokens to sum to 1.
78
+
79
+ Results are shown in the right panel of Figure 5. The attention weights were higher for of tokens in partitive some-NPs, suggesting that the model learned an association between partitive of in some-NPs and inference strength.
80
+
81
+ In the tuning experiments above, we found that including the preceding conversational context in the input to the model did not improve or lowered prediction accuracy.999As suggested by a reviewer, we conducted post-hoc experiments in which we limited the conversational context to the preceding 2 or 5 utterances, which presumably have a higher signal-to-noise ratio than a larger conversational context of 10 preceding utterances. In these experiments, we again found that including the conversational context did not improve model predictions. At the same time, we found that the model is capable of making accurate predictions in most cases without taking the preceding context into account. Taken together, these results suggest either that the conversational context is not necessary and one can draw inferences from the target utterance alone, or that the model does not make adequate use of the preceding context.
82
+
83
+ Degen (2015) did not systematically investigate whether the preceding conversational context was used by participants judging inference strength. To assess the extent to which the preceding context in this dataset affects inference strength, we re-ran her experiment, but without presenting participants with the preceding conversational context. We recruited 680 participants on Mechanical Turk who each judged 20 or 22 items, yielding 10 judgments per item. If the context is irrelevant for drawing inferences, then mean inference strength ratings should be very similar across the two experiments, suggesting the model may have rightly learned to not utilize the context. If the presence of context affects inference strength, ratings should differ across experiments, suggesting that the model’s method of integrating context is ill-suited to the task.
84
+
85
+ The new, no-context ratings correlated with the original ratings (r=0.68𝑟0.68r=0.68, see Appendix D) but were overall more concentrated towards the center of the scale, suggesting that in many cases, participants who lacked information about the conversational context were unsure about the strength of the scalar inference. Since the original dataset exhibited more of a bi-modal distribution with fewer ratings at the center of the scale, this suggests that the broader conversational context contains important cues to scalar inferences.
86
+
87
+ For our model, these results suggest that the representation of the conversational context is inadequate, which highlights the need for more sophisticated representations of linguistic contexts beyond the target utterance.101010The representation of larger linguistic context is also important for span-based question-answer (QA) systems (e.g., Hermann et al., 2015; Chen, 2018; Devlin et al., 2019) and adapting methods from QA to predicting scalar inferences would be a promising extension of the current model. We further find that the model trained on the original dataset is worse at predicting the no-context ratings (r=0.66𝑟0.66r=0.66) than the original ratings (r=0.78𝑟0.78r=0.78), which is not surprising considering the imperfect correlation between ratings across experiments, but also provides additional evidence that participants indeed behaved differently in the two experiments.
88
+
89
+ We showed that despite lacking specific pragmatic reasoning abilities, neural network-based sentence encoders are capable of harnessing the linguistic signal to learn to predict human inference strength ratings from some to not all with high accuracy. Further, several model behavior analyses provided consistent evidence that the model learned associations between previously established linguistic features and the strength of scalar inferences.
90
+
91
+ In an analysis of the contribution of the conversational context, we found that humans make use of the preceding context whereas the models we considered failed to do so adequately. Considering the importance of context in drawing both scalar and other inferences in communication Grice (1975); Clark (1992); Bonnefon et al. (2009); Zondervan (2010); Bergen and Grodner (2012); Goodman and Stuhlmüller (2013); Degen et al. (2015), the development of appropriate representations of larger context is an exciting avenue for future research.
92
+
93
+ We also only considered the supervised setting in which the model was trained to predict inference strength. It would be interesting to investigate how much supervision is necessary and, for example, to what extent a model trained to perform another task such as predicting natural language inferences is able to predict scalar inferences (see Jiang and de Marneffe (2019b) for such an evaluation of predicting speaker commitment, and Jeretič et al. (2020) for an evaluation of different NLI models for predicting lexically triggered scalar inferences).
94
+
95
+ One further interesting line of research would be to extend this work to other pragmatic inferences. Recent experimental work has shown that inference strength is variable across scale and inference type (Doran et al., 2012; van Tiel et al., 2016). We treated some as a case study in this work, but none of our modeling decisions are specific to some. It would be straightforward to train similar models for other types of inferences.
96
+
97
+ Lastly, the fact that the attention weights provided insights into the model’s decisions suggests possibilities for using neural network models for developing more precise theories of pragmatic language use. Our goal here was to investigate whether neural networks can learn associations for already established linguistic features but it would be equally interesting to investigate whether such models could be used to discover new features, which could then be verified in experimental and corpus work, potentially providing a model-driven approach to experimental and formal pragmatics.
1910.14260v2.txt ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Humans canfocus their visual attention on only a small part of their surroundings at any moment,and thus have to choose whatto pay attention to in real time [43].Driven by the tasks and intentions we have in mind,we manage attention with our foveated visual system byadjusting our head pose and our gaze point in order tofocus on the most relevant object in the environment at any moment in time [29, 8, 17, 62, 47].
2
+
3
+ This close relationship between intention, attention, and semanticobjects has inspired a variety of work in computer vision, including image classification [26],object detection [46, 27, 52, 50], actionrecognition [36, 4, 48, 42],action prediction [53],video summarization [30], visual searchmodeling [51], and irrelevant frameremoval [38], in which the attended object estimation serves as auxiliary information. Despite being a key component of thesepapers, how to identify and locate the important object is seldom studiedexplicitly. This problem in and of itself is of broad potential usein real-world applications such as driver assistance systemsand intelligent human-like robots.
4
+
5
+ In this paper, we discuss how to identify and locate the attendedobject in first-person videos. Recorded by head-mounted cameras along with eye trackers, first-person videos capture an approximation of what people see in theirfields of view as they go about their lives, yielding interesting data for studying real-time human attention. In contrast to gaze studiesof static images or pre-recorded videos, first-person video is uniquein that there is exactly one correct point of attention in eachframe, as a camera wearer can only gaze at one point at a time. Accordingly, one and only one gazed object exists for each frame, reflecting the camera wearer’s real-time attention and intention. We will use the term object of interest to refer to the attended object in our later discussion.
6
+
7
+ Some recent work [68, 22, 66]has discussed estimating probability maps of ego-attention or predicting gaze points in egocentric videos. However, people think not in terms of points in their field ofview, but in terms of the objects that they are attending to. Of course, the object of interest could be obtained by first estimating the gaze with the gaze estimator and generating object candidates from an off-the-shelf object detector, and then picking the object that the estimated gaze falls in. Because this bottom-up approach estimates where and what separately, it could be doomed to fail if theeye gaze prediction is slightly inaccurate, such as falling between twoobjects or in the intersection of multiple object bounding boxes(Figure 1). To assure consistency, one may think of performing anchor-level attention estimation and directly predicting the attended box by modifying existing object detectors. Class can be either predicted simultaneously with the anchor-level attention estimation using the same set of features, as in SSD [40], or afterwards using the features pooled within the attended box, as in Faster-RCNN [49]. Either way, these methods still do not yield satisfying performance, as we will show in Sec. 4.2, because they lack the ability to leverage the consistency to refine the results.
8
+
9
+ We propose to identify and locate the object of interest by jointlyestimating where it is within the frame aswell as recognizing what its identity is.Inparticular, we propose a novel model — which we cheekily callMindreader Net or Mr. Net — to jointly solve theproblem. Our model incorporates both spatial evidence within framesand temporal evidence across frames, in a network architecture (whichwe call the Cogged Spatial-Temporal Module) with separate spatial andtemporal branches to avoid feature entanglement.
10
+
11
+ A key feature of our model is that it explicitly enforces and leverages a simple butextremely useful constraint: our estimate of what is being attended should be locatedin exactly the position of where we estimate the attention to be.This Self Validation Module first computes similarities between the globalobject of interest class prediction vector and each local anchor boxclass prediction vector as the attention validation score to updatethe anchor attention score prediction, and then, with the updated anchorattention score, we select the attended anchor and use itscorresponding class prediction score to update the global object ofinterest class prediction. With global context originally incorporated by extracting features from the whole clip using 3D convolution, the Self Validation Modulehelps the network focus on the local context in a spatially-localanchor box and a temporally-local frame.
12
+
13
+ We evaluate the approach on two existing first-person video datasetsthat include attended object ground truth annotations. We show ourapproach outperforms baselines, and that our Self Validation Module not only improves performance by refining the outputswith visual consistency during testing, but alsoit helps bridge multiple components together during trainingto guide the model to learn a highly meaningful latent representation.More information is availableat http://vision.soic.indiana.edu/mindreader/.
14
+
15
+ Compared with many efforts to understand human attention by modelingeye gaze [68, 66, 22, 35, 34, 24, 16, 20, 21, 45, 60, 59, 2, 7, 64] orsaliency [25, 69, 19, 33, 39, 31, 55, 32, 67], thereare relatively few papers that detect object-level attention.Lee et al. [30] address videosummarization with hand-crafted features to detect importantpeople and objects, while object-level reasoning plays a key role inBaradel et al.’s work on understanding videos through interactions ofimportant objects [4].In the particular case of egocentric video, Pirsiavash andRamanan [48] and Ma et al. [42] detectobjects in hands as a proxy for attended objects to help actionrecognition.However,eye gaze usually precedes hand motion and thus objects in handare not always those being visually attended(Fig. 1(a)). Shen etal. [53] combine eye gaze groundtruth and detected object bounding boxes to extract attended objectinformation for future action prediction.EgoNet [5], among thefirst papers to focus on important object detection infirst-person videos, combines visual appearance and3D layout information to generate probability maps of objectimportance. Multiple objectscan be detected in a single frame,making their results more similar to saliency than humanattention in egocentric videos.
16
+
17
+ Perhaps the most related work to ours isBertasius et al.’s Visual-Spatial Network (VSN) [6], whichproposes an unsupervised method for important object detection infirst-person videos that incorporates the idea ofconsistency between the where and whatconcepts to facilitate learning. However, VSN requires a much morecomplicated training strategy of switching the cascade order of thetwo pathways multiple times, whereas we present a unified framework thatcan be learned end-to-end.
18
+
19
+ Given a video captured with a head-mounted camera, our goal is todetect the object that is visually attended in each frame. This ischallenging because egocentric videos can be highly cluttered, withmany competing objects vying for attention. We thus incorporatetemporal cues that consider multiple frames at a time. We firstconsider performing detection for the middle frame of a short input sequence (asin [42]), and then further develop it to work online(considering only past information) by performing detection on thelast frame. Our novel model consists of two main parts (Figure 2), which we call the CoggedSpatial-Temporal Module and the Self Validation Module.
20
+
21
+ The Cogged Spatial-Temporal Module consists of a spatial and atemporal branch. The “cogs” refer to the way that the outputsof each layer of the two branches are combined together, reminiscent ofthe interlocking cogs of two gears (Figure 2).Please see supplementary material for more details.
22
+
23
+ The Spatial Gear Branch, inspired by SSD300 [40],takes a single frame Itsubscript𝐼𝑡I_{t} of size h×wℎ𝑤h\times w and performs spatialprediction of local anchor box offsets and anchor box classes. It isexpected to work as an object detector, although we only have groundtruth for the objects of interest to train it, so wedo not add an extra background class as in [40], and only computelosses for the spatial-based tasks on the matched positive anchors.We use atrous [10, 65]VGG16 [54] as the backbone and follow a similaranchor box setting as [40]. We also apply the samemulti-anchor matching strategy. With the spatial branch, we obtainanchor box offset predictions O∈Ra×4𝑂superscript𝑅𝑎4O\in R^{a\times 4} andclass predictions Cb​o​x∈Ra×csubscript𝐶𝑏𝑜𝑥superscript𝑅𝑎𝑐C_{box}\in R^{a\times c}, where a𝑎a is the numberof anchor boxes and c𝑐c is the number of classes in ourproblem. Following SSD300 [40], we have a=8732𝑎8732a=8732, h=300ℎ300h=300, andw=300𝑤300w=300.
24
+
25
+ The Temporal Gear Branch takes N𝑁N continuousRGB frames It−N−12,t+N−12subscript𝐼𝑡𝑁12𝑡𝑁12I_{t-\frac{N-1}{2},t+\frac{N-1}{2}} as well as N𝑁Ncorresponding optical flow fieldsFt−N−12,t+N−12subscript𝐹𝑡𝑁12𝑡𝑁12F_{t-\frac{N-1}{2},t+\frac{N-1}{2}}, both of spatial resolutionh×wℎ𝑤h\times w (with N=15𝑁15N=15, set empirically). We useInception-V1 [58] I3D [9] as thebackbone of our temporal branch.With aggregated global features from 3Dconvolution, we obtain global object of interest class predictionsCg​l​o​b​a​l∈R1×csubscript𝐶𝑔𝑙𝑜𝑏𝑎𝑙superscript𝑅1𝑐C_{global}\in R^{1\times c} and anchor box attention predictionsA∈Ra×1𝐴superscript𝑅𝑎1A\in R^{a\times 1}. We match the ground truth box only to theanchor with the greatest overlap (intersection over union). Thematching strategy is empirical and discussed inSection 4.3.
26
+
27
+ The Self Validation Module connects the abovebranches and delivers global and local context between the twobranches at both spatial (e.g., whole frame versus ananchor box) and temporal (e.g., wholesequence versus a single frame) levels. It incorporates the constraint on consistencybetween where and what by embedding a doublevalidation mechanism: what→absent→\xrightarrow{}where andwhere→absent→\xrightarrow{}what.
28
+
29
+ What→absent→\xrightarrow{}where. With theoutputs of the Cogged Spatial-Temporal Module, we compute the cosinesimilarities between the global class predictionCg​l​o​b​a​lsubscript𝐶𝑔𝑙𝑜𝑏𝑎𝑙C_{global} and the class prediction for each anchor box,Cb​o​xisubscript𝐶𝑏𝑜subscript𝑥𝑖C_{box_{i}}, yielding an attention validation score for each box i𝑖i,Va​t​t​ni=Cg​l​o​b​a​l​Cb​o​xiT||Cg​l​o​b​a​l||×||Cb​o​xi||.V^{i}_{attn}=\frac{C_{global}C^{T}_{box_{i}}}{||C_{global}||\times||C_{box_{i}}||.}(1)Then the attention validation vector Va​t​t​n=[Va​t​t​n1,Va​t​t​n2,…,Va​t​t​na]∈Ra×1subscript𝑉𝑎𝑡𝑡𝑛subscriptsuperscript𝑉1𝑎𝑡𝑡𝑛subscriptsuperscript𝑉2𝑎𝑡𝑡𝑛…subscriptsuperscript𝑉𝑎𝑎𝑡𝑡𝑛superscript𝑅𝑎1V_{attn}=[V^{1}_{attn},V^{2}_{attn},...,V^{a}_{attn}]\in R^{a\times 1} is used to update theanchor box attention scores A𝐴A by element-wise summation, A′=A+Va​t​t​nsuperscript𝐴′𝐴subscript𝑉𝑎𝑡𝑡𝑛A^{\prime}=A+V_{attn}. Since −1≤Va​t​t​ni≤11subscriptsuperscript𝑉𝑖𝑎𝑡𝑡𝑛1-1\leq V^{i}_{attn}\leq 1, we makethe optimization easier by rescaling each Aisubscript𝐴𝑖A_{i}to the range [−1,1]11[-1,1],A′=R​(A)+Va​t​t​n=A−(m​a​x​(A)+m​i​n​(A))/2m​a​x​(A)−(m​a​x​(A)+m​i​n​(A))/2+Va​t​t​n,superscript𝐴′𝑅𝐴subscript𝑉𝑎𝑡𝑡𝑛𝐴𝑚𝑎𝑥𝐴𝑚𝑖𝑛𝐴2𝑚𝑎𝑥𝐴𝑚𝑎𝑥𝐴𝑚𝑖𝑛𝐴2subscript𝑉𝑎𝑡𝑡𝑛~{}A^{\prime}=R(A)+V_{attn}=\frac{A-(max(A)+min(A))/2}{max(A)-(max(A)+min(A))/2}+V_{attn},(2)where m​a​x​()𝑚𝑎𝑥max() and m​i​n​()𝑚𝑖𝑛min() are element-wise vector operations.
30
+
31
+ Where→absent→\xrightarrow{}what.Intuitively,obtaining the attended anchor box index m𝑚m is a simple matter ofcomputingm=a​r​g​m​a​x​(A′)𝑚𝑎𝑟𝑔𝑚𝑎𝑥superscript𝐴′m=argmax(A^{\prime}), and the class validation score issimplyVc​l​a​s​s=Cb​o​xmsubscript𝑉𝑐𝑙𝑎𝑠𝑠subscript𝐶𝑏𝑜subscript𝑥𝑚V_{class}=C_{box_{m}}. Similarly, after rescaling, we take an element-wisesummation, Vc​l​a​s​ssubscript𝑉𝑐𝑙𝑎𝑠𝑠V_{class} and Cg​l​o​b​a​lsubscript𝐶𝑔𝑙𝑜𝑏𝑎𝑙C_{global}, to update the global object of interest classprediction (R​(⋅)𝑅⋅R(\cdot) in Equation 2), Cg​l​o​b​a​l′=R​(Cg​l​o​b​a​l)+R​(Vc​l​a​s​s)superscriptsubscript𝐶𝑔𝑙𝑜𝑏𝑎𝑙′𝑅subscript𝐶𝑔𝑙𝑜𝑏𝑎𝑙𝑅subscript𝑉𝑐𝑙𝑎𝑠𝑠C_{global}^{\prime}=R(C_{global})+R(V_{class}).However, the hard argmax is not differentiable, and thusgradients are not able to backpropagate properly during training.We thus use soft argmax.Softmax is applied to the updatedanchor box attention score A′superscript𝐴′A^{\prime} to produce a weighting vectorA~′superscript~𝐴′\widetilde{A}^{\prime} for class validation score estimation,V^c​l​a​s​s=∑i=1aA~i′​Cb​o​xi,with​A~i′=eAi′∑j=1aeAj′formulae-sequencesubscript^𝑉𝑐𝑙𝑎𝑠𝑠superscriptsubscript𝑖1𝑎superscriptsubscript~𝐴𝑖′subscript𝐶𝑏𝑜subscript𝑥𝑖withsuperscriptsubscript~𝐴𝑖′superscript𝑒superscriptsubscript𝐴𝑖′superscriptsubscript𝑗1𝑎superscript𝑒superscriptsubscript𝐴𝑗′\hat{V}_{class}=\sum_{i=1}^{a}\widetilde{A}_{i}^{\prime}C_{box_{i}},~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}\mbox{with}~{}~{}\widetilde{A}_{i}^{\prime}=\frac{e^{A_{i}^{\prime}}}{\sum_{j=1}^{a}e^{A_{j}^{\prime}}}(3)Now we replace Vc​l​a​s​ssubscript𝑉𝑐𝑙𝑎𝑠𝑠V_{class} with V^c​l​a​s​ssubscript^𝑉𝑐𝑙𝑎𝑠𝑠\hat{V}_{class} to update Cg​l​o​b​a​lsubscript𝐶𝑔𝑙𝑜𝑏𝑎𝑙C_{global}, Cg​l​o​b​a​l′=R​(Cg​l​o​b​a​l)+R​(V^c​l​a​s​s)superscriptsubscript𝐶𝑔𝑙𝑜𝑏𝑎𝑙′𝑅subscript𝐶𝑔𝑙𝑜𝑏𝑎𝑙𝑅subscript^𝑉𝑐𝑙𝑎𝑠𝑠C_{global}^{\prime}=R(C_{global})+R(\hat{V}_{class}).
32
+
33
+ Thissoft what→absent→\xrightarrow{}wherevalidation is closely related to the soft attention mechanism widelyused in many recent papers [56, 3, 11, 63, 41, 61]. While softattention learns the mapping itself inside the model, we explicitlyincorporate the coherence of the where and what concepts into ourmodel to self-validate the output during both training andtesting. In contrast to soft attention which describes relationshipsbetween e.g. words, graphnodes, etc., this self-validation mechanism naturallymirrors the visual consistency of our foveated vision system.
34
+
35
+ We implemented our model with Keras [12] andTensorflow [1]. A batch normalizationlayer [23] is inserted after each layer in both spatialand temporal backbones, and momentum for batch normalizationis 0.80.80.8. Batch normalization is not used in the four prediction heads.We found pretraining the spatial branch helps the model convergefaster. No extra data is introduced as we still only use the labels ofthe objects of interest for pretraining.VGG16 [54] is initialized with weightspretrained on ImageNet [14].We use Sun et al.’s method [57, 44] toextract optical flow and follow [9] to truncate the mapsto [−20,20]2020[-20,20] and then rescale them to [−1,1]11[-1,1]. TheRGB input to the Temporal Gear Branch is rescaled to [−1,1]11[-1,1] [9], while for the Spatial Gear Branch the RGB inputis normalized to have 0 mean and the channels are permutedto BGR.
36
+
37
+ When training the whole model, the spatial branch is initialized withthe pretrained weights from above. The I3D backbone is initializedwith weights pretrained on Kinetics [28] andImageNet [14], while other parts are randomlyinitialized. We use stochastic gradient descent with learning rate0.030.030.03, momentum 0.90.90.9, decay 0.00010.00010.0001, and L​2𝐿2L2 regularizer5​e−55superscript𝑒55e^{-5}. The loss function consists of four parts:global classification Lg​l​o​b​a​l​c​l​a​s​ssubscript𝐿𝑔𝑙𝑜𝑏𝑎𝑙𝑐𝑙𝑎𝑠𝑠L_{globalclass}, attentionLa​t​t​nsubscript𝐿𝑎𝑡𝑡𝑛L_{attn}, anchor box classification Lb​o​x​c​l​a​s​ssubscript𝐿𝑏𝑜𝑥𝑐𝑙𝑎𝑠𝑠L_{boxclass}, andbox regression Lb​o​xsubscript𝐿𝑏𝑜𝑥L_{box},Lt​o​t​a​l=α​Lg​l​o​b​a​l​c​l​a​s​s+β​La​t​t​n+1Np​o​s​(γ​Lb​o​x​c​l​a​s​s+Lb​o​x),subscript𝐿𝑡𝑜𝑡𝑎𝑙𝛼subscript𝐿𝑔𝑙𝑜𝑏𝑎𝑙𝑐𝑙𝑎𝑠𝑠𝛽subscript𝐿𝑎𝑡𝑡𝑛1subscript𝑁𝑝𝑜𝑠𝛾subscript𝐿𝑏𝑜𝑥𝑐𝑙𝑎𝑠𝑠subscript𝐿𝑏𝑜𝑥L_{total}=\alpha L_{globalclass}+\beta L_{attn}+\frac{1}{N_{pos}}(\gamma L_{boxclass}+L_{box}),(4)where we empirically set α=β=γ=1𝛼𝛽𝛾1\alpha=\beta=\gamma=1, and Np​o​ssubscript𝑁𝑝𝑜𝑠N_{pos} is thetotal number of matched anchors for training the anchor box classpredictor and anchor box offset predictor. Lg​l​o​b​a​l​c​l​a​s​ssubscript𝐿𝑔𝑙𝑜𝑏𝑎𝑙𝑐𝑙𝑎𝑠𝑠L_{globalclass} andLa​t​t​nsubscript𝐿𝑎𝑡𝑡𝑛L_{attn} apply cross entropy loss, computed on the updatedpredictions of object of interest class and anchor boxattention. Lb​o​x​c​l​a​s​ssubscript𝐿𝑏𝑜𝑥𝑐𝑙𝑎𝑠𝑠L_{boxclass} is the total cross entropy loss andLb​o​xsubscript𝐿𝑏𝑜𝑥L_{box} is the total box regression loss over only all the matchedanchors. The box regression loss follows [49, 40]and we refer readers there for details. Our full model has 64​M64𝑀64M trainableparameters, while the Self Validation Module contains no parameters,making it very flexible so that it can be added to training or testinganytime. It is even possible to stack multiple Self Validation Modulesor use only half of it.
38
+
39
+ During testing, the anchor with the highest anchor box attention scoreAi′subscriptsuperscript𝐴′𝑖A^{\prime}_{i} is selected as the attended anchor. The correspondinganchor box offset prediction Oisubscript𝑂𝑖O_{i} indicates where the object ofinterest is, while the argmax of theglobal object of interest class score Cg​l​o​b​a​l′subscriptsuperscript𝐶′𝑔𝑙𝑜𝑏𝑎𝑙C^{\prime}_{global} gives its class.
40
+
41
+ We evaluate our model on identifying attended objects in two first-person datasetscollected invery different contexts: child and adult toy play,and adults in kitchens.
42
+
43
+ ATT [68] (Adult-Toddler Toy play) consists offirst-person videos from head-mounted cameras of parents and toddlersplaying with 24 toys in a simulated home environment. The datasetconsists of 20 synchornized video pairs (child head camerasand parent head cameras), although we only use the parent videos.The object being attended is determined usinggaze tracking.We randomly select 90%percent9090\% of the samples in eachobject class for training and use the remaining 10%percent1010\%for testing, resulting in about 17,0001700017,000 training and 1,90019001,900testing samples, each with 15 continuous frames. We do not restrict the object of interest to remainthe same in each sample sequence and only use the label of the objectof interest for training.
44
+
45
+ Epic-Kitchen Dataset [13] contains 555555 hours offirst-person video from 32 participants in theirown kitchens.The dataset includesanntoations on the “active” objects related to the person’s current action.We use this as a proxy for attended object bywe selecting only frames containing one active object and assuming that they are attended.Object classes with fewer than100010001000 samples are also excluded, resulting in 535353 classes. Werandomly select 90% of samples for training, yieldingabout 120,000120000120,000 trainingand 13,0001300013,000 testing samples.
46
+
47
+ For evaluation, we report accuracy — number of correct predictionsover the number of samples. A prediction is considered correct if ithas both (a) the correct class prediction and (b) an IoU between theestimated and the ground truth boxes above a threshold. Similarto [37], we report accuraciesat IOU thresholds of 0.50.50.5 and 0.750.750.75, as well as a mean accuracym​A​c​c𝑚𝐴𝑐𝑐mAcc computed by averaging accuracies at 101010IOU thresholds evenly distributed from 0.50.50.5 to 0.950.950.95.Accuracy thus measures ability to correctly predict bothwhat and where is being attended.
48
+
49
+ We evaluate against several strong baselines.Gaze + GT bounding box, inspired byLi et al. [35],appliesZhang et al.’s gaze prediction method [68] (since it has state-of-the-art performance on the ATT)and directly uses ground truth object bounding boxes.This isequivalent to having a perfect object detector (with m​A​P=100%𝑚𝐴𝑃percent100mAP=100\%),resulting in a very strong baseline. We use two different methods tomatch the predicted eye gaze to the objectboxes: (1) Hit: only boxes in which the gaze falls in are consideredmatched, and if the estimated gaze point is within multiple boxes,the accuracy score is averaged by the number of matched boxes; and(2) Closest: the box whose center is the closest to the predictedgaze is considered to be matched.I3D [9]-based SSD [40] tries to overcome thediscrepancy caused by solving the where and what problemsseparately by directly performing anchor-level attention estimation with anI3D [9]-backboned SSD [40]. The anchor boxsetting is similar to SSD300 [40]. For each anchor we predict anattention score, a class score, and box offsets.Cascade model contains a temporal branch withI3D backbone and a spatial branch with VGG16 backbone. Fromthe temporal branch, the important anchor as well as its box offsetsare predicted, and then features are pooled [49, 18]from the spatial branch for classification.Object in hands + GT bounding box, inspired by [48, 42, 15], tries to detect object of interest bydetecting the object in hand. We use several variants; the “eitherhanded model” is strongest, and uses both the ground truth objectboxes and the ground truth label of the object in hands. Whentwo hands hold different objects, the model always picks the one yieldinghigher accuracy, thus reflecting the best performance wecan obtain with this baseline. Pleaserefer to the supplementary materials for details of other variants.Center GT box usesthe ground truth object boxes and labels to select the objectclosest to the frame center,inspired by the fact that people tend to adjusttheir head pose so that their gaze is near the center oftheir view [34].
50
+
51
+ Table 2 presents quantitative results ofour Mindreader Net and baselines on the ATTdataset.Both enforcing and leveraging the visual consistency, our method even outperformed the either-handed model in terms of m​A​c​c𝑚𝐴𝑐𝑐mAcc, whichis built upon several strong oracles — a perfectobject detector, two perfect object-in-hand detectors, and a perfectwhich-hand classifier.Other methods without perfect objectdetectors suffer from a rapid drop in A​c​c𝐴𝑐𝑐Acc as the IOUthreshold becomes higher.For example, when the IOU thresholdreaches 0.75, the either-handed model already has no obviousadvantage compared with I3D-based SSD, and the Cascademodel achieves a much higher score. When the threshold becomes 0.5,not only our Mindreader Net but also Cascade and I3D-based SSDoutperform the either-handed model by a significant margin. Though theA​c​c0.5𝐴𝑐subscript𝑐0.5Acc_{0.5} of the cascade model is lower than I3D-basedSSD by about 3%percent33\%, its m​A​c​c𝑚𝐴𝑐𝑐mAcc and A​c​c0.75𝐴𝑐subscript𝑐0.75Acc_{0.75} are higher,suggesting bad box predictions with low IOU confuses the class headof the cascade model, but having a separate spatial branch to overcomefeature entanglement improves the overall performance withhigher-quality predictions.
52
+
53
+ We also observed thatthe Closest variant of the Gaze +GT Box modelis about 40%percent4040\% better than the Hit variant. This suggests that gazeprediction often misses the ground truth box a bit or mayfall in the intersection of several bounding boxes,reflecting the discrepancy between the where and thewhat concepts in exiting eye gazeestimation algorithms.
54
+
55
+ Sample results of our model compared with other baselines are shown inFigure 3. Regular gaze prediction models fail in (c) &(d), supporting our hypothesis about the drawback of estimating whereand what independently — the model is not robust to small errors in gaze estimation (recall the gaze-based baseline uses groundtruth bounding boxes so failures must be caused by gaze estimation).In particular, the estimated gaze falls on 3 objects in (c), slightlycloser to the center of the rabbit; In (d), eye gaze does not fall onany object. More unified models (I3D-based SSD, thecascade model, and our model) thus achieve better performance. In (a)& (b), our model outperforms I3D-based SSD and Cascade. Because aSelf Validation Module is applied to inject consistency, our Mr. Netperforms better when many objects including the object of interest areclose to each other.
56
+
57
+ Figure 6 illustrate how various parts of our model work.Image (a) shows the intermediate anchor attention score A𝐴A∈\inRa×1superscript𝑅𝑎1R^{a\times 1} from the temporal branch, visualized as the top 555attended anchors with attention scores. These are anchor-levelattention and no box offsets are predicted here. Image (b) showsvisualizations of the predicted anchor offsets O𝑂O∈\inRa×4superscript𝑅𝑎4R^{a\times 4} and box class score Cb​o​xsubscript𝐶𝑏𝑜𝑥C_{box}∈\inRa×csuperscript𝑅𝑎𝑐R^{a\times c} from thespatial branch (only of the top 5 attended anchors). We do not havenegative samples or a background class for training thespatial branch and thus there are some false positives. Image (c) combinesoutput from both branches; this is also the final prediction of themodel trained with the Self Validation Module but tested without it inthe ablation studies in Section 4.3. The predicted class isobtained from Cg​l​o​b​a​lsubscript𝐶𝑔𝑙𝑜𝑏𝑎𝑙C_{global} and we combine A𝐴A and O𝑂O to get thelocation. Discrepancy happens in this example as the class predictionis correct but not the location. Image (d) shows prediction of our fullmodel. By applying double self validation, the full model correctlypredicts location and class.
58
+
59
+ Some failure cases of our model are shown inFigure 6:(a) heavy occlusion, (b) ambiguity of whichheld object is attended, (c) the model favors the object that isreached for, and (d) an extremely difficult case where parent’s reachis occluded by an object held by the child.
60
+
61
+ We conduct several ablation studies to evaluate the importanceof the parts of our model.
62
+
63
+ Hard argmax vs. soft argmax during testing. The soft versionof what→absent→\xrightarrow{}where is necessary for gradient backpropagationduring training, but there is no such issue in testing.Our fullmodel achieves m​A​c​c=44.78%𝑚𝐴𝑐𝑐percent44.78mAcc=44.78\% when tested with hard argmax, versusm​A​c​c=44.13%𝑚𝐴𝑐𝑐percent44.13mAcc=44.13\% when tested with soft argmax. When doing the sameexperiments with other model settings, we observed similar results.
64
+
65
+ Self Validation Module.To study the importance of the Self Validation Module, we conduct fiveexperiments: (1) Train and test the model without the SelfValidation Module; (2) Train the model without the Self ValidationModule but test with only thewhat→absent→\xrightarrow{}where validation (the first step of Self Validation);(3) Train the model without Self Validationbut test with it; (4) Train the model with Self Validationbut test with onlywhat→absent→\xrightarrow{}where validation; (5) Train the model with Self Validationbut test without it. As shown in Table 2,the Self Validation Module yields consistent performancegain. If we train the model with Self Validation but removeit during testing, the remaining model still outperforms other modelstrained without the module.This implies that embedding the Self Validation Moduleduring training helps learn a better model by bridging each componentand providing guidance of how components are related to each other. Even when SelfValidation is removed during testing, consistency is stillmaintained between the temporal and the spatial branches. Also, recallthat when training the model with the Self Validation Module, the loss iscomputed based on the final output, and thus when we test the fullmodel without Self Validation, the output is actually alatent representation in our full model. This suggests that our SelfValidation Module encourages the model to learn a highlysemantically-meaningful latent representation. Furthermore, theconsistency injected by Self Validation helps prevent overfitting,while significant overfitting was observed without the Self ValidationModule during training.
66
+
67
+ Validation method for what→absent→\xrightarrow{}where. We usedelement-wise summation for what→absent→\xrightarrow{}where validation. Anotherstrategy is to treat Va​t​t​nsubscript𝑉𝑎𝑡𝑡𝑛V_{attn} as an attentionvector in which rescaling is unnecessary,Ai′=Ai⋅V~a​t​t​ni,with​V~a​t​t​ni=eVa​t​t​ni∑j=1aeVa​t​t​nj.formulae-sequencesuperscriptsubscript𝐴𝑖′⋅subscript𝐴𝑖subscriptsuperscript~𝑉𝑖𝑎𝑡𝑡𝑛withsubscriptsuperscript~𝑉𝑖𝑎𝑡𝑡𝑛superscript𝑒subscriptsuperscript𝑉𝑖𝑎𝑡𝑡𝑛superscriptsubscript𝑗1𝑎superscript𝑒subscriptsuperscript𝑉𝑗𝑎𝑡𝑡𝑛A_{i}^{\prime}=A_{i}\cdot\widetilde{V}^{i}_{attn},~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}\mbox{with}~{}~{}~{}\widetilde{V}^{i}_{attn}=\frac{e^{V^{i}_{attn}}}{\sum_{j=1}^{a}e^{V^{j}_{attn}}}.(5)We repeated experiments using this techniqueand obtained m​A​c​c=43.30%𝑚𝐴𝑐𝑐percent43.30mAcc=43.30\%, a slight dropthat may be because the double softmax inside the Self ValidationModule increases optimization difficulty.
68
+
69
+ Single stream versus two streams. We conducted experiments to studythe effect of each stream in our task. AsTable 2 shows, a single optical flow stream performs much worsethan single RGB or two-stream, indicating that object appearance isvery important for problems related to object detection. However,it still acheived acceptable results since the network can refer to thespatial branch for appearance information through the SelfValidation Module. To test this, we removed the SelfValidation Module from the single flow stream model duringtraining. When testing this model directly, we observed a very poor resultof m​A​c​c=18.4%𝑚𝐴𝑐𝑐percent18.4mAcc=18.4\%; adding the Self Validation Module back duringtesting yields a large gain to m​A​c​c=25.1%𝑚𝐴𝑐𝑐percent25.1mAcc=25.1\%.
70
+
71
+ Alternative matching strategy for box attentionprediction. For the anchor box attentionpredictor, we perform experiments with different anchor matchingstrategies. When multi anchor matching is used, we do hard negativemining as suggested in [40] with the negative:positive ratio setto 3. The model with the multi anchormatching strategy achieves m​A​c​c=44.27%𝑚𝐴𝑐𝑐percent44.27mAcc=44.27\%, versus m​A​c​c=44.78%𝑚𝐴𝑐𝑐percent44.78mAcc=44.78\% with one-bestanchor matching. We tried other different negative:positive ratios( e.g. 5, 10, 20) and still found the one best anchormatching strategy works better. This may be because we have anacceptable number of anchor boxes; once we set more anchor boxes,multi matching may work better.
72
+
73
+ Object of interest class prediction. We explore where toplace the global object of interest class predictor. When weconnect it to the temporal branch after the fused block 5, we obtain m​A​c​c=44.78%𝑚𝐴𝑐𝑐percent44.78mAcc=44.78\%;when placed after the conv block 8 at the end of the temporal branch, we achievem​A​c​c=43.69%𝑚𝐴𝑐𝑐percent43.69mAcc=43.69\%.This implies that fordetecting the object of interest among others, a higher spatialresolution of the feature map is helpful.
74
+
75
+ Our model can be easily modified to do online detection, in which onlyprevious frames are available. We modifiedthe model to detect the object of interest in thelast frame of a given sequence. As shown inTable 4, except for the Gaze + GT boxes model, all othermodels suffer from dropping A​c​c𝐴𝑐𝑐Acc scores, indicating that onlinedetection is more difficult. However, since the gaze prediction modelthat we use [68] is trained to predict eye gaze in each frame of thevideo sequence and thus works for both online and offline tasks, itsperformance remains stable.
76
+
77
+ We show the generalizability of our model by performing experiments onEpic-Kitchens [13]. Results by applying our model aswell as the I3D-based SSD model and the cascade model on this datasetare shown in Table 4. On this dataset,the A​c​c0.5𝐴𝑐subscript𝑐0.5Acc_{0.5} of the Cascade model is higher than that of the I3D +SSD model. The reason may be that objects are sparser in this datasetand thus poorly-predicted boxes will be less likely to lead to wrongclassification. Sample results are shown in Figure 6.
78
+
79
+ We considered the problem of detecting attended object in clutteredfirst-person views.We proposed a novel unified model with a Self Validation Module toleverage the visual consistency of human vision system.The module jointly optimizes the class and theattention estimates as selfvalidation. Experiments on two public datasets show our modeloutperforms other state-of-the-art methods by a large margin.
80
+
81
+ This work was supported in part by theNational Science Foundation (CAREER IIS-1253549), the NationalInstitutes of Health (R01 HD074601, R01 HD093792), NVidia, Google, and the IUOffice of the Vice Provost for Research, the College of Arts andSciences, and the School of Informatics, Computing, and Engineeringthrough the Emerging Areas of Research Project “Learning: Brains,Machines, and Children.”
82
+
83
+ We train two object-in-hand detectors (for the left hand and the right hand respectively), using the ResNet-50 backbone, and one which-hand classifier with the I3D backbone to classify which hand holds the object of interest when the left hand and the right hand hold different objects. During testing, if only one object-in-hand detector predicts object in hand or both hands hold the same object, we accept the prediction as the object of interest and it is combined with the ground truth bounding box as the final output. Otherwise we apply the which-hand classifier to decide which object to take. We obtain testing accuracy of 86.28%percent86.2886.28\%, 88.61%percent88.6188.61\% and 90.80%percent90.8090.80\% for the object-in-left-hand detector, the object-in-right-hand-detector and the object-in-which-hand classifier respectively.
84
+
85
+ To further strengthen the baseline, we directly use the ground truth of objects in hands and have 4 more settings: (1) Right handed model, which uses the ground truth object in hands labels, and when two hands hold different objects, it always favours the right one; (2) Left handed model, which is the same as (1) but always favours the left hand; (3) Model with object-in-hand ground truth and which-hand classifier, which will apply the which-hand classifier to decide which object to take when two hands hold different objects; (4) Either handed model, which uses the ground truth object-in-hand labels, and when two hands hold different objects, the model always take the one resulting in higher m​A​c​c𝑚𝐴𝑐𝑐mAcc as the prediction. Note that (4) depicts the best performance which hand-based methods can possibly achieve in theory as it uses all of the ground truth.
1910.14268v4.txt ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ With data becoming an asset, data owners try to protect their intellectual property. One such method is protecting publicly accessible machine learning models derived from this data, which recently receives more and more attention as many Machine Learning as a Service (MLaaS) web applications, e.g., the Model Zoo by Caffe Developers, and Alexa Skills by Amazon, are appearing.However, a machine learning model is an asset in itself, and can be easily copied and reused. Watermarking (Katzenbeisserand Petitcolas, 2015) may enable data owners to trace copied models. Watermarking embeds a secret message into the cover data, i.e., the machine learning model, and the message can only be retrieved with a secret key.
2
+
3
+ In the recent past, several watermarking algorithms for neural networks have been proposed (Adi et al., 2018; Chenet al., 2019a; Le Merreret al., 2020; Rouhaniet al., 2019; Szylleret al., 2019; Uchidaet al., 2017; Zhang et al., 2018; Liet al., 2019b).These algorithms can be broadly classified into black-box watermarks and white-box watermarks (see our related work discussion in Section 2).A black-box watermark can be extracted by only querying the model (black-box access).A white-box watermark needs access to the model and its parameters in order to extract the watermark.Recent studies (Shafieinejad et al., 2019) show that black-box watermarks (Adi et al., 2018; Chenet al., 2019a; Le Merreret al., 2020; Szylleret al., 2019; Zhang et al., 2018) necessarily impact the model’s accuracy, since they modify the training dataset and hence modify the learned function. This nature, however, can be unacceptable for some safety-critical applicationssuch as cancer diagnosis (Esteva et al., 2017; Khanet al., 2001). A misclassified cancer patient with potential health consequences versus a model owner’s intellectual property rights may be a hard to justify trade-off.
4
+
5
+ On the contrary, white-box watermarks can work without accuracy loss. White-box watermarking was first introduced by Uchida et al. (Uchidaet al., 2017) and later refined by Rouhani et al. (DeepSigns) (Rouhaniet al., 2019). They embed watermark messages into model weights by using some special regularizers during the training process.
6
+
7
+ One line of work studies the watermark detection attack (Wang andKerschbaum, 2019; Shafieinejad et al., 2019). Specifically, Wang andKerschbaum (2019) show that Uchida et al.’s watermarking algorithm modifies weights distribution and can be easily detected. Shafieinejad et al. (2019) propose a supposedly strongest watermark detection attack called property inference attack.Another line of work that attracts more interest is on watermark removal attacks (Wang andKerschbaum, 2019; Shafieinejad et al., 2019; Aikenet al., 2020; Liuet al., 2020; Chen et al., 2019b). In particular, most of the existing watermark removal attacks target at black-box watermarks (Shafieinejad et al., 2019; Chen et al., 2019b; Aikenet al., 2020; Liuet al., 2020).For white-box watermarks, Wang andKerschbaum (2019) show that an overwriting attack can easily remove Uchida et al.’s watermark. However, many removal attacks targeted at black-box watermarks can also be easily adapted to white-box settings, especially for those based on fine-tuning.
8
+
9
+ In this paper, we generalize the research on white-box watermarking algorithms. First, we propose a formal scheme to reason about white-box watermarking algorithms (Section 3) – encompassing the existing algorithms of Uchida et al. (Uchidaet al., 2017) and DeepSigns (Rouhaniet al., 2019).Then, we propose RIGA, a novel, improved watermarking scheme that is both hard to detect and robust against all the existing watermark removal attacks.To improve the covertness, we encourage the weights distributions of watermarked models to be similar to the weights distributions of non-watermark models. Specifically, we propose a watermark hiding technique by setting up an adversarial learning network – similar to a generative adversarial network (GAN) – where the training of the watermarked model is the generator and a watermark detector is the discriminator. Using this automated approach, we show how to embed a covert watermark which has no accuracy loss. Furthermore, we make our white-box algorithm robust to model transformation attacks.We replace the watermark extractor – a linear function in previous works (Rouhaniet al., 2019; Uchidaet al., 2017) – with a deep neural network. This change largely increases the capacity to embed a watermark. Our watermark extractor is trained while embedding the watermark. The extractor maps weights to random messages except for the watermarked weights.
10
+
11
+ Finally, we combine the two innovations into a novel white-box watermarking algorithm for deep neural networks named as RIGA. We survey various watermark detection and removal attacks and apply them on RIGA. We show that RIGA  does not impact accuracy, is hard to detect and robust against model transformation attacks.We emphasize that a white-box watermark that does not impact accuracy cannot possibly protect against model stealing and distillation attacks (Hintonet al., 2015; Juutiet al., 2019; Orekondyet al., 2017), since model stealing and distillation are black-box attacks and the black-box interface is unmodified by the white-box watermark.However, white-box watermarks still have important applications when the model needs to be highly accurate, or model stealing attacks are not feasible due to rate limitation or available computational resources.
12
+
13
+ Watermarking techniques for neural networks can be classified into black-box and white-box algorithms.A black-box watermark can be extracted by only querying the model (black-box access).A white-box watermark needs access to the model and its parameters in order to extract the watermark.In this paper we present a white-box watermarking algorithm.The first white-box algorithm was developed by Uchida et al. (Uchidaet al., 2017).Subsequently, Rouhani et al. (Rouhaniet al., 2019) presented an improved version.We generalize both algorithms into a formal scheme for white-box watermarking algorithms and present their details in Section 3.
14
+
15
+ The first attack on Uchida et al.’s algorithm was presented by Wang and Kerschbaum (Wang andKerschbaum, 2019).They show that the presence of a watermark is easily detectable and that it can be easily removed by an overwriting attack.
16
+
17
+ The first black-box watermarking algorithms using backdoors were concurrently developed by Zhang et al. (Zhang et al., 2018) and Adi et al. (Adi et al., 2018).Shafieinejad et al. show that these backdoor-based watermarks can be easily removed using efficient model stealing and distillation attacks (Shafieinejad et al., 2019).Attacks with stronger assumptions (Chen et al., 2019b; Yanget al., 2019; Liuet al., 2020; Aikenet al., 2020; Chen et al., 2019b) have later confirmed this result.
18
+
19
+ There are other types of black-box algorithms. Chen et al. (Chenet al., 2019a) and Le Merrer et al. (Le Merreret al., 2020) use adversarial examples to generate watermarks.Szyller et al. (Szylleret al., 2019) modifies the classification output of the neural network in order to embed a black-box watermark.All black-box algorithms are obviously susceptible to sybil attacks (Hitajet al., 2019), unless access to multiple, differently watermarked models is prevented.
20
+
21
+ This section provides a formal definition of white-box watermarking of deep neural networks.We provide a general scheme that encompasses at the least the existing white-box neural network watermarking algorithms (Uchidaet al., 2017; Rouhaniet al., 2019).
22
+
23
+ In this paper, we focus on deep neural networks (DNNs).A DNN is a function ℱ:X→Y:ℱ→𝑋𝑌\mathcal{F}:X\rightarrow Y, where X𝑋X is the input space, usually ℝmsuperscriptℝ𝑚\mathbb{R}^{m}, and Y𝑌Y is the collection of classes. There is a target joint distribution PX,Ysubscript𝑃𝑋𝑌P_{X,Y} on (X,Y)𝑋𝑌(X,Y) which we want to learn about. A DNN ℱℱ\mathcal{F} has function parameters w𝑤w, which is a sequence of adjustable values to enable ℱℱ\mathcal{F} fitting a wide range of mappings.The values w𝑤w are commonly referred as model parameters or model weights, which we will use interchangeably.For an instance x∈X𝑥𝑋x\in X, we represent the output of neural network ℱℱ\mathcal{F} as ℱ​(x;w)ℱ𝑥𝑤\mathcal{F}(x;w).Let 𝕎𝕎\mathbb{W} be the parameter space of w𝑤w, i.e. w∈𝕎𝑤𝕎w\in\mathbb{W}. 𝕎𝕎\mathbb{W} is usually high-dimensional real space ℝnsuperscriptℝ𝑛\mathbb{R}^{n} for DNNs, where n𝑛n is the total number of model parameters.The goal of training a DNN ℱℱ\mathcal{F} is to let ℱℱ\mathcal{F} approximate the conditional distribution PY|Xsubscript𝑃conditional𝑌𝑋P_{Y|X} by updating w𝑤w.The training of DNNs is the process of searching for the optimal w𝑤w in the parameter space to minimize a function ℰo:𝕎→ℝ:subscriptℰ𝑜→𝕎ℝ\mathcal{E}_{o}:\mathbb{W}\rightarrow\mathbb{R}, which is typically a categorical cross-entropy derived from training data (Xt​r​a​i​n,Yt​r​a​i​n)subscript𝑋𝑡𝑟𝑎𝑖𝑛subscript𝑌𝑡𝑟𝑎𝑖𝑛(X_{train},Y_{train}). ℰosubscriptℰ𝑜\mathcal{E}_{o} is commonly referred to as loss function.The accuracy of ℱℱ\mathcal{F} after training depends on the quality of the loss function ℰosubscriptℰ𝑜\mathcal{E}_{o}, while the quality of ℰosubscriptℰ𝑜\mathcal{E}_{o} in turn depends on the quality of the training data.The search for a global minimum is typically performed using a stochastic gradient descent algorithm.
24
+
25
+ To formally define training, we assume there exist three algorithms:
26
+
27
+ •ℰo←DesignLoss​(Xt​r​a​i​n,Yt​r​a​i​n)←subscriptℰ𝑜DesignLosssubscript𝑋𝑡𝑟𝑎𝑖𝑛subscript𝑌𝑡𝑟𝑎𝑖𝑛\mathcal{E}_{o}\leftarrow\textbf{DesignLoss}(X_{train},Y_{train}) is an algorithm that outputs loss function ℰosubscriptℰ𝑜\mathcal{E}_{o} according to the available training data.•wi+1←TrainBatch​(ℰo,wi)←subscript𝑤𝑖1TrainBatchsubscriptℰ𝑜subscript𝑤𝑖w_{i+1}\leftarrow\textbf{TrainBatch}(\mathcal{E}_{o},w_{i}) is an algorithm that applies one iteration of a gradient descent algorithm to minimize ℰosubscriptℰ𝑜\mathcal{E}_{o} with the starting weights wisubscript𝑤𝑖w_{i}, and outputs the resulting weights wi+1subscript𝑤𝑖1w_{i+1}.•ℱ←Train​(ℰo,w0)←ℱTrainsubscriptℰ𝑜subscript𝑤0\mathcal{F}\leftarrow\textbf{Train}(\mathcal{E}_{o},w_{0}) is an algorithm that applies TrainBatch​(ℰo,wi)TrainBatchsubscriptℰ𝑜subscript𝑤𝑖\textbf{TrainBatch}(\mathcal{E}_{o},w_{i}) iteratively for multiple steps where in the i𝑖i-th iteration the input wisubscript𝑤𝑖w_{i} is the wisubscript𝑤𝑖w_{i} returned from the previous iteration. The iterations will continue until specific conditions are satisfied (e.g. model accuracy does not increase anymore).The algorithm outputs the final model and its parameters w𝑤w.For simplicity in the following text, when the initial weights w0subscript𝑤0w_{0} are randomly initialized, we omit argument w0subscript𝑤0w_{0} and simply write Train​(ℰo)Trainsubscriptℰ𝑜\textbf{Train}(\mathcal{E}_{o}).
28
+
29
+ A well-trained DNN model ℱℱ\mathcal{F} is expected to learn the joint distribution PX,Ysubscript𝑃𝑋𝑌P_{X,Y} well. Given DNN ℱℱ\mathcal{F} and loss function ℰosubscriptℰ𝑜\mathcal{E}_{o}, we say ℱℱ\mathcal{F} is ε𝜀\varepsilon-accurate ifPr(x,y)∼PX,Y⁡[ℱ​(x;w)≠y]<ϵsubscriptPrsimilar-to𝑥𝑦subscript𝑃𝑋𝑌ℱ𝑥𝑤𝑦italic-ϵ\Pr_{(x,y)\sim P_{X,Y}}[\mathcal{F}(x;w)\neq y]<\epsilonwhere w𝑤w is the trained parameter returned by Train​(ℰo)Trainsubscriptℰ𝑜\textbf{Train}(\mathcal{E}_{o}).
30
+
31
+ A regularization term (Bühlmann andVan De Geer, 2011), or regularizer, is commonly added to the loss function to prevent models from overfitting.A regularizer is applied by training the parameters using Train​(ℰo+λ​ℰR)Trainsubscriptℰ𝑜𝜆subscriptℰ𝑅\textbf{Train}(\mathcal{E}_{o}+\lambda\mathcal{E}_{R}) where ℰRsubscriptℰ𝑅\mathcal{E}_{R} is the regularization term and λ𝜆\lambda is a coefficient to adjust its importance.
32
+
33
+ Digital watermarking is a technique used to embed a secret message, the watermark, into cover data (e.g. an image or video). It can be used to provide proof of ownership of cover data which is legally protected as intellectual property.In white-box watermarking of DNN models the cover data are the model parameters w𝑤w.DNNs have a high dimension of parameters, where many parameters have little significance in their primary classification task.The over-parameterization property can be used to encode additional information beyond what is required for the primary task.
34
+
35
+ A white-box neural network watermarking scheme consists of a message space 𝕄𝕄\mathbb{M} and a key space 𝕂𝕂\mathbb{K}. It also consists of two algorithms:
36
+
37
+ •m←Extract​(w,k)←𝑚Extract𝑤𝑘m\leftarrow\textbf{Extract}(w,k) is a deterministic polynomial-time algorithm that given model parameters w𝑤w and (secret) extraction key k𝑘k outputs extracted watermark message m𝑚m.•ℱw​m,k←Embed​(ℰo,w0,m)←subscriptℱ𝑤𝑚𝑘Embedsubscriptℰ𝑜subscript𝑤0𝑚\mathcal{F}_{{wm}},k\leftarrow\textbf{Embed}(\mathcal{E}_{o},w_{0},m) is an algorithm that given original loss function ℰosubscriptℰ𝑜\mathcal{E}_{o}, a watermark message m𝑚m and initial model weights parameters w0subscript𝑤0w_{0} outputs model ℱw​msubscriptℱ𝑤𝑚\mathcal{F}_{{wm}} including its parameters ww​msubscript𝑤𝑤𝑚w_{{wm}} and the (secret) extraction key k𝑘k.In some watermarking algorithms (Rouhaniet al., 2019; Uchidaet al., 2017) k𝑘k can be chosen independently of ℰ0subscriptℰ0\mathcal{E}_{0}, w0subscript𝑤0w_{0} and m𝑚m using a key generation function KeyGen.For generality, we combine both algorithms into one. In the following text, when w0subscript𝑤0w_{0} is randomly initialized, we omit argument w0subscript𝑤0w_{0} and simply write Embed​(ℰo,m)Embedsubscriptℰ𝑜𝑚\textbf{Embed}(\mathcal{E}_{o},m).
38
+
39
+ The extraction of watermarks, i.e. algorithm Extract​(w,k)Extract𝑤𝑘\textbf{Extract}(w,k) usually proceeds in two steps: (a) feature extraction, and (b) message extraction.The extraction key is also separated into two parts k=(kF​E,kM​E)𝑘subscript𝑘𝐹𝐸subscript𝑘𝑀𝐸k=(k_{FE},k_{ME}) for each of the steps in Extract.First, given feature extraction key kF​Esubscript𝑘𝐹𝐸k_{FE}, features q𝑞q are extracted from w𝑤w by feature extraction function gw​msubscript𝑔𝑤𝑚g_{wm}:q←gw​m​(w,kF​E)←𝑞subscript𝑔𝑤𝑚𝑤subscript𝑘𝐹𝐸q\leftarrow g_{wm}(w,k_{FE})For example, in the simplest case, the feature q𝑞q can be a subset of w𝑤w, e.g. the weights of one layer of the model, and kF​Esubscript𝑘𝐹𝐸k_{FE} is the index of the layer. This step is necessary given the complexity of a DNN’s structure.
40
+
41
+ Second, given message extraction key kM​Esubscript𝑘𝑀𝐸k_{ME}, the message m𝑚m is extracted from the features q𝑞q by message extraction function e𝑒e:m←e​(q,kM​E)←𝑚𝑒𝑞subscript𝑘𝑀𝐸m\leftarrow e(q,k_{ME})We will refer to e𝑒e as extractor in the remaining text.
42
+
43
+ Embedding of the watermark, i.e. algorithm Embed​(ℰo,m)Embedsubscriptℰ𝑜𝑚\textbf{Embed}(\mathcal{E}_{o},m) is performed alongside the primary task of training a DNN.First, a random key k=(kF​E,kM​E)𝑘subscript𝑘𝐹𝐸subscript𝑘𝑀𝐸k=(k_{FE},k_{ME}) is randomly generated.Embedding a watermark message m∈𝕄𝑚𝕄m\in\mathbb{M} into target model ℱt​g​tsubscriptℱ𝑡𝑔𝑡\mathcal{F}_{tgt} consists of regularizing ℱt​g​tsubscriptℱ𝑡𝑔𝑡\mathcal{F}_{tgt} with a special regularization term ℰw​msubscriptℰ𝑤𝑚\mathcal{E}_{{wm}}.Let d:𝕄×𝕄→ℝ:𝑑→𝕄𝕄ℝd:\mathbb{M}\times\mathbb{M}\rightarrow\mathbb{R} be a distance function measures the discrepancy between two messages.For example, when m𝑚m is a binary string of length n𝑛n, i.e. 𝕄⊆{0,1}n𝕄superscript01𝑛\mathbb{M}\subseteq\{0,1\}^{n}, d𝑑d can simply be bit error rate.Given a watermark m𝑚m to embed, the regularization term is then defined as:ℰw​m=d​(e​(gw​m​(w,kF​E),kM​E),m)subscriptℰ𝑤𝑚𝑑𝑒subscript𝑔𝑤𝑚𝑤subscript𝑘𝐹𝐸subscript𝑘𝑀𝐸𝑚\mathcal{E}_{{wm}}=d(e(g_{wm}(w,k_{FE}),k_{ME}),m)The watermarked model ℱt​g​tsubscriptℱ𝑡𝑔𝑡\mathcal{F}_{tgt} with model parameters ww​msubscript𝑤𝑤𝑚w_{{wm}} is obtained by the training algorithm Train​(ℰo+λ​ℰw​m)Trainsubscriptℰ𝑜𝜆subscriptℰ𝑤𝑚\textbf{Train}(\mathcal{E}_{o}+\lambda\mathcal{E}_{{wm}}).
44
+
45
+ There are a set of minimal requirements that a DNN watermarking algorithm should fulfill:
46
+
47
+ Functionality-Preserving: The embedding of the watermark should not impact the accuracy of the target model:Pr(x,y)∼PX,Y⁡[ℱ​(x;ww​m)=y]≈Pr(x,y)∼PX,Y⁡[ℱ​(x;w)=y]subscriptPrsimilar-to𝑥𝑦subscript𝑃𝑋𝑌ℱ𝑥subscript𝑤𝑤𝑚𝑦subscriptPrsimilar-to𝑥𝑦subscript𝑃𝑋𝑌ℱ𝑥𝑤𝑦\Pr_{(x,y)\sim P_{X,Y}}[\mathcal{F}(x;w_{{wm}})=y]\approx\Pr_{(x,y)\sim P_{X,Y}}[\mathcal{F}(x;w)=y]where ww​msubscript𝑤𝑤𝑚w_{{wm}} is returned by Train​(ℰo+λ​ℰw​m)Trainsubscriptℰ𝑜𝜆subscriptℰ𝑤𝑚\textbf{Train}(\mathcal{E}_{o}+\lambda\mathcal{E}_{{wm}}) and w𝑤w is returned by Train​(ℰo)Trainsubscriptℰ𝑜\textbf{Train}(\mathcal{E}_{o}).
48
+
49
+ Robustness: For any model transformation (independent of the key k𝑘k, e.g. fine-tuning) mapping ww​msubscript𝑤𝑤𝑚w_{{wm}} to w′superscript𝑤′w^{\prime}, such that model accuracy does not degrade, the extraction algorithm should still be able to extract watermark message m′superscript𝑚′m^{\prime} from w′superscript𝑤′w^{\prime} that is convincingly similar to the original watermark message m𝑚m, i.e. ifPr(x,y)∼PX,Y⁡[ℱ​(x;w′)=y]≈Pr(x,y)∼PX,Y⁡[ℱ​(x;ww​m)=y]subscriptPrsimilar-to𝑥𝑦subscript𝑃𝑋𝑌ℱ𝑥superscript𝑤′𝑦subscriptPrsimilar-to𝑥𝑦subscript𝑃𝑋𝑌ℱ𝑥subscript𝑤𝑤𝑚𝑦\Pr_{(x,y)\sim P_{X,Y}}[\mathcal{F}(x;w^{\prime})=y]\approx\Pr_{(x,y)\sim P_{X,Y}}[\mathcal{F}(x;w_{{wm}})=y]where w′superscript𝑤′w^{\prime} is obtained from a model transformation mapping, thenExtract​(w′,k)≈Extract​(ww​m,k)Extractsuperscript𝑤′𝑘Extractsubscript𝑤𝑤𝑚𝑘\textbf{Extract}(w^{\prime},k)\approx\textbf{Extract}(w_{{wm}},k)
50
+
51
+ A further requirement we pose to a watermarking algorithm is that the watermark in the cover data is covert.This is a useful property, because it may deter an adversary from the attempt to remove the watermark, but it is not strictly necessary.
52
+
53
+ Covertness: The adversary should not be able to distinguish a watermarked model from a non-watermarked one. Formally, we say a watermark is covert if no polynomial-time adversary algorithm 𝒜𝒜\mathcal{A} such that:Pr⁡[ℱ0←Train​(ℰo);ℱ1,k←Embed​(ℰo,m);b←${0,1};𝒜​(ℱb)=b]≫12much-greater-thanPrformulae-sequence←subscriptℱ0Trainsubscriptℰ𝑜subscriptℱ1←𝑘Embedsubscriptℰ𝑜𝑚formulae-sequencesuperscript←currency-dollar𝑏01𝒜subscriptℱ𝑏𝑏12\Pr\left[\begin{array}[]{l}\mathcal{F}_{0}\leftarrow\textbf{Train}(\mathcal{E}_{o});\mathcal{F}_{1},k\leftarrow\textbf{Embed}(\mathcal{E}_{o},m);\\b\stackrel{{\scriptstyle\$}}{{\leftarrow}}\{0,1\};\mathcal{A}(\mathcal{F}_{b})=b\end{array}\right]\gg\frac{1}{2}where 𝒜𝒜\mathcal{A} is polynomial in the number of bits to represent k𝑘k.
54
+
55
+ In the literature (Adi et al., 2018; Liet al., 2019a) further properties of watermarking algorithms have been defined. We review them and show that they are met by our new watermarking schemein Appendix A.
56
+
57
+ We now formalize Uchida et al.’s watermarking algorithm (Uchidaet al., 2017) with our general scheme. Since DeepSigns  (Rouhaniet al., 2019) is similar to Uchida et al. in many aspects, we refer to Appendix B for its formal scheme. In Uchida et al.’s algorithm, the message space 𝕄=ℝ[0,1]t𝕄superscriptsubscriptℝ01𝑡\mathbb{M}=\mathbb{R}_{[0,1]}^{t}.A typical watermark message m∈𝕄𝑚𝕄m\in\mathbb{M} is a t𝑡t-bit binary string.Both feature extraction key space 𝕂F​Esubscript𝕂𝐹𝐸\mathbb{K}_{FE} and message extraction key space 𝕂M​Esubscript𝕂𝑀𝐸\mathbb{K}_{ME} are matrix spaces.The features q𝑞q to embed the watermark into are simply the weights of a layer of the DNN, i.e. gw​msubscript𝑔𝑤𝑚g_{wm} is the multiplication of a selection matrix ZF​Esubscript𝑍𝐹𝐸Z_{FE} with the vector w𝑤w of weights. Hence the feature extraction key kF​E=ZF​Esubscript𝑘𝐹𝐸subscript𝑍𝐹𝐸k_{FE}=Z_{FE}.The message extractor e𝑒e does a linear transformation over the weights wlsubscript𝑤𝑙w_{l} of one layer using message extraction key matrix kM​E=ZM​Esubscript𝑘𝑀𝐸subscript𝑍𝑀𝐸k_{ME}=Z_{ME},and then applies sigmoid function to the resulting vector to bound the range of values.The distance function d𝑑d is the binary cross-entropy between watermark message m𝑚m and extracted message e​(gw​m​(w,ZF​E),ZM​E)𝑒subscript𝑔𝑤𝑚𝑤subscript𝑍𝐹𝐸subscript𝑍𝑀𝐸e(g_{wm}(w,Z_{FE}),Z_{ME}).Formally, Uchida et al.’s watermarking scheme is defined as follows:
58
+
59
+ •gw​m:𝕎×𝕂F​E→𝕎l:subscript𝑔𝑤𝑚→𝕎subscript𝕂𝐹𝐸subscript𝕎𝑙g_{wm}:\mathbb{W}\times\mathbb{K}_{FE}\rightarrow\mathbb{W}_{l} where gw​m​(w,ZF​E)=ZF​E​w=wlsubscript𝑔𝑤𝑚𝑤subscript𝑍𝐹𝐸subscript𝑍𝐹𝐸𝑤subscript𝑤𝑙g_{wm}(w,Z_{FE})=Z_{FE}w=w_{l}. ZF​Esubscript𝑍𝐹𝐸Z_{FE} is a |wl|×|w|subscript𝑤𝑙𝑤|w_{l}|\times|w| selection matrix with a 111 at position (i,1)𝑖1(i,1), (i+1,2)𝑖12(i+1,2) and so forth, and 00 otherwise, where i𝑖i is the start index of a layer.𝕎lsubscript𝕎𝑙\mathbb{W}_{l} is the parameter space of the weights of the selected layer, which is a subspace of 𝕎𝕎\mathbb{W}.•e:𝕎l×𝕂M​E→𝕄:𝑒→subscript𝕎𝑙subscript𝕂𝑀𝐸𝕄e:\mathbb{W}_{l}\times\mathbb{K}_{ME}\rightarrow\mathbb{M} where e​(wl,ZM​E)=σ​(ZM​E​wl)𝑒subscript𝑤𝑙subscript𝑍𝑀𝐸𝜎subscript𝑍𝑀𝐸subscript𝑤𝑙e(w_{l},Z_{ME})=\sigma(Z_{ME}w_{l}). ZM​Esubscript𝑍𝑀𝐸Z_{ME} is a t×|wl|𝑡subscript𝑤𝑙t\times|w_{l}| matrix whose values are randomly initialized. σ𝜎\sigma denotes sigmoid function.•d:𝕄×𝕄→ℝ+:𝑑→𝕄𝕄subscriptℝd:\mathbb{M}\times\mathbb{M}\rightarrow\mathbb{R}_{+} where d​(m,y)=m​log⁡(y)+(1−m)​log⁡(1−y)𝑑𝑚𝑦𝑚𝑦1𝑚1𝑦d(m,y)=m\log(y)+(1-m)\log(1-y) andy=e​(gw​m​(w,ZF​E),ZM​E)𝑦𝑒subscript𝑔𝑤𝑚𝑤subscript𝑍𝐹𝐸subscript𝑍𝑀𝐸y=e(g_{wm}(w,Z_{FE}),Z_{ME}).
60
+
61
+ In this section, we present the design of our new watermarking algorithm, RIGA, and analyze the source of its covertness and robustness.
62
+
63
+ The white-box watermarking algorithms summarized in Section 3 are based on regularizationTrain​(ℰo+λ​ℰw​m)Trainsubscriptℰ𝑜𝜆subscriptℰ𝑤𝑚\textbf{Train}(\mathcal{E}_{o}+\lambda\mathcal{E}_{{wm}}).As demonstrated by Wang andKerschbaum (2019), this extra regularization term detectably changes the distribution of weights in the target layer of the target models (referred as weights distribution in the remaining text), which makes watermark detection feasible. In this section, we propose a technique that provably increase the covertness of watermarks.
64
+
65
+ Denote μn​o​nsubscript𝜇𝑛𝑜𝑛\mu_{non} and μw​msubscript𝜇𝑤𝑚\mu_{wm} as the probability distribution of the weights vector outputted by Train​(ℰo)Trainsubscriptℰ𝑜\textbf{Train}(\mathcal{E}_{o}) and Train​(ℰo+ℰw​m)Trainsubscriptℰ𝑜subscriptℰ𝑤𝑚\textbf{Train}(\mathcal{E}_{o}+\mathcal{E}_{wm}), respectively. Both of μn​o​nsubscript𝜇𝑛𝑜𝑛\mu_{non} and μw​msubscript𝜇𝑤𝑚\mu_{wm} are therefore defined on parameter space 𝕎𝕎\mathbb{W}. Intuitively, to make embedded watermarks difficult to be detected, we need to make μw​msubscript𝜇𝑤𝑚\mu_{wm} to be as close to μn​o​nsubscript𝜇𝑛𝑜𝑛\mu_{non} as possible. To hide the watermark, we impose the constraint that the weights of a watermarked model should be similar to the weights of a typical non-watermarked model. We define a security metric ℰd​e​tsubscriptℰ𝑑𝑒𝑡\mathcal{E}_{det} to evaluate the covertness of the obtained watermarked weights, which serves as an additional regularizer in the new loss function for watermark embedding:(1)ℰo+λ1​ℰw​m+λ2​ℰd​e​tsubscriptℰ𝑜subscript𝜆1subscriptℰ𝑤𝑚subscript𝜆2subscriptℰ𝑑𝑒𝑡\mathcal{E}_{o}+\lambda_{1}\mathcal{E}_{wm}+\lambda_{2}\mathcal{E}_{det}where the hyperparameters λ1subscript𝜆1\lambda_{1} and λ2subscript𝜆2\lambda_{2} control the tradeoff between different loss terms.
66
+
67
+ Later in this section, we introduce the relationship between the new loss function and the covertness goal theoretically. Prior to that, we first present the overall structure of our approach. We first collect a batch of non-watermarked models and extract a sample of non-watermarked weights wn​o​nsubscript𝑤𝑛𝑜𝑛w_{non}. The proposed scheme consists of two components: 1) target model ℱt​g​tsubscriptℱ𝑡𝑔𝑡\mathcal{F}_{tgt} to be embedded with watermark, and 2) detector model ℱd​e​tsubscriptℱ𝑑𝑒𝑡\mathcal{F}_{det} which tries to distinguish ℱt​g​tsubscriptℱ𝑡𝑔𝑡\mathcal{F}_{tgt}’s weights from non-watermarked models’ weights.This detector guides the training process of ℱt​g​tsubscriptℱ𝑡𝑔𝑡\mathcal{F}_{tgt}, ensuring that the learned weights w𝑤w are similar to wn​o​nsubscript𝑤𝑛𝑜𝑛w_{non}.
68
+
69
+ To calculate ℰd​e​tsubscriptℰ𝑑𝑒𝑡\mathcal{E}_{det}, we measure the Earth Mover Distance (EMD) between μn​o​nsubscript𝜇𝑛𝑜𝑛\mu_{non} and μw​msubscript𝜇𝑤𝑚\mu_{wm}:(2)ℰd​e​t=ℱd​e​t​(μw​m,μn​o​n;θ)=infγ∈τ​(μw​m,μn​o​n)(∫𝕎×𝕎∥w−wn​o​n∥​𝑑γ​(w,wn​o​n))subscriptℰ𝑑𝑒𝑡subscriptℱ𝑑𝑒𝑡subscript𝜇𝑤𝑚subscript𝜇𝑛𝑜𝑛𝜃subscriptinfimum𝛾𝜏subscript𝜇𝑤𝑚subscript𝜇𝑛𝑜𝑛subscript𝕎𝕎delimited-∥∥𝑤subscript𝑤𝑛𝑜𝑛differential-d𝛾𝑤subscript𝑤𝑛𝑜𝑛\begin{split}\mathcal{E}_{det}&=\mathcal{F}_{det}(\mu_{wm},\mu_{non};\theta)\\&=\inf_{\gamma\in\tau(\mu_{wm},\mu_{non})}(\int_{\mathbb{W}\times\mathbb{W}}\lVert w-w_{non}\rVert d\gamma(w,w_{non}))\end{split}where θ𝜃\theta is the parameters of ℱd​e​tsubscriptℱ𝑑𝑒𝑡\mathcal{F}_{det}, τ​(μw​m,μn​o​n)𝜏subscript𝜇𝑤𝑚subscript𝜇𝑛𝑜𝑛\tau(\mu_{wm},\mu_{non}) is the collection of all joint probability measures on 𝕎×𝕎𝕎𝕎\mathbb{W}\times\mathbb{W} with two marginal distributions of μw​msubscript𝜇𝑤𝑚\mu_{wm} and μn​o​nsubscript𝜇𝑛𝑜𝑛\mu_{non} respectively. We use the Euclidean distance ∥w−wn​o​n∥delimited-∥∥𝑤subscript𝑤𝑛𝑜𝑛\lVert w-w_{non}\rVert between model parameters to implement EMD. Developing more fine-grained distance metrics between models is an interesting future work.
70
+
71
+ Unfortunately, the computation of Equation 2 is intractable. Instead, we use the Kantorovich-Rubinstein Duality (Arjovskyet al., 2017):ℰd​e​t=ℱd​e​t​(μw​m,μn​o​n;θ)=1K​sup∥ℱd​e​t∥L≤KEwn​o​n∼μn​o​n​[ℱd​e​t​(wn​o​n;θ)]−Ew∼μw​m​[ℱd​e​t​(w;θ)]subscriptℰ𝑑𝑒𝑡subscriptℱ𝑑𝑒𝑡subscript𝜇𝑤𝑚subscript𝜇𝑛𝑜𝑛𝜃1𝐾subscriptsupremumsubscriptdelimited-∥∥subscriptℱ𝑑𝑒𝑡𝐿𝐾subscript𝐸similar-tosubscript𝑤𝑛𝑜𝑛subscript𝜇𝑛𝑜𝑛delimited-[]subscriptℱ𝑑𝑒𝑡subscript𝑤𝑛𝑜𝑛𝜃subscript𝐸similar-to𝑤subscript𝜇𝑤𝑚delimited-[]subscriptℱ𝑑𝑒𝑡𝑤𝜃\begin{split}&\mathcal{E}_{det}=\mathcal{F}_{det}(\mu_{wm},\mu_{non};\theta)\\&=\frac{1}{K}\sup_{\lVert\mathcal{F}_{det}\rVert_{L}\leq K}E_{w_{non}\sim\mu_{non}}[\mathcal{F}_{det}(w_{non};\theta)]-E_{w\sim\mu_{wm}}[\mathcal{F}_{det}(w;\theta)]\end{split}where our detector ℱd​e​tsubscriptℱ𝑑𝑒𝑡\mathcal{F}_{det} is taken from the set of all functions 𝕎→ℝ→𝕎ℝ\mathbb{W}\rightarrow\mathbb{R} satisfying the K𝐾K-Lipschitz condition.
72
+
73
+ We implement ℱd​e​tsubscriptℱ𝑑𝑒𝑡\mathcal{F}_{det} as another neural network to approximate the EMD.The idea of this scheme stems from the training of GAN models (Goodfellow et al., 2014).However, our proposed approach differs from GANs in that ℱt​g​tsubscriptℱ𝑡𝑔𝑡\mathcal{F}_{tgt} does not need the input noise to generate an output. Instead, the generated sample is taken directly from ℱt​g​tsubscriptℱ𝑡𝑔𝑡\mathcal{F}_{tgt} itself, i.e. its weights w𝑤w after each iteration of update.Similar to the principle of GAN, ℱt​g​tsubscriptℱ𝑡𝑔𝑡\mathcal{F}_{tgt} and ℱd​e​tsubscriptℱ𝑑𝑒𝑡\mathcal{F}_{det} can be regarded as playing the following two-player minimax game with function V​(w,θ)𝑉𝑤𝜃V(w,~{}\theta):minw⁡maxθ⁡V​(w,θ)=E​[log⁡ℱd​e​t​(wn​o​n;θ)]+E​[log⁡(1−ℱd​e​t​(w;θ))]subscript𝑤subscript𝜃𝑉𝑤𝜃𝐸delimited-[]subscriptℱ𝑑𝑒𝑡subscript𝑤𝑛𝑜𝑛𝜃𝐸delimited-[]1subscriptℱ𝑑𝑒𝑡𝑤𝜃\begin{split}\min_{w}\max_{\theta}V(w,\theta)&=E[\log\mathcal{F}_{det}(w_{{non}};\theta)]+E[\log(1-\mathcal{F}_{det}(w;\theta))]\end{split}Hence, in addition to training the primary task (ℰosubscriptℰ𝑜\mathcal{E}_{o}) and embedding the watermark message (ℰw​msubscriptℰ𝑤𝑚\mathcal{E}_{{wm}}), w𝑤w in ℱt​g​tsubscriptℱ𝑡𝑔𝑡\mathcal{F}_{tgt} is also updated according to the above equation, accompanied by the training of ℱd​e​tsubscriptℱ𝑑𝑒𝑡\mathcal{F}_{det}:(3)θ^^𝜃\displaystyle\hat{\theta}=maxθ⁡(log⁡ℱd​e​t​(wn​o​n;θ)+log⁡(1−ℱd​e​t​(w;θ)))absentsubscript𝜃subscriptℱ𝑑𝑒𝑡subscript𝑤𝑛𝑜𝑛𝜃1subscriptℱ𝑑𝑒𝑡𝑤𝜃\displaystyle=\max_{\theta}(\log\mathcal{F}_{det}(w_{{non}};\theta)+\log(1-\mathcal{F}_{det}(w;\theta)))(4)w^^𝑤\displaystyle\hat{w}=minw(ℰo(w)+λ1ℰw​m(w)−λ2logℱd​e​t(w;θ))⏟ℰd​e​t\displaystyle=\min_{w}(\mathcal{E}_{o}(w)+\lambda_{1}\mathcal{E}_{{wm}}(w)-\lambda_{2}\underbrace{\log\mathcal{F}_{det}(w;\theta))}_{\mathcal{E}_{det}}During training, we alternately train ℱt​g​tsubscriptℱ𝑡𝑔𝑡\mathcal{F}_{tgt} and ℱd​e​tsubscriptℱ𝑑𝑒𝑡\mathcal{F}_{det} with Equations 4 and 3. We summarize our proposed method in Algorithm 1. The efficiency of this approach has been demonstrated (Arjovskyet al., 2017). We clamp the model parameters to ensure bounded first-order derivatives and therefore the Lipschitz condition (Arjovskyet al., 2017).In order to improve the detection accuracy of ℱd​e​tsubscriptℱ𝑑𝑒𝑡\mathcal{F}_{det} and hence the covertness of final watermarked weights, a feature selection for the input of ℱd​e​tsubscriptℱ𝑑𝑒𝑡\mathcal{F}_{det} is necessary. In our implementation, we sort the weights as the neural networks are invariant in terms of different permutations of neurons in a layer (Ganjuet al., 2018).
74
+
75
+ We note that our watermark hiding technique is compatible with all existing white-box watermarking algorithms (Uchida et al. and DeepSigns). In Section 6.2, we perform ablation study of the effectiveness of this watermarking hiding technique.
76
+
77
+ Recall that a white-box watermarking algorithm Embed consists of three functions: gw​msubscript𝑔𝑤𝑚g_{wm} outputs the features of DNN to be watermarked, e𝑒e extracts the watermark message from the features, and d𝑑d measures the discrepancy between an extracted message and the target message m𝑚m.
78
+
79
+ In our proposed watermark embedding algorithm, we change the extractor e𝑒e to be another neural network, which we refer to as ℱe​x​tsubscriptℱ𝑒𝑥𝑡\mathcal{F}_{ext} with model parameters θ𝜃\theta.To extract a watermark message, we use the feature vector q𝑞q extracted by gw​msubscript𝑔𝑤𝑚g_{wm} as the input to ℱe​x​tsubscriptℱ𝑒𝑥𝑡\mathcal{F}_{ext}, and compare the output to the watermark message m𝑚m using d𝑑d.Due to the strong fitting ability of neural networks, ℱe​x​tsubscriptℱ𝑒𝑥𝑡\mathcal{F}_{ext} can map q𝑞q to a wide range of data types of watermark messages m𝑚m, e.g. a binary string or even a 3-channel image. For different types of m𝑚m, we choose the appropriate d𝑑d accordingly.Formally, our newly proposed white-box watermarking algorithm is defined as follows:
80
+
81
+ •gw​m:𝕎×𝕂→𝕎l:subscript𝑔𝑤𝑚→𝕎𝕂subscript𝕎𝑙g_{wm}:\mathbb{W}\times\mathbb{K}\rightarrow\mathbb{W}_{l} where gw​m​(w,Z)=Z​wsubscript𝑔𝑤𝑚𝑤𝑍𝑍𝑤g_{wm}(w,Z)=Zw.As in Uchida et al.’s scheme the gw​msubscript𝑔𝑤𝑚g_{wm} outputs a layer of w𝑤w.•e:𝕎l×Θ:𝑒subscript𝕎𝑙Θe:\mathbb{W}_{l}\times\Theta where e​(wl,θ)=ℱe​x​t​(wl;θ)𝑒subscript𝑤𝑙𝜃subscriptℱ𝑒𝑥𝑡subscript𝑤𝑙𝜃e(w_{l},\theta)=\mathcal{F}_{ext}(w_{l};\theta). ℱe​x​tsubscriptℱ𝑒𝑥𝑡\mathcal{F}_{ext} is a DNN with parameter θ𝜃\theta, and ΘΘ\Theta is ℱe​x​tsubscriptℱ𝑒𝑥𝑡\mathcal{F}_{ext}’s parameter space.•d:𝕄×𝕄→ℝ:𝑑→𝕄𝕄ℝd:\mathbb{M}\times\mathbb{M}\rightarrow\mathbb{R} varies for different data types of m𝑚m.For binary strings we use cross-entropy as in Uchida et al.’s scheme, for images we use mean squared error for pixel values.
82
+
83
+ Our new algorithm largely increases the capacity of the channel in which the watermark is embedded, and hence allows to embed different data types, including pixel images, whilst in both Uchida et al.’s algorithm and DeepSigns, the embedded watermarks are restricted to binary strings. In the embedding algorithms of those two previous schemes, the number of embedded bits should be smaller than the number of parameters w𝑤w, since otherwise the embedding will be overdetermined and cause large embedding loss. However, in our new scheme, the adjustable parameter is not only w𝑤w but also θ𝜃\theta of ℱe​x​tsubscriptℱ𝑒𝑥𝑡\mathcal{F}_{ext}, which largely increases the capacity of the embedded watermark.
84
+
85
+ Next to enabling larger watermarks, the increased channel capacity of a neural network extractor also enhances the robustness of the watermark. In Uchida et al.’s scheme, e𝑒e is the sigmoid of a linear mapping defined by a random matrix X𝑋X, which can be viewed as a single layer perceptron. The resulting watermark can be easily removed by overwriting. As shown by Wang and Kerschbaum (Wang andKerschbaum, 2019), to remove the original watermark binary string m���m without knowing the secret (key) matrix X𝑋X, an adversary can randomly generate a key matrix X∗superscript𝑋X^{*} of the same dimension, and embed his/her own watermark mrsubscript𝑚𝑟m_{r} into the target neural network.The result of X​w𝑋𝑤Xw is a simple linear projection of w𝑤w. Because of the low capacity of a linear mapping, a randomly generated X∗superscript𝑋X^{*} is likely to be very similar to the original embedding matrix X𝑋X in some of the watermark bit positions.Hence an adversary who randomly embeds a new watermark is likely to overwrite and remove the existing watermark at those bit positions.
86
+
87
+ In our algorithm, we make the watermark extraction more complex and the secret key more difficult to guess by adding more layers to the neural network, i.e. we replace the secret matrix X𝑋X in Uchida et al.’s scheme by a multi-layer neural network, ℱe​x​tsubscriptℱ𝑒𝑥𝑡\mathcal{F}_{ext}.
88
+
89
+ In existing white-box watermarking algorithms, the extractor e𝑒e is a static, pre-determined function depending only on the key k𝑘k. In our scheme, however, ℱe​x​tsubscriptℱ𝑒𝑥𝑡\mathcal{F}_{ext} is trained alongside the target model to enable fast convergence. Instead of only training ℱt​g​tsubscriptℱ𝑡𝑔𝑡\mathcal{F}_{tgt} and updating w𝑤w, we update w𝑤w and θ𝜃\theta alternately to embed watermark message m𝑚m into ℱt​g​tsubscriptℱ𝑡𝑔𝑡\mathcal{F}_{tgt} in an efficient way, as summarized in the following equation:(5)w^,θ^=minw,θ⁡(ℰo​(w)+λ​d​(m,ℱe​x​t​(w,θ)))^𝑤^𝜃subscript𝑤𝜃subscriptℰ𝑜𝑤𝜆𝑑𝑚subscriptℱ𝑒𝑥𝑡𝑤𝜃\hat{w},\hat{\theta}=\min_{w,\theta}(\mathcal{E}_{o}(w)+\lambda d(m,\mathcal{F}_{ext}(w,\theta)))The above equation implies that the extractor e=ℱe​x​t​(⋅;θ)𝑒subscriptℱ𝑒𝑥𝑡⋅𝜃e=\mathcal{F}_{ext}(\cdot;\theta) adapts to the message m𝑚m. If that is the only goal of ℱe​x​tsubscriptℱ𝑒𝑥𝑡\mathcal{F}_{ext}, it will result in a trivial function that ignores the input and maps everything to the watermark message m𝑚m. To ensure the extractor being a reasonable function, we collect non-watermarked weights wn​o​nsubscript𝑤𝑛𝑜𝑛w_{{non}} and train ℱe​x​tsubscriptℱ𝑒𝑥𝑡\mathcal{F}_{ext} to map wn​o​nsubscript𝑤𝑛𝑜𝑛w_{{non}} to some random message mrsubscript𝑚𝑟m_{r} other than watermark message m𝑚m. Hence our new parameter update equations are:
90
+
91
+ (6)θ^=minθ⁡(d​(m,ℱe​x​t​(w;θ))+d​(mr,ℱe​x​t​(wn​o​n;θ)))^𝜃subscript𝜃𝑑𝑚subscriptℱ𝑒𝑥𝑡𝑤𝜃𝑑subscript𝑚𝑟subscriptℱ𝑒𝑥𝑡subscript𝑤𝑛𝑜𝑛𝜃\displaystyle\begin{split}\hat{\theta}&=\min_{\theta}(d(m,\mathcal{F}_{ext}(w;\theta))+d(m_{r},\mathcal{F}_{ext}(w_{{non}};\theta)))\end{split}(7)w^^𝑤\displaystyle\hat{w}=minw(ℰo(w)+λd(m,ℱe​x​t(w;θ)))⏟ℰw​m\displaystyle=\min_{w}(\mathcal{E}_{o}(w)+\lambda\underbrace{d(m,\mathcal{F}_{ext}(w;\theta)))}_{\mathcal{E}_{{wm}}}
92
+
93
+ Because of the adaptive nature of ℱe​x​tsubscriptℱ𝑒𝑥𝑡\mathcal{F}_{ext}, one may worry that two model owners will obtain the same extractor e𝑒e if the watermark message they choose is the same. However, this is nearly impossible. ℱe​x​tsubscriptℱ𝑒𝑥𝑡\mathcal{F}_{ext} is not only adaptive to m𝑚m, but also many other factors such as the watermarked features q𝑞q. Even if all of the settings are the same, since the loss function of neural networks is non-convex and there are numerous local minima, it is almost impossible for two training processes to fall into the same local minimum. We experimentally validate our hypothesis in Appendix E.4.
94
+
95
+ The watermark hiding and embedding algorithms mentioned in the two previous sections are similar in the sense that they both use a separate deep learning model (ℱd​e​tsubscriptℱ𝑑𝑒𝑡\mathcal{F}_{det} and ℱe​x​tsubscriptℱ𝑒𝑥𝑡\mathcal{F}_{ext}) to hide or embed watermarks into the target model.It is hence natural to combine the two algorithms into one new neural network watermarking scheme, which we name it RIGA.The workflow of RIGA  is summarized in Appendix C.In each round of training, ℱt​g​tsubscriptℱ𝑡𝑔𝑡\mathcal{F}_{tgt}’s weights w𝑤w are updated by loss function(8)ℰo+λ1​ℰw​m+λ2​ℰd​e​tsubscriptℰ𝑜subscript𝜆1subscriptℰ𝑤𝑚subscript𝜆2subscriptℰ𝑑𝑒𝑡\mathcal{E}_{o}+\lambda_{1}\mathcal{E}_{{wm}}+\lambda_{2}\mathcal{E}_{det}and ℱe​x​tsubscriptℱ𝑒𝑥𝑡\mathcal{F}_{ext} and ℱd​e​tsubscriptℱ𝑑𝑒𝑡\mathcal{F}_{det} are updated using Equations 6 and 3, respectively.Our newly proposed white-box watermarking scheme for deep neural networks has several advantages including that it does not impact model accuracy, is covert and robust against model modification attacks, such as overwriting, as demonstrated in the evaluation section.
96
+
97
+ We evaluate RIGA’s impact on model performance, as well as the covertness and robustness of RIGA.111RIGA’s implementation is available at https://github.com/TIANHAO-WANG/rigaWe show that our watermark hiding technique significantly improves the covertness of white-box watermarks by evaluating against the watermark detection approaches proposed by Wang andKerschbaum (2019) and Shafieinejad et al. (2019). We demonstrate the robustness of RIGA  by evaluating against three watermark removal techniques: overwriting (Wang andKerschbaum, 2019), fine-tuning (Adi et al., 2018; Chen et al., 2019b), and weights pruning (Uchidaet al., 2017; Rouhaniet al., 2019; Liuet al., 2018a). For all attacks we evaluate, we consider the strongest possible threat models.We refer to Appendix E.4 for results on evaluating RIGA’s validity.
98
+
99
+ Table 1 summarizes the three benchmarks we use. We leave the description of datasets and models to the Appendix D.1 and D.2, respectively.To show the general applicability of RIGA, we embed watermarks into different types of network layers.For Benchmark 1, we embed the watermarks into the weights of the second to last fully-connected layer.For Benchmark 2, we embed the watermarks into the third convolutional layer of the Inception-V3.Because the order of filters is arbitrary for a convolutional layer, we embed the watermark message into the mean weights of a filter at each filter position. For Benchmark 3, the watermarks are embedded into the weights of “input gate layer” of the LSTM layer. We use simple 3-layer fully-connected neural networks as the architecture for both ℱe​x​tsubscriptℱ𝑒𝑥𝑡\mathcal{F}_{ext} and ℱd​e​tsubscriptℱ𝑑𝑒𝑡\mathcal{F}_{det} in our experiments.We use two different data types of watermarks, including a 256-bit random binary string and a 128×128128128128\times 128 3-channel logo image. In the following text, we denote models watermarked with 256-bit binary string as BITS, and models watermarked with logo image as IMG. For example, if a Benchmark 2’s model watermarked with binary string, we denote it as Benchmark 2-BITS.
100
+
101
+ We use Adam optimizer with the learning rate 10−4superscript10410^{-4}, batch size 100, β1=0.5subscript𝛽10.5\beta_{1}=0.5, and β2=0.999subscript𝛽20.999\beta_{2}=0.999 to train these networks. We train 500 non-watermarked models for each of the benchmark and extracts the sample of non-watermarked weights wn​o​nsubscript𝑤𝑛𝑜𝑛w_{non} for implementing Algorithm 1 and 2. We set λ1=0.01subscript𝜆10.01\lambda_{1}=0.01 and λ2=0.1subscript𝜆20.1\lambda_{2}=0.1 in Equation 8.For the GAN-like training, we set weights clipping limit to 0.01 to ensure the Lipschitz condition.
102
+
103
+ For binary string watermarks, we use bit error rate as the metric to measure the distance between original and extracted watermarks. BER is calculated as1n​∑i=1nI​[|m^i−mi|>0.5]1𝑛superscriptsubscript𝑖1𝑛𝐼delimited-[]subscript^𝑚𝑖subscript𝑚𝑖0.5\frac{1}{n}\sum_{i=1}^{n}I[|\hat{m}_{i}-m_{i}|>0.5]where m^^𝑚\hat{m} is the extracted watermark, I𝐼I is the indicator function, and n𝑛n is the size of the watermark.
104
+
105
+ BER may not reflect the exact distance between original and extracted watermarks, as both m^i=0.99subscript^𝑚𝑖0.99\hat{m}_{i}=0.99 and m^i=0.51subscript^𝑚𝑖0.51\hat{m}_{i}=0.51 will be interpreted as “correct bit” for mi=1subscript𝑚𝑖1m_{i}=1. Therefore we introduce Embedding Loss as an alternate metric for binary string watermarks, which computes the binary cross entropy between m^^𝑚\hat{m} and m𝑚m. For image watermarks, we use L2 distance between original and extracted image as the embedding loss.
106
+
107
+ Wang andKerschbaum (2019) report that the existing white-box watermarking algorithms change target model’s weights distribution, which allows one to detect watermark simply by visual inspection.Shafieinejad et al. (2019) propose a more rigorous and supposedly strongest watermark detection attack called property inference attack. The intuition of property inference attack is that the common patterns of watermarked weights can be easily learned by a machine learning model if enough samples of such weights distributions are provided.Specifically, a property inference attack trains a watermark detector ℱd​e​tsubscriptℱ𝑑𝑒𝑡\mathcal{F}_{det} on weights distributions extracted from various neural network models that are either non-watermarked or watermarked.Our evaluation assumes the worst case where the attacker knows the training data, the exact model architecture of ℱt​g​tsubscriptℱ𝑡𝑔𝑡\mathcal{F}_{tgt}, and the feature extraction key kF​Esubscript𝑘𝐹𝐸k_{FE}. Note that this threat model is overly strong, but we consider the worst case here to demonstrate the effectiveness of our watermark hiding algorithm.We leave the details of property inference attack implementation to Appendix D.3.
108
+
109
+ The attacker may attempt to remove the original watermark by embedding his/her own watermarks into the target model. This technique has been shown to be effective against Uchida et al.’s watermark (Wang andKerschbaum, 2019). Specifically, for every epoch, the attacker generates a new watermark message m𝑚m and a secret key kM​Esubscript𝑘𝑀𝐸k_{ME}, embeds this message into the target model and hopes it overwrites the original watermark. In our experiments, we assume the worst case such that the attacker knows everything but the message extraction key kM​Esubscript𝑘𝑀𝐸k_{ME}. That is, the attacker has access to the original training set and has knowledge of the feature extraction key kF​Esubscript𝑘𝐹𝐸k_{FE}, which means that the attacker is aware of the layer in ℱt​g​tsubscriptℱ𝑡𝑔𝑡\mathcal{F}_{tgt} where watermark message m𝑚m is embedded.The only thing the attacker does not know is the model parameters of ℱe​x​tsubscriptℱ𝑒𝑥𝑡\mathcal{F}_{ext}, θ𝜃\theta, which serve as our message extraction key kM​Esubscript𝑘𝑀𝐸k_{ME}.
110
+
111
+ Fine-tuning is the most common watermark removal attacks considered in the literature (Uchidaet al., 2017; Adi et al., 2018; Rouhaniet al., 2019; Chen et al., 2019b; Liuet al., 2018a). Formally, for a trained model ℱt​g​tsubscriptℱ𝑡𝑔𝑡\mathcal{F}_{tgt} with parameter w𝑤w, we fine-tune the model by updating w𝑤w to be Train​(ℰf​t)Trainsubscriptℰ𝑓𝑡\textbf{Train}(\mathcal{E}_{ft}) where ℰf​tsubscriptℰ𝑓𝑡\mathcal{E}_{ft} can be the same as or different from ℰosubscriptℰ𝑜\mathcal{E}_{o}.Note that we train ℱt​g​tsubscriptℱ𝑡𝑔𝑡\mathcal{F}_{tgt} without the watermarking-related regularizers (ℰw​m,ℰd​e​tsubscriptℰ𝑤𝑚subscriptℰ𝑑𝑒𝑡\mathcal{E}_{{wm}},~{}\mathcal{E}_{det}) during fine-tuning. Adi et al. (2018) propose several variants of fine-tuning process. In our evaluation, we always fine-tune the entire model because fine-tuning the output layers only is insufficient to remove white-box watermarks by design, as long as the watermarks are not embeded on the output layers. We evaluate both FTAL and RTAL processes in Adi et al. (2018). Specifically, FTAL directly fine-tunes the entire model; when using RTAL, the output layer is randomly initialized before fine-tuning.
112
+
113
+ The fine-tuning learning rates set in Adi et al. (2018) are the same as those in the original training process. Chen et al. (2019b) argue that the learning rates set in the fine-tuning process in Adi et al. (2018) are too small and propose a generic black-box watermark removal attack called REFIT by setting larger fine-tuning learning rates. Specifically, they set the initial fine-tuning learning rate to be much larger, e.g. 0.05. During the fine-tuning process, the learning rate is decayed by 0.9 for every 500 iteration steps. We evaluate REFIT on RIGA  with many different initial learning rates.
114
+
115
+ Weights pruning, i.e., removing connections between some neurons in the neural network, is another common post-processing operation of DNNs and hence a plausible threat to embedded watermarks. It has been verified that pruning is not effective on removing either Uchida et al. or DeepSigns. For the completeness of the evaluation, we also test the robustness of RIGA against pruning.
116
+
117
+ Previous work found that combining pruning-based techniques with fine-tuning could improve the effectiveness of black-box watermark removal (Liuet al., 2018a). However, as reported in Chen et al. (2019b), pruning is not necessary with a properly designed learning rate schedule for fine-tuning even for black-box watermarks. Nevertheless, we also evaluate the performance of fine-pruning on RIGA  and present results in Appendix E.3.
118
+
119
+ We expect the accuracy of the watermarked deep learning model not to degrade compared to the non-watermarked models. Table 2 summarizes the mean and 95% upper/lower bound of the accuracy of non-watermarked models and models with a watermark message embedded by RIGA. The 95% upper/lower accuracy bound is obtained by training over 1000 models with different random seeds.The results demonstrate that RIGA maintains model accuracy by optimizing the original objective function whilst simultaneously embedding a watermark message.In some cases, e.g. Benchmark 2, we even observe a slight performance improvement. This is because our two extra loss terms (ℰw​msubscriptℰ𝑤𝑚\mathcal{E}_{{wm}} and ℰd​e​tsubscriptℰ𝑑𝑒𝑡\mathcal{E}_{det}) serve as regularizers whereas the non-watermarked models are trained without regularizers. Regularization, in turn, helps the model avoid overfitting by introducing a small amount of noise into the target model. Table 2 also includes the values of the embedding loss for each benchmark after training, which are close to zero in all cases.We conclude that neural networks are capable of maintaining accuracy while memorizing information injected by regularization.
120
+
121
+ Figure 1 (a)-(c) provides an example of the weights distribution for non-watermarked model, regular watermarked model, and watermarked model trained with our watermark hiding technique.When embedding a watermark without applying hiding technique (Figure 1 (b)), the weights distribution is significantly different from the non-watermarked weights distribution (Figure 1 (a)). Yet, our watermark hiding technique makes the weights distribution very similar to the non-watermarked weights distribution, as shown in Figure 1 (c).
122
+
123
+ Figure 1 (d) shows the watermark detection accuracy of property inference attack on Uchida et al., DeepSigns  and RIGA for Benchmark 1-BITS. The attacks perform very differently when the watermarked models are trained with or without our watermark hiding technique.When the hiding technique is not applied, the property inference attack is extremely effective as the accuracy climbs above 95% after 10 epochs of training for all three watermarking algorithms.However, when the watermark hiding algorithm is applied, the performance of property inference attack drops dramatically. The detection accuracies rarely go above 60%, which are only slightly better than random guess.Note that property inference attack has the worst performance on DeepSigns  when embedding watermarks without watermark hiding. We also observe that DeepSigns has the smallest impact on weights distribution compared with Uchida et al. and RIGA. However, the watermark detection accuracy is still above 90% for DeepSigns, which implies that there are some invisible patterns exist in the watermarked weights distribution. Given enough watermarked samples, these patterns can be a property inference attack. On the other hand, our covertness regularizer ℰd​e​tsubscriptℰ𝑑𝑒𝑡\mathcal{E}_{det} is designed specifically to hide the existence of watermarks, and is much more effective in defending against watermark detection.We refer to Appendix E.1 for similar attack results on other benchmarks.
124
+
125
+ We attempt to overwrite the original watermark with new watermarks of either the same size as the original watermark (i.e. a 256-bit binary string or a 128×128128128128\times 128 3-channel logo image), or of a larger size (i.e. a 512-bit binary string or a 256×256256256256\times 256 3-channel logo image).Figure 1 (e) shows the embedding loss of overwriting attack on BITSwatermark for all three benchmarks. In all cases, we can see that there are only tiny increases in the embedding losses. The BER is 0 for all cases in Figure 1 (e). The results show that overwriting by a larger watermark does not cause larger embedding losses after convergence, although the embedding losses increase faster at the beginning of the attack. The attack results on IMG watermark are similar and we leave it to Appendix E.2. We also refer to Appendix E.2 for the results of comparison amongst RIGA, Uchida et al.  and DeepSigns against overwriting attacks.
126
+
127
+ An attacker may also try to remove the watermark by embedding new watermarks into the neural networks with a different watermarking algorithm. However, we find that this approach is not effective for any combinations of the existing watermarking algorithms, and the resulting plots are very similar to Figure 1 (e).
128
+
129
+ REFIT (Chen et al., 2019b) does not provide a concrete method to select the optimal learning rate that can remove the watermark while maintaining model performance. Nevertheless, we search such an optimal learning rate by varying the magnitude of the learning rate during fine-tuning and see its effect on watermark accuracy. Specifically, starting from the original learning rate (0.0001 for all three benchmarks), the learning rate is doubled every 10 epochs in the fine-tuning process.Figure 1 (g) presents the model accuracy and watermark BER of this process for all three benchmarks with the BITS  watermark. We observe that when the learning rate is large enough, e.g. after 40 epochs for Benchmark 1 and 3, or after 60 epochs for Benchmark 2, the model accuracy will significantly decrease at the beginning of each epoch when the learning rate is doubled.When the learning rate is moderately large, the model accuracy may gradually restore within the next 10 epochs. However, for these learning rates, there is no noticeable change in BER.When the learning rate is too large (e.g. after 60 epochs for Benchmark 1), the model will be completely destroyed and there will be no incentive for the attacker to redistribute it.
130
+
131
+ The results in Figure 1 (g) indicate that the optimal fine-tuning learning rates in REFIT that can remove RIGA  while also preserving model performance may not exist or cannot be found easily. To further demonstrate RIGA’s robustness against fine-tuning attacks, we evaluate REFIT with initial learning rates range from 0.01 to 0.05 as typically used in Chen et al. (2019b). In Table 3, we show the model accuracy when the watermarks are moderately removed in fine-tuning attacks on Benchmark 1. That is, for BITS  watermark we record the model accuracy when BER is greater than 15% or the embedding loss is greater than 0.1. For IMG  watermark we record the model accuracy when the embedding loss is greater than 0.1. We denote “N/A” if the BER or embedding loss is never above the threshold during the entire fine-tuning process. As shown in Table 3, for all cases, the model performance is significantly degraded when the watermarks are moderately removed. The attack results on Benchmark 2 and 3 are very similar and we refer to Appendix E.2 for the results.
132
+
133
+ We have also tried fine-tuning the target model with a different dataset (transfer learning case in Chen et al. (2019b)), however we observe that it does not provide additional gain in watermark removal, but causes much larger decrease in model performance.
134
+
135
+ We use the weights pruning approach (Hanet al., 2015) to compress our watermarked deep learning model ℱt​g​tsubscriptℱ𝑡𝑔𝑡\mathcal{F}_{tgt}. Specifically, we set α𝛼\alpha% of the parameters in w𝑤w with the smallest absolute values to zeros. Figure 2 (a) shows pruning’s impact on watermark accuracies for all three benchmarks on BITS. For Benchmark 1-BITS and 2-BITS, RIGA can tolerate up to 99% pruning ratio. For Benchmark 3-BITS, the BER will be around 20% when the pruning ratio is 95% but still far less than 50%, while the watermarked model accuracy has already dropped to around 40%. Given RIGA’s strong robustness when we prune parameters from small to large, we also test the case when we prune parameters from large to small (Figure 2 (b)). Surprisingly, while the model accuracy drops more quickly, the watermarks remain robust against pruning. The BER is still negligible for Benchmark 1 and 2 even when we pruned for over 95% parameters. This implies that RIGA does not embed too much watermark information on any particular subset of the weights. Figure 1 (f) shows the extracted image watermark for Benchmark 1-IMG  after weights pruning attack with different pruning ratios.Even with a pruning ratio of 95%percent9595\%, the logo image can still be clearly recognized, while the pruned model suffers a great accuracy loss.
136
+
137
+ In this work we generalize existing white-box watermarking algorithms for DNN models. We first outlined a theoretical connection to the previous work on white-box watermarking for DNN models. We present a new white-box watermarking algorithm, RIGA, whose watermark extracting function is also a DNN and which is trained using an adversarial network. We performed all plausible watermark detection and removal attacks on RIGA, and showed that RIGA  is both more covert and robust compared to the existing works. For future work, we would like to develop a theoretical boundary for how much similarity between embedded and extracted watermark message is needed for a party can claim ownership of the model.
1910.14303v1.txt ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Detecting or localizing activities in videos lin2017single ; wang2014action ; singh2016multi ; yuan2016temporal ; gavrilyuk2018actor ; tran2018a ; liu2019multi ; feng2018video ; feng2019spatio is a prominent while fundamental problem for video understanding. As videos often contain intricate activities that cannot be indicated by a predefined list of action classes, a new task, namely temporal sentence grounding in videos (TSG) Hendricks2017Localizing ; gao2017tall , has recently attracted much research attention chen2018temporally ; zhang2018man ; chen2019localizing ; liu2018attentive ; chen2019SAP ; chen2019weaklysupervised ; yuan2019thumbnailgeneration . Formally, given an untrimmed video and a natural sentence query, the task aims to identify the start and end timestamps of one specific video segment, which contains activities of interest semantically corresponding to the given sentence query.
2
+
3
+ Most of existing approaches gao2017tall ; Hendricks2017Localizing ; liu2018attentive ; chen2019SAP for the TSG task often sample candidate video segments first, then fuse the sentence and video segment representations together, and thereby evaluate their matching relationships based on the fused features. Lately, some approaches chen2018temporally ; zhang2018man try to directly fuse the sentence information with each video clip, then employ an LSTM or a ConvNet to compose the fused features over time, and thus predict the temporal boundaries of the target video segment. While promising results have been achieved, there are still several problems that need to be concerned.
4
+
5
+ First, previous methods mainly focus on semantically matching sentences and individual video segments or clips, while neglect the important guiding role of sentences to help correlate and compose video contents over time. For example, the target video sequence shown in Figure 1 mainly expresses two distinct activities “woman walks cross the room” and “woman reads the book on the sofa”. Without referring to the sentence, these two distinct activities are not easy to be associated as one whole event. However, the sentence clearly indicates that “The woman takes the book across the room to read it on the sofa”. Keeping such a semantic meaning in mind, persons can easily correlate the two activities together and thereby precisely determine the temporal boundaries. Therefore, how to make use of the sentence semantics to guide the composing and correlating of relevant video contents over time is very crucial for the TSG task. Second, activities contained in videos are usually of diverse visual appearances, and present in various temporal scales. Therefore, the sentence guidance for composing and correlating video contents should also be considered in different temporal granularities and dynamically evolve with the diverse visual appearances.
6
+
7
+ In this paper, we propose a novel semantic conditioned dynamic modulation (SCDM) mechanism, which leverages sentence semantic information to modulate the temporal convolution processes in a hierarchical temporal convolutional network. The SCDM manipulates the temporal feature maps by adjusting the scaling and shifting parameters for feature normalization with referring to the sentence semantics. As such, the temporal convolution process is activated to better associate and compose sentence-related video contents over time. More specifically, such a modulation dynamically evolves when processing different convolutional layers and different locations of feature maps, so as to better align the sentence and video semantics under diverse video contents and various granularities. Coupling SCDM with the temporal convolutional network, our proposed model naturally characterizes the interaction behaviors between sentence and video, leading to a novel and effective architecture for the TSG task.
8
+
9
+ Our main contributions are summarized as follows.(1) We propose a novel semantic conditioned dynamic modulation (SCDM) mechanism, which dynamically modulates the temporal convolution procedure by referring to the sentence semantic information. In doing so, the sentence-related video contents can be temporally correlated and composed to yield a precise temporal boundary prediction.(2) Coupling the proposed SCDM with the hierarchical temporal convolutional network, our model naturally exploits the complicated semantic interactions between sentence and video in various temporal granularities.(3) We conduct experiments on three public datasets, and verify the effectiveness of the proposed SCDM mechanism as well as its coupled temporal convolution architecture with the superiority over the state-of-the-art methods.
10
+
11
+ Temporal sentence grounding in videos is a new task introduced recently gao2017tall ; Hendricks2017Localizing . Some previous works gao2017tall ; Hendricks2017Localizing ; liu2018attentive ; xu2019multilevel ; chen2019SAP ; ge2019mac often adopted a two-stage multimodal matching strategy to solve this problem. They sampled candidate segments from a video first, then integrated the sentence representation with those video segments individually, and thus evaluated their matching relationships through the integrated features.With the above multimodal matching framework, Hendricks et al. Hendricks2017Localizing further introduced temporal position features of video segments into the feature fusion procedure; Gao et al.gao2017tall established a location regression network to adjust the temporal position of the candidate segment to the target segment; Liu et al. liu2018attentive designed a memory attention mechanism to emphasize the visual features mentioned in the sentence; Xu et al. xu2019multilevel and Chen et al. chen2019SAP proposed to generate query-specific proposals as candidate segments; Ge et al. ge2019mac investigated activity concepts from both videos and queries to enhance the temporal sentence grounding.
12
+
13
+ Recently, some other works chen2019SAP ; zhang2018man proposed to directly integrate sentence information with each fine-grained video clip unit, and then predicted the temporal boundary of the target segment by gradually merging the fusion feature sequence over time in an end-to-end fashion. Specifically, Chen et al. chen2018temporally aggregated frame-by-word interactions between video and language through a Match-LSTM wang2016machine . Zhang et al. zhang2018man adopted the Graph Convolutional Network (GCN) kipf2017semi to model relations among candidate segments produced from a convolutional neural network.
14
+
15
+ Although promising results have been achieved by existing methods, they all focus on better aligning semantic information between sentence and video, while neglect the fact that sentence information plays an important role in correlating the described activities in videos. Our work firstly introduces the sentence information as a critical prior to compose and correlate video contents over time, subsequently sentence-guided video composing is dynamically performed and evolved in a hierarchical temporal convolution architecture, in order to cover the diverse video contents of various temporal granularities.
16
+
17
+ Given an untrimmed video V𝑉V and a sentence query S𝑆S, the TSG task aims to determine the start and end timestamps of one video segment, which semantically corresponds to the given sentence query. In order to perform the temporal grounding, the video is first represented as 𝐕={𝐯t}t=1T𝐕superscriptsubscriptsubscript𝐯𝑡𝑡1𝑇\mathbf{V}=\left\{\mathbf{v}_{t}\right\}_{t=1}^{T} clip-by-clip, and accordingly the query sentence is represented as 𝐒={𝐬n}n=1N𝐒superscriptsubscriptsubscript𝐬𝑛𝑛1𝑁\mathbf{S}=\left\{\mathbf{s}_{n}\right\}_{n=1}^{N} word-by-word.
18
+
19
+ In this paper, we propose one novel model to handle the TSG task, as illustrated in Figure 2. Specifically, the proposed model consists of three components, namely the multimodal fusion, the semantic modulated temporal convolution, and the position prediction. Please note that the three components fully couple together and can therefore be trained in an end-to-end manner.
20
+
21
+ The TSG task requires to understand both the sentence and video. As such, in order to correlate their corresponding semantic information, we first let each video clip meet and interact with the entire sentence, which is formulated as:𝐟t=ReLU​(𝐖f​(𝐯t∥𝐬¯)+𝐛f),subscript𝐟𝑡ReLUsuperscript𝐖𝑓conditionalsubscript𝐯𝑡¯𝐬superscript𝐛𝑓\mathbf{\mathbf{f}}_{t}=\text{ReLU}\left(\mathbf{W}^{f}\big{(}\mathbf{v}_{t}\|\mathbf{\overline{s}}\big{)}+\mathbf{b}^{f}\right),(1)where 𝐖fsuperscript𝐖𝑓\mathbf{W}^{f} and 𝐛fsuperscript𝐛𝑓\mathbf{b}^{f} are the learnable parameters. 𝐬¯¯𝐬\mathbf{\overline{s}} denotes the global sentence representation, which can be obtained by simply averaging the word-level sentence representation 𝐒𝐒\mathbf{S}. With such a multimodal fusion strategy, the yielded representation 𝐅={𝐟t}t=1T∈ℛT×df𝐅superscriptsubscriptsubscript𝐟𝑡𝑡1𝑇superscriptℛ𝑇subscript𝑑𝑓\mathbf{F}=\{\mathbf{f}_{t}\}_{t=1}^{T}\in\mathcal{R}^{T\times d_{f}} captures the interactions between sentence and video clips in a fine-grained manner. The following semantic modulated temporal convolution will gradually correlate and compose such representations together over time, expecting to help produce accurate temporal boundary predictions of various scales.
22
+
23
+ As aforementioned, the sentence-described activities in videos may have various durations and scales. Therefore, the fused multimodal representation 𝐅𝐅\mathbf{F} should be exploited from different temporal scales to comprehensively characterize the temporal diversity of video activities. Inspired by the efficient single-shot object and action detections liu2016ssd ; lin2017single , the temporal convolutional network established via one hierarchical architecture is used to produce multi-scale features to cover the activities of various durations. Moreover, in order to fully exploit the guiding role of the sentence, we propose one novel semantic conditioned dynamic modulation (SCDM) mechanism, which relies on the sentence semantics to modulate the temporal convolution operations for better correlating and composing the sentence-related video contents over time. In the following, we first review the basics of the temporal convolutional network. Afterwards, the proposed SCDM will be described in details.
24
+
25
+ Taking the multimodal fusion representation 𝐅𝐅\mathbf{F} as input, the standard temporal convolution operation in this paper is denoted as Conv​(θk,θs,dh)Convsubscript𝜃𝑘subscript𝜃𝑠subscript𝑑ℎ\text{Conv}(\theta_{k},\theta_{s},d_{h}), where θksubscript𝜃𝑘\theta_{k}, θssubscript𝜃𝑠\theta_{s}, and dhsubscript𝑑ℎd_{h} indicate the kernel size, stride size, and filter numbers, respectively. Meanwhile, the nonlinear activation, such as ReLU, is then followed with the convolution operation to construct a basic temporal convolutional layer. By setting θksubscript𝜃𝑘\theta_{k} as 3 and θssubscript𝜃𝑠\theta_{s} as 2, respectively, each convolutional layer will halve the temporal dimension of the input feature map and meanwhile expand the receptive field of each feature unit within the map. By stacking multiple layers, a hierarchical temporal convolutional network is constructed, with each feature unit in one specific feature map corresponding to one specific video segment in the original video. For brevity, we denote the output feature map of the k𝑘k-th temporal convolutional layer as 𝐀k={𝐚k,i}i=1Tk∈ℛTk×dhsubscript𝐀𝑘superscriptsubscriptsubscript𝐚𝑘𝑖𝑖1subscript𝑇𝑘superscriptℛsubscript𝑇𝑘subscript𝑑ℎ\mathbf{A}_{k}=\{\mathbf{a}_{k,i}\}_{i=1}^{T_{k}}\in\mathcal{R}^{T_{k}\times d_{h}}, where Tk=Tk−1/2subscript𝑇𝑘subscript𝑇𝑘12T_{k}=T_{k-1}/2 is the temporal dimension, and 𝐚k,i∈𝐑dhsubscript𝐚𝑘𝑖superscript𝐑subscript𝑑ℎ\mathbf{a}_{k,i}\in\mathbf{R}^{d_{h}} denotes the i𝑖i-th feature unit at the the k𝑘k-th layer feature map.
26
+
27
+ Regarding video activity localization, besides the video clip contents, their temporal correlations play an even more important role. For the TSG task, the query sentence, presenting rich semantic indications on such important correlations, provides crucial information to temporally associate and compose the consecutive video contents over time.Based on the above considerations, in this paper, we propose a novel SCDM mechanism, which relies on the sentence semantic information to dynamically modulate the feature composition process in each temporal convolutional layer.
28
+
29
+ Specifically, as shown in Figure 3(b), given the sentence representation 𝐒={𝐬n}n=1N𝐒superscriptsubscriptsubscript𝐬𝑛𝑛1𝑁\mathbf{S}=\{\mathbf{s}_{n}\}_{n=1}^{N} and one feature map extracted from one specific temporal convolutional layer 𝐀={𝐚i}𝐀subscript𝐚𝑖\mathbf{A}=\{\mathbf{a}_{i}\} (we omit the layer number here), we attentively summarize the sentence representation to 𝐜isubscript𝐜𝑖\mathbf{c}_{i} with respect to each feature unit 𝐚isubscript𝐚𝑖\mathbf{a}_{i}:ρin=softmax​(𝐰⊤​tanh​(𝐖s​𝐬n+𝐖a​𝐚i+𝐛)),𝐜i=∑n=1Nρin​𝐬n,\begin{split}\rho_{i}^{n}=\text{softmax}\big{(}\mathbf{w}^{\top}\text{tanh}\left(\mathbf{W}^{s}\mathbf{s}_{n}+\mathbf{W}^{a}\mathbf{a}_{i}+\mathbf{b}\right)\big{)},\qquad\mathbf{c}_{i}=\sum_{n=1}^{N}\rho_{i}^{n}\mathbf{s}_{n},\end{split}(2)
30
+
31
+ where 𝐰𝐰\mathbf{w}, 𝐖ssuperscript𝐖𝑠\mathbf{W}^{s}, 𝐖asuperscript𝐖𝑎\mathbf{W}^{a}, and 𝐛𝐛\mathbf{b} are the learnable parameters. Afterwards, two fully-connected (FC) layers with the tanh activation function are used to generate two modulation vectors γic∈𝐑dhsubscriptsuperscript𝛾𝑐𝑖superscript𝐑subscript𝑑ℎ\gamma^{c}_{i}\in\mathbf{R}^{d_{h}} and βic∈𝐑dhsubscriptsuperscript𝛽𝑐𝑖superscript𝐑subscript𝑑ℎ\beta^{c}_{i}\in\mathbf{R}^{d_{h}}, respectively:γic=tanh​(𝐖γ​𝐜i+𝐛γ),βic=tanh​(𝐖β​𝐜i+𝐛β),formulae-sequencesubscriptsuperscript𝛾𝑐𝑖tanhsuperscript𝐖𝛾subscript𝐜𝑖superscript𝐛𝛾subscriptsuperscript𝛽𝑐𝑖tanhsuperscript𝐖𝛽subscript𝐜𝑖superscript𝐛𝛽\begin{split}\gamma^{c}_{i}&=\text{tanh}(\mathbf{W}^{\gamma}\mathbf{c}_{i}+\mathbf{b}^{\gamma}),\\\beta^{c}_{i}&=\text{tanh}(\mathbf{W}^{\beta}\mathbf{c}_{i}+\mathbf{b}^{\beta}),\end{split}(3)where 𝐖γsuperscript𝐖𝛾\mathbf{W}^{\gamma}, 𝐛γsuperscript𝐛𝛾\mathbf{b}^{\gamma}, 𝐖βsuperscript𝐖𝛽\mathbf{W}^{\beta}, and 𝐛βsuperscript𝐛𝛽\mathbf{b}^{\beta} are the learnable parameters. Finally, based on the generated modulation vectors γicsubscriptsuperscript𝛾𝑐𝑖\gamma^{c}_{i} and βicsubscriptsuperscript𝛽𝑐𝑖\beta^{c}_{i}, the feature unit 𝐚isubscript𝐚𝑖\mathbf{a}_{i} is modulated as:𝐚i^=γic⋅𝐚i−μ​(𝐀)σ​(𝐀)+βic.^subscript𝐚𝑖⋅subscriptsuperscript𝛾𝑐𝑖subscript𝐚𝑖𝜇𝐀𝜎𝐀subscriptsuperscript𝛽𝑐𝑖\begin{split}\hat{\mathbf{a}_{i}}=\gamma^{c}_{i}\cdot\frac{\mathbf{a}_{i}-\mu(\mathbf{A})}{\sigma({\mathbf{A})}}+\beta^{c}_{i}.\end{split}(4)
32
+
33
+ With the proposed SCDM, the temporal feature maps, yielded during the temporal convolution process, are meticulously modulated by scaling and shifting the corresponding normalized features under the sentence guidance. As such, each temporal feature map will absorb the sentence semantic information, and further activate the following temporal convolutional layer to better correlate and compose the sentence-related video contents over time. Coupling the proposed SCDM with each temporal convolutional layer, we thus obtain the novel semantic modulated temporal convolution as shown in the middle part of Figure 2.
34
+
35
+ Discussion. As shown in Figure 3, our proposed SCDM differs from the existing conditional batch/instance normalization vries2017modulating ; dumoulin2017a , where the same γcsuperscript𝛾𝑐\gamma^{c} and βcsuperscript𝛽𝑐\beta^{c} are applied within the whole batch/instance. On the contrary, as indicated in Equations (2)-(4), our SCDM dynamically aggregates the meaningful words with referring to different video contents, making the yielded γcsuperscript𝛾𝑐\gamma^{c} and βcsuperscript𝛽𝑐\beta^{c} dynamically evolve for different temporal units within each specific feature map. Such a dynamic modulation enables each temporal feature unit to be interacted with each word to collect useful grounding cues along the temporal dimension. Therefore, the sentence-video semantics can be better aligned over time to support more precise boundary predictions. Detailed experimental demonstrations will be given in Section 4.5.
36
+
37
+ Similar to liu2016ssd ; lin2017single for object/action detections, during the prediction, lower and higher temporal convolutional layers are used to localize short and long activities, respectively. As illustrated in Figure 4, regarding a feature map with temporal dimension Tksubscript𝑇𝑘T_{k}, the basic temporal span for each feature unit within this feature map is 1/Tk1subscript𝑇𝑘1/T_{k}. We impose different scale ratios based on the basic span, and denote them as r∈R={0.25,0,5,0.75,1.0}𝑟𝑅0.25050.751.0r\in R=\{0.25,0,5,0.75,1.0\}. As such, for the i𝑖i-th feature unit of the feature map, we can compute the length of the scaled spans within it as r/Tk𝑟subscript𝑇𝑘r/T_{k}, and the center of these spans is (i+0.5)/Tk𝑖0.5subscript𝑇𝑘(i+0.5)/T_{k}. For the whole feature map, there are a total number of Tk⋅|R|⋅subscript𝑇𝑘𝑅T_{k}\cdot|R| scaled spans within it, with each span corresponding to a candidate video segment for grounding.
38
+
39
+ Then, we impose an additional set of convolution operations on the layer-wise temporal feature maps to predict the target video segment position. Specifically, each candidate segment will be associated with a prediction vector p=(po​v​e​r,△​c,△​w)𝑝superscript𝑝𝑜𝑣𝑒𝑟△𝑐△𝑤p=(p^{over},\triangle c,\triangle w), where po​v​e​rsuperscript𝑝𝑜𝑣𝑒𝑟p^{over} is the predicted overlap score between the candidate and ground-truth segment, and △​c△𝑐\triangle c and △​w△𝑤\triangle w are the temporal center and width offsets of the candidate segment relative to the ground-truth. Suppose that the center and width for a candidate segment are μcsuperscript𝜇𝑐\mu^{c} and μwsuperscript𝜇𝑤\mu^{w}, respectively. Then the center ϕcsuperscriptitalic-ϕ𝑐\phi^{c} and width ϕwsuperscriptitalic-ϕ𝑤\phi^{w} of the corresponding predicted segment are therefore determined by:ϕc=μc+αc⋅μw⋅△​c,ϕw=μw⋅e​x​p​(αw⋅△​w),formulae-sequencesuperscriptitalic-ϕ𝑐superscript𝜇𝑐⋅superscript𝛼𝑐superscript𝜇𝑤△𝑐superscriptitalic-ϕ𝑤⋅superscript𝜇𝑤𝑒𝑥𝑝⋅superscript𝛼𝑤△𝑤\phi^{c}=\mu^{c}+\alpha^{c}\cdot\mu^{w}\cdot\triangle c,\qquad\phi^{w}=\mu^{w}\cdot exp(\alpha^{w}\cdot\triangle w),(5)where αcsuperscript𝛼𝑐\alpha^{c} and αwsuperscript𝛼𝑤\alpha^{w} both are used for controlling the effect of location offsets to make location prediction stable, which are set as 0.1 empirically. As such, for a feature map with temporal dimension Tksubscript𝑇𝑘T_{k}, we can obtain a predicted segment set ΦksubscriptΦ𝑘\Phi_{k} = {(pjo​v​e​r,ϕjc,ϕjw)superscriptsubscript𝑝𝑗𝑜𝑣𝑒𝑟subscriptsuperscriptitalic-ϕ𝑐𝑗subscriptsuperscriptitalic-ϕ𝑤𝑗(p_{j}^{over},\phi^{c}_{j},\phi^{w}_{j})}Tk⋅|R|j=1superscriptsubscriptabsent𝑗1⋅subscript𝑇𝑘𝑅{}_{j=1}^{T_{k}\cdot|R|}. The total predicted segment set is therefore denoted as 𝚽={Φk}k=1K𝚽superscriptsubscriptsubscriptΦ𝑘𝑘1𝐾\mathbf{\Phi}=\{\Phi_{k}\}_{k=1}^{K}, where K𝐾K is the number of temporal feature maps.
40
+
41
+ Training: Our training sample consists of three elements: an input video, a sentence query, and the ground-truth segment. We treat candidate segments within different temporal feature maps as positive if their tIoUs (temporal Intersection-over-Union) with ground-truth segments are larger than 0.5. Our training objective includes an overlap prediction loss Lo​v​e​rsubscript𝐿𝑜𝑣𝑒𝑟L_{over} and a location prediction loss Ll​o​csubscript𝐿𝑙𝑜𝑐L_{loc}. The Lo​v​e​rsubscript𝐿𝑜𝑣𝑒𝑟L_{over} term is realized as a cross-entropy loss, which is defined as:Lo​v​e​r=∑z∈{p​o​s,n​e​g}−1Nz​∑iNzgio​v​e​r​log⁡(pio​v​e​r)+(1−gio​v​e​r)​log⁡(1−pio​v​e​r),subscript𝐿𝑜𝑣𝑒𝑟subscript𝑧𝑝𝑜𝑠𝑛𝑒𝑔1subscript𝑁𝑧superscriptsubscript𝑖subscript𝑁𝑧superscriptsubscript𝑔𝑖𝑜𝑣𝑒𝑟superscriptsubscript𝑝𝑖𝑜𝑣𝑒𝑟1superscriptsubscript𝑔𝑖𝑜𝑣𝑒𝑟1superscriptsubscript𝑝𝑖𝑜𝑣𝑒𝑟\begin{split}L_{over}=\sum_{z\in\{pos,neg\}}-\frac{1}{N_{z}}\sum_{i}^{N_{z}}g_{i}^{over}\log(p_{i}^{over})+(1-g_{i}^{over})\log(1-p_{i}^{over}),\end{split}(6)where go​v​e​rsuperscript𝑔𝑜𝑣𝑒𝑟g^{over} is the ground-truth tIoU between the candidate and target segments, and po​v​e​rsuperscript𝑝𝑜𝑣𝑒𝑟p^{over} is the predicted overlap score. The Ll​o​csubscript𝐿𝑙𝑜𝑐L_{loc} term measures the Smooth L1subscript𝐿1L_{1} loss girshick2015fast for positive samples:Ll​o​c=1Np​o​s​∑iNp​o​sS​L1​(gic−ϕic)+S​L1​(giw−ϕiw),subscript𝐿𝑙𝑜𝑐1subscript𝑁𝑝𝑜𝑠superscriptsubscript𝑖subscript𝑁𝑝𝑜𝑠𝑆subscript𝐿1superscriptsubscript𝑔𝑖𝑐superscriptsubscriptitalic-ϕ𝑖𝑐𝑆subscript𝐿1superscriptsubscript𝑔𝑖𝑤superscriptsubscriptitalic-ϕ𝑖𝑤\begin{split}L_{loc}=\frac{1}{N_{pos}}\sum_{i}^{N_{pos}}SL_{1}(g_{i}^{c}-\phi_{i}^{c})+SL_{1}(g_{i}^{w}-\phi_{i}^{w}),\end{split}(7)where gcsuperscript𝑔𝑐g^{c} and gwsuperscript𝑔𝑤g^{w} are the center and width of the ground-truth segment, respectively.
42
+
43
+ The two losses are jointly considered for training our proposed model, with λ𝜆\lambda and η𝜂\eta balancing their contributions:La​l​l=λ​Lo​v​e​r+η​Ll​o​c.subscript𝐿𝑎𝑙𝑙𝜆subscript𝐿𝑜𝑣𝑒𝑟𝜂subscript𝐿𝑙𝑜𝑐\begin{split}L_{all}=\lambda L_{over}+\eta L_{loc}.\end{split}(8)
44
+
45
+ Inference: The predicted segment set 𝚽𝚽\mathbf{\Phi} of different temporal granularities can be generated in one forward pass. All the predicted segments within 𝚽𝚽\mathbf{\Phi} will be ranked and refined with non maximum suppression (NMS) according to the predicted po​v​e​rsuperscript𝑝𝑜𝑣𝑒𝑟p^{over} scores. Afterwards, the final temporal grounding result is obtained.
46
+
47
+ We validate the performance of our proposed model on three public datasets for the TSG task: TACoS Regneri2013Grounding , Charades-STA gao2017tall , and AcitivtyNet Captions krishna2017dense . The TACoS dataset mainly contains videos depicting human’s cooking activities, while Charades-STA and ActivityNet Captions focus on more complicated human activities in daily life.
48
+
49
+ For fair comparisons, we adopt “R@n, IoU@m” as our evaluation metrics as in previous works chen2018temporally ; gao2017tall ; zhang2018man ; wu2018multi ; liu2018attentive . Specifically, “R@n, IoU@m” is defined as the percentage of the testing queries having at least one hitting retrieval (with IoU larger than m𝑚m) in the top-n𝑛n retrieved segments.
50
+
51
+ Following the previous methods, 3D convolutional features (C3D tran2015learning for TACoS and ActivityNet, and I3D carreira2017quo for Charades-STA) are extracted to encode videos, with each feature representing a 1-second video clip. According to the video duration statistics, the length of input video clips is set as 1024 for both ActivityNet Captions and TACoS, and 64 for Charades-STA to accommodate the temporal convolution. Longer videos are truncated, and shorter ones are padded with zero vectors. For the design of temporal convolutional layers, 6 layers with {32, 16, 8, 4, 2, 1} temporal dimensions, 6 layers with {512, 256, 128, 64, 32, 16} temporal dimensions, and 8 layers with {512, 256, 128, 64, 32, 16, 8, 4} temporal dimensions are set for Charades-STA, TACoS, and ActivityNet Captions, respectively. All the first temporal feature maps will not be used for location prediction, because the receptive fields of the corresponding feature units are too small and are too rare to contain target activities. To save model memory footprint, the SCDM mechanism is only performed on the following temporal feature maps which directly serve for position prediction. For sentence encoding, we first embed each word in sentences with the Glove pennington2014glove , and then employ a Bi-directional GRU to encode the word embedding sequence. As such, words in sentences are finally represented with their corresponding GRU hidden states. Hidden dimension of the sentence Bi-directional GRU, dimension of the multimodal fused features dfsubscript𝑑𝑓d_{f}, and the filter number dhsubscript𝑑ℎd_{h} for temporal convolution operations are all set as 512 in this paper. The trade-off parameters of the two loss terms λ𝜆\lambda and η𝜂\eta are set as 100 and 10, respectively.
52
+
53
+ We compare our proposed model with the following state-of-the-art baseline methods on the TSG task. CTRL gao2017tall : Cross-model Temporal Regression Localizer. ACRN liu2018attentive : Attentive Cross-Model Retrieval Network. TGN chen2018temporally : Temporal Ground-Net. MCF wu2018multi : Multimodal Circulant Fusion. ACL ge2019mac : Activity Concepts based Localizer. SAP chen2019SAP : A two-stage approach based on visual concept mining. Xu et al. xu2019multilevel : A two-stage method (proposal generation + proposal rerank) exploiting sentence re-construction. MAN zhang2018man : Moment Alignment Network. We use Ours-SCDM to refer our temporal convolutional network coupled with the proposed SCDM mechanism.
54
+
55
+ Table 1 and Table 2 report the performance comparisons between our model and the existing methods on the aforementioned three public datasets. Overall, Ours-SCDM achieves the highest temporal sentence grounding accuracy, demonstrating the superiority of our proposed model. Notably, for localizing complex human activities in Charades-STA and ActivityNet Captions datasets, Ours-SCDM significantly outperforms the state-of-the-art methods with 10.71% and 6.26% absolute improvements in the R@1,IoU@0.7 metrics, respectively. Although Ours-SCDM achieves lower results of R@5,IoU@0.5 on the Charades-STA dataset, it is mainly due to the biased annotations in this dataset. For example, in Charades-STA, the annotated ground-truth segments are 10s on average while the video duration is only 30s on average. Randomly selecting one candidate segment can also achieve competing temporal grounding results. It indicates that the Recall values under higher IoUs are more stable and convincing even considering the dataset biases. The performance improvements under the high IoU threshold demonstrate that Ours-SCDM can generate grounded video segments of more precise boundaries. For TACoS, the cooking activities take place in the same kitchen scene with some slightly varied cooking objects (e.g., chopping board, knife, and bread, as shown in the second example of Figure 5). Thus, it is hard to localize such fine-grained activities. However, our proposed model still achieves the best results, except slight worse performances in R@5,IoU@0.3.
56
+
57
+ The main reasons for our proposed model outperforming the competing models lie in two folds. First, the sentence information is fully leveraged to modulate the temporal convolution processes, so as to help correlate and compose relevant video contents over time to support the temporal boundary prediction. Second, the modulation procedure dynamically evolves with different video contents in the hierarchical temporal convolution architecture, and therefore characterizes the diverse sentence-video semantic interactions of different granularities.
58
+
59
+ In this section, we perform ablation studies to examine the contributions of our proposed SCDM. Specifically, we re-train our model with the following four settings.•Ours-w/o-SCDM: SCDM is replaced by the plain batch normalization ioffe2015batch .•Ours-FC: Instead of performing SCDM, one FC layer is used to fuse each temporal feature unit with the global sentence representation 𝐬¯¯𝐬\mathbf{\overline{s}} after each temporal convolutional layer.•Ours-MUL: Instead of performing SCDM, element-wise multiplication between each temporal feature unit and the global sentence representation 𝐬¯¯𝐬\mathbf{\overline{s}} is performed after each temporal convolutional layer.•Ours-SCM: We use the global sentence representation 𝐬¯¯𝐬\mathbf{\overline{s}} to produce γcsuperscript𝛾𝑐\gamma^{c} and βcsuperscript𝛽𝑐\beta^{c} without dynamically changing these two modulation vectors with respect to different feature units.
60
+
61
+ Table 3 shows the performance comparisons of our proposed full model Ours-SCDM w.r.t. these ablations on the Charades-STA dataset (please see results on the other datasets in our supplemental material). Without considering SCDM, the performance of the model Ours-w/o-SCDM degenerates dramatically. It indicates that only relying on multimodal fusion to exploit the relationship between video and sentence is not enough for the TSG task. The critical sentence semantics should be intensified to guide the temporal convolution procedure so as to better link the sentence-related video contents over time. However, roughly introducing sentence information in the temporal convolution architecture like Ours-MUL and Ours-FC does not achieve satisfying results. Recall that temporal feature maps in the proposed model are already multimodal representations since the sentence information has been integrated during the multimodal fusion process. Directly coupling the global sentence representation 𝐬¯¯𝐬\mathbf{\overline{s}} with temporal feature units could possibly disrupt the visual correlations and temporal dependencies of the videos, which poses a negative effect on the temporal sentence grounding performance. In contrast, the proposed SCDM mechanism modulates the temporal feature maps by manipulating their scaling and shifting parameters under the sentence guidance, which is lightweight while meticulous, and still achieves the best results.
62
+
63
+ In addition, comparing Ours-SCM with Ours-SCDM, we can find that dynamically changing the modulation vectors γcsuperscript𝛾𝑐\gamma^{c} and βcsuperscript𝛽𝑐\beta^{c} with respect to different temporal feature units is beneficial, with R@5,IoU@0.7 increasing from 54.57% of Ours-SCM to 58.08% of Ours-SCDM. The SCDM intensifies meaningful words and cues in sentences catering for different temporal feature units, with the motivation that different video segments may contain diverse visual contents and express different semantic meanings. Establishing the semantic interaction between these two modalities in a dynamic way can better align the semantics between sentence and diverse video contents, yielding more precise temporal boundary predictions.
64
+
65
+ Table 4 shows the run-time efficiency, model size (#param), and memory footprint of different methods. Specifically, “Run-Time” denotes the average time to localize one sentence in a given video. The methods with released codes are run with one Nvidia TITAN XP GPU. The experiments are run on the TACoS dataset since the videos in this dataset are relatively long (7 minutes on average), and are appropriate to evaluate the temporal grounding efficiency of different methods. It can be observed that ours-SCDM achieves the fastest run-time with the smallest model size. Both CTRL and ACRN methods need to sample candidate segments with various sliding windows in the videos first, and then match the input sentence with each of the segments individually. Such a two-stage architecture will inevitably influence the temporal sentence grounding efficiency, since the matching procedure through sliding window is quite time-consuming. In contrast, Ours-SCDM adopts a hierarchical convolution architecture, and naturally covers multi-scale video segments for grounding with multi-layer temporal feature maps. Thus, we only need to process the video in one pass of temporal convolution and then get the TSG results, and achieve higher efficiency. In addition, SCDM only needs to control the feature normalization parameters and is lightweight towards the overall convolution architecture. Therefore, ours-SCDM also has smaller model size.
66
+
67
+ Some qualitative examples of our model are illustrated in Figure 5. Evidently, our model can produce accurate segment boundaries for the TSG task. Moreover, we alsovisualize the attention weights (defined in Equation (2)) produced by SCDM when it processes different temporal units. It can be observed that different video contents attentively trigger different words in sentences so as to better align their semantics. For example, in the first example, the words “walking” and “open” obtain higher attention weights in the ground-truth segment since the described action indeed happens there. While in the other region, the word attention weights are more inclined to be an even distribution.
68
+
69
+ In order to gain more insights of our proposed SCDM mechanism, we visualize the temporal feature maps produced by the variant model Ours-w/o-SCDM and the full-model Ours-SCDM. For both of the trained models, we extract their temporal feature maps, and subsequently apply t𝑡t-SNE maaten2008visualizing to each temporal feature unit within these maps. Since each temporal feature unit corresponds to one specific location in the original video, we then assign the corresponding video clips to the positions of these feature units in the t𝑡t-SNE embedded space. As illustrated in Figure 6, temporal feature maps of two testing videos are visualized, where the video clips marked with red color denote the ground-truth segments of the given sentence queries. Interestingly, it can be observed that through SCDM processing, video clips within ground-truth segments are more tightly grouped together. In contrast, the clips without SCDM processing are separated in the learned feature space. This demonstrates that SCDM successfully associates the sentence-related video contents according to the sentence semantics, which is beneficial to the later temporal boundary predictions. More visualization results are provided in the supplemental material.
70
+
71
+ In this paper, we proposed a novel semantic conditioned dynamic modulation mechanism for tackling the TSG task. The proposed SCDM leverages the sentence semantics to modulate the temporal convolution operations to better correlate and compose the sentence-related video contents over time. As SCDM dynamically evolves with the diverse video contents of different temporal granularities in thetemporal convolution architecture,the sentence described video contents are tightly correlated and composed, leading to more accurate temporal boundary predictions.The experimental results obtained on three widely-used datasets further demonstrate the superiority of the proposed SCDM on the TSG task.
72
+
73
+ This work was supported by National Natural Science Foundation of China Major Project No.U1611461 and Shenzhen Nanshan District Ling-Hang Team Grant under No.LHTD20170005.
1910.14375v2.txt ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ In speech production, articulatory movements provide an intermediate representation between neuro-motor planning (high level) and speech acoustics (low level) [1]. Fig. 1 demonstrates the top-down process involved in human speech production. Neuro-motor planning in the brain primarily aims to convey linguistic information (to express the thought) which are discrete abstract units. This information is passed through motor nerves to activate vocal muscles, which results in different temporally overlapping gestures of speech articulators (namely lips, tongue tip, tongue body, tongue dorsum, velum, and larynx), each of which regulates constriction in different parts of the vocal tract [2, 3]. These articulatory gestures, in turn, modulate the spectrum of acoustic signal, which results in the speech sound wave.The acoustic features extracted from speech, embed para-linguistic information along with the linguistic content including speaker identity, age, gender, and emotion state. The para-linguistic information is often encoded in the dynamics involved in the muscle coordination, articulatory timing, and vocal tract morphology of the speaker.To estimate articulatory movements, in this work, we consider phonemes as a representative of high level information, and Mel-Frequency Cepstral Coefficeints (MFCC) as acoustic features.We also consider a representation by combining timing information with the phoneme sequence, which captures both linguistic and timing information but lacks the para-linguistic information and this could be treated as an intermediate representation between phonemes and MFCCs. From the acoustic features perspective, MFCC have been shown to carry maximal mutual information with articulatory features [4, 5]. Unlike estimating from MFCC (frame-to-frame estimation), estimating articulatory movements from discrete phonemes is a top-down approach and very challenging due to the absence of timing information. It is unclear to what extent we can estimate articulatory movement from the phonemes. In this work, we investigate on the accuracy with which the articulatory representations can be predicted from the phoneme sequence, and how it differs with respect to the acoustic features and phoneme sequence with timing information.
2
+
3
+ Knowledge about the articulatory position information along with the speech acoustics have shown to benefit applications like language learning [6, 7], automatic speech recognition [8, 9], and speech synthesis [10, 11] tasks. A rich literature exists in estimating articulatory movements from acoustic features of speech which is typically known as acoustic-to-articulatory inversion (AAI). Various approaches were proposed includingGaussian Mixture Model (GMM) [12], Hidden Markov Model (HMM) [13], and neural network [14, 15]. The state-of-art performance is achieved by bidirectional long short-term memory networks (BLSTM)[16, 17].
4
+
5
+ On the other hand, there have been few attempts for estimating articulatory movements from text or phonological units. These attempts typically deployed the techniques from speech synthesis paradigm, using HMM [18] and BLSTM [19]. In fact, these works compared their respective performance with that from AAI. Works in [18, 19] reported a significant drop in phonological feature based performance compared to that using acoustic features (AAI model). The main reason for the drop in the performance from acoustic features to phonemes could be due to the limitations of the duration model with HMM [18, 19].
6
+
7
+ With advancements in the neutral network based modelling approaches, it has been shown that attention networks are able to capture the duration model more accurately, and achieve the state-of-the-art performance in speech synthesis applications [20]. In this work, we deploy the tacotron [20] based speech synthesis approach for phonemes to articulatory movement prediction.Since, the tacotron based model needs large amount of data to learn the alignments and the phonemes-to-articulatory movements mapping, we deploy generalized model training using ten subjects’ training data and fine-tuning approach for each subject as done for AAI in [16].A systematic comparison of articulatory movement prediction using different features reveals that a correlation coefficient of 0.81 between predicted and original articulatory movements is obtained when phoneme sequence is used for prediction, without any timing information. On the other hand, the acoustic features based prediction achieves a correlation coefficient of 0.85 indicating that articulatory movements are primarily driven by linguistic information.
8
+
9
+ In this work, we consider a set of 460 phonetically balanced English sentences from MOCHA-TIMIT corpus as the stimuli for data collection from a group of 10 subjects comprising 6 males (M1, M2, M3, M4, M5, M6) and 4 females (F1, F2, F3, F4) in the age group of 20-28 years. All the subjects are native Indians with proficiency in English and reported to have no speech disorders in the past. All subjects were familiarized with the 460 sentences to obviate any elocution errors during recording. For each sentence, we simultaneously recorded audio using a microphone [21] and articulatory movement data using Electromagnetic articulograph (EMA) AG501 [22]. EMA AG501 has 24 channels to measure the horizontal, vertical, and lateral displacements and angular orientations of a maximum of 24 sensors. The articulatory movement was collected with a sampling rate of 250Hz. The sensors were placed following the guidelines provided in [23]. A schematic diagram of the sensor placement is shown in Fig. 2.
10
+
11
+ As indicated in Fig. 2, we used 6 sensors which were glued on different articulators, viz. Upper Lip (UL), Lower Lip (LP), Jaw, Tongue Tip (TT), Tongue Body (TB), and Tongue Dorsum (TD).Each of these six sensors captured the movements of articulators in 3D space.Additionally, we also glued two sensors behind the ears for head movement correction.In this study we consider the movements only in the midsagittal plane, indicated by X and Y directions in Fig. 2. Thus, we have twelve articulatory trajectories denoted by U​Lx𝑈subscript𝐿𝑥UL_{x}, U​Ly𝑈subscript𝐿𝑦UL_{y}, L​Lx𝐿subscript𝐿𝑥LL_{x}, L​Ly𝐿subscript𝐿𝑦LL_{y}, J​a​wx𝐽𝑎subscript𝑤𝑥Jaw_{x}, J​a​wy𝐽𝑎subscript𝑤𝑦Jaw_{y}, T​Tx𝑇subscript𝑇𝑥TT_{x}, T​Ty𝑇subscript𝑇𝑦TT_{y}, T​Bx𝑇subscript𝐵𝑥TB_{x}, T​By𝑇subscript𝐵𝑦TB_{y}, T​Dx𝑇subscript𝐷𝑥TD_{x}, T​Dy𝑇subscript𝐷𝑦TD_{y}. Before placing the sensors, the subjects were made to sit comfortably in the EMA recording setup. The subjects were given sufficient time to get used to speaking naturally with the sensors attached to different articulators. Manual annotations were performed to remove silence at the start and end of each sentence.
12
+
13
+ In this section, we first present the proposed approach for phoneme-to-articulatory prediction, and then describe a BLSTM based AAI approach, followed by a training scheme to overcome the limitation of scarcity of acoustic-articulatory data.
14
+
15
+ Articulatory movement estimation using attention network:In this work, we deploy the state-of-the-art speech synthesis model, tacotron architecture [20] to model duration information for articulatory movement estimation from phonemes.There are three major components in tacotron model, encoder, attention and decoder as shown in Fig. 3.Encoder takes discrete sequences of phonemesP={p1,p2,..p}NP=\{p_{1},p_{2},..p{{}_{N}}\} as an input and maps it to the hidden states E={e1,e2,..eN}E=\{e_{1},e_{2},..e_{N}\}, which acts as an input to the attention.The attention network models the time alignment between the encoder and decoder hidden states. The decoder hidden states, D={d1,d2,..dT}D=\{d_{1},d_{2},..d_{T}\}, are utilized to generate the articulatory movement trajectories over time.
16
+
17
+ Each phoneme is represented by a 40-dimensional one-hot encoded representation, which are fed to a 512-dimensional embedding layer, followed by a stack of 3 convolution layers and a BLSTM layer with 512 hidden units, which make up the encoder block of the model as depicted in Fig. 3. Attention network is a location-sensitive attention network which iterates over previous decoder output (dt−1subscript𝑑𝑡1d_{t-1}) and attention weights (αn,t−1subscript𝛼𝑛𝑡1\alpha_{n,t-1}) andall the encoder hidden states (E𝐸E).The attention mechanism is governed by the equations below [24]:αn,t=σ​(score​(dt−1,αn,t−1,E))subscript𝛼𝑛𝑡𝜎scoresubscript𝑑𝑡1subscript𝛼𝑛𝑡1𝐸\alpha_{n,t}=\sigma(\text{score}(d_{t-1},\alpha_{n,t-1},E))(1)score:​sn,t=wT​tanh​(W​dt−1+V​en+U​fj,t+b)score:subscript𝑠𝑛𝑡superscript𝑤𝑇tanh𝑊subscript𝑑𝑡1𝑉subscript𝑒𝑛𝑈subscript𝑓𝑗𝑡𝑏\text{score:}\ s_{n,t}=w^{T}\text{tanh}(Wd_{t-1}+Ve_{n}+Uf_{j,t}+b)(2)Context vector: ​gt=∑j=1Nαj,t​ejContext vector: subscript𝑔𝑡superscriptsubscript𝑗1𝑁subscript𝛼𝑗𝑡subscript𝑒𝑗\text{Context vector: }g_{t}=\sum_{j=1}^{N}\alpha_{j,t}e_{j}(3)where αn,tsubscript𝛼𝑛𝑡\alpha_{n,t} are attention weights and nϵ{1,2..N}n\epsilon\{1,2..N\} and parameters of attention network are denoted byW𝑊W, V𝑉V, U𝑈U weight matrices and w𝑤w and b𝑏b denotes the projection and bias vectors, respectively. In the Eq.(2), fj,tsubscript𝑓𝑗𝑡f_{j,t} is computed by ft=F∗αt−1subscript𝑓𝑡𝐹subscript𝛼𝑡1f_{t}=F*\alpha_{t-1}, which incorporates location awareness to the attention network [24], where F𝐹F is a weight matrix and αt−1subscript𝛼𝑡1\alpha_{t-1} is the set of previous time-step alignments.In Eq.(2), attention scores are computed as a function of encoder outputs (ensubscript𝑒𝑛e_{n}) and previous attention weights (αn,t−1subscript𝛼𝑛𝑡1\alpha_{n,t-1}) and decoder output (dt−1subscript𝑑𝑡1d_{t-1}), which are further normalized using softmax to obtain attention weights.These obtained attention weights are utilized to compute fixed context vector as described by Eq.(3).
18
+
19
+ The decoder consists of two uni-directional LSTM layers with 1024 units, followed by a linear projection layer to predict the articulatory movements as shown in Fig. 3. The decoder computes the final output ( dt∼D​e​c​o​d​e​r​(dt−1,gt)similar-tosubscript𝑑𝑡𝐷𝑒𝑐𝑜𝑑𝑒𝑟subscript𝑑𝑡1subscript𝑔𝑡d_{t}\sim Decoder(d_{t-1},g_{t})) from the previous state output (dt−1subscript𝑑𝑡1d_{t-1}) and attention context vector (gtsubscript𝑔𝑡g_{t}). To compute dt−1subscript𝑑𝑡1d_{t-1}, decoder’s previous output is transformed by a two layered fully-connected network with 256 units (Pre-Net).The decoder hidden state outputs are further projected using two linear layers, one for articulatory sequence prediction and other to predict end of the sequence. The predicted articulatory trajectories are passed through a 5-layer convolutional Post-Net which predicts a residual to add to the prediction to improve the overall reconstruction. Each layer in the Post-Net consists of 512 filters with a dimension of 5×1515\times 1 followed by a batch normalization layer. Tanh activation is used at the end of each layer except for the final layer.For end sequence prediction, the decoder LSTM output and attention context are concatenated and projected down to a scalar and then passed through sigmoid activation to predict the probability that the output sequence has completed. This “Stop Token” prediction is used during inference to allow the model to dynamically determine when to terminate generation instead of always generating for a fixed duration.
20
+
21
+ Articulatory movement estimation using BLSTM:Acoustic features and phoneme features with timing information have one-to-one correspondence between the input and output (articulatory position information) features, thereby implicitly encode timing information.Therefore, we do not need to model timing information explicitly for articulatory movement prediction in such cases.Deep recurrent neural networks architecture, namely BLSTM network has been shown to perform well in capturing context and smoothing characteristics and achieves the state-of-art AAI performance [16, 17].So, in this work, we deploy a BLSTM neural network based method to estimate articulatory movements from acoustic and phoneme features with timing information.These input features are fed to three consecutive BLSTM layers with 256 units and at the output, we use a time distributed dense layer as a linear regression layer.
22
+
23
+ Generalized model and fine-tuning:Typically neural network models demand large amount of training data to achieve better performance.To overcome the scarcity of articulatory data to train a subject specific model, we deploy the training approach proposed in [16].At the first step, we pool the training data from all the subjects and train a generic model to learn the mapping from input features to the target articulatory trajectories. In the second stage, we fine tune the generic model weights with respect to the target speaker, to learn speaker specific models.
24
+
25
+ Data pre-processing and feature computation:Articulatory data is first low-pass filtered to remove high frequency noise incurred during measurement process. The cutoff frequency of low-pass filter is 25Hz, which preserves the smoothly varying nature of the articulatory movement [4].Further, we perform sentence wise mean removal and variance normalization along each articulatory dimension.The recorded speech is down-sampled from 48kHz to 16kHz, following which a forced alignment is performed to obtain phonetic transcription using Kaldi [25]. The resultant phonetic transcription of the dataset consists of 39 ARPABET symbols.For experiment with phonemes,we use 39 discrete phonemes plus a start token, which are encoded as a 40-dim one-hot encoded vector, denoted as “PHN”. We also incorporate the timing information to phoneme sequence using phonetic boundaries obtained from the forced alignment. In this feature set, we replicate the one-hot vector for every 10 msec in the entire duration of the corresponding phonemes, which we denote by “TPHN”. For acoustic features, we compute a 13-dim Mel-frequency cepstrum coefficients (MFCC), which are shown to be optimal for the AAI task [4, 5].This TPHN feature set carries both linguistic information and timing information, and, hence, it works as an intermediate representation carrying information between MFCC and PHN. We also experimented with the concatenation of MFCC and TPHN to observe if there is any benefit of providing linguistic information explicitly along with MFCC.A summary of input features with respect to the hypothesized possible information they encode and the models used to estimate articulatory movements are reported in Table 1.
26
+
27
+ Model training and evaluation procedure:The recorded acoustic-articulatory data from 460 sentences are divided into train (80%percent8080\%), validation (10%percent1010\%), and test (10%percent1010\%) sets, for each subject.For BLSTM network training, we perform zero padding for all the sentences in train and validation set to obtain a fixed length sequence of 400 frames (4sec) with a batch size of 25. We choose root mean squared error (RMSE) and correlation coefficient (CC) as evaluation metrics to assess the performance the articulatory movement estimation technique.The RMSE and CC between the original and estimated trajectories are computed for each articulator separately [4, 16].Note that the RMSE is computed on articulatory trajectories which are mean and variance normalized. So RMSE does not have any units.
28
+
29
+ For experiments with PHN, we perform teacher forcing approach [20] while training attention network, by iterating over the decoder hidden states output dt−1subscript𝑑𝑡1d_{t-1}. We pass previous ground-truth articulatory position information as an input to attention and decoder instead of dt−1subscript𝑑𝑡1d_{t-1}. During testing, we perform DTW alignment using Euclidean distance metric between the predicted and estimated articulatory trajectories, and then compute the RMSE and CC to assess the model performance. We use RMSE as an objective measure for learning weights for all the models.
30
+
31
+ Three types of training were done for all features: Subject-Dependent, Generic, and Fine-Tuned. In the first case, the models were trained for each subject separately, giving 10 models for 10 subjects, whereas in the second case, a single generic model is trained on all 10 subjects pooled together.And in the third case we trained the models for each subject separately, by fine-tuning the generic model with subject specific data. All the experiments for BLSTM were performed using Keras [26] and Tensorflow backend [27]. Experiments with attention network were performed using NVIDIA open source code repository [28].
32
+
33
+ In this section, we first present the results of the generalized model and fine-tuning approach to estimate articulatory movements. Then we compare the performance with different features (PHN, TPHN, MFCC) in a subject specific manner.
34
+
35
+ Table 2, reports the performance with different training approaches across features. Interestingly, we observe that in all the cases fine-tuning of a model performs better than the subject-dependent model. This implies that pooling the data from all subjects helps in learning generic mapping across multiple subjects, and fine-tuning with speaker specific training data improves the speaker specific mapping. On the other-hand, while comparing the performance of the generic model with the subject dependent model, we observe that TPHN performance drops in generic model. This could be due to the lack of speaker specific para-linguistic information in the input features, unlike MFCC which encodes speaker information and enables BLSTM to learn mappings for multiple subjects by a single model [16].Although speaker information lacks when PHN is used as the input feature, the performance using subject-dependent model is worse than that using generic model. This is primarily due to scarcity of the training data for the complex attention network.The relative improvements from generic to fine-tuned model across the PHN, TPHN, MFCC, and MFCC+TPHN are 18.53, 9.3, 0.5, and 0.8%percent\%, respectively. Unlike MFCC, the greater improvements in PHN could be due to lack of para-linguistic information conveying speaker information for generic model with pooled data, which could lead to the coarse duration model across multiple subjects which, when fine-tuned with individual subject’s data, becomes more subject specific. We also perform experiments with MNGU corpus to compare tacotron based PHN model with HMMs [18]. We obtain 0.78 CC with tacotron model fine-tuned with MNGU corpus, while [18] reports 0.60 CC with HMM based approach.
36
+
37
+ We compare the performance of models with respect to input features, namely PHN, TPHN, MFCC, and TPHN+MFCC (concatenation of TPHN and MFCC). Fig. 4, illustrates the box plot of CC using different input features, where x-axis represents different subjects and y-axis indicates the CC across all the articulators. While comparing the performance of PHN with TPHN, we observe that there is no significant difference (p<0.01𝑝0.01p<0.01) in performance for six subjects, namely M1, M2, M4, M6, F1, F2 and F4; which indicates that the timing information could be recovered from phoneme sequence and articulatory trajectories using attention network. This helps it to perform similar to the BLSTM model with TPHN features, which explicitly provides timing information. We observe that MFCC outperforms both PHN and TPHN features, this could be due to the fact that articulatory information is maximally preserved when speech acoustic signal is processed by auditory filters such as mel-scale [29, 5]. Experiments reveal that fusing the TPHN with MFCC features indicated by MFCC+TPHN, results in the best performance among all the features.
38
+
39
+ To illustrate the attention weights learned for PHN to articulatory movement mapping in the fine-tuned model, we consider an example utterance “This was easy for us”.In Fig. 5, in the top subplot, we plot the ground-truth articulatory trajectories for lower lip (L​Ly𝐿subscript𝐿𝑦LL_{y}) and tongue tip (T​Ty𝑇subscript𝑇𝑦TT_{y}) and the corresponding phonetic boundaries are indicated by vertical lines.The attention weights are illustrated in the second subplot, where their corresponding phoneme labels are indicated on top of each weight profile. The estimated articulatory trajectories are plotted in the last subplot.Let us consider the attention weight corresponding to phoneme ‘z’ in “easy”. When the attention network provides a greater weight to the hidden state corresponding to phoneme ‘z’ (indicated by rectangular box), there is a tongue tip constriction in the predicted trajectories.Similar trend is observed with attention weight for the phoneme “f” in the word “for”, where we observe lip closures as a peak in lower lip vertical (L​Ly𝐿subscript𝐿𝑦LL_{y}) movement. We observe that the trend in the original and predicted articulatory trajectories are similar.
40
+
41
+ In this work, we proposed phoneme-to-articulatory movement estimation using attention networks. We experimentally showed that, with phoneme sequence without any timing information, we achieve an estimation performance which is identical to that using timing information. This implies that attention networks are able to learn the timing information to estimate articulatory movements. Experiments performed with different features, reveal that MFCC concatenated with TPHN features achieve the best performance in estimating articulatory movements. In future, we plan to utilize the estimated articulatory movements in speech synthesis task and in developing audio-visual speech synthesis systems.
42
+
43
+  Authors thank all the subjects for their participation in the data collection. We also thank the Pratiksha Trust and the Department of Science and Technology, Govt. of India for their support in this work.
1910.14443v1.txt ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Deep convolutional neural networks (CNNs) with 2D convolutions and small kernels [2], have achieved state-of-the-art results for several speech recognition tasks [3, 4, 5, 6, 7]. The accuracy of those models grows with their complexity, leading to redundant latent representations. Several approaches have been proposed in the literature to reduce this redundancy [8, 9, 10, 11, 12], and therefore to improve their efficiency.
2
+
3
+ Octave convolutional layers [1] address the problem of spatial redundancy in feature maps by learning feature representations at high and low resolutions. The low resolution processing path increases the size of the receptive field in the original input space, which is a plausible explanation of the improved performance for image classification. We extend the octave convolution concept to multi-scale octave convolutional layers, which include lower resolution feature maps with a higher compression rate (reduction by more than one octave), and the use of more than two feature map tensor groups in order to be learn representations at multiple scales.
4
+
5
+ Multi-scale processing have been previously proposed for a variety of speech recognition tasks [13, 14, 15, 16, 17]. In deep CNN acoustic models, some of the feature maps may need to represent information which varies at a lower rate, such as the characteristics of the speaker or background noise, compared to the information necessary for phonetic discrimination.Spatial average pooling in a low resolution group of feature maps can be interpreted as a form of low-pass filtering, providing smoothed representations of the observed data, potentially leading to improved performance.
6
+
7
+ We investigate the use of multi-scale octave convolutional layers for robust speech recognition, and attempt to shed more light on the explainability of the models by evaluating the robustness of the learned representations using an affine transformation loss to measure the similarity between clean and noisy encodings.
8
+
9
+ An octave convolutional layer [1] factorizes the output feature maps of a convolutional layer into two groups.The resolution of the low-frequency feature maps is reduced by an octave – height and width dimensions are divided by 222. In this work, we explore spatial reduction by up to 3 octaves – dividing by 2tsuperscript2𝑡2^{t}, where t=1,2,3𝑡123t=1,2,3 – and for up to 4 groups. We refer to such a layer as a multi-octave convolutional (MultiOctConv) layer, and an example with three groups and reductions of one and two octaves is depicted in Fig. 1.
10
+
11
+ In a vanilla CNNthe convolutions have the same spatial resolution throughout the network. An octave convolutional (OctConv) layer is divided into high- and low-frequency feature maps and a multi-octave convolutional (MultiOctConv) layer has feature maps reduced by multiple octaves. Let the input feature tensor be X∈ℝci​n×h×w𝑋superscriptℝsubscript𝑐𝑖𝑛ℎ𝑤X\in\mathbb{R}^{c_{in}\times h\times w}, where ci​nsubscript𝑐𝑖𝑛c_{in} denotes the number of input channels and hℎh and w𝑤w correspond to the spatial dimensions. In a MultiOctConv layer working at 3 resolutions, X𝑋X is factorized along the channel dimension into X={X1,X2,X3}𝑋superscript𝑋1superscript𝑋2superscript𝑋3X=\{X^{1},X^{2},X^{3}\}. The first tensor group tensor, X1superscript𝑋1X^{1}, is a representation at the same spatial scale as X𝑋X. The spatial dimensions of the second and third group tensors, X2superscript𝑋2X^{2} and X3superscript𝑋3X^{3}, are reduced by one and two octaves respectively.
12
+
13
+ The dimensions of the input tensors X1superscript𝑋1X^{1}, X2superscript𝑋2X^{2} and X3superscript𝑋3X^{3} are described in Fig. 1. The fraction of the channels for each group is denoted with αn∈[0,1]subscript𝛼𝑛01\alpha_{n}\in[0,1], where ∑n=1Nαn=1superscriptsubscript𝑛1𝑁subscript𝛼𝑛1\sum_{n=1}^{N}\alpha_{n}=1 for N𝑁N resolution groups in the MultiOctConv layer. For simplicity, we use the same αnsubscript𝛼𝑛\alpha_{n} for input and output representations within the same scale group. Similarly, the output tensors are also factorized into Y={Y1,Y2,Y3}𝑌superscript𝑌1superscript𝑌2superscript𝑌3Y=\{Y^{1},Y^{2},Y^{3}\}. Their dimensions are analogous to the dimensions of the input tensors and are described in Fig. 1. To compute Y1superscript𝑌1Y^{1}, Y2superscript𝑌2Y^{2} and Y3superscript𝑌3Y^{3} we operate directly on the factorized input tensors X1superscript𝑋1X^{1}, X2superscript𝑋2X^{2} and X3superscript𝑋3X^{3}. Inter-frequency information update is implemented as a sum of feature maps from different resolution groups. To be able to sum those representations for a desired output scale, the spatial dimensions of the input tensors must be the same. For this reason, two operations are employed: spatial average pooling pool(X,p𝑋𝑝X,p) and bilinear interpolation upsample(X,u𝑋𝑢X,u), where p𝑝p is the kernel size and stride for the the 2D pooling layer and u𝑢u is the upsampling factor. The output MultiOctConv representations are therefore computed asY1=f​(X1;W1→1)+upsample​(f​(X2;W2→1),2)++upsample​(f​(X3;W3→1),4)subscript𝑌1𝑓superscript𝑋1superscript𝑊→11upsample𝑓superscript𝑋2superscript𝑊→212upsample𝑓superscript𝑋3superscript𝑊→314\displaystyle\begin{split}Y_{1}=f(X^{1};W^{1\rightarrow 1})+\texttt{upsample}(f(X^{2};W^{2\rightarrow 1}),2)+\\+\texttt{upsample}(f(X^{3};W^{3\rightarrow 1}),4)\end{split}Y2=f​(X2;W2→2)+upsample​(f​(X3;W3→2),2)++f​(pool​(X1,2);W1→2)subscript𝑌2𝑓superscript𝑋2superscript𝑊→22upsample𝑓superscript𝑋3superscript𝑊→322𝑓poolsuperscript𝑋12superscript𝑊→12\displaystyle\vskip 3.0pt plus 1.0pt minus 1.0pt\begin{split}Y_{2}=f(X^{2};W^{2\rightarrow 2})+\texttt{upsample}(f(X^{3};W^{3\rightarrow 2}),2)+\\+f(\texttt{pool}(X^{1},2);W^{1\rightarrow 2})\end{split}Y3=f​(X3;W3→3)+f​(pool​(X1,4);W1→3)++f​(pool​(X2,2);W2→3)subscript𝑌3𝑓superscript𝑋3superscript𝑊→33𝑓poolsuperscript𝑋14superscript𝑊→13𝑓poolsuperscript𝑋22superscript𝑊→23\displaystyle\vskip 3.0pt plus 1.0pt minus 1.0pt\begin{split}Y_{3}=f(X^{3};W^{3\rightarrow 3})+f(\texttt{pool}(X^{1},4);W^{1\rightarrow 3})+\\+f(\texttt{pool}(X^{2},2);W^{2\rightarrow 3})\end{split}
14
+
15
+ where f(.)f(.) is the convolution function and Wni​n→no​u​t∈ℝci​n×k×k×co​u​tsuperscript𝑊→subscript𝑛𝑖𝑛subscript𝑛𝑜𝑢𝑡superscriptℝsubscript𝑐𝑖𝑛𝑘𝑘subscript𝑐𝑜𝑢𝑡W^{n_{in}\rightarrow{n_{out}}}\in\mathbb{R}^{c_{in}\times k\times k\times c_{out}} is the convolution filter for a k×k𝑘𝑘k\times k kernel. We call the information update “intra-frequency” when ni​n=no​u​tsubscript𝑛𝑖𝑛subscript𝑛𝑜𝑢𝑡n_{in}=n_{out}, and “inter-frequency” when ni​n≠no​u​tsubscript𝑛𝑖𝑛subscript𝑛𝑜𝑢𝑡n_{in}\neq n_{out}. It is important to note that the convolution f(.)f(.) operates on the tensors compressed with average pooling and on the tensors before upsampling, making the design more efficient. The number of parameters in the MultiOctConv layer is the same as in a vanilla convolutional layer.
16
+
17
+ To evaluate the robustness of learned representations, we compare the projections of clean and noisy Aurora-4 samples. The similarity between them is measured using the mean squared error (MSE) loss of an affine projection y𝑦y of N𝑁N clean to noisy samples (Eq. 1), to take into account permutations of hidden representations and to ensure invariance of the metric to affine transformations of the encodings. The number of units in layer y𝑦y and the dimensionality D𝐷D of 𝐱hsubscript𝐱ℎ\mathbf{x}_{h} is 1024.
18
+
19
+ θ∗=arg​minθ⁡1N​D​∑i=1N∥y​(𝐱h,c​l​e​a​n(i),θ)−𝐱h,n​o​i​s​y(i)∥2superscript𝜃subscriptargmin𝜃1𝑁𝐷superscriptsubscript𝑖1𝑁superscriptdelimited-∥∥𝑦superscriptsubscript𝐱ℎ𝑐𝑙𝑒𝑎𝑛𝑖𝜃superscriptsubscript𝐱ℎ𝑛𝑜𝑖𝑠𝑦𝑖2\theta^{*}=\operatorname*{arg\,min}_{\theta}{\frac{1}{ND}\sum_{i=1}^{N}\big{\lVert}y({\mathbf{x}_{h,clean}^{(i)},\theta})-{\mathbf{x}_{h,noisy}^{(i)}}\big{\rVert}^{2}}(1)
20
+
21
+ We use the Aurora-4 test sets and compare clean encodings 𝐱h,c​l​e​a​nsubscript𝐱ℎ𝑐𝑙𝑒𝑎𝑛\mathbf{x}_{h,clean} with noisy encodings 𝐱h,n​o​i​s​esubscript𝐱ℎ𝑛𝑜𝑖𝑠𝑒\mathbf{x}_{h,noise}, obtained as the activations from the last convolutional layer with a forward pass through a trained model. Both hidden representations were obtained for CNN and octave CNN (OctCNN) models in order to compare representations between the models. Also, for intra-model comparison, we evaluate the loss with the encodings from high and low-resolution groups (paths Y1→1superscript𝑌→11Y^{1\rightarrow 1} and Y2→1superscript𝑌→21Y^{2\rightarrow 1}). This analysis aims to evaluate if the low-resolution groups for noisy samples are indeed more similar to the clean ones than the high-resolution encodings, suggesting more robust representations. We optimize the parameters of y𝑦y with back-propagation using a fixed number of 3 epochs and we report the validation loss for Aurora-4 test sets.
22
+
23
+ Aurora-4 [18]: We evaluate our models on the simulated multi-condition Aurora-4 dataset, consisting of ∼similar-to\sim15h of audio for training and ∼similar-to\sim9h for testing. The test set is divided into 4 subsets: A, B, C, and D. Subset A contains clean-condition recordings, subset B has 6 noise types added to the recordings (car, babble, restaurant, street, airport, train), subset C is recorded with a mismatched microphone, and subset D is recorded with a mismatched microphone and with noise added. In our experiments, we use multi-condition GMM-HMM forced alignments as targets for CNN training. The number of CD states for Aurora-4 is 3422.
24
+
25
+ AMI [19]: AMI contains ∼similar-to\sim100h of meeting recordings, captured by an independent headset microphone (IHM), single distant microphone (SDM), and multiple distant microphones (MDM), where the mics are combined using the BeamformIt [20] toolkit. We train our models using the MDM data and evaluate the models for all 3 types of recordings to analyze the effect of mismatched training/testing conditions. We use the suggested train/dev/eval data split [21], and we evaluate the models on both dev and eval sets. The number of CD states for AMI is 3984.
26
+
27
+ Features: In our experiments, we use 40-dimension mel-scaled filterbank (FBANK) features with {-5,..,5} context for splicing, resulting in a 40×11401140\times 11 input feature map.
28
+
29
+ Models: Our baseline CNN model [22] consists of 15 convolutional and one fully-connected layer. We use 3×3333\times 3 kernels throughout the network. We start with 64 output channels in the first layer and double them after 3 and 9 layers. We use batch normalization in every convolutional layer, and ReLU afterwards (unless a reverse order is noted). The initial learning rate is 0.001. We use early stopping for training.
30
+
31
+ We present our results in terms of accuracy and robustness on Aurora-4 and AMI, as well as in terms of the computational cost, which is calculated as the number of multiply-accumulate operations (MACCs) performed for a single input feature map. The cost reductionwhen using octave convolutions stems from reduced dimensions ci​nsubscript𝑐𝑖𝑛c_{in}, co​u​tsubscript𝑐𝑜𝑢𝑡c_{out}, hℎh, and w𝑤w compared to a vanilla convolutional layer.
32
+
33
+ Aurora-4:Results for Aurora-4 are presented in Table 1. We replace vanilla convolutional layers of our baseline model (CNN) with OctConv and MultiOctConv layers.We first evaluate which layers can be replaced and find that all but the first layer, operating directly on the input representation, should be replaced for the best performance. This approach (L2-L15) is also the least costly.Reducing the ratio of low-resolution representations to 0.125 improves the WER for the mismatched microphone scenario C, but not for all test conditions. Applying batch normalization after ReLU is beneficial for test set C and D. For OctCNN models, the WER for test set D dropped by ∼0.4%similar-toabsentpercent0.4\sim 0.4\% with a compression by one octave, and by another ∼0.4%similar-toabsentpercent0.4\sim 0.4\% with a reversed batch normalization and ReLU order.
34
+
35
+ The biggest differences between the MultiOctCNN models can be observed for test set D. The models with the lowest WERs are the ones with a spatial reduction by 2 or 3 octaves, and with 2 or 3 groups. This indicates that multi-scale octave convolutions seem to be an effective, as well as an efficient design for processing speech with background noise and channel mismatch. For MultiOctCNNs, batch normalization after ReLU also gives a performance boost for test set D, with a drop to 13.57%percent13.5713.57\%.
36
+
37
+ To further evaluate the robustness of the latent representationswe measured the MSE between the (projected) representations, described above(Fig. 3). The loss for the activations at the output of Conv15 (”all”) is similar for CNN and OctCNN models for test sets B and C, but lower for test set D for OctCNN, indicating that the learned representations are more robust, contributing to lower WERs. As expected, within-model comparison of the loss show that the representations at low resolution are more similar to the clean encodings from test set A than the ones at high resolution. We believe that this effect improves the robustness of latent representations and results in a decreased WER.
38
+
39
+ AMI:Results for AMI are presented in Table 2. In contrast to the Aurora-4 findings, better performance was achieved with an all OctCNN model (L1-L15). This is an interesting finding, and we believe that the multi-scale processing of the input feature space is beneficial for AMI MDM because of the reverberation in the data. The reverbarated input time×\timesfreq representation can be viewed as a spatially redundant one, therefore the OctConv layer applied to the input representation is effective. Unfortunately, the only MultiOctConv model superior to the baseline CNN is the one with 3 groups with a spatial reduction by 1 and 2 octaves. This result indicates that the spatial redundancy for this architecture for AMI MDM is not degrading the performance. However, in terms of the computational cost, we can reduce the #MACCs by a factor of 1.8 with only a small WER increase for a model with 4 resolution groups.
40
+
41
+ We have presented multi-scale octave CNN models for robust and efficient speech recognition. We build on Chen et al [1], applying the method to robust ASR and extending it to multiple resolution groups with a spatial reduction of more than one octave.Our experiments confirm that multi-scale processing of the hidden representations is not only more computationally efficient, but also improves the recognition. Similarity measures between clean and noisy encodings indicates that multi-scale processing in a deep CNN acoustic model improves the robustness of learned representations, especially in the additive noise and mismatched microphone scenario. The gain of the octave convolutions was also observed for AMI MDM data with significant reverberation, when applied to the input feature space. However, the model performance for AMI MDM was not improved with multi-octave convolutions. More careful tuning of the α𝛼\alpha hyperparameter could improve the results, as it controls the ratio of multi-scale feature maps in the model, enabling both learning of fine-grained representations preserving the details necessary for phonetic discrimination, as well as smoothed, more invariant representations improving the robustness of the model. It would also be possible to set α𝛼\alpha layer-by-layer to enable the fractions of channels at different resolutions to vary according to the depth of the representation.
42
+
43
+ We proposed a single projection layer MSE loss to measure the affine relationship of clean and noisy hidden representations. With this approach, we evaluated the robustness of the encodings and improved the explainability of our models. More thorough analysis of the representations learned is an interesting future direction. We confirmed that the noisy lower resolution representations are more similar to the clean counterparts than high resolution representations, and thus are more robust. However, we did not investigate the reason for the increased similarity, leaving future work to ascertain if the lower resolution group corresponds to better speaker or noise characteristics, or more invariant phonetic representations.
1910.14472v1.txt ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Fairness is essential for human society, contributing to stability and productivity. Similarly, fairness is also the key for many multi-agent systems, e.g., routing [1], traffic light control [2], and cloud computing [3]. More specifically, in routing, link bandwidth needs to be fairly allocated to packets to achieve load balance; in traffic light control, resources provided by infrastructure needs to be fairly shared by vehicles; in cloud computing, resource allocation of virtual machines has to be fair to optimize profit.
2
+
3
+ Many game-theoretic methods [4, 5, 6] have been proposed for fair division in multi-agent systems, which mainly focus on proportional fairness and envy-freeness. Most of them are in static settings, while some [7, 8, 9] consider the dynamic environment. Recently, multi-agent reinforcement learning (RL) has been successfully applied to multi-agent sequential decision-making, such as [10, 11, 12, 13, 14, 15, 16]. However, most of them try to maximize the reward of each individual agent or the shared reward among agents, without taking fairness into account. Only a few methods consider fairness, but are handcrafted for different applications [17, 18, 19], which all require domain-specific knowledge and cannot be generalized. Some methods [20, 21, 22] aim to encourage cooperation in social dilemmas but cannot guarantee fairness.
4
+
5
+ Taking fairness into multi-agent learning could help multi-agent systems become both efficient and stable. However, learning efficiency (system performance) and fairness simultaneously is a complex, multi-objective, joint-policy optimization. To tackle these difficulties, we propose a novel hierarchical RL model, FEN, to enable agents to easily and effectively learn both efficiency and fairness. First, we decompose fairness for each agent and propose fair-efficient reward that each agent learns its own policy to optimize it. We prove that agents achieve Pareto efficiency and fairness is guaranteed in infinite-horizon sequential decision-making if all agents maximize their own fair-efficient reward and learn the optimal policies. However, the conflicting nature between fairness and efficiency makes it hard for a single policy to learn effectively. To overcome this, we then design a hierarchy, which consists a controller and several sub-policies. The controller maximizes the fair-efficient reward by switching among the sub-policies which directly interact with the environment. One of the sub-policies is designated to maximize the environmental reward, and other sub-policies are guided by information-theoretic reward to explore diverse possible behaviors for fairness. Additionally, average consensus, which is included in the fair-efficient reward, coordinates the policies of agents in fully decentralized multi-agent learning.By saying fully decentralized, we emphasize that there is no centralized controller, agents exchange information locally, and they learn and execute based on only local information.
6
+
7
+ We evaluate FEN in three classic scenarios, i.e., job scheduling, the Mathew effect, and manufacturing plant. It is empirically demonstrated that FEN obtains both fairness and efficiency and significantly outperforms existing methods. By ablation studies, we confirm the hierarchy indeed helps agents to learn more easily. Benefited from distributed average consensus, FEN can learn and execute in a fully decentralized way, making it easy to be deployed in real-world applications.
8
+
9
+ Fairness. There are many existing works on fair division in multi-agent systems.Most of them focus on static settings [4, 5, 6], where the information of entire resources and agents are known and fixed, while some of them work on dynamic settings [7, 8, 9], where resource availability and agents are changing.For multi-agent sequential decision-making, a regularized maximin fairness policy is proposed [8] to maximize the worst performance of agents while considering the overall performance, and the policy is computed by linear programming or game-theoretic approach. However, none of these works are learning approach.Some multi-agent RL methods [17, 18, 19] have been proposed and handcrafted for resource allocation in specific applications, such as resource allocation on multi-core systems[17], sharing network resources among UAVs[18], and balancing various resources in complex logistics networks[19]. However, all these methods require domain-specific knowledge and thus cannot be generalized. Some methods [20, 21, 22] are proposed to improve cooperation in social dilemmas.In [20], the reward is shaped for two-player Stag Hunt games, which could be agents’ average reward in its multi-player version.In [20], one agent’s reward is set to be the weighted average reward of two agents in two-player Stag Hunt games to induce prosociality. By extending the inequity aversion model, a shaped reward is designed in [21] to model agent’s envy and guilt.A reward network is proposed in [22] to generate intrinsic reward for each agent, which is evolved based on the group’s collective reward.Although cooperation in social dilemmas helps improve agents’ sum reward, it does not necessarily mean the fairness is guaranteed.
10
+
11
+ The Matthew effect, summarized as the rich get richer and the poor get poorer, can be witnessed in many aspects of human society [23], as well as in multi-agent systems, such as preferential attachment in networking [24, 25] and mining process in blockchain systems [26].The Matthew effect causes inequality in society and also performance bottleneck in multi-agent systems. Learning fairness could avoid the Matthew effect and help systems become stable and efficient.
12
+
13
+ Multi-Agent RL. Many multi-agent RL models have been recently proposed, such as [10, 11, 12, 13, 14, 15, 16], but all of them only consider efficiency. CommNet [11] and ATOC [13] use continuous communication for multi-agent cooperation. Opponent modeling [27, 28] learns to reason about other agents’ behaviors or minds for better cooperation or competition. MADDPG [10] is designed for mixed cooperative-competitive environments. In these models, each agent only focuses on optimizing its own local reward. Thus, more capable agents will obtain more rewards and fairness is not considered. VDN [14], QMIX [15], and COMA [16] are designed for the scenario where all agents jointly maximize a shared reward. The shared reward is not directly related to fairness. Even if the shared reward is defined as the sum of local rewards of all agents, we can easily see that higher reward sum does not mean fairer.
14
+
15
+ Hierarchical RL. To solve more complex tasks with sparse rewards or long time horizons and to speed up the learning process, hierarchical RL trains multiple levels of policies. The higher level policies give goals or options to the lower level policies and only the lowest level applies actions to the environment. So, the higher levels are able to plan over a longer time horizon or a more complex task. Learning a decomposition of complex tasks into sub-goals are considered in [29, 30, 31],while learning options are considered in [32, 33, 34]. However, none of these hierarchical RL models can be directly applied to learning both fairness and efficiency in multi-agent systems.
16
+
17
+ We propose Fair-Efficient Network, FEN, to enable agents to learn both efficiency and fairness in multi-agent systems. Unlike existing work, we decompose fairness for each agent and propose fair-efficient reward, and each agent learns its own policy to optimize it. However, optimizing the two conflicting objectives is hard for a single learning policy. To this end, we propose a hierarchy specifically designed for easing this learning difficulty. The hierarchy consists a controller and several sub-policies, where the controller learns to select sub-policies and each sub-policy learns to interact with the environment in a different way. Average consensus, which is included in the fair-efficient reward, coordinates agents’ policies and enables agents to learn in a fully decentralized way.
18
+
19
+ In the multi-agent system we consider, there are n𝑛n agents and limited resources in the environment. The resources are non-excludable and rivalrous (common resources), e.g., CPU, memory, and network bandwidth. At each timestep, the environmental reward r𝑟r an agent obtains is only related to its occupied resources at that timestep. We define the utility of agent i𝑖i at timestep t𝑡t as uti=1t​∑j=0trjisuperscriptsubscript𝑢𝑡𝑖1𝑡superscriptsubscript𝑗0𝑡subscriptsuperscript𝑟𝑖𝑗u_{t}^{i}=\frac{1}{t}\sum_{j=0}^{t}r^{i}_{j}, which is the average reward over elapsed timesteps. We use the coefficient of variation (CV) of agents’ utilities 1n−1​∑i=1n(ui−u¯)2u¯21𝑛1superscriptsubscript𝑖1𝑛superscriptsuperscript𝑢𝑖¯𝑢2superscript¯𝑢2\sqrt{\frac{1}{n-1}\sum_{i=1}^{n}\frac{(u^{i}-\bar{u})^{2}}{\bar{u}^{2}}} to measure fairness [35], where u¯¯𝑢\bar{u} is average utility of all agents. A system is said to be fairer if and only if the CV is smaller.
20
+
21
+ In multi-agent sequential decision-making, it is difficult for an individual agent to optimize the CV since it is not just related to the agent’s own policy, but the joint policies of all agents.However, as the resources are limited, the upper bound of u¯¯𝑢\bar{u} can be easily reached by self-interested agents.Thus, u¯¯𝑢\bar{u} is hardly affected by an individual agent and the contribution of agent i𝑖i to the variance could be approximated as (ui−u¯)2/u¯2superscriptsuperscript𝑢𝑖¯𝑢2superscript¯𝑢2(u^{i}-\bar{u})^{2}/\bar{u}^{2}. We decompose the fairness objective for each agent and propose the fair-efficient rewardr^ti=u¯t/cϵ+|uti/u¯t−1|,superscriptsubscript^𝑟𝑡𝑖subscript¯𝑢𝑡𝑐italic-ϵsuperscriptsubscript𝑢𝑡𝑖subscript¯𝑢𝑡1\hat{r}_{t}^{i}=\frac{\bar{u}_{t}/c}{\epsilon+\left|u_{t}^{i}/\bar{u}_{t}-1\right|},where c𝑐c is a constant that normalizes the numerator and is set to the maximum environmental reward the agent obtains at a timestep. In the fair-efficient reward, u¯t/csubscript¯𝑢𝑡𝑐\bar{u}_{t}/c can be seen as the resource utilization of the system, encouraging the agent to improve efficiency; |uti/u¯t−1|superscriptsubscript𝑢𝑡𝑖subscript¯𝑢𝑡1\left|u_{t}^{i}/\bar{u}_{t}-1\right| measures the agent’s utility deviation from the average, and the agent will be punished no matter it is above or below the average, which leads to low variance; ϵitalic-ϵ\epsilon is a small positive number to avoid zero denominator. Each agent i𝑖i learns its own policy to maximize the objective Fi=𝔼​[∑t=0∞γt​r^ti]subscript𝐹𝑖𝔼delimited-[]superscriptsubscript𝑡0superscript𝛾𝑡superscriptsubscript^𝑟𝑡𝑖F_{i}=\mathbb{E}\left[\sum_{t=0}^{\infty}\gamma^{t}\hat{r}_{t}^{i}\ \right], where γ𝛾\gamma is the discount factor. The fair-efficient reward allows each agent to respond to the behaviors of other agents, which can be summarized by u¯¯𝑢\bar{u}. Therefore, u¯¯𝑢\bar{u} can actually coordinate agents’ policies in decentralized multi-agent learning.
22
+
23
+ Proposition 1. The optimal fair-efficient policy set 𝛑∗superscript𝛑\boldsymbol{\pi}^{*} is Pareto efficient in infinite-horizon sequential decision-making.
24
+
25
+ Proof. We prove by contradiction. We first prove the resources must be fully occupied. Since the decision-making is infinite-horizon, the resources could be allocated in any proportion in the time domain. Assume the resources are not fully used, there must exist another 𝝅′superscript𝝅′\boldsymbol{\pi}^{\prime}, under which each agent could occupy the remaining resources according to the ratio of ui/n​u¯superscript𝑢𝑖𝑛¯𝑢u^{i}/n\bar{u}. Then, we have |ui′/u¯′−1|=|ui/u¯−1|superscriptsuperscript𝑢𝑖′superscript¯𝑢′1superscript𝑢𝑖¯𝑢1|{u^{i}}^{\prime}/{\bar{u}}^{\prime}-1|=|u^{i}/\bar{u}-1|, but u¯′/c>u¯/csuperscript¯𝑢′𝑐¯𝑢𝑐{\bar{u}}^{\prime}/c>\bar{u}/c. Thus, for each agent i𝑖i, Fi′>Fisubscriptsuperscript𝐹′𝑖subscript𝐹𝑖F^{\prime}_{i}>F_{i}, which contradicts the pre-condition that 𝝅∗superscript𝝅\boldsymbol{\pi}^{*} is optimal. We then prove 𝝅∗superscript𝝅\boldsymbol{\pi}^{*} is Pareto efficient.Assume Pareto efficiency is not achieved, there must exist ∀i,ui′⩾ui∧∃i,ui′>uiformulae-sequencefor-all𝑖superscriptsuperscript𝑢𝑖′superscript𝑢𝑖𝑖superscriptsuperscript𝑢𝑖′superscript𝑢𝑖\forall i,{u^{i}}^{\prime}\geqslant u^{i}\wedge\exists i,{u^{i}}^{\prime}>u^{i}, so ∑i=1nui′>∑i=1nuisuperscriptsubscript𝑖1𝑛superscriptsuperscript𝑢𝑖′superscriptsubscript𝑖1𝑛superscript𝑢𝑖\sum_{i=1}^{n}{{u^{i}}^{\prime}}>\sum_{i=1}^{n}{u^{i}}, which contradicts the pre-condition that the resources are fully occupied.
26
+
27
+ Proposition 2. The optimal fair-efficient policy set 𝛑∗superscript𝛑\boldsymbol{\pi}^{*} achieves equal allocation when the resources are fully occupied.
28
+
29
+ Proof. We prove by contradiction. Assume the allocation is not equal when the resources are fully occupied, ∃i,ui≠u¯𝑖superscript𝑢𝑖¯𝑢\exists i,u^{i}\neq\bar{u}. There must exist another 𝝅′superscript𝝅′\boldsymbol{\pi}^{\prime}, under which agents that have ui>u¯superscript𝑢𝑖¯𝑢u^{i}>\bar{u} can give up resources to make ui=u¯superscript𝑢𝑖¯𝑢u^{i}=\bar{u}. Then, for the remaining resources and other agents, this is an isomorphic subproblem. According to Proposition 1, the resources will be fully occupied by other agents. After that, we have Fi′>Fisubscriptsuperscript𝐹′𝑖subscript𝐹𝑖F^{\prime}_{i}>F_{i}. This process can be repeated until ∀i,Fi′>Fifor-all𝑖subscriptsuperscript𝐹′𝑖subscript𝐹𝑖\forall i,F^{\prime}_{i}>F_{i}, which contradicts the pre-condition that 𝝅∗superscript𝝅\boldsymbol{\pi}^{*} is optimal.
30
+
31
+ A learning policy could feel ambiguous while considering both fairness and efficiency since they might conflict in some states. For example, if different behaviors of other agents cause the change of u¯¯𝑢\bar{u}, an agent may need to perform different action at a same state to maximize its fair-efficient reward. However, this is hard for a single learned policy.
32
+
33
+ To overcome this difficulty, we design a hierarchy that consists of a controller and several sub-policies parameterized respectively by θ𝜃\theta and ϕbold-italic-ϕ\boldsymbol{\phi} , illustrated in Figure 1. The controller selects one of sub-policies by the sampled index zt∼πθ(⋅|ot)z_{t}\sim\pi_{\theta}(\cdot|o_{t}) based on the partial observation otsubscript𝑜𝑡o_{t}. The controller receives the fair-efficient reward r^^𝑟\hat{r} and acts at a lower temporal resolution than the sub-policies. Every T𝑇T timesteps, the controller chooses a sub-policy and in the next T𝑇T timesteps, the chosen sub-policy outputs actions to interact with the environment.
34
+
35
+ To obtain efficiency, we designate one of the sub-policies parameterized by ϕ1subscriptitalic-ϕ1\phi_{1} to maximize the reward r𝑟r given by the environment. For other sub-policies, we exploit an information-theoretic objective to guide the sub-policies to explore diverse possible behaviors for fairness.
36
+
37
+ From the perspective of the controller, these sub-policies should be able to be distinguished from each other and thus the controller can have more choices. Obviously, we can not quantify the difference of sub-policies directly. However, the experienced observations under a sub-policy could indirectly reflect the policy. The more differences between sub-policies, the less the uncertainty of z𝑧z is, given observation o𝑜o under the policy. That is to say, the mutual information I​(Z;O)𝐼𝑍𝑂I(Z;O) should be maximized by the sub-policy and we take it as one term of the objective. On the other hand, to explore diverse possible behaviors, the sub-policy should act as randomly as possible, so we also maximize the entropy between the action and observation H​(A|O)𝐻conditional𝐴𝑂H(A|O). In summary, the objective of the sub-policy is to maximizeJ​(ϕ)=I​(Z;O)+H​(A|O)=H​(Z)−H​(Z|O)+H​(A|O)≈−H​(Z|O)+H​(A|O)=𝔼z∼πθ,o∼πϕ​[log⁡p​(z|o)]+𝔼a∼πϕ​[−p​(a|o)​log⁡p​(a|o)].𝐽italic-ϕ𝐼𝑍𝑂𝐻conditional𝐴𝑂𝐻𝑍𝐻conditional𝑍𝑂𝐻conditional𝐴𝑂𝐻conditional𝑍𝑂𝐻conditional𝐴𝑂subscript𝔼formulae-sequencesimilar-to𝑧subscript𝜋𝜃similar-to𝑜subscript𝜋italic-ϕdelimited-[]𝑝conditional𝑧𝑜subscript𝔼similar-to𝑎subscript𝜋italic-ϕdelimited-[]𝑝conditional𝑎𝑜𝑝conditional𝑎𝑜\begin{split}J(\phi)&=I(Z;O)+H(A|O)\\&=H(Z)-H(Z|O)+H(A|O)\\&\approx-H(Z|O)+H(A|O)\\&=\mathbb{E}_{z\sim\pi_{\theta},o\sim\pi_{\phi}}[\log{p(z|o)}]+\mathbb{E}_{a\sim\pi_{\phi}}[-p(a|o)\log{p(a|o)}].\end{split}As H​(Z)𝐻𝑍H(Z) is only related to θ𝜃\theta, H​(Z)𝐻𝑍H(Z) can be seen a constant and be neglected. The controller just outputs the probability pθ​(z|o)subscript𝑝𝜃conditional𝑧𝑜p_{\theta}(z|o), and thus the first term of the objective can be interpreted as that each sub-policy tries to maximize the expected probability that it would be selected by the controller. To maximize it, we can give sub-policies a reward r~=log⁡pθ​(z|o)~𝑟subscript𝑝𝜃conditional𝑧𝑜\tilde{r}=\log{p_{\theta}(z|o)} at each timestep and use RL to train the sub-policies. The second term can be treated as an entropy regularization, which is differentiable and could be optimized by backpropagation.
38
+
39
+ The hierarchy reduces the difficulty of learning both efficiency and fairness. The controller focuses on the fair-efficient reward and learns to decide when to optimize efficiency or fairness by selecting the sub-policy, without directly interacting with the environment. Sub-policy ϕ1subscriptitalic-ϕ1\phi_{1} learns to optimize the environmental reward, i.e., efficiency. Other sub-policies learn diverse behaviors to meet the controller’s demand of fairness. The fair-efficient reward changes slowly since it is slightly affected by immediate environmental reward the sub-policy obtains. Thus, the controller can plan over a long time horizon to optimize both efficiency and fairness, while the sub-policies only optimize their own objectives within the given time interval T𝑇T.
40
+
41
+ The centralized policy has an advantage in coordinating all agents’ behaviors. However, the centralized policy is hard to train, facing the curse of dimensionality as the number of agents increases. FEN is a decentralized policy in both training and execution. Although each agent only focuses on its own fair-efficient reward, they are coordinated by the average consensus on utility.
42
+
43
+ In the decentralized training, each agent need to perceive the average utility u¯¯𝑢\bar{u} to know its current utility deviation from the average. When the number of agents is small, it is easy to collect the utility from each agent and compute the average. When the number of agents is large, it may be costly to collect the utility from each agent in real-world applications. To deal with this, we adopt a gossip algorithm for distributed average consensus [36]. Each agent i𝑖i maintains the average utility u¯isubscript¯𝑢𝑖\bar{u}_{i} and iteratively updates it byu¯i​(t+1)=u¯i​(t)+∑j∈𝒩iwi​j×(u¯j​(t)−u¯i​(t)),subscript¯𝑢𝑖𝑡1subscript¯𝑢𝑖𝑡subscript𝑗subscript𝒩𝑖subscript𝑤𝑖𝑗subscript¯𝑢𝑗𝑡subscript¯𝑢𝑖𝑡\bar{u}_{i}(t+1)=\bar{u}_{i}(t)+\sum_{j\in\mathcal{N}_{i}}w_{ij}\times(\bar{u}_{j}(t)-\bar{u}_{i}(t)),where u¯i​(0)=uisubscript¯𝑢𝑖0subscript𝑢𝑖\bar{u}_{i}(0)=u_{i}, 𝒩isubscript𝒩𝑖\mathcal{N}_{i} is the set of neighboring agents in agent i𝑖i’s observation, and the weight wi​j=1/(max⁡{di,dj}+1)subscript𝑤𝑖𝑗1subscript𝑑𝑖subscript𝑑𝑗1w_{ij}=1/(\max\left\{d_{i},d_{j}\right\}+1), where the degree di=|𝒩i|subscript𝑑𝑖subscript𝒩𝑖d_{i}=|\mathcal{N}_{i}|. The gossip algorithm is distributed and requires only limited communication between neighbors to estimate the average.
44
+
45
+ The training of FEN is detailed in Algorithm 1. The controller and sub-policies are trained both using PPO [37]. The controller selects one sub-policy every T𝑇T to interact with the environment. The selected sub-policy is updated based on the trajectory during T𝑇T. The controller is updated based on the trajectory of every sub-policy selection and its obtained fair-efficient reward during each episode.
46
+
47
+ For the experiments, we design three scenarios as abstractions of job scheduling, the Matthew effect, and manufacturing plant, which are illustrated in Figure 2. We demonstrate that by each agent decentralizedly optimizing the fair-efficient reward the multi-agent system could obtain a great balance between efficiency and fairness, and that the hierarchy indeed helps to learn both fairness and efficiency more easily. In the experiments, we compare FEN against several baselines which have different optimization objectives and are summarized as follows.•Independent agents are fully self-interested and each agent maximizes its expected sum of discounted environmental rewards ψi=𝔼​[∑t=0∞γt​rti]subscript𝜓𝑖𝔼delimited-[]superscriptsubscript𝑡0superscript𝛾𝑡subscriptsuperscript𝑟𝑖𝑡\psi_{i}=\mathbb{E}\left[\sum_{t=0}^{\infty}\gamma^{t}r^{i}_{t}\right].•Inequity Aversion agents receive a shaped reward ri−αN−1​∑max​(rj−ri,0)−βN−1​∑max​(ri−rj,0)subscript𝑟𝑖𝛼𝑁1maxsubscript𝑟𝑗subscript𝑟𝑖0𝛽𝑁1maxsubscript𝑟𝑖subscript𝑟𝑗0r_{i}-\frac{\alpha}{N-1}\sum\textrm{max}(r_{j}-r_{i},0)-\frac{\beta}{N-1}\sum\textrm{max}(r_{i}-r_{j},0) to model the envy and guilt [21].•Avg agents take the average reward of agents as a shared reward and maximize avg​ψ=∑ψi/navg𝜓subscript𝜓𝑖𝑛\texttt{avg}\psi=\sum\psi_{i}/n [20].•Min agents consider the worst performance of agents and maximize min​ψmin𝜓\texttt{min}\psi.•Min+α𝛼\alphaAvg agents consider both the worst performance and system performance and maximize the regularized maximin fairness [8], min​ψ+α​avg​ψmin𝜓𝛼avg𝜓\texttt{min}\psi+\alpha\texttt{avg}\psi.Note that in the last three baselines, all agents share the same optimization objective.To ensure the comparison is fair, the basic hyperparameters are all the same for FEN and the baselines, which are summarized in Appendix. The details about the experimental setting of each scenario are also available in Appendix. Moreover, the code of FEN is at https://github.com/PKU-AI-Edge/FEN.
48
+
49
+ In this scenario of job scheduling, we investigate whether agents can learn to fairly and efficiently share a resource. In a 5×5555\times 5 grid world, there are 444 agents and 111 resource, illustrated in Figure 2 (left). The resource’s location is randomly initialized in different episodes, but fixed during an episode. Each agent has a local observation that contains a square view with 3×3333\times 3 grids centered at the agent itself. At each timestep, each agent can move to one of four neighboring grids or stay at current grid. If the agent occupies the resource (move to or stay at the resource’s location), it receives a reward of 111, which could be seen as the job is scheduled, otherwise the reward is 00. Two agents cannot stay at a same grid, making sure the resource can only be occupied by one agent at a timestep. We trained all the methods for five runs with different random seeds. All experimental results are presented with standard deviation (also in other two scenarios). Moreover, as all agents are homogeneous in the task, we let agents share weights for all the methods.
50
+
51
+ Table 1 shows the performance of FEN and the baselines in terms of resource utilization (sum of utility), coefficient of variation (CV) of utility (fairness), min utility, and max utility. Independent has the highest resource utilization, but also the worst CV. Self-interested Independent agents would not give up the resource for fairness, which is also witnessed by that min utility is 00 and max utility is 0.880.880.88, close to resource utilization. FEN has the lowest CV and the highest min utility. As only one agent can use the resource at a time, fairly sharing the resource among agents inevitably incurs the reduction of resource utilization. However, FEN can obtain much better fairness at a subtle cost of resource utilization, and its resource utilization is slightly less than Independent. Maximizing avg​ψavg𝜓\text{avg}\psi causes high CV since the average is not directly related to fairness. Its resource utilization is also lower, because avg​ψavg𝜓\text{avg}\psi is determined by all the agents, making it hard for individual agents to optimize by decentralized training. For the same reason, min​ψmin𝜓\text{min}\psi is hard to be maximized by individual agents. The regularized maximin fairness reward min​ψ+α​avg​ψmin𝜓𝛼avg𝜓\text{min}\psi+\alpha\text{avg}\psi is designed to obtain a balance between fairness and resource utilization. However, due to the limitations of these two objective terms, Min+α𝛼\alphaAvg is much worse than FEN. The CV of Inequity Aversion is better than Independent but still worse than FEN, and the resource utilization is much lower, showing modeling envy and guilt is not effective in fairness problems. Moreover, the hyperparameters α𝛼\alpha and β𝛽\beta might greatly affect the performance.
52
+
53
+ Since min​ψmin𝜓\text{min}\psi, avg​ψavg𝜓\text{avg}\psi, and min​ψ+α​avg​ψmin𝜓𝛼avg𝜓\text{min}\psi+\alpha\text{avg}\psi do not depend on individual agents, but all agents, we adopt a centralized policy, which takes all observations and outputs actions for all agents, to optimize each objective. As shown in Table 1, the centralized policies for Min, Avg, and Min+α𝛼\alphaAvg are even worse than their decentralized versions. Although the centralized policy could coordinate agents’ behaviors, it is hard to train because of the curse of dimensionality. We also tried the centralized policy in the Matthew effect and manufacturing plant, but it did not work and thus is omitted.
54
+
55
+ Does the hierarchy indeed help the learning of FEN? To verify the effect of the hierarchy, we trained a single policy to maximize the fair-efficient reward directly without the hierarchy. Figure 4 illustrates the learning curves of FEN and FEN w/o Hierarchy, where we can see that FEN converges to a much higher mean fair-efficient reward than FEN w/o Hierarchy. As shown in Table 1, although FEN w/o Hierarchy is fairer than other baselines, the resource utilization is mediocre. This is because it is hard for a single policy to learn efficiency from the fair-efficient reward. However, in FEN, one of the sub-policies explicitly optimizes the environmental reward to improve the efficiency, other sub-policies learn diverse fairness behaviors, and the controller optimizes fair-efficient reward by long time horizon planing. The hierarchy successfully decomposes the complex objective and reduce the learning difficulty.
56
+
57
+ To further verify the effectiveness of the hierarchy, we use the hierarchy with other baselines. The controller maximizes each own objective and the sub-policies are the same as FEN. Table 1 shows their performance has a certain degree of improvement, especially the resource utilizations of Min and Min+α𝛼\alphaAvg raise greatly and the CV of Min+α𝛼\alphaAvg reduces significantly. That demonstrates the hierarchy we proposed could reduce learning difficulty in many general cases with both global and local objectives. However, these baselines with the hierarchy are still worse than FEN in both resource utilization and CV, verifying the effectiveness of the fair-efficient reward.
58
+
59
+ In order to analyze the behavior of the controller, in Figure 4 we visualize the probability of selecting sub-policy ϕ1subscriptitalic-ϕ1\phi_{1} and other sub-policies in terms of the utility deviation from average, (ui−u¯)/u¯subscript𝑢𝑖¯𝑢¯𝑢(u_{i}-\bar{u})/\bar{u}. It shows when the agent’s utility is below average, the controller is more likely to select ϕ1subscriptitalic-ϕ1\phi_{1} to occupy the resources, and when the agent’s utility is above average, the controller tends to select other sub-policies to improve fairness. The controller learns the sensible strategy based on the fair-efficient reward.
60
+
61
+ In this scenario of the Matthew effect, we investigate whether agents can learn to mitigate/avoid the Matthew effect. In the scenario, there are 101010 pac-men (agents) initialized with different positions, sizes, and speeds and also 333 stationary ghosts initialized at random locations, illustrated in Figure 2 (mid). Each pac-man can observe the nearest three other pac-men and the nearest one ghost. It could move to one of four directions or stay at current position. Once the distance between the pac-men and a ghost is less than the agent’s size, the ghost is consumed and the agent gets a reward 111. Then, a new ghost will be generated at a random location. When the agent gets a reward, its size and speed will increase correspondingly until the upper bounds are reached. In this scenario, the pac-man who consumes more ghosts becomes larger and faster, making consume ghosts easier. So, there exists inherent inequality in the setting. We trained all the models for five runs with different random seeds. As pac-men are homogeneous, we let pac-men share weights for all the methods.
62
+
63
+ Figure 5 shows the performance of FEN and the baselines in terms of social welfare (total ghosts consumed by all the pac-men), CV, and min and max income (consumed ghosts) among pac-men, episodes to converge. The detailed results are available in Appendix. Random pac-men take random actions and their CV shows the inherent unfairness of this scenario. Min pac-men cannot learn reasonable policies, because min​ψmin𝜓\text{min}\psi is always closed to 00. Min+α𝛼\alphaAvg is only a little fairer than Avg since the effect of min​ψmin𝜓\text{min}\psi is very weak. Independent causes the Matthew effect as indicated by the min (close to 00) and max (more than 200200200) income, where pac-man with initial larger size becomes larger and larger and ghosts are mostly consumed by these larger pac-men. Inequity Aversion is slightly fairer than Independent but lower social welfare.
64
+
65
+ Although Independent has the largest pac-man which consumes ghosts faster than others, this does not necessarily mean they together consume ghosts fast. FEN is not only fairer than the baselines but also has the highest social welfare, even higher than Independent. FEN pac-men have similar sizes and consume more ghosts than the baselines. This demonstrates FEN is capable of tackling the Matthew effect and helps social welfare increase.FEN w/o Hierarchy focuses more on fairness, neglecting the efficiency as in the scenario of job scheduling.Moreover, learning without hierarchy is much slower than FEN in this scenario, as illustrated in Figure 6. FEN w/o Hierarchy takes about 600060006000 episodes, while FEN takes only about 300300300 episodes, confirming that the hierarchy indeed speeds up the training.
66
+
67
+ Does distributed average consensus affect the performance of FEN? Instead of using the centrally computed average utility, we employ the gossip algorithm to estimate the average utility, where each agent only exchanges information with the agents in its observation. As shown in Figure 5, FEN w/ Gossip performs equivalently to FEN with only slight variation on each performance metric. The learning curve of FEN w/ Gossip is also similar to FEN, as illustrated in Figure 6. These confirm that FEN can be trained in a fully decentralized way.
68
+
69
+ Do sub-policies really learn something useful? To answer this question, after the training of FEN, we keep the learned weights θ𝜃\theta and ϕ1subscriptitalic-ϕ1\phi_{1} and replace other sub-policies with a random sub-policy. Once the controller chooses other sub-policies instead of ϕ1subscriptitalic-ϕ1\phi_{1}, the agent will perform random actions. In this FEN w/ random sub-policy, the min income become lower than FEN and CV becomes higher, because the random sub-policy cannot provide fairness behavior the controller requests. To investigate the difference of learned sub-policies and random sub-policy, we fix the three ghosts as a triangle at the center of the field and visualize the distribution of an agent’s positions under each sub-policy, as illustrated in Figure 7. It is clear that the learned sub-policies keep away from the three ghosts for fairness and their distributions are distinct, concentrated at different corners, verifying the effect of the information-theoretic reward.
70
+
71
+ In this scenario of manufacturing plant, we investigate whether agents with different needs can learn to share different types of resources and increase the production in a manufacturing plant. In a 8×8888\times 8 grid world, there are 555 agents and 888 gems, as illustrated in Figure 2 (right). The gems belong to three types (y, g, b). Each agent has a local observation that contains a square view with 5×5555\times 5 grids centered at the agent itself, and could move to one of four neighboring grids or stay. When an agent moves to the grid of one gem, the agent collects the gem and gets a reward of 0.010.010.01, and then a new gem with random type and random location is generated. The total number of gems is limited, and when all the gems are collected by the agents, the game ends. Each agent has a unique requirement of numbers for the three types of gems to manufacture a unique part of the product and receive a reward 111. Each product is assembled by the five unique parts manufactured by the five agents, respectively. So, the number of manufactured products is determined by the least part production among the agents. Due to the heterogeneity, we let each agent learn its own weights for FEN and the baselines.
72
+
73
+ Table 2 shows the performance of FEN and the baselines in terms of resource utilization (the ratio of the number of gems consumed to manufacture the products over the total number of gems), CV, number of products (minimum number of manufactured parts among agents), and max number of manufactured parts among agents. In this scenario, agents need to learn to collect the right gems and then to balance the parts manufactured by each agent (i.e., manufacturing similar large number of parts), because the unused collected gems and redundant parts will be wasted. FEN manufactures the most products, more than two times than the baselines. The more products are assembled, the higher the resource utilization is. Thus, FEN also has the highest resource utilization. Moreover, FEN is also the fairest one. Although FEN w/o Hierarchy agents are fairer than other baselines, they all manufacture less parts and hence eventually less products. Avg agents assemble the least products, though one agent manufactures the largest number of parts, resulting in serious waste.
74
+
75
+ We have proposed FEN, a novel hierarchical reinforcement learning model to learn both fairness and efficiency, driven by fair-efficient reward, in multi-agent systems. FEN consists of one controller and several sub-policies, where the controller learns to optimize the fair-efficient reward, one sub-policy learns to optimize the environmental reward, and other sub-policies learn to provide diverse fairness behaviors guided by the derived information-theoretic reward. FEN can learn and execute in a fully decentralized way, coordinated by average consensus. It is empirically demonstrated that FEN easily learns both fairness and efficiency and significantly outperforms baselines in a variety of multi-agent scenarios including job scheduling, the Matthew effect, and manufacturing plant.
76
+
77
+ This work was supported in part by Huawei Noah’s Ark Lab, Peng Cheng Lab, and NSF China under grant 61872009.
1910.14479v1.txt ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ As CNNs are increasingly explored for safety-critical applications such as autonomous vehicles and aerospace, reliability of CNN inference is becoming an important concern. A key threat is memory faults (e.g., bit flips in memory), which may result from environment perturbations, temperature variations, voltage scaling, manufacturing defects, wear-out, and radiation-induced soft errors. These faults change the stored data (e.g., CNN parameters), which may cause large deviations of the inference results [13, 19, 20]. In this work, fault rate is defined as the ratio between the number of bit flips experienced before correction is applied and the total number of bits.
2
+
3
+ Existing solutions have resorted to general memory fault protection mechanisms, such as Error Correction Codes (ECC) hardware [24], spatial redundancy, and radiation hardening [28]. Being CNN-oblivious, these protections incur large costs. ECC, for instance, uses eight extra bits in protecting 64-bit memory; spatial redundancy requires at least two copies of CNN parameters to correct one error (called Triple Modular Redundancy (TMR) [14]); radiation hardening is subject to substantial area overhead and hardware cost. The spatial, energy, and hardware costs are especially concerning for safety-critical CNN inferences; as they often execute on resource-constrained (mobile) devices, the costs worsen the limit on model size and capacity, and increase the cost of the overall AI solution.
4
+
5
+ To address the fundamental tension between the needs for reliability and the needs for space/energy/cost efficiency, this work proposes the first zero space cost memory protection for CNNs. The design capitalizes on the opportunities brought by the distinctive properties of CNNs. It further amplifies the opportunities by introducing a novel training scheme, Weight Distribution-Oriented Training (WOT), to regularize the weight distributions of CNNs such that they become more amenable for zero-space protection. It then introduces a novel protection method, in-place zero-space ECC, which removes all space cost of ECC protection while preserving protection guarantees.
6
+
7
+ Experiments on VGG16, ResNet18, and SqueezeNet validate the effectiveness of the proposed solution. Across all tested scenarios, the method provides protections consistently comparable to those offered by existing hardware ECC logic, while removing all space costs. It hence offers a promising replacement of existing protection schemes for CNNs.
8
+
9
+ There are some early studies on fault tolerance of earlier neural networks (NN) [16, 17, 26]; they examined the performance degradation of NNs with various fault models on networks that differ from modern CNNs in both network topologies and and model complexities.
10
+
11
+ Fault tolerance of deep neural networks (DNN) has recently drawn increasing attentions.Li et al. [13] studied the soft error propagation in DNN accelerators and proposed to leverage symptom-based error detectors for detecting errors and a hardware-based technique, selective latch hardening, for detecting and correcting data-path faults. A recent work [19, 3] conducted some empirical studies to quantify the fault tolerance of DNNs to memory faults and revealed that DNN fault tolerance varies with respect to model, layer type, and structure. Zhang et al. [30] proposed fault-aware pruning with retraining to mitigate the impact of permanent faults for systolic array-based CNN accelerators (e.g., TPUs). They focused only on faults in the data-path and ignored faults in the memory.Qin et al. [18] studied the performance degradation of 16-bit quantized CNNs under different bit flip rates and proposed to set values of detected erroneous weights as zeros to mitigate the impact of faults.These prior works focused mainly on the characterization of DNN’s fault tolerance with respect to various data types and network topologies. While several software-based protection solutions were explored, they are preliminary. Some can only detect but not correct errors (e.g. detecting extreme values [13]), others have limited protection capability (e.g. setting faulty weights to zero [18]).
12
+
13
+ Some prior work proposes designs of energy-efficient DNN accelerators by exploiting fault tolerance of DNNs [25, 12, 29]. An accelerator design [20] optimizes SRAM power by reducing the supply voltage. It leverages active hardware fault detection coupled with bit masking that shifts data towards zero to mitigate the impact of bit flips on DNNs’ model accuracy without the need of re-training.Similar hardware faults detection techniques are later exploited in [27, 22, 29, 7] to improve fault tolerance of DNNs. Azizimazreah et al. [4] proposed a novel memory cell designed to eliminate soft errors while achieving a low power consumption.These designs are for some special accelerators rather than general DNN reliability protection. They are still subject to various costs and offer no protection guarantees as existing ECC protections do. This current work aims to reducing the space cost of protection to zero without compromising the reliability of existing protections.
14
+
15
+ This work focuses on protections of 8-bit quantized CNN models.On the one hand, although the optimal bit width for a network depends on its weight distribution and might be lower than 8, we have observed that 8-bit quantization is a prevalent, robust, and general choice to reduce model size and latency while preserving accuracy. In our experiments, both activations and weights are quantized to 8-bit. Existing libraries that support quantized CNNs (e.g. NVIDIA TensorRT [15], Intel MKL-DNN [1], Google’s GEMMLOWP [10], Facebook’s QNNPACK [2]) mainly target for fast operators using 8-bit instead of lower bit width.On the other hand, previous studies [13, 19] have suggested that CNNs should use data types that provide just-enough numeric value range and precision to increase its fault tolerance. Our explorations on using higher precision including float32 for representing CNN parameters also show that 8-bit quantized models are the most resilient to memory faults.
16
+
17
+ The quantization algorithm we used is symmetric range-based linear quantization that is well-supported by major CNN frameworks (e.g. Tensorflow [11], Pytorch [32]). Specifically, let X𝑋X be a floating-point tensor and Xqsuperscript𝑋𝑞X^{q} be the 8-bit quantized version. X𝑋X can be either weights or activations from a CNN. The quantization is based on the following formula:Xq=r​o​u​n​d​(X​2n−1−1max⁡{|X|}),superscript𝑋𝑞𝑟𝑜𝑢𝑛𝑑𝑋superscript2𝑛11𝑋X^{q}=round(X\frac{2^{n-1}-1}{\max\{|X|\}}),(1)where n𝑛n is the number of bits used for quantization. In our case, n=8𝑛8n=8. The number of bits used for accumulation is 32. Biases, if exist, are quantized to 32 bit integer.
18
+
19
+ Our work protects only weights for two reasons. Firstly, weights are usually kept in the memory. The longer they are kept, the higher the number of bit flips they will suffer from. This easily results in a high fault rate (e.g. 1e-3) for weights. Activations, however, are useful only during an inference process. Given the slight chance of having a bit flip during an inference process (usually in milliseconds), protecting activations is not as pressing as protecting weights. Secondly, previous work [19] has shown that activations are much less sensitive to faults compared with weights.
20
+
21
+ Error Correction Codes (ECC) is commonly used in computer systems to correct memory faults. They are usually described as (k,d,t)𝑘𝑑𝑡(k,d,t) code for length k𝑘k code word, length d𝑑d data, and t𝑡t-bit error correction. The number of required check bits is k−d𝑘𝑑k-d.
22
+
23
+ Our proposed method, in-place zero-space ECC, builds on the following observation:Weights of a well-trained CNN are mostly small values. The Percentage rows in Table 1 show the distributions of the absolute values of weights in some popular 8-bit quantized CNN models. The absolute values of more than 99% of the weights are less than 64. Even though eight bits are used to represent each weight, if we already know that the absolute value of a weight is less than 64, the number of effective bits to represent the value would be at most seven, and the remaining bit could be possibly used for other purposes—such as error correction. We call it a non-informative bit.
24
+
25
+ The core idea of in-place zero-space ECC is to use non-informative bits in CNN parameters to store error check bits. For example, the commonly used SEC-DED (64,57,1)64571(64,57,1) code uses seven check bits to protect 57 data bits for single error correction; they together form a 64-bit code word. If seven out of eight consecutive weights are in range [−64,63]6463[-64,63], we can then have seven non-informative bits, one per small weight. The essential idea of in-place ECC is to use these non-informative bits to store the error check bits for the eight weights. By embedding the check bits into the data, it can hence avoid all space cost.
26
+
27
+ For the in-place ECC to work, there cannot be more than one large weight in every 8 consecutive weights. And the implementation has to record the locations of the large weights such that the decoding step can find the error check bits from the data. It is, however, important to note that the requirement of recording the locations of large weights would disappear if the large weights are regularly distributed in data—an example is that the only place in which a large weight could appear is the last byte of an 8-byte block. However, the distributions of large weights in CNNs are close to uniform, as Figure 1 shows.
28
+
29
+ To eliminate the need of storing large weight locations in in-place ECC, we enhance our design by introducing a new training scheme, namely weight-distribution oriented training (WOT). WOT aims to regularize the spatial distribution of large weights such that large values can appear only at specific places. We first formalize the WOT problem and then elaborate our regularized training process.
30
+
31
+ Let Wlsubscript𝑊𝑙W_{l} be the float32 parameters (including both weights and biases) in the l𝑙l-th convolutional layer and Wlqsuperscriptsubscript𝑊𝑙𝑞W_{l}^{q} be their values after quantization. Note that WOT applies to fully-connected layers as well even though our discussion focuses on convolutional layers. WOT minimizes the sum of the standard cross entropy loss (f​({Wlq}l=1L)𝑓superscriptsubscriptsuperscriptsubscript𝑊𝑙𝑞𝑙1𝐿f(\{W_{l}^{q}\}_{l=1}^{L})) and weighted weight regularization loss (Frobenius norm with the hyperparameter λ𝜆\lambda) subject to some weight distribution constraints on the weights:min{Wlq}⁡f​({Wlq}l=1L)+λ​∑l=1L‖Wlq‖F2,subscriptsuperscriptsubscript𝑊𝑙𝑞𝑓superscriptsubscriptsuperscriptsubscript𝑊𝑙𝑞𝑙1𝐿𝜆superscriptsubscript𝑙1𝐿superscriptsubscriptnormsuperscriptsubscript𝑊𝑙𝑞𝐹2\displaystyle\min_{\{W_{l}^{q}\}}f(\{W_{l}^{q}\}_{l=1}^{L})+\lambda\sum_{l=1}^{L}\|W_{l}^{q}\|_{F}^{2},(2)s.t.Wlq∈Sl,l=1,⋯,L.\displaystyle s.t.\quad W_{l}^{q}\in S_{l},l=1,\cdots,L.(3)
32
+
33
+ The weights are a four-dimensional tensor. If flattened, it is a vector of length Nl×Cl×Hl×Wlsubscript𝑁𝑙subscript𝐶𝑙subscript𝐻𝑙subscript𝑊𝑙N_{l}\times C_{l}\times H_{l}\times W_{l}, where Nlsubscript𝑁𝑙N_{l}, Clsubscript𝐶𝑙C_{l}, Hlsubscript𝐻𝑙H_{l} and Wlsubscript𝑊𝑙W_{l} are respectively the number of filters, the number of channels in a filter, the height of the filter, and the width of the filter, in the l𝑙l-th convolutional layer. WOT adds constraints to each 64-bit data block in the flattened weight vectors.Recall that, for in-place ECC to protect a 64-bit data block, we need seven non-informative bits (i.e., seven small weights in the range [−64,63]6463[-64,63]) to store the seven check bits. To regularize the positions of large values in weights, the constraint on the weights in the l𝑙l-th convolutional layer can be given by Sl={X|S_{l}=\{X| the first seven values in every 64-bit data block can have a value in only the range of [−64,63]}[-64,63]\}.
34
+
35
+ We next describe two potential solutions to the optimization problems.
36
+
37
+ The above optimization problem can be formulated in the Alternating Direction Method of Multipliers (ADMM) framework and solved in a way similar to an earlier work [31].The optimization problem (Eq.  2) is equivalent to:min{Wlq}}⁡f​({Wlq}l=1L)+λ​∑l=1L‖Wlq‖F2+∑l=1Lgl​(Wlq),\displaystyle\min_{\{W_{l}^{q}\}\}}f(\{W_{l}^{q}\}_{l=1}^{L})+\lambda\sum_{l=1}^{L}\|W_{l}^{q}\|_{F}^{2}+\sum_{l=1}^{L}{g_{l}(W_{l}^{q})},(4)where gl​(Wlq)={0,if ​Wlq∈Sl+∞,otherwise.subscript𝑔𝑙superscriptsubscript𝑊𝑙𝑞cases0if superscriptsubscript𝑊𝑙𝑞subscript𝑆𝑙otherwiseg_{l}(W_{l}^{q})=\begin{cases}0,&\text{if }W_{l}^{q}\in S_{l}\\+\infty,&\text{otherwise}.\end{cases}.Rewriting Eq. 4 in the ADMM framework leads to:min{Wlq}⁡f​({Wlq}l=1L)+λ​∑l=1L‖Wlq‖F2+∑l=1Lgl​(Zl),subscriptsuperscriptsubscript𝑊𝑙𝑞𝑓superscriptsubscriptsuperscriptsubscript𝑊𝑙𝑞𝑙1𝐿𝜆superscriptsubscript𝑙1𝐿superscriptsubscriptnormsuperscriptsubscript𝑊𝑙𝑞𝐹2superscriptsubscript𝑙1𝐿subscript𝑔𝑙subscript𝑍𝑙\displaystyle\min_{\{W_{l}^{q}\}}f(\{W_{l}^{q}\}_{l=1}^{L})+\lambda\sum_{l=1}^{L}\|W_{l}^{q}\|_{F}^{2}+\sum_{l=1}^{L}{g_{l}(Z_{l})},(5)s.t.Wlq=Zl,l=1,⋯,L\displaystyle s.t.\quad W_{l}^{q}=Z_{l},l=1,\cdots,L(6)
38
+
39
+ ADMM alternates between the optimization of model parameters ({Wlq}l=1Lsuperscriptsubscriptsuperscriptsubscript𝑊𝑙𝑞𝑙1𝐿\{W_{l}^{q}\}_{l=1}^{L} and the auxiliary variables {Zl}l=1Lsuperscriptsubscriptsubscript𝑍𝑙𝑙1𝐿\{Z_{l}\}_{l=1}^{L} by repeating the following three steps for k=1,2,⋯𝑘12⋯k=1,2,\cdots :{Wlq,k+1}l=1L=superscriptsubscriptsuperscriptsubscript𝑊𝑙𝑞𝑘1𝑙1𝐿absent\displaystyle\{W_{l}^{q,k+1}\}_{l=1}^{L}=arg⁡min{Wlq}l=1L⁡f​({Wlq}l=1L)+λ​∑l=1L‖Wlq‖F2+γ​∑l=1L‖Wlq−Zl+Ulk‖F2,subscriptsuperscriptsubscriptsuperscriptsubscript𝑊𝑙𝑞𝑙1𝐿𝑓superscriptsubscriptsuperscriptsubscript𝑊𝑙𝑞𝑙1𝐿𝜆superscriptsubscript𝑙1𝐿superscriptsubscriptnormsuperscriptsubscript𝑊𝑙𝑞𝐹2𝛾superscriptsubscript𝑙1𝐿superscriptsubscriptnormsuperscriptsubscript𝑊𝑙𝑞subscript𝑍𝑙superscriptsubscript𝑈𝑙𝑘𝐹2\displaystyle\arg\min_{\{W_{l}^{q}\}_{l=1}^{L}}f(\{W_{l}^{q}\}_{l=1}^{L})+\lambda\sum_{l=1}^{L}\|W_{l}^{q}\|_{F}^{2}+\gamma\sum_{l=1}^{L}{\|W_{l}^{q}-Z_{l}+U_{l}^{k}\|_{F}^{2}},(7){Zlk+1}l=1L=superscriptsubscriptsuperscriptsubscript𝑍𝑙𝑘1𝑙1𝐿absent\displaystyle\{Z_{l}^{k+1}\}_{l=1}^{L}=arg⁡min{Zl}l=1L​∑l=1Ngl​(Zl)+∑l=1Lλ2​‖Wlq,k+1−Zl+Ulk‖F2,subscriptsuperscriptsubscriptsubscript𝑍𝑙𝑙1𝐿superscriptsubscript𝑙1𝑁subscript𝑔𝑙subscript𝑍𝑙superscriptsubscript𝑙1𝐿𝜆2superscriptsubscriptnormsuperscriptsubscript𝑊𝑙𝑞𝑘1subscript𝑍𝑙superscriptsubscript𝑈𝑙𝑘𝐹2\displaystyle\arg\min_{\{Z_{l}\}_{l=1}^{L}}\sum_{l=1}^{N}g_{l}(Z_{l})+\sum_{l=1}^{L}\frac{\lambda}{2}{\|W_{l}^{q,k+1}-Z_{l}+U_{l}^{k}\|_{F}^{2}},(8)Ulk+1=superscriptsubscript𝑈𝑙𝑘1absent\displaystyle U_{l}^{k+1}=Ulk+Wlq,k+1−Zlk+1.superscriptsubscript𝑈𝑙𝑘superscriptsubscript𝑊𝑙𝑞𝑘1superscriptsubscript𝑍𝑙𝑘1\displaystyle U_{l}^{k}+W_{l}^{q,k+1}-Z_{l}^{k+1}.(9)until the two conditions are met: ‖Wlq,k+1−Zlk+1‖F2≤ϵsuperscriptsubscriptnormsuperscriptsubscript𝑊𝑙𝑞𝑘1superscriptsubscript𝑍𝑙𝑘1𝐹2italic-ϵ\|W_{l}^{q,k+1}-Z_{l}^{k+1}\|_{F}^{2}\leq\epsilon and ‖Zlk+1−Zlk‖F2≤ϵsuperscriptsubscriptnormsuperscriptsubscript𝑍𝑙𝑘1superscriptsubscript𝑍𝑙𝑘𝐹2italic-ϵ\|Z_{l}^{k+1}-Z_{l}^{k}\|_{F}^{2}\leq\epsilon.
40
+
41
+ Problem 7 can be solved using stochastic gradient descent (SGD) as the objective function is differentiable. The optimal solution to the problem 8 is the projection of Wlq,k+1+Ulksuperscriptsubscript𝑊𝑙𝑞𝑘1superscriptsubscript𝑈𝑙𝑘W_{l}^{q,k+1}+U_{l}^{k} to set Slsubscript𝑆𝑙S_{l}. In the implementation, we set a value in a 64-data block to 63 or -64 if the value is not in the eighth position and is larger than 63 or smaller than -64.
42
+
43
+ Previous work has successfully applied the ADMM framework to CNN weight pruning [31] and CNN weight quantization [21] and shown remarkable compression results.But when it is applied to our problem, experiments show that ADMM-based training cannot help reduce the number of large values in the first seven positions of a 64-bit data block. Moreover, as the ADMM-based training cannot guarantee that the constrain in Eq. 3 is satisfied, it is necessary to bound the reamining large quantized values in the first 7 positions to 63 or -64 after the training, resulting in large accuracy drops. Instead of ADMM-based training, WOT adopts an alternative approach described below.
44
+
45
+ Our empirical explorations indicate that a simple quantization-aware training (QAT) procedure combined with weight throttling can make the weights meet the constraint without jeopardising the accuracy of a 8-bit quantized model. The training process iterates the following major steps for each batch:1.QAT: It involves forward-propagation using quantized parameters ({Wlq}l=1Lsuperscriptsubscriptsuperscriptsubscript𝑊𝑙𝑞𝑙1𝐿\{W_{l}^{q}\}_{l=1}^{L} and {blq}l=1Lsuperscriptsubscriptsuperscriptsubscript𝑏𝑙𝑞𝑙1𝐿\{b_{l}^{q}\}_{l=1}^{L}) to get the loss defined in Equation 2, back-propagation using quantized parameters, a update step that applies float32 gradients to update float32 parameters ({Wl}l=1Lsuperscriptsubscriptsubscript𝑊𝑙𝑙1𝐿\{W_{l}\}_{l=1}^{L} and {bl}l=1Lsuperscriptsubscriptsubscript𝑏𝑙𝑙1𝐿\{b_{l}\}_{l=1}^{L}), and a quantization step that gets the new quantized parameters from their float32 version.2.Throttling: It forces the quantized weights to meet the constraints defined in Eq. 3: If any value in the first seven bytes of a 64-bit data block is larger than 63 (or less than -64), set the value to 63 (or -64). The float32 versions are updated accordingly.
46
+
47
+ After the training, all of the values in the first seven positions of a 64-bit data block are ensured to be within the range of [−64,63]6463[-64,63], eliminating the need of storing large value positions for the in-place ECC. It is worth noting that with WOT, all tested CNNs converge without noticeable accuracy loss compared to the 8-bit quantized versions as Section 5 shows.
48
+
49
+ In this part, we provide the full design of in-place zero-space ECC. For a given CNN, it first applies WOT to regularize the CNN. After that, it conducts in-place error check encoding. The encoding uses the same encoding algorithm as the standard error-correction encoding methods do; the difference lies only in where the error check bits are placed.
50
+
51
+ There are various error-correction encoding algorithms.In principle, our proposed in-place ECC could be generalized to various codes; we focus our implementation on SEC-DED codes for its popularity in existing hardware-based memory protections for CNN.
52
+
53
+ Our in-place ECC features the same protection guarantees as the popular SEC-DED (72,64,1)72641(72,64,1) code but at zero-space cost.The in-place ECC uses the SEC-DED (64,57,1)64571(64,57,1) code instead of (72,64,1)72641(72,64,1) to protect a 64-bit data block with the same protection strength. It distributes the seven error check bits into the non-informative bits in the first seven weights.
54
+
55
+ As the ECC check bits are stored in-place, a minor extension to the existing ECC hardware is required to support ECC decoding. As shown in Figure 2, the in-place ECC check bits and data bits are swizzled to the right inputs to the standard ECC logic. The output of the ECC logic is then used to recover the original weights: for each small weight (first seven bytes in a 8-byte data block), simply copy the sign bit to its non-informative bit. As only additional wiring is needed to implement this copy operation, no latency overhead is incurred to the standard ECC logic.
56
+
57
+ We conducted a set of experiments to examine the efficacy of the proposed techniques in fault protection and overhead. We first describe our experiment settings in Section 5.1 and then report the effects of WOT and the proposed fault protection technique in Sections 5.2 and 5.3.
58
+
59
+ The models we used in the fault injection experiments include VGG16 [23], ResNet18 [8], and SqueezeNet [9].We choose these CNN models as representatives because: 1) VGG is a typical CNN with stacked convolutional layers and widely used in transfer learning because of its robustness. 2) ResNets are representatives of CNNs with modular structure (e.g. Residual Module) and are widely used in advanced computer vision tasks such as object detection. 3) SqueezeNet has much fewer parameters and represents CNNs that are designed for mobile applications.The accuracies of these models are listed in Table 1. By default, We use the ImageNet dataset [6] (ILSVRC 2012) for model training and evaluation.All the experiments are performed with PyTorch 1.0.1 on machines equipped with a 40-core 2.2GHz Intel Xeon Silver 4114 processor, 128GB of RAM, and an NVIDIA TITAN Xp GPU with 12GB memory. Distiller [32] is used for 8-bit quantization. The CUDA version is 10.1.
60
+
61
+ We compare our method (denoted as in-place) with the following three counterparts:•No Protection (faulty): The CNN has no memory protection.•Parity Zero (zero): It adds one parity bit to detect single bit errors in an eight-bit data block (e.g. a single weight parameter). Once errors are detected, the weight is set to zero111We have tried to set a detected faulty weight to the average of its neighbors but found it has worse performance than Parity Zero..•SEC-DED (ecc) It is the traditional SEC-DED [72,64,1]72641[72,64,1] code-based protection in computer systems [24].
62
+
63
+ There are some previous proposals [20, 4] of memory protections, which are however designed for special CNN accelerators and provide without protection guarantees. The parity and ECC represent the state of the art in the industry for memory protection that work generally across processors and offer protection guarantees, hence the counterparts for our comparison.
64
+
65
+ We evaluate the efficiency of WOT using the CNNs shown in Table 1. All the models are pre-trained on ImageNet (downloaded from TorchVision222https://pytorch.org/docs/master/torchvision/). We set λ𝜆\lambda to 0.00010.00010.0001 for all of the CNNs. Model training uses stochastic gradient descent with a constant learning rate 0.0001 and momentum 0.9. Batch size is 32 for VGG16_bn and ResNet152, 64 for ResNet50 and VGG16, and 128 for the remaining models. Training stops as long as the model accuracy after weight throttling reaches its 8-bit quantized version.
66
+
67
+ Figure 3 shows the changes of the total number of large values that are beyond [−64,63]6463[-64,63] in the first seven positions of 8-byte blocks during the training on six of the CNNs. WOT successfully reduces this number from more than 3,500–80,000 to near 0 for the models before throttling during the training process. The remaining few large values in non-eighth positions are set to -64 or 63 at the end of WOT. Note that VGG16_bn has around 10000 large values in the non eighth positions after 8k iterations. Although more iterations further reduce this number, VGG16_bn can already reach its original accuracy after weight throttling.
68
+
69
+ The accuracy curves of the models in the WOT training are shown in Figure 4. Overall, after WOT training, the original accuracy of all the six networks are fully recovered. During the training, the gap between the accuracy before throttling and after throttling is gradually reduced. For example, the top-1 accuracy of SqueezeNet after 8-bit quantization is 57.01%percent57.0157.01\%. After the first iteration of WOT, the accuracy before weight throttling is 31.38%percent31.3831.38\% and drops to 11.54%percent11.5411.54\% after throttling. WOT increases the accuracy to 57.11%percent57.1157.11\% after 46k iterations with batch size 128 (around 4 epochs). All the other CNNs are able to recover their original accuracy in only a few thousands of iterations. An exception is VGG16, which reaches an accuracy of 71.50% (only 0.01% accuracy loss) after 20 epochs of training.
70
+
71
+ In this set of experiments, we inject faults to CNN models and report the accuracy drops of CNN models protected using different strategies. The fault model is random bit flip. Faults are injected to the weights of CNNs with memory fault rates varying from 10−9superscript10910^{-9} to 0.0010.0010.001. The number of faulty bits is the product of the number of bits used to represent weights of a CNN and the memory fault rate. We repeated each fault injection experiment ten times.
72
+
73
+ Table 2 shows the mean accuracy drops with standard deviations under different memory fault rates and the overheads introduced by the protection strategies for each model.Overall, the in-place ECC protection and standard SEC-DED show similar accuracy drop patterns under various fault rate settings as expected because they provide the same error correction capability, i.e., correcting a single bit error and detecting double bit errors in a 64-bit data block. Both of the methods provide stronger fault protection compared with the Parity Zero method.The space overhead is the ratio between the extra number of bytes introduced by a protection strategy and the number of bytes required to store weights. Parity Zero and SEC-DED encode 8-byte data with extra eight check bits on average, making their space overhead 12.5%. In contrast, in-place ECC has zero space cost.
74
+
75
+ The fault injection experiments give the following insights on memory fault protection for CNNs. First, larger models tend to suffer less from memory faults. For example, when fault rate is 0.0001 and no protection is applied, the accuracy drops of VGG16, ResNet18, SqueezeNet (less than 2%, 8%, and 16% respectively) are increasing while the model size is decreasing (number of parameters are 138M, 12M, and 1.2M respectively).Second, when the fault rate is small (e.g. less than 1e-05), in-place ECC and standard SEC-DED can almost guarantee the same accuracy as the fault-free model. Overall, the experiments confirm the potential of in-place zero-space ECC as an efficient replacement of the standard ECC without compromising the protection quality.
76
+
77
+ Besides 8-bit quantizations, there are proposals of even fewer-bit quantizations for CNN, in which, there may be fewer non-informative bits in weight values. It is however worth noting that 8-bit quantization is the de facto in most existing CNN frameworks; it has repeatedly shown in practice as a robust choice that offers an excellent balance in model size and accuracy. Improving the reliability of such models is hence essential. With that said, creating zero-space protections that works well with other model quantizations is a direction worth future explorations.
78
+
79
+ A second direction worth exploring is to extend the in-place zero-space protection to other error encoding methods (e.g., BCH [5]). Some of them require more parity bits, for which, the regularized training may need to be extended to create more free bits in data.
80
+
81
+ Finally, in-place zero-space ECC is in principle applicable to neural networks beyond CNN. Empirically assessing the efficacy is left to future studies.
82
+
83
+ This paper presents in-place zero-space ECC assisted with a new training scheme named WOT to protect CNN memory. The protection scheme removes all space cost of ECC without compromising the reliability offered by ECC, opening new opportunities for enhancing the accuracy, energy efficiency, reliability, and cost effectiveness of CNN-driven AI solutions.
84
+
85
+ We would like to thank the anonymous reviews for their helpful feedbacks. This material is based upon work supported by the National Science Foundation (NSF) under GrantNo. CCF-1525609, CCF-1703487, CCF-1717550, and CCF-1908406. Any opinions, comments, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of NSF. This manuscript has been authored by UT-Battelle, LLC, under contract DE-AC05-00OR22725 with the US Department of Energy (DOE). The US government retains and the publisher, by accepting the article for publication, acknowledges that the US government retains a nonexclusive, paid-up, irrevocable, worldwide license to publish or reproduce the published form of this manuscript, or allow others to do so, for US government purposes. DOE will provide public access to these results of federally sponsored research in accordance with the DOE Public Access Plan (http://energy.gov/downloads/doe-public-access-plan).
1910.14481v1.txt ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Humans have the impressive ability to learn many different concepts and perform different tasks in a sequential lifelong setting.For example, infants learn to interact with objects in their environment without clear specification of tasks (task-agnostic), in a sequential fashion without forgetting (non-stationary), from temporally correlated visual inputs (non-i.i.d), and with minimal external supervision (unsupervised).For a learning system such as a robot deployed in the real world, it is highly desirable to satisfy these desiderata as well.In contrast, learning algorithms often require input samples to be shuffled in order to satisfy the i.i.d. assumption, and have been shown to perform poorly when trained on sequential data, with newer tasks or concepts overwriting older ones; a phenomenon known as catastrophic forgetting (McCloskey & Cohen, 1989; Goodfellow et al., 2013).As a result, there has been renewed research focus on the continual learning problem in recent years (e.g. Kirkpatrick et al., 2017; Nguyen et al., 2017; Zenke et al., 2017; Shin et al., 2017),with several approaches addressing catastrophic forgetting as well as backwards or forwards transfer—using the current task to improve performance on past or future tasks.However, most of these techniques have focused on a sequence of tasks in which both the identity of the task (task label) and boundaries between tasks are provided; moreover, they often focus on the supervised learning setting, where class labels for each data point are given.Thus, many of these methods fail to capture some of the aforementioned properties of real-world continual learning, with unknown task labels or poorly defined task boundaries, or when abundant class-labelled data is not available.In this paper, we propose to address the more general unsupervised continual learning setting (also suggested separately by Smith et al. (2019)), in which task labels and boundaries are not provided to the learner, and hence the focus is on unsupervised task learning.The tasks could correspond to either unsupervised representation learning, or learning skills without extrinsic reward if applied to the reinforcement learning domain.In this sense, the problem setting is “unsupervised” in two ways: in terms of the absence of task labels (or indeed well-defined tasks themselves), and in terms of the absence of external supervision such as class labels, regression targets, or external rewards.The two aspects may seem independent, but considering the unsupervised learning problem encourages solutions that aim to capture all fundamental properties of the data, which in turn might encourage, or reinforce, particular ways of addressing the task boundary problem. Hence the two aspects are connected through the type of solutions they necessitate, and it is beneficial to consider them jointly.We argue that this is an important and challenging open problem, as it enables continual learning in environments without clearly defined tasks and goals, and with minimal external supervision.Relaxing these constraints is crucial to performing lifelong learning in the real world.
2
+
3
+ Our approach, named Continual Unsupervised Representation Learning (CURL), learns a task-specific representation on top of a larger set of shared parameters, and deals with task ambiguity by performing task inference within the model.We endow the model with the ability to dynamically expand its capacity to capture new tasks, and suggest methods to minimise catastrophic forgetting.The model is experimentally evaluated in a variety of unsupervised settings: when tasks or classes are presented sequentially, when training data are shuffled, and with ambiguous task boundaries when transitions are continuous rather than discrete.We also demonstrate that despite focusing on unsupervised learning, the method can be trivially adapted to supervised learning while removing the reliance on task knowledge and class labels.The experiments demonstrate competitive performance with respect to previous work, with the additional ability to learn without supervision in a continual learning setting, and indicate the efficacy of the different components of the proposed method.
4
+
5
+ We begin by defining the CURL model and training loss, then introduce methods to perform dynamic expansion, and propose a generative replay mechanism to combat forgetting.
6
+
7
+ To address the problem, we utilise the following generative model (Figure 2):𝐲𝐲\displaystyle\mathbf{y}∼similar-to\displaystyle\simCat​(𝝅),Cat𝝅\displaystyle\textrm{Cat}(\boldsymbol{\pi}),𝐳𝐳\displaystyle\mathbf{z}∼similar-to\displaystyle\sim𝒩​(𝝁z​(𝐲),𝝈z2​(𝐲)),𝒩subscript𝝁𝑧𝐲subscriptsuperscript𝝈2𝑧𝐲\displaystyle\mathcal{N}(\boldsymbol{\mu}_{z}(\mathbf{y}),\boldsymbol{\sigma}^{2}_{z}(\mathbf{y})),(1)𝐱𝐱\displaystyle\mathbf{x}∼similar-to\displaystyle\simBernoulli​(𝝁x​(𝐳)),Bernoullisubscript𝝁𝑥𝐳\displaystyle\textrm{Bernoulli}(\boldsymbol{\mu}_{x}(\mathbf{z})),with the joint probability factorising as p���(𝐱,𝐲,𝐳)=p​(𝐲)​p​(𝐳|𝐲)​p​(𝐱|𝐳)𝑝𝐱𝐲𝐳𝑝𝐲𝑝conditional𝐳𝐲𝑝conditional𝐱𝐳p(\mathbf{x},\mathbf{y},\mathbf{z})=p(\mathbf{y})p(\mathbf{z}\,|\,\mathbf{y})p(\mathbf{x}\,|\,\mathbf{z}). Here, the categorical variable 𝐲𝐲\mathbf{y} indicates the current task, which is then used to instantiate the task-specific Gaussian parameters for latent variable 𝐳𝐳\mathbf{z}, which is then decoded to produce the input 𝐱𝐱\mathbf{x}.p​(𝐲)𝑝𝐲p(\mathbf{y}) is a fixed uniform prior, with component weights specified by 𝝅𝝅{\boldsymbol{\pi}}.In the representation learning scenario, 𝐲𝐲\mathbf{y} can be interpreted as representing some discrete clusters in the data, with 𝐳𝐳\mathbf{z} then representing a mixture of Gaussians which encodes both the inter- and intra-cluster variation.Posterior inference of p​(𝐲,𝐳|𝐱)𝑝𝐲conditional𝐳𝐱p(\mathbf{y},\mathbf{z}\,|\,\mathbf{x}) in this model is intractable, so we employ an approximate variational posterior q​(𝐲,𝐳|𝐱)=q​(𝐲|𝐱)​q​(𝐳|𝐱,𝐲)𝑞𝐲conditional𝐳𝐱𝑞conditional𝐲𝐱𝑞conditional𝐳𝐱𝐲q(\mathbf{y},\mathbf{z}\,|\,\mathbf{x})=q(\mathbf{y}\,|\,\mathbf{x})q(\mathbf{z}\,|\,\mathbf{x},\mathbf{y}).
8
+
9
+ Each of these components is parameterised by a neural network: the input is encoded to a shared representation, the mixture probabilities q​(𝐲|𝐱)𝑞conditional𝐲𝐱q(\mathbf{y}\,|\,\mathbf{x}) are determined by an output softmax “task inference” head, and the Gaussian parameters for q​(𝐳|𝐱,𝐲=k)𝑞conditional𝐳𝐱𝐲𝑘q(\mathbf{z}\,|\,\mathbf{x},\mathbf{y}=k) are produced by the output of a component-specific latent encoding head (one for each component k𝑘k).The component-specific prior parameters 𝝁z​(𝐲)subscript𝝁𝑧𝐲\boldsymbol{\mu}_{z}(\mathbf{y}) and 𝝈z​(𝐲)subscript𝝈𝑧𝐲\boldsymbol{\sigma}_{z}(\mathbf{y}) are parameterised as a linear layer (followed by a softplus nonlinearity for the latter) using a one-hot representation of 𝐲𝐲\mathbf{y} as the input.Finally, the decoder is a single network that maps from the mixture-of-Gaussians latent space 𝐳𝐳\mathbf{z} to the reconstruction 𝐱^^𝐱\hat{\mathbf{x}}.The architecture is shown in Figure 2, where for simplicity, we denote the parameters of the kt​hsuperscript𝑘𝑡ℎk^{th} Gaussian by {𝝁(k),𝝈(k)}superscript𝝁𝑘superscript𝝈𝑘\{\boldsymbol{\mu}^{(k)},\boldsymbol{\sigma}^{(k)}\}.The loss for this model is the evidence lower bound (ELBO) given by:log⁡p​(𝐱)≥ℒ𝑝𝐱ℒ\displaystyle\log p(\mathbf{x})\geq\mathcal{L}=\displaystyle=𝔼q​(𝐲,𝐳|𝐱)​[log⁡p​(𝐱,𝐲,𝐳)−log⁡q​(𝐲,𝐳|𝐱)]subscript𝔼𝑞𝐲conditional𝐳𝐱delimited-[]𝑝𝐱𝐲𝐳𝑞𝐲conditional𝐳𝐱\displaystyle\mathbb{E}_{q(\mathbf{y},\mathbf{z}\,|\,\mathbf{x})}\left[\log p(\mathbf{x},\mathbf{y},\mathbf{z})-\log q(\mathbf{y},\mathbf{z}\,|\,\mathbf{x})\right]=\displaystyle=𝔼q​(𝐲|𝐱)​q​(𝐳|𝐱,𝐲)[logp(𝐱|𝐳)]−𝔼q​(𝐲|𝐱)[KL(q(𝐳|𝐱,𝐲)||p(𝐳|𝐲))]\displaystyle\mathbb{E}_{q(\mathbf{y}\,|\,\mathbf{x})q(\mathbf{z}\,|\,\mathbf{x},\mathbf{y})}\left[\log p(\mathbf{x}\,|\,\mathbf{z})\right]-\mathbb{E}_{q(\mathbf{y}\,|\,\mathbf{x})}\left[\textrm{KL}{\left(q(\mathbf{z}\,|\,\mathbf{x},\mathbf{y})\,||\,p(\mathbf{z}\,|\,\mathbf{y})\right)}\right]−KL(q(𝐲|𝐱)||p(𝐲))\displaystyle-\textrm{KL}{\left(q(\mathbf{y}\,|\,\mathbf{x})\,||\,p(\mathbf{y})\right)}
10
+
11
+ The expectation over q​(𝐲|𝐱)𝑞conditional𝐲𝐱q(\mathbf{y}\,|\,\mathbf{x}) can be computed exactly by marginalising over the K𝐾K categorical options, but the expectation over q​(𝐳|𝐱,𝐲)𝑞conditional𝐳𝐱𝐲q(\mathbf{z}\,|\,\mathbf{x},\mathbf{y}) is intractable, and requires sampling.The resulting Monte Carlo approximation comprises a set of familiar terms, some of which correspond clearly to the single-component VAE (Kingma & Welling, 2013; Rezende et al., 2014):ℒℒ\displaystyle\mathcal{L}≈\displaystyle\approx∑k=1Kq​(𝐲=k|𝐱)⏞component posterior​[log⁡p​(𝐱|𝐳~(k))⏞component-wise reconstruction loss−KL(q(𝐳|𝐱,𝐲=k)||p(𝐳|𝐲=k))⏞component-wise regulariser]\displaystyle\sum_{k=1}^{K}{\overbrace{q(\mathbf{y}=k\,|\,\mathbf{x})}^{\textrm{component posterior}}\left[\overbrace{\log p(\mathbf{x}\,|\,\widetilde{\mathbf{z}}^{(k)})}^{\textrm{component-wise reconstruction loss}}-\overbrace{\textrm{KL}{\left(q(\mathbf{z}\,|\,\mathbf{x},\mathbf{y}=k)\,||\,p(\mathbf{z}\,|\,\mathbf{y}=k)\right)}}^{\textrm{component-wise regulariser}}\right]}(3)−KL(q(𝐲|𝐱)||p(𝐲))⏟Categorical regulariser\displaystyle-\underbrace{\textrm{KL}{\left(q(\mathbf{y}\,|\,\mathbf{x})\,||\,p(\mathbf{y})\right)}}_{\textrm{Categorical regulariser}}where 𝐳~(k)∼q​(𝐳|𝐱,𝐲=k)similar-tosuperscript~𝐳𝑘𝑞conditional𝐳𝐱𝐲𝑘\widetilde{\mathbf{z}}^{(k)}\sim q(\mathbf{z}\,|\,\mathbf{x},\mathbf{y}=k) is sampled using the reparametrisation trick.Of course, this can be generalised to multiple samples in a similar fashion to the Importance-Weighted Autoencoder (IWAE) (Burda et al., 2015).
12
+
13
+ Intuitively, this loss encourages the model to reconstruct the data and perform clustering where possible.For a given data point, the model can choose to have high entropy over q​(𝐲|𝐱)𝑞conditional𝐲𝐱q(\mathbf{y}\,|\,\mathbf{x}), in which case all of the component-wise losses must be low, or assign high q​(𝐲=k|𝐱)𝑞𝐲conditional𝑘𝐱q(\mathbf{y}=k\,|\,\mathbf{x}) for some k𝑘k, and use that component to model the datum well.By exploiting diversity in the input data, the model can learn to utilise different components for different discrete structures (such as classes) in the data.
14
+
15
+ While our main aim is to operate in an unsupervised setting, there may be cases in which one may wish to train a specific component, or when labels can be generated in a self-supervised fashion.In such cases where labels 𝐲o​b​ssubscript𝐲𝑜𝑏𝑠\mathbf{y}_{obs} are available, we can use a supervised loss, adapted from Eqn. 3:ℒs​u​psubscriptℒ𝑠𝑢𝑝\displaystyle\mathcal{L}_{sup}=\displaystyle=logp(𝐱|𝐳~(𝐲o​b​s),𝐲=𝐲o​b​s)−KL(q(𝐳|𝐱,𝐲=𝐲o​b​s)||p(𝐳|𝐲=𝐲o​b​s))\displaystyle\log p(\mathbf{x}\,|\,\widetilde{\mathbf{z}}^{(\mathbf{y}_{obs})},\mathbf{y}=\mathbf{y}_{obs})-\textrm{KL}{\left(q(\mathbf{z}\,|\,\mathbf{x},\mathbf{y}=\mathbf{y}_{obs})\,||\,p(\mathbf{z}\,|\,\mathbf{y}=\mathbf{y}_{obs})\right)}(4)+log⁡q​(𝐲=𝐲o​b​s|𝐱).𝑞𝐲conditionalsubscript𝐲𝑜𝑏𝑠𝐱\displaystyle+\log q(\mathbf{y}=\mathbf{y}_{obs}\,|\,\mathbf{x}).Here, instead of marginalising over 𝐲𝐲\mathbf{y} as in Equation 3, the component-wise ELBO (the first two terms) is computed only for the known label 𝐲o​b​ssubscript𝐲𝑜𝑏𝑠\mathbf{y}_{obs}.Furthermore, the final term in the original ELBO is replaced with a supervised cross-entropy term encouraging q​(𝐲|𝐱)𝑞conditional𝐲𝐱q(\mathbf{y}\,|\,\mathbf{x}) to match the label, which reduces to the log posterior probability of the observed label.This loss will be utilised and further discussed in Sections 2.3 and 2.4.
16
+
17
+ To determine the number of mixture components, we opt for a dynamic expansion approach in which capacity is added as needed, by maintaining a small set of poorly-modelled samples and then initialising and fitting a new component to this set when it reaches a critical size.In a similar fashion to existing techniques such as the Forget-Me-Not process (Milan et al., 2016) and Dirichlet process (Teh, 2010), we rely on a threshold to determine when to instantiate a new component.More concretely, we denote a subset of parameters θ(k)={θqy(k),θqz(k),θpz(k)}superscript𝜃𝑘superscriptsubscript𝜃subscript𝑞𝑦𝑘superscriptsubscript𝜃subscript𝑞𝑧𝑘superscriptsubscript𝜃subscript𝑝𝑧𝑘\theta^{(k)}=\{\theta_{q_{y}}^{(k)},\theta_{q_{z}}^{(k)},\theta_{p_{z}}^{(k)}\} corresponding to the parameters unique to each component k𝑘k (i.e. the kthsuperscript𝑘thk^{\textrm{th}} softmax output in q​(𝐲|𝐱)𝑞conditional𝐲𝐱q(\mathbf{y}\,|\,\mathbf{x}) and the kthsuperscript𝑘thk^{\textrm{th}} Gaussian component in p​(𝐳|𝐲)𝑝conditional𝐳𝐲p(\mathbf{z}\,|\,\mathbf{y}) and q​(𝐳|𝐲,𝐱)𝑞conditional𝐳𝐲𝐱q(\mathbf{z}\,|\,\mathbf{y},\mathbf{x})).During training, any sample with a log-likelihood less than a threshold cn​e​wsubscript𝑐𝑛𝑒𝑤c_{new} is added to set 𝒟n​e​wsubscript𝒟𝑛𝑒𝑤\mathcal{D}_{new} (where the log-likelihood is approximated by the ELBO).Then, when the set 𝒟n​e​wsubscript𝒟𝑛𝑒𝑤\mathcal{D}_{new} reaches size Nn​e​wsubscript𝑁𝑛𝑒𝑤N_{new}, we initialise the parameters of the new component to the current component k∗superscript𝑘∗k^{\ast} that has greatest probability over 𝒟n​e​wsubscript𝒟𝑛𝑒𝑤\mathcal{D}_{new}:θ(K+1)=θ(k∗),k∗=arg​maxk∈{1,2,…,K}​∑𝐱∈𝒟n​e​wq​(𝐲=k|𝐱).formulae-sequencesuperscript𝜃𝐾1superscript𝜃superscript𝑘∗superscript𝑘∗subscriptargmax𝑘12…𝐾subscript𝐱subscript𝒟𝑛𝑒𝑤𝑞𝐲conditional𝑘𝐱\theta^{(K+1)}=\theta^{(k^{\ast})},\qquad k^{\ast}=\operatorname*{arg\,max}_{k\,\in\{1,2,\ldots,K\}}\sum_{\mathbf{x}\in\mathcal{D}_{new}}q(\mathbf{y}=k\,|\,\mathbf{x}).(5)The new component is then tuned to 𝒟n​e​wsubscript𝒟𝑛𝑒𝑤\mathcal{D}_{new}, by performing a small fixed number of iterations of gradient descent on all parameters θ𝜃\theta, using the component-constrained ELBO (Eqn. 4) with label K+1𝐾1K+1.
18
+
19
+ Intuitively, this process encourages forward transfer, by initialising new concepts to the “closest” existing concept learned by the model and then finetuning to a small number of instances.The additional capacity used for each expansion is only in the top-most layer of the encoder, with ∼104similar-toabsentsuperscript104\sim 10^{4} parameters, compared to ∼2.5×106similar-toabsent2.5superscript106\sim 2.5\times 10^{6} for the rest of the shared model.That is, while dynamic expansion incorporates a new high-level concept, the underlying low-level representations in the encoder, and the entire decoder, are both shared among all tasks.
20
+
21
+ A shared low-level representation can mean that learning new tasks interferes with previous ones, leading to forgetting.One relevant technique to address this is Deep Generative Replay (DGR) (Shin et al., 2017), in which samples from a learned generative model are reused in learning.We propose to adapt and extend DGR to the mixture setting to perform unsupervised learning without forgetting.In contrast to the original DGR work, our approach is inherently generative, such that a generative replay-based approach can be incorporated holistically into the framework at minimal cost.We note that many other existing methods (e.g.,  Kirkpatrick et al. (2017)) could straightforwardly be adapted to our approach, but our experiments demonstrated generative replay to be simple and effective.
22
+
23
+ To be more precise, during training, the model alternates between batches of real data, with samples 𝐱d​a​t​a∼𝒟similar-tosubscript𝐱𝑑𝑎𝑡𝑎𝒟\mathbf{x}_{data}\sim\mathcal{D} drawn from the current training distribution, and generated data, with samples 𝐱g​e​nsubscript𝐱𝑔𝑒𝑛\mathbf{x}_{gen} produced by the previous snapshot of the model (with parameters θp​r​e​vsubscript𝜃𝑝𝑟𝑒𝑣\theta_{prev}):𝐲g​e​n∼𝝅​(𝐲),𝐳g​e​n∼pθp​r​e​v​(𝐳|𝐲g​e​n),𝐱g​e​n∼pθp​r​e​v​(𝐱|𝐳g​e​n),formulae-sequencesimilar-tosubscript𝐲𝑔𝑒𝑛𝝅𝐲formulae-sequencesimilar-tosubscript𝐳𝑔𝑒𝑛subscript𝑝subscript𝜃𝑝𝑟𝑒𝑣conditional𝐳subscript𝐲𝑔𝑒𝑛similar-tosubscript𝐱𝑔𝑒𝑛subscript𝑝subscript𝜃𝑝𝑟𝑒𝑣conditional𝐱subscript𝐳𝑔𝑒𝑛\mathbf{y}_{gen}\sim{\boldsymbol{\pi}}(\mathbf{y}),\;\mathbf{z}_{gen}\sim p_{\theta_{prev}}(\mathbf{z}\,|\,\mathbf{y}_{gen}),\;\mathbf{x}_{gen}\sim p_{\theta_{prev}}(\mathbf{x}\,|\,\mathbf{z}_{gen}),(6)where 𝝅𝝅{\boldsymbol{\pi}} represents a choice of prior distribution for the categorical 𝐲𝐲\mathbf{y}.While the uniform prior p​(𝐲)𝑝𝐲p(\mathbf{y}) is a natural choice, this fails to consider the degree to which different components are used, and can therefore result in poor sample quality.To address this, the model maintains a count over components by accumulating the mean of posterior q​(𝐲|𝐱)𝑞conditional𝐲𝐱q(\mathbf{y}\,|\,\mathbf{x}) over all previous timesteps, thereby favouring the components that have been used the most.We refer to this process as mixture generative replay (MGR).
24
+
25
+ While MGR ensures tasks or concepts that have been previously learned by the model are reused for learning, it places no constraint on which components are used to model them.Given that each generated datum 𝐱g​e​nsubscript𝐱𝑔𝑒𝑛\mathbf{x}_{gen} is conditioned on a sampled 𝐲g​e​nsubscript𝐲𝑔𝑒𝑛\mathbf{y}_{gen}, we can use 𝐲g​e​nsubscript𝐲𝑔𝑒𝑛\mathbf{y}_{gen} as a self-supervised learning signal and encourage mixture components to remain consistent with respect to the model snapshot, by using the component-constrained loss from Eqn. 4.
26
+
27
+ The only remaining question is when to update the previous model snapshot θp​r​e​vsubscript𝜃𝑝𝑟𝑒𝑣\theta_{prev}.For this, we explore two cases, with snapshots taken at periodic fixed intervals, or immediately before performing dynamic expansion.The intuition behind the latter is that dynamic expansion is performed when there is a sufficient shift in the input distribution, and consolidating previously learned information is beneficial prior to adding a newly observed concept.This is also advantageous as it eliminates the additional snapshot period hyperparameter.
28
+
29
+ A number of related approaches aim to learn a discriminative latent space using generative models.Building on the original VAE (Kingma & Welling, 2013), Nalisnick et al. (2016) utilise a latent mixture of Gaussians, aiming to capture class structure in an unsupervised fashion, and propose a Bayesian non-parametric prior, further developed in (Nalisnick & Smyth, 2017).Similarly, Joo et al. (2019) suggest a Dirichlet posterior in latent space to avoid some of the previously observed component-collapsing phenomena.Lastly, Jiang et al. (2017) propose Variational Deep Embedding (VaDE) focused on the goal of clustering in an i.i.d setting.While VaDE has the same generative process as CURL, it assumes a mean-field approximation, with 𝐲𝐲\mathbf{y} and 𝐳𝐳\mathbf{z} conditionally independent given the input. In the case of CURL, conditioning 𝐳𝐳\mathbf{z} on 𝐲𝐲\mathbf{y} ensures we can adequately capture the inter- and intra- class uncertainty of a sample within the same structured latent space 𝐳𝐳\mathbf{z}.
30
+
31
+ A large body of work has addressed the continual learning problem (Parisi et al., 2019).Regularisation-based methods minimise changes to parameters that are crucial for earlier tasks, with some parameter-wise weight to measure importance (Kirkpatrick et al., 2017; Nguyen et al., 2017; Zenke et al., 2017; Aljundi et al., 2018; Schwarz et al., 2018). Related techniques seek to ensure the performance on previous data does not decrease, by employing constrained optimisation (Lopez-Paz et al., 2017; Chaudhry et al., 2018) or distilling the information from old models or tasks (Li & Hoiem, 2018).In a similar vein, other methods encourage new tasks to utilise previously unused parameters, either by finding “free” linear parameter subspaces (He & Jaeger, 2018); learning an attention mask over parameters (Serra et al., 2018); or using an agent to find new activation paths through a network (Fernando et al., 2017).Expansion-based models dynamically increase capacity to allow for additional tasks (Rusu et al., 2016; Yoon et al., 2017; Draelos et al., 2017), and optionally prune the network to constrain capacity (Zhou et al., 2012; Golkar et al., 2019).Another popular approach is that of rehearsal-based methods (Robins, 1995), where the data distribution from earlier tasks is captured by samples from a generative model trained concurrently (Shin et al., 2017; van de Ven & Tolias, 2018; Ostapenko et al., 2018).Farquhar & Gal (2018) combine such methods with regularisation-based approaches under a Bayesian interpretation.Alternatively, Rebuffi et al. (2017) learn class-specific exemplars instead of a generative model.However, these methods usually require task identities, rely on well-defined task boundaries, and are often evaluated on a sequence of supervised learning tasks.
32
+
33
+ Some recent work has investigated continual learning without task labels or boundaries.Hsu et al. (2018) and van de Ven & Tolias (2019) identify the scenarios of incremental task, domain, and class learning; which operate without task labels in the latter cases, but all focus on supervised learning tasks.Aljundi et al. (2019) propose a task-free approach to continual learning related to ours, which mitigates forgetting using the regularisation-based Memory Aware Synapses (MAS) approach (Aljundi et al., 2018), maintains a hard example buffer to better estimate the regularisation weights, and detects when to update these weights (usually performed at known task boundaries in previous work).Zeno et al. (2018) propose a Bayesian task-agnostic learning update rule for the mean and variance of each parameter, and demonstrate its ability to handle ambiguous task boundaries.However, it is only applied to supervised tasks, and can exploit the “label” trick, inferring the task based on the class label.In contrast, Achille et al. (2018) address the problem of unsupervised learning in a sequential setting by learning a disentangled latent space with task-specific attention masks, but the main focus is on learning across datasets, and the method relies on abrupt shifts in data distribution between datasets.Our approach builds upon this existing body of work, addressing the full unsupervised continual learning problem, where task labels and boundaries are unknown, and the tasks themselves are without class supervision.We argue that addressing this problem is critical in order to tackle continual learning in challenging, real-world scenarios.
34
+
35
+ In the following sections, we empirically evaluate a) whether our method learns a meaningful class-discriminable latent space in the unsupervised sequential learning setting, without forgetting, even when task boundaries are unclear; b) the importance of the dynamic expansion and generative replay techniques to performance; and c) how CURL performs on external benchmarks when trained i.i.d or adapted to learn in a supervised fashion.Code for all experiments can be found at https://github.com/deepmind/deepmind-research/.
36
+
37
+ One desired outcome of our approach is the ability to learn class-discriminative latent representations from non-stationary input data. We evaluate this using cluster accuracy (the accuracy obtained when assigning each mixture component to its most represented class), and with the accuracy of a k-Nearest Neighbours (k-NN) classifier in latent space.The former measures the amount of class-relevant information encoded into the categorical variable 𝐲𝐲\mathbf{y}, while the latter measures the discriminability of the entire latent space without imposing structure (such as a linear boundary).
38
+
39
+ For the evaluation we extensively utilise the MNIST (LeCun et al., 2010) and Omniglot (Lake et al., 2011) datasets, and further information can be found in Appendix B.We investigate a number of different evaluation settings: i.i.d, where the model sees shuffled training data; sequential, where the model sees classes sequentially; and continuous drift, similar to the sequential case, but with classes gradually introduced by slowly increasing the number of samples from the new class within a batch.
40
+
41
+ We begin by analysing our approach, and follow this with evaluation on external benchmarks in later sections.First, we measure the ability to perform class-discriminative representation learning in the sequential setting on MNIST, where each of the classes is observed for 100001000010000 training steps (further experimental details can be found in Appendix C.1).Figure 4(c)a shows the cluster accuracy for a number of variants of CURL.We observe the importance of both dynamic expansion and mixture generative replay (MGR) to learn a coherent representation without forgetting.Figure 4(c)b shows the class-wise accuracies during training, for the model with MGR and expansion.Interestingly, while many existing continual learning approaches appear to forget earlier classes (see e.g. Nguyen et al. (2017)), these classes are well modelled by CURL, and the confusion is more observed between similar classes (such as 333s and 555s; or 777s and 999s).Indeed, this is reflected in the class-confusion matrix after training (Figure 4(c)c).This implies the model adequately addresses catastrophic forgetting, but could improve in terms of plasticity, i.e., learning new concepts.Further analysis can be found in Appendix A.1, showing generated samples; and Appendix A.2, analysing the dynamic expansion buffers.
42
+
43
+ Next, we perform an ablation study to gauge the impact of the expansion threshold for continual learning, in terms of cluster accuracy and number of components used, as shown in Figure 3.As the threshold value is increased, samples are more frequently stored into the “poorly-modelled” buffer, and the model expands more aggressively throughout learning.Consequently, for sequential learning, the number of components ranges from 121212 to 717171, the cluster accuracy varies up to a maximum of 84%percent8484\%, and the k𝑘k-NN error also marginally decreases over this range.Furthermore, without any dynamic expansion, the result is significantly poorer at 51%percent5151\% accuracy, and when discovering the same number of components with dynamic expansion (252525, obtained with an expansion threshold of −200200-200), the equivalent performance is at 77%percent7777\%.Thus, the dynamic expansion threshold conveniently provides a tuning parameter to perform capacity estimation, trading off cluster accuracy with the memory cost of using additional components in the latent mixture.Interestingly, if we perform the same analysis for i.i.d. data (also in Figure 3), we observe a similar trade-off; though the final performance is slightly poorer than when starting with an equivalent, fixed number of mixture components (222222).
44
+
45
+ We also further analyse mixture generative replay (MGR) with an ablation study in Table 1.We evaluate standard and self-supervised MGR (SMGR), and compare between the case where snapshots are taken on expansion (i.e., no task information is needed), or at fixed intervals (either at T𝑇T, the duration of training on each class, or 0.1​T0.1𝑇0.1T, ten times more frequently).Intuitively, the period is important as it determines how quickly a shifting data distribution is consolidated into the model: if too short, the generated data will drift with the model, leading to forgetting.The results in Table 1 point to a number of interesting observations.First, both MGR and SMGR are sensitive to the fixed snapshot period: the performance is unsurprisingly optimal when snapshots are taken as the training class changes, but drops significantly when performed more frequently, and also uses a greater number of clusters in the process.Second, by taking snapshots before dynamic expansion instead, this performance can largely be recovered, and without any knowledge of the task boundaries.Third, perhaps surprisingly, SMGR harms performance compared to MGR.This may be due to the fact that mixture components already tend to be consistent in latent space throughout learning, and SMGR may be reducing plasticity; further analysis can be found in Appendix A.3.Lastly, we can also observe the benefits of MGR, with the MNIST case exhibiting far poorer performance and utilising many more components in the process.Interestingly, the Omniglot case without MGR performs well, but at the cost of significantly more components: expansion itself is able to partly address catastrophic forgetting by effectively oversegmenting the data.
46
+
47
+ Next, we evaluate CURL in the continuous drift setting, and compare to the standard sequential setting.The overall performance on MNIST and Omniglot is shown in Table 2, using MGR with either fixed or dynamic snapshots.We observe that despite having unclear task boundaries, where classes are gradually introduced, the continuous case generally exhibits better performance than the case with well-defined task boundaries.We also closely investigate the mixture component dynamics during learning, by obtaining the top 555 components (most used over the course of learning) and plotting their posterior probabilities over time (Figure 5).From the discrete task-change domain (left), we observe that probabilities change sharply with the hard task boundaries (every 100001000010000 steps); and many mixture components are quite sparsely activated, modelling either a single class, or a few classes.Some of the mixture components also observe “echoes”, where the sharp change to a new class in the data distribution activates the component temporarily before dynamic expansion is performed.In the continuous drift case (right of Figure 5), the mixture probabilities exhibit similar behaviours, but are much smoother in response to the gradually changing data distribution. Further, without a sharp distributional shift, the “echoes” are not observed.
48
+
49
+ While focused on task-agnostic continual learning in unsupervised settings, CURL can also be trivially adapted to supervised tasks simply by training with the supervised loss in Eqn. 4.We evaluate on the split MNIST benchmark, where the data are split into five tasks, each classifying between two classes, and the model is trained on each task sequentially.If we evaluate the overall accuracy after training, this is called incremental class learning; and if we provide the model with the appropriate task label and evaluate the binary classification accuracy for each task, this is incremental task learning (Hsu et al., 2018; van de Ven & Tolias, 2019).Experimental details can be found in Appendix C.2.The results in Table 2 demonstrate that the proposed unsupervised approach can easily and effectively be adapted to supervised tasks, achieving competitive results for both scenarios.While all methods perform quite well on incremental task learning, CURL is outperformed only by iCARL (Rebuffi et al., 2017) on incremental class learning, which was specifically proposed for this task.Interestingly, the result is also better than DGR, suggesting that by holistically incorporating the generative process and classifier into the same model, and focusing on the broader unsupervised, task-agnostic perspective, CURL is still effective in the supervised domain.
50
+
51
+ We also demonstrate the ability of the underlying model to learn in a more traditional setting with the entire dataset shuffled, and compare with existing work in clustering and representation learning: the VAE (Kingma & Welling, 2013), DirichletVAE (Joo et al., 2019), SBVAE (Nalisnick & Smyth, 2017), and VaDE (Jiang et al., 2017).We utilise the same architecture and hyperparameter settings as in Joo et al. (2019) for consistency, with latent spaces of dimension 505050 and 100100100 for MNIST and Omniglot respectively; and full details of the experimental setup can be found in Appendix C.3.We note that the k𝑘k-NN error values are much better here than in Section 4.3; this is due to a higher dimensional latent space and hence they cannot be directly compared (see Appendix A.4).
52
+
53
+ The uppermost group in Table 4 show the results on i.i.d MNIST and Omniglot.The CURL generative model trained i.i.d (without MGR, and with dynamic expansion) is competitive with the state-of-the-art on MNIST (bettered only by VaDE, which incorporates a larger architecture) and Omniglot (bettered only by DirVAE).While not the main focus of this paper, this demonstrates the ability of the proposed generative model to learn a structured, discriminable latent space, even in more standard learning settings with shuffled data.Table 4 also shows the performance of CURL trained in the sequential setting.We observe that, despite learning from sequential data, these results are competitive with the state-of-the-art approaches that operate on i.i.d. data.
54
+
55
+ In this work, we introduced an approach to address the unsupervised continual learning problem, in which task labels and boundaries are unknown, and the tasks themselves lack class labels or other external supervision.Our approach, named CURL, performs task inference via a mixture-of-Gaussians latent space, and uses dynamic expansion and mixture generative replay (MGR) to instantiate new concepts and minimise catastrophic forgetting.Experiments on MNIST and Omniglot showed that CURL was able to learn meaningful class-discriminative representations without forgetting in a sequential class setting (even with poorly defined task boundaries).External benchmarks also demonstrated the method to be competitive with respect to previous work when adapted to unsupervised learning from i.i.d data, and to supervised incremental class learning.Future directions will investigate additional techniques to alleviate forgetting, and the extension to the reinforcement learning domain.
1910.14488v5.txt ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Deep neural networks (DNNs) [25] have been producing state-of-the-art results in many challenging tasks including image classification [12, 23, 42, 57, 58, 18, 11, 53], face recognition [38, 43, 56],brain signal processing [33, 34],video analysis [50, 49] and many other areas [55, 54, 24, 3, 10, 9, 4]. One of the key factors behind the success lies in the innovation of neural architectures, such as VGG [40] andResNet[13].However, designing effective neural architectures is often labor-intensive and relies heavily on substantial human expertise.Moreover, the human-designed process cannot fully explore the whole architecture space and thus the designed architectures may not be optimal.Hence, there is a growing interest to replace the manual process of architecture design with Neural Architecture Search (NAS).
2
+
3
+ Recently, substantial studies [29, 35, 61] have shown that the automatically discovered architectures are able to achieve highly competitive performance compared to existing hand-crafted architectures. However, there are some limitations in NAS based architecture design methods. In fact, since there is an extremely large search space [35, 61] (e.g., billions of candidate architectures), these methods often produce sub-optimal architectures, leading to limited representation performance or substantial computation cost.Thus, even for a well-designed model, it is necessary yet important to optimize its architecture (e.g., removing the redundant operations) to achieve better performance and/or reduce the computation cost.
4
+
5
+ To optimize the architectures, Luo et al. recently proposed a neural architecture optimization (NAO) method [31]. Specifically, NAO first encodes an architecture into an embedding in continuous space and then conducts gradient descent to obtain a better embedding. After that, it uses a decoder to map the embedding back to obtain an optimized architecture. However, NAO comes with its own set of limitations. First, NAO often produces a totally different architecture from the input one and may introduce extra parameters or additional computation cost. Second, similar to the NAS based methods, NAO has a huge search space, which, however, may not be necessary for the task of architecture optimization and may make the optimization problem very expensive to solve. An illustrative comparison between our method and NAO can be found in Figure 1.
6
+
7
+ Unlike existing methods that design neural architectures, we seek to design an architecture optimization method, called Neural Architecture Transformer (NAT), to optimize neural architectures.Since the optimization problem is non-trivial to solve,we cast it into a Markov decision process (MDP). Thus, the architecture optimization process is reduced to a series of decision making problems. Based on MDP, we seek to replace the expensive operations or redundant modules in the architecture with more computationally efficient ones.Specifically, NAT shall remove the redundant modules or replace these modules with skip connections.In this way, the search space can be significantly reduced.Thus, the training complexity to learn an architecture optimizer is smaller than those NAS based methods, e.g., NAO. Last, it is worth mentioning that our NAT model can be used as a general architecture optimizer which takes any architecture as the input and output an optimized one.In experiments, we apply NAT to both hand-crafted and NAS based architectures and demonstrate the performance on two benchmark datasets, namely CIFAR-10 [22] and ImageNet [8].
8
+
9
+ The main contributions of this paper are summarized as follows.
10
+
11
+ •We propose a novel architecture optimization method, called Neural Architecture Transformer (NAT), to optimize arbitrary architectures in order to achieve better performance and/or reduce computation cost.To this end, NAT either removes the redundant paths or replaces the original operation with skip connection to improve the architecture design.•We cast the architecture optimization problem into a Markov decision process (MDP),in which we seek to solve a series of decision making problems to optimize the operations. We then solve the MDP problem with policy gradient.To better exploit the adjacency information of operations in an architecture, we propose to exploit graph convolution network (GCN) to build the architecture optimization model.•Extensive experiments demonstrate the effectiveness of our NAT on both hand-crafted and NAS based architectures. Specifically, for hand-crafted models (e.g., VGG), our NAT automatically introduces additional skip connections into the plain network and results in 2.75% improvement in terms of Top-1 accuracy on ImageNet. For NAS based models (e.g., DARTS [29]), NAT reduces 20% parameters and achieves 0.6% improvement in terms of Top-1 accuracy on ImageNet.
12
+
13
+ Hand-crafted architecture design.Many studies focus on architecture design and propose a series of deep neural architectures, such as Network-in-network [27], VGG [40]and so on.Unlike these plain networks that only contain a stack of convolutions, He et al. propose the residual network (ResNet) [13] by introducing residual shortcuts between different layers.However, the human-designed process often requires substantial human effort and cannot fully explore the whole architecture space, making the hand-crafted architectures often not optimal.
14
+
15
+ Neural architecture search.Recently, neural architecture search (NAS) methods have been proposedto automate the process of architecture design [61, 62, 35, 1, 59, 29, 2, 45, 41].Some researchers conduct architecture search by modeling the architecture as a graph [51, 20].Unlike these methods, DSO-NAS [52] finds the optimal architectures by starting from a fully connected block and then imposing sparse regularization [17, 44] to prune useless connections.Besides, Jin et al. propose a Bayesian optimization approach [19] to morph the deep architectures by inserting additional layers, adding more filters or introducing additional skip connections.More recently, Luo et al. propose the neural architecture optimization (NAO) [31] method to perform the architecture search on continuous space by exploiting the encoding-decoding technique.However, NAO is essentially designed for architecture search and often obtains very different architectures from the input architectures and may introduce extra parameters. Unlike these methods, our method is able to optimize architectures without introducing extra computation cost (See the detailed comparison in Figure 1).
16
+
17
+ Architecture adaptation and model compression.Several methods [48, 7, 6] have been proposed to obtain compact architecturesby learning the optimal settings of each convolution, including kernel size, stride and the number of filters.To obtain compact models, model compression methods [26, 15, 30, 60] detect and remove the redundant channels from the original models. However, these methods only change the settings of convolution but ignore the fact that adjusting the connections in the architecture could be more critical.Recently, Cao et al.  propose an automatic architecture compression method [5]. However, this method has to learn a compressed model for each given pre-trained model and thus has limited generalization ability to different architectures.Unlike these methods, we seek to learn a general optimizer for any arbitrary architecture.
18
+
19
+ Given an architecture space ΩΩ\Omega, we can represent an architecture α𝛼\alpha as a directed acyclic graph (DAG), i.e., α=(𝒱,ℰ)𝛼𝒱ℰ\alpha=\left(\mathcal{V},\mathcal{E}\right), where 𝒱𝒱{\mathcal{V}} is a set of nodes that denote the feature maps in DNNs and ℰℰ\mathcal{E} is an edge set [61, 35, 29], as shown in Figure 2.Here, the directed edge ei​j∈ℰsubscript𝑒𝑖𝑗ℰe_{ij}\in{\mathcal{E}} denotes some operation (e.g., convolution or max pooling) that transforms the feature map from node visubscript𝑣𝑖v_{i} to vjsubscript𝑣𝑗v_{j}.For convenience, we divide the edges in ℰℰ{\mathcal{E}} into three categories, namely, S𝑆S, N𝑁{N}, O𝑂O, as shown in Figure 2. Here, S𝑆{S} denotes the skip connection, N𝑁{N} denotes the null connection (i.e., no edge between two nodes), and O𝑂{O} denotes the operations other than skip connection or null connection (e.g., convolution or max pooling). Note that different operations have different costs. Specifically, let c​(⋅)𝑐⋅c(\cdot) be a function to evaluate the computation cost. Obviously, we have c​(O)>c​(S)>c​(N)𝑐𝑂𝑐𝑆𝑐𝑁c({O})>c({S})>c({N}).
20
+
21
+ In this paper, we seek to design an architecture optimization method, called Neural Architecture Transformer (NAT), to optimize any given architecture into a better one with the improved performance and/or less computation cost. To achieve this, an intuitive way is to make the original operation with less computation cost, e.g., using the skip connection to replace convolution or using the null connection to replace skip connection. Although the skip connection has slightly higher cost than the null connection, it often can significantly improve the performance [13, 14].Thus, we enable the transition from null connection to skip connection to increase the representation ability of deep networks. In summary, we constrain the possible transitions among O𝑂O, S𝑆S, and N𝑁{N} in Figure 2 in order to reduce the computation cost.
22
+
23
+ Note that the architecture optimization on an entire network is still very computationally expensive. Moreover, we hope to learn a general architecture optimizer.Given these two concerns, we consider learning a computational cell as the building block of the final architecture. To build a cell, we follow the same settings as that in ENAS [35].Specifically, each cell has two input nodes, i.e., v−2subscript𝑣2v_{-2} and v−1subscript𝑣1v_{-1}, which denote the outputs of the second nearest and the nearest cell in front of the current one, respectively.Each intermediate node (marked as the blue box in Figure 1) also takes two previous nodes in this cell as inputs. Last, based on the learned cell, we are able to form any final network.
24
+
25
+ In this paper, we seek to learn a general architecture optimizer α=NAT​(β;θ)𝛼NAT𝛽𝜃\alpha={\rm NAT}(\beta;\theta), which transforms any β𝛽\beta into an optimized α𝛼\alpha and is parameterized by θ𝜃\theta. Here, we assume β𝛽\beta follows some distribution p​(⋅)𝑝⋅p(\cdot), e.g., multivariate uniformly discrete distribution. Let wαsubscript𝑤𝛼w_{\alpha} and wβsubscript𝑤𝛽w_{\beta} be the well-learned model parameters of architectures α𝛼\alpha and β𝛽\beta, respectively. We measure the performance of α𝛼\alpha and β𝛽\beta by some metric R​(α,wα)𝑅𝛼subscript𝑤𝛼R(\alpha,w_{\alpha}) and R​(β,wβ)𝑅𝛽subscript𝑤𝛽R(\beta,w_{\beta}), e.g., the accuracy on validation data. For convenience, we define the performance improvement between α𝛼\alpha and β𝛽\beta by R​(α|β)=R​(α,wα)−R​(β,wβ)𝑅conditional𝛼𝛽𝑅𝛼subscript𝑤𝛼𝑅𝛽subscript𝑤𝛽R(\alpha|\beta)=R(\alpha,w_{\alpha})-R(\beta,w_{\beta}).
26
+
27
+ To learn a good transformer α=NAT​(β;θ)𝛼NAT𝛽𝜃\alpha={\rm NAT}(\beta;\theta) to optimize arbitrary β𝛽\beta, we can maximize the expectation of performance improvement R​(α|β)𝑅conditional𝛼𝛽R(\alpha|\beta) over the distribution of β𝛽\beta under a constraint of computation cost c​(α)≤κ𝑐𝛼𝜅c(\alpha)\leq\kappa, where c​(α)𝑐𝛼c(\alpha) measures the cost of α𝛼\alpha and κ𝜅\kappa is an upper bound of the cost. Then, the optimization problem can be written asmaxθ⁡𝔼β∼p​(⋅)​[R​(α|β)],s.t. ​c​(α)≤κ.subscript𝜃subscript𝔼similar-to𝛽𝑝⋅delimited-[]𝑅conditional𝛼𝛽s.t. 𝑐𝛼𝜅\displaystyle\max_{\theta}~{}\mathbb{E}_{\beta\sim p(\cdot)}\left[R\left(\alpha|\beta\right)\right],~{}\text{s.t. }~{}c(\alpha)\leq\kappa.(1)
28
+
29
+ Unfortunately, it is non-trivial to directly obtain the optimal α𝛼\alpha given different β𝛽\beta. Nevertheless, following [61, 35], given any architecture β𝛽\beta, we instead sample α𝛼\alpha from some well learned policy, denoted by π(⋅|β;θ)\pi(\cdot|\beta;\theta), namely α∼π(⋅|β;θ)\alpha\sim\pi(\cdot|\beta;\theta).In other words, NAT first learns the policy and then conducts sampling from it to obtain the optimized architecture. In this sense, the parameters to be learned only exist in π(⋅|β;θ)\pi(\cdot|\beta;\theta).To learn the policy, we solve the following optimization problem:maxθ𝔼β∼p​(⋅)[𝔼α∼π(⋅|β;θ)R(α|β)],s.t. c(α)≤κ,α∼π(⋅|β;θ),\displaystyle\max_{\theta}~{}\mathbb{E}_{\beta\sim p(\cdot)}\left[\mathbb{E}_{\alpha\sim\pi(\cdot|\beta;\theta)}~{}R\left(\alpha|\beta\right)\right],~{}\text{s.t. }~{}c(\alpha)\leq\kappa,~{}\alpha\sim\pi(\cdot|\beta;\theta),(2)where 𝔼β∼p​(⋅)​[⋅]subscript𝔼similar-to𝛽𝑝⋅delimited-[]⋅\mathbb{E}_{\beta\sim p(\cdot)}\left[\cdot\right] and 𝔼α∼π(⋅|β;θ)​[⋅]\mathbb{E}_{\alpha\sim\pi(\cdot|\beta;\theta)}\left[\cdot\right] denote the expectation operation over β𝛽\beta and α𝛼\alpha, respectively.
30
+
31
+ This problem, however, is still very challenging to solve. First, the computation cost of deep networks can be evaluated by many metrics, such as the number of multiply-adds (MAdds), latency, and energy consumption, making it hard to find a comprehensive measure to accurately evaluate the cost.Second, the upper bound of computation cost κ𝜅\kappa in Eqn. (1) may vary for different cases and thereby is hard to determine. Even if there already exists a specific upper bound, dealing with the constrained optimization problem is still a typical NP-hard problem.Third, how to compute 𝔼β∼p​(⋅)​[𝔼α∼π(⋅|β;θ)​R​(α|β)]\mathbb{E}_{\beta\sim p(\cdot)}\left[\mathbb{E}_{\alpha\sim\pi(\cdot|\beta;\theta)}~{}R\left(\alpha|\beta\right)\right] remains a question.
32
+
33
+ To address the above challenges, we cast the optimization problem into an architecture transformation problem and reformulate it as a Markov decision process (MDP).Specifically, we optimize architectures by making a series of decisions to alternate the types of different operations. Following the transition graph in Figure 2, as c​(O)>c​(S)>c​(N)𝑐𝑂𝑐𝑆𝑐𝑁c({O})>c({S})>c({N}), we can naturally obtain more compact architectures than the given ones.In this sense, we can achieve the goal to optimize arbitrary architecture without introducing extra cost into the architecture. Thus, for the first two challenges, we do not have to evaluate the cost c​(α)𝑐𝛼c(\alpha) or determine the upper bound κ𝜅\kappa.For the third challenge, we estimate the expectation value by sampling architectures from p​(⋅)𝑝⋅p(\cdot) and π(⋅|β;θ)\pi(\cdot|\beta;\theta) (See details in Section 3.4).
34
+
35
+ MDP formulation details. A typical MDP [39] is defined by a tuple (𝒮,𝒜,P,R,q,γ)𝒮𝒜𝑃𝑅𝑞𝛾(\mathcal{S},\mathcal{A},P,{R},q,\gamma),where 𝒮𝒮\mathcal{S} is a finite set of states, 𝒜𝒜\mathcal{A} is a finite set of actions, P:𝒮×𝒜×𝒮→ℝ:𝑃→𝒮𝒜𝒮ℝP:\mathcal{S}\times\mathcal{A}\times\mathcal{S}\rightarrow\mathbb{R} is the state transition distribution, R:𝒮×𝒜→ℝ:𝑅→𝒮𝒜ℝ{R}:\mathcal{S}\times\mathcal{A}\rightarrow\mathbb{R} is the reward function, q:𝒮→[0,1]:𝑞→𝒮01q:\mathcal{S}\rightarrow[0,1] is the distribution of initial state, and γ∈[0,1]𝛾01\gamma\in[0,1] is a discount factor.Here, we define an architecture as a state, a transformation mapping β→α→𝛽𝛼\beta\to\alpha as an action.Here, we use the accuracy improvement on the validation set as the reward. Since the problem is a one-step MDP, we can omit the discount factor γ𝛾\gamma.Based on the problem definition, we transform any β𝛽\beta into an optimized architecture α𝛼\alpha with the policy π(⋅|β;θ)\pi(\cdot|\beta;\theta). Then, the main challenge becomes how to learn an optimal policy π(⋅|β;θ)\pi(\cdot|\beta;\theta). Here, we exploit reinforcement learning [46] to solve the problem and propose an efficient policy learning algorithm.
36
+
37
+ Search space of NAT over a cell structure. For a cell structure with B𝐵B nodes and 3 states for each edge, there are 2​(B−3)2𝐵32(B{\small-}3) edges and the size of the search space w.r.t. a specific β𝛽\beta is |Ωβ|=32​(B−3)subscriptΩ𝛽superscript32𝐵3|\Omega_{\beta}|=3^{2(B-3)}.However, NAS methods [35, 61] have a large search space with the size of k2​(B−3)​((B−2)!)2superscript𝑘2𝐵3superscript𝐵22k^{2(B-3)}((B-2)!)^{2}, where k𝑘k is the number of candidate operations (e.g., k=5𝑘5k{=}5 in ENAS [35] and k=8𝑘8k{=}8 in DARTS [29]).
38
+
39
+ To learn the optimal policy π(⋅|β;θ)\pi(\cdot|\beta;\theta) w.r.t. an arbitrary architecture β𝛽\beta,we propose an effective learning method to optimize the operations inside the architecture. Specifically, we take an arbitrary architecture graph β𝛽\beta as the input and output the optimization policy w.r.t β𝛽\beta. Such a policy is used to optimize the operations of the given architecture.Since the choice of operation on an edge depends on the adjacent nodes and edges,we have to consider the attributes of both the current edge and its neighbors. For this reason, we employ a graph convolution networks (GCN) [21] to exploit the adjacency information of the operations in the architecture.Here, an architecture graph can be represented by a data pair (𝐀,𝐗)𝐀𝐗({\bf A},{\bf X}),where 𝐀𝐀{\bf A} denotes the adjacency matrix of the graph and 𝐗𝐗{\bf X} denotes the attributes of the nodes together with their two input edges111Due to the page limit, we put the detailed representation methods in the supplementary..We consider a two-layer GCN and formulate the model as:𝐙=f​(𝐗,𝐀)=Softmax​(𝐀​σ​(𝐀𝐗𝐖(0))​𝐖(1)​𝐖FC),𝐙𝑓𝐗𝐀Softmax𝐀𝜎superscript𝐀𝐗𝐖0superscript𝐖1superscript𝐖FC{\bf{Z}}=f({\bf X},{\bf A})={\rm Softmax}\left({\bf A}{\rm\sigma}\left({\bf A}{\bf X}{\bf W}^{(0)}\right){\bf W}^{(1)}{\bf W}^{\rm FC}\right),(3)where 𝐖(0)superscript𝐖0{\bf W}^{(0)} and 𝐖(1)superscript𝐖1{\bf W}^{(1)} denote the weights of two graph convolution layers, 𝐖FCsuperscript𝐖FC{\bf W}^{\rm FC} denotes the weight of the fully-connected layer, σ𝜎\sigma is a non-linear activation function (e.g., the Rectified Linear Unit (ReLU) [32]), and 𝐙𝐙{\bf{Z}} refers to the probability distribution of different candidate operations on the edges, i.e., the learned policy π(⋅|β;θ)\pi(\cdot|\beta;\theta). For convenience, we denote θ={𝐖(0),𝐖(1),𝐖FC}𝜃superscript𝐖0superscript𝐖1superscript𝐖FC\theta=\{{\bf W}^{(0)},{\bf W}^{(1)},{\bf W}^{\rm FC}\} as the parameters of the architecture transformer.To cover all possible architectures, we randomly sample architectures from the whole architecture space and use them to train our model.
40
+
41
+ Differences with LSTM.The architecture graph can also be processed by the long short-term memory (LSTM) [16], which is a common practice in NAS methods [31, 61, 35]. In these methods, LSTM first treats the graph as a sequence of tokens and then learns the information from the sequence. However, turning a graph into a sequence of tokens may lose some connectivity information of the graph, leading to limited performance. On the contrary, our GCN model can better exploit the information from the graph and yield superior performance (See results in Section 4.4).
42
+
43
+ We apply the policy gradient [46] to train our model. The overall scheme is shown in Algorithm 1, which employs an alternating manner. Specifically, in each training epoch, we first train the model parameters w𝑤w with fixed transformer parameters θ𝜃\theta. Then, we train the transformer parameters θ𝜃\theta by fixing the model parameters w𝑤w.
44
+
45
+ Training the model parameters w𝑤w.Given any θ𝜃\theta, we need to update the model parameters w𝑤w based on the training data. Here, to accelerate the training process, we adopt the parameter sharing technique [35], i.e.,we construct a large computational graph, where each subgraph represents a neural network architecture, hence forcing all architectures to share the parameters.Thus, we can use the shared parameters w𝑤w to represent the parameters for different architectures.For any architecture β∼p​(⋅)similar-to𝛽𝑝⋅\beta\sim p(\cdot), let ℒ​(β,w)ℒ𝛽𝑤\mathcal{L}(\beta,w) be the loss function on the training data, e.g., the cross-entropy loss. Then, given any m𝑚m sampled architectures, the updating rule for w𝑤w with parameter sharing can be given by w←w−η​1m​∑i=1m∇wℒ​(βi,w)←𝑤𝑤𝜂1𝑚superscriptsubscript𝑖1𝑚subscript∇𝑤ℒsubscript𝛽𝑖𝑤w\leftarrow w-\eta\frac{1}{m}\sum_{i=1}^{m}\nabla_{w}\mathcal{L}(\beta_{i},w), where η𝜂\eta is the learning rate.
46
+
47
+ Training the transformer parameters θ𝜃\theta.We train the transformer model with policy gradient [46]. To encourage exploration, we introduce an entropyregularization term into the objective toprevent the transformer from converging to a local optimum too quickly [62], e.g., selecting the “original” option for all the operations.Given the shared parameters w𝑤w, the objective can be formulated asJ​(θ)𝐽𝜃\displaystyle J(\theta)=𝔼β∼p​(⋅)[𝔼α∼π(⋅|β;θ)[R(α,w)−R(β,w)]+λH(π(⋅|β;θ))]\displaystyle=\mathbb{E}_{\beta\sim p(\cdot)}\left[\mathbb{E}_{\alpha\sim\pi(\cdot|\beta;\theta)}\left[{R}\left(\alpha,w\right)-{R}\left(\beta,w\right)\right]+\lambda H\big{(}\pi(\cdot|\beta;\theta)\big{)}\right](4)=∑βp(β)[∑απ(α|β;θ)(R(α,w)−R(β,w))+λH(π(⋅|β;θ))].\displaystyle=\sum_{\beta}p(\beta)\left[\sum_{\alpha}\pi(\alpha|\beta;\theta)\big{(}{R}\left(\alpha,w\right)-{R}\left(\beta,w\right)\big{)}+\lambda H\big{(}\pi(\cdot|{\beta};\theta)\big{)}\right].where p​(β)𝑝𝛽p(\beta) is the probability to sample some architecture β𝛽\beta from the distribution p​(⋅)𝑝⋅p(\cdot), π​(α|β;θ)𝜋conditional𝛼𝛽𝜃\pi(\alpha|\beta;\theta) is the probability to sample some architecture α𝛼\alpha from the distribution π(⋅|β;θ)\pi({\cdot|\beta};\theta), H​(⋅)𝐻⋅H(\cdot) evaluates the entropy of the policy, and λ𝜆\lambda controls the strength of the entropy regularization term.For each input architecture, we sample n𝑛n optimized architectures {αj}j=1nsuperscriptsubscriptsubscript𝛼𝑗𝑗1𝑛\{\alpha_{j}\}_{j=1}^{n} from the distribution π(⋅|β;θ)\pi(\cdot|\beta;\theta) in each iteration.Thus, the gradient of Eqn. (4) w.r.t. θ𝜃\theta becomes222We put the derivations of Eqn. (5) in the supplementary.∇θJ(θ)≈1m​n∑i=1m∑j=1n[∇θlogπ(αj|βi;θ)(R(αj,w)−R(βi,w))+λ∇θH(π(⋅|βi;θ))].\nabla_{\theta}J(\theta)\approx\frac{1}{mn}\sum_{i=1}^{m}\sum_{j=1}^{n}\left[\nabla_{\theta}\log\pi(\alpha_{j}|\beta_{i};\theta)\big{(}R(\alpha_{j},w)-R(\beta_{i},w)\big{)}+\lambda\nabla_{\theta}H\big{(}\pi(\cdot|\beta_{i};\theta)\big{)}\right].(5)The regularization term H(π(⋅|βi;θ))H\big{(}\pi(\cdot|\beta_{i};\theta)\big{)} encourages the distribution π(⋅|β;θ)\pi(\cdot|\beta;\theta) to have high entropy,i.e., high diversity in the decisions on the edges. Thus, the decisions for some operations would be encouraged to choose the “identity” or “null” operations during training. As a result, NAT is able to sufficiently explore the whole search space to find the optimal architecture.
48
+
49
+ Inferring the optimized architecture.We do not explicitly obtain the optimized architecture via α=NAT​(β;θ)𝛼NAT𝛽𝜃\alpha={\rm NAT}(\beta;\theta). Instead, we conduct sampling according to the learned probability distribution.Specifically, we first sample several candidate optimized architectures from the learned policy π(⋅|β;θ)\pi(\cdot|\beta;\theta) and then select the architecture with the highest validation accuracy.Note that we can also obtain the optimized architecture by selecting the operation with the maximum probability, which, however, tends to reach a local optimum and yields worse results than the sampling based method (See comparisons in Section 4.4).
50
+
51
+ In this section, we apply NAT on both hand-crafted and NAS based architectures, and conduct experiments on two image classification benchmark datasets, i.e., CIFAR-10 [22] and ImageNet [8].All implementations are based on PyTorch.333The source code of NAT is available at https://github.com/guoyongcs/NAT.
52
+
53
+ We consider two kinds of cells in a deep network, including the normal cell and the reduction cell.The normal cell preserves the same spatial size as inputs while the reduction cell reduces the spatial size by 2×2\times. Both the normal and reduction cells contain 2 input nodes and a number of intermediate nodes.During training, we build the deep network by stacking 8 basic cells and train the transformer for 100 epochs.We set m=1𝑚1m=1, n=1𝑛1n=1, and λ=0.003𝜆0.003\lambda=0.003 in the training.We split CIFAR-10 training set into 40%percent4040\% and 60%percent6060\% slices to train the model parameters w𝑤w and the transformer parameters θ𝜃\theta, respectively.As for the evaluation of the networks with different architectures,we replace the original cell with the optimized one and train the model from scratch. Please see more details in the supplementary.For all the considered architectures, we follow the same settings of the original papers. In the experiments, we only apply cutout to the NAS based architectures on CIFAR-10.
54
+
55
+ In this experiment, we apply NAT on three popular hand-crafted models, i.e., VGG [40], ResNet [13], and MobileNet [37].To make all architectures share the same graph representation method defined in Section 3.2, we add null connections into the hand-crafted architectures to ensure that each node has two input nodes (See examples in Figure 3).For a fair comparison, we build deep networks using the original and optimized architectures while keeping the same depth and number of channels as the original models.We compare NAT with a strong baseline method Neural Architecture Optimization (NAO) [31].We show the results in Table 1 and the corresponding architectures in Figure 3.From Table 1, although the models with NAO yield better performance than the original ones,they often have more parameters and higher computation cost. By contrast,our NAT based models consistently outperform the original models by a large margin with approximately the same computation cost.
56
+
57
+ For the automatically searched architectures,we evaluate the proposed NAT on three state-of-the-art NAS based architectures, i.e., DARTS [29], NAONet [31], and ENAS [35].Moreover, we also compare our optimized architectures with other NAS based architectures, including AmoebaNet [36], PNAS [28], SNAS [47]and GHN [51].From Table 2,all the NAT based architecturesyield higher accuracy than their baseline models and the models optimized by NAO on CIFAR-10 and ImageNet.Compared with other NAS based architectures, our NAT-DARTS performs the best on CIFAR-10 and achieves the competitive performance compared to the best architecture (i.e., AmoebaNet) on ImageNet with less computation cost and fewer number of parameters.We also visualize the architectures of the original and optimized cellin Figure 4.As for DARTS and NAONet, NAT replaces several redundant operations with the skip connections or directly removes the connection, leading to fewer number of parameters. While optimizing ENAS, NAT removes the average pooling operation andimproves the performance without introducing extra computations.
58
+
59
+ In this experiment, we compare the performance of different policy learners, including Random Search, LSTM, and the GCN method.For the Random Search method, we perform random transitions among O𝑂O, S𝑆S, and N𝑁N on the input architectures.For the GCN method, we consider two variants which infer the optimized architecture by sampling from the learned policy (denoted by Sampling-GCN) or by selecting the operation with the maximum probability (denoted by Maximum-GCN).From Table 3,our Sampling-GCN method outperforms all the considered policies on different architectures. These results demonstrate the superiority of the proposed GCN method as the policy learner.
60
+
61
+ In this experiment, we investigate the effect of different graph representations on hand-crafted architectures.Note that an architecture may correspond to many different topological graphs, especially for the hand-crafted architectures, e.g., VGG and ResNet, where the number of nodes is smaller than that of our basic cell.For convenience, we study three different graphs for VGG and ResNet20, respectively.The average accuracy of NAT-VGG is 95.83% and outperforms the baseline VGG with the accuracy of 93.56%.Similarly, our NAT-ResNet20 yields the average accuracy of 92.48%, which is also better than the original model.We put the architecture and the performance of each possible representation in the supplementary.In practice, the graph representation may influence the result of NAT and how to alleviate its effect still remains an open question.
62
+
63
+ In this paper, we have proposed a novel Neural Architecture Transformer (NAT) for the task of architecture optimization. To solve this problem, we cast it into a Markov decision process (MDP) by making a series of decisions to optimize existing operations with more computationally efficient operations, including skip connection and null operation. To show the effectiveness of NAT, we apply it to both hand-crafted architectures and Neural Architecture Search (NAS) based architectures. Extensive experiments on CIFAR-10 and ImageNet datasets demonstrate the effectiveness of the proposed method in improving the accuracy and the compactness of neural architectures.
64
+
65
+ This work was partially supported by Guangdong Provincial Scientific and Technological Funds under Grants 2018B010107001, National Natural Science Foundation of China (NSFC) (No. 61602185), key project of NSFC (No. 61836003), Fundamental Research Funds for the Central Universities (No. D2191240), Program for Guangdong Introducing Innovative and Enterpreneurial Teams 2017ZT07X183, Tencent AI Lab Rhino-Bird Focused Research Program (No. JR201902), Guangdong Special Branch Plans Young Talent with Scientific and Technological Innovation (No. 2016TQ03X445), Guangzhou Science and Technology Planning Project (No. 201904010197), and Microsoft Research Asia (MSRA Collaborative Research Program). We last thank Tencent AI Lab.
1910.14648v1.txt ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Due to the sheer volume of data generated by the end-user devices, as well asthe increasing concerns about sharing private information, a new machinelearning model, namely the federated learning (FL) [1, 2, 3, 4], has emerged from the intersection ofartificial intelligence and edge computing [5, 6, 7].In stark contrast to the conventional machine learning methods that run in a data center, FL usually operates at the network edge and brings the models directly to the devices for training, where only the resultant parameters shall be sent to the edge servers that reside in an access point (AP). This salient feature of on-device training brings along great advantages of eliminating the large communication overheads as well as preserving data privacy, and hence making FL particularly relevant for mobile applications [6, 7, 8, 9, 10]. However, as the AP needs to link a large number of user equipments (UEs) over a limited spectrum, only a portion of the UEs can be selected to access the radio channel and send their trained updates in each global aggregation [11, 5].To this end, the stragglers issue is more crucial for FL than for conventional trainings run in data centers [3, 4, 12].
2
+
3
+ Recognizing such criticality, a host of studies have been carried out and resulted in various scheduling protocols for FL, ranging from minimizing the transmission latency [13], maximizing the spectral utility [14], to opportunistically alternating between selecting the UEs with advantageous and disadvantageous channel conditions [15].Even though positive gains have been demonstrated, these works put the main focus on exploiting the spectral resources so as to maximize the number of updates collectible by the AP in each round of global communication but ignore the staleness of these updates. As pointed out by [16], the staleness of updates has a significant impact on the convergence rate of distributed machine learning models such as FL.Therefore, it is reasonable to expect a scheduling algorithm that accounts for both the staleness and the communication quality can accelerate the convergence of FL in a mobile edge network.On this purpose, we introduce a metric, referred to as the age-of-update (AoU)111Such age metric has been previously used, mainly, in the context of networking and has been shown to improve the notion of data freshness in various applications, see, e.g., the original treatment in [17], and the survey in [18]., to measure the staleness associated with each update and based on that, devise a scheduling protocol that allows the AP to collect timely updates from the UEs for FL training.The algorithm is shown to possess low complexity, and its effectiveness is amply illustrated via Monte Carlo simulations.
4
+
5
+ Let us consider a mobile edge network that consists of one AP and K𝐾K user equipments (UEs), as depicted in Fig. 1, all are capable of performing local computing.For a generic UE k𝑘k, we consider that it is equipped with single antenna and has local data set 𝒟k={𝐱i∈ℝd,yi∈ℝ}i=1nksubscript𝒟𝑘superscriptsubscriptformulae-sequencesubscript𝐱𝑖superscriptℝ𝑑subscript𝑦𝑖ℝ𝑖1subscript𝑛𝑘\mathcal{D}_{k}=\{\mathbf{x}_{i}\in\mathbb{R}^{d},y_{i}\in\mathbb{R}\}_{i=1}^{n_{k}} with size nk=|𝒟k|subscript𝑛𝑘subscript𝒟𝑘n_{k}=|\mathcal{D}_{k}|, where |⋅||\cdot| denotes the cardinality.In this network, the UEs communicate with the AP through a common spectrum, which is divided into N𝑁N equal-length subchannels. Here, we assume N<K𝑁𝐾N<K.The AP can possibly assign different UEs a different number of subchannels.We adopt a block-fading propagation model, where the channels between any pair of antennas are assumed independently and identically distributed (i.i.d.) and quasi-static, i.e., the channel is constant during one transmission block, and varies independently from block to block.
6
+
7
+ The goal of the AP is to learn a statistical model over data that reside on the K𝐾K associated UEs. Specifically, the AP needs to fit a vector 𝐰∈ℝd𝐰superscriptℝ𝑑\mathbf{w}\in\mathbb{R}^{d} so as to minimize a particular loss function. Formally, such a task can be expressed as follows:min𝐰∈ℝd⁡{P​(𝐰)=1n​∑i=1nℓ​(𝐰;𝐱i,yi)+ξ​r​(𝐰)}subscript𝐰superscriptℝ𝑑𝑃𝐰1𝑛superscriptsubscript𝑖1𝑛ℓ𝐰subscript𝐱𝑖subscript𝑦𝑖𝜉𝑟𝐰\displaystyle\min_{\mathbf{w}\in\mathbb{R}^{d}}\Big{\{}P(\mathbf{w})=\frac{1}{n}\sum_{i=1}^{n}\ell(\mathbf{w};\mathbf{x}_{i},y_{i})+\xi r(\mathbf{w})\Big{\}}(1)where n=∑i=1Kni𝑛superscriptsubscript𝑖1𝐾subscript𝑛𝑖n=\sum_{i=1}^{K}n_{i} is the size of the whole data set, ξ𝜉\xi is the regularizing parameter and r​(𝐰)𝑟𝐰r(\mathbf{w}) a deterministic penalty function.The function ℓ​(⋅)ℓ⋅\ell(\cdot) represents the loss function.Several examples of loss functions used in popular machine learning models are summarized in [19].
8
+
9
+ Due to concerns of data privacy, the raw data set is generally not available at the AP and hence (1) shall be solved using FL.In particular, the training procedure (cf. Algorithm 3) comprises three major steps: i𝑖i) the UEs conduct local computing aimed to solve (1) by referring to the data resided on device and a downloaded global model, and send the resultant parameters to the AP, i​i𝑖𝑖ii) the AP aggregates the received updates to produce an improved global model, and i​i​i𝑖𝑖𝑖iii) the new model is sent backto UEs, and the process is repeated.After a sufficient amount of training and update exchanges, usually termed communication rounds, between the AP and UEs, the objective function (1) can converge to the global optimal.Nevertheless, because the wireless medium is resource-constrained, the AP can only select a subgroup of UEs for parameter updates in each communication round, and the choice of selection can largely affect the convergence rate of FL [19].In that respect, it languishes a dire need for appropriate scheduling algorithms.
10
+
11
+ In this section,we elaborate the concept of AoU, and detail the development of a scheduling policy based on this quantity.
12
+
13
+ In order to quantify the staleness of each update, we leverage the concept of information freshness [17] and define a metric termed Age-of-Update (AoU).For a generic UE k𝑘k, its AoU evolves as follows:Tk​[t+1]=(Tk​[t]+1)​(1−Sk​[t]),Sk​[t]∈{0,1}formulae-sequencesubscript𝑇𝑘delimited-[]𝑡1subscript𝑇𝑘delimited-[]𝑡11subscript𝑆𝑘delimited-[]𝑡subscript𝑆𝑘delimited-[]𝑡01\displaystyle T_{k}[t+1]=(T_{k}[t]+1)(1-S_{k}[t]),~{}~{}S_{k}[t]\in\{0,1\}(2)where Tk​[0]=0subscript𝑇𝑘delimited-[]00T_{k}[0]=0, and Sk​[t]subscript𝑆𝑘delimited-[]𝑡S_{k}[t] takes value 1 if UE k𝑘k is selected by the AP for update during communication round t𝑡t, and takes value 0 otherwise.It is important to note that the AoU of UE k𝑘k measures the time elapsed since its latest update is received by the AP, and hence a larger AoU value indicates a higher degree of staleness associated with that UE.
14
+
15
+ As illustrated in Fig. 2, the evolution of AoU is affected by the scheduling algorithm.Moreover, as the UEs are usually situated at various geographic locations, their AoU will progress differently due to their distinct communication conditions. In this regard, the different AoUs can be utilized as a reference to prioritize the channel access for the UEs.
16
+
17
+ Using the notion of AoU, we devise our scheduling protocol such that the AP is able to keep the collection of all the updates “as fresh as possible” by minimizing the sum of certain functions of the AoUs in each communication round. To be concrete, upon the global aggregation at round t𝑡t, the AP selects the set of UEs for parameter update, denoted by 𝐒​[t]={S1​[t],S2​[t],…,SK​[t]}𝐒delimited-[]𝑡subscript𝑆1delimited-[]𝑡subscript𝑆2delimited-[]𝑡…subscript𝑆𝐾delimited-[]𝑡\mathbf{S}[t]=\{S_{1}[t],S_{2}[t],...,S_{K}[t]\}, according to the following criteria:min𝐒​[t],𝐏​∑k=1Kfα​(Tk​[t])​( 1−Sk​[t])subscript𝐒delimited-[]𝑡𝐏superscriptsubscript𝑘1𝐾subscript𝑓𝛼subscript𝑇𝑘delimited-[]𝑡1subscript𝑆𝑘delimited-[]𝑡\displaystyle\min_{\mathbf{S}[t],\mathbf{P}}~{}\sum_{k=1}^{K}f_{\alpha}(\,T_{k}[t]\,)(\,1-S_{k}[t]\,)(3a)s.t.(∑n∈𝒞k12​log⁡(1+Gk,n​Pk,n)−Rs)​Sk​[t]≥0formulae-sequencestsubscript𝑛subscript𝒞𝑘121subscript𝐺𝑘𝑛subscript𝑃𝑘𝑛subscript𝑅ssubscript𝑆𝑘delimited-[]𝑡0\displaystyle~{}~{}\mathrm{s.t.}~{}\left(\sum_{n\in\mathcal{C}_{k}}\frac{1}{2}\log(1+G_{k,n}P_{k,n})-R_{\mathrm{s}}\right)S_{k}[t]\geq 0(3b)∑n∈𝒞kPk,n≤PTXsubscript𝑛subscript𝒞𝑘subscript𝑃𝑘𝑛subscript𝑃TX\displaystyle~{}\qquad\sum_{n\in\mathcal{C}_{k}}P_{k,n}\leq P_{\mathrm{TX}}(3c)Sk​[t]∈{0,1},∀k∈{1,…,K}formulae-sequencesubscript𝑆𝑘delimited-[]𝑡01for-all𝑘1…𝐾\displaystyle~{}\,\qquad S_{k}[t]\in\{0,1\},~{}~{}~{}\forall\,k\in\{1,...,K\}(3d)𝒞i∩𝒞j=ϕ,if​i≠j​and∪k=1K𝒞k⊆{1,…,N}formulae-sequencesubscript𝒞𝑖subscript𝒞𝑗italic-ϕif𝑖superscriptsubscript𝑘1𝐾𝑗andsubscript𝒞𝑘1…𝑁\displaystyle~{}\,\qquad\mathcal{C}_{i}\cap\mathcal{C}_{j}\!=\!\phi,~{}\mathrm{if}~{}i\neq j~{}\mathrm{and}\,\cup_{k=1}^{K}\mathcal{C}_{k}\!\subseteq\!\{1,...,N\}(3e)where Gk,nsubscript𝐺𝑘𝑛G_{k,n} is the gain attainable by UE k𝑘k on the n𝑛n-th subchannel, Pk,nsubscript𝑃𝑘𝑛P_{k,n} the correspondingly injected power, and 𝒞ksubscript𝒞𝑘\mathcal{C}_{k} is the set of subchannels assigned to UE k𝑘k. Because the transmission of updates need to be finished within a certain time, the selected UEs should have their rates individually exceeding a threshold Rssubscript𝑅sR_{\mathrm{s}}, representing a required quality-of-service.Moreover, the UEs are subject to a maximum transmit power through constraint (3c), while the constraint (3e) stipulates that the UEs shall follow an orthogonal channel access methodology to avoid interfering with each other.The function fα​(⋅)subscript𝑓���⋅f_{\alpha}(\cdot) in (3) represents the sensitivity of the edge server to the staleness of local updates. In this paper, we set the function as follows [20]:fα(x)={​​ x1−α1−α,ifα≠1,​​​​ log(1+x),otherwise.\displaystyle f_{\alpha}(x)=\left\{\begin{tabular}[]{cc}\!\! $\frac{x^{1-\alpha}}{1-\alpha}$,&$\mathrm{if}~{}\alpha\neq 1$,\\\!\!\!\! $\log(1+x)$,&$\mathrm{otherwise}$.\end{tabular}\right.(6)The essence of the above function is to ensure a fairness treatment among the UEs based on their AoUs.
18
+
19
+ Two special cases are noteworthy: i𝑖i) if fα​(x)subscript𝑓𝛼𝑥f_{\alpha}(x) is set as a constant, then solving problem (3) is equivalent to packing the maximum number of UEs into the spectrum during each communication round [14],and i​i𝑖𝑖ii) when the communication is conducted under an ideal environment, i.e., if Rs=0subscript𝑅s0R_{\mathrm{s}}=0, solutions of the optimization problem (3) lead to an N𝑁N-Round-Robin policy [19].Therefore, in the general scenario, the design problem given by (3) balances the tradeoff between fairness and quality on the radio channel access. It is also worthwhile to note that the design per problem (3) is not only suitable for scheduling updates in FL, but can also be leveraged in the scheduling of wireless traffic [21].
20
+
21
+ The problem given by (3) is a combinatorial problem with mixed integers that does not possess low complexity solutions in general. Here, we tackle the problem via a greedy algorithm.The approach is constituted of two major steps.
22
+
23
+ First, amongst all the UEs, the AP needs to form a candidate list ℐssubscriptℐs\mathcal{I}_{\mathrm{s}} for further selection, by choosing those UEs that are able to achieve the targeted rate Rssubscript𝑅sR_{\mathrm{s}} under the currently available spectrum budget. Moreover, each UE in the candidate list shall occupy the least amount of subchannels.As such, a candidate UE k𝑘k needs to satisfy the following:min𝒞k,𝐏k⁡‖𝒞k‖0subscriptsubscript𝒞𝑘subscript𝐏𝑘subscriptnormsubscript𝒞𝑘0\displaystyle\min_{\mathcal{C}_{k},\mathbf{P}_{k}}~{}\|\mathcal{C}_{k}\|_{0}(11a)s.t.∑n∈𝒞k12​log⁡(1+Gk,n​Pk,n)≥Rs,formulae-sequencestsubscript𝑛subscript𝒞𝑘121subscript𝐺𝑘𝑛subscript𝑃𝑘𝑛subscript𝑅s\displaystyle~{}~{}\mathrm{s.t.}~{}~{}\sum_{n\in\mathcal{C}_{k}}\frac{1}{2}\log(1+G_{k,n}P_{k,n})\geq R_{\mathrm{s}},(11b)∑n∈𝒞kPk,n≤PTXsubscript𝑛subscript𝒞𝑘subscript𝑃𝑘𝑛subscript𝑃TX\displaystyle~{}~{}\qquad\sum_{n\in\mathcal{C}_{k}}P_{k,n}\leq P_{\mathrm{TX}}(11c)where ∥⋅∥0\|\cdot\|_{0} is the L-0 norm [22] and 𝐏k={Pk,n,n∈𝒞k}subscript𝐏𝑘subscript𝑃𝑘𝑛𝑛subscript𝒞𝑘\mathbf{P}_{k}=\{P_{k,n},n\in\mathcal{C}_{k}\} is the transmit power on the allotted subchannels.For each selectioin of 𝒞ksubscript𝒞𝑘\mathcal{C}_{k}, subproblem (11) can be solved by a water-filling algorithm, and the details of forming the candidate list is summarized in Algorithm 1.
24
+
25
+ Next, from the set of candidate UEs, the AP shall select the UEs that have relatively large AoU while requiring a relatively small amount of subchannels for the transmissions. Formally, the AP will select UE i𝑖i instead of UE j𝑗j if the following holds:fα​(Ti​[t])/‖𝒞i‖0>fα​(Tj​[t])/‖𝒞j‖0.subscript𝑓𝛼subscript𝑇𝑖delimited-[]𝑡subscriptnormsubscript𝒞𝑖0subscript𝑓𝛼subscript𝑇𝑗delimited-[]𝑡subscriptnormsubscript𝒞𝑗0\displaystyle f_{\alpha}(T_{i}[t])/\|\mathcal{C}_{i}\|_{0}>f_{\alpha}(T_{j}[t])/\|\mathcal{C}_{j}\|_{0}.(12)The above criteria brings us to the age-based scheduling (ABS) policy, summarized in Algorithm 2. Note that the ABS adopts a recursive search for UEs, since the occupation of a particular subchannel can incur other UEs in the candidate list to violate their rate constraint and hence get removed. Therefore, the candidate list ℐssubscriptℐs\mathcal{I}_{\mathrm{s}} needs to be recalculated via Algorithm 1 whenever a UE is selected.Nevertheless, as the UE selection and subchannel assignments are conducted in a greedy manner, the algorithm has relatively low complexity.
26
+
27
+ Finally, we present the FL approach to solving (1) in the setting of a mobile edge network, as per Algorithm 3.
28
+
29
+ In this section, we carry out simulations to verify the effectiveness of the proposed scheduling policy. Particularly, we evaluate the efficiency of training FL on a support vector machine (SVM) over the MNIST data set, which consists of handwritten numerals, under the proposed ABS policy, and a state-of-the-art approach [14], coined as the MaxPack policy.The whole data set is participated in 100 non-overlapped portions and assigned to the K=100𝐾100K=100 UEs that are randomly scattered within a disc of a radius 100 m, where the AP locates at the center. There are in total N=20𝑁20N=20 available subchannels, and the transmission on any subchannel is subject to Rayleigh fading with unit mean and the path loss that follows a power law, with the exponent being β=3.5𝛽3.5\beta=3.5.
30
+
31
+ Fig. 3 plots the test accuracy as a function of the communication rounds. From this figure, we can observe that FL running under the ABS policy is able to attain a marked improvement in the accuracy value compared to the MaxPack policy. Moreover, the gain achieved by the ABS policy is especially pronounced in the initial stage of the training, e.g., when the communication rounds are less than 40, which demonstrates that the proposed scheme is able to accelerate the convergence of FL and hence improve the learning efficiency.This gain can be essentially attributed to that while the MaxPack policy exploits the multi-user diversity [23] by allocating the best subchannels and power to maximize the total number of receivable updates, the ABS strikes a balance between the aggressive channel use and short term fairness and hence achieves the gradient diversity [24].
32
+
33
+ In this paper, we have proposed a scheduling policy for FL in the context of mobile edge networks. By adopting a metric termed AoU, our scheme is able to account for both the staleness of updates and the instantaneous channel qualities so as to accelerate the convergence rate of FL.
1910.14670v2.txt ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Many machine learning tasks involve joint prediction of a set of variables. For instance, semantic image segmentation infers the class label for every pixel in an image.To address joint prediction, it is common to use deep nets which model probabilitydistributions independently over the variables (e.g., the pixels).The downside: correlations between different variables aren’t modeled explicitly.
2
+
3
+ A number of techniques, such as Structured SVMs [1], Max-Margin Markov Nets [2] and Deep Structured Models [3, 4], directly model relations between output variables. However, modeling the correlations between a large number of variables is computationally expensive and therefore generally impractical.As an attempt to address some of the fallbacks of classical high-order structured prediction techniques, Structured Prediction Energy Networks (SPENs) were introduced [5, 6]. SPENs assign a score to an entire prediction, which allows them to harness global structure. Additionally, because these models do not represent structure explicitly, complex relations between variables can be learned while maintaining tractability of inference. However, SPENs have their own set of downsides: Belanger and McCallum [5] mention, and we can confirm, that it is easy to overfit SPENs to the training data. Additionally, the inference techniques developed for SPENs do not enforce structural constraints among output variables, hence they cannot support structured scores and discrete losses. An attempt to combine locally structured scores with joint prediction was introduced very recently by Graber et al. [7]. However, Graber et al. [7] require the score function to take a specific, restricted form, and inference is formulated as a difficult-to-solve saddle-point optimization problem.
4
+
5
+ To address these concerns, we develop a new model which we refer to as ‘Graph Structured Prediction Energy Network’ (GSPEN). Specifically, GSPENs combine the capabilities of classical structured prediction models and SPENs and have the ability to explicitly model local structure when known or assumed, while providing the ability to learn an unknown or more global structure implicitly. Additionally, the proposed GSPEN formulation generalizes the approach by Graber et al. [7]. Concretely, inference in GSPENs is a maximization of a generally non-concave function w.r.t. structural constraints, for which we develop two inference algorithms.
6
+
7
+ We show the utility of GSPENs by comparing to related techniques on several tasks: optical character recognition, image tagging, multilabel classification, and named entity recognition. In general, we show that GSPENs are able to outperform other models. Our implementation is available at https://github.com/cgraber/GSPEN.
8
+
9
+ Let x∈𝒳𝑥𝒳x\in\mathcal{X} represent the input provided to a model, such as a sentence or an image. In this work, we consider tasks where the outputs take the form y=(y1,…,yK)∈𝒴≔∏k=1K𝒴k𝑦subscript𝑦1…subscript𝑦𝐾𝒴≔superscriptsubscriptproduct𝑘1𝐾subscript𝒴𝑘y=(y_{1},\dots,y_{K})\in\mathcal{Y}\coloneqq\prod_{k=1}^{K}\mathcal{Y}_{k}, i.e., they are vectors where the k𝑘k-th variable’s domain is the discrete and finite set 𝒴k={1,…,|𝒴k|}subscript𝒴𝑘1…subscript𝒴𝑘\mathcal{Y}_{k}=\{1,\ldots,|\mathcal{Y}_{k}|\}. In general, the number of variables K𝐾K which are part of the configuration y𝑦y can depend on the observation x𝑥x. However, for readability only, we assume all y∈𝒴𝑦𝒴y\in\mathcal{Y} contain K𝐾K entries, i.e., we drop the dependence of the output space 𝒴𝒴\mathcal{Y} on input x𝑥x.
10
+
11
+ All models we consider consist of a function F​(x,y;w)𝐹𝑥𝑦𝑤F(x,y;w), which assigns a score to a given configuration y𝑦y conditioned on input x𝑥x and is parameterized by weights w𝑤w. Provided an input x𝑥x, the inference problem requires finding the configuration y^^𝑦\hat{y} that maximizes this score, i.e., y^≔arg​maxy∈𝒴⁡F​(x,y;w)≔^𝑦subscriptargmax𝑦𝒴𝐹𝑥𝑦𝑤\hat{y}\coloneqq\operatorname*{arg\,max}_{y\in\mathcal{Y}}F(x,y;w).
12
+
13
+ To find the parameters w𝑤w of the function F​(x,y;w)𝐹𝑥𝑦𝑤F(x,y;w), it is common to use a Structured Support Vector Machine (SSVM) (a.k.a. Max-Margin Markov Network) objective [1, 2]: given a multiset {(xi,yi)i=1N}superscriptsubscriptsuperscript𝑥𝑖superscript𝑦𝑖𝑖1𝑁\left\{\left(x^{i},y^{i}\right)_{i=1}^{N}\right\} of data points (xi,yi)superscript𝑥𝑖superscript𝑦𝑖\left(x^{i},y^{i}\right) comprised of an input xisuperscript𝑥𝑖x^{i} and the corresponding ground-truth configuration yisuperscript𝑦𝑖y^{i}, a SSVM attempts to find weights w𝑤w which maximize the margin between the scores assigned to the ground-truth configuration yisuperscript𝑦𝑖y^{i} and the inference prediction:minw​∑(xi,yi)maxy^∈𝒴⁡{F​(xi,y^;w)+L​(y^,yi)}−F​(xi,yi;w).subscript𝑤subscriptsuperscript𝑥𝑖superscript𝑦𝑖subscript^𝑦𝒴𝐹superscript𝑥𝑖^𝑦𝑤𝐿^𝑦superscript𝑦𝑖𝐹superscript𝑥𝑖superscript𝑦𝑖𝑤\min_{w}\sum_{\left(x^{i},y^{i}\right)}\max_{\hat{y}\in\mathcal{Y}}\left\{F\left(x^{i},\hat{y};w\right)+L\left(\hat{y},y^{i}\right)\right\}-F\left(x^{i},y^{i};w\right).(1)Hereby, L​(y^,yi)𝐿^𝑦superscript𝑦𝑖L\left(\hat{y},y^{i}\right) is a task-specific and often discrete loss, such as the Hamming loss, which steers the model towards learning a margin between correct and incorrect outputs. Due to addition of the task-specific loss L​(y^,yi)𝐿^𝑦superscript𝑦𝑖L(\hat{y},y^{i}) to the model score F​(xi,y^;w)𝐹superscript𝑥𝑖^𝑦𝑤F\left(x^{i},\hat{y};w\right), we often refer to the maximization task within Eq. (1) as loss-augmented inference. The procedure to solve loss-augmented inference depends on the considered model, which we discuss next.
14
+
15
+ Unstructured Models.Unstructured models, such as feed-forward deep nets, assign a score to each label of variable yksubscript𝑦𝑘y_{k} which is part of the configuration y𝑦y, irrespective of the label choice of other variables. Hence, the final score function F𝐹F is the sum of K𝐾K individual scores fk​(x,yk;w)subscript𝑓𝑘𝑥subscript𝑦𝑘𝑤f_{k}(x,y_{k};w), one for each variable:F​(x,y;w)≔∑k=1Kfk​(x,yk;w).≔𝐹𝑥𝑦𝑤superscriptsubscript𝑘1𝐾subscript𝑓𝑘𝑥subscript𝑦𝑘𝑤F(x,y;w)\coloneqq\sum_{k=1}^{K}f_{k}(x,y_{k};w).(2)Because the scores for each output variable do not depend on the scores assigned to other output variables, the inference assignment is determined efficiently by independently finding the maximum score for each variable yksubscript𝑦𝑘y_{k}. The same is true for loss-augmented inference, assuming that the loss decomposes into a sum of independent terms as well.
16
+
17
+ Classical Structured Models.Classical structured models incorporate dependencies between variables by considering functions that take more than one output space variable yksubscript𝑦𝑘y_{k} as input, i.e., each function depends on a subset r⊆{1,…,K}𝑟1…𝐾r\subseteq\{1,\dots,K\} of the output variables. We refer to the subset of variables via yr=(yk)k∈rsubscript𝑦𝑟subscriptsubscript𝑦𝑘𝑘𝑟y_{r}=(y_{k})_{k\in r} and use frsubscript𝑓𝑟f_{r} to denote the corresponding function. The overall score for a configuration y𝑦y is a sum of these functions, i.e.,F​(x,y;w)≔∑r∈ℛfr​(x,yr;w).≔𝐹𝑥𝑦𝑤subscript𝑟ℛsubscript𝑓𝑟𝑥subscript𝑦𝑟𝑤F(x,y;w)\coloneqq\sum_{r\in\mathcal{R}}f_{r}(x,y_{r};w).(3)Hereby, ℛℛ\mathcal{R} is a set containing all of the variable subsets which are required to compute F𝐹F. The variable subset relations between functions frsubscript𝑓𝑟f_{r}, i.e., the structure, is often visualized using factor graphs or, generally, Hasse diagrams.
18
+
19
+ This formulation allows to explicitly model relations between variables, but itcomes at the price of more complex inference which isNP-hard [8] in general. A number of approximations to this problem havebeen developed and utilized successfully (see Sec. 5 for moredetails), but the complexity of these methods scales with the size of thelargest region r𝑟r. For this reason, these models commonly consider only unaryand pairwise regions, i.e., regions with one or two variables.
20
+
21
+ Inference, i.e., maximization of the score, is equivalent to the integer linear programmaxp∈ℳ​∑r∈ℛ∑yr∈𝒴rpr​(yr)​fr​(x,yr;w),subscript𝑝ℳsubscript𝑟ℛsubscriptsubscript𝑦𝑟subscript𝒴𝑟subscript𝑝𝑟subscript𝑦𝑟subscript𝑓𝑟𝑥subscript𝑦𝑟𝑤\max_{p\in\mathcal{M}}\sum_{r\in\mathcal{R}}\sum_{y_{r}\in\mathcal{Y}_{r}}p_{r}(y_{r})f_{r}(x,y_{r};w),(4)where each prsubscript𝑝𝑟p_{r} represents a marginal probability vector for region r𝑟r and ℳℳ\mathcal{M} represents the set of prsubscript𝑝𝑟p_{r} whose marginal distributions are globally consistent, which is often called the marginal polytope.Adding an entropy term over the probabilities to the inference objective transforms the problem from maximum a-posteriori (MAP) to marginal inference, and pushes the predictions to be more uniform [9, 10]. When combined with the learning procedure specified above, this entropy provides learning with the additional interpretation of maximum likelihood estimation [9]. The training objective then also fits into the framework of Fenchel-Young Losses [11].
22
+
23
+ For computational reasons, it is common to relax the marginal polytope ℳℳ\mathcal{M} to the local polytope ℳLsubscriptℳ𝐿\mathcal{M}_{L}, which is the set of all probability vectors that marginalize consistently for the factors present in the graph [9]. Since the resulting marginals are no longer globally consistent, i.e., they are no longer guaranteed to arise from a single joint distribution, we write the predictions for each region using br​(yr)subscript𝑏𝑟subscript𝑦𝑟b_{r}(y_{r}) instead of pr​(yr)subscript𝑝𝑟subscript𝑦𝑟p_{r}(y_{r}) and refer to them using the term “beliefs.” Additionally, the entropy term is approximated using fractional entropies [12] such that it only depends on the factors in the graph, in which case it takes the form Hℛ​(b)≔∑r∈ℛ∑yr∈𝒴r−br​(yr)​log⁡br​(yr)≔subscript𝐻ℛ𝑏subscript𝑟ℛsubscriptsubscript𝑦𝑟subscript𝒴𝑟subscript𝑏𝑟subscript𝑦𝑟subscript𝑏𝑟subscript𝑦𝑟H_{\mathcal{R}}(b)\coloneqq\sum_{r\in\mathcal{R}}\sum_{y_{r}\in\mathcal{Y}_{r}}-b_{r}(y_{r})\log b_{r}(y_{r}).
24
+
25
+ Structured Prediction Energy Networks.Structured Prediction Energy Networks (SPENs) [5] were motivated by the desire to represent interactions between larger sets of output variables without incurring a high computational cost. The SPEN score function takes the following form:F​(x,p1,…,pK;w)≔T​(f¯​(x;w),p1,…,pK;w),≔𝐹𝑥subscript𝑝1…subscript𝑝𝐾𝑤𝑇¯𝑓𝑥𝑤subscript𝑝1…subscript𝑝𝐾𝑤F(x,p_{1},\dots,p_{K};w)\coloneqq T\left(\bar{f}(x;w),p_{1},\dots,p_{K};w\right),(5)where f¯​(x;w)¯𝑓𝑥𝑤\bar{f}(x;w) is a learned feature representation of the input x𝑥x, each pksubscript𝑝𝑘p_{k} is a one-hot vector, and T𝑇T is a function that takes these two terms and assigns a score. This representation of the labels, i.e., pksubscript𝑝𝑘p_{k}, is used to facilitate gradient-based optimization during inference. More specifically, inference is formulated via the program:maxpk∈Δk​∀k⁡T​(f¯​(x;w),p1,…,pK;w),subscriptsubscript𝑝𝑘subscriptΔ𝑘for-all𝑘𝑇¯𝑓𝑥𝑤subscript𝑝1…subscript𝑝𝐾𝑤\max_{p_{k}\in\Delta_{k}\forall k}T\left(\bar{f}(x;w),p_{1},\dots,p_{K};w\right),(6)where each pksubscript𝑝𝑘p_{k} is constrained to lie in the |𝒴k|subscript𝒴𝑘|\mathcal{Y}_{k}|-dimensional probability simplex ΔksubscriptΔ𝑘\Delta_{k}. This task can be solved using any constrained optimization method. However, for non-concave T𝑇T the inference solution might only be approximate.
26
+
27
+ NLStruct.SPENs do not support score functions that contain a structured component.In response, Graber et al. [7] introduced NLStruct, which combines a classical structured score function with a nonlinear transformation applied on top of it to produce a final score. Given a set ℛℛ\mathcal{R} as defined previously, the NLStruct score function takes the following form:F​(x,pℛ;w)≔T​(fℛ​(x;w)∘pℛ;w),≔𝐹𝑥subscript𝑝ℛ𝑤𝑇subscript𝑓ℛ𝑥𝑤subscript𝑝ℛ𝑤F(x,p_{\mathcal{R}};w)\coloneqq T\left(f_{\mathcal{R}}(x;w)\circ p_{\mathcal{R}};w\right),(7)where fℛ​(x;w)≔(fr​(x,yr;w))|r∈ℛ,yr∈𝒴r≔subscript𝑓ℛ𝑥𝑤evaluated-atsubscript𝑓𝑟𝑥subscript𝑦𝑟𝑤formulae-sequence𝑟ℛsubscript𝑦𝑟subscript𝒴𝑟f_{\mathcal{R}}(x;w)\coloneqq(f_{r}(x,y_{r};w))|_{r\in\mathcal{R},y_{r}\in\mathcal{Y}_{r}} is a vectorized form of the score function for a classical structured model, pℛ≔(pr​(yr))|∀r∈ℛ,∀yr∈𝒴r≔subscript𝑝ℛevaluated-atsubscript𝑝𝑟subscript𝑦𝑟formulae-sequencefor-all𝑟ℛfor-allsubscript𝑦𝑟subscript𝒴𝑟p_{\mathcal{R}}\coloneqq(p_{r}(y_{r}))|_{\forall r\in\mathcal{R},\forall y_{r}\in\mathcal{Y}_{r}} is a vector containing all marginals, ‘∘\circ’ is the Hadamard product, and T𝑇T is a scalar-valued function.
28
+
29
+ For this model, inference is formulated as a constrained optimization problem, where 𝒴ℛ≔∏r∈ℛ𝒴r≔subscript𝒴ℛsubscriptproduct𝑟ℛsubscript𝒴𝑟\mathcal{Y}_{\mathcal{R}}\coloneqq\prod_{r\in\mathcal{R}}\mathcal{Y}_{r}:maxy∈ℝ|𝒴ℛ|,pℛ∈ℳ⁡T​(y;w)​ s.t. ​y=fℛ​(x;w)∘pℛ.subscriptformulae-sequence𝑦superscriptℝsubscript𝒴ℛsubscript𝑝ℛℳ𝑇𝑦𝑤 s.t. 𝑦subscript𝑓ℛ𝑥𝑤subscript𝑝ℛ\max_{y\in\mathbb{R}^{|\mathcal{Y}_{\mathcal{R}}|},p_{\mathcal{R}}\in\mathcal{M}}T(y;w)\text{~{}~{}s.t.~{}~{}}y=f_{\mathcal{R}}(x;w)\circ p_{\mathcal{R}}.(8)Forming the Lagrangian of this program and rearranging leads to the saddle-point inference problemminλ⁡maxy⁡{T​(y;w)−λT​y}+maxpℛ∈ℳ⁡λT​(fℛ​(x;w)∘pℛ).subscript𝜆subscript𝑦𝑇𝑦𝑤superscript𝜆𝑇𝑦subscriptsubscript𝑝ℛℳsuperscript𝜆𝑇subscript𝑓ℛ𝑥𝑤subscript𝑝ℛ\min_{\lambda}\max_{y}\left\{T(y;w)-\lambda^{T}y\right\}+\max_{p_{\mathcal{R}}\in\mathcal{M}}\lambda^{T}\left(f_{\mathcal{R}}(x;w)\circ p_{\mathcal{R}}\right).(9)Notably, maximization over pℛsubscript𝑝ℛp_{\mathcal{R}} is solved using techniques developedfor classical structured models111As mentioned,solving the maximization over pℛsubscript𝑝ℛp_{\mathcal{R}} tractably might require relaxing the marginal polytope ℳℳ\mathcal{M} to the local marginal polytope ℳLsubscriptℳ𝐿\mathcal{M}_{L}. For brevity, we will not repeat this fact whenever an inference problem of this form appears throughout the rest of this paper., and the saddle-point problem is optimized using the primal-dual algorithm of Chambolle and Pock [13], which alternates between updating λ𝜆\lambda, y𝑦y, and pℛsubscript𝑝ℛp_{\mathcal{R}}.
30
+
31
+ Graph Structured Prediction Energy Networks (GSPENs) generalize allaforementioned models. They combine both a classicalstructured component as well as a SPEN-like component to score an entire setof predictions jointly. Additionally, the GSPEN score function ismore general than that for NLStruct, and includes it as a special case. Afterdescribing the formulation of both the score function and the inference problem(Sec. 3.1), we discuss two approaches to solving inference(Sec. 3.2 and Sec. 3.3) that we found to work well in practice.Unlike the methods described previously for NLStruct, these approaches do notrequire solving a saddle-point optimization problem.
32
+
33
+ The GSPEN score function is written as follows:F​(x,pℛ;w)≔T​(f¯​(x;w),pℛ;w),≔𝐹𝑥subscript𝑝ℛ𝑤𝑇¯𝑓𝑥𝑤subscript𝑝ℛ𝑤F\left(x,p_{\mathcal{R}};w\right)\coloneqq T\left(\bar{f}(x;w),p_{\mathcal{R}};w\right),where vector pℛ≔(pr​(yr))|r∈ℛ,yr∈𝒴r≔subscript𝑝ℛevaluated-atsubscript𝑝𝑟subscript𝑦𝑟formulae-sequence𝑟ℛsubscript𝑦𝑟subscript𝒴𝑟p_{\mathcal{R}}\coloneqq(p_{r}(y_{r}))|_{r\in\mathcal{R},y_{r}\in\mathcal{Y}_{r}} contains one marginal per region per assignment of values to that region. This formulation allows for the use of a structured score function while also allowing T𝑇T to score an entire prediction jointly. Hence, it is a combination of classical structured models and SPENs. For instance, we can construct a GSPEN model by summing a classical structured model and a multilayer perceptron that scores an entire label vector, in which case the score function takes the form F​(x,pℛ;w)≔∑r∈ℛ∑yr∈𝒴rpr​(yr)​fr​(x,yr;w)+MLP​(pℛ;w)≔𝐹𝑥subscript𝑝ℛ𝑤subscript𝑟ℛsubscriptsubscript𝑦𝑟subscript𝒴𝑟subscript𝑝𝑟subscript𝑦𝑟subscript𝑓𝑟𝑥subscript𝑦𝑟𝑤MLPsubscript𝑝ℛ𝑤F(x,p_{\mathcal{R}};w)\coloneqq\sum_{r\in\mathcal{R}}\sum_{y_{r}\in\mathcal{Y}_{r}}p_{r}(y_{r})f_{r}(x,y_{r};w)+\text{MLP}\left(p_{\mathcal{R}};w\right). Of course, this is one of many possible score functions that are supported by this formulation. Notably, we recover the NLStruct score function if we use T​(f¯​(x;w),pℛ;w)=T′​(f¯​(x;w)∘pℛ;w)𝑇¯𝑓𝑥𝑤subscript𝑝ℛ𝑤superscript𝑇′¯𝑓𝑥𝑤subscript𝑝ℛ𝑤T(\bar{f}(x;w),p_{\mathcal{R}};w)=T^{\prime}(\bar{f}(x;w)\circ p_{\mathcal{R}};w) and let f¯​(x;w)=fℛ​(x;w)¯𝑓𝑥𝑤subscript𝑓ℛ𝑥𝑤\bar{f}(x;w)=f_{\mathcal{R}}(x;w).
34
+
35
+ Given this model, the inference problem ismaxpℛ∈ℳ⁡T​(f¯​(x;w),pℛ;w).subscriptsubscript𝑝ℛℳ𝑇¯𝑓𝑥𝑤subscript𝑝ℛ𝑤\max_{p_{\mathcal{R}}\in\mathcal{M}}T\left(\bar{f}(x;w),p_{\mathcal{R}};w\right).(10)As for classical structured models, the probabilities areconstrained to lie in the marginal polytope. In addition we also consider a fractional entropy term over the predictions,leading to maxpℛ∈ℳ⁡T​(f¯​(x;w),pℛ;w)+Hℛ​(pℛ).subscriptsubscript𝑝ℛℳ𝑇¯𝑓𝑥𝑤subscript𝑝ℛ𝑤subscript𝐻ℛsubscript𝑝ℛ\max_{p_{\mathcal{R}}\in\mathcal{M}}T\left(\bar{f}(x;w),p_{\mathcal{R}};w\right)+H_{\mathcal{R}}(p_{\mathcal{R}}).(11)In the classical setting, adding an entropy termrelates to Fenchel duality [11]. However, the GSPEN inference objective does not take the correct form to use this reasoning.We instead view this entropy as a regularizer for the predictions: it pushespredictions towards a uniform distribution, smoothing the inferenceobjective, which we empirically observed to improve convergence. Theresults discussed below indicate that addingentropy leads to better-performing models. Alsonote that it is possible to add a similar entropy term to the SPEN inferenceobjective, which is mentioned by Belanger and McCallum [5] and Belanger et al. [6].
36
+
37
+ For inference in GSPEN, SPEN procedures cannot be used since they do not maintain the additional constraints imposed by the graphical model, i.e., the marginal polytope ℳℳ{\cal M}. We also cannot use the inference procedure developed for NLStruct, as the GSPEN score function does not take the same form.Therefore, in the following, we describe two inference algorithms that optimizethe program while maintaining structural constraints.
38
+
39
+ The Frank-Wolfe algorithm [14] is suitable because the objectives in Eqs. (10, 11) are non-linear while the constraints are linear. Specifically, using [14], wecompute a linear approximation of the objective at the current iterate, maximize this linear approximation subject to the constraints of the original problem, and take a step towards this maximum.
40
+
41
+ In Algorithm 1 we detail the steps to optimize Eq. (10). In every iteration we first calculate the gradient of the score function F𝐹F with respect to the marginals/beliefs using the current prediction as input. We denote this gradient using g=∇pℛT​(f¯​(x;w),pℛ;w)𝑔subscript∇subscript𝑝ℛ𝑇¯𝑓𝑥𝑤subscript𝑝ℛ𝑤g=\nabla_{p_{\mathcal{R}}}T\left(\bar{f}(x;w),p_{\mathcal{R}};w\right). The gradient of T𝑇T depends on the specific function used and is computed via backpropagation. If entropy is part of the objective, an additional term of −ln⁡(pℛ)−1subscript𝑝ℛ1-\ln\left(p_{\mathcal{R}}\right)-1 is added to this gradient.
42
+
43
+ Next we find the maximizing beliefs whichis equivalent to inference for classical structured prediction: the constraintspace is identical and the objective is a linear function of themarginals/beliefs. Hence, we solve this inner optimization usingone of a number of techniques referenced in Sec. 5.
44
+
45
+ Convergence guarantees for Frank-Wolfe have been proven when the overallobjective is concave, continuously differentiable, and has bounded curvature [15], which is the case when T𝑇T has these properties with respect to the marginals. This is true even when the inner optimization is onlysolved approximately, which is often the case due to standardapproximations used for structured inference. When T𝑇T is non-concave,convergence can still be guaranteed, but only to a localoptimum [16]. Note that entropy has unbounded curvature, therefore its inclusion in the objective precludes convergence guarantees. Other variants of theFrank-Wolfe algorithm exist which improve convergence in certaincases [17, 18]. We defer a study of these properties to future work.
46
+
47
+ Mirror descent, another constrained optimization algorithm, is analogous toprojected subgradient descent, albeit using a more general distance beyondthe Euclidean one [19]. This algorithm has been used in thepast to solve inference for SPENs, where entropy was used as the link functionψ𝜓\psi and by normalizing over each coordinate independently [5]. We similarly use entropy in our case. However, theadditional constraints in form of the polytope ℳℳ{\cal M} require special care.
48
+
49
+ We summarize the structured entropic mirror descent inference for the proposedmodel in Algorithm 2. Each iteration of mirror descent updates thecurrent prediction pℛsubscript𝑝ℛp_{\mathcal{R}} and dual vector a𝑎a in two steps: (1) a𝑎a isupdated based on the current prediction pℛsubscript𝑝ℛp_{\mathcal{R}}. Usingψ​(pℛ)=−Hℛ​(pℛ)𝜓subscript𝑝ℛsubscript𝐻ℛsubscript𝑝ℛ\psi(p_{\mathcal{R}})=-H_{\mathcal{R}}(p_{\mathcal{R}}) as the link function,this update step takes the form a=1+ln⁡pℛ+1t​(∇pℛT​(f¯​(x;w),pℛ;w))𝑎1subscript𝑝ℛ1𝑡subscript∇subscript𝑝ℛ𝑇¯𝑓𝑥𝑤subscript𝑝ℛ𝑤a=1+\ln p_{\mathcal{R}}+\frac{1}{\sqrt{t}}\left(\nabla_{p_{\mathcal{R}}}T\left(\bar{f}(x;w),p_{\mathcal{R}};w\right)\right). As mentioned previously, the gradient ofT𝑇T can be computed using backpropagation; (2) pℛsubscript𝑝ℛp_{\mathcal{R}} is updated bycomputing the maximizing argument of the Fenchel conjugate of the link functionψ∗superscript𝜓\psi^{*} evaluated at a𝑎a. More specifically, pℛsubscript𝑝ℛp_{\mathcal{R}} is updated viapℛ=maxp^ℛ∈ℳ​∑r∈ℛ∑yr∈𝒴rp^r​(yr)​ar​(yr)+Hℛ​(p^ℛ),subscript𝑝ℛsubscriptsubscript^𝑝ℛℳsubscript𝑟ℛsubscriptsubscript𝑦𝑟subscript𝒴𝑟subscript^𝑝𝑟subscript𝑦𝑟subscript𝑎𝑟subscript𝑦𝑟subscript𝐻ℛsubscript^𝑝ℛp_{\mathcal{R}}=\max_{\hat{p}_{\mathcal{R}}\in\mathcal{M}}\sum_{r\in\mathcal{R}}\sum_{y_{r}\in\mathcal{Y}_{r}}\hat{p}_{r}(y_{r})a_{r}(y_{r})+H_{\mathcal{R}}\left(\hat{p}_{\mathcal{R}}\right),(12)which is identical to classical structured prediction.
50
+
51
+ When the inference objective is concave and Lipschitz continuous (i.e., when T𝑇T has these properties), thisalgorithm has also been proven to converge [19].Unfortunately, we are not aware of any convergence results if the inneroptimization problem is solved approximately and if the objective is notconcave. In practice, though, we did not observe any convergence issues duringexperimentation.
52
+
53
+ GSPENs assign a score to an input x𝑥x and a prediction p𝑝p. An SSVM learning objective is applicable, which maximizes the margin betweenthe scores assigned to the correct prediction and the inferred result. The full SSVMlearning objective with added loss-augmented inference is summarized inFig. 1. The learning procedure consists of computing thehighest-scoring prediction using one of the inference procedures described inSec. 3.2 and Sec. 3.3 for each example in a mini-batch and thenupdating the weights of the model towards making better predictions.
54
+
55
+ To demonstrate the utility of our model and to compare inference and learning settings, we report results on the tasks of optical character recognition (OCR), image tagging, multilabel classification, and named entity recognition (NER). For each experiment, we use the following baselines: Unary is an unstructured model that does not explicitly model the correlations between output variables in any way. Struct is a classical deep structured model using neural network potentials. We follow the inference and learning formulation of [3], where inference consists of a message passing algorithm derived using block coordinate descent on a relaxation of the inference problem. SPEN and NLStruct represent the formulations discussed in Sec. 2. Finally, GSPEN represents Graph Structured Prediction Energy Networks, described in Sec. 3. For GSPENs, the inner structured inference problems are solved using the same algorithm as for Struct. To compare the run-time of these approaches, Table 1 gives the average epoch compute time (i.e., time to compute the inference objective and update model weights) during training for our models for each task. In general, GSPEN training was more efficient with respect to time than NLStruct but, expectedly, more expensive than SPEN. Additional experimental details, including hyper-parameter settings, are provided in Appendix A.2.
56
+
57
+ For the OCR experiments, we generate data by selecting a list of 50 common 5-letter English words, such as ‘close,’ ‘other,’ and ‘world.’ To create each data point, we choose a word from this list and render each letter as a 28x28 pixel image by selecting a random image of the letter from the Chars74k dataset [20], randomly shifting, scaling, rotating, and interpolating with a random background image patch. A different pool of backgrounds and letter images was used for the training, validation, and test splits of the data. The task is to identify the words given 5 ordered images. We create three versions of this dataset using different interpolation factors of α∈{0.3,0.5,0.7}𝛼0.30.50.7\alpha\in\{0.3,0.5,0.7\}, where each pixel in the final image is computed as α​xbackground+(1−α)​xletter𝛼subscript𝑥background1𝛼subscript𝑥letter\alpha x_{\text{background}}+(1-\alpha)x_{\text{letter}}. See Fig. 2 for a sample from each dataset. This process was deliberately designed to ensure that information about the structure of the problem (i.e., which words exist in the data) is a strong signal, while the signal provided by each individual letter image can be adjusted. The training, validation, and test set sizes for each dataset are 10,000, 2,000, and 2,000, respectively. During training we vary the training data to be either 200, 1k or 10k.
58
+
59
+ To study the inference algorithm, we train four different GSPEN models on the dataset containing 1000 training points and using α=0.5𝛼0.5\alpha=0.5. Each model uses either Frank-Wolfe or Mirror Descent and included/excluded the entropy term. To maintain tractability of inference, we fix a maximum iteration count for each model. We additionally investigate the effect of this maximum count on final performance. Additionally, we run this experiment by initializing from two different Struct models, one being trained using entropy during inference and one being trained without entropy. The results for this set of experiments are shown in Fig. 3(a). Most configurations perform similarly across the number of iterations, indicating these choices are sufficient for convergence. When initializing from the models trained without entropy, we observe that both Frank-Wolfe without entropy and Mirror Descent with entropy performed comparably. When initializing from a model trained with entropy, the use of mirror descent with entropy led to much better results.
60
+
61
+ The results for all values of α𝛼\alpha using a train dataset size of 1000 are presented in Fig. 3(b), and results for all train dataset sizes with α=0.5𝛼0.5\alpha=0.5 are presented in Fig. 3(c). We observe that, in all cases, GSPEN outperforms all baselines. The degree to which GSPEN outperforms other models depends most on the amount of train data: with a sufficiently large amount of data, SPEN and GSPEN perform comparably. However, when less data is provided, GSPEN performance does not drop as sharply as that of SPEN initially. It is also worth noting that GSPEN outperformed NLStruct by a large margin. The NLStruct model is less stable due to its saddle-point formulation. Therefore it is much harder to obtain good performance with this model.
62
+
63
+ Next, we evaluate on the MIRFLICKR25k dataset [21], which consists of 25,000 images taken from Flickr. Each image is assigned a subset of 24 possible tags. The train/val/test sets for these experiments consist of 10,000/5,000/10,000 images, respectively.
64
+
65
+ We compare to NLStruct and SPEN.We initialize the structured portion of our GSPEN model using the pre-trained DeepStruct model described by Graber et al. [7], which consists of unary potentials produced from an AlexNet architecture [22] and linear pairwise potentials of the form fi,j​(yi,yj,W)=Wi,j,xi,xjsubscript𝑓𝑖𝑗subscript𝑦𝑖subscript𝑦𝑗𝑊subscript𝑊𝑖𝑗subscript𝑥𝑖subscript𝑥𝑗f_{i,j}(y_{i},y_{j},W)=W_{i,j,x_{i},x_{j}}, i.e., containing one weight per pair in the graph per assignment of values to that pair. A fully-connected pairwise graph was used. The T𝑇T function for our GSPEN model consists of a 2-layer MLP with 130 hidden units. It takes as input a concatenation of the unary potentials generated by the AlexNet model and the current prediction. Additionally, we train a SPEN model with the same number of layers and hidden units. We used Frank-Wolfe without entropy for both SPEN and GSPEN inference.
66
+
67
+ The results are shown in Fig. 4. GSPEN obtains similar test performance to the NLStruct model, and both outperform SPEN. However, the NLStruct model was run for 100 iterations during inference without reaching ‘convergence’ (change of objective smaller than threshold), while the GSPEN model required an average of 69 iterations to converge at training time and 52 iterations to converge at test time. Our approach has the advantage of requiring fewer variables to maintain during inference and requiring fewer iterations of inference to converge. The final test losses for SPEN, NLStruct and GSPEN are 2.158, 2.037, and 2.029, respectively.
68
+
69
+ We use the Bibtex and Bookmarks multilabel datasets [23]. They consist of binary-valued input feature vectors, each of which is assigned some subset of 159/208 possible labels for Bibtex/Bookmarks, respectively. We train unary and SPEN models with architectures identical to [5] and [24] but add dropout layers. In addition, we further regularize the unary model by flipping each bit of the input vectors with probability 0.01 when sampling mini-batches. For Struct and GSPEN, we generate a graph by first finding the label variable that is active in most training data label vectors and add edges connecting every other variable to this most active one. Pairwise potentials are generated by passing the input vector through a 2-layer MLP with 1k hidden units. The GSPEN model is trained by starting from the SPEN model, fixing its parameters, and training the pairwise potentials.
70
+
71
+ The results are in Table 2 alongside those taken from [5] and [24]. We found the Unary models to perform similarly to or better than previous best results. Both SPEN and Struct are able to improve upon these Unary results. GSPEN outperforms all configurations, suggesting that the contributions of the SPEN component and the Struct component to the score function are complementary.
72
+
73
+ We also assess suitability forNamed Entity Recognition (NER) using the English portion of the CoNLL 2003 shared task [25]. To demonstrate the applicability of GSPEN for this task, we transformed two separate models, specifically the ones presented by Ma and Hovy [26] and Akbik et al. [27], into GSPENs by taking their respective score functions and adding a component that jointly scores an entire set of predictions. In each case, we first train six instances of the structured model using different random initializations and drop the model that performs the worst on validation data. We then train the GSPEN model, initializing the structured component from these pre-trained models.
74
+
75
+ The final average performance is presented in Table 3, and individual trial information can be found in Table 4 in the appendix. When comparing to the model described by Ma and Hovy [26], GSPEN improves the final test performance in four out of the five trials, and GSPEN has a higher overall average performance across both validation and test data. Compared to Akbik et al. [27], on average GSPEN’s validation score was higher, but it performed slightly worse at test time. Overall, these results demonstrate that it is straightforward to augment a task-specific structured model with an additional prediction scoring function which can lead to improved final task performance.
76
+
77
+ A variety of techniques have been developed to model structure among output variables, originating from seminal works of [28, 2, 1]. These works focus on extending linear classification, both probabilistic and non-probabilistic, to model the correlation among output variables. Generally speaking,scores representing both predictions for individual output variables and for combinations of output variables are used. A plethora of techniques have been developed to solve inference for problems of this form, e.g., [29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 9, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 12, 54, 55, 56, 57, 58, 59, 60, 61, 62]. As exact inference for general structures is NP-hard [8], early work focused on tractable exact inference. However, due to interest in modeling problems with intractable structure, a plethora of approaches have been studied for learning withapproximate inference [63, 64, 65, 66, 67, 68, 69, 70]. More recent work has also investigated the role of different types of prediction regularization, with Niculae et al. [10] replacing the often-used entropy regularization with an L2 norm and Blondel et al. [11] casting both as special cases of a Fenchel-Young loss framework.
78
+
79
+ To model both non-linearity and structure,deep learning and structured prediction techniques were combined. Initially, local, per-variable score functions were learned with deep nets and correlations among output variables were learned in a separate second stage [71, 72]. Later work simplified this process, learning both local score functions and variable correlations jointly [73, 74, 3, 4, 75].
80
+
81
+ Structured Prediction Energy Networks (SPENs), introduced by Belanger and McCallum [5], take a different approach to modeling structure. Instead of explicitly specifying a structure a-priori and enumerating scores for every assignment of labels to regions, SPENs learn a function which assigns a score to an input and a label. Inference uses gradient-based optimization to maximize the score w.r.t. the label. Belanger et al. [6] extend this technique byunrolling inference in a manner inspired by Domke [76]. Both approaches involve iterative inference procedures, which are slower than feed-forward prediction of deep nets. To improve inference speed, Tu and Gimpel [77] learn a neural net to produce the same output as the gradient-based methods. Deep Value Networks [24] follow the same approach of Belanger and McCallum [5] but use a different objective that encourages the score to equal the task loss of the prediction. All these approaches do not permit to include known structure. The proposed approach enables this.
82
+
83
+ Our approach is most similar to our earlier work [7], which combines explicitly-specified structured potentials with a SPEN-like score function. The score function of our earlier work is a special case of the one presented here.In fact, earlier we required a classical structured prediction model as an intermediate layer of the score function, while we don’t make this assumption any longer. Additionally, in our earlier work we had to solve inference viaa computationally challenging saddle-point objective. Another related approach is described by Vilnis et al. [78], whose score function is the sum of a classical structured score function and a (potentially non-convex) function of the marginal probability vector pℛsubscript𝑝ℛp_{\mathcal{R}}. This is also a special case of the score function presented here. Additionally, the inference algorithm they develop is based on regularized dual averaging [79] and takes advantage of the structure of their specific score function, i.e., it is not directly applicable to our setting.
84
+
85
+ The developed GSPEN model combines the strengths of several prior approaches to solving structured prediction problems. It allows machine learning practitioners to include inductive bias in the form of known structure into a model while implicitly capturing higher-order correlations among output variables. The model formulation described here is more general than previous attempts to combine explicit local and implicit global structure modeling while not requiring inference to solve a saddle-point problem.
86
+
87
+ This work is supported in part by NSF under Grant No. 1718221 and MRI #1725729, UIUC, Samsung, 3M, Cisco Systems Inc. (Gift Award CG 1377144) and Adobe. We thank NVIDIA for providing GPUs used for this work and Cisco for access to the Arcetri cluster.
1910.14673v1.txt ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Finding a likely configuration for part of the variables of a joint distributiongiven the remaining ones is a computationallychallenging problem with many applications in machine learning, computer visionand natural language processing.
2
+
3
+ Classical structuredprediction approaches [39, 72, 75] whichexplicitly capture correlations over an output space of multiplediscrete random variables permit to formulate an energy function restricted tothe unobserved variables when conditioned on partly observed data. However, in many cases, it remains computationallydemanding to find the most likely configuration or to sample from the energyrestricted to the unobserved variables [66, 78].
4
+
5
+ Alternatively, to model a joint probability distribution which implicitlycaptures the correlations, generative adversarial nets(GANs) [25] and variational auto-encoders(VAEs) [36] evolved as compelling tools which exploit theunderlying manifold assumption: a latent ‘perturbation’ is drawn from a simpledistribution which is subsequently transformed via a deep net(generator/encoder) to the output space. Those methods have been used for aplethora of tasks, e.g., for domaintransfer [3, 10],inpainting [61, 83], image-to-imagetranslation [32, 42, 31, 51, 63, 84, 87, 88],machine translation [11] and health care [67].
6
+
7
+ While GANs and VAEs permit easy sampling from the entire output space domain, italso remains an open question of how to sample from part of the domain given theremainder? We refer to this task as co-generation subsequently.
8
+
9
+ Co-generation has been addressed in numerous works. For instance, forimage-to-imagetranslation [32, 42, 31, 51, 63, 84, 87, 88],mappings between domains are learned directly via an encoder-decoder structure.While such a formulation is convenient if we have two clearly separate domains,this mechanism isn’t scaleable if the number of output space partitioningsgrows, e.g., for image inpainting where missing regions are only specified attest time.
10
+
11
+ To enable co-generation for a domain unknown at training time, for GANs,optimization based algorithms have been proposed [83, 50]. Intuitively, they aim at finding that latent sample thataccurately matches the observed part. Dinh et al. [16] maximize the log-likelihood of the missing part given the observed one. However, we find that successful training of a GANleads to an increasingly ragged energy landscape, making the search for anappropriate latent variable via back-propagation through the generator harderand harder until it eventually fails.
12
+
13
+ To deal with this ragged energy landscape for co-generation, we develop anannealed importance sampling (AIS) [58] based Hamiltonian Monte Carlo (HMC)algorithm [19, 59]. The proposed approach leverages the benefits of AIS, i.e., graduallyannealing a complex probability distribution, and HMC, i.e., avoiding a localizedrandom walk.
14
+
15
+ We evaluate the proposed approach on synthetic data and imaging data (CelebA and LSUN), showing compelling results via MSE and MSSIM metrics.
16
+
17
+ In the following, we briefly discuss generative adversarial nets before providingbackground on co-generation with adversarial nets.
18
+
19
+ Generative adversarial nets (GANs) [24]have originally been proposed as a non-cooperative two-player game, pitting agenerator against a discriminator. The discriminator is tasked to tell apartreal data from samples produced by the generator, while the generator is askedto make differentiation for the discriminator as hard as possible. For a datasetof samples x∈𝒳𝑥𝒳x\in{\cal X} and random perturbations z𝑧z drawn from a simpledistribution, this intuitive formulation results in the saddle-point objectivemaxθ⁡minw−𝔼x​[ln⁡Dw​(x)]−𝔼z​[ln⁡(1−Dw​(Gθ​(z)))],subscript𝜃subscript𝑤subscript𝔼𝑥delimited-[]subscript𝐷𝑤𝑥subscript𝔼𝑧delimited-[]1subscript𝐷𝑤subscript𝐺𝜃𝑧\max_{\theta}\min_{w}-\mathbb{E}_{{x}}[\ln D_{w}({x})]-\mathbb{E}_{{z}}[\ln(1-D_{w}(G_{\theta}({z})))],where Gθsubscript𝐺𝜃G_{\theta} denotes the generator parameterized by θ𝜃\theta and Dwsubscript𝐷𝑤D_{w}refers to the discriminator parameterized by w𝑤w. The discriminator assesses the probability of its input argumentbeing real data. We let 𝒳𝒳{\cal X} denote the output space. Subsequently, we refer to this formulation as the ‘Vanilla GAN,’ and note thatits loss is related to the Jensen-Shannon divergence. Many other divergences anddistances have been proposed recently [4, 44, 26, 38, 14, 12, 56, 6, 55, 49, 28, 64] to improve the stability of the saddle-pointobjective optimization during training and to address mode-collapse, some theoretically foundedand others empirically motivated. It isbeyond the scope to review all those variants.
20
+
21
+ Co-generation, is the task of obtaining a sample for a subset of the output space domain, given as input the remainder of the outputspace domain. This task is useful for applications like imageinpainting [61, 83] or image-to-imagetranslation [32, 42, 31, 51, 63, 84, 87, 88].Many formulations for co-generation have been considered in the past. However,few meet the criteria that any given a subset of the output space could beprovided to generate the remainder.
22
+
23
+ Conditional GANs [54] have been used to generate output spaceobjects based on a given input signal [80]. The output spaceobject is typically generated as a whole and, to the best of our knowledge, nodecomposition into multiple subsets is considered.
24
+
25
+ Co-generation is related to multi-modal Boltzmannmachines [70, 60], which learn a sharedrepresentation for video and audio [60] or image andtext [70]. Restricted Boltzmann Machine basedencoder-decoder architectures are used to reconstruct either video/audio orimage/text given one of the representations. Co-generation is also related to deep net based joint embedding spacelearning [37]. Specifically, a joint embedding of images andtext into a single vector space is demonstrated using deep net encoders. After performing vector operations in the embedding space, a new sentence can beconstructed using a decoder. Co-generation is also related to cross-domain imagegeneration [85, 62, 18, 3].Those techniques use an encoder-decoder style deep net to transform rotation offaces, to learn the transfer of style properties like rotation and translation toother objects, or to encode class, view and transformation parameters intoimages.
26
+
27
+ Image-to-image translation is related in that a transformation between twodomains is learned either via an Image Transformation Net or an Encoder-Decoderarchitecture. Early works in this direction tackled supervised image-to-imagetranslation [33, 32, 41, 9, 48, 10]followed by unsupervisedvariants [71, 68, 84, 63, 8, 81, 73, 29].Cycle-consistency was discovered as a convenient regularization mechanismin [35, 87, 51, 2] and a distancepreserving regularization was shown by Benaim and Wolf [5]. Disentangling ofimage representations was investigated recently [31, 42]and ambiguity in the task was considered by Zhu et al. [88]. Otherlosses such as a ‘triangle formulation’ have been investigatedin [21, 43].
28
+
29
+ Attribute transfer [40], analogylearning [27, 62] and many style transferapproaches [74, 7, 79, 13, 52, 77, 30, 45, 47, 76, 17, 65, 20, 23, 86]just like feature learning via inpainting [61] are also usingan encoder-decoder formulation, which maps entire samples from one domain toentire samples in another domain.
30
+
31
+ Co-generation is at least challenging if not impossible for all theaforementioned works since decoders need to be trained for every subset of theoutput space domain. This is not scalable unless we know ahead of time the fewdistinct subsets of interest.
32
+
33
+ Hence, to generate arbitrary sub-spaces, other techniques need to be considered.Some applicable exceptions from the encoder-decoder style training are work onstyle transfer by Gatys et al. [22], work on image inpaintingby Yeh et al. [83], and coupled generative adversarial nets(CoGANs) by Liu and Tuzel [50]. In all three formulations, a loss is optimizedto match observations to parts of the generated databy iteratively computing gradient updates for a latent space sample.In particular, Liu and Tuzel [50] learn a joint distribution overmultiple domains by coupling multiple generators and possibly discriminators viaweight-sharing.Liu and Tuzel [50]briefly discuss co-generation when talking about “cross-domain imagetransformation,” report to observe coverage issues and state that they leave adetailed study to “future work.” Instead of an optimization based procedure, wepropose to use an annealed importance sampling based Hamiltonian Monte Carloapproach. We briefly review both techniques subsequently.
34
+
35
+ Annealded importance sampling (AIS) [58] is an algorithmtypically used to estimate (ratios of) the partition function [82, 69]. Specifically, itgradually approaches the partition function for a distribution of interest bysuccessively refining samples which were initially obtained from a ‘simple’distribution, e.g., a multivariate Gaussian.Here, we are not interested in the partition function itself, but rather in theability of AIS to accurately draw samples from complex distributions, which makes AIS a great tool for co-generation.
36
+
37
+ Hamiltonian Monte Carlo (HMC) [19] originallyreferred to as “Hybrid Monte Carlo” united the Markov Chain MonteCarlo [53] technique with molecular dynamicsapproaches [1]. Early on they were used for neural netmodels [57] and a seminal review by Neal [59]provides a detailed account. In short, a Hamiltonian combines the potentialenergy, i.e., the log probability that we are interested in sampling from with auxiliary kinetic energy. The latter typically follows a Gaussian distribution.HMC alternates updates for the kinetic energy with Metropolis updates computedby following a trajectory of constant value along the Hamiltonian to compute anew proposal. HMC is useful for co-generation because of its reduced random-walk behavior as we will explain next.
38
+
39
+ In the following we first motivate the problem of co-generation before wepresent an overview of our proposed approach and discuss the details of theemployed Hamiltonian Monte Carlo method.
40
+
41
+ Assume we are given a well trained generator x^=Gθ​(z)^𝑥subscript𝐺𝜃𝑧\hat{x}=G_{\theta}(z), parameterized by θ𝜃\theta, which isable to produce samples x^^𝑥\hat{x} from an implicitly modeled distributionpG​(x|z)subscript𝑝𝐺conditional𝑥𝑧p_{G}(x|z) via a transformation of embeddings z𝑧z [25, 4, 46, 14, 15]. Further assume we are given partially observed data xosubscript𝑥𝑜x_{o} while theremaining part xhsubscript𝑥ℎx_{h} of the data x=(xo,xh)𝑥subscript𝑥𝑜subscript𝑥ℎx=(x_{o},x_{h}) is latent, i.e., hidden. Note that during training of the generator parameters θ𝜃\theta we don’t assume information about which part of the data is missing to be available.
42
+
43
+ To reconstruct the latent parts of the data xhsubscript𝑥ℎx_{h} from available observations xosubscript𝑥𝑜x_{o}, a program is often formulated as follows:z∗=arg⁡minz⁡‖xo−Gθ​(z)o‖22,superscript𝑧∗subscript𝑧superscriptsubscriptnormsubscript𝑥𝑜subscript𝐺𝜃subscript𝑧𝑜22z^{\ast}=\arg\min_{z}\|x_{o}-G_{\theta}(z)_{o}\|_{2}^{2},(1)where Gθ​(z)osubscript𝐺𝜃subscript𝑧𝑜G_{\theta}(z)_{o} denotes the restriction of the generated sample Gθ​(z)subscript𝐺𝜃𝑧G_{\theta}(z) to the observed part. We focus on the ℓ2subscriptℓ2\ell_{2} loss here but note that any other function measuring the fit of xosubscript𝑥𝑜x_{o} and Gθ​(z)osubscript𝐺𝜃subscript𝑧𝑜G_{\theta}(z)_{o} is equally applicable. Upon solving the program given in Eq. (1), we easily obtain an estimate for the missing data x^h=G​(z∗)hsubscript^𝑥ℎ𝐺subscriptsuperscript𝑧∗ℎ\hat{x}_{h}=G(z^{\ast})_{h}.
44
+
45
+ Although the program given in Eq. (1) seems rather straightforward, it turns out to be really hard to solve, particularly if the generator Gθ​(z)subscript𝐺𝜃𝑧G_{\theta}(z) is very well trained. To see this, consider as an example a generator operating on a 2-dimensional latent space z=(z1,z2)𝑧subscript𝑧1subscript𝑧2z=(z_{1},z_{2}) and 2-dimensional data x=(x1,x2)𝑥subscript𝑥1subscript𝑥2x=(x_{1},x_{2}) drawn from a mixture of five equally weighted Gaussians with a variance of 0.020.020.02, the means of which are spaced equally on the unit circle. For this example we use h=1ℎ1h=1 and let xo=x2=0subscript𝑥𝑜subscript𝑥20x_{o}=x_{2}=0.In the first row of Fig. 1 we illustrate the loss surface of the objective given in Eq. (1) obtained when using a generator Gθ​(z)subscript𝐺𝜃𝑧G_{\theta}(z) trained on the original 2-dimensional data for 500, 1.5k, 2.5k, and 15k iterations (columns in Fig. 1).
46
+
47
+ Even in this simple 2-dimensional setting, we observe the latent space to become increasingly ragged, exhibiting folds that clearly separate different data regimes. First or second order optimization techniques cannot cope easily with such a loss landscape and likely get trapped in local optima. To illustrate this we highlight in Fig. 1 (first row) the trajectory of a sample z𝑧z optimized via gradient descent (GD) using red color and provide the corresponding loss over the number of GD updates for the objective given in Eq. (1) in Fig. 1 (second row). We observe optimization to get stuck in a local optimum as the loss fails to decrease to zero once the generator better captures the data.
48
+
49
+ To prevent those local-optima issues for co-generation, we propose an annealed importance-sampling (AIS) based Hamiltonian Monte Carlo (HMC) method in the following.
50
+
51
+ Inorder to reconstruct the hidden portion xhsubscript𝑥ℎx_{h} of the data x=(xo,xh)𝑥subscript𝑥𝑜subscript𝑥ℎx=(x_{o},x_{h}) we areinterested in drawing samples z^^𝑧\hat{z} such that x^o=Gθ​(z^)osubscript^𝑥𝑜subscript𝐺𝜃subscript^𝑧𝑜\hat{x}_{o}=G_{\theta}(\hat{z})_{o}has a high probability under log⁡p​(z|xo)∝−‖xo−Gθ​(z)o‖22proportional-to𝑝conditional𝑧subscript𝑥𝑜superscriptsubscriptnormsubscript𝑥𝑜subscript𝐺𝜃subscript𝑧𝑜22\log p(z|x_{o})\propto-\|x_{o}-G_{\theta}(z)_{o}\|_{2}^{2}. Note that the proposed approach is not restricted to thislog-quadratic posterior p​(z|xo)𝑝conditional𝑧subscript𝑥𝑜p(z|x_{o}) just like the objective in Eq. (1) is not restricted to the ℓ2subscriptℓ2\ell_{2} norm.
52
+
53
+ To obtain samples z^^𝑧\hat{z} following the posterior distribution p​(z|xo)𝑝conditional𝑧subscript𝑥𝑜p(z|x_{o}), the sampling-importance-resampling framework provides amechanism which only requires access to samples and doesn’t need computation ofa normalization constant. Specifically, for sampling-importance-resampling, wefirst draw latent points z∼p​(z)similar-to𝑧𝑝𝑧z\sim p(z) from a simple prior distribution p​(z)𝑝𝑧p(z), e.g., a Gaussian.We then compute weights according to p​(z|xo)𝑝conditional𝑧subscript𝑥𝑜p(z|x_{o}) in a second step and finally resamplein a third step from the originally drawn set according to the computed weights.
54
+
55
+ However, sampling-importance-resampling is particularly challenging in even modestly high-dimensional settings since many samples are required to adequately coverthe space to a reasonable degree. As expected, empirically, we found thisprocedure to not work very well. To address this concern, here, we propose anannealed importance sampling (AIS) based Hamiltonian Monte Carlo (HMC)procedure. Just like sampling-importance-resampling, the proposed approachonly requires access to samples and no normalization constant needs to be computed.
56
+
57
+ More specifically, we use annealed importance sampling to gradually approachthe complex and often high-dimensional posterior distribution p​(z|xo)𝑝conditional𝑧subscript𝑥𝑜p(z|x_{o}) by simulating a Markov Chain starting fromthe prior distribution p​(z)=𝒩​(z|0,I)𝑝𝑧𝒩conditional𝑧0𝐼p(z)={\cal N}(z|0,I), a standard normal distribution withzero mean and unit variance. With the increasing number of updates, we gradually approach the true posterior.Formally, we define an annealing schedule for theparameter βtsubscript𝛽𝑡\beta_{t} from β0=0subscript𝛽00\beta_{0}=0 to βT=1subscript𝛽𝑇1\beta_{T}=1. At every time step t∈{1,…,T}𝑡1…𝑇t\in\{1,\ldots,T\} werefine the samples drawn at the previous timestep t−1𝑡1t-1 so as to represent thedistribution p^t​(z|xo)=p​(z|xo)βt​p​(z)1−βtsubscript^𝑝𝑡conditional𝑧subscript𝑥𝑜𝑝superscriptconditional𝑧subscript𝑥𝑜subscript𝛽𝑡𝑝superscript𝑧1subscript𝛽𝑡\hat{p}_{t}(z|x_{o})=p(z|x_{o})^{\beta_{t}}p(z)^{1-\beta_{t}}. Intuitively andfollowing the spirit of annealed importance sampling, it is easier to graduallyapproach sampling from p​(z|xo)=p^T​(z|xo)𝑝conditional𝑧subscript𝑥𝑜subscript^𝑝𝑇conditional𝑧subscript𝑥𝑜p(z|x_{o})=\hat{p}_{T}(z|x_{o}) by successively refining thesamples. Note the notational difference between the posterior of interest p​(z|xo)𝑝conditional𝑧subscript𝑥𝑜p(z|x_{o}), and the annealed posterior p^t​(z|xo)subscript^𝑝𝑡conditional𝑧subscript𝑥𝑜\hat{p}_{t}(z|x_{o}).
58
+
59
+ To successively refine the samples we use Hamilton Monte Carlo (HMC) samplingbecause a proposed update can be far from the current sample while still havinga high acceptance probability. Specifically, HMC enables to bypass to some extentslow exploration of the space when using classical Metropolis updates based on arandom walk proposal distribution.
60
+
61
+ Combining both AIS and HMC, the developed approach summarized inAlg. 1 iteratively proceeds as follows after having drawn initialsamples from p​(z)=p^0​(z|xo)𝑝𝑧subscript^𝑝0conditional𝑧subscript𝑥𝑜p(z)=\hat{p}_{0}(z|x_{o}): (1) define the desired proposal distribution;and (2) for K𝐾K iterations compute new proposals using leapfrog integration andcheck whether to replace the previous sample with the new proposal.Subsequently, we discuss how to compute proposals and how to check acceptance.
62
+
63
+ Hamilton Monte Carlo (HMC) explores the latent space much more quickly than a classical random walk algorithm.Moreover, HMC methods are particularly suitable for co-generation becausethey are capable of traversing folds in an energy landscape.To this end, HMC methodstrade potential energy Ut​(z)=−log⁡p^t​(z|xo)subscript𝑈𝑡𝑧subscript^𝑝𝑡conditional𝑧subscript𝑥𝑜U_{t}(z)=-\log\hat{p}_{t}(z|x_{o}) with kinetic energy Kt​(v)subscript𝐾𝑡𝑣K_{t}(v).Hereby the dimension d𝑑d of the momentum variable v∈ℝd𝑣superscriptℝ𝑑v\in\mathbb{R}^{d} isidentical to that of the latent samples z∈ℝd𝑧superscriptℝ𝑑z\in\mathbb{R}^{d}.For readability, we drop the dependence on the time index t𝑡t from here on.
64
+
65
+ Specifically, HMC defines a Hamiltonian H​(z,v)=U​(z)+K​(v)𝐻𝑧𝑣𝑈𝑧𝐾𝑣H(z,v)=U(z)+K(v) or converselya joint probability distribution log⁡p​(z,v)∝−H​(z,v)proportional-to𝑝𝑧𝑣𝐻𝑧𝑣\log p(z,v)\propto-H(z,v) and proceeds byiteratingthree steps M𝑀M times.
66
+
67
+ In a first step, the Hamiltonian is initialized by randomlysampling the momentum variable v𝑣v, typically using a standard Gaussian. Notethat this step leaves the joint distribution p​(z,v)𝑝𝑧𝑣p(z,v) corresponding to the Hamiltonian invariant as the momentum v𝑣vis independent of samples z𝑧z and as we sample from the correct pre-defineddistribution for the momentum variables.
68
+
69
+ In a second step, we compute proposals (z∗,v∗)superscript𝑧∗superscript𝑣∗(z^{\ast},v^{\ast}) via leapfrogintegration to move along a hypersurface of the Hamiltonian, i.e., the value ofthe Hamiltonian does not change. However note, in this step, kinetic energyK​(v)𝐾𝑣K(v) can be traded for potential energy U​(z)𝑈𝑧U(z) and vice versa.
70
+
71
+ In the final third step we decide whether to accept the proposal (z∗,v∗)superscript𝑧∗superscript𝑣∗(z^{\ast},v^{\ast}) computed via leapfrog integration. Formally, we accept the proposalwith probabilitymin⁡{1,exp⁡(−H​(z∗,v∗)+H​(z,v))}.1𝐻superscript𝑧∗superscript𝑣∗𝐻𝑧𝑣\min\{1,\exp\left(-H(z^{\ast},v^{\ast})+H(z,v)\right)\}.(2)If the proposed state (z∗,v∗)superscript𝑧∗superscript𝑣∗(z^{\ast},v^{\ast}) is rejected, the m+1𝑚1m+1-th iterationreuses z𝑧z, otherwise z𝑧z is replaced with z∗superscript𝑧∗z^{\ast} in the m+1𝑚1m+1-th iteration.
72
+
73
+ Note that points (z,v)𝑧𝑣(z,v) with different probability density are only obtainedduring the first step, i.e., sampling of the moment variables v𝑣v. Importantly, resampling of v𝑣v can change the probabilitydensity by a large amount. As evident from Eq. (2), a low value for theHamiltonian obtained after resampling v𝑣v increases the chances of acceptingthis proposal, i.e., we gradually increase the number of samples with a low value for the Hamiltonian, conversely a high probability.
74
+
75
+ We use a sigmoid schedule for the parameter βtsubscript𝛽𝑡\beta_{t}, i.e., we linearly space T−1𝑇1T-1 temperature values within a range and apply a sigmoid function to these values to obtain βtsubscript𝛽𝑡\beta_{t}. This schedule, emphasizes locations where the distribution changes drastically. We use 0.010.010.01 as the leapfrog step size and employ 101010 leapfrog updates per HMC loop for the synthetic 2D dataset and 202020 leapfrog updates for the real dataset at first. The acceptance rate is 0.650.650.65, as recommended by Neal [59]. Low acceptance rate means the leapfrog step size is too large in which case the step size will be decreased by 0.98 automatically. In contrast, a high acceptance rate will increase the step size by 1.02111We adapt the AIS implementation from https://github.com/tonywu95/eval_gen.
76
+
77
+ Baselines: In the following, we evaluate the proposed approach on synthetic and imaging data. We compare Alg. 1 with two GD baselines by employing two different initialization strategies. The first one is sampling a single z𝑧z randomly. The secondpicks that one sample z𝑧z from 500050005000 initial points which best matches the objective given in Eq. (1).
78
+
79
+ To illustrate the advantage of our proposed method over the common baseline, we first demonstrate our results on 2-dimensional synthetic data. Specifically, the 2-dimensional data x=(x1,x2)𝑥subscript𝑥1subscript𝑥2x=(x_{1},x_{2}) is drawn from a mixture of five equally weighted Gaussians each with a variance of 0.020.020.02, the means of which are spaced equally on the unit circle. See the blue points in columns (a), (b), and (d) of Fig. 2 for an illustration.
80
+
81
+ In this experiment we aim to reconstruct x=(x1,x2)𝑥subscript𝑥1subscript𝑥2{x}=(x_{1},x_{2}), given xo=x2=0subscript𝑥𝑜subscript𝑥20x_{o}=x_{2}=0. Considering the generator has learned the synthetic data very well, the optimal solution for the reconstruction is x^=(1,0)^𝑥10\hat{{x}}=(1,0), where the reconstruction error should be 0. However, as discussed in reference to Fig. 1 earlier, we observe that energy barriers in the 𝒵𝒵{\cal Z}-space complicate optimization. Specifically, if we initialize optimization with a sample far from the optimum, it is hard to recover.While the strategy to pick the best initializer from a set of 5,00050005,000 points works reasonably well in the low-dimensional setting, it obviously breaks down quickly if the latent space dimension increases even moderately.
82
+
83
+ In contrast, our proposed AIS co-generation method only requires one initialization to achieve the desired result after 6,00060006,000 AIS loops, as shown in Fig. 2 (15000 (d)). Specifically, reconstruction with generators trained for a different number of epochs (500, 1.5k, 2.5k and 15k) are shown in the rows. The samples obtained from the generator for the data (blue points in column (a)) are illustrated in column (a) using black color. Using the respective generator to solve the program given in Eq. (1) via GD yields results highlighted with yellow color in column (b). The empirical reconstruction error frequency for this baseline is given in column (c). The results and the reconstruction error frequency obtained with Alg. 1 are shown in columns (d, e). We observe significantly better results and robustness to initialization.
84
+
85
+ In Fig. 3 we show for 100 samples that Alg. 1 moves them across the energy barriers during the annealing procedure, illustrating the benefits of AIS based HMC over GD.
86
+
87
+ To validate our method on real data, we evaluate on three datasets, using MSE and MSSIM metrics. For all three experiments, we use the progressive GAN architecture [34] and evaluate baselines and AIS on progressive GAN training data.
88
+
89
+ CelebA:For CelebA, the size of the input and the output are 512 and 128×128128128128\times 128 respectively. We generate corrupted images by randomly masking blocks of width and height ranging from 30 to 60. Then we use Alg. 1 for reconstruction with 500 HMC loops.
90
+
91
+ In Fig. 4 (a,b), we observe that Alg. 1 outperforms both baselines for all GAN training iterations on both MSSIM and MSE metrics. The difference increases for better trained generators. In Fig. 5, we show some results generated by both baselines and Alg. 1. Compared to baselines, Alg. 1 results are more similar to the ground truth and more robust to different mask locations. Note that Alg. 1 only uses one initialization, which demonstrates its robustness to initialization.
92
+
93
+ LSUN: The output size is 256×\times256. We mask images with blocks of width and height between 50 to 80. The complex distribution and intricate details of LSUN challenge the reconstruction. Here, we sample 5 initializations in our Alg. 1 (line 2). We use 500 HMC loops for each initialization independently. For each image, we pick the best score among five and show the average in Fig. 4 (c,d). We observe that Alg. 1 with 5 initializations easily outperforms GD with 5,000 initializations. We also show reconstructions in Fig. 6.
94
+
95
+ CelebA-HQBesides recovering masked images, we also demo co-generation on single image super-resolution (SISR). In this task, the ground truth is a high-resolution image x𝑥x (1024×1024102410241024\times 1024) and the exposure information xesubscript𝑥𝑒x_{e} is a low-resolution image (128×128128128128\times 128). Here, we use the Progressive CelebA-HQ GAN as the generator. After obtaining the generated high-resolution image, we downsample it to 128×128128128128\times 128 via pooling and aim to reduce the squared error between it and the final result. We use 3 z𝑧z samples for the SISR task. We show MSSIM and MSE between the ground truth (1024×1024102410241024\times 1024) and the final output on Fig. 4 (e, f). Fig. 7 compares the outputs of baselines to those of Alg. 1.
96
+
97
+ We propose a co-generation approach, i.e., we complete partially given input data, using annealed importance sampling (AIS) based on the Hamiltonian Monte Carlo (HMC) method. Different from the classical optimization based methods, specifically GD, which get easily trapped in local optima when solving this task, the proposed approach is much more robust. Importantly, the method can traverse large energy barriers that occur when training generative adversarial nets. Its robustness is due to AIS gradually annealing a probability distribution and HMC avoiding localized walks.
98
+
99
+ Acknowledgments:This work is supported in part by NSF under Grant No. 1718221 and MRI #1725729, UIUC, Samsung, 3M, Cisco Systems Inc. (Gift Award CG 1377144) and Adobe. We thank NVIDIA for providing GPUs used for this work and Cisco for access to the Arcetri cluster.
100
+
101
+ Sampling from a multi-modal distribution is challenging. Particularly if the modes are well separated it is important to adequately explore the domain in order not to get stuck in a single mode. To observe this we study the ability to sample from a multi-modal distribution on our synthetic data. We use observation xo=x1=−1subscript𝑥𝑜subscript𝑥11x_{o}=x_{1}=-1 which retains an ambiguous x2=0.5subscript𝑥20.5x_{2}=0.5 or x2=−0.5subscript𝑥20.5x_{2}=-0.5. For this experiment, we use the same 15k-th iteration generative model as employed in Fig. 2. Results for GD are shown in Fig. 8 (b,c) while AIS results are provided in Fig. 8 (d, e). We observe GD gets stuck in bad modes. In contrast, AIS finds the optimal modes.
102
+
103
+ Following Fig. 1, Fig. 2 and Fig. 3 in the main paper, we compare the performances of baselines and our proposed AIS based HMC algorithm on WGAN-GP. The results illustrate the robustness of our algorithm on a variety of GAN losses and advantages over the baselines.
104
+
105
+ The optimal solution of this experiment is (x1,x2)=(1,0)subscript𝑥1subscript𝑥210(x_{1},x_{2})=(1,0). Fig. 9 shows energy barriers which challenge optimization w.r.t. z𝑧z particularly for well trained generators. Fig. 10 shows that baselines get stuck in a local optimum easily. In contrast, the reconstructions obtained by our proposed algorithm overcome the energy barriers and find good solutions within 4,000 AIS loops. We observe that the reconstruction accuracy (Fig. 10 (d, e)) increases with generator model improvements. Fig. 11 shows how 100 z𝑧z samples move in 𝒵𝒵{\cal Z}-space and cross the barriers during the AIS procedure.
106
+
107
+ We show additional results for real data experiments. We observe our proposed algorithm to recover masked images more accurately than baselines and to generate better high-resolution images given low-resolution images.
108
+
109
+ We show masked CelebA (Fig. 13) and LSUN (Fig. 14) recovery results for baselines and our method, given a Progressive GAN generator. Note that our algorithm is pretty robust to the position of the z𝑧z initialization, since the generated results are consistent in Fig. 13. In Fig. 15, we compare our results with baselines on generating a 1024×1024102410241024\times 1024 high-resolution image from a given 128×128128128128\times 128 low-resolution image.
110
+
111
+ We also run both baselines and AIS on LSUN test data. The result is shown in Fig. 12. However, for both CelebA and CelebA-HQ, Progressive GANs are trained on the whole dataset, we are unable to do the experiments on these two datasets.
1911.00055v1.txt ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Knowledge bases store structured information about real-world people, locations, companies and governments, etc. Knowledge base construction has attracted the attention of researchers, foundations, industry, and governments [11, 13, 39, 43]. Nevertheless, even the largest knowledge bases remain incomplete due to the limitations of human knowledge, web corpora, and extraction algorithms.
2
+
3
+ Numerous projects have been developed to shorten the gap between KBs and human knowledge. A popular approach is to use the existing elements in the knowledge graph to infer the existence of new ones. There are two prominent directions in this line of research: representation learning that obtains distributed vectors for all entities and relations in the knowledge graph [12, 36, 38], and rule mining that uses observed co-occurrences of frequent patterns in the knowledge graph to determine logical rules [5, 15]. An example of knowledge graph completion with logical rules is shown in Figure 1.
4
+
5
+ One of the main advantages of logic-learning based methods for link prediction is that they can be applied to both transductive and inductive problems while representation learning methods like that of Bordes et al. [4], Sadeghian et al. [35] and Yang et al. [45] cannot be employed in inductive scenarios. Consider the scenario in Figure 1, and suppose that at training time our knowledge base does not contain information about Obama’s family. Representation learning techniques need to be retrained on the whole knowledge base in order to find the answer. In contrast rule mining methods can transfer reasoning to unseen facts.
6
+
7
+ Additionally, learning logical rules provides us with interpretable reasoning for predictions which is not the case for the embedding based method. This interpretability can keep humans in the loop, facilitate debugging, and increase user trustworthiness. More importantly, rules allow domain knowledge transfer by enabling the addition of extra rules by experts, a strong advantage over representation learning models in scenarios with little or low-quality data.
8
+
9
+ Mining rules have traditionally relied on pre-defined statistical measures such as support and confidence to assess the quality of rules. These are fixed heuristic measures, and are not optimal for various use cases in which one might want to use the rules. For example, using standard confidence is not necessarily optimal for statistical relational learning. Therefore, finding a method that is able to simultaneously learn rule structures as well as appropriate scores is crucial. However, this is a challenging task because the method needs to find an optimal structure in a large discrete space and simultaneously learn proper score values in a continuous space. Most previous approaches address parts of this problem [9, 24, 26, 44] but are not able to learn both structure and scores together, with the exception of Yang et al. [46].
10
+
11
+ In this paper we propose DRUM, a fully differentiable model to learn logical rules and their related confidence scores. DRUM has significant importance because it not only addresses the aforementioned challenges, but also allows gradient based optimization to be employed for inductive logic programming tasks.
12
+
13
+ Our contributions can be summarized as: 1) An end-to-end differentiable rule mining model that is able to learn rule structures and scores simultaneously; 2) We provide a connection between tensor completion and the estimation of confidence scores; 3) We theoretically show that our formulation is expressive enough at finding the rule structures and their related confidences;4) Finally, we demonstrate that our method outperforms previous models on benchmark knowledge bases, both on the link prediction task and in terms of rule quality.
14
+
15
+ Definitions  We model a knowledge graph as a collection of facts G={(s,r,o)|s,o∈ℰ,r∈ℛ}𝐺conditional-set𝑠𝑟𝑜formulae-sequence𝑠𝑜ℰ𝑟ℛG=\{(s,r,o)|s,o\in\mathcal{E},r\in\mathcal{R}\}, where ℰℰ\mathcal{E} and ℛℛ\mathcal{R} represent the set of entities and relations in the knowledge graph, respectively.
16
+
17
+ A first order logical rule is of the form B⟹H⟹B𝐻\textbf{B}\Longrightarrow H, where B=⋀iBi​(⋅,⋅)Bsubscript𝑖subscript𝐵𝑖⋅⋅\textbf{B}=\bigwedge_{i}B_{i}(\cdot\,\mathpunct{\raisebox{2.15277pt}{,}}\cdot) is a conjunction of atoms Bisubscript𝐵𝑖B_{i}, e.g., l​i​v​e​s​I​n​(⋅,⋅)𝑙𝑖𝑣𝑒𝑠𝐼𝑛⋅⋅livesIn(\cdot\,\mathpunct{\raisebox{2.15277pt}{,}}\cdot), called the Body, and H𝐻H is a specific predicate called the head. A rule is connected if every atom in the rule shares at least one variable with another atom, and a rule is closed if each variable in the rule appears in at least two atoms.
18
+
19
+ Rule Mining  We address the problem of learning first-order logical Horn clauses from a knowledge graph. In particular we are interested in mining closed and connected rules. These assumptions ensure finding meaningful rules that are human understandable. Connectedness also prevents finding rules with unrelated relations.
20
+
21
+ Formally, we aim to find all T∈ℕ𝑇ℕT\in\mathbb{N} and relations B1,B2,⋯,BT,Hsubscript𝐵1subscript𝐵2⋯subscript𝐵𝑇𝐻B_{1},B_{2},\cdots,B_{T},H as well as a confidence value α∈ℝ𝛼ℝ\alpha\in\mathbb{R}, where:
22
+
23
+ B1​(x,z1)∧B2​(z1,z2)∧⋯∧BT​(zT−1,y)⟹H​(x,y):α,:subscript𝐵1𝑥subscript𝑧1subscript𝐵2subscript𝑧1subscript𝑧2⋯subscript𝐵𝑇subscript𝑧𝑇1𝑦𝐻𝑥𝑦𝛼B_{1}(x,z_{1})\land B_{2}(z_{1},z_{2})\land\cdots\land B_{{}_{T}}(z_{{}_{T-1}},y)\implies H(x,y)\,\,:\alpha,(1)
24
+
25
+ where, zisubscript𝑧𝑖z_{i}s are variables that can be substituted with entities. This requires searching a discrete space to find Bisubscript𝐵𝑖B_{i}s and searching a continuous space to learn α𝛼\alpha for every particular rule.
26
+
27
+ Mining Horn clauses has been previously studied in the Inductive Logic Programming (ILP) field, e.g, FOIL [33], MDIE [30] and Inspire [37]. Given a background knowledge base, ILP provides a framework for learning on multi-relational data. However, despite the strong representation powers of ILP, it requires both positive and negative examples and does not scale to large datasets. This is a huge drawback since most knowledge bases are large and contain only positive facts.
28
+
29
+ Recent rule mining methods such as AMIE+ [15] and Ontological Pathfinding (OP) [5] use predefined metrics such as confidence and support and take advantage of various parallelization and partitioning techniques to speed up the counting process. However, they still suffer from the inherent limitations of relying on predefined confidence and discrete counting.
30
+
31
+ Most recent knowledge base rule mining approaches fall under the same category as ILP and OP. However, Yang et al. [45] show that one can also use graph embeddings to mine rules. They introduce DistMult, a simple bilinear model for learning entity and relation representations. The relation representations learned via the bilinear model can capture compositional relational semantics via matrix multiplications. For example, if the rule B1​(x,y)∧B2​(y,z)⟹H​(x,z)subscript𝐵1𝑥𝑦subscript𝐵2𝑦𝑧𝐻𝑥𝑧B_{1}(x,y)\land B_{2}(y,z)\implies H(x,z) holds, then intuitively so should 𝐀B1​𝐀B2≈𝐀Hsubscript𝐀subscript𝐵1subscript𝐀subscript𝐵2subscript𝐀𝐻\mathbf{A}_{B_{1}}\mathbf{A}_{B_{2}}\approx\mathbf{A}_{H}. To mine rules, they use the Frobenius norm to search for all possible pairs of relations with respect to their compositional relevance to each head. In a more recent approach Omran et al. [32] improve this method by leveraging pruning techniques and computing traditional metrics to scale it up to larger knowledge bases.
32
+
33
+ In [17] the authors proposed a RESCAL-based model to learn from paths in KGs. More recently, Yang et al. [46] provide the first fully differentiable rule mining method based on TensorLog [6], Neural LP. They estimate the graph structure via constructing TensorLog operators per relation using a portion of the knowledge graph. Similar to us, they chain these operators to compute a score for each triplet, and learn rules by maximizing this score. As we explain in Section 4.1, this formulation is bounded to a fixed length of rules. To overcome this limitation, Neural LP uses an LSTM and attention mechanisms to learn variable rule lengths. However, it can be implied from Theorem 1 that its formulation has theoretical limitations on the rules it can produce.
34
+
35
+ There are some other interesting works [7, 14, 29, 34] which learn rules in a differentiable manner. However, they need to learn embeddings for each entity in the graph and they do link prediction not only based on the learned rules but also the embeddings. Therefore we exclude them from our experiment section.
36
+
37
+ We did not cover embedding based methods on graphs or knowledge graphs here, we refer the reader to some of the recent works [18, 19, 21, 16]
38
+
39
+ To provide intuition about each part of our algorithm we start with a vanilla solution to the problem. We then explain the drawbacks of the this approach and modify the suggested method step-by-step to makes the challenges of the problem more clear and provides insight into different parts of the suggested algorithm.
40
+
41
+ We begin by defining a one-to-one correspondence between the elements of ℰℰ\mathcal{E} and {𝐯1,…,𝐯n}subscript𝐯1…subscript𝐯𝑛\{\mathbf{v}_{1},...,\mathbf{v}_{n}\}, where n𝑛n is the number of entities and 𝐯i∈{0,1}nsubscript𝐯𝑖superscript01𝑛\mathbf{v}_{i}\in\{0,1\}^{n} is a vector with 111 at position i𝑖i and 00 otherwise. We also define 𝐀Brsubscript𝐀subscript𝐵𝑟\mathbf{A}_{B_{r}} as the adjacency matrix of the knowledge base with respect to relation Brsubscript𝐵𝑟B_{r}; the (i,j)thsuperscript𝑖𝑗th(i,j)^{\text{th}} elements of 𝐀Brsubscript𝐀subscript𝐵𝑟\mathbf{A}_{B_{r}} equals to 111 when the entities corresponding to 𝐯isubscript𝐯𝑖\mathbf{v}_{i} and 𝐯jsubscript𝐯𝑗\mathbf{v}_{j} have relation Brsubscript𝐵𝑟B_{r}, and 00 otherwise.
42
+
43
+ To approach this inherently discrete problem in a differentiable manner, we utilize the fact that using the above notations for a pair of entities (x,y)𝑥𝑦(x,y) the existence of a chain of atoms such asB1​(x,z1)∧B2​(z1,z2)∧⋯∧BT​(zT−1,y)subscript𝐵1𝑥subscript𝑧1subscript𝐵2subscript𝑧1subscript𝑧2⋯subscript𝐵𝑇subscript𝑧𝑇1𝑦B_{1}(x,z_{1})\land B_{2}(z_{1},z_{2})\land\cdots\land B_{{}_{T}}(z_{{}_{T-1}},y)(2)
44
+
45
+ is equivalent to 𝐯xT⋅𝐀B1⋅𝐀B2​⋯​𝐀BT⋅𝐯y⋅⋅superscriptsubscript𝐯𝑥𝑇subscript𝐀subscript𝐵1subscript𝐀subscript𝐵2⋯subscript𝐀subscript𝐵𝑇subscript𝐯𝑦\mathbf{v}_{x}^{T}\cdot\mathbf{A}_{B_{1}}\cdot\mathbf{A}_{B_{2}}\cdots\mathbf{A}_{B_{{}_{T}}}\cdot\mathbf{v}_{y} being a positive scalar.
46
+
47
+ This scalar is equal to the number of paths of length T𝑇T connecting x𝑥x to y𝑦y which traverse relation Brisubscript𝐵subscript𝑟𝑖B_{r_{i}} at step i𝑖i. It is straightforward to show that for each head relation H𝐻H, one can learn logical rules by finding an appropriate 𝜶𝜶\bm{\alpha} inωH​(𝜶)≐∑sαs​∏k∈ps𝐀Bkapproaches-limitsubscript𝜔𝐻𝜶subscript𝑠subscript𝛼𝑠subscriptproduct𝑘subscript𝑝𝑠subscript𝐀subscript𝐵𝑘\omega_{{}_{H}}(\bm{\alpha})\doteq\sum_{s}\alpha_{s}\prod_{k\in p_{s}}\mathbf{A}_{B_{k}}(3)that maximizesOH​(𝜶)≐∑(x,H,y)∈K​G𝐯xT​ωH​(𝜶)​𝐯y,approaches-limitsubscript𝑂𝐻𝜶subscript𝑥𝐻𝑦𝐾𝐺superscriptsubscript𝐯𝑥𝑇subscript𝜔𝐻𝜶subscript𝐯𝑦O_{{}_{H}}(\bm{\alpha})\doteq\sum_{(x,H,y)\in KG}\mathbf{v}_{x}^{T}\omega_{{}_{H}}(\bm{\alpha})\mathbf{v}_{y},(4)where s𝑠s indexes over all potential rules with maximum length of T𝑇T, and pssubscript𝑝𝑠p_{s} is the ordered list of relations related to the rule indexed by s𝑠s.
48
+
49
+ However, since the number of learnable parameters in OH​(𝜶)subscript𝑂𝐻𝜶O_{{}_{H}}(\bm{\alpha}) can be exceedingly large, i.e. 𝒪​(|ℛ|T)𝒪superscriptℛ𝑇\mathcal{O}(|\mathcal{R}|^{T}), and the number of observed pairs (x,y)𝑥𝑦(x,y) which satisfy the head H𝐻H are usually small, direct optimization of OH​(𝜶)subscript𝑂𝐻𝜶O_{{}_{H}}(\bm{\alpha}) falls in the regime of over-parameterization and cannot provide useful results. To reduce the number of parameters one can rewrite ωH​(𝜶)subscript𝜔𝐻𝜶\omega_{{}_{H}}(\bm{\alpha}) asΩH​(𝐚)≐∏i=1T∑k=1|ℛ|ai,k​𝐀Bk.approaches-limitsubscriptΩ𝐻𝐚superscriptsubscriptproduct𝑖1𝑇superscriptsubscript𝑘1ℛsubscript𝑎𝑖𝑘subscript𝐀subscript𝐵𝑘\Omega_{{}_{H}}(\mathbf{a})\doteq\prod_{i=1}^{T}\sum_{k=1}^{|\mathcal{R}|}a_{i,k}\mathbf{A}_{B_{k}}.(5)This reformulation significantly reduces the number of parameters to T​ℛ𝑇ℛT\mathcal{R}.However, the new formulation can only learn rules with fixed length T𝑇T. To overcome this problem, we propose to modify ΩH​(𝐚)subscriptΩ𝐻𝐚\Omega_{{}_{H}}(\mathbf{a}) toΩHI​(𝐚)≐∏i=1T(∑k=0|ℛ|ai,k​𝐀Bk),approaches-limitsubscriptsuperscriptΩ𝐼𝐻𝐚superscriptsubscriptproduct𝑖1𝑇superscriptsubscript𝑘0ℛsubscript𝑎𝑖𝑘subscript𝐀subscript𝐵𝑘\Omega^{I}_{{}_{H}}(\mathbf{a})\doteq\prod_{i=1}^{T}(\sum_{k=0}^{|\mathcal{R}|}a_{i,k}\mathbf{A}_{B_{k}}),(6)wherewe define a new relation B0subscript𝐵0B_{0} with an identity adjacency matrix AB0=Insubscript𝐴subscript𝐵0subscript𝐼𝑛A_{B_{0}}=I_{n}. With this change, the expansion of ΩHIsubscriptsuperscriptΩ𝐼𝐻\Omega^{I}_{{}_{H}} includes all possible rule templates of length T𝑇T or smaller with only T​(|ℛ|+1)𝑇ℛ1T(|\mathcal{R}|+1) free parameters.
50
+
51
+ Although ΩHIsubscriptsuperscriptΩ𝐼𝐻\Omega^{I}_{{}_{H}} considers all possible rules lengths, it is still constrained in learning the correct rule confidences. As we will show in the experiments Section 5.3, this formulation (as well as Neural LP [46]) inevitably mines incorrect rules with high confidences. The following theorem provides insight about the restricted expressive power of the rules obtained by ΩHIsubscriptsuperscriptΩ𝐼𝐻\Omega^{I}_{{}_{H}}.
52
+
53
+ The proof is provided in the appendix.∎
54
+
55
+ To further explain Theorem 1, consider an example knowledge base with only two meaningful logical rules of body length T=3𝑇3T=3, i.e. Ro​ and ​Rssubscript𝑅𝑜 and subscript𝑅𝑠R_{o}\text{ and }R_{s} such that they do not share any body atoms. According to Theorem 1, learning these two rules by optimizing OHI​(𝐚)subscriptsuperscript𝑂𝐼𝐻𝐚O^{I}_{{}_{H}}(\mathbf{a}) leads to learning at least ℓ≥2ℓ2\ell\geq 2 other rules, since d​(Ro,Rs)=3𝑑subscript𝑅𝑜subscript𝑅𝑠3d(R_{o},R_{s})=3, with confidence values greater than min⁡(αo,αs)subscript𝛼𝑜subscript𝛼𝑠\min(\alpha_{o},\alpha_{s}). This means we inevitably learn at least 222 additional incorrect rules with substantial confidence values.
56
+
57
+ Theorem 1 also entails other undesirable issues, for example the resulting list of rules may not have the correct order of importance. More specifically, a rule might have higher confidence value just because it is sharing an atom with another high confidence rule. Thus confidence values are not a direct indicator of rule importance. This reduces the interpretability of the output rules.
58
+
59
+ We must note that all previous differentiable rule mining methods based on ΩH​(𝐚)subscriptΩ𝐻𝐚\Omega_{{}_{H}}(\mathbf{a}) suffer from this limitation. For example Yang et al. [46] has this limitation for rules with maximum length. Section 5.3 illustrates these drawbacks using examples of mined rules.
60
+
61
+ Recall that the number of confidence values for rules of length T𝑇T or smaller is (|ℛ|+1)Tsuperscriptℛ1𝑇(|\mathcal{R}|+1)^{T}. These values can be viewed as entries of a T𝑇T dimensional tensor where the size of each axis is |ℛ|+1ℛ1|\mathcal{R}|+1. To be more specific, we put the confidence value of the rule with body Br1∧Br2∧⋯∧BrTsubscript𝐵subscript𝑟1subscript𝐵subscript𝑟2⋯subscript𝐵subscript𝑟𝑇B_{r_{1}}\land B_{r_{2}}\land\cdots\land B_{r_{T}} at position (r1,r2,…,rT)subscript𝑟1subscript𝑟2…subscript𝑟𝑇(r_{1},r_{2},\dots,r_{T}) in the tensor and we call it the confidence value tensor.
62
+
63
+ It can be shown that the final confidences obtained by expanding ΩHI​(𝐚)subscriptsuperscriptΩ𝐼𝐻𝐚\Omega^{I}_{{}_{H}}(\mathbf{a}) are a rank one estimation of the confidence value tensor. This interpretation makes the limitation of ΩHI​(𝐚)subscriptsuperscriptΩ𝐼𝐻𝐚\Omega^{I}_{{}_{H}}(\mathbf{a}) more clear and provides a natural connection to the tensor estimation literature. Since a low-rank approximation (not just rank one) is a popular method for tensor approximation, we use it to generalize ΩHI​(𝐚)subscriptsuperscriptΩ𝐼𝐻𝐚\Omega^{I}_{{}_{H}}(\mathbf{a}). The ΩΩ\Omega related to rank L𝐿L approximation can be formulated asΩHL​(𝐚,L)≐∑j=1L{∏i=1T∑k=0|ℛ|aj,i,k​𝐀Bk}.approaches-limitsubscriptsuperscriptΩ𝐿𝐻𝐚𝐿subscriptsuperscript𝐿𝑗1superscriptsubscriptproduct𝑖1𝑇superscriptsubscript𝑘0ℛsubscript𝑎𝑗𝑖𝑘subscript𝐀subscript𝐵𝑘\Omega^{L}_{{}_{H}}(\mathbf{a},L)\doteq\sum^{L}_{j=1}\{\prod_{i=1}^{T}\sum_{k=0}^{|\mathcal{R}|}a_{j,i,k}\mathbf{A}_{B_{k}}\}.(7)
64
+
65
+ In the following theorem, we show that ΩHL​(𝒂,L)subscriptsuperscriptΩ𝐿𝐻𝒂𝐿\Omega^{L}_{{}_{H}}(\bm{a},L) is powerful enough to learn any set of logical rules, without including unrelated ones.
66
+
67
+ To prove the theorem we will show that one can find a 𝐚∗superscript𝐚\mathbf{a^{*}} for L∗=rsuperscript𝐿𝑟L^{*}=r such that the requirements are met. Without loss of generality, assume Rjsubscript𝑅𝑗R_{j} (for some 1≤j≤r1𝑗𝑟1\leq j\leq r) is of length t0subscript𝑡0t_{0} and consists of body atoms Br1,Br2,⋯,Brt0subscript𝐵subscript𝑟1subscript𝐵subscript𝑟2⋯subscript𝐵subscript𝑟subscript𝑡0B_{r_{1}},B_{r_{2}},\cdots,B_{r_{t_{0}}}. By setting aj,i,k∗subscriptsuperscript𝑎𝑗𝑖𝑘a^{*}_{j,i,k}aj,i,k∗={αj​δr1​(k)if i=1δri​(k)if 1<i≤t0δ0​(k)if t0<isubscriptsuperscript𝑎𝑗𝑖𝑘casessubscript𝛼𝑗subscript𝛿subscript𝑟1𝑘if i=1subscript𝛿subscript𝑟𝑖𝑘if 1<i≤t0subscript𝛿0𝑘if t0<ia^{*}_{j,i,k}=\begin{cases}\alpha_{j}\delta_{r_{1}}\scriptstyle{(k)}&\text{if $i=1$}\\\delta_{r_{i}}\scriptstyle{(k)}&\text{if $1<i\leq t_{0}$}\\\delta_{0}\scriptstyle{(k)}&\text{if $t_{0}<i$}\end{cases}it is easy to show that 𝐚∗superscript𝐚\mathbf{a^{*}} satisfies the condition in Theorem 2. Let’s look at ΩHL​(𝐚∗,L∗)subscriptsuperscriptΩ𝐿𝐻superscript𝐚superscript𝐿\Omega^{L}_{{}_{H}}(\mathbf{a^{*}},L^{*}) for each j𝑗j:∏i=1T∑k=1|ℛ|aj,i,k∗​𝐀Bk=αj​𝐀Br1⋅𝐀Br2​⋯​𝐀Brt0⋅𝐈​⋯​𝐈=αj​Rj.superscriptsubscriptproduct𝑖1𝑇superscriptsubscript𝑘1ℛsubscriptsuperscript𝑎𝑗𝑖𝑘subscript𝐀subscript𝐵𝑘⋅⋅subscript𝛼𝑗subscript𝐀subscript𝐵subscript𝑟1subscript𝐀subscript𝐵subscript𝑟2⋯subscript𝐀subscript𝐵subscript𝑟subscript𝑡0𝐈⋯𝐈subscript𝛼𝑗subscript𝑅𝑗\prod_{i=1}^{T}\sum_{k=1}^{|\mathcal{R}|}a^{*}_{j,i,k}\mathbf{A}_{B_{k}}=\alpha_{j}\mathbf{A}_{B_{r_{1}}}\cdot\mathbf{A}_{B_{r_{2}}}\cdots\mathbf{A}_{B_{r_{t_{0}}}}\cdot\mathbf{I}\cdots\mathbf{I}=\alpha_{j}R_{j}.Therefore ΩHL​(𝒂∗,L∗)=∑αj​RjsubscriptsuperscriptΩ𝐿𝐻superscript𝒂superscript𝐿subscript𝛼𝑗subscript𝑅𝑗\Omega^{L}_{{}_{H}}(\bm{a^{*}},L^{*})=\sum\alpha_{j}R_{j}.∎
68
+
69
+ Note the number of learnable parameters in ΩHLsubscriptsuperscriptΩ𝐿𝐻\Omega^{L}_{{}_{H}} is now L​T​(|ℛ|+1)𝐿𝑇ℛ1LT(|\mathcal{R}|+1). However, this is just the number of free parameters for finding the rules for a single head relation, learning the rules for all relations in knowledge graph requires estimating L​T​(|ℛ|+1)⋅|ℛ|⋅𝐿𝑇ℛ1ℛLT(|\mathcal{R}|+1)\cdot|\mathcal{R}| parameters, which is 𝒪​(|ℛ|2)𝒪superscriptℛ2\mathcal{O}(|\mathcal{R}|^{2}) and can be potentially large. Also, the main problem that we haven’t addressed yet, is that direct optimization of the objective related to ΩHLsubscriptsuperscriptΩ𝐿𝐻\Omega^{L}_{{}_{H}} learns parameters of rules for different head relations separately, therefore learning one rule can not help in learning others.
70
+
71
+ Before we explain how RNNs can solve this problem, we would like to draw your attention to the fact that some pairs of relations cannot be followed by each other, or have a very low probability of appearing together. Consider the family knowledge base, where the entities are people and the relations are familial ties like fatherOf, AuntOf, wifeOf, etc. If a node in the knowledge graph is fatherOf, it cannot be wife_of another node because it has to be male. Therefore the relation wife_of never follows the relation father_of. This kind of information can be useful in estimating logical rules for different head relations and can be shared among them.
72
+
73
+ To incorporate this observation in our model and to alleviate the mentioned problems, we use L𝐿L bidirectional RNNs to estimate aj,i,ksubscript𝑎𝑗𝑖𝑘a_{j,i,k} in equation 7:𝐡i(j),𝐡T−i+1′⁣(j)=𝐁𝐢𝐑𝐍𝐍j​(𝐞H,𝐡i−1(j),𝐡T−i′⁣(j)),subscriptsuperscript𝐡𝑗𝑖subscriptsuperscript𝐡′𝑗𝑇𝑖1subscript𝐁𝐢𝐑𝐍𝐍𝑗subscript𝐞𝐻subscriptsuperscript𝐡𝑗𝑖1subscriptsuperscript𝐡′𝑗𝑇𝑖\displaystyle\mkern 3.0mu\mathbf{h}^{(j)}_{i},\mkern 3.0mu\mathbf{h}^{\prime(j)}_{T-i+1}=\mathbf{BiRNN}_{j}(\mathbf{e}_{H},\mkern 3.0mu\mathbf{h}^{(j)}_{i-1},\mkern 3.0mu\mathbf{h}^{\prime(j)}_{T-i}),(8)[aj,i,1,⋯,aj,i,|ℛ|+1]=fθ​([𝐡i(j),𝐡T−i+1′(j)]),\displaystyle[a_{j,i,1},\cdots,\mkern 3.0mua_{j,i,|\mathcal{R}|+1}]=f_{\mathbf{\theta}}([\mkern 3.0mu\mathbf{h}^{(j)}_{i},\mkern 3.0mu\mathbf{h}^{\prime^{(j)}}_{T-i+1}]),(9)where 𝐡𝐡\mathbf{h} and 𝐡′superscript𝐡′\mathbf{h}^{\prime} are the hidden-states of the forward and backward path RNNs, respectively, both of which are zero initialized. The subindexes of the hidden states denote their time step, and their superindexes identify their bidirectional RNN. eHsubscript𝑒𝐻e_{H} is the embedding of the head relation H𝐻H for which we want to learn a probabilistic logic rule, and fθsubscript𝑓𝜃f_{\theta} is a fully connected neural network that generates the coefficients from the hidden states of the RNNs.
74
+
75
+ We use a bidirectional RNN instead of a normal RNN because it is capable of capturing information about both backward and forward order of which the atoms can appear in the rule. In addition, sharing the same set of recurrent networks for all head predicates (for all ΩHLsubscriptsuperscriptΩ𝐿𝐻\Omega^{L}_{H}) allows information to be shared from one head predicate to another.
76
+
77
+ In this section we evaluate DRUM on statistical relation learning and knowledge base completion. We also empirically assess the quality and interpretability of the learned rules.
78
+
79
+ We implement our method in TensorFlow [1] and train on Tesla K40 GPUs. We use ADAM [23] with learning rate and batch size of 0.001 and 64, respectively. We set both the hidden state dimension and head relation vector size to 128. We did gradient clipping for training the RNNs and used LSTMs [20] for both directions. fθsubscript𝑓𝜃f_{\theta} is a single layer fully connected. We followed the convention in the existing literature [46] of splitting the data into three categories of facts, train, and test. The code and the datasets for all the experiments will be publicly available.
80
+
81
+ Datasets: Our experiments were conducted on three different datasets [24]. The Unified Medical Language System (UMLS) consists of biomedical concepts such as drug and disease names and relations between them such as diagnosis and treatment. Kinship contains kinship relationships among members of a Central Australian native tribe. The Family data set contains the bloodline relationships between individuals of multiple families. Statistics about each data set are shown in Table 1.
82
+
83
+ We compared DRUM to its state of the art differentiable rule mining alternative, Neural LP [46]. To show the importance of having a rank greater than one in DRUM, we test two versions, DRUM-1 and DRUM-4, with L=1𝐿1L=1 and L=4𝐿4L=4 (rank 4), respectively.
84
+
85
+ To the best of our knowledge, NeuralLP and DRUM are the only scalable 111e.g., On the Kinship dataset DRUM takes 1.2 minutes to run vs +8 hours for NTP(-λ𝜆\lambda) [34] on the same machine. and differentiable methods that provide reasoning on KBs without the need to use embeddings of the entities at test time, and provide prediction solely based on the logical rules. Other methods like NTPs [29, 34] and MINERVA [8], rely on some type of learned embeddings at training and test time. Since rules are interpretable and embeddings are not, this puts our method and NeuralLP in fully-interpretable category while others do not have this advantage (therefore its not fair to directly compare them with each other). Moreover, methods that rely on embeddings (fully or partially) are prone to having worse results in inductive tasks, as partially shown in the experiment section. Nonetheless we show the results of the other methods in the appendix.
86
+
87
+ Table 2 shows link prediction results for each dataset in two scenarios with maximum rule length two and three. The results demonstrate that DRUM empirically outperforms Neural-LP in both cases T=2,3𝑇23T=2,3. Moreover it illustrates the importance of having a rank higher than one in estimating confidence values. We can see a more than seven percent improvement on some metrics for UMLS, and meaningful improvements in all other datasets. We believe DRUM’s performance over Neural LP is due to its high rank approximation of rule confidences and its use of bidirectional LSTM to capture forward and backward ordering criteria governing the body relations according to the ontology.
88
+
89
+ We evaluate our proposed model in inductive and transductive link prediction tasks on two widely used knowledge graphs WordNet [22, 28] and Freebase [3]. WordNet is a knowledge base constructed to produce an intuitively usable dictionary, and Freebase is a growing knowledge base of general facts. In the experiment we use WN18RR [10], a subset of WordNet, and FB15K-237 [41], which both are more challenging versions of WN18 and FB15K [4] respectively. The statistics of these knowledge bases are summarized in Table 3. We also present our results on WN18 [4] in the appendix.
90
+
91
+ For transductive link prediction we compare DRUM to several state-of-the-art models, including DistMult [45], ComplEx [42], Gaifman [31], TransE [4], ConvE[10], and most importantly Neural-LP. Since NTP(-λ𝜆\lambda) [34] are not scalable to WN18 or FB15K, we could not present results on larger datasets. Also dILP [14], unlike our method requires negative examples which is hard to obtain under Open World Assumption (OWA) of modern KGs and dILP is memory-expensive as authors admit, which cannot scale to the size of large KGs, thus we can not compare numerical results here.
92
+
93
+ In this experiment for DRUM we set the rank of the estimator L=3𝐿3L=3 for both datasets. The results are reported without any hyperparamter tuning. To train the model, we split the training file into facts and new training file with the ratio of three to one. Following the evaluation method in Bordes et al. [4], we use filtered ranking; table 4 summarizes our results.
94
+
95
+ The results clearly show DRUM empirically outperforms Neural-LP for all metrics on both datasets.DRUM also achieves state of the art Hit@1, Hit@3 as well as MRR on WN18RR among all methods (including the embedding based ones).
96
+
97
+ It is important to note that comparing DRUM with embedding based methods solely on accuracy is not a fair comparison, because unlike DRUM they are black-box models that do not provide interpretability. Also, as we will demonstrate next, embedding based methods are not capable of reasoning on previously unseen entities.
98
+
99
+ For the inductive link prediction experiment, the set of entities in the test and train file need to be disjoint. To force that condition, after randomly selecting a subset of test tuples to be the new test file, we omit any tuples from the training file with the entity in the new test file. Table  6 summarizes the inductive results for Hits@10.
100
+
101
+ It is reasonable to expect a significant drop in the performance of the embedding based methods in the inductive setup. The result of Table 6 clearly shows that fact for the TransE method. The table also demonstrates the superiority of DRUM to Neural LP in the inductive regime. Also for Hits@1 and Hits@3, the results of DRUM are about 1 percent better than NeuralLP and for the TransE all the values are very close to zero.
102
+
103
+ As stated in Section 1, an important advantage of rules as a reasoning mechanism is their comprehensibility by humans. To evaluate the quality and interpretability of rules mined by DRUM we perform two experiments. Throughout this section we use the family dataset for demonstration purposes as it is more tangible. Other datasets like umls yield similar results.
104
+
105
+ We use human annotation to quantitatively assess rule quality of DRUM and Neural LP. For each system and each head predicate, we ask two blind annotators222Two CS students. The annotators are not aware which system produced the rules. to examine each system’s sorted list of rules. The annotators were instructed to identify the first rule they perceive as erroneous. Table 6 depicts the number of correct rules before the system generates an erroneous rule.
106
+
107
+ The results of this experiment demonstrate that rules mined by DRUM appear to be better sorted and are perceived to be more accurate.
108
+
109
+ We also sort the rules generated by each system based on their assigned confidences and show the three top rules333A complete list of top 10 rules is available in the supplementary materials. in Table 7. Logically incorrect rules are highlighted by italic-red. This experiment shows two of the three top ranked rules generated by Neural LP are incorrect (for both head predicates w​i​f​e𝑤𝑖𝑓𝑒wife and s​o​n𝑠𝑜𝑛son).
110
+
111
+ These errors are inevitable because it can be shown that for rules of maximum length (T𝑇T), the estimator of Neural LP provides a rank one estimator for the confidence value tensor described in Section 4.2. Thus according to Theorem 1 the second highest confidence rule generated by Neural LP has to share a body atom with the first rule. For example the rule brother(B,A) →→\shortrightarrow son(B,A), even though incorrect, has a high confidence due to sharing the body atom brother with the highest confidence rule (first rule). Since DRUM does not have this limitation it can be seen that the same does not happen for rules mined by DRUM.
112
+
113
+ We present DRUM, a fully differentiable rule mining algorithm which can be used for inductive and interpretable link prediction. We provide intuition about each part of the algorithm and demonstrate its empirical success for a variety of tasks and benchmark datasets.
114
+
115
+ DRUM’s objective function is based on the Open World Assumption of KBs and is trained using only positive examples. As a possible future work we would like to modify DRUM to take advantage of negative sampling. Negative sampling has shown empirical success in representation learning methods and it may also be useful here. Another direction for future work would be to investigate an adequate way of combining differential rule mining with representation learning techniques.
1911.00069v1.txt ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Relation extraction (RE) is an important information extraction task that seeks to detect and classify semantic relationshipsbetween entities like persons, organizations, geo-political entities, locations, and events. It provides useful information for many NLP applications such as knowledge base construction, text mining and question answering. For example, the entity Washington, D.C. and the entity United States have a CapitalOf relationship, and extraction of such relationships can help answer questions like “What is the capital city of the United States?”
2
+
3
+ Traditional RE models (e.g., Zelenko et al. (2003); Kambhatla (2004); Li and Ji (2014)) require careful feature engineering to derive and combine various lexical, syntactic and semantic features. Recently, neural network RE models (e.g., Zeng et al. (2014); dos Santos et al. (2015); Miwa and Bansal (2016); Nguyen and Grishman (2016)) have become very successful. These models employ a certain level of automatic feature learning by usingword embeddings, which significantly simplifies the feature engineering task while considerably improving the accuracy, achieving the state-of-the-art performance for relation extraction.
4
+
5
+ All the above RE models are supervised machine learning models that need to be trained with large amounts of manually annotated RE data to achieve high accuracy. However, annotating RE data by human is expensive and time-consuming, and can be quite difficult for a newlanguage. Moreover, most RE models require language-specific resources such as dependency parsers and part-of-speech (POS) taggers,which also makes it very challenging to transfer an RE model of a resource-rich language to a resource-poor language.
6
+
7
+ There are a few existing weakly supervised cross-lingual RE approaches that require no human annotation in the target languages, e.g.,Kim et al. (2010); Kim and Lee (2012); Faruqui and Kumar (2015); Zou et al. (2018). However, the existing approaches require aligned parallel corpora or machine translation systems,which may not be readily available in practice.
8
+
9
+ In this paper, we make the following contributions to cross-lingual RE:•We propose a new approach for direct cross-lingual RE model transfer based on bilingual word embedding mapping. It projects word embeddings from a target language to a source language (e.g., English), so that a well-trainedsource-language RE model can be directly applied to the target language, with no manually annotated RE data needed for the target language.•We design a deep neural network architecture for the source-language (English) RE model that uses word embeddings and genericlanguage-independent features as the input. The English RE model achieves the-state-of-the-art performance without usinglanguage-specific resources.•We conduct extensive experiments which show that the proposed approach achieves very good performance (up to 79%percent7979\% of the accuracy of the supervised target-language RE model) for a number of target languages on both in-house and the ACE05 datasets Walker et al. (2006),using a small bilingual dictionary with only 1K word pairs. To the best of our knowledge, this is the first work that includes empirical studies for cross-lingual RE on several languages across a variety of language families, without using aligned parallel corpora or machine translation systems.
10
+
11
+ We organize the paper as follows. In Section 2 we provide an overview of our approach. In Section 3 we describe how to build monolingualword embeddings and learn a linear mapping between two languages. In Section 4 we present a neural network architecture for thesource-language (English). In Section 5 we evaluate the performance of the proposed approach for a number of target languages. Wediscuss related work in Section 6 and conclude the paper in Section 7.
12
+
13
+ We summarize the main steps of our neural cross-lingual RE model transfer approach as follows.
14
+
15
+ 1.Build word embeddings for the source language and the target language separately using monolingual data.2.Learn a linear mapping that projects the target-language word embeddings into the source-language embedding space usinga small bilingual dictionary.3.Build a neural network source-language RE model that uses word embeddings and generic language-independent features as theinput.4.For a target-language sentence and any two entities in it, project the word embeddings of the words in the sentence to thesource-language word embeddings using the linear mapping, and then apply the source-language RE model on the projected word embeddingsto classify the relationship between the two entities. An example is shown in Figure 1, where the targetlanguage is Portuguese and the source language is English.
16
+
17
+ We will describe each component of our approach in the subsequent sections.
18
+
19
+ In recent years, vector representations of words, known as word embeddings, become ubiquitous for many NLP applicationsCollobert et al. (2011); Mikolov et al. (2013a); Pennington et al. (2014).
20
+
21
+ A monolingual word embedding model maps words in the vocabulary 𝒱𝒱\mathcal{V} of a language to real-valued vectors inℝd×1superscriptℝ𝑑1\mathbb{R}^{d\times 1}. The dimension of the vector space d𝑑d is normally much smaller than the size of the vocabularyV=|𝒱|𝑉𝒱V=|\mathcal{V}| for efficient representation. It also aims to capture semantic similarities between the words based on theirdistributional properties in large samples of monolingual data.
22
+
23
+ Cross-lingual word embedding models try to build word embeddings across multiple languages Upadhyay et al. (2016); Ruder et al. (2017). One approach builds monolingual word embeddings separately and then maps them to the same vector space using a bilingual dictionary Mikolov et al. (2013b); Faruqui and Dyer (2014). Another approach builds multilingual word embeddings in a shared vector space simultaneously, bygenerating mixed language corpora using aligned sentences Luong et al. (2015); Gouws et al. (2015).
24
+
25
+ In this paper, we adopt the technique in Mikolov et al. (2013b) because it only requires a small bilingual dictionary of aligned wordpairs, and does not require parallel corpora of aligned sentences which could be more difficult to obtain.
26
+
27
+ To build monolingual word embeddings for the source and target languages, we use a variant of the Continuous Bag-of-Words (CBOW)word2vec model Mikolov et al. (2013a).
28
+
29
+ The standard CBOW model has two matrices, the input word matrix 𝐗~∈ℝd×V~𝐗superscriptℝ𝑑𝑉\tilde{\mathbf{X}}\in\mathbb{R}^{d\times V} and the output word matrix 𝐗∈ℝd×V𝐗superscriptℝ𝑑𝑉\mathbf{X}\in\mathbb{R}^{d\times V}. For the i𝑖ith word wisubscript𝑤𝑖w_{i} in 𝒱𝒱\mathcal{V},let 𝐞​(wi)∈ℝV×1𝐞subscript𝑤𝑖superscriptℝ𝑉1\mathbf{e}(w_{i})\in\mathbb{R}^{V\times 1} be a one-hot vector with 1 at index i𝑖i and 0s at other indexes, so that 𝐱~i=𝐗~​𝐞​(wi)subscript~𝐱𝑖~𝐗𝐞subscript𝑤𝑖\tilde{\mathbf{x}}_{i}=\tilde{\mathbf{X}}\mathbf{e}(w_{i}) (the i𝑖ith column of 𝐗~~𝐗\tilde{\mathbf{X}}) is the input vector representation of word wisubscript𝑤𝑖w_{i},and 𝐱i=𝐗𝐞​(wi)subscript𝐱𝑖𝐗𝐞subscript𝑤𝑖\mathbf{x}_{i}=\mathbf{X}\mathbf{e}(w_{i}) (the i𝑖ith column of 𝐗𝐗\mathbf{X}) is the output vector representation (i.e., word embedding) of word wisubscript𝑤𝑖w_{i}.
30
+
31
+ Given a sequence of training words w1,w2,…,wNsubscript𝑤1subscript𝑤2…subscript𝑤𝑁w_{1},w_{2},...,w_{N}, the CBOW model seeks to predict a target word wtsubscript𝑤𝑡w_{t} using a window of 2​c2𝑐2c context words surrounding wtsubscript𝑤𝑡w_{t}, by maximizing the following objective function:ℒ=1N​∑t=1Nlog⁡P​(wt|wt−c,…,wt−1,wt+1,…,wt+c)ℒ1𝑁superscriptsubscript𝑡1𝑁𝑃conditionalsubscript𝑤𝑡subscript𝑤𝑡𝑐…subscript𝑤𝑡1subscript𝑤𝑡1…subscript𝑤𝑡𝑐\displaystyle\mathcal{L}=\frac{1}{N}\sum_{t=1}^{N}\log P(w_{t}|w_{t-c},...,w_{t-1},w_{t+1},...,w_{t+c})The conditional probability is calculated using a softmax function:P​(wt|wt−c,…,wt+c)=exp⁡(𝐱tT​𝐱~c​(t))∑i=1Vexp⁡(𝐱iT​𝐱~c​(t))𝑃conditionalsubscript𝑤𝑡subscript𝑤𝑡𝑐…subscript𝑤𝑡𝑐superscriptsubscript𝐱𝑡Tsubscript~𝐱𝑐𝑡superscriptsubscript𝑖1𝑉superscriptsubscript𝐱𝑖Tsubscript~𝐱𝑐𝑡\displaystyle P(w_{t}|w_{t-c},...,w_{t+c})=\frac{\exp(\mathbf{x}_{t}^{\mathrm{T}}\tilde{\mathbf{x}}_{c(t)})}{\sum_{i=1}^{V}\exp(\mathbf{x}_{i}^{\mathrm{T}}\tilde{\mathbf{x}}_{c(t)})}(1)where 𝐱t=𝐗𝐞​(wt)subscript𝐱𝑡𝐗𝐞subscript𝑤𝑡\mathbf{x}_{t}=\mathbf{X}\mathbf{e}(w_{t}) is the output vector representation of word wtsubscript𝑤𝑡w_{t}, and𝐱~c​(t)=∑−c≤j≤c,j≠0𝐗~​𝐞​(wt+j)subscript~𝐱𝑐𝑡subscriptformulae-sequence𝑐𝑗𝑐𝑗0~𝐗𝐞subscript𝑤𝑡𝑗\displaystyle\tilde{\mathbf{x}}_{c(t)}=\sum_{-c\leq j\leq c,j\neq 0}\tilde{\mathbf{X}}\mathbf{e}(w_{t+j})(2)is the sum of the input vector representations of the context words.
32
+
33
+ In our variant of the CBOW model, we use a separate input word matrix 𝐗~jsubscript~𝐗𝑗\tilde{\mathbf{X}}_{j} for a context word at position j,−c≤j≤c,j≠0formulae-sequence𝑗𝑐𝑗𝑐𝑗0j,-c\leq j\leq c,j\neq 0. In addition, we employ weights that decay with the distances of the context words to thetarget word. Under these modifications, we have𝐱~c​(t)n​e​w=∑−c≤j≤c,j≠01|j|​𝐗~j​𝐞​(wt+j)superscriptsubscript~𝐱𝑐𝑡𝑛𝑒𝑤subscriptformulae-sequence𝑐𝑗𝑐𝑗01𝑗subscript~𝐗𝑗𝐞subscript𝑤𝑡𝑗\tilde{\mathbf{x}}_{c(t)}^{new}=\sum_{-c\leq j\leq c,j\neq 0}\frac{1}{|j|}\tilde{\mathbf{X}}_{j}\mathbf{e}(w_{t+j})(3)
34
+
35
+ We use the variant to build monolingual word embeddings because experiments on named entity recognition and word similarity tasks showed this variant leads to small improvements over the standard CBOW model Ni et al. (2017).
36
+
37
+ Mikolov et al. (2013b) observed that word embeddings of different languages often have similar geometric arrangements, and suggested tolearn a linear mapping between the vector spaces.
38
+
39
+ Let 𝒟𝒟\mathcal{D} be a bilingual dictionary with aligned word pairs (wi,vi)i=1,…,Dw_{i},v_{i})_{i=1,...,D} between a source language s𝑠s and a targetlanguage t𝑡t, where wisubscript𝑤𝑖w_{i} is a source-language word and visubscript𝑣𝑖v_{i} is the translation of wisubscript𝑤𝑖w_{i} in the target language. Let 𝐱i∈ℝd×1subscript𝐱𝑖superscriptℝ𝑑1\mathbf{x}_{i}\in\mathbb{R}^{d\times 1} be the word embedding of the source-language word wisubscript𝑤𝑖w_{i}, 𝐲i∈ℝd×1subscript𝐲𝑖superscriptℝ𝑑1\mathbf{y}_{i}\in\mathbb{R}^{d\times 1}be the word embedding of the target-language word visubscript𝑣𝑖v_{i}.
40
+
41
+ We find a linear mapping (matrix) 𝐌t→ssubscript𝐌→𝑡𝑠\mathbf{M}_{t\rightarrow s} such that 𝐌t→s​𝐲isubscript𝐌→𝑡𝑠subscript𝐲𝑖\mathbf{M}_{t\rightarrow s}\mathbf{y}_{i} approximates 𝐱isubscript𝐱𝑖\mathbf{x}_{i}, by solving the following least squares problem using the dictionary as the training set:𝐌t→s=arg⁡min𝐌∈ℝd×d​∑i=1D‖𝐱i−𝐌𝐲i‖2subscript𝐌→𝑡𝑠subscript𝐌superscriptℝ𝑑𝑑superscriptsubscript𝑖1𝐷superscriptnormsubscript𝐱𝑖subscript𝐌𝐲𝑖2\mathbf{M}_{t\rightarrow s}=\arg\min_{\mathbf{M}\in\mathbb{R}^{d\times d}}\sum_{i=1}^{D}||\mathbf{x}_{i}-\mathbf{M}\mathbf{y}_{i}||^{2}(4)
42
+
43
+ Using 𝐌t→ssubscript𝐌→𝑡𝑠\mathbf{M}_{t\rightarrow s}, for any target-language word v𝑣v with word embedding 𝐲𝐲\mathbf{y}, we can project it intothe source-language embedding space as 𝐌t→s​𝐲subscript𝐌→𝑡𝑠𝐲\mathbf{M}_{t\rightarrow s}\mathbf{y}.
44
+
45
+ To ensure that all the training instances in the dictionary 𝒟𝒟\mathcal{D} contribute equally to the optimization objective in(4) and to preserve vector norms after projection, we have tried length normalization and orthogonal transformation for learning the bilingual mapping as in Xing et al. (2015); Artetxe et al. (2016); Smith et al. (2017).
46
+
47
+ First, we normalize the source-language and target-language word embeddings to be unit vectors: 𝐱′=𝐱‖𝐱‖superscript𝐱′𝐱norm𝐱\mathbf{x}^{\prime}=\frac{\mathbf{x}}{||\mathbf{x}||} for each source-language word embedding 𝐱𝐱\mathbf{x}, and 𝐲′=𝐲‖𝐲‖superscript𝐲′𝐲norm𝐲\mathbf{y}^{\prime}=\frac{\mathbf{y}}{||\mathbf{y}||} for each target-language word embedding 𝐲𝐲\mathbf{y}.
48
+
49
+ Next, we add an orthogonality constraint to (4) such that 𝐌𝐌\mathbf{M} is an orthogonal matrix, i.e.,𝐌T​𝐌=𝐈superscript𝐌T𝐌𝐈\mathbf{M}^{\mathrm{T}}\mathbf{M}=\mathbf{I} where 𝐈𝐈\mathbf{I} denotes the identity matrix:𝐌t→sO=arg⁡min𝐌∈ℝd×d,𝐌T​𝐌=𝐈​∑i=1D‖𝐱i′−𝐌𝐲i′‖2subscriptsuperscript𝐌𝑂→𝑡𝑠subscriptformulae-sequence𝐌superscriptℝ𝑑𝑑superscript𝐌T𝐌𝐈superscriptsubscript𝑖1𝐷superscriptnormsubscriptsuperscript𝐱′𝑖subscriptsuperscript𝐌𝐲′𝑖2\mathbf{M}^{O}_{t\rightarrow s}=\arg\min_{\mathbf{M}\in\mathbb{R}^{d\times d},\mathbf{M}^{\mathrm{T}}\mathbf{M}=\mathbf{I}}\sum_{i=1}^{D}||\mathbf{x}^{\prime}_{i}-\mathbf{M}\mathbf{y}^{\prime}_{i}||^{2}(5)𝐌t→sOsubscriptsuperscript𝐌𝑂→𝑡𝑠\mathbf{M}^{O}_{t\rightarrow s} can be computed using singular-value decomposition (SVD).
50
+
51
+ The mapping learned in (4) or (5) requires a seed dictionary. To relax this requirement, Artetxe et al. (2017) proposed a self-learning procedure that can be combined with a dictionary-based mapping technique. Starting with a small seed dictionary, the procedure iteratively 1) learns a mapping using the current dictionary; and 2) computes a new dictionary using the learned mapping.
52
+
53
+ Artetxe et al. (2018) proposed an unsupervised method to learn the bilingual mapping without using a seed dictionary. The method first uses a heuristic to build an initial dictionary that aligns the vocabularies of two languages, and then applies a robust self-learning procedure to iteratively improve the mapping. Another unsupervised method based on adversarial training was proposed in Conneau et al. (2018).
54
+
55
+ We compare the performance of different mappings for cross-lingual RE model transfer in Section 5.3.2.
56
+
57
+ For any two entities in a sentence, an RE model determines whether these two entities have a relationship, and if yes, classifies therelationship into one of the pre-defined relation types.We focus on neural network RE models since these models achieve the state-of-the-art performance for relation extraction. Mostimportantly, neural network RE models use word embeddings as the input, which are amenable to cross-lingual model transfer via cross-lingual word embeddings. In this paper, we use English as the source language.
58
+
59
+ Our neural network architecture has four layers. The first layer is the embedding layer which maps input words in a sentence toword embeddings. The second layer is a context layer which transforms the word embeddings to context-aware vector representationsusing a recurrent or convolutional neural network layer. The third layer is a summarization layer which summarizes the vectors ina sentence by grouping and pooling. The final layer is the output layer which returns the classification label for the relationtype.
60
+
61
+ For an English sentence with n𝑛n words 𝐬=(w1,w2,…,wn)𝐬subscript𝑤1subscript𝑤2…subscript𝑤𝑛\mathbf{s}=(w_{1},w_{2},...,w_{n}), the embedding layer maps each word wtsubscript𝑤𝑡w_{t} to a real-valued vector (word embedding) 𝐱t∈ℝd×1subscript𝐱𝑡superscriptℝ𝑑1\mathbf{x}_{t}\in\mathbb{R}^{d\times 1} using the English word embedding model (Section 3.1).In addition, for each entity m𝑚m in the sentence, theembedding layer maps its entity type to a real-valued vector (entity label embedding) 𝐥m∈ℝdm×1subscript𝐥𝑚superscriptℝsubscript𝑑𝑚1\mathbf{l}_{m}\in\mathbb{R}^{d_{m}\times 1} (initialized randomly). In our experiments we use d=300𝑑300d=300 and dm=50subscript𝑑𝑚50d_{m}=50.
62
+
63
+ Given the word embeddings 𝐱tsubscript𝐱𝑡\mathbf{x}_{t}’s of the words in the sentence, the context layer tries to build asentence-context-aware vector representation for each word. We consider two types of neural network layers that aim to achieve this.
64
+
65
+ The first type of context layer is based on Long Short-Term Memory (LSTM) type recurrent neural networks Hochreiter and Schmidhuber (1997); Graves and Schmidhuber (2005). Recurrent neural networks (RNNs) are a class of neural networks that operate on sequential data such as sequences of words. LSTM networks are a type of RNNs that have been invented to better capture long-range dependencies in sequentialdata.
66
+
67
+ We pass the word embeddings 𝐱tsubscript𝐱𝑡\mathbf{x}_{t}’s to a forward and a backward LSTM layer. A forward or backward LSTM layerconsists of a set of recurrently connected blocks known as memory blocks. The memory block at the t𝑡t-th word in the forward LSTMlayer contains a memory cell 𝐜→tsubscript→𝐜𝑡\overrightarrow{\mathbf{c}}_{t} and three gates: an input gate𝐢→tsubscript→𝐢𝑡\overrightarrow{\mathbf{i}}_{t}, a forget gate 𝐟→tsubscript→𝐟𝑡\overrightarrow{\mathbf{f}}_{t} and an output gate 𝐨→tsubscript→𝐨𝑡\overrightarrow{\mathbf{o}}_{t}(⋅→→⋅\overrightarrow{\cdot} indicates the forward direction), which are updated as follows:𝐢→tsubscript→𝐢𝑡\displaystyle\overrightarrow{\mathbf{i}}_{t}=\displaystyle=σ​(W→i​𝐱t+U→i​𝐡→t−1+𝐛→i)𝜎subscript→𝑊𝑖subscript𝐱𝑡subscript→𝑈𝑖subscript→𝐡𝑡1subscript→𝐛𝑖\displaystyle\sigma\big{(}\overrightarrow{W}_{i}\mathbf{x}_{t}+\overrightarrow{U}_{i}\overrightarrow{\mathbf{h}}_{t-1}+\overrightarrow{\mathbf{b}}_{i}\big{)}𝐟→tsubscript→𝐟𝑡\displaystyle\overrightarrow{\mathbf{f}}_{t}=\displaystyle=σ​(W→f​𝐱t+U→f​𝐡→t−1+𝐛→f)𝜎subscript→𝑊𝑓subscript𝐱𝑡subscript→𝑈𝑓subscript→𝐡𝑡1subscript→𝐛𝑓\displaystyle\sigma\big{(}\overrightarrow{W}_{f}\mathbf{x}_{t}+\overrightarrow{U}_{f}\overrightarrow{\mathbf{h}}_{t-1}+\overrightarrow{\mathbf{b}}_{f}\big{)}𝐨→tsubscript→𝐨𝑡\displaystyle\overrightarrow{\mathbf{o}}_{t}=\displaystyle=σ​(W→o​𝐱t+U→o​𝐡→t−1+𝐛→o)𝜎subscript→𝑊𝑜subscript𝐱𝑡subscript→𝑈𝑜subscript→𝐡𝑡1subscript→𝐛𝑜\displaystyle\sigma\big{(}\overrightarrow{W}_{o}\mathbf{x}_{t}+\overrightarrow{U}_{o}\overrightarrow{\mathbf{h}}_{t-1}+\overrightarrow{\mathbf{b}}_{o}\big{)}𝐜→tsubscript→𝐜𝑡\displaystyle\overrightarrow{\mathbf{c}}_{t}=\displaystyle=𝐟→t⊙𝐜→t−1+limit-fromdirect-productsubscript→𝐟𝑡subscript→𝐜𝑡1\displaystyle\overrightarrow{\mathbf{f}}_{t}\odot\overrightarrow{\mathbf{c}}_{t-1}+𝐢→t⊙tanh⁡(W→c​𝐱t+U→c​𝐡→t−1+𝐛→c)direct-productsubscript→𝐢𝑡subscript→𝑊𝑐subscript𝐱𝑡subscript→𝑈𝑐subscript→𝐡𝑡1subscript→𝐛𝑐\displaystyle\overrightarrow{\mathbf{i}}_{t}\odot\tanh\big{(}\overrightarrow{W}_{c}\mathbf{x}_{t}+\overrightarrow{U}_{c}\overrightarrow{\mathbf{h}}_{t-1}+\overrightarrow{\mathbf{b}}_{c}\big{)}𝐡→tsubscript→𝐡𝑡\displaystyle\overrightarrow{\mathbf{h}}_{t}=\displaystyle=𝐨→t⊙tanh⁡(𝐜→t)direct-productsubscript→𝐨𝑡subscript→𝐜𝑡\displaystyle\overrightarrow{\mathbf{o}}_{t}\odot\tanh(\overrightarrow{\mathbf{c}}_{t})(6)where σ𝜎\sigma is the element-wisesigmoid function and ⊙direct-product\odot is the element-wise multiplication.
68
+
69
+ The hidden state vector 𝐡→tsubscript→𝐡𝑡\overrightarrow{\mathbf{h}}_{t} in the forward LSTM layer incorporates information from the left (past) tokens of wtsubscript𝑤𝑡w_{t} in thesentence. Similarly, we can compute the hidden state vector 𝐡←tsubscript←𝐡𝑡\overleftarrow{\mathbf{h}}_{t} in the backward LSTM layer, which incorporatesinformation from the right (future) tokens of wtsubscript𝑤𝑡w_{t} in the sentence. The concatenation of the two vectors 𝐡t=[���→t,𝐡←t]subscript𝐡𝑡subscript→𝐡𝑡subscript←𝐡𝑡\mathbf{h}_{t}=[\overrightarrow{\mathbf{h}}_{t},\overleftarrow{\mathbf{h}}_{t}] is a good representation of the word wtsubscript𝑤𝑡w_{t} with both left and right contextual information in the sentence.
70
+
71
+ The second type of context layer is based on Convolutional Neural Networks (CNNs) Zeng et al. (2014); dos Santos et al. (2015), which appliesconvolution-like operation on successive windows of size k𝑘k around each word in the sentence. Let 𝐳t=[𝐱t−(k−1)/2,…,𝐱t+(k−1)/2]subscript𝐳𝑡subscript𝐱𝑡𝑘12…subscript𝐱𝑡𝑘12\mathbf{z}_{t}=[\mathbf{x}_{t-(k-1)/2},...,\mathbf{x}_{t+(k-1)/2}] be the concatenation of k𝑘k word embeddings around wtsubscript𝑤𝑡w_{t}. The convolutional layercomputes a hidden state vector𝐡t=tanh⁡(𝐖𝐳t+𝐛)subscript𝐡𝑡subscript𝐖𝐳𝑡𝐛\mathbf{h}_{t}=\tanh(\mathbf{W}\mathbf{z}_{t}+\mathbf{b})(7)for each word wtsubscript𝑤𝑡w_{t}, where 𝐖𝐖\mathbf{W} is a weight matrix and 𝐛𝐛\mathbf{b} is a bias vector, and tanh⁡(⋅)⋅\tanh(\cdot) is the element-wisehyperbolic tangent function.
72
+
73
+ After the context layer, the sentence (w1,w2,…,wn)subscript𝑤1subscript𝑤2…subscript𝑤𝑛(w_{1},w_{2},...,w_{n}) is represented by (𝐡1,….,𝐡n)(\mathbf{h}_{1},....,\mathbf{h}_{n}). Suppose m1=(wb1,..,we1)m_{1}=(w_{b_{1}},..,w_{e_{1}}) andm2=(wb2,..,we2)m_{2}=(w_{b_{2}},..,w_{e_{2}}) are two entities in the sentence where m1subscript𝑚1m_{1} is on the left of m2subscript𝑚2m_{2} (i.e., e1<b2subscript𝑒1subscript𝑏2e_{1}<b_{2}). As differentsentences and entities may have various lengths, the summarization layer tries to build a fixed-length vector that bestsummarizes the representations of the sentence and the two entities for relation type classification.
74
+
75
+ We divide the hidden state vectors 𝐡tsubscript𝐡𝑡\mathbf{h}_{t}’s into 5 groups:•G1={𝐡1,..,𝐡b1−1}G_{1}=\{\mathbf{h}_{1},..,\mathbf{h}_{b_{1}-1}\} includes vectors that are left to the first entity m1subscript𝑚1m_{1}.•G2={𝐡b1,..,𝐡e1}G_{2}=\{\mathbf{h}_{b_{1}},..,\mathbf{h}_{e_{1}}\} includes vectors that are in the first entity m1subscript𝑚1m_{1}.•G3={𝐡e1+1,..,𝐡b2−1}G_{3}=\{\mathbf{h}_{e_{1}+1},..,\mathbf{h}_{b_{2}-1}\} includes vectors that are between the two entities.•G4={𝐡b2,..,𝐡e2}G_{4}=\{\mathbf{h}_{b_{2}},..,\mathbf{h}_{e_{2}}\} includes vectors that are in the second entity m2subscript𝑚2m_{2}.•G5={𝐡e2+1,..,𝐡n}G_{5}=\{\mathbf{h}_{e_{2}+1},..,\mathbf{h}_{n}\} includes vectors that are right to the second entity m2subscript𝑚2m_{2}.
76
+
77
+ We perform element-wise max pooling among the vectors in each group:𝐡Gi​(j)=max𝐡∈Gi⁡𝐡​(j),1≤j≤dh,1≤i≤5formulae-sequenceformulae-sequencesubscript𝐡subscript𝐺𝑖𝑗subscript𝐡subscript𝐺𝑖𝐡𝑗1𝑗subscript𝑑ℎ1𝑖5\mathbf{h}_{G_{i}}(j)=\max_{\mathbf{h}\in G_{i}}\mathbf{h}(j),1\leq j\leq d_{h},1\leq i\leq 5(8)where dhsubscript𝑑ℎd_{h} is the dimension of the hidden state vectors. Concatenating the 𝐡Gisubscript𝐡subscript𝐺𝑖\mathbf{h}_{G_{i}}’s we get a fixed-length vector𝐡s=[𝐡G1,…,𝐡G5]subscript𝐡𝑠subscript𝐡subscript𝐺1…subscript𝐡subscript𝐺5\mathbf{h}_{s}=[\mathbf{h}_{G_{1}},...,\mathbf{h}_{G_{5}}].
78
+
79
+ The output layer receives inputs from the previous layers (the summarization vector 𝐡ssubscript𝐡𝑠\mathbf{h}_{s}, the entity label embeddings𝐥m1subscript𝐥subscript𝑚1\mathbf{l}_{m_{1}} and 𝐥m2subscript𝐥subscript𝑚2\mathbf{l}_{m_{2}} for the two entities under consideration) and returns a probability distribution over therelation type labels:𝐩=softmax​(𝐖s​𝐡s+𝐖m1​𝐥m1+𝐖m2​𝐥m2+𝐛o)𝐩softmaxsubscript𝐖𝑠subscript𝐡𝑠subscript𝐖subscript𝑚1subscript𝐥subscript𝑚1subscript𝐖subscript𝑚2subscript𝐥subscript𝑚2subscript𝐛𝑜\mathbf{p}=\textrm{softmax}\big{(}\mathbf{W}_{s}\mathbf{h}_{s}+\mathbf{W}_{m_{1}}\mathbf{l}_{m_{1}}+\mathbf{W}_{m_{2}}\mathbf{l}_{m_{2}}+\mathbf{b}_{o}\big{)}(9)
80
+
81
+ Given the word embeddings of a sequence of words in a target language t𝑡t, (𝐲1,…,𝐲n)subscript𝐲1…subscript𝐲𝑛(\mathbf{y}_{1},...,\mathbf{y}_{n}), we project them into theEnglish embedding space by applying the linear mapping 𝐌t→ssubscript𝐌→𝑡𝑠\mathbf{M}_{t\rightarrow s} learned in Section3.2: (𝐌t→s​𝐲1,𝐌t→s​𝐲2,…,𝐌t→s​𝐲n)subscript𝐌→𝑡𝑠subscript𝐲1subscript𝐌→𝑡𝑠subscript𝐲2…subscript𝐌→𝑡𝑠subscript𝐲𝑛(\mathbf{M}_{t\rightarrow s}\mathbf{y}_{1},\mathbf{M}_{t\rightarrow s}\mathbf{y}_{2},...,\mathbf{M}_{t\rightarrow s}\mathbf{y}_{n}). The neural network English RE model is then applied on the projected word embeddings and the entity label embeddings (which are language independent) to perform relationship classification.
82
+
83
+ Note that our models do not use language-specific resources such as dependency parsers or POS taggers because these resources might notbe readily available for a target language. Also our models do not use precise word position features since word positions in sentencescan vary a lot across languages.
84
+
85
+ In this section, we evaluate the performance of the proposed cross-lingual RE approach on both in-house dataset and the ACE (AutomaticContent Extraction) 2005 multilingual dataset Walker et al. (2006).
86
+
87
+ Our in-house dataset includes manually annotated RE data for 6 languages: English, German, Spanish, Italian, Japanese and Portuguese.It defines 56 entity types (e.g., Person, Organization, Geo-Political Entity, Location, Facility, Time,Event_Violence, etc.) and 53 relation types between the entities (e.g., AgentOf, LocatedAt, PartOf,TimeOf, AffectedBy, etc.).
88
+
89
+ The ACE05 dataset includes manually annotated RE data for 3 languages: English, Arabic and Chinese. It defines 7 entity types(Person, Organization, Geo-Political Entity, Location, Facility, Weapon, Vehicle) and 6relation types between the entities (Agent-Artifact, General-Affiliation, ORG-Affiliation, Part-Whole,Personal-Social, Physical).
90
+
91
+ For both datasets, we create a class label “O” to denote that the two entities under consideration do not have a relationship belonging to one of the relation types of interest.
92
+
93
+ We build 3 neural network English RE models under the architecture described in Section 4:
94
+
95
+ •The first neural network RE model does not have a context layer and the word embeddings are directly passed to the summarizationlayer. We call it Pass-Through for short.•The second neural network RE model has a Bi-LSTM context layer. We call it Bi-LSTM for short.•The third neural network model has a CNN context layer with a window size 3. We call it CNN for short.
96
+
97
+ First we compare our neural network English RE models with the state-of-the-art RE models on the ACE05 English data. The ACE05 Englishdata can be divided to 6 different domains: broadcast conversation (bc), broadcast news (bn), telephone conversation (cts), newswire(nw), usenet (un) and webblogs (wl). We apply the same data splitin Plank and Moschitti (2013); Gormley et al. (2015); Nguyen and Grishman (2016), which uses news (the unionof bn and nw) as the training set, a half of bc as the development set and the remaining data as the test set.
98
+
99
+ We learn the model parameters using Adam Kingma and Ba (2015). We apply dropout Srivastava et al. (2014) to the hidden layers to reduceoverfitting. The development set is used for tuning the model hyperparameters and for early stopping.
100
+
101
+ In Table 1 we compare our models with the best models in Gormley et al. (2015) and Nguyen and Grishman (2016). OurBi-LSTM model outperforms the best model (single or ensemble) in Gormley et al. (2015) and the best single model in Nguyen and Grishman (2016),without using any language-specific resources such as dependency parsers.
102
+
103
+ While the data split in the previous works was motivated by domain adaptation, the focus of this paper is on cross-lingual model transfer, and hencewe apply a random data split as follows. For the source language English and each target language, we randomly select 80%percent8080\% of the dataas the training set, 10%percent1010\% as the development set, and keep the remaining 10%percent1010\% as the test set. The sizes of the sets are summarizedin Table 2.
104
+
105
+ We report the Precision, Recall and F1subscript𝐹1F_{1} score of the 3 neural network English RE models in Table 3. Note that adding an additional context layer with either Bi-LSTM or CNN significantly improves the performance of our English RE model, compared with the simple Pass-Through model. Therefore, we will focus on the Bi-LSTM model and the CNN model in the subsequent experiments.
106
+
107
+ We apply the English RE models to the 7 target languages across a variety of language families.
108
+
109
+ The bilingual dictionary includes the most frequent target-language words and their translations in English. To determine how many word pairs are needed to learn an effective bilingual word embedding mapping for cross-lingual RE, we first evaluate the performance (F1subscript𝐹1F_{1} score) of our cross-lingual RE approach on the target-language development sets with an increasing dictionary size, as plotted in Figure 2.
110
+
111
+ We found that for most target languages, once the dictionary size reaches 1K, further increasing the dictionary size may not improve the transfer performance. Therefore, we select the dictionary size to be 1K.
112
+
113
+ We compare the performance of cross-lingual RE model transfer under the following bilingual word embedding mappings:•Regular-1K: the regular mapping learned in (4) using 1K word pairs;•Orthogonal-1K: the orthogonal mapping with length normalization learned in (5) using 1K word pairs (in this case we train the English RE models with the normalized English word embeddings);•Semi-Supervised-1K: the mapping learned with 1K word pairs and improved by the self-learning method in Artetxe et al. (2017);•Unsupervised: the mapping learned by the unsupervised method in Artetxe et al. (2018).
114
+
115
+ The results are summarized in Table 4. The regular mapping outperforms the orthogonal mapping consistently across the target languages. While the orthogonal mapping was shown to work better than the regular mapping for the word translation task Xing et al. (2015); Artetxe et al. (2016); Smith et al. (2017), our cross-lingual RE approach directly maps target-language word embeddings to the English embedding space without conducting word translations. Moreover, the orthogonal mapping requires length normalization, but we observed that length normalization adversely affects the performance of the English RE models (about 2.0 F1subscript𝐹1F_{1} points drop).
116
+
117
+ We apply the vecmap toolkit111https://github.com/artetxem/vecmap to obtain the semi-supervised and unsupervised mappings. The unsupervised mapping has the lowest average accuracy over the target languages, but it does not require a seed dictionary. Among all the mappings, the regular mapping achieves the best average accuracy over the target languages using a dictionary with only 1K word pairs, and hence we adopt it for the cross-lingual RE task.
118
+
119
+ The cross-lingual RE model transfer results for the in-house test data are summarized in Table 5 and theresults for the ACE05 test data are summarized in Table 6, using the regular mapping learned with a bilingual dictionary of size 1K. In the tables, we also provide the performance of the supervised RE model (Bi-LSTM) for each target language, which is trained with a few hundred thousand tokens of manually annotated RE data in the target-language, and may serve as an upper bound for the cross-lingual model transfer performance.
120
+
121
+ Among the 2 neural network models, the Bi-LSTM model achieves a better cross-lingual RE performance than the CNN model for 6 out of the 7 target languages. In terms of absolute performance, the Bi-LSTM model achieves over 40.040.040.0 F1subscript𝐹1F_{1} scores for German, Spanish, Portuguese and Chinese. In terms of relative performance, it reaches over 75%percent7575\% of the accuracy of the supervised target-language RE model for German, Spanish, Italian and Portuguese. While Japanese and Arabic appear to be more difficult to transfer, it still achieves 55%percent5555\% and 52%percent5252\% of the accuracy of the supervised Japanese and Arabic RE model, respectively, without using any manually annotated RE data in Japanese/Arabic.
122
+
123
+ We apply model ensemble to further improve the accuracy of the Bi-LSTM model. We train 5 Bi-LSTM English RE models initiated withdifferent random seeds, apply the 5 models on the target languages, and combine the outputs by selecting the relation type labels with thehighest probabilities among the 5 models. This Ensemble approach improves the single model by 0.6-1.9 F1subscript𝐹1F_{1} points, except for Arabic.
124
+
125
+ Since our approach projects the target-language word embeddings to the source-language embedding space preserving the word order, it is expected to work better for a target language that has more similar word order as the source language. This has been verified by our experiments. The source language, English, belongs to the SVO (Subject, Verb, Object) language family where in a sentence the subject comes first, the verb second, and the object third. Spanish, Italian, Portuguese, German (in conventional typology) and Chinese also belong to the SVO language family, and our approach achieves over 70%percent7070\% relative accuracy for these languages. On the other hand, Japanese belongs to the SOV (Subject, Object, Verb) language family and Arabic belongs to the VSO (Verb, Subject, Object) language family, and our approach achieves lower relative accuracy for these two languages.
126
+
127
+ There are a few weakly supervised cross-lingual RE approaches. Kim et al. (2010) and Kim and Lee (2012) project annotated English RE data to Korean to create weakly labeled training data via aligned parallel corpora. Faruqui and Kumar (2015) translates a target-language sentence into English, performs RE in English, and then projects the relation phrases back to the target-language sentence. Zou et al. (2018) proposes an adversarial feature adaptation approach for cross-lingual relation classification, which uses a machine translation system to translate source-language sentences into target-language sentences.Unlike the existing approaches, our approach doesnot require aligned parallel corpora or machine translation systems. There are also several multilingual RE approaches, e.g.,Verga et al. (2016); Min et al. (2017); Lin et al. (2017), where the focus is to improve monolingual RE by jointly modeling texts in multiple languages.
128
+
129
+ Many cross-lingual word embedding models have been developed recently Upadhyay et al. (2016); Ruder et al. (2017). An important application of cross-lingual word embeddings is to enable cross-lingual model transfer. In this paper, we apply the bilingual word embedding mapping technique in Mikolov et al. (2013b) to cross-lingual RE model transfer. Similar approaches have been applied toother NLP tasks such as dependency parsing Guo et al. (2015), POS tagging Gouws and S��gaard (2015) and named entity recognition Ni et al. (2017); Xie et al. (2018).
130
+
131
+ In this paper, we developed a simple yet effective neural cross-lingual RE model transfer approach, which has very low resource requirements (a small bilingual dictionary with 1K word pairs) and can be easily extended to a new language. Extensive experiments for 7 target languages across a variety of language families on both in-house and open datasets show that the proposed approach achieves very good performance (up to 79%percent7979\% of the accuracy of the supervised target-language RE model), which provides a strong baseline for building cross-lingual RE models with minimal resources.
1911.00077v1.txt ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ The progress of text-to-image synthesis field has traditionally been empirically driven, and since no “one-fits-all” metric has been proposed for both quantitative and qualitative evaluation of machine-generated images, the existence of a robust evaluation metric is crucial for the advancement of the field. The Inception Score (IS) [1] is the commonly chosen metric for evaluating the quality of the generated images, as it has been shown to correlate well with human judgment. However, this metric solely takes into account the realism and variety of the generated images [4, 5, 6, 7]. This works well for unrestricted image generation, but fails to capture important information when the image synthesis task is conditioned on classes or text descriptions. For conditional text-to-image synthesis, a suitable evaluation metric should also take into account how well the generated images correspond to the given conditions. For text-to-image synthesis methods this means the method’s ability to correctly capture the semantic meaning of the input text descriptions. Human rankings give an excellent estimate of semantic accuracy but evaluating thousands of images following this approach is impractical, since it is a time consuming, tedious and expensive process.
2
+
3
+ In this paper, we propose a new evaluation method for text-to-image synthesis that allows for the simultaneous estimation of realism, variety and semantic accuracy of the generated images. We use t-Distributed Stochastic Neighbor Embedding (t-SNE) [3] to visualize Inception-net [2] features of the real and generated images. Visual concepts are determined by clustering the representations of the real images in the low-dimensional feature space and are used to access their class-wise similarities. We evaluate four state-of-the-art text-to-image synthesis methods using this method, i.e. the AttnGAN [4], the HDGAN [6], the MirrorGAN [5], and the StackGAN++ [8], and we show that the proposed evaluation method can capture information related to the classes of the corresponding real (ground-truth) images.
4
+
5
+ An ideal evaluation method for text-to-image synthesis methods should be able to highlight several key properties of the generated images. The first property is realism and image quality, i.e. to what extend the generated images resemble real images. The second property is variety, i.e., the generated images should ideally show as much variety as that appearing in real images. Moreover, mode collapse, i.e. different captions leading to the same image being generated multiple times, should be avoided. The third key property is the methods’ ability to accurately capture the semantics of the provided text descriptions. The evaluation method introduced in this paper focuses on all of these three properties. The procedure followed by the proposed method is described next.
6
+
7
+ Let us denote by X={x1,x2,…,xn}𝑋subscript𝑥1subscript𝑥2…subscript𝑥𝑛X=\left\{x_{1},x_{2},\dots,x_{n}\right\} a set of n𝑛n real images, each followed by a text description (in the form of a caption) included in the set T={t1,t2,…,tn}𝑇subscript𝑡1subscript𝑡2…subscript𝑡𝑛T=\left\{t_{1},t_{2},\dots,t_{n}\right\}. A text-to-image synthesis method, usually based on a generative network G𝐺G, generates synthetic images included in the set S={s1,s2,…​sn}𝑆subscript𝑠1subscript𝑠2…subscript𝑠𝑛S=\left\{s_{1},s_{2},\dots s_{n}\right\}, where si=G​(ti)subscript𝑠𝑖𝐺subscript𝑡𝑖s_{i}=G(t_{i}) for i=1,2,…,n𝑖12…𝑛i=1,2,\dots,n. As commonly done in the evaluation of text-to-image synthesis methods, the data sets (X,T)𝑋𝑇(X,T) should not have been used for training of G𝐺G, and the classes of (X,T)𝑋𝑇(X,T) should be disjoint from the classes of the data used for training G𝐺G111In general there may be several captions for each real image, and thus more synthetic images than the real ones. Here one caption per image is assumed to simplify notation..
8
+
9
+ To capture semantic information related to the classes of the real images in the set X𝑋X, an Inception network [2] is trained to achieve high classification performance (∼95%similar-toabsentpercent95\sim 95\%) on the real images X𝑋X. This network is subsequently used to extract image representations for both the real images in X𝑋X and the synthetic images in S𝑆S. This is done by introducing the images to the network and extracting the next to the last layer outputs. Let us denote byX~={x~1,x~2,…,x~n}~𝑋subscript~𝑥1subscript~𝑥2…subscript~𝑥𝑛\tilde{X}=\left\{\tilde{x}_{1},\tilde{x}_{2},\dots,\tilde{x}_{n}\right\} and S~={s~1,s~2,…,s~n}~𝑆subscript~𝑠1subscript~𝑠2…subscript~𝑠𝑛\tilde{S}=\left\{\tilde{s}_{1},\tilde{s}_{2},\dots,\tilde{s}_{n}\right\}, where x~i∈ℝDsubscript~𝑥𝑖superscriptℝ𝐷\tilde{x}_{i}\in\mathbb{R}^{D} and s~i∈ℝD,i=1,…,nformulae-sequencesubscript~𝑠𝑖superscriptℝ𝐷𝑖1…𝑛\tilde{s}_{i}\in\mathbb{R}^{D},\>i=1,\dots,n, the representations of the real and synthetic images, respectively. Since the next to the last layer in Inception network is formed by 102410241024 neurons, we have D=1024𝐷1024D=1024.
10
+
11
+ To obtain 222-dimensional representations of the real and synthetic images, the two sets (X~,S~~𝑋~𝑆\tilde{X},\tilde{S}) are combined and used for applying the t-SNE [3] mapping. In our experiments we followed the process suggested by the authors in [3], i.e. an intermediate dimensionality reduction from D𝐷D to 505050 dimensions is applied by using Principal Component Analysis (PCA) [10]. When performing the t-SNE mapping, the perplexity is set to the number of images in each class since this is the expected number of neighbors. Let us denote by ΦX∈ℝ2×nsuperscriptΦ𝑋superscriptℝ2𝑛\Phi^{X}\in\mathbb{R}^{2\times n} and ΦS∈ℝ2×nsuperscriptΦ𝑆superscriptℝ2𝑛\Phi^{S}\in\mathbb{R}^{2\times n} the resulting 222-dimensional representations of the real and the synthetic images, respectively.
12
+
13
+ For a properly trained Inception network, the image representations obtained by applying the t-SNE mapping of the real images ΦXsuperscriptΦ𝑋\Phi^{X} is expected to form tight clusters, corresponding (sub-)classes of the data set (X,T)𝑋𝑇(X,T). This is verified by our experiments, as can be seen from the 222-dimensional plots in Figures 2 and 3, where the real image representations illustrated as black points are well-clustered in disjoint groups. The distribution of the representations ΦSsuperscriptΦ𝑆\Phi^{S} of the synthetic images reveals the following properties:
14
+
15
+ Realism: For fairly realistically looking synthetic images, the distribution of their low-dimensional representations ΦSsuperscriptΦ𝑆\Phi^{S} should show a significant degree of overlap with the distribution of the low-dimensional representations of the real images ΦXsuperscriptΦ𝑋\Phi^{X}. This is assuming the Inception network is not completely over-fitted to the real images (hence the choice of ∼95%similar-toabsentpercent95\sim 95\% classification accuracy vs. 100%percent100100\%).Variety: The low-dimensional synthetic image representations ΦSsuperscriptΦ𝑆\Phi^{S} should be spread out to a reasonable degree, i.e. comparable to the distribution of low-dimensional representations of the real images ΦXsuperscriptΦ𝑋\Phi^{X}. Too tight clustering of ΦSsuperscriptΦ𝑆\Phi^{S} signifies very similarly looking generated images or, in the worst case, mode collapse where the same image is generated from multiple different captions.Semantic accuracy: The types of data considered in this paper, i.e. CUB-200-2011 [9] (see Figure 1), consists of images belonging to distinct classes of similar looking objects, such as species, along with matching, human written captions. For such data, captions within each class should ideally show a high degree of semantic similarity, since they are all describing the same type of object (i.e. a specific species of bird). When the generator G𝐺G is successful at capturing the semantics of the captions in the set T𝑇T, the generated images should not only be realistically looking but also similar to the real images belonging to the same class. This means that the distance between points in ΦSsuperscriptΦ𝑆\Phi^{S} and ΦXsuperscriptΦ𝑋\Phi^{X} belonging to the same classes should be a good gauge of the text-to-image synthesis method semantic accuracy.
16
+
17
+ To quantify the results of the process described above, a clustering scheme is used. First, fuzzy C-Means clustering [11] is applied on the real image representations ΦXsuperscriptΦ𝑋\Phi^{X}. The number of cluster centers is set to the number of classes in the data set (X,T)𝑋𝑇(X,T). After clustering is performed, each cluster is assigned a label indicated by the most frequent class among the images belonging to that cluster. When two or more clusters are assigned the same class based on the majority of their images, the cluster containing most images of that class is given first priority when assigning labels. This ensures unique labels for the resulting clusters.
18
+
19
+ Each synthetic image i𝑖i represented by a low-dimensional vector in ΦSsuperscriptΦ𝑆\Phi^{S} is assigned probabilities pi​jsubscript𝑝𝑖𝑗p_{ij} correspoding to the membership values with respect to the j𝑗jth cluster based on its distance to the corresponding cluster centroid. The predicted classes are then given by:yipred=arg⁡max𝑗​pi​j.subscriptsuperscript𝑦pred𝑖𝑗subscript𝑝𝑖𝑗y^{\mathrm{pred}}_{i}=\underset{j}{\arg\max}\>\>p_{ij}.(1)Since the true classes yitruesubscriptsuperscript𝑦true𝑖y^{\mathrm{true}}_{i} of points in ΦSsuperscriptΦ𝑆\Phi^{S} are known, the clustering accuracy can be easily calculated by:cluster​acc=1n​∑i{yipred=yitrue1yipred≠yitrue0.clusteracc1𝑛subscript𝑖casessubscriptsuperscript𝑦pred𝑖subscriptsuperscript𝑦true𝑖1subscriptsuperscript𝑦pred𝑖subscriptsuperscript𝑦true𝑖0\displaystyle\mathrm{cluster\,acc}=\frac{1}{n}\sum_{i}\begin{cases}y^{\mathrm{pred}}_{i}=y^{\mathrm{true}}_{i}&1\\y^{\mathrm{pred}}_{i}\neq y^{\mathrm{true}}_{i}&0.\end{cases}(2)
20
+
21
+ When G𝐺G correctly captures the semantics of the text descriptions in T𝑇T for a specific class, the resulting low-dimensional image representations should lie close to the cluster of real images belonging to the corresponding class. Thus, the clustering accuracy above should be a good metric for evaluating the ability of the text-to-image synthesis method to synthesize images capturing the class semantics.
22
+
23
+ In this Section, we describe experiments conducted to evaluate the ability of the proposed method to capture semantic class information in text-to-image synthesis methods evaluation. We used four state-of-the-art text-to-image synthesis methods to this end, i.e. the AttnGAN [4], the MirrorGAN [5], the HDGAN [6], and the StackGAN++ [7]. These methods were used to generate synthetic images using each of the ∼30similar-toabsent30\sim 30k captions from the test set of the CUB-200-2011 dataset [9]. The captions describe ∼3similar-toabsent3\sim 3k images of birds from 505050 different species (101010 captions per image).
24
+
25
+ The pre-trained Inception model from [7], trained on the CUB-200-2011 test data [9], was then used to generate image representations for the real images as well as the resulting synthetic images obtained by each of the four text-to-image synthesis methods. When performing the t-SNE mapping, the perplexity was set to 600 since this is the approximate number of synthetic images per class (and thus the expected number of neighbors).
26
+
27
+ Figures 2 and 3 show the 222-dimensional data representations obtained by applying t-SNE on the real images combined with each of the synthetic image sets of the studied methods. The synthetic image representations are shown in blue and red, while the real image representations are shown in black. The blue points are synthetic image mappings that have been classified correctly using the proposed method based on fuzzy C-means. These are positioned around real image clusters corresponding to the correct species. The red points are representations of synthetic images that were not classified correctly. More blue points signify that the corresponding text-to-image synthesis method is better at capturing the semantics of the captions.
28
+
29
+ The AttnGAN (Figure 2(a)) and MirrorGAN (Figure 2(b)) seem to yield the most correct classifications. Their t-SNE plots are very similar showing a high degree of clustering around the real image representations. They both seem to have a large amount of variety, and the methods are able to generate correctly classified images for almost all classes. There exists, however, still a large number of incorrectly classified images that are not similar to any real image cluster.
30
+
31
+ The StackGAN++ (Figure 3(b)) and HDGAN (Figure 3(a)) methods are also very similar to each other but synthesize much fewer correctly classified images. They both show an equal amount of variety, similar to the AttnGAN and MirrorGAN frameworks, and produce images similar to all real image clusters. However, most of these images are miss-classified, revealing a lower ability to accurately portray the semantics of the captions.
32
+
33
+ Calculating the clustering accuracy (Eq. (2)) confirms the conclusions from the visual inspection. In Table 1 the clustering accuracy of each method is highlighted in bold font. The AttnGAN and MirrorGAN methods achieve an accuracy of 0.22 and 0.20, respectively which is close to double the accuracy achieved by the HDGAN and StackGAN++ methods. As a sanity check, the classification accuracy of the pre-trained Inception network was calculated directly (bottom line of table 1), and the results are almost completely equal to those reported by the corresponding works. This is a strong indicator that the overall structure and clustering of the data has not been lost after applying the the t-SNE mapping.
34
+
35
+ The Inception scores were also calculated for the generated images. The Inception scores obtained by our experiments and those reported in the papers proposing each corresponding method are listed in the top two lines of table 1. As can be seen, the self-reported scores are close to those reported by the corresponding papers. HDGAN’s Inception score deviates somewhat from the self-reported score (3 standard deviations) while the other scores agree with self-reported results.
36
+
37
+ In this paper, we introduced a novel evaluation method and metric for text-to-image synthesis methods. We showed that the proposed visualization method allows for the assessment of several key properties of the generated images, namely realism, variety (including the presence of mode-collapse) and semantic similarity to the input text descriptions. These properties can be assessed for thousands of images simultaneously and lead to much better insight of the text-to-image synthesis methods’ performance than the traditional evaluation approach based on the Inception Score [1]. Finally, a semantic accuracy metric was introduced that allows for easy comparison between different text-to-image synthesis methods’ ability to accurately capture semantic information.
1911.00102v1.txt ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Given a mixture of multiple concurrent sources, the aim of single-channel source separation is to extract the individual sources from the mixture. Under a supervised training setup, we assume that we have clean training examples for each source in the mixture. Using these training examples, we first construct suitable models for the sources. Then, we use these trained models to extract the in sources from previously unseen mixtures.
2
+
3
+ With the current rapid strides in neural networks (NNs) and deep learning, several sophisticated architectures have been proposed and successfully used for single-channel source separation [1, 2, 3, 4]. More recently, we have started to operate directly on the waveforms with several end-to-end approaches available [2, 5, 6], and use better cost-functions motivated by the Source-to-Distortion ratio (SDR) [7, 8, 9, 10, 11, 2]. Using deep-clustering [1] and permutation-invariant training [12], we can train the networks to perform speaker-independent source separation. These advancements have resulted in significant improvements in separation performance.
4
+
5
+ However, these neural network models are typically trained under a discriminative setup. The mixture is given as an input to the network and the network is trained to produce outputs that resemble the constituent clean sources. Thus, for these models to work well in the real world, we need huge networks and copious amounts of training examples that account for different signal-to-noise ratio combinations and various categories of sounds. In such cases, updating trained networks to operate on mixtures containing a new sound requires significant data-augmentation and re-training on the augmented dataset. This is particularly infeasible when operating on a wide variety of sources [13], especially with limited computational resources.
6
+
7
+ In contrast, classical approaches like Non-negative Matrix Factorization (NMF) [14, 15, 16, 17, 18] and its recent NN alternatives  [19, 20] use generative models for source separation. We use clean training examples to build models for the sources and use these models to estimate the contribution of the sources in unseen mixtures. A significant advantage of such generative models is that the trained models can be used to extract the corresponding source from any mixture irrespective of the interfering sources in the mixture. Thus, tweaking the models to work for a new type of source just requires training a new model for the source and appending it to the existing dictionary of models. However, these approaches continue to lag behind discriminative models due to a lack of updates to their capabilities. We aim to address this issue here.
8
+
9
+ In this paper, we improve upon Non-Negative Autoencoders (NAEs) and generative models for source separation. We generalize NAEs to develop end-to-end versions and show how they can be used for single-channel source separation. These networks simultaneously operate on custom-designed time-frequency representations that are optimal for each source. With these improvements, we demonstrate that end-to-end NAE networks are comparable to discriminative approaches in terms of source separation performance. At the same time, we retain the advantages of generative modeling. The models are reusable and can be used in a variety of test scenarios without any additional data-augmentation or training requirements.
10
+
11
+ We first begin with a brief description of NAEs. We extend the capabilities of NAEs to operate directly on the audio waveforms to construct end-to-end NAE networks.
12
+
13
+ NMF approximates a non-negative matrix 𝐒∈ℝ≥0M×N𝐒superscriptsubscriptℝabsent0𝑀𝑁\mathbf{S}\in\mathbb{R}_{\geq 0}^{M\times N} as a product of two low-rank non-negative matrices, 𝐖∈ℝ≥0M×K𝐖superscriptsubscriptℝabsent0𝑀𝐾\mathbf{W}\in\mathbb{R}_{\geq 0}^{M\times K} and 𝐇∈ℝ≥0K×N𝐇superscriptsubscriptℝabsent0𝐾𝑁\mathbf{H}\in\mathbb{R}_{\geq 0}^{K\times N}. Here, ℝ≥0M×Nsuperscriptsubscriptℝabsent0𝑀𝑁\mathbb{R}_{\geq 0}^{M\times N} denotes the set of matrices size M×N𝑀𝑁M\times N with real, non-negative elements. In the case of audio signals, we apply NMF on the magnitude spectrograms. The columns of 𝐖𝐖\mathbf{W} (NMF bases) learn spectral bases and the rows of 𝐇𝐇\mathbf{H} (NMF activations) indicate the weights of the bases in each frame of the spectrogram.
14
+
15
+ As described in [19], we can generalize these NMF models by interpreting them as a neural network. In the case of NMF, we can replace it by a two-layer NAE given by,
16
+
17
+ 1st layer:  (Encoder) ​𝐇1st layer:  (Encoder) 𝐇\displaystyle\text{$1^{\text{st}}$ layer:~{} (Encoder)~{}}\mathbf{H}=g​(𝐖‡⋅𝐒)absent𝑔⋅superscript𝐖‡𝐒\displaystyle=g(\mathbf{W^{\ddagger}}\cdot\mathbf{S})2nd layer:  (Decoder) ​𝐒^2nd layer:  (Decoder) ^𝐒\displaystyle\text{$2^{\text{nd}}$ layer:~{} (Decoder)~{}}\mathbf{\widehat{S}}=g​(𝐖⋅𝐇)absent𝑔⋅𝐖𝐇\displaystyle=g(\mathbf{W}\cdot\mathbf{H})(1)
18
+
19
+ In this equation, 𝐒����\mathbf{S} represents the input spectrogram, the decoder weights 𝐖𝐖\mathbf{W} gives the equivalent of NMF bases and the encoder output 𝐇𝐇\mathbf{H} gives the equivalent of the NMF activations. The weights of the encoder 𝐖‡superscript𝐖‡\mathbf{W^{\ddagger}} represent a form of a pseudo-inverse matrix that can be applied to the input spectrogram to get the activations. The non-linearity g(.):𝐑→𝐑≥0g(.):\mathbf{R}\rightarrow\mathbf{R}_{\geq 0} operates element-wise and maps a real number to the space of positive-real numbers. This allows the network to learn a non-negative 𝐇𝐇\mathbf{H} and a non-negative reconstruction 𝐒^^𝐒\mathbf{\widehat{S}} of the input 𝐒𝐒\mathbf{S}. Unlike NMF, the decoder weights need not be strictly non-negative. But, under suitable sparsity constraints on the activations 𝐇𝐇\mathbf{H}, they can be shown to be non-negative like NMF bases [19, 20].
20
+
21
+ Eq. 1 defines the encoder and decoder of our NAE to be a single dense-layer. However, we are not necessarily restricted by this formulation. We can now take advantage of the modeling flexibility of neural networks and develop complex encoder and decoder architectures that adhere to the above format. In particular, multi-layer [19] and convolutional extensions [20] have shown significant performance improvement compared to a single dense-layer encoder and decoder given in Eq. 1. Probabilistic equivalents of these models using variational NAEs have also been proposed [21, 22]. As before, the weights of the decoder act as a representative model for the source. The output of the encoder indicates the corresponding activations of the model to explain the input to the autoencoder.
22
+
23
+ In addition to using complex architectures, recent neural network approaches for source separation operate on the mixture waveforms and estimate the waveforms of the constituent sources directly. Adopting such end-to-end approaches has yielded a significant boost in separation performance using neural networks [2, 5]. Even in the case of NMF, learning a front-end transform has led to significant improvements [23, 24].
24
+
25
+ To introduce end-to-end processing capabilities into our NAE, we replace the front-end transform step by a 1D-convolutional layer. To get a non-negative representation like the magnitude spectrogram, we use a softplus non-linearity for the layer. To transform back into the waveform from the latent representation, we use a transposed 1D-convolutional layer. These modifications allow the network to accept a waveform and learn a trainable latent representation that is optimal for representing a particular source. As we will show in Section 3, this also enables operating simultaneously on multiple customized latent representations corresponding to the different sources in the mixture, to extract the sources. Fig. 1(b) shows the block diagram of our end-to-end NAE.
26
+
27
+ Having developed the end-to-end NAE architecture, we now show how we can use it for end-to-end source separation. Like NMF, source separation using end-to-end NAEs is a two-step process,Step 1: Learn suitable end-to-end NAE models for all the sources we expect to encounter in the mixture. We refer to this as the “training” step. Step 2: Given an unseen mixture, fit the trained models to explain the contributions of the individual sources in the mixture. We refer to this as the “inference” step.
28
+
29
+ To extract the sources, we use the pre-trained end-to-end NAEs from the training step to construct an inference network. In this paper, we consider two distinct inference frameworks. As shown in [19], the decoders of the pre-trained NAEs sufficiently act as representative models. Extending the same idea, the decoders of our pre-trained end-to-end NAEs can be used to separate sources in the inference step. It is important to emphasize here that when we refer to the “decoder” in case of end-to-end NAEs, it contains the NAE decoder 𝒟𝒟\mathcal{D} followed by the transposed-1D convolution layer. The block diagram of the inference network using the pre-trained end-to-end decoders is shown in Fig. LABEL:fig:inference_latent. At the outputs of the decoders, we can directly access the waveforms of the individual sources. Consequently, the goal of the inference step is to extract the source waveforms 𝐬𝐢subscript𝐬𝐢\mathbf{s_{i}} for i∈1,2,…​K𝑖12…𝐾i\in{1,2,\dots K}, given the mixture waveform 𝐱𝐦subscript𝐱𝐦\mathbf{x_{m}} and the pre-trained decoders. To get these decoder outputs, we need to estimate the activations 𝐇θ𝐢subscript𝐇subscript𝜃𝐢\mathbf{H_{\theta_{i}}} for all the sources in the mixture. In other words, during the inference step, we optimize towards finding the right inputs to the inference network. The subscript θ𝜃\mathbf{\theta} serves to denote the trainable parameters of our inference network.
30
+
31
+ The above inference procedure ignores the encoder in constructing the inference network. Incorporating the pre-trained encoder could potentially improve separation performance. Thus, we consider an alternative approach where the inference network uses the whole pre-trained end-to-end NAE. As before, we optimize to find the right inputs 𝐬θ𝐢subscript𝐬subscript𝜃𝐢\mathbf{s_{\theta_{i}}} to the inference network such that the outputs add up to explain the mixture. In this version of inference, we are optimizing on the space of waveforms as opposed to the space of activations. Fig. 2(b) describes this inference approach as a block diagram.
32
+
33
+ To develop an intuition on the complexity of the inference optimization, we can compare the number of trainable parameters for the two inference approaches for a 111-second test example. For a sampling rate of 161616 kHz, a 646464 dimensional activation matrix for each source and a stride of 323232 samples for the front-end 1D-convolutional layer, the number of trainable parameters can be given by 16,000⋅6432=32,000formulae-sequence16⋅00064323200016,000\cdot\frac{64}{32}=32,000 parameters per source. The second inference approach optimizes to estimate the waveforms as the parameters and trains for 16,0001600016,000 parameters per source. Thus, the inference optimization happens on a significantly smaller parameter space compared to training standard neural networks. In addition, applying the inference step for longer test examples can possibly be done in batches, reducing the inference time further.
34
+
35
+ In the case of discriminative end-to-end models, using cost-functions motivated by SDR have led to several promising results [9, 25]. We can use these waveform based cost-functions to train end-to-end NAEs, both during training and inference. For a reference waveform 𝐲𝐲\mathbf{y} and a network output 𝐱𝐱\mathbf{x}, we maximize a simplified version of SDR given by |⟨𝐱,𝐲⟩|2⟨𝐱,𝐱⟩superscript𝐱𝐲2𝐱𝐱\frac{|\left<\mathbf{x},~{}\mathbf{y}\right>|^{2}}{\left<\mathbf{x},~{}\mathbf{x}\right>}. Here, ⟨𝐱,𝐲⟩𝐱𝐲\left<\mathbf{x},~{}\mathbf{y}\right> represents the inner-product operation. Intuitively, we ask to maximize the sample correlation between 𝐱𝐱\mathbf{x} and 𝐲𝐲\mathbf{y} and while minimizing the energy of the solution.
36
+
37
+ We now consider the advantages that end-to-end NAEs have to offer when used for source separation. As stated previously, we can exploit the modeling flexibility afforded by neural networks to construct complex architectures that operate on the waveforms directly. In our experiments, we show that end-to-end NAE models are comparable to discriminative models in terms of separation performance. Although we require an optimization process during inference, we gain a significant advantage. End-to-end NAEs are developed as generalizations of NMF and we continue to retain its modular nature. Consequently, once we learn a model for a source, we can use the model on any mixture that contains the source and extract it, irrespective of the interferences in the mixture. Also, we can directly use the pre-trained models without the need for any data-augmentation, on a variety of test examples with varying characteristics. We also evaluate this capability of end-to-end NAEs in our experiments. In fact, the availability of an inference step where, we try to optimally fit the pre-trained models on an unseen mixture, allows us to use the same models for different test mixtures. In other words, the modularity of end-to-end NAEs is a consequence of having a trainable inference step. Finally, extending the model to operate on new types of sounds becomes extremely easy. All we need to do is to train an end-to-end NAE for the new source. We can then append the pre-trained model to the inference network to separate that source from given mixtures.
38
+
39
+ Having described the training and inference steps, we now present some experiments and their results to evaluate the performance of end-to-end NAEs for supervised single-channel source separation. Primarily, we focus on two experiments. The first experiment is aimed at comparing end-to-end NAEs to end-to-end discriminative source separation models, in terms of their separation performance. The second experiment is directed towards evaluating their modular nature. We begin with a description of our experimental setup.
40
+
41
+ For our experiments, we use the Device and Produced Speech (DAPS) dataset [26]. We use the clean speech examples from the dataset only, for our experiments. Of the 101010 male and 101010 female speakers, we use 888 male and 888 female speakers to construct the training set. We use the first 333 scripts to construct the training examples out of the 555 scripts available per speaker. This gives about 222 hours of training data for each class. To evaluate separation performance, we generate two test sets as follows. Test-set-1 is generated from the unused recordings of the speakers that are a part of the training set. The test examples in Test-set-2 come from the speakers not included in the training set. We down-sample the recordings to 161616 kHz and randomly draw 222-sec snippets for training and testing.
42
+
43
+ For the network configurations, we use a front-end 1D convolutional layer consisting of 256256256 filters of width 646464 samples and a stride of 323232 samples. The NAE encoder (ℰℰ\mathcal{E}) is formed by a cascade of two 1D-convolutional layers. The two layers have 128128128 and 646464 filters respectively, a filter width of 555 taps and a stride value of 111 respectively. Thus, the activation matrix for each source has a dimensionality of 646464. The decoder architecture is constructed to invert the activation matrix. Thus, the NAE decoder (𝒟𝒟\mathcal{D}) is constructed using two 1D transposed-convolutional layers of 128128128 and 256256256 filters, a filter width of 555 taps and a stride value of 111. Each convolutional layer is followed by a softplus non-linearity and a batch-norm operation. To transform the output of the NAE decoder 𝒟𝒟\mathcal{D} back into the waveform domain, we use a 1D transposed-convolutional layer having the same parameters as the front-end. In our experiments, we compare the performance of NAEs to discriminatively trained source separation models. For the discriminative model, we use the same architecture as an end-to-end NAE.
44
+
45
+ The first experiment is designed to compare the separation performance of end-to-end NAEs with discriminative source separation models. We train two end-to-end NAEs, one for the set of male speakers and the other for the set of female speakers. Using these pre-trained models, we apply the inference step on the test mixtures to get the separation results. The discriminative model used for comparison is trained as a denoising auto-encoder that separates the female speaker from a 00 dB mixture consisting of a male and a female speaker. We generate these 00 dB training examples by drawing random snippets from the training sets and mixing them. For evaluation, we generate 303030 test mixtures mixed at 00 dB for each test set. To reiterate, Test-set-1 is formed from speakers that are included in the training set. Test-set-2 is generated from speakers that are not included in the training set. The results are shown in Fig. LABEL:fig:exp1 as a box-plot of scale-invariant SDR (SISDR) [27, 7] values.
46
+
47
+ As shown in Fig. LABEL:fig:exp1, we compare the separation performance of three models: 1. End-to-end NAE with inference using decoder only (left) 2. End-to-end NAE with inference using entire model (middle) and 3. End-to-end discriminative source separation (right) over both the test-sets. We see that the separation performance of end-to-end NAEs with decoder based inference is comparable with end-to-end discriminative models over both the test sets. Using the entire model for inference results in a significant drop in separation performance. This can be attributed to the fact that inference on waveforms does not produce silences as effectively as inference on the activation matrices. Comparing with the performance on Test-set-2, we observe a dip in median SISDR on end-to-end NAE models. Also, the variance in SISDR values increases slightly. But, the separation performance looks about the same overall.
48
+
49
+ The second experiment aims to evaluate the modular nature of our end-to-end NAEs. We evaluate this by comparing the performance on mixtures with varying signal-to-noise ratio (SNR) levels. In the case of discriminative models, we cannot expect any reasonable separation results when there is a mismatch between the training and test mixtures encountered by the models. But, the model-fitting performed during the inference step for end-to-end NAEs allow the use of the pre-trained models even in mismatched cases. We generate 303030 test mixtures with SNR levels varying from −33-3 dB to 333 dB, taking the male speech as the reference. As before, we construct two test sets of 303030 mixtures each: test-set-111 from speakers included in the training set and test-set-222 from speakers that are not a part of the training examples. We compare across three models: 1. End-to-end NAE with decoder inference (left) 2. End-to-end NAE with fill model inference (middle) and 3. End-to-end discriminative source separation (right). We use the same models trained for the previous experiment in all the cases. The results are shown in Fig. 3(b)
50
+
51
+ We see that the end-to-end NAEs achieve a good separation even at these varying SNR levels, something not possible in the case of discriminative separation models as shown by their extremely poor performance. However, we also observe an increase in the range and variance of SISDR values for this experiment. As before, we see a drop in the median SISDR values and an increase in the variance, on Test-set-2 compared to Test-set-1. Despite this, the separation performance falls in the same range overall, indicating the efficacy of the trained model.
52
+
53
+ In this paper, we developed and investigated the use of end-to-end non-negative autoencoders for supervised source separation. These networks were developed as a generalization of NMF and can learn suitable models for the sources directly from their waveforms. Our experiments showed that these networks are comparable to discriminative source separation models in terms of their separation performance. Although these models exhibit a more computationally intensive inference step, they allow for additional extensions that discriminative models cannot easily facilitate. In addition to having an extensible architecture, the modular nature of end-to-end NAEs allowed us to separate sources from mixtures having a wide range of signal-to-noise ratios using the same pre-trained generative models for the sources.
1911.00111v1.txt ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Generative adversarial networks (GANs) [19] represent a power tool of training deep generative models, which have a profound impact on machine learning. In GANs, a generator tries to generate fake samples resembling the true data, while a discriminator tries to discriminate between the true and the fake data. The learning process for generator and discriminator can be deemed as an adversarial game that converges to some equilibrium point under reasonable assumptions.
2
+
3
+ Inspired by the success of GANs and classical generative models, developing their quantum counterparts is a natural and important topic in the emerging field of quantum machine learning [37, 5].There are at least two appealing reasons for which quantum GANs are extremely interesting. First, quantum GANs could provide potential quantum speedups due to the fact that quantum generators and discriminators (i.e., parameterized quantum circuits) cannot be efficiently simulated by classical generators/discriminators. In other words, there might exist distributions that can be efficiently generated by quantum GANs, while otherwise impossible with classical GANs. Second, simple prototypes of quantum GANs (i.e., executing simple parameterized quantum circuits), similar to those of the variational methods (e.g., [16, 30, 27]), are likely to be implementable on near-term noisy-intermediate-scale-quantum (NISQ) machines [33]. Since the seminal work of [25], there are quite a few proposals (e.g, [13, 4, 46, 39, 23, 34, 49]) of constructions of quantum GANs on how to encode quantum or classical data into this framework. Furthermore, [23, 49] also demonstrated proof-of-principle implementations of small-scale quantum GANs on actual quantum machines.
4
+
5
+ A lot of existing quantum GANs focus on using quantum generators to generate classical distributions. For truly quantum applications such as investigation of quantum systems in condensed matter physics or quantum chemistry, the ability to generate quantum data is also important. In contrast to the case of classical distributions, where the loss function measuring the difference between the real and the fake distributions can be borrowed directly from the classical GANs, the design of the loss function between real and fake quantum data as well as the efficient training of the corresponding GAN is much more challenging. The only existing results on quantum data either have a unique design specific to the 1-qubit case [13, 23], or suffer from robust training issues discussed below [4].
6
+
7
+ More importantly, classical GANs are well known for being delicate and somewhat unstable in training. In particular, it is known [1] that the choice of the metric between real and fake distributions will be critical for the stability of the performance in the training. A few widely used ones such as the Kullback-Leibler (KL) divergence, the Jensen-Shannon (JS) divergence, and the total variation (or statistical) distance are not sensible for learning distributions supported by low dimensional generative models. The shortcoming of these metrics will likely carry through to their quantum counterparts and hence quantum GANs based on these metrics will likely suffer from the same weaknesses in training.This training issue was not significant in the existing numerical study of quantum GANs in the 1-qubit case [13, 23]. However, as observed by [4] and us, the training issue becomes much more significant when the quantum system scales up, even just in the case of a few qubits.
8
+
9
+ To tackle the training issue of classical GANs, a lot of research has been conducted on the convergence of training GANs in classical machine learning. A seminal work [1] used Wasserstein distance (or, optimal transport distance) [43] as a metric for measuring the distance between real and fake distributions. Comparing to other measures (such as KL and JS), Wasserstein distance is more appealing from optimization perspective because of its continuity and smoothness. As a result, the corresponding Wasserstein GAN (WGAN) is promising for improving the training stability of GANs. There are a lot of subsequent studies on various modifications of the WGAN, such as GAN with regularized Wasserstein distance [35], WGAN with entropic regularizers [12, 38], WGAN with gradient penalty [20, 31], relaxed WGAN [21], etc.It is known [26] that WGAN and its variants such as [20] have demonstrated improved training stability compared to the original GAN formulation.
10
+
11
+ Contributions.  Inspired by the success of classical Wasserstein GANs and the need of smooth, robust, and scalable training methods for quantum GANs on quantum data, we propose the first design of quantum Wasserstein GANs (qWGANs). To this end, our technical contributions are multi-folded.
12
+
13
+ In Section 3, we propose a quantum counterpart of the Wasserstein distance, denoted by qW(P,Q)fragmentsqW(P,Q)\mathrm{qW}(P,Q) between quantum data P𝑃P and Q𝑄Q, inspired by [1, 43]. We prove that qW(⋅,⋅)fragmentsqW(⋅,⋅)\mathrm{qW}(\cdot,\cdot) is a semi-metric (i.e., a metric without the triangle inequality) over quantum data and inherits nice properties such as continuity and smoothness of the classical Wasserstein distance.We will discuss a few other proposals of quantum Wasserstein distances such as [29, 18, 32, 8, 9, 10, 45, 6] and in particular why most of them are not suitable for the purpose of generating quantum data in GANs.We will also discuss the limitation of our proposal of quantum Wasserstein semi-metric and hope its successful application in quantum GANs could provide another perspective and motivation to study this topic.
14
+
15
+ In Section 4, we show how to add the quantum entropic regularization to qW(⋅,⋅)fragmentsqW(⋅,⋅)\mathrm{qW}(\cdot,\cdot) to further smoothen the loss function in the spirit of the classical case (e.g., [35]). We then show the construction of our regularized quantum Wasserstein GAN (qWGAN) in Figure LABEL:fig:QWGAN-summary and describe the configuration and the parameterization of both the generator and the discriminator. Most importantly, we show that the evaluation of the loss function and the evaluation of the gradient of the loss function can be in principle efficiently implemented on quantum machines. This enables direct applications of classical training methods of GANs, such as alternating gradient-based optimization, to the quantum setting. It is a wide belief that classical computation cannot efficiently simulate quantum machines, in our case, the evaluation of the loss function and its gradient. Hence, the ability of evaluating them efficiently on quantum machines is critical for its scalability.
16
+
17
+ In Section 5, we supplement our theoretical results with experimental validations via classical simulation of qWGAN. Specifically, we demonstrate numerical performance of our qWGAN for quantum systems up to 8 qubits for pure states and up to 3 qubits for mixed states (i.e., mixture of pure states). Comparing to existing results [13, 23, 4], our numerical performance is more favorable in both the system size and its numerical stability.To give a rough sense, a single step in the classical simulation of the 8-qubit system involves multiple multiplications of 28×28fragments28282^{8}\times 2^{8} matrices. Learning a mixed state is much harder than learning pure states (a reasonable classical analogue of their difference is the one between learning a Gaussian distribution and learning a mixture of Gaussian distributions [2]).We present the only result for learning a true mixed state up to 3 qubits.
18
+
19
+ Furthermore, following a specific 4-qubit generator that is recently implemented on an ion-trap quantum machine [48] and a reasonable noise model on the same machine [47], we simulate the performance of our qWGAN with noisy quantum operations. Our result suggests that qWGAN can tolerant a reasonable amount of noise in quantum systems and still converge. This shows the possibility of implementing qWGAN on near-term (NISQ) machines [33].
20
+
21
+ Finally, we demonstrate a real-world application of qWGAN to approximate useful quantum application with large circuits by small ones. qWGAN can be used to approximate a potentially complicated unknown quantum state by a simple one when using a reasonably simple generator.We leverage this property and the Choi-Jamiołkowski isomorphism [28] between quantum operations and quantum states to generate a simple state that approximates another Choi-Jamiołkowski state corresponding to potentially complicated circuits in real quantum applications.The closeness in two Choi-Jamiołkowski states of quantum circuits will translate to the average output closeness between two quantum circuits over random input states.Specifically, we show that the quantum Hamiltonian simulation circuit for 1-d 3-qubit Heisenberg model in [11] can be approximated by a circuit of 52 gates with an average output fidelity over 0.9999 and a worst-case error 0.15.The best-known circuit based on the product formula will need ∼similar-to\sim11900 gates, however, with a worst-case error 0.001.
22
+
23
+ Related results.  All existing quantum GANs [25, 13, 4, 46, 39, 23, 34, 49], no matter dealing with classical or quantum data, have not investigated the possibility of using the Wasserstein distance. The most relevant works to ours are [13, 4, 23] with specific GANs dealing with quantum data. As we discussed above,  [13, 23] only discussed the 1-qubit case (both pure and mixed) and [4] discussed the pure state case (up to 6 qubits) but with the loss function being the quantum counterpart of the total variation distance. Moreover, different from ours, the mixed state case in [13] is a labeled one: in addition to observing their mixture, one also gets a label of which pure state it is sampled from.
24
+
25
+ Let us first review the definition of Wasserstein distance and how it is used in classical WGANs.
26
+
27
+ Wasserstein distance  Consider two probability distributions p𝑝p and q𝑞q given by corresponding density functions p:𝒳→ℝ,q:𝒴→ℝfragmentsp:X→R,q:Y→Rp\colon\mathcal{X}\to\mathbb{R},q\colon\mathcal{Y}\to\mathbb{R}. Given a cost function c:𝒳×𝒴→ℝfragmentsc:XY→Rc\colon\mathcal{X}\times\mathcal{Y}\to\mathbb{R}, the optimal transport cost between p𝑝p and q𝑞q, known as the Kantorovich’s formulation [43], is defined asdc(p,q):=minπ∈Π(p,q)fragmentsd𝑐(p,q)assignfragmentsπΠ(p,q)\displaystyle d_{c}(p,q):=\min_{\pi\in\Pi(p,q)}∫𝒳∫𝒴π(x,y)c(x,y)dxdyfragments𝒳𝒴π(x,y)c(x,y)dxdy\displaystyle\int_{\mathcal{X}}\int_{\mathcal{Y}}\pi(x,y)c(x,y)\,\mathrm{d}x\,\mathrm{d}y(2.1)where Π(p,q)fragmentsΠ(p,q)\Pi(p,q) is the set of joint distributions π𝜋\pi having marginal distributions p𝑝p and q𝑞q, i.e., ∫𝒴π(x,y)dy=p(x)fragments𝒴π(x,y)dyp(x)\int_{\mathcal{Y}}\pi(x,y)\,\mathrm{d}y=p(x) and ∫𝒳π(x,y)dx=q(y)fragments𝒳π(x,y)dxq(y)\int_{\mathcal{X}}\pi(x,y)\,\mathrm{d}x=q(y).
28
+
29
+ Wasserstein GAN   The Wasserstein distance dc(p,q)fragmentsd𝑐(p,q)d_{c}(p,q) can be used as an objective for learning a real distribution q𝑞q by a parameterized function GθfragmentsG𝜃G_{\theta} that acts on a base distribution p𝑝p. Then the objective becomes learning parameters θ𝜃\theta such that dc(Gθ(p),q)fragmentsd𝑐(G𝜃(p),q)d_{c}(G_{\theta}(p),q) is minimized as follows:minθminπ∈Π(𝒫,𝒬)fragments𝜃fragmentsπΠ(P,Q)\displaystyle\min_{\theta}\min_{\pi\in\Pi(\mathcal{P},\mathcal{Q})}∫𝒳∫𝒴π(x,y)c(Gθ(x),y)dxdy.fragments𝒳𝒴π(x,y)c(G𝜃(x),y)dxdy.\displaystyle\int_{\mathcal{X}}\int_{\mathcal{Y}}\pi(x,y)c(G_{\theta}(x),y)\,\mathrm{d}x\,\mathrm{d}y.(2.2)In [1], Arjovsky et al. propose using the dual of (2.2) to formulate the original min-min problem into a min-max problem, i.e., a generative adversarial network, with the following form:minθmaxα,βfragments𝜃fragmentsα,β\displaystyle\min_{\theta}\max_{\alpha,\beta}\quad𝔼x∼𝒫[ϕα(x)]−𝔼y∼𝒬[ψβ(y)],fragmentsEfragmentsxsimilar-toP[ϕ𝛼(x)]Efragmentsysimilar-toQ[ψ𝛽(y)],\displaystyle\mathbb{E}_{x\sim\mathcal{P}}[\phi_{\alpha}(x)]-\mathbb{E}_{y\sim\mathcal{Q}}[\psi_{\beta}(y)],(2.3)s.tϕα(Gθ(x))−ψβ(y)≤c(Gθ(x),y),∀x,y,fragmentsϕ𝛼(G𝜃(x))ψ𝛽(y)c(G𝜃(x),y),for-allx,y,\displaystyle\phi_{\alpha}(G_{\theta}(x))-\psi_{\beta}(y)\leq c(G_{\theta}(x),y),\ \forall x,y,(2.4)where ϕ,ψfragmentsϕ,ψ\phi,\psi are functions parameterized by α,βfragmentsα,β\alpha,\beta respectively. This is advantageous because it is usually easier to parameterize functions rather than joint distributions. The constraint (2.4) is usually enforced by a regularizer term for actual implementation. Out of many choices of regularizers, the most relevant one to ours is the entropy regularizer in [35]. In the case that c(x,y)=∥x−y∥2fragmentsc(x,y)∥xy∥2c(x,y)=\lVert x-y\rVert_{2} and ϕ=ψfragmentsϕψ\phi=\psi in (2.3), the constraint is that ϕitalic-ϕ\phi must be a 111-Lipschitz function. This is often enforced by the gradient penalty method in a neural network used to parameterize ϕitalic-ϕ\phi.
30
+
31
+ Mathematical formulation of quantum data  We refer curious readers to Supplemental Materials A for a more comprehensive introduction. Any quantum data (or quantum states) over space 𝒳𝒳\mathcal{X} (e.g., 𝒳=ℂdfragmentsXC𝑑\mathcal{X}=\mathbb{C}^{d}) can be mathematically described by a density operator ρ𝜌\rho that is a positive semidefinite matrix (i.e., ρ⪰0fragmentsρsucceeds-or-equals0\rho\succeq 0) with trace one (i.e., Tr(ρ)=1fragmentsTr(ρ)1\operatorname{Tr}(\rho)=1), and the set of which is denoted by 𝒟(𝒳)fragmentsD(X)\mathcal{D}(\mathcal{X}).
32
+
33
+ A quantum state ρ𝜌\rho is pure if rank(ρ)=1fragmentsrank(ρ)1\mathrm{rank}{(\rho)}=1; otherwise it is a mixed state.For a pure state ρ𝜌\rho, it can be represented by the outer-product of a unit vector v→∈ℂdfragments→𝑣C𝑑\vec{v}\in\mathbb{C}^{d}, i.e., ρ=v→v→†fragmentsρ→𝑣→𝑣†\rho=\vec{v}\vec{v}^{\dagger}, where ††\dagger refers to conjugate transpose.We can also use v→→𝑣\vec{v} to directly represent pure states. Mixed states are a classical mixture of pure states, e.g., ρ=∑ipivi→vi→†fragmentsρ𝑖p𝑖→fragmentsv𝑖→fragmentsv𝑖†\rho=\sum_{i}p_{i}\vec{v_{i}}\vec{v_{i}}^{\dagger} where pifragmentsp𝑖p_{i}s form a classical distribution and vi→→fragmentsv𝑖\vec{v_{i}}s are all unit vectors.
34
+
35
+ Quantum states in a composed system of 𝒳𝒳\mathcal{X} and 𝒴𝒴\mathcal{Y} are represented by density operators ρ𝜌\rho over the Kronecker-product space 𝒳⊗𝒴fragmentsXtensor-productY\mathcal{X}\otimes\mathcal{Y} with dimension dim(𝒳)dim(𝒴)fragmentsdimension(X)dimension(Y)\dim(\mathcal{X})\dim(\mathcal{Y}). 1-qubit systems refer to 𝒳=ℂ2fragmentsXC2\mathcal{X}=\mathbb{C}^{2}. A 2-qubit system has dimension 4 (𝒳⊗2fragmentsXfragmentstensor-product2\mathcal{X}^{\otimes 2}) and an n𝑛n-qubit system has dimension 2nfragments2𝑛2^{n}.The partial trace operation Tr𝒳(⋅)fragmentsTr𝒳(⋅)\operatorname{Tr}_{\mathcal{X}}(\cdot) (resp. Tr𝒴(⋅)fragmentsTr𝒴(⋅)\operatorname{Tr}_{\mathcal{Y}}(\cdot)) is a linear mapping from ρ𝜌\rho to its marginal state on 𝒴𝒴\mathcal{Y} (resp. 𝒳𝒳\mathcal{X}).
36
+
37
+ From classical to quantum data   Classical distributions p,qfragmentsp,qp,q in (2.1) can be viewed as special mixed states 𝒫∈𝒟(𝒳),𝒬∈𝒟(𝒴)fragmentsPD(X),QD(Y)\mathcal{P}\in\mathcal{D}(\mathcal{X}),\mathcal{Q}\in\mathcal{D}(\mathcal{Y}) where 𝒫,𝒬fragmentsP,Q\mathcal{P},\mathcal{Q} are diagonal and p,qfragmentsp,qp,q (viewed as density vectors) are the diagonals of 𝒫𝒫\mathcal{P}, 𝒬𝒬\mathcal{Q} respectively. Note that this is different from the conventional meaning of samples from classical distributions, which are random variables with the corresponding distributions.
38
+
39
+ This distinction is important to understand quantum data as the former (i.e., density operators) rather than the latter (i.e., samples) actually represents the entity of quantum data. This is because there are multiple ways (different quantum measurements) to read out classical samples out of quantum data for one fixed density operator. Mathematically, this is because density operators in general can have off-diagonal terms and quantum measurements can happen along arbitrary bases.
40
+
41
+ Consider 𝒳𝒳\mathcal{X} and 𝒴𝒴\mathcal{Y} from (2.1) being finite sets. We can express the classical Wasserstein distance (2.1) as a special case of the matrix formulation of quantum data. Precisely, we can replace the integral in (2.1) by summation, which can be then expressed by the trace of πCfragmentsπC\pi C where C𝐶C is a diagonal matrix with c(x,y)fragmentsc(x,y)c(x,y) in the diagonal. π𝜋\pi is also a diagonal matrix expressing the coupling distribution π(x,y)fragmentsπ(x,y)\pi(x,y) of p,qfragmentsp,qp,q. Namely, π𝜋\pi’s diagonal is π(x,y)fragmentsπ(x,y)\pi(x,y) and satisfies the coupling marginal condition Tr𝒴(π)=PfragmentsTr𝒴(π)P\operatorname{Tr}_{\mathcal{Y}}(\pi)=P and Tr𝒳(π)=QfragmentsTr𝒳(π)Q\operatorname{Tr}_{\mathcal{X}}(\pi)=Q where P,QfragmentsP,QP,Q are diagonal matrices with the distribution of p,qfragmentsp,qp,q in the diagonal, respectively. As a result, the Kantorovich’s optimal transport in (2.1) can be reformulated asdc(p,q):=minπTr(πC)fragmentsd𝑐(p,q)assign𝜋Tr(πC)\displaystyle d_{c}(p,q):=\min_{\pi}\operatorname{Tr}(\pi C)(3.1)s.t.Tr𝒴(π)=diag{p(x)},Tr𝒳(π)=diag{q(y)},π∈𝒟(𝒳⊗𝒴),fragmentsTr𝒴(π)diag{p(x)},Tr𝒳(π)diag{q(y)},πD(Xtensor-productY),\displaystyle\operatorname{Tr}_{\mathcal{Y}}(\pi)=\mathrm{diag}\{p(x)\},\ \operatorname{Tr}_{\mathcal{X}}(\pi)=\mathrm{diag}\{q(y)\},\ \pi\in\mathcal{D}(\mathcal{X}\otimes\mathcal{Y}),where C=diag{c(x,y)}fragmentsCdiag{c(x,y)}C=\mathrm{diag}\{c(x,y)\}. Note that (3.1) is effectively a linear program.
42
+
43
+ Quantum Wasserstein semimetric   Our matrix reformulation of the classical Wasserstein distance (2.1) suggests a naive extension to the quantum setting as follows. Let qW(𝒫,𝒬)fragmentsqW(P,Q)\mathrm{qW}(\mathcal{P},\mathcal{Q}) denote the quantum Wasserstein semimetric between 𝒫∈𝒟(𝒳),𝒬∈𝒟(𝒴)fragmentsPD(X),QD(Y)\mathcal{P}\in\mathcal{D}(\mathcal{X}),\mathcal{Q}\in\mathcal{D}(\mathcal{Y}), which is defined byqW(𝒫,𝒬):=minπTr(πC)fragmentsqW(P,Q)assign𝜋Tr(πC)\displaystyle\mathrm{qW}(\mathcal{P},\mathcal{Q}):=\min_{\pi}\operatorname{Tr}(\pi C)(3.2)s.t.Tr𝒴(π)=𝒫,Tr𝒳(π)=𝒬,π∈𝒟(𝒳⊗𝒴),fragmentsTr𝒴(π)P,Tr𝒳(π)Q,πD(Xtensor-productY),\displaystyle\operatorname{Tr}_{\mathcal{Y}}(\pi)=\mathcal{P},\ \operatorname{Tr}_{\mathcal{X}}(\pi)=\mathcal{Q},\ \pi\in\mathcal{D}(\mathcal{X}\otimes\mathcal{Y}),where C𝐶C is a matrix over 𝒳⊗𝒴fragmentsXtensor-productY\mathcal{X}\otimes\mathcal{Y} that should refer to some cost-type function. The choice of C𝐶C is hence critical to make sense of the definition. First, matrix C𝐶C needs to be Hermitian (i.e., C=C†fragmentsCC†C=C^{\dagger}) to make sure that qW(⋅,⋅)fragmentsqW(⋅,⋅)\mathrm{qW}(\cdot,\cdot) is real. A natural attempt is to use C=diag{c(x,y)}fragmentsCdiag{c(x,y)}C=\mathrm{diag}\{c(x,y)\} from (3.1), which turns out to be significantly wrong.This is because qW(v→v→†,v→v→†)fragmentsqW(→𝑣→𝑣†,→𝑣→𝑣†)\mathrm{qW}(\vec{v}\vec{v}^{\dagger},\vec{v}\vec{v}^{\dagger}) will be strictly greater than zero for random choice of unit vector v→→𝑣\vec{v} in that case. This demonstrates a crucial difference between classical and quantum data: while classical information is always stored in the diagonal (or computational basis) of the space, quantum information can be stored off-diagonally (or in an arbitrary basis of the space). Thus, choosing a diagonal C𝐶C fails to detect the off-diagonal information in quantum data.
44
+
45
+ Our proposal is to leverage the concept of symmetric subspace in quantum information [22] to make sure that qW(P,P)=0fragmentsqW(P,P)0\mathrm{qW}(P,P)=0 for any P𝑃P. The projection onto the symmetric subspace is defined byΠsym:=12(I𝒳⊗𝒴+SWAP),fragmentsΠsymassign12(IfragmentsXtensor-productYSWAP),\displaystyle\Pi_{\text{sym}}:=\frac{1}{2}(\mathrm{I}_{\mathcal{X}\otimes\mathcal{Y}}+\mathrm{SWAP}),(3.3)where I𝒳⊗𝒴fragmentsIfragmentsXtensor-productY\mathrm{I}_{\mathcal{X}\otimes\mathcal{Y}} is the identity operator over 𝒳⊗𝒴fragmentsXtensor-productY\mathcal{X}\otimes\mathcal{Y} and SWAPSWAP\operatorname{\mathrm{SWAP}} is the operator such that SWAP(x→⊗y→)=(y→⊗x→),∀x→∈𝒳,y→∈𝒴fragmentsSWAP(→𝑥tensor-product→𝑦)(→𝑦tensor-product→𝑥),for-all→𝑥X,→𝑦Y\operatorname{\mathrm{SWAP}}(\vec{x}\otimes\vec{y})=(\vec{y}\otimes\vec{x}),\forall\vec{x}\in\mathcal{X},\vec{y}\in\mathcal{Y}.111One needs that 𝒳𝒳\mathcal{X} is isometric to 𝒴𝒴\mathcal{Y} to well define ΠsymfragmentsΠsym\Pi_{\text{sym}}. However, this is without loss of generality by choosing appropriate and potentially larger spaces 𝒳𝒳\mathcal{X} and 𝒴𝒴\mathcal{Y} to describe quantum data.It is well known that Πsym(u→⊗u→)=u→⊗u→fragmentsΠsym(→𝑢tensor-product→𝑢)→𝑢tensor-product→𝑢\Pi_{\text{sym}}(\vec{u}\otimes\vec{u})=\vec{u}\otimes\vec{u} for all unit vectors u𝑢u. With this property and by choosing C𝐶C to be the complement of ΠsymfragmentsΠsym\Pi_{\text{sym}}, i.e.,C:=I𝒳⊗𝒴−Πsym=12(I𝒳⊗𝒴−SWAP),fragmentsCassignIfragmentsXtensor-productYΠsym12(IfragmentsXtensor-productYSWAP),\displaystyle C:=\mathrm{I}_{\mathcal{X}\otimes\mathcal{Y}}-\Pi_{\text{sym}}=\frac{1}{2}(\mathrm{I}_{\mathcal{X}\otimes\mathcal{Y}}-\operatorname{\mathrm{SWAP}}),(3.4)we can show qW(P,P)=0fragmentsqW(P,P)0\mathrm{qW}(P,P)=0 for any P𝑃P. This is achieved by choosing π=∑iλi(vi→vi→†⊗vi→vi→†)fragmentsπ𝑖λ𝑖(→fragmentsv𝑖→fragmentsv𝑖†tensor-product→fragmentsv𝑖→fragmentsv𝑖†)\pi=\sum_{i}\lambda_{i}(\vec{v_{i}}\vec{v_{i}}^{\dagger}\otimes\vec{v_{i}}\vec{v_{i}}^{\dagger}) given P𝑃P’s spectral decomposition P=∑iλivi→vi→†fragmentsP𝑖λ𝑖→fragmentsv𝑖→fragmentsv𝑖†P=\sum_{i}\lambda_{i}\vec{v_{i}}\vec{v_{i}}^{\dagger}. Moreover, we can show
46
+
47
+ Even though our definition of qW(⋅,⋅)fragmentsqW(⋅,⋅)\mathrm{qW}(\cdot,\cdot), especially the choice of C𝐶C, does not directly come from a cost function c(x,y)fragmentsc(x,y)c(x,y) over 𝒳𝒳\mathcal{X} and 𝒴𝒴\mathcal{Y}, it however still encodes some geometry of the space of quantum states. For example, let P=v→v→†fragmentsP→𝑣→𝑣†P=\vec{v}\vec{v}^{\dagger} and Q=u→u→†fragmentsQ→𝑢→𝑢†Q=\vec{u}\vec{u}^{\dagger}, qW(P,Q)fragmentsqW(P,Q)\mathrm{qW}(P,Q) becomes 0.5 (1−|u→†v→|2)fragments(1|→𝑢†→𝑣|2)(1-|\vec{u}^{\dagger}\vec{v}|^{2}) where |u→†v→|fragments|→𝑢†→𝑣||\vec{u}^{\dagger}\vec{v}| depends on the angle between u→→𝑢\vec{u} and v→→𝑣\vec{v} which are unit vectors representing (pure) quantum states.
48
+
49
+ The dual form of qW(⋅,⋅)fragmentsqW(⋅,⋅)\mathrm{qW}(\cdot,\cdot)   The formulation of qW(⋅,⋅)fragmentsqW(⋅,⋅)\mathrm{qW}(\cdot,\cdot) in (3.2) is given by a semidefinite program (SDP), opposed to the classical form in (3.1) given by a linear program. Its dual form is as follows.maxϕ,ψfragmentsfragmentsϕ,ψ\displaystyle\max_{\phi,\psi}\quadTr(Qψ)−Tr(Pϕ)fragmentsTr(Qψ)Tr(Pϕ)\displaystyle\operatorname{Tr}(Q\psi)-\operatorname{Tr}(P\phi)(3.5)s.t.I𝒳⊗ψ−ϕ⊗I𝒴⪯C,ϕ∈ℋ(𝒳),ψ∈ℋ(𝒴),fragmentsI𝒳tensor-productψϕtensor-productI𝒴precedes-or-equalsC,ϕH(X),ψH(Y),\displaystyle\mathrm{I}_{\mathcal{X}}\otimes\psi-\phi\otimes\mathrm{I}_{\mathcal{Y}}\preceq C,\phi\in\mathcal{H}(\mathcal{X}),\ \psi\in\mathcal{H}(\mathcal{Y}),where ℋ(𝒳),ℋ(𝒴)fragmentsH(X),H(Y)\mathcal{H}(\mathcal{X}),\mathcal{H}(\mathcal{Y}) denote the set of Hermitian matrices over space 𝒳𝒳\mathcal{X} and 𝒴𝒴\mathcal{Y}.We further show the strong duality for this SDP in Supplemental Materials B. Thus, both the primal (3.2) and the dual (3.5) can be used as the definition of qW(⋅,⋅)fragmentsqW(⋅,⋅)\mathrm{qW}(\cdot,\cdot).
50
+
51
+ Comparison with other quantum Wasserstein metrics   There have been a few different proposals that introduce matrices into the original definition of classical Wasserstein distance. We will compare these definitions with ours and discuss whether they are appropriate in our context of quantum GANs.
52
+
53
+ A few of these proposals (e.g., [7, 9, 10]) extend the dynamical formulation of Benamou and Brenier [3] in optimal transport to the matrix/quantum setting. In this formulation, couplings are defined not in terms of joint density measures, but in terms of smooth paths t→ρ(x,t)fragmentst→ρ(x,t)t\rightarrow\rho(x,t) in the space of densities that satisfy some continuity equation with some time dependent vector field v(x,t)fragmentsv(x,t)v(x,t) inspired by physics. A pair {ρ(⋅,⋅),v(⋅,⋅)}fragments{ρ(⋅,⋅),v(⋅,⋅)}\{\rho(\cdot,\cdot),v(\cdot,\cdot)\} is said to couple P𝑃P and Q𝑄Q, the set of which is denoted C(P,Q)fragmentsC(P,Q)C(P,Q), if ρ(x,t)fragmentsρ(x,t)\rho(x,t) is a smooth path with ρ(⋅,0)=Pfragmentsρ(⋅,0)P\rho(\cdot,0)=P and ρ(⋅,1)=Qfragmentsρ(⋅,1)Q\rho(\cdot,1)=Q. The 2-Wasserstein distance isW2(P,Q)=inf{ρ(⋅,⋅),v(⋅,⋅)}∈C(P,Q)12∫01∫Rn|v(x,t)|2ρ(x,t)dxdt.fragmentsW2(P,Q)infimumfragments{ρ(⋅,⋅),v(⋅,⋅)}C(P,Q)1201fragmentsR𝑛|v(x,t)|2ρ(x,t)dxdt.\displaystyle\mathrm{W}_{2}(P,Q)=\inf_{\{\rho(\cdot,\cdot),v(\cdot,\cdot)\}\in C(P,Q)}\frac{1}{2}\int_{0}^{1}\int_{R^{n}}|v(x,t)|^{2}\rho(x,t)\,\mathrm{d}x\,\mathrm{d}t.(3.6)The above formulation seems difficult to manipulate in the context of GAN. It is unclear (a) whether the above definition has a favorable duality to admit the adversarial training and (b) whether the physics-inspired quantities like v(x,t)fragmentsv(x,t)v(x,t) are suitable for the purpose of generating fake quantum data.
54
+
55
+ A few other proposals (e.g., [29, 32]) introduce the matrix-valued mass defined by a function μ:X→Cn×nfragmentsμ:X→Cfragmentsnn\mu:X\rightarrow C^{n\times n} over domain X𝑋X, where μ(x)fragmentsμ(x)\mu(x) is positive semidefinite and satisfies Tr(∫Xμ(x)dx)=1fragmentsTr(𝑋μ(x)dx)1\operatorname{Tr}(\int_{X}\mu(x)dx)=1. Instead of considering transport probability masses from X𝑋X to Y𝑌Y, one considers transporting a matrix-valued mass μ0(x)fragmentsμ0(x)\mu_{0}(x) on X𝑋X to another matrix-valued mass μ1(y)fragmentsμ1(y)\mu_{1}(y) on Y𝑌Y.One can similarly define the Kantorovich’s coupling π(x,y)fragmentsπ(x,y)\pi(x,y) of μ0(x)fragmentsμ0(x)\mu_{0}(x) and μ1(y)fragmentsμ1(y)\mu_{1}(y), and define the Wasserstein distance based on a slight different combination of π(x,y)fragmentsπ(x,y)\pi(x,y) and c(x,y)fragmentsc(x,y)c(x,y) comparing to (2.1).This definition, however, fails to derive a new metric between two matrices. This is because the defined Wasserstein distance still measures the distance between X𝑋X and Y𝑌Y based on some induced measure (∥⋅∥Ffragments∥⋅∥𝐹\|\cdot\|_{F}) on the dimension-n𝑛n matrix space. This is more evident when X={P}fragmentsX{P}X=\{P\} and Y={Q}fragmentsY{Q}Y=\{Q\}. The Wasserstein distance reduces to c(x,y)+∥P−Q∥F2fragmentsc(x,y)∥PQ∥𝐹2c(x,y)+\|P-Q\|_{F}^{2} where the Frobenius norm (∥⋅∥Ffragments∥⋅∥𝐹\|\cdot\|_{F}) is directly used in the definition.
56
+
57
+ The proposals in [18, 6] are very similar to us in the sense they define the same coupling in the Kantorovich’s formulation as ours. However, their definition of the Wasserstein distance motivated by physics is induced by unbounded operator applied on continuous space, e.g., ∇xfragments∇𝑥\nabla_{x}, divxfragmentsdiv𝑥\mathrm{div}_{x}. This makes their definition only applicable to continuous space, rather than qubits in our setting.
58
+
59
+ The closest result to ours is [45], although the authors haven’t proposed one concrete quantum Wasserstein metric. Instead, they formulate a general form of reasonable quantum Wasserstein metrics between finite-dimensional quantum states and prove that Kantorovich-Rubinstein theorem does not hold under this general form. Namely, they show the trace distance between quantum states cannot be determined by any quantum Wasserstein metric out of their general form.
60
+
61
+ Limitation of our qW(⋅,⋅)fragmentsqW(⋅,⋅)\mathrm{qW}(\cdot,\cdot)   Although we have successfully implemented qWGAN based on our qW(⋅,⋅)fragmentsqW(⋅,⋅)\mathrm{qW}(\cdot,\cdot) and observed improved numerical performance, there are a few perspectives about qW(⋅,⋅)fragmentsqW(⋅,⋅)\mathrm{qW}(\cdot,\cdot) worth further investigation. First, numerical study reveals that qW(⋅,⋅)fragmentsqW(⋅,⋅)\mathrm{qW}(\cdot,\cdot) does not satisfy the triangle inequality.Second, our qW(⋅,⋅)fragmentsqW(⋅,⋅)\mathrm{qW}(\cdot,\cdot) does not come from an explicit cost function, even though it encodes some geometry of the quantum state space.We conjecture that there could be a concrete underlying cost function and our qW(⋅,⋅)fragmentsqW(⋅,⋅)\mathrm{qW}(\cdot,\cdot) (or a related form) could be emerged as the 2-Wasserstein metric of that cost function.We hope our work provides an important motivation to further study this topic.
62
+
63
+ We describe the specific architecture of our qWGAN (Figure LABEL:fig:QWGAN-summary) and its training. Similar to (2.2) with the fake state P𝑃P from a parameterized quantum generator G𝐺G, considerminGminπfragments𝐺𝜋\displaystyle\min_{G}\min_{\pi}\quadTr(πC)fragmentsTr(πC)\displaystyle\operatorname{Tr}(\pi C)(4.1)s.t.Tr𝒴(π)=P,Tr𝒳(π)=Q,π∈𝒟(𝒳⊗𝒴),fragmentsTr𝒴(π)P,Tr𝒳(π)Q,πD(Xtensor-productY),\displaystyle\operatorname{Tr}_{\mathcal{Y}}(\pi)=P,\operatorname{Tr}_{\mathcal{X}}(\pi)=Q,\pi\in\mathcal{D}(\mathcal{X}\otimes\mathcal{Y}),or similar to (2.3) by taking the dual from (3.5),minGmaxϕ,ψfragments𝐺fragmentsϕ,ψ\displaystyle\min_{G}\max_{\phi,\psi}\quadTr(Qψ)−Tr(Pϕ)=𝔼Q[ψ]−𝔼P[ϕ]fragmentsTr(Qψ)Tr(Pϕ)E𝑄[ψ]E𝑃[ϕ]\displaystyle\operatorname{Tr}(Q\psi)-\operatorname{Tr}(P\phi)=\mathbb{E}_{Q}[\psi]-\mathbb{E}_{P}[\phi](4.2)s.t.I𝒳⊗ψ−ϕ⊗I𝒴⪯C,ϕ∈ℋ(𝒳),ψ∈ℋ(𝒴),fragmentsI����tensor-productψϕtensor-productI𝒴precedes-or-equalsC,ϕH(X),ψH(Y),\displaystyle\mathrm{I}_{\mathcal{X}}\otimes\psi-\phi\otimes\mathrm{I}_{\mathcal{Y}}\preceq C,\phi\in\mathcal{H}(\mathcal{X}),\ \psi\in\mathcal{H}(\mathcal{Y}),where we abuse the notation of 𝔼Q[ψ]:=Tr(Qψ)fragmentsE𝑄[ψ]assignTr(Qψ)\mathbb{E}_{Q}[\psi]\vcentcolon=\operatorname{Tr}(Q\psi), which refers to the expectation of the outcome of measuring Hermitian ψ𝜓\psi on quantum state Q𝑄Q.We hence refer ϕ,ψfragmentsϕ,ψ\phi,\psi as the discriminator.
64
+
65
+ The dual form (4.2) is inconvenient for optimizing directly due to the constraint I𝒳⊗ψ−ϕ⊗I𝒴⪯CfragmentsI𝒳tensor-productψϕtensor-productI𝒴precedes-or-equalsC\mathrm{I}_{\mathcal{X}}\otimes\psi-\phi\otimes\mathrm{I}_{\mathcal{Y}}\preceq C.Inspired by the entropy regularizer in the classical setting (e.g., [35]), we add a quantum-relative-entropy-based regularizerbetween π𝜋\pi and P⊗QfragmentsPtensor-productQP\otimes Q with a tunable parameter λ𝜆\lambda to (4.1) to obtainminGminπfragments𝐺𝜋\displaystyle\min_{G}\min_{\pi}\quadTr(πC)+λTr(πlog(π)−πlog(P⊗Q))fragmentsTr(πC)λTr(π(π)π(Ptensor-productQ))\displaystyle\operatorname{Tr}(\pi C)+\lambda\operatorname{Tr}(\pi\log(\pi)-\pi\log(P\otimes Q))(4.3)s.t.Tr𝒴(π)=P,Tr𝒳(π)=Q,π∈𝒟(𝒳⊗𝒴).fragmentsTr𝒴(π)P,Tr𝒳(π)Q,πD(Xtensor-productY).\displaystyle\operatorname{Tr}_{\mathcal{Y}}(\pi)=P,\operatorname{Tr}_{\mathcal{X}}(\pi)=Q,\pi\in\mathcal{D}(\mathcal{X}\otimes\mathcal{Y}).Using duality and the Golden-Thomposon inequality [17, 40], we can approximate (4.3) byminGmaxϕ,ψ𝔼Q[ψ]−𝔼P[ϕ]−𝔼P⊗Q[ξR]s.t.ϕ∈ℋ(𝒳),ψ∈ℋ(𝒴),fragments𝐺fragmentsϕ,ψE𝑄[ψ]E𝑃[ϕ]EfragmentsPtensor-productQ[ξ𝑅]s.t.ϕH(X),ψH(Y),\displaystyle\min_{G}\max_{\phi,\psi}\quad\mathbb{E}_{Q}[\psi]-\mathbb{E}_{P}[\phi]-\mathbb{E}_{P\otimes Q}[\xi_{R}]\quad\text{s.t.}\ \ \phi\in\mathcal{H}(\mathcal{X}),\ \psi\in\mathcal{H}(\mathcal{Y}),(4.4)where ξRfragmentsξ𝑅\xi_{R} refers to the regularizing HermitianξR=λeexp(−C−ϕ⊗I𝒴+I𝒳⊗ψλ).fragmentsξ𝑅𝜆𝑒(fragmentsCϕtensor-productI𝒴I𝒳tensor-productψ𝜆).\displaystyle\xi_{R}=\frac{\lambda}{e}\exp\left(\frac{-C-\phi\otimes\mathrm{I}_{\mathcal{Y}}+\mathrm{I}_{\mathcal{X}}\otimes\psi}{\lambda}\right).(4.5)Similar to [35], we prove that this entropic regularization ensures that the objective for the outer minimization problem (4.4) is differentiable in P𝑃P. (Proofs are given in Supplemental Materials B.2.)
66
+
67
+ Generator G𝐺G is a quantum operation that generates P𝑃P from a fixed initial state ρ0fragmentsρ0\rho_{0} (e.g., the classical all-zero state e→0fragments→𝑒0\vec{e}_{0}). Specifically, generator G𝐺G can be described by an ensemble {(p1,U1),…,(pr,Ur)}fragments{(p1,U1),…,(p𝑟,U𝑟)}\{(p_{1},U_{1}),\dots,(p_{r},U_{r})\} that means applying the unitary UifragmentsU𝑖U_{i} with probability pifragmentsp𝑖p_{i}. The distribution {p1,…,pr}fragments{p1,…,p𝑟}\{p_{1},\ldots,p_{r}\} can be parameterized directly or through some classical generative network. The rank of the generated state is r𝑟r (r=1fragmentsr1r=1 for pure states and r>1fragmentsr1r>1 for mixed states). Our experiments include the cases r=1,2fragmentsr1,2r=1,2.
68
+
69
+ Each unitary UifragmentsU𝑖U_{i} refers to a quantum circuit consisting of simple parameterized 1-qubit and 2-qubit Pauli-rotation quantum gates (see the right of Figure LABEL:fig:QWGAN-summary). These Pauli gates can be implemented on near-term machines (e.g., [48]) and also form a universal gate set for quantum computation. Hence, this generator construction is widely used in existing quantum GANs. The j𝑗jth gate in UifragmentsU𝑖U_{i} contains an angle θi,jfragmentsθfragmentsi,j\theta_{i,j} as the parameter. All variables pifragmentsp𝑖p_{i}, θi,jfragmentsθfragmentsi,j\theta_{i,j} constitute the set of parameters for the generator.
70
+
71
+ Discriminator ϕ,ψfragmentsϕ,ψ\phi,\psi can be parameterized at least in two ways. The first approach is to represent ϕ,ψfragmentsϕ,ψ\phi,\psi as linear combinations of tensor products of Pauli matrices, which form a basis of the matrix space (details on Pauli matrices and measurements can be found in Supplemental Materials A). Let ϕ=∑kαkAkfragmentsϕ𝑘α𝑘A𝑘\phi=\sum_{k}\alpha_{k}A_{k} and ψ=∑lβlBlfragmentsψ𝑙β𝑙B𝑙\psi=\sum_{l}\beta_{l}B_{l}, where Ak,BlfragmentsA𝑘,B𝑙A_{k},B_{l} are tensor products of Pauli matrices. To evaluate 𝔼P[ϕ]fragmentsE𝑃[ϕ]\mathbb{E}_{P}[\phi] (similarly for 𝔼Q[ψ]fragmentsE𝑄[ψ]\mathbb{E}_{Q}[\psi]), by linearity it suffices to collect the information of 𝔼P[Ak]fragmentsE𝑃[A𝑘]\mathbb{E}_{P}[A_{k}]s, which are simply Pauli measurements on the quantum state P𝑃P and amenable to experiments. Hence, αkfragmentsα𝑘\alpha_{k} and βlfragmentsβ𝑙\beta_{l} can be used as the parameters of the discriminator.The second approach is to represent ϕ,ψfragmentsϕ,ψ\phi,\psi as parameterized quantum circuits (similar to the G𝐺G) with a measurement in the computational basis. The set of parameters of ϕitalic-ϕ\phi (respectively ψ𝜓\psi) could be the parameters of the circuit and values associated with each measurement outcome. Our implementation mostly uses the first parameterization.
72
+
73
+ For the scalability of the training of the Regularized Quantum Wasserstein GAN, one must be able to evaluate the loss function L=𝔼Q[ψ]−𝔼P[ϕ]−𝔼P⊗Q[ξR]fragmentsLE𝑄[ψ]E𝑃[ϕ]EfragmentsPtensor-productQ[ξ𝑅]L=\mathbb{E}_{Q}[\psi]-\mathbb{E}_{P}[\phi]-\mathbb{E}_{P\otimes Q}[\xi_{R}] or its gradient efficiently on a quantum computer. Ideally, one would hope to directly approximate gradients by quantum computers to facilitate the training of qWGAN, e.g., by using the alternating gradient descent method. We show that it is indeed possible and outline the key steps. More details are in Supplemental Materials C.
74
+
75
+ Computing the loss function: Each unitary operation UifragmentsU𝑖U_{i} that refers to an actual quantum circuit can be efficiently evaluated on quantum machines in terms of the circuit size.It can be shown that L𝐿L is a linear function of P𝑃P and can be computed by evaluating each Li=𝔼Q[ψ]−𝔼Uiρ0Ui†[ϕ]−𝔼Uiρ0Ui†⊗Q[ξR]fragmentsL𝑖E𝑄[ψ]EfragmentsU𝑖ρ0U𝑖†[ϕ]EfragmentsU𝑖ρ0U𝑖†tensor-productQ[ξ𝑅]L_{i}=\mathbb{E}_{Q}[\psi]-\mathbb{E}_{U_{i}\rho_{0}U_{i}^{\dagger}}[\phi]-\mathbb{E}_{U_{i}\rho_{0}U_{i}^{\dagger}\otimes Q}[\xi_{R}]where Uiρ0Ui†fragmentsU𝑖ρ0U𝑖†U_{i}\rho_{0}U_{i}^{\dagger} refers to the state after applying UifragmentsU𝑖U_{i} on ρ0fragmentsρ0\rho_{0}. Similarly, one can show that L𝐿L is a linear function of the Hermitian matrices ϕ,ψ,ξRfragmentsϕ,ψ,ξ𝑅\phi,\psi,\xi_{R}. Our parameterization of ϕitalic-ϕ\phi and ψ𝜓\psi readily allows the use of efficient Pauli measurements to evaluate 𝔼P[ϕ]fragmentsE𝑃[ϕ]\mathbb{E}_{P}[\phi] and 𝔼Q[ψ]fragmentsE𝑄[ψ]\mathbb{E}_{Q}[\psi]. To handle the tricky part 𝔼P⊗Q[ξR]fragmentsEfragmentsPtensor-productQ[ξ𝑅]\mathbb{E}_{P\otimes Q}[\xi_{R}], we relax ξRfragmentsξ𝑅\xi_{R} and use a Taylor series to approximate 𝔼P⊗Q[ξR]fragmentsEfragmentsPtensor-productQ[ξ𝑅]\mathbb{E}_{P\otimes Q}[\xi_{R}]; the result form can again be evaluated by Pauli measurements composed with simple SWAP operations. As the major computation (e.g., circuit evaluation and Pauli measurements) is efficient on quantum machines, the overall implementation is efficient with possible overhead of sampling trials.
76
+
77
+ Computing the gradients: The parameters of the qWGAN are {pi}∪{θi,j}∪{αk}∪{βl}fragments{p𝑖}{θfragmentsi,j}{α𝑘}{β𝑙}\{p_{i}\}\cup\{\theta_{i,j}\}\cup\{\alpha_{k}\}\cup\{\beta_{l}\}. L𝐿L is a linear function of pi,αk,βlfragmentsp𝑖,α𝑘,β𝑙p_{i},\alpha_{k},\beta_{l}. Thus it can be shown that the partial derivatives w.r.t. pifragmentsp𝑖p_{i} can be computed by evaluating the loss function on a generated state Uiρ0Ui†fragmentsU𝑖ρ0U𝑖†U_{i}\rho_{0}U_{i}^{\dagger} and the partial derivatives w.r.t. αk,βlfragmentsα𝑘,β𝑙\alpha_{k},\beta_{l} can be computed by evaluating the loss function with ϕ,ψfragmentsϕ,ψ\phi,\psi replaced with Ak,BlfragmentsA𝑘,B𝑙A_{k},B_{l} respectively. The partial derivatives w.r.t. θi,jfragmentsθfragmentsi,j\theta_{i,j} can be evaluated using techniques due to [36] via a simple yet elegant modification of the quantum circuits used to evaluate the loss function. The complexity analysis is similar to above. The only new ingredient is the quantum circuits to evaluate the partial derivatives w.r.t. θi,jfragmentsθfragmentsi,j\theta_{i,j} due to [36], which are again efficient on quantum machines.
78
+
79
+ Summary of the training complexity: A rough complexity analysis above suggests that one step of the evaluation of the loss function (or the gradients) of our qWGAN can be efficiently implemented on quantum machines. (A careful analysis is in Supplemental Materials C.5.) Given this ability, the rest of the training of qWGAN is similar to the classical case and will share the same complexity. It is worthwhile mentioning that quantum circuit evaluation and Pauli measurements are not known to be efficiently computable by classical machines; the best known approach will cost exponential time.
80
+
81
+ We supplement our theoretical findings with numerical results by classical simulation of quantum WGANs of learning pure states (up to 8 qubits) and mixed states (up to 3 qubits) as well as its performance on noisy quantum machines. We use quantum fidelity between the generated and target states to track the progress of our quantum WGAN.If the training is successful, the fidelity will approach 111. Our quantum WGAN is trained using the alternating gradient descent method.
82
+
83
+ In most of the cases, the target state is generated by a circuit sharing the same structure with the generator but with randomly chosen parameters. We also demonstrate a special target state corresponding to useful quantum unitaries via the Choi-Jamiołkowski isomorphism.More details of the following experiments (e.g., parameter choices) can be found in Supplemental Materials D.
84
+
85
+ Most of the simulations were run on a dual core Intel I5 processor with 8G memory. The 888-qubit pure state case was run on a Dual Intel Xeon E5-2697 v2 @ 2.70GHz processor with 128G memory. All source codes are publicly available at https://github.com/yiminghwang/qWGAN.
86
+
87
+ Pure states   We demonstrate a typical performance of quantum WGAN of learning 1,2,4fragments1,2,41,2,4, and 888 qubit pure states in Figure 2. We also plot the average fidelity for 10 runs with random initializations in Figure 3 which shows the numerical stability of qWGAN.
88
+
89
+ Mixed states   We also demonstrate a typical learning of mixed quantum states of rank 222 with 1,2fragments1,21,2, and 333 qubits in Figure 4. The generator now consists of 222 unitary operators and 2 real probability parameters p1,p2fragmentsp1,p2p_{1},p_{2} which are normalized to form a probability distribution using a softmax layer.
90
+
91
+ Learning pure states with noise   To investigate the possibility of implementing our quantum WGAN on near-term machines, we perform a numerical test on a practically implementable 4-qubit generator on the ion-trap machine [48] with an approximate noise model [47]. We deem this as the closest example that we can simulate to an actual physical experiment.In particular, we add a Gaussian sampling noise with standard deviation σ=0.2,0.15,0.1,0.05fragmentsσ0.2,0.15,0.1,0.05\sigma=0.2,0.15,0.1,0.05 to the measurement outcome of the quantum system.Our results (in Figure 6) show that the quantum WGAN can still learn a 4-qubit pure state in the presence of this kind of noise. As expected, noise of higher degrees (higher σ𝜎\sigma) increases the number of epochs before the state is learned successfully.
92
+
93
+ Comparison with existing experimental results    We will compare to quantum GANs with quantum data [13, 4, 23]. It is unfortunate that there is neither precise figure nor public data in their papers which makes a precise comparison infeasible. However, we manage to give a rough comparison as follows. Ref. [13] studies the pure state and the labeled mixed state case for 1 qubit. It can be inferred from the plots of their results (Figure 8.b in [13]) that the relative entropy for both labels converges to 10−10fragments10fragments1010^{-10} after ∼5000fragmentssimilar-to5000\sim 5000 iterations, and it takes more than 100010001000 iterations for the relative entropy to significantly decrease from 111.Ref. [23] performs experiments to learn 1-qubit pure and mixed states using a quantum GAN on a superconducting quantum circuit. However, the specific design of their GAN is very unique to the 1-qubit case. They observe that the fidelity between the fake state and the real state approaches 111 after 220220220 iterations for the pure state, and 120120120 iterations for the mixed state.From our figures, qWGAN can quickly converge for 1-qubit pure states after 150−160fragments150160150-160 iterations and for a 111-qubit mixed state after ∼120fragmentssimilar-to120\sim 120 iterations.
94
+
95
+ Ref. [4] studies only pure states but with numerical results up to 6 qubits. In particular, they demonstrate (in Figure 6 from [4]) in the case of 6-qubit that the normal gradient descent approach, like the one we use here, won’t make much progress at all after 600 iterations. Hence they introduce a new training method. This is in sharp contrast to our Figure 2 where we demonstrate smooth convergence to fidelity 1 with the simple gradient descent for 8-qubit pure states within 900 iterations.
96
+
97
+ Application: approximating quantum circuits   To approximate any quantum circuit U0fragmentsU0U_{0} over n𝑛n-qubit space 𝒳𝒳\mathcal{X}, consider Choi-Jamiołkowski state Ψ0fragmentsΨ0\Psi_{0} over 𝒳⊗𝒳fragmentsXtensor-productX\mathcal{X}\otimes\mathcal{X} defined as (U0⊗I𝒳)Φfragments(U0tensor-productI𝒳)Φ(U_{0}\otimes\mathrm{I}_{\mathcal{X}})\Phi where ΦΦ\Phi is the maximally entangled state 12n∑i=02n−1ei→⊗ei→fragments1fragments2𝑛fragmentsi0fragments2𝑛1→fragmentse𝑖tensor-product→fragmentse𝑖\frac{1}{\sqrt{2^{n}}}\sum_{i=0}^{2^{n}-1}\vec{e_{i}}\otimes\vec{e_{i}} and {e→i}i=02n−1fragments{→𝑒𝑖}fragmentsi0fragments2𝑛1\{\vec{e}_{i}\}_{i=0}^{2^{n}-1} forms an orthonormal basis of 𝒳𝒳\mathcal{X}.The generator is the normal generator circuit U1fragmentsU1U_{1} on the first 𝒳𝒳\mathcal{X} and identity on the second 𝒳𝒳\mathcal{X}, i.e., U1⊗IfragmentsU1tensor-productIU_{1}\otimes\mathrm{I}. In order to learn for the 1-d 3-qubit Heisenberg model circuit (treated as U0fragmentsU0U_{0}) in [11], we simply run our qWGAN to learn the 6-qubit Choi-Jamiołkowski state Ψ0fragmentsΨ0\Psi_{0} in Figure 6 and obtain the generator (i.e., U1fragmentsU1U_{1}).We use the gate set of single or 2-qubit Pauli rotation gates. Then U1fragmentsU1U_{1} only has 52 gates, while using the best product-formula (2nd order) U0fragmentsU0U_{0} has ∼similar-to\sim11900 gates. It is worth noting that U1fragmentsU1U_{1} achieves an average output fidelity over 0.9999 and a worst-case error 0.15, whereas U0fragmentsU0U_{0} has a worst-case error 0.001. However, the worst-case input of U1fragmentsU1U_{1} is not realistic in current experiments and hence the high average fidelity implies very reasonable approximation in practice.
98
+
99
+ We provide the first design of quantum Wasserstein GANs, its performance analysis on realistic quantum hardware through classical simulation, and a real-world application in this paper. At the technical level, we propose a counterpart of Wasserstein metric between quantum data. We believe that our result opens the possibility of quite a few future directions, for example:•Can we implement our quantum WGAN on an actual quantum computer? Our noisy simulation suggests the possibility at least on an ion-trap machine.•Can we apply our quantum WGAN to even larger and noisy quantum systems? In particular, can we approximate more useful quantum circuits using small ones by quantum WGAN? It seems very likely but requires more careful numerical analysis.•Can we better understand and build a rich theory of quantum Wasserstein metrics in light of [43]?
1911.00126v3.txt ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Adversarial attacks on machine learning systems are a topic of growing importance. As machine learning becomes ever more prevalent in all aspects of modern life, concerns about safety tend to gain prominence as well. Recent demonstrations of the ease with which machine learning systems can be “fooled” have caused a strong impact in the field and in the general media. Systems that use voice and audio such as Amazon Alexa, Google Assistant, Apple Siri and Microsoft Cortana are growing in popularity, and their applications maybe safety critical in cases like in a car. The hidden risk of those advancements is that those systems are potentially vulnerable to adversarial attacks from an ill-intended third-party. Despite the recent growth in consumer presence of audio-based artificial intelligence products, attacks on audio and speech systems have received much less attention than the image and language domains so far.
2
+
3
+ Despite a number of recent works attempting to create adversarial examples against Automatic Speech Recognition (ASR) systems (Carlini and Wagner, 2018; Schönherr et al., 2018; Qin et al., 2019), we believe robust playable-over-the-air real-time audio adversaries against commercial ASR systems still have not been demonstrated. Attacks that worked digitally against specific models are not effective played over-the-air against commercial ASR models. Moreover, as consumer-facing products, Voice Assistants (VAs) such as Amazon Alexa and Google Assistant are well-maintained by their infrastructure teams. It is revealed that these teams retrain and update ASR models very frequently on their cloud back-end, making a robust audio adversary that can consistently work against these ASR systems almost impossible to craft Hoffmeister (2019). Attackers would not only lack knowledge of the backend models’ parameters and gradients, but would also struggle to keep up with the ever-evolving models.
4
+
5
+ However, all the existing VAs rely solely on wake-word detection to respond to people’s commands, which could potentially make them vulnerable to audio adversarial examples. In this work, rather than directly attacking the general ASR models, we target our attack on the wake-word detection system. Wake-word detection models always have to be stored and executed on-board within smart-home hardware, which is usually very limited in terms of computing power due to form factors. It is also revealed that updates to the wake-word models are much more infrequent and difficult compared to the backend ASR models Hoffmeister (2019). We therefore propose to attack VAs by “jamming” the wake-word detection, effectively deactivating the VA while our adversary is present. In security term, this is a type of denial-of-service (DoS) attack. Specifically, we create a parametric attack that resembles a piece of background music, making the attack inconspicuous to humans.
6
+
7
+ We reimplemented the wake-word detection system used in Amazon Alexa based on their latest publications on the architecture (Wu et al., 2018). We leveraged a large amount of open-sourced speech data to train our wake-word model, testing and making sure it has on par performance compared with the real Alexa. We collected 100 samples of "Alexa" utterances from 10 people and augmented the data set by varying the volume, tempo and speed. We created a synthetic data set using publicly available data sets as background noise and negative speech examples. This collected database is used to validate our emulated model and be compared with the real Alexa.
8
+
9
+ After successfully training a high-performance emulated wake-word model, we synthesized guitar-like music to craft our audio perturbations. Projected Gradient Descent (PGD) is used here to maximize the effect of our attack while keeping the parameters of our adversarial music within realistic boundaries. During the training of our audio perturbation, we considered expectation over transforms (Athalye et al., 2018) including psychoacoustic masking and room impulse responses. Finally, we tested our perturbation over the air against our emulated model in parallel with the real Amazon Echo and verified that our perturbation works effectively against both of them in a real world setting. Specifically, the recognition F1 score of our emulated model was reduced from 93.4% to 11.0%, and the F1 score of the real Alexa was also brought down from 92.5% to 11.0%. Our adversarial music poses a real threat against commercial grade VAs, leading to potential safety concerns such as distraction in driving and malicious manipulations of smart devices, and thus, our finding calls for future speech research looking into defenses against potential risks and general robustness.
10
+
11
+ Most current adversarial attacks work by trying to find a way to modify a given input (hopefully by a very small amount) in such a way that the machine learning system’s proper functioning is disrupted. A classic example is to take an image classifier and modify an input with a very small perturbation (difficult for human to tell apart from the original image) that still changes the output classification to a completely distinct (and incorrect) one. To achieve such a goal, the general idea behind many of the attack algorithms is to optimize an objective that involves maximizing the likelihood of the intended (incorrect) behavior, while being constrained to a small perturbation. For differentiable systems such as deep networks, which are the current state-of-the-art for many classification tasks, utilizing gradient-based methods is a common approach. We describe such methods and their relation to our work in more depth in Section. 3.5. In this work, our target of attack is wake-word detection systems.
12
+
13
+ Adversarial attacks were initially introduced for images (Szegedy et al., 2013) and have been studied the most in the domain of computer vision (Nguyen et al., 2015; Kurakin et al., 2016; Moosavi-Dezfooli et al., 2016; Elsayed et al., 2018; Li et al., 2019). Following successful demonstrations in the vision domain, adversarial attacks were also successfully applied to natural language processing (Papernot et al., 2016; Ebrahimi et al., 2018; Reddy and Knight, 2016; Iyyer et al., 2018; Naik et al., 2018). This trend gives rise to defensive systems such as Cisse et al. (2017); Wong and Kolter (2018), and thus provides a guideline to the community about how to build robust machine learning models.
14
+
15
+ Attacks on audio and speech systems have received much less attention so far. Two years ago, Zhang et al. (2017) pioneered a proof-of-concept that proved the feasibility of real-world attacks on speech recognition models. This work however, had a larger focus on the hardware part of the Automatic Speech Recognition (ASR) system, instead of its machine learning component. Until very recently, there was not much work done on exploring adversarial perturbation on speech recognition models. Carlini et al. (2016) was the first to demonstrate that attack against HMM models are possible. They claimed to effectively attack based on the inversion of feature extractions. This work was preliminary since it only showcased a limited number of discrete voice commands, and the majority of perturbations are not able to be played over the air. As a follow-up work, Carlini and Wagner (2018); Qin et al. (2019) showcased that curated white-box attacks based on adversarial perturbation can easily fool the Mozilla speech recognition system. Again, their attacks would only work in with their special setups and are very brittle in the real world. Meanwhile, Schönherr et al. (2018) attempted to leverage psycho-acoustic hiding to improve the chance of success of playable attacks. They verified their attacks against the Kaldi ASR system, whereas the real-world success rate was still not satisfying, and the adversary itself cannot be played from a different source. Unfortunately, state-of-the-art audio adversaries can only work digitally against the specific model they were trained against, but cannot work robustly over the air against state-of-the-art commercial grade ASR systems. We verified all these adversaries mentioned above not effective against Alexa or Siri. Alexa and Siri can still transcribe correctly with the presence of these audio perturbations. Acknowledging the strict limit on the potency of such an over-the-air attack, we aim at a different target rather than focusing on the ASR models deployed in commercial products. Our proposed attack targets at the more manageable but equally critical wake-word detection system, and effectively demonstrates that it can be playable over the air.
16
+
17
+ Here are our main contributions in this work compared with previous works:1.We create a parametric threat model in audio domain that allows us to disguise our adversarial attack as a piece of music playable over the air in the physical space.2.Our adversarial attack is a “gray-box” attack222We avoid using the term “black-box” here since we admit that the gradients of the real Alexa model can be expected to be similar to those of models of Panchapagesan et al. (2016) that leverages the domain transferability of our perturbation. This is a lot more challenging than previous works on white-box attack where attackers have perfect information about the model.3.Our adversarial attack is jointly optimizing the attack nature while fitting the threat model to the perturbation achievable by the microphone hearing response of Amazon Alexa. Our attack budget is very limited compared with previous works, which makes this challenging.4.Our adversarial attack demonstrated its effect in the real world under separate audio source settings, which is the first real-time “gray-box” adversarial attack against commercial grade Voice Assist’s wake-word detection system to our knowledge. 333Our demo video is included in the supplementary material
18
+
19
+ This section contains the main methodological contributions of our paper: the algorithmic and practical pipeline for synthesizing our adversarial music. To begin, we will first describe the training setup and the performance of our emulated wake-word detection model. We then describe the general threat model we consider in this work. Unlike past works which often considered Lpsubscript𝐿𝑝L_{p} norm bounded perturbations on the entire spectrum, we require a threat model that can generate a piece of audible music. Next, we describe the approach we used to make our threat model robust over the air. Finally, we describe how we optimized the parameters of our threat model to synthesize a robust over-the-air attack.
20
+
21
+ Wake-word detection is the first important step before any interactions with distant speech recognition. Due to the compacted space of embedded platforms and the need for quick reflection time, models of wake-word detection are usually truncated and vulnerable to attacks. Thus, we target our attack at the wake-word detection function.
22
+
23
+ Since the Alexa model is a black-box to us, the only way to attack it is either to estimate its gradients, or to emulate its architecture and later transfer the white-box attack against the emulated model to its original model. Estimating its gradient using first order optimization techniques would be extremely computationally expensive (Ilyas et al., 2018), making it difficult if not impossible to implement. Luckily, the architecture of Amazon Alexa was published in Panchapagesan et al. (2016); Kumatani et al. (2017); Guo et al. (2018), allowing us to emulate the model as if it is a white-box attack. We implemented the time-delayed bottleneck highway networks with Discrete Fourier Transform (DFT) features as shown in Figure. 2. The architecture is following the details in Guo et al. (2018), which is the most up-to-date information on the model architecture.
24
+
25
+ The architecture of the emulated model is shown in Figure. 2. The model is a two-level architecture which uses the highway block as the basic building block. Specifically, our architecture contains a 4-layer highway block as a feature extractor, a linear layer acting as the bottleneck, a temporal context window that concatenates features from adjacent frames, and a 6-layer highway block for classification.
26
+
27
+ The training data for wake-word detection systems is very limited, so our model is first pre-trained with several large corpora (Cieri et al., 2004; Godfrey et al., 1992; Rousseau et al., 2012) to train a general acoustic model. Then it is adapted to the wake-word detection model by using a small amount of wake-word detection training data. The emulated model could detect the wake-word “Alexa" by recognizing the corresponding phonemes of AX, L, EH, K, S and AX.
28
+
29
+ We trained the model as a binary classification problem over a time sequence, distinguishing between wake-words and non wake-words. The performance is evaluated over a reserved test set. Care has been taken to ensure that augmented copies of the same raw audio sample will not occur in the train and test set simultaneously. Common performance metrics are listed in Table 1. Given that our emulated model’s architecture is very similar to the Alexa model, the gradients of the two models should also share great similarities. We believe that the white-box attack computed by gradient based attacks against our emulated model would be effective against Alexa’s original model. Figure. 2 shows the Detection Error Tradeoff (DET) in the similar style as Guo et al. (2018). We note that our performance is not exactly the same as Alexa model due to the lack of training data, but our performance is in the same order of magnitude. Thus, we believe we should have a high fidelity emulation of the Alexa wake-word detection model.
30
+
31
+ To perform the adversarial attack on the audio domain, we introduce a parametric model to define a realistic construction of our adversary δθsubscript𝛿𝜃\delta_{\theta} parameterized by θ𝜃\theta. We use the Karplus-Strong algorithm Jaffe and Smith (1983) to synthesis guitar-timbre sounds. The goal is to generate a sequence of L𝐿L guitar notes {(f​ri,di,v​o​li)}i=1Lsuperscriptsubscript𝑓subscript𝑟𝑖subscript𝑑𝑖𝑣𝑜subscript𝑙𝑖𝑖1𝐿\{(fr_{i},d_{i},vol_{i})\}_{i=1}^{L}, with given Beats Per Minute (BPM) b​p​m𝑏𝑝𝑚bpm, Sampling Frequency f​rs𝑓subscript𝑟𝑠fr_{s}, where f​ri𝑓subscript𝑟𝑖fr_{i} is the frequency pitch of the it​hsubscript𝑖𝑡ℎi_{th} note, disubscript𝑑𝑖d_{i} is the note duration, and v​o​li𝑣𝑜subscript𝑙𝑖vol_{i} is the note volume. In this work, we update the θ={(f​ri,v​o​li)}i=1L𝜃superscriptsubscript𝑓subscript𝑟𝑖𝑣𝑜subscript𝑙𝑖𝑖1𝐿\theta=\{(fr_{i},vol_{i})\}_{i=1}^{L} of all notes’ frequency f​r𝑓𝑟fr and volume v​o​l𝑣𝑜𝑙vol, while fixing the notes’ duration {di}i=1Lsuperscriptsubscriptsubscript𝑑𝑖𝑖1𝐿\{d_{i}\}_{i=1}^{L}.
32
+
33
+ The Karplus-Strong algorithm is an example of digital waveguide synthesis to simulate string instruments physically. It mimics the dampening effects of a real guitar string as it vibrates by taking the decaying average of two consecutive samples: y​[n]=γ​(y​[n−D]+y��[n−D+1])/2𝑦delimited-[]𝑛𝛾𝑦delimited-[]𝑛𝐷𝑦delimited-[]𝑛𝐷12y[n]=\gamma(y[n-D]+y[n-D+1])/2, where γ𝛾\gamma is the decay factor, y𝑦y is the output wave, D𝐷D is the sampling phase delay. This is similar to a one-zero low-pass filter with a transfer function H​(z)=(1+z−1)/2𝐻𝑧1superscript𝑧12H(z)=(1+z^{-1})/2 (Smith, 1983), as shown in Figure. 3.
34
+
35
+ When a guitar string is plucked, the string vibrates and emits sound. To simulate this, the Karplus-Strong algorithm consists of two phases, as shown in Figure. 3:
36
+
37
+ Plucking the string: The string is “plucked” by a random initial displacement and initial velocity distribution y[0:D−1]∼𝒩(0,β)y[0:D-1]\sim\mathcal{N}(0,\beta), where β𝛽\beta is the displacement factor. The plucking time, i.e. the sampling phase delay D𝐷D for the note frequency f​r𝑓𝑟fr is calculated using D=f​rs/f​r𝐷𝑓subscript𝑟𝑠𝑓𝑟D=fr_{s}/fr.
38
+
39
+ The resulting vibrations: The pluck causes a wave-like displacement over time with a decaying sound. The decay factor depends on the note frequency f​r𝑓𝑟fr and the delay period nD=d×f​r/f​rssubscript𝑛𝐷𝑑𝑓𝑟𝑓subscript𝑟𝑠n_{D}=d\times fr/fr_{s}. It is calculated as: γ=(4/l​o​g​(f​r))1/nD𝛾superscript4𝑙𝑜𝑔𝑓𝑟1subscript𝑛𝐷\gamma=(4/log(fr))^{1/n_{D}}. The volume of the output of a note is adjusted by vo​u​t​p​u​t=pv×v​o​lsubscript𝑣𝑜𝑢𝑡𝑝𝑢𝑡subscript𝑝𝑣𝑣𝑜𝑙v_{output}=p_{v}\times vol using a frequency-specific volume factor pv=1+0.8×(l​o​g​(f​r)−3)/5.5×c​o​s​(π/5.3​(l​o​g​(f​r)−3))subscript𝑝𝑣10.8𝑙𝑜𝑔𝑓𝑟35.5𝑐𝑜𝑠𝜋5.3𝑙𝑜𝑔𝑓𝑟3p_{v}=1+0.8\times(log(fr)-3)/5.5\times cos(\pi/5.3(log(fr)-3)) (Woodhouse, 2004). Jaffe and Smith (1983) suggested using a linear interpolation to obtain a fractional delay to generate a better result:y​[n]=γ​vo​u​t​p​u​t​(ω×y​[n−D]+(1−ω)×y​[n−D−1])/2,𝑦delimited-[]𝑛𝛾subscript𝑣𝑜𝑢𝑡𝑝𝑢𝑡𝜔𝑦delimited-[]𝑛𝐷1𝜔𝑦delimited-[]𝑛𝐷12y[n]=\gamma v_{output}(\omega\times y[n-D]+(1-\omega)\times y[n-D-1])/2,(1)where, ω∈(0,1)𝜔01\omega\in(0,1) is the weight factor.Overall, the Karplus-Strong algorithm is shown in algorithm. 1.
40
+
41
+ The resulting synthesizing function π​(x;θ)𝜋𝑥𝜃\pi(x;\theta) is a differentiable function of part of the parameters θ𝜃\theta value is a continuous function of the parameters: the frequency f𝑓f and the volume v​o​l𝑣𝑜𝑙vol of each note (We fix the note duration d𝑑d). Therefore, we can implement the perturbation model within an automatic differentiation toolkit (we implement it with the PyTorch library), a feature that will be exploited to both fit the parametric perturbation model to real data, and to construct real-world adversarial attacks.
42
+
43
+ Our ultimate task is to deceive the voice assistant with minimal impact to human hearing, and it is natural to leverage the psychoacoustic effect of human hearing. The principles of the psychoacoustic model are similar to what used in the compression process of audio files, e.g. compress the lossless file format "wav" to the lossy file format "mp3". In this process, the information carried by the audio file is actually altered while human ear could not tell the differences between these two sounds.Specifically, a louder signal (the “masker") can make other signals at nearby frequencies (the “maskees") imperceptible (Mitchell, 2004). In this work, we adopted the same setup as Qin et al. (2019). When we add an perturbation δ𝛿\delta, the normalized power spectral density (PSD) estimate of the perturbation p¯δ​(k)subscript¯𝑝𝛿𝑘\bar{p}_{\delta}(k) is under the frequency masking threshold of the original audio ηx​(k)subscript𝜂𝑥𝑘\eta_{x}(k),p¯δ​(k)=92−maxk⁡px​(k)+pδ​(k)subscript¯𝑝𝛿𝑘92subscript𝑘subscript𝑝𝑥𝑘subscript𝑝𝛿𝑘\bar{p}_{\delta}(k)=92-\max_{k}{p_{x}(k)}+p_{\delta}(k)(2)where pδ​(k)=10​log10⁡|1N​sδ​(k)|2subscript𝑝𝛿𝑘10subscript10superscript1𝑁subscript𝑠𝛿𝑘2{p}_{\delta}(k)=10\log_{10}|\frac{1}{N}s_{\delta}(k)|^{2}, px​(k)=10​log10⁡|1N​sx​(k)|2subscript𝑝𝑥𝑘10subscript10superscript1𝑁subscript𝑠𝑥𝑘2{p}_{x}(k)=10\log_{10}|\frac{1}{N}s_{x}(k)|^{2} are power spectral density estimation of the perturbation and the original audio input. sx​(k)subscript𝑠𝑥𝑘s_{x}(k) is the kt​hsubscript𝑘𝑡ℎk_{th} bin of the spectrum of frame x𝑥x. This results in the loss function term:Lη​(x,δ)=1⌊N2⌋+1​∑k=0⌊N2⌋max⁡{p¯δ​(k)−ηx​(k),0}subscript𝐿𝜂𝑥𝛿1𝑁21subscriptsuperscript𝑁2𝑘0subscript¯𝑝𝛿𝑘subscript𝜂𝑥𝑘0L_{\eta}(x,\delta)=\frac{1}{\lfloor\frac{N}{2}\rfloor+1}\sum^{\lfloor\frac{N}{2}\rfloor}_{k=0}\max{\{\bar{p}_{\delta}(k)-\eta_{x}(k),0\}}(3)where N𝑁N is the predefined window size and ⌊x⌋𝑥\lfloor x\rfloor outputs the greatest integer no larger than x𝑥x.
44
+
45
+ When using the voice assistant in a room, the real sound caught by the microphone includes both the original sound spoken by human and the reflected sound. The "room impulse response" function explained the transform of the original audio and the audio caught by the microphone. Therefore, to make our adversarial attack effective in the physical domain, i.e. attack the voice assistant over the air, it is necessary to consider the room impulse response in our work. Here, we use the classic Image Source Method introduced in Allen and Berkley (1979); Scheibler et al. (2018) to create the room impulse response r𝑟r based on the room configurations (dimension, source location, reverberation time): t​(x)=x∗r𝑡𝑥∗𝑥𝑟t(x)=x\ast r, where x𝑥x denotes clean audio and ∗∗\ast denotes convolution operation. The transformation function t𝑡t follows a chosen distribution 𝒯𝒯\mathcal{T} over different room configurations.
46
+
47
+ Originally, wake-word detection problem is formulated as a minimization of 𝐄x,y∼D​[L​(f​(x),y)]subscript𝐄similar-to𝑥𝑦𝐷delimited-[]𝐿𝑓𝑥𝑦\mathbf{E}_{x,y\sim D}[L(f(x),y)] where L𝐿L is the loss function, f𝑓f is the classifier mapping from input x𝑥x to label y𝑦y, and D𝐷D is the data distribution. We evaluate the quality of our classifier based on the loss, and a smaller loss usually indicates a better classifier. In this work, since we are interested in attack, we form max𝛿​[𝐄x,y∼D​[L​(f​(x′),y)]]𝛿delimited-[]subscript𝐄similar-to𝑥𝑦𝐷delimited-[]𝐿𝑓superscript𝑥′𝑦\underset{\delta}{\max}[\mathbf{E}_{x,y\sim D}[L(f(x^{\prime}),y)]], where x′=x+δsuperscript𝑥′𝑥𝛿x^{\prime}=x+\delta is our perturbed audio. In a completely differentiable system, an immediately obvious initial approach to this would be to use gradient ascent in order to search for an x′superscript𝑥′x^{\prime} that maximizes this loss. However, for this maximization to be interesting both practically and theoretically, we need x′superscript𝑥′x^{\prime} to be close to the original datapoint x𝑥x, according to some measure. It is thus common to define a perturbation set C​(x)𝐶𝑥C(x) that constrains x′superscript𝑥′x^{\prime}, such that the maximization problem becomes maxx′∈C​(x)​[𝐄x,y∼D​[L​(f​(x′),y)]]superscript𝑥′𝐶𝑥delimited-[]subscript𝐄similar-to𝑥𝑦𝐷delimited-[]𝐿𝑓superscript𝑥′𝑦\underset{x^{\prime}\in C(x)}{\max}[\mathbf{E}_{x,y\sim D}[L(f(x^{\prime}),y)]]. The set C​(x)𝐶𝑥C(x) is usually defined as a ball of small radius (of either ℓ∞,ℓ2subscriptℓsubscriptℓ2\ell_{\infty},\ell_{2}\, or ℓ1subscriptℓ1\,\ell_{1}) around x𝑥x.
48
+
49
+ Since we have to solve such a constrained optimization problem, we cannot simply apply the gradient descent method to maximize the loss, as this could take us out of the constrained region. One of the most common methods utilized to circumvent this issue is called Projected Gradient Descent (PGD). To actually implement gradient descent methods, instead of maximizing the aforementioned loss L𝐿L, we will invert the sign and minimize the negative loss, i.e., minx′∈C​(x)​[−l​(x,δ,y)]superscript𝑥′𝐶𝑥delimited-[]𝑙𝑥𝛿𝑦\underset{x^{\prime}\in C(x)}{\min}[-l(x,\delta,y)].
50
+
51
+ In our case, we attack the voice assistant via a parametric threat model and considering psychoacoustic effect, as illustrated in Section. 3.3 and Section. 3.2. The loss function of attack thus can be rewritten as:max⁡l​(x,δθ,y)=𝐄x,y∼D​[Lwake​(f​(x+δθ),y)−α⋅Lη​(x,δθ)]𝑙𝑥subscript𝛿𝜃𝑦subscript𝐄similar-to𝑥𝑦𝐷delimited-[]subscript𝐿wake𝑓𝑥subscript𝛿𝜃𝑦⋅𝛼subscript𝐿𝜂𝑥subscript𝛿𝜃\max l(x,\delta_{\theta},y)=\mathbf{E}_{x,y\sim D}[L_{\text{wake}}(f(x+\delta_{\theta}),y)-\alpha\cdot L_{\eta}(x,\delta_{\theta})](4)where Lwakesubscript𝐿wakeL_{\text{wake}} is the original loss of the emulated model for wake-word detection, and α𝛼\alpha is the balancing parameter. δθsubscript𝛿𝜃\delta_{\theta} is our adversarial music defined in Section. 3.2. In addition, we consider the room impulse response defined in Section. 3.4, which would be the attack in physical world over the air. We simulated our testing environments using the parameters shown in Table 2 to transform t​(x)𝑡𝑥t(x) our digital adversary to compensate for the room impulse responses. We want to optimize our δ𝛿\delta by tuning θ𝜃\theta to maximize this loss to synthesize our adversary:
52
+
53
+ max⁡l​(x,δθ,y)=𝐄t∈𝒯,x,y∼D​[Lwake​(f​(t​(x+δθ),y))−α⋅Lη​(x,δθ)]𝑙𝑥subscript𝛿𝜃𝑦subscript𝐄formulae-sequence𝑡𝒯𝑥similar-to𝑦𝐷delimited-[]subscript𝐿wake𝑓𝑡𝑥subscript𝛿𝜃𝑦⋅𝛼subscript𝐿𝜂𝑥subscript𝛿𝜃\max l(x,\delta_{\theta},y)=\mathbf{E}_{t\in\mathcal{T},x,y\sim D}[L_{\text{wake}}(f(t(x+\delta_{\theta}),y))-\alpha\cdot L_{\eta}(x,\delta_{\theta})](5)
54
+
55
+ Datasets
56
+
57
+ We collected 100 positive speech samples (speaking "Alexa") from 10 peoples (4 males and 6 females; 4 native speakers of English, 6 non-native speakers of English). Each person provided 10 utterances, under the requirement of varying their tone and pitch as much as possible. We further augmented the data to 20x by varying the speed, tempo and the volume of the utterance, resulting in 2000 samples. We used LJ speech dataset (Ito, 2017) for background noise and negative speech examples (speak anything but "Alexa"). We created a synthetic data set by randomly adding positive and negative speech examples onto a 10s background noise and created binary labels accordingly. While "hearing" positive speech examples, we set label values as 1.
58
+
59
+ Training and Testing the Adversarial Music
60
+
61
+ We followed the methodology described in Section. 3.5, using the loss function defined by Eq. 5 and the parametric method illustrated in Section. 3.2, we optimized the parameters of the music to maximize our attack. We used the emulated model developed in Section. 3.1 to estimate the gradient and maximizes the classification loss following Eq. 5. When using PGD to train, we restricted the frequency to 27.5Hz ∼similar-to\sim 4186Hz in the 88 notes space, and restricted the volume from 0 dBA ∼similar-to\sim 100 dBA. Other parameters are defined in the code, we fixed some parameters to speed up the training. The trained perturbations are directly added on top of the clean signals to perform our digital evaluation. Our physical experiments are conducted at a home environment which can be seen in the video attached in the supplementary material, and the setup is shown in Figure. 5. The adversarial music is played by a MacBook Pro (15-inch, 2018) speaker444We have also experimented with Alienware MX 18R2 speakers and Logitech Z506 speakers, MacBook Pro speakers generated the best results. Since we are not comparing different speakers in this paper, we report the results from the MacBook Pro speakers. The tester stands dtsubscript𝑑𝑡d_{t} away from the Amazon Echo or the computer running our emulated model, and the adversary is placed dasubscript𝑑𝑎d_{a} away from the Echo. The angle between the two lines is φ𝜑\varphi. We tested against the model for 100 samples with and without the audio adversary. We used a decibel meter to ensure that our adversary is never louder than the wake-word command. Our human spoken wake-word command is measured to be 70 dBA on average. We experimented with adversaries being played at from 40 dBA and 70 dBA (measured by the decibel meter) with the background reference noise at 20 dBA, and we also experimented with 2 different testers (a male and a female). We also experimented with the influence of timing offset toffsetsubscript𝑡offsett_{\textit{offset}} on the performance of the adversarial music. 555please refer to the demo video in https://www.junchengbillyli.com/AdversarialMusic
62
+
63
+ The performance metrics of the emulated model on adversary examples are shown in Table 1. An example of modified adversarial attack example is shown in Figure .5. As we can see, our attack is effective against both the emulated model and the real Alexa model in both digital and physical tests. Especially, the precision score takes a heavier hit by the adversary compared with the recall score. We also noticed that False Positives are relatively uncommon, this might be due to the fact that we are running an untargeted attack against the wake-word detection, and our adversaries are not encouraging the model to predict a specific target label. Overall, our experiments showcased that audio adversaries masked as a piece of music can be played over the air, and disable a commercial grade wake-word detection system.
64
+
65
+ In our physical experiments against the real Alexa, we measured the performance of our audio perturbation under several different physical settings shown in Table 2. As we can observe, our model successfully attacked against Alexa in most cases. The distance dasubscript𝑑𝑎d_{a} between Alexa and the attacker is critical for a successful attack: a shorter distance dasubscript𝑑𝑎d_{a} generally leads to a more effective adversary, while the number of successful attacks declines when distance dtsubscript𝑑𝑡d_{t} is shorter. The adversary effectively fooled Alexa at most volume levels. The success rate increased as the volume of the adversarial music increased from 40 dBA to 70 dBA. We also observed it would not be effective being played under 40 dBA. We also experimented with different starting time of the adversary and wake words. As is shown in Table 3, the adversary was effective when it overlapped with the entire length of the wake-word, while it was ineffective if the wake-word uttered first. Our adversaries successfully demonstrated to be effective at various physical locations and angles φ𝜑\varphi referenced to Alexa and the human tester, the larger φ𝜑\varphi the less effective our adversary would be. This is relevant because Alexa’s 7-microphone array is supposedly to be very robust at source separation. This can prove that our consideration of the room impulse responses was useful. When we remove the room impulse transform, the adversary lost its effect.
66
+
67
+ To verify that Alexa would not be affected easily with other non-adversarial noises, we experimented with three different baselines: random music generated by the Karplus-Strong (KS) algorithm, single-note sounds generated by the KS algorithm and random pieces of music.666We picked 10 different top ranking guitar music on Youtube. (not generated by the KS algorithm). The baseline noises are played at the same volume as our adversarial music. As is shown in Table 4, these three baselines could rarely fool Alexa under various testing conditions. This demonstrated the Projected Gradient Descent (PGD) adversarial music trained using the KS algorithm is effective.
68
+
69
+ In this work, we demonstrated a DoS attack on the wake-word detection system of Amazon Alexa with a real-word inconspicuous adversarial background music. We first created an emulated model for the wake-word detection on Amazon Alexa following the implementation details published in Guo et al. (2018). The model is the basis to design our “gray-box” attacks. We collected, augmented and synthesized a data set for training and testing. We implemented our threat model which disguises our attack in a sequence of inconspicuous background music notes in PyTorch. Our experiments verified that our adversarial music is not only effective against our emulated model digitally, but also can effectively disable Amazon Alexa’s wake-word detection function over the air. We also verified that non-adversarial music does not affect Alexa compared to our adversary at the same sound level. A Our work shows the potential of adversarial attack in the audio domain, specifically, against the widely applied wake-word detection systems in voice assistants. Overall, this suggests a real concern of attack against commercial grade machine learning algorithms, highlighting the importance of adversarial robustness from a practical, security-based point of view.
70
+
71
+ Acknowledgement: The authors would like to thank Bingqing Chen and Zhuoran Zhang for help with data collection and preliminary studies.
1911.00147v1.txt ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ One of the goals of the media is to inform, but in practice, the media also shapes opinions [23, 53, 2, 20, 57, 44]. The same issue can be presented from multiple perspectives, both in terms of the text written in an article, and the visual content chosen to illustrate the article.For example, when speaking of immigration, left-leaning sources might showcase the struggles of well-meaning immigrants, while right-leaning sources might portray the misdeeds of criminal immigrants.The type of topics portrayed is also strong cue for the left or right bias of the source media (e.g. tradition is primarily seen as a value on the right, while diversity is seen as a value on the left [15]).
2
+
3
+ In this paper, we presenta method for recognizing the political bias of an image, which we define as whether the image came from a left- or right-leaning media source.This requires understanding: 1) what visual concepts to look for in images, and 2) how these visual concepts are portrayed across the spectrum.Note that this is a very challenging task because many of the concepts that we aim to learn show serious visual variability within the left and right.For example, the concept of “immigration” can be illustrated with a photo of a border wall, children crying behind bars while detained, immigration agents, protests and demonstrations about the issue, politicians giving speeches, etc.Human viewers account for such within-class variance by generalizing what they see into broader semantic concepts or themes using prior knowledge, deduction, and reasoning.
4
+
5
+ On the other hand, modern CNN architectures learn by discovering recurring textures or edges representing objects in the images through backpropagation.However, the same objects might appear and be discussed across the political spectrum, meaning that the simple presence or absence of objects is not a good indicator of the politics of an image.Thus, model training may fall into poor local minima due to the lack of a recurring discriminative signal. Further, it is not merely the presence or absence of objects that matters, but rather how they are portrayed, often in subtle ways.
6
+
7
+ In order to capture the visual concepts necessary to predict the politics of an image, we propose a method which uses an auxiliary channel at training time, namely the article text that the image is paired with.Our method contains two stages.In the first one, we learn a document embedding model on the articles, then train a model to predict the bias of the image, given the image and the paired document embedding. To be successful on this task, the model learns to recognize visual cues which complement the textual embedding and suggest the politics of the image-text pair.At test time, we want to recognize bias from images alone, without any article text. Thus, in the second training stage of the model, we use the first stage model as a feature extractor and train a linear bias classifier on top. The article text serves as a type of privileged information to help guide learning.
8
+
9
+ Since recognizing the right semantic and visual concepts amidst intra-class variance requires large amounts of data, we train our approach on webly supervised data: the only labels are in the form of the political leaning of the source that the image came from. However, for testing purposes, we collect human annotations and test on images where annotators agreed on the label.We experimentally show that our method outperforms numerous baselines on both a large held-out webly supervised test set, and the set of crowdsourced annotations.
10
+
11
+ We believe that recognizing the political bias of a photograph is an important step towards building socially-aware computer vision systems. Such awareness is necessary if we hope to use computer vision systems to automatically tag or describe images (e.g. for the visually impaired) or to summarize large collections of potentially biased visual content. Social media companies or search engines may deploy such techniques to automatically identify the political bent of images or even entire news sites being spread or linked to. Progress has already been made in this space in other domains. For example, Facebook automatically determines users’ political leanings from site activity and pages liked [40]. Other works have studied predicting political affiliation from text [11, 73, 68] or even MRI scans [58]. However, visual bias understanding has been greatly underexplored. While some work examines visual persuasion [31, 26], none analyzes political leaning as we do.
12
+
13
+ Our contributions are as follows:•We propose and make available111Our dataset, code, and additional materials are available online for download here: http://www.cs.pitt.edu/∼similar-to\simchris/politics a very large dataset of biased images with paired text, and a large amount of diverse crowdsourced annotations regarding political bias.•We propose a weakly supervised method for predicting the political leaning of an image by using noisy auxiliary textual data at training time.•We perform a detailed experimental analysis of our method on both webly supervised and human annotated data, and demonstrate the factors humans use to predict bias in images.•We show qualitative results that demonstrate the relationship between images and semantic concepts, and the variability in how faces of the same person appear on the left or the right.
14
+
15
+ Our work is in the weakly supervised setting, in the sense that other than noisy left/right labels, our method does not receive information about what makes an image left- or right-leaning. This is challenging because there is significant variety in the type of content that can be left-leaning or right-leaning. Thus, our method needs to identify relevant visual concepts based on which to make its predictions.Recently, weakly supervised approaches have been proposed for classic topics such as object detection [45, 8, 78, 72, 75], action localization [69, 56], etc.Researchers have also developed techniques for learning from potentially noisy web data, e.g. [7].Also related is work in unsupervised discovery of patterns and topic modeling, e.g. [37, 38, 61, 62, 79, 27, 13, 63, 18].In contrast to these works, our problem exhibits much larger within-class variance (with left and right being the classes of interest). Unlike objects and actions, the differences between left and right live in semantic space as much as they do in visual space, hence our use of auxiliary training inputs.
16
+
17
+ Also relevant are self-paced and curriculum learning approaches [28, 51, 76, 77, 29].These attempt to simplify learning by finding “easy” examples to learn with first.We too employ a type of curriculum learning. We first train a multi-modal classifier to predict bias, using the assumption that the relation between text and bias is more direct. We then leverage this model as a feature extractor by adding an image-only politics classifier on top of it. Thus, our method focuses the model on relevant visual concepts using text.
18
+
19
+ Our method also exploits a similar intuition as privileged information methods [65, 60, 25, 43, 17, 22, 4, 35] that use an extra feature input at training time. These approaches use tied weights [4], computing summary statistics [60, 35], or multitask training [17] to guide learning. The closest such method to ours is [22] which uses an approach trained to predict text embeddings from images. The features are then applied on visual-only data. However, in early experiments we showed directly predicting text embeddings from images is much more challenging on our data because of the many-to-many relationship of images with topics (e.g. image of the White House can be paired with text about Trump’s children, border control, LGBT rights, etc.).
20
+
21
+ To learn the meaning of the images, we elevate the image representation to a semantic one, by connecting images and text. However, because our texts contain a lot of information not relevant to the image, our main method does not predict text from the image.The latter task has received sustained interest[67, 14, 30, 66, 48, 6, 12, 1, 16, 74]but our domain is unique in that articles that are paired with our images are orders of magnitude longer.
22
+
23
+ Our work also belongs to a recent trend of developing algorithms to analyze visual media and the strategies that a media creator uses to convey a message. [31, 32] analyze the skills and characteristics that a politician is implied to have through a photo, e.g. “competent”; we adapt their method as a baseline in our setting. [49] study differences in facial portrayals between presidential candidates, and [70, 71] examine visual differences between supporters of the left or right.We learn to generate faces from the left and right.Further, we examine differences in general images rather than just faces.[26, 74] predict the persuasive messages of advertisements, but persuasion in political images is more subtle.These works are based on careful and expensive human annotations, while we aim to discover facets of bias in a weakly supervised way.
24
+
25
+ Prior work in NLP has discovered indicators of biased language and political framing (i.e. presenting an event or person in a positive or negative light). For example, [54, 3] use carefully designed dictionary, lexical, grammatical and content features to detect biased language, using supervision over short phrases. Others [50, 9, 10, 11, 73, 68] have studied predicting politics from text. In contrast,it is not clear what “lexicon” of biased content to use for images.
26
+
27
+ Because no dataset exists for this problem, we assembled a large dataset of images and text about contemporary politically charged topics.We got a list of “biased” sources from mediabiasfactcheck.com which places news media on a spectrum from extreme left to extreme right.We used [47] to get a list of current “hot topics” e.g. immigration, LGBT rights, welfare, terrorism, the environment, etc. We crawled the media sources that were labeled left/right or extreme left/right for images using each of these topics as queries. After identifying images associated with each keyword and the pages they were on, we used [52] to extract articles. We obtained 1,861,336 images total and 1,559,004 articles total. We manually removed boilerplate text (headers, copyrights, etc.) which leaked into some articles.
28
+
29
+ Because sources cover the same events, some images are published multiple times. To prevent models from “cheating” by memorization, all experiments are performed on a “deduplicated” subset of our data. We extract features from a Resnet [24] model for all images. Because computing distances between all pairs is intractable, we use [39] for approximate kNN search (k=200𝑘200k=200). We set a threshold on neighbors’ distances to find duplicates and near-duplicates. We determine the threshold empirically by examining hundreds of kNN matches to ensure all near-duplicates are detected. From each set of duplicates, we select one image (and its associated article) to remain in our “deduplicated” dataset while excluding all others. If the same image appeared in both left and right media sources, we keep it on the side where it was more common, e.g. one left source and three right sources would result in preserving one of the image-text pairs from the right sources.After removing duplicates, we are left with 1,079,588 unique images and paired text on which the remainder of this paper is based.
30
+
31
+ We treat the problem of predicting bias as a weakly supervised task. For training, we assume all image-text pairs have the political leaning of the source they come from. In Sec. 5.3 we show that this assumption is reasonable by leveraging human labels, though it is certainly not correct for all images / text, e.g. a left-leaning source may publish a right-leaning image to critique it. In order to better explore this assumption and understand human conceptions of bias, we ran a large-scale crowdsourcing study on Amazon Mechanical Turk (MTurk). We asked workers to guess the political leaning of images by indicating whether the image favored the left, right, or was unclear. In total, we showed 3,237 images to at least three workers each. We show examples of different levels of agreement in Fig. 1. In total, 993 were labeled with a clear L/R label by at least a majority. We also asked what image featureswere used to make their guess. The features workers could choose (and the count of each agreed upon) was: closeup-90 (closeup of specific person’s face), known person-409 (portrays public figure in political way), multiple people-237 (group or class of people portrayed in political way), no people-81 (scenes or objects associated with parties, e.g. windmill/left, gun/right), symbols-104 (e.g. swastika, pride flag), non-photographic-130 (cartoons, charts, etc.), logos-77 (logo of e.g. CNN, FOX, etc.), and text in image-267 (e.g. text on protest signs, captions, etc.).
32
+
33
+ We also showed workers the image’s article and asked a series of questions about the image-text pair, such as the political leaning of the pair (as opposed to image only), the topic (e.g. terrorism, LGBT) the pair is related to, and which article text best aligned with the image. We computed agreement scores and found that 2.45 out 3 annotators agreed on bias label on average, while 1.71 out of 3 agreed on topic, on average. Finally, we asked workers to provide a free-form text explanation of their politics prediction for a small number of images.We extracted semantic concepts from these explanations and later use them to train one of our baseline methods (Sec. 5.1). Humans often mentioned using the positive/negative portrayal of public figures and the gender, race and ethnicity of photo subjects. We provide a demonstration of differences in portrayal across L/R in Sec. 5.5. Absent these cues, workers used stereotypical notions of what issues the left/right discuss or their values. For example, for images of protests or college women, annotators might guess “left”.
34
+
35
+ To ensure quality, we used validation images with obvious bias to disqualify careless workers. We restricted our task to US workers who passed a qualification test, had ≥98absent98\geq 98% approval rate, and who had completed ≥\geq1,000 HITs.In total, we collected 14,327 sets of annotations (each containing image bias label, image-text pair bias label, topic, etc.) at a cost of $4,771.We include a number of experimental results on this human annotated set of images in Sec. 5.3.
36
+
37
+ We hypothesize that the complementary textual domain provides a useful cue to guide the training of our visual bias classifier.The text of the articles includes words that clearly correlate with political bias, e.g. “unite”, “medicaid”, “donations”, “homosexuality”, “Putin”, “Antifa” and “brutality” strongly correlate with left bias according to our model, while “defend”, “retired”, “NRA”, “minister” and “cooperation” strongly correlate with right bias.By factoring out these semantic concepts into the auxiliary text domain, we enable our model to learn complementary visual cues.We use information flowing from the visual pipeline, and fuse it with the document embedding as an auxiliary source of information. Because we are primarily interested in visual political bias, we next remove our model’s reliance on textual features, but keep all convolutional layers fixed. We train a linear bias classifier on top of the first model, using it as a feature extractor. Thus, at test time, our model predicts the bias of an image without using any text.We illustrate our method in Fig. 2.
38
+
39
+ We wish to capture the implicit semantics of an image by leveraging the association between images and text. More specifically, let𝒟={𝐱i,𝐚i,𝐲i}i=1N𝒟superscriptsubscriptsubscript𝐱𝑖subscript𝐚𝑖subscript𝐲𝑖𝑖1𝑁\mathcal{D}=\left\{\mathbf{x}_{i},\mathbf{a}_{i},\mathbf{y}_{i}\right\}_{i=1}^{N}(1)denote our dataset 𝒟𝒟\mathcal{D}, where 𝐱isubscript𝐱𝑖\mathbf{x}_{i} represents image i𝑖i, 𝐚isubscript𝐚𝑖\mathbf{a}_{i}, represents the textual article associated with the it​hsuperscript𝑖𝑡ℎi^{th} image, and 𝐲isubscript𝐲𝑖\mathbf{y}_{i} represents the political leaning of the image. In the first stage of our method, we seek the following function:fθ​(𝐱i,Ω​(𝐚i))=𝐲isubscript𝑓𝜃subscript𝐱𝑖Ωsubscript𝐚𝑖subscript𝐲𝑖f_{\mathbf{\theta}}\left(\mathbf{x}_{i},\Omega\left(\mathbf{a}_{i}\right)\right)=\mathbf{y}_{i}(2)where Ω(.)\Omega\left(.\right) represents transforming the article text into a latent feature space.We train Doc2Vec [36] offline on our train set of articles to parameterize ΩΩ\Omega.Specifically, ΩΩ\Omega is trained to maximize the average log probability1T​∑t=1Tlog⁡p​(𝐰𝐭|𝐝,𝐰𝐭−𝐤,…,𝐰𝐭+𝐤)1𝑇superscriptsubscript𝑡1𝑇𝑝conditionalsubscript𝐰𝐭𝐝subscript𝐰𝐭𝐤…subscript𝐰𝐭𝐤\frac{1}{T}\sum_{t=1}^{T}\log p\left(\mathbf{w_{t}}|\mathbf{d},\mathbf{w_{t-k}},\ldots,\mathbf{w_{t+k}}\right)(3)where T𝑇T is the number of words in article 𝐚𝐚\mathbf{a} (we omit the index i𝑖i to simplify notation), p𝑝p represents the probability of the indicated word, 𝐰𝐭subscript𝐰𝐭\mathbf{w_{t}} is the learned embedding for word t𝑡t of article 𝐚𝐚\mathbf{a}, 𝐝𝐝\mathbf{d} is the learned document embedding of 𝐚𝐚\mathbf{a} (200D), and k𝑘k is the window around the word to look when training the model. We use hierarchical softmax [42] to compute p𝑝p.We train Doc2Vec on our corpus of news articles, and observe more intuitive embeddings than from a pretrained model.
40
+
41
+ After training, we compute ΩΩ\Omega for a given article 𝐚𝐚\mathbf{a} by finding the embedding 𝐝𝐝\mathbf{d} that maximizes Eq. 3.ΩΩ\Omega thus projects each article into a space where the resulting vector captures the overall latent context and topic of the article.We provide Ω​(𝐚)Ω𝐚\Omega\left(\mathbf{a}\right) to our model’s fusion layer for each train image. The fusion layer is a linear layer which receives concatenated image and text features and learns to project them into a multimodal image-text embedding space which is finally used by the classifier.
42
+
43
+ The formulation of fθ(.)f_{\theta}(.) described above requires that the ground-truth text be available at test time and also does not ensure that our model is learning visual bias (i.e. the classifier may be relying primarily on text features and ignoring the visual channel completely).To address this problem, in the second stage of our method, we finetune fθsubscript𝑓𝜃f_{\theta} to directly predict the politics of an image only, without the text, as follows: fθ,θ′′​(𝐱i)=𝐲isubscriptsuperscript𝑓′𝜃superscript𝜃′subscript𝐱𝑖subscript𝐲𝑖f^{\prime}_{\mathbf{\theta},\theta^{\prime}}\left(\mathbf{x}_{i}\right)=\mathbf{y}_{i}. Specifically, we freeze the trained convolutional parameters of fθsubscript𝑓𝜃f_{\theta} and add a final linear classifier layer to the network, whose parameters are denoted θ′superscript𝜃′\theta^{\prime}. Because fθsubscript𝑓𝜃f_{\theta}’s convolutional layers have already been trained jointly with text features, they havealready learned to extract visual features which complemented the text domain; we now learn to use those features alone for bias prediction, as shown in Fig. 2.
44
+
45
+ All methods use the Resnet-50 [24] architecture and are initialized with a pretrained Imagenet model. We train all models using Adam [34], with learning rate of 1.0e-4 and minibatch size of 64 images. We use cross-entropy loss and apply class-weight balancing to correct for slight data imbalance between L/R. We use an image size of 224x224 and random horizontal flipping as data augmentation. We use Xavier initialization  [21] for non-pretrained layers. We use PyTorch [46] to train all image models. For our text embedding, we use [55], with 𝐝∈ℛ200×1𝐝superscriptℛ2001\mathbf{d}\in\mathcal{R}^{200\times 1} and train using distributed memory [36] for 20 epochs with window size k=20𝑘20k=20, ignoring words which appear less than 20 times.
46
+
47
+ In this section, we demonstrate our method’s performance at predicting left/right bias.We show results on a large held-out test set from our dataset, whose left/right labels come from the leaning of the news source containing the image.We also show results on test images for which a majority of human annotators agreed on the bias and show how humans reason about visual bias. We show that seeing the complementary text information helped humans become more accurate at this task, much like seeing the text at training time helps our algorithm.We also show the challenge of our task through across-class nearest-neighbors, how the portrayal of politicians differs from the left to the right, images that best match various words from articles, and visualize how our model makes decisions about visual bias. Our supp. contains additional results such as results per-media source / per-political issue, an exploration of the learned text embedding space, failure cases for machines/humans, humans’ reasoning behind their bias decisions, and examples from our dataset.
48
+
49
+ For quantitative results, we show the accuracy of each method on predicting left/right bias.We compare against the following baselines:•Resnet [24] - A standard 50-layer classification Resnet.•Joo [31] - Adaptation of Joo et al.’s method for our task.We use [31]’s dataset to train predictors for 15 attributes and nine “intents” (qualities the photo subject is estimated to have, e.g. trustworthiness, competence). We then use the predictions for these attributes and intents on images from our dataset as additional features to a Resnet to predict a left/right leaning.•Human Concepts - We use the manually extracted vocabulary of bias-related concepts (e.g. “confederate”, “African-American”) from the human-provided explanations (Sec. 3.2) and download data for each from Google Image Search. We train a separate Resnet to predict concepts, and use it on each image in our dataset: p​(cj|𝐱i)𝑝conditionalsubscript𝑐𝑗subscript𝐱𝑖p(c_{j}|\mathbf{x}_{i}) denotes the probability that image 𝐱isubscript𝐱𝑖\mathbf{x}_{i} exhibits concept cjsubscript𝑐𝑗c_{j}. We then use the confidence of each detected concept, as a feature vector to predict bias.•OCR - We use [41] to recognize free-form scene text in images. Because images contain words not found in the default lexicon (e.g. Manafort), we create our own lexicon from the 100k most common words in our articles. We use [19] for spelling correction. We represent each recognized word as its learned word embedding,denoted 𝐰i′subscriptsuperscript𝐰′𝑖\mathbf{w}^{\prime}_{i}, weighed by the confidence of the recognition p​(𝐰i′)𝑝subscriptsuperscript𝐰′𝑖p\left(\mathbf{w}^{\prime}_{i}\right) as provided by the recognition model. The feature is thus given by 1n​∑i=1np​(𝐰i′)​𝐰i′1𝑛superscriptsubscript𝑖1𝑛𝑝subscriptsuperscript𝐰′𝑖subscriptsuperscript𝐰′𝑖\frac{1}{n}\sum_{i=1}^{n}p\left(\mathbf{w}^{\prime}_{i}\right)\mathbf{w}^{\prime}_{i}.
50
+
51
+ All methods use the same residual network architecture. For methods relying on additional features, we use the fusion architecture in Fig. 2.For reference, we also show an upper-bound method Ours (GT) which uses the Ground Truth text paired with the images at test time (to compute a document embedding), in addition to the image. We thus consider it an upper-bound to the task of visual only prediction. Ours (GT) is the same as the first stage of our approach (see Fig. 2, left), without the addition of the image classifier layer in step 2.
52
+
53
+ In Table 1, we show the results of evaluating our methods on 75,148 held-out images with weakly supervised labels.Our method performs best overall. The top two performing methods rely on semantics discovered in the text domain (Ours and OCR). OCR is unique in that it is able to explicitly use text information at test time, by discovering text within the image and then using word embeddings.Ours improves over OCR by 2.6% (relative 3.8%, reduction in error of 8%).The improvement of Ours over Resnet is 3.4% (relative 5%, error reduction of 11%).This amounts to classifying an additional ∼similar-to\scriptstyle\mathtt{\sim}2,555 images correctly.Relying on the concepts humans identified actually slightly hurt performance compared to Resnet. This may be because of a disconnect between humans’ preconceived notions about L/R and those required by the dataset.We finally observe Joo performs the weakest, likely because [31]’s data mainly features closeups of politicians, while ours contains a much broader image range.
54
+
55
+ We next tested our methods on test images which at least a majority of MTurkers labeled as having the same bias, i.e. those that humans agreed had a particular label. We describe this dataset in Sec. 3.2. Because workers also labeled images with what features of the image they used to make their prediction, we also break down each method’s performance by feature. We show this result in Table 2. Ours performs best on average across all categories and performs best on four out of eight categories. Categories where Ours is outperformed on are reasonable: OCR performs best when text can be relied on in the image, i.e. “logos” and “text in image”. We note that while the overall result for OCR approaches Ours, Ours works better on a broader set of images than OCR and is thus a more general method for predicting visual bias. Ours is also outperformed by Human Concepts when humans relied on a known face (politician, celebrity, etc.). This may be because Human Concepts relies on external training data (Sec. 5.1) which feature many known individuals, e.g. “rappers” and “founding fathers”. Joo outperforms our method when the prediction depends on scene context (“no people”), again likely because Joo uses an external human-labeled dataset to learn features, including scene attributes (e.g. indoor, background, national flag, etc.). We note Ours (GT) performs sig. worse on human labels vs. weakly-supervised labels. This is likely because Ours (GT) has learned to exploit dataset-specific features (e.g. author names, header text, etc.) for prediction, which does not actually translate into humans’ commonsense understanding of political bias.
56
+
57
+ We next test whether our assumption that all images harvested from a right- or left-leaning source exhibit that type of bias is reasonable. Several results computed from our ground-truth human study suggest that our web labels are a reasonable approximation of bias.First, we observe that the relative performance of the methods across Table 1 and 2 is roughly maintained; Ours is best, followed by OCR, and the other methods essentially tied.The results are also sound, e.g. when humans used text, OCR tends to do better, which indicates the model’s concept of bias correlates with humans’.
58
+
59
+ We also performed two other experiments to verify our conclusions. First, we explored the difference between the performance of our method on images on which the majority of humans agreed vs. those on which humans unanimously agreed. We found that our method worked better when humans unanimously labeled the images vs. simple majority (gain of 4.4%). This suggests that as humans become more certain of bias, our model (trained on noisy data) also performs better. Next, we evaluated the impact of text on humans’ bias predictions. We compared how humans changed their predictions (made originally using the image only) after they saw the text paired with the image.We found that when workers picked a L/R label, the label was strongly correlated with the weakly supervised label. Moreover, after seeing the text, humans became even more correct with respect to the noisy labels, switching many “unclear” predictions to the “correct” label (i.e. the noisy label). This indicates that: 1) our noisy labels are a good approximation of the true bias of the images; and 2) the paired text is useful for predicting bias (a result also borne out by our experiments).
60
+
61
+ In order to test the soundness of our method and our experimental design, we performed several ablations. We first tested the importance of the second stage of our method (right side of Fig. 2). To do so, we used Ours (GT), the result of the first stage of our method andinstead of performing stage 2, we removed the dependency on text by zeroing out all text embedding weights in the fusion layer.We evaluated on our weakly supervised test set and obtained 0.677, a result sig. worse than our full method, underscoring the importance of stage 2. We next tested how the performance of our method varied given the length of the article text.We thus trained our method with the first k sentences of the article and obtained these results: k=1→0.672𝑘1→0.672k=1\rightarrow 0.672, k=2→0.669𝑘2→0.669k=2\rightarrow 0.669, k=5→0.668𝑘5→0.668k=5\rightarrow 0.668, k=10→0.669𝑘10→0.669k=10\rightarrow 0.669. All choices of k tested performed sig. worse than using the full article (0.712).
62
+
63
+ We finally examined how reliant our method was on images from a particular media source being in our train set (i.e. to test if the model was learning non-generalizable, source-specific features).We experimented with leaving out all training data harvested from a few popular sources. The result was (before excluding →→\rightarrow after excluding): Breitbart (0.607→→\rightarrow0.566), CNN (0.873→→\rightarrow0.866), CommonDreams (0.647→→\rightarrow0.636), DailyCaller (0.703→→\rightarrow0.667), DemocraticUnderground (0.713→→\rightarrow0.700), NewsMax (0.685→→\rightarrow0.628), and TheBlaze (0.746→→\rightarrow0.742). We observed only a slight decrease for all sources we tested, suggesting our method is not dependent on seeing the source at train time.
64
+
65
+ Many workers noted how politicians were portrayed in making their decision (Sec. 3.2).To visualize the differences in how well-known individuals are portrayed within our dataset, we trained a generative model to modify a given Trump/Clinton/Obama face, and make it appear as if it came from a left/right leaning source. We use a variation of the autoencoder-based model from [64], which learns a distribution of facial attributes and latent features on ads, not political images.We train the model using the features from the original method on faces of Trump/Clinton/Obama detected in our dataset using [33]. We use [59] for face recognition. To modify an image, we condition the generator on the image’s embedding and modify the distribution of attributes/expressions for the image to match that person’s average portrayal on the left/right, following [64]’s technique. We show the results in Fig. 3. Observe that Trump and Clinton appear angry on the far-left/right (respectively) end of the spectrum. In contrast, all three appear happy/benevolent in sources supporting their own party. We also observe Clinton appears younger in far-left sources. In far-right sources, Obama appears confused or embarrassed.These results further underscore that our weakly supervised labels are accurate enough to extract a meaningful signal.
66
+
67
+ In Fig. 4, we show the challenge of classifying in visual space only. We compute the distance between images from the left and right, and show L/R pairs that have a small distance in feature space within topics.For BLM, the left image is serious,while the right image is whimsical. For climate change, one presents a more negative vision, while the other is picturesque. Both border control images show fire, but the left one is of a Trump effigy. For terrorism, the left image shows a white domestic terrorist whilethe right shows Middle-Eastern men. These pairs highlight how subtle the distinctions between L/R are for some images.
68
+
69
+ We wanted to see how well our model could align images and concepts from text. We formulated a variation of our method which, instead of predicting bias, predicted relevant words. We chose a set of 1k words that had the lowest average distance between their images’ features (i.e. were visually consistent on avg.) from the 10k most frequent words.The model is trained to predict whether each word is/is not present in the image’s article given the image and text embedding. In Fig. 5, we show examples of images that were among the top-100 strongest predictions for that word. We see that the model strongly predicts “antifa” for black-clad protestors, “brutality” for police scenes and protests, “immigrant” for the border wall and Hispanics, and “LGBT” for pride flags.Though the image may only relate to a small portion of the lengthy text, there is enough visual signal present for the model to learn, demonstrating the benefit of leveraging text to complement the model’s training.
70
+
71
+ We wanted to see whether we could interpret how our model learned to perform bias classification. We used Grad-CAM++ [5] to compute attention maps on images that humans annotated.We show the result in Fig. 6. We observe that our model pays the most attention to logos and faces of public figures. We see the model only focuses on the “PBS” logo in the first row (and ignores the face of the lesser known person), but pays attention to both the “Fox News” logo and the face of the well-known commentator in the second row.We believe that because our model was trained with the topic information provided via the text embedding during stage one, the visual component of the model learned to focus on learning visual features that complemented the text (such as logos and faces). Ultimately these features work better even without the text.
72
+
73
+ We assembled a large dataset of biased images and paired articles and presented a weakly supervised approach for inferring the political bias of images.Our method leverages the image’s paired text to guide the model’s training process towards relevant semantics in a way which ultimately improves bias classification.We demonstrate the contribution of our method and dataset both quantitatively and qualitatively, including on a large crowdsourced dataset.Use cases of our work include: inferring the bias of new media sources, constructing balanced “news feeds,” or detecting political ads.Broadly speaking, our method demonstrates the potential of using an auxiliary semantic space, e.g. for abstract tasks such as video summarization and visual commonsense reasoning.
74
+
75
+ Acknowledgement: This material is based upon work supported by the National Science Foundation under Grant Number 1566270. It was also supported by an NVIDIA hardware grant. We thank the reviewers for their constructive feedback.
1911.00164v1.txt ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Networks are data structures that encode relationships between elements and can be thought of as signals that, instead of having values associated with elements, have values associated with pairs of elements. As such, they play an important role in our current scientific understanding of problems in which relationships between elements are important, including interactions between proteins or organisms in biology [1, 2], individuals or institutions in sociology [3, 4], and neurons or brain regions in neuroscience [5, 6, 7].
2
+
3
+ Despite their pervasive presence, tools to analyze networks and algorithms that exploit network data are not as well developed as tools and algorithms for processing of conventional signals.Indeed, consider a problem of proximity search in which we are given a network and an element whose dissimilarity to different nodes of the network can be determined.We are asked to find the element that is least dissimilar.In an arbitrary network, finding the least dissimilar node requires comparison against all nodes and incurs a complexity that is linear in the size of the network.In a metric space, however, the triangle inequality encodes a transitive notion of proximity.This characteristic can be exploited to design efficient search methods using metric trees whose complexity is logarithmic in the number of nodes [8, 9, 10].Likewise, many hard combinatorial problems on graphs are known to be approximable in metric spaces but not approximable in generic networks.The traveling salesman problem, for instance, is not approximable in generic graphs but is approximable in polynomial time to within a factor of 3/2 in metric spaces [10].In either case, the advantage of the metric space is that the triangle inequality endows it with a structure that an arbitrary network lacks.It is this structure that makes analysis and algorithm design tractable.
4
+
5
+ If metric spaces are easier to handle than arbitrary networks, a possible route for network analysis is to design projection operators to map arbitrary networks onto the subset of networks that represent metric spaces. This is the problem addressed in this paper.
6
+
7
+ Related work and contributions.The traditional way of mapping a generic dissimilarity function between pairs of points to a metric space is through multidimensional scaling (MDS) [11].Different problem formulations give rise to the definition of different types of MDS with a basic distinction between metric MDS, where the input consists of quantitative dissimilarities [12, 13], and non-metric MDS where dissimilarities can be ordinal [14, 15].However, all these techniques have in common that the end goal is to facilitate visualization of the data [16].Thus, MDS embeds the input dissimilarities onto familiar and low-dimensional metric spaces such as ℝ2superscriptℝ2{\mathbb{R}}^{2} or ℝ3superscriptℝ3{\mathbb{R}}^{3}.Similarly, there is a whole gamut of node embedding methods [17, 18, 19, 20, 21] that embed the node set into ℝdsuperscriptℝ𝑑{\mathbb{R}}^{d} for some relatively small d𝑑d based on the structure encoded by the network and, possibly, features on the nodes.
8
+
9
+ In this paper, we propose a new perspective to the problem of mapping generic dissimilarity networks to metric spaces.In particular, we follow an axiomatic approach, i.e., we encode as axioms desirable properties of the projections.This approach was originally inspired by [22, 23], where the authors propose three axioms to study hierarchical clustering of metric spaces. Given the relation between hierarchical clustering and ultrametrics [24, 25, 26], such a problem can be recast as projecting networks onto finite ultrametric spaces. In our current work, however, we study the projections of networks onto (regular) metric spaces.
10
+
11
+ The contributions of this paper are threefold.First, we introduce an axiomatic approach for the study of metric projections and show that the proposed axioms imply a unique admissible way of performing these projections, which is based on shortest paths in the network.Second, we show that this (canonical) projection is also optimal in a well-defined sense, thus helping to approximate certain classes of combinatorial problems in graphs.Lastly, we illustrate how the canonical metric representation of a network can be used to perform fast (approximate) search in the network.
12
+
13
+ We consider weighted, undirected graphs or networks.A graph G=(V,E,W)𝐺𝑉𝐸𝑊G=(V,E,W) is a triplet formed by a finite set of n𝑛n nodes or vertices V𝑉V, a set of edges E⊆V×V𝐸𝑉𝑉E\subseteq V\times V where (x,y)∈E𝑥𝑦𝐸(x,y)\in E represents an edge from x∈V𝑥𝑉x\in V to y∈V𝑦𝑉y\in V, and a map W:E→ℝ++:𝑊→𝐸subscriptℝabsentW\colon E\to{\mathbb{R}}_{++} from the set of edges to the strictly positive real numbers.Since G𝐺G is assumed to be undirected, (x,y)∈E𝑥𝑦𝐸(x,y)\in E implies (y,x)∈E𝑦𝑥𝐸(y,x)\in E, and similarly W​(x,y)=W​(y,x)𝑊𝑥𝑦𝑊𝑦𝑥W(x,y)=W(y,x).Moreover, the graphs considered do not contain self-loops, i.e., (x,x)∉E​for all​x∈V𝑥𝑥𝐸for all𝑥𝑉(x,x)\notin E\ \text{for all}\ x\in V.Denote by 𝒩𝒩{\cal N} the set of all networks, where networks in 𝒩𝒩{\cal N} can have different node sets V𝑉V, different edge sets E𝐸E, or different weights W𝑊W.
14
+
15
+ Given a finite set X𝑋X, a metric d:X×X→ℝ+:𝑑→𝑋𝑋subscriptℝd\colon X\times X\to{\mathbb{R}}_{+} is a function satisfying the following three properties for every x,y,z∈X𝑥𝑦𝑧𝑋x,y,z\in X:Symmetry:d​(x,y)=d​(y,x)𝑑𝑥𝑦𝑑𝑦𝑥d(x,y)=d(y,x).Identity:d​(x,y)=0𝑑𝑥𝑦0d(x,y)=0 if and only if x=y𝑥𝑦x=y.Triangle inequality:d​(x,y)≤d​(x,z)+d​(z,y)𝑑𝑥𝑦𝑑𝑥𝑧𝑑𝑧𝑦d(x,y)\leq d(x,z)+d(z,y).The ordered pair (X,d)𝑋𝑑(X,d) is said to be a finite metric space [27], and the set of all finite metric spaces is denoted as ℳℳ{\cal M}.In this paper we treat finite metric spaces (X,d)𝑋𝑑(X,d) as networks of the form (X,X×X,d)𝑋𝑋𝑋𝑑(X,X\times X,d).One can observe that ℳ⊂𝒩ℳ𝒩{\cal M}\subset{\cal N}.
16
+
17
+ To define metric projections for networks, it is important to define paths and path lengths.For a network G=(V,E,W)𝐺𝑉𝐸𝑊G=(V,E,W) and x,x′∈V𝑥superscript𝑥′𝑉x,x^{\prime}\in V, a path Px​x′subscript𝑃𝑥superscript𝑥′P_{xx^{\prime}} is an ordered sequence of nodes in V𝑉V,Px​x′=[x=x0,x1,…,xl−1,xl=x′],subscript𝑃𝑥superscript𝑥′delimited-[]formulae-sequence𝑥subscript𝑥0subscript𝑥1…subscript𝑥𝑙1subscript𝑥𝑙superscript𝑥′P_{xx^{\prime}}=[x=x_{0},x_{1},\ldots,x_{l-1},x_{l}=x^{\prime}],(1)which starts at x𝑥x and finishes at x′superscript𝑥′x^{\prime} and ei=(xi,xi+1)∈Esubscript𝑒𝑖subscript𝑥𝑖subscript𝑥𝑖1𝐸e_{i}=(x_{i},x_{i+1})\in E for i=0,…,l−1𝑖0…𝑙1i=0,\ldots,l-1.In this paper, we only consider connected graphs, i.e., there exists at least one path Px​x′​for all​x,x′∈Vsubscript𝑃𝑥superscript𝑥′for all𝑥superscript𝑥′𝑉P_{xx^{\prime}}\ \text{for all}\ x,x^{\prime}\in V.
18
+
19
+ We define the length of a given path Px​x′=[x=x0,…,xl=x′]subscript𝑃𝑥superscript𝑥′delimited-[]formulae-sequence𝑥subscript𝑥0…subscript𝑥𝑙superscript𝑥′P_{xx^{\prime}}=[x=x_{0},\ldots,x_{l}=x^{\prime}] as h​(Px​x′)=W​(x0,x1)+…+W​(xl−1,xl)ℎsubscript𝑃𝑥superscript𝑥′𝑊subscript𝑥0subscript𝑥1…𝑊subscript𝑥𝑙1subscript𝑥𝑙h(P_{xx^{\prime}})=W(x_{0},x_{1})+\ldots+W(x_{l-1},x_{l}), i.e., the sum of the weights associated with the links in the path.For convenience, we utilize the convention that h​([x,x])=0​for all​x∈Vℎ𝑥𝑥0for all𝑥𝑉h([x,x])=0\ \text{for all}\ x\in V.We define the shortest path length function s:V×V→ℝ+:𝑠→𝑉𝑉subscriptℝs:V\times V\to{\mathbb{R}}_{+} where the minimum length s𝑠s between nodes x,x′∈V𝑥superscript𝑥′𝑉x,x^{\prime}\in V is given bys​(x,x′)=minPx​x′⁡h​(Px​x′).𝑠𝑥superscript𝑥′subscriptsubscript𝑃𝑥superscript𝑥′ℎsubscript𝑃𝑥superscript𝑥′s(x,x^{\prime})=\min_{P_{xx^{\prime}}}\,\,h(P_{xx^{\prime}}).(2)The connectedness of G𝐺G ensures that s​(x,x′)𝑠𝑥superscript𝑥′s(x,x^{\prime}) is well-defined for every pair of nodes x,x′∈V𝑥superscript𝑥′𝑉x,x^{\prime}\in V.
20
+
21
+ Throughout this paper, we study the design of metric projections 𝒫𝒫{\mathcal{P}} with the objective of representing networks as metric spaces.Formally, for all node sets V𝑉V we define a metric projection 𝒫:𝒩→ℳ:𝒫→𝒩ℳ{\mathcal{P}}:{\mathcal{N}}\to{\mathcal{M}} as a map that projects every network onto a metric space while preserving V𝑉V.We say that two metric projections 𝒫𝒫{\mathcal{P}} and 𝒫′superscript𝒫′{\mathcal{P}}^{\prime} are equivalent, and we write 𝒫≡𝒫′𝒫superscript𝒫′{\mathcal{P}}\equiv{\mathcal{P}}^{\prime}, if and only if 𝒫​(G)=𝒫′​(G)𝒫𝐺superscript𝒫′𝐺{\mathcal{P}}(G)={\mathcal{P}}^{\prime}(G), for all G∈𝒩𝐺𝒩G\in{\mathcal{N}}.
22
+
23
+ The given definition of a metric projection 𝒫𝒫{\cal P} allows for maps with undesirable behavior.Take, for instance, the map that projects networks onto a discrete metric space, i.e., for any graph G=(V,E,W)𝐺𝑉𝐸𝑊G=(V,E,W), consider the projection onto the finite metric space (V,d)𝑉𝑑(V,d) where d​(x,y)=1𝑑𝑥𝑦1d(x,y)=1 and d​(x,x)=0𝑑𝑥𝑥0d(x,x)=0 for all x≠y∈V𝑥𝑦𝑉x\neq y\in V.Such a projection clearly does not incorporate the original network structure, although the output is a valid metric space.To enforce the incorporation of network structure in a valid projection, we state two axioms to guide the design of such projections.
24
+
25
+ Recall from Section 2 that the set of all finite metric spaces is a subset of the set of networks, i.e., ℳ⊂𝒩ℳ𝒩{\cal M}\subset{\cal N}.Motivated by this, we state the following axiom for metric projections of networks.
26
+
27
+ Given that our goal is to represent networks with more structured metric spaces, if we already have a metric space there is no justification to change it.This concept is illustrated in Fig. 1.
28
+
29
+ We also wish to enforce intuitive behavior for transformations of networks.Given two networks G=(V,E,W),G′=(V′,E′,W′)formulae-sequence𝐺𝑉𝐸𝑊superscript𝐺′superscript𝑉′superscript𝐸′superscript𝑊′G=(V,E,W),G^{\prime}=(V^{\prime},E^{\prime},W^{\prime}), an injective map ϕ:V→V′:italic-ϕ→𝑉superscript𝑉′\phi\colon V\to V^{\prime} is dissimilarity-reducing if, for all (x,x′)∈E𝑥superscript𝑥′𝐸(x,x^{\prime})\in E, the following properties hold:Dissimilarity-reducing:W​(x,x′)≥W′​(ϕ​(x),ϕ​(x′))𝑊𝑥superscript𝑥′superscript𝑊′italic-ϕ𝑥italic-ϕsuperscript𝑥′W(x,x^{\prime})\geq W^{\prime}(\phi(x),\phi(x^{\prime})),Edge-preserving:(ϕ​(x),ϕ​(x′))∈E′italic-ϕ𝑥italic-ϕsuperscript𝑥′superscript𝐸′(\phi(x),\phi(x^{\prime}))\in E^{\prime}.Intuitively, dissimilarity-reducing maps reduce the path lengths between nodes in the domain of the map, as shown in Fig. 2.Thus, we expect nodes to be closer together in their metric projection after undergoing a dissimilarity-reducing transformation, which we enforce with the following axiom.
30
+
31
+ Axiom 2 encodes the natural requirement that if we reduce dissimilarities in network G𝐺G to obtain G′superscript𝐺′G^{\prime}, then the metric space onto which G′superscript𝐺′G^{\prime} is mapped cannot have distances larger than those on the metric space associated with G𝐺G.We say that a projection 𝒫𝒫{\cal P} is admissible if it satisfies Axioms 1 and 2.The landscape of admissible projections is characterized next.
32
+
33
+ In the framework established by Axioms 1 and 2, we first seek to establish the existence of an admissible projection operator.To this end, we define the canonical projection 𝒫∗:𝒩→ℳ:superscript𝒫→𝒩ℳ{\cal P}^{*}\colon{\cal N}\to{\cal M}, where for a given graph G=(V,E,W)𝐺𝑉𝐸𝑊G=(V,E,W), the metric space (V,d∗)=𝒫∗​(G)𝑉superscript𝑑superscript𝒫𝐺(V,d^{*})={\cal P}^{*}(G) is defined byd∗​(x,x′)=s​(x,x′)​ for ​x,x′∈V.formulae-sequencesuperscript𝑑𝑥superscript𝑥′𝑠𝑥superscript𝑥′ for 𝑥superscript𝑥′𝑉d^{*}(x,x^{\prime})=s(x,x^{\prime})\text{ for }x,x^{\prime}\in V.(4)That is, the canonical projection map yields a metric corresponding to the geodesic distance or shortest path length between nodes.It can be shown that the canonical projection satisfies both axioms, as stated in the following proposition.
34
+
35
+ The proof of this can be found in Appendix A.Given that the canonical projection is admissible, two questions arise:(i) Are there any other admissible projections?; and(ii) Is the canonical projection special in any sense?Both questions are answered by the following uniqueness theorem.
36
+
37
+ The proof of this can be found in Appendix B.By Theorem 1, there is only one admissible projection from the set of networks to the set of finite metric spaces, namely the canonical projection.
38
+
39
+ Notice that the proposed canonical metric projection is nothing more than the well-known shortest path metric in the graph.However, the proposed axioms provide a clean framework for the validity of this widely used metric.If a practitioner agrees with the axioms, then shortest path must be the right metric between nodes in the graph.Conversely, if a different metric is used, then a practitioner can be now aware that at least one of the axioms must be violated.Apart from providing a clean theoretical framework, the proposed axioms allow us to establish desirable properties of the (canonical) shortest path metric, as we study next.
40
+
41
+ A myriad of combinatorial optimization problems exist, where the goal is to find subsets of edges of a network that are optimal in some sense.Examples include the traveling salesman problem – finding a path that visits each node exactly once with smallest length [28] – and the minimum bisection problem [29] – separating the network into two equally-sized blocks so that the sum of the weights in the edges that connect the blocks is minimal.In this section, we focus on problems characterized by an objective function that depends on the weights of the edges of the network.
42
+
43
+ Define the function f:𝒩→ℝ:𝑓→𝒩ℝf:{\mathcal{N}}\to{\mathbb{R}} that maps every network G𝐺G to the minimum cost f​(G)𝑓𝐺f(G) of an optimization problem that depends on the structure of G𝐺G.We can leverage the fact that combinatorial problems are often simpler to solve in metric spaces to efficiently obtain lower bounds for f​(G)𝑓𝐺f(G) [30, 31].More specifically, we restrict our attention to cost functions f𝑓f that do not decrease with increasing edge weights, i.e., for networks with a shared set of nodes f​(G′)≥f​(G)𝑓superscript𝐺′𝑓𝐺f(G^{\prime})\geq f(G) if the identity map is dissimilarity-reducing from G′superscript𝐺′G^{\prime} to G𝐺G.Then, if we project an arbitrary network G𝐺G onto a metric space M𝑀M where no dissimilarity is increased, we may compute the lower bound f​(M)𝑓𝑀f(M) efficiently.The optimal choice for this projection is the canonical map 𝒫∗superscript𝒫{\mathcal{P}}^{*} as we show in the following proposition.
44
+
45
+ The proof of this can be found in Appendix C.Proposition 2 states that of all projections 𝒫:𝒩→ℳ:𝒫→𝒩ℳ{\mathcal{P}}:{\mathcal{N}}\to{\mathcal{M}} that do not increase dissimilarities [cf. constraint in (5)], the canonical projection 𝒫∗superscript𝒫{\mathcal{P}}^{*} decreases the edge weights the least while imposing a metric structure.Thus, since f𝑓f is non-decreasing in the edge weights, 𝒫∗superscript𝒫{\mathcal{P}}^{*} perturbs f​(G)𝑓𝐺f(G) the least, for every network G∈𝒩𝐺𝒩G\in{\mathcal{N}}.Given that 𝒫∗​(G)superscript𝒫𝐺{\mathcal{P}}^{*}(G) and G𝐺G are close, algorithms for efficiently solving combinatorial optimization problems in metric spaces can be applied to find a lower bound to f​(G)𝑓𝐺f(G) that is optimal over all metric projections of G𝐺G.
46
+
47
+ Given a network G=(V,E,W)𝐺𝑉𝐸𝑊G=(V,E,W), assume that we have access only to a subset of the network G′=(V′,E′,W′)superscript𝐺′superscript𝑉′superscript𝐸′superscript𝑊′G^{\prime}=(V^{\prime},E^{\prime},W^{\prime}) where V′⊂Vsuperscript𝑉′𝑉V^{\prime}\subset V and E′superscript𝐸′E^{\prime} and W′superscript𝑊′W^{\prime} are the restrictions of E𝐸E and W𝑊W to V′superscript𝑉′V^{\prime}, respectively.An additional point z∈V\V′𝑧\𝑉superscript𝑉′z\in V\backslash V^{\prime} is then revealed, and we seek to find the node x∈V′𝑥superscript𝑉′x\in V^{\prime} closest to z𝑧z, i.e., the node x𝑥x for which W​(x,z)𝑊𝑥𝑧W(x,z) is minimized.The described setting occurs frequently in practice, e.g., in the implementation of k𝑘k nearest neighbor (k-NN) methods [32, Chapter 2] where G𝐺G is the dataset of interest and G′superscript𝐺′G^{\prime} is the training set.The complexity of the mentioned task depends on how structured the network G𝐺G is.When no structure is present, an exhaustive search is the only option and z𝑧z must be compared with every node in V′superscript𝑉′V^{\prime}.By contrast, when G𝐺G is a metric space, then the NN of z𝑧z can be found efficiently by leveraging metric trees [8, 9, 10]. In this section, we propose an efficient search strategy in networks by first projecting a general network onto a metric space and then leveraging this structure for search via the construction of a metric tree.
48
+
49
+ Intuitively, if z𝑧z is far away from a node x𝑥x in a metric space, i.e., W​(z,x)𝑊𝑧𝑥W(z,x) is large, then the triangle inequality implies that z𝑧z will also be far away from any node x′superscript𝑥′x^{\prime} close to x𝑥x, thus, there is no need to consider nodes x′superscript𝑥′x^{\prime} as potential candidates for the NN of z𝑧z.Metric trees formally leverage this intuition by constructing hierarchical structures of V′superscript𝑉′V^{\prime} in order to accelerate search.In this paper, we focus on the vantage point tree (vp-tree) [8], one of the most popular types of metric tree.The implementation of a metric tree is a two-step process: we first construct the tree and then utilize it for (possibly multiple) queries.
50
+
51
+ To construct a vp-tree given G′superscript𝐺′G^{\prime}, we begin by associating the whole node set V′superscript𝑉′V^{\prime} to the root of the tree and then pick a node (the vantage point) at random, say v∈V′𝑣superscript𝑉′v\in V^{\prime} .We then compute the median μvsubscript𝜇𝑣\mu_{v} of the distances W​(v,x)𝑊𝑣𝑥W(v,x) from the vantage point to every other node x∈V′𝑥superscript𝑉′x\in V^{\prime} and partition V′superscript𝑉′V^{\prime} into two blocks: one containing the nodes whose distance to v𝑣v is smaller than or equal to μvsubscript𝜇𝑣\mu_{v} and the other one containing the rest of V′superscript𝑉′V^{\prime}.The nodes in the first block are assigned to the left child of the root of the vp-tree while the right child consists of the nodes in the second block.We iteratively repeat this procedure within each of the children until every leaf in the vp-tree is associated with a single point in V′superscript𝑉′V^{\prime}; see Fig. 3(a).For more details, see [8].
52
+
53
+ To efficiently search a vp-tree for the NN of a query point z𝑧z, we traverse the nodes of the tree and compare z𝑧z only with the vantage point of the current node of the vp-tree.We then leverage the triangle inequality to discard branches of the vp-tree without even traversing them, reducing the number of measurements needed to find the NN of z𝑧z.More specifically, assume that we are searching at an intermediate node in the vp-tree, say node L𝐿L in Fig. 3(a) and the current best estimate of the NN is at distance τ𝜏\tau from z𝑧z, which can be initialized as τ=∞𝜏\tau=\infty for the root of the vp-tree.We then compute the distance W​(z,vL)𝑊𝑧subscript𝑣𝐿W(z,v_{L}) between z𝑧z and the vantage point vLsubscript𝑣𝐿v_{L} associated with the current node in the vp-tree.If W​(z,vL)<τ𝑊𝑧subscript𝑣𝐿𝜏W(z,v_{L})<\tau, we then update our estimate of τ𝜏\tau.In order to continue traversing the vp-tree, we follow the ensuing rules where v𝑣v is the vantage point of the current node in the vp-tree{i)W(z,v)≤μv−τ⇒visit only the left child,ii)μv−τ<W(z,v)≤μv+τ⇒visit left & right child,iii)μv+τ<W(z,v)⇒visit only right child.\displaystyle\begin{cases}i)\,W(z,v)\leq\mu_{v}-\tau\,\Rightarrow\,\text{visit only the left child},\\ii)\,\mu_{v}-\tau<W(z,v)\leq\mu_{v}+\tau\,\Rightarrow\,\text{visit left \& right child},\\iii)\,\mu_{v}+\tau<W(z,v)\,\Rightarrow\,\text{visit only right child}.\end{cases}(6)Even though statements i)i) and iii)iii) in (6) entail that we discard part of the nodes in V′superscript𝑉′V^{\prime} during our search, the way the metric tree is constructed guarantees that the NN of z𝑧z is not contained among the discarded nodes.
54
+
55
+ The construction of the vp-tree, a one-time computational effort, can be shown to have complexity 𝒪​(n​log⁡n)𝒪𝑛𝑛\mathcal{O}(n\log n) where n𝑛n is the cardinality of V′superscript𝑉′V^{\prime}.However, once it is built it can be used to reduce the complexity of a brute force linear search from 𝒪​(n)𝒪𝑛\mathcal{O}(n) to an expected cost of 𝒪​(log⁡n)𝒪𝑛\mathcal{O}(\log n) [8].To corroborate this, we construct metric spaces of varying sizes by embedding points in a square in ℝ2superscriptℝ2{\mathbb{R}}^{2} and consider their Euclidean distance as the dissimilarities W𝑊W.In Fig. 3(b) we plot the average number of comparisons needed to find the nearest neighbor of a query point in this metric space as a function of n𝑛n for exhaustive and metric-tree search.This average is computed across 1000 queries.As expected, exhaustive search complexity grows linearly with n𝑛n whereas vp-tree’s complexity grows logarithmically.Notice that there is a marked difference in the number of measurements required, e.g., for n=106𝑛superscript106n=10^{6} the metric tree search can be performed with an expected cost of 500 measurements.
56
+
57
+ Motivated by the computational gain depicted in Fig. 3(b), a possible way to search a non-metric network G𝐺G is to first project it onto a metric space M𝑀M via the canonical projection M=𝒫∗​(G)𝑀superscript𝒫𝐺M={\mathcal{P}}^{*}(G) and then construct a vp-tree on M𝑀M.This construction guarantees an efficient search of the NN in M𝑀M of a given query.However, we are interested in finding the NN in G𝐺G, thus, potentially committing an error.Intuitively, the furthest away the structure of G𝐺G is from being metric, the larger the error in the NN found.Notice that we do not consider the complexity of implementing the projection 𝒫∗superscript𝒫{\mathcal{P}}^{*} into the computational cost of the search since this can be done once and offline, and then reused for fast online NN queries.
58
+
59
+ In order to illustrate the search performance, we generate metric spaces obtained by randomly embedding 1000 points in ℝ100superscriptℝ100{\mathbb{R}}^{100} and considering their Euclidean distances as dissimilarities between them.We then obtain (non-metric) perturbed versions of each metric space by multiplying a subset of the dissimilarities by 1+δ1𝛿1+\delta where δ𝛿\delta is a random variable uniformly distributed in [0,10]010[0,10].The subset of dissimilarities to modify is chosen randomly with probability of perturbation r𝑟r.In Fig. 3(c) we illustrate the search performance over 1000 queries as a function of r𝑟r (blue curves).The dashed line illustrates the percentage of perfect recovery (left y-axis), i.e., the proportion of the 1000 queries in which the node found coincides with the actual NN of the query point.The solid and the pointed lines represent, respectively, the mean and median relative positions of the actual node found (right y-axis). E.g., a value in 0%–1% indicates that the node found is actually contained among the 10 nearest nodes (1% of 1000) to the query.Finally, to illustrate the value of the projection method proposed, we also illustrate the search performance when the vp-tree is constructed directly on G𝐺G (red curves), i.e., when we apply the aforementioned construction scheme and navigation rules [cf. (6)] to G𝐺G even though it is non-metric.First of all, notice that when r=0𝑟0r=0, both schemes work perfectly since G=M𝐺𝑀G=M corresponds to a metric space.For other values of r𝑟r, the vp-tree constructed on M𝑀M (blue curves) consistently outperforms the one constructed on G𝐺G (red curves). E.g., for r=0.6𝑟0.6r=0.6 the median and mean relative positions of the nodes found on M𝑀M are in the top 0.5% and 0.8%, respectively, which contrast with the ones found on G𝐺G which are in the top 1.7% and 3.2%, respectively.Finally, notice that for large values of r𝑟r (when most of the edges in G𝐺G are perturbed), the structure becomes more similar to a metric space and, thus, there is an improvement in the search performance on both G𝐺G and M𝑀M.
60
+
61
+ We analyzed how to project networks onto finite metric spaces.We defined the Axioms of Projection and Transformation as desirable properties of projections and showed that there is a unique canonical way of projecting any network onto the set of finite metric spaces.In particular, this axiomatic framework provided theoretical support for the computation of shortest path distances between nodes of networked datasets.Moreover, we showed that metric projections can be used in practice to approximate combinatorial optimization problems in graphs and to efficiently search a network for the nearest neighbor of a given query point.Future directions include the study of projections onto generalizations of metric spaces including their directed counterparts [33].
1911.00176v1.txt ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Neural approaches to sequence generation have seen a variety of applications such as language modeling [1], machine translation [2, 3], music generation [4] and image captioning [5].All these tasks involve modeling a probability distribution over sequences of some kind of tokens.
2
+
3
+ Usually, sequences are generated in the left-to-right manner, by iteratively adding tokens to the end of an unfinished sequence. Although this approach is widely used due to its simplicity, such decoding restricts the generation process. Generating sequences in the left-to-right manner reduces output diversity [6] and could be unsuited for the target sequence structure [7]. To alleviate this issue, previous studies suggested exploiting prior knowledge about the task (e.g. the semantic roles of words in a natural language sentence or the concept of language branching) to select the preferable generation order [6, 7, 8].However, these approaches are still limited by predefined generation order, which is the same for all input instances.
4
+
5
+ In this work, we propose INTRUS: INsertion TRansformer for Unconstrained order Sequence modeling.Our model has no predefined order constraint and generates sequences by iteratively adding tokens to a subsequence in any order, not necessarily in the order they appear in the final sequence. It learns to find convenient generation order as a by-product of its training procedure without any reliance on prior knowledge about the task it is solving.
6
+
7
+ Our key contributions are as follows:•We propose a neural sequence model that can generate the output sequence by inserting tokens in any arbitrary order;•The proposed model outperforms fixed-order baselines on several tasks, including Machine Translation, Image-to-LaTeX and Image Captioning;•We analyze learned generation orders and find that the modelhas a preference towards producing “easy” words at the beginning and leaving more complicated choices for later.
8
+
9
+ We consider the task of generating a sequence Y𝑌Y consisting of tokens ytsubscript𝑦𝑡y_{t} given some input X𝑋X.In order to remove the predefined generation order constraint, we need to reformulate the probability of target sequence in terms of token insertions. Unlike traditional models, there are multiple valid insertions at each step. This formulation is closely related to the existing framework of generating unordered sets, which we briefly describe in Section 2.1. In Section 2.2, we introduce our approach.
10
+
11
+ In the context of unordered set generation,Vinyals et al. [9]proposed a method to learn sequence order from data jointly with the model. The resulting model samples a permutation π​(t)𝜋𝑡\pi(t) of the target sequence and then scores the permuted sequence with a neural probabilistic model:P(Yπ|x,θ)=∏tp(yπ​(t)|X,yπ​(0),..,yπ​(t−1),θ).P(Y_{\pi}|x,\theta)=\prod_{t}p(y_{\pi(t)}|X,y_{\pi(0)},..,y_{\pi(t-1)},\theta).(1)The training is performed by maximizing the data log-likelihood over both model parameters θ𝜃\theta and target permutation π​(t)𝜋𝑡\pi(t):θ∗=arg⁡max𝜃​∑X,Ymaxπ⁡log⁡P​(Yπ|x,θ).superscript𝜃𝜃subscript𝑋𝑌subscript𝜋𝑃conditionalsubscript𝑌𝜋𝑥𝜃\theta^{*}=\underset{\theta}{\arg\max}\sum_{X,Y}\max_{\pi}\log P(Y_{\pi}|x,\theta).(2)Exact maximization over π​(t)𝜋𝑡\pi(t) requires O​(|Y|!)𝑂𝑌O(|Y|!) operations, therefore it is infeasible in practice. Instead, the authors propose using greedy or beam search. The resulting procedure resembles the Expectation Maximization algorithm:1.E step: find optimal π​(t)𝜋𝑡\pi(t) for Y𝑌Y under current θ𝜃\theta with inexact search,2.M step: update parameters θ𝜃\theta with gradient descent under π​(t)𝜋𝑡\pi(t) found on the E step.EM algorithms are known to easily get stuck in local optima. To mitigate this issue, the authors sample permutations proportionally to p(yπ​(t)|x,yπ​(0),..,yπ​(t−1),θ)p(y_{\pi(t)}|x,y_{\pi(0)},..,y_{\pi(t-1)},\theta) instead of maximizing over π𝜋\pi.
12
+
13
+ The task now is to build a probabilistic model over sequences τ=(τ0,τ1,…,τT)𝜏subscript𝜏0subscript𝜏1…subscript𝜏𝑇\tau=(\tau_{0},\tau_{1},...,\tau_{T}) of insertion operations.This can be viewed as an extension of the approach described in the previous section, which operates on ordered sequences instead of unordered sets. At step t𝑡t, the model generates either a pair τt=(p​o​st,t​o​k​e​nt)subscript𝜏𝑡𝑝𝑜subscript𝑠𝑡𝑡𝑜𝑘𝑒subscript𝑛𝑡\tau_{t}=(pos_{t},token_{t}) consisting of a position p​o​st𝑝𝑜subscript𝑠𝑡pos_{t} in the produced so far sub-sequence (p​o​st∈[0,t]𝑝𝑜subscript𝑠𝑡0𝑡pos_{t}~{}\in~{}[0,~{}t]) and a token t​o​k​e​nt𝑡𝑜𝑘𝑒subscript𝑛𝑡token_{t} to be inserted at this position, or a special EOS element indicating that the generation process is terminated.It estimates the conditional probability of a new insertion τtsubscript𝜏𝑡\tau_{t} given X𝑋X and a partial output Y~​(��0:t−1)~𝑌subscript𝜏:0𝑡1\tilde{Y}(\tau_{0:t-1}) constructed from the previous inserts:p​(τ|X,θ)=∏tp​(τt|X,Y~​(τ0:t−1),θ).𝑝conditional𝜏𝑋𝜃subscriptproduct𝑡𝑝conditionalsubscript𝜏𝑡𝑋~𝑌subscript𝜏:0𝑡1𝜃p(\tau|X,\theta)=\prod_{t}p(\tau_{t}|X,\tilde{Y}(\tau_{0:t-1}),\theta).(3)
14
+
15
+ We train the model by maximizing the log-likelihood of the reference sequence Y𝑌Y given the source X𝑋X, summed over the data set D𝐷D:
16
+
17
+ L=∑{X,Y}∈Dlog⁡p​(Y|X,θ)=∑{X,Y}∈Dlog​∑τ∈T∗​(Y)p​(τ|X,θ)==∑{X,Y}∈Dlog​∑τ∈T∗​(Y)∏tp​(τt|X,Y~​(τ0:t−1),θ),𝐿subscript𝑋𝑌𝐷𝑝conditional𝑌𝑋𝜃subscript𝑋𝑌𝐷subscript𝜏superscript𝑇𝑌𝑝conditional𝜏𝑋𝜃subscript𝑋𝑌𝐷subscript𝜏superscript𝑇𝑌subscriptproduct𝑡𝑝conditionalsubscript𝜏𝑡𝑋~𝑌subscript𝜏:0𝑡1𝜃\begin{gathered}L=\sum_{\{X,Y\}\in D}\log p(Y|X,\theta)=\sum_{\{X,Y\}\in D}\log\sum_{\tau\in T^{*}(Y)}p(\tau|X,\theta)=\\=\sum_{\{X,Y\}\in D}\log\sum_{\tau\in T^{*}(Y)}\prod_{t}p(\tau_{t}|X,\tilde{Y}(\tau_{0:t-1}),\theta),\end{gathered}(4)where T∗​(Y)superscript𝑇𝑌T^{*}(Y) denotes the set of all trajectories leading to Y𝑌Y (see Figure 2).
18
+
19
+ Intuitively, wemaximize the total probability “flowing” through the acyclic graph defined by T∗​(Y)superscript𝑇𝑌T^{*}(Y). This graph has approximately O​(|Y|!)𝑂𝑌O(|Y|!) paths from an empty sequence to the target sequence Y𝑌Y. Therefore, directly maximizing (4) is impractical. Our solution, inspired by [9], is to assume that for any input X𝑋X there is a trajectory τ∗superscript𝜏\tau^{*} that is the most convenient for the model. We want the model to concentrate the probability mass on this single trajectory. This can be formulated as a lower bound of the objective (4):L=∑{X,Y}∈Dlog⁡p​(Y|X,θ)=∑{X,Y}∈Dlog​∑τ∈T∗​(Y)∏tp​(τt|X,Y~​(τ0:t−1),θ)≥≥∑{X,Y}∈Dlog⁡maxτ​∏tp​(τt|X,Y~​(τ0:t−1),θ)=∑{X,Y}∈Dmaxτ​∑tlog⁡p​(τt|X,Y~​(τ0:t−1),θ).𝐿subscript𝑋𝑌𝐷𝑝conditional𝑌𝑋𝜃subscript𝑋𝑌𝐷subscript𝜏superscript𝑇𝑌subscriptproduct𝑡𝑝conditionalsubscript𝜏𝑡𝑋~𝑌subscript𝜏:0𝑡1𝜃subscript𝑋𝑌𝐷subscript𝜏subscriptproduct𝑡𝑝conditionalsubscript𝜏𝑡𝑋~𝑌subscript𝜏:0𝑡1𝜃subscript𝑋𝑌𝐷subscript𝜏subscript𝑡𝑝conditionalsubscript𝜏𝑡𝑋~𝑌subscript𝜏:0𝑡1𝜃\begin{gathered}L=\sum_{\{X,Y\}\in D}\log p(Y|X,\theta)=\sum_{\{X,Y\}\in D}\log\sum_{\tau\in T^{*}(Y)}\prod_{t}p(\tau_{t}|X,\tilde{Y}(\tau_{0:t-1}),\theta)\geq\\\geq\sum_{\{X,Y\}\in D}\log\max_{\tau}\prod_{t}p(\tau_{t}|X,\tilde{Y}(\tau_{0:t-1}),\theta)=\!\!\sum_{\{X,Y\}\in D}\max_{\tau}\sum_{t}\log p(\tau_{t}|X,\tilde{Y}(\tau_{0:t-1}),\theta).\end{gathered}(5)The lower bound is tight iff the entire probability mass in T∗superscript𝑇T^{*} is concentrated along a single trajectory. This leads to a convenient property: maximizing (5) forces the model to choose a certain “optimal” sequence of insertions τ∗=arg⁡maxτ​∏tp​(τt|X,Y~​(τ0:t−1),θ)superscript𝜏subscript𝜏subscriptproduct𝑡𝑝conditionalsubscript𝜏𝑡𝑋~𝑌subscript𝜏:0𝑡1𝜃\tau^{*}=\arg\max\limits_{\tau}\prod\limits_{t}p(\tau_{t}|X,\tilde{Y}(\tau_{0:t-1}),\theta) and concentrate most of the probability mass there.
20
+
21
+ The bound (5) depends only on the most probable trajectory τ∗superscript𝜏\tau^{*}, thus is difficult to optimize directly. This may result in convergence to a local maximum. Similar to [9], we replace max\max with an expectation w.r.t. trajectories sampled from T∗superscript𝑇T^{*}. We sample from the probability distribution over the trajectories obtained from the model.The new lower bound is:∑{X,Y}∈DEτ∼p​(τ|X,τ∈T∗​(Y),θ)​∑tlog⁡p​(τt|X,Y~​(τ0:t−1),θ).subscript𝑋𝑌𝐷subscript𝐸similar-to𝜏𝑝conditional𝜏𝑋𝜏superscript𝑇𝑌𝜃subscript𝑡𝑝conditionalsubscript𝜏𝑡𝑋~𝑌subscript𝜏:0𝑡1𝜃\begin{split}\sum_{\{X,Y\}\in D}E_{\tau\sim p(\tau|X,\tau\in T^{*}(Y),\theta)}\sum_{t}\log p(\tau_{t}|X,\tilde{Y}(\tau_{0:t-1}),\theta).\end{split}(6)The sampled lower bound in (6) is less or equal to (5). However, if the entire probability mass is concentrated on a single trajectory, both lower bounds are tight. Thus, when maximizing (6), we also expect most of the probability mass to be concentrated on one or a few “best” trajectories.
22
+
23
+ We train our model using stochastic gradient ascent of (6). For each pair {X,Y}𝑋𝑌\{X,Y\} from the current mini-batch, we sample the trajectory τ𝜏\tau from the model: τ∼p​(τ|X,τ∈T∗​(Y),θ)similar-to𝜏𝑝conditional𝜏𝑋𝜏superscript𝑇𝑌𝜃\tau~{}\sim~{}p(\tau|~{}X,~{}\tau\in T^{*}(Y),~{}\theta). We constrain sampling only to correct trajectories by allowing only the correct insertion operations (i.e. the ones that lead to producing Y𝑌Y). At each step along the sampled trajectory τ𝜏\tau, we maximize log⁡p​(r​e​f​(Y,τ0:t−1)|X,Y~​(τ0:t−1),θ)𝑝conditional𝑟𝑒𝑓𝑌subscript𝜏:0𝑡1𝑋~𝑌subscript𝜏:0𝑡1𝜃\log p(ref(Y,\tau_{0:{t-1}})|X,\tilde{Y}(\tau_{0:t-1}),\theta), where r​e​f​(Y,τ0:t−1)𝑟𝑒𝑓𝑌subscript𝜏:0𝑡1ref(Y,\tau_{0:{t-1}}) defines a set of all insertions τtsubscript𝜏𝑡\tau_{t} immediately after τ0:t−1subscript𝜏:0𝑡1\tau_{0:t-1}, such that the trajectory τ0:t−1subscript𝜏:0𝑡1\tau_{0:t-1} extended with τtsubscript𝜏𝑡\tau_{t} is correct: τ0:t−1⊕τt∈T∗​(Y)direct-sumsubscript𝜏:0𝑡1subscript𝜏𝑡superscript𝑇𝑌\tau_{0:t-1}\oplus\tau_{t}\in T^{*}(Y). From a formal standpoint, this is a probability of picking any insertion that is on the path to Y𝑌Y. The simplified training procedure is given in Algorithm 2.2.
24
+
25
+ The training procedure is split into two steps: (i) pretraining with uniform samples from the set of feasible trajectories T∗​(Y)superscript𝑇𝑌T^{*}(Y), and (ii) training on samples from our model’s probability distribution over T∗​(Y)superscript𝑇𝑌T^{*}(Y) till convergence. We discuss the importance of the pretraining step in Section 5.2.
26
+
27
+ To find the most likely output sequence according to our model, we have to compute the probability distribution over target sequences as follows:p​(Y|X,θ)=∑τ∈T∗​(Y)p​(τ|x,θ).𝑝conditional𝑌𝑋𝜃subscript𝜏superscript𝑇𝑌𝑝conditional𝜏𝑥𝜃\begin{gathered}p(Y|X,\theta)=\sum_{\tau\in T^{*}(Y)}p(\tau|x,\theta).\end{gathered}(7)Computing such probability exactly requires summation over up to O​(|Y|!)𝑂𝑌O(|Y|!) trajectories, which is infeasible in practice. However, due to the nature of our optimization algorithm (explicitly maximizing the lower bound Eτ∼p​(τ|X,τ∈T∗​(Y),θ)​p​(τ|x,θ)≤maxτ∈T∗​(Y)⁡p​(τ|x,θ)≤P​(Y|X)subscript𝐸similar-to𝜏𝑝conditional𝜏𝑋𝜏superscript𝑇𝑌𝜃𝑝conditional𝜏𝑥𝜃subscript𝜏superscript𝑇𝑌𝑝conditional𝜏𝑥𝜃𝑃conditional𝑌𝑋E_{\tau\sim p(\tau|X,\tau\in T^{*}(Y),\theta)}p(\tau|x,\theta)\leq\max_{\tau\in T^{*}(Y)}p(\tau|x,\theta)\leq P(Y|X)), we expect most of the probability mass to be concentrated on one or a few “best” trajectories:P​(Y|X)≈maxτ∈T∗​(Y)⁡p​(τ|x,θ).𝑃conditional𝑌𝑋subscript𝜏superscript𝑇𝑌𝑝conditional𝜏𝑥𝜃P(Y|X)\approx\max_{\tau\in T^{*}(Y)}p(\tau|x,\theta).(8)Hence, we perform approximate inference by finding the most likely trajectory of insertions, disregarding the fact that several trajectories may lead to the same Y𝑌Y.222To justify this transition, we translated 104superscript10410^{4} sentences with a fully trained model using beam size 128 and found only 4 occasions where multiple insertion trajectories in the beam led to the same output sequence.The resulting inference problem is defined as:Y∗=arg⁡maxY​(τ)​log⁡p​(τ|X,θ).superscript𝑌𝑌𝜏𝑝conditional𝜏𝑋𝜃Y^{*}=\underset{Y(\tau)}{\arg\max}\log p(\tau|X,\theta).(9)
28
+
29
+ This problem is combinatoric in nature, but it can be solved approximately using beam search. In the case of our model, beam search compares partial output sequences and extends them by selecting the k𝑘k best token insertions. Our model also inherits a common problem of the left-to-right machine translation: it tends to stop too early and produce output sequences that are shorter than the reference. To alleviate this effect, we divide hypotheses’ log-probabilities by their length. This has already been used in previous works [10, 11, 12].
30
+
31
+ INTRUS follows the encoder-decoder framework. Specifically,the model is based on the Transformer [10] architecture (Figure 3) due to its state-of-the-art performance on a wide range of tasks [13, 14, 15].There are two key differences of INTRUS from the left-to-right sequence models.Firstly, our model’s decoder does not require the attention mask preventing attention to subsequent positions. Decoder self-attention is re-applied at each decoding step because the positional encodings of most tokens change when inserting a new one into an incomplete subsequence of Y𝑌Y.333Though this makes training more computationally expensive than the standard Transformer, this does not hurt decoding speed much: on average decoding is only 50%percent\% times slower than the baseline. We will discuss this in detail in Section 5.2. Secondly, the decoder predicts the joint probability of a token and a position corresponding to a single insertion (rather than the probability of a token, as usually done in the standard setting). Consequently, the predicted probabilities should add up to 1 over all positions and tokens at each step. We achieve this by decomposing the insertion probability into the probabilities of a token and a position:
32
+
33
+ p​(τt)=p​(t​o​k​e​n|p​o​s)⋅p​(p​o​s),p​(p​o​s)=s​o​f​t​m​a​x​(H×wl​o​c),p​(t​o​k​e​n|p​o​s)=s​o​f​t​m​a​x​(hp​o​s×Wt​o��k).formulae-sequence𝑝subscript𝜏𝑡⋅𝑝conditional𝑡𝑜𝑘𝑒𝑛𝑝𝑜𝑠𝑝𝑝𝑜𝑠formulae-sequence𝑝𝑝𝑜𝑠𝑠𝑜𝑓𝑡𝑚𝑎𝑥𝐻subscript𝑤𝑙𝑜𝑐𝑝conditional𝑡𝑜𝑘𝑒𝑛𝑝𝑜𝑠𝑠𝑜𝑓𝑡𝑚𝑎𝑥subscriptℎ𝑝𝑜𝑠subscript𝑊𝑡𝑜𝑘\begin{gathered}p(\tau_{t})=p(token|pos)\cdot p(pos),\\p(pos)=softmax(H\times w_{loc}),\\p(token|pos)=softmax(h_{pos}\times W_{tok}).\end{gathered}(10)
34
+
35
+ Here hp​o​s∈ℝdsubscriptℎ𝑝𝑜𝑠superscriptℝ𝑑h_{pos}\in\mathbb{R}^{d} denotes a single decoder hidden state (of size d𝑑d) corresponding to an insertion at position p​o​s𝑝𝑜𝑠pos; H∈ℝt×d𝐻superscriptℝ𝑡𝑑H\in\mathbb{R}^{t\times d} represents a matrix of all such states. Wt​o​k∈ℝd×vsubscript𝑊𝑡𝑜𝑘superscriptℝ𝑑𝑣W_{tok}\in\mathbb{R}^{d\times v} is a learned weight matrix that predicts token probabilities and wl​o​c∈ℝdsubscript𝑤𝑙𝑜𝑐superscriptℝ𝑑w_{loc}\in\mathbb{R}^{d} is a learned vector of weights used to predict positions. In other words, the hidden state of each token in the current sub-sequence defines (i) the probability that the next token will be generated at the position immediately preceding current and (ii) the probability for each particular token to be generated next.
36
+
37
+ The encoder component of the model can have any task-specific network architecture. For Machine Translation task, it can be an arbitrary sequence encoder: any combination of RNN [3, 2], CNN [12, 16] or self-attention [10, 17]. For image-to-sequence problems (e.g. Image-To-LaTeX [18]) any 2d convolutional encoder architecture from the domain of computer vision can be used [19, 20, 21].
38
+
39
+ The closest to our is the work byGu et al. [22]444At the time of submission, this was a concurrent work., who propose a decoding algorithm which supports flexible sequence generation in arbitrary orders through insertion operations.
40
+
41
+ In terms of modeling, they describe a similar transformer-based model but use a relative-position-based representation to capture generation orders. This effectively addresses the problem that absolute positional encodings are unknown before generating the whole sequence. While in our model positional encodings of most of the tokens change after each insertion operation and, therefore, decoder self-attention is re-applied at each generation step, the model by Gu et al. [22] does not need this and has better theoretical time complexity of O​(l​e​n​(Y)2)𝑂𝑙𝑒𝑛superscript𝑌2O(len(Y)^{2}) in contrast to our O​(l​e​n​(Y)3)𝑂𝑙𝑒𝑛superscript𝑌3O(len(Y)^{3}). However, in practice our decoding is on average only 50%percent\% times slower than the baseline; for the details, see Section 5.2.
42
+
43
+ In terms of training objective, they use lower bound (5) with beam search over T∗​(Y)superscript𝑇𝑌T^{*}(Y), which is different from our lower bound (6). However, we found our lower bound to be beneficial in terms of quality and less prone to getting stuck in local optima. We will discuss this in detail in Section 5.1.
44
+
45
+ We consider three sequence generation tasks: Machine Translation, Image-To-Latex and Image Captioning. For each, we now define input X𝑋X and output Y𝑌Y, the datasets and the task-specific encoder we use. Decoders for all tasks are Transformers in base configuration [10] (either original or INTRUS) with identical hyperparameters.
46
+
47
+ For MT, input and output are sentences in different languages. The encoder is the Transformer-base encoder [10].
48
+
49
+ Wu et al. [7] suggest that left-to-right NMT models fit better for right-branching languages (e.g., English) and right-to-left NMT models fit better for left-branching languages (e.g., Japanese). This defines the choice of language pairs for our experiments. Our experiments include: En-Ru and Ru-En WMT14; En-Ja ASPEC [23]; En-Ar, En-De and De-En IWSLT14 Machine Translation data sets. We evaluate our models on WMT2017 test set for En-Ru and Ru-En, ASPEC test set for En-Ja, concatenated IWSLT tst2010, tst2011 and tst2012 for En-De and De-En, and concatenated IWSLT tst2014 and tst2013 for En-Ar.
50
+
51
+ Sentences of all translation directions except the Japanese part of En-Ja data set are preprocessed with the Moses tokenizer [24] and segmented into subword units using BPE [25] with 32,000 merge operations. Before BPE segmentation Japanese sentences were firstly segmented into words555Open-source word segmentation software is available at https://github.com/atilika/kuromoji.
52
+
53
+ In this task, X𝑋X is a rendered image of LaTeX markup, Y𝑌Y is the markup itself. We use the ImageToLatex-140K [18, 26] data set. We used the encoder CNN architecture, preprocessing pipeline and evaluation scripts by Singh [26]666We used https://github.com/untrix/im2latex.
54
+
55
+ Here X𝑋X is an image, Y𝑌Y is its description in natural language.We use MSCOCO [27], the standard Image Captioning dataset. Encoder is VGG16 [19] pretrained777We use pretrained weights from keras applications https://keras.io/applications/, the same for both baseline and our model. on the ImageNet task without the last layer.
56
+
57
+ We use BLEU888BLEU is computed via SacreBLEU [28] script with the following parameters: BLEU+c.lc+l.[src-lang]-[dst-lang]+#.1+s.exp+tok.13a+v.1.2.18 [29] for evaluation of Machine Translation and Image-to-Latex models. For En-Ja, we measure character-level BLEU to avoid infuence on word segmentation software. The scores on MSCOCO dataset are obtained via the official evaluation script999Script is available at https://github.com/tylin/coco-caption.
58
+
59
+ The models are trained until convergencewith base learning rate 1.4e-3, 16,000 warm-up steps and batch size of 4,000 tokens. We vary the learning rate over the course of training according to [10] and follow their optimization technique.We use beam search with the beam between 4 and 64 selected using the validation data for both baseline and INTRUS, although our model benefits more when using even bigger beam sizes. The pretraining phase of INTRUS is 105superscript10510^{5} batches.
60
+
61
+ Among all tasks, the largest improvements are for Image Captioning: 7.6 BLEU and 25.1 CIDER.
62
+
63
+ For Machine Translation, INTRUS substantially outperforms the baselines for most considered language pairs and matches the baseline for the rest. As expected, the right-to-left generation order is better than the left-to-right for translation into Japanese. However, our model significantly outperforms both baselines. For the tasks where left-to-right decoding order provides a strong inductive bias (e.g. in De-En translation task, where source and target sentences can usually be aligned without any permutations), generation in arbitrary order does not give significant improvements.
64
+
65
+ Image-To-Latex improves by 0.8 BLEU, which is reasonable difference considering the high performance of the baseline.
66
+
67
+ In this section, we show the superior performance of the proposed lower bound of the data log-likelihood (6) over the natural choice of (5). We also emphasize the importance of the pretraining phase for INTRUS. Specifically, we compare performance of the following models:•Default — using the training procedure described in Section 2.2;•Argmax — trained with the lower bound (5) (maximum is approximated with using beam search with the beam of 4; this technique matches the one used in Gu et al. [22]);•Left-to-right pretraining — pretrained with the fixed left-to-right decoding order (in contrast to the uniform samples in the default setting);•No pretraining — with no pretraining phase;•Only pretraining — training is performed with a model-independent order, either uniform or left-to-right.
68
+
69
+ Table 2 confirms the importance of the chosen pretraining strategy for the performance of the model. In preliminary experiments, we also observed that introducing any of the two pretraining strategies increases the overall robustness of our training procedure and helps to avoid convergence to poor local optima. We attribute this to the fact that a pretrained model provides the main algorithm with a good initial exploration of the trajectory space T∗superscript𝑇T^{*}, while the Argmax training strategy tends to quickly converge to the current best trajectory which may not be globally optimal. This leads to poor performance and unstable results. This is the only strategy that required several consecutive runs to obtain reasonable quality, despite the fact that it starts from a good pretrained model.
70
+
71
+ Despite its superior performance, INTRUS is more computationally expensive compared to the baseline. The main computational bottleneck in the model training is the generation of insertions required to evaluate the training objective (6). This generation procedure is inherently sequential. Thus, it is challenging to effectively parallelize it on GPU accelerators. In our experiments, training time of INTRUS is 3-4 times longer than that of the baseline. The theoretical computational complexity of the model’s inference is O​(|Y|3​k)𝑂superscript𝑌3𝑘O(|Y|^{3}k) compared to O​(|Y|2​k)𝑂superscript𝑌2𝑘O(|Y|^{2}k) of conventional left-to-right models. However, in practice this is likely not to cause drastic decrease of the decoding speed. Figure 4 shows the decoding speed of both INTRUS and the baseline measured for machine translation task. On average, INTRUS is only 50%percent5050\% slower because for sentences of a reasonable length it performs comparably to the baseline.
72
+
73
+ In this section, we analyze generation orders learned by INTRUS on the Ru-En translation task.
74
+
75
+ We noticed that the model often follows a general decoding direction that varies from sentence to sentence: left-to-right, right-to-left, middle-out, etc. (Figure 5 shows several examples101010More examples and the analysis for Image Captioning are provided in the supplementary material.).When following the chosen direction, the model deviates from it for translation of certain phrases. For instance, the model tends to decode pairs of quotes and brackets together. Also we noticed thattokens which are generated first are often uninformative (e.g., punctuation, determiners, etc.). This suggests that the model has preference towards generating “easy” words first.
76
+
77
+ We want to find out if the model has any preference towards generating different parts of speech in the beginning or at the end of the decoding process. For each part of speech,111111To derive part of speech tags, we used CoreNLP tagger [31]. we compute the relative index on the generation trajectory (for the baseline, it corresponds to its relative position in a sentence). Figure 6 shows that INTRUS tends to generate punctuation tokens and conjunctions early in decoding.Other parts of speech like nouns, adjectives, prepositions and adverbs are the next easiest to predict. Most often they are produced in the middle of the generation process, when some context is already established. Finally, the most difficult for the model is to insert verbs and particles.
78
+
79
+ These observations are consistent with the easy-first generation hypothesis: the early decoding steps mostly produce words which are the easiest to predict based on the input data.This is especially interesting in the context of previous work. Ford et al. [8] study the influence of token generation order on a language model quality. They developed a family of two-pass language models that depend on a partitioning of the vocabulary into a set of first-pass and second-pass tokens to generate sentences. The authors find that the most effective strategy is to generate function words in the first pass and content words in the second. While Ford et al. [8] consider three manually defined strategies, our model learned to give preference to such behavior despite not having any inductive bias to do so.
80
+
81
+ In Machine Translation, decoding in the right-to-left order improves performance for English-to-Japanese [32, 7].The difference in translation qualityis attributed to two main factors: Error Propagation [33] and the concept of language branching [7, 34]. In some languages (e.g. English), sentences normally start with subject/verb on the left and add more information in the rightward direction. Other languages (e.g. Japanese) have the opposite pattern.
82
+
83
+ Several works suggest to first generate the most “important” token, and then the rest of the sequence using forward and backward decoders. The two decoders start generation process from this first “important” token, which is predicted using classifiers. This approach was shown beneficial for video captioning [6] and conversational systems [35]. Other approaches to non-standard decoding include multi-pass generation models [36, 8, 37, 38] and non-autoregressive decoding [39, 38].
84
+
85
+ Several recent works proposed sequence models with arbitrary generation order. Gu et al. [22] propose a similar approach using another lower bound of the log-likelihood which, as we showed in Section 5.1, underperforms ours. They, however, achieve O​(|Y|2)𝑂superscript𝑌2O(|Y|^{2}) time complexity by utilizing a different probability parameterization along with relative position encoding. Welleck et al. [40] investigates the possibility of decoding output sequences by descending a binary insertion tree. Stern et al. [41] focuses on parallel decoding using one of several pre-specified generation orders.
86
+
87
+ In this work, we introduce INTRUS, a model which is able to generate sequences in any arbitrary order via iterative insertion operations. We demonstrate that our model learns convenient generation order as a by-product of its training procedure.The model outperforms left-to-right and right-to-left baselines on several tasks.We analyze learned generation orders and show that the model has a preference towards producing “easy” words at the beginning and leaving more complicated choices for later.
1911.00212v1.txt ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Video captioning has drawn much attention from natural language processing and computer vision researchers Venugopalan et al. (2014); Bin et al. (2016); Ramanishka et al. (2016); Zanfir et al. (2016). As videos typically consist of multiple modalities (image, motion, audio, etc.), video captioning is actually a multimodal learning task. The abundant information underlying in the modalities is much beneficial for video captioning models. However, how to effectively learn the association relationships between different modalities is still a challenging problem.
2
+
3
+ In the context of deep learning based video captioning, multimodal attention mechanisms Xu et al. (2017); Hori et al. (2017); Wang et al. (2018c) are shown to help deliver superior performance. Bahdanau Attention Bahdanau et al. (2014) is widely used to calculate the attention weights according to the features of individual modalities, since Bahdanau Attention is originally proposed for machine translation which can be considered as a unimodal task. However, video captioning is a multimodal task and different modalities are able to provide complementary cues to each other when calculating the attention weights. For example, as shown in Fig. 1, a part of the video shows that two men are wrestling and another part shows that the referee coaches the match. With only the image modality, the model may pay equal attention to the frames with the competitors and referee. Considering the additional motion modality, the attention mechanism weighs more on one of them, resulting in a model with more focused attention.
4
+
5
+ Motivated by the above observations, in this paper we propose an attention mechanism called High-Order Cross-Modal Attention (HOCA) for video captioning, which makes a full use of the different modalities in video data by capturing their structure relationships. The key idea of HOCA is to consider the information of the other modalities when calculating the attention weights for one modality, different from Bahdanau Attention. In addition, we propose a low-rank version of HOCA which significantly reduces the computational complexity of HOCA. Specifically, the attention weights of HOCA are computed based on the similarity tensor between modalities, fully exploiting the correlation information of different modalities at each time step. Given the fact that the space requirement of the high-order tensor increases exponentially in the number of modalities and inspired by tensor decomposition, we adopt a low-rank correlation structure across modalities into HOCA to enable a good scalability to the increasing number of modalities. Such improvement largely reduces the algorithm complexity of HOCA with good results in empirical study.
6
+
7
+ Our contributions can be summarized as:
8
+
9
+ (1) We propose High-Order Cross-Modal Attention (HOCA), which is a novel multimodal attention mechanism for video captioning. Compared with the Bahdanau Attention, HOCA captures the frame-level interaction between different modalities when computing the attention weights, leading to an effective multimodal modeling.
10
+
11
+ (2) Considering the scalability to the increasing number of modalities, we propose Low-Rank HOCA, which employs tensor decomposition to enable an efficient implementation of High-Order Cross-Modal Attention.
12
+
13
+ (3) Experimental results show that our method outperforms the state-of-the-art methods on video captioning, demonstrating the effectiveness of our method. In addition, the theoretical and experimental complexity analyses show that Low-Rank HOCA can implement multimodal correlation effeciently with acceptable computing cost.
14
+
15
+ The encoder-decoder structures have been widely used in sequence transformation tasks. Some models also connect the encoder and decoder through an attention mechanismBahdanau et al. (2014); Luong et al. (2015). In natural language processing (NLP), Bahdanau et al. (2014) first proposes the soft attention mechanism to adaptively learn the context vector of the target keys/values. Such attention mechanisms are used in conjunction with a recurrent network. In the context of video captioning, there are many methods Hori et al. (2017); Xu et al. (2017) using Bahdanau Attention to learn the context vector of the temporal features of video data, including the recent state-of-the-art method, hierarchically aligned cross-modal attentive network (HACA) Wang et al. (2018c). Such method ignores the structure relationships between modalities when computing the attention weights.
16
+
17
+ Compared with image data, video data have rich multimodal information, such as image, motion, audio, semantic object, text. Therefore, the key is how to utilize the information. In the literature of video captioning, Xu et al. (2017); Hori et al. (2017) propose the hierarchical multimodal attention, which selectively attends to a certain modality when generating descriptions. Shen et al. (2017); Gan et al. (2017) adopt multi-label learning with weak supervision to extract semantic features of video data. Wang et al. (2018b) proposes optimizing the metrics directly with hierarchical reinforcement learning. Chen et al. (2017) extracts five types of features to develop the multimodal video captioning method and achieves promising results. Wang et al. (2018a) performs the reconstruction of input video features by utilizing the output of the decoder, increasing the consistency of descriptions and video features. Wang et al. (2018c) proposes the hierarchically aligned multimodal attention (HACA) to selectively fuse both global and local temporal dynamics of different modalities.
18
+
19
+ None of the methods mentioned above utilizes the interaction information of different modalities to calculate the attention weights. Motivated by this observation, we present HOCA and Low-Rank HOCA for video captioning. Different from the widely used Bahdanau Attention, our methods fully exploits the video representation of different modalities and their frame-level interaction information when computing the attention weights.
20
+
21
+ We introduce our methods in the following sections, where Section 3 introduces the details of Bahdanau Attention based multimodal video captioning (background), Section 4 gives the derivations of HOCA and Low-Rank HOCA, and the encoder-decoder structure which we propose for video captioning. Section 5 and 6 show the experimental settings and results of our methods.
22
+
23
+ Encoder-decoder structures combined with Bahdanau Attention are widely used in multimodal video captioning. Suppose that the number of input modalities is n𝑛n, Ilsubscript𝐼𝑙I_{l} denotes the features of l𝑙l-th modality, the space of Ilsubscript𝐼𝑙I_{l} is ℝdl×tlsuperscriptℝsubscript𝑑𝑙subscript𝑡𝑙\mathbb{R}^{d_{l}\times t_{l}} where tlsubscript𝑡𝑙t_{l} denotes the temporal length and dlsubscript𝑑𝑙d_{l} denotes the feature dimensions. The corresponding output is word sequence.
24
+
25
+ The input video is fed to multiple feature extractors, which can be pre-trained CNNs for classification tasks such as Inception-Resnet-v2Szegedy et al. (2017), I3DCarreira and Zisserman (2017), VGGishHershey et al. (2017), each extractor corresponds to one modality. The extracted features are sent to Bi-LSTM Hochreiter and Schmidhuber (1997) which has a capability to process sequence data, capturing the information from both forward and backward directions. The output of Bi-LSTM is kept.
26
+
27
+ The decoder aims to generate word sequence by utilizing the features provided by the encoder and the context information. At time step t𝑡t, the decoder output can be obtained with the input word ytsubscript𝑦𝑡y_{t} and the previous output ht−1subscriptℎ𝑡1h_{t-1},
28
+
29
+ ht=LSTM​(ht−1,yt)subscriptℎ𝑡LSTMsubscriptℎ𝑡1subscript𝑦𝑡h_{t}={\rm LSTM}(h_{t-1},y_{t})(1)
30
+
31
+ We treat htsubscriptℎ𝑡h_{t} as query q𝑞q, the features of different modalities are allocated weights with Bahdanau Attention seperately as shown in Fig. 2(a). The attention weights αtIl∈ℝtlsuperscriptsubscript𝛼𝑡subscript𝐼𝑙superscriptℝsubscript𝑡𝑙\alpha_{t}^{I_{l}}\in\mathbb{R}^{t_{l}} of l𝑙l-th modality can be obtained as follows:
32
+
33
+ (αtIl)rl=exp​{(etIl)rl}∑n=1tlexp​{(etIl)n}subscriptsuperscriptsubscript𝛼𝑡subscript𝐼𝑙subscript𝑟𝑙expsubscriptsuperscriptsubscript𝑒𝑡subscript𝐼𝑙subscript𝑟𝑙superscriptsubscript𝑛1subscript𝑡𝑙expsubscriptsuperscriptsubscript𝑒𝑡subscript𝐼𝑙𝑛(\alpha_{t}^{I_{l}})_{r_{l}}=\frac{{\rm exp}\Big{\{}(e_{t}^{I_{l}})_{r_{l}}\Big{\}}}{\sum_{n=1}^{t_{l}}{\rm exp}\Big{\{}(e_{t}^{I_{l}})_{n}\Big{\}}}(2)
34
+
35
+ (etIl)rl=w1𝕋​tanh​[W1​ht+U1​(Il)rl+b1]subscriptsuperscriptsubscript𝑒𝑡subscript𝐼𝑙subscript𝑟𝑙superscriptsubscript𝑤1𝕋tanhdelimited-[]subscript𝑊1subscriptℎ𝑡subscript𝑈1subscriptsubscript𝐼𝑙subscript𝑟𝑙subscript𝑏1(e_{t}^{I_{l}})_{r_{l}}=w_{1}^{\mathbb{T}}{\rm tanh}\Big{[}W_{1}h_{t}+U_{1}(I_{l})_{r_{l}}+b_{1}\Big{]}(3)
36
+
37
+ where (Il)rlsubscriptsubscript𝐼𝑙subscript𝑟𝑙(I_{l})_{r_{l}} denotes the rlsubscript𝑟𝑙r_{l}-th time step of Ilsubscript𝐼𝑙I_{l} and (αtIl)rlsubscriptsuperscriptsubscript𝛼𝑡subscript𝐼𝑙subscript𝑟𝑙(\alpha_{t}^{I_{l}})_{r_{l}} is the corresponding weight, we combine the attention weights and features, obtaining the context vector φt​(Il)subscript𝜑𝑡subscript𝐼𝑙\varphi_{t}(I_{l}) of l𝑙l-th modality,
38
+
39
+ ∑rl=1tl(αtIl)rl=1superscriptsubscriptsubscript𝑟𝑙1subscript𝑡𝑙subscriptsuperscriptsubscript𝛼𝑡subscript𝐼𝑙subscript𝑟𝑙1\sum_{{r_{l}}=1}^{t_{l}}(\alpha_{t}^{I_{l}})_{r_{l}}=1(4)
40
+
41
+ φt​(Il)=∑rl=1tl(αtIl)rl​(Il)rlsubscript𝜑𝑡subscript𝐼𝑙superscriptsubscriptsubscript𝑟𝑙1subscript𝑡𝑙subscriptsuperscriptsubscript𝛼𝑡subscript𝐼𝑙subscript𝑟𝑙subscriptsubscript𝐼𝑙subscript𝑟𝑙\varphi_{t}(I_{l})=\sum_{{r_{l}}=1}^{t_{l}}(\alpha_{t}^{I_{l}})_{r_{l}}(I_{l})_{r_{l}}(5)
42
+
43
+ the context vectors of other modalities can be obtained in the same way. We then integrate the context vectors to predict the word as follows:
44
+
45
+ pt=softmax���[Wph​ht+∑i=1nWpIi​φt​(Ii)+bp]subscript𝑝𝑡softmaxdelimited-[]superscriptsubscript𝑊𝑝ℎsubscriptℎ𝑡superscriptsubscript𝑖1𝑛superscriptsubscript𝑊𝑝subscript𝐼𝑖subscript𝜑𝑡subscript𝐼𝑖subscript𝑏𝑝p_{t}={\rm softmax}\Big{[}W_{p}^{h}h_{t}+\sum_{i=1}^{n}W_{p}^{I_{i}}\varphi_{t}(I_{i})+b_{p}\Big{]}(6)
46
+
47
+ where n𝑛n is the number of modalities, ptsubscript𝑝𝑡p_{t} denotes the probability distribution of words at time step t𝑡t.
48
+
49
+ Considering multimodal features, Bahdanau Attention and its variants process different modalities separately. In such situation, the interaction between different modalities is ignored. We propose HOCA and Low-Rank HOCA to excavate this information, in addition, the tensor decomposition used in Low-Rank HOCA reduces the complexity of the high-order correlation.
50
+
51
+ Different modalities in video data are able to provide complementary cues for each other and should be integrated effectively. Inspired by the correlation matrix which is widely used in the natural language understanding Seo et al. (2016), we use a high-order correlation tensor to model the interaction between different modalities. Fig. 2(b) shows the generalized form of the structure for n𝑛n modalities, the core module is “tensor multiplication” defined by ourselves. After the nonlinear mapping similar to Eqn. 3 with query htsubscriptℎ𝑡h_{t}, the features of the n𝑛n modalities are in a d𝑑d-dimensional common space. Note that, for convenience, we still use Ilsubscript𝐼𝑙I_{l} to represent the features of the l𝑙l-th modality (instead of Il,tsubscript𝐼𝑙𝑡I_{l,t}) and omit t𝑡t which denotes the time step of the decoder in the following derivations of Section 4.1 and 4.2.
52
+
53
+ Let αnIlsuperscriptsubscript𝛼𝑛subscript𝐼𝑙\alpha_{n}^{I_{l}} denote the target attention weights of modality Ilsubscript𝐼𝑙{I_{l}}. We obtain αnIlsuperscriptsubscript𝛼𝑛subscript𝐼𝑙\alpha_{n}^{I_{l}} through the high-order correlation tensor Cnsubscript𝐶𝑛C_{n} between the n𝑛n modalities. Cnsubscript𝐶𝑛C_{n} can be obtained as below:
54
+
55
+ (Cn)r1,…,rnsubscriptsubscript𝐶𝑛subscript𝑟1…subscript𝑟𝑛\displaystyle(C_{n})_{r_{1},...,r_{n}}=𝟏d​[(I1)r1∘(I2)r2∘…∘(In)rn]absentsubscript1𝑑delimited-[]subscriptsubscript𝐼1subscript𝑟1subscriptsubscript𝐼2subscript𝑟2…subscriptsubscript𝐼𝑛subscript𝑟𝑛\displaystyle={\bf 1}_{d}\Big{[}(I_{1})_{r_{1}}\circ(I_{2})_{r_{2}}\circ...\circ(I_{n})_{r_{n}}\Big{]}(7)=𝟏d[Λi=1n(Ii)ri]\displaystyle={\bf 1}_{d}\Big{[}\operatorname*{\raisebox{-3.5pt}{\scalebox{1.44}{$\Lambda$}}}_{i=1}^{n}(I_{i})_{r_{i}}\Big{]}
56
+
57
+ Cnsubscript𝐶𝑛\displaystyle C_{n}=⨂{I1,I2,…,In}=⨂i=1nIiabsenttensor-productsubscript𝐼1subscript𝐼2…subscript𝐼𝑛superscriptsubscripttensor-product𝑖1𝑛subscript𝐼𝑖\displaystyle=\bigotimes\Big{\{}I_{1},I_{2},...,I_{n}\Big{\}}=\bigotimes_{i=1}^{n}I_{i}(8)
58
+
59
+ where the (r1,…,rn)subscript𝑟1…subscript𝑟𝑛(r_{1},...,r_{n})-th entry of Cnsubscript𝐶𝑛C_{n} is the inner-product of the r1subscript𝑟1r_{1}-th column (time step) of I1subscript𝐼1I_{1}, r2subscript𝑟2r_{2}-th column (time step) of I2subscript𝐼2I_{2},…,rnsubscript𝑟𝑛r_{n}-th column (time step) of Insubscript𝐼𝑛I_{n}. ∘\circ denotes element-wise multiplication and ΛΛ\Lambda denotes the element-wise multiplication ∘\circ for a sequence of tensors. ⨂tensor-product\bigotimes is the tensor product operator and we use it to define a new operation ⨂{,…,}\bigotimes\{,...,\} for the “tensor multiplication” of multiple matrices. 𝟏dsubscript1𝑑{\bf 1}_{d} with space ℝdsuperscriptℝ𝑑\mathbb{R}^{d} consists of 111. We use the vectors 𝟏dsubscript1𝑑{\bf 1}_{d} and 𝟏tisubscript1subscript𝑡𝑖{\bf 1}_{t_{i}} to denote the summation operation along the d𝑑d and tisubscript𝑡𝑖t_{i} dimensions. In this situation, Eqn. 7 and Eqn. 8 are equivalent. The attention weights of Ilsubscript𝐼𝑙I_{l} can be calculated as below:
60
+
61
+ (αnIl)rl=exp​{∑[Wn−1Il∘(CnIl)rl]}∑o=1tlexp​{∑[Wn−1Il∘(CnIl)o]}subscriptsuperscriptsubscript𝛼𝑛subscript𝐼𝑙subscript𝑟𝑙expdelimited-[]superscriptsubscript𝑊𝑛1subscript𝐼𝑙subscriptsuperscriptsubscript𝐶𝑛subscript𝐼𝑙subscript𝑟𝑙superscriptsubscript𝑜1subscript𝑡𝑙expdelimited-[]superscriptsubscript𝑊𝑛1subscript𝐼𝑙subscriptsuperscriptsubscript𝐶𝑛subscript𝐼𝑙𝑜(\alpha_{n}^{I_{l}})_{r_{l}}=\frac{{\rm exp}\Big{\{}\sum\Big{[}W_{n-1}^{I_{l}}\circ(C_{n}^{I_{l}})_{r_{l}}\Big{]}\Big{\}}}{\sum_{o=1}^{t_{l}}{\rm exp}\Big{\{}\sum\Big{[}W_{n-1}^{I_{l}}\circ(C_{n}^{I_{l}})_{o}\Big{]}\Big{\}}}(9)
62
+
63
+ where (CnIl)rlsubscriptsuperscriptsubscript𝐶𝑛subscript𝐼𝑙subscript𝑟𝑙(C_{n}^{I_{l}})_{r_{l}} is equal to (Cn):,:,…,rl,…,:,:subscriptsubscript𝐶𝑛::…subscript𝑟𝑙…::(C_{n})_{:,:,...,r_{l},...,:,:}, which is an (n𝑛n-111)-order tensor and denotes the correlation values between the rlsubscript𝑟��r_{l}-th time step of Ilsubscript𝐼𝑙I_{l} and different time steps of the other n𝑛n-111 modalities. Wn−1Ilsuperscriptsubscript𝑊𝑛1subscript𝐼𝑙W_{n-1}^{I_{l}} is also an (n𝑛n-111)-order tensor, which has the same shape and denotes the relative importance of the correlation values. ∑\sum denotes the summation function for the high-order tensor. For simplicity, the “weighted sum” module can be considered as a linear layer in multiple dimensions.
64
+
65
+ One of the main drawbacks of HOCA is the generation of high-order tensor, the size of the high-order tensor will increases exponentially with the number of modalities as ∏i=1ntisuperscriptsubscriptproduct𝑖1𝑛subscript𝑡𝑖\prod_{i=1}^{n}t_{i}, resulting in a lot of computation. Therefore, we implement the multimodal correlation between the different modalities in a more efficient way with low-rank approximation which has been widely used in the community of vision and language Lei et al. (2015); Liu et al. (2018); Yu et al. (2017). Following the Eqn. 7 and 8, we rewrite (CnIl)rlsubscriptsuperscriptsubscript𝐶𝑛subscript𝐼𝑙subscript𝑟𝑙(C_{n}^{I_{l}})_{r_{l}} as1:
66
+
67
+ (CnIl)rlsubscriptsuperscriptsubscript𝐶𝑛subscript𝐼𝑙subscript𝑟𝑙\displaystyle(C_{n}^{I_{l}})_{r_{l}}=⨂{(Il)rl∘I1,…,Il−1,Il+1,…,In}absenttensor-productsubscriptsubscript𝐼𝑙subscript𝑟𝑙subscript𝐼1…subscript𝐼𝑙1subscript𝐼𝑙1…subscript𝐼𝑛\displaystyle=\bigotimes\Big{\{}(I_{l})_{r_{l}}\circ I_{1},...,I_{l-1},I_{l+1},...,I_{n}\Big{\}}(10)=⨂i=1,≠ln(Il)rl⋆Iiabsentsuperscriptsubscripttensor-product𝑖1absent𝑙𝑛⋆subscriptsubscript𝐼𝑙subscript𝑟𝑙subscript𝐼𝑖\displaystyle=\bigotimes_{i=1,\not=l}^{n}(I_{l})_{r_{l}}\star I_{i}
68
+
69
+ Element-wise multiplication operator ∘\circ is used for vector (Il)rlsubscriptsubscript𝐼𝑙subscript𝑟𝑙(I_{l})_{r_{l}} and matrix I1subscript𝐼1I_{1}. Each column of matrix I1subscript𝐼1I_{1} multiplies vector (Il)rlsubscriptsubscript𝐼𝑙subscript𝑟𝑙(I_{l})_{r_{l}}. ⋆⋆\star denotes that (Il)rlsubscriptsubscript𝐼𝑙subscript𝑟𝑙(I_{l})_{r_{l}} is multiplied (∘\circ) only when i=1𝑖1i=1. We assume a low-rank factorization of the tensor Wn−1Ilsuperscriptsubscript𝑊𝑛1subscript𝐼𝑙W_{n-1}^{I_{l}}. Specifically, Wn−1Ilsuperscriptsubscript𝑊𝑛1subscript𝐼𝑙W_{n-1}^{I_{l}} is decomposed into a sum of k𝑘k rank 111 tensors,
70
+
71
+ Wn−1Il=∑j=1k⨂i=1,≠lnwjIisuperscriptsubscript𝑊𝑛1subscript𝐼𝑙superscriptsubscript𝑗1𝑘superscriptsubscripttensor-product𝑖1absent𝑙𝑛superscriptsubscript𝑤𝑗subscript𝐼𝑖W_{n-1}^{I_{l}}=\sum_{j=1}^{k}\bigotimes_{i=1,\not=l}^{n}w_{j}^{I_{i}}(11)
72
+
73
+ where the space of wjIisuperscriptsubscript𝑤𝑗subscript𝐼𝑖w_{j}^{I_{i}} is ℝ1×tisuperscriptℝ1subscript𝑡𝑖\mathbb{R}^{1\times t_{i}}. Note that we set k𝑘k to a constant value and use the recovered low-rank tensor to approximate Wn−1Ilsuperscriptsubscript𝑊𝑛1subscript𝐼𝑙W_{n-1}^{I_{l}}. The numerator in Eqn. 9 can be further derived as:
74
+
75
+ ∑[Wn−1Il∘(CnIl)rl]=∑[∑j=1k⨂i=1,≠lnwjIi\displaystyle\sum\Big{[}W_{n-1}^{I_{l}}\!\circ\!(C_{n}^{I_{l}})_{r_{l}}\Big{]}\!=\!\sum\!\Big{[}\sum_{j=1}^{k}\bigotimes_{i=1,\not=l}^{n}w_{j}^{I_{i}}(12)∘⨂i=1,≠ln(Il)rl⋆Ii]\displaystyle\circ\bigotimes_{i=1,\not=l}^{n}(I_{l})_{r_{l}}\star I_{i}\Big{]}
76
+
77
+ Since Iisubscript𝐼𝑖I_{i} is a matrix and wjIisuperscriptsubscript𝑤𝑗subscript𝐼𝑖w_{j}^{I_{i}} is a vector, we directly multiply Iisubscript𝐼𝑖I_{i} and corresponding wjIisuperscriptsubscript𝑤𝑗subscript𝐼𝑖w_{j}^{I_{i}} 111The details of the propositions are shown in the supplementary materials.. Each row of the matrix Iisubscript𝐼𝑖I_{i} multiplies vector wjIisuperscriptsubscript𝑤𝑗subscript𝐼𝑖w_{j}^{I_{i}},
78
+
79
+ ∑[Wn−1Il∘(CnIl)rl]=∑j=1k[∑⨂i=1,≠ln(Il)rl⋆Ii∘wjIi]delimited-[]superscriptsubscript𝑊𝑛1subscript𝐼𝑙subscriptsuperscriptsubscript𝐶𝑛subscript𝐼𝑙subscript𝑟𝑙superscriptsubscript𝑗1𝑘delimited-[]superscriptsubscripttensor-product𝑖1absent𝑙𝑛⋆subscriptsubscript𝐼𝑙subscript𝑟𝑙subscript𝐼𝑖superscriptsubscript𝑤𝑗subscript𝐼𝑖\displaystyle\sum\!\Big{[}W_{n-1}^{I_{l}}\!\circ\!(C_{n}^{I_{l}})_{r_{l}}\Big{]}\!=\!\sum_{j=1}^{k}\!\Big{[}\sum\!\bigotimes_{i=1,\not=l}^{n}\!(I_{l})_{r_{l}}\star I_{i}\circ w_{j}^{I_{i}}\Big{]}(13)
80
+
81
+ where we first apply the tensor multiplication ⨂tensor-product\bigotimes to correlating the different time steps of all modalities. During the process, we sum in the d𝑑d dimension to obtain the elements of the high-order tensor. Second, we sum (inner ∑\sum) all the elements. For convenience, we change the operation order, we first sum in the temporal dimension, then sum in the d𝑑d dimension1. Letting (Ii′)jsubscriptsuperscriptsubscript𝐼𝑖′𝑗(I_{i}^{{}^{\prime}})_{j} denote the global information of Iisubscript𝐼𝑖I_{i} with importance factor wjIisuperscriptsubscript𝑤𝑗subscript𝐼𝑖w_{j}^{I_{i}},
82
+
83
+ (Ii′)j=(Ii∘wjIi)​𝟏ti=Ii​(wjIi)𝕋subscriptsuperscriptsubscript𝐼𝑖′𝑗subscript𝐼𝑖superscriptsubscript𝑤𝑗subscript𝐼𝑖subscript1subscript𝑡𝑖subscript𝐼𝑖superscriptsuperscriptsubscript𝑤𝑗subscript𝐼𝑖𝕋(I_{i}^{{}^{\prime}})_{j}=(I_{i}\circ w_{j}^{I_{i}}){\bf 1}_{t_{i}}=I_{i}(w_{j}^{I_{i}})^{\mathbb{T}}(14)
84
+
85
+ Eqn. 12 can be further derived as below:
86
+
87
+ ∑[Wn−1Il∘(CnIl)rl]=𝟏d​[(Il)rl∘Bl]delimited-[]superscriptsubscript𝑊𝑛1subscript𝐼𝑙subscriptsuperscriptsubscript𝐶𝑛subscript𝐼𝑙subscript𝑟𝑙subscript1𝑑delimited-[]subscriptsubscript𝐼𝑙subscript𝑟𝑙subscript𝐵𝑙\displaystyle\sum\Big{[}W_{n-1}^{I_{l}}\!\circ\!(C_{n}^{I_{l}})_{r_{l}}\Big{]}\!=\!{\bf 1}_{d}\Big{[}(I_{l})_{r_{l}}\!\circ\!B_{l}\Big{]}(15)
88
+
89
+ Bl=∑j=1kΛi=1,≠ln(Ii′)jB_{l}=\sum_{j=1}^{k}\operatorname*{\raisebox{-3.5pt}{\scalebox{1.44}{$\Lambda$}}}_{i=1,\not=l}^{n}(I_{i}^{{}^{\prime}})_{j}(16)
90
+
91
+ Due to the different information carried by the elements of the feature, we use a linear layer wIlsubscript𝑤subscript𝐼𝑙w_{I_{l}} to replace 𝟏dsubscript1𝑑{\bf 1}_{d},
92
+
93
+ (αnIl)rl=exp​{wIl​[(Il)rl∘Bl]}∑o=1tlexp​{wIl​[(Il)o∘Bl]}subscriptsuperscriptsubscript𝛼𝑛subscript𝐼𝑙subscript𝑟𝑙expsubscript𝑤subscript𝐼𝑙delimited-[]subscriptsubscript𝐼𝑙subscript𝑟𝑙subscript𝐵𝑙superscriptsubscript𝑜1subscript𝑡𝑙expsubscript𝑤subscript𝐼𝑙delimited-[]subscriptsubscript𝐼𝑙𝑜subscript𝐵𝑙(\alpha_{n}^{I_{l}})_{r_{l}}=\frac{{\rm exp}\Big{\{}w_{I_{l}}\Big{[}(I_{l})_{r_{l}}\circ B_{l}\Big{]}\Big{\}}}{\sum_{o=1}^{t_{l}}{\rm exp}\Big{\{}w_{I_{l}}\Big{[}(I_{l})_{o}\circ B_{l}\Big{]}\Big{\}}}(17)
94
+
95
+ The detailed structure of Low-Rank HOCA is shown in Fig. 2(c).
96
+
97
+ We analyze the space complexity of Bahdanau Attention, HOCA, and Low-Rank HOCA in Fig. 2, focusing on the trainable variables and the output of each layer. For convenience, we start by calculating from the output of t​a​n​h𝑡𝑎𝑛ℎtanh layer, since the front structures of three methods are same.
98
+
99
+ Bahdanau Attention The size of the trainable variable in second l​i​n​e​a​r​(d)𝑙𝑖𝑛𝑒𝑎𝑟𝑑linear(d) layer is d×1𝑑1d\times 1, and the size of the output is ∑i=1ntisuperscriptsubscript𝑖1𝑛subscript𝑡𝑖\sum_{i=1}^{n}t_{i}. The space complexity is O​(∑i=1nti+d)𝑂superscriptsubscript𝑖1𝑛subscript𝑡𝑖𝑑O(\sum_{i=1}^{n}t_{i}+d).
100
+
101
+ HOCA The size of the output of tensor multiplication is ∏i=1ntisuperscriptsubscriptproduct𝑖1𝑛subscript𝑡𝑖\prod_{i=1}^{n}t_{i}. The size of the trainable variables and corresponding output in w​e​i​g​h​t​e​d𝑤𝑒𝑖𝑔ℎ𝑡𝑒𝑑weighted s​u​m𝑠𝑢𝑚sum layer is ∑i=1n(∏j=1ntjti)+∑i=1ntisuperscriptsubscript𝑖1𝑛superscriptsubscriptproduct𝑗1𝑛subscript𝑡𝑗subscript𝑡𝑖superscriptsubscript𝑖1𝑛subscript𝑡𝑖\sum_{i=1}^{n}(\frac{\prod_{j=1}^{n}t_{j}}{t_{i}})+\sum_{i=1}^{n}t_{i}. The space complexity is O​(∏i=1nti+∑i=1n(∏j=1ntjti)+∑i=1nti)𝑂superscriptsubscriptproduct𝑖1𝑛subscript𝑡𝑖superscriptsubscript𝑖1𝑛superscriptsubscriptproduct𝑗1𝑛subscript𝑡𝑗subscript𝑡𝑖superscriptsubscript𝑖1𝑛subscript𝑡𝑖O(\prod_{i=1}^{n}t_{i}+\sum_{i=1}^{n}(\frac{\prod_{j=1}^{n}t_{j}}{t_{i}})+\sum_{i=1}^{n}t_{i}).
102
+
103
+ Low-Rank HOCA The rank is set to k𝑘k. The size of the trainable variable and corresponding output in l​i​n​e​a​r​(t)𝑙𝑖𝑛𝑒𝑎𝑟𝑡linear(t) layer is ∑i=1nti×k+n×k×dsuperscriptsubscript𝑖1𝑛subscript𝑡𝑖𝑘𝑛𝑘𝑑\sum_{i=1}^{n}t_{i}\times k+n\times k\times d. The size of the output in Blsubscript𝐵𝑙B_{l} and m​u​l𝑚𝑢𝑙mul layer is n×d+∑i=1nti×d𝑛𝑑superscriptsubscript𝑖1𝑛subscript𝑡𝑖𝑑n\times d+\sum_{i=1}^{n}t_{i}\times d. The size of the trainable variable and the corresponding output in second l​i​n​e​a​r​(d)𝑙𝑖𝑛𝑒𝑎𝑟𝑑linear(d) layer is d+∑i=1nti𝑑superscriptsubscript𝑖1𝑛subscript𝑡𝑖d+\sum_{i=1}^{n}t_{i}. The space complexity is O​(∑i=1nti×(k+d+1)+(n×k+n+1)×d)𝑂superscriptsubscript𝑖1𝑛subscript𝑡𝑖𝑘𝑑1𝑛𝑘𝑛1𝑑O(\sum_{i=1}^{n}t_{i}\times(k+d+1)+(n\times k+n+1)\times d).
104
+
105
+ Bahdanau Attention and Low-Rank HOCA both scale linearly in the number of modalities while HOCA scales exponentially. Therefore, HOCA will have explosive complexity when the number of modalities is big, and Low-Rank HOCA can solve this problem effectively.
106
+
107
+ In this section, we mainly introduce our encoder-decoder structure combined with high-order attention (HOCA and Low-Rank HOCA). As shown in Fig. 3(a), the features of different modalities, i.e. image(F), motion(M), audio(S) are extracted in the encoder. These features are sent to the decoder for generating words. The “MAF” module performs HOCA and Low-Rank HOCA for the features of different modalities with htsubscriptℎ𝑡h_{t}. As shown in Fig. 3(b), each modality has three types of attention weights, i.e. unary, binary, ternary, which denote the different number (i.e. 111,222,333) of modalities applied to the HOCA and Low-Rank HOCA (note that unary attention is equal to Bahdanau Attention). In some cases, not all the modalities are effective, for example, the binary attention weights of image and motion are more accurate for the salient videos.
108
+
109
+ We use αt,3Fsuperscriptsubscript𝛼𝑡3𝐹\alpha_{t,3}^{F}, αt,3Msuperscriptsubscript𝛼𝑡3𝑀\alpha_{t,3}^{M}, αt,3Ssuperscriptsubscript𝛼𝑡3𝑆\alpha_{t,3}^{S} to denote the ternary weights of three modalities at time step t𝑡t, the calculation is shown as follows:
110
+
111
+ αt,3F,αt,3M,αt,3S=HOCA​(ht,F,M,S)superscriptsubscript𝛼𝑡3𝐹superscriptsubscript𝛼𝑡3𝑀superscriptsubscript𝛼𝑡3𝑆HOCAsubscriptℎ𝑡𝐹𝑀𝑆\alpha_{t,3}^{F},\alpha_{t,3}^{M},\alpha_{t,3}^{S}={\rm HOCA}(h_{t},F,M,S)(18)
112
+
113
+ where F𝐹F,M𝑀M,S𝑆S denote the features of image, motion, audio, respectively, and HOCA can be replaced by Low-Rank HOCA. We obtain the binary and unary weights in the same way. For different attention weights, we utilize trainable variables to determine their importance. We take the image modality as an example, the fusion weights are obtained as follows:
114
+
115
+ αtF=softmax​(θ1​αt,1F+θ2​αt,2F,M+θ3​αt,2F,S+θ4​αt,3F)superscriptsubscript𝛼𝑡𝐹softmaxsubscript𝜃1superscriptsubscript𝛼t1Fsubscript𝜃2superscriptsubscript𝛼t2FMsubscript𝜃3superscriptsubscript𝛼t2FSsubscript𝜃4superscriptsubscript𝛼t3F\alpha_{t}^{F}\!=\!\rm softmax(\theta_{1}\alpha_{t,1}^{F}\!+\!\theta_{2}\alpha_{t,2}^{F,M}\!+\!\theta_{3}\alpha_{t,2}^{F,S}\!+\!\theta_{4}\alpha_{t,3}^{F})\\(19)
116
+
117
+ where θ1−4subscript𝜃14\theta_{1-4} are trainable variables, αt,1Fsuperscriptsubscript𝛼𝑡1𝐹\alpha_{t,1}^{F} denotes the unary weights, αt,2F,Msuperscriptsubscript𝛼𝑡2𝐹𝑀\alpha_{t,2}^{F,M} and αt,2F,Ssuperscriptsubscript𝛼𝑡2𝐹𝑆\alpha_{t,2}^{F,S} denote the binary weights with motion and audio, respectively. As we obtain the attention weights of three modalities, we can calculate the context vectors φt​(F)subscript𝜑𝑡𝐹\varphi_{t}(F), φt​(M)subscript𝜑𝑡𝑀\varphi_{t}(M), φt​(S)subscript𝜑𝑡𝑆\varphi_{t}(S) following the Eqn. 4 and 5.
118
+
119
+ To further determine the relative importance of multiple modalities, we perform a hierarchical attention mechanism for the context vectors in the “Fusion” module. The attention weights of image modality are calculated as follows:
120
+
121
+ βtF=exp​(etF)∑k={F,M,S}exp​(etk)superscriptsubscript𝛽𝑡𝐹expsuperscriptsubscript𝑒𝑡𝐹subscript𝑘𝐹𝑀𝑆expsuperscriptsubscript𝑒𝑡𝑘\beta_{t}^{F}=\frac{{\rm exp}(e_{t}^{F})}{\sum_{k=\{F,M,S\}}{{\rm exp}(e_{t}^{k})}}(20)
122
+
123
+ etF=we𝕋​tanh​[We​ht+Ue​φt​(F)+be]superscriptsubscript𝑒𝑡𝐹superscriptsubscript𝑤𝑒𝕋tanhdelimited-[]subscript𝑊𝑒subscriptℎ𝑡subscript𝑈𝑒subscript𝜑𝑡𝐹subscript𝑏𝑒e_{t}^{F}=w_{e}^{\mathbb{T}}{\rm tanh}\Big{[}W_{e}h_{t}+U_{e}\varphi_{t}(F)+b_{e}\Big{]}(21)
124
+
125
+ βtMsuperscriptsubscript𝛽𝑡𝑀\beta_{t}^{M} and βtSsuperscriptsubscript𝛽𝑡𝑆\beta_{t}^{S} are obtained in the same way. We integrate the context vectors and corresponding weights to predict word as follows:
126
+
127
+ pt=softmax​[Wph​ht+∑kβtk​Dt​(k)+bp]subscript𝑝𝑡softmaxdelimited-[]superscriptsubscript𝑊𝑝ℎsubscriptℎ𝑡subscript𝑘superscriptsubscript𝛽𝑡𝑘subscript𝐷𝑡𝑘subscript𝑏𝑝p_{t}={\rm softmax}\Big{[}W_{p}^{h}h_{t}+\sum_{k}\beta_{t}^{k}D_{t}(k)+b_{p}\Big{]}(22)
128
+
129
+ Dt​(k)=Wpk​φt​(k),k={F,M,S}formulae-sequencesubscript𝐷𝑡𝑘superscriptsubscript𝑊𝑝𝑘subscript𝜑𝑡𝑘𝑘𝐹𝑀𝑆D_{t}(k)=W_{p}^{k}\varphi_{t}(k),k=\{F,M,S\}(23)
130
+
131
+ The optimization goal is to minimize the cross-entropy loss function defined as the accumulative loss from all the time steps:
132
+
133
+ L=−∑i=1Tlog​(pt∗|p1∗,…,pt−1∗,V)𝐿superscriptsubscript𝑖1𝑇logconditionalsuperscriptsubscript𝑝𝑡superscriptsubscript𝑝1…superscriptsubscript𝑝𝑡1𝑉L=-\sum_{i=1}^{T}{\rm log}(p_{t}^{*}|p_{1}^{*},...,p_{t-1}^{*},V)(24)
134
+
135
+ where pt∗superscriptsubscript𝑝𝑡p_{t}^{*} denotes the probability of the ground-truth word at time step t𝑡t, T𝑇T denotes the length of description, V𝑉V denotes the original video data.
136
+
137
+ We evaluate video captioning on two standard datasets, MSVD Chen and Dolan (2011) and MSR-VTT Xu et al. (2016), which are both provided by Microsoft Research, with several state-of-the-art methods. MSVD includes 1970 video clips. The time length of a video clip is about 10 to 25 seconds and each video clip is annotated with about 40 English sentences. MSR-VTT has 10000 video clips; each clip is annotated with 20 English sentences. We follow the commonly used protocol in the previous work and use four common metrics in the evaluation, including BLEU4, ROUGE, METEOR, and CIDEr.
138
+
139
+ We sample video data to 808080 frames for extracting image features. For extracting motion features, we divide the raw video data into video chunks centered on 808080 sampled frames at the first step. Each video chunk includes 646464 frames. For extracting audio features, we obtain the audio file from the raw video data with FFmpeg. For both datasets, we use a pre-trained Inception-ResNet-v2 Szegedy et al. (2017) to extract image features from the sampled frames and we keep the activations from the penultimate layer. In addition, we use a pre-trained I3D Carreira and Zisserman (2017) to extract motion features from video chunks. We employ the activations from the last convolutional layer and implement a mean-pooling in the temporal dimension. We use the pre-trained VGGish Hershey et al. (2017) to extract audio features. On MSRVTT, we also utilize the glove embedding of the auxiliary video category labels to initialize the decoder state.
140
+
141
+ The hidden size is 512512512 for all LSTMs. The attention layer size for image, motion, audio attention is also 512512512. The dropout rate for the input and output of LSTM decoder is 0.50.50.5. The rank is set to 111. In the training stage, we use Adam Kingma and Ba (2014) algorithm to optimize the loss function; the learning rate is set to 0.00010.00010.0001. In the testing stage, we use beam-search method with beam-width 555. We use a pre-trained word2vec embedding to initialize the word vectors. Each word is represented as a 300300300-dimension vector. Those words which are not in the word2vec matrix are initialized randomly. All the experiments are done on 444 GTX 1080Ti GPUs.
142
+
143
+ Table 2 shows the results of different variants of HOCA and Low-Rank HOCA. HOCA-U, HOCA-B, and HOCA-T denote the model with only unary, binary, and ternary attention, respectively. HOCA-UB and HOCA-UBT denote the models with original HOCA and more types of attention mechanisms. The prefix “L-HOCA” denotes the model with Low-Rank HOCA.
144
+
145
+ It is observed that the model with only one type of attention mechanism(U, B, or T) in the decoder achieves relatively bad results on both datasets. However, when we combine them, the performances are significantly improved on metrics, especially ROUGE and CIDEr. HOCA-UBT and L-HOCA-UBT with a combination of unary, binary, and ternary attention achieve relatively promising results on all the metrics. We argue that HOCA-UBT and L-HOCA-UBT can learn appropriate ratios of all types of attention mechanisms based on the specific video-description pairs, while other variants only focus on one or two types. In addition, the models of low-rank version (L-HOCA-UB and L-HOCA-UBT) have better metrics than the models of original version (HOCA-UB and HOCA-UBT). On the one hand, we utilize wIlsubscript𝑤subscript𝐼𝑙w_{I_{l}} to replace 𝟏dsubscript1𝑑{\bf 1}_{d} in Eqn. 17, fully mining the different information carried by the elements of the feature, on the other hand, the low-rank approximation is effective.
146
+
147
+ Table 2 shows the results of different methods on MSR-VTT and MSVD, including ours (L-HOCA-UBT), and some state-of-the-art methods, such as LSTM-TSA Pan et al. (2017), TDDF Zhang et al. (2017), SCN Gan et al. (2017), MM-TGM Chen et al. (2017), Dense Caption Shen et al. (2017), RecNet Wang et al. (2018a), HRL Wang et al. (2018b),HACAWang et al. (2018c).
148
+
149
+ From Table 2, we find that Ours(L-HOCA-UBT) shows competitive performances compared with the state-of-the-art methods. On MSVD, L-HOCA-UBT has outperformed SCN, TDDF, RecNet, LSTM-TSA, MM-TGM, on all the metrics. In particular, L-HOCA-UBT achieves 86.1%percent86.186.1\% on CIDEr, making an improvement of 5.7%percent5.75.7\% over MM-TGM. On MSR-VTT, we have the similar observation, L-HOCA-UBT has outperformed RecNet, HRL, MM-TGM, Dense Caption, and HACA on all the metrics.
150
+
151
+ The theoretical complexity of different attention mechanisms is illustrated in Section 4.3. In practice, we utilize the experimental settings mentioned above, the batch size and the maximum number of epochs are set to 252525 and 100100100, respectively. the training time and memory space requirement are shown in Table 3. We can find that L-HOCA-UBT has smaller space requirement and less time cost than HOCA-UBT, in addition, the computing cost of L-HOCA-UBT is close to that of HOCA-U (Bahdanau Attention). The results demonstrate the advantage of Low-rank HOCA.
152
+
153
+ We also evaluate the impact of different rank values. We show the results on MSVD in Fig. 5. The red and green lines represent HOCA-UBT and L-HOCA-UBT, respectively. We find that the CIDEr of L-HOCA-UBT has slight fluctuations as the rank changes and a small value of rank can achieve competitive results with high efficiency.
154
+
155
+ Fig. 4 shows some qualitative results of our method. We simply compare the descriptions generated by HOCA-U and L-HOCA-UBT, respectively. GT represents “Ground Truth”. Benefiting from the high-order correlation of multiple modalities, L-HOCA-UBT can generate more accurate descriptions which are close to GT.
156
+
157
+ In this paper, we have proposed a new cross-modal attention mechanism called HOCA for video captioning. HOCA integrates the information of the other modalities into the inference of attention weights of current modality. Furthermore, we have introduced the Low-Rank HOCA which has a good scalability to the increasing number of modalities. The experimental results on two standard datasets have demonstrated the effectiveness of our approach.
1911.00218v1.txt ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ One is often interested in learning from groups of heterogeneous data produced by related, but unique, generative processes. For instance, consider the problem of discovering shared topics from a collection of documents, or extracting common patterns from physiological signals of a cohort of patients. Learning such shared representations can be relevant to many heterogeneous, federated, and transfer learning tasks. Hierarchical Bayesian models [3, 12, 30] are widely used for performing such analyses, as they are able to both naturally model heterogeneity in data and share statistical strength across heterogeneous groups.
2
+
3
+ However, when the data is large and scattered across disparate silos, as is increasingly the case in many real-world applications, use of standard hierarchical Bayesian machinery becomes fraught with difficulties. In addition to costs associated with moving large volumes of data, the computational cost of full Bayesian inference may be prohibitive. Moreover, pooling sequestered data may also be undesirable owing to concerns such as privacy [11].While distributed variants [18] have been developed, they require frequent communication with a central server and hence are restricted to situations where sufficient communication bandwidth is available. Yet others [27] have proposed federated learning algorithms to deal with such scenarios. However, these algorithms tend to be bespoke and can require significant modifications based on the models being federated.
4
+
5
+ Motivated by these challenges, in this paper we develop Bayesian nonparametric meta-models that are able to coherently combine models trained on independent partitions of data (model fusion). Relying on tools from Bayesian nonparametrics (BNP), our meta model treats the parameters of the locally trained models as noisy realizations of latent global parameters, of which there can be infinitely many. The generative process is formally characterized through a Beta-Bernoulli process (BBP) [32]. Model fusion, rather than being an ad-hoc procedure, then reduces to posterior inference over the meta-model. Governed by the BBP posterior, the meta-model allows local parameters to either match existing global parameters or create new ones. This ability to grow or shrink the number of parameters is crucial for combining local models of varying complexity – for instance, hidden Markov models with differing numbers of states.
6
+
7
+ Our construction provides several key advantages over alternatives in terms of scalability and flexibility. First, scaling to large data through parallelization is trivially easy in our framework. One would simply train the local models in parallel and fuse them. Armed with a Hungarian algorithm-based efficient MAP inference procedure for the BBP model, we find that our train-in-parallel and fuse scheme affords significant speedups. Since our model fusion procedure is independent of the learning and inference algorithms that may have been used to train individual models, we can seamlessly combine models trained using disparate algorithms. Furthermore, since we only require access to trained local models and not the original data, our framework is also applicable in cases where only pre-trained models are available but not the actual data, a setting that is difficult for existing federated or distributed learning algorithms.
8
+
9
+ Finally, we note that our development is largely agnostic to the form of the local models and is reusable across a wide variety of domains. In fact, up to the choice of an appropriate base measure to describe the local parameters, the exact same algorithm can be used for fusion across qualitatively different settings. We illustrate this flexibility by demonstrating proficiency at combining a diverse class of models, which include sparse Gaussian processes, mixture models, topic models and hierarchical Dirichlet process based hidden Markov models.
10
+
11
+ Here, we briefly review the building blocks of our approach and highlight the differences of our approach from existing work.
12
+
13
+ The Indian buffet process (IBP) specifies a distribution over sparse binary matrices with infinitely many columns [17]. It is commonly described through the following culinary metaphor. Imagine J𝐽J customers arrive sequentially at a buffet and choose dishes to sample. The first customer to arrive samples Poisson(γ0)subscript𝛾0(\gamma_{0}) dishes. The j𝑗j-th subsequent customer then tries each of the dishes selected by previous customers with probability proportional to the dish’s popularity, and then additionally samples Poisson(γ0/j)subscript𝛾0𝑗(\gamma_{0}/j) new dishes that have not yet been sampled by any customer.Thibaux and Jordan [32] showed that the de Finetti mixing distribution underlying the IBP is a Beta Bernoulli Process (BBP). Let Q𝑄Q be a random measure drawn from a Beta process, Q∣α,γ0,H∼BP​(α,γ0​H)similar-toconditional𝑄𝛼subscript𝛾0𝐻BP𝛼subscript𝛾0𝐻Q\mid\alpha,\gamma_{0},H\sim\text{BP}(\alpha,\gamma_{0}H), with mass parameter γ0subscript𝛾0\gamma_{0}, base measure H𝐻H over ΩΩ\Omega such that H​(Ω)=1𝐻Ω1H(\Omega)=1 and concentration parameter α𝛼\alpha. It can be shown Q𝑄Q is a discrete measure Q=∑iqi​δθi𝑄subscript𝑖subscriptq𝑖subscript𝛿subscript𝜃𝑖Q=\sum_{i}{\textnormal{q}}_{i}\delta_{{\mathbf{\theta}}_{i}} formed by an infinitely countable set of (weight, atom) pairs (qi,θi)∈[0,1]×Ωsubscriptq𝑖subscript𝜃𝑖01Ω({\textnormal{q}}_{i},{\mathbf{\theta}}_{i})\in[0,1]\times\Omega. The weights {qi}i=1∞superscriptsubscriptsubscriptq𝑖𝑖1\{{\textnormal{q}}_{i}\}_{i=1}^{\infty} are distributed by a stick-breaking process [31], ν1∼Beta​(γ0,1),νi=∏j=1iνjformulae-sequencesimilar-tosubscript𝜈1Betasubscript𝛾01subscript𝜈𝑖superscriptsubscriptproduct𝑗1𝑖subscript𝜈𝑗\nu_{1}\sim\text{Beta}(\gamma_{0},1),\,\nu_{i}=\prod_{j=1}^{i}\nu_{j} and the atoms θisubscript𝜃𝑖{\mathbf{\theta}}_{i} are drawn i.i.d. from H𝐻H. Subsets of atoms in Q𝑄Q are then selected via a Bernoulli process. That is, each subset 𝒯jsubscript𝒯𝑗\mathcal{T}_{j} with j=1,…,J𝑗1…𝐽j=1,\ldots,J is characterized by a Bernoulli process with base measure Q𝑄Q, 𝒯j∣Q∼BeP​(Q)similar-toconditionalsubscript𝒯𝑗𝑄BeP𝑄\mathcal{T}_{j}\mid Q\sim\text{BeP}(Q). Consequently, subset 𝒯jsubscript𝒯𝑗\mathcal{T}_{j} is also a discrete measure formed by pairs (bj​i,θi)∈{0,1}×Ωsubscriptb𝑗𝑖subscript𝜃𝑖01Ω({\textnormal{b}}_{ji},{\mathbf{\theta}}_{i})\in\{0,1\}\times\Omega,𝒯j:=∑ibj​i​δθi​, where bj​i∣qi∼Bernoulli​(qi)​∀iassignsubscript𝒯𝑗conditionalsubscript𝑖subscriptb𝑗𝑖subscript𝛿subscript𝜃𝑖subscript, where b𝑗𝑖subscriptq𝑖similar-toBernoullisubscriptq𝑖for-all𝑖\mathcal{T}_{j}:=\sum_{i}{\textnormal{b}}_{ji}\delta_{{\mathbf{\theta}}_{i}}\text{, where }{\textnormal{b}}_{ji}\mid{\textnormal{q}}_{i}\sim\text{Bernoulli}({\textnormal{q}}_{i})\,\forall i is a binary random variable indicating whether atom θisubscript𝜃𝑖\theta_{i} belongs to subset 𝒯jsubscript𝒯𝑗\mathcal{T}_{j}. The collection of such subsets is then said to be distributed by a Beta-Bernoulli process. Marginalizing over the Beta Process distributed Q𝑄Q we recover the predictive distribution,𝒯J∣𝒯1,…,𝒯J−1∼BeP​(α​γ0J+α−1​H+∑imiJ+α−1​δθi)similar-toconditionalsubscript𝒯𝐽subscript𝒯1…subscript𝒯𝐽1BeP𝛼subscript𝛾0𝐽𝛼1𝐻subscript𝑖subscript𝑚𝑖𝐽𝛼1subscript𝛿subscript𝜃𝑖\mathcal{T}_{J}\mid\mathcal{T}_{1},\ldots,\mathcal{T}_{J-1}\sim\text{BeP}\left(\frac{\alpha\gamma_{0}}{J+\alpha-1}H+\sum_{i}\frac{m_{i}}{J+\alpha-1}\delta_{{\mathbf{\theta}}_{i}}\right),where mi=∑j=1J−1bj​isubscript𝑚𝑖superscriptsubscript𝑗1𝐽1subscriptb𝑗𝑖m_{i}=\sum_{j=1}^{J-1}{\textnormal{b}}_{ji} (dependency on J𝐽J is suppressed for notational simplicity) which can be shown to be equivalent to the IBP.Our work is related to recent advances [35] in efficient BBP MAP inference.
14
+
15
+ Similarly to us, federated and distributed learning approaches also attempt to learn from sequestered data. These approaches roughly fall into two groups, those [9, 15, 21, 22, 23] that decompose a global, centralized learning objective into localized ones that can be optimized separately using local data, and those that iterate between training local models on private data sources and distilling them into a global model [8, 6, 18, 27]. The former group carefully exploits properties of the local models being combined. It is unclear how methods developed for a particular class of local models (for example, Gaussian processes) can be adapted to a different class of models (say, hidden Markov models). More recently, [34] also exploited a BBP construction for federated learning, but were restricted to only neural networks. Alternatively, [20] follows a different development that requires local models of different classes to be distilled into the same class of surrogate models before aggregating them, which, however, accumulates local distillation error (especially when the number of local models is large). Members of the latter group require frequent communication with a central server, are poorly suited to bandwidth limited cases, and are not applicable when the pretrained models cannot share their associated data. Others [5] have proposed decentralized approximate Bayesian algorithms. However, unlike us, they assume that each of the local models have the same number of parameters, which is unsuitable for federating models with different complexities.
16
+
17
+ We propose a Bayesian nonparametric meta model based on the Beta-Bernoulli process [32]. In seeking a “meta model”, our goal will be to describe a model that generates collections of parameters that describe the local models. This meta model can then be used to infer the parameters of a global model from a set of local models learned independently on private datasets.
18
+
19
+ Our key assumption is that there is an unknown shared set of parameters of unknown size across datasets, which we call global parameters, and we are able to learn subsets of noisy realizations of these parameters from each of the datasets, which we call local parameters. The noise in local parameters is motivated by estimation error due to finite sample size and by variations in the distributions of each of the datasets. Additionally, local parameters are allowed to be permutation invariant, which is the case in a variety of widely used models (e.g., any mixture or an HMM).
20
+
21
+ We start with Beta process prior on the collection of global parameters, G∼BP​(α,γ0​H)​ then ​G=∑ipi​δθi,θi∼Hformulae-sequencesimilar-to𝐺BP𝛼subscript𝛾0𝐻 then 𝐺subscript𝑖subscript𝑝𝑖subscript𝛿subscript𝜃𝑖similar-tosubscript𝜃𝑖𝐻G\sim\text{BP}(\alpha,\gamma_{0}H)\text{ then }G=\sum_{i}p_{i}\delta_{\theta_{i}},\ \theta_{i}\sim H, where H𝐻H is a base measure, θisubscript𝜃𝑖\theta_{i} are the global parameters, and pisubscript𝑝𝑖p_{i} are the stick breaking weights.To devise a meta-model applicable to broad range of existing models, we do not assume any specific base measure and instead proceed with general exponential family base measure,pθ​(θ∣τ,n0)=ℋ​(τ,n0)​exp⁡(τT​θ−n0​𝒜​(θ)).subscript𝑝𝜃conditional𝜃𝜏subscript𝑛0ℋ𝜏subscript𝑛0superscript𝜏𝑇𝜃subscript𝑛0𝒜𝜃p_{\theta}(\theta\mid\tau,n_{0})=\mathcal{H}(\tau,n_{0})\exp(\tau^{T}\theta-n_{0}\mathcal{A}(\theta)).(1)Local models do not necessarily have to use all global parameters, e.g. a Hidden Markov Model for a given time series may only contain a subset of latent dynamic behaviors observed across collection of time series. We use a Bernoulli process to allow J𝐽J local models to select a subset of global parameters,Qj∣G∼BeP​(G)​ for ​j=1,…,J.formulae-sequencesimilar-toconditionalsubscript𝑄𝑗𝐺BeP𝐺 for 𝑗1…𝐽Q_{j}\mid G\sim\text{BeP}(G)\text{ for }j=1,\ldots,J.(2)Then Qj=∑ibj​i​δθisubscript𝑄𝑗subscript𝑖subscript𝑏𝑗𝑖subscript𝛿subscript𝜃𝑖Q_{j}=\sum_{i}b_{ji}\delta_{\theta_{i}}, where bj​i∣pi∼Bern​(pi)similar-toconditionalsubscript𝑏𝑗𝑖subscript𝑝𝑖Bernsubscript𝑝𝑖b_{ji}\mid p_{i}\sim\text{Bern}(p_{i}) is a random measure representing the subset of global parameters characterizing model j𝑗j. We denote the corresponding subset of indices of the global parameters induced by Qjsubscript𝑄𝑗Q_{j} as 𝒞j={i:bj​i=1}subscript𝒞𝑗conditional-set𝑖subscript𝑏𝑗𝑖1\mathcal{C}_{j}=\{i:b_{ji}=1\}. The noisy, permutation invariant local parameters estimated from dataset j𝑗j are modeled as,vj​l∣θc​(j,l)∼F(⋅∣θc​(j,l)) for l=1,…,Lj,v_{jl}\mid\theta_{c(j,l)}\sim F(\cdot\mid\theta_{c(j,l)})\text{ for }l=1,\ldots,L_{j},(3)where Lj=card(𝒞j)subscript𝐿𝑗cardsubscript𝒞𝑗L_{j}=\operatorname*{card}(\mathcal{C}_{j}) and c​(j,l):{1,…,LJ}→𝒞j:𝑐𝑗𝑙→1…subscript𝐿𝐽subscript𝒞𝑗c(j,l):\{1,\ldots,L_{J}\}\rightarrow\mathcal{C}_{j} is an unknown mapping of indices of local parameters to indices of global parameters corresponding to dataset j𝑗j. Parameters of different models of potential interest may have different domain spaces and domain-specific structure. To preserve generality of our meta-modeling approach we again consider a general exponential family density for the local parameters,pv​(v∣θ)=h​(v)​exp⁡(θT​T​(v)−𝒜​(θ)).subscript𝑝𝑣conditional𝑣𝜃ℎ𝑣superscript𝜃𝑇𝑇𝑣𝒜𝜃p_{v}(v\mid\theta)=h(v)\exp(\theta^{T}T(v)-\mathcal{A}(\theta)).(4)where T​(⋅)𝑇⋅T(\cdot) is the sufficient statistic function.
22
+
23
+ We emphasize that our construction describes a meta model, in particular it describes a generative process for the parameters of the local models rather than the data itself. These parameters are “observed” either when pre-trained local models are made available or when the local models are learned independently and potentially in parallel across datasets. The meta model then infers shared latent structure among the datasets. The Beta process concentration parameter α𝛼\alpha controls the degree of sharing across local models while the mass parameter γ0subscript𝛾0\gamma_{0} controls the number of global parameters. The interpretation of the exponential family parameters, τ𝜏\tau and n0subscript𝑛0n_{0}, depends on the choice of the particular exponential family. We provide a concrete example with the Gaussian distribution in Section 4.1.
24
+
25
+ Several prior works [10, 19, 4] explore the meta modeling perspective. The key difference with our approach is that we consider broader model class allowing for inherent permutation invariant structure of the parameter space, e.g. mixture models, topic models, hidden Markov models and sparse Gaussian processes. The aforementioned approaches are only applicable to models with natural parameter ordering, e.g. linear regression, which is a simpler special case of our construction. Permutation invariance leads to inferential challenges associated with finding correspondences across sets of local parameters and learning the size of the global model, which we address in the next section.
26
+
27
+ Taking the optimization perspective, our goal is to maximize the posterior probability of the global parameters given the local ones. Before discussing the objective function we re-parametrize (4) to side-step the index mappings c​(⋅,⋅)𝑐⋅⋅c(\cdot,\cdot) as follows:vj​l∣B,θ∼F(⋅∣∑iBi​ljθi) s.t. ∑iBi​lj=1, bj​i=∑lBi​lj∈{0,1},\begin{split}v_{jl}\mid B,\theta\sim F\left(\cdot\mid\sum_{i}B^{j}_{il}\theta_{i}\right)\text{ s.t. }\sum_{i}B^{j}_{il}=1\text{, }b_{ji}=\sum_{l}B^{j}_{il}\in\{0,1\},\end{split}(5)where B={Bi​lj}i,j,l𝐵subscriptsuperscriptsubscript𝐵𝑖𝑙𝑗𝑖𝑗𝑙B=\{B_{il}^{j}\}_{i,j,l} are the assignment variables such that Bi​lj=1superscriptsubscript𝐵𝑖𝑙𝑗1B_{il}^{j}=1 denotes that vj​lsubscript𝑣𝑗𝑙v_{jl} is matched to θisubscript𝜃𝑖\theta_{i}, i.e. vj​lsubscript𝑣𝑗𝑙v_{jl} is the local parameter realization of the global parameter θisubscript𝜃𝑖\theta_{i}; Bi​lj=0superscriptsubscript𝐵𝑖𝑙𝑗0B_{il}^{j}=0 implies the opposite.
28
+
29
+ The objective function is then ℙ​(θ,B∣v,Θ)ℙ𝜃conditional𝐵𝑣Θ\mathbb{P}(\theta,B\mid v,\Theta), where Θ={τ,n0}Θ𝜏subscript𝑛0\Theta=\{\tau,n_{0}\} are the hyperparameters and indexing is suppressed for simplicity. In the context of our meta model this problem has been studied when distributions in (1) and (4) are Gaussian [34] or von Mises-Fisher [35], which are both special cases of our meta model. However, this objective requires ΘΘ\Theta to be chosen a priori leading to potentially sub-optimal solutions or to be selected via expensive cross-validation.
30
+
31
+ We show that it is possible to simplify the optimization problem via integrating out θ𝜃\theta and jointly learn hyperparameters and matching variables B𝐵B, all while maintaining the generality of our meta model. Define Zi={(j,l)∣Bi​lj=1}subscript𝑍𝑖conditional-set𝑗𝑙subscriptsuperscript𝐵𝑗𝑖𝑙1Z_{i}=\{(j,l)\mid B^{j}_{il}=1\} to be the index set of the local parameters assigned to the i𝑖ith global parameter, then the objective functions we consider is,ℒ​(B,Θ)=ℙ​(B∣v)∝ℙ​(B)​∫pv​(v∣B,θ)​pθ​(θ)​dθ=ℙ​(B)​∏i∫∏z∈Zipv​(vz∣θi)​pθ​(θi)​d​θi=ℙ(B)∏iℋ(τ,n0)∫(∏z∈Zih(vz))exp((τ+∑z∈ZiT(vz))T)θi−(card(Zi)+n0)𝒜(θ))dθi=ℙ​(B)​∏iℋ​(τ,n0)​∏z∈Zih​(vz)ℋ​(τ+∑z∈ZiT​(vz),card(Zi)+n0),\begin{split}&\mathcal{L}(B,\Theta)=\mathbb{P}(B\mid v)\propto\mathbb{P}(B)\int p_{v}(v\mid B,\theta)p_{\theta}(\theta)\mathop{}\!\mathrm{d}\theta=\mathbb{P}(B)\prod_{i}\int\prod_{z\in Z_{i}}p_{v}(v_{z}\mid\theta_{i})p_{\theta}(\theta_{i})\mathop{}\!\mathrm{d}\theta_{i}\\&=\mathbb{P}(B)\prod_{i}\mathcal{H}(\tau,n_{0})\int\left(\prod_{z\in Z_{i}}h(v_{z})\right)\exp\left((\tau+\sum_{z\in Z_{i}}T(v_{z}))^{T})\theta_{i}-(\operatorname*{card}(Z_{i})+n_{0})\mathcal{A}(\theta)\right)\mathop{}\!\mathrm{d}\theta_{i}\\&=\mathbb{P}(B)\prod_{i}\frac{\mathcal{H}(\tau,n_{0})\prod_{z\in Z_{i}}h(v_{z})}{\mathcal{H}(\tau+\sum_{z\in Z_{i}}T(v_{z}),\operatorname*{card}(Z_{i})+n_{0})},\end{split}(6)Holding ΘΘ\Theta fixed, and then taking the logarithm and noting that ∑i∑j,lBi​lj​log⁡h​(vj​l)subscript𝑖subscript𝑗𝑙subscriptsuperscript𝐵𝑗𝑖𝑙ℎsubscript𝑣𝑗𝑙\sum_{i}\sum_{j,l}B^{j}_{il}\log h(v_{jl}) is constant in B𝐵B, we wish to maximize,ℒΘ​(B)=log⁡ℙ​(B)−∑ilog⁡ℋ​(τ+∑j,lBi​lj​T​(vj​l),∑j,lBi​lj+n0),subscriptℒΘ𝐵ℙ𝐵subscript𝑖ℋ𝜏subscript𝑗𝑙subscriptsuperscript𝐵𝑗𝑖𝑙𝑇subscript𝑣𝑗𝑙subscript𝑗𝑙subscriptsuperscript𝐵𝑗𝑖𝑙subscript𝑛0\begin{split}\mathcal{L}_{\Theta}(B)=\log\mathbb{P}(B)-\sum_{i}\log\mathcal{H}\left(\tau+\sum_{j,l}B^{j}_{il}T(v_{jl}),\sum_{j,l}B^{j}_{il}+n_{0}\right),\end{split}(7)where we have used ℒΘ​(B)subscriptℒΘ𝐵\mathcal{L}_{\Theta}(B) to denote the objective when ΘΘ\Theta is held constant.Despite the large number of discrete variables, we show that ℒΘ​(B)subscriptℒΘ𝐵\mathcal{L}_{\Theta}(B) admits a reformulation that permits efficient inference by iteratively solving small sized linear sum assignment problems (e.g., the Hungarian algorithm [25]).
32
+
33
+ We consider iterative optimization where we optimize the assignments Bj0superscript𝐵subscript𝑗0B^{j_{0}} for some group j0subscript𝑗0j_{0} given that the assignments for all other groups, denoted B∖j0superscript𝐵subscript𝑗0B^{\setminus j_{0}}, are held fixed. Let mi=∑j,lBi​ljsubscript𝑚𝑖subscript𝑗𝑙subscriptsuperscript𝐵𝑗𝑖𝑙m_{i}=\sum_{j,l}B^{j}_{il} denote number of local parameters assigned to the global parameter i𝑖i, mi∖j0=∑j≠j0,lBi​ljsubscriptsuperscript𝑚subscript𝑗0𝑖subscript𝑗subscript𝑗0𝑙subscriptsuperscript𝐵𝑗𝑖𝑙m^{\setminus j_{0}}_{i}=\sum_{j\neq j_{0},l}B^{j}_{il} be the same outside of group j0subscript𝑗0j_{0} and let L∖j0subscript𝐿subscript𝑗0L_{\setminus j_{0}} denote the number of unique global parameters corresponding to the local parameters outside of j0subscript𝑗0j_{0}. The corresponding objective functions are given byℒB∖j0,Θ​(Bj0)=log⁡ℙ​(Bj0∣B∖j0)−∑i=1L∖j0+Lj0log⁡ℋ​(τ+∑lBi​lj0​T​(vj0​l)+∑j≠j0,lBi​lj​T​(vj​l),∑lBi​lj+mi∖j0+n0).subscriptℒsuperscript𝐵subscript𝑗0Θsuperscript𝐵subscript𝑗0ℙconditionalsuperscript𝐵subscript𝑗0superscript𝐵subscript𝑗0superscriptsubscript𝑖1subscript𝐿subscript𝑗0subscript𝐿subscript𝑗0ℋ𝜏subscript𝑙subscriptsuperscript𝐵subscript𝑗0𝑖𝑙𝑇subscript𝑣subscript𝑗0𝑙subscript𝑗subscript𝑗0𝑙subscriptsuperscript𝐵𝑗𝑖𝑙𝑇subscript𝑣𝑗𝑙subscript𝑙subscriptsuperscript𝐵𝑗𝑖𝑙subscriptsuperscript𝑚subscript𝑗0𝑖subscript𝑛0\begin{split}\mathcal{L}_{B^{\setminus j_{0}},\Theta}(B^{j_{0}})&=\log\mathbb{P}(B^{j_{0}}\mid B^{\setminus j_{0}})\\&-\sum_{i=1}^{L_{\setminus j_{0}}+L_{j_{0}}}\log\mathcal{H}\left(\tau+\sum_{l}B^{j_{0}}_{il}T(v_{j_{0}l})+\sum_{j\neq j_{0},l}B^{j}_{il}T(v_{jl}),\sum_{l}B^{j}_{il}+m^{\setminus j_{0}}_{i}+n_{0}\right).\end{split}(8)To arrive at a form of a linear sum assignment problem we define a subtraction trick:
34
+
35
+ Applying the subtraction trick to (8) (conditions on B𝐵B are satisfied per (5)), we arrive at a linear sum assignment formulation ℒB∖j0,Θ​(Bj0)=−∑i,lBi​lj0​Ci​lj0subscriptℒsuperscript𝐵subscript𝑗0Θsuperscript𝐵subscript𝑗0subscript𝑖𝑙subscriptsuperscript𝐵subscript𝑗0𝑖𝑙subscriptsuperscript𝐶subscript𝑗0𝑖𝑙\mathcal{L}_{B^{\setminus j_{0}},\Theta}(B^{j_{0}})=-\sum_{i,l}B^{j_{0}}_{il}C^{j_{0}}_{il}, where the costCi​lj0subscriptsuperscript𝐶subscript𝑗0𝑖𝑙\displaystyle C^{j_{0}}_{il}=\displaystyle={log⁡mi∖j0α+J−1−mi∖j0−log⁡ℋ​(τ+T​(vj0​l)+∑j≠j0,lBi​lj​T​(vj​l),1+mi∖j0+n0)ℋ​(τ+∑j≠j0,lBi​lj​T​(vj​l),mi∖j0+n0),i≤L∖j0log⁡α​γ0(α+J−1)​(i−L∖j0)−log⁡ℋ​(τ+T​(vj0​l),1+n0)ℋ​(τ,n0),L∖j0<i≤L∖j0+Lj.casessuperscriptsubscript𝑚𝑖subscript𝑗0𝛼𝐽1superscriptsubscript𝑚𝑖subscript𝑗0ℋ𝜏𝑇subscript𝑣subscript𝑗0𝑙subscript𝑗subscript𝑗0𝑙subscriptsuperscript𝐵𝑗𝑖𝑙𝑇subscript𝑣𝑗𝑙1subscriptsuperscript𝑚subscript𝑗0𝑖subscript𝑛0ℋ𝜏subscript𝑗subscript𝑗0𝑙subscriptsuperscript𝐵𝑗𝑖𝑙𝑇subscript𝑣𝑗𝑙subscriptsuperscript𝑚subscript𝑗0𝑖subscript𝑛0𝑖subscript𝐿subscript𝑗0𝛼subscript𝛾0𝛼𝐽1𝑖subscript𝐿subscript𝑗0ℋ𝜏𝑇subscript𝑣subscript𝑗0𝑙1subscript𝑛0ℋ𝜏subscript𝑛0subscript𝐿subscript𝑗0𝑖subscript𝐿subscript𝑗0subscript𝐿𝑗\displaystyle\begin{cases}\log\frac{m_{i}^{\setminus j_{0}}}{\alpha+J-1-m_{i}^{\setminus j_{0}}}-\log\frac{\mathcal{H}\left(\tau+T(v_{j_{0}l})+\sum_{j\neq j_{0},l}B^{j}_{il}T(v_{jl}),1+m^{\setminus j_{0}}_{i}+n_{0}\right)}{\mathcal{H}\left(\tau+\sum_{j\neq j_{0},l}B^{j}_{il}T(v_{jl}),m^{\setminus j_{0}}_{i}+n_{0}\right)},&i\leq L_{\setminus j_{0}}\\\log\frac{\alpha\gamma_{0}}{(\alpha+J-1)(i-L_{\setminus j_{0}})}-\log\frac{\mathcal{H}\left(\tau+T(v_{j_{0}l}),1+n_{0}\right)}{\mathcal{H}\left(\tau,n_{0}\right)},&L_{\setminus j_{0}}<i\leq L_{\setminus j_{0}}+L_{j}.\end{cases}(9)
36
+
37
+ Terms on the left are due to log⁡ℙ​(Bj0∣B∖j0)ℙconditionalsuperscript𝐵subscript𝑗0superscript𝐵subscript𝑗0\log\mathbb{P}(B^{j_{0}}\mid B^{\setminus j_{0}}). Details are provided in Supplement A.Our algorithm consists of alternating the Hungarian algorithm with the above cost and hyperparameter optimization using log⁡ℙ​(B∣v)ℙconditional𝐵𝑣\log\mathbb{P}(B\mid v) from (6), ignoring ℙ​(B)ℙ𝐵\mathbb{P}(B) as it is a constant with respect to hyperparameters.Specifically, the hyperparameter optimization step isτ^,n^0^𝜏subscript^𝑛0\displaystyle\hat{\tau},\hat{n}_{0}=\displaystyle=arg​maxτ,n0​∑i=1L(log⁡ℋ​(τ,n0)−log⁡ℋ​(τ+∑j,lBi​lj​T​(vj​l),∑j,lBi​lj+n0)),subscriptargmax𝜏subscript𝑛0superscriptsubscript𝑖1𝐿ℋ𝜏subscript𝑛0ℋ𝜏subscript𝑗𝑙subscriptsuperscript𝐵𝑗𝑖𝑙𝑇subscript𝑣𝑗𝑙subscript𝑗𝑙subscriptsuperscript𝐵𝑗𝑖𝑙subscript𝑛0\displaystyle\operatorname*{arg\,max}_{\tau,n_{0}}\sum_{i=1}^{L}\left(\log\mathcal{H}(\tau,n_{0})-\log\mathcal{H}\left(\tau+\sum_{j,l}B^{j}_{il}T(v_{jl}),\sum_{j,l}B^{j}_{il}+n_{0}\right)\right),(10)where B𝐵B is held fixed. After obtaining estimates for B𝐵B and the hyperparameters ΘΘ\Theta, it only remains to compute global parameters estimates {θi}i=1L=arg​maxθ1,…,θL⁡ℙ​({θi}i=1L|B,v,Θ)superscriptsubscriptsubscript𝜃𝑖𝑖1𝐿subscriptargmaxsubscript𝜃1…subscript𝜃𝐿ℙconditionalsuperscriptsubscriptsubscript𝜃𝑖𝑖1𝐿𝐵𝑣Θ\{\theta_{i}\}_{i=1}^{L}=\operatorname*{arg\,max}\limits_{\theta_{1},\ldots,\theta_{L}}\mathbb{P}(\{\theta_{i}\}_{i=1}^{L}|B,v,\Theta). Given the assignments, expressions for hyperparameter and global parameter estimates can be obtained using gradient-based optimization. In Section 4.1 we give a concrete example where derivations may be done in closed form. Our method, Statistical Parameter Aggregation via Heterogeneous Matching (SPAHM, pronounced “spam”), is summarized as Algorithm 1.
38
+
39
+ We present an example of how a statistical modeler may apply SPAHM in practice. The only choice modeler has to make is the prior over parameters of their local models, i.e. (4). In many practical scenarios (as we will demonstrate in the experiments section) model parameters are real-valued and the Gaussian distribution is a reasonable choice for the prior on the parameters. The Gaussian case is further of interest as it introduces additional parameters. For simplicity we consider the 1-dimensional Gaussian, which is also straightforward to generalize to multi-dimensional isotropic case.
40
+
41
+ The modeler starts by writing the densitypv​(v∣θ,σ2)=12​π​σ2​exp⁡(−(v−θ)22​σ2)​ and noticing thathσ​(v)=12​π​σ2​exp⁡(−v22​σ2),Tσ​(v)=vσ2,𝒜σ​(v)=θ22​σ2.\begin{split}&p_{v}(v\mid\theta,\sigma^{2})=\frac{1}{\sqrt{2\pi\sigma^{2}}}\exp\left(-\frac{(v-\theta)^{2}}{2\sigma^{2}}\right)\text{ and noticing that}\\&h_{\sigma}(v)=\frac{1}{\sqrt{2\pi\sigma^{2}}}\exp\left(-\frac{v^{2}}{2\sigma^{2}}\right),\quad T_{\sigma}(v)=\frac{v}{\sigma^{2}},\quad\mathcal{A}_{\sigma}(v)=\frac{\theta^{2}}{2\sigma^{2}}.\end{split}Here the subscript σ𝜎\sigma indicates dependence on the additional parameter, i.e. variance. Next,Hσ​(τ,n0)=(∫exp⁡(τ​θ−n0​θ22​σ2)​dθ)−1=(exp⁡(τ2​σ22​n0)​2​π​σ2n0)−1subscript𝐻𝜎𝜏subscript𝑛0superscript𝜏𝜃subscript𝑛0superscript𝜃22superscript𝜎2differential-d𝜃1superscriptsuperscript𝜏2superscript𝜎22subscript𝑛02𝜋superscript𝜎2subscript𝑛01H_{\sigma}(\tau,n_{0})=\left(\int\exp\left(\tau\theta-\frac{n_{0}\theta^{2}}{2\sigma^{2}}\right)\mathop{}\!\mathrm{d}\theta\right)^{-1}=\left(\exp\left(\frac{\tau^{2}\sigma^{2}}{2n_{0}}\right)\sqrt{\frac{2\pi\sigma^{2}}{n_{0}}}\right)^{-1}to ensure pθ​(θ|τ,n0)subscript𝑝𝜃conditional𝜃𝜏subscript𝑛0p_{\theta}(\theta|\tau,n_{0}) integrates to unity. Hence,log⁡Hσ​(τ,n0)=−τ2​σ22​n0+log⁡n0−log⁡σ2−log⁡2​π2.subscript𝐻𝜎𝜏subscript𝑛0superscript𝜏2superscript𝜎22subscript𝑛0subscript𝑛0superscript𝜎22𝜋2\log H_{\sigma}(\tau,n_{0})=-\frac{\tau^{2}\sigma^{2}}{2n_{0}}+\frac{\log n_{0}-\log\sigma^{2}-\log 2\pi}{2}.These are all we need to customize (9) and (10) to the Gaussian case, which then allows the modeler to use Algorithm 1 to compute the shared parameters across the datasets. Note that in this case ∑j,llog⁡hσ​(vj​l)subscript𝑗𝑙subscriptℎ𝜎subscript𝑣𝑗𝑙\sum_{j,l}\log h_{\sigma}(v_{jl}) should be added to eq. (10) if it is desired to learn the additional parameter σ2superscript𝜎2\sigma^{2}. We recognize that not every exponential family allows for closed form evaluation of the prior normalizing constant Hσ​(τ,n0)subscript𝐻𝜎𝜏subscript𝑛0H_{\sigma}(\tau,n_{0}), however it remains possible to use SPAHM by employing Monte Carlo techniques for estimating entries of the cost (9) and auto-differentiation [2] to optimize hyperparameters.
42
+
43
+ Continuing our Gaussian example, we note that setting τ=μ0/σ02𝜏subscript𝜇0superscriptsubscript𝜎02\tau=\mu_{0}/\sigma_{0}^{2} and n0=σ2/σ02subscript𝑛0superscript𝜎2superscriptsubscript𝜎02n_{0}=\sigma^{2}/\sigma_{0}^{2} we recover (1) as a density of a Gaussian random variable with mean μ0subscript𝜇0\mu_{0} and variance σ02superscriptsubscript𝜎02\sigma_{0}^{2}, as expected. The further benefit of the Gaussian choice is the closed-form solution to the hyperparameters estimation problem.
44
+
45
+ Under the mild assumption that σ02+σ2/mi≈σ02​∀isuperscriptsubscript𝜎02superscript𝜎2subscript𝑚𝑖superscriptsubscript𝜎02for-all𝑖\sigma_{0}^{2}+\sigma^{2}/m_{i}\approx\sigma_{0}^{2}\,\ \forall i (i.e., global parameters are sufficiently distant from each other in comparison to the noise in the local parameters) we obtainμ^0=1L​∑i=1L1mi​∑j,lBi​lj​vj​l,σ^2=1N−L​∑i=1L(∑j,lBi​lj​vj​l2−(∑j,lBi​lj​vj​l)2mi),σ^02=1L​∑i=1L(∑j,lBi​lj​vj​lmi−μ^0)2−∑i=1Lσ^2mi,\begin{split}&\hat{\mu}_{0}=\frac{1}{L}\sum_{i=1}^{L}\frac{1}{m_{i}}\sum_{j,l}B_{il}^{j}v_{jl},\quad\hat{\sigma}^{2}=\frac{1}{N-L}\sum_{i=1}^{L}\left(\sum_{j,l}B_{il}^{j}v_{jl}^{2}-\frac{(\sum_{j,l}B_{il}^{j}v_{jl})^{2}}{m_{i}}\right),\\&\hat{\sigma}_{0}^{2}=\frac{1}{L}\sum_{i=1}^{L}\left(\frac{\sum_{j,l}B_{il}^{j}v_{jl}}{m_{i}}-\hat{\mu}_{0}\right)^{2}-\sum_{i=1}^{L}\frac{\hat{\sigma}^{2}}{m_{i}},\end{split}
46
+
47
+ where N=∑jLj𝑁subscript𝑗subscript𝐿𝑗N=\sum_{j}L_{j} is the total number of observed local parameters. The result may be verified by setting corresponding derivatives of eq. (10) + ∑j,llog⁡hσ​(vj​l)subscript𝑗𝑙subscriptℎ𝜎subscript𝑣𝑗𝑙\sum_{j,l}\log h_{\sigma}(v_{jl}) to 0 and solving the system of equations. Derivations are long but straightforward. Given assignments B𝐵B, our example reduces to a hierarchical Gaussian model – see Section 5.4 of Gelman et al. [16] for analogous hyperparameter derivations. Finally we obtainθi=μ0​σ2+σ02​∑j,lBi​lj​vj​lσ2+mi​σ02.subscript𝜃𝑖subscript𝜇0superscript𝜎2superscriptsubscript𝜎02subscript𝑗𝑙superscriptsubscript𝐵𝑖𝑙𝑗subscript𝑣𝑗𝑙superscript𝜎2subscript𝑚𝑖superscriptsubscript𝜎02\theta_{i}=\frac{\mu_{0}\sigma^{2}+\sigma_{0}^{2}\sum_{j,l}B_{il}^{j}v_{jl}}{\sigma^{2}+m_{i}\sigma_{0}^{2}}.For completeness we provide cost expression corresponding to eq. (9): Ci​lj0=subscriptsuperscript𝐶subscript𝑗0𝑖𝑙absentC^{j_{0}}_{il}={2​log⁡mi∖j0α+J−1−mi∖j0+log⁡mi∖j0+σ2σ021+mi∖j0+σ2σ02+(μ0σ02+vj0​lσ2+∑j≠j0,lBi​lj​vj​lσ2)2​σ21+mi∖j0+σ2σ02−(μ0σ02+∑j≠j0,lBi​lj​vj​lσ2)2​σ2mi∖j0+σ2σ02,2​log⁡α​γ0(α+J−1)​(i−L∖j0)+log⁡σ2σ02+σ2+(μ0/σ02+vj0​l/σ2)2​σ21+σ2/σ02−μ02σ02,cases2superscriptsubscript𝑚𝑖subscript𝑗0𝛼𝐽1superscriptsubscript𝑚𝑖subscript𝑗0superscriptsubscript𝑚𝑖subscript𝑗0superscript𝜎2superscriptsubscript𝜎021superscriptsubscript𝑚𝑖subscript𝑗0superscript𝜎2superscriptsubscript𝜎02superscriptsubscript𝜇0superscriptsubscript𝜎02subscript𝑣subscript𝑗0𝑙superscript𝜎2subscript𝑗subscript𝑗0𝑙superscriptsubscript𝐵𝑖𝑙𝑗subscript𝑣𝑗𝑙superscript𝜎22superscript𝜎21superscriptsubscript𝑚𝑖subscript𝑗0superscript𝜎2superscriptsubscript𝜎02superscriptsubscript𝜇0superscriptsubscript𝜎02subscript𝑗subscript𝑗0𝑙superscriptsubscript𝐵𝑖𝑙𝑗subscript𝑣𝑗𝑙superscript𝜎22superscript𝜎2superscriptsubscript𝑚𝑖subscript𝑗0superscript𝜎2superscriptsubscript𝜎02otherwise2𝛼subscript𝛾0𝛼𝐽1𝑖subscript𝐿subscript𝑗0superscript𝜎2superscriptsubscript𝜎02superscript𝜎2superscriptsubscript𝜇0superscriptsubscript𝜎02subscript𝑣subscript𝑗0𝑙superscript𝜎22superscript𝜎21superscript𝜎2superscriptsubscript𝜎02superscriptsubscript𝜇02superscriptsubscript𝜎02otherwise\begin{cases}2\log\frac{m_{i}^{\setminus j_{0}}}{\alpha+J-1-m_{i}^{\setminus j_{0}}}+\log\frac{m_{i}^{\setminus j_{0}}+\frac{\sigma^{2}}{\sigma_{0}^{2}}}{1+m_{i}^{\setminus j_{0}}+\frac{\sigma^{2}}{\sigma_{0}^{2}}}+\frac{\left(\frac{\mu_{0}}{\sigma_{0}^{2}}+\frac{v_{j_{0}l}}{\sigma^{2}}+\sum_{j\neq j_{0},l}B_{il}^{j}\frac{v_{jl}}{\sigma^{2}}\right)^{2}\sigma^{2}}{1+m_{i}^{\setminus j_{0}}+\frac{\sigma^{2}}{\sigma_{0}^{2}}}-\frac{\left(\frac{\mu_{0}}{\sigma_{0}^{2}}+\sum_{j\neq j_{0},l}B_{il}^{j}\frac{v_{jl}}{\sigma^{2}}\right)^{2}\sigma^{2}}{m_{i}^{\setminus j_{0}}+\frac{\sigma^{2}}{\sigma_{0}^{2}}},&\\2\log\frac{\alpha\gamma_{0}}{(\alpha+J-1)(i-L_{\setminus j_{0}})}+\log\frac{\sigma^{2}}{\sigma_{0}^{2}+\sigma^{2}}+\frac{(\mu_{0}/\sigma_{0}^{2}+v_{j_{0}l}/\sigma^{2})^{2}\sigma^{2}}{1+\sigma^{2}/\sigma_{0}^{2}}-\frac{\mu_{0}^{2}}{\sigma_{0}^{2}},&\end{cases}(11)where first case is for i≤L∖j0𝑖subscript𝐿subscript𝑗0i\leq L_{\setminus j_{0}} and second is for L∖j0<i≤L∖j0+Ljsubscript𝐿subscript𝑗0𝑖subscript𝐿subscript𝑗0subscript𝐿𝑗L_{\setminus j_{0}}<i\leq L_{\setminus j_{0}}+L_{j}.
48
+
49
+ While the exponential family hyperparameter objective function (10) is too general to be tractable, the consistency of the hyperparameter estimates can be analyzed for specific choices of distributional families. Following the specialization to Gaussian distributions in Section 4.1, the following result establishes that the closed-form hyperparameter estimates are consistent in the case of Gaussian priors, subject to the assignments B𝐵B being correct.
50
+
51
+ We begin with a correctness verification of our inference procedure via a simulated experiment. We randomly sample L=50𝐿50L=50 global centroids θi∈ℝ50subscript𝜃𝑖superscriptℝ50\theta_{i}\in\mathbb{R}^{50} from a Gaussian distribution θi∼𝒩​(μ0,σ02​𝐈)similar-tosubscript𝜃𝑖𝒩subscript𝜇0superscriptsubscript𝜎02𝐈\theta_{i}\sim\mathcal{N}(\mu_{0},\sigma_{0}^{2}\mathbf{I}). We then simulate j=1,…,J𝑗1…𝐽j=1,\ldots,J heterogeneous datasets by picking a random subset of global centroids and adding white noise with variance σ2superscript𝜎2\sigma^{2} to obtain the “true” local centroids, {vj​l}l=1Ljsuperscriptsubscriptsubscript𝑣𝑗𝑙𝑙1subscript𝐿𝑗\{v_{jl}\}_{l=1}^{L_{j}} (following generative process in Section 3 with Gaussian densities). Then each dataset is sampled from a Gaussian mixture model with the corresponding set of centroids. We want to estimate global centroids and parameters μ0,σ02,σ2subscript𝜇0superscriptsubscript𝜎02superscript𝜎2\mu_{0},\sigma_{0}^{2},\sigma^{2}. We consider two basic baselines: k-means clustering of all datasets pooled into one (k-means pooled) and k-means clustering of local centroid estimates (this can be seen as another form of parameter aggregation - i.e. k-means “matching”). Both, unlike SPAHM, enjoy access to true L𝐿L.
52
+
53
+ To obtain local centroid estimates for SPAHM and k-means “matching”, we run (another) k-means on each of the simulated datasets. Additionally to quantify how local estimation error may effect our approach, we compare to SPAHM using true data generating local centroids. To measure the quality of different approaches we evaluate Hausdorff distance between the estimates and true data generating global centroids. This experiment is presented in Figures 2 and 2. White noise variance σ𝜎\sigma implies degree of heterogeneity across J=20𝐽20J=20 datasets and as it grows the estimation problem becomes harder, however SPAHM degrades more gracefully than baselines. Fixing σ2=1superscript𝜎21\sigma^{2}=1 and varying number of datasets J𝐽J may make the problem harder as there is more overlap among the datasets, however SPAHM is able to maintain low estimation error.We empirically verify hyperparameter estimation quality in Supplement D.
54
+
55
+ We present a practical scenario where problem similar to our simulated experiment arises — learning Gaussian topic models [7] where local topic models are learned from the Gutenberg dataset comprising 40 books. We then build the global topic model using SPAHM. We use basic k-means with k=25𝑘25k=25 to cluster word embeddings of words present in a book to obtain local topics and then apply SPAHM resulting in 155 topics. We compare to the Gibbs sampler of Das et al. [7] in terms of the UCI coherence score [28], −2.12.1-2.1 for SPAHM and −4.64.6-4.6 for [7], where higher is better. Besides, [7] took 16 hours to run 100 MCMC iterations while SPAHM + k-means takes only 40 seconds, over 140014001400 times faster. We present topic interpretation in Fig. 3 and defer additional details to Supplement F.
56
+
57
+ We next demonstrate the effectiveness of our approach on the task of temperature prediction using Sparse Gaussian Processes (SGPs) [1]. For this task, we utilize the GSOD data available from the National Oceanic and Atmospheric Administration222https://data.noaa.gov/dataset/dataset/global-surface-summary-of-the-day-gsod containing the daily global surface weather summary from over 9000 stations across the world. We limit the geography of our data to the United States alone and also filter the observations to the year 2015 and after. We further select the following 7 features to create the final dataset - date (day, month, year), latitude, longitude, and elevation of the weather stations, and the previous day’s temperature. We consider states as datasets of wheather stations observations.
58
+
59
+ We proceed by training SGPs on each of the 50 states data and evaluate it on the test set consisting of a random subset drawn from all states. Such locally trained SGPs do not generalize well beyond their own region, however we can apply SPAHM to match local inducing points along with their response values and pass it back to each of the states. Using inducing points found by SPAHM, local GPs gain ability to generalize across the continent while maintaining comparable fit on its own test data (i.e. test data sampled only from a corresponding state). We summarize the results across 10 experiment repetitions in Table 1. In addition, we note that Bauer et al. [1] previously showed that increasing number of inducing inputs tends to improve performance. To ensure this is not the reason for strong performance of SPAHM we also compare to local SGPs trained with 300 inducing points each.
60
+
61
+ Next, we consider the problem of discovering common structure in collections of related MoCAP sequences collected from the CMU MoCap database (http://mocap.cs.cmu.edu). We used a curated subset [14] of the data from two different subjects each providing three sequences. This subset comes with human annotated labels which allow quantitative comparisons. We performed our experiments on this annotated subset. For each subject, we trained an independent ‘sticky’ HDP-HMM [13] with Normal Wishart likelihoods. We used memoized variational inference [24] with random restarts and merge moves to alleviate local optima issues (see Supplement E for details about parameter settings and data pre-processing). The trained models discovered nine states for the first subject and thirteen for the second. We then used SPAHM to match local HDP-HMM states across subjects and recovered fourteen global states. The matching was done on the basis of the posterior means of the local states.
62
+
63
+ The matched states are visualized in Figure 4 (right) and additional visualizations are available in Supplement E.3. We find that SPAHM correctly recognizes similar activities across subjects. It also creates singleton states when there are no good matches. For instance, “up-downs”, an activity characterized by distinct motion patterns is only performed by the second subject. We correctly do not match it with any of the activities performed by the first subject. The figure also illustrates a limitation of our procedure wherein poor local states can lead to erroneous matches. Global states five and six are a combination of “toe-touches” and “twists”. State five combines exaggerated motions to the right while state six is a combination of states with motions to the left. Although the toe-touch activities exhibit similar motions, the local HDP-HMM splits them into different local states. Our matching procedure only allows local states to be matched across subjects and not within. As a result, they get matched to oversegmented “twists” with similar motions.
64
+
65
+ We also quantified the quality of the matched solutions using normalized hamming distance [14] and adjusted rand index [29]. We compare against local HDP-HMMs as well as two strong competitors, an identical sticky HDP-HMM model but trained on all six sequences jointly, and an alternate matching scheme based on k𝑘k-means clustering that clusters together states discovered by the individual HDP-HMMs. For k𝑘k-means, we set k𝑘k to the ground truth number of activities, twelve. The results are shown in Figure 4 (left).Quantitatively results show that SPAHM does nearly as well as the full HDP-HMM at less than half the amount of compute time. Note that SPAHM may be applied to larger amount of sequences, while full HDP-HMM is limited to small data sizes. We also outperform the k-means scheme despite cheating in its favor by providing it with the true number of labels.
66
+
67
+ This work presents a statistical model aggregation framework for combining heterogeneous local models of varying complexity trained on federated, private data sources. Our proposed framework is largely model-agnostic requiring only an appropriately chosen base measure, and our construction assumes only that the base measure belongs to the exponential family. As a result, our work can be applied to a wide range of practical domains with minimum adaptation. A possible interesting direction for future work will be to consider situations where local parameters are learned across datasets with a time stamp in addition to the grouping structure.
1911.00274v1.txt ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Text generation has been significantly improved with deep learning approaches in tasks such as language modeling (Bengio et al., 2003; Mikolov et al., 2010), machine translation (Sutskever et al., 2014; Bahdanau et al., 2015; Vaswani et al., 2017), and dialog generation (Sordoni et al., 2015).All these models include a softmax final layer to yield words.The softmax layer takes a context state (hℎh) from an upstream network such as RNN cells as the input,and transforms hℎh into the word probability with a linear projection (W⋅h⋅𝑊ℎW\cdot h) and an exponential activation.Each row of W𝑊W can be viewed as the embedding of a word.Essentially, softmax conducts embedding matching with inner-product scoring between a calculated context vector hℎh and word embeddings W𝑊W in the vocabulary.
2
+
3
+ The above commonly adopted setting for softmax imposes a strong hypothesis on the embedding space —it assumes that each word corresponds to a single vector andthe context vector hℎh from the decoding network must be indiscriminately close to the desired word embedding vectorin certain distance metric.We discover that such an assumption does not coincide with practical cases.Fig. 1 visualizes examples of the context vectors for utterances containing the examined words, calculated from the BERT model Devlin et al. (2019).We make three interesting observations.a) Multi-sense: Not every word’s context vectors form a single cluster. There are words with multiple clusters (Fig. 1b).b) Varying-variance: The variances of context vectors vary significantly across clusters. Some words correspond to smaller variances while others to larger variances (Fig. 1c).c) Robustness: There are outliers in the context space (Fig. 1b).These observations explain the ineffectiveness during training with the traditional softmax.The traditional way brings word embedding W𝑊W ill-centered with all context vectors of the same word – even though they might belong to multiple clusters.At the same time, the variances of different words are completely ignored in the plain softmax with inner-product as the similarity score.It is also vulnerable to outliers since a single anomally would lead the word embedding to be far from the main cluster.In short, the softmax layer doesn’t have sufficient expressiveness capacity.
4
+
5
+ Yang et al. (2018) propose Mixture-of-Softmax (MoS) to enhance the expressiveness of softmax.It replaces a single softmax layer with a weighted average of M𝑀M softmax layers. However, all words share the same fixed number of components M𝑀M and averaging weights, which heavily restrict MoS’s capacity. Furthermore, the variances of context vectors are not taken into the consideration.
6
+
7
+ In this paper, we propose KerBS, a novel approach to learn text embedding for generation.KerBS avoids the above softmax issues by introducing a Bayesian composition of multiple embeddings and a learnable kernel to measure the similarities among embeddings.Instead of a single embedding, KerBS explicitly represents a word with a weighted combination of multiple embeddings – each is regarded as a “sense”222Since there is no direct supervision, an embedding vector does not necessarily correspond to a semantic sense..The number of embeddings is automatically learned from the corpus as well.We design a family of kernel functions to replace the embedding matching (i.e. the matrix-vector dot-product) in softmax layer.With parameters learned from text, each word (or “sense”) can enjoy individual variance in its embedding space.In addition, the kernel family is more robust to outliers than Gaussian kernels.
8
+
9
+ We conduct experiments on a variety of text generation tasks including machine translation, language modeling, and dialog generation.The empirical results verify the effectiveness of KerBS.Ablation study indicates that each part of KerBS, including the Bayesian composition and the kernel function, is necessary for the performance improvement.We also find that words with more semantic meanings are allocated with more sense embeddings, which adheres to our intuition.
10
+
11
+ Word Embeddings.Word2Vec (Mikolov et al., 2013) and GloVe (Pennington et al., 2014) learn distributed word representations from corpus in an unsupervised way. However, only one embedding is assigned to each word, which not only suffers from ignoring polysemy but also could not provide context related word embeddings.Recent works (Alec Radford and Sutskever, 2018; Peters et al., 2018; Devlin et al., 2019) indicates that pre-trained contextualized word representations are beneficial for downstream natural language processing tasks. BERT (Devlin et al., 2019) pre-train a masked language model with a deep bidirectional Transformer and it achieves state-of-the-art performance in various NLP tasks.
12
+
13
+ Multi-Sense Word Embeddings.Early works obtain multi-sense word embeddings by first training single point word embeddings and then clustering the context embeddings (for example, the average embedding of neighbor words). But these methods are not scalable and take lots of efforts in parameter tuning (Reisinger and Mooney, 2010; Huang et al., 2012).Tian et al. (2014) introduce a probabilistic model, which uses a variable to control sense selection of each word. Liu et al. (2015) add a topic variable for each word, and condition word embeddings on the topic variable. Both of Tian et al. (2014) and Liu et al. (2015) can be easily integrated into Skip-Gram model (Mikolov et al., 2013), which is highly efficient.Other works (Chen et al., 2014; Jauhar et al., 2015; Chen et al., 2015; Wu and Giles, 2015) further improve the performance of multi-sense embeddings by making use of huge corpora such as WordNet Miller (1995) and Wikipedia.However, these works are mainly focused on text understanding rather than text generation.
14
+
15
+ Word Embedding as a Distribution.In order to represent the semantic breadth of each word, Vilnis and McCallum (2015) propose to map each word into a Gaussian distribution in the embedding space. Instead of using cosine similarity in Mikolov et al. (2013), Vilnis and McCallum (2015) use KL-divergence of the embedding distributions to measure the similarities between words.To improve the numerical stability of Gaussian word embeddings, especially when comparing very close or very distant distributions, Sun et al. (2018) propose to replace KL-divergence with Wasserstein distance.Though Gaussian word embeddings perform well in word-level tasks such as similarity and entailment detection, they cannot be directly applied to the scenario of text generation, because it is difficult to perform embedding matching between Gaussian word embeddings and output embeddings, which are usually single points in the embedding space.
16
+
17
+ Most text generation models generate words through an embedding matching procedure.Intuitively, at each step, upstream networks such as RNN decoders compute a context vector hℎhaccording to the encoded information from input and previously generated words.The context vector hℎh serves as a query to search for the most similar match from a pre-calculated vocabulary embeddings W𝑊W.In practice, this is implemented with an inner-product between W𝑊W and hℎh.Normalized probabilities over all words are computed with the softmax function.Words with the highest probabilities will be chosen during the inference process.
18
+
19
+ Specifically, given an utterance y^^𝑦\hat{y}, a GRU decoder calculates as follows:et=Lookup​(Wi​n,y^t−1),subscript𝑒𝑡Lookupsubscript𝑊𝑖𝑛subscript^𝑦𝑡1\displaystyle e_{t}=\textsc{Lookup}(W_{in},\hat{y}_{t-1}),(1)ht=GRU​(ht−1,et),subscriptℎ𝑡GRUsubscriptℎ𝑡1subscript𝑒𝑡\displaystyle h_{t}=\textsc{GRU}(h_{t-1},e_{t}),(2)P​(yt=i)=Softmax​(ht​W)i.𝑃subscript𝑦𝑡𝑖Softmaxsubscriptsubscriptℎ𝑡𝑊𝑖\displaystyle P(y_{t}=i)=\textsc{Softmax}(h_{t}W)_{i}.(3)At time step t𝑡t, its word embedding etsubscript𝑒𝑡e_{t} is obtained by looking up the previous output word in the word embedding matrix Wi​n=[w¯1,w¯2,…,w¯V]subscript𝑊𝑖𝑛subscript¯𝑤1subscript¯𝑤2…subscript¯𝑤𝑉W_{in}=[\bar{w}_{1},\bar{w}_{2},...,\bar{w}_{V}] (Eq. (1)).Here w¯isubscript¯𝑤𝑖\bar{w}_{i} is the embedding of the i𝑖i-th word in the vocabulary. V𝑉V is the vocabulary size.The context embedding htsubscriptℎ𝑡h_{t} of the t𝑡t-th step will be obtained from GRU by combining information of ht−1subscriptℎ𝑡1h_{t-1} and etsubscript𝑒𝑡e_{t} ( Eq. (2)). Other decoders such as Transformer Vaswani et al. (2017) work similary.
20
+
21
+ Eq. (3) performs embedding matching between htsubscriptℎ𝑡h_{t} and W𝑊W, and probabilities of words will be obtained by a softmax activation.Intuitively, to generate the correct word y^tsubscript^𝑦𝑡\hat{y}_{t}, the context embedding htsubscriptℎ𝑡h_{t} should lie in a small neighborhood around y^tsubscript^𝑦𝑡{\hat{y}_{t}}’s word embedding wy^tsubscript𝑤subscript^𝑦𝑡{w_{\hat{y}_{t}}}.
22
+
23
+ In this section, we first introduce KerBS for text generation.It is designed according to the three observations mentioned in the introduction: multi-sense, varying-variance, and robustness.Then we provide a training scheme to dynamically allocate senses since it is difficult to directly learn the number of senses of each word.
24
+
25
+ KerBS assumes that the space of context vectors for the same word consists of several geometrically separate components.Each component represents a “sense”, with its own variance.To better model their distribution, we replace Eq. (3) with the following equations:P​(yt=i)=∑j∈0,1,…,MiP​(st=⟨i,j⟩).𝑃subscript𝑦𝑡𝑖subscript𝑗01…subscript𝑀𝑖𝑃subscript𝑠𝑡𝑖𝑗\displaystyle P(y_{t}=i)=\sum_{j\in{0,1,...,M_{i}}}P(s_{t}=\langle i,j\rangle).(4)Here, stsubscript𝑠𝑡s_{t} is the sense index of the step t𝑡t.Its value takes ⟨i,j⟩𝑖𝑗\langle i,j\rangle corresponding to the j𝑗j-th sense of the i𝑖i-th word in vocabulary.Misubscript𝑀𝑖M_{i} is the number of senses for word i𝑖i, which may be different for different words.Instead of directly calculating the probabilities of words, KerBS first calculates the probabilities of all senses belonging to a word and then sums them up to get the word probability.
26
+
27
+ P(st=⟨i,j⟩)=Softmax([𝒦θ(ht,W)])ij=exp⁡(𝒦θij​(ht,wij))∑k∑r∈0,1,…,Mkexp⁡(𝒦θkr​(ht,wkr)).𝑃subscript𝑠𝑡𝑖𝑗Softmaxsuperscriptsubscriptdelimited-[]subscript𝒦𝜃subscriptℎ𝑡𝑊𝑖𝑗subscript𝒦superscriptsubscript𝜃𝑖𝑗subscriptℎ𝑡superscriptsubscript𝑤𝑖𝑗subscript𝑘subscript𝑟01…subscript𝑀𝑘subscript𝒦superscriptsubscript𝜃𝑘𝑟subscriptℎ𝑡superscriptsubscript𝑤𝑘𝑟\begin{split}P(&s_{t}=\langle i,j\rangle)=\textrm{Softmax}\big{(}[\mathcal{K}_{\theta}(h_{t},W)]\big{)}_{i}^{j}=\frac{\exp(\mathcal{K}_{\theta_{i}^{j}}(h_{t},{w}_{i}^{j}))}{\sum_{k}{\sum_{r\in{0,1,...,M_{k}}}\exp(\mathcal{K}_{\theta_{k}^{r}}(h_{t},{w}_{k}^{r}))}}.\end{split}(5)The probability of output sense stsubscript𝑠𝑡s_{t} in Eq. (5) is not a strict Gaussian posterior, as the training of Gaussian models in high dimensional space is numerical instable.Instead, we propose to use a carefully designed kernel function, to model the distribution variance of each sense.Concretely, we replace the inner product in Eq. (3) with kernel function 𝒦𝒦\mathcal{K}, which depends on a variance-related parameter θ𝜃\theta.[𝒦θ​(ht,W)]delimited-[]subscript𝒦𝜃subscriptℎ𝑡𝑊[\mathcal{K}_{\theta}(h_{t},W)] is a simplified notation containing all pairs of kernal values 𝒦θij​(ht,wij)subscript𝒦superscriptsubscript𝜃𝑖𝑗subscriptℎ𝑡superscriptsubscript𝑤𝑖𝑗\mathcal{K}_{\theta_{i}^{j}}(h_{t},{w}_{i}^{j}).With different θijsuperscriptsubscript𝜃𝑖𝑗\theta_{i}^{j} for each sense, we can model the variances of their distributions separately.
28
+
29
+ In this part, we introduce in detail how KerBS models the multi-sense property of words.Intuitively, we use Bayesian composition of embeddings in text generation, because the same word can have totally different meanings.For words with more than one sense, their corresponding context vectors can be usually divided into separate clusters (see Figure 1).If we use single-embedding models such as traditional softmax to fit these clusters, the word embedding will converge to the mean of these clusters and could be distant from all of them.This may lead to poor performance in text generation.
30
+
31
+ As shown in Eq. (4), we can allocate different embeddings for each sense. We first obtain the sense probabilities by performing weight matching between context vector hℎh and sense embedding matrix W𝑊{W}.Then we add up the sense probabilities belonging to each word to get word probabilities.
32
+
33
+ We adopt weight tying scheme (Inan et al., 2017), where the decoding embedding and the input embedding are shared.Since W𝑊W is a matrix of sense embeddings, it cannot be directly used in the decoding network for next step as in Eq. (1).Instead, we obtain embedding etsubscript𝑒𝑡e_{t} by calculating the weighted sum of sense embeddings according to their conditional probabilities. Assume that y^t=isubscript^𝑦𝑡𝑖\hat{y}_{t}=i is the input word at step t𝑡t,et=∑j∈[1,2,…,Mi]P​(st−1=⟨i,j⟩|y^[0:t−1])​wij,subscript𝑒𝑡subscript𝑗12…subscript𝑀𝑖𝑃subscript𝑠𝑡1conditional𝑖𝑗subscript^𝑦delimited-[]:0𝑡1superscriptsubscript𝑤𝑖𝑗\displaystyle e_{t}=\sum_{j\in[1,2,...,M_{i}]}{P(s_{t-1}=\langle i,j\rangle|\hat{y}_{[0:t-1]})\ w_{i}^{j}},(6)P​(st−1=⟨i,j⟩|y^[0:t−1])=P​(st−1=⟨i,j⟩|y^[0:t−2])∑k∈[1,2,…,Mi]P​(st−1=⟨i,k⟩|y^[0:t−2]).𝑃subscript𝑠𝑡1conditional𝑖𝑗subscript^𝑦delimited-[]:0𝑡1𝑃subscript𝑠𝑡1conditional𝑖𝑗subscript^𝑦delimited-[]:0𝑡2subscript𝑘12…subscript𝑀𝑖𝑃subscript𝑠𝑡1conditional𝑖𝑘subscript^𝑦delimited-[]:0𝑡2\displaystyle P(s_{t-1}=\langle i,j\rangle|\hat{y}_{[0:t-1]})=\frac{P(s_{t-1}=\langle i,j\rangle|\hat{y}_{[0:t-2]})}{\sum_{k\in[1,2,...,M_{i}]}P(s_{t-1}=\langle i,k\rangle|\hat{y}_{[0:t-2]})}.(7)
34
+
35
+ To calculate the probability of each sense, it is very straightforward to introduce Gaussian distributions in the embedding space.However, it is difficult to learn a Gaussian distribution for embeddings in high dimensional space for the following reasons.Context vectors are usually distributed in low dimensional manifolds embedded in a high dimensional space.Using an iostropic Gaussian distribution to model embedding vectors in low dimensional manifolds may lead to serious instability.Assume in a d𝑑d-dimensional space, the distribution of Hisubscript𝐻𝑖H_{i} follows N​(0,σ1)𝑁0subscript𝜎1N(0,\sigma_{1}) in a d1subscript𝑑1d_{1}-dimensional subspace.We build a model N​(0,σ)𝑁0𝜎N(0,\sigma) to fit the embedding points.But there are often some noisy outliers, which are assumed to distribute uniformly in a cube with edge length 1 and centered at the origin.Then the average square distance between an outlier and the origin is d12𝑑12\frac{d}{12}, which increases linearly with d𝑑d.The log\log-likelihood to maximize can be written as:ℒ=∑x∈Xlog⁡((2​π​σ)−d​exp⁡(−∑i∈1,2,…,dxi22​σ2))=∑x∈X(−d​log⁡(2​π​σ)−∑i∈1,2,…,dxi22​σ2),ℒsubscript𝑥𝑋superscript2𝜋𝜎𝑑subscript𝑖12…𝑑superscriptsubscript𝑥𝑖22superscript𝜎2subscript𝑥𝑋𝑑2𝜋𝜎subscript𝑖12…𝑑superscriptsubscript𝑥𝑖22superscript𝜎2\begin{split}\mathcal{L}=&\sum_{x\in X}\log((\sqrt{2\pi}\sigma)^{-d}\exp(-\frac{\sum_{i\in{1,2,...,d}}x_{i}^{2}}{2\sigma^{2}}))=\sum_{x\in X}(-d\log(\sqrt{2\pi}\sigma)-\frac{\sum_{i\in{1,2,...,d}}x_{i}^{2}}{2\sigma^{2}}),\end{split}(8)where X𝑋X is the set of data points including outliers. Denote the proportion of outliers in X𝑋X as α𝛼\alpha. Since 𝔼​(∑i∈1,2,…,dxi2)𝔼subscript𝑖12…𝑑superscriptsubscript𝑥𝑖2\mathbb{E}(\sum_{i\in{1,2,...,d}}x_{i}^{2}) equals d1subscript𝑑1d_{1} for points generated by the oracle and d12𝑑12\frac{d}{12} for outliers, ℒℒ\mathcal{L} is dominated by outliers when d𝑑d is large. The optimal σ𝜎\sigma approximately equals to α​d12+(1−α)​d​σ1d𝛼𝑑121𝛼𝑑subscript𝜎1𝑑\sqrt{\frac{\frac{\alpha d}{12}+(1-\alpha)d\sigma_{1}}{d}}. With large d𝑑d, optimal σ≈α12𝜎𝛼12\sigma\approx\sqrt{\frac{\alpha}{12}}, which is independent of real variance σ1subscript𝜎1\sigma_{1}.As expected, we find that directly modeling the Gaussian distributions does not work well in our preliminary experiments.
36
+
37
+ Therefore we design a kernel function to model embedding variances, which can be more easily learned compared with Gaussian mixture model.Specifically, we replace the inner product ℐ​(h,e)=c​o​s​(h,e)​|h|​|e|ℐℎ𝑒𝑐𝑜𝑠ℎ𝑒ℎ𝑒\mathcal{I}(h,e)=cos(h,e)|h||e|, which can be regarded as a fixed kernel around whole space, with a kernel function𝒦θ​(h,e)=|h|​|e|​(a​exp⁡(−θ​c​o​s​(h,e))−a).subscript𝒦𝜃ℎ𝑒ℎ𝑒𝑎𝜃𝑐𝑜𝑠ℎ𝑒𝑎\begin{split}\mathcal{K}_{\theta}(h,e)=|h|\,|e|\,(a\exp(-\theta\ cos(h,e))-a).\end{split}(9)Here θ𝜃\theta is a parameter controlling the embedding variances of each sense and a=−θ2(exp(−θ)+θ−1))a=\frac{-\theta}{2(\exp(-\theta)+\theta-1))} is a normalization factor. When θ→0→𝜃0\theta\to 0, 𝒦θ​(h,e)→ℐ​(h,e)→subscript𝒦𝜃ℎ𝑒ℐℎ𝑒\mathcal{K}_{\theta}(h,e)\to\mathcal{I}(h,e), which degenerates to common inner product.As shown in Figure 2, with a small θ𝜃\theta, embeddings are concentrated on a small region, while a large θ𝜃\theta leads to a flat kernel.Finally, parameters for the i𝑖i-th word could be:{[wi1,θi1],[wi2,θi2]​⋯​[wiMi,θiMi]}superscriptsubscript𝑤𝑖1superscriptsubscript𝜃𝑖1superscriptsubscript𝑤𝑖2superscriptsubscript𝜃𝑖2⋯superscriptsubscript𝑤𝑖subscript𝑀𝑖superscriptsubscript𝜃𝑖subscript𝑀𝑖\{[{w}_{i}^{1},\theta_{i}^{1}],[{w}_{i}^{2},\theta_{i}^{2}]\cdots[{w}_{i}^{M_{i}},\theta_{i}^{M_{i}}]\}, where wijsuperscriptsubscript𝑤𝑖𝑗{w}_{i}^{j} and θijsuperscriptsubscript𝜃𝑖𝑗\theta_{i}^{j} are the embedding and kernel parameter of sense ⟨i,j⟩𝑖𝑗\langle i,j\rangle.Intuitively, in the original space with inner product similarity, the density of probability mass is uniformly distributed.But 𝒦𝒦\mathcal{K} distorts the probabilistic space, making the variances of context vectors differ over different senses.
38
+
39
+ Since∂log⁡𝒦θ​(h,e)∂θ=1a​∂a∂θ−c​o​s​(h,e)​e​x​p​(−θ​c​o​s​(h,e))exp⁡(−θ​c​o​s​(h,e))−1,subscript𝒦𝜃ℎ𝑒𝜃1𝑎𝑎𝜃𝑐𝑜𝑠ℎ𝑒𝑒𝑥𝑝𝜃𝑐𝑜𝑠ℎ𝑒𝜃𝑐𝑜𝑠ℎ𝑒1\begin{split}\frac{\partial\log\mathcal{K}_{\theta}(h,e)}{\partial\theta}=\frac{1}{a}\frac{\partial a}{\partial\theta}-\frac{cos(h,e)exp(-\theta cos(h,e))}{\exp(-\theta cos(h,e))-1},\end{split}(10)the gradient of each hℎh is bounded for fixed θ𝜃\theta. It results from the continuity of c​o​s​(h,e)​e​x​p​(−θ​c​o​s​(h,e))exp⁡(θ​c​o​s​(h,e))−1𝑐𝑜𝑠ℎ𝑒𝑒𝑥𝑝𝜃𝑐𝑜𝑠ℎ𝑒𝜃𝑐𝑜𝑠ℎ𝑒1\frac{cos(h,e)exp(-\theta cos(h,e))}{\exp(\theta cos(h,e))-1} when c​o​s​(h,e)≠0𝑐𝑜𝑠ℎ𝑒0cos(h,e)\neq 0 and the fact that c​o​s​(h,e)​e​x​p​(−θ​c​o​s​(h,e))exp⁡(θ​c​o​s​(h,e))−1→1θ→𝑐𝑜𝑠ℎ𝑒𝑒𝑥𝑝𝜃𝑐𝑜𝑠ℎ𝑒𝜃𝑐𝑜𝑠ℎ𝑒11𝜃\frac{cos(h,e)exp(-\theta cos(h,e))}{\exp(\theta cos(h,e))-1}\to\frac{1}{\theta}, when c​o​s​(h,e)→0→𝑐𝑜𝑠ℎ𝑒0cos(h,e)\to 0.As a result, a small proportion of outliers or noise points will not have a major impact on training stability.
40
+
41
+ It is difficult to empirically determine the sense numbers of each word, which is a very large set of hyper-parameters. Also, properties of the same word may vary among different corpora and tasks.So we design a training scheme for KerBS, which includes dynamic sense allocation. Instead of providing the sense number for each word, we only need to input the total sense number. The algorithm will automatically allocate senses.
42
+
43
+ Details of the training scheme are shown in Algorithm 1.Specifically, to obtain parameters for both KerBS and upstream network fϕsubscript𝑓italic-ϕf_{\phi}, which outputs the context vectors, the whole process consists of allocation and adaptation phases.Before training, W𝑊W and θ𝜃\theta are initialized by a random matrix and a random vector respectively. We randomly allocate Ms​u​msubscript𝑀𝑠𝑢𝑚M_{sum} senses to words.After initialization, we first turn to the adaptation phase. Given a sequence y^^𝑦\hat{y} in training set, at step t𝑡t, we get the context vector htsubscriptℎ𝑡h_{t} from fϕsubscript𝑓italic-ϕf_{\phi}. Then sense and word probabilities are calculated by Eq. (4) and Eq. (5), respectively. Afterwards, we calculate the log-probability ℒℒ\mathcal{L} of generating y^tsubscript^𝑦𝑡\hat{y}_{t}. And we maximize ℒℒ\mathcal{L} by tuning W𝑊W, θ𝜃\theta and ϕitalic-ϕ\phi:ℒ=∑tlog⁡(P​(yt=y^t|y^[0:t−1];W,θ,ϕ)).ℒsubscript𝑡𝑃subscript𝑦𝑡conditionalsubscript^𝑦𝑡subscript^𝑦delimited-[]:0𝑡1𝑊𝜃italic-ϕ\mathcal{L}=\sum_{t}\log(P(y_{t}=\hat{y}_{t}|\hat{y}_{[0:t-1]};W,\theta,\phi)).(11)During the adaption phase, KerBS learns wijsuperscriptsubscript𝑤𝑖𝑗{w}_{i}^{j}, the sense embedding vector, and θijsuperscriptsubscript𝜃𝑖𝑗\theta_{i}^{j}, the indicator of distribution variance.
44
+
45
+ During the allocation phase, we remove redundant senses and reallocate them to poorly predicted words.To determine senses to remove and words which need more senses, we record the moving average of each word’s log prediction accuracy log⁡P𝑃\log P and sense usage U𝑈U:log⁡Pi←(1−β)​log⁡Pi+log⁡(P​(yt=i))​𝟙i=y^t←subscript𝑃𝑖1𝛽subscript𝑃𝑖𝑃subscript𝑦𝑡𝑖subscript1𝑖subscript^𝑦𝑡\displaystyle\log P_{i}\leftarrow(1-\beta)\log P_{i}+\log(P(y_{t}=i))\mathbbm{1}_{{i=\hat{y}_{t}}}(12)Uij←(1−β)​Uij+β​P​(st=⟨i,j⟩)​𝟙i=y^t←superscriptsubscript𝑈𝑖𝑗1𝛽superscriptsubscript𝑈𝑖𝑗𝛽𝑃subscript𝑠𝑡𝑖𝑗subscript1𝑖subscript^𝑦𝑡\displaystyle{U_{i}^{j}}\leftarrow(1-\beta){U_{i}^{j}}+\beta P({s}_{t}=\langle i,j\rangle)\mathbbm{1}_{{i=\hat{y}_{t}}}(13)where β𝛽\beta is the updating rate.For a word i𝑖i, if after several epochs l​o​g​P𝑙𝑜𝑔𝑃logP is consistently lower than a threshold ϵitalic-ϵ\epsilon, we think that the senses currently allocated to i𝑖i is not enough. Then we delete the least used sense and reallocate it to i𝑖i.We alternatively perform adaption and reallocation until convergence.
46
+
47
+ In this part, we explain why KerBS has the ability to learn the complex distributions of context vectors. We only give a brief introduction to the following lemmas and leave more detailed proofs in the appendix.
48
+
49
+ Each cluster of word i𝑖i’s context vectors attracts i𝑖i’s KerBS sense embeddings, in order to draw these embeddings nearer to increase ℒℒ\mathcal{L}. However, if a cluster has already been represented by a KerBS sense, its attractions to embeddings of other senses get weaker. So they will converge to other clusters. Instead of gathering together in a few clusters, senses will try to represent as many clusters of context vectors’ distribution as possible.∎
50
+
51
+ The optimized θ𝜃\theta is a solution of equation ∂ℒ∂θ=0ℒ𝜃0\frac{\partial\mathcal{L}}{\partial\theta}=0. We only need to explain that, when the variance of hℎh grows, the solution of the equation gets larger.∎
52
+
53
+ In this section, we empirically validate the effectiveness of KerBS.We will first set up the experiments, and then give the experimental results in Section 5.2.
54
+
55
+ We test KerBS on several text generation tasks, including:•Machine Translation (MT) is conducted on IWSLT’16 De→→\rightarrowEn, which contains 196k pairs of sentences for training.•Language modeling (LM) is included to test the unconditional text generation performance.Following previous work, we use a 300k, 10k and 30k subset of One-Billion-Word Corpus for training, validating and testing, respectively.•Dialog generation (Dialog) is also included. We employ the DailyDialog dataset from Li et al. (2017) for experiment, by deleting the overlapping of train and test sets in advance.
56
+
57
+ Note that these text generation tasks emphasize on different sides.MT is employed to test the ability of semantic transforming across bilingual corpus.LM is included to test whether KerBS can generally help generate more fluent sentences.Dialog generation even needs some prior knowledge to generate good responses, which is the most challenging task.
58
+
59
+ For LM, we use Perplexity (PPL) to test the performance.For MT and Dialog, we measure the generation quality with BLEU-4 and BLEU-1 scores (Papineni et al., 2002).Human evaluation is also included for Dialog.During human evaluation, 3 volunteers are requested to label Dialog data containing 50 sets of sentences.Each set contains the input sentences as well as output responses generated by KerBS and baseline models.Volunteers are asked to score the responses according to their fluency and relevance to the corresponding questions. (See detailed scoring in the appendix.)After responses are labeled, we calculate the average score of each method.Then a t-test is performed to reject the hypothesis that KerBS is not better than the baseline methods.
60
+
61
+ For LM, we use GRU language model (Chung et al., 2014) as our testbed. We try different sets of parameters, including RNN layers, hidden sizes and embedding dimensions.The model that performs best with traditional softmax is chosen as the baseline.
62
+
63
+ For MT and Dialog, we implement the attention-based sequence to sequence model (Seq2Seq, (Bahdanau et al., 2015)) as well as Transformer (Vaswani et al., 2017) as our baselines.For Seq2Seq, (hidden size, embedding dimension) are set to(512, 256) and (1024, 512), respectively.And For Transformer, (hidden size, embedding dim, dropout, layer num, head num) is set to (288, 507, 0.1, 5, 2) for both MT and Dialog, following Lee et al. (2018). All models are trained on sentences with up to 80 words. We set the batch size to 128 and the beam size to 5 for decoding. For both German and English, we first tokenize sentences into tokens by Moses tokenizer (Koehn et al., 2007). Then BPE (Sennrich et al., 2016) is applied to segment each word into subwords.
64
+
65
+ Adam (Kingma and Ba, 2014) is adopted as our optimization algorithm. We start to decay the learning rate when the loss on validation set stops to decrease. For LM, we set the initial learning rate to 1.0, and the decay rate to 0.8. For MT and Dialog, the initial learning rate is 5e-4 and the decay rate is 0.5.
66
+
67
+ We list the results of using KerBS in Table 1 and 2. Then we give some analysis.
68
+
69
+ Machine TranslationFor machine translation, KerBS achieves higher BLEU-4 scores on Seq2Seq(+1.37) and Transformer(+1.29). However, the performance gain of MoS is not significant, and it is not even as good as vanilla Transformer model.Cases of MT on Transformer are shown in Table 3.
70
+
71
+ Language ModelAs expected, KerBS achieves lower PPL (102.17) on LM compared with both MoS (102.72) and traditional softmax (103.12). Although it introduces more parameters, KerBS does not lead to overfitting. On the contrary, the increased complexity in KerBS helps the model to better capture the information of the embedding space.
72
+
73
+ Dialogue GenerationWe also include results of dialog generation.Unlike tasks where source and target sentences are highly aligned,dialog generation may need some prior knowledge for obtaining good responses.Moreover, the multi-modality of the generated sentences is a serious problem in Dialog. We expect that much expressive structure of KerBS could help. Since the performance of Transformer is not comparable to Seq2Seq on Dialog generation, we will focus on Seq2Seq in this part. KerBS achieves a BLEU-1 score of 17.85 on test set, which is remarkable compared with the baselines.Human evaluations also confirm the effectiveness of using KerBS in dialog generation.After performing a one-tailed hypothesis test, we find that the p-value is lower than 0.05, which means that the obtained improvements on Dialog systems are nontrivial.We list some of the generated responses of different models in Table 4.
74
+
75
+ We perform ablation study of three variants of KerBS on the MT task. KerBS w/o kernel removes the kernel function from KerBS, so that distribution variances are no longer explicitly controlled. We find that it loses 0.49 BLEU scores compared with original KerBS, which indicates that to explicitly express distribution variances of hidden states is important and KerBS works well in doing so (Table 5).KerBS with single sense replaces the multi-sense model with single-sense one, which also leads to performance decline.This further confirms our assumption that the distribution of context vectors is multi-modal.In such cases, the output layer should also be multi-modal.In KerBS w/o dynamic allocation, each word is allocated with a fixed number of senses. Though it still performs better than single sense models, it is slightly worse than full KerBS model, which shows the necessity of dynamic allocation.
76
+
77
+ In this part, we verify that KerBS learns reasonable sense number M𝑀M and variance parameter θ𝜃\theta by examples. And we have the following conclusions.
78
+
79
+ Firstly, KerBS can learn the multisense property. From Table 6, we find that words with a single meaning, including some proper nouns, are allocated with only one sense. But for words with more complex meanings, such as pronouns, more senses are necessary to represent them. (In our experiment, we restrict each word’s sense number between 1 and 4, in order to keep the training stable.) In addition, we find that words with 4 senses have several distinct meanings. For instance, ”change” means transformation as well as small currency.
80
+
81
+ Secondly, θ𝜃\theta in KerBS is an indicator for words’ semantic scopes. In figure 3 we compare the θ𝜃\theta of 3 sets of nouns. For each set of them, we find words denoting bigger concepts (such as car, animal and earth) have larger θ𝜃\theta.
82
+
83
+ Compared with baselines, the computation cost of incorporating KerBS into text generation mainly lies with the larger vocabulary for embedding matching, which is only a portion of the whole computation of text generation.Empirically, when we set the total sense number to about 333 times the vocabulary size, KerBS takes twice as long as vanilla softmax for one epoch.
84
+
85
+ Text generation requires a proper embedding space for words.In this paper, we proposed KerBS to learn better embeddings for text generation.Unlike traditional Softmax, KerBS includes a Bayesian composition of multi-sense embedding for words and a learnable kernel to capture the similarities between words.Incorporating KerBS into text generation could boost the performance of several text generation tasks, especially the dialog generation task.Future work includes proposing better kernels for generation and designing a meta learner to dynamically reallocate senses.
86
+
87
+ We would like to thank Xunpeng Huang and Yitan Li for helpful discussion and review of the first version.We also wish to thank the anonymous reviewers for their insightful comments.
1911.00292v1.txt ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ In many real-world applications, including finance, computational biology, social-network studies, criminology, and epidemiology, it is important to gain insight from the interactions of multivariate time series of discrete events.For example,in finance, changes in the price of a stock might affect the market [4];and in epidemiology, individuals infected by an infectious disease might spread the disease to their neighbors [15].Such networks of time series often exhibit mutually exciting patterns of diffusion.Hence, a recurring issue is to learn in an unsupervised way the causal structure of interacting networks. This task is usually tackled by defining a so-called causal graph of entities where an edge from a node i𝑖i to a node j𝑗j means that events in node j𝑗j depend on the history of node i𝑖i. Such causal interactions are typically learned with either directed information [24, 23], transfer entropy [26], or Granger causality [2, 11].
2
+
3
+ A widely used model for capturing mutually exciting patterns in a multi-dimensional time series is the Multivariate Hawkes process (MHP), a particular type of temporal point process where an event in one dimension can affect future arrivals in other dimensions. It has been shown that learning the excitation matrix of an MHP encodes the causal structure between the processes, both in terms of Granger causality [12] and directed information [13].Most studies focus on the scalability of MHPs to large datasets.However, in many applications, data can be very expensive to collect, or simply not available.For example, in economic and public health studies, collecting survey data is usually an expensive process.Similarly, in the case of epidemic modeling, it is critical to learn as fast as possible the patterns of diffusion of a spreading disease.As a result, the amount of data available is intrinsically limited.MHPs are known to be sensitive to the amount of data used for training, and the excitation patterns learned by MHPs from short sequences can be unreliable [29].In such settings, the likelihood becomes noisy and regularization becomes critical.Nevertheless, as most hyper-parameter tuning algorithms such as grid search, random search, and even Bayesian optimization become challenging when the number of hyper-parameters is large, state-of-the-art methods only parameterize regularizers by a single shared hyper-parameter, hence limiting the power of representation of the model.
4
+
5
+ In this work, we address both the small data and hyper-parameter tuning issues by considering the parameters of the model as latent variables and by developing an efficient algorithm based on variational expectation-maximization.By estimating the evidence – rather than the likelihood – the proposed approach is able to optimize, with minimal computational complexity, over an extended set of hyper-parameters.Our approach is also able to take into account the uncertainty in the model parameters by fitting a posterior distribution over them.Therefore, rather than just providing a point estimate, this approach can provide an estimation of uncertainty on the learned causal graph.Experimental results on synthetic and real datasets show that, as a result, the proposed approach significantly outperforms state-of-the-art methods under short observation sequences, and maintains the same performance in the large-data regime.
6
+
7
+ The most common approaches to learning the excitation matrix of MHPs are based on variants of regularized maximum-likelihood estimation (MLE).Zhou et al. [31] propose regularizers that enforce sparse and low-rank structures, along with an efficient algorithm based on the alternating-direction method of multipliers.To mitigate the parametric assumption, Xu et al. [28] represent the excitation functions as a series of basis functions, and to achieve sparsity under this representation they propose a sparse group-lasso regularizer. Such estimation methods are often referred to as non-parametric as they enable more flexibility on the shape of the excitation functions [19, 16].To estimate the excitation matrix without any parametric modeling, fully non-parametric approaches were developed [32, 1]. However, these methods focus on scalability and target settings where large-scale datasets are available.
8
+
9
+ Bayesian methods go beyond the classic approach of MLE by enabling a probabilistic interpretation of the model parameters.A few studies tackled the problem of learning MHPs from a Bayesian perspective.Linderman and Adams [20] use a Gibbs sampling-based approach, but the convergence of the proposed algorithm is slow. To tackle this problem, Linderman and Adams [21] discretize the time, which introduces noise in the model.In a different setting where some of the events or dimensions are hidden, Linderman et al. [22] use an expectation maximization algorithm to marginalize over the unseen part of the network.
10
+
11
+ Bayesian probabilistic models are usually intractable and require approximate inference. To address the issue, variational inference (VI) approximates the high-dimensional posterior of the probabilistic model. It recently gained interest in many applications. VI is used, to name a few, for word embedding [5, 7], paragraph embedding [17], and knowledge-graph embedding [6]. For more details on this topic, we refer the reader to Zhang et al. [30] and Blei et al. [9].Variational inference has also proven to be a successful approach to learning hyper-parameters [8, 6].Building on recent advances in variational inference, we develop in this work a variational expectation-maximization algorithm by interpreting the parameters of an MHP as latent variables of a probabilistic model.
12
+
13
+ Formally, a D𝐷D-dimensional MHP is a collection of D𝐷D univariate counting processes Ni​(t)subscript𝑁𝑖𝑡N_{i}(t), i=1,…,D𝑖1…𝐷i=1,\dots,D, whose realization over an observation period [0,T)0𝑇[0,T) consists of a sequence of discrete events𝒮={(tn,in)}𝒮subscript𝑡𝑛subscript𝑖𝑛\mathcal{S}=\{(t_{n},i_{n})\}, where tn∈[0,T)subscript𝑡𝑛0𝑇t_{n}\in[0,T) is the timestamp of the n𝑛n-th event and in∈{1,…,D}subscript𝑖𝑛1…𝐷i_{n}\in\{1,\ldots,D\} is its dimension.Each process has the particular form of conditional intensity functionλi​(t)=μi+∑j=1D∫0tϕi​j​(t−τ)​𝑑Nj​(τ),subscript𝜆𝑖𝑡subscript𝜇𝑖superscriptsubscript𝑗1𝐷superscriptsubscript0𝑡subscriptitalic-ϕ𝑖𝑗𝑡𝜏differential-dsubscript𝑁𝑗𝜏\displaystyle\lambda_{i}(t)=\mu_{i}+\sum_{j=1}^{D}\int_{0}^{t}\phi_{ij}(t-\tau)dN_{j}(\tau),(1)where μi>0subscript𝜇𝑖0\mu_{i}>0 is the constant exogenous part of the intensity of process i𝑖i, and the excitation function ϕi​j:ℝ+↦ℝ+:subscriptitalic-ϕ𝑖𝑗maps-tosubscriptℝsubscriptℝ\phi_{ij}:\operatorname{\mathbb{R}}_{+}\mapsto\operatorname{\mathbb{R}}_{+} encodes the effect of past events from dimension j𝑗j on future events from dimension i𝑖i. The larger the values of ϕi​j​(t)subscriptitalic-ϕ𝑖𝑗𝑡\phi_{ij}(t), the more likely events in dimension j𝑗j will trigger events in dimension i𝑖i.It has been shown that the excitation matrix [ϕi​j​(t)]delimited-[]subscriptitalic-ϕ𝑖𝑗𝑡[\phi_{ij}(t)] encodes the causal structure of the MHP in terms of Granger causality, i.e., ϕi​j​(t)=0subscriptitalic-ϕ𝑖𝑗𝑡0\phi_{ij}(t)=0 if and only if the process j𝑗j does not Granger-cause process i𝑖i [13, 12].
14
+
15
+ Most of the literature uses a parametric form for the excitation functions. The most popular form is the exponential excitation functionϕi​j​(t)=wi​j​ζ​e−ζ​t.subscriptitalic-ϕ𝑖𝑗𝑡subscript𝑤𝑖𝑗𝜁superscript𝑒𝜁𝑡\displaystyle\phi_{ij}(t)=w_{ij}\zeta e^{-\zeta t}.(2)However, in most applications the excitation patterns are unknown and this form might be too restrictive. Hence, to alleviate the assumption of a particular form for the excitation function, other approaches [19, 16, 28] over-parameterize the space and encode the excitation functions as a linear combination of M𝑀M basis functions κ1​(t),κ2​(t),…,κM​(t)subscript𝜅1𝑡subscript𝜅2𝑡…subscript𝜅𝑀𝑡\kappa_{1}(t),\kappa_{2}(t),\ldots,\kappa_{M}(t) asϕi​j​(t)=∑m=1Mwi​jm​κm​(t),subscriptitalic-ϕ𝑖𝑗𝑡superscriptsubscript𝑚1𝑀superscriptsubscript𝑤𝑖𝑗𝑚subscript𝜅𝑚𝑡\displaystyle\phi_{ij}(t)=\sum_{m=1}^{M}w_{ij}^{m}\kappa_{m}(t),(3)where the basis functions are often exponential or Gaussian kernels [28].This kind of approach is generally referred to as non-parametric. In the experiments of Section 5, we investigate the performance of both parametric and non-parametric approaches to learning MHPs from small sequences of observations.We denote the set of exogenous rates by 𝝁={μi}i=1D∈ℝ+D𝝁superscriptsubscriptsubscript𝜇𝑖𝑖1𝐷superscriptsubscriptℝ𝐷\bm{\mu}=\{\mu_{i}\}_{i=1}^{D}\in\operatorname{\mathbb{R}}_{+}^{D}and theexcitation matrixby 𝑾≔{{wi​jm}m=1M}i,j=1D∈ℝ+D2​M≔𝑾superscriptsubscriptsuperscriptsubscriptsuperscriptsubscript𝑤𝑖𝑗𝑚𝑚1𝑀𝑖𝑗1𝐷superscriptsubscriptℝsuperscript𝐷2𝑀{\bm{W}}\coloneqq\{\{w_{ij}^{m}\}_{m=1}^{M}\}_{i,j=1}^{D}\in\operatorname{\mathbb{R}}_{+}^{D^{2}M}.
16
+
17
+ Suppose that we observe a sequence of discrete events 𝒮={(tn,in)}n=1N𝒮superscriptsubscriptsubscript𝑡𝑛subscript𝑖𝑛𝑛1𝑁\mathcal{S}=\{(t_{n},i_{n})\}_{n=1}^{N} over an observation period [0,T)0𝑇[0,T).The most common approach to learning the parameters of an MHP given 𝒮𝒮\mathcal{S} is to perform a regularized maximum-likelihood estimation [31, 3, 28],which amounts to minimizing an objective function that is the sum of the negative log-likelihood and of a penalty term that induces some desired structural properties. Specifically, the objective is to solve the optimization problem𝝁^,𝑾^=argmin𝝁≥0,𝑾≥0−log⁡p​(𝒮|𝝁,𝑾)+1α​ℛ​(𝝁,𝑾),^𝝁^𝑾subscriptargminformulae-sequence𝝁0𝑾0𝑝conditional𝒮𝝁𝑾1𝛼ℛ𝝁𝑾\displaystyle\hat{\bm{\mu}},\hat{{\bm{W}}}=\mathop{\mathrm{argmin}}_{\bm{\mu}\geq 0,{\bm{W}}\geq 0}-\log p(\mathcal{S}|\bm{\mu},{\bm{W}})+\frac{1}{\alpha}\mathcal{R}(\bm{\mu},{\bm{W}}),(4)where the log-likelihood of the parameters is given bylog⁡p​(𝒮|𝝁,𝑾)𝑝conditional𝒮𝝁𝑾\displaystyle\log p(\mathcal{S}|\bm{\mu},{\bm{W}})=∑(tn,in)∈𝒮log⁡λin​(tn)−∑i=1D∫0Tλi​(t)​𝑑t.absentsubscriptsubscript𝑡𝑛subscript𝑖𝑛𝒮subscript𝜆subscript𝑖𝑛subscript𝑡𝑛superscriptsubscript𝑖1𝐷superscriptsubscript0𝑇subscript𝜆𝑖𝑡differential-d𝑡\displaystyle=\!\!\sum_{(t_{n},i_{n})\in\mathcal{S}}\!\!\log\lambda_{i_{n}}(t_{n})-\sum_{i=1}^{D}\int_{0}^{T}\lambda_{i}(t)dt.(5)The particular choice of penalty ℛ​(𝝁,𝑾)ℛ𝝁𝑾\mathcal{R}(\bm{\mu},{\bm{W}}), along with the single hyper-parameter α𝛼\alpha controlling its influence, depends on the problem at hand.For example, a necessary condition to ensure that the learned model is stable is that limt→∞ϕi​j​(t)=0subscript→𝑡subscriptitalic-ϕ𝑖𝑗𝑡0\lim_{t\rightarrow\infty}\phi_{ij}(t)=0 and that the spectral radius of the excitation matrix is less than 111 [10]. Hence, a common penalty used isℛp​(𝝁,𝑾)=∑i,j=1d∑m=1M|wi​jm|p,subscriptℛ𝑝𝝁𝑾superscriptsubscript𝑖𝑗1𝑑superscriptsubscript𝑚1𝑀superscriptsuperscriptsubscript𝑤𝑖𝑗𝑚𝑝\displaystyle\textstyle\mathcal{R}_{p}(\bm{\mu},{\bm{W}})=\sum_{i,j=1}^{d}\sum_{m=1}^{M}|w_{ij}^{m}|^{p},(6)with p=1𝑝1p=1 or 222 in [32, 31, 28].Another common assumption is that the graph is sparse. In this case, a Group-Lasso penalty of the formℛ1,2​(𝝁,𝑾)=∑i,j=1d∑m=1M(wi​jm)2subscriptℛ12𝝁𝑾superscriptsubscript𝑖𝑗1𝑑superscriptsubscript𝑚1𝑀superscriptsuperscriptsubscript𝑤𝑖𝑗𝑚2\displaystyle\textstyle\mathcal{R}_{1,2}(\bm{\mu},{\bm{W}})=\sum_{i,j=1}^{d}\sqrt{\sum_{m=1}^{M}(w_{ij}^{m})^{2}}(7)is commonly used to enforce sparsity in the excitation functions [28].
18
+
19
+ Small data amplifies the danger of overfitting; hence the choice of regularizers and their hyper-parameters becomes essential.Nevertheless, to control the influence of the penalty in (4), all state-of-the-art methods are limited by the use of a single shared hyper-parameter α𝛼\alpha.Ideally, we would have a different hyper-parameter to independently control the effect of the penalty on each parameter of the model.However, the number of parameters, i.e., (D2​M+D)superscript𝐷2𝑀𝐷(D^{2}M+D), grows quadratically with the dimension of the problem D𝐷D.To make matters worse, the most common approaches used to fine-tune the choice of hyper-parameters, i.e., grid search and random search, become computationally prohibitive when the number of hyper-parameters becomes large. Indeed, the search space exponentially increases with the number of hyper-parameters.Another approach is to use Bayesian optimization of hyper-parameters, but the cost of doing this also becomes prohibitive as the number of samples required to learn the landscape of cost function exponentially increases with the number of hyper-parameters [27].We describe the details of our proposed approach in the next section.
20
+
21
+ We now introduce the proposed approach for learning MHPs.The approach enables us to use different hyper-parameters for each model parameter and efficiently tune them all by taking into account parameter uncertainty.It is based on the variational expectation-maximization (EM) algorithm and jointly optimizes both the model parameters 𝝁𝝁\bm{\mu} and 𝑾𝑾{\bm{W}}, as well as the hyper-parameters 𝜶𝜶{\bm{\alpha}}.
22
+
23
+ First, we can view regularized MLE as a maximum a posteriori (MAP) estimator of the model where parameters are considered as latent variables. Under this interpretation, regularizers on the model parameters correspond to unnormalized priors on the latent variables. The optimization problem becomes𝝁^,𝑾^=argmax𝝁≥0,𝑾≥0log⁡p𝜶​(𝝁,𝑾,𝒮)=argmax𝝁≥0,𝑾≥0log⁡p​(𝒮|𝝁,𝑾)+log⁡p𝜶​(𝝁,𝑾).^𝝁^𝑾subscriptargmaxformulae-sequence𝝁0𝑾0subscript𝑝𝜶𝝁𝑾𝒮subscriptargmaxformulae-sequence𝝁0𝑾0𝑝conditional𝒮𝝁𝑾subscript𝑝𝜶𝝁𝑾\displaystyle\hat{\bm{\mu}},\hat{{\bm{W}}}=\mathop{\mathrm{argmax}}_{\bm{\mu}\geq 0,{\bm{W}}\geq 0}\log p_{\bm{\alpha}}(\bm{\mu},{\bm{W}},\mathcal{S})=\mathop{\mathrm{argmax}}_{\bm{\mu}\geq 0,{\bm{W}}\geq 0}\log p(\mathcal{S}|\bm{\mu},{\bm{W}})+\log p_{\bm{\alpha}}(\bm{\mu},{\bm{W}}).(8)Therefore, having a better regularizer means having a better prior.In the presence of a long sequence of observations, we want the prior to be as uninformative as possible (i.e., a smaller regularization) as we have access to enough information for the MLE to accurately estimate the parameters of the model. But in the case where we only observe short sequences, we want to use more informative priors to avoid overfitting (i.e., a larger regularization).
24
+
25
+ Unfortunately, the MAP estimator cannot adjust the influence of the prior by optimizing over 𝜶𝜶{\bm{\alpha}}.Indeed, the cost function in (8) is unbounded from aboveand solving Equation (8) with respect to 𝜶𝜶{\bm{\alpha}} leads trivially to a divergent solution 1𝜶→∞→1𝜶\frac{1}{{\bm{\alpha}}}\rightarrow\infty.To address this issue, we can take a Bayesian approach, integrate out parameters and optimize the evidence (or marginal likelihood) p𝜶​(𝒮)subscript𝑝𝜶𝒮p_{\bm{\alpha}}(\mathcal{S}) instead of the log-likelihood. Such an approach changes the optimization problem of Equation (8) into𝜶^=argmax𝜶≥0∬p​(𝒮|𝝁,𝑾)​p𝜶​(𝝁,𝑾)​𝑑𝝁​𝑑𝑾=argmax𝜶≥0p𝜶​(𝒮).^𝜶subscriptargmax𝜶0double-integral𝑝conditional𝒮𝝁𝑾subscript𝑝𝜶𝝁𝑾differential-d𝝁differential-d𝑾subscriptargmax𝜶0subscript𝑝𝜶𝒮\displaystyle\hat{{\bm{\alpha}}}=\mathop{\mathrm{argmax}}_{{\bm{\alpha}}\geq 0}~{}\iint p(\mathcal{S}|\bm{\mu},{\bm{W}})p_{\bm{\alpha}}(\bm{\mu},{\bm{W}})d\bm{\mu}d{\bm{W}}=\mathop{\mathrm{argmax}}_{{\bm{\alpha}}\geq 0}~{}p_{\bm{\alpha}}(\mathcal{S}).(9)Unlike the MAP objective function, maximizing the evidence over 𝜶𝜶{\bm{\alpha}} does not lead to a degenerate solution because it is upper bounded by the likelihood.However, this optimization problem can be solved only for simple models where the integral has a closed form, which requires a conjugate prior to the likelihood.Therefore, we use variational inference to estimate the evidence and develop a variational EM algorithm to optimize our objective with respect to 𝜶𝜶{\bm{\alpha}}.
26
+
27
+ The derivation of the variational objective is as follows.First postulate a variational distribution q𝜸​(𝝁,𝑾)subscript𝑞𝜸𝝁𝑾q_{\bm{\gamma}}(\bm{\mu},{\bm{W}}), parameterized by the variational parameters 𝜸𝜸{\bm{\gamma}}, approximating the posterior p​(𝝁,𝑾|𝒮)𝑝𝝁conditional𝑾𝒮p(\bm{\mu},{\bm{W}}|\mathcal{S}).The variational parameters 𝜸𝜸{\bm{\gamma}} are chosen such that the Kullback–Leibler divergence between the true posterior p​(𝝁,𝑾|𝒮)𝑝𝝁conditional𝑾𝒮p(\bm{\mu},{\bm{W}}|\mathcal{S}) and the variational distribution q𝜸​(𝝁,𝑾)subscript𝑞𝜸𝝁𝑾q_{{\bm{\gamma}}}(\bm{\mu},{\bm{W}}) is minimized.It is known that minimizing KL[q𝜸(𝝁,𝑾)∥p(𝝁,𝑾|𝒮)]KL\left[q_{{\bm{\gamma}}}(\bm{\mu},{\bm{W}})\|p(\bm{\mu},{\bm{W}}|\mathcal{S})\right] is equivalent to maximizing the evidence lower-bound (ELBO) [9, 30] defined as𝖤𝖫𝖡𝖮​(q𝜸,𝜶)≔𝔼q𝜸⁡[log⁡p𝜶​(𝝁,𝑾,𝒮)]−𝔼q𝜸⁡[log⁡q𝜸​(𝝁,𝑾)].≔𝖤𝖫𝖡𝖮subscript𝑞𝜸𝜶subscript𝔼subscript𝑞𝜸subscript𝑝𝜶𝝁𝑾𝒮subscript𝔼subscript𝑞𝜸subscript𝑞𝜸𝝁𝑾{\mathsf{ELBO}}(q_{\bm{\gamma}},{\bm{\alpha}})\coloneqq\operatorname{\mathbb{E}}_{q_{\bm{\gamma}}}\left[\log p_{\bm{\alpha}}(\bm{\mu},{\bm{W}},\mathcal{S})\right]-\operatorname{\mathbb{E}}_{q_{\bm{\gamma}}}[\log q_{\bm{\gamma}}(\bm{\mu},{\bm{W}})].(10)By invoking Jensen’s inequality on the integral p𝜶​(𝒮)=∬p𝜶​(𝝁,𝑾,𝒮)​𝑑𝝁​𝑑𝑾subscript𝑝𝜶𝒮double-integralsubscript𝑝𝜶𝝁𝑾𝒮differential-d𝝁differential-d𝑾p_{\bm{\alpha}}(\mathcal{S})=\iint p_{\bm{\alpha}}(\bm{\mu},{\bm{W}},\mathcal{S})d\bm{\mu}d{\bm{W}}, we obtain the desired lower bound on the evidencep𝜶​(𝒮)≥𝖤𝖫𝖡𝖮​(q𝜸,𝜶)subscript𝑝𝜶𝒮𝖤𝖫𝖡𝖮subscript𝑞𝜸𝜶p_{\bm{\alpha}}(\mathcal{S})\geq\mathsf{{\mathsf{ELBO}}}(q_{{\bm{\gamma}}},{\bm{\alpha}}) where, by maximizing 𝖤𝖫𝖡𝖮​(q𝜸,𝜶)𝖤𝖫𝖡𝖮subscript𝑞𝜸𝜶{\mathsf{ELBO}}(q_{{\bm{\gamma}}},{\bm{\alpha}}) with respect to 𝜸𝜸{\bm{\gamma}}, the bound becomes tighter.
28
+
29
+ For simplicity, we adopt the mean-field assumption by choosing a variational distribution q𝜸​(𝝁,𝑾)subscript𝑞𝜸𝝁𝑾q_{\bm{\gamma}}(\bm{\mu},{\bm{W}}) that factorizes over the latent variables111This assumption can be relaxed using more advanced techniques at the cost of having a higher computational complexity. .As the parameters 𝝁𝝁\bm{\mu} and 𝑾𝑾{\bm{W}} of an MHP are non-negative, a good candidate to approximate the posterior is a log-normal distribution.We define the variational parameters 𝜸={𝝂,e𝝈}𝜸𝝂superscript𝑒𝝈{\bm{\gamma}}=\{{\bm{\nu}},e^{\bm{\sigma}}\} as the mean and the standard deviation of q𝜸subscript𝑞𝜸q_{{\bm{\gamma}}}. We denote the standard deviation by e𝝈superscript𝑒𝝈e^{\bm{\sigma}} because, we optimize its log to naturally ensure its positivity and the stability of the optimization procedure.Although we present our learning approach for the log-normal distribution, it is easily generalizable to other distributions.
30
+
31
+ In order to efficiently optimize the ELBO with respect to both the variational parameters 𝜸𝜸{\bm{\gamma}} and the hyper-parameters 𝜶𝜶{\bm{\alpha}}, we use the variational EM algorithm that iterates over the two following steps:The E-step maximizes the ELBO with respect to the variational parameters 𝜸𝜸{\bm{\gamma}} in order to get a tighter lower-bound on the evidence;and the M-step updates the hyper-parameters α𝛼\alpha with a closed form update. Details of the two steps are as follows.
32
+
33
+ The E-step maximizes the ELBO with respect to the variational parameters 𝜸𝜸{\bm{\gamma}} to make the variational distribution q𝜸​(𝝁,𝑾)subscript𝑞𝜸𝝁𝑾q_{\bm{\gamma}}(\bm{\mu},{\bm{W}}) close to the exact posterior p​(𝝁,𝑾|𝒮)𝑝𝝁conditional𝑾𝒮p(\bm{\mu},{\bm{W}}|\mathcal{S}) and to ensure that the ELBO is a good proxy for the evidence.To evaluate the ELBO, we use the black-box variational-inference optimization in [18, 25].Re-parameterize the model as𝝁=g𝜸​(𝜺𝝁)=exp⁡(𝝂𝝁+e𝝈𝝁⊙𝜺𝝁),𝝁subscript𝑔𝜸superscript𝜺𝝁superscript𝝂𝝁direct-productsuperscript𝑒superscript𝝈𝝁superscript𝜺𝝁\displaystyle\bm{\mu}=g_{{\bm{\gamma}}}({\bm{\varepsilon}}^{\bm{\mu}})=\exp({\bm{\nu}}^{\bm{\mu}}+e^{{\bm{\sigma}}^{\bm{\mu}}}\odot{\bm{\varepsilon}}^{\bm{\mu}}),𝑾=g𝜸​(𝜺𝑾)=exp⁡(𝝂𝑾+e𝝈𝑾⊙𝜺𝑾),𝑾subscript𝑔𝜸superscript𝜺𝑾superscript𝝂𝑾direct-productsuperscript𝑒superscript𝝈𝑾superscript𝜺𝑾\displaystyle{\bm{W}}=g_{{\bm{\gamma}}}({\bm{\varepsilon}}^{{\bm{W}}})=\exp({\bm{\nu}}^{{\bm{W}}}+e^{{\bm{\sigma}}^{{\bm{W}}}}\odot{\bm{\varepsilon}}^{{\bm{W}}}),where 𝜺𝝁superscript𝜺𝝁{\bm{\varepsilon}}^{\bm{\mu}} (resp. 𝜺𝑾superscript𝜺𝑾{\bm{\varepsilon}}^{{\bm{W}}}) has the same shape as 𝝁𝝁\bm{\mu} (resp. 𝑾𝑾{\bm{W}}), with each element following a normal distribution 𝒩​(0,1)𝒩01\mathcal{N}(0,1). ⊙direct-product\odot denotes the element-wise product.This trick enables us to rewrite the first intractable expectation term of the ELBO in (10) as𝔼q𝜸⁡[log⁡pC​(𝝁,𝑾,𝒮)]=𝔼𝜺∼𝒩​(0,I)⁡[log⁡p𝜶​(g𝜸​(𝜺𝝁),g𝜸​(𝜺𝑾),𝒮)].subscript𝔼subscript𝑞𝜸subscript𝑝𝐶𝝁𝑾𝒮subscript𝔼similar-to𝜺𝒩0𝐼subscript𝑝𝜶subscript𝑔𝜸superscript𝜺𝝁subscript𝑔𝜸superscript𝜺𝑾𝒮\operatorname{\mathbb{E}}_{q_{{\bm{\gamma}}}}\left[\log p_{C}(\bm{\mu},{\bm{W}},\mathcal{S})\right]=\operatorname{\mathbb{E}}_{{\bm{\varepsilon}}\sim\mathcal{N}(0,I)}\left[\log p_{\bm{\alpha}}\left(g_{{\bm{\gamma}}}({\bm{\varepsilon}}^{\bm{\mu}}),g_{{\bm{\gamma}}}({\bm{\varepsilon}}^{{\bm{W}}}),\mathcal{S}\right)\right].(11)The second term of the ELBO in (10) is the entropy of the log-normal distribution that can be expressed, up to a constant, as∑μi,σi(μi+σi)subscriptsubscript𝜇𝑖subscript𝜎𝑖subscript𝜇𝑖subscript𝜎𝑖\sum_{\mu_{i},\sigma_{i}}(\mu_{i}+\sigma_{i}).The ELBO then can be estimated by Monte-Carlo integration as𝖤𝖫𝖡𝖮​(q𝜸,𝜶)≈1L​∑ℓ=1Llog⁡p𝜶​(g𝜸​(𝜺ℓ𝝁),g𝜸​(𝜺ℓ𝑾),𝒮)+∑μi,σi(μi+σi),𝖤𝖫𝖡𝖮subscript𝑞𝜸𝜶1𝐿superscriptsubscriptℓ1𝐿subscript𝑝𝜶subscript𝑔𝜸subscriptsuperscript𝜺𝝁ℓsubscript𝑔𝜸subscriptsuperscript𝜺𝑾ℓ𝒮subscriptsubscript𝜇𝑖subscript𝜎𝑖subscript𝜇𝑖subscript𝜎𝑖{\mathsf{ELBO}}(q_{{\bm{\gamma}}},{\bm{\alpha}})\approx\frac{1}{L}\sum_{\ell=1}^{L}\log p_{\bm{\alpha}}\left(g_{{\bm{\gamma}}}({\bm{\varepsilon}}^{\bm{\mu}}_{\ell}),g_{{\bm{\gamma}}}({\bm{\varepsilon}}^{{\bm{W}}}_{\ell}),\mathcal{S}\right)+\sum_{\mu_{i},\sigma_{i}}(\mu_{i}+\sigma_{i}),(12)where L𝐿L is the number of Monte-Carlo samples 𝜺1,…,𝜺Lsubscript𝜺1…subscript𝜺𝐿\bm{\varepsilon}_{1},\ldots,\bm{\varepsilon}_{L}.Note that the first term of (12) is the cost function for the MAP problem (8) evaluated at{𝝁,𝑾}={g𝜸​(𝜺ℓ𝝁),g𝜸​(𝜺ℓ𝑾)}𝝁𝑾subscript𝑔𝜸subscriptsuperscript𝜺𝝁ℓsubscript𝑔𝜸subscriptsuperscript𝜺𝑾ℓ\{\bm{\mu},{\bm{W}}\}=\{g_{{\bm{\gamma}}}({\bm{\varepsilon}}^{\bm{\mu}}_{\ell}),g_{{\bm{\gamma}}}({\bm{\varepsilon}}^{{\bm{W}}}_{\ell})\} for ℓ∈[n]ℓdelimited-[]𝑛\ell\in[n].Hence, the E-step summarizes into maximizing the right-hand side of (12) with respect to 𝜸𝜸{\bm{\gamma}} using gradient descent.
34
+
35
+ In the M-step, the ELBO is used as a proxy for the evidence pα​(𝒮)subscript𝑝𝛼𝒮p_{\alpha}(\mathcal{S}) and is maximized with respect to the hyper-parameters 𝜶𝜶{\bm{\alpha}}.Again, we rely on the re-parameterization technique and compute the unbiased estimate of the ELBO in (12). The maximum of the estimate (12) with respect to 𝜶𝜶{\bm{\alpha}} has a closed form that depends on the choice of prior. We provide the closed-form solutions in Appendix A for a few proposed priors that emulate common regularizers.To avoid fast changes in 𝜶𝜶{\bm{\alpha}} due to the variance of the Monte-Carlo integration, we take an update similar to the one in [6] and take a weighted average between the current estimate and the minimizer of the current Monte-Carlo estimate of the ELBO as𝜶≔β⋅𝜶+(1−β)⋅argmin𝜶~1L​∑ℓ=1Llog⁡p𝜶~​(g𝜸​(𝜺ℓ𝝁),g𝜸��(𝜺ℓ𝑾),𝒮),≔𝜶⋅𝛽𝜶⋅1𝛽subscriptargmin~𝜶1𝐿superscriptsubscriptℓ1𝐿subscript𝑝~𝜶subscript𝑔𝜸subscriptsuperscript𝜺𝝁ℓsubscript𝑔𝜸subscriptsuperscript𝜺𝑾ℓ𝒮{\bm{\alpha}}\coloneqq\beta\cdot{\bm{\alpha}}+(1-\beta)\cdot\mathop{\mathrm{argmin}}_{\tilde{{\bm{\alpha}}}}\frac{1}{L}\sum_{\ell=1}^{L}\log p_{\tilde{{\bm{\alpha}}}}\left(g_{{\bm{\gamma}}}({\bm{\varepsilon}}^{\bm{\mu}}_{\ell}),g_{{\bm{\gamma}}}({\bm{\varepsilon}}^{{\bm{W}}}_{\ell}),\mathcal{S}\right),(13)where β∈[0,1]𝛽01\beta\in[0,1] is the momentum term.
36
+
37
+ Algorithm 1 summarizes the proposed variational EM approach.222Source code is available publicly.The computational complexity of the inner-most loop of Algorithm 1 is L𝐿L times the complexity of an iteration of gradient descent on the log-likelihood. However, as observed by recent studies in variational inference, using L=1𝐿1L=1 is usually sufficient in many applications [18]. Hence, we use L=1𝐿1L=1 in all our experiments, leading to the same computational complexity per-iteration as MLE using gradient descent.
38
+
39
+ We carry out two sets of experiments.First, we perform a link-prediction task on synthetic data to show that our approach can accurately recover the support of the excitation matrix of the MHP under short sequences.Second, we perform an event-prediction task on real datasets of short sequences to show that our approach outperforms state-of-the-art methods in terms of predictive log-likelihood.
40
+
41
+ We run our experiments in two different settings.First, in a parametric setting where the exponential form of the excitation function is known, we compare our approach (VI-EXP) to the state-of-the-art MLE-based method (MLE-ADM4) from Zhou et al. [31].Second, we use a non-parametric setting where no assumption is made on the shape of the excitation function. We then set the excitation function as a mixture of M=10𝑀10M=10 Gaussian kernels defined asκm​(t)=(2​π​b2)−1​exp⁡(−(t−τm)2/(2​b2)),∀m=1,…,M,formulae-sequencesubscript𝜅𝑚𝑡superscript2𝜋superscript𝑏21superscript𝑡subscript𝜏𝑚22superscript𝑏2for-all𝑚1…𝑀\displaystyle\kappa_{m}(t)=(2\pi b^{2})^{-1}\exp\left(-(t-\tau_{m})^{2}/(2b^{2})\right),\forall m=1,\ldots,M,(14)where τmsubscript𝜏𝑚\tau_{m} and b𝑏b are the known location and scale of the kernel.In this setting, we compare our approach (VI-SG) to the state-of-the-art MLE-based methods (MLE-SGLP) of Xu et al. [28] with the same {κm​(t)}subscript𝜅𝑚𝑡\{\kappa_{m}(t)\}333We also performed the experiments with other approaches designed for large-scale datasets, but their performance was below that of the reported baselines [1, 20, 21]..Let us stress that the parametric methods have a strong advantage over the non-parametric ones because they are given the true value of the exponential decay ζ𝜁\zeta.
42
+
43
+ As our VI approach returns a posterior on the parameters, rather than a point estimate, we use the mode of the approximate log-normal posterior as the inferred edges {w^i​j}subscript^𝑤𝑖𝑗\{\hat{w}_{ij}\}.For the non-parametric setting, we use w^i​j=∑m=1Mw^i​jmsubscript^𝑤𝑖𝑗superscriptsubscript𝑚1𝑀superscriptsubscript^𝑤𝑖𝑗𝑚\hat{w}_{ij}=\sum_{m=1}^{M}\hat{w}_{ij}^{m}.To mimic the regularization schemes of the baselines, we use a Laplacian prior for the edge weights {wi​j}subscript𝑤𝑖𝑗\{w_{ij}\} to enforce sparsity, and we use a Gaussian prior for the baselines {μi}subscript𝜇𝑖\{\mu_{i}\}.We tune the hyper-parameters of the baselines using grid search444More details are provided in Appendix E..
44
+
45
+ We first evaluate the performance of our VI approach on simulated data.We generate random Erdős–Rényi graphs with D=50𝐷50D=50 nodes and edge probability p=log⁡(D)/D𝑝𝐷𝐷p=\log(D)/D. Then, a sequence of observations is generated from an MHP with exponential excitation functions defined in (2) with exponential decay ζ=1𝜁1\zeta=1. The baselines {μi∗}superscriptsubscript𝜇𝑖\{\mu_{i}^{*}\} are sampled independently in Unif​[0,0.02]Unif00.02\mathrm{Unif}[0,0.02], and the edge weights {wi​j∗}superscriptsubscript𝑤𝑖𝑗\{w_{ij}^{*}\} are sampled independently in Unif​[0.1,0.2]Unif0.10.2\mathrm{Unif}[0.1,0.2].Results are averaged over 303030 graphs with 101010 simulations each.For reproducibility, a detailed description of the experimental setup is provided in Appendix E.
46
+
47
+ To investigate if the support of the excitation matrix can be accurately recovered under small data, we evaluate the performance of each approach on three metrics [32, 28, 14].•F1-score. We zero-out small weights using a threshold η=0.04𝜂0.04\eta=0.04 and measure the F1-score of the resulting binary edge classification problem555Additional results with varying thresholds η𝜂\eta are provided in Appendix D..•Precision@k. Instead of thresholding, we also report the precision@k defined by the average fraction of correctly identified edges in the top k𝑘k largest estimated weights. Since the proposed VI approach gives an estimate of uncertainty via the variance of the posterior, we select the edges with high weights w^i​jsubscript^𝑤𝑖𝑗\hat{w}_{ij} and low uncertainty, i.e., the edges with ratio of lowest standard deviation over weight w^i​jsubscript^𝑤𝑖𝑗\hat{w}_{ij}.•Relative error. To evaluate the distance of the estimated weights to the ground truth ones, we use the averaged relative error defined as|w^i​j−wi​j∗|/wi​j∗subscript^𝑤𝑖𝑗superscriptsubscript𝑤𝑖𝑗superscriptsubscript𝑤𝑖𝑗\textstyle|\hat{w}_{ij}-w_{ij}^{*}|/w_{ij}^{*} when wi​j∗≠0superscriptsubscript𝑤𝑖𝑗0w_{ij}^{*}\neq 0, andw^i​j/(minwk​l∗>0⁡wk​l∗)subscript^𝑤𝑖𝑗subscriptsuperscriptsubscript𝑤𝑘𝑙0superscriptsubscript𝑤𝑘𝑙\textstyle\hat{w}_{ij}/(\min_{w_{kl}^{*}>0}w_{kl}^{*}) when wi​j∗=0superscriptsubscript𝑤𝑖𝑗0w_{ij}^{*}=0.This metric is more sensitive to errors in small weights wi​j∗superscriptsubscript𝑤𝑖𝑗w_{ij}^{*}, and therefore penalizes false positive over false negative errors.
48
+
49
+ We investigate the sensitivity of each approach to the amount of data available for training by varying the size of the training set from N=750𝑁750N=\numprint{750} to N=25 000𝑁25000N=\numprint{25000} events, i.e., 151515 to 500500\numprint{500} events per node. Results are shown in Figure 1.Our approach improves the results in both parametric and non-parametric settings for all metrics.The improvements are more substantial in the non-parametric setting. If the accuracy of the top edges is similar for both VI-SG and MLE-SGLP in terms of precision@20, VI-SG improves the F1-score by about 20%percent2020\% with N=5 000𝑁5000N=\numprint{5000} training events. The reason for this improvement is that MLE-SGLP has a much higher false positive rate, which is hurting the F1-score but does not affect the precision@20.VI-SG is also able to reach the same F1-score as the parametric baseline MLE-ADM4 with only N=4 000𝑁4000N=\numprint{4000} training events666We present additional results with various thresholds η𝜂\eta and k𝑘k in Appendix D..Note that VI-SG is optimizing D2​M+D=25 050superscript𝐷2𝑀𝐷25050D^{2}M+D=\numprint{25050} hyper-parameters with minimal additional cost.
50
+
51
+ In the next experiment, we focus on the non-parametric setting, we fix the length of observation to N=5000𝑁5000N=5000 and study the effect of increasing M𝑀M on the performance of the algorithms.The results are shown in Figure 2. We see that our approach is more robust to the choice of M𝑀M than MLE-SGLP.A possible explanation for this behavior is that MLE-SGLP overfits due to the increasing number of model parameters.
52
+
53
+ Finally, we investigate the parameters of the model learned by our VI-EXP approach.In Figure 3a, we use the variance of the approximated posterior q𝜸subscript𝑞𝜸q_{{\bm{\gamma}}} as a measure of confidence for edge identification, and we report the distribution of ratio of standard deviation over weight w^i​jsubscript^𝑤𝑖𝑗\hat{w}_{ij} for both the true and false positive edges.Similar results hold between the true and false negative edges.The false positive edges have a higher uncertainty than the true positive ones.This is relevant when we cannot identify all edges due to lack of data, even though we still wish to identify a subset of edges with high confidence.In addition, Figure 3b confirms that, as expected, the optimized weight priors 𝜶𝜶{\bm{\alpha}} are much larger for true edges in the ground-truth excitation matrix than for non-edges.
54
+
55
+ We also evaluate the performance of our approach on the following three small datasets:1.Epidemics.This dataset contains records of infection of individuals, along with their corresponding district of residence, during the last Ebola epidemic in West Africa in 2014-2015 [15].To learn the propagation network of the epidemics, we consider the 54 districts as processes and define infection records as events.2.Stock market.This dataset contains the stock prices of 121212 high-tech companies sampled every 222 minutes on the New York Stock Exchange for 202020 days in April 2008 [13]. We consider each stock as a process and record an event every time a stock price changes by 0.15%percent0.150.15\% from its current value.3.Enron email.This dataset contains emails between employees of Enron from the Enron corpus. We consider all employees with more than 101010 received emails as processes and record an event every time an employee receives an email.
56
+
57
+ We perform an event-prediction task to show that our approach outperforms the state-of-the-art methods in terms of predictive log-likelihood.To do so, we use the first 70% events as training set, and we compute the held-out averaged log-likelihood on the remaining 30%. We present the results in Table 1.
58
+
59
+ We first see that the non-parametric methods outperform the parametric ones on both the Epidemic dataset and the Stock market dataset. This suggests that the exponential excitation function might be too restrictive to fit their excitation patterns.In addition, our non-parametric approach VI-SG significantly outperforms MLE-SGLP on all datasets.The improvement is particularly clear for the Epidemic dataset, which has the smallest number of events per dimension. Indeed, the top edges learned by VI-SG correspond to contiguous districts as expected. This is not the case for MLE-SGLP, for which the top learned edges correspond to districts that are far from each other.
60
+
61
+ We proposed a novel approach to learn the excitation matrix of a multivariate Hawkes process in the presence of short observation sequences.We observed that state-of-the-art methods are sensitive to the amount of data used for training and showed that the proposed approach outperforms these methods when only short training sequences are available.The common tool to tackle this problem is to design smarter regularization schemes.However, all maximum likelihood-based methods suffer from a common problem: all the model parameters are regularized equally with a few hyper-parameters.We developed a variational expectation maximization algorithm that is able to(1) optimize over an extended set of hyper-parameters, with almost no additional costand (2) take into account the uncertainty of the learned model parameters by fitting a posterior distribution over them.We performed experiments on both synthetic and real datasets and showed that our approach outperforms state-of-the-art methods under small-data regimes.
1911.00334v1.txt ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Cover song identification has long been a popular task in the music information retrieval community, with potential applications in areas such as music license management, music retrieval, and music recommendation. Cover song identification can also be seen as measuring the similarity between music melodies. Given those cover songs may differ from the original song in key transposition, speed change and structural variations, identifying cover songs is a rather challenging task. Over the past ten years, researchers initially attempt to address the problem employing Dynamic Programming (DP) approaches. Typically, chroma sequences representing the intensity of twelve pitch classes are used to describe recordings, and then a DP method is utilized for finding an optimal alignment between two given recordings, resolving the discrepancy caused by tempo changes and structural variations [1, 2, 3].Such approaches work well when facing structural variations and tempo changes in the music; however, the involvement of element-to-element distance computation with quadratic time complexity makes it unsuitable for large-scale datasets.
2
+
3
+ Alternatively, some researchers attempted to identify cover songs by modeling the music. For instance, Serrà et al. studied time series modeling for cover song identification [3].[4, 5] represent the music with fixed-dimensional vectors, which enables a direct measure of the music similarity. These approaches highly improved the efficiency compared to alignment methods, while the loss of the temporal information of music in these approaches may yield a lower precision.
4
+
5
+ Moreover, deep learning approaches are introduced to cover song identification. For instance, CNNs are utilized to measure the similarity matrix [6] or learn features [7, 8, 9, 10]. While these methods have achieved promising results, there is still room for improvement.In this paper, a specially designed CNN architecture is proposed to overcome challenges of key transposition, speed change and structural variations existing in cover song identification. Notably, the use of the specialized kernel size is fist ever utilized in the field of music information retrieval. The dilation convolution and the method of data augmentation are also introduced. Our approach outperforms state-of-the-art methods on all public datasets with better accuracy but lower time complexity. Furthermore, to our best knowledge, our method is currently the best method to identify cover songs in huge real-life corpora.
6
+
7
+ As shown in Figure 1, we have a training dataset D={(xn,tn)}𝐷subscript𝑥𝑛subscript𝑡𝑛D=\{(x_{n},t_{n})\}, where xnsubscript𝑥𝑛x_{n} is a recording and tnsubscript𝑡𝑛t_{n} is a one-hot vector denoting to which song (or class) the recording belongs. Different versions of the same song are viewed as the samples from the same class, and different songs are regarded as the different classes. We aim to train a classification network model parameterized as {θ,λ}𝜃𝜆\{\theta,\lambda\} from D𝐷D. As shown in Figure 2, θ𝜃\theta is the parameter of all convolutions and FC00; λ𝜆\lambda is the parameter of FC111; fθsubscript𝑓𝜃f_{\theta} is the output of the FC00 layer. Then, this model could be used for cover song retrieval. More specifically, after the training, given a query Q𝑄Q and references Rnsubscript𝑅𝑛{R_{n}} in the dataset, we extract latent features fθ​(Q),fθ​(Rn)subscript𝑓𝜃𝑄subscript𝑓𝜃subscript𝑅𝑛f_{\theta}(Q),{f_{\theta}(R_{n})} which we call as music representations obtained by the network, and then we use a metric s𝑠s to measure the similarity between them. In the following sections, we will discuss the low-level representation used, the design of network structure and a robust trained model against key transposition and tempo change. We use lowercase for audio and uppercase for the CQT to discriminate.
8
+
9
+ The CQT, mapping frequency energy into musical notes, is extracted by Librosa [11] for our experiment. The audio is resampled to 220502205022050 Hz, the number of bins per octave is set as 121212 and Hann window is used for extraction with a hop size of 512512512. Finally, a 202020-point mean down-sampling in the time direction is applied to the CQT, and the resulting feature is a sequence with a feature rate of about 222 Hz. It could also be viewed as an 84×T84𝑇84\times T matrix where T𝑇T depends on the duration of input audio.
10
+
11
+ Inspired by successful applications of network architectures like [12, 13], we design a novel Network architecture for the cover song task. We stack small filters following with max pooling operations, except that in initial layers, we design the height of filter to be 121212 or 131313 (see Figure 2) as the number of bins per octave is set as 121212 in the CQT.This setting results in that the units of the third layer have a receptive field with a height of 363636; it spans across three octaves or thirty-six semitones.
12
+
13
+ We also introduce dilated convolution into the model to enlarge the receptive field because cover song identification focuses on the long-term melody of the music. The design is consistent with the ideas of existing works in [2, 4], which extracted features or measured the similarity from a long range.
14
+
15
+ More importantly, our model does not involve any downsample pooling operation in the frequency dimension; in other words, the vertical stride is always set to 111, different from prevalent network structures like VGG and ResNet [12, 13]. The motivation behind this design focuses on the fact that key transposition may be one or two semitones, corresponding to moving the CQT matrix vertically for merely one or two elements. Without downsampling feature map, the network remains a higher resolution and deals with key transposition better. We experimentally validate that this design helps improve the precision (see Section 4.1).
16
+
17
+ Furthermore, after several convolutional and pooling layers, we apply an adaptive pooling layer to the feature map, whose length varies depending on the input audio. Obviously, this global pooling has the advantage of converting variable-length feature maps into fixed-dimensional vectors, connected with two fully-connected layers to exploit more information. Without the global pooling, the fully-connected layers only allow fixed-dimensional inputs, which are not the cases of music as different compositions may have different durations. Comparing with [9] who utilized Temporal Pyramid Pooling, we utilize global pooling because it performs the same as TPP in our model. One explanation is that our convolutional network is much deeper.
18
+
19
+ Given the inputs of network X𝑋X, the output of FC00 is fθ​(X)∈R300subscript𝑓𝜃𝑋superscript𝑅300f_{\theta}(X)\in R^{300}, and the prediction of network is y=softmax​(λ​fθ​(X))𝑦softmax𝜆subscript𝑓𝜃𝑋y=\mathrm{softmax}(\lambda f_{\theta}(X)). Cross-entropy loss L𝐿L is used for training. In our cases, different versions of a song are considered as the same category, and different songs are viewed as different classes.
20
+
21
+ For each batch, we sample some recordings from the training set and extract CQTs from them. For each CQT, we randomly crop three subsequences with a length of 200,300200300200,300 and 400400400 for training, corresponding to roughly 100100100s, 150150150s and 200200200s, respectively.
22
+
23
+ Despite the training set contains covers performed at different speeds, each song merely owns several covers on average for training. Moreover, as our model does not explicitly handle tempo changes in cover songs, it may be difficult for the model to learn a representation robust against tempo changes automatically. Therefore, we perform data augmentation during model training. As shown in Algorithm 1, we sample a changing factor from (0.7,1.3)0.71.3(0.7,1.3) for each recording in the batch following uniform distribution and simulate tempo changes using Librosa [11] on the recording before cropping subsequences.
24
+
25
+ After the training, the network is used to extract music representations. As shown in Figure 1, given a query q𝑞q and a reference r𝑟r, we first extract their CQT descriptors Q𝑄Q and R𝑅R respectively, which are fed into the network to obtain music representations fθ​(Q)subscript𝑓𝜃𝑄f_{\theta}(Q) and fθ(R))f_{\theta}(R)), and then the similarity s𝑠s, defined as their cosine similarity, are measured.After computing the pair-wise similarity between the query and references in the dataset, a ranking list is returned for evaluation.
26
+
27
+ Second Hand Songs 100K (SHS100K), which is collected from Second Hand Songs website by [8], consisting of 885888588858 songs with various covers and 108523108523108523 recordings. This dataset is split into three subsets – SHS100K-TRAIN, SHS100K-VAL and SHS100K-TEST with a ratio of 8:1:1:81:18:1:1.
28
+
29
+ Youtube is collected from the YouTube website, containing 505050 compositions of multiple genres [14]. Each song in Youtube has 777 versions, with 222 original versions and 555 different versions and thus results in 350350350 recordings in total. In our experiment, we use the 100100100 original versions as references and the others as queries following the same as [15, 9, 8].
30
+
31
+ Covers80 is a widely used benchmark dataset in the literature. It has 808080 songs, with 222 covers for each song, and has 160160160 recordings in total. To compare with existing methods, we compute the similarity of any pair of recordings.
32
+
33
+ Mazurkas is a classical music collection consisting of 2914 recordings of 49 Chopin’s Mazurkas, originated from the Mazurka Project 111www.mazurka.org.uk. The number of covers for each piece varies between 414141 and 959595. For this dataset, we follow the experimental setting of [15].
34
+
35
+ For evaluation, we calculate the common evaluation metrics: mean average precision (MAP), precision at 101010 (P@10) and the mean rank of the first correctly identified cover (MR1). These metrics are the ones used in Mirex Audio Cover Song Identification contest 222https://www.music-ir.org/mirex/wiki/2019:Audio_Cover_Song_Identification. Additionally, query time is recorded for efficiency evaluation. All the experiments are run in a Linux server with two TITAN X (Pascal) GPUs.
36
+
37
+ Firstly we explore the kernel size of CNNs and replace the kernel size of the initial three layers with 3×3333\times 3, 7×3737\times 3, 15×315315\times 3, 7×7777\times 7, 12×12121212\times 12. The result of experiment shows that the height of filter to be 121212 or 131313 performs the best.
38
+
39
+ Additional, we change the vertical strides of max-pooling layers and conduct several experiments to explore its influence on accuracy. The original model is denoted as CQT-Net, and the modified network is denoted as CQT-Net{4}4\{4\}, CQT-Net{3,4}34\{3,4\} and CQT-Net{2,3,4}234\{2,3,4\} respectively, where the numbers indicate the shape of corresponding pooling layers are changed to (2,2)22(2,2). For instance, CQT-Net{2}2\{2\} means that Pool222 is replaced with a pooling operation with a stride and size of (2,2)22(2,2). That is, the total vertical strides for CQT-Net{4}4\{4\}, CQT-Net{3,4}34\{3,4\} and CQT-Net{2,3,4}234\{2,3,4\} are 2,4242,4 and 888, respectively. When the vertical stride increases, MAP degrades on the four datasets consistently, as well as MR1 and P@10.We suppose this is because the key transposition may shift one or two semitones; the network having a higher resolution of feature dimension (that is, setting vertical stride to be 111) could capture these changes and help improve the precision.
40
+
41
+ We compare with other state-of-the-art methods on different datasets. Table 1 shows our approach outperforms state-of-the-art methods on all datasets. The advantages of our approach lie in without relying on complicated hand-crafted features and elaborately-designed alignment algorithms, our approach exploits massive data and feature learning and obtains high precision. By collecting a larger dataset, our approach may obtain higher precision. It is worth noting that our training set SHS100K-TRAIN mainly consists of pop music while Mazurkas contains classical music. Our approach outperforms state-of-the-art methods on this dataset, which indicates a good generalization ability. We do not show the result of [22] in Mazurka Project because our test sets are different. As for the large dataset SHS100K-TEST, our method performs much better than state-of-the-art methods.
42
+
43
+ Moreover, the query time shown in the table does not include the time of feature extracting. Therefore, our method has the same time consumed as [9]. It extracts a fixed-dimensional feature whatever the duration of input audio is. Theoretically, it has linear time complexity, faster than sequence alignment methods with quadratic time complexity. One could find that the query time of our approach is shorter than approaches such as DPLA, SiMPle by several magnitudes. For Ki-CNN and TPPNet, they model music with a fixed-dimensional vector and have similar time complexity. In our implementation, our approach learns a 300300300-dimensional representation, which is the same as TPPNet, explaining why the time consumption of our approach is the same as TPPNet.
44
+
45
+ We listen to the Top10 retrieval results and attempt to make some analysis on SHS100K-TEST. Our approach could identify versions when performed by different genders, accompanied by different instruments, sung in different languages, etc. Especially, as our training goal is to classify the song and different versions of the same song often have similar styles, melodic and chord structures, we find that even though some candidates in the Top10 may not be the cover of the query, but they have similar properties such as accompaniment and genre with the query. For instance, Everybody Knows This Is Nowhere by the Bluebeaters has a similar accompaniment with that of Waiting in Vain by Bob Marley & The Wailers. In this sense, our approach may also be used to retrieve similar music of the query and extended to content-based music recommendation.
46
+
47
+ Furthermore, we find that Top1 precision of our model is 0.810.810.81, suggesting that it could find a cover as the Top1 candidate for 81%percent8181\% queries. However, it works worse in some cases. This may explain why our approach obtains a MAP of 0.6550.6550.655 while only a MR1 of 54.954.954.9 on this dataset. Most importantly, the high Top1 precision and the fast retrieval speed make our method possible to handle the real-life cover song task instead of just staying in the lab stage.
48
+
49
+ Different from conventional techniques, we propose CNNs for feature learning towards cover song identification. Utilizing specific kernels and dilated convolutions to extend the receptive field, we show that it could be used to capture melodic structures underlying the music and learn key-invariant representations. By casting the problem into a classification task, we train a model that is used for music version identification. Additionally, we design a training strategy to enhance the model’s robustness against tempo changes and to deal with inputs with different lengths. Combined with these techniques, our approach outperforms state-of-the-art methods on all public datasets with low time complexity. Furthermore, we show that this model could retrieve various music versions and discover similar music. Eventually, we believe our method is competent to solve real-life cover song problem.
1911.00384v2.txt ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Monte-Carlo Tree Search (MCTS) Coulom (2006) is an effective strategy for combining Monte-Carlo search with an incremental tree structure. MCTS is becoming increasingly popular in the community, especially after the outstanding results recently achieved in the game of Go Silver et al. (2016). In the last years, the MCTS research has mainly focused on effective ways of expanding the tree, performing rollouts, and backing up the average reward computed from rollouts to the parent nodes.We consider the Upper Confidence bound applied to Trees (UCT) algorithm Kocsis et al. (2006), which combines tree search with the well-known UCB1 sampling policy Auer et al. (2002), as an effective way of dealing with the action selection to expand the tree. In UCT, the estimate of the value of each node is computed performing multiple rollouts starting from the node, and updating the node’s value as the average of the collected rewards; then, the node’s value is backed up to the parent nodes that are updated with the average of the value of the children nodes. Since the action selection policy tends to favor the best actions in the long run, UCT has theoretical convergence guarantees to the optimal value. However, it has been shown that using the average reward for backup leads to an underestimation of the optimal value, slowing down the learning; on the other hand, using the maximum reward leads to an overestimation causing the same learning problems, especially in stochastic settings Coulom (2006). This problem is also evinced in the well-known Q𝑄Q-Learning algorithm Watkins (1989), where the maximum operator leads to overestimation of the optimal value Smith and Winkler (2006).Some variants of Q𝑄Q-Learning based on (weighted) mean operators have been successfully proposed to address this issue Hasselt (2010); D’Eramo et al. (2016).
2
+
3
+ In this paper, we introduce a novel backup operator based on a power mean Bullen (2013) that, through the tuning of a single coefficient, computes a value between the average reward and the maximum one. This allows to balance between the negatively biased estimate of the average reward, and the positively biased estimate of the maximum reward; in practice, this translates in balancing between a safe but slow update, and a greedy but misleading one. In the following, we propose a variant of UCT based on the power mean operator, which we call Power-UCT. We theoretically prove the convergence of Power-UCT, based on the consideration that the algorithm converges for all values between the range computed by the power mean.We empirically evaluate Power-UCT w.r.t. UCT and the recent MENTS algorithm Xiao et al. (2019) in classic MDP and POMDP benchmarks.Remarkably, we show how Power-UCT outperforms the baselines both in terms of quality and speed of learning.Thus, our contribution is twofold:1.We propose a new backup operator for UCT based on a power mean, and prove the convergence to the optimal values;2.We empirically evaluate the effectiveness of our approach comparing it with UCT in well-known MDPs and POMDPs, showing significantly better performance.The rest of this paper is organized as follows. First we describe related work. Next, we discuss background knowledge of MCTS, UCB and UCT. Then, we describe the power mean operator and introduce our Power-UCT algorithm. We derive theoretical results and prove convergence to the optimum for Power-UCT. Finally, we present empirical results in both MDP and POMDP problems, showing that Power-UCT outperforms baselines in MCTS.
4
+
5
+ Several works focus on adapting how UCB1 Auer et al. (2002) is applied to MCTS. For this purposeUCB1-tuned Auer et al. (2002) modifies the upper confidence bound of UCB1 to account for variance in order to improve exploration.Tesauro et al. (2012) propose a Bayesian version of UCT, which obtains better estimates of node values and uncertainties given limited experience. However,the Bayesian version of UCT is more computation-intensive.While most work on bandits in MCTS focuses on discrete actions,work on continuous action MCTS also exists Mansley et al. (2011).Since our MCTS algorithm is based on the UCTalgorithm, which is an extension of UCB1, ourmethod could be applied to all of these MCTS algorithms.
6
+
7
+ Many heuristic approaches based on specific domain knowledge have been proposed, such as adding a bonus term to value estimates based on domainknowledge Gelly and Wang (2006); Teytaud and Teytaud (2010); Childs et al. (2008); Kozelek (2009); Chaslot et al. (2008)or prior knowledge collected during policysearch Gelly and Silver (2007); Helmbold andParker-Wood (2009); Lorentz (2010); Tom (2010); Hoock et al. (2010).We point out that we provide a novel node value backup approach thatcould be applied in combination with all of these methods.
8
+
9
+ To improve upon UCT algorithm in MCTS,Khandelwal et al. (2016) formalizes and analyzes different on-policy and off-policy complex backup approaches for MCTS planning based on techniques in the Reinforcement Learning literature. Khandelwal et al. (2016) propose four complex backup strategies: MCTS(λ)𝜆(\lambda),MaxMCTS(λ)𝜆(\lambda), MCTSγ, MaxMCTSγ. Khandelwal et al. (2016) report that MaxMCTS(λ)𝜆(\lambda) and MaxMCTSγ perform better than UCT for certain setup of parameter. Vodopivec et al. (2017) proposed an approach calledSARSA-UCT, which performs the dynamic programming backups using SARSA Rummery (1995).Both Khandelwal et al. (2016) and Vodopivec et al. (2017) directlyborrow value backup ideas from Reinforcement Learning in order to estimatethe value at each tree node.However, they do not provide any proof of convergence.
10
+
11
+ Instead, our method provides a completely novel way of backing up valuesin each MCTS node using a power mean operator, for which we prove the convergence tothe optimal policy in the limit.The recently introduced MENTS algorithm Xiao et al. (2019), uses softmax backup operator at each node in combination with E2W policy, and shows better convergence rate w.r.t. UCT. Given its similarity to our approach, we empirically compare to it in the experimental section.
12
+
13
+ In this section, we first discuss an overview of Monte Carlo Tree Search method. Next, we discuss UCB algorithm and subsequently an extension of UCBto UCT algorithm. Finally, we discuss the definition of Power Mean operator and its properties.
14
+
15
+ MCTS combines tree search with Monte-Carlo sampling in order to build a tree, where states and actions are respectively modeled as nodes and edges, to compute optimal decisions. MCTS requires a generative black box simulator for generating a new state based on the current state and chosen action. The MCTS algorithm consists of a loop of four steps:–Selection: start from the root node, interleave action selection and sampling the next state (tree node) until a leaf node is reached–Expansion: expand the tree by adding a new edge (action) to the leaf node and sample a next state (new leaf node)–Simulation: rollout from the reached state to the end of the episode using random actions or a heuristic–Backup: update the nodes backwards along the trajectory starting from the end of the episode until the root node according to the rewards collectedIn the next subsection, we discuss UCB algorithm and its extension to UCT.
16
+
17
+ In this work, we consider the MCTS algorithm UCT (Upper Confidence bounds forTrees) Kocsis et al. (2006), an extensionof the well-known UCB1 Auer et al. (2002) multi-armed bandit algorithm. UCB1 choosesthe arm (action a𝑎a) usinga=arg​maxi∈{1​…​K}⁡X¯i,Ti​(n−1)+C​log⁡nTi​(n−1).𝑎subscriptargmax𝑖1…𝐾subscript¯𝑋𝑖subscript𝑇𝑖𝑛1𝐶𝑛subscript𝑇𝑖𝑛1\displaystyle a=\operatorname*{arg\,max}_{i\in\{1...K\}}\overline{X}_{i,T_{i}(n-1)}+C\sqrt{\frac{\log n}{T_{i}(n-1)}}.(1)where Ti​(n)=∑t=1n1​{t=i}subscript𝑇𝑖𝑛subscriptsuperscript𝑛𝑡11𝑡𝑖T_{i}(n)=\sum^{n}_{t=1}\textbf{1}\{t=i\} is the number oftimes arm i𝑖i is played up to time n𝑛n. X¯i,Ti​(n−1)subscript¯𝑋𝑖subscript𝑇𝑖𝑛1\overline{X}_{i,T_{i}(n-1)}denotes the average reward of arm i𝑖i up to time n−1𝑛1n-1 and C=2𝐶2C=\sqrt{2} is an exploration constant.In UCT, each node is a separate bandit, where the arms correspond to the actions, and the payoff is the reward of the episodes starting from them.In the backup phase, value is backed up recursively from the leaf node to the root asX¯n=∑i=1K(Ti​(n)n)​X¯i,Ti​(n).subscript¯𝑋𝑛subscriptsuperscript𝐾𝑖1subscript𝑇𝑖𝑛𝑛subscript¯𝑋𝑖subscript𝑇𝑖𝑛\displaystyle\overline{X}_{n}=\sum^{K}_{i=1}\Big{(}\frac{T_{i}(n)}{n}\Big{)}\overline{X}_{i,T_{i}(n)}.(2)Kocsis et al. (2006) proved that UCT converges in the limit to the optimal policy.
18
+
19
+ In this paper, we introduce a novel way of estimating theexpected value of a bandit arm (X¯i,Ti​(n−1)subscript¯𝑋𝑖subscript𝑇𝑖𝑛1\overline{X}_{i,T_{i}(n-1)} in(1)) in MCTS. For this purpose, we will use the powermean Mitrinovic andVasic (1970), an operator belonging to the family of functions for aggregating sets of numbers, that includes as special cases the Pythagorean means (arithmetic, geometric, and harmonic means):
20
+
21
+ With p=1𝑝1p=1 we obtain the weighted arithmetic mean. With p→0→𝑝0p\rightarrow 0 we have thegeometric mean, and with p=−1𝑝1p=-1 we have the harmonic mean Mitrinovic andVasic (1970)Furthermore, we get Mitrinovic andVasic (1970)Mn[−∞]​(X,w)=limp→−∞Mn[p]​(X,w)=Min​(X1,…,Xn),subscriptsuperscriptMdelimited-[]𝑛𝑋𝑤subscript→𝑝subscriptsuperscriptMdelimited-[]𝑝𝑛𝑋𝑤Minsubscript𝑋1…subscript𝑋𝑛\displaystyle\text{M}^{[-\infty]}_{n}(X,w)=\lim_{p\rightarrow-\infty}\text{M}^{[p]}_{n}(X,w)=\text{Min}(X_{1},...,X_{n}),(4)Mn[+∞]​(X,w)=limp→+∞Mn[p]​(X,w)=Max​(X1,…,Xn),subscriptsuperscriptMdelimited-[]𝑛𝑋𝑤subscript→𝑝subscriptsuperscriptMdelimited-[]𝑝𝑛𝑋𝑤Maxsubscript𝑋1…subscript𝑋𝑛\displaystyle\text{M}^{[+\infty]}_{n}(X,w)=\lim_{p\rightarrow+\infty}\text{M}^{[p]}_{n}(X,w)=\text{Max}(X_{1},...,X_{n}),(5)
22
+
23
+ The weighted arithmetic mean lies betweenMin​(X1,…,Xn)Minsubscript𝑋1…subscript𝑋𝑛\text{Min}(X_{1},...,X_{n}) and Max​(X1,…,Xn)Maxsubscript𝑋1…subscript𝑋𝑛\text{Max}(X_{1},...,X_{n}). Moreover,the following lemma shows that Mn[p]​(X,w)subscriptsuperscriptMdelimited-[]𝑝𝑛𝑋𝑤\text{M}^{[p]}_{n}(X,w) is an increasing function.
24
+
25
+ For the proof, see Mitrinovic andVasic (1970).∎
26
+
27
+ The following lemma shows that Power Mean can be upper bound by Average Mean plus with a constant.
28
+
29
+ Refer to Mitrinovic andVasic (1970).∎
30
+
31
+ As previously described, it is well known that performing backups using the average of the rewards results in an underestimate of the true value of the node, while using the maximum results in an overestimate of it Coulom (2006). Usually, the average backup is used when the number of simulations is low, for a conservative update of the nodes due to the lack of samples; on the other hand, the maximum operator is favoured when the number of simulations is high. We address this problem proposing a novel backup operator for UCT based on the power mean (Equation 3):X¯n​(p)=(∑i=1K(Ti​(n)n)​X¯i,Ti​(n)p)1p.subscript¯𝑋𝑛𝑝superscriptsubscriptsuperscript𝐾𝑖1subscript𝑇𝑖𝑛𝑛superscriptsubscript¯𝑋𝑖subscript𝑇𝑖𝑛𝑝1𝑝\displaystyle\overline{X}_{n}(p)=\left(\sum^{K}_{i=1}\left(\frac{T_{i}(n)}{n}\right)\overline{X}_{i,T_{i}(n)}^{p}\right)^{\frac{1}{p}}.(11)This way, we bridge the gap between the average and maximum estimators with the purpose of getting the advantages of both. We call our approach Power-UCT and describe it in more detail in the following.
32
+
33
+ The introduction of our novel backup operator in UCT does not require major changes to the algorithm. Indeed, the Power-UCT pseudocode shown in Algorithm 1 is almost identical to the UCT one, with the only differences in lines 36 and 49. MCTS has two typeof nodes: V_Nodes corresponding to the state-value, and Q_Nodes corresponding to state-action values. An action is taken from the V_Node of the current state leading to the respective Q_Node, then it leads to the V_Node of the reached state. We skip the description of all the procedures since they are well-known components of MCTS, and we focus only on the ones involved in the use of the power mean backup operator.In SIMULATE_V, Power-UCT updates the value of each V_Node using the power mean of its children Q_Nodes, that are computed in SIMULATE_Q. Note that our algorithm could be applied to several bandit based enhancements of UCT, but for simplicity we only focus on UCT.
34
+
35
+ In this section, we show that Power-UCT  can smoothly adapt to all theorems of UCT Kocsis et al. (2006). The following results can be seen as a generalization of the results for UCT, as we consider a generalized mean instead of a standard mean as the backup operator.Our main results are Theorem 6 and Theorem 7, which respectively prove the convergence of failure probability at the root node, and derive the bias of power mean estimated payoff.In order to prove them, we start with Theorem 1 to show the concentration of power mean with respect to i.i.d random variables X𝑋X. Subsequently, Theorem 2 shows the upper bound of the expected number of times when a suboptimal arm is played.Theorem 3 bounds the expected error of the power mean estimation.Theorem 4 shows the lower bound of the number of times any arm is played.Theorem 5 shows the concentration of power mean backup around its mean value at each node in the tree222Refer to Dam et al. (2019) for proofs of lemmas and theorems..
36
+
37
+ Theorem 1 is derived using the upper bound of the power mean operator, which corresponds to the average mean incremented by a constant Mitrinovic andVasic (1970) and Chernoff’s inequality.Note that this result can be considered a generalization of the well-known Hoeffding inequality to power mean. Next, given i.i.d. random variables Xi​tsubscript𝑋𝑖𝑡X_{it} (t=1,2,…) as the payoff sequence at any internal leaf node of the tree, we assume the expectation of the payoff exists and let μi​n=𝔼⁡[Xi​n¯]subscript𝜇𝑖𝑛𝔼¯subscript𝑋𝑖𝑛\mu_{in}=\operatorname{\mathbb{E}}[\overline{X_{in}}]. We assume the power mean reward drifts as a function of time and converges only in the limit, which means thatμi=limn→∞μi​n.subscript𝜇𝑖subscript→𝑛subscript𝜇𝑖𝑛\displaystyle\mu_{i}=\lim_{n\rightarrow\infty}{\mu_{in}}.Let δi​n=μi−μi​nsubscript𝛿𝑖𝑛subscript𝜇𝑖subscript𝜇𝑖𝑛\delta_{in}=\mu_{i}-\mu_{in} which also means thatlimn→∞δi​n=0.subscript→𝑛subscript𝛿𝑖𝑛0\displaystyle\lim_{n\rightarrow\infty}{\delta_{in}}=0.From now on, let ∗* be the upper index for all quantities related to the optimal arm. By assumption, the rewards lie between 00 and 111. Let’s start with an assumption:
38
+
39
+ Under Assumption 1, a suitable choice for the bias sequence ct,ssubscript𝑐𝑡𝑠c_{t,s} is given byct,s=2​C​log⁡ts.subscript𝑐𝑡𝑠2𝐶𝑡𝑠\displaystyle c_{t,s}=2C\sqrt{\frac{\log{t}}{s}}.(14)where C is an exploration constant.Next, we derive Theorems 2, 3, and 4 following the derivations in Kocsis et al. (2006).First, from Assumption 1, we derive an upper bound on the error for the expected number of times suboptimal arms are played.
40
+
41
+ Next, we derive our version of Theorem 3 in Kocsis et al. (2006), which computes the upper bound of the difference between the value backup of an arm with μ∗superscript𝜇\mu^{*} up to time n𝑛n.
42
+
43
+ A lower bound for the times choosing any arm follows:
44
+
45
+ For deriving the concentration of estimated payoff around its mean,we modify Lemma 14 in Kocsis et al. (2006) for power mean: in the proof, wefirst replace the partial sums term with a partial mean termand modify the following equations accordingly. The partial mean term can then be easily replaced by a partial power mean term and we get
46
+
47
+ Based on the results from Lemma 7, we derive the concentration of estimated payoff around its mean.
48
+
49
+ Using The Hoeffding-Azuma inequality for Stopped Martingales Inequality (Lemma 10 in Kocsis et al. (2006)), under Assumption 1 and the result from Theorem 4 we get
50
+
51
+ And finally, the following is our main result showing the expected payoff of our Power-UCT.
52
+
53
+ In this section, we aim to answer the following questions empirically: Does the Power Mean offer higher performance in MDP and POMDP MCTS tasks than the regular Mean? How does the value of p𝑝p influence the overall performance? How does Power-UCT, our MCTS algorithm based on the Power Mean, compare to state-of-the-art methods in tree-search? We choose the recent MENTS algorithm Xiao et al. (2019), that introduces a maximum entropy policy optimization framework for MCTS, and shows better convergence rate w.r.t. UCT.
54
+
55
+ For MENTS we find the best combination of the two hyper-parameters by grid search. In MDP tasks, we find the UCT exploration constant using grid search. For Power-UCT, we find the p𝑝p-value by increasing it until performance starts to decrease.
56
+
57
+ For MDPs, we consider the well-known FrozenLake problem as implemented in OpenAI Gym Brockman et al. (2016). In this problem, the agent needs to reach a goal position in an 8x8 ice grid-world while avoiding falling into the water by stepping onto unstable spots. The challenge of this task arises from the high-level of stochasticity, which makes the agent only move towards the intended direction one-third of the time, and into one of the two tangential directions the rest of it. Reaching the goal position yields a reward of 111, while all other outcomes (reaching the time limit or falling into the water) yield a reward of zero. As can be seen in Table 1, Power-UCT improves the performance compared to UCT. Power-UCT outperforms MENTS when the number of simulations increases.
58
+
59
+ Now, we aim to answer the question of how Power-UCT scales to domains with a large number of actions (high branching factor). We use the OpenAI gym Copy environment where the agent needs to copy the characters on an input band to an output band. The agent can move and read the input band at every time-step and decide to write a character from an alphabet to the output band. Hence, the number of actions scales with the size of the alphabet.
60
+
61
+ Contrary to the previous experiments, there is only one initial run of tree-search and afterwards, no re-planning between two actions occurs. Hence, all actions are selected according to the value estimates from the initial search. The results in Tables 2(a) and 2(b) show that Power-UCT allows to solve the task much quicker than regular UCT. Furthermore, we observe that MENTS and Power-UCT for p=∞𝑝p=\infty exhibit larger variance compared to Power-UCT with a finite value of p𝑝p and are not able to reliably solve the task, as they do not reach the maximum reward of 404040 with 00 standard deviation.
62
+
63
+ In POMDP problems, we compare Power-UCT against the POMCP algorithm Silver and Veness (2010) which is a standard UCT algorithm for POMDPs.Since the state is not fully observable in POMDPs, POMCP assigns a unique action-observation history, which is a sufficient statistic for optimal decision making in POMDPs, instead of the state, to each tree node. Similarly to fully observable UCT, POMCP chooses actions using the UCB1 bandit. Therefore, we modify POMCP to use the power mean identically to how we modified fully observable UCT and get a POMDP version of Power-UCT. We also modify POMCP similarly for the MENTS approach.Next, we discuss the evaluation of the POMDP based Power-UCT, MENTS, and POMCP, in the rocksample and pocman environments Silver and Veness (2010).In both problems, we scale the rewards into [0,1] for MCTS planning and show the plot with real reward scale.
64
+
65
+ The rocksample (n,k) (Smith and Simmons (2004)) simulates a Mars explorer robotin an n𝑛n x n𝑛n grid containing k rocks. The task is to determinewhich rocks are valuable using a long range sensor, take samples of valuable rocks and to finally leavethe map to the east. There are k+5𝑘5k+5 actions where the agent can move in four directions (North, South, East, West), sample a rock, or sense one of the k𝑘k rocks. Rocksample requires strong exploration to find informative actions which do not yield immediate reward but may yield high long term reward.We use three variants with a different number of actions: rocksample (11,11), rocksample (15,15), rocksample (15,35) and set the exploration constant as in Silver and Veness (2010) to the difference of the maximum and minimum immediate reward.In Fig. 2, Power-UCT outperforms POMCP for almost all values of p𝑝p. For sensitivity analysis, Fig. 1 shows the performance of Power-UCT in rocksample (11x11) for different p𝑝p-values at 65536 simulations. Fig. 1 suggests that at least in rocksample finding a good p𝑝p-value is straightforward. Fig. 3 shows that Power-UCT significantly outperforms MENTS in rocksample (11,11). A possible explanation for the strong difference in performance between MENTS and Power-UCT is that MENTS may not explore sufficiently in this task. However, this would require more in depth analysis of MENTS.
66
+
67
+ We further evaluate our algorithm in the pocman problem Silver and Veness (2010). In pocman,an agent called PocMan must travel in a maze of size (17x19) by only observing the local neighborhood in the maze. PocMan tries to eat as many food pellets as possible. Four ghosts try to kill PocMan. After moving initially randomly the ghosts start to follow directions with a high number of food pellets more likely.If PocMan eats a power pill, he is able to eat ghosts for 151515 time steps.PocMan receives a reward of −11-1 at each step he travels, +1010+10 for eating each food pellet, +2525+25 for eating a ghost and −100100-100 for dying. The pocman problem has 444 actions, 102410241024 observations, and approximately 1056superscript105610^{56} states.Table 3 shows that Power-UCT and MENTS outperform POMCP.
68
+
69
+ We proposed to use power mean as a novel backup operator in MCTS, and derived a variant of UCT based on this operator, which we call Power-UCT. We theoretically prove the convergence of Power-UCT to the optimal value, given that the value computed by the power mean lies between the average and the maximum. The empirical evaluation on stochastic MDPs and POMDPs, shows the advantages of Power-UCT w.r.t. other baselines.
70
+
71
+ Possible future work includes the proposal of a theoretically justified or heuristic approach to adapt the greediness of power mean.Moreover, we are interested in analysing the bias and variance of the power mean estimator, or analyse the regret bound of Power-UCT  in MCTS.Furthermore, we plan to test our methodology in more challenging Reinforcement Learning problems through the use of parametric function approximators, e.g. neural networks.
1911.00465v2.txt ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Learning to rank is fundamental to information retrieval, E-commerce, and many other applications, for ranking items [1]. In this work we focus on document retrieval without loss of generality. Document retrieval (i.e., document ranking) has applications in large-scale item search engines, which can generally be described as follows: There is a collection of documents (items). Given a query (e.g. a query entered by a user in the search engine), the ranking function assigns a score to each document, quantifying the relative relevance of the document to the query. The documents are ranked in the descending order based on these scores and the top ranked ones are returned.
2
+
3
+ Traditional approaches rank documents based on unsupervised models of words appearing in the documents and query and do not need any training [2]. Supervised machine learning for ranking has become popular due to the availability of more signals related to relevance of documents, such as click items or search log data [1].
4
+
5
+ The bulk of machine learning methods for learning to rank can roughly be categorized as pointwise, pairwise and listwise methods. Pointwise methods cast the ranking problem as a regression problem for predicting relevance scores [3] or a multiple ordinal classification to predict categorical relevance levels [4]. Pairwise approaches take document pairs asinstances in learning, and formalize the learning-to-rank problem as that of classification. More precisely, they collect document pairs to query the relative ranking from the underlying unknown ranking lists. Classification models are then trained with the labeled data for ranking [5]. Finally, listwise methods use ranked document lists instead of document pairs as instances in learning and define an optimization loss function over the entire ranked list(s) [6].
6
+
7
+ In this paper, we propose a new framework for supervised learning to rank. Specifically, we define a scoring function that maps the input vector of features for a document to the probability parameters of a categorical distribution, where each category represents the relative relevance of the input document to the query. We then define the objective function of learning-to-rank as the expectation of a loss function, which determines the distance between predicted and true relevance labels of the input document, with respect to the categorical distribution parameterized by the scoring function. To achieve a rich family of ranking algorithms, we employ neural networks as scoring functions.
8
+
9
+ Due to its novel discrete structure, we exploit stochastic gradient based optimization to learn the parameters of the scoring function. The main difficulty arises when backpropagating the gradients through categorical variables. The recently proposed augment-REINFORCE-swap-merge(ARSM) [7] gradient estimator provides a natural solution with unbiased low-variance gradient updates during the training of our proposed learning-to-rank framework. ARSM first uses variable augmentation, REINFORCE [8], and Rao-Blackwellization [9] to re-express the gradient as anexpectation under the Dirichlet distribution, then uses variable swapping to construct differentlyexpressed but equivalent expectations, and finally shares common random numbers between these expectations to achieve significant variance reduction.
10
+
11
+ The proposed framework, hereby referred to as ARSM-L2R, has main advantage over the existing learning-to-rank methods. More precisely, due to the utilization of ARSM gradient estimator, the loss function assessing the distance between predicted and true document relevance labels need not be differentiable. This significantly enriches the choices of loss functions that can be employed. Specifically, in our experiments, we optimize the truncated normalized discounted cumulative gain (NDCG) [10].
12
+
13
+ Comprehensive experiments conducted on benchmark datasets demonstrate that our proposed ARSM-L2R method achieves better or comparable results with pairwise and listwise approaches in terms of common ranking metrics such as truncated NDCG and mean average precision (MAP).
14
+
15
+ The remainder of this paper is organized as follows. In Section 2, we present the methodology, including the new formulation of ARSM-L2R for supervised learning to rank, and its parameter estimation using Monte Carlo gradient estimates. Section 3 provides comprehensive experimental results for comparison with several existing learning-to-rank methods. The paper is concluded in Section 4.
16
+
17
+ In the supervised learning-to-rank setting, a set of queries Q={q(1),…,q(N)}𝑄superscript𝑞1…superscript𝑞𝑁Q=\{q^{(1)},...,q^{(N)}\} is given. Each query q(i)superscript𝑞𝑖q^{(i)} is associated with a list of documents 𝒅(i)=[d1(i),…,dn(i)(i)]superscript𝒅𝑖superscriptsubscript𝑑1𝑖…superscriptsubscript𝑑superscript𝑛𝑖𝑖\boldsymbol{d}^{(i)}=[d_{1}^{(i)},...,d_{n^{(i)}}^{(i)}], where dj(i)superscriptsubscript𝑑𝑗𝑖d_{j}^{(i)} and n(i)superscript𝑛𝑖n^{(i)} denote the j𝑗jth document and size of 𝒅(i)superscript𝒅𝑖\boldsymbol{d}^{(i)} respectively. In addition, a list of scores 𝒚(i)=[y1(i),…,yn(i)(i)]superscript𝒚𝑖superscriptsubscript𝑦1𝑖…superscriptsubscript𝑦superscript𝑛𝑖𝑖\boldsymbol{y}^{(i)}=[y_{1}^{(i)},...,y_{n^{(i)}}^{(i)}] is available for each list of documents 𝒅(i)superscript𝒅𝑖\boldsymbol{d}^{(i)}. The score yj(i)superscriptsubscript𝑦𝑗𝑖y_{j}^{(i)} represents the relevance degree of document dj(i)superscriptsubscript𝑑𝑗𝑖d_{j}^{(i)} to query q(i)superscript𝑞𝑖q^{(i)}, and can be a judgment score explicitly or implicitly given by humans [6]. Higher scores imply more relevant documents.
18
+
19
+ For each query-document pair (q(i),dj(i))superscript𝑞𝑖superscriptsubscript𝑑𝑗𝑖(q^{(i)},d_{j}^{(i)}), a P𝑃P-dimensional vector of features 𝒙j(i)superscriptsubscript𝒙𝑗𝑖\boldsymbol{x}_{j}^{(i)} is constructed. The training set is represented as {(𝒙(i),𝒚(i))}i=1Nsuperscriptsubscriptsuperscript𝒙𝑖superscript𝒚𝑖𝑖1𝑁\big{\{}(\boldsymbol{x}^{(i)},\boldsymbol{y}^{(i)})\big{\}}_{i=1}^{N}. The objective of learning is to create ranking functions that map the input query-document features to scores resembling the true relevant scores. In the following discussions, we drop the query index (i)𝑖(i) to avoid cluttering the notations.
20
+
21
+ In this paper, we formulate the supervised learning-to-rank problem as maximizing an objective, expressed as an expectation over multivariate categorical variables. More specifically, given n𝑛n documents for a query, let zj∈{1,…,C}subscript𝑧𝑗1…𝐶z_{j}\in\{1,\ldots,C\} denote the relevance label for j𝑗jth document, where C𝐶C is the number of possible levels of relevance for each document. In our proposed generative model, each zjsubscript𝑧𝑗z_{j} is distributed according to a categorical distribution whose probabilities are constructed based on a scoring function 𝒯𝜽:ℝP→ℝC:subscript𝒯𝜽→superscriptℝ𝑃superscriptℝ𝐶\mathcal{T}_{\boldsymbol{\theta}}:\mathbb{R}^{P}\rightarrow\mathbb{R}^{C} parameterized by 𝜽𝜽\boldsymbol{\theta}:zj∼Cat​(σ​(ϕj)),ϕj=𝒯𝜽​(𝒙j).formulae-sequencesimilar-tosubscript𝑧𝑗Cat𝜎subscriptbold-italic-ϕ𝑗subscriptbold-italic-ϕ𝑗subscript𝒯𝜽subscript𝒙𝑗z_{j}\sim\mbox{Cat}(\sigma(\boldsymbol{\phi}_{j})),\quad\boldsymbol{\phi}_{j}=\mathcal{T}_{\boldsymbol{\theta}}(\boldsymbol{x}_{j}).(1)Here σ​(ϕj)=(eϕj​1,…,eϕj​C)/∑c=1Ceϕj​c𝜎subscriptbold-italic-ϕ𝑗superscript𝑒subscriptitalic-ϕ𝑗1…superscript𝑒subscriptitalic-ϕ𝑗𝐶superscriptsubscript𝑐1𝐶superscript𝑒subscriptitalic-ϕ𝑗𝑐\sigma(\boldsymbol{\phi}_{j})=(e^{\phi_{j1}},...,e^{\phi_{jC}})/\sum_{c=1}^{C}e^{\phi_{jc}} is the softmax function. We use multi-layer perceptrons (MLPs) as scoring functions, thus 𝜽𝜽\boldsymbol{\theta} corresponds to the collection of weight matrices of MLPs. For each realization of categorical variables 𝒛=(z1,…,zn)𝒛subscript𝑧1…subscript𝑧𝑛\boldsymbol{z}=(z_{1},...,z_{n}), we employ a loss function ℓℓ\ell to determine their distance from the true labels 𝒚=(y1,…,yn)𝒚subscript𝑦1…subscript𝑦𝑛\boldsymbol{y}=(y_{1},...,y_{n}). We then define the learning-to-rank optimization problem as finding:𝜽^^𝜽\displaystyle\hat{\boldsymbol{\theta}}=\displaystyle=arg⁡min𝜽⁡𝔼z∼∏j=1nCat​(zj;σ​(ϕ))​[ℓ​(𝒛,𝒚)]subscript𝜽subscript𝔼similar-to𝑧superscriptsubscriptproduct𝑗1𝑛Catsubscript𝑧𝑗𝜎bold-italic-ϕdelimited-[]ℓ𝒛𝒚\displaystyle\arg\min_{\boldsymbol{\theta}}\mathbb{E}_{z\sim\prod_{j=1}^{n}\mbox{Cat}(z_{j};\sigma(\boldsymbol{\phi}))}[\ell(\boldsymbol{z},\boldsymbol{y})](2):=assign\displaystyle:=arg⁡min𝜽⁡ℰ​(𝚽),subscript𝜽ℰ𝚽\displaystyle\arg\min_{\boldsymbol{\theta}}\mathcal{E}(\boldsymbol{\Phi}),where ℓ​(⋅,⋅)ℓ⋅⋅\ell(\cdot,\cdot) can be any loss function measuring the dissimilarity of two vectors of ordinal labels. We resort to stochastic gradient based methods to solve the optimization problem in (2). Backpropagating the gradient through discrete latent variables have been recently studied extensively [11, 7, 12, 13]. For optimizing (2), the challenge lies in developing a low-variance and unbiased estimator for its gradient with respect to ϕbold-italic-ϕ\boldsymbol{\phi}, which is denoted by ∇ϕℰ​(𝚽)subscript∇bold-italic-ϕℰ𝚽\nabla_{\boldsymbol{\phi}}\mathcal{E}(\boldsymbol{\Phi}).
22
+
23
+ We employ Augment-REINFORCE-Swap-Merge (ARSM) gradient estimator for training the scoring functions described in the previous section. To describe this algorithm, we start by the simple objective function ℰ​(ϕ):=𝔼z∼Cat​(σ​(ϕ))​[f​(z)]assignℰbold-italic-ϕsubscript𝔼similar-to𝑧Cat𝜎bold-italic-ϕdelimited-[]𝑓𝑧\mathcal{E}(\boldsymbol{\phi}):=\mathbb{E}_{z\sim\mbox{Cat}(\sigma(\boldsymbol{\phi}))}[f(z)] with respect to a univariate categorical variable, where f​(z)𝑓𝑧f(z) is the reward function and ϕ:=(ϕ1,…,ϕC)assignbold-italic-ϕsubscriptitalic-ϕ1…subscriptitalic-ϕ𝐶\boldsymbol{\phi}:=(\phi_{1},\ldots,\phi_{C}). In the augmentation step, the gradient of ℰ​(ϕ)ℰbold-italic-ϕ\mathcal{E}(\boldsymbol{\phi}) can be expressed as an expectation under a Dirichlet distribution as∇ϕcℰ​(ϕ)subscript∇subscriptitalic-ϕ𝑐ℰbold-italic-ϕ\displaystyle\nabla_{\phi_{c}}\mathcal{E}(\boldsymbol{\phi})=\displaystyle=𝔼𝝅∼Dir​(𝟏C)​[f​(z)​(1−C​πc)],subscript𝔼similar-to𝝅Dirsubscript1𝐶delimited-[]𝑓𝑧1𝐶subscript𝜋𝑐\displaystyle\mathbb{E}_{\boldsymbol{\pi}\sim\mbox{Dir}(\boldsymbol{1}_{C})}[f(z)(1-C\pi_{c})],z𝑧\displaystyle z:=assign\displaystyle:=arg⁡mink∈{1,…,C}⁡πk​e−ϕk.subscript𝑘1…𝐶subscript𝜋𝑘superscript𝑒subscriptitalic-ϕ𝑘\displaystyle\arg\min_{k\in\{1,\ldots,C\}}\pi_{k}e^{-\phi_{k}}.(3)Given the vector 𝝅𝝅\boldsymbol{\pi}, we denote the vector obtained after swapping k𝑘kth and m𝑚mth elements of 𝝅𝝅\boldsymbol{\pi} as 𝝅m⇌k:=(π1m⇌k,…,πCm⇌k)assignsuperscript𝝅⇌𝑚𝑘superscriptsubscript𝜋1⇌𝑚𝑘…superscriptsubscript𝜋𝐶⇌𝑚𝑘\boldsymbol{\pi}^{m\rightleftharpoons k}:=(\pi_{1}^{m\rightleftharpoons k},\ldots,\pi_{C}^{m\rightleftharpoons k}), where πmm⇌k=πksuperscriptsubscript𝜋𝑚⇌𝑚𝑘subscript𝜋𝑘\pi_{m}^{m\rightleftharpoons k}=\pi_{k}, πkm⇌k=πmsuperscriptsubscript𝜋𝑘⇌𝑚𝑘subscript𝜋𝑚\pi_{k}^{m\rightleftharpoons k}=\pi_{m} and for c∉{m,k}𝑐𝑚𝑘c\notin\{m,k\} we have πcm⇌k=πcsuperscriptsubscript𝜋𝑐⇌𝑚𝑘subscript𝜋𝑐\pi_{c}^{m\rightleftharpoons k}=\pi_{c}. Exploiting the symmetrical property 𝝅m⇌k∼Dir​(𝟏C)similar-tosuperscript𝝅⇌𝑚𝑘Dirsubscript1𝐶\boldsymbol{\pi}^{m\rightleftharpoons k}\sim\mbox{Dir}(\boldsymbol{1}_{C}), and sharing common random numbers between different expectations to significantly reduceMonte Carlo integration variance leads to another unbiased estimator referred as ARS estimator:∇ϕcℰ​(ϕ)subscript∇subscriptitalic-ϕ𝑐ℰbold-italic-ϕ\displaystyle\nabla_{\phi_{c}}\mathcal{E}(\boldsymbol{\phi})=\displaystyle=𝔼𝝅∼Dir​(𝟏C)​[fΔc⇌k​(1−C​πk)],subscript𝔼similar-to𝝅Dirsubscript1𝐶delimited-[]superscriptsubscript𝑓Δ⇌𝑐𝑘1𝐶subscript𝜋𝑘\displaystyle\mathbb{E}_{\boldsymbol{\pi}\sim\mbox{Dir}(\boldsymbol{1}_{C})}[f_{\Delta}^{c\rightleftharpoons k}(1-C\pi_{k})],fΔc⇌ksuperscriptsubscript𝑓Δ⇌𝑐𝑘\displaystyle f_{\Delta}^{c\rightleftharpoons k}:=assign\displaystyle:=f​(zc⇌k)−1C​∑m=1Cf​(zm⇌k),𝑓superscript𝑧⇌𝑐𝑘1𝐶superscriptsubscript𝑚1𝐶𝑓superscript𝑧⇌𝑚𝑘\displaystyle f(z^{c\rightleftharpoons k})-\frac{1}{C}\sum_{m=1}^{C}f(z^{m\rightleftharpoons k}),(4)where zc⇌k:=arg⁡mink′∈{1,…,C}⁡πk′c⇌k​e−ϕk′assignsuperscript𝑧⇌𝑐𝑘subscriptsuperscript𝑘′1…𝐶superscriptsubscript𝜋superscript𝑘′⇌𝑐𝑘superscript𝑒subscriptitalic-ϕsuperscript𝑘′z^{c\rightleftharpoons k}:=\arg\min_{k^{\prime}\in\{1,\ldots,C\}}\pi_{k^{\prime}}^{c\rightleftharpoons k}e^{-\phi_{k^{\prime}}} and k𝑘k is the reference category. Finally, the ARS estimator can be further improved by considering all swap operations, and adding a merge step to construct the ARSM estimator as∇ϕcℰ​(ϕ)=𝔼𝝅∼Dir​(𝟏C)​[∑k=1CfΔc⇌k​(1/C−πk)].subscript∇subscriptitalic-ϕ𝑐ℰbold-italic-ϕsubscript𝔼similar-to𝝅Dirsubscript1𝐶delimited-[]superscriptsubscript𝑘1𝐶superscriptsubscript𝑓Δ⇌𝑐𝑘1𝐶subscript𝜋𝑘\displaystyle\nabla_{\phi_{c}}\mathcal{E}(\boldsymbol{\phi})=\mathbb{E}_{\boldsymbol{\pi}\sim\mbox{Dir}(\boldsymbol{1}_{C})}\Big{[}\sum_{k=1}^{C}f_{\Delta}^{c\rightleftharpoons k}(1/C-\pi_{k})\Big{]}.(5)
24
+
25
+ To employ ARSM for learning to rank, we need to consider the optimization problem with respect to the multivariate categorical variables 𝒛=(z1,…,zn)𝒛subscript𝑧1…subscript𝑧𝑛\boldsymbol{z}=(z_{1},...,z_{n}). Let 𝒛c⇌k=(z1c⇌k,…,znc⇌k)superscript𝒛⇌𝑐𝑘superscriptsubscript𝑧1⇌𝑐𝑘…superscriptsubscript𝑧𝑛⇌𝑐𝑘\boldsymbol{z}^{c\rightleftharpoons k}=(z_{1}^{c\rightleftharpoons k},...,z_{n}^{c\rightleftharpoons k}) denote the multivariate swapping whose elements are defined, similar to those in (4) and (5), as zjc⇌k:=arg⁡mink′∈{1,…,C}⁡πj​k′c⇌k​e−ϕj​k′assignsuperscriptsubscript𝑧𝑗⇌𝑐𝑘subscriptsuperscript𝑘′1…𝐶superscriptsubscript𝜋𝑗superscript𝑘′⇌𝑐𝑘superscript𝑒subscriptitalic-ϕ𝑗superscript𝑘′z_{j}^{c\rightleftharpoons k}:=\arg\min_{k^{\prime}\in\{1,...,C\}}\pi_{jk^{\prime}}^{c\rightleftharpoons k}e^{-\phi_{jk^{\prime}}}. Then the multivariate extension of ARSM gradient estimator for the learning-to-rank objective in (2) can be expressed as [7]:∇ϕj​cℰ​(𝚽)=𝔼𝚷∼∏j=1nDir​(𝝅j;𝟏C)​[∑k=1CℓΔc⇌k​(1/C−πj​k)],subscript∇subscriptitalic-ϕ𝑗𝑐ℰ𝚽subscript𝔼similar-to𝚷superscriptsubscriptproduct𝑗1𝑛Dirsubscript𝝅𝑗subscript1𝐶delimited-[]superscriptsubscript𝑘1𝐶superscriptsubscriptℓΔ⇌𝑐𝑘1𝐶subscript𝜋𝑗𝑘\nabla_{\phi_{jc}}\mathcal{E}(\boldsymbol{\Phi})=\mathbb{E}_{\boldsymbol{\Pi}\sim\prod_{j=1}^{n}\mbox{Dir}(\boldsymbol{\pi}_{j};\boldsymbol{1}_{C})}\Big{[}\sum_{k=1}^{C}\ell_{\Delta}^{c\rightleftharpoons k}(1/C-\pi_{jk})\Big{]},(6)where ℓΔc⇌k=ℓ​(𝒛c⇌k,𝒚)−1C​∑m=1Cℓ​(𝒛m⇌k,𝒚)superscriptsubscriptℓΔ⇌𝑐𝑘ℓsuperscript𝒛⇌𝑐𝑘𝒚1𝐶superscriptsubscript𝑚1𝐶ℓsuperscript𝒛⇌𝑚𝑘𝒚\ell_{\Delta}^{c\rightleftharpoons k}=\ell(\boldsymbol{z}^{c\rightleftharpoons k},\boldsymbol{y})-\frac{1}{C}\sum_{m=1}^{C}\ell(\boldsymbol{z}^{m\rightleftharpoons k},\boldsymbol{y}). Since we define the categorical distribution parameter 𝚽𝚽\boldsymbol{\Phi} in terms of a neural network with parameters 𝜽𝜽\boldsymbol{\theta}, the final gradients are computed using the chain rule as∇𝜽ℰ​(𝚽)subscript∇𝜽ℰ𝚽\displaystyle\nabla_{\boldsymbol{\theta}}\mathcal{E}(\boldsymbol{\Phi})=\displaystyle=∑j=1n∑c=1C∇ϕj​cℰ​(𝚽)​∂ϕj​c∂𝜽superscriptsubscript𝑗1𝑛superscriptsubscript𝑐1𝐶subscript∇subscriptitalic-ϕ𝑗𝑐ℰ𝚽subscriptitalic-ϕ𝑗𝑐𝜽\displaystyle\sum_{j=1}^{n}\sum_{c=1}^{C}\nabla_{\phi_{jc}}\mathcal{E}(\boldsymbol{\Phi})\frac{\partial\phi_{jc}}{\partial\boldsymbol{\theta}}(7)=\displaystyle=∇𝜽(∑j=1n∑c=1C∇ϕj​cℰ​(𝚽)​ϕj​c).subscript∇𝜽superscriptsubscript𝑗1𝑛superscriptsubscript𝑐1𝐶subscript∇subscriptitalic-ϕ𝑗𝑐ℰ𝚽subscriptitalic-ϕ𝑗𝑐\displaystyle\nabla_{\boldsymbol{\theta}}\Big{(}\sum_{j=1}^{n}\sum_{c=1}^{C}\nabla_{\phi_{jc}}\mathcal{E}(\boldsymbol{\Phi})\phi_{jc}\Big{)}.
26
+
27
+ The estimated gradients are then utilized in a stochastic optimization process to learn the model parameters. Algorithm 1 summarizes the parameter learning for ARSM-L2R.
28
+
29
+ The loss function ℓ​(𝒛,𝒚)ℓ𝒛𝒚\ell(\boldsymbol{z},\boldsymbol{y}) in (2) measures the dissimilarity between predicted categorical labels 𝒛𝒛\boldsymbol{z} and the true labels 𝒚𝒚\boldsymbol{y}. In this work, we utilize the negative truncated NDCG as the loss function of ARSM-L2R. The calculation of NDCG only relies on the sorting of the predicted labels 𝒛𝒛\boldsymbol{z}, and the true labels 𝒚𝒚\boldsymbol{y}. Furthermore, our experiments show that setting the number of possible levels of relevance C𝐶C to be higher than the number of true levels in 𝒚𝒚\boldsymbol{y} improves the performance of ARSM-L2R. Hence, for all experiments in this paper we set C=20𝐶20C=20.
30
+
31
+ After the parameters of the scoring function are learned in the training phase, the probability of different levels of relevance for the test documents can be calculated by simply passing the documents features through the scoring function. We then construct the final scores of the test documents by a weighted combination of these probabilities, and sort the documents based on these scores. More precisely, given the probability of different labels pcsubscript𝑝𝑐p_{c} for a test document, we calculate its overall ranking score as ∑c=1Cc×pcsuperscriptsubscript𝑐1𝐶𝑐subscript𝑝𝑐\sum_{c=1}^{C}c\times p_{c}, where c∈{1,2,…,C}𝑐12…𝐶c\in\{1,2,\ldots,C\} and higher values of c𝑐c correspond to more relevant levels. Our experiments show that the performance of ARSM-L2R is not sensitive to the choice of the weight combination scheme.
32
+
33
+ We evaluate the performance of ARSM-L2R on two widely tested benchmark datasets, including a query set from Million Query track of TREC 2007, denoted as MQ2007 [14], as well as the OHSUMED dataset [15]. Each dataset consists of queries, corresponding retrieved documents and labels provided by human experts. The possible relevance labels for each document are “relevant”, “partially relevant”, and “not relevant”. We use the 5-fold partitions provided in the original dataset for 5-fold cross validation in the experiments. In each fold, there are three subsets forlearning: training set, validation set and testing set. The properties of these learning to rank datasets are presented in Table 1.
34
+
35
+ We compare the performance of our ARSM-L2R with several state-of-the-art baselines, including a pairwise method of RankSVM [16], a listwise method of ListNet [6], and other listwise methods that optimize lower bounds of different evaluation measures: AdaRank-MAP, and AdaRank-NDCG [17].
36
+
37
+ We use two popular learning-to-rank scoring functions to compare the predicted rankings of the test documents with their true rankings: truncated Normalized Discounted Cumulative Gain (NDCG@R𝑅R) [10] and Mean Average Precision (MAP) [18]. NDCG (DCG) has the effect ofgiving high scores to the ranking lists in which relevantdocuments are ranked high. Average Precision (AP) represents the averaged precision over all the positions of documents with relevant label for query q(i)superscript𝑞𝑖q^{(i)}. Denoting the ranking list 𝒓(i)superscript𝒓𝑖\boldsymbol{r}^{(i)} on 𝒅(i)superscript𝒅𝑖\boldsymbol{d}^{(i)}, MAP is defined asMAP=1N​∑i=1NAP​(q(i))=1N​∑i=1N∑j=1n(i)wj(i)​yj(i)∑j=1n(i)yj(i),MAP1𝑁superscriptsubscript𝑖1𝑁APsuperscript𝑞𝑖1𝑁superscriptsubscript𝑖1𝑁superscriptsubscript𝑗1superscript𝑛𝑖superscriptsubscript𝑤𝑗𝑖superscriptsubscript𝑦𝑗𝑖superscriptsubscript𝑗1superscript𝑛𝑖superscriptsubscript𝑦𝑗𝑖\text{MAP}=\frac{1}{N}\sum_{i=1}^{N}\text{AP}(q^{(i)})=\frac{1}{N}\sum_{i=1}^{N}\frac{\sum_{j=1}^{n^{(i)}}w_{j}^{(i)}y_{j}^{(i)}}{\sum_{j=1}^{n^{(i)}}y_{j}^{(i)}},(8)where wj(i)=∑l:rl(i)≤rj(i)yl(i)rj(i)superscriptsubscript𝑤𝑗𝑖subscript:𝑙superscriptsubscript𝑟𝑙𝑖superscriptsubscript𝑟𝑗𝑖superscriptsubscript𝑦𝑙𝑖superscriptsubscript𝑟𝑗𝑖w_{j}^{(i)}=\frac{\sum_{l:r_{l}^{(i)}\leq r_{j}^{(i)}}y_{l}^{(i)}}{r_{j}^{(i)}}.NDCG@R𝑅R is calculated byNDCG@​R=1N​∑i=1NNDCG@​R(i)=1N​∑i=1N1IDCG@​R(i)​∑j:rj(i)≤R2yj(i)−1log2​(1+rj(i)),NDCG@𝑅1𝑁superscriptsubscript𝑖1𝑁NDCG@superscript𝑅𝑖1𝑁superscriptsubscript𝑖1𝑁1IDCG@superscript𝑅𝑖subscript:𝑗superscriptsubscript𝑟𝑗𝑖𝑅superscript2superscriptsubscript𝑦𝑗𝑖1subscriptlog21superscriptsubscript𝑟𝑗𝑖\begin{split}\text{NDCG@}R&=\frac{1}{N}\sum_{i=1}^{N}\text{NDCG@}R^{(i)}\\&=\frac{1}{N}\sum_{i=1}^{N}\frac{1}{\text{IDCG@}R^{(i)}}\sum_{j:r_{j}^{(i)}\leq R}\frac{2^{y_{j}^{(i)}}-1}{\text{log}_{2}(1+r_{j}^{(i)})},\end{split}(9)where if rtruesubscript𝑟truer_{\text{true}} represents the true ranking list of 𝒅(i)superscript𝒅𝑖\boldsymbol{d}^{(i)}, then IDCG@​R(i)=∑j:rtrue,j(i)≤R2yj(i)−1log2​(1+rj(i))IDCG@superscript𝑅𝑖subscript:𝑗superscriptsubscript𝑟true𝑗𝑖𝑅superscript2superscriptsubscript𝑦𝑗𝑖1subscriptlog21superscriptsubscript𝑟𝑗𝑖\text{IDCG@}R^{(i)}=\sum_{j:r_{\text{true},j}^{(i)}\leq R}\frac{2^{y_{j}^{(i)}}-1}{\text{log}_{2}(1+r_{j}^{(i)})}. R𝑅R here represents the truncation level.
38
+
39
+ For the scoring function neural network, we employ a fully connected neural network with one hidden layer of 500 units and the tanh nonlinear activation function. We initialize the weights of the neural network by Glorot method [19], and train ARSM-L2R using the Adam optimizer [20] with a learning rate of 10−4superscript10410^{-4}. The algorithm is run for a total of 2000 epochs, and the ranking metrics on the validation sets are monitored for choosing the best performing neural network weights. ARSM-L2R is implemented in Tensorflow [21].
40
+
41
+ We compare the performance of the different methods based on NDCG@1, NDCG@3, NDCG@5, NDCG@10, and MAP. The results for MQ2007 and OHSUMED datasets are provided in Tables 2 and 3, respectively. Our ARSM-L2R achieves the highest NDCG@1 and NDCG@3 on the MQ2007 dataset. On the OHSUMED dataset ARSM-L2R has a significantly higher NDCG@1 compared with all the other methods tested. It also shows the best MAP on this dataset. It is worth mentioning that NDCG@1 is one of the most important metrics for ranking systems, since it quantifies the relevance of the top ranked item. It is interesting to note that our method only optimizes a rough approximation of the evaluation metric NDCG, but shows the best performance on both two metrics for each dataset and comparable results for the rest of the metrics on the datasets. Our proposed method achieves better or comparable performance due to utilizing a loss function more directly related to ranking performance and also taking advantage of unbiased and low-variance gradient estimation.
42
+
43
+ We have developed a new supervised learning-to-rank model—ARSM-L2R—that generates relevance labels based on a categorical model with probabilities estimated by a MLP. The training objective is optimized with respect to the multivariate categorical variables with an unbiased and low-variance gradient estimator, ARSM. Our method can employ a non-differentiable loss function as opposed to the existing learning-to-rank methods. The experimental results show that ARSM-L2R achieves better or comparable results with pairwise and listwise approaches.
44
+
45
+ The presented materials are based upon the work supported by the National Science Foundation under Grants CCF-1553281, IIS-1812641, IIS-1812699, and CCF-1934904. We also thank Texas A&M High Performance Research Computing and Texas Advanced Computing Center for providing computational resources to perform experiments in this work.
1911.00484v4.txt ADDED
@@ -0,0 +1,330 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ \section{Introduction}
2
+ Machine Reading Comprehension (RC) or Question answering (QA) has seen great advancement in recent years. Numerous neural models have been proposed \cite{seo2016bidirectional,xiong2016dynamic,tay2018densely} and achieved promising performances on several different MRC data sets, such as SQuAD \cite{rajpurkar2016squad,rajpurkar2018know}, NarrativeQA \cite{kovcisky2018narrativeqa} and CoQA \cite{reddy2018coqa}. The performance was further boosted after the release of the Bidirectional Encoder Representations from Transformers (BERT) model \cite{devlin2018bert}, which has delivered state-of-the-art performance on several RC/QA data sets.
3
+
4
+ \begin{figure}[t]
5
+ \framebox{
6
+ \parbox{0.45\textwidth}{
7
+ \small
8
+ \textbf{Question:} What government position was held by the woman who portrayed Corliss Archer in the film Kiss and Tell? \smallskip\newline
9
+ \textbf{Document 1, Kiss and Tell (1945 film):} \textcolor{blue}{Kiss and Tell is a 1945 American comedy film starring then 17-year-old Shirley Temple as Corliss Archer.} In the film, two teenage girls cause their respective parents much concern when they start to become interested in boys. The parents' bickering about which girl is the worse influence causes more problems than it solves. \smallskip\newline
10
+ \textbf{Document 2, Shirley Temple:} \textcolor{blue}{Shirley Temple Black (April 23, 1928 - February 10, 2014) was an American actress, singer, dancer, businesswoman, and diplomat who was Hollywood's number one box-office draw as a child actress from 1935 to 1938. As an adult, she was named United States ambassador to Ghana and to Czechoslovakia and also served as Chief of Protocol of the United States.} \smallskip\newline
11
+ \textbf{Answer:} \textcolor{red}{Chief of Protocol} \smallskip\newline
12
+ \textbf{Supporting facts:} [``Kiss and Tell (1945 film)'',0], [``Shirley Temple'',0], [``Shirley Temple'',1]
13
+ }
14
+ }
15
+ \caption{An example from HotpotQA dev set (only 2 documents are shown). Supporting facts formatted as [document title, sentence id] are annotated in blue.}
16
+ \label{fig:hotpotqa}
17
+ \end{figure}
18
+
19
+ Most existing research in machine RC/QA focuses on answering a question given a single document or paragraph. Although the performance on these types of tasks have been improved a lot over the last few years, the models used in these tasks still lack the ability to do reasoning across multiple documents when a single document is not enough to find the correct answer \cite{chen2019understanding}. In order to improve a machine's ability to do multi-hop reasoning over multiple documents, recently several multi-hop QA data sets have been proposed to promote the related research, such as \textsc{WikiHop} \cite{welbl2018constructing} and HotpotQA \cite{yang2018hotpotqa}. These data sets are challenging because they require models to be able to do multi-hop reasoning over multiple documents and under strong distraction. HotpotQA also encourages explainable QA models by providing supporting sentences for the answer, which usually come from several documents (a document is called "gold doc" if it contains the answer or it contains supporting sentences to the answer).
20
+ One example from HotpotQA is shown in Figure \ref{fig:hotpotqa}. Besides the answer ``Chief of Protocol'', HotpotQA also annotates supporting sentences (text in blue) in gold documents to explain the choice of that answer.
21
+
22
+ To solve the multi-hop multi-document QA task, two research directions have been explored. The first direction focuses on applying or adapting previous techniques that are successful in single-document QA tasks to multi-document QA tasks, for example the studies in \cite{dhingra2018neural,zhong2019coarse,yang2018hotpotqa,nishida2019answering}. The other direction resorts to Graph Neural Networks (GNN) to realize multi-hop reasoning across multiple documents, and promising performance has been achieved \cite{song2018exploring,de2018question,cao2019bag,tu2019hdegraph,xiao2019dfgn}.
23
+
24
+
25
+
26
+
27
+ Despite of the above achieved success, there are still several limitations of the current approaches on multi-hop multi-document QA. First, little attention has been paid to the explainability of the answer prediction, which is important and challenging because in multi-hop multi-documents QA tasks supporting evidences could spread out over very long context or multiple documents \cite{welbl2018constructing}. Being able to retrieve evidences from scattering information in different context results in more practical and intelligent QA systems.
28
+
29
+ Second, almost all existing methods directly work on all documents either by concatenating them or processing them separately, regardless of the fact that most context is not related to the question or not helpful in finding the answer. Few attempts have been conducted to design a document filter in order to remove answer-unrelated documents and reduce the amount of information needs to be processed. An accurate document selection module can also improve the scalability of a QA model without degradation on performance \cite{min2018efficient}.
30
+
31
+ Third, current applications of GNN for QA tasks usually take entities \cite{de2018question,tu2019hdegraph,xiao2019dfgn} as graph nodes and reasoning is achieved by conducting message passing over nodes with contextual information. This is only possible when a predefined set of target entities is available (e.g. \cite{welbl2018constructing}). Otherwise a Named Entity Recognition (NER) tool is used to extract entities, which could result in redundant and noisy entities for graph reasoning. If the answer is not a named entity, further processing is needed to locate the final answer \cite{xiao2019dfgn}.
32
+
33
+ To overcome these limitations, we propose an effective and interpretable system called Select, Answer and Explain (SAE) to solve the multi-hop RC over multiple documents.
34
+ Our SAE system first filters out answer-unrelated documents and thus reduce the amount of distraction information. This is achieved by a document classifier trained with a novel pairwise learning-to-rank loss, which can achieve both high accuracy and recall on the gold documents.
35
+ The selected gold documents are then input to a model to jointly predict the answer to the question and supporting sentences.
36
+ The model is optimized in a multi-task learning way on both token level for answer span prediction and sentence level for supporting sentence prediction. While the answer prediction is accomplished by sequential labeling with start and end tokens as targets, we cast the support sentence prediction as a node classification task. We build a GNN model to do reasoning over contextual sentence embeddings, which is summarized over token representations based on a novel mixed attentive pooling mechanism. Multi-task learning together with the mixed attention-based interaction between these two tasks ensures that complementary information between the two tasks is exploited.
37
+
38
+ Our proposed SAE system is evaluated on the distractor setting of the HotpotQA data set.
39
+ On the blind test set of HotpotQA, our SAE system attains top competitive results compared to other systems on the leaderboard \footnote{https://hotpotqa.github.io/} at the time of submission (Sep 5th).
40
+ To summarize, we make the following contributions:
41
+ \begin{enumerate}
42
+ \item We design a document selection module to filter out answer-unrelated documents and remove distracting information. The model is based on multi-head self-attention over document embeddings to account for interaction among documents. We propose a novel pairwise learning-to-rank loss to further enhance the ability to locate accurate top ranked answer-related gold documents.
43
+ \item Our ``answer and explain'' model is trained in a multi-task learning way to jointly predict answer and supporting sentences on gold documents. We build multi-hop reasoning graphs based on GNN with contextual sentence embeddings as nodes, instead of using entities as nodes as in previous work, to directly output supporting sentences with the answer prediction.
44
+ \item The contextual sentence embedding used in GNN is summarized over token representations based on a novel mixed attentive pooling mechanism. The attention weight
45
+ is calculated from both answer span logits and self-attention output on token representations. This attention based interaction enables exploitation of complementary information between ``answer'' and ``explain'' tasks.
46
+ \end{enumerate}
47
+ \section{Related work}
48
+ \textbf{Multi-hop multi-document QA:} The work in \cite{dhingra2018neural} designed a recurrent layer to explicitly exploit the skip connections between entities from different documents given coreference predictions. An attention based system was proposed in \cite{zhong2019coarse} and it shows that techniques like co-attention and self-attention widely employed in single-document RC tasks are also useful in multi-document RC tasks.
49
+ The study by \cite{song2018exploring} adopted two separate Named Entity Recognition (NER) and coreference resolution systems to locate entities in support documents, which are then used in GNN to enable multi-hop reasoning across documents. Work by \cite{de2018question,cao2019bag} directly used mentions of candidates as GNN nodes and calculated classification scores over mentions of candidates. The study in \cite{tu2019hdegraph} proposed a heterogeneous graph including document, candidate and entity nodes to enable rich information interaction at different granularity levels.
50
+
51
+ Our proposed system is different from the previous models in that 1) Our model is jointly trained and is capable of explaining the answer prediction by providing supporting sentences. 2) We propose to first filter out answer unrelated documents and then perform answer prediction.
52
+
53
+ \noindent \textbf{Explainable QA:} The study in \cite{zhou2018interpretable} proposed an Interpretable Reasoning Network for QA on knowledge base. The baseline model provided in the HotpotQA paper \cite{yang2018hotpotqa} and the QFE model proposed in \cite{nishida2019answering} are based on a single-document RC system proposed in \cite{clark2018simple}, with interpretable answer prediction. However multi-hop reasoning was not explicitly dealt with in this work. The DFGN model proposed in \cite{xiao2019dfgn} considered the model explainability by first locating supporting entities and then leading to support sentences, while our model directly finds the supporting sentences. The study in \cite{wang2019evidence} designed an evidence extractor for QA tasks based on Deep Probabilistic Logic, while our model is based on GNN by taking the interaction among sentences within or across documents into account.
54
+
55
+ \noindent \textbf{Sentence or document selector}: The study in \cite{min2018efficient} proposed an efficient sentence selector for single-document QA tasks, while our selector works on multiple documents. The DFGN model \cite{xiao2019dfgn} also has a document selector however they did not consider the relational information among documents and treated each document independently.
56
+ \section{Methodology}
57
+ The diagram of the proposed SAE system is shown in Figure \ref{fig:diagram}. We assume a setting where each example in our data set contains a question and a set of $N$ documents; a set of labelled support sentences from different documents; the answer text, which could be a span of text or ``Yes/No''.
58
+ We derive the gold document labels from the answer and support sentence labels. We use $D_{i}$ to note document $i$: it is labelled as $1$ if $D_i$ is a gold doc, otherwise $0$. We also label the answer type as one of the following annotations: ``Span'', ``Yes'' and ``No''.
59
+
60
+ \begin{figure}[t]
61
+ \centering
62
+ \includegraphics[width=0.6\linewidth]{diagram.pdf}
63
+ \caption{Diagram of the proposed SAE system. The dashed arrow line indicates the mixed attention based interaction between the two tasks}
64
+ \label{fig:diagram}
65
+ \end{figure}
66
+ \subsection{\textbf{S}elect gold documents}
67
+ \label{select_gold}
68
+
69
+ \begin{figure}[t]
70
+ \centering
71
+ \includegraphics[width=0.9\linewidth]{DocExtractor3.png}
72
+ \caption{Diagram of document selection module. $N$ indicates the total number of documents.}
73
+ \label{fig:extractor}
74
+ \end{figure}
75
+
76
+ Our SAE system begins by accurately extracting gold documents from the given input of $N$ documents. This phase of our system is crucial in minimizing distracting information being passed to the downstream answer prediction and explanation generation tasks. For every document, we generate an input to feed through BERT by concatenating ``[CLS]'' + question + ``[SEP]'' + document + ``[SEP]''. We use the ``[CLS]'' token output from BERT as a summary vector for each question/document pair. A straightforward way for gold document classification is to project this summary vector into a singular dimension and calculate the binary cross entropy loss as in \cite{xiao2019dfgn}:
77
+
78
+ \begingroup\makeatletter\def\f{@size}{8}\check@mathfonts
79
+ \def\maketag{@@@#1}{\hbox{\m@th\large\normalfont#1}}%
80
+ \begin{align}
81
+ L = -\sum_{i=0}^{n} t_{i}logP(D_{i}) + (1-t_{i})log(1-P(D_{i}))
82
+ \end{align}\endgroup
83
+ where $t_{i}$ is the label of $D_i$, $n$ is the number of documents, and $P(D_{i})$ is the probability of document $i$ being in label $t_i$.
84
+ This simple approach treats each document separately, without considering inter-document interactions and relationships that are essential for the downstream multi-hop reasoning task.
85
+
86
+ Therefore we propose a new model as shown in Figure \ref{fig:extractor}. First we add a multi-head self-attention (MHSA) layer on top of the ``CLS'' tokens. This MHSA layer is defined as:
87
+ \begin{align}%
88
+ & Attention = softmax(\frac{QK^{T}}{\sqrt{d_{k}}}) \\
89
+ & Multihead = Concat(head_{i}...head_{n})W^{o} \\
90
+ & head_{i} = Attention(QW_{i}^{Q},KW_{i}^{k},VW_{i}^{v})
91
+ \end{align}
92
+ where, $Q$, $K$, and $V$ are linear projections from ``CLS'' embeddings of documents, representing attention queries, key and values \cite{vaswani2017attention}. Our motivation for adding attention across the ``CLS'' tokens generated from different documents is to encourage inter-document interactions. Inter-document interactions are crucial to %
93
+ the multi-hop reasoning across documents.
94
+ By allowing document/question representations to interact with each other, the model is able to train on a better input signal for selecting a set of gold documents that are needed for the answer extraction and support sentence prediction.
95
+
96
+
97
+ We also formulate our problem from a classification problem to a pairwise learning-to-rank problem, where we would take the top ranked documents as predicted gold documents \cite{liu2009learning}.
98
+ By comparing a document to all other documents, the model is able to better distinguish a small set of gold documents from the rest distracting documents.
99
+ We first give a score $S(.)$ to each document $D_{i}$: $S(D_{i}) = 1$ if $D_{i}$ is a golden document, and $S(D_{i}) = 0$ otherwise.
100
+ We then label each pair of input documents: given a pair of input documents $(D_{i},D_{j})$, our label $l$ will be set as:
101
+ \[
102
+ l_{i,j}=
103
+ \begin{cases}
104
+ 1 & \text{if $S(D_{i}) > S(D_{j})$}\\
105
+ 0 & \text{if $S(D_{i}) <= S(D_{j})$} \\
106
+ \end{cases}
107
+ \]
108
+ This label indicates that gold document would be scored higher than non-gold docs.
109
+
110
+ We also consider the document containing the answer span to be more important for downstream tasks. Thus we give $S(D_{i}) = 2$ if $D_{i}$ is a golden document containing the answer span.
111
+
112
+ Our model outputs a probability for each pair of documents by passing the MHSA outputs of documents through a bi-linear layer, which is trained on binary cross entropy as the following:
113
+ \begingroup\makeatletter\def\f{@size}{7}\check@mathfonts
114
+ \def\maketag{@@@#1}{\hbox{\m@th\large\normalfont#1}}%
115
+ \begin{equation}
116
+ L = -\sum_{i=0}^{n}\sum_{j=0,j \neq i}^{i} l_{i,j}logP(D_{i},D_{j}) + \\ (1-l_{i,j})log(1-P(D_{i},D_{j}))
117
+ \end{equation}
118
+ \endgroup
119
+ where $l_{i,j}$ is the label for the pair of documents $(D_{i},D_{j})$. $P(D_{i},D_{j})$ is our model's predicted probability that $D_{i}$ is more relevant than $D_{j}$. At inference time, we examine the comparisons that each of the documents makes with each other. We threshold each of the pair of predictions with a value of 0.5, and define relevance as $R_{i} = \sum_{j}^{n} \mathbbm{1}(P(D_{i},D_{j}) > 0.5)$. $\mathbbm{1}$ denotes the indicator function. We take the top $k$ ranked documents from this relevance ranking as our filtered documents.
120
+ \subsection{Answer and Explain}
121
+ The document selection module removes answer unrelated documents and distractions from the original input.
122
+ Given the question and gold documents,
123
+ we jointly train the answer prediction and supporting sentence classification in a multi-task learning way (note that at inference time we use the predicted gold documents.). In addition we explicitly model the interaction between the two tasks with attention-based summarized sentence embeddings.
124
+
125
+ First, all the gold documents are concatenated into one context input, and BERT is employed to encode the question and context pair in ``[CLS] + question + [SEP] + context + [SEP]'' format. Denote the token-level BERT output for $i$th input as $\mathbf{H}^i=\{\mathbf{h}^i_0, \mathbf{h}^i_2, \cdots, \mathbf{h}^i_{L-1}\}$, and we expect $\mathbf{H}^i \in \mathbb{R}^{L \times d}$ to have enough question-related contextual information, $d$ is the output dimension of BERT. Next, we introduce our new design of token-level and sentence-level multi-task learning.
126
+ \subsubsection{Answer prediction}
127
+ A 2-layer Multilayer Perceptron (MLP) with output size 2 is applied to the BERT output $\mathbf{H}^i$. One dimension of the output is used for start position prediction, and the other for end position prediction, as introduced in \cite{devlin2018bert}. We calculate the cross entropy between logits of all possible indices from $1$ to $L$, and the true start and end position of answer span. The final output is the predicted answer span derived from the start and end positions. The process could be described using the following formulas.
128
+
129
+ \begin{equation}
130
+ \mathbf{\hat{Y}} = f_{span}(\mathbf{H}^i) \in \mathbb{R}^{L \times 2},
131
+ \end{equation}
132
+ \begin{equation}
133
+ L^{span} = \frac{1}{2}(CE(\mathbf{\hat{Y}}[:,0], \mathbf{y}^{start}) + CE(\mathbf{\hat{Y}}[:,1], \mathbf{y}^{end})),
134
+ \end{equation}
135
+ where the first row of $\mathbf{\hat{Y}}$ is the logits of start position and second row is the logits of end position. $\mathbf{y}^{start}$ and $\mathbf{y}^{end}$ are the labels of start and end positions in the range [0, L-1]. $CE$ denotes cross entropy loss function.
136
+ \subsubsection{Supporting sentence prediction}
137
+ The other task is to predict whether a sentence in the input context is a supporting evidence to the answer prediction. To achieve sentence-level prediction, we first obtain sequential representation of each sentence from $\mathbf{H}^i$.
138
+ \begin{equation}
139
+ \mathbf{S}^j = \mathbf{H}[j^{s}:j^{e},:] \in \mathbb{R}^{L^j \times d},
140
+ \end{equation}
141
+ where $\mathbf{S}^j$ is the matrix representing the token embeddings within sentence $j$ (for clarity, we drop the sample index $i$ here); $j^s$ and $j^e$ defines the start and end positions, and $L^j$ is the length of sentence $j$.
142
+
143
+ Intuitively, the answer prediction task and support sentence prediction task could complement each other. Our observation is that the answer prediction task could always help support sentence prediction task because the sentence with answer is always a piece of evidence; however it is not the same case the other way around because there may be multiple support sentences and the sentence with the highest probability may not contain the answer. Therefore, to exploit the interaction between the two complementary tasks, we propose an attention-based summarized sentence representation to introduce complementary information from answer prediction. The attention weights are calculated in the following way: one part of attention is computed with self-attention on $\mathbf{S}^j$; the other part is from the summation of the start and end position logits from the answer prediction task.
144
+ \begin{equation}
145
+ \boldsymbol{\alpha^j} = \sigma(f_{att}(\mathbf{S}^j) + \mathbf{\hat{Y}}[j^{s}:j^{e},0] + \mathbf{\hat{Y}}[j^{s}:j^{e},1]),
146
+ \label{equ:mixed_att}
147
+ \end{equation}
148
+ \begin{equation}
149
+ \mathbf{s}^j = \sum_{k=0}^{L^j} \alpha^j_k \mathbf{S}^j[k,:] \in \mathbb{R}^{1 \times d},
150
+ \label{equ:sent_att}
151
+ \end{equation}
152
+
153
+ where $f_{att}$ is a two-layer MLP with output size 1, and function $\sigma$ is the softmax function applied on the sequence length dimension. $\boldsymbol{\alpha}^j \in \mathbb{R}^{L^j \times 1}$ denotes the attention weight on each token of sentence $j$. Our mixed attention idea is different from the supervised attention proposed in \cite{rei2019jointly} because we calculate attention weights from two inputs while supervised attention only uses token-level logits for attention weight calculation.
154
+
155
+ Next we propose to build a GNN model over sentence embeddings $\mathbf{s}^j$ to explicitly facilitate multi-hop reasoning over all sentences from the predicted gold documents for better exploitation of the complex relational information. We illustrate our model for support sentence prediction in Figure \ref{fig:e_module}. We use sentence embedding $\mathbf{s}^j$ to initialize the graph node features. A multi-relational Graph Convolution Networks (GCN) based message passing strategy is employed to update the graph node features, and the final node features are input to a MLP to get the classification logit of each sentence.
156
+
157
+ \begin{figure}[t]
158
+ \centering
159
+ \includegraphics[width=0.5\linewidth]{fig2.pdf}
160
+ \caption{Diagram of the supporting sentence prediction module. Different node colors indicate that nodes are from different documents. Nodes with diagonal stripes indicate that the corresponding input sentences are supporting sentences. We use solid, dashed and dotted lines to differentiate different edge types.}
161
+ \label{fig:e_module}
162
+ \end{figure}
163
+
164
+ To build the connections among graph nodes, we design three types of edges based on the named entities and noun phrases presented in the question and sentences:
165
+ \begin{enumerate}
166
+ \item Add an edge between two nodes if they are originally from the same document (solid line in Figure \ref{fig:e_module}).
167
+ \item Add an edge between two nodes from different documents if the sentences representing the two nodes both have named entities or noun phrases (can be different) in the question (dashed line in Figure \ref{fig:e_module}).
168
+ \item Add an edge between two nodes from different documents if the sentences representing the two nodes have the same named entities or noun phrases (dotted line in Figure \ref{fig:e_module}).
169
+ \end{enumerate}
170
+ The motivation for the first type of edge is that we want the GNN to grasp the global information presented within each document. Furthermore, cross-document reasoning is achieved by jumping from entities in the question to unknown bridging entities or comparing attributes of two entities in the question \cite{yang2018hotpotqa}. Thus, we design the second and third types of edge to better capture such cross-document reasoning path.
171
+
172
+ For message passing, we use multi-relational %
173
+ GCN with gating mechanism as in \cite{de2018question,tu2019hdegraph}. Assume $\mathbf{h}_j^0$ represents initial node embedding from sentence embedding $\mathbf{s}_j$, the calculation of node embedding after one hop (or layer) can be formulated as
174
+ \begin{equation}
175
+ \mathbf{h}_j^{k+1} = act(\mathbf{u}_j ^ k) \odot \mathbf{g}_j ^ k + \mathbf{h}_j ^ k \odot (1-\mathbf{g}_j ^ k)
176
+ \end{equation}
177
+ where
178
+ \begin{equation}
179
+ \mathbf{u}_j ^ k = f_s(\mathbf{h}_j ^ k) + \sum_{r \in \mathcal{R}} \frac{1}{\left | \mathcal{N}_j ^ r \right |} \sum_{n \in \mathcal{N}_j ^ r} f_r(\mathbf{h}_n ^ k),
180
+ \end{equation}
181
+ \begin{equation}
182
+ \mathbf{g}_j ^ k = sigmoid(f_g([\mathbf{u}_j ^ k; \mathbf{h}_j ^ k])).
183
+ \end{equation}
184
+ $\mathcal{R}$ is the set of all edge types, $\mathcal{N}_j ^ r$ is the neighbors of node $j$ with edge type $r$ and $\mathbf{h}_n ^ k$ is the node representation of node $n$ in layer $k$. $\left | \cdot \right|$ indicates the size of the neighboring set.
185
+
186
+ Each of $f_r$, $f_s$, $f_g$ defines a transform on the input node representations, and can be implemented with a MLP. Gate control $\mathbf{g}_j ^ k$, which is a vector consisting of values between 0 and 1, is to control the amount information from computed update $\mathbf{u}_j ^ k$ or from the original node representation $\mathbf{h}_j ^ k$. Function $act$ denotes a non-linear activation function. After message passing on the graph with predefined number of hops, each node has its final representation $\mathbf{h}_j$. We use a two-layer MLP $f_{sp}$ with 1-dimensional output to get the logit of node $j$ for supporting sentence prediction: $\hat{y}_j^{sp} = sigmoid(f_{sp}(\mathbf{h}_j)$).
187
+
188
+ Besides the supporting sentence prediction task, we add another task on top of the GNN outputs to account for ``Yes/No'' type of questions. We formulate the answer type prediction task as a 3-class (``Yes'', ``No'' and ``Span'') classification. We design a simple graph attention module to calculate the weighted sum of all nodes representation over $j$ by $\mathbf{h} = \sum_j a_j \mathbf{h}_j$, where the attention weight $\mathbf{a}$ is derived by $\mathbf{a} = \sigma(\hat{\mathbf{y}}^{sp})$.
189
+ Then, another two-layer MLP with 3-dimensional output is applied to the weighted-summed graph representation to get the answer type prediction: $\hat{\mathbf{y}}^{ans} = f_{ans}(\mathbf{h})$.
190
+
191
+ The final training loss is the summation of span prediction, support sentence prediction and answer type prediction losses:
192
+ \begin{equation}
193
+ L = \gamma L^{span} + BCE(\hat{\mathbf{y}}^{sp}, \mathbf{y}^{sp}) + CE(\hat{\mathbf{y}}^{ans}, \mathbf{y}^{ans})
194
+ \end{equation}
195
+ where $BCE()$ represents binary cross entropy loss function; $\mathbf{y}^{sp}$ and $\mathbf{y}^{ans}$ are the labels of support sentences and answer types respectively. We add a weight $\gamma$ to span loss to account for the scale difference of different losses.
196
+ \section{Experiments}
197
+ \begin{table*}[]
198
+ \centering
199
+ \caption{Results comparison between our proposed SAE system with other methods. $^*$ indicates unpublished models.}
200
+ \resizebox{0.65\linewidth}{!}{
201
+ \begin{tabular}{c|c|cc|cc|cc}
202
+ \hline
203
+ \multirow{2}*{}&\multirow{2}*{Model} & \multicolumn{2}{c|}{Ans} & \multicolumn{2}{c|}{Sup} & \multicolumn{2}{c}{Joint} \\
204
+ ~ & ~& EM & $F_1$ & EM & $F_1$ & EM & $F_1$ \\
205
+ \hline
206
+ \multirow{4}*{Dev}&~Baseline\cite{yang2018hotpotqa} & 44.44 & 58.28 & 21.95 & 66.66 & 11.56 & 40.86\\
207
+ ~&QFE\cite{nishida2019answering}& 53.70 & 68.70 & 58.80 & 84.70 & 35.40 & 60.60 \\
208
+ ~&DFGN\cite{xiao2019dfgn}& 55.66 & 69.34 & 53.10 & 82.24 & 33.68 & 59.86 \\
209
+ ~&SAE(ours)&61.32 & 74.81 & 58.06 & 85.27 & 39.89 & 66.45\\
210
+ ~&SAE-oracle(ours)&63.48 & 77.16 & 62.80 & 89.29 & 42.77 & 70.13 \\
211
+ ~&SAE-large(ours)&67.70 & 80.75 & 63.30 & 87.38 & 46.81 & 72.75 \\
212
+ \hline
213
+ \hline
214
+ \multirow{5}*{Test}&~Baseline\cite{yang2018hotpotqa} & 45.46 & 58.99 & 22.24 & 66.62 & 12.04 & 41.37 \\
215
+ ~&QFE\cite{nishida2019answering}& 53.86 & 68.06 & 57.75 & 84.49 & 34.63 & 59.61 \\
216
+ ~&DFGN\cite{xiao2019dfgn} & 56.31 & 69.69 & 51.50 & 81.62 & 33.62 & 59.82\\
217
+ ~&SAE(ours) & 60.36 & 73.58 & 56.93 & 84.63 & 38.81 & 64.96 \\
218
+ ~&SAE-large(ours) & 66.92 & 79.62 & \textbf{61.53} & 86.86 & \textbf{45.36} & 71.45 \\ \cline{2-8}
219
+ ~&C2F Reader$^*$ & 67.98 & 81.24 & 60.81 & 87.63 & 44.67 & 72.73 \\
220
+ \hline
221
+ \end{tabular}}
222
+ \addtolength{\belowcaptionskip}{-12pt}
223
+ \label{tab:result}
224
+ \end{table*}
225
+ \subsection{Data set}
226
+ HotpotQA is the first multi-hop QA data set taking the explanation ability of models into account. HotpotQA is constructed in the way that crowd workers are presented with multiple documents and are asked to provide a question, corresponding answer and support sentences used to reach the answer as shown in Figure \ref{fig:hotpotqa}. The gold documents annotation can be derived from the support sentences annotation. There are about 90K training samples, 7.4K development samples, and 7.4K test samples. Please refer to the original paper \cite{yang2018hotpotqa} for more details.
227
+
228
+ HotpotQA presents two tasks: answer span prediction and supporting facts prediction. Models are evaluated based on Exact Match (EM) and $F_1$ score of the two tasks. Joint EM and $F_1$ scores are used as the overall performance measurements, which encourage the model to be accurate on both tasks for each example. In the experiment, we train our SAE system on the training set, and tune hyperparameters on the development set. Our best model on development set is submitted to the leaderboard organizer to obtain the performance measurements on the blind test set.
229
+ \subsection{Implementation details}
230
+ Our implementation is based on the PyTorch \cite{paszke2017automatic} implementation of BERT\footnote{https://github.com/huggingface/pytorch-pretrained-BERT}. We use both \textit{BERT base uncased} model (``SAE'') and Roberta \cite{liu2019roberta} large model (``SAE-large''). All texts are tokenized using the wordpiece tokenizer adopted by BERT and Roberta. Since only answer text is provided in HotpotQA, we employ a simple exact match strategy to find the start and end tokens of the answer in documents, and use it as the answer prediction labels. We also use spaCy\footnote{https://spacy.io} to recognize named entities and noun phrases in context and question.
231
+
232
+ To train the document selection module, we use all samples in the training set.
233
+ For the multi-task learning module, we only use the annotated gold documents for training and evaluate the model on predicted gold documents.
234
+ During evaluation, we only take the top-2 documents returned by the document selection module as input to the answer and support sentence prediction module. if the answer type prediction is ``Span'', the answer span output is used as predicted answer; otherwise, the predicted answer is ``Yes'' or ``No'' based on the answer type prediction.
235
+ \subsection{Results}
236
+ In Table \ref{tab:result}, we show the performance comparison among different models on both development and blind test set of HotpotQA. On development set, our method improves more than 28\% and 25\% absolutely in terms of joint EM and $F_1$ scores over the baseline model. Compared to the DFGN model \cite{xiao2019dfgn} and QFE model \cite{nishida2019answering}, our SAE system is over 5\% absolutely better in terms of both joint EM and $F_1$ scores.
237
+
238
+ We also show the results of SAE-oracle and SAE-large here. For SAE-oracle, we directly input the annotated gold documents of dev set to get answer and support sentence prediction. We find that for almost all measurements, the gap between our model using predicted gold documents and oracle gold documents is around 3-4\%, which implies the effectiveness of our document selection module. By using large pre-trained language models as encoders, the performance is improved tremendously.
239
+
240
+ On the blind test set, since most submitted systems on the HotpotQA leaderboard are unpublished, we only show the comparison with two published models, and the best single model on the leaderboard. Our SAE-large model ranks No. 2 at the time of submission.
241
+ Compared to the best single model, our SAE system performs better in terms of support sentence prediction EM and joint EM.
242
+ \subsection{Ablation studies}
243
+ \begin{table}[]
244
+ \centering
245
+ \caption{Ablation study results on HotpotQA dev set. PR(0,1) stands for giving 0 score to non-gold documents and 1 score to all gold documents when preparing pairwise labels, and PR(0,1,2) stands for giving 2 score to the gold document with answer span.
246
+ }
247
+ \resizebox{1.0\columnwidth}{!}{
248
+ \begin{tabular}{l|c|c|c|c|c}
249
+ \hline
250
+ & EM\textsubscript{S} & Recall\textsubscript{S} & Acc\textsubscript{span} & joint EM & joint $F_1$ \\ \hline
251
+ BERT only & 70.65 & 89.16 & 90.08 & 31.87 & 59.33 \\ \hline
252
+ ~~+MHSA & 87.07 & 94.65 & 92.54 & 38.54 & 65.00 \\ \hline
253
+ ~~~~+PR(0,1) & 89.76 & 94.75 & 94.53 & 39.53 & 65.44 \\ \hline
254
+ ~~~~+PR(0,1,2) & 91.40 & 95.61 & 95.86 & 39.89 & 66.45 \\ \hline
255
+ \end{tabular}}
256
+ \label{tab:doc_ablation}
257
+ \end{table}
258
+
259
+ We only present the ablation studies on our SAE system using \textit{BERT base uncased} model. We first show the results of ablation studies on the document selection module in Table \ref{tab:doc_ablation}. ``EM\textsubscript{S}'' and ``Recalls\textsubscript{S}'' measure the accuracy and recall of both two gold documents are selected; ``Acc\textsubscript{span}'' measures the accuracy of the gold document with answer span being selected. The ``BERT only'' model, similar with the document selection model in \cite{xiao2019dfgn}, is used as baseline. The MHSA mechanism, which allows information from different documents to interact with each other, brings the most gain over the baseline in terms of all measurements. The pairwise learning-to-rank loss function, which allows documents to be compared directly against each other and provides finer-grained information for the model to learn, further improves the performance. Further, scoring documents that contain the answer span to 2 is better than weighting the two gold documents equally. Finally, we can see that better document filter always results in better answer and support sentence prediction performance.
260
+
261
+
262
+
263
+ \begin{table}[]
264
+ \centering
265
+ \caption{Ablation study results on HotpotQA dev set.}
266
+ \resizebox{0.65\columnwidth}{!}{
267
+ \begin{tabular}{l|c|c}
268
+ \hline
269
+ & joint EM & joint $F_1$ \\ \hline
270
+ full model & 39.89 & 66.45 \\ \hline \hline
271
+ ~~~-mixed attn & 39.59 & 66.28 \\ \hline
272
+ ~~~-attn sum & 38.04 & 65.33 \\ \hline \hline
273
+ ~~~-GNN & 38.46 & 65.53 \\ \hline
274
+ ~~~-type 1 edge & 38.15 & 65.00 \\ \hline
275
+ ~~~-type 2 edge & 39.55 & 66.13 \\ \hline
276
+ ~~~-type 3 edge & 39.32 & 66.03 \\ \hline
277
+ ~~~-type 2\&3 edge & 39.16 & 65.76 \\ \hline
278
+ \end{tabular}}
279
+ \label{tab:ablation}
280
+ \end{table}
281
+
282
+ Then we ablate different components in the ``Answer and Explain'' module, and we measure the model performance in these circumstances in terms of joint EM and $F_1$. From Table \ref{tab:ablation} it can be observed:
283
+ \begin{itemize}
284
+ \item If only self-attention with span logits when calculating attention weights for sentence attentive pooling (``-mixed attn'') is used, the performance drops marginally, indicating that the mixed attention mechanism helps but in a limited extent. However, replacing attention based sentence summarization with simple averaging (``-attn sum'') deteriorates the performance a lot (the joint EM drops almost 2\%), which proves the effectiveness of attention based sentence summarization.
285
+ \item For the GNN module, if we do not use GNN based message passing over sentence embeddings, the performance degrades by $\sim$1.4\% for EM and $\sim$0.9\% for $F_1$. If we remove one of the three types of edges, the results show that the first type of edges, i.e. the connection among sentences within the same documents, contributes the most while other two types of edges contribute marginally. But when we remove both of them, the results further drops, indicating the usefulness of cross-document information.
286
+ \end{itemize}
287
+ \subsection{Result analysis}
288
+ In order to better understand the performance of the proposed SAE system, analysis is done based on different reasoning types in the development set. The reasoning type of an example is provided as part of the annotation by the data set. It has two categories: ``bridge'' and ``comparison''. The ``bridge'' type of reasoning requires the model to be able to find a bridge entity before reaching the final answer, while the ``comparison'' type of reasoning requires the model to compare the attributes of two entities and then give the answer.
289
+ We calculate the joint EM and $F_1$ in each categorization (full sets of performance measurements is put in supplementary materials). We compare our proposed system with the baseline model and the DFGN model \cite{xiao2019dfgn}\footnote{only this model's output is available online} under these two reasoning types.
290
+
291
+ In Table \ref{tab:reason}, we show the performance comparison in terms of joint EM and $F_1$ score under the ``bridge'' and ``comparison'' reasoning types. Our proposed SAE system delivers better performance under both reasoning types, and improvement over the DFGN model on the ``bridge'' type of reasoning is bigger than that of the "comparison" type. This proves our SAE system is better at dealing with bridging type of reasoning. Another interesting finding is that for all models the performance under ``comparison'' type is higher than ``bridge'' type. For our model, we conjecture that this is due to the bridge entity may be far from the question entities in context, thus is hard to find it. However, attributes of entities are usually close and are less possible to be ignored for ``comparison'' type of reasoning.
292
+
293
+ In Figure \ref{fig:attention} we also show the sentence summarization attention heatmap of a sample in dev set. The question of this sample is ``Were Scott Derrickson and Ed Wood of the same nationality?''. It clearly shows that the model attends to supporting sentences with the word ``american'', which indicates the nationality of both ``Scott Derrickson'' and ``Ed Wood''. %
294
+ We include more ablation study results and analysis in supplementary materials.
295
+
296
+
297
+ \begin{figure}[t]
298
+ \centering
299
+ \includegraphics[width=1.0\linewidth]{fig3.pdf}
300
+ \caption{Attention heatmap of a sample from dev set. Each cell is a word piece token returned by BERT. Sentences with different colors are from different documents.}
301
+ \label{fig:attention}
302
+ \end{figure}
303
+
304
+ \begin{table}[]
305
+ \caption{Performance comparison in terms of joint EM and $F_1$ scores under different reasoning types.}
306
+ \begin{center}
307
+ \resizebox{1.0\columnwidth}{!}{
308
+ \begin{tabular}{c|c|c|c|c}
309
+ \hline
310
+ \multirow{2}{*}{} & \multicolumn{2}{c|}{Bridge (5918 samples)} & \multicolumn{2}{c}{Comparison (1487 samples)} \\ \cline{2-5}
311
+ & joint EM & joint $F_1$ & joint EM & joint $F_1$ \\ \hline
312
+ Baseline & 8.80 & 39.77 & 20.91 & 43.24 \\ \hline
313
+ DFGN & 30.09 & 58.61 & 47.95 & 64.79 \\ \hline
314
+ SAE & 37.07 & 66.12 & 51.18 & 67.73 \\ \hline
315
+ \end{tabular}}
316
+ \end{center}
317
+ \label{tab:reason}
318
+ \end{table}
319
+ \section{Conclusion}
320
+ We propose a new effective and interpretable system to tackle the multi-hop RC problem over multiple documents. Our system first accurately filters out unrelated documents and then performs joint prediction of answer and supporting evidence. Several novel ideas to train the document filter model and the model for answer and support sentence prediction are presented. Our proposed system attains competitive results on the HotpotQA blind test set compared to existing systems. We would like to thank Peng Qi of Stanford University for running evaluation on our submitted models. This work is partially supported by Beijing Academy of Artificial Intelligence (BAAI).
321
+
322
+
323
+
324
+
325
+
326
+
327
+ {\small
328
+ \bibliography{hotpotqa}
329
+ \bibliographystyle{aaai}
330
+ }
1911.00547v1.txt ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Sexual violence, including harassment, is a pervasive, worldwide problem with a long history. This global problem has finally become a mainstream issue thanks to the efforts of survivors and advocates. Statistics show that girls and women are put at high risk of experiencing harassment. Women have about a 3 in 5 chance of experiencing sexual harassment, whereas men have slightly less than 1 in 5 chance Quinnipiac (2017); EEOC (2018); Goldstein (2018). While women in developing countries are facing distinct challenges with sexual violence Lea et al. (2017), however sexual violence is ubiquitous. In the United States, for example, there are on average >300,000 people who are sexually assaulted every year Morgan and Truman (2018). Additionally, these numbers could be underestimated, due to reasons like guilt, blame, doubt and fear, which stopped many survivors from reporting Griffith (2018). Social media can be a more open and accessible channel for those who have experienced harassment to be empowered to freely share their traumatic experiences and to raise awareness of the vast scale of sexual harassment, which then allows us to understand and actively address abusive behavior as part of larger efforts to prevent future sexual harassment. The deadly gang rape of a medical student on a Delhi bus in 2012 was a catalyst for protest and action, including the development of Safecity, which uses online and mobile technology to work towards ending sexual harassment and assault. More recently, the #MeToo and #TimesUp movements, further demonstrate how reporting personal stories on social media can raise awareness and empower women. Millions of people around the world have come forward and shared their stories. Instead of being bystanders, more and more people become up-standers, who take action to protest against sexual harassment online. The stories of people who experienced harassment can be studied to identify different patterns of sexual harassment, which can enable solutions to be developed to make streets safer and to keep women and girls more secure when navigating city spaces Karlekar and Bansal (2018). In this paper, we demonstrated the application of natural language processing (NLP) technologies to uncover harassment patterns from social media data. We made three key contributions:
2
+
3
+ 1. Safecity111https://safecity.in is the largest publicly-available online forum for reporting sexual harassment Karlekar and Bansal (2018). We annotated about 10,000 personal stories from Safecity with the key elements, including information of harasser (i.e. the words describing the harasser), time, location and the trigger words (i.e. the phrases indicate the harassment that occurred). The key elements are important for studying the patterns of harassment and victimology Griffith (2018); Ceccato (2017). Furthermore, we also associated each story with five labels that characterize the story in multiple dimensions (i.e. age of harasser, single/multiple harasser(s), type of harasser, type of location and time of day). The annotation data are available online.222https://github.com/alievent/harassment-analysis Please follow Safecity guidelines for usage.
4
+
5
+ 2. We proposed joint learning NLP models that use convolutional neural network (CNN) Lecun and Bengio (1995) and bi-directional long short-term memory (BiLSTM) Schuster and Paliwal (1997); Hochreiter and Schmidhuber (1997) as basic units. Our models can automatically extract the key elements from the sexual harassment stories and at the same time categorize the stories in different dimensions. The proposed models outperformed the single task models, and achieved higher than previously reported accuracy in classifications of harassment forms Karlekar and Bansal (2018).
6
+
7
+ 3. We uncovered significant patterns from the categorized sexual harassment stories.
8
+
9
+ Conventional surveys and reports are often used to study sexual harassment, but harassment on these is usually under-reported Goldstein (2018); Griffith (2018). The high volume of social media data available online can provide us a much larger collection of firsthand stories of sexual harassment. Social media data has already been used to analyze and predict distinct societal and health issues, in order to improve the understanding of wide-reaching societal concerns, including mental health, detecting domestic abuse, and cyberbullying Balani and De Choudhury (2015); Schrading et al. (2015); Ziegele et al. (2018); Agrawal and Awekar (2018).
10
+
11
+ There are a very limited number of studies on sexual harassment stories shared online. Karlekar and Bansal Karlekar and Bansal (2018) were the first group to our knowledge that applied NLP to analyze large amount ( ∼similar-to\sim10,000) of sexual harassment stories. Although their CNN-RNN classification models demonstrated high performance on classifying the forms of harassment, only the top 3 majority forms were studied. In order to study the details of the sexual harassment, the trigger words are crucial. Additionally, research indicated that both situational factors and person (or individual difference) factors contribute to sexual harassment Hitlan et al. (2009). Therefore, the information about perpetrators needs to be extracted as well as the location and time of events. Karlekar and Bansal Karlekar and Bansal (2018) applied several visualization techniques in order to capture such information, but it was not obtained explicitly. Our preliminary research demonstrated automatic extraction of key element and story classification in separate steps Liu et al. (2019). In this paper, we proposed joint learning NLP models to directly extract the information of the harasser, time, location and trigger word as key elements and categorize the harassment stories in five dimensions as well. Our approach can provide an avenue to automatically uncover nuanced circumstances informing sexual harassment from online stories.
12
+
13
+ We obtained 9,892 stories of sexual harassment incidents that was reported on Safecity. Those stories include a text description, along with tags of the forms of harassment, e.g. commenting, ogling and groping. A dataset of these stories was published by Karlekar and Bansal Karlekar and Bansal (2018). In addition to the forms of harassment, we manually annotated each story with the key elements (i.e. “harasser”, “time”, “location”, “trigger”), because they are essential to uncover the harassment patterns. An example is shown in Figure 1. Furthermore, we also assigned each story classification labels in five dimensions (Table 1). The detailed definitions of classifications in all dimensions are explained below.
14
+
15
+ Age of Harasser: Individual difference such as age can affect harassment behaviors. Therefore, we studied the harassers in two age groups, young and adult. Young people in this paper refer to people in the early 20s or younger.
16
+
17
+ Single/Multiple Harasser(s): Harassers may behave differently in groups than they do alone.
18
+
19
+ Type of Harasser: Person factors in harassment include the common relationships or titles of the harassers. Additionally, the reactions of people who experience harassment may vary with the harassers’ relations to themselves Griffith (2018). We defined 10 groups with respects to the harassers’ relationships or titles. We put conductors and drivers in one group, as they both work on the public transportation. Police and guards are put in the same category, because they are employed to provide security. Manager, supervisors, and colleagues are in the work-related group. The others are described by their names.
20
+
21
+ Type of Location: It will be helpful to reveal the places where harassment most frequently occurs Ceccato (2017); Karlekar and Bansal (2018). We defined 14 types of locations. “Station/stop” refers to places where people wait for public transportation or buy tickets. Private places include survivors’ or harassers’ home, places of parties and etc. The others are described by their names.
22
+
23
+ Time of Day: The time of an incident may be reported as “in evening” or at a specific time, e.g. “10 pm”. We considered that 5 am to 6 pm as day time, and the rest of the day as the night.
24
+
25
+ Because many of the stories collected are short, many do not contain all of the key elements. For example, “A man came near to her tried to be physical with her .”. The time and location are unknown from the story. In addition, the harassers were strangers to those they harassed in many cases. For instance, “My friend was standing in the queue to pay bill and was ogled by a group of boys.”, we can only learn that there were multiple young harassers, but the type of harasser is unclear. The missing information is hence marked as “unspecified”. It is different from the label “other”, which means the information is provided but the number of them is too small to be represented by a group, for example, a “trader”.
26
+
27
+ All the data were labeled by two annotators with training. Inter-rater agreement was measured by Cohen’s kappa coefficient, ranging from 0.71 to 0.91 for classifications in different dimensions and 0.75 for key element extraction (details can refer to Table 1 in supplementary file). The disagreements were reviewed by a third annotator and a final decision was made.
28
+
29
+ The key elements can be very informative when categorizing the incidents. For instance, in Figure 1, with identified key elements, one can easily categorize the incident in dimensions of “age of harasser” (adult), “single/multiple harasser(s)” (single), “type of harasser” (unspecified), “type of location” (park) , “time of day” (day time). Therefore, we proposed two joint learning schemes to extract the key elements and categorize the incidents together. In the models’ names, “J”, “A”, “SA” stand for joint learning, attention, and supervised attention, respectively.
30
+
31
+ In Figure 2, the first proposed structure consists of two layers of CNN modules.
32
+
33
+ J-CNN: To predict the type of key element, it is essential for the CNN model to capture the context information around each word. Therefore, the word along with its surrounding context of a fixed window size was converted into a context sequence. Assuming a window size of 2​l+12𝑙12l+1 around the target word w0subscript𝑤0w_{0}, the context sequence is [(w−l,w−l+1,…​w0,…​wl−1,wl)]delimited-[]subscript𝑤𝑙subscript𝑤𝑙1…subscript𝑤0…subscript𝑤𝑙1subscript𝑤𝑙[(w_{-l},w_{-l+1},...w_{0},...w_{l-1},w_{l})], where wi​(i∈[−l,l])subscript𝑤𝑖𝑖𝑙𝑙w_{i}(i\in[-l,l]) stands for the i​t​h𝑖𝑡ℎith word from w0subscript𝑤0w_{0}.
34
+
35
+ Because the context of the two consecutive words in the original text are only off by one position, it will be difficult for the CNN model to detect the difference. Therefore, the position of each word in this context sequence is crucial information for the CNN model to make the correct predictions Nguyen and Grishman (2015). That position was embedded as a p𝑝p dimensional vector, where p𝑝p is a hyperparameter. The position embeddings were learned at the training stage. Each word in the original text was then converted into a sequence of the concatenation of word and position embeddings. Such sequence was fed into the CNN modules in the first layer of the model, which output the high level word representation (hi,i∈[0,n−1]subscriptℎ𝑖𝑖0𝑛1h_{i},i\in[0,n-1], where n is the number of input words). The high level word representation was then passed into a fully connected layer, to predict the key element type for the word. The CNN modules in this layer share the same parameters.
36
+
37
+ We input the sequence of high level word representations (hisubscriptℎ𝑖h_{i}) from the first layer into another layer of multiple CNN modules to categorize the harassment incident in each dimension (Figure 2). Inside each CNN module, the sequence of word representations were first passed through a convolution layer to generate a sequence of new feature vectors (C=[c0,c1,…​cq]𝐶subscript𝑐0subscript𝑐1…subscript𝑐𝑞C=[c_{0},c_{1},...c_{q}]). This vector sequence (C𝐶C) was then fed into a max pooling layer. This is followed by a fully connected layer. Modules in this layer do not share parameters across classification tasks.
38
+
39
+ J-ACNN: We also experimented with attentive pooling, by replacing the max pooling layer. The attention layer aggregates the sequence of feature vectors (C𝐶C) by measuring the contribution of each vector to form the high level representation of the harassment story. Specifically,ui=t​a​n​h​(Wω​ci+bω)subscript𝑢𝑖𝑡𝑎𝑛ℎsubscript𝑊𝜔subscript𝑐𝑖subscript𝑏𝜔\displaystyle u_{i}=tanh(W_{\omega}c_{i}+b_{\omega})(1)αi=e​x​p​(uiT​uω)∑ie​x​p​(uiT​uw)subscript𝛼𝑖𝑒𝑥𝑝subscriptsuperscript𝑢𝑇𝑖subscript𝑢𝜔subscript𝑖𝑒𝑥𝑝subscriptsuperscript𝑢𝑇𝑖subscript𝑢𝑤\displaystyle\alpha_{i}=\frac{exp(u^{T}_{i}u_{\omega})}{\sum_{i}exp(u^{T}_{i}u_{w})}(2)v=∑iαi​ci𝑣subscript𝑖subscript𝛼𝑖subscript𝑐𝑖\displaystyle v=\sum_{i}\alpha_{i}c_{i}(3)
40
+
41
+ That is, a fully connected layer with non-linear activation was applied to each vector cisubscript𝑐𝑖c_{i} to get its hidden representation uisubscript𝑢𝑖u_{i}. The similarity of uisubscript𝑢𝑖u_{i} with a context vector uwsubscript𝑢𝑤u_{w} was measured and get normalized through a softmax function, as the importance weight αisubscript𝛼𝑖\alpha_{i}. The final representation of the incident story v𝑣v was an aggregation of all the feature vectors weighted by αisubscript𝛼𝑖\alpha_{i}. Wωsubscript𝑊𝜔W_{\omega}, bωsubscript𝑏𝜔b_{\omega} and uwsubscript𝑢𝑤u_{w} were learned during training.
42
+
43
+ The final representation (v𝑣v) was passed into one fully connected layer for each classification task. We also applied different attention layers for different classifications, because the classification modules categorize the incident in different dimensions, their focuses vary. For example, to classify “time of day”, one needs to focus on the time phrases, but pays more attention to harassers when classifying “age of harasser”.
44
+
45
+ J-SACNN: To further exploit the information of the key elements, we applied supervision Zhao et al. (2018) to the attentive pooling layer, with the annotated key element types of the words as ground truth. For instance, in classification of “age of harasser”, the ground truth attention labels for words with key element types of “harasser” are 1 and others are 0. To conform to the CNN structure, we applied convolution to the sequence of ground truth attention labels, with the same window size (w𝑤w) that was applied to the word sequence (Eq. 4).α∗(t)=W∘[et:et+w−1]\displaystyle\alpha^{*}(t)=W\circ[e_{t}:e_{t+w-1}](4)where ∘\circ is element-wise multiplication, etsubscript𝑒𝑡e_{t} is the ground truth attention label, and the W∈Rw×1𝑊superscript𝑅𝑤1W\in R^{w\times 1} is a constant matrix with all elements equal to 1. α∗superscript𝛼\alpha^{*} was normalized through a softmax function and used as ground truth weight values of the vector sequence (C𝐶C) output from the convolution layer. The loss was calculated between learned attention α𝛼\alpha and α∗superscript𝛼\alpha^{*} (Eq. 5), and added to the total loss.E​(α,α∗)=∑i=0q(αi−αi∗)2𝐸𝛼superscript𝛼subscriptsuperscript𝑞𝑖0superscriptsubscript𝛼𝑖subscriptsuperscript𝛼𝑖2\displaystyle E(\alpha,\alpha^{*})=\sum^{q}_{i=0}(\alpha_{i}-\alpha^{*}_{i})^{2}(5)
46
+
47
+ J-BiLSTM: The model input the sequence of word embeddings to the BiLSTM layer. To extract key elements, the hidden states from the forward and backward LSTM cells were concatenated and used as word representations to predict the key element types.
48
+
49
+ To classify the harassment story in different dimensions, concatenation of the forward and backward final states of BiLSTM layer was used as document level representation of the story.
50
+
51
+ J-ABiLSTM: We also experimented on BiLSTM model with the attention layer to aggregate the outputs from BiLSTM layer (Figure 3). The aggregation of the outputs was used as document level representation.
52
+
53
+ J-SABiLSTM: Similarly, we experimented with the supervised attention.
54
+
55
+ In all the models, softmax function was used to calculate the probabilities at the prediction step, and the cross entropy losses from extraction and classification tasks were added together. In case of supervised attention, the loss defined in Eq. 5 was added to the total loss as well. We applied the stochastic gradient descent algorithm with mini-batches and the AdaDelta updateRule (rho=0.95 and epsilon=1e-6) Zeiler (2012); Feng et al. (2016). The gradients were computed using back-propagation. During training, we also optimized the word and position embeddings.
56
+
57
+ Data Splits: We used the same splits of train, develop, and test sets used by Karlekar and Bansal Karlekar and Bansal (2018), with 7201, 990 and 1701 stories, respectively. In this study, we only considered single label classifications.
58
+
59
+ Baseline Models: CNN and BiLSTM models that perform classification and extraction separately were used as baseline models. In classification, we also experimented with BiLSTM with the attention layer. To demonstrate that the improvement came from joint learning structure rather the two layer structure in J-CNN, we investigated the same model structure without training on key element extraction. We use J-CNN* to denote it.
60
+
61
+ Preprocess: All the texts were converted to lowercase and preprocessed by removing non-alphanumeric characters, excluding “. ! ? ” . The word embeddings were pre-trained using fastText Bojanowski et al. (2016) with dimension equaling 100.
62
+
63
+ Hyperparameters: For the CNN model, the filter size was chosen to be (1,2,3,4), with 50 filters per filter size. Batch size was set to 50 and the dropout rate was 0.5. The BiLSTM model comprises two layers of one directional LSTM. Every LSTM cell has 50 hidden units. The dropout rate was 0.25. Attention size was 50.
64
+
65
+ We compared joint learning models with the single task models. Results are averages from five experiments. Although not much improvement was achieved in key element extraction (Figure 2), classification performance improved significantly with joint learning schemes (Table 3). Significance t-test results are shown in Table 2 in the supplementary file.
66
+
67
+ BiLSTM Based Models: Joint learning BiLSTM with attention outperformed single task BiLSTM models. One reason is that it directed the attention of the model to the correct part of the text. For example,
68
+
69
+ S1: “when i was returning my home after finishing my class . i was in queue to get on the micro bus and there was a girl opposite to me just then a young man tried to touch her on the breast .”
70
+
71
+ S2: “when i was returning my home after finishing my class . i was in queue to get on the micro bus and there was a girl opposite to me just then a young man tried to touch her on the breast .”
72
+
73
+ S3: “when i was returning my home after finishing my class . i was in queue to get on the micro bus and there was a girl opposite to me just then a young man tried to touch her on the breast .”
74
+
75
+ In S1, the regular BiLSTM with attention model for classification on “age of harasser” put some attention on phrases other than the harasser, and hence aggregated noise. This could explain why the regular BiLSTM model got lower performance than the CNN model. However, when training with key element extractions, it put almost all attention on the harasser “young man” (S2), which helped the model make correct prediction of “young harasser”. When predicting the “type of location” (S3), the joint learning model directed its attention to “micro bus”.
76
+
77
+ CNN Based Models: Since CNN is efficient for capturing the most useful information Chen et al. (2015), it is quite suitable for the classification tasks in this study. It achieved better performance than the BiLSTM model. The joint learning method boosted the performance even higher. This is because the classifications are related to the extracted key elements, and the word representation learned by the first layer of CNNs (Figure 2) is more informative than word embedding. By plotting of t-SNEs Maaten and Hinton (2008) of the two kinds of word vectors, we can see the word representations in the joint learning model made the words more separable (Figure 1 in supplementary file). In addition, no improvement was found with the J-CNN* model, which demonstrated the joint learning with extraction is essential for the improvement.
78
+
79
+ With supervised attentive pooling, the model can get additional knowledge from key element labels. It helped the model in cases when certain location phrases were mentioned but the incidents did not happen at those locations. For instance, “I was followed on my way home .”, max pooling will very likely to predict it as “private places”. But, it is actually unknown. In other cases, with supervised attentive pooling, the model can distinguish “metro” and “metro station”, which are “transportation” and “stop/station” respectively. Therefore, the model further improved on classifications on “type of location” with supervised attention in terms of macro F1. For some tasks, like “time of day”, there are fewer cases with such disambiguation and hence max pooling worked well. Supervised attention improved macro F1 in location and harasser classifications, because it made more correct predictions in cases that mentioned location and harasser. But the majority did not mention them. Therefore, the accuracy of J-SACNN did not increase, compared with the other models.
80
+
81
+ Classification on Harassment Forms: In Table 4, we also compared the performance of binary classifications on harassment forms with the results reported by Karlekar and Bansal Karlekar and Bansal (2018). Joint learning models achieved higher accuracy. In some harassment stories, the whole text or a span of the text consists of trigger words of multiple forms, such as “stare, whistles, start to sing, commenting”. The supervised attention mechanism will force the model to look at all such words rather than just the one related to the harassment form for classification and hence it can introduce noise. This can explain why J-SACNN got lower accuracy in two of the harassment form classifications, compared to J-ACNN. In addition, J-CNN model did best in “ogling” classification.
82
+
83
+ We plotted the distribution of harassment incidents in each categorization dimension (Figure 4). It displays statistics that provide important evidence as to the scale of harassment and that can serve as the basis for more effective interventions to be developed by authorities ranging from advocacy organizations to policy makers. It provides evidence to support some commonly assumed factors about harassment: First, we demonstrate that harassment occurred more frequently during the night time than the day time. Second, it shows that besides unspecified strangers (not shown in the figure), conductors and drivers are top the list of identified types of harassers, followed by friends and relatives.
84
+
85
+ Furthermore, we uncovered that there exist strong correlations between the age of perpetrators and the location of harassment, between the single/multiple harasser(s) and location, and between age and single/multiple harasser(s) (Figure 5). The significance of the correlation is tested by chi-square independence with p value less than 0.05. Identifying these patterns will enable interventions to be differentiated for and targeted at specific populations. For instance, the young harassers often engage in harassment activities as groups. This points to the influence of peer pressure and masculine behavioral norms for men and boys on these activities. We also found that the majority of young perpetrators engaged in harassment behaviors on the streets. These findings suggest that interventions with young men and boys, who are readily influenced by peers, might be most effective when education is done peer-to-peer. It also points to the locations where such efforts could be made, including both in schools and on the streets. In contrast, we found that adult perpetrators of sexual harassment are more likely to act alone. Most of the adult harassers engaged in harassment on public transportation. These differences in adult harassment activities and locations, mean that interventions should be responsive to these factors. For example, increasing the security measures on transit at key times and locations.
86
+
87
+ In addition, we also found that the correlations between the forms of harassment with the age, single/multiple harasser, type of harasser, and location (Figure 6). For example, young harassers are more likely to engage in behaviors of verbal harassment, rather than physical harassment as compared to adults. It was a single perpetrator that engaged in touching or groping more often, rather than groups of perpetrators. In contrast, commenting happened more frequently when harassers were in groups. Last but not least, public transportation is where people got indecently touched most frequently both by fellow passengers and by conductors and drivers. The nature and location of the harassment are particularly significant in developing strategies for those who are harassed or who witness the harassment to respond and manage the everyday threat of harassment. For example, some strategies will work best on public transport, a particular closed, shared space setting, while other strategies might be more effective on the open space of the street.
88
+
89
+ These results can provide valuable information for all members of the public. Sharing stories of harassment has been found by researchers to shift people’s cognitive and emotional orientation towards their traumatic experiences Dimond et al. (2013). Greater awareness of patterns and scale of harassment experiences promises to ensure those who have been subjected to this violence that they are not alone, empowering others to report incidents, and ensuring them that efforts are being made to prevent others from experiencing the same harassment. These results also provide various authorities tools to identify potential harassment patterns and to make more effective interventions to prevent further harassment incidents. For instance, the authorities can increase targeted educational efforts at youth and adults, and be guided in utilizing limited resources the most effectively to offer more safety measures, including policing and community-based responses. For example, focusing efforts on highly populated public transportation during the nighttime, when harassment is found to be most likely to occur.
90
+
91
+ We provided a large number of annotated personal stories of sexual harassment. Analyzing and identifying the social patterns of harassment behavior is essential to changing these patterns and social tolerance for them. We demonstrated the joint learning NLP models with strong performances to automatically extract key elements and categorize the stories. Potentiality, the approaches and models proposed in this study can be applied to sexual harassment stories from other sources, which can process and summarize the harassment stories and help those who have experienced harassment and authorities to work faster, such as by automatically filing reports Karlekar and Bansal (2018). Furthermore, we discovered meaningful patterns in the situations where harassment commonly occurred. The volume of social media data is huge, and the more we can extract from these data, the more powerful we can be as part of the efforts to build a safer and more inclusive communities. Our work can increase the understanding of sexual harassment in society, ease the processing of such incidents by advocates and officials, and most importantly, raise awareness of this urgent problem.
1911.00566v2.txt ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Automatic speech recognition (ASR) aims at transcribing recorded speech to text. In enclosed spaces, acoustic reflections and reverberation arrive at the receiver filtered and delayed relative to the direct propagation path, thus repeating and smearing the speech signal in time. Therefore, reverberation may negatively impact human speech intelligibility and the performance of ASR engines [1, 2].
2
+
3
+ The REVERB challenge aimed at providing a common data set to evaluate state-of-the-art ASR models in the presence of noise and reverberation [2]. The challenge results indicate that while the proposed ASR approaches varied substantially in terms of features, model architecture, and performance, they exhibited similar behaviour with respect to the relative increase or decrease of the word error rate (WER) as a function of the reverberation conditions [3]. To increase robustness of ASR engines against reverberation, prior work includes denoising and dereverberation techniques [4], improved speech features [5], improved model architectures [6], and data augmentation techniques [7, 8, 9].
4
+
5
+ With voice-enabled services being deployed in more challenging scenarios and becoming more ubiquitous, e.g., through the rise of smart home devices, it is useful to quantify the effect of reverberation on ASR performance. Assuming a linear and time-invariant system, the effect of reverberation on a sound signal is determined by the acoustic impulse response (AIR) of the reverberant environment. A convenient way to describe an AIR is by estimating acoustic parameters, including the reverberation time (T60), direct-to-reverberation ratio (DRR), clarity (C50), and definition (D50) [10].A recent study investigated the effect of these reverberation parameters on audio event classification [11]. Prior work on acoustic parameter estimation has indicated the usefulness of this parameterization in the context of ASR. Giri et al. showed that ASR performance in reverberant conditions could be improved by combining speech features with estimates for T60 and DRR [12].Fukumori et al. proposed predicting the performance of a hidden Markov model (HMM) based ASR system from a speech quality parameter (PESQ [13]) and definition [14]. Tsilfidis et al. showed that C50 and D50 can be used to predict phoneme recognition rate [15]. Parada et al. proposed a blind C50 estimator that is correlated with phoneme recognition [16].
6
+
7
+ Here we study the effect of reverberation on the performance of ASR systems in terms of the word error rate (WER).Speech recognition models convert an audio signal into a sequence of words, often via an intermediate phoneme representation [17], which lends itself to calculating a phoneme error rate (PER) as a performance metric.Prior work has used PER as an evaluation criterion, as it is assumed to be directly impacted by reverberation and does not depend on a language model [15, 16]. However, with the emergence of end-to-end speech recognition systems that map directly from acoustic input features to sequences of words [17], it may be difficult to derive a PER. Therefore, we focus on WER as the performance criterion instead. We evaluate two state-of-the-art ASR models on a clean speech corpus convolved with a large set of measured AIRs. First, we confirm that C50 and C80 remain the most important among a range of AIR parameters for predicting the WER. Next, we propose models for predicting WER from acoustic parameters, using a polynomial, sigmoidal, or neural network fit.Finally, we propose a non-intrusive approach for predicting WER blindly from reverberant speech samples using a convolutional neural network (CNN).The CNN model may be suitable for applications where neither the clean reference speech nor the raw AIRs are available. A light-weight, non-intrusive WER estimator could potentially be useful to derive a loss metric to train dereverberation models for ASR, or to predict WER for data without transcription to be used for unsupervised ASR (pre-)training [18].
8
+
9
+ To train and evaluate the proposed methods for WER prediction, we generated a large and diverse corpus of reverberated speech. Clean speech recordings were taken from the LibriSpeech ASR Corpus [19], a corpus containing speech from approximately 8000 public domain audio books, sampled at 16 kHz. We used the 100-hour training corpus for training the ASR models, and the test set for evaluation. To simulate reverberant speech, we compiled a large corpus of measured acoustic impulse responses (AIRs) from proprietary as well as publicly available data sets, in an effort to cover a wide range of acoustic conditions: the Aachen Impulse Response database [20], the Open Acoustic Impulse Response database [21], the Multichannel Acoustic Reverberation Database at York [22], the PORI Concert Hall Impulse Responses [23], AIRs published in the SOFA format [24], the REVERB Challenge database [25], SMARD [26], the Echothief Impulse Response Library [27], the Concert Hall Research Group database [28], the Real Acoustic Environments Working Group database [29], the QMUL Room Impulse Response Data Set [30], and The ACE Challenge Corpus [31]. After pruning AIRs with measurement-related issues or that were outliers otherwise, the set totalled 15 167 single-channel AIRs.
10
+
11
+ The reverberant set used to test the ASR systems and evaluate the WER prediction performance of the proposed methods consisted of the LibriSpeech “test clean” corpus, containing 2620 utterances by 40 speakers. The clean utterances were convolved with randomly drawn AIRs from the set described above. This process was repeated multiple times to increase the size of the evaluation set.For training and testing the WER prediction methods, the evaluation set was further split into 17 280 training (TR), 2430 validation (CV), and 2196 test utterances (TE), such that the talkers and AIRs in TE were not contained in TR.
12
+
13
+ The reverberation time (T60) is the time it takes for the AIR energy to drop by 60 dB. It is estimated here using the method by Karjalainen et al. [32, 31]. An alternative way to estimate reverberation time is by fitting a line to the energy decay curve (EDC) [31].Here, we fit a line from the point where the EDC drops below -5 dB to where it drops below -15 dB (T10), -20 dB (T15), -25 dB (T20), and -35 dB (T30). A metric shown to correlate well with human perception of reverberance is the early decay time (EDT), calculated at the point where the EDC first drops below -10 dB [33].
14
+
15
+ The bass ratio (BR) is the ratio between the average reverberation times at low and high frequencies [33]. With the reverberation time Tf of an AIR filtered through an octave-band filter with center frequency f𝑓f, the BR is given as [33]BR=T125+T250T500+T1000.BRsubscript𝑇125subscript𝑇250subscript𝑇500subscript𝑇1000\mathrm{BR}=\frac{T_{125}+T_{250}}{T_{500}+T_{1000}}.(1)
16
+
17
+ The direct-to-reverberant ratio (DRR) relates the energy of the direct path to the energy of reflected paths [31].The direct path energy is determined as the energy in a window of 2.5 ms around the maximum of the AIR, h​[n]ℎdelimited-[]𝑛h[n], while the energy outside this window is taken as the reverberant energy [31]:DRR=10​log10⁡(∑n=nd−nwnd+nwh​[n]2∑n=nd+nw∞h​[n]2),DRR10subscript10superscriptsubscript𝑛subscript𝑛𝑑subscript𝑛𝑤subscript𝑛𝑑subscript𝑛𝑤ℎsuperscriptdelimited-[]𝑛2superscriptsubscript𝑛subscript𝑛𝑑subscript𝑛𝑤ℎsuperscriptdelimited-[]𝑛2\mathrm{DRR}=10\log_{10}\left(\frac{\sum_{n=n_{d}-n_{w}}^{n_{d}+n_{w}}h[n]^{2}}{\sum_{n=n_{d}+n_{w}}^{\infty}h[n]^{2}}\right),(2)wherend=arg⁡max𝑛​|h​[n]|subscript𝑛𝑑𝑛ℎdelimited-[]𝑛n_{d}=\underset{n}{\arg\max}~{}|h[n]|(3)and nwsubscript𝑛𝑤n_{w} denotes the number of samples corresponding to a window length of 2.5 ms. Note that 2 and 3 are slightly modified compared to the definitions given by Eaton et al. [31] to operate on AIRs with unknown measurement characteristics.Similar to DRR, clarity is a measure for the energy ratio between early and late parts of the AIR [33]. It is given asCt=10​log10⁡(∑n=n0n0+nth​[n]2∑n=nt∞h​[n]2),subscriptC𝑡10subscript10superscriptsubscript𝑛subscript𝑛0subscript𝑛0subscript𝑛𝑡ℎsuperscriptdelimited-[]𝑛2superscriptsubscript𝑛subscript𝑛𝑡ℎsuperscriptdelimited-[]𝑛2\mathrm{C}_{t}=10\log_{10}\left(\frac{\sum_{n=n_{0}}^{n_{0}+n_{t}}h[n]^{2}}{\sum_{n=n_{t}}^{\infty}h[n]^{2}}\right),(4)where n0subscript𝑛0n_{0} is defined asthe sample with the largest drop in the EDC, which was found to be a relatively robust measure for determining the direct path,and ntsubscript𝑛𝑡n_{t} is the number of samples corresponding to a window length t𝑡t in ms. With 4, we estimate C30, C50, and C80. Similarly, the definition, DtsubscriptD𝑡\mathrm{D}_{t}, can be calculated as [33]:Dt=(∑n=n0n0+nth​[n]2∑n=n0∞h​[n]2).subscriptD𝑡superscriptsubscript𝑛subscript𝑛0subscript𝑛0subscript𝑛𝑡ℎsuperscriptdelimited-[]𝑛2superscriptsubscript𝑛subscript𝑛0ℎsuperscriptdelimited-[]𝑛2\mathrm{D}_{t}=\left(\frac{\sum_{n=n_{0}}^{n_{0}+n_{t}}h[n]^{2}}{\sum_{n=n_{0}}^{\infty}h[n]^{2}}\right).(5)Given 5, we estimate D30, D50, and D80.
18
+
19
+ The center time (Tc) is defined as [15]:Tc=∑n=n0∞n−n0f​s​h​[n]2∑n=n0∞h​[n]2,Tcsuperscriptsubscript𝑛subscript𝑛0𝑛subscript𝑛0𝑓𝑠ℎsuperscriptdelimited-[]𝑛2superscriptsubscript𝑛subscript𝑛0ℎsuperscriptdelimited-[]𝑛2\mathrm{Tc}=\frac{\sum_{n=n_{0}}^{\infty}\frac{n-n_{0}}{fs}h[n]^{2}}{\sum_{n=n_{0}}^{\infty}h[n]^{2}},(6)where f​s𝑓𝑠fs denotes the sampling rate.The resulting KK\mathrm{K} = 15 parameters are referred to as raw acoustic parameters aksubscript𝑎𝑘a_{k}, with 1≤k≤151𝑘151\leq k\leq 15.
20
+
21
+ The word error rate (WER) of an ASR engine is calculated as:WER=D+S+IT,WER𝐷𝑆𝐼𝑇\mathrm{WER}=\frac{D+S+I}{T},(7)where T𝑇T is the total number of words, andD𝐷D, S𝑆S, I𝐼I are the number of erroneous deletions, substitutions, and insertions, respectively.
22
+
23
+ To determine performance of the proposed prediction models, we calculate the absolute Pearson correlation coefficient, Pearson correlation coefficient (ρ𝜌\rho), and the root-mean-square error (RMSE) between true and predicted WER.
24
+
25
+ We use two state-of-the-art ASR models to evaluate the proposed methods to predict WER.The baseline model was obtained using the Kaldi recipe “s5” for LibriSpeech [34] to train an ASR model on the clean 100-hour LibriSpeech corpus (SR1). A more realistic training procedure for evaluating ASR performance on reverberant speech is to provide the network with reverberant training samples. Here we re-train the ASR model on the 100-hour corpus with 50% of the samples convolved with AIRs drawn randomly from the set described in Section 2 (SR2).
26
+
27
+ Recently, Ravanelli et al. proposed ASR models based on the Kaldi recipe that achieve state-of-the-art performance for LibriSpeech [35]. We train their proposed model based on Light Gated Recurrent Units (liGRUs) and feature-space Maximum Likelihood Linear Regression (fMLLR) features, bothon the clean 100-hour LibriSpeech corpus (SR3) as well as the 50% reverberated corpus described above (SR4).
28
+
29
+ A number of acoustic parameters have previously been shown to be correlated with error rates for phoneme recognition tasks. Here we explore their ability to generalize as predictors of WER. The estimated WER is obtained by mapping a raw acoustic parameter, aksubscript𝑎𝑘a_{k} (see Section 2.1), to the true WER via a polynomial fit:WER^p​(𝒑,ak)=pM​akM+pM−1​akM−1+⋯+p0​ak0,subscript^WERp𝒑subscript𝑎𝑘subscript𝑝𝑀superscriptsubscript𝑎𝑘𝑀subscript𝑝𝑀1superscriptsubscript𝑎𝑘𝑀1⋯subscript𝑝0superscriptsubscript𝑎𝑘0\widehat{\mathrm{WER}}_{\text{p}}({\mbox{\boldmath$p$}},a_{k})=p_{M}a_{k}^{M}+p_{M-1}a_{k}^{M-1}+\cdots+p_{0}a_{k}^{0},(8)where 𝒑=[pM,⋯​p0]𝒑subscript𝑝𝑀⋯subscript𝑝0{\mbox{\boldmath$p$}}=[p_{M},\cdots p_{0}],and M∈{1,3}𝑀13M\in\{1,3\} is the polynomial order. Second-order polynomials are not considered as the mapping of aksubscript𝑎𝑘a_{k} to WER is assumed to be monotonic.
30
+
31
+ As can be seen in Figure 2,the WER as a function of C50 may plateau at the lower end where the ASR model reaches clean speech performance, as well as at the upper end as the WER approaches 100% (though for corner cases, WER as defined in 7 may exceed 100%).Therefore, we propose a sigmoidal fit 9, as an alternative to first and third order polynomial fits:WER^s​(𝒒,ak)=q1+q2−q11+exp⁡(q3​(ak−q4)).subscript^WERs𝒒subscript𝑎𝑘subscript𝑞1subscript𝑞2subscript𝑞11subscript𝑞3subscript𝑎𝑘subscript𝑞4\widehat{\mathrm{WER}}_{\text{s}}({\mbox{\boldmath$q$}},a_{k})=q_{1}+\frac{q_{2}-q_{1}}{1+\exp\left(q_{3}(a_{k}-q_{4})\right)}.(9)Coefficients qisubscript𝑞𝑖q_{i} are derived by squared error minimization:arg⁡min𝒒​‖WER−f​(𝒒,a)‖22,𝒒subscriptsuperscriptnormWER𝑓𝒒𝑎22\underset{{\mbox{\boldmath$q$}}}{\arg\min}~{}||\mathrm{WER}-f({\mbox{\boldmath$q$}},a)||^{2}_{2},(10)where ||⋅||2||\cdot||_{2} is the L2subscript𝐿2L_{2} norm,andf​(𝒒,a)𝑓𝒒𝑎f({\mbox{\boldmath$q$}},a) is the fitting function as defined in 8 or 9. For evaluation, the minimization in 10 is performed on the training set and tested on a hold-out set, to ensure the fit generalizes to unseen data.The goodness of fit is determined using the RMSE and ρ𝜌\rho between the true and predicted WER.
32
+
33
+ To better understand the interaction of the acoustic parameters and their effect on WER we performed a principal component analysis (PCA) [36].A total of three components explained 97% of the variance.We further studied the combined predictive power of the AIR parameters using a multilayer perceptron (MLP), as illustrated in Figure 1b. We kept the network complexity low, following PCA findings.The network consisted of L𝐿L fully connected hidden layers, with Nlsubscript𝑁𝑙N_{l} neurons each. The estimated parameters of Section 2.1 comprise the input of the network, with WER as the output.The evaluation set described in Section 2 was used for training, validating and testing the model.The network parameters were optimized on the validation set via grid search and mean-square-error loss, over 30 epochs, with L∈[0,4]𝐿04L\in[0,4] and Nl∈[1,32]subscript𝑁𝑙132N_{l}\in[1,32], a 5% drop-out rate, and rectified linear unit (ReLU) activation functions. We propose a network with one fully connected layer with 3 neurons.
34
+
35
+ In practice, the clean speech or raw AIRs of reverberant speech may not be available, e.g., if the samples stem from actual device recordings. We propose an alternative, data-driven approach to predict WER directly from the reverberant speech samples. The assumption is that much like blind or non-intrusive acoustic parameter estimation can be used as a proxy for estimating ASR performance [16], a neural network model can be trained to extract features from reverberant speech that are correlated with WER. The proposed method assumes reverberant speech samples transcribed by an ASR engine and the corresponding WER per utterance calculated by 7. The same data split as described in Section 2 is used. A neural network model is trained on the TR set to predict the WER non-intrusively, using a squared-error loss function. The CV set is used to monitor training progress and ensure a good model fit.
36
+
37
+ The goal of the proposed model is to predict WER on the unseen test data TE, using a neural network that is substantially more light-weight than a fully-blown, state-of-the-art ASR model.The input features are inspired by approaches used for ASR, i.e., the proposed model may lend itself to operating directly on the features extracted by the ASR engine, thus saving computations. The samples are processed in frames of 640 samples, corresponding to a frame length of 25 ms at a sampling rate of 16 kHz, with a hop size of 160 samples, i.e., 10 ms. 26 Mel-frequency bins are extracted per frame, and 100 consecutive frames are combined to a 26×1002610026\times 100 feature matrix, which corresponds to about 1 s of speech. We propose a 4-layer convolutional neural network (CNN) model with ReLU activation functions that operates on the input feature matrices of each utterance. All but the first layer are followed by 3×3333\times 3 average-pooling layers with a stride of (2,2). The CNN is followed by a single long short-term memory (LSTM) layer with four cells that accumulates frame-level estimates to produce one WER prediction per utterance. The 7809 model parameters are trained over 100 epochs in about 4 hours on 4 GPUs. Figure 1c illustrates the proposed CNN-LSTM model.
38
+
39
+ Experiments are performed on four ASR models, described in Section 2.3, and using the evaluation set described in Section 2.
40
+
41
+ Performance of the four ASR models is summarized in Table 1, in terms of WER for the clean LibriSpeech test set as well as the reverberant evaluation set (TR + CV + TE, as described in Section 2, i.e., note that TR refers to the training set used to train the WER predictors, not the ASR model). As can be seen, the WER increases dramatically for reverberant speech for all four models. However, the models trained on a set containing 50% reverberant samples, i.e., SR2 and SR4, clearly outperform the models trained entirely on clean speech, at the cost of a slight decrease in clean-speech performance. Figure 2 clearly shows this effect as well.We assume that these WERs are representative of the performance of state-of-the-art ASR models in challenging reverberant conditions.
42
+
43
+ Figure 3 illustrates the goodness of fit for the acoustic parameters extracted from the AIR (see Section 2.1), for the four tested ASR models and the TE set. Clarity, Ct, definition, Dt, and center time, Tc, best predict the WER. For the linear fit, C50 exhibits slightly lower correlation with WER, ρ𝜌\rho =0.78absent0.78=0.78 averaged across ASR models, than the correlation reported by Parada et al. with phoneme error rate [16]. This seems to confirm their hypothesis that phoneme error rate better reflects the effect of reverberation, as it eliminates the effect of the language model [16]. A third-order polynomial or sigmoidal fit, with coefficients derived from the TR set, improved the predictive power of all tested AIR parameters on the TE set.
44
+
45
+ Table 2 summarizes the WER prediction results. In line with prior findings, C50 serves as a relatively good predictor for WER for the tested state-of-the-art ASR models. Applying a third-order polynomial or sigmoidal fit to the raw estimates, using coefficients derived from the TR set (cf. Section 3.1), improves accuracy in all cases. The proposed MLP provides more accurate WER estimates (in terms or RMSE and ρ𝜌\rho) than a direct fit.Finally, the proposed CNN-LSTM model, which estimates WER blindly from reverberant speech samples, slightly outperforms all other tested estimators. Note that while a one-way Anova does not indicate a statistically significant reduction in error rate compared to a linear C50 fit, the improvement is consistent across all tested ASR models and obtained without reference or knowledge of the AIR parameters.
46
+
47
+ Our results indicate that word error rate (WER) of an automatic speech recognition (ASR) model processing reverberant speech can be predicted directly from acoustic impulse response (AIR) parameters, as well as blindly from the reverberant utterances. We tested two state-of-the-art ASR models, trained either entirely on clean speech or on a combination of clean and reverberant speech. Our results are in line with prior art, indicating that clarity, i.e., C50 and C80, as well as definition, i.e., D50 and D80, are highly correlated with WER. We show that WER prediction can be improved by using a third-order polynomial or sigmoidal fit or a neural network to map AIR parameters directly to WER. Finally, we propose a convolutional neural network (CNN) model that predicts WER blindly from the reverberant speech samples, without knowledge of the underlying AIR parameters or access to the clean speech. The proposed models may prove useful for developing speech enhancement models or unsupervised ASR (pre-)training. A noteworthy limitation of the present work is that noise is not considered. Future work includes extending the WER estimators to reverberant speech in noise as well as studying how well they generalize to unseen ASR models.
48
+
49
+ The authors thank Yifan Gong from Microsoft Speech Services for advice on the speech data and ASR models.
1911.00627v1.txt ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Video interpolation aims to synthesize intermediate frames between the original input images, which can temporally upsample low-frame rate videos to higher-frame rates.It is a fundamental problem in computer vision as it helps overcome the temporal limitations of camera sensors and can be used in numerous applications, such as motion deblurring [5, 35], video editing [38, 25], virtual reality [1], and medical imaging [11].
2
+
3
+ Most state-of-the-art video interpolation methods [9, 14, 2, 3, 17] explicitly or implicitly assume uniform motion between consecutive frames, where the objects move along a straight line at a constant speed.As such, these approaches usually adopt linear models for synthesizing intermediate frames.However, the motion in real scenarios can be complex and non-uniform, and the uniform assumption may not always hold in the input videos, which often leads to inaccurate interpolation results.Moreover, the existing models are mainly developed based on two consecutive frames for interpolation, and the higher-order motion information of the video (e.g., acceleration) has not been well exploited.An effective frame interpolation algorithm should use additional input frames and estimate the higher-order information for more accurate motion prediction.
4
+
5
+ To this end, we propose a quadratic video interpolation method to exploit additional input frames toovercome the limitations of linear models.Specifically, we develop a data-driven model which integrates convolutional neural networks (CNNs) [13, 24] and quadratic models [15] for accurate motion estimation and image synthesis.The proposed algorithm is acceleration-aware, and thus allows predictions with curvilinear trajectory and variable velocity.Although the ideas of our method are intuitive and sensible,this task is challenging as we need to estimate the flow field from the unknown target frame to the source frame (i.e., backward flow) for image synthesis, which cannot be easily obtained with existing approaches.To address this issue,we propose a flow reversal layer to effectively convert forward flow to backward flow.In addition, we introduce new techniques for filtering the estimated flow maps.As shown in Figure 1, the proposed quadratic model can better approximatepixel motion in real world and thus obtain more accurate interpolation results.
6
+
7
+ The contributions of this work can be summarized as follows.First, we propose a quadratic interpolation algorithm for synthesizing accurate intermediate video frames.Our method exploits the acceleration information of the video, which can better model the nonlinear movements in the real world.Second, we develop a flow reversal layer to estimate the flow field from the target frame to the source frame, thereby facilitating high-quality frame synthesis.In addition, we present novel techniques for refining flow fields in the proposed method.We demonstrate that our method performs favorably against the state-of-the-art video interpolation methods on different video datasets.While we focus on quadratic functions in this work, the proposed framework for exploiting the acceleration information is general, and can be further extended to higher-order models.
8
+
9
+ Most state-of-the-art approaches [4, 2, 14, 9, 19, 17, 3] for video interpolation explicitly or implicitly assume uniform motion between consecutive frames.As a typical example, Baker et al. [2] use optical flow and forward warping to linearly move pixels to the intermediate frames.Liu et al. [14] develop a CNN model to directly learn the uniform motion for interpolating the middle frame.Similarly, Jiang et al. [9] explicitly assume uniform motion with flow estimation networks, which enables a multi-frame interpolation model.
10
+
11
+ On the other hand, Meyer et al. [17] develop a phase-based method to combine the phase information across different levels of a multi-scale pyramid, where the phase is modeledas a linear function of time with the implicit uniform motion assumption.Since the above linear approaches do not exploithigher-order information in videos, the interpolation results are less accurate.
12
+
13
+ Kernel-based algorithms [20, 21, 33] have also been proposed for frame interpolation.While these methods are not constrained by the uniform motion model,existing schemes do not handle nonlinear motion in complex scenarios well asonly the visual information of two consecutive frames is used for interpolation.
14
+
15
+ Closely related to our work is the method by McAllister and Roulier [15]which uses quadratic splines for data interpolation to preserve the convexity ofthe input.However, this method can only be applied to low-dimensional data, while we solve the problem of video interpolation which is in much higher dimensions.
16
+
17
+ To synthesize an intermediate frame I^tsubscript^𝐼𝑡\hat{I}_{t} where t∈(0,1)𝑡01t\in(0,1),existing algorithms [9, 21, 14] usually assume uniform motion between the two consecutive frames I0,I1subscript𝐼0subscript𝐼1I_{0},I_{1}, and adopt linear models for interpolation.However, this assumption cannot approximate the complex motion in real world well and often leads to inaccurately interpolated results.To solve this problem, we propose a quadratic interpolation method forpredicting more accurate intermediate frames.The proposed method is acceleration-aware, and thus can better approximate real-world scene motion.
18
+
19
+ An overview of our quadratic interpolation algorithm is shown in Figure 2,where we synthesize the frame I^tsubscript^𝐼𝑡\hat{I}_{t} by fusing pixels warped from I0subscript𝐼0I_{0} and I1subscript𝐼1I_{1}.We use I−1subscript𝐼1I_{-1}, I0subscript𝐼0I_{0}, and I1subscript𝐼1I_{1} to warp pixels from I0subscript𝐼0I_{0} and describe this part in details in the following sections,and the warping from the other side (i.e., I1subscript𝐼1I_{1}) can be performed similarly by using I0subscript𝐼0I_{0}, I1subscript𝐼1I_{1}, and I2subscript𝐼2I_{2}.Specifically,we first compute optical flow 𝒇0→1subscript𝒇→01\bm{f}_{0\to 1} and 𝒇0→−1subscript𝒇→01\bm{f}_{0\to-1} with the state-of-the-art flow estimation network PWC-Net [31].We then predict the intermediate flow map 𝒇0→tsubscript𝒇→0𝑡\bm{f}_{0\to t} using 𝒇0→1subscript𝒇→01\bm{f}_{0\to 1} and 𝒇0→−1subscript𝒇→01\bm{f}_{0\to-1} in Section 3.1.In Section 3.2, we propose a new method to estimate the backward flow 𝒇t→0subscript𝒇→𝑡0\bm{f}_{t\to 0} by reversing the forward flow 𝒇0→tsubscript𝒇→0𝑡\bm{f}_{0\to t}.Finally, we synthesize the interpolated results with the backward flow in Section 3.3.
20
+
21
+ To interpolate frame I^tsubscript^𝐼𝑡\hat{I}_{t}, we first consider the motion model of a pixel from I0subscript𝐼0I_{0}:𝒇0→t=∫0t[𝒗0+∫0κ𝒂τ​𝑑τ]​𝑑κ,subscript𝒇→0𝑡superscriptsubscript0𝑡delimited-[]subscript𝒗0superscriptsubscript0𝜅subscript𝒂𝜏differential-d𝜏differential-d𝜅\bm{f}_{0\to t}=\int_{0}^{t}\left[\bm{v}_{0}+\int_{0}^{\kappa}\bm{a}_{\tau}d\tau\right]d\kappa,(1)where 𝒇0→tsubscript𝒇→0𝑡\bm{f}_{0\to t} denotes the displacement of the pixel from frame 00 to t𝑡t,𝒗0subscript𝒗0\bm{v}_{0} is the velocity at frame 00,and 𝒂τsubscript𝒂𝜏\bm{a}_{\tau} represents the acceleration at frame τ𝜏\tau.
22
+
23
+ Existing models [9, 14, 21] usually explicitly or implicitly assume uniform motion and set 𝒂τ=𝟎subscript𝒂𝜏0\bm{a}_{\tau}=\bm{0} between consecutive frames, where (1) can be rewritten as a linear function of t𝑡t:𝒇0→t=t​𝒇0→1.subscript𝒇→0𝑡𝑡subscript𝒇→01\bm{f}_{0\to t}=t\bm{f}_{0\to 1}.(2)However, the objects in real scenarios do not always travel in a straight line at a constant velocity,.Thus, these linear approaches cannot effectively model the complex non-uniform motionand often lead to inaccurate interpolation results.
24
+
25
+ In contrast, we take higher-order information into consideration and assume a constant 𝒂τsubscript𝒂𝜏\bm{a}_{\tau} for τ∈[−1,1]𝜏11\tau\in[-1,1].Correspondingly, the flow from frame 00 to t𝑡t can be derived as:𝒇0→t=(𝒇0→1+𝒇0→−1)/2×t2+(𝒇0→1−𝒇0→−1)/2×t,subscript𝒇→0𝑡subscript𝒇→01subscript𝒇→012superscript𝑡2subscript𝒇→01subscript𝒇→012𝑡\bm{f}_{0\to t}=(\bm{f}_{0\to 1}+\bm{f}_{0\to-1})/2\times t^{2}+(\bm{f}_{0\to 1}-\bm{f}_{0\to-1})/2\times t,(3)which is equivalent to temporally interpolating pixels with a quadratic function.
26
+
27
+ This formulation relaxes the constraint of constant velocity and rectilinear movement of linear models, and thus allows accelerated and curvilinear motion prediction between frames.In addition, existing methods with linear models only use the two closest frames I0,I1subscript𝐼0subscript𝐼1I_{0},I_{1},whereas our algorithm naturally exploits visual information from more neighboring frames.
28
+
29
+ While we obtain forward flow 𝒇0→tsubscript𝒇→0𝑡\bm{f}_{0\to t} from quadratic flow prediction, it cannot be easily used for synthesizing images.Instead, we need backward flow 𝒇t→0subscript𝒇→𝑡0\bm{f}_{t\to 0} for high-quality frame synthesis [16, 31, 14, 9].To estimate the backward flow, Jiang et al. [9] introduce a simple method which linearly combines 𝒇0→1subscript𝒇→01\bm{f}_{0\to 1} and 𝒇1→0subscript𝒇→10\bm{f}_{1\to 0} to approximate 𝒇t→0subscript𝒇→𝑡0\bm{f}_{t\to 0}.However, this approach does not perform well around motion boundaries as shown in Figure 3(a).More importantly, this approach cannot be applied in our quadratic method to exploit the acceleration information.
30
+
31
+ In this work, we propose a flow reversal layer for better prediction of 𝒇t→0subscript𝒇→𝑡0\bm{f}_{t\to 0}.We first project the flow map 𝒇0→tsubscript𝒇→0𝑡\bm{f}_{0\to t} to frame t𝑡t, where a pixel 𝒙𝒙\bm{x} on I0subscript𝐼0I_{0} corresponds to 𝒙+𝒇0→t​(𝒙)𝒙subscript𝒇→0𝑡𝒙\bm{x}+\bm{f}_{0\to t}(\bm{x}) on Itsubscript𝐼𝑡I_{t}.Next, we compute the flow of a pixel 𝒖𝒖\bm{u} on Itsubscript𝐼𝑡I_{t} by reversing and averaging the projected flow values that fall into the neighborhood 𝒩​(𝒖)𝒩𝒖\mathcal{N}(\bm{u}) of pixel 𝒖𝒖\bm{u}.Mathematically, this process can be written as:𝒇t→0​(𝒖)=∑𝒙+𝒇0→t​(𝒙)∈𝒩​(𝒖)w​(‖𝒙+𝒇0→t​(𝒙)−𝒖‖2)​(−𝒇0→t​(𝒙))∑𝒙+𝒇0→t​(𝒙)∈𝒩​(𝒖)w​(‖𝒙+𝒇0→t​(𝒙)−𝒖‖2),subscript𝒇→𝑡0𝒖subscript𝒙subscript𝒇→0𝑡𝒙𝒩𝒖𝑤subscriptnorm𝒙subscript𝒇→0𝑡𝒙𝒖2subscript𝒇→0𝑡𝒙subscript𝒙subscript𝒇→0𝑡𝒙𝒩𝒖𝑤subscriptnorm𝒙subscript𝒇→0𝑡𝒙𝒖2\bm{f}_{t\to 0}(\bm{u})=\frac{\sum_{\bm{x}+\bm{f}_{0\to t}(\bm{x})\in\mathcal{N}(\bm{u})}w(\|\bm{x}+\bm{f}_{0\to t}(\bm{x})-\bm{u}\|_{2})(-\bm{f}_{0\to t}(\bm{x}))}{\sum_{\bm{x}+\bm{f}_{0\to t}(\bm{x})\in\mathcal{N}(\bm{u})}w(\|\bm{x}+\bm{f}_{0\to t}(\bm{x})-\bm{u}\|_{2})},(4)where w​(d)=e−d2/σ2𝑤𝑑superscript𝑒superscript𝑑2superscript𝜎2w(d)=e^{-d^{2}/\sigma^{2}} is the Gaussian weight for each flow.The proposed flow reversal layer is conceptually similar to the surface splatting [39] in computer graphics where the optical flow in our work is replaced by camera projection.During training, while the reversal layer itself does not have learnable parameters, it is differentiable and allows the gradients to be backpropagated to the flow estimation module in Figure 2, and thus enables end-to-end training of the whole system.
32
+
33
+ Note that the proposed reversal approach can lead to holes in the estimated flow map 𝒇t→0subscript𝒇→𝑡0\bm{f}_{t\to 0}, which is mostly due to the objects visible in Itsubscript𝐼𝑡I_{t} but occluded in I0subscript𝐼0I_{0}.And the missing objects are filled with the pixels warped from I1subscript𝐼1I_{1} which is on the other side of the interpolation model.
34
+
35
+ In this section, we first refine the reversed flow field with adaptive filtering.Then we use the refined flow to generate the interpolated results with backward warping and frame fusion.
36
+
37
+ Adaptive flow filtering.
38
+
39
+ While our approach is effective in reversing flow maps, the generated backward flow 𝒇t→0subscript𝒇→𝑡0\bm{f}_{t\to 0} may still have some ringing artifacts around edges as shown in Figure 3(b), which are mainly due to outliers in the original estimations of the PWC-Net.A straightforward way to reduce these artifacts [9, 6, 31] is to train deep CNNs with residual connections to refine the initial flow maps.However, this strategy does not work well in our practice as shown in Figure 3(c).This is because the artifacts from the flow reversal layer are mostly thin streaks with spike values (Figure 3(b)).Such outliers cannot be easily removed since the weighted averaging of convolution can be affected by the spiky outliers.
40
+
41
+ Inspired by the median filter [7] which samples only one pixel from a neighborhood and avoids the issues of weighted averaging,we propose a flow filtering network to adaptively sample the flow map for removing outliers.While the classical median filter involves indifferentiable operation and cannot be easily trained in our end-to-end model, the proposed method learns to sample one pixel in a neighborhood with neural networks and can more effectively reduce the artifacts of the flow map.
42
+
43
+ Specifically, we formulate the adaptive filtering process as follows:𝒇′t→0​(𝒖)=𝒇t→0​(𝒖+𝜹​(𝒖))+𝒓​(𝒖),subscriptsuperscript𝒇bold-′→𝑡0𝒖subscript𝒇→𝑡0𝒖𝜹𝒖𝒓𝒖\bm{f^{\prime}}_{t\to 0}(\bm{u})=\bm{f}_{t\to 0}(\bm{u}+\bm{\delta}(\bm{u}))+\bm{r}(\bm{u}),(5)where 𝒇′t→0subscriptsuperscript𝒇bold-′→𝑡0\bm{f^{\prime}}_{t\to 0} denotes the filtered backward flow,and 𝜹​(𝒖)𝜹𝒖\bm{\delta}(\bm{u}) is the learned sampling offset of pixel 𝒖𝒖\bm{u}.We constrain 𝜹​(𝒖)∈[−k,k]𝜹𝒖𝑘𝑘\bm{\delta}(\bm{u})\in[-k,k] by using k×tanh⁡(⋅)𝑘⋅k\times\tanh(\cdot) as the activation function of 𝜹𝜹\bm{\delta}such that the proposed flow filter has a local receptive field of 2​k+12𝑘12k+1.Since the flow map is sparse and smooth in most regions, we do not directly rectify the artifacts with CNNs as the schemes in [9, 31, 6].Instead, we rely on the flow values around outliers by sampling in a neighborhood, where 𝜹𝜹\bm{\delta} is trained to find the suitable sampling locations.The residual map 𝒓𝒓\bm{r} is learned for further improvement.Our filtering method enables spatially-variant and nonlinear refinement of 𝒇t→0subscript𝒇→𝑡0\bm{f}_{t\to 0}, which could be seen as a learnable median filter in spirit.As show in Figure 3(d), the proposed algorithm can effectively reduce the artifacts in the reversed flow maps.More implementation details are presented in Section 4.2.
44
+
45
+ Warping and fusing source frames.
46
+
47
+ While we obtain 𝒇′t→0subscriptsuperscript𝒇bold-′→𝑡0\bm{f^{\prime}}_{t\to 0} with the input frames I−1subscript𝐼1I_{-1}, I0subscript𝐼0I_{0}, and I1subscript𝐼1I_{1},we can also estimate 𝒇′t→1subscriptsuperscript𝒇bold-′���𝑡1\bm{f^{\prime}}_{t\to 1} in a similar way with I0subscript𝐼0I_{0}, I1subscript𝐼1I_{1}, and I2subscript𝐼2I_{2}.Finally, we synthesize the intermediate video frames as:I^t​(𝒖)=(1−t)​m​(𝒖)​I0​(𝒖+𝒇′t→0​(𝒖))+t​(1−m​(𝒖))​I1​(𝒖+𝒇′t→1​(𝒖))(1−t)​m​(𝒖)+t​(1−m​(𝒖))subscript^𝐼𝑡𝒖1𝑡𝑚𝒖subscript𝐼0𝒖subscriptsuperscript𝒇bold-′→𝑡0𝒖𝑡1𝑚𝒖subscript𝐼1𝒖subscriptsuperscript𝒇bold-′→𝑡1𝒖1𝑡𝑚𝒖𝑡1𝑚𝒖\hat{I}_{t}(\bm{u})=\frac{(1-t)m(\bm{u})I_{0}(\bm{u}+\bm{f^{\prime}}_{t\to 0}(\bm{u}))+t(1-m(\bm{u}))I_{1}(\bm{u}+\bm{f^{\prime}}_{t\to 1}(\bm{u}))}{(1-t)m(\bm{u})+t(1-m(\bm{u}))}(6)where Ii​(𝒖+𝒇′t→i​(𝒖))subscript𝐼𝑖𝒖subscriptsuperscript𝒇bold-′→𝑡𝑖𝒖I_{i}(\bm{u}+\bm{f^{\prime}}_{t\to i}(\bm{u})) denotes the pixel warped from frame i𝑖i to t𝑡t with bilinear function [8].m𝑚m is a mask learned with a CNN to fuse the warped frames.Similar to [9], we also use the temporal distance 1−t1𝑡1-t and t𝑡t for the source frames I0subscript𝐼0I_{0} and I1subscript𝐼1I_{1}, such that we can give higher confidence to temporally-closer pixels.Note that we do not directly use the pixels in I−1subscript𝐼1I_{-1} and I2subscript𝐼2I_{2} for image synthesis, as almost all the contents in the intermediate frame can be found in I0subscript𝐼0I_{0} and I1subscript𝐼1I_{1}. Instead, I−1subscript𝐼1I_{-1} and I2subscript𝐼2I_{2} are exploited for acceleration-aware motion estimation.
48
+
49
+ Since all the above steps of our method are differentiable, we can train the proposed interpolation model in an end-to-end manner.The loss function for training our network is a combination of the ℓ1subscriptℓ1\ell_{1} loss and perceptual loss [10, 37]:‖I^t−It‖1+λ​‖ϕ​(I^t)−ϕ​(It)‖2,subscriptnormsubscript^𝐼𝑡subscript𝐼𝑡1𝜆subscriptnormitalic-ϕsubscript^𝐼𝑡italic-ϕsubscript𝐼𝑡2\|\hat{I}_{t}-I_{t}\|_{1}+\lambda\|\phi(\hat{I}_{t})-\phi(I_{t})\|_{2},(7)where Itsubscript𝐼𝑡I_{t} is the ground truth, and ϕitalic-ϕ\phi is the conv4_3 feature extractor of the VGG16 model [28].
50
+
51
+ In this section, we first provide implementation details of the proposed model, including training data, network structure, and hyper-parameters.We then present evaluation results of our algorithm with comparisons to the state-of-the-art methods on video datasets.The source code, data, and the trained models will be made available to the public for reproducible research.
52
+
53
+ To train the proposed interpolation model, we collect high-quality videos from the Internet, where each frame is of 1080×\times1920 pixels at the frame rate of 960 fpstimes960fps960\text{\,}\mathrm{f}\mathrm{p}\mathrm{s}.From the collected videos, we select the clips with both camera shake and dynamic object motion, which are beneficial for more effective network training.The final training dataset consists of 173 video clips of different scenes and 36926 frames in total.In addition, the 960 fpstimes960fps960\text{\,}\mathrm{f}\mathrm{p}\mathrm{s} video clips are randomly downsampled to 240 fpstimes240fps240\text{\,}\mathrm{f}\mathrm{p}\mathrm{s} and 480 fpstimes480fps480\text{\,}\mathrm{f}\mathrm{p}\mathrm{s} for data augmentation.During the training process, we extract non-overlapped frame groups from these video clips, where each has 4 input frames I−1,I0,I1,I2subscript𝐼1subscript𝐼0subscript𝐼1subscript𝐼2I_{-1},I_{0},I_{1},I_{2}, and 7 target frames Itsubscript𝐼𝑡I_{t}, t=0.125,0.25,…,0.875𝑡0.1250.25…0.875t=0.125,0.25,\ldots,0.875.We resize the frames into 360×\times640 and randomly crop 352×\times352patches for training.Image flipping and sequence reversal are also performed to fully utilize the video data.
54
+
55
+ We learn the adaptive flow filtering with a 23-layer U-Net [26, 36] which is an encoder-decoder network.The encoder is composed of 12 convolution layers with 5 average pooling layers for dowsampling, and the decoder has 11 convolution layers with 5 bilinear layers for upsampling.We add skip connections with pixel-wise summation between the same-resolution layers in the encoder and decoder to jointly use low-level and high-level features.The input of our network is a concatenation of I0subscript𝐼0I_{0}, I1subscript𝐼1I_{1}, I0tsuperscriptsubscript𝐼0𝑡I_{0}^{t}, I1tsuperscriptsubscript𝐼1𝑡I_{1}^{t}, 𝒇0→1subscript𝒇→01\bm{f}_{0\to 1}, 𝒇1→0subscript𝒇→10\bm{f}_{1\to 0}, 𝒇t→0subscript𝒇→𝑡0\bm{f}_{t\to 0}, and 𝒇t→1subscript𝒇→𝑡1\bm{f}_{t\to 1}, where Iit​(𝒖)=Ii​(𝒖+𝒇t→i​(𝒖))superscriptsubscript𝐼𝑖𝑡𝒖subscript𝐼𝑖𝒖subscript𝒇→𝑡𝑖𝒖I_{i}^{t}(\bm{u})=I_{i}(\bm{u}+\bm{f}_{t\to i}(\bm{u})) denotes the pixel warped with 𝒇t→isubscript𝒇→𝑡𝑖\bm{f}_{t\to i}.The U-Net produces the output 𝜹𝜹\bm{\delta} and 𝒓𝒓\bm{r} which are used to estimate the filtered flow map 𝒇′t→0subscriptsuperscript𝒇bold-′→𝑡0\bm{f^{\prime}}_{t\to 0} and 𝒇′t→1subscriptsuperscript𝒇bold-′→𝑡1\bm{f^{\prime}}_{t\to 1} with (5).Then we warp I0subscript𝐼0I_{0} and I1subscript𝐼1I_{1} with flow 𝒇′t→0subscriptsuperscript𝒇bold-′→𝑡0\bm{f^{\prime}}_{t\to 0} and 𝒇′t→1subscriptsuperscript𝒇bold-′→𝑡1\bm{f^{\prime}}_{t\to 1}, and feed the warped images to a 3-layer CNN to estimate the fusion mask m𝑚m which is finally used for frame interpolation with (6).
56
+
57
+ We first train the proposed network with the flow estimation module fixed for 200 epochs, and then finetune the whole system for another 40 epochs.Similar to [34], we use the Adam optimizer [12] for training.We initialize the learning rate as 10−4superscript10410^{-4} and further decrease it by a factor of 0.10.10.1 at the end of the \nth100 and \nth150 epochs. The trade-off parameter λ𝜆\lambda of the loss function (7) is set to be 0.0050.0050.005.k𝑘k in the activation function of 𝜹𝜹\bm{\delta} is set to be 101010.In the flow reversal layer, we set the Gaussian standard deviation σ=1𝜎1\sigma=1.
58
+
59
+ For evaluation, we report PSNR, Structural Similarity Index (SSIM) [32], and the interpolation error (IE) [2] between the predictions and ground truth intermediate frames, where IE is defined as root-mean-squared (RMS) difference between the reference and interpolated image.
60
+
61
+ We evaluate our model with the state-of-the-art video interpolation approaches, including the phase-based method (Phase) [17], separable adaptive convolution (SepConv) [21], deep voxel flow (DVF) [14], and SuperSloMo [9].We use the original implementations for Phase, SepConv, DVF and the implementation from [22] for SuperSlomo.We retrain DVF and SuperSlomo with our data.We were not able to retrain SepConv as the training code is not publicly available, and directly use the original models [21] in our experiments instead.Note that the proposed quadratic video interpolation can be used for synthesizing arbitrary intermediate frames, which is evaluated on the high frame rate video datasets such as GOPRO [18] and Adobe240 [30].We also conduct experiments on the UCF101 [29] and DAVIS [23] datasets for performance evaluation of single-frame interpolation.
62
+
63
+ This dataset is composed of 33 high-quality videos with a frame rate of 720 fpstimes720fps720\text{\,}\mathrm{f}\mathrm{p}\mathrm{s} and image resolution of 720×\times1280.These videos are recorded with hand-held cameras, which often contain non-linear camera motion.In addition, this dataset has dynamic object motion from both indoor and outdoor scenes, which are challenging for existing interpolation algorithms.
64
+
65
+ We extract 4275 non-overlapped frame sequences with a length of 25 from the GOPRO videos.To evaluate the proposed quadratic model, we use the \nth1, \nth9, \nth17, and \nth25 frames of each sequence as our inputs, which respectively correspond to I−1,I0,I1,I2subscript𝐼1subscript𝐼0subscript𝐼1subscript𝐼2I_{-1},I_{0},I_{1},I_{2} in the proposed model.As discussed in Section 1, the baseline methods only exploit the \nth9 and \nth17 frames for video interpolation.We synthesize 7 frames between the \nth9 and \nth17 frames, and thus all the corresponding ground truth frames are available for evaluation.
66
+
67
+ As shown in Table 1, we separately evaluate the scores of the center frame (i.e., the \nth4 frame, denoted as center) and the average of all the 7 interpolated frames (denoted as whole).The quadratic interpolation model consistently performs favorably againstall the other linear methods.Noticeably, the PSNRs of our results on either the center frame or the average of the whole frames improve over the second best method by more than 1 dBtimes1dB1\text{\,}\mathrm{d}\mathrm{B}.
68
+
69
+ To understand the effectiveness of the proposed quadratic interpolation algorithm, we visualize the trajectories of the interpolated results in Figure 4 and compare with the baseline methods both qualitatively and quantitatively.Specifically, for each test sequence from the GOPRO dataset, we use the classic feature tracking algorithm [27] to select 10000 feature points in the \nth9 frame, and track them through the 7 synthesized in-between frames.For better performance evaluation, we exclude the points that disappear or move out of the image boundaries during tracking.
70
+
71
+ We show two typical examples in Figure 4 and visualize the interpolation trajectory by connecting the tracking points (i.e., the red lines).In the the first example, the object moves along a quite sharp curve, mostly due to a sudden violent change of the camera’s moving direction.All the existing methods fail on this example as the linear models assume uniform motion and cannot predict the motion change well.In contrast, our quadratic model enables higher-order video interpolation and exploits the acceleration information from the neighboring frames.As shown in Figure 4(e), the proposed method approximates the curvilinear motion well against the ground truth.
72
+
73
+ In addition, we overlap the predicted center frame with its ground truth to evaluate the interpolation accuracy of different methods (first row of each example of Figure 4).For linear models, the overlapped frames are severely blurred, which demonstrates the large shift between ground truth and the linearly interpolated results.In contrast, the generated frames by our approach align with the ground truth well, which indicates better interpolation results with smaller errors.
74
+
75
+ Different from the first example which contains severe non-linear movements, we present a video with motion trajectory closer to straight lines in the second example.As shown in Figure 4,although the motion in this video is closer to the uniform assumption of linear models, existing approaches still do not generate accurate interpolation results.This demonstrates the importance of the proposed quadratic algorithm, since there are few scenes strictly satisfying uniform motion, and minor perturbations to this strict motion assumption can lead to obvious shifts in the synthesized images.As shown in the second example of Figure 4(e), the proposed quadratic method estimates the moving trajectory well against the ground truth and thus generates more accurate interpolation results.
76
+
77
+ In addition, if we do not consider the acceleration in the proposed method (i.e., using (2) to replace (3)), the interpolation performance of our model decreases drastically to that of linear models (“Ours w/o qua.” in Table 1 and Figure 4), which shows the importance of the higher-order information.
78
+
79
+ To quantitatively measure the shifts between the synthesized frames and ground truth, we define a new error metric for video interpolation denoted as average shift of feature points (ASFP):A​S​F​P​(It,I^t)=1N​∑i=1N‖𝒑​(It,i)−𝒑​(It^,i)‖2,𝐴𝑆𝐹𝑃subscript𝐼𝑡subscript^𝐼𝑡1𝑁superscriptsubscript𝑖1𝑁subscriptnorm𝒑subscript𝐼𝑡𝑖𝒑^subscript𝐼𝑡𝑖2ASFP(I_{t},\hat{I}_{t})=\frac{1}{N}\sum_{i=1}^{N}\|\bm{p}(I_{t},i)-\bm{p}(\hat{I_{t}},i)\|_{2},(8)where 𝒑​(It,i)𝒑subscript𝐼𝑡𝑖\bm{p}(I_{t},i) denotes the position of the it​hsuperscript𝑖𝑡ℎi^{th} feature point on Itsubscript𝐼𝑡I_{t}, and N𝑁N is the number of feature points.We respectively compute the average ASFP of the center frame and the whole 7 interpolated frames on the GOPRO dataset.Table 3 shows theproposed quadratic algorithm performs favorably against the state-of-the-art methods while significantly reducing the average shift.
80
+
81
+ This dataset consists of 133 videos with a frame rate of 240 fpstimes240fps240\text{\,}\mathrm{f}\mathrm{p}\mathrm{s} and image resolution of 720×\times1280 pixels.The frames are resized to 360×\times480 during testing.We extract 8702 non-overlapped frame sequences from the videos in the Adobe240 dataset, and each sequence contain 25 consecutive frames similar with the settings of the GOPRO dataset.We also synthesize 7 in-between frames for 8 times temporally upsampling.As shown in Table 1, the proposed quadratic algorithm performs favorably against the state-of-the-art linear interpolation methods.
82
+
83
+ In addition to the multi-frame interpolation evaluated on high frame rate videos, we test the proposed quadratic model on single-frame interpolationusing videos with 30 fpstimes30fps30\text{\,}\mathrm{f}\mathrm{p}\mathrm{s}, i.e., UCF101 [29] and DAVIS [23] datasets.
84
+
85
+ Liu et al. [14] previously extract 100 triplets from the videos of the UCF101 datasetas test data, which cannot be used to evaluate our algorithmssince we need four consecutive frames as inputs.Thus, we re-generate the test data byfirst temporally downsampling the original videos to 15 fpstimes15fps15\text{\,}\mathrm{f}\mathrm{p}\mathrm{s} and then randomly extracting 4 adjacent frames (i.e., I−1,I0,I1,I2subscript𝐼1subscript𝐼0subscript𝐼1subscript𝐼2I_{-1},I_{0},I_{1},I_{2}) from these videos.The sequences with static scenes are removed for more accurate evaluations.We collect 100 quintuples (4 input frames I−1,I0,I1,I2subscript𝐼1subscript𝐼0subscript𝐼1subscript𝐼2I_{-1},I_{0},I_{1},I_{2} and 1 target frame I0.5subscript𝐼0.5I_{0.5}) where each frame is resized to 225×\times225 pixels as [14].For the DAVIS dataset, we evaluate our method on the whole 90 video clips which are divided into 2847 quintuples using the original image resolution.
86
+
87
+ We interpolate the center frame for these two dataset, which is equivalent to converting a 15 fpstimes15fps15\text{\,}\mathrm{f}\mathrm{p}\mathrm{s} video to a 30 fpstimes30fps30\text{\,}\mathrm{f}\mathrm{p}\mathrm{s} one.As shown in Table 3,the quadratic interpolation approach performs slightly better than the baseline models on the UCF101 dataset as the videos are of relatively low quality with low image resolution and slow motion.For the DAVIS dataset which contains complex motion from both camera shake and dynamic scenes, our method significantly outperforms other approaches in terms of all evaluation metrics.We show one example from the DAVIS dataset in Figure 5 for visual comparisons.
88
+
89
+ Overall, the quadratic approach achieves state-of-the-art performance on a wide variety of video datasets for both single-frame and multi-frame interpolations.More importantly, experimental results demonstrate that it is important and effective to exploit the acceleration information for accurate video frame interpolation.
90
+
91
+ We analyze the contribution of each component in our model on the DAVIS video dataset [23] in Table 4.In particular, we study the impact of quadratic interpolation by replacing the quadratic flow prediction (3) with the linear function (2) (w/o qua.).We further study the effectiveness of the adaptive flow filtering by directly learning residuals for flow refinement similar with [6, 31, 9] (w/o ada.).In addition, we compare the flow reversal layer with the linear combination strategy in [9] which approximates 𝒇t→0subscript𝒇→𝑡0\bm{f}_{t\to 0} by simply fusing 𝒇0→1subscript𝒇→01\bm{f}_{0\to 1} and 𝒇1→0subscript𝒇→10\bm{f}_{1\to 0} (w/o rev.).As shown in Table 4, removing each of the three components degrades performance in all metrics.Particularly, the quadratic flow prediction plays a crucial role, which verifiesour approach to exploit the acceleration information from additional neighboring frames.Note that while the quantitative improvement from the adaptive flow filtering is small,this component is effective in generating high-quality interpolationresults by reducing artifacts of the flow fields as shown in Figure 6.
92
+
93
+ In this paper we propose a quadratic video interpolation algorithm which cansynthesize high-quality intermediate frames.This method exploits the acceleration information from neighboring frames of a videofor non-linear video frame interpolation, and facilitates end-to-end training.The proposed method is able to model complex motion in real world more accurately andgenerate more favorable results than existing linear models on different video datasets.While we focus on quadratic function in this work, the proposed formulation is general and can be extended to even higher-order interpolation methods, e.g., the cubic model.We also expect this framework to be applied to other related tasks, such as multi-frame optical flow and novel view synthesis.
1911.00650v2.txt ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ State-of-the-art generative language models are now capable of producing multi-paragraph excerpts that at a surface level are virtually indistinguishable from human-written content (Zellers et al., 2019; Radford et al., 2019; Adelani et al., 2020).Often, only subtle logical fallacies or idiosyncrasies of language give away the text as machine-generated, errors that require a close reading and/or domain knowledge for humans to detect.
2
+
3
+ Deceptive text, whether human- or machine-generated, has entered the sphere of public concern (Cooke, 2018).It propogates quickly (Vosoughi et al., 2018), sets political agendas (Vargo et al., 2018), influences elections (Allcott and Gentzkow, 2017), and undermines user trust Wang et al. (2012); Song et al. (2015).Recently, Adelani et al. (2020) have shown that automatically generated reviews are perceived to be as fluent as human-written ones.As generative technology matures, authors, well-meaning or otherwise, will increasingly employ it to augment and accelerate their own writing.It is more imperative now than ever for both humans and automated systems to be able to detect and identify machine-generated texts in the wild.However, there has thus been little inquiry into the textual properties that cause humans to give generated text high human-like ratings compared to those that cause automatic systems to rate it highly.
4
+
5
+ To speak of texts produced by language models, we must first consider how these texts are generated.A neural language model encodes a probability distribution over the next word in a sequence given the previous words.111Often these ‘words” are actually subword character sequences such as BPE tokens (Sennrich et al., 2016).A decoding strategy is an algorithm that generates sequences from a language model by determining how words should get selected from this distribution.The field has largely moved toward probabilistic decoding strategies that randomly sample from the output distribution token-by-token.However, when many low-likelihood words cumulatively contain quite a bit of probability mass, choosing one of these words can lead to odd or contradictory phrases and semantic errors.Humans are quick to notice these types of errors.
6
+
7
+ For this reason, it has become common to modify the language model’s output probability distribution to increase the chance of sampling tokens with high likelihood according to the language model.Top-k𝑘k random sampling, where low-likelihood words are restricted from being generated, is one such method.A language model that is only permitted to produce high-likelihood words is less likely to make a poor choice and create the type of mistakes that are easy for humans to detect.Since humans are not proficient at identifying when a model subtly favors some utterances more often than a human author would, they don’t notice the over-representation of high-likelihood words in the generated text.In contrast, automatic systems excel at identifying statistical anomalies and struggle to build deeper semantic understanding.Top-k𝑘k in particular creates text that is easy for machines to detect but very hard for humans.Thus, we observe the general trend: as the number of unlikely words available to be chosen is increased, humans get better at detecting fakes while automatic systems get worse.
8
+
9
+ In this work, we study three popular random decoding strategies—top-k𝑘k, nucleus, and temperature sampling—applied to GPT-2 Radford et al. (2019).We draw a large number of excerpts generated by each strategy and train a family of BERT-based Devlin et al. (2019) binary classifiers to label text excerpts as human-written or machine-generated.We find large differences in human rater and classifier accuracy depending on the decoding strategy employed and length of the generated sequences.Regardless of strategy, we find human raters achieve significantly lower accuracy than the automatic discriminators.We also show that when a decoding strategy severely modifies the unigram token distribution, as top-k𝑘k does, humans have trouble detecting the resultant generated text, but automatic classifiers find it the easiest to discriminate.Worryingly, we further find that classifiers are brittle; they generalize poorly when trained to discriminate samples from one strategy and then evaluated on samples from another.
10
+
11
+ In summary, our contributions are:•A comprehensive study of generated text detection systems’ sensitivity to model structure, decoding strategy, and excerpt length.•An analysis of human raters’ ability to identify machine-generated content, and how human raters differ from automatic detectors.
12
+
13
+ Generative Language Models  With a sufficiently large training set and number of trainable parameters, neural language models based on the Transformer architecture (Vaswani et al., 2017) are capable of generating convincing, human-like excerpts up to several paragraphs in length.GPT-2 (Radford et al., 2019), Grover (Zellers et al., 2019), and Transformer-DMCA (Liu et al., 2018) are a few examples of large, publicly available models with this ability.Grover, in particular, has been shown to generate fake news that is more trustworthy than human-written fake news according to human raters.
14
+
15
+ Human Detection  The task of trying to guess whether text is coming from a robot or a fellow human was made famous by the Turing Test (Turing, 1950).It continues to be used is chatbot evaluation (Lowe et al., 2017).The related (but not identical) task of asking human raters to judge the quality of machine-generated excerpts remains the gold-standard for evaluating open-domain generation systems (van der Lee et al., 2019).Kreps et al. (2020), Gehrmann et al. (2019), and others have stressed the importance of humans being able to identify fake content on the web.
16
+
17
+ Automatic Detection  The rise of machine-generated content has led to the development of automated systems to identify it.Grover was designed to not only generate convincing news excerpts but to also identify them using a fine-tuned version of the generative model itself (Zellers et al., 2019).GLTR, expecting attackers to use sampling methods that favor high-likelihood tokens, aims to make machine-generated text detectable by computing histograms over per-token log likelihoods (Gehrmann et al., 2019).Bakhtin et al. (2019) frame human-text detection as a ranking task and evaluate their models’ cross-domain and cross-model generalization, finding significant loss in quality when training on one domain and evaluating on another.Schuster et al. (2019) argue that the language distributional features implicitly or explicitly employed by these detectors are insufficient; instead, one should look to explicit fact-verification models.Finally, discriminators for whether text is machine-generated are a promising research direction in adversarial training (Lin et al., 2017; Li et al., 2017) and in automatic evaluation of generative model quality (Novikova et al., 2017; Kannan and Vinyals, 2017; Lowe et al., 2017).
18
+
19
+ Natural Language Understanding  Automatic detection of machine-generated text benefits from a semantic understanding of the text.Contradictions, falsehoods, and topic drift can all indicate that an excerpt was machine-generated.Encoder-only Transformer models such as BERT (Devlin et al., 2019) have been shown to do very well at tasks requiring this understanding.While we fine-tune BERT for the task of classifying whether text was machine-generated, others have used the contextual word embeddings from a pre-trained BERT model without fine-tuning to compute a quality score for generated text (Zhang et al., 2020).It is worth noting that recent work has raised questions as to whether BERT truly builds a semantic understanding to make its predictions, or whether it merely takes advantage of spurious statistical differences between the text of different classes (Niven and Kao, 2019).
20
+
21
+ We frame the detection problem as a binary classification task: given an excerpt of text, label it as either human-written or machine-generated.In particular, we are interested in how variables such as excerpt length and decoding strategy impact performance on this classification task.We thus create several datasets.Each is approximately balanced between positive examples of machine-generated text and negative examples of human-written text.While they all share the same human-written examples, each dataset contains a different set of machine-generated examples sampled using one particular decoding strategy.We also build additional datasets by truncating all of the examples to a particular sequence length,
22
+
23
+ By training a separate classifier on each dataset, we are able to answer questions about which decoding strategy results in text that is the easiest to automatically disambiguate from human-written text.We are also able to answer questions about how the length of the examples in the training set impacts our ability to automatically classify excerpts of that same length as either human-written or machine-generated.
24
+
25
+ All of our generated text samples are drawn from GPT-2, a state-of-the-art Transformer-based generative language model that was trained on text from popular web pages (Radford et al., 2019).While we use the GPT-2 Large model with 774M parameters, we found that similar trends to those reported here hold in experiments with smaller language models.
26
+
27
+ Given an autoregressive language model that defines a probability distribution over the next token given the previous tokens in a sequence, a decoding strategy generates text by deciding how to output a token at each step based on the predicted distributions.Perhaps the most straightforward decoding strategy is to randomly choose a token with probability proportional to its likelihood.A challenge with the random sampling approach is that these probability distributions often contain a long tail of vocabulary items that are individually low-probability but cumulatively comprise a substantial amount of probability mass.Holtzman et al. (2020) observe that choosing tokens from this tail often leads to incoherent generations.
28
+
29
+ Top-k𝑘k sampling, nucleus sampling, and (in the extreme) beam search have all been proposed to heuristically promote samples with higher per-token likelihoods.Top-k𝑘k and nucleus sampling both do so by setting the likelihood of tokens in the tail of the distribution to zero.Top-k𝑘k restricts the distribution to all but the k𝑘k most likely tokens, where k𝑘k is a constant (Fan et al., 2018).Nucleus sampling, also called top-p𝑝p, truncates the distribution at each decoding step t𝑡t to the ktsubscript𝑘𝑡k_{t}-most-likely next tokens such that the cumulative likelihood of these tokens is no greater than a constant p𝑝p (Holtzman et al., 2020).
30
+
31
+ We thus consider three different decoding strategy settings:
32
+
33
+ •Sample from the untruncated distribution•Top-k𝑘k, choosing k𝑘k=40 (Radford et al., 2019).•Nucleus sampling (aka top-p𝑝p), choosing p𝑝p=0.96 (Zellers et al., 2019).
34
+
35
+ In addition, we form “negative” examples of human-written text by taking excerpts of web text that come from the same distribution as GPT-2’s training data.222https://github.com/openai/gpt-2-output-datasetBy picking text that resembles GPT-2’s train set, we ensure that our classifiers can’t simply take advantage of stylistic differences between the human-written text corpus and the kind of text GPT-2 was trained to generate.
36
+
37
+ For each decoding method, we construct a training dataset by pairing 250,000 generated samples with 250,000 excerpts of web text.5,000 additional paired samples are kept aside for validation and test datasets.Lastly, we filter out excerpts with fewer than 192 WordPiece tokens (Wu et al., 2016) (excerpts might be quite short if the model produces an end-of-text token early on). See Appendix 1 for final dataset sizes.
38
+
39
+ A crucial question when generating text with a language model is whether or not to provide a priming sequence which the language model should continue.Unconditioned samples, where no priming text is provided, in conjunction with top-k𝑘k sampling, lead to pathological behavior for discriminators as the first token of the generated text will always be one of k𝑘k possible options.On the other hand, if long sequences of human text are used as priming, the space of possible generated sequences is larger, but the detection problem shifts from one of “how human-like is the generated text?” to “how well does the generated text follow the priming sequence?”.
40
+
41
+ Since in this study we are interested in the former simpler question, we create two datasets, one with no priming, and one with the minimum amount of priming possible: a single token of web text.This means that for every excerpt of web text in the training set, there is an excerpt of machine-generated text that starts with the same token.We find that even with limited priming, the ability of automatic detectors can be strongly impacted.
42
+
43
+ To study the effect of excerpt length, we construct variations of the above datasets by truncating all excerpts to ten possible lengths ranging from 2 to 192 WordPiece tokens Wu et al. (2016). In total, we obtain sixty dataset variations: one per sampling method, truncation length, and choice of priming or no priming.
44
+
45
+ The primary discriminator we employ is a fine-tuned BERT classifier (Devlin et al., 2019).We fine-tune one instance of BERT per dataset variation described above.For the longest sequence length, n𝑛n=192, we compare BERT’s performance with several simple baselines that have been proposed in other work.
46
+
47
+ Fine-tuned BERT  We fine-tune BERT-Large (cased) on the task of labeling a sentence as human- or machine- generated.The models are trained for 15 epochs, with checkpoints saved every 1000 steps, and a batch size of 256.All results are reported on the test set using the checkpoint for which validation accuracy was highest.
48
+
49
+ Bag-of-Words  For each sequence, we compute a bag-of-words embedding where each dimension corresponds to a token in GPT-2’s 50,000 token BPE vocabulary (Sennrich et al., 2016), and we count how many times that token appears in the text sequence.We then train a logistic regression binary classifier to predict human- or machine-written given this 50,000-dimensional embedding.We experimented with truncating embedding size by removing entries for infrequent vocabulary words, but this did not improve performance.
50
+
51
+ Histogram-of-Likelihood Ranks  Following GLTR (Gehrmann et al., 2019), we compute the probability distribution of the next word given the previous words in a text sequence according to a trained language model (in our case the same GPT-2 model that was used for generation).At each sequence position, we rerank the vocabulary words by likelihood, and record the rank of the ground-truth next word within this list.These ranks are then binned.GLTR uses four bins, counting (1) the number of times the top 1 word is seen, (2) the number of times words ranked 2 through 5 are seen, (3) words ranked 6-100, and (4) words ranked >100.However, we observe higher accuracy when 50 bins are spread uniformly over the possible rankings.This means that since there are 50,000 vocabulary words, the first bin counts the number of times the actual next word was within the 1,000 mostly likely next words, the second bin counts the 1,001-2,000th, and so on.We then train logistic regression binary classifiers to predict human- or machine-written given either the 4-dimensional histograms or 50-dimensional histograms as input.
52
+
53
+ Total Probability  Solaiman et al. (2019) propose a very simple baseline consisting of a threshold on the total probability of the text sequence.An excerpt is predicted as machine-generated if its likelihood according to GPT-2 is closer to the mean likelihood over all machine-generated sequences than to the mean of human-written ones.
54
+
55
+ The human evaluation task is framed similarly to the automatic one.We ask the raters to decide whether a passage of text was written by a human or by a computer algorithm. (Full instructions are in the Appendix.)Raters are allowed to choose between four options: “definitely” or “possibly” machine-generated and “definitely” or “possibly” human-written.They are first shown an excerpt of length 16 WordPiece tokens.After they make a guess, the length of the excerpt is doubled, and they are asked the same question again.This continues until the entire passage of length 192 tokens is shown.Passages are equally likely to be human-written or machine-generated, with the machine-generated excerpts being evenly split between the three sampling strategies considered in this paper.
56
+
57
+ Initially, Amazon Mechanical Turk (AMT) raters were employed for this task, but rater accuracy was poor with over 70% of the “definitely” votes cast for “human” despite the classes being balanced.Accuracy, even for the longest sequences, hovered around 50%.The same study was then performed with university students who were first walked through ten examples (see Appendix Table 4) as a group.Afterward, they were asked to complete the same tasks that had been sent to the AMT workers.No additional guidance or direction was given to them after the initial walk-through.We will refer to this group as the “expert raters.”Among them, 52.1% of “definitely” votes were cast for human, and accuracy on the longest excerpt length was over 70%.
58
+
59
+ The human evaluation dataset consisted of 150 excerpts of web text and 50 excerpts each from the three decoding strategies.Each question was shown to at most three raters, leading to 900 total annotations from the untrained workers and 475 from the expert raters.A more detailed breakdown can be found in the Appendix.
60
+
61
+ Simple Baselines  Table 1 shows the performance of the baseline discriminators on length-192 sequences, as compared with fine-tuned BERT.Reassuringly, BERT far surpasses all simple baselines, indicating that it is not fully possible to solve the detection problem without complex sequence-based understanding.The simplest baseline, TotalProb, which makes a decision based on the likelihood of the sequence, performs surprisingly well (over 60% accuracy for all sampling methods) relative to the methods which involve training logistic regression models.
62
+
63
+ Logistic regression on bag-of-words is the best of the baselines, beating out the histogram-based methods.While Gehrmann et al. (2019) report an AUC of 0.87 on classifying text as real or generated using logistic regression on the four buckets of the GLTR system, we report AUC between 0.52 and 0.56 for this task.The discrepancy is likely due to the fact that the human-written text in our discriminator training set comes from the same distribution as the text used to train the language model, while in GLTR the human text comes from children’s books, scientific abstracts, and newspaper articles.The selection of training data for learned detection systems is crucial. In real-world applications, the choice ought to reflect the genres that builders of text-generation systems are trying to impersonate.
64
+
65
+ Fine-tuned BERT   In Figure 1(a), we begin by observing discriminator accuracy as a function of excerpt length and sampling method.As can be intuitively expected, as sequence length increases, so too does accuracy.For unconditioned text decoded with nucleus (p0.96) and untruncated (p1.0) random sampling, we find discriminator accuracy increases from 55%, near random, to about 81% for the longest sequences tested.In contrast, discriminators trained and evaluated on top-k𝑘k achieve over 80% accuracy even on 16-token excerpts.
66
+
67
+ Why are top-k𝑘k’s samples so easy to detect?In Figure 2(b), we see the percentage of probability mass concentrated in the k𝑘k most common token types for each sampling method.While random sampling and nucleus sampling are very similar to human-written texts, we see top-k concentrating up to 80% of its mass in the first 500 most common tokens.The other sampling methods as well as human-written texts require at least 1,100 token types for the same.It is clear that top-k𝑘k’s distribution over unigrams strongly diverges from human-written texts–an easy feature for discriminators to exploit.In fact, See et al. (2019) note that it takes setting k𝑘k to 1000 to achieve about the same amount of rare word usage and fraction of non-stopword text as as human writing.333when decoding from the GPT-2 small model with 117M parameters.This makes it very easy for the model to pick out machine-generated text based on these distributional differences.
68
+
69
+ One way to help resolve this problem is to add priming text.Doing so causes more rare words to be incorporated into the top-k𝑘k of the unigram distribution.Adding even a single human word of priming significantly reduces the performance of detectors trained with top-k𝑘k random sampling.Without priming, a discriminator trained on sequences of length 2 can classify with ∼similar-to\mathtt{\sim}90% accuracy the provenance of the text (Figure 1(a)).By adding one priming token, accuracy drops to ∼similar-to\mathtt{\sim}65%.Even on the longest 192-length sequences, top-k𝑘k discriminator accuracy is 6% lower on the primed dataset than the unprimed one.
70
+
71
+ When generating with nucleus or untruncated random sampling, adding a priming token is not as impactful, as these methods are already sampling from a large fraction (or all) of the probability distribution.This is seen in Figure 2(a) where at the very first step of unprimed generation, nucleus sampling selects from 3075 possible vocabulary words, and at later positions selects from on average more than 500.Untruncated random sampling always selects from the entire 50,000 word vocabulary, whereas top-k𝑘k only selects from k𝑘k.
72
+
73
+ Transferability  In Table 2, we show how discriminators trained with samples from one decoding strategy can transfer at test time to detecting samples generated using a different decoding strategy.Unsurprisingly a discriminator trained on top-k𝑘k generalizes poorly to other sampling methods: accuracy drops to as low as 42.5%, worse than chance.Conversely, training the discriminator with sequences sampled from the untruncated distribution leads to little transferability to detecting top-k𝑘k samples.Only the discriminator trained with nucleus sampling (a compromise between unmodified sampling and top-k𝑘k) was able to detect sequences from the other sampling strategies without too much of a hit to accuracy.As expected, a discriminator trained on an equal portion of data from each decoding method does reasonably at detecting all three.
74
+
75
+ Perhaps this lack of transferability is related to each discriminator’s calibration.Indeed, the degree to which a discriminator’s average prediction deviates from 50% is a direct indicator of its accuracy.In Table 3, we observe that of the three BERT discriminators, only that trained on top-p𝑝p samples predicts ‘machine-generated’ on approximately 50% of in-domain examples as expected.This same discriminator’s behavior holds on datasets generated by other sampling strategies as well.In contrast, we observe that discriminators trained on top-k and untruncated random samples severely underestimate the percentage of machine-generated excerpts in out-of-domain datasets.Even within domain (Figure 1(b)), we find both discriminators heavily favor a single class, increasingly so as the number of tokens increases.
76
+
77
+ Human Evaluation  Overall human performance across all sampling methods is shown in Figure 3b.Even with the multi-paragraph 192-length excerpts, human performance is only at 71.4%, indicating that even trained humans struggle to correctly identify machine-generated text over a quarter a time.However, it is worth noting that our best raters achieved accuracy of 85% or higher, suggesting that it is possible for humans to do very well at this task.Further investigation is needed into how educational background, comfort with English, participation in more extensive training, and other factors can impact rater performance.
78
+
79
+ To break up the accuracies by sampling method in a way that is comparable to the results shown for the automatic discriminators, we pair each machine-generated example with a randomly selected one of webtext to create a balanced dataset for each sampling strategy.Performance is shown in Figure 3a.Top-k𝑘k produces the text that is hardest for raters to correctly distinguish, but as shown in Section 7, it is the easiest for our automatic detection systems.Samples from untruncated random sampling and nucleus sampling with p𝑝p=0.96 are equivalently difficult for raters to classify as machine-generated.Our human evaluation results suggest that much lower p𝑝p-values than the 0.92 to 0.98 range proposed in Zellers et al. (2019) might be necessary in order to generate text that is considered significantly more human-like to human raters than the text produced by using the untruncated distribution.
80
+
81
+ Table 4 gives several examples where human raters and our BERT-based discriminators disagreed.When raters incorrectly labeled human-written text as machine-generated, often the excerpts contained formatting failures introduced when the HTML was stripped out.In the middle two examples, topic drift and falsehoods such as Atlanta being the “information hub of the nation’s capital” allowed humans to correctly detect the generated content.However, in the bottom two examples, the high level of fluency left human raters fooled.
82
+
83
+ Overall we find that human raters—even “expert” trained ones—have consistently worse accuracy than automatic discriminators for all decoding methods and excerpt lengths.In our experiments, randomly-selected pairs of raters agree with each other on a mere 59% of excerpts on average. (In comparison, raters and discriminators agree on 61% to 70% of excerpts depending on the discriminator considered).We surmise that the gap between human and machine performance will only grow as researchers inevitably train bigger, better detection models on larger amounts of training data.While improved detection models are inevitible, it is unclear how to go about improving human performance.GLTR proposes providing visual aids to humans to improve their performance at detecting generated-text, but it is unlikely that their histogram-based color-coding will continue to be effective as generative methods get better at producing high-quality text that lacks statistical anomalies.
84
+
85
+ In this work, we study the behavior of automated discriminators and their ability to identify machine-generated and human-written texts.We train these discriminators on balanced binary classification datasets where all machine-generated excerpts are drawn from the same generative model but with different decoding strategies.We find that, in general, discriminators transfer poorly between decoding strategies, but that training on a mix of data from methods can help.We also show the rate at which discriminator accuracy increases as excerpts are lengthened.
86
+
87
+ We further study the ability of expert human raters to perform the same task.We find that rater accuracy varies wildly, but has a median of 74%, which is less than the accuracy of our best-performing discriminator.Most interestingly, we find that human raters and discriminators make decisions based on different qualities, with humans more easily noticing semantic errors and discriminators picking up on statistical artifacts.In our experiments, these artifacts are most prominent with top-k𝑘k sampling.However, any strategy that over-samples high-likelihood words is susceptible.As the p𝑝p in nucleus sampling is set increasingly lower to achieve more fluent text (some systems are already using p𝑝p as low as 0.5 (Miculicich et al., 2019)), the distributional deviations that plague top-k𝑘k text will surface in nucleus sampling as well.
88
+
89
+ Holtzman et al. (2020) explain how a unique attribute of human language is that it dips in and out of low probability zones.This variance in likelihood is what makes human-written text interesting and exciting to read.Today’s generation systems have not yet solved the problem of mimicking the human cadence without introducing poor word choices that are easy for humans to detect.Generation systems often optimize for fooling humans without acknowledging the trade-off that exists between human perception of quality and ease of automatic detection.We therefore suggest three prongs for future research:
90
+
91
+ 1.Identifying ways to improve the language models and decoding strategies we use in order to generate text that is both exciting (ie. unlikely) and semantically plausible.2.Building better world understanding into automatic discriminators so that they are more capable of detecting the types of errors that humans notice.3.Developing tools and educational materials to improve humans’ ability to detect machine-generated text. These may include automatic detectors with components that explain their predictions.
92
+
93
+ Finally, we would like to note that all of our experiments were performed with English language models, and it remains an open question how the trade-off between ease of human detection and ease of automatic detection might differ for languages that are very different from English.
1911.00682v2.txt ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Steganography tries to hide messages in plainsight while steganalysis tries to detect their existence secret data from suspicious carriers. VoIP is a real-time service which enables users to make phone calls through IP data networks. It is utilized in many popular apps such as Wechat, Skype andSnapchat, which are widely used for instant messaging in daily life. Compared with traditional steganographic audiocarriers, VoIP possesses many particular advantages, including instantaneity, a large mass of carrier data, high covertbandwidth and flexible conversation length, making it a very popular scheme for covert communication[1, 2, 3]. However, like manyother security techniques, VoIP-based steganography might also be employed by lawbreakers, terrorists and hackers forillegitimate purposes, which causes serious threats to cybersecurity. Thus, it is crucial to develop a powerful and practiacal steganalysis tool for VoIP stream.
2
+
3
+ Recent years have witnessed a variety of neuralnetwork models that boost the performance of audio steganalysis. For example, Paulin e​t​a​l.𝑒𝑡𝑎𝑙et\ al. [4] firstly employed deep belief networks to solve speech steganalysis problems. They calculated Mel Frequency Cepstrum Coefficient (MFCC) and deep belief networks (DBN) served as a classifier. Chen e​t​a​l.𝑒𝑡𝑎𝑙et\ al. [5] used Convolutional Neural Network to detect LSB steganography in time domain. Lin e​t​a​l.𝑒𝑡𝑎𝑙et\ al. [6] proposed Codeword Correlation Model (CCM), which used recurrent neural network (RNN) to extract correlation features in speech steganalysis. The authors in [7] proposed a model to combine the strength of bi-direactional Long Short-Term Memory (LSTM) and Convolutional Neural Network to conduct audio steganalysis and achieved currently state-of-the-art result.
4
+
5
+ Obviously, recent works often switch between two types of deep neural network (DNN): RNNsand CNNs. RNNs perform better in sequential architecture and can capture long-range dependencies but have low computational efficiency. CNN whose hierarchical structure is good at extracting local or position-invariant features but is hard to capture long-range dependencies. Compared with RNNs and CNNs, the attention mechanism [8] is more flexible in modeling sequence than RNN/CNN, and is more task/data-driven when modeling dependencies. Unlike sequential models, its computation can be easily and significantly accelerated by existing distributed/parallel computing schemes which are very suitable for real time steganalysis in scenarios like VoIP. However, to the best of our knowledge, steganalysis method solely based on attention to extract correlation features has not been studied for VoIP steganalysis or even for audio steganalysis. Thus, it’s very promising to design a model that thoroughly based on attention mechanism to steganalysis.
6
+
7
+ In this paper, we proposed a light-weight and RNN/CNN-free neuralnetwork named Fast Correlation Extract Model (FCEM) to conduct steganalysis of QIM steganography [9] in VoIP streams. In the proposed model, compressed speech frames are firstly converted to dense vector based on an embedding matrix. Then, a variant of attention called ”multi-head attention” is used to capture the correlations or frame context dependency which produce context-aware representations for compressed speech frames. Finally, the new representations are passed to classification module to compute the final prediction for a steganalysis task. The simple architecture ofFCEM leads to fewer parameters, less computation and easier parallelization, making it a very excellent model to be widely applied in online services.
8
+
9
+ The contribution of this work is: 1) we firstly proposed a method solely based on attention mechanism to extract correlation features in steganalysis of VoIP stream or even audio steganalysis task.2) experiments show that the proposed steganalysis method achieves excellent performance in detecting low embedding rates and short samples. What’s more, proposed model are significantly reduced inference time when sample length is as short as 0.1s, making it can be easily utilized in online services.
10
+
11
+ The rest of the paper is structured as follows. In part 2,we introduce the proposed method in detail. Part 3 shows experiments results. Finally, we make the conclusion and offer some aspirations for future research in part 4.
12
+
13
+ The architecture of the proposed Fast Correlation Extract Model model is illustrated inFigure 1. Each layer in our model from bottomto top is explain in detail in the following parts.
14
+
15
+ In general, low bit-rate speech codecs such as ITU-G.723.1 are widely used in VoIP communications for compressing the speech or audio signal components of streaming media.Most of the speech codecs are based on the linear predictive coding (LPC) [10] model, which uses an LPC filter to analyze and synthesize acoustic signals between theencoding and decoding endpoints. In LPC encoding, the LPC coefficients are first converted into Line Spectrum Frequency (LSF) coefficients. Andthe LSFs are encoded by Vector Quantization (VQ). Quantization Index Sequence (QIS) is generated in the process of VQ, which can be denoted as follows:Q​I​S=[s1,1s2,1s1,2s2,2s1,3s2,3​…..sT,1sT,2sT,3],QIS=\left[{\begin{array}[]{*{20}{c}}{{s_{1,1}}}&{{s_{2,1}}}\\{{s_{1,2}}}&{{s_{2,2}}}\\{{s_{1,3}}}&{{s_{2,3}}}\end{array}\begin{array}[]{*{20}{c}}{.....\begin{array}[]{*{20}{c}}{}\hfil\end{array}\begin{array}[]{*{20}{c}}{{s_{T,1}}}\\{{s_{T,2}}}\\{{s_{T,3}}}\end{array}}\end{array}}\right],(1)where T𝑇T is the total frame number in the sample window of the speech. In VoIP scenario, we can utilize sliding detection window [11] to collect one or several continuous packets each time to construct these quantization index sequences for steganalysis .
16
+
17
+ QIM steganography divides quantization codebook of VQ intoseveral parts according to the embedded data. The VQ codewords in different position use independent quantization codebooks, which will bring distortion to the characteristics of QIS. Thus, QIS can be taken as clues for steganalysis and we take it as model inputs.
18
+
19
+ Embedding Layer is a common approach to represent some objects using a low-dimension dense vector representation, which is a very popular technique in various task such as natural language processing [12] and speech process [13]. Specifically, in our task, the weights of the Embedding layer are of the shape (c​o​d​e​w​o​r​d​_​s​i​z​e,e​m​b​e​d​d​i​n​g​_​s​i​z​e)𝑐𝑜𝑑𝑒𝑤𝑜𝑟𝑑_𝑠𝑖𝑧𝑒𝑒𝑚𝑏𝑒𝑑𝑑𝑖𝑛𝑔_𝑠𝑖𝑧𝑒(codeword\_size,embedding\_size). For each training sample, its input codewords are quantization integers in QIS. The integers are in the range of the c​o​d​e​w​o​r​d​_​s​i​z​e𝑐𝑜𝑑𝑒𝑤𝑜𝑟𝑑_𝑠𝑖𝑧𝑒codeword\_size. The Embedding layer transforms each quantization integer i𝑖i into the i𝑖i-th line of the embedding weights matrix, i.e.,ei=V​si,subscript𝑒𝑖𝑉subscript𝑠𝑖{e_{i}}={V}{s_{i}},(2)where V𝑉V is an random initialized embedding matrix for code-words, sisubscript𝑠𝑖s_{i} is corresponding one-hot vector created by quantization integer code-words in QIS and eisubscript𝑒𝑖e_{i} is an dense vector whose dimension is e​m​b​e​d​d​i​n​g​_​s​i​z​e𝑒𝑚𝑏𝑒𝑑𝑑𝑖𝑛𝑔_𝑠𝑖𝑧𝑒embedding\_size.After the embedding layer, representation of the j𝑗j-th QIS frame can be denoted as:xj=[ej,1⊕ej,2⊕ej,3],subscript𝑥𝑗delimited-[]direct-sumsubscript𝑒𝑗1subscript𝑒𝑗2subscript𝑒𝑗3{x_{j}}=[{e_{j,1}}\oplus{e_{j,2}}\oplus{e_{j,3}}],(3)where ⊕direct-sum\oplus is the concatenation operator.
20
+
21
+ The attention mechanism cannot distinguish betweendifferent positions. So it is crucial to encode positions ofeach code words. There are various ways to encode positions,and the simplest one is to use an additional positionencoding module. In this paper, we try the approachproposed in [8], which is formulated asfollows:P​E​(t,2​i)=sin⁡(t/100002​i/d)𝑃𝐸𝑡2𝑖𝑡superscript100002𝑖𝑑\begin{array}[]{l}PE(t,2i)=\sin(t/{10000^{2i/d}})\end{array}(4)P​E​(t,2​i+1)=cos⁡(t/100002​i/d),𝑃𝐸𝑡2𝑖1𝑡superscript100002𝑖𝑑\begin{array}[]{l}PE(t,2i+1)=\cos(t/{10000^{2i/d}})\end{array},(5)where t𝑡t is the frame number, i𝑖i is the position in the embedded vector of xtsubscript𝑥𝑡x_{t} and d𝑑d is the dimension of xtsubscript𝑥𝑡x_{t}. d𝑑d euqals to 3∗e​m​b​e​d​d​i​n​g​_​s​i​z​e3𝑒𝑚𝑏𝑒𝑑𝑑𝑖𝑛𝑔_𝑠𝑖𝑧𝑒3*embedding\_size.The position encodings are simply added to the input embeddings to encode position information.
22
+
23
+ Correlations between different frames are crucial in speech steganalysis [6]. Here, we adopt Multi-head self attention [8] which has recently achievedremarkable performance in modeling complicated relations between different code-words. Taking the m𝑚m-th frame feature xmsubscript𝑥𝑚x_{m} as an example, we will explain how to identify multiple meaningful correlation features involving feature xmsubscript𝑥𝑚x_{m} based on such a mechanism. At first, We defined the correlation between feature xmsubscript𝑥𝑚x_{m} and feature xksubscript𝑥𝑘x_{k} under a specific attention head hℎh as follows:
24
+
25
+ αm,k(h)=exp⁡(φ(h)​(xm,xk))∑l=1Mexp⁡(φ(h)​(xm,xl))superscriptsubscript𝛼𝑚𝑘ℎsuperscript𝜑ℎsubscript𝑥𝑚subscript𝑥𝑘superscriptsubscript𝑙1𝑀superscript𝜑ℎsubscript𝑥𝑚subscript𝑥𝑙\begin{array}[]{l}\alpha_{m,k}^{(h)}=\frac{{\exp({\varphi^{(h)}}({x_{m}},{x_{k}}))}}{{\sum\nolimits_{l=1}^{M}{\exp({\varphi^{(h)}}({x_{m}},{x_{l}}))}}}\end{array}(6)φ(h)​(xm,xk)=⟨Wq​u​e​r​yh​xm,Wk​e​y(h)​xk⟩,superscript𝜑ℎsubscript𝑥𝑚subscript𝑥𝑘superscriptsubscript𝑊𝑞𝑢𝑒𝑟𝑦ℎsubscript𝑥𝑚superscriptsubscript𝑊𝑘𝑒𝑦ℎsubscript𝑥𝑘\begin{array}[]{l}{\varphi^{(h)}}({x_{m}},{x_{k}}){\rm{=}}\left\langle{W_{query}^{h}{x_{m}},W_{key}^{(h)}{x_{k}}}\right\rangle\end{array},(7)where φ(h)​(⋅,⋅)superscript𝜑ℎ⋅⋅{\varphi^{(h)}}\left({\cdot,\cdot}\right) is an attention function which defines the correlation between feature xmsubscript𝑥𝑚x_{m} and feature xksubscript𝑥𝑘x_{k}. In most cases, it can be defined as inner product. Wq​u​e​r​yh,Wk​e​y(h)∈Rd×d′superscriptsubscript𝑊𝑞𝑢𝑒𝑟𝑦ℎsuperscriptsubscript𝑊𝑘𝑒𝑦ℎsuperscript𝑅𝑑superscript𝑑′W_{query}^{h},W_{key}^{(h)}\in{R^{d\times d^{\prime}}} are transformation matrices which map the original embedding space Rdsuperscript𝑅𝑑{R^{d}} into a new semantic space Rd′superscript𝑅superscript𝑑′{R^{d^{\prime}}}. Next we recalibrate representation of feature xmsubscript𝑥𝑚x_{m} in subspace hℎh by combining allrelevant features guided by coefficients αm,k(h)superscriptsubscript𝛼𝑚𝑘ℎ\alpha_{m,k}^{(h)}:x^m(h)=∑k=1Mαm,k(h)​(Wv​a​l​u​e(h)​xk),superscriptsubscript^𝑥𝑚ℎsuperscriptsubscript𝑘1𝑀superscriptsubscript𝛼𝑚𝑘ℎsuperscriptsubscript𝑊𝑣𝑎𝑙𝑢𝑒ℎsubscript𝑥𝑘\hat{x}_{m}^{(h)}=\sum\nolimits_{k=1}^{M}{\alpha_{m,k}^{(h)}(W_{value}^{(h)}{x_{k}})},(8)where Wv​a​l​u​e(h)∈Rd×d′superscriptsubscript𝑊𝑣𝑎𝑙𝑢𝑒ℎsuperscript𝑅𝑑superscript𝑑′W_{value}^{(h)}\in{R^{d\times d^{\prime}}} and M𝑀M is the sequence length.Since x^m(h)∈Rd′superscriptsubscript^𝑥𝑚ℎsuperscript𝑅superscript𝑑′\hat{x}_{m}^{(h)}\in{R^{d^{\prime}}} is a combination of feature xmsubscript𝑥𝑚x_{m} and its relevantfeatures under head hℎh, it represents a new combinatorial featurelearned by our method. Furthermore, a feature is also likely to beinvolved in different combinatorial features, and we achieve this byusing multiple heads, which create different subspaces and learndistinct feature interactions separately. We collect combinatorialfeatures learned in all subspaces as follows:x^m=x^m(1)⊕x^m(2)⊕…⊕x^m(H),subscript^𝑥𝑚direct-sumsuperscriptsubscript^𝑥𝑚1superscriptsubscript^𝑥𝑚2…superscriptsubscript^𝑥𝑚𝐻\hat{x}_{m}=\hat{x}_{m}^{(1)}\oplus\hat{x}_{m}^{(2)}\oplus...\oplus\hat{x}_{m}^{(H)},(9)where ⊕direct-sum\oplus is the concatenation operator, and H𝐻H is the number of totalheads.
26
+
27
+ With such an interacting layer, the representation of each featurexmsubscript𝑥𝑚x_{m} will be updated into x^msubscript^𝑥𝑚\hat{x}_{m} to represent high-order correlation features.
28
+
29
+ The output of the correlation extraction layer is a set of feature vectors. We simply concatenate them and then put them into a classification layer for final prediction. The process can be expressed as:y^=σ​(w∘(x^1⊕x^2⊕…⊕x^T)+b),^𝑦𝜎𝑤direct-sumsubscript^𝑥1subscript^𝑥2…subscript^𝑥𝑇𝑏\hat{y}=\sigma(w\circ({{\hat{x}}_{1}}\oplus{{\hat{x}}_{2}}\oplus...\oplus{{\hat{x}}_{T}})+b),(10)where σ​(x)=11+e−x𝜎𝑥11superscript𝑒𝑥\sigma(x)=\frac{1}{{1+{e^{-x}}}}, w𝑤w and b𝑏b are parameter and bias term of linear transformation and T𝑇T is the total frame in the sample window. After this step, the model will output probabilities that samples belongs to cover or stego carrier. Besides, dropout is used to prevent over-fitting in this layer.
30
+
31
+ The proposed model is trained in a supervised framework. Loss of training process is cross entropy loss. Parameters in the model can be update via minimizing the cross entropy loss based on gradient descent [14].
32
+
33
+ Our experiments were conducted in public dataset 111https://github.com/fjxmlzn/RNN-SM.The above dataset contained different types of native speakers making it a good diversity in speech. Besides, each speech file in thedatasets was encoded according to the G.729a standard and secret data were embedded using CNV-QIM [3] steganography with different embedding rates. In our experiment, in order to test the performance of proposed model in low embedding rates, we choose samples embeded secret data with embedding rates from %10\%10 to %50\%50 in step of %10\%10. Besides, we cut samples into 0.1s, 0.3s, 0.5, 0.7s and 1s segments to test the model performance in short samples. The efficency test is also based on these samples.The hyperparameters in our model were selected via cross-validation on the trail set. More specifically, the e​m​b​e​d​d​i​n​g​_​s​i​z​e𝑒𝑚𝑏𝑒𝑑𝑑𝑖𝑛𝑔_𝑠𝑖𝑧𝑒embedding\_size is 100. The head of attention H=8𝐻8H=8. The dimension of hidden units d′superscript𝑑′d^{\prime} in each head is 32. The dropout rate was 0.6 for the output layer. The batch size in training process was 256, and the maximal training epoch was set to 100. We used Adam [14] as the optimizer for network training. Our model was implemented by Keras. We train all the networks on GeForce GTX 1080 GPU with 16G graphics memory. Prediction process is done both on previous GPU and on ”Intel(R) Xeon(R) CPU E5-2683 v3 2.00GHz”.
34
+
35
+ In order to validate the performance of our model, we compare with other state-of-the-art methods: QCCN [15], RNN-SM [6], R-CNN[7], and HRN [16]. Metrics used in experiments are detection accuracy and inference time.
36
+
37
+ Durations of samples have significantly influences on detection accuracy of QIM steganography in VoIP streams. From the Table 1, we can see the accuracy of detecting short samples are harder than long samples. The reason is that longer sample will provide more clues for steganalysis. Besides, we can also observe that the proposed model can improve the performancein various length of sample especially sample as short as 0.1s which is more practical in actual application. Thus, we can conclude that the proposed method can effectively detect the QIM steganography only by capturing a small segment speech stream of a monitored VoIP session.
38
+
39
+ The embedding rate is an important factor influencing detecting accuracy.In order to prevent steganalysis, the two parties of communication often adopt low embedding strategy. Obviously, detection rates in low embedding rates make great sense in practical scenario. In this part, we mainly conduct steganalysis in low embedding rates to show the effectiveness of proposed model. From the Table 2, we can observe that the proposed model outperforms all of the previous methods in low embedding rates.
40
+
41
+ VoIP is a real-time services used in IP network which means that the detection of steganography in VoIP stream should conduct as fast as possible. Compared with previous machine learning framework, the proposed model utilizes attention have the advantage for easier parallelizable computation. Experiments in Table 3 shows that our model drastically reduces the steganalysis time compared to recent works. Especially, we can see that even when the sample is as short as 0.1, the proposed model accelerate the steganalysis speed more than twice.
42
+
43
+ VoIP is a very popular real time streaming media for steganography. Previous steganalysis methods always extracted correlation feature by adopting RNN, CNN and their combination in VoIP streams, which either has low computation effiency or is hard to model long dependency. In this paper, we introduced attention mechanisms to extract correlation in code-words for speech steganalysis tasks and designed a fast correlation extract network without any RNN/CNN structure to detect QIM based steganography in VoIP stream. Experiment results indicate that our model can outperform all of the previous work and achieve state-of-the-art results. Excellent detection performance of proposed method shows that steganalysis model based solely on attention is a powerful alternative to extract correlation feature for steganalysis of VoIP stream and can be easily extend to similar problems in audio steganalysis.
1911.00714v1.txt ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Brain-computer interfaces (BCIs) decode motor intentions directly from brain signals for external device control [1, 2, 3]. Intracortical BCIs (iBCIs) utilize neural signals recorded from implanted electrode arrays to extract information about movement intentions. Advances in iBCIs have enabled the development in control of prosthetic devices or computer cursors by neural activities [4].
2
+
3
+ In iBCI systems, neural decoding algorithm plays an important role. Many algorithms have been proposed to decode motor information from neural signals [5, 6, 7], including population vector [8], linear estimators [9], deep neural networks [10], recursive Bayesian decoders [11]. Among these approaches, Kalman filter is considered to provide more accurate trajectory estimation by incorporating the process of trajectory evolution as a prior knowledge [12], which has been successfully applied to online cursor and prosthetic control, achieving the state-of-the-art performance [5, 13].
4
+
5
+ One critical challenge in neural decoding is the nonstationary property of neural signals [14]. Current iBCI neural decoders mostly assume a static functional relationship between neural signals and movements by using fixed decoding models. However, in an online decoding process, signals from neurons can be temporarily noised or even lost, and brain activities can also change due to neuroplasticity [15]. With the presence of noises and changes, the functional mapping between neural signals and movements can be nonstationary and changes continuously in time [16]. Static decoders with fixed decoding functions can be inaccurate and unstable given nonstationary neural signals [14], thus need to be retrained periodically to maintain the performance [17, 18].
6
+
7
+ Most existing neural decoders dealing with nonstationary problems can be classified into two groups. The first group is recalibration-based, which uses a static model, and periodically recalibrates it (with offline paradigms) or adaptively updates the parameters online (usually require true intention/trajectory). Most approaches belong to this group [5, 18, 19]. The second group uses dynamic models to track nonstationary changes in signals [20, 21, 22]. These approaches can avoid the expense of recalibration, which is potentially more suitable for long-term decoding tasks. However, there are very few studies in this group for the challenge in modeling nonstationary neural signals.
8
+
9
+ To obtain robust decoding performance with nonstationary neural signals, we improve upon the Kalman filter’s measurement function by introducing a dynamic ensemble measurement model, called DyEnsemble, capable of adapting to changes in neural signals. Different from static models, DyEnsemble allows the measurement function to be adaptively adjusted online. DyEnsemble firstly learns a set of diverse candidate models. In online prediction, it adaptively adjusts the measurement function along with changes in neural signals by dynamically selects and combines these models according to the Bayesian updating mechanism.Experimental results demonstrate that DyEnsemble model can effectively mitigate the effect of noises and cope with different task behaviors by automatic model switching, thus gives more accurate predictions.The main contributions of this work are summarized as follows:•We propose a novel dynamic ensemble model (DyEnsemble) to cope with nonstationary neural signals. We propose to use the particle filter algorithm for recursive state estimation in DyEnsemble, which adaptively estimates the posterior probability of each candidate model according to incoming neural signals, and combines them online with the Bayesian updating mechanism. The process of dynamic ensemble modeling is illustrated in Fig. 1.•We propose a candidate model generation strategy to learn a diverse candidate set from neural signals. The strategy includes a neuron dropout step to deal with noisy neurons, and a weight perturbation step to handle functional changes in neural signals.
10
+
11
+ Experiments are carried out with both simulation data and neural signal data. It is demonstrated that the DyEnsemble method outperforms Kalman filters remarkably, and its advantage is more obvious with noisy signals.
12
+
13
+ A classic state-space model consists of a state transition function f(.)f(.) and a measurement function h(.)h(.) as follows:𝐱k=f​(𝐱k−1)+𝐯k−1,subscript𝐱𝑘𝑓subscript𝐱𝑘1subscript𝐯𝑘1\displaystyle\mathbf{x}_{k}=f(\mathbf{x}_{k-1})+\mathbf{v}_{k-1},(1)𝐲k=h​(𝐱k)+𝐧k,subscript𝐲𝑘ℎsubscript𝐱𝑘subscript𝐧𝑘\displaystyle\mathbf{y}_{k}=h(\mathbf{x}_{k})+\mathbf{n}_{k},(2)where k𝑘k denotes the discrete time step, 𝐱k∈ℝdxsubscript𝐱𝑘superscriptℝsubscript𝑑𝑥\mathbf{x}_{k}\in\mathbb{R}^{d_{x}} is the state of our interest, 𝐲k∈ℝdysubscript𝐲𝑘superscriptℝsubscript𝑑𝑦\mathbf{y}_{k}\in\mathbb{R}^{d_{y}} is the measurement or observation, 𝐯ksubscript𝐯𝑘\mathbf{v}_{k} and 𝐧ksubscript𝐧𝑘\mathbf{n}_{k} are i.i.d. state transition noise and measurement noise.
14
+
15
+ In the context of neural decoding, the state and the measurement represent the movement trajectory and the neural signals, respectively. Given a sequence of neural signals 𝐲0:ksubscript𝐲:0𝑘\mathbf{y}_{0:k}, the task is to estimate the probability density of 𝐱ksubscript𝐱𝑘\mathbf{x}_{k} recursively. For linear Gaussian cases, Kalman filter can provide an analytical optimal solution to the above task.
16
+
17
+ In the classic state-space model mentioned earlier, the measurement function h(.)h(.) is assumed to be precisely determined beforehand, which can not adapt to functional changes in neural signals. In DyEnsemble, we allow the measurement function to be adaptively adjusted online. Specifically, we consider an improved measurement model as follows:𝐲k=hℋk​(𝐱k)+𝐧k,subscript𝐲𝑘subscriptℎsubscriptℋ𝑘subscript𝐱𝑘subscript𝐧𝑘\displaystyle\mathbf{y}_{k}=h_{\mathcal{H}_{k}}(\mathbf{x}_{k})+\mathbf{n}_{k},(3)in which ℋk∈{1,2,…,M}subscriptℋ𝑘12…𝑀\mathcal{H}_{k}\in\{1,2,\ldots,M\} denotes the index of our hypotheses about the observation function. Specifically, we use the notation ℋk=msubscriptℋ𝑘𝑚\mathcal{H}_{k}=m to denote the hypothesis that the working observation function at time k𝑘k is hmsubscriptℎ𝑚h_{m}.
18
+
19
+ Here we adopt a set of functions, i.e. candidate models, to characterize the relationship between the measurement and the state to be estimated. A Bayesian updating mechanism [23, 24, 25] is used for dynamically switching among these models in a data-driven manner.Given an observation sequence 𝐲0:ksubscript𝐲:0𝑘\mathbf{y}_{0:k}, the posterior of the state at time k𝑘k is given by [26]:p​(𝐱k|𝐲0:k)=∑m=1Mp​(𝐱k|ℋk=m,𝐲0:k)​p​(ℋk=m|𝐲0:k),𝑝conditionalsubscript𝐱𝑘subscript𝐲:0𝑘superscriptsubscript𝑚1𝑀𝑝conditionalsubscript𝐱𝑘subscriptℋ𝑘𝑚subscript𝐲:0𝑘𝑝subscriptℋ𝑘conditional𝑚subscript𝐲:0𝑘p(\mathbf{x}_{k}|\mathbf{y}_{0:k})=\sum_{m=1}^{M}{p(\mathbf{x}_{k}|\mathcal{H}_{k}=m,\mathbf{y}_{0:k})p(\mathcal{H}_{k}=m|\mathbf{y}_{0:k})},(4)where p​(𝐱k|ℋk=m,𝐲0:k)𝑝conditionalsubscript𝐱𝑘subscriptℋ𝑘𝑚subscript𝐲:0𝑘p(\mathbf{x}_{k}|\mathcal{H}_{k}=m,\mathbf{y}_{0:k}) is the posterior of the state corresponding to hypothesis ℋk=msubscriptℋ𝑘𝑚\mathcal{H}_{k}=m; p​(ℋk=m|𝐲0:k)𝑝subscriptℋ𝑘conditional𝑚subscript𝐲:0𝑘p(\mathcal{H}_{k}=m|\mathbf{y}_{0:k}) denotes the posterior probability of the m𝑚m-th hypothesis.
20
+
21
+ Now we consider how to derive p​(ℋk=m|𝐲0:k)𝑝subscriptℋ𝑘conditional𝑚subscript𝐲:0𝑘p(\mathcal{H}_{k}=m|\mathbf{y}_{0:k}) based on p​(ℋk−1=m|𝐲0:k−1)𝑝subscriptℋ𝑘1conditional𝑚subscript𝐲:0𝑘1p(\mathcal{H}_{k-1}=m|\mathbf{y}_{0:k-1}). This is required for developing a recursive algorithm. Following [27], we specify a model transition process in term of forgetting, to predict the model indicator at k𝑘k as follows:p​(ℋk=m|𝐲0:k−1)=p​(ℋk−1=m|𝐲0:k−1)α∑j=1Mp​(ℋk−1=j|𝐲0:k−1)α,𝑝subscriptℋ𝑘conditional𝑚subscript𝐲:0𝑘1𝑝superscriptsubscriptℋ𝑘1conditional𝑚subscript𝐲:0𝑘1𝛼superscriptsubscript𝑗1𝑀𝑝superscriptsubscriptℋ𝑘1conditional𝑗subscript𝐲:0𝑘1𝛼p(\mathcal{H}_{k}=m|\mathbf{y}_{0:k-1})=\frac{p(\mathcal{H}_{k-1}=m|\mathbf{y}_{0:k-1})^{\alpha}}{\sum_{j=1}^{M}{p(\mathcal{H}_{k-1}=j|\mathbf{y}_{0:k-1})^{\alpha}}},(5)where α𝛼\alpha (0<α<10𝛼10<\alpha<1) denotes the forgetting factor which controls the rate of reducing the impact of historical data. Employing Bayes’ rule, the posterior probability of the m𝑚m-th hypothesis at k𝑘k is obtained as below:p​(ℋk=m|𝐲0:k)=p​(ℋk=m|𝐲0:k−1)​pm​(𝐲k|𝐲0:k−1)∑j=1Mp​(ℋk=j|𝐲0:k−1)​pj​(𝐲k|𝐲0:k−1).𝑝subscriptℋ𝑘conditional𝑚subscript𝐲:0𝑘𝑝subscriptℋ𝑘conditional𝑚subscript𝐲:0𝑘1subscript𝑝𝑚conditionalsubscript𝐲𝑘subscript𝐲:0𝑘1superscriptsubscript𝑗1𝑀𝑝subscriptℋ𝑘conditional𝑗subscript𝐲:0𝑘1subscript𝑝𝑗conditionalsubscript𝐲𝑘subscript𝐲:0𝑘1p(\mathcal{H}_{k}=m|\mathbf{y}_{0:k})=\frac{p(\mathcal{H}_{k}=m|\mathbf{y}_{0:k-1})p_{m}(\mathbf{y}_{k}|\mathbf{y}_{0:k-1})}{\sum_{j=1}^{M}{p(\mathcal{H}_{k}=j|\mathbf{y}_{0:k-1})p_{j}(\mathbf{y}_{k}|\mathbf{y}_{0:k-1})}}.(6)The term of pm​(𝐲k|𝐲0:k−1)subscript𝑝𝑚conditionalsubscript𝐲𝑘subscript𝐲:0𝑘1p_{m}(\mathbf{y}_{k}|\mathbf{y}_{0:k-1}) is the marginal likelihood of model hmsubscriptℎ𝑚h_{m} at time k𝑘k, which is defined as:pm​(𝐲k|𝐲0:k−1)=∫pm​(𝐲k|𝐱k)​p​(𝐱k|𝐲0:k−1)​𝑑𝐱k,subscript𝑝𝑚conditionalsubscript𝐲𝑘subscript𝐲:0𝑘1subscript𝑝𝑚conditionalsubscript𝐲𝑘subscript𝐱𝑘𝑝conditionalsubscript𝐱𝑘subscript𝐲:0𝑘1differential-dsubscript𝐱𝑘p_{m}(\mathbf{y}_{k}|\mathbf{y}_{0:k-1})=\int{p_{m}(\mathbf{y}_{k}|\mathbf{x}_{k})p(\mathbf{x}_{k}|\mathbf{y}_{0:k-1})d\mathbf{x}_{k}},(7)where pm​(𝐲k|𝐱k)subscript𝑝𝑚conditionalsubscript𝐲𝑘subscript𝐱𝑘p_{m}(\mathbf{y}_{k}|\mathbf{x}_{k}) is the likelihood function associated with the m𝑚m-th hypothesis.
22
+
23
+ Here we develop a generic particle-based solution to Eqn. (4) by adapting the particle filter (PF) to fit our model.In PF, the posterior distribution at each time step is approximated with a weighted particle set [28].As shown in Eqn. (4), to estimate p​(𝐱k|𝐲0:k)𝑝conditionalsubscript𝐱𝑘subscript𝐲:0𝑘p(\mathbf{x}_{k}|\mathbf{y}_{0:k}) with particles, we need to derive a particle-based solution to: 1) p​(𝐱k|ℋk=m,𝐲0:k)𝑝conditionalsubscript𝐱𝑘subscriptℋ𝑘𝑚subscript𝐲:0𝑘p(\mathbf{x}_{k}|\mathcal{H}_{k}=m,\mathbf{y}_{0:k}); and 2) p​(ℋk=m|𝐲0:k)𝑝subscriptℋ𝑘conditional𝑚subscript𝐲:0𝑘p(\mathcal{H}_{k}=m|\mathbf{y}_{0:k}).
24
+
25
+ Assume that we are standing at the beginning of the k𝑘k-th time step, having at hand p​(ℋk−1=m|𝐲0:k−1),m=1,…,Mformulae-sequence𝑝subscriptℋ𝑘1conditional𝑚subscript𝐲:0𝑘1𝑚1…𝑀p(\mathcal{H}_{k-1}=m|\mathbf{y}_{0:k-1}),m=1,\ldots,M, and a weighted particle set {ωk−1i,𝐱k−1i}i=1Nssuperscriptsubscriptsubscriptsuperscript𝜔𝑖𝑘1subscriptsuperscript𝐱𝑖𝑘1𝑖1subscript𝑁𝑠\{\omega^{i}_{k-1},\mathbf{x}^{i}_{k-1}\}_{i=1}^{N_{s}}, where Nssubscript𝑁𝑠N_{s} denotes the particle size, 𝐱k−1isuperscriptsubscript𝐱𝑘1𝑖\mathbf{x}_{k-1}^{i} the i𝑖i-th particle with importance weight ωk−1isubscriptsuperscript𝜔𝑖𝑘1\omega^{i}_{k-1}. Assume that p​(𝐱k−1|𝐲0:k−1)≃∑i=1Nsωk−1i​δ​(𝐱k−1−𝐱k−1i)similar-to-or-equals𝑝conditionalsubscript𝐱𝑘1subscript𝐲:0𝑘1subscriptsuperscriptsubscript𝑁𝑠𝑖1subscriptsuperscript𝜔𝑖𝑘1𝛿subscript𝐱𝑘1subscriptsuperscript𝐱𝑖𝑘1p(\mathbf{x}_{k-1}|\mathbf{y}_{0:k-1})\simeq\sum^{N_{s}}_{i=1}\omega^{i}_{k-1}\delta(\mathbf{x}_{k-1}-\mathbf{x}^{i}_{k-1}), where δ(.)\delta(.) denotes the Dirac delta function, we show how to get a particle solution to p​(𝐱k|ℋk=m,𝐲0:k)𝑝conditionalsubscript𝐱𝑘subscriptℋ𝑘𝑚subscript𝐲:0𝑘p(\mathbf{x}_{k}|\mathcal{H}_{k}=m,\mathbf{y}_{0:k}) and p​(ℋk=m|𝐲0:k)𝑝subscriptℋ𝑘conditional𝑚subscript𝐲:0𝑘p(\mathcal{H}_{k}=m|\mathbf{y}_{0:k}), for m=1,…,M𝑚1…𝑀m=1,\ldots,M.
26
+
27
+ Step 1. Particle based estimation of p​(𝐱k|ℋk=m,𝐲0:k)𝑝conditionalsubscript𝐱𝑘subscriptℋ𝑘𝑚subscript𝐲:0𝑘p(\mathbf{x}_{k}|\mathcal{H}_{k}=m,\mathbf{y}_{0:k}).To begin with, we draw particles 𝐱kisubscriptsuperscript𝐱𝑖𝑘\mathbf{x}^{i}_{k} from the state transition prior p​(𝐱k|𝐱k−1i)𝑝conditionalsubscript𝐱𝑘subscriptsuperscript𝐱𝑖𝑘1p(\mathbf{x}_{k}|\mathbf{x}^{i}_{k-1}), for i=1,…,Ns𝑖1…subscript𝑁𝑠i=1,\ldots,N_{s}. Then according to the principle of importance sampling, we have:p​(𝐱k|ℋk=m,𝐲0:k)≈∑i=1Nsωm,ki​δ​(𝐱k−𝐱ki),𝑝conditionalsubscript𝐱𝑘subscriptℋ𝑘𝑚subscript𝐲:0𝑘subscriptsuperscriptsubscript𝑁𝑠𝑖1subscriptsuperscript𝜔𝑖𝑚𝑘𝛿subscript𝐱𝑘subscriptsuperscript𝐱𝑖𝑘p(\mathbf{x}_{k}|\mathcal{H}_{k}=m,\mathbf{y}_{0:k})\approx\sum^{N_{s}}_{i=1}\omega^{i}_{m,k}\delta(\mathbf{x}_{k}-\mathbf{x}^{i}_{k}),(8)where ωm,ki∝ωk−1i​pm​(𝐲k|𝐱ki)proportional-tosubscriptsuperscript𝜔𝑖𝑚𝑘subscriptsuperscript𝜔𝑖𝑘1subscript𝑝𝑚conditionalsubscript𝐲𝑘subscriptsuperscript𝐱𝑖𝑘\omega^{i}_{m,k}\propto\omega^{i}_{k-1}p_{m}(\mathbf{y}_{k}|\mathbf{x}^{i}_{k}), ∑i=1Nsωm,ki=1superscriptsubscript𝑖1subscript𝑁𝑠subscriptsuperscript𝜔𝑖𝑚𝑘1\sum_{i=1}^{N_{s}}\omega^{i}_{m,k}=1. ωm,kisubscriptsuperscript𝜔𝑖𝑚𝑘\omega^{i}_{m,k} denotes the normalized importance weight of the i𝑖ith particle under the hypothesis ℋk=msubscriptℋ𝑘𝑚\mathcal{H}_{k}=m.
28
+
29
+ Step 2. Particle based estimation of p​(ℋk=m|𝐲0:k)𝑝subscriptℋ𝑘conditional𝑚subscript𝐲:0𝑘p(\mathcal{H}_{k}=m|\mathbf{y}_{0:k}).Given p​(ℋk−1=m|𝐲0:k−1)𝑝subscriptℋ𝑘1conditional𝑚subscript𝐲:0𝑘1p(\mathcal{H}_{k-1}=m|\mathbf{y}_{0:k-1}), first we calculate the predictive probability of ℋk=msubscriptℋ𝑘𝑚\mathcal{H}_{k}=m using Eqn. (5). Then we can calculate p​(ℋk=m|𝐲0:k)𝑝subscriptℋ𝑘conditional𝑚subscript𝐲:0𝑘p(\mathcal{H}_{k}=m|\mathbf{y}_{0:k}) using Eqn. (6) provided that pm​(𝐲k|𝐲0:k−1),m=1,…,Mformulae-sequencesubscript𝑝𝑚conditionalsubscript𝐲𝑘subscript𝐲:0𝑘1𝑚1…𝑀p_{m}(\mathbf{y}_{k}|\mathbf{y}_{0:k-1}),m=1,\ldots,M is available. Now we show how to make use of the weighted particle set in Step 1 to estimate pm​(𝐲k|𝐲0:k−1),m=1,…,Mformulae-sequencesubscript𝑝𝑚conditionalsubscript𝐲𝑘subscript𝐲:0𝑘1𝑚1…𝑀p_{m}(\mathbf{y}_{k}|\mathbf{y}_{0:k-1}),m=1,\ldots,M. Recall that, in Step 1, the state transition prior is adopted as the importance function, namely q​(𝐱k|𝐱k−1,𝐲0:k)=p​(𝐱k|𝐱k−1)𝑞conditionalsubscript𝐱𝑘subscript𝐱𝑘1subscript𝐲:0𝑘𝑝conditionalsubscript𝐱𝑘subscript𝐱𝑘1q(\mathbf{x}_{k}|\mathbf{x}_{k-1},\mathbf{y}_{0:k})=p(\mathbf{x}_{k}|\mathbf{x}_{k-1}). It naturally leads to a particle approximation to the predictive distribution of xksubscript𝑥𝑘x_{k}, which is shown to be p​(𝐱k|𝐲0:k−1)≈∑i=1Nωk−1i​δ𝐱ki𝑝conditionalsubscript𝐱𝑘subscript𝐲:0𝑘1superscriptsubscript𝑖1𝑁subscriptsuperscript𝜔𝑖𝑘1subscript𝛿subscriptsuperscript𝐱𝑖𝑘p(\mathbf{x}_{k}|\mathbf{y}_{0:k-1})\approx\sum_{i=1}^{N}\omega^{i}_{k-1}\delta_{\mathbf{x}^{i}_{k}}. Then, according to Eqn. (7), we havepm​(𝐲k|𝐲0:k−1)≈∑i=1Nsωk−1i​pm​(𝐲k|𝐱ki).subscript𝑝𝑚conditionalsubscript𝐲𝑘subscript𝐲:0𝑘1subscriptsuperscriptsubscript𝑁𝑠𝑖1subscriptsuperscript𝜔𝑖𝑘1subscript𝑝𝑚conditionalsubscript𝐲𝑘subscriptsuperscript𝐱𝑖𝑘p_{m}(\mathbf{y}_{k}|\mathbf{y}_{0:k-1})\approx\sum^{N_{s}}_{i=1}\omega^{i}_{k-1}p_{m}(\mathbf{y}_{k}|\mathbf{x}^{i}_{k}).(9)Note that PF usually suffers from the problem of particle degeneracy. That says, after several iterations, only a few particles have large weights. Hence, we adopt a resampling procedure in our method, which is a common practice in the literature for mitigating particle degeneracy by removing particles with negligible weights and duplicate particles with large weights.
30
+
31
+ Here we propose a candidate model generation strategy to learn a diverse model set from neural signals. The strategy includes two stages of neuron dropout and weight perturbation. To create proper candidate models, we analyze the properties of neural signals. The details of neural signal data are given in Section 4.1.The candidate model generation strategy is given in Algorithm 1.
32
+
33
+ Neuron dropout.In Fig. 2 (a), we evaluate the decoding ability of each neuron by mutual information (MI) between its spike rates and target trajectory. It shows that only some of the neurons contain useful information for motor decoding [29]. The activities of uncorrelated neurons can reduce decoding performance, and the informative neurons can also be temporarily noised or even lost. In neuron dropout, we randomly disconnect candidate models with several neurons to improve the noise-resistant ability and increase model diversity. After neuron dropout, each candidate only connects to s𝑠s neurons, where s𝑠s is the parameter of model size.
34
+
35
+ Weight perturbation. In Fig. 2 (b), we analyze the functional changes over time. Specifically, we fit linear mapping functions between neuron’s firing rates and target trajectory in every 20-second temporal window with a stride of 1 second, and illustrate the distribution of slope parameters. The red plus sign indicates the slope estimated with the whole time length. Results show that the mapping function of neuron swings slightly around the mean in time.
36
+
37
+ To track the functional changes in neural signals, we propose a weight perturbation process. After model training, we randomly disturb the weights of each candidate model hmsubscriptℎ𝑚h_{m} (hm∈ℳsubscriptℎ𝑚ℳh_{m}\in\mathcal{M}) in a small range:w=w+p×ϵ,𝑤𝑤𝑝italic-ϵw=w+p\times\epsilon,(10)where ϵitalic-ϵ\epsilon is randomly sampled from Gaussian(0,1), p𝑝p is the weight perturbation factor. The weight perturbation step gives the model set better tolerance of functional changes.
38
+
39
+ The DyEnsemble approach is firstly evaluated with simulation data. In this experiment, we simulate a time series data where the measurement model is formulated by a piecewise function, to see how DyEnsemble tracks changes in functions.
40
+
41
+ The state transition function of the simulation data is given by:xk+1=1+s​i​n​(0.04​π×(k+1))+0.5​xk+vk,subscript𝑥𝑘11𝑠𝑖𝑛0.04𝜋𝑘10.5subscript𝑥𝑘subscript𝑣𝑘x_{k+1}=1+sin(0.04\pi\times(k+1))+0.5x_{k}+v_{k},(11)where vksubscript𝑣𝑘v_{k} is a Gamma(3,2) random state process noise. The formulation of state transition function follows [30]. The measurement function is defined as:yk={h​1​(x)=2​x−3+nk,0<k⩽100,h​2​(x)=−x+8+nk,100<k⩽200,h​3​(x)=0.5​x+5+nk,200<k⩽300,subscript𝑦𝑘casesℎ1𝑥2𝑥3subscript𝑛𝑘0𝑘100ℎ2𝑥𝑥8subscript𝑛𝑘100𝑘200ℎ3𝑥0.5𝑥5subscript𝑛𝑘200𝑘300y_{k}=\left\{\begin{array}[]{lr}h1(x)=2x-3+n_{k},&0<k\leqslant 100,\\h2(x)=-x+8+n_{k},&100<k\leqslant 200,\\h3(x)=0.5x+5+n_{k},&200<k\leqslant 300,\end{array}\right.(12)where nksubscript𝑛𝑘n_{k} is Gaussian(0,1) random measurement noise. The goal is to estimate state 𝐱ksubscript𝐱𝑘\mathbf{x}_{k} given a sequence of measurement 𝐲0:ksubscript𝐲:0𝑘\mathbf{y}_{0:k}. The length of simulation data is 300. In DyEnsemble, h​1ℎ1h1, h​2ℎ2h2, and h​3ℎ3h3 are adopted as candidate models. The forgetting factor α𝛼\alpha is set to 0.5, and the particle number is 200.
42
+
43
+ Fig. 3 shows the posterior probability of candidate models over time. In DyEnsemble, the weights of the candidate models switch automatically along with changes in signals. Candidate h​1ℎ1h1, h​2ℎ2h2, and h​3ℎ3h3 takes the dominating weight alternately, which is highly consistent with the piecewise function.We also evaluate the influence of forgetting factor α𝛼\alpha, which adjusts the smoothness of weight transition. With a higher α𝛼\alpha, model weights change more smoothly in time.
44
+
45
+ Neural signals were recorded from rats during lever-pressing tasks. The rats were trained to use their right forelimb to press a lever for water rewards. 16-channel microwire electrode arrays (8×\times2, diameter = 35 μ​m𝜇𝑚\mu m) were implanted in the primary motor cortex of rats. Neural signals were recorded by a CerebusTM system at a sampling rate of 30 kHz. Spikes were sorted and binned by 100 ms windows without overlap. The forelimb movements were acquired by lever trajectory, which was recorded at a sampling rate of 500 Hz, and downsampled to 10 Hz, to align to the spike bins. The experiments conformed to the Guide for the Care and Use of Laboratory Animals.
46
+
47
+ The neural signal dataset includes two rats, for each rat, the data length is about 400 seconds. We use the first 200 seconds for training and the last 100 seconds for test. After spike sorting, there are 22 and 58 neurons for rat1 and rat2 respectively. We evaluate the neurons with mutual information (MI) between the spike rates and lever trajectory, and select the top 20 neurons for movement decoding.
48
+
49
+ The movement trajectory at time step k𝑘k is a 3×1313\times 1 vector 𝐱k=[pk,vk,ak]Tsubscript𝐱𝑘superscriptsubscript𝑝𝑘subscript𝑣𝑘subscript𝑎𝑘𝑇\mathbf{x}_{k}=[p_{k},v_{k},a_{k}]^{T}, where pksubscript𝑝𝑘p_{k}, vksubscript𝑣𝑘v_{k} and aksubscript𝑎𝑘a_{k} are the position, velocity and acceleration, respectively. The binned neural signal 𝐲ksubscript𝐲𝑘\mathbf{y}_{k} is a 20×120120\times 1 vector 𝐲k=[yk1,yk2,…,yk20]Tsubscript𝐲𝑘superscriptsuperscriptsubscript𝑦𝑘1superscriptsubscript𝑦𝑘2…superscriptsubscript𝑦𝑘20𝑇\mathbf{y}_{k}=[y_{k}^{1},y_{k}^{2},...,y_{k}^{20}]^{T}, where each element ykisuperscriptsubscript𝑦𝑘𝑖y_{k}^{i} denotes the spike count of the i𝑖i-th neuron.
50
+
51
+ Adaptation to changing noises.To analyze the dynamic ensemble process with changing noises, we add noise to neuron 2 and neuron 13 at around the 2nd and 4th second, as in Fig. 4 (a). The additional noise is randomly distributed integers in [0,10]. Fig. 4 (b) shows the weights of candidate models over time. There are a total of 20 candidate models with model size s=15𝑠15s=15 and weight perturbation factor p=0.1𝑝0.1p=0.1. Specially, we set the forgetting factor α=0.98𝛼0.98\alpha=0.98 to force model weight transition to be highly smooth, for analysis convenience.
52
+
53
+ As shown in Fig. 4 (a) and (b), when there is no additional noise (the first 2 seconds), the 13th, 15th and 19th candidate models are with high weights in assembling, as in Fig. 4 (c). When noise occurs in the 2nd neuron (2-4 seconds), the weights of the 13th and 19th candidates become small because they both connected to the 2nd neuron. While the 15th candidate, which does not connect to neuron 2, takes the dominating weight, as in Fig. 4 (d). When noise occurs in neuron 13 at the 4th second, the weight of the 15th candidate decreases due to its connection to neuron 13, and the new winner is the 4th candidate, which does not connect to both noisy neurons (Fig. 4 (e)). The results strongly suggest that, given signals with changing noise, DyEnsemble approach can adaptively switch its model combination to mitigate the effect of noise.
54
+
55
+ Adaptation to task behaviors. Fig. 5 (a) visualizes the model weight transition process with α=0.1𝛼0.1\alpha=0.1 and α=0.5𝛼0.5\alpha=0.5. It is interesting to find that, the model assembling behaviors are different in lever-pressing and non-pressing periods. As highlighted in the dashed boxes in Fig. 5 (a), during lever-pressing, only several certain models are selected. In Fig. 5 (b) and (c), we illustrate the average weights of some candidate models in both lever-pressing and non-pressing periods. The results suggest that different models show different preferences to task behaviors, and DyEnsemble approach can automatically switch to suitable candidates to cope with changes of behaviors.
56
+
57
+ Experiments are carried out to compare the neural decoding performance of DyEnsemble with other methods. The neural decoding performance is evaluated by commonly used criteria of correlation coefficient (CC) between lever trajectory and estimations. The results are shown in Table. 1.
58
+
59
+ To simulate noisy situations with unpredictable noises, we randomly replace several neurons’ signals by noise in the test data. In Table. 1, we replace two (Noisy #2) and four (Noisy #4) neurons’ signals by random integer noises in a range of [0, 10].
60
+
61
+ Evaluation of neuron dropout and weight perturbation.Here we evaluate the two key parts of neuron dropout and weight perturbation. In Table. 1 we compare the baseline approach (without neuron dropout and perturbation), the DyEnsemble with perturbation (p=0.1) alone, and the DyEnsemble with both perturbation (p=0.1) and dropout (DyEnsemble-2 and DyEnsemble-5 drops 2 and 5 neurons respectively). Compared with the baseline, weight perturbation improves the performance by about 10% in noisy situations, and neuron dropout (DyEnsemble-5) leads to a further 20% performance improvement with 4 noisy neurons.
62
+
63
+ Comparison with other decoders. The methods in comparison include: Kalman filter, which is a baseline approach in neural motor decoding; long short-term memory (LSTM) [31] recurrent neural network, which excels in learning from sequential data in machine learning field [32]; dual decoder with a Kalman filter [21, 22], which can be regarded as the current state-of-the-art dynamic modeling approach for nonstationary neural signals.
64
+
65
+ For a fair comparison, we use linear functions of f(.)f(.), h(.)h(.) and zero-mean Gaussian terms for 𝐯ksubscript𝐯𝑘\mathbf{v}_{k} and 𝐧ksubscript𝐧𝑘\mathbf{n}_{k} in Kalman, dual decoder, and DyEnsemble, and f(.)f(.), h(.)h(.) are estimated by the least square algorithm. For LSTM, we use a one-hidden-layer model with 8 hidden neurons. In DyEnsemble, the forgetting factor α𝛼\alpha is 0.1, model number M𝑀M is 20, weight perturbation factor p𝑝p is 0.1, and the particle number is 1000. For DyEnsemble-2 and DyEnsemble-5, the model size is 18 and 15, respectively.All the methods are carefully tuned by validation and the validation set is the last 400 points of training data. The results are averaged over three random runs.
66
+
67
+ In Table. 1, we highlighted the top two performances in bold. Without additional noises (Original column), the CCs of DyEnsemble-2 and DyEnsemble-5 are 0.799 and 0.775 for Rat1, which are slightly higher than Kalman (0.777) and LSTM (0.753), and comparable to dual decoder (0.779). For Rat2, the best CC of DyEnsemble is 0.803 which is higher than Kalman (0.798) while slightly lower than LSTM (0.846). Overall, with original neural signals, the performance of DyEnsemble is comparable to state-of-the-art approaches.
68
+
69
+ With noisy neurons, the performances of Kalman, LSTM and dual decoder decrease significantly. For Rat1, when there are 2 noisy neurons, the CCs of Kalman, LSTM, and dual decoder are 0.696, 0.687 and 0.694, respectively. The CC of DyEnsemble-5 is 0.739, which improves by 6.2%, 7.6%, 6.5% compared with Kalman, LSTM, and dual decoder, respectively. With 4 noisy neurons, DyEnsemble-5 achieves a CC of 0.671, which is 19.8%, 8.8% and 16.7% higher than Kalman, LSTM and dual decoder, respectively. Similar results are observed with Rat2. DyEnsemble-5 is more stable and robust than DyEnsemble-2 with noisy neurons especially when there are 4 noisy neurons. Since Ensemble-2 only drops 2 neurons in candidate models, the performance decreases when more than 2 noisy neurons occur. Dropping more neurons can increase the robustness against noises, while it may also harm estimation accuracy.
70
+
71
+ Here we evaluate the key parameters in DyEnsemble: model size (s𝑠s), model number (M𝑀M), forgetting factor (α𝛼\alpha), and weight perturbation factor (p𝑝p). The results are illusrated in Fig. 6.
72
+
73
+ Model size. Model size s𝑠s defines the number of neurons connected to each candidate model. The rest of the parameters is set to: α=0.1,p=0.1,M=20formulae-sequence𝛼0.1formulae-sequence𝑝0.1𝑀20\alpha=0.1,p=0.1,M=20.As shown in Fig. 6 (a), overall, CC improves with the increasing of model size. While for Rat2, CC decreases slightly after model size reaches 18. Commonly, a larger model size brings more information, while it also decreases the noise-resistant ability as discussed in Section 4.3.
74
+
75
+ Model number. The model number denotes the number of candidate models in ℳℳ\mathcal{M}. The rest of the parameters is set to: α=0.1,p=0.1,s=15formulae-sequence𝛼0.1formulae-sequence𝑝0.1𝑠15\alpha=0.1,p=0.1,s=15. As shown in Fig. 6 (b), the performance increases when we tune M𝑀M from 5 to 20, while the improvement is subtle when M𝑀M is larger than 20.
76
+
77
+ Forgetting factor. The parameter of forgetting factor from Eqn. (5) controls the inertia in the candidate model transition.With a large α𝛼\alpha, the candidate models prefer to keep the weights from the last time step.From Fig. 6 (c), we find that smaller α𝛼\alpha gives better performance in the neural decoding task, which reflects the nonstationary properties of neural signals. The rest of the parameters is set to: s=15,p=0.1,M=20formulae-sequence𝑠15formulae-sequence𝑝0.1𝑀20s=15,p=0.1,M=20.
78
+
79
+ Weight perturbation factor. The weight perturbation factor p𝑝p controls the range that candidate models can deviate from the mean. A higher p𝑝p can tolerate larger changes in functional relationships, however, it also leads to inaccurate predictions. As shown in Fig. 6 (d), the performance improves when p𝑝p is adjusted from 0.01 to 0.1, while decreases rapidly when p𝑝p is bigger than 0.2. The rest of the parameters is set to: s=15,α=0.1,M=20formulae-sequence𝑠15formulae-sequence𝛼0.1𝑀20s=15,\alpha=0.1,M=20.
80
+
81
+ We proposed a dynamic ensemble modeling approach, called DyEnsemble, for robust movement trajectory decoding from nonstationary neural signals. The DyEnsemble model improved upon the classic state-space model by introducing a dynamic ensemble measurement function, which is capable of adapting to changes in neural signals. Experimental results demonstrated that the DyEnsemble approach could automatically switch to suitable models to mitigate the effect of noises and cope with different task behaviors. The proposed method can provide valuable solutions for robust neural decoding tasks and nonstationary signal processing problems.
82
+
83
+ This work was partly supported by grants from the National Key Research and Development Program of China (2018YFA0701400, 2017YFB1002503), National Natural Science Foundation of China (61906166, 61571238, 61906099), Zhejiang Provincial Natural Science Foundation of China (LZ17F030001), and the Zhejiang Lab (2018EB0ZX01).
1911.00731v1.txt ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ The rapid growth in the size of datasets has given rise to distributed models for statistical learning, in which data is not stored on a single machine.In several recent learning applications, it is commonplace to distribute data across multiple machines, each of which processes its own data and communicates with other machines to carry out a learning task.The main bottleneck in such distributed settings is often the communication between machines, and several recent works have focused on designing communication-efficient algorithms for different machine learning applications (duchi2012dual; braverman2016communication; chang2017distributed; diakonikolas2017communication; lee2017communication).
2
+
3
+ In this paper, we consider the problem of statistical optimization in a distributed setting as follows.Consider an unknown distribution P𝑃P over a collection, ℱℱ\cal{F}, of differentiable convex functions with Lipschitz first order derivatives, defined on a convex region in ℝdsuperscriptℝ𝑑{\mathbb{R}}^{d}.There are m𝑚m machines, each observing n𝑛n i.i.d sample functions from P𝑃P. Each machine processes its observed data, and transmits a signal of certain length to a server. The server then collects all the signals and outputs an estimate of the parameter θ∗superscript𝜃\theta^{*} that minimizes the expected loss, i.e., minθ⁡𝔼f∼P​[f​(θ)]subscript𝜃subscript𝔼similar-to𝑓𝑃delimited-[]𝑓𝜃\min_{\theta}\mathbb{E}_{f\sim P}\big{[}f(\theta)\big{]}.See Fig. LABEL:Fig:system for an illustration of the system model.
4
+
5
+ We focus on the distributed aspect of the problem considering arbitrarily large number of machines (m𝑚m) anda)present an order optimal algorithm with b=O​(log⁡m​n)𝑏𝑂𝑚𝑛b=O(\log mn) bits per transmission, whose estimation error is no larger than O~​(m−1/max⁡(d,2)​n−1/2)~𝑂superscript𝑚1𝑑2superscript𝑛12\tilde{O}\big{(}m^{-{1}/{\max(d,2)}}n^{-1/2}\big{)}, meeting the lower bound in (saleh2019) up to a poly-logarithmic factor (cf. Theorem LABEL:th:main_upper);b)we present an algorithm with a single bit per message with expected error no larger than O~​(m−1/2+n−1/2)~𝑂superscript𝑚12superscript𝑛12\tilde{O}\big{(}m^{-1/2}+n^{-1/2}\big{)} (cf. Proposition LABEL:prop:H2constb).
6
+
7
+ The distributed setting considered here has recently employed in a new machine learning paradigm called Federated Learning (konevcny2015federated).In this framework, training data is kept in users’ computing devices due to privacy concerns, and the users participate in the training process without revealing their data.As an example, Google has been working on this paradigm in their recent project, Gboard (mcmahan2017federated), the Google keyboard.Besides communication constraints, one of the main challenges in this paradigm is that each machine has a small amount of data. In other words, the system operates in a regime that m𝑚m is much larger than n𝑛n (chen2017distributed).
8
+
9
+ A large body of distributed statistical optimization/estimation literature considers “one-shot" setting, in which each machine communicates with the server merely once (zhang2013information).In these works, the main objective is to minimize the number of transmitted bits, while keeping the estimation error as low as the error of a centralized estimator, in which the entire data is co-located in the server.
10
+
11
+ If we impose no limit on the communication budget, then each machine can encode its entire data into a single message and sent it to the server.In this case, the sever acquires the entire data from all machines, and the distributed problem reduces to a centralized problem.We call the sum of observed functions at all machines as the centralized empirical loss, and refer to its minimizer as the centralized solution.It is part of the folklore that the centralized solution is order optimal and its expected error is Θ​(1/m​n)Θ1𝑚𝑛\Theta\big{(}1/\sqrt{mn}\big{)} (lehmann2006theory; zhang2013information).Clearly, no algorithm can beat the performance of the best centralized estimator.
12
+
13
+ zhang2012communication studied a simple averaging method where each machine obtains the empirical minimizer of its observed functions and sends this minimizer to the server through an O​(log⁡m​n)𝑂𝑚𝑛O(\log mn) bit message. Output of the server is then the average of all received empirical minimizers.zhang2012communication showed that the expected error of this algorithm is no larger than O​(1/m​n+ 1/n)𝑂1𝑚𝑛1𝑛O\big{(}1/\sqrt{mn}\,+\,1/n\big{)}, provided that: 1- all functions are convex and twice differentiable with Lipschitz continuous second derivatives, and 2- the objective function 𝔼f∼P​[f​(θ)]subscript𝔼similar-to𝑓𝑃delimited-[]𝑓𝜃\mathbb{E}_{f\sim P}\big{[}f(\theta)\big{]} is strongly convex at θ∗superscript𝜃\theta^{*}.Under the extra assumption that the functions are three times differentiable with Lipschitz continuous third derivatives, zhang2012communication also present a bootstrap methodwhose expected error is O​(1/m​n+ 1/n1.5)𝑂1𝑚𝑛1superscript𝑛1.5O\big{(}1/\sqrt{mn}\,+\,1/n^{1.5}\big{)}.It is easy to see that, under the above assumptions, the averaging method and the bootstrap method achieve the performance of the centralized solution if m≤n𝑚𝑛m\leq n and m≤n2𝑚superscript𝑛2m\leq n^{2}, respectively.Recently, jordan2018communication proposed to optimize a surrogate loss function using Taylor series expansion. This expansion can be constructed at the server by communicating O​(m)𝑂𝑚O(m) number of d𝑑d-dimensional vectors.Under similar assumption on the loss function as in (zhang2012communication), they showed that the expected error of their method is no larger than O​(1/m​n+1/n9/4)𝑂1𝑚𝑛1superscript𝑛94O\big{(}1/\sqrt{mn}+1/n^{{9}/{4}}\big{)}.It, therefore, achieves the performance of the centralized solution for m≤n3.5𝑚superscript𝑛3.5m\leq n^{3.5}.However, note that when n𝑛n is fixed, all aforementioned bounds remain lower bounded by a positive constant, even when m𝑚m goes to infinity.
1911.00760v2.txt ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Precision medicine (Collins andVarmus, 2015), with the goal of providing the right treatment to the right patient at the right time, holds great premise on treating complicated diseases such as cancer. Biomedical literature database stores the state-of-the-art information about the various aspects related to precision medicine (e.g., patients, diseases, genetics, treatments, etc.) and serves as a vital knowledge source. For example, with the prevalence of Next Generation Sequencing (NGS) technology, vast amounts of genetic variants can be identified for a specific patient on a specific tissue (e.g., tumor). The domain experts, such as clinicians, pathologists, oncologists, need to search the relevant literature on PubMed to interpret these genetic variants. Therefore, an efficient and accurate biomedical literature retrieval (BLR) system is crucial.
2
+
3
+ There are many challenges to building such an effective BLR system. For example, the vocabulary of professional terms in biomedical articles is typically large,and there are many semantic variations for the same biomedical concept (e.g., a specific genetic variant), the relations between these concepts are complicated (which could be explicit/implicit, direct/indirect, and known/unknown, etc.).
4
+
5
+ The goal of this paper is to develop a high-performance BLR system in view of the above challenges.Specifically, our task is to take patient information with the genetic variant as query and retrieve relevant biomedical articles from literature databases such as MEDLINE111MEDLINE (https://www.nlm.nih.gov/bsd/medline.html) is a bibliographic database of life sciences and biomedical information. It includes bibliographic information for articles from academic journals covering medicine, nursing, pharmacy, dentistry, veterinary medicine, and health care..Here the patient information can be either in a structured form (disease name, variant, demographic, …) or unstructured text. The output should be a list of biomedical articles which are ranked according to the relevance with the query.
6
+
7
+ There are mainly two types of retrieval models can be used for our scenario. The first type is the traditional document retrieval model which represents the query and documents both as one-hot representations and matches query and documents with similarity measures such as cosine similarity. In particular, one-hot representations can be generated through the bag-of-words model or TF-IDF model. In the bag-of-words model, a text (such as a query or a biomedical article) is represented as the bag (multiset) of its words, disregarding grammar and even word order but keeping multiplicity. TF-IDF model is a better approach compared to the bag-of-words model. It assigns a weighting to each word in the document and put that weighting in the vector, which is allowed to normalize the count/frequency of the word. Yet the drawback of the traditional retrieval model is apparent. Consider one takes ”lung cancer” as the query, then the model can only retrieve the articles with exactly the term ”lung cancer” in their contents. A notable exception is PubMed which expands the query by mapping it to related MeSH terms (Lu et al., 2009). Although this increases recall, it often decreases precision which is crucial for precision medicine (Hershet al., 2000).The second type is deep learning models, such as DeepMatch (Lu and Li, 2013) and Delta (Mohanet al., 2018), which have demonstrated superior performance in recent years. The advantage of these models comes from their flexible representation learning process for the query and the documents. In particular, the learned representations can encode the underlying semantics for queries and documents. This greatly enhanced the capturing of the semantically similar words but with different expressions such as ”cancer” and ”tumor”, ”diabetes” and ”hyperglycemia”. Therefore, take ”diabetes” as query these models might find articles with ”hyperglycemia”. However, it is still difficult for these models to identify indirectly/implicitly related terms such as ”diabetes” and ”metformin”, in which case we would need external knowledge base (Zhaoet al., 2018).
8
+
9
+ Our developed system is called GRAPHENE, which stands for GRaph Augmented deeP learning witH knowlEdge empowermeNt Engine.Our model learns literature representations with local text and external structured knowledge and matches queries with the pair-wise learning to rank mechanism. The overall architecture of GRAPHENE is shown in Figure 1, which is composed of 3 main modules. The first is a document representation learning module. We propose to construct a document-concept graph, upon which a graph-augmented document representation is learned to encode both the underlying semantics of the literature and the information from non-local relevant medical concepts. The second is patient information query representation learning module, where we propose to expand query and learn representations through the convolution upon the expanded query. The third is a learning to rank module, which minimizes the pairwise ranking loss between the patient information and biomedical article to learn a partial order of relevance of biomedical articles. The organic integration of these components makes GRAPHENE possible to retrieve biomedical articles effectively and precisely.
10
+
11
+ Experimental results on TREC Precision Medicine data (Roberts et al., 2017) demonstrate that our model can effectively retrieve most relevant biomedical articles with patient information.The results also show that our model outperforms those deep neural retrieval models which represent documents with textual information only, suggesting the necessity of encoding graph-based external knowledge into document representation.
12
+
13
+ The paper is organized as follows. Section 2 includes related studies in biomedical literature retrieval and document retrieval methodology. Section 3 describes the details of graph-augmented document representation learning algorithm. Section 4 describes the details of CNN-based query representation learning algorithm and pair-wise learning-to-rank algorithm. Experimental results are presented inSection 5, and the paper is concluded in Section 6.
14
+
15
+ There has already been a lot of research on biomedical literature retrieval (Fioriniet al., 2018a, 2017, b; Mohanet al., 2018; Soldainiet al., 2017; Zheng and Wan, 2016).For example, Zheng and Wan (Zheng and Wan, 2016) proposed to use the paragraph vector technique to learn the latent semantic representation of texts and treat the latent semantic representations and the original bag-of-words representations as two different modalities. They then proposed to use the multi-modality learning algorithm to retrieve biomedical literature for clinical decision support. Soldaini et al. (Soldainiet al., 2017) applied query reformulation techniques to address the need of literature search based on case reports. Best Match (Fioriniet al., 2018a) is the first relevance search algorithm for PubMed that leverages the intelligence of users and machine-learning technology as an alternative to the traditional sorting techniques.Delta (Mohanet al., 2018) is a deep learning based model that applies convolution operation upon an updated document matrix in which each word is replaced with the most similar word in the query. However, this model takes the key topic word and other words in query with equal importance, making the retrieval out of focus.
16
+
17
+ The traditional document retrieval models represent both the queries and documents as one-hot representations and match query and documents with similarity measures like cosine similarity. As we stated in the introduction, the problem of this method is that the semantically similar query-document pairs without exact expression match cannot be identified.
18
+
19
+ In recent years, deep learning based retrieval models, such as DeepMatch (Lu and Li, 2013), PACRR (Huiet al., 2017), Delta (Mohanet al., 2018), Conv-KNRM (Daiet al., 2018), MASH RNN (Jiang et al., 2019), have dominated the document retrieval research. In particular, these models have been focusing on 1) flexible representation learning for query and documents and 2) measuring the similarity between query and documents at different levels. Correspondingly, there are two main categories of deep neural information retrieval (IR) models. One is the representation-focused model, which tries to learn good representations for both query and documents with deep neural networks, and then conducts matching between the learned representations. Examples include DSSM (Huanget al., 2013), C-DSSM (Gaoet al., 2014), ARC-I (Huet al., 2014), Delta (Mohanet al., 2018), MASH RNN (Jiang et al., 2019). The other is the interaction-focused model, which first builds local interactions (i.e., local matching signals) between the query and documents, and then uses deep neural networks to learn the overall matching score. Examples include DeepMatch (Lu and Li, 2013), ARC-II (Huet al., 2014), DRMM (Guoet al., 2016), ESR (Xionget al., 2017b), PACRR (Huiet al., 2017), Conv-KNRM (Daiet al., 2018) and SMASH RNN (Jiang et al., 2019).
20
+
21
+ These deep neural IR models can effectively exploit the underlying semantics for queries and documents, which can be good at matching similar but differently expressed words like ”cancer” and ”tumor”, ”diabetes” and ”hyperglycemia”. Therefore, take ”diabetes” as query the model might find articles with ”hyperglycemia”. But these model cannot find articles indirectly/implicitly related to ”diabetes” like the article with ”metformin” because it requires external knowledge (metformin, against, diabetes).Although prior research generally confirms that external knowledge has great value for document retrieval (Scells et al., 2017; Goodwin andHarabagiu, 2016; Xiong and Callan, 2015a), little research has been conducted to show the value of the external knowledge on deep neural IR models. There are studies trying to perform query expansion or leverage pre-trained embeddings of name entities using external knowledge bases. For example, Xiong and Callan (Xiong and Callan, 2015b) presented a simple and effective method to improve query expansion with Freebase. They proposed a supervised model to combine the information derived from Freebase descriptions and categories so that ‘effective terms can be selected for query expansion. In another paper, Xiong et al. (Xionget al., 2017b) proposed a ranking technique for matching query and documents, where a knowledge graph is leveraged to pre-train the embeddings of the named entities in both query and documents.
22
+
23
+ In this section, we present a graph-augmented representation learning approach for documents and biomedical concepts through the Document-Concept Graph (DCG). There are two types of nodes in a DCG: the biomedical concepts and documents. There are also two types of edges in the graph. One links concepts and documents according to their co-occurrence relationships. The other links pairwise concepts if any semantic relationship can be identified between them in a specific knowledge base.With the DCG representation, the global topics of the documents are effectively encoded through the document-concept relationships. Moreover, such topics can further be enhanced with external knowledge sources through the transitions on the graph.In this paper, we denote scalars by lowercase letters, such as x𝑥x; vectors by boldface lowercase letters, such as 𝐱𝐱\mathbf{x}; and matrices by boldface uppercase letters, such as 𝐗𝐗\mathbf{X}. Table 1 lists the symbols and their descriptions that are used throughout this paper.
24
+
25
+ More formally, a DCG G𝐺G consists of two types of nodes, the document nodes {di}subscript𝑑𝑖\{d_{i}\} and the biomedical concept nodes {cj}subscript𝑐𝑗\{c_{j}\}. A document disubscript𝑑𝑖d_{i} is composed of a sequence of k𝑘k words (x1(i),x2(i),…,xk(i))superscriptsubscript𝑥1𝑖superscriptsubscript𝑥2𝑖…superscriptsubscript𝑥𝑘𝑖(x_{1}^{(i)},x_{2}^{(i)},...,x_{k}^{(i)}) and contains n𝑛n medical concepts (c1(i),c2(i),…,cn(i))superscriptsubscript𝑐1𝑖superscriptsubscript𝑐2𝑖…superscriptsubscript𝑐𝑛𝑖(c_{1}^{(i)},c_{2}^{(i)},...,c_{n}^{(i)}). A specific biomedical concept cjsubscript𝑐𝑗c_{j} can be composed of a single word or multiple words, which corresponds to a medical named entity or a key topic in medical domain. We link a concept node cjsubscript𝑐𝑗c_{j} to a document node disubscript𝑑𝑖d_{i} if this document contains the concept cjsubscript𝑐𝑗c_{j}. We link two concept nodes cusubscript𝑐𝑢c_{u} and cvsubscript𝑐𝑣c_{v} if there exists any relations between them in external knowledge bases. Given the document-concept graph G𝐺G, our objective is to learn the representation for each document node.
26
+
27
+ Figure 2 illustrates an example of DCG. The construction of a DCG consists of four steps: 1) tokenization; 2) word embedding; 3) medical concept extraction; 4) edge construction.
28
+
29
+ Tokenization. Given a biomedical article, tokenization is necessary to convert the texts into space-separated sequences of words (words may include punctuation or be followed by punctuation). In our work, the Stanford CoreNLP (Manning et al., 2014) is leveraged to conduct tokenization on documents.
30
+
31
+ Word Embedding. After tokenization, unsupervised word representation learning models like Glove (Penningtonet al., 2014) and Word2Vec (Mikolov et al., 2013) are implemented on all documents to get semantic representation for each word which would be useful in later parts.
32
+
33
+ Medical Concept Extraction. Since each document might contain multiple medical concepts corresponding to different types of biomedical named entities, such as genes, diseases, chemicals, mutations, etc., which can be detected through medical named recognition and normalization methods and tools (Wei et al., 2013; Zhaoet al., 2019).
34
+
35
+ Edge Construction. Given all detected medical concepts in documents, we can construct the edges in a DCG. It is straightforward to link the document and concept nodes by just checking whether the concept is included in the document as the same way in (Zhao et al., 2017). For the edges linking concept nodes, we extract them from external knowledge bases as in (Zhuet al., 2018).
36
+
37
+ Given the DCG G𝐺G, our next step is to learn effective representations for documents, which is a so crucial factor for the performance of our system. In particular, we propose to learn such representation through a graph (DCG) augmented recurrent neural network (RNN) model, which is shown in Figure 3. This type of Graph-LSTM framework has been applied in information extraction tasks (Qianet al., 2018; Songet al., 2018).Our model has three components:•Encoder, which generates context-aware hidden representations for each biomedical document with a recurrent neural network;•Graph Module, which is essentially the DCG capturing the relationships among the documents and biomedical concepts as we introduced in the last subsection.•Decoder, which exploits the contextual information generated by the encoder and the graph to predict key topics of the documents. Our goal is to predict the title for the abstract of each biomedical article.
38
+
39
+ We first use an encoder to generate document representations. Given a document disubscript𝑑𝑖d_{i} with word sequence (x1(i),x2(i),…,xk(i))superscriptsubscript𝑥1𝑖superscriptsubscript𝑥2𝑖…superscriptsubscript𝑥𝑘𝑖(x_{1}^{(i)},x_{2}^{(i)},...,x_{k}^{(i)}) of length k𝑘k, each word xk(i)superscriptsubscript𝑥𝑘𝑖x_{k}^{(i)} is represented by a vector 𝐱𝐤(𝐢)superscriptsubscript𝐱𝐤𝐢\mathbf{x_{k}^{(i)}}, which is obtained from some pre-trained word embedding. We encode the document with a recurrent neural network defined as(1)𝐡1:k(i)=RNN​(𝐱1:k(i);𝟎;Θenc)superscriptsubscript𝐡:1𝑘𝑖RNNsuperscriptsubscript𝐱:1𝑘𝑖0subscriptΘenc\mathbf{h}_{1:k}^{(i)}=\text{RNN}(\mathbf{x}_{1:k}^{(i)};\mathbf{0};\Theta_{\text{enc}})where 𝐱1:k(i)superscriptsubscript𝐱:1𝑘𝑖\mathbf{x}_{1:k}^{(i)} represents the input word sequence (x1(i),x2(i),…,xk(i))superscriptsubscript𝑥1𝑖superscriptsubscript𝑥2𝑖…superscriptsubscript𝑥𝑘𝑖(x_{1}^{(i)},x_{2}^{(i)},...,x_{k}^{(i)}), 𝐡1:k(i)superscriptsubscript𝐡:1𝑘𝑖\mathbf{h}_{1:k}^{(i)} denotes the hidden states [𝐡1(i),𝐡2(i),…,𝐡k(i)]superscriptsubscript𝐡1𝑖superscriptsubscript𝐡2𝑖…superscriptsubscript𝐡𝑘𝑖[\mathbf{h}_{1}^{(i)},\mathbf{h}_{2}^{(i)},...,\mathbf{h}_{k}^{(i)}]. 𝟎0\mathbf{0} denotes an all-zero vector. ΘencsubscriptΘenc\Theta_{\text{enc}} denotes parameters of the encoder. We implement the RNN as a bi-directional LSTM (Hochreiter andSchmidhuber, 1997) to encode each document.
40
+
41
+ We construct the textual representation for document disubscript𝑑𝑖d_{i} by averaging the hidden states of its words, i.e. Enc​(di)=1k​(∑t=1k𝐡t(i))Encsubscript𝑑𝑖1𝑘superscriptsubscript𝑡1𝑘superscriptsubscript𝐡𝑡𝑖\text{Enc}(d_{i})=\frac{1}{k}(\sum_{t=1}^{k}\mathbf{h}_{t}^{(i)}). These learned representations are then fed into the DCG as the initial representation of the document nodes. The final document representation will be the combination of the textual representation and the structural representation induced from the DCG. In the following, we introduce how such structural representations are learned.
42
+
43
+ The graph module is designed to get the structural representations for document nodes via message passing in the DCG G𝐺G.Specifically, we adopt a restricted graph convolutional network (GCN) to achieve this goal.
44
+
45
+ Given the DCG G=(V,E)𝐺𝑉𝐸G=(V,E), where for a document node vdisubscript𝑣subscript𝑑𝑖v_{d_{i}} (representing document disubscript𝑑𝑖d_{i}), it has the encoding Enc​(di)Encsubscript𝑑𝑖\text{Enc}(d_{i}) capturing its textual information. For a concept node vcjsubscript𝑣subscript𝑐𝑗v_{c_{j}} (representing biomedical concept cjsubscript𝑐𝑗c_{j}), it has a pre-trained word embedding representation. The graph module enhances such representation with the graph structure in DCG. More concretely, it operates on local neighborhoods in the graph to integrate medical concepts information to document nodes.This means that we want the information flow from concept nodes to document nodes and the information flow between concept nodes, but we do not want the concept node to be influenced by the information from document nodes since we assume the semantic of a medical concept is much more concrete and stable than the document.
46
+
47
+ Precisely, at each layer of the GCN, each document node gets information from its neighboring concept nodes, i.e.,(2)𝐠di(l+1)=δ​(∑m∈ℳiα​fm​(𝐠di(l),𝐠cj(l)))superscriptsubscript𝐠subscript𝑑𝑖𝑙1𝛿subscript𝑚subscriptℳ𝑖𝛼subscript𝑓𝑚superscriptsubscript𝐠subscript𝑑𝑖𝑙superscriptsubscript𝐠subscript𝑐𝑗𝑙\mathbf{g}_{d_{i}}^{(l+1)}=\delta\left(\sum_{m\in\mathcal{M}_{i}}\alpha f_{m}(\mathbf{g}_{d_{i}}^{(l)},\mathbf{g}_{c_{j}}^{(l)})\right)where 𝐠di(l)∈ℝd(l)superscriptsubscript𝐠subscript𝑑𝑖𝑙superscriptℝsuperscript𝑑𝑙\mathbf{g}_{d_{i}}^{(l)}\in\mathbb{R}^{d^{(l)}} is the hidden state of document node vdisubscript𝑣subscript𝑑𝑖v_{d_{i}} in the l𝑙l-th layer of the neural network, with d(l)superscript𝑑𝑙d^{(l)} being the dimensionality of this layer’s representation. Incoming messages from fmsubscript𝑓𝑚f_{m} are accumulated and passed through an element-wise activation function δ(.)\delta(.), such as ReLU. ℳisubscriptℳ𝑖\mathcal{M}_{i} denotes the set of incoming messages for document node vdisubscript𝑣subscript𝑑𝑖{v}_{d_{i}}. fm(.,.)f_{m}(.,.) is typically chosen to be a (message-specific) neural network-like function or simply a linear transformation fm​(𝐠di(l),𝐠cj(l))=𝐖d​𝐠cjsubscript𝑓𝑚superscriptsubscript𝐠subscript𝑑𝑖𝑙superscriptsubscript𝐠subscript𝑐𝑗𝑙subscript𝐖𝑑subscript𝐠subscript𝑐𝑗f_{m}(\mathbf{g}_{d_{i}}^{(l)},\mathbf{g}_{c_{j}}^{(l)})=\mathbf{W}_{d}\mathbf{g}_{c_{j}} with a weight matrix 𝐖dsubscript𝐖𝑑\mathbf{W}_{d}. α𝛼\alpha is a reward factor. The neighboring biomedical concepts of an article may differ in their importance. Therefore, it is reasonable to assign different weights to those medical concepts in sending message to their central document node. For those neighboring concept nodes which do not match any related queries, we set α=1𝛼1\alpha=1. For those neighboring concept nodes which match related queries, we set α>1𝛼1\alpha>1.
48
+
49
+ At each layer of the GCN, each concept node get information from its neighboring concept nodes, i.e.,(3)𝐠ci(l+1)=δ​(∑n∈𝒩ifn​(𝐠ci(l),𝐠cj(l)))superscriptsubscript𝐠subscript𝑐𝑖𝑙1𝛿subscript𝑛subscript𝒩𝑖subscript𝑓𝑛superscriptsubscript𝐠subscript𝑐𝑖𝑙superscriptsubscript𝐠subscript𝑐𝑗𝑙\mathbf{g}_{c_{i}}^{(l+1)}=\delta\left(\sum_{n\in\mathcal{N}_{i}}f_{n}(\mathbf{g}_{c_{i}}^{(l)},\mathbf{g}_{c_{j}}^{(l)})\right)where 𝐠ci(l)∈ℝd(l)superscriptsubscript𝐠subscript𝑐𝑖𝑙superscriptℝsuperscript𝑑𝑙\mathbf{g}_{c_{i}}^{(l)}\in\mathbb{R}^{d^{(l)}} is the hidden state of concept node vcisubscript𝑣subscript𝑐𝑖v_{c_{i}} in the l𝑙l-th layer of the neural network, with d(l)superscript𝑑𝑙d^{(l)} being the dimensionality of this layer’s representation. Incoming messages of the form fnsubscript𝑓𝑛f_{n} are accumulated and passed through an element-wise activation function δ(.)\delta(.), such as ReLU. 𝒩isubscript𝒩𝑖\mathcal{N}_{i} denotes the set of incoming messages for concept node vcisubscript𝑣subscript𝑐𝑖{v}_{c_{i}}. fn(.,.)f_{n}(.,.) is typically chosen to be a (message-specific) neural network-like function or simply a linear transformation fn​(𝐠ci(l),𝐠cj(l))=𝐖c​𝐠cjsubscript𝑓𝑛superscriptsubscript𝐠subscript𝑐𝑖𝑙superscriptsubscript𝐠subscript𝑐𝑗𝑙subscript𝐖𝑐subscript𝐠subscript𝑐𝑗f_{n}(\mathbf{g}_{c_{i}}^{(l)},\mathbf{g}_{c_{j}}^{(l)})=\mathbf{W}_{c}\mathbf{g}_{c_{j}} with a weight matrix 𝐖csubscript𝐖𝑐\mathbf{W}_{c}.
50
+
51
+ In each layer of the GCN, information is only propagated through neighboring nodes that are directly connected. Thus we can stack more GCN layers to get a larger node receptive field, i.e. each node can get information from more distant neighbors through transitivity on the graph. After L𝐿L layers, for each document node vdisubscript𝑣subscript𝑑𝑖v_{d_{i}} we obtain its structural representation GCN​(di)=𝐠di(L)GCNsubscript𝑑𝑖superscriptsubscript𝐠subscript𝑑𝑖𝐿\text{GCN}(d_{i})=\mathbf{g}_{d_{i}}^{(L)}. Such representation will be combined with its corresponding textual representation Enc​(di)Encsubscript𝑑𝑖\text{Enc}(d_{i}) to form the final representation of each document, i.e.(4)𝐯di=fl​(Enc​(di)∘GCN​(di))subscript𝐯subscript𝑑𝑖subscript𝑓𝑙Encsubscript𝑑𝑖GCNsubscript𝑑𝑖\mathbf{v}_{d_{i}}=f_{l}(\text{Enc}(d_{i})\circ\text{GCN}(d_{i}))where flsubscript𝑓𝑙f_{l} is a linear transformation and ∘\circ is the concatenation operator. In this way the representation captured both the local textual information (induced from the encoder) and the global topic information (learned from the GCN) of each document.
52
+
53
+ To make sure document representations can encode relevant local and non-local concepts, we design a decoder to see if key relevant information can be reproduced. The decoder takes as input the representation of each document 𝐯disubscript𝐯subscript𝑑𝑖\mathbf{v}_{d_{i}} and generates a title for the document.In particular, given the document representation 𝐯disubscript𝐯subscript𝑑𝑖\mathbf{v}_{d_{i}}, we apply a recurrent neural network to generate a word or a medical concept once a time from a controlled vocabulary including words and medical entities. The decoder is defined as(5)w1:L(i)=RNN​(𝐡1:L(i),𝐯di,Θdec)superscriptsubscript𝑤:1𝐿𝑖RNNsuperscriptsubscript𝐡:1𝐿𝑖subscript𝐯subscript𝑑𝑖subscriptΘdecw_{1:L}^{(i)}=\text{RNN}(\mathbf{h}_{1:L}^{(i)},\mathbf{v}_{d_{i}},\Theta_{\text{dec}})w1:L(i)superscriptsubscript𝑤:1𝐿𝑖w_{1:L}^{(i)} represents the generated word/entity sequence, L𝐿L is the set max length of generated sequence. The process would stop early when ‘EOS’ (end-of-sequence) is generated, 𝐡1:L(i)=[𝐡1(i),𝐡2(i),…,𝐡L(i)]superscriptsubscript𝐡:1𝐿𝑖superscriptsubscript𝐡1𝑖superscriptsubscript𝐡2𝑖…superscriptsubscript𝐡𝐿𝑖\mathbf{h}_{1:L}^{(i)}=[\mathbf{h}_{1}^{(i)},\mathbf{h}_{2}^{(i)},...,\mathbf{h}_{L}^{(i)}] denotes the hidden states. 𝐯disubscript𝐯subscript𝑑𝑖\mathbf{v}_{d_{i}} serves as the initialization for each state, ΘdecsubscriptΘdec\Theta_{\text{dec}} denotes parameters of the decoder. We implement the RNN as a bi-directional LSTM to generate word/entity sequence.
54
+
55
+ In this way, we can construct the loss to optimize over the model parameters using the sequence cross-entropy loss shown as follows(6)ℒgraph=−1I​L​∑i=1I∑l=1Llog⁡p​(wl|di,w<l;Θ)subscriptℒgraph1𝐼𝐿superscriptsubscript𝑖1𝐼superscriptsubscript𝑙1𝐿𝑝conditionalsubscript𝑤𝑙subscript𝑑𝑖subscript𝑤absent𝑙Θ\mathcal{L}_{\text{graph}}=-\frac{1}{IL}\sum_{i=1}^{I}\sum_{l=1}^{L}\log p(w_{l}|d_{i},w_{<l};\Theta)where I𝐼I is the number of documents, L𝐿L is the max length of generated sequence of word/entity, ΘΘ\Theta represents all parameters involved in encoder, graph module, and decoder.
56
+
57
+ In this section, we propose a learning-to-rank model to identify relevant biomedical articles for a given query (e.g., patient with genetic information in terms of treatment, prevention, and prognosis of the disease) with the document representation vector learned. First, we discuss how to effectively represent a query.
58
+
59
+ Each query contains information including the patient’s disease name, the relevant genetic variants (which genes), basic demographic information (age, sex), etc.It is very common that the same disease and variant have different expressions. For example ‘leucocythemia’ and ‘leukemia’ are the same disease but expressed in different ways. Disease names are frequently expressed using abbreviations in literature. Different institutions may name the same genetic variants in different ways. All these aspects make it challenging to match the query to relevant biomedical articles. Therefore, it is necessary to expand queries to incorporate these different expressions.
60
+
61
+ To get the flexible representation of the query, we propose to utilize a variety of knowledge bases in Table 2 to carefully expand gene, variant, and disease terms.
62
+
63
+ Since the query is given as structured patient information including disease, variant, and demographic, it is crucial to combine them together and represent as a vector.We exploit convolutional neural network (CNN) to convolve structured items and obtain the vector representation of the query. Note that this part shares the same pre-trained word embedding vocabulary as is used in the document representation learning part. The CNN model is shown in Figure 4.
64
+
65
+ For the query of MeSH terms, we expand each term via knowledge bases in Table 2 and apply CNN to convolve each Mesh term and its expansion so as to share the same CNN model with clinical topics.
66
+
67
+ For each (pk,D)subscript𝑝𝑘𝐷(p_{k},D) pair, where D𝐷D is a ranking list (d1,d2,d3,…​…)superscript𝑑1superscript𝑑2superscript𝑑3……(d^{1},d^{2},d^{3},......) of biomedical articles with the superscript indicating the ranking order of the document and pksubscript𝑝𝑘p_{k} is the k𝑘k-th query, we define a relevant scoring function f​(pk,di)𝑓subscript𝑝𝑘superscript𝑑𝑖f(p_{k},d^{i}) as(7)f​(pk,di)=‖𝐖×𝐯pk−𝐯di‖2𝑓subscript𝑝𝑘subscript𝑑𝑖subscriptnorm𝐖subscript𝐯subscript𝑝𝑘subscript𝐯subscript𝑑𝑖2f(p_{k},d_{i})=\left\|\mathbf{W}\times\mathbf{v}_{p_{k}}-\mathbf{v}_{d_{i}}\right\|_{2}where we use an ℓ1subscriptℓ1\ell_{1} norm in the latent space, but other metrics could be used as well, 𝐯disubscript𝐯subscript𝑑𝑖\mathbf{v}_{d_{i}} is the vector representation obtained from document representation learning and 𝐯pksubscript𝐯subscript𝑝𝑘\mathbf{v}_{p_{k}} is the vector representation obtained from patient representation learning, 𝐖𝐖\mathbf{W} is linear transformation matrix. The scoring function evaluates the relevance between pksubscript𝑝𝑘p_{k} and disuperscript𝑑𝑖d^{i}, smaller value indicates higher relevance between pksubscript𝑝𝑘p_{k} and disuperscript𝑑𝑖d^{i} . Therefore, we can generate the following pairs of partial order from the sample (pk,D)subscript𝑝𝑘𝐷(p_{k},D):(8)f​(pk,d1)<f​(pk,d2);f​(pk,d1)<f​(pk,d3);f​(pk,d2)<f​(pk,d3);…​…formulae-sequence𝑓subscript𝑝𝑘superscript𝑑1𝑓subscript𝑝𝑘superscript𝑑2formulae-sequence𝑓subscript𝑝𝑘superscript𝑑1𝑓subscript𝑝𝑘superscript𝑑3𝑓subscript𝑝𝑘superscript𝑑2𝑓subscript𝑝𝑘superscript𝑑3……\begin{split}&f(p_{k},d^{1})<f(p_{k},d^{2});\\&f(p_{k},d^{1})<f(p_{k},d^{3});\\&f(p_{k},d^{2})<f(p_{k},d^{3});\\&......\\\end{split}With these pairs, we can define the loss of pairwise learning to rank as follows(9)ℒrank=1K​I​J​∑k=1K∑i=1I∑j>iJm​a​x​(0,f​(pk,dpki)−f​(pk,dpkj))subscriptℒrank1𝐾𝐼𝐽superscriptsubscript𝑘1𝐾superscriptsubscript𝑖1𝐼superscriptsubscript𝑗𝑖𝐽𝑚𝑎𝑥0𝑓subscript𝑝𝑘superscriptsubscript𝑑subscript𝑝𝑘𝑖𝑓subscript𝑝𝑘superscriptsubscript𝑑subscript𝑝𝑘𝑗\mathcal{L}_{\text{rank}}=\frac{1}{KIJ}\sum_{k=1}^{K}\sum_{i=1}^{I}\sum_{j>i}^{J}max(0,f(p_{k},d_{p_{k}}^{i})-f(p_{k},d_{p_{k}}^{j}))This is a margin loss to make sure the score of dpkisuperscriptsubscript𝑑subscript𝑝𝑘𝑖d_{p_{k}}^{i} is smaller than dpkjsuperscriptsubscript𝑑subscript𝑝𝑘𝑗d_{p_{k}}^{j} when j>i𝑗𝑖j>i, where dpkisuperscriptsubscript𝑑subscript𝑝𝑘𝑖d_{p_{k}}^{i} denotes the document is ranked as i𝑖i-th for the query pksubscript𝑝𝑘p_{k}. Our object is to minimize total loss on all training data. For a new query, the biomedical articles would be ranked according to the value of scoring function. The ranking model is trained to give more relevant documents a smaller score by tuning its parameters to minimize the pairwise maximum margin loss.
68
+
69
+ Therefore, the total loss of the entire ranking framework GRAPHENE is defined as(10)ℒ=β​ℒgraph+γ​ℒrankℒ𝛽subscriptℒgraph𝛾subscriptℒrank\mathcal{L}=\beta\mathcal{L}_{\text{graph}}+\gamma\mathcal{L}_{\text{rank}}where β=0.5𝛽0.5\beta=0.5 and γ=0.5𝛾0.5\gamma=0.5 are hyper-parameters.The Adagrad stochastic gradient descent method is used to train the model with mini-batch mode.
70
+
71
+ This section describes the details of our empirical study on evaluating our proposed framework, including the ranking benchmark dataset, the experimental settings, and results.
72
+
73
+ We use the dataset from TREC Precision Medicine track (http://www.trec-cds.org/, 2017 and 2018) clinical scenarios and medical articles for empirical evaluation. We also exploited the MeSH222MeSH (Medical Subject Headings, https://www.nlm.nih.gov/mesh/meshhome.html) is the National Library of Medicine’s controlled vocabulary thesaurus. Each biomedical article is associated with a set of MeSH terms describing the content of the citation. terms of each biomedical article in the first dataset as query and take the corresponding article to be the unique relevant document to be retrieved.The TREC dataset comprises 80 clinical scenarios (called topics) with structured patient scenarios including information related to disease, genetic variants, demographics, and other relevant factors. The dataset was curated by precision oncologists from MD Anderson. Therefore, it included relevant information about cancer patients such that participant systems can retrieve pertinent biomedical articles. The biomedical article corpus is composed of approximately 26.8 million MEDLINE abstracts with titles and associated MeSH terms. It is supplemented with two additional sets of abstracts: (i) 37,007 abstracts from recent proceedings of the American Society of Clinical Oncology (ASCO), and (ii) 33,018 abstracts from recent proceedings of the American Association for Cancer Research (AACR). These additional datasets were added to increase the set of potentially relevant treatment information. One reason for this is because the fact that the latest research is often presented at conferences such as ASCO and AACR prior to submission to journals (thus these proceedings may represent a more up-to-date snapshot of scientific knowledge than MEDLINE).
74
+
75
+ For each clinical topic, there is a list of relevant biomedical articles with human-labeled relevance scores. Therefore, it is very convenient to generate a ranking list of articles for each topic. We take 50 clinical topics of TREC PM track 2018 as the training set and the left 30 clinical topics of TREC PM track 2017 as the testing set.Due to the limited number of clinical topics for training a deep neural IR model, we use the MeSH terms of each biomedical article as the corresponding query to pre-train deep neural models. In the pre-training stage, for each unique ⟨⟨\langleMeSH term, article⟩⟩\rangle pair, we randomly sample a different article to generate a controlled pair ⟨⟨\langleMeSH terms, unrelated article⟩⟩\rangle.
76
+
77
+ For each ⟨⟨\langleMeSH term, article⟩⟩\rangle pair, we can take the MeSH terms as query and search the corresponding article. Since the Mesh terms and article are one-one co-related. We can take the MeSH terms as another query set to conduct biomedical literature retrieval task. We split all pairs of ⟨⟨\langleMeSH, article⟩⟩\rangle and corresponding ⟨⟨\langleMeSH term, unrelated article⟩⟩\rangle into a training/validation/test set randomly, with the ratio of 8:1:1. The first part is for the training model, the second for hyper-parameter tuning, and the third for evaluation.Since there is only one matched article for a particular MeSH term query in most cases. Therefore, it is more reasonable to use Prec.1 and MRR instead of Prec.10 and NDCG.20 (which are explained in detail below) as the metrics to evaluate the performance on the query set of MeSH terms.
78
+
79
+ We introduce a set of metrics for evaluating the retrieval performance of the algorithms. All metrics have values in the range of [0, 1], with higher values for better rankings. When generating the ranked list, for documents with the same relevance scores, they will be ranked according to their IDs.
80
+
81
+ Discounted Cumulative Gain (DCG) (Järvelin and Kekäläinen, 2002) is a relevance and rank correlation metric that penalizes placement of relevant documents at lower ranks. The traditional formula of DCG accumulated at a particular rank position n𝑛n is defined as:(11)D​C​G​(n)=∑i=1nr​e​lilog2⁡(i+1)𝐷𝐶𝐺𝑛superscriptsubscript𝑖1𝑛𝑟𝑒subscript𝑙𝑖subscript2𝑖1DCG(n)=\sum_{i=1}^{n}\frac{rel_{i}}{\log_{2}(i+1)}Where r​e​li𝑟𝑒subscript𝑙𝑖rel_{i} is the graded relevance of the result at position i𝑖i. Normalized Discounted Cumulative Gain (NDCG) then measures the relativeDCG of a ranking compared to the best possible ranking for that data: N​D​C​G​(n)=D​C​G​(n)/I​D​C​G​(n)𝑁𝐷𝐶𝐺𝑛𝐷𝐶𝐺𝑛𝐼𝐷𝐶𝐺𝑛NDCG(n)=DCG(n)/IDCG(n), where I​D​C​G​(n)𝐼𝐷𝐶𝐺𝑛IDCG(n) is the D​C​G​(n)𝐷𝐶𝐺𝑛DCG(n)for the ideal ranking. When there are multiple queries, NDCG refers to the mean value across queries. We use the scaled relevance levels, and quote “NDCG.20” metrics for n=20𝑛20n=20.
82
+
83
+ Average Precision measures, for a single query, is the weighted sum of the precision observed in a ranked list up to each specific rank weighted by the actual relevance score of the corresponding document, averaged over the number of relevant documents for that query. It is thus a ranking measure that factors out the size of the ranked list and the number of relevant documents, without any rank-based penalization or discounting. The Mean Average Precision (MAP) is the mean of the Average Precision across queries in our test dataset. The Precision at rank n metrics (“Prec.n”) is the retrieval precision at rank n. The mean reciprocal rank (MRR) is the multiplicative inverse of the rank of the first correct answer.
84
+
85
+ In the experiments, we evaluate the performance of GRAPHENE in two query sets for retrieving biomedical articles, including (1) clinical topics, and (2) MeSH terms. Our RNN network is a 3-layer BiLSTM with pre-trained word embeddings. Hyperparameters of our 2-layer GCN are set by the same values reported in Kipf and Welling (Kipf and Welling, 2016). We follow the training procedure outlined in Section 4.2 with the word embeddings setup in Section 5.4. The best setting of the reward factor α𝛼\alpha for those matched concept nodes is 1.61.61.6. We use a dropout rate of 0.5 and train the model with Adagrad SGD with the initial learning rate of 0.001 and momentum of 0.9 for 50 epochs. For baseline deep neural models, we use the same setting reported in their corresponding papers.
86
+
87
+ We compared the performance of GRAPHENE with the following IR models as baselines.
88
+
89
+ BM25 (Robertson et al., 1995) is a bag-of-words retrieval model that ranks a set of documents based on the appearance of the query terms in each document, regardless of the intra-relationship between the query terms within a document (e.g., their relative proximity).
90
+
91
+ DLH13 (DFR) (Amati, 2006) is a probabilistic retrieval model based on vector matching. However, they replace the term frequencies in the bag-of-words model with the probabilities inferred from a fitted Poisson model.
92
+
93
+ DeepMatch (Lu and Li, 2013) is a deep learning architecture aiming at capturing the complicated matching relations between two objects from heterogeneous domains more effectively. DeepMatch is an interaction-focused model. It directly modeled the object-object interactions with a CNN-based architecture. In particular, it convolves on object-object interaction matrix and predicts if two objects are related.
94
+
95
+ Delta (Mohanet al., 2018) constructs a “modified” document matrix first by replacing the words in the documents by the closest words in the query. Convolutions will be performed on this matrix to obtain a final relevance score.
96
+
97
+ We initialized the word embedding matrix with three types of pre-trained word embeddings respectively.The first is Word2Vec 100 dimensional embeddings trained on all 27.5 million MEDLINE biomedical articles in our data. The second is GloVe 100 dimensional embeddings trained on the same entire 27.5 million MEDLINE biomedical articles. The third is the randomly initialized 100 dimensional embeddings which are uniformly sampled from range [−3d​i​m,+3d​i​m]3𝑑𝑖𝑚3𝑑𝑖𝑚[-\sqrt{\frac{3}{dim}},+\sqrt{\frac{3}{dim}}], where d​i​m𝑑𝑖𝑚dim is the dimension of embeddings (Heet al., 2015).
98
+
99
+ This section presents the performance results of different retrieval models over the two benchmark query sets. The overall summary of the results is displayed in Table 3.
100
+
101
+ From the table we can observe that•The deep neural IR models, Delta and DeepMatch, perform significantly better than the traditional retrieval models. This verifies the advantage of these deep neural models for retrieving relevant documents compared to retrieval models based on simple matching with one-hot representations.•The TREC PM track models are the top two results reported at TREC precision track 2017. Since these two models utilize many external knowledge bases, rules, and ensemble strategies, these top two TREC PM track models produce very good results.•Our GRAPHENE system achieves the best performance.
102
+
103
+ In order to test the necessity of the different components in GRAPHENE, we also implemented two variants. GRAPHENE(-graph) excludes the graph module in document representation learning part. GRAPHENE(-reward) ignores the reward part when the passing message from concept nodes to document nodes by assigning equal weights on all messages. From the results we can see that both variants perform worse than the original GRAPHENE, which indicates that all components in GRAPHENE are important and necessary.
104
+
105
+ Moreover, we can also observe that GRAPHENE performs the best on the query set of MeSH terms, which is a one-one matching problem, which means that given a set of MeSH terms only one biomedical article should be matched in most cases. This also demonstrates the potential of our model in precise searching problems such as question answering, email search, citation recommendation, etc.
106
+
107
+ We have also tested the effects of initialization with different strategies for pre-training the word embeddings described in Section 5.4. The results are shown in Table 4. From the table we can observe that•Models using pre-trained word embeddings achieve a significant improvement as opposed to the ones using random embeddings.•Models using GloVe embeddings outperforms using Word2Vec consistently for different neural models in different data sets.•DeepMatch and Delta rely more heavily on pre-trained word embeddings compared to our proposed GRAPHENE.The reason why pre-trained word embeddings affect less on our GRAPHENE is probably due to the encoder-decoder part of GRAPHENE to generate title can provide training of more customized word embeddings on large-scale abstract-to-title samples.
108
+
109
+ Moreover, we also investigated the importance of pre-training via the query set of MeSH terms for biomedical literature retrieval. We have performed experiments without pre-training on ‘MeSH terms’ and directly trained the model on 50 clinical topics. According to the results in Table 5, deep neural IR models without pre-training using MeSH terms query set drop sharply on the performance of biomedical literature retrieval. Compared to DeepMatch, the performance of Delta and our proposed GRAPHENE have a greater dependency on the pre-training with large-scale data.
110
+
111
+ Figure 5 shows the overall scores of our model for biomedical literature retrieval across all 30 clinical topics as compared to Delta and DeepMatch. From the figures we can see that GRAPHENE performs consistently better than the baseline models for nearly all the topics across all evaluation measures on the query set of clinical topics. Delta outperforms GRAPHENE in 4 clinical topics and DeepMatch outperforms Delta in 3 clinical topics. Here, it is worth to mention that the first and second sub-figures in Figure 5 show the evaluation on top n documents and the third sub-figure in Figure 5 shows the evaluation on all related documents, and the evaluation on top n results is much more stable than the evaluation on all related documents.
112
+
113
+ The last question we investigated is whether the size of pre-training query set of MeSH terms would affect the final performance. As shown in Figure 6, we check the performance of deep neural IR models on biomedical literature retrieval of clinical topics by incrementally augmenting pre-training data. The results indicate clearly that the size of pre-training data plays a key role in all three deep neural IR models, and it is more critical to GRAPHENE and Delta, both of which are representation-focused models rely more heavily on large scale of pre-training data. This is consistent with the results of previous work (Xionget al., 2017a).
114
+
115
+ Case Study:Last but not the least, we performed a case study to better understand the power of GRAPHENE. Table 6 shows an example of retrieved relevant documents that are placed at rank 1 by GRAPHENE, DeepMatch and Delta, with respect to a specific query. We highlight the biomedical concepts which are contained in query in blue bold text and the relevant medical concepts with entity in query blue italic text. From the results we can see that in the document retrieved by GRAPHENE, there are matched disease name “pancreatic cancer”, matched gene variant “CDK6” and the relevant medical concept “arsenic trioxide” (treatment of the pancreatic cancer), while only the disease name “pancreatic cancer” appears in the most relevant document identified by Delta and DeepMatch. This demonstrates the strong potential of GRAPHENE on identification of semantic similar items despite the different exact term expressions.
116
+
117
+ In this paper, we proposed a deep neural biomedical literature retrieval framework GRAPHENE which consists of graph-augmented document representation learning, query expansion, and representation learning, and learning to rank biomedical articles. The graph-augmented document representation learning is applied upon a document-concept graph which contains biomedical concept nodes and document nodes so that global biomedical concept co-occurrence can be explicitly modeled and graph convolution can be easily adapted. Query representation learning exploits a CNN-based model to convolve structured items of patients and output the vector representation for each query. A learning-to-rank algorithm is proposed to use partial order between biomedical articles with the given patient and learn the rank of relevant articles. Experimental results on TREC Precision Medicine track data provided compelling evidence to support that our model can effectively retrieve most relevant biomedical articles for a given query. The results also demonstrated that our GRAPHENE improves previous deep neural retrieval models which represent the document with textual information only, suggesting the necessity of encoding graph-based external knowledge bases into document representation.
118
+
119
+ Since the great success of pre-trained BERT model in modeling long text for many NLP tasks recently (Devlinet al., 2018; Beltagyet al., 2019), we want to integrate it into our present GRAPHENE to replace the RNN-based encoder-decoder module in our future work. Additionally, we also want to leverage advantages from both representation-focused models and interaction-focused models for our future work as they have respective advantages.
120
+
121
+ This work is supported by NSF 1716432 and 1750326.
1911.00811v1.txt ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Evaluations of deep learning approaches to semantics generally rely oncorpora of naturalistic examples, with quantitative metrics serving asa proxy for the underlying capacity of the models to learn richmeaning representations and find generalized solutions. From thisperspective, when a model achieves human-level performance on a taskaccording to a chosen metric, one might be tempted to say that thetask is “solved”. However, recent adversarial testing methods, inwhich models are evaluated on new examples with known semanticproperties, have begun to reveal that even these state-of-the-artmodels often rely on brittle, local solutions that fail to generalizeeven to examples that are similar to those they saw in training. Thesefindings indicate that we need a broad and deep range of evaluationmethods to fully characterize the capacities of our models.
2
+
3
+ However, for any evaluation method, we should askwhether it is fair. Has the model been shown data sufficient tosupport the kind of generalization we are asking of it? Unless we cansay “yes” with complete certainty, we can’t be sure whether a failedevaluation traces to a model limitation or a data limitation that nomodel could overcome.
4
+
5
+ In this paper, we seek to address this issue by defining a formalnotion of fairness for these evaluations. The definition is quitegeneral and can be used to create fair evaluations for a wide range oftasks. We apply it to Natural Language Inference (NLI) by constructingvery challenging but provably fair artificial datasets111 https://github.com/atticusg/MultiplyQuantifiedData. We evaluate anumber of different standard architectures (variants of LSTM sequencemodels with attention and tree-structured neural networks) as well asNLI-specific tree-structured neural networks that process alignedexamples. Our central finding is that only task-specific models areable to achieve high performance, and even these models do not solvethe task perfectly, calling into question the viability of the standardmodels for semantics.
6
+
7
+ There is a growing literature that uses targeted generalization tasks toprobe the capacity of learning models. We seek to build on this workby developing a formal framework in which one can ask whether one ofthese tasks is even possible.
8
+
9
+ In adversarial testing, training examples are systematically perturbedand then used for testing. In computer vision, it is common toadversarially train on artificially noisy examples to create a morerobust model (Goodfellow et al., 2015; Szegedy et al., 2014). However, in thecase of question answering, Jia and Liang (2017) show that training on oneperturbation does not result in generalization to similarperturbations, revealing a need for models with strongergeneralization capabilities. Similarly, adversarial testing has shownthat strong models for the SNLI dataset (Bowman et al., 2015a) havesignificant holes in their knowledge of lexical and compositionalsemantics (Glockner et al., 2018; Naik et al., 2018; Nie et al., 2018; Yanaka et al., 2019; Dasgupta et al., 2018). In addition, anumber of recent papers suggest that even top models exploit datasetartifacts to achieve good quantitative results(Poliak et al., 2018; Gururangan et al., 2018; Tsuchiya, 2018), which furtheremphasizes the need to go beyond naturalistic evaluations.
10
+
11
+ Artificially generated datasets have also been used extensively togain analytic insights into what models are learning. These methodshave the advantage that the complexity of individual examples can beprecisely characterized without reference to the models beingevaluated. Evans et al. (2018) assess the ability of neural models tolearn propositional logic entailment. Bowman et al. (2015b) conductsimilar experiments using natural logic, and Veldhoen and Zuidema (2018) analyze models trained on those same tasks,arguing that they fail to discover the kind of global solution wewould expect if they had truly learned natural logic. Lake and Baroni (2017)apply similar methods to instruction following with an artificiallanguage describing a simple domain.
12
+
13
+ These methods can provide powerful insights, but the issue of fairnesslooms large. For instance, Bowman (2013) poses generalizationtasks in which entire reasoning patterns are held out for testing.Similarly, Veldhoen and Zuidema (2018) assess a model’s ability to recognizeDe Morgan’s laws without any exposure to this reasoning in training.These extremely difficult tasks break from standard evaluations in anattempt to expose model limitations. However, thesetasks are not fair by our standards; brief formal argumentsfor these claims are given in Appendix A.
14
+
15
+ Many problems can be solved by recursively composing intermediate representations with functions along a tree structure. In the case of arithmetic, the intermediate representations are numbers and the functions are operators such a plus or minus. In the case of evaluating the truth of propositional logic sentences, the intermediate representation are truth values and the functions are logical operators such as disjunction, negation, or the material conditional. We will soon see that, in the case of NLI, the intermediate representations are semantic relations between phrases and the functions are semantic operators such as quantifiers or negation. When tasked with learning some compositional problem, we intuitively would expect to be shown how every function operates on every intermediate value. Otherwise, some functions would be underdetermined. We now formalize the idea of recursive tree-structured composition and this intuitive notion of fairness.
16
+
17
+ We first define composition trees (Section 3.1) andshow how these naturally determine baseline learning models(Section 3.2). These models implicitlydefine a property of fairness: a train/test split is fair if thebaseline model learns the task perfectly(Section 3.3). This enables us to create provablyfair NLI tasks in Section 4.
18
+
19
+ A composition tree describes how to recursively compose elements froman input space up a tree structure to produce an element in an outputspace. Our baseline learning model will construct a composition treeusing training data.
20
+
21
+ A composition tree C=(T,Dom,Func)𝐶𝑇DomFuncC=(T,\emph{Dom},\emph{Func}) realizes a functionF:ℐC→𝒪C:𝐹→subscriptℐ𝐶subscript𝒪𝐶F:\mathcal{I}_{C}\to\mathcal{O}_{C} in the following way: For anyinput x∈ℐC𝑥subscriptℐ𝐶x\in\mathcal{I}_{C}, this function is given byF​(x)=compose​(C,r,x)𝐹𝑥compose𝐶𝑟𝑥F(x)=\texttt{compose}(C,r,x), where r𝑟r is the root node of T𝑇Tand compose is defined recursively inAlgorithm 1. For a given x∈ℐC𝑥subscriptℐ𝐶x\in\mathcal{I}_{C} anda∈Nnon-leafT𝑎subscriptsuperscript𝑁𝑇non-leafa\in N^{T}_{\text{non-leaf}} with children c1,…,cmsubscript𝑐1…subscript𝑐𝑚c_{1},\dots,c_{m}, we say that theelement of Dom​(c1)×⋯×Dom​(cm)Domsubscript𝑐1⋯Domsubscript𝑐𝑚\emph{Dom}(c_{1})\times\dots\times\emph{Dom}(c_{m}) that is input toFunc​(a)Func𝑎\emph{Func}(a) during the computation of F​(x)=compose​(C,r,x)𝐹𝑥compose𝐶𝑟𝑥F(x)=\texttt{compose}(C,r,x)is the input realized at Func​(a)Func𝑎\emph{Func}(a) on x𝑥x and the element ofDom​(a)Dom𝑎\emph{Dom}(a) that is output by Func​(a)Func𝑎\emph{Func}(a) is the output realized atFunc​(a)Func𝑎\emph{Func}(a) on x𝑥x.At a high level, compose​(C,a,x)compose𝐶𝑎𝑥\texttt{compose}(C,a,x) finds the output realizedat a node a𝑎a by computing node a𝑎a’s function Func​(a)Func𝑎\emph{Func}(a) with theoutputs realized at node a𝑎a’s children as inputs. This recursionbottoms out when the components of x𝑥x are provided as the outputsrealized at leaf nodes.
22
+
23
+ Algorithm 2 is our baseline learning model. It learns afunction by constructing a composition tree. This is equivalent tolearning the function that tree realizes, as once the composition treeis created, Algorithm 1 computes the realizedfunction. Because this model constructs a composition tree, it has aninductive bias to recursively compute intermediate representations upa tree structure. At a high level, it constructs a full compositiontree when provided with the tree structure and training data thatprovides a label at every node in the tree by looping through trainingdata inputs and memorizing the output realized at each intermediatefunction for a given input. As such, any learning model we compare tothis baseline model should be provided with the outputs realized at everynode during training.
24
+
25
+ We define a training dataset to be fair with respect to some functionF𝐹F if our baseline model perfectly learns the function F𝐹F from thattraining data.The guiding idea behind fairness is that the training data must exposeevery intermediate function of a composition tree to every possibleintermediate input, allowing the baseline model to learn a globalsolution:
26
+
27
+ Not all fair datasets are challenging. For example, a scenarioin which one trains and tests on the entire space of exampleswill be fair. Therole of fairness is to ensure that, when we separately define achallenging task, it is guaranteed to be possible. We noted inSection 2 that some challenging problems in theliterature fail to meet this minimal requirement.
28
+
29
+ As a simple illustration of the above concepts, we consider thetask of evaluating the truth of a sentence from propositionallogic. We use the standard logical operators material conditional,⇒⇒\Rightarrow, and negation, ¬\lnot, aswell as the unary operator ε𝜀\varepsilon, which we define to be theidentity function on {T,F}TF\{\text{T},\text{F}\}. We consider a small set of eight propositional sentences, all which can be seen in Table 1. We illustrate acomposition tree that realizes a function performing truthevaluation on these sentences in Figure 1, where a leaf nodel𝑙l is labeled with its domain Dom​(l)Dom𝑙\emph{Dom}(l) and a non-leaf node a𝑎a islabeled with Func​(a)→Dom​(a)→Func𝑎Dom𝑎\emph{Func}(a)\to\emph{Dom}(a).
30
+
31
+ A dataset for this problem is fair if and only if it has two specificproperties. First, the binary operator ⇒���\Rightarrow must be exposed toall four inputs in {T,F}×{T,F}TFTF\{\text{T},\text{F}\}\times\{\text{T},\text{F}\} during training.Second, the unary operators ¬\lnot and ε𝜀\varepsilon each must be exposedto both inputs in {T,F}TF\{\text{T},\text{F}\}. Jointly, these constraintsensure that a model will see all the possibilities for how ourlogical operators interact with their truth-value arguments. If eitherconstraint is not met, then there is ambiguity about which operators the modelis tasked with learning. An example fair train/test split is given inTable 1.
32
+
33
+ Crucial to our ability to create a fair training dataset using onlyfour of the eight sentences is that ⇒⇒\Rightarrow operates onthe intermediate representation of a truth value, abstracting awayfrom the specific identity of its sentence arguments. Because thereare two ways to realize T and F at the intermediate node, we canefficiently use only half of our sentences to satisfyour fairness property.
34
+
35
+ Our central empirical question is whether current neural models can learn todo robust natural language inference if given fair datasets. We now presenta method for addressing this question. To do this, we need to move beyondthe simple propositional logic example explored above, to come closer to thetrue complexity of natural language. To do this, we adopt a variant of thenatural logic developed by MacCartney and Manning (2007, 2009) (see alsoSánchez-Valencia 1991; van Benthem 2008; Icard and Moss 2013). Natural logicis a flexible approach to doing logical inference directly on naturallanguage expressions. Thus, in this setting, we can work directly withnatural language sentences while retaining complete control overall aspects of the generated dataset.
36
+
37
+ We define natural logic reasoning over aligned semantic parse treesthat represent both the premise and hypothesis as a single structureand allow us to calculate semantic relations for all phrasescompositionally. The core components are semantic relations, whichcapture the direct inferential relationships between words and phrases, andprojectivity signatures, which encode how semantic operatorsinteract compositionally with their arguments. We employ the semantic relations ofMacCartney and Manning (2009), as in Table 2. We use ℬℬ\mathcal{B} to denote the set containing these seven semantic relations.
38
+
39
+ The essential concept for thematerial to come is that of joint projectivity: for a pairof semantic functions f𝑓f and g𝑔g and a pair of inputs X𝑋X and Y𝑌Ythat are in relation R𝑅R, the joint projectivity signaturePf/g:ℬ→ℬ:subscript𝑃𝑓𝑔→ℬℬP_{f/g}:\mathcal{B}\to\mathcal{B}is a function such that the relation between f​(X)𝑓𝑋f(X) and g​(Y)𝑔𝑌g(Y)is Pf/g​(R)subscript𝑃𝑓𝑔𝑅P_{f/g}(R). Figure 2 illustrates this with thephrases every animal and some dog.We show the details of how the natural logicof MacCartney and Manning (2009), with a small extension, determinesthe joint projectivity signatures for our datasetsin Appendix B.
40
+
41
+ Our fragment G𝐺G consists of sentences of the form:QSsubscriptQS\text{Q}_{\text{S}} AdjSsubscriptAdjS\text{Adj}_{\text{S}} NSsubscriptNS\text{N}_{\text{S}} NegsubscriptNeg\text{Neg}_{\text{}} AdvsubscriptAdv\text{Adv}_{\text{}}VsubscriptV\text{V}_{\text{}} QOsubscriptQO\text{Q}_{\text{O}} AdjOsubscriptAdjO\text{Adj}_{\text{O}} NOsubscriptNO\text{N}_{\text{O}}where NSsubscriptNS\text{N}_{\text{S}} and NOsubscriptNO\text{N}_{\text{O}} are nouns, VsubscriptV\text{V}_{\text{}} is a verb,AdjSsubscriptAdjS\text{Adj}_{\text{S}} and AdjOsubscriptAdjO\text{Adj}_{\text{O}} are adjectives, and AdvsubscriptAdv\text{Adv}_{\text{}} isan adverb. NegsubscriptNeg\text{Neg}_{\text{}} is does not, and QSsubscriptQS\text{Q}_{\text{S}} andQOsubscriptQO\text{Q}_{\text{O}} can be every, not every, some, orno; in each of the remaining categories, there are 100 words.Additionally, AdjSsubscriptAdjS\text{Adj}_{\text{S}}, AdjOsubscriptAdjO\text{Adj}_{\text{O}}, AdvsubscriptAdv\text{Adv}_{\text{}}, andNegsubscriptNeg\text{Neg}_{\text{}} can be the empty string ε𝜀\varepsilon, which is represented in the databy a unique token. Semantic scope is fixed by surface order,with earlier elements scoping over later ones.
42
+
43
+ For NLI, we define the set of premise–hypothesis pairs𝒮⊂G×G𝒮𝐺𝐺\mathcal{S}\subset G\times G such that(sp,sh)∈𝒮subscript𝑠𝑝subscript𝑠ℎ𝒮(s_{p},s_{h})\in\mathcal{S} iff the non-identical non-emptynouns, adjectives, verbs, and adverbs with identical positions inspsubscript𝑠𝑝s_{p} and shsubscript𝑠ℎs_{h} are in the ##\# relation. This constraint on𝒮𝒮\mathcal{S} trivializes the task of determining the lexicalrelations between adjectives, nouns, adverbs, and verbs, since therelation is ≡\equiv where the two aligned elements are identical andotherwise ##\#. Furthermore, it follows that distinguishingcontradictions from entailments is trivial. The only sources ofcontradictions are negation and the negative quantifiers no andnot every. Consider (sp,sh)∈𝒮subscript𝑠𝑝subscript𝑠ℎ𝒮(s_{p},s_{h})\in\mathcal{S} and letC𝐶C be the number of times negation or a negative quantifier occurs inspsubscript𝑠𝑝s_{p} and shsubscript𝑠ℎs_{h}. If spsubscript𝑠𝑝s_{p} contradicts shsubscript𝑠ℎs_{h}, then C𝐶C is odd;if spsubscript𝑠𝑝s_{p} entails shsubscript𝑠ℎs_{h}, then C𝐶C is even.
44
+
45
+ We constrain the open-domain vocabulary to stress models with learninginteractions between logically complex function words; we trivializethe task of lexical semantics to isolate the task of compositionalsemantics. We also do not have multiple morphological forms, useartificial tokens that do not correspond to English words, and collapsedo not and not every to single tokens to furthersimplify the task and isolate a model’s ability to perform compositionallogical reasoning.
46
+
47
+ Our corpora use the three-way labeling scheme of entailment,contradiction, and neutral. To assign these labels, wetranslate each premise–hypothesis pair into first-order logic and useProver9 McCune (2005–2010). We assume no expression is empty oruniversal and encode these assumptions as additional premises. Thislabel generation process implicitly assumes the relation betweenunequal nouns, verbs, adjectives, and adverbs is independence.
48
+
49
+ When we generate training data for NLI corpora from some subset𝒮train⊂𝒮subscript𝒮train𝒮\mathcal{S}_{\emph{train}}\subset\mathcal{S}, we perform the following balancing.For a given example, every adjective–noun and adverb–verb pair across thepremise and hypothesis is equally likely to have the relation≡\equiv, ⊏square-image-of\sqsubset, ⊐square-original-of\sqsupset, or ##\#. Without this balancing,any given adjective–noun and adverb–verb pair across the premise andhypothesis has more than a 99% chance of being in the independencerelation for values of 𝒮trainsubscript𝒮train\mathcal{S}_{\emph{train}} we consider.Even with this step, 98% of the sentence pairs are neutral,so we again sample to create corpora that are balanced across thethree NLI labels. This balancing across our three NLI labelsjustifies our use of an accuracy metric rather than an F1 score.
50
+
51
+ We provide a composition tree for inference on 𝒮𝒮\mathcal{S} in Figure 3.This is an aligned composition tree, as in Figure 2: itjointly composes lexical items from the premise and hypothesis. The leaf nodes comein sibling pairs where one sibling is a lexical item from the premise andthe other is a lexical item from the hypothesis. If both leaf nodesin a sibling pair have domains containing lexical items that are semantic functions, thentheir parent node domain contains the joint projectivity signatures between those semantic functions. Otherwisethe parent node domain contains the semantic relations between the lexical itemsin the two sibling node domains. The root captures the overall semantic relationbetween the premise and the hypothesis, whilethe remaining non-leaf nodes represent intermediate phrasal relations.
52
+
53
+ The sets AdjSsubscriptAdj𝑆\emph{Adj}_{S}, NSsubscriptN𝑆\emph{N}_{S}, AdjOsubscriptAdj𝑂\emph{Adj}_{O}, NOsubscriptN𝑂\emph{N}_{O},Adv, and Veach have 100 of their respective open class lexical items with Adv,AdjSsubscriptAdj𝑆\emph{Adj}_{S}, and AdjOsubscriptAdj𝑂\emph{Adj}_{O} also containing the empty string ε𝜀\varepsilon.The set Q𝑄Q is {some, every, no, not,every} and the set Neg is {ε,not}𝜀not\{\varepsilon,\emph{not}\}.𝒬𝒬\mathcal{Q} is the set of 16 joint projectivity signatures betweenthe quantifiers some, every, no, and notevery, 𝒩𝒩\mathcal{N} is the set of 4 joint projectivity signaturesbetween the empty string ε𝜀\varepsilon and no, and 𝒜𝒜\mathcal{A} is theset of 4 projectivity signatures between ε𝜀\varepsilon and anintersective adjective or adverb. These joint projectivitysignatures were exhaustivelydetermined by us by hand, using the projectivity signaturesof negation and quantifiers provided by MacCartney and Manning (2009) as wellas a small extension (details in Appendix B).
54
+
55
+ The function PROJ computes the joint projectivity signaturebetween two semantic functions, REL computes the semantic relation between two lexicalitems, and COMP inputs semantic relations into a joint projectivitysignature and outputs the result. We trimmed the domain of every node sothat the function of every node is surjective. Pairs ofsubexpressions containing quantifiers can be in any of the seven basicsemantic relations; even with the contributions of open-class lexicalitems trivialized, the level of complexity remains high, and all of itemerges from semantic composition, rather than from lexical relations.
56
+
57
+ A fair training dataset exposes each local function to all possible inputs.Thus, a fair training dataset for NLI will have the following properties.First, all lexical semantic relations must be included in the trainingdata, else the lexical targets could be underdetermined.Second, for any aligned semantic functions f𝑓f and g𝑔gwith unknown joint projectivity signature Pf/gsubscript𝑃𝑓𝑔P_{f/g}, and for anysemantic relation R���R, there is some training examplewhere Pf/gsubscript𝑃𝑓𝑔P_{f/g} is exposed to the semanticrelation R𝑅R. This ensures that the model has enough information tolearn full joint projectivity signatures. Even with these constraints inplace, the composition tree of Section 3.1 determinesan enormous number of very challenging train/test splits.Appendix C fully defines the procedure for data generation.
58
+
59
+ We also experimentally verify that our baselinelearns a perfect solution from the data we generate. The trainingset contains 500,000 examples randomly sampled from𝒮trainsubscript𝒮train\mathcal{S}_{\emph{train}} and the test and development sets eachcontain 10,000 distinct examples randomly sampled from𝒮¯trainsubscript¯𝒮train\bar{\mathcal{S}}_{\emph{train}}. All random sampling is balancedacross adjective–noun and adverb–verb relations as well asacross the three NLI labels, as described in Section 4.2.
60
+
61
+ We consider six different model architectures:CBoWPremise and hypothesis are represented by the average oftheir respective word embeddings (continuous bag of words).LSTM EncoderPremise and hypothesis are processed assequences of words using a recurrent neural network (RNN) with LSTMcells, and the final hidden state of eachserves as its representation Hochreiter and Schmidhuber (1997); Elman (1990); Bowman et al. (2015a).TreeNNPremise and hypothesis are processed as trees,and the semantic composition function is a single-layerfeed-forward network Socher et al. (2011b, a). The value ofthe root node is the semantic representation in each case.Attention LSTMAn LSTM RNNwith word-by-word attention Rocktäschel et al. (2015).CompTreeNNPremise and hypothesis are processed as asingle aligned tree, following the structure of the compositiontree in Figure 3.The semantic composition function is a single-layer feed-forwardnetwork Socher et al. (2011b, a). The value ofthe root node is the semantic representation of the premise andhypothesis together.CompTreeNTNIdentical to the CompTreeNN, but with aneural tensor network as the composition function Socher et al. (2013).
62
+
63
+ For the first three models, the premise and hypothesis representationsare concatenated. For the CompTreeNN, CompTreeNTN, and Attention LSTM,there is just a single representation of the pair. In all cases, thepremise–hypothesis representation is fed through two hidden layers anda softmax layer.
64
+
65
+ All models are initialized with random 100-dimensional word vectorsand optimized using Adam Kingma and Ba (2014). It would not be possible to use pretrainedword vectors, due to the artificial nature of our dataset. A gridhyperparameter search was run over dropout values of {0,0.1,0.2,0.3}00.10.20.3\{0,0.1,0.2,0.3\}on the output and keep layers of LSTM cells, learning rates of{1​e−2,3​e−3,1​e−3,3​e−4}1e23e31e33e4\{1\mathrm{e}{-2},3\mathrm{e}{-3},1\mathrm{e}{-3},3\mathrm{e}{-4}\},L2 regularization values of{0,1​e−4,1​e−3,1​e−2}01e41e31e2\{0,1\mathrm{e}{-4},1\mathrm{e}{-3},1\mathrm{e}{-2}\} on all weights,and activation functions ReLUReLU\operatorname{ReLU} and tanh\tanh. Each hyperparametersetting was run for three epochs and parameters with the highestdevelopment set score were used for the complete training runs.
66
+
67
+ The training datasets for this generalization task are only fair if the outputs realized at every non-leaf node are provided during training just as they are in our baseline learning model. For our neural models, we accomplish this by predicting semantic relations for every subexpression pair in the scope of a node in the tree in Figure 3 and summing the loss of the predictions together. We do not do this for the nodes labeled PROJ →𝒬→absent𝒬\rightarrow\mathcal{Q} or PROJ →𝒩→absent𝒩\rightarrow\mathcal{N}, as the function PROJ is a bijection at these nodes and no intermediate representations are created. For any example sentence pair the neural models are trained using the a weighted sum of the error on 12 prediction tasks shown in Figure 4. The 12 errors are weighted to regularize the loss according to the length of the expressions being predicted on.
68
+
69
+ The CompTreeNN and CompTreeNTN models are structured to create intermediate representations of these 11 aligned phrases and so intermediate predictions are implemented as in the sentiment models of Socher et al. (2013). The other models process each of the 11 pairs of aligned phrases separately. Different softmax layers are used depending on the number of classes, but otherwise the networks have identical parameters for all predictions.
70
+
71
+ Table 3 summarizes our findings on the hardest of our fairgeneralization tasks, where the training sets are minimal ones required forfairness. The four standard neural models fail the task completely.The CompTreeNN and CompTreeNTN, while better, are not able to solve the task perfectlyeither. However, it should be noted that the CompTreeNN outperforms our fourstandard neural models by ≈30%absentpercent30{\approx}30\% and the CompTreeNTN improves on thisby another ≈10%absentpercent10{\approx}10\%. This increase in performance leads us to believe theremay be some other composition function that solves this task perfectly.
72
+
73
+ Both the CompTreeNN and CompTreeNTN have large 95% confidence intervals,indicating that the models are volatile and sensitive to random initialization.The TreeNN also has a large 95%percent9595\% interval. On one of the five runs,the TreeNN achieved a test accuracy of 65.76%percent65.7665.76\%, much higher than usual,indicating that this model may have more potential than the other three.
74
+
75
+ Figure 5, left panel, provides further insights into these resultsby tracking dev-set performance throughout training. It is evident herethat the standard models never get traction on the problem. The volatilityof the CompTreeNN and CompTreeNTN is also again evident. Notably, the CompTreeNNis the only model that doesn’t peak in the first four training epochs,showing steady improvement throughout training.
76
+
77
+ We can also increase the number of training examples so that the trainingdata redundantly encodes the information needed for fairness. As we do this, the learningproblem becomes one of trivial memorization. Figure 5,right panel, tracks performance on this sequence of progressively more trivial problems.The CompTreeNN and CompTreeNTN both rapidly ascend to perfect performance. In contrast,the four standard models continue to have largely undistinguished performancefor all but the most trivial problems. Finally, CBoW, while competitive with otherneural models initially, falls behind in a permanent way;its inability to account for word order prevents it from even memorizing thetraining data.
78
+
79
+ The results in Figure 5 are for models trained to predict the semantic relations for every subexpression pair in the scope of a node in the tree in Figure 3 (as discussed in Section 5), but we also trained the models without intermediate predictions to quantify their impact.
80
+
81
+ All models fail on our difficult generalization task when these intermediate values are withheld. Without intermediate values this task is unfair by our standards, so this to be expected. In the hardest generalization setting the CBoW model is the only one of the four standard models to show statistically significant improvement when intermediate predictions are made. We hypothesize that the model is learning relations between open-class lexical items, which are more easily accessible in its sentence representations.As the generalization task approaches a memorization task, the four standard models benefit more and more from intermediate predictions. In the easiest generalization setting, the four standard models are unable to achieve a perfect solution without intermediate predictions, while the CompTreeNN and CompTreeNTN models achieve perfection with or without the intermediate values. Geiger et al. (2018) show that this is due to standard models being unable to learn the lexical relations between open class lexical items when not directly trained on them. Even with intermediate predictions, the standard models are only able to learn the base case of this recursive composition.
82
+
83
+ One might worry that these results represent a failure of model capacity.However, the systematic errors remain even for much largernetworks; the trends by epoch and final results are virtually identical with200-dimensional rather than 100-dimensions representations.
84
+
85
+ The reason these standard neural models fail to perform natural logic reasoning istheir architecture. The CBoW, TreeNN, and LSTM Encoder models all separately bottleneckthe premise and hypothesis sentences into two sentence vector embeddings, so the only placeinteractions between the two sentences can occur is in the two hidden layers beforethe softmax layer. However, the essence of natural logic reasoning is recursive compositionup a tree structure where the premise and hypothesis are composed jointly, so thisbottleneck proves extremely problematic. The Attention LSTM model has an architecturethat can align and combine lexical items from the premise and hypothesis, but it cannot perform thisprocess recursively and also fails. The CompTreeNN and CompTreeNTN have this recursive tree structureencoded as hard alignments in their architecture, resulting in higher performance. Perhaps in future work,a general purpose model will be developed that can learn to perform this recursive compositionwithout a hard-coded aligned tree structure.
86
+
87
+ It is vital that we stress-test our models of semantics using methods that go beyondstandard naturalistic corpus evaluations. Recent experiments with artificial andadversarial example generation have yielded valuable insights here already, but it isvital that we ensure that these evaluations are fair in the sense that they provideour models with achievable, unambiguous learning targets. We must carefully andprecisely navigate the border between meaningful difficulty and impossibility.To this end, we developed a formal notion of fairness for train/test splits.
88
+
89
+ This notion of fairness allowed us to rigorously pose the question of whether specificNLI models can learn to do robust natural logicreasoning. For our standard models, the answer is no. For ourtask-specific models, which align premise and hypothesis, the answer is more nuanced;they do not achieve perfectperformance on our task, but they do much better than standard models. This helps us trace the problemto the information bottleneck formed by learning separate premise and hypothesis representations.This bottleneck prevents the meaningful interactions between the premise and hypothesisthat are at the core of inferential reasoning with language. Our task-specific modelsare cumbersome for real-world tasks, but they do suggest that truly robust models ofsemantics will require much more compositional interaction than is typical in today’sstandard architectures.
1911.00835v1.txt ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Generating text at the right level of complexity can make machine translation (MT) more useful for a wide range of users. As Xu et al. (2015) note, simplifying text makes it possible to develop reading aids for people with low-literacy Watanabe et al. (2009); De Belder and Moens (2010), for non-native speakers and language learners Petersen and Ostendorf (2007); Allen (2009), for people who suffer from language impairments Carroll et al. (1999); Canning et al. (2000); Inui et al. (2003), and for readers lacking expert knowledge of the topic discussed Elhadad and Sutaria (2007); Siddharthan and Katsos (2010). Such readers would also benefit from MT output that is better targeted to their needs by being easier to read than the original.
2
+
3
+ Prior work on text complexity has focused on simplifying input text in one language, primarily English Chandrasekar et al. (1996); Coster and Kauchak (2011); Siddharthan (2014); Xu et al. (2015); Zhang and Lapata (2017); Scarton and Specia (2018); Kriz et al. (2019); Nishihara et al. (2019).Simplification has been used to improve MT by restructuring complex sentences into shorter and simpler segments that are easier to translate Gerber and Hovy (1998); Štajner and Popovic (2016); Hasler et al. (2017).Contemporaneously to our work, Marchisio et al. (2019) show that tagging the English side of parallel corpora with automatic readability scores can help translate the same input in a simpler or more complex form. Our work shares the goal of controlling translation complexity, but considers a broader range of reading grade levels and simplification operations grounded in professionally edited text simplification corpora.
4
+
5
+ Building a model for this task ideally requires rich annotation for evaluation and supervised training that is not available in bilingual parallel corpora typically used in MT. Controlling the complexity of Spanish-English translation ideally requires examples of Spanish sentences paired with several English translations that span a range of complexity levels. We collect such a dataset of English-Spanish segment pairs from the Newsela website, which provides professionally edited simplifications and translations. By contrast with MT parallel corpora, the English and Spanish translations at different grade levels are only comparable. They differ in length and sentence structure, reflecting complex syntactic and lexical simplification operations.
6
+
7
+ We adopt a multi-task approach to control complexity in neural MT and evaluate it on complexity-controlled Spanish-English translation. Our extensive empirical study shows that multitask models produce better and simpler translations than pipelines of independent translation and simplification models. We then analyze the strengths and weaknesses of multitask models, focusing on the degree to which they match the target complexity, and the impact of training data types and reading grade level annotation.111Researchers can request the bilingual Newsela data at https://Newsela.com/data/. Scripts to replicate our model configurations and our cross-lingual segment aligner are available at https://github.com/sweta20/ComplexityControlledMT.
8
+
9
+ Given corpora of parallel complex-simple segments, text simplification can naturally be framed as a translation task, borrowing and adapting model architectures originally designed for MT. Xu et al. (2016) provide a thorough study of statistical MT techniques for English text simplification, and introduce novel objectives to measure simplification quality. Interestingly, they indirectly make use of parallel translation corpora to derive simplification paraphrasing rules by bilingual pivoting Callison-Burch (2007). Zhang and Lapata (2017) train sequence-to-sequence models to translate from complex to simple English using reinforcement learning to directly optimize the metrics that evaluate complexity (SARI) and fluency and adequacy (BLEU). Scarton and Specia (2018) address the task of producing text of varying levels of complexity for different target audiences. They show that neural sequence-to-sequence models informed by target-complexity tokens inserted in the input sequence perform well on this task. While the vast majority of text simplification work has focused on English, Spanish (Štajner et al., 2015), Italian (Brunato et al., 2016; Aprosio et al., 2019) and German (Klaper et al., 2013) have also received some attention.
10
+
11
+ While most MT approaches only indirectly capture style properties (e.g., via domain adaptation), a growing number of studies share the goal of considering source texts and their translation in their pragmatic context. Mirkin and Meunier (2015) introduce personalized MT. Rabinovich et al. (2016) and Vanmassenhove et al. (2018) suggest that the gender of the author is implicitly marked in the source text and that dedicated statistical and neural systems better preserve gender traits in MT output. Neural MT has enabled more flexible ways to control stylistic properties of MT output. Sennrich et al. (2016) first propose to append a special token to the source that neural MT models can attend to and to select the formal (Sie) or informal (du) version of second person pronouns when translating into German. Niu et al. (2018) show that multi-task models can jointly translate between languages and styles, producing formal and informal translations with broader lexical and phrasal changes than the local pronoun changes in Sennrich et al. (2016). Closest to our goal, Marchisio et al. (2019) address the task of producing either simple or complex translations of the same input, using automatic readability scoring of parallel corpora. They show that training distinct decoders for simple and complex language allows better complexity control than using the target complexity as a side-constraint. By contrast, our approach exploits text simplification corpora for richer supervision for both training and evaluation.
12
+
13
+ We define complexity controlled MT as a task that takes two inputs: an input language segment sisubscript𝑠𝑖s_{i} and a target complexity c𝑐c. The goal is to produce a translation sosubscript𝑠𝑜s_{o} in the output language that has complexity c𝑐c. For instance, given input Spanish sentences in Table 1, complexity controlled MT aims to produce English translations at a specific level of complexity, which might differ from the complexity of the original Spanish.
14
+
15
+ We model P​(so|si,c;θ)𝑃conditionalsubscript𝑠𝑜subscript𝑠𝑖𝑐𝜃P(s_{o}|s_{i},c;\theta) as a neural encoder-decoder with attention Bahdanau et al. (2015). This architecture has been used successfully for the two related tasks of text simplification Wang et al. (2016); Zhang and Lapata (2017); Nisioi et al. (2017); Scarton and Specia (2018) and machine translation Bahdanau et al. (2015). The encoder constructs hidden representation for each word in the input sequence, while the decoder generates the target sequence, conditioned on hidden source representations. We hypothesize that training a single encoder-decoder model to perform the two distinct tasks of machine translation and text simplification will yield a model that can perform complexity controlled MT. We adopt the multi-task framework proposed by Johnson et al. (2016) to train multilingual neural MT systems.
16
+
17
+ Target complexity c𝑐c can be incorporated in sequence-to-sequence models as a special token appended to the beginning of the input sequence, which acts as a side constraint. The encoder encodes this token in its hidden states as any other vocabulary token, and the decoder can attend to this representation to guide the generation of the output sequence. This simple strategy has been used in MT to control second person pronoun forms when translating into German Sennrich et al. (2016), to indicate the target language in multilingual MT Johnson et al. (2016), and to obtain formal or informal translations of the same input Niu et al. (2018). In monolingual text simplification tasks Scarton and Specia (2018), the reading grade level has been encoded as such a special token.
18
+
19
+ Fully supervised training would ideally require translation samples with outputs representing different levels of complexity for the same input segment. However, constructing such data at the scale required to train deep neural networks is expensive and unrealistic.Our multi-task training configuration lets us exploit different types of training examples to train shared encoder-decoder parameters θ𝜃\theta.We use the following samples/tasks:•Complexity controlled MT samples (si,co,so)subscript𝑠𝑖subscript𝑐𝑜subscript𝑠𝑜(s_{i},c_{o},s_{o}): These are the closest samples to the task at hand, but are hard to obtain. They are used to defined the complexity-controlled MT lossℒC​M​T=∑(si,co,so)log⁡P​(so|si,co;θ)subscriptℒ𝐶𝑀𝑇subscriptsubscript𝑠𝑖subscript𝑐𝑜subscript𝑠𝑜𝑃conditionalsubscript𝑠𝑜subscript𝑠𝑖subscript𝑐𝑜𝜃\mathcal{L}_{CMT}=\sum_{(s_{i},c_{o},s_{o})}\log P(s_{o}|s_{i},c_{o};\theta)(1)•MT samples (si,so)subscript𝑠𝑖subscript𝑠𝑜(s_{i},s_{o}): These are sentence pairs drawn from parallel corpora. They are available in large quantities for many language pairs Tiedemann (2012) and are used to define the MT lossℒM​T=∑(si,so)log⁡P​(so|si;θ)subscriptℒ𝑀𝑇subscriptsubscript𝑠𝑖subscript𝑠𝑜𝑃conditionalsubscript𝑠𝑜subscript𝑠𝑖𝜃\mathcal{L}_{MT}=\sum_{(s_{i},s_{o})}\log P(s_{o}|s_{i};\theta)(2)•Text simplification samples in the MT target language (so,cso′,so′)subscript𝑠𝑜subscript𝑐superscriptsubscript𝑠𝑜′superscriptsubscript𝑠𝑜′(s_{o},c_{s_{o}^{\prime}},s_{o}^{\prime}) where so′superscriptsubscript𝑠𝑜′s_{o}^{\prime} is a simplified version of complexity cso′subscript𝑐superscriptsubscript𝑠𝑜′c_{s_{o}^{\prime}} for input sosubscript𝑠𝑜s_{o}, which are likely to be available in much smaller quantities than MT samples.ℒSimplify=∑(so,cso′,so′)log⁡P​(so′|so,cso′;θ)subscriptℒSimplifysubscriptsubscript𝑠𝑜subscript𝑐superscriptsubscript𝑠𝑜′superscriptsubscript𝑠𝑜′𝑃conditionalsuperscriptsubscript𝑠𝑜′subscript𝑠𝑜subscript𝑐superscriptsubscript𝑠𝑜′𝜃\mathcal{L}_{\textit{Simplify}}=\sum_{(s_{o},c_{s_{o}^{\prime}},s_{o}^{\prime})}\log P(s_{o}^{\prime}|s_{o},c_{s_{o}^{\prime}};\theta)(3)The multi-task loss is simply obtained by summing the losses from individual tasks: ℒC​M​T+ℒM​T+ℒS​i​m​p​l​i​f​ysubscriptℒ𝐶𝑀𝑇subscriptℒ𝑀𝑇subscriptℒ𝑆𝑖𝑚𝑝𝑙𝑖𝑓𝑦\mathcal{L}_{CMT}+\mathcal{L}_{MT}+\mathcal{L}_{Simplify}.
20
+
21
+ We build on prior work that used the Newsela dataset for English or Spanish text simplification by automatically aligning English and Spanish segments of different complexity to enable complexity-controlled machine translation.
22
+
23
+ The Newsela website provides high quality data to study text simplification. Xu et al. (2015) argue that text simplification research should be grounded in texts that are simplified by professional editors for specific target audiences, rather than more general-purpose crowd-sourced simplifications such as those available on Wikipedia. They show that Wikipedia is prone to sentence alignment errors, contains a non-negligible amount of inadequate simplifications, and does not generalize well to other text genres. By contrast, Newsela is an instructional content platform meant to help teachers prepare curriculum that match the language skills required at each grade level. The Newsela corpus consists of English articles in their original form, 4 or 5 different versions rewritten by professionals to suit different grade levels as well as optional translations of original and/or simplified English articles into Spanish resulting in 23,130 English and 5,320 Spanish articles with grade annotations respectively.
24
+
25
+ This section introduces our method to align English and Spanish segments across complexity levels, and the resulting bilingual dataset.
26
+
27
+ Extracting training examples from this corpus requires aligning segments within documents. This is challenging because text is neither simplified nor translated sentence by sentence, and as a result, equivalent content might move from one sentence to the next.Past work has introduced techniques to align segments of different complexity within documents of the same language (Xu et al., 2015; Paetzold et al., 2017; Štajner et al., 2018).
28
+
29
+ Complexity controlled MT requires aligning segments of different complexity in English and Spanish. Existing methods for aligning sentences in English and Spanish parallel corpora are not well suited to this task. For instance, the Gale-Church algorithm Gale and Church (1993) assumes that aligned sentences should have similar length. This assumption does not hold if the English article is a simplification of the Spanish article. Consider the following Spanish text and its English translation in Newsela:
30
+
31
+ Spanish: LA HAYA, Holanda - Te has tomado alguna vez una selfie?, Hoy en día es muy fácil. Solo necesitas un teléfono inteligente.
32
+
33
+ Google Translated English: THE HAGUE, Netherlands - Have you ever taken a selfie? Today is very easy. You only need a smart phone.
34
+
35
+ Original English Version: THE HAGUE, Netherlands - All you need is a smartphone to take a selfie. It is that easy.
36
+
37
+ As a result, we adapt a monolingual text simplification aligner for cross-lingual alignment. MASSAlign Paetzold et al. (2017) is a Python library designed to align segments of different length within comparable corpora of the same language. It employs a vicinity-driven search approach, based on the assumption that the order in which information appears is roughly constant in simple and complex texts. A similarity matrix is created between the paragraphs/sentences of aligned documents/paragraphs using a standard bag-of-words TF-IDF model. It finds a starting point to begin the search for an alignment path, allowing long-distance alignment skips, capturing 1-N and N-1 alignments. To leverage this alignment flexibility, we apply MASSAlign to English articles and Spanish articles machine translated into English by Google translate.222https://translate.google.com/ An important property of Google translated articles is that they are aligned 1-1 at the sentence level. This lets us deterministically find the Spanish replacement for the aligned Google translated English version returned by MASSAlign. Translation quality is high for this language pair, and even noisy translated articles contain enough signal to construct the similarity matrix required by MASSAlign.
38
+
39
+ We thus create: both samples for complexity controlled MT (si,co,so)subscript𝑠𝑖subscript𝑐𝑜subscript𝑠𝑜(s_{i},c_{o},s_{o}) and traditional monolingual text simplification samples (so,cso′,so′)subscript𝑠𝑜subscript𝑐superscriptsubscript𝑠𝑜′superscriptsubscript𝑠𝑜′\left(s_{o},c_{s_{o}^{\prime}},s_{o}^{\prime}\right) that can be used by the multi-task model (Section 3). Since the properties of Newsela monolingual simplification samples have been studied thoroughly by Xu et al. (2015), we present key statistics for the cross-lingual simplification examples only. Table 2 contrasts Newsela parallel segments with bilingual parallel sentences drawn from the OPUS corpus (Tiedemann, 2009). We use Global Voices and News Commentary from OPUS corpus as it has the most similar domain to the Newsela data. Aligned segments in Newsela are about twice as long as segments in parallel corpora, and contain more than two sentences on each side on average. By contrast, parallel corpora samples align sentences one-to-one on average.
40
+
41
+ Articles are distributed across reading levels spanning grades 2 to 12 for both English and English-Spanish pairs. Table 3 highlights the vocabulary differences among the different grade levels for the Newsela Spanish-English corpus. The vocabulary size of the corpus corresponding to lower grade level is smaller as compared to higher complexity levels. Also, complex sentences have more words per sentence on average but fewer sentences per segment compared to their simplified counterparts. Simple sentences differ from complex sentences in various ways, ranging from sentence splitting and content deletion to paraphrasing and lexical substitutions, as illustrated in Table 1.
42
+
43
+ We evaluate complexity controlled MT using a subset of the 150k Spanish-English segment pairs extracted from Newsela as described in Section 4. We select Spanish and English segments that have different reading grade levels, so that given a Spanish input, the task consists in producing an English translation which is simpler (lower reading grade level) than the Spanish input.The train/development/test split ensures that there is no overlap between articles held out for testing and articles used for training. We refer to the corresponding training examples as MT+simplify since it represents the joint task of translation and simplification.
44
+
45
+ We evaluate the truecased detokenized output of our models using three automatic evaluation metrics, drawing from both machine translation and text simplification evaluation.
46
+
47
+ BLEU Papineni et al. (2002) estimates translation quality based on n𝑛n-gram overlap between system output and references. However it does not separate mismatches due to meaning errors and mismatches due to simplification errors.
48
+
49
+ SARI Xu et al. (2016)333https://github.com/cocoxu/simplification is designed to evaluate text simplification systems by comparing system output against references and against the input sentence. It explicitly measures the goodness of words that are added, deleted and kept by the systems. Xu et al. (2016) showed that BLEU shows high correlation with human scores for grammaticality and meaning preservation and SARI shows high correlation with human scores for simplicity. In the cross-lingual setting, we cannot directly compare the Spanish input with English hypotheses and references, therefore we use the baseline machine translation of Spanish into English as a pseudo-source text. The resulting SARI score directly measures the improvement over baseline machine translation.
50
+
51
+ In addition to BLEU and SARI, we report Pearson’s correlation coefficient (PCC) to measure the strength of the linear relationship between the complexity of our system outputs and the complexity of reference translations. Heilman et al. (2008) use it to evaluate the performance of reading difficulty prediction. Here we estimate the reading grade level complexity of MT outputs and reference translations using the Automatic Readability Index (ARI)444https://github.com/mmautner/readability score, which combines evidence from the number of characters per word and number of words per sentence using hand-tuned weights (Senter and Smith, 1967):A​R​I=4.71​(c​h​a​r​sw​o​r​d​s)+0.5​(w​o​r​d​ss​e​n​t​s)−21.43𝐴𝑅𝐼4.71𝑐ℎ𝑎𝑟𝑠𝑤𝑜𝑟𝑑𝑠0.5𝑤𝑜𝑟𝑑𝑠𝑠𝑒𝑛𝑡𝑠21.43ARI=4.71(\frac{chars}{words})+0.5(\frac{words}{sents})-21.43(4)
52
+
53
+ In addition to the Newsela MT+Simplify training examples described above, which are of the form (si,co,so)subscript𝑠𝑖subscript𝑐𝑜subscript𝑠𝑜(s_{i},c_{o},s_{o}), we use monolingual English simplification data, bilingual parallel training data and Spanish simplification data.
54
+
55
+ provides training examples of the form (so,cso′,so′)subscript𝑠𝑜subscript𝑐superscriptsubscript𝑠𝑜′superscriptsubscript𝑠𝑜′(s_{o},c_{s_{o}^{\prime}},s_{o}^{\prime}), where sosubscript𝑠𝑜s_{o} and so′superscriptsubscript𝑠𝑜′s_{o}^{\prime} are in the same language. We refer to this data as Simplify data. It is used for training multi-task models and for auxiliary evaluation on English only. Our version of this corpus has 513k English segment pairs extracted using the method by Paetzold and Specia (2016). Similar to Scarton and Specia (2018), an original article 0 can be aligned to up to four simplified versions: 1,2,3 and 4. Here 4 denotes the least simplified level and 0 represents the most simplified level. The train split consists of 460k instance pairs whereas the development and test sets consist of roughly 20K instances, drawn from the same articles as the MT+preserve and MT+simplify test set. For Spanish, we have 110k segment pairs, which will be used to train the Spanish simplification baseline.
56
+
57
+ We also extract parallel Spanish-English segments from Newsela based on aligned segments between Spanish and English articles that have the same reading grade level. We use this dataset to provide in-domain MT training examples which includes roughly 70k instances.
58
+
59
+ All datasets are pre-processed using Moses tools for normalization, tokenization and true-casing (Koehn et al., 2007). We further segment tokens into subwords using a joint source-target byte pair encoding model with 32,000 operations Sennrich et al. (2015).
60
+
61
+ We use the standard encoder-decoder architecture implemented in the Sockeye toolkit Hieber et al. (2017). Both encoder and decoder have two Long Short Term Memory (LSTM) layers (Bahdanau et al., 2015), hidden states of size 500 and dropout of 0.3 applied to the RNNs of the encoder and decoder which is same as what was used by Scarton and Specia (2018). We observe that dot product based attention works best in our scenario, perhaps indicating that the task of complexity controlled translation requires mostly local changes that do not lead to long distance reorderings across sentences. We train using the Adam (Kingma and Ba, 2014) optimizer with a batch size of 256 segments and checkpoint the model every 1000 updates. Training stops after 8 checkpoints without improvement of validation perplexity. The vocabulary size is limited to 50000. We decode with a beam size of 5. Grade side-constraints are defined using a distinct special token for each grade level (from 2 to 12). The constraint token corresponds to the grade level of the target instance.
62
+
63
+ We contrast the multi-task system with pipeline based approaches, where translation and simplification are treated as independent consecutive steps. We train a neural MT model to perform translation from Spanish to English and other neural MT models to perform monolingual text simplification for Spanish and English respectively. In the first pipeline setup, the output from the translation model is fed as input to an English simplification model while in the other, the output from the Spanish simplification model is fed as input to an translation model. As Scarton and Specia (2018), we simply use grade level tokens as side constraints on English simplification examples to control output complexity.555Additional constraints based on simplification operations were also used in that work but did not provide substantial benefits when operations are predicted based on the input.
64
+
65
+ We compare pipeline and multitask models on the Newsela complexity controlled MT task (Table 4). Overall, results show that compared to pipeline models, multitask models produce complexity controlled translations that better match human references according to BLEU. SARI suggests that multitask translations are simpler than baseline translations, and their resulting complexity correlates better with reference grade levels according to PCC.
66
+
67
+ The two pipeline models use the same MT system, therefore the difference between them comes from text simplification: using English simplification (first pipeline) outperforms Spanish simplification (second pipeline) according to BLEU and PCC, but not SARI. This can be explained by the smaller amount of Spanish simplification training data, which yields a model that generalizes poorly.
68
+
69
+ The “All tasks” model highlights the strengths of the multi-task approach: combining training samples from many tasks yields improvements over the “Translate and Simplify” multi-task model which is trained on the exact same data as the pipelines. However, even without additional training data, the multitask “Translate and Simpifly” model improves over baselines mainly by simplifying the output more, which suggests that the simplification component of the multitask model benefits from the additional MT training data.
70
+
71
+ Qualitative analysis suggests that the multi-task model is capable of distinguishing among different grade levels and the simplification operations performed for different grade levels are gradual. Table  5 illustrates simplification operations observed for a fixed grade 12 Spanish input into English with target grade levels ranging from 9 to 3. When translating to a nearby grade level, for example 9, the model roughly translates the entire input. For lower grade levels such as 7 and 5, lexical simplification and sentence splitting is observed. For the simplest grade level, the model deletes additional content. More examples are provided in the Appendix ( Table  13).
72
+
73
+ We aim to better understand to what degree models simplify the input text: how often does the output complexity exactly matches that of the reference? Does this change depend on the distance between input and output complexity levels? Table 6 compiles Adjacency Accuracy scores (Heilman et al., 2008), which represent the percentage of sentences where the system output complexity is within 111 or 222 grades of the reference text. We derive the reading grade levels from ARI Senter and Smith (1967) and conduct this analysis for the best pipeline (“Translate then Simplify”) and multitask models (“All Tasks”). These adjacency scores are broken down according to the distance between input and target grade levels.
74
+
75
+ When the source and target grades are close, roughly 60% of system outputs that are within a ±1plus-or-minus1\pm 1 window of the correct grade level. The pipeline model matches the target grade slightly better than the multitask model. However, in the more difficult case where the difference between source and target grades is larger than three, the multitask model outperforms the pipeline. Increasing the adjacency window to ±2plus-or-minus2\pm 2 pushes the percentage of matches in the 70s.
76
+
77
+ Overall these results show that multitask and pipeline models are able to translate and simplify, but that they do not yet fully succeed at precisely controlling the complexity of their output to match a specific target reading grade.
78
+
79
+ Table 7 shows the impact of different training data types on the multitask model using ablation experiments. OPUS improves BLEU and SARI performance across the board. However, using OPUS without any Newsela MT data (Row 4) hurts the correlation score, indicating the importance of in-domain MT data to control complexity. The difference between the performance when using joint translation and simplification (MT+S) examples (Row 2) vs. simplification only (S in Row 3) is small in terms of BLEU (+0.11) and PCC (0.012), indicating that the monolingual simplification dataset can provide simplification supervision when MT+Simplify data is unavailable. The overall best performance for the task is obtained by using all types of training examples.666A random sample of outputs from the best model configuration are provided in the Appendix (Table  14).
80
+
81
+ In addition to complexity controlled MT, the multi-task model can be used to simplify English text, and to translate from Spanish-to-English without changing the complexity. For completeness, we evaluate on these two auxiliary tasks.
82
+
83
+ Table 8 summarizes the results: the multitask model slightly outperforms a dedicated simplification model on English simplification, showing the benefits of the additional training data from other tasks. By contrast, on the resource-rich MT task, the standalone translation system performs better. This can be explained by the fact that the standalone system is only responsible for text translation, while the multi-task model is exposed to samples of more diverse complexity levels during training which damage its ability to preserve complexity.
84
+
85
+ Our models control complexity using the gold reading grade level assigned by professional Newsela editors. We investigate the impact of replacing these gold labels by automatic predictions from the ARI metric. ARI can be computed for any English segment, including for MT parallel corpora that are not annotated for complexity.
86
+
87
+ Table 9 shows that ARI provides an adequate substitute for manually annotated reading grade levels, as BLEU and SARI score remain close when Newsela reading grade levels are replaced by ARI-based tags. However, annotating all data with ARI grades, including the OPUS parallel corpus, hurts BLEU. We attribute this result to the differences in length and number of sentences per segment in OPUS vs. Newsela (Table 2): segments of vastly different lengths can have the same ARI score (Equation 4), thus confusing the multitask model.
88
+
89
+ We introduce a new task that aims to control complexity in machine translation output, as a proxy for producing translations targeted at audiences with different reading proficiency levels. We construct a Spanish-English dataset drawn from the Newsela corpus for training and evaluation, and adopt a sequence-to-sequence model trained in a multitask fashion.
90
+
91
+ We show that the multitask model improves performance over translation and simplification pipelines, according to both machine translation and simplification metrics. The reading grade level of the multi-task outputs correlate better with target grade levels than with pipeline outputs. Analysis shows that these benefits come from their ability to combine larger training data from different tasks.Manual inspection also shows that the multi-task model successfully produces different translations for increasingly lower grades given the same Spanish input.
92
+
93
+ However, even when simplifying translations, multitask models are not yet able to exactly match the desired complexity level, and the gap between the complexity achieved and the target complexity increases with the amount of simplification required.Our datasets and models thus provide a foundation to investigate strategies for a tighter control on output complexity in future work.
1911.00837v2.txt ADDED
@@ -0,0 +1,570 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ \section{Introduction}
2
+ Fueled by the emergence of blockchain technology~\cite{blockchain_dist,bit_pedigree,bftbook}, we see a surge in consensus-based data processing frameworks and database systems~\cite{bftbook,caper,hyperledger,blockchaindb,blockmeetdb,blockplane}. This interest can be easily explained: compared to traditional distributed database systems, consensus-based systems can provide \emph{more resilience during failures}, can provide strong support for \emph{data provenance}, and can enable \emph{federated data processing} in a heterogeneous environment with many independent participants. Consequently, consensus-based systems can prevent disruption of service due to software issues or cyberattacks that compromise part of the system, and can aid in improving data quality of data that is managed by many independent parties, potentially reducing the huge societal costs of cyberattacks and bad data.
3
+
4
+ At the core of consensus-based systems are \emph{consensus protocols} that enable independent participants (e.g., different companies) to manage a single common database by reliably and continuously replicating a unique sequence of transactions among all participants. By design, these consensus protocols are resilient and can deal with participants that have crashed, are unable to participate due to local network, hardware, or software failures, or are compromised and act malicious~\cite{blockchain_iot,wild}. As such, consensus protocols can be seen as the fault-resilient counterparts of classical two-phase and three-phase commit protocols~\cite{2pc,3pc,easyc}. Most practical systems use consensus protocols that follow the classical primary-backup design of \PBFT{}~\cite{pbftj} in which a single replica, the \emph{primary}, proposes transactions by broadcasting them to all other replicas, after which all replicas \emph{exchange state} to determine whether the primary correctly proposes the same transaction to all replicas and to deal with failure of the primary. Well-known examples of such protocols are \PBFT{}~\cite{pbftj}, \ZZ{}~\cite{zyzzyvaj}, \SBFT{}~\cite{sbft}, \HS{}~\cite{hotstuff}, \PoE{}~\cite{poe}, and \RBFT{}~\cite{rbft}, and fully-optimized implementations of these protocols are able to process up-to tens-of-thousands transactions per second~\cite{icdcs}.
5
+ \subsection{The Limitations of Traditional Consensus}
6
+ \label{ss:limit}
7
+
8
+ Unfortunately, a close look at the design of primary-backup consensus protocols reveals that their design \emph{underutilized available network resources}, which prevents the \emph{maximization of transaction throughput}: the throughput of these protocols is determined mainly by the outgoing bandwidth of the primary. To illustrate this, we consider the maximum throughput by which primaries can replicate transactions. Consider a system with $\n$ replicas of which $\f$ are faulty and the remaining $\nf = \n - \f$ are non-faulty. The maximum throughput $\TP{\max}$ of any such protocol is determined by the outgoing bandwidth $\Bandwidth$ of the primary, the number of replicas $\n$, and the size of transactions $\SizeT$: $\TP{\Max} = \dsfrac{\Bandwidth}{((\n-1)\SizeT)}$. No practical consensus protocol will be able to achieve this throughput, as dealing with crashes and malicious behavior requires substantial state exchange. Protocols such as \ZZ{}~\cite{zyzzyvaj} can come close, however, by optimizing for the case in which no faults occur, this at the cost of their ability to deal with faults efficiently.
9
+
10
+ For \PBFT{}, the minimum amount of state exchange consists of two rounds in which \Name{Prepare} and \Name{Commit} messages are exchanged between all replicas (a quadratic amount, see Example~\ref{ex:pbft} in Section~\ref{sec:design}). Assuming that these messages have size $\SizeM$, the maximum throughput of \PBFT{} is $\TP{\PBFT} = \dsfrac{\Bandwidth}{((\n-1)(\SizeT + 3\SizeM))}$. To minimize overhead, typical implementations of \PBFT{} group hundreds of transactions together, assuring that $\SizeT \gg \SizeM$ and, hence, $\TP{\Max} \approx \TP{\PBFT{}}$.
11
+
12
+ The above not only shows a maximum on throughput, but also that primary-backup consensus protocols such as \PBFT{} and \ZZ{} severely \emph{underutilize resources} of non-primary replicas: when $\SizeT \gg \SizeM$, the primary sends and receives roughly $(\n-1) \SizeT$ bytes, whereas all other replicas only send and receive roughly $\SizeT$ bytes. The obvious solution would be to use several primaries. Unfortunately, recent protocols such as \HS{}~\cite{hotstuff}, \Name{Spinning}~\cite{spin}, and \Name{Prime}~\cite{prime} that regularly \emph{switch primaries} all require that a switch from a primary happens after all proposals of that primary are processed. Hence, such primary switching does load balance overall resource usage among the replicas, but does not address the underutilization of resources we observe.
13
+ \subsection{Our Solution: Towards Resilient Concurrent Consensus}
14
+ The only way to push throughput of consensus-based databases and data processing systems beyond the limit $\TP{\Max}$, is by better utilizing available resources. In this paper, we propose to do so via \emph{concurrent consensus}, in which we use many primaries that \emph{concurrently} propose transactions. We also propose \MultiBFT{}, a paradigm for the realization of concurrent consensus. Our contributions are as follows:
15
+ \begin{enumerate}
16
+ \item First, in Section~\ref{sec:propose}, we propose \emph{concurrent consensus} and show that concurrent consensus can achieve much higher throughput than primary-backup consensus by effectively utilizing all available system resources.
17
+ \item Then, in Section~\ref{sec:design}, we propose \MultiBFT{}, a paradigm for turning any primary-backup consensus protocol into a concurrent consensus protocol and that is designed for maximizing throughput in all cases, even during malicious activity.
18
+ \item Then, in Section~\ref{sec:improve}, we show that \MultiBFT{} can be utilized to make systems \emph{more resilient}, as it can mitigate the effects of order-based attacks and throttling attacks (which are not prevented by traditional consensus protocols), and can provide better load balancing.
19
+ \item Finally, in Section~\ref{sec:eval}, we put the design \MultiBFT{} to the test by implementing it in \RDB{},\footnote{\RDB{} is open-sourced and available at \url{https://resilientdb.com}.} our high-performance resilient blockchain fabric, and compare \MultiBFT{} with state-of-the-art primary-backup consensus protocols. Our comparison shows that \MultiBFT{} answers the promises of \emph{concurrent consensus}: it achieves up to $2.75\times$ higher throughput than other consensus protocols, has a peak throughput of $\SI{365}{\kilo\txn\per\batch}$ and can be easily scaled to $91$ replicas.
20
+ \end{enumerate}
21
+ \section{The Promise of Concurrent Consensus}
22
+ \label{sec:propose}
23
+
24
+ To deal with the underutilization of resources and the low throughput of primary-backup consensus, we propose \emph{concurrent consensus}. In specific, we design for a system that is optimized for high-throughput scenarios in which a plentitude of transactions are available, and we make every replica a \emph{concurrent primary} that is responsible for proposing and replicating some of these transactions. As we have $\nf$ non-faulty replicas, we can expect to always \emph{concurrently} propose at least $\nf$ transactions if sufficient transactions are available. Such concurrent processing has the potential to drastically improve throughput: in each round, each primary will send out one proposal to all other replicas, and receive $\nf-1$ proposals from other primaries. Hence, the maximum concurrent throughput is $\TP{\CMax} = \dsfrac{\nf\Bandwidth}{((\n -1)\SizeT + (\nf - 1)\SizeT)}$.
25
+
26
+ In practice, of course, the primaries also need to participate in state exchange to determine the correct operations of all concurrent primaries. If we use \PBFT{}-style state exchange, we end up with a concurrent throughput of $\TP{\CPBFT} = \dsfrac{\nf\Bandwidth}{((\n - 1)(\SizeT + 3\SizeM) + (\nf-1)(\SizeT + 4(\n-1)\SizeM))}$. In Figure~\ref{fig:theory_limit}, we have sketched the maximum throughputs $\TP{\Max}$, $\TP{\PBFT}$, $\TP{\CMax}$, and $\TP{\CPBFT}$. As one can see, concurrent consensus not only promises greatly improved throughput, but also sharply reduces the costs associated with scaling consensus. We remark, however, that these figures provide best-case \emph{upper-bounds}, as they only focus on bandwidth usage. In practice, replicas are also limited by computational power and available memory buffers that puts limits on the number of transactions they can process in parallel and can execute (see Section~\ref{ss:rdb}).
27
+
28
+ \begin{figure}
29
+ \centering
30
+ \plotTheoryTPut{20}{\dataTwentyRQ}\plotTheoryTPut{400}{\dataFourHRQ}
31
+ \caption{Maximum throughput of replication in a system with $\Bandwidth = \SI{1}{\giga\bit\per\second}$, $\n = 3\f+1$, $\nf = 2\f+1$, $\SizeM = \SI{1}{\kibi\byte}$, and individual transactions are $\SI{512}{\byte}$. On the \emph{left}, each proposal groups $20$ transactions ($\SizeT = \SI{10}{\kibi\byte}$) and on the \emph{right}, each proposal groups $400$ transactions ($\SizeT = \SI{2}{\mebi\byte}$).}\label{fig:theory_limit}
32
+ \end{figure}
33
+ \section{\MultiBFT{}: Resilient Concurrent Consensus}
34
+ \label{sec:design}
35
+
36
+ The idea behind concurrent consensus, as outlined in the previous section, is straightforward: improve overall throughput by using all available resources via concurrency. Designing and implementing a concurrent consensus system that operates correctly, even during crashes and malicious behavior of some replicas, is challenging, however. In this section, we describe how to design correct \emph{consensus protocols} that deliver on the promises of concurrent consensus. We do so by introducing \MultiBFT{}, a paradigm that can turn any primary-backup consensus protocol into a concurrent consensus protocol. At its basis, \MultiBFT{} makes every replica a primary of a consensus-instance that replicates transactions among all replicas. Furthermore, \MultiBFT{} provides the necessary coordination between these consensus-instances to coordinate execution and deal with faulty primaries. To assure resilience and maximize throughput, we put the following design goals in \MultiBFT{}:
37
+ \begin{enumerate}
38
+ \renewcommand{\theenumi}{D\arabic{enumi}}
39
+ \item\label{goal:consensus} \MultiBFT{} provides \emph{consensus} among replicas on the client transactions that are to be executed and the order in which they are executed.
40
+ \item\label{goal:client} Clients can interact with \MultiBFT{} to force execution of their transactions and learn the outcome of execution.
41
+ \item\label{goal:paradigm} \MultiBFT{} is a design paradigm that can be applied to any primary-backup consensus protocol, turning it into a concurrent consensus protocol.
42
+ \item\label{goal:always} In \MultiBFT{}, consensus-instances with non-faulty primaries are \emph{always} able to propose transactions at maximum throughput (with respect to the resources available to any replica), this independent of faulty behavior by any other replica.
43
+ \item\label{goal:recover} In \MultiBFT{}, dealing with faulty primaries does not interfere with the operations of other consensus-instances.
44
+ \end{enumerate}
45
+ Combined, design goals~\ref{goal:always} and~\ref{goal:recover} imply that instances with non-faulty primaries can propose transactions \emph{wait-free}: transactions are proposed concurrent to any other activities and does not require any coordination with other instances.
46
+ \subsection{Background on Primary-Backup Consensus and \PBFT{}}
47
+ \label{ss:back}
48
+ Before we present \MultiBFT{}, we provide the necessary background and notation for primary-backup consensus. Typical primary-backup consensus protocols operate in \emph{views}. Within each view, a primary can propose client transactions, which will then be executed by all non-faulty replicas. To assure that all non-faulty replicas maintain the same state, transactions are required to be \emph{deterministic}: on identical inputs, execution of a transaction must always produce identical outcomes. To deal with faulty behavior by the primary or by any other replicas during a view, three complimentary mechanisms are used:
49
+
50
+ \paragraph*{Byzantine commit}
51
+ The primary uses a \emph{Byzantine commit algorithm} \BCA{} to propose a client transaction $\Transaction$ to all replicas. Next, \BCA{} will perform state exchange to determine whether the primary successfully proposed a transaction. If the primary is non-faulty, then all replicas will receive $\Transaction$ and determine success. If the primary is faulty and more than $\f$ non-faulty replicas do \emph{not} receive a proposal or receive different proposals than the other replicas, then the state exchange step of \BCA{} will detect this failure of the primary.
52
+
53
+ \paragraph*{Primary replacement}
54
+ The replicas use a \emph{view-change algorithm} to replace the primary of the current view $\View$ when this primary is detected to be faulty by non-faulty replicas. This view-change algorithm will collect the state of sufficient replicas in view $v$ to determine a correct starting state for the next view $\View+1$ and assign new primary that will propose client transactions in view $\View+1$.
55
+
56
+ \paragraph*{Recovery}
57
+ A faulty primary can keep up to $\f$ non-faulty replicas \emph{in the dark} without being detected, as $\f$ faulty replicas can cover for this malicious behavior. Such behavior is not detected and, consequently, does not trigger a view-change. Via a \emph{checkpoint algorithm} the at-most-$\f$ non-faulty replicas that are in the dark will learn the proposed client transactions that are successfully proposed to the remaining at-least-$\nf-\f > \f$ non-fault replicas (that are not in the dark).
58
+
59
+ \begin{example}\label{ex:pbft}
60
+ Next, we illustrate these mechanisms in \PBFT{}. At the core of \PBFT{} is the \emph{preprepare-prepare-commit} Byzantine commit algorithm. This algorithm operates in three phases, which are sketched in Figure~\ref{fig:pbft}.
61
+ \begin{figure}[t!]
62
+ \centering
63
+ \begin{tikzpicture}[yscale=0.35,xscale=1.05]
64
+ \draw[thick,draw=black!75] (0.75, 4.5) edge[green!50!black!90] ++(7.25, 0)
65
+ (0.75, 0) edge ++(7.25, 0)
66
+ (0.75, 1) edge ++(7.25, 0)
67
+ (0.75, 2) edge ++(7.25, 0)
68
+ (0.75, 3) edge[blue!50!black!90] ++(7.25, 0);
69
+
70
+ \draw[thin,draw=black!75] (1, 0) edge ++(0, 4.5)
71
+ (2, 0) edge ++(0, 4.5)
72
+ (3.5, 0) edge ++(0, 4.5)
73
+ (5, 0) edge ++(0, 4.5)
74
+ (6.5, 0) edge ++(0, 4.5)
75
+ (8, 0) edge ++(0, 4.5);
76
+
77
+ \node[left] at (0.8, 0) {$\Replica_3$};
78
+ \node[left] at (0.8, 1) {$\Replica_2$};
79
+ \node[left] at (0.8, 2) {$\Replica_1$};
80
+ \node[left] at (0.8, 3) {$\Replica[p]$};
81
+ \node[left] at (0.8, 4.5) {$\Client$};
82
+
83
+ \path[->] (1, 4.5) edge node[above=-4pt,xshift=6pt,label] {$\SignMessage{\Client}{\Transaction}$} (2, 3)
84
+ (2, 3) edge (3.5, 2)
85
+ edge (3.5, 1)
86
+ edge (3.5, 0)
87
+
88
+ (3.5, 2) edge (5, 0)
89
+ edge (5, 1)
90
+ edge (5, 3)
91
+
92
+ (3.5, 1) edge (5, 0)
93
+ edge (5, 2)
94
+ edge (5, 3)
95
+
96
+ (5, 2) edge (6.5, 0)
97
+ edge (6.5, 1)
98
+ edge (6.5, 3)
99
+
100
+ (5, 1) edge (6.5, 0)
101
+ edge (6.5, 2)
102
+ edge (6.5, 3)
103
+
104
+ (6.5, 0) edge (8, 4.5)
105
+ (6.5, 1) edge (8, 4.5)
106
+ (6.5, 2) edge (8, 4.5)
107
+ (6.5, 3) edge (8, 4.5)
108
+ ;
109
+
110
+ \node[dot,red] at (6.5, 0) {};
111
+ \node[dot,red] at (6.5, 1) {};
112
+ \node[dot,red] at (6.5, 2) {};
113
+ \node[dot,red] at (6.5, 3) {};
114
+
115
+ \node (x) at (6.5, 4.75) {} edge[thick,red] (6.5, 0);
116
+ \node[above=-4pt] at (x) {Execute $\SignMessage{\Client}{\Transaction}$};
117
+
118
+
119
+ \node[below=-4pt,label] at (2.75, 0) {\Name{PrePrepare}};
120
+ \node[below=-4pt,label] at (4.25, 0) {\Name{Prepare}};
121
+ \node[below=-4pt,label] at (5.75, 0) {\Name{Commit}};
122
+ \node[below=-4pt,label] at (7.25, 0) {\Name{Inform}};
123
+ \end{tikzpicture}
124
+ \caption{A schematic representation of the \emph{preprepare-prepare-commit protocol} of \PBFT{}. First, a client $\Client$ requests transaction $\Transaction$ and the primary $\Replica[p]$ proposes $\Transaction$ to all replicas via a \Name{PrePrepare} message. Next, replicas commit to $\Transaction$ via a two-phase message exchange (\Name{Prepare} and \Name{Commit} messages). Finally, replicas execute the proposal and inform the client.}\label{fig:pbft}
125
+ \end{figure}
126
+
127
+ First, the current primary chooses a client request of the form $\SignMessage{\Client}{\Transaction}$, a transaction $\Transaction$ signed by client $\Client$, and proposes this request as the $\rn$-th transaction by broadcasting it to all replicas via a \Name{PrePrepare} message $m$. Next, each non-faulty replica $\Replica$ \emph{prepares} the first proposed $\rn$-th transaction it receives by broadcasting a \Name{Prepare} message for $m$. If a replica $\Replica$ receives $\nf$ \Name{Prepare} messages for $m$ from $\nf$ distinct replicas, then it has the guarantee that any group of $\nf$ replicas will contain a \emph{non-faulty replica} that has received $m$. Hence, $\Replica$ has the guarantee that $m$ can be recovered from any group of $\nf$ replicas, independent of the behavior of the current primary. With this guarantee, $\Replica$ \emph{commits} to $m$ by broadcasting a \Name{Commit} message for $m$. Finally, if a replica $\Replica$ receives $\nf$ \Name{Commit} messages for $m$ from $\nf$ distinct replicas, then it \emph{accepts} $m$. In \PBFT{}, accepted proposals are then \emph{executed} and the client is informed of the outcome.
128
+
129
+ Each replica $\Replica$ participating in preprepare-prepare-commit uses an internal \emph{timeout value} to detect failure: whenever the primary fails to coordinate a round of preprepare-prepare-commit---which should result in $\Replica$ accepting some proposal---$\Replica$ will detect \emph{failure} of the primary and halt participation in preprepare-prepare-commit. If $\f + 1$ non-faulty replicas detect such a failure and communication is reliable, then they can cooperate to assure that all non-faulty replicas detect the failure. We call this a \emph{confirmed failure} of preprepare-prepare-commit. In \PBFT{}, confirmed failures trigger a \emph{view-change}. Finally, \PBFT{} employs a majority-vote \emph{checkpoint protocol} that allows replicas that are kept in the dark to learn \emph{accepted} proposals without help of the primary.
130
+ \end{example}
131
+ \subsection{The Design of \MultiBFT{}}
132
+ We now present \MultiBFT{} in detail. Consider a primary-backup consensus protocol \Protocol{} that utilizes Byzantine commit algorithm \BCA{} (e.g., \PBFT{} with preprepare-prepare-commit). At the core of applying our \MultiBFT{} paradigm to \Protocol{} is running $\m$, $1 \leq \m \leq \n$, instances of \BCA{} \emph{concurrently}, while providing sufficient coordination between the instances to deal with any malicious behavior. To do so, \MultiBFT{} makes \BCA{} \emph{concurrent} and uses a checkpoint protocol for per-instance recovery of in-the-dark replicas (see Section~\ref{ss:udetfaulty}). Instead of view-changes, \MultiBFT{} uses a novel wait-free mechanism, that does not involve replacing primaries, to deal with detectable primary failures (see Section~\ref{ss:detfaulty}). \MultiBFT{} requires the following guarantees on \BCA{}:
133
+
134
+ \begin{assumption}
135
+ Consider an instance of \BCA{} running in a system with $\n$ replicas, $\n > 3\f$.
136
+ \begin{enumerate}
137
+ \renewcommand{\theenumi}{A\arabic{enumi}}
138
+ \item\label{ass:bca:succeed} If no failures are detected in round $\rn$ of \BCA{} (the round is \emph{successful}), then at least $\nf-\f$ non-faulty replicas have \emph{accepted} a proposed transaction in round $\rn$.
139
+ \item\label{ass:bca:non_diverge} If a non-faulty replica \emph{accepts} a proposed transaction $\Transaction$ in round $\rn$ of \BCA{}, then all other non-faulty replicas that accepted a proposed transaction, accepted $\Transaction$.
140
+ \item\label{ass:bca:recover} If a non-faulty replica \emph{accepts} a transaction $\Transaction$, then $\Transaction$ can be recovered from the state of any subset of $\nf - \f$ non-faulty replicas.
141
+ \item\label{ass:bca:good} If the primary is non-faulty and communication is reliable, then all non-faulty replicas will accept a proposal in round $\rn$ of \BCA{}.
142
+ \end{enumerate}
143
+ \end{assumption}
144
+ With minor fine-tuning, these assumptions are met by \PBFT{}, \ZZ{}, \SBFT{}, \HS{}, and many other primary-backup consensus protocols, meeting design goal~\ref{goal:paradigm}.
145
+
146
+ \MultiBFT{} operates in rounds. In each round, \MultiBFT{} replicates $\m$ client transactions (or, as discussed in Section~\ref{ss:limit}, $\m$ sets of client transactions), one for each instance. We write $\Instance{i}$ to denote the $i$-th instance of \BCA{}. To enforce that each instance is coordinated by a distinct primary, the $i$-th replica $\Primary{i}$ is assigned as the primary coordinating $\Instance{i}$. Initially, \MultiBFT{} operates with $\m = \n$ instances. In \MultiBFT{}, instances can fail and be \emph{stopped}, e.g., when coordinated by malicious primaries or during periods of unreliable communication. Each round $\rn$ of \MultiBFT{} operates in three steps:
147
+ \begin{enumerate}
148
+ \item \emph{Concurrent \BCA{}}. First, each replica participates in $\m$ instances of \BCA{}, in which each instance is proposing a transaction requested by a client among all replicas.
149
+ \item \emph{Ordering}. Then, each replica collects all successfully replicated client transactions and puts them in the same---deterministically determined---\emph{order}.
150
+ \item \emph{Execution}. Finally, each replica \emph{executes} the transactions of round $\rn$ in order and informs the clients of the outcome of their requested transactions.
151
+ \end{enumerate}
152
+ Figure~\ref{fig:mbft_replica_overview} sketches a high-level overview of running \emph{$\m$ concurrent instances of \BCA{}}.
153
+
154
+ \begin{figure}[t!]
155
+ \centering
156
+ \begin{tikzpicture}[xscale=0.7,yscale=0.5]
157
+ \fill[fill=black!10!blue!10] (1, 2) rectangle (3.9, -2.1);
158
+ \fill[fill=black!20!blue!20] (3.9, 2) rectangle (8.75, -2.1);
159
+ \fill[fill=black!30!blue!30] (8.75, 2) rectangle (11.25, -2.1);
160
+
161
+ \path (1, 2) edge (1, -2.1)
162
+ (3.9, 2) edge (3.9, -2.1)
163
+ (8.75, 2) edge (8.75, -2.1)
164
+ (11.25, 2) edge (11.25, -2.1);
165
+
166
+
167
+ \node (i1) at (1.5, 1.5) {$\Instance{1}$};
168
+ \node (i2) at (1.5, 0.5) {$\Instance{2}$};
169
+ \node at (1.5, -0.25) {$\vdots$};
170
+ \node (im) at (1.5, -1.5) {$\Instance{\m}$};
171
+
172
+ \node (bcp1) at (3, 1.5) {\BCA{}};
173
+ \node (bcp2) at (3, 0.5) {\BCA{}};
174
+ \node at (3, -0.25) {$\vdots$};
175
+ \node (bcpm) at (3, -1.5) {\BCA{}};
176
+
177
+ \path[semithick] (3.75, 1.5) edge (3.75, 1.05)
178
+ (3.75, 1.05) edge (2, 1.05)
179
+ (2, 1.05) edge[->] (2, 1.5)
180
+ (3.75, 0.5) edge (3.75, 0.05)
181
+ (3.75, 0.05) edge (2, 0.05)
182
+ (2, 0.05) edge[->] (2, 0.5)
183
+ (3.75, -1.5) edge (3.75, -1.95)
184
+ (3.75, -1.95) edge (2, -1.95)
185
+ (2, -1.95) edge[->] (2, -1.5);
186
+
187
+ \path[->,semithick]
188
+ (1.75, 1.5) edge (2.5, 1.5) (1.75, 0.5) edge (2.5, 0.5) (1.75, -1.5) edge (2.5, -1.5)
189
+ (3.5, 1.5) edge (4.375, 1.5) (3.5, 0.5) edge (4.375, 0.5) (3.5, -1.5) edge (4.375, -1.5)
190
+ (6.25, 0) edge (6.75, 0) (8.25, 0) edge (9.25, 0);
191
+ \path[semithick] (6.25, 1.5) edge (6.25, -1.5) (5.875, 1.5) edge (6.25, 1.5) (5.875, 0.5) edge (6.25, 0.5) (5.875, -1.5) edge (6.25, -1.5);
192
+
193
+ \node[align=center] (c1) at (5.125, 1.5) {$\SignMessage{\Client_0}{\Transaction_0}$};
194
+ \node[align=center] (c2) at (5.125, 0.5) {$\SignMessage{\Client_1}{\Transaction_1}$};
195
+ \node[align=center] at (5.125, -0.25) {$\vdots$};
196
+ \node[align=center] (cm) at (5.125, -1.5) {$\SignMessage{\Client_{\m}}{\Transaction_{\m}}$};
197
+
198
+ \node[align=center] (permute) at (7.5, 0) {\strut{}order\\\strut{}requests};
199
+ \node[align=center] (execute) at (10, 0) {\strut{}execute\\\strut{}requests};
200
+
201
+ \node[above,font=\bfseries,align=center] at (2.5, 2) {\small \strut{}Concurrent \BCA{}};
202
+ \node[above,font=\bfseries,align=center] at (6.375, 2) {\small \strut{}Ordering};
203
+ \node[above,font=\bfseries,align=center] at (10, 2) {\small \strut{}Execution};
204
+ \end{tikzpicture}
205
+ \caption{A high-level overview of \MultiBFT{} running at replica $\Replica$. Replica $\Replica$ participates in $\m$ concurrent instances of \BCA{} (that run independently and continuously output transactions). The instances yield $\m$ transactions, which are executed in a deterministic order.}\label{fig:mbft_replica_overview}
206
+ \end{figure}
207
+
208
+ To maximize performance, we want every instance to propose distinct transactions, such that every round results in $\m$ distinct transactions. In Section~\ref{ss:clients}, we delve into the details by which primaries can choose transactions to propose.
209
+
210
+ To meet design goal~\ref{goal:always} and~\ref{goal:recover}, individual \BCA{} instances in \MultiBFT{} can continuously propose and replicate transactions: ordering and execution of the transactions replicated in a round by the $\m$ instances is done \emph{in parallel} to the proposal and replication of transactions for future rounds. Consequently, non-faulty primaries can utilize their entire outgoing network bandwidth for proposing transactions, even if other replicas or primaries are acting malicious.
211
+
212
+ Let $\SignMessage{\Client_i}{\Transaction_i}$ be the transaction $\Transaction_i$ requested by $\Client_i$ and proposed by $\Primary{i}$ in round $\rn$. After all $\m$ instances complete round $\rn$, each replica can collect the set of transactions $S = \{ \SignMessage{\Client_i}{\Transaction_i} \mid 1 \leq i \leq \m \}$. By Assumption~\ref{ass:bca:non_diverge}, all non-faulty replicas will obtain the same set $S$. Next, all replicas choose an order on $S$ and execute all transactions in that order. For now, we assume that the transaction $\SignMessage{\Client_i}{\Transaction_i}$ is executed as the $i$-th transaction of round $\rn$. In Section~\ref{sec:improve}, we show that a more advanced ordering-scheme can further improve the resilience of consensus against malicious behavior. As a direct consequence of Assumption~\ref{ass:bca:good}, we have the following:
213
+
214
+ \begin{proposition}
215
+ Consider \MultiBFT{} running in a system with $\n$ replicas, $\n > 3\f$. If all $\m$ instances have non-faulty primaries and communication is reliable, then, in each round, all non-faulty replicas will accept the same set of $\m$ transactions and execute these transactions in the same order.
216
+ \end{proposition}
217
+
218
+ As all non-faulty replicas will execute each transaction in $\SignMessage{\Client_i}{\Transaction_i} \in S$, there are $\nf$ distinct non-faulty replicas that can inform the client of the outcome of execution. As all non-faulty replicas operate deterministically and execute the transactions in the same order, client $\Client_i$ will receive identical outcomes of $\nf > \f$ replicas, guaranteeing that this outcome is correct.
219
+
220
+ In the above, we described the normal-case operations of \MultiBFT{}. As in normal primary-backup protocols, individual instances in \MultiBFT{} can be subject to both \emph{detectable} and \emph{undetectable} failures. Next, we deal with these two types of failures.
221
+ \subsection{Dealing with Detectable Failures}
222
+ \label{ss:detfaulty}
223
+
224
+ Consensus-based systems typically operate in an environment with asynchronous communication: messages can get lost, arrive with arbitrary delays, and in arbitrary order. Consequently, it is impossible to distinguish between, on the one hand, a primary that is malicious and does not send out proposals and, on the other hand, a primary that does send out proposals that get lost in the network. As such, asynchronous consensus protocols can only provide \emph{progress} in periods of \emph{reliable bounded-delay communication} during which all messages sent by non-faulty replicas will arrive at their destination within some maximum delay~\cite{flp,capproof}.
225
+
226
+ To be able to deal with failures, \MultiBFT{} assumes that \emph{any failure} of non-faulty replicas to receive proposals from a primary $\Primary{i}$, $1 \leq i \leq \m$, is due to \emph{failure} of $\Primary{i}$, and we design the recovery process such that it can also recover from failures due to unreliable communication. Furthermore, in accordance with the wait-free design goals~\ref{goal:always} and~\ref{goal:recover}, the recovery process will be designed so that it does not interfere with other \BCA{} instances or other recovery processes. Now assume that primary $\Primary{i}$ of $\Instance{i}$, $1 \leq i \leq \m$, fails in round $\rn$. The recovery process consists of three steps:
227
+ \begin{enumerate}
228
+ \item All non-faulty replicas need to detect failure of the $\Primary{i}$.
229
+ \item All non-faulty replicas need to reach agreement on the state of $\Instance{i}$: which transactions have been proposed by $\Primary{i}$ and have been accepted in the rounds up-to-$\rn$.
230
+ \item To deal with unreliable communication, all non-faulty replicas need to determine the round in which $\Primary{i}$ is allowed to resume its operations.
231
+ \end{enumerate}
232
+
233
+ To reach agreement on the state of $\Instance{i}$, we rely on a separate instance of the consensus protocol $\Protocol$ that is only used to coordinate agreement on the state of $\Instance{i}$ during failure. This coordinating consensus protocol $\Protocol$ replicates $\Stop{i}{E}$ operations, in which $E$ is a set of $\nf$ \Name{Failure} messages sent by $\nf$ distinct replicas from which all accepted proposals in instance $\Instance{i}$ can be derived. We notice that $\Protocol$ is---itself---an instance of a primary-backup protocol that is coordinated by some primary $\Leader{i}$ (based on the current view in which the instance of $\Protocol$ operates), and we use the standard machinery of $\Protocol$ to deal with failures of that leader (see Section~\ref{ss:back}). Next, we shall describe how the recovery process is initiated. The details of this protocol can be found in Figure~\ref{fig:rec_init}.
234
+
235
+ \begin{figure}[t!]
236
+ \begin{myprotocol}
237
+ \TITLE{Recovery request role}{used by replica $\Replica$}
238
+ \EVENT{$\Replica$ detects failure of the primary $\Primary{i}$, $1 \leq i \leq \m$, in round $\rn$}\label{fig:rec_init:detect}
239
+ \STATE $\Replica$ halts $\Instance{i}$.
240
+ \STATE Let $P$ be the state of $\Replica$ in accordance to Assumption~\ref{ass:bca:recover}.
241
+ \STATE Broadcast $\Message{Failure}{i, \rn, P}$ to all replicas.
242
+ \ENDEVENT
243
+ \EVENT{$\Replica$ receives $\f+1$ messages $m_j = \Message{Failure}{i, \rn_j, P_j}$ such that:
244
+ \begin{algenumerate}
245
+ \item these messages are sent by a set $S$ of $\abs{S} = \f+1$ distinct replicas;
246
+ \item all $\f+1$ messages are well-formed; and
247
+ \item $\rn_j$, $1 \leq j \leq \f+1$, comes after the round in which $\Instance{i}$ started last
248
+ \end{algenumerate}}\label{fig:rec_init:join}
249
+ \STATE $\Replica$ detects failure of $\Primary{i}$ (if not yet done so).
250
+ \ENDEVENT
251
+ \SPACE
252
+ \TITLE{Recovery leader role}{used by leader $\Leader{i}$ of $\Protocol$}
253
+ \EVENT{$\Leader{i}$ receives $\nf$ messages $m_j = \Message{Failure}{i, \rn_j, P_j}$ such that
254
+ \begin{algenumerate}
255
+ \item these messages are sent by a set $S$ of $\abs{S} = \f+1$ distinct replicas;
256
+ \item all $\nf$ messages are well-formed; and
257
+ \item $\rn_j$, $1 \leq j \leq \f+1$, comes after the round in which $\Instance{i}$ started last
258
+ \end{algenumerate}}\label{fig:rec_init:stop}
259
+ \STATE Propose $\Stop{i}{\{ m_1, \dots, m_{\nf} \}}$ via $\Protocol$.
260
+ \ENDEVENT
261
+ \SPACE
262
+ \TITLE{State recovery role}{used by replica $\Replica$}
263
+ \EVENT{$\Replica$ accepts $\Stop{i}{E}$ from $\Leader{i}$ via $\Protocol$}
264
+ \STATE Recover the state of $\Instance{i}$ using $E$ in accordance to Assumption~\ref{ass:bca:recover}.
265
+ \STATE Determine the last round $\rn$ for which $\Instance{i}$ accepted a proposal.
266
+ \STATE Set $\rn + 2^f$, with $f$ the number of accepted $\Stop{i}{E'}$ operations, as the next valid round number for instance $\Instance{i}$.\label{fig:rec_init:restart}
267
+ \ENDEVENT
268
+ \end{myprotocol}
269
+ \caption{The \emph{recovery algorithm} of \MultiBFT{}.}\label{fig:rec_init}
270
+ \end{figure}
271
+
272
+ When a replica $\Replica$ detects failure of instance $\Instance{i}$, $0 \leq i < \m$, in round $\rn$, it broadcasts a message $\Message{Failure}{i, \rn, P}$, in which $P$ is the state of $\Replica$ in accordance to Assumption~\ref{ass:bca:recover} (\lfref{fig:rec_init}{detect}). To deal with unreliable communication, $\Replica$ will continuously broadcast this \Name{Failure} message with an exponentially-growing delay until it learns on how to proceed with $\Instance{i}$. To reduce communication in the normal-case operations of $\Protocol$, one can send the full message $\Message{Failure}{i, \rn, P}$ to only $\Leader{i}$, while sending $\Message{Failure}{i, \rn}$ to all other replicas.
273
+
274
+ If a replica receives $\f+1$ \Name{Failure} messages from distinct replicas for a certain instance $\Instance{i}$, then it received at least one such message from a non-faulty replica. Hence, it can detect failure of $\Instance{i}$ (\lfref{fig:rec_init}{join}). Finally, if a replica $\Replica$ receives $\nf$ \Name{Failure} messages from distinct replicas for a certain instance $\Instance{i}$, then we say there is a \emph{confirmed failure}, as $\Replica$ has the guarantee that eventually---within at most two message delays---also the primary $\Leader{i}$ of $\Protocol$ will receive $\nf$ \Name{Failure} messages (if communication is reliable). Hence, at this point, $\Replica$ sets a timer based on some internal timeout value (that estimates the message delay) and waits on the leader $\Leader{i}$ to propose a valid \StopOp{}-operation or for the timer to run out. In the latter case, replica $\Replica$ detects failure of the leader $\Leader{i}$ and follows the steps of a view-change in $\Protocol$ to (try to) replace $\Leader{i}$. When the leader $\Leader{i}$ receives $\nf$ \Name{Failure} messages, it can and must construct a valid \StopOp{}-operation and reach consensus on this operation (\lfref{fig:rec_init}{stop}). After reaching consensus, each replica can recover to a common state of $\Instance{i}$:
275
+
276
+ \begin{theorem}\label{thm:term}
277
+ Consider \MultiBFT{} running in a system with $\n$ replicas. If $\n > 3\f$, an instance $\Instance{i}$, $0 \leq i < \m$, has a confirmed failure, and the last proposal of $\Primary{i}$ accepted by a non-faulty replica was in round $\rn$, then---whenever communication becomes reliable---the recovery protocol of Figure~\ref{fig:rec_init} will assure that all non-faulty replicas will recover the same state, which will include all proposals accepted by non-faulty replicas before-or-at round $\rn$.
278
+ \end{theorem}
279
+ \begin{proof}
280
+ If communication is reliable and instance $\Instance{i}$ has a confirmed failure, then all non-faulty replicas will detect this failure and send \Name{Failure} messages (\lfref{fig:rec_init}{detect}). Hence, all replicas are guaranteed to receive at least $\nf$ \Name{Failure} messages, and any replica will be able to construct a well-formed operation $\Stop{i}{E}$. Hence, \Protocol{} will eventually be forced to reach consensus on $\Stop{i}{E}$. Consequently, all non-faulty replicas will conclude on the same state for instance $\Instance{i}$. Now consider a transaction $\Transaction$ accepted by non-faulty replica $\Replica[q]$ in instance $\Instance{i}$. Due to Assumption~\ref{ass:bca:recover}, $\Replica[q]$ will only accept $\Transaction$ if $\Transaction$ can be recovered from the state of any set of $\nf-\f$ non-faulty replicas. As $\abs{E} = \nf$ (\lfref{fig:rec_init}{stop}), the set $E$ contains the state of $\nf-\f$ non-faulty replicas. Hence, $\Transaction$ must be recoverable from $E$.
281
+ \end{proof}
282
+
283
+ We notice that the recovery algorithm of \MultiBFT{}, as outlined in Figure~\ref{fig:rec_init}, only affects the capabilities of the \BCA{} instance that is stopped. All other \BCA{} instances can concurrently propose transactions for current and for future rounds. Hence, the recovery algorithm adheres to the wait-free design goals~\ref{goal:always} and~\ref{goal:recover}. Furthermore, we reiterate that we have separate instance of the coordinating consensus protocol for each instance $\Instance{i}$, $1\leq i \leq \m$. Hence, recovery of several instances can happen concurrently, which minimizes the time it takes to recover from several simultaneous primary failures and, consequently, minimizes the delay before a round can be executed during primary failures.
284
+
285
+ Confirmed failures not only happen due to malicious behavior. Instances can also fail due to periods of unreliable communication. To deal with this, we eventually restart any stopped instances. To prevent instances coordinated by malicious replicas to continuously cause recovery of their instances, every failure will incur an exponentially growing restart penalty (\lfref{fig:rec_init}{restart}). The exact round in which an instance can resume operations can be determined deterministically from the accepted history of \StopOp{}-requests. When all instances have round failures due to unreliable communication (which can be detected from the history of \StopOp{}-requests), any instance is allowed to resume operations in the earliest available round (after which all other instances are also required to resume operations).
286
+ \subsection{Dealing with Undetectable Failures}
287
+ \label{ss:udetfaulty}
288
+
289
+ As stated in Assumption~\ref{ass:bca:succeed}, a malicious primary $\Primary{i}$ of a \BCA{} instance $\Instance{i}$ is able to keep up to $\f$ non-faulty replicas in the dark without being detected. In normal primary-backup protocols, this is not a huge issue: at least $\nf - \f > \f$ non-faulty replicas still accept transactions, and these replicas can execute and reliably inform the client of the outcome of execution. This is not the case in \MultiBFT{}, however:
290
+
291
+ \begin{example}\label{ex:collusion}
292
+ Consider a system with $\n = 3\f+1 = 7$ replicas. Assume that primaries $\Primary{1}$ and $\Primary{2}$ are malicious, while all other primaries are non-faulty. We partition the non-faulty replicas into three sets $A_1$, $A_2$, and $B$ with $\abs{A_1} = \abs{A_2} = \f$ and $\abs{B} = 1$. In round $\rn$, the malicious primary $\Primary{i}$, $i \in \{1,2\}$, proposes transaction $\SignMessage{\Client_i}{\Transaction_i}$ to only the non-faulty replicas in $A_i \union B$. This situation is sketched in Figure~\ref{fig:bi_attack}. After all concurrent instances of \BCA{} finish round $\rn$, we see that the replicas in $A_1$ have accepted $\SignMessage{\Client_1}{\Transaction_1}$, the replicas in $A_2$ have accepted $\SignMessage{\Client_2}{\Transaction_2}$, and only the replica in $B$ has accepted both $\SignMessage{\Client_1}{\Transaction_1}$ and $\SignMessage{\Client_2}{\Transaction_2}$. Hence, only the single replica in $B$ can proceed with execution of round $\rn$. Notice that, due to Assumption~\ref{ass:bca:succeed}, we consider all instances as finished successfully. If $\n \geq 10$ and $\f \geq 3$, this example attack can be generalized such that also the replica in $B$ is missing at least a single client transaction.
293
+ \begin{figure}[t!]
294
+ \centering
295
+ \begin{tikzpicture}[yscale=0.395,xscale=1.1]
296
+ \node[above,align=right] at (0, 1.75) {\emph{Non-faulty} replicas $A_1$, $A_2$, and $B$};
297
+ \draw[thick,rounded corners] (-3.25, -1.25) rectangle (3.25, 1.7);
298
+ \draw[thick] (0, 0) circle (0.25);
299
+ \node[above=-1pt] (n1) at (0, 0.25) {$B$};
300
+
301
+ \draw[thick] (-2, 0) circle (0.65);
302
+ \node[above=-0.25pt] (n2) at (-2, 0.5) {$A_1$};
303
+
304
+ \draw[thick] (2, 0) circle (0.65);
305
+ \node[above=-0.25pt] (n3) at (2, 0.5) {$A_2$};
306
+
307
+ \draw[thick] (0, -2.75) ellipse (2 and 0.5);
308
+ \node[below,align=right] (f) at (0, -3.25) {\emph{Faulty} replicas $\Primary{1}$ and $\Primary{2}$};
309
+
310
+ \node[dot] (p1) at (-1, -2.75) {};
311
+ \node[dot] (p2) at ( 1, -2.75) {};
312
+ \node[right] at (p1) {$\Primary{1}$};
313
+ \node[left] at (p2) {$\Primary{2}$};
314
+
315
+ \draw[semithick] (p1.north) edge[->] node[left,label] {$\SignMessage{\Client_1}{\Transaction_1}$} (-2, -0.8) edge[->] node[left,label,yshift=-2pt,xshift=-2pt] {$\SignMessage{\Client_1}{\Transaction_1}$} (0, -0.25)
316
+ (p2.north) edge[->] node[right=3pt,label] {$\SignMessage{\Client_2}{\Transaction_2}$} ( 2, -0.8) edge[->] node[right,label,yshift=-2pt,xshift=2pt] {$\SignMessage{\Client_2}{\Transaction_2}$} (0, -0.25);
317
+ \end{tikzpicture}
318
+ \caption{An attack possible when parallelizing \BCA{}: malicious primaries can prevent non-faulty replicas from learning all client requests in a round, thereby preventing timely round execution. The faulty primary $\Primary{i}$, $i \in \{1,2\}$, does so by only letting non-faulty replicas $A_i \union B$ participate in instance $\Instance{i}$.}\label{fig:bi_attack}
319
+ \end{figure}
320
+ \end{example}
321
+
322
+ To deal with \emph{in-the-dark} attacks of Example~\ref{ex:collusion}, we can run a standard checkpoint algorithm for each \BCA{} instance: if the system does not reach confirmed failure of $\Primary{i}$ in round $\rn$, $1\leq i \leq \m$, then, by Assumption~\ref{ass:bca:succeed} and~\ref{ass:bca:non_diverge}, at-least-$\nf - \f$ non-faulty replicas have accepted the same transaction $\Transaction$ in round $\rn$ of $\Instance{i}$. Hence, by Assumption~\ref{ass:bca:recover}, a standard checkpoint algorithm (e.g., the one of \PBFT{} or one based on delayed replication~\cite{delay_rep}) that exchanges the state of these at-least-$\nf - \f$ non-faulty replicas among all other replicas is sufficient to assure that all non-faulty replicas eventually accept $\Transaction$. We notice that these checkpoint algorithms can be run concurrently with the operations of \BCA{} instances, thereby adhering to our wait-free design goals~\ref{goal:always} and~\ref{goal:recover}.
323
+
324
+ To reduce the cost of checkpoints, typical consensus systems only perform checkpoints after every $x$-th round for some system-defined constant $x$. Due to in-the-dark attacks, applying such a strategy to \MultiBFT{} means choosing between execution latency and throughput. Consequently, in \MultiBFT{} we do checkpoints on a dynamic \emph{per-need basis}: when replica $\Replica$ receives $\nf - \f$ claims of failure of primaries (via the \Name{Failure} messages of the recovery protocol) in round $\rn$ and $\Replica$ itself finished round $\rn$ for all its instances, then it will participate in any attempt for a checkpoint for round $\rn$. Hence, if an in-the-dark attack affects more than $\f$ distinct non-faulty replicas in round $\rn$, then a successful checkpoint will be made and all non-faulty replicas recover from the attack, accept all transactions in round $\rn$, and execute all these transactions.
325
+
326
+ Using Theorem~\ref{thm:term} to deal with detectable failures and using checkpoint protocols to deal with replicas in-the-dark, we conclude that \MultiBFT{} adheres to design goal~\ref{goal:consensus}:
327
+
328
+ \begin{theorem}
329
+ Consider \MultiBFT{} running in a system with $\n$ replicas. If $\n > 3\f$, then \MultiBFT{} provides consensus in periods in which communication is reliable.
330
+ \end{theorem}
331
+ \subsection{Client Interactions with \MultiBFT{}}
332
+ \label{ss:clients}
333
+
334
+ To maximize performance, it is important that every instance proposes distinct client transactions, as proposing the same client transaction several times would reduce throughput. We have designed \MultiBFT{} with faulty clients in mind, hence, we do not expect cooperation of clients to assure that they send their transactions to only a single primary.
335
+
336
+ To be able to do so, the design of \MultiBFT{} is optimized for the case in which there are always many more concurrent clients than replicas in the system. In this setting, we assign every client $\Client$ to a single primary $\Primary{i}$, $1 \leq i \leq \m = \n$, such that only instance $\Instance{i}$ can propose client requests of $\Client$. For this design to work in \emph{all cases}, we need to solve two issues, however: we need to deal with situations in which primaries do not receive client requests (e.g., during downtime periods in which only few transactions are requested), and we need to deal with faulty primaries that refuse to propose requests of some clients.
337
+
338
+ First, if there are less concurrent clients than replicas in the system, e.g., when demand for services is low, then \MultiBFT{} still needs to process client transactions correctly, but it can do so without optimally utilizing resources available, as this would not impact throughput in this case due to the low demands. If a primary $\Primary{i}$, $1 \leq i \leq \m$, does not have transactions to propose in any round $\rn$ and $\Primary{i}$ detects that other \BCA{} instances are proposing for round $\rn$ (e.g., as it receives proposals), then $\Primary{i}$ proposes a small no-op-request instead.
339
+
340
+ Second, to deal with a primary $\Primary{i}$, $1 \leq i \leq \m$, that refuses to propose requests of some clients, we take a two-step approach. First, we incentivize malicious primaries to \emph{not refuse} services, as otherwise they will be detected faulty and loose the ability to propose transactions altogether. To detect failure of $\Primary{i}$, \MultiBFT{} uses standard techniques to enable a client $\Client$ to \emph{force} execution of a transaction $\Transaction$. First, $\Client$ broadcasts $\SignMessage{\Client}{\Transaction}$ to all replicas. Each non-faulty replica $\Replica$ will then forward $\SignMessage{\Client}{\Transaction}$ to the appropriate primary $\Primary{i}$, $1 \leq i \leq \m$. Next, if the primary $\Primary{i}$ does not propose any transaction requested by $\Client$ within a reasonable amount of time, then $\Replica$ detects failure of $\Primary{i}$. Hence, refusal of $\Primary{i}$ to propose $\SignMessage{\Client}{\Transaction}$ will lead to primary failure, incentivizing malicious primaries to provide service.
341
+
342
+ Finally, we need to deal with primaries that are unwilling or incapable of proposing requests of $\Client$, e.g., when the primary crashes. To do so, $\Client$ can request to be reassigned to another instance $\Instance{j}$, $1 \leq j \leq \m$, by broadcasting a request $m \GETS \Message{SwitchInstance}{\Client, j}$ to all replicas. Reassignment is handled by the coordinating consensus protocol $\Protocol$ for $\Instance{i}$, that will reach consensus on $m$. Malicious clients can try to use reassignment to propose transactions in several instances at the same time. To deal with this, we assume that no instance is more than $\sigma$ rounds behind any other instance (see Section~\ref{sec:improve}). Now, consider the moment at which replica $\Replica$ accepts $m$ and let $\rn(m, \Replica)$ be the maximum round in which any request has been proposed by any instance in which $\Replica$ participates. The primary $\Primary{i}$ will stop proposing transactions of $\Client$ immediately. Any non-faulty replica $\Replica$ will stop accepting transactions of $\Client$ by $\Instance{i}$ after round $\rn(m, \Replica) + \sigma$ and will start accepting transactions of $\Client$ by $\Instance{j}$ after round $\rn(m, \Replica) + 2\sigma$. Finally, $\Primary{j}$ will start proposing transactions of $\Client$ in round $\rn(m, \Primary{j}) + 3\sigma$.
343
+ \section{\MultiBFT{}: Improving Resilience of Consensus}
344
+ \label{sec:improve}
345
+
346
+ Traditional primary-backup consensus protocols rely heavily on the operations of their primary. Although these protocols are designed to deal with primaries that \emph{completely fail} proposing client transactions, they are not designed to deal with many other types of malicious behavior.
347
+ \begin{example}
348
+ Consider a financial service running on a traditional \PBFT{} consensus-based system. In this setting, a malicious primary can affect operations in two malicious ways:
349
+ \begin{enumerate}
350
+ \item \emph{Ordering attack}. The primary sets the order in which transactions are processed and, hence, can choose an ordering that best fits its own interests. To illustrate this, we consider client transactions of the form:
351
+ \begin{multline*}
352
+ \operatorname{transfer}(A, B, n, m) \GETS\texttt{if $\operatorname{amount}(A) > n$ then}\\
353
+ \texttt{$\operatorname{withdraw}(A, m)$; $\operatorname{deposit}(B, m)$.}
354
+ \end{multline*}
355
+ Let $\Transaction_1 = \operatorname{transfer}(\text{Alice}, \text{Bob}, 500, 200)$ and $\Transaction_2 = \operatorname{transfer}(\text{Bob}, \text{Eve}, 400, 300)$. Before processing these transaction, the balance for Alice is $800$, for Bob $300$, and for Eve $100$. In Figure~\ref{fig:tbl_spendings}, we summarize the results of either first executing $\Transaction_1$ or first executing $\Transaction_2$. As is clear from the figure, execution of $\Transaction_1$ influences the outcome of execution of $\Transaction_2$. As primaries choose the ordering of transactions, a malicious primary can chose an ordering whose outcome benefits its own interests, e.g., formulate targeted attacks to affect the execution of the transaction of some clients.
356
+ \begin{figure}[t]
357
+ \centering
358
+ \begin{tabular}{ll||lr||lr}
359
+ \hline
360
+ &Original&\multicolumn{2}{c||}{First $\Transaction_1$, then $\Transaction_2$}&\multicolumn{2}{c}{First $\Transaction_2$, then $\Transaction_1$}\\
361
+ &Balance&$\Transaction_1$ &$\Transaction_2$ &$\Transaction_2$ & $\Transaction_1$\\
362
+ \hline
363
+ \hline
364
+ Alice& 800&600&600&800&600\\
365
+ Bob& 300&500&200&300&500\\
366
+ Eve& 100&100&400&100&100\\
367
+ \hline
368
+ \end{tabular}
369
+ \caption{Illustration of the influence of execution order on the outcome: switching around requests affects the transfer of $\Transaction_2$.}\label{fig:tbl_spendings}
370
+ \end{figure}
371
+ \item \emph{Throttling attack}. The primary sets the pace at which the system processes transactions. We recall that individual replicas rely on \emph{time-outs} to detect malicious behavior of the primary. This approach will fail to detect or deal with primaries that \emph{throttle throughput} by proposing transactions as slow as possible, while preventing failure detection due to time-outs.
372
+ \setcounter{mycounterf}{\value{enumi}}
373
+ \end{enumerate}
374
+ Besides malicious primaries, also other malicious entities can take advantage of a primary-backup consensus protocol:
375
+ \begin{enumerate}
376
+ \setcounter{enumi}{\value{mycounterf}}
377
+ \item \emph{Targeted attack}. As the throughput of a primary-backup system is entirely determined by the primary, attackers can send arbitrary messages to the primary. Even if the primary recognizes that these messages are irrelevant for its operations, it has spend resources (network bandwidth, computational power, and memory) to do so, thereby reducing throughput. Notice that---in the worst case---this can even lead to failure of a non-faulty primary to propose transactions in a timely manner.
378
+ \end{enumerate}
379
+ \end{example}
380
+
381
+ Where traditional consensus-based systems fail to deal with these attacks, the concurrent design of \MultiBFT{} can be used to mitigate these attacks.
382
+
383
+ First, we look at \emph{ordering attacks}. To mitigate this type of attack, we propose a method to deterministically select a different permutation of the order of execution in every round in such a way that this ordering is practically impossible to predict or influence by faulty replicas. Note that for any sequence $S$ of $k = \abs{S}$ values, there exist $k!$ distinct permutations. We write $P(S)$ to denote these permutations of $S$. To deterministically select one of these permutations, we construct a function that maps an integer $h \in \{0, \dots, k!-1\}$ to a unique permutation in $P(S)$. Then we discuss how replicas will uniformly pick $h$. As $\abs{P(S)} = k!$, we can construct the following bijection $f_S : \{ 0, \dots, k!-1 \} \rightarrow P(S)$
384
+ \[
385
+ f_S(i) =
386
+ \begin{cases}
387
+ S &\text{if $\abs{S} = 1$};\\
388
+ f_{S \difference S[q]}(r) \Concat S[q] &\text{if $\abs{S} > 1$},
389
+ \end{cases}
390
+ \]
391
+ in which $q = i \div{(\abs{S}-1)!}$ is the quotient and $r = i \bmod{(\abs{S}-1)!}$ is the remainder of integer division by $(\abs{S}-1)!$. Using induction on the size of $S$, we can prove:
392
+ \begin{lemma}\label{lem:bijection}
393
+ $f_S$ is a bijection from $\{ 0, \dots, \abs{S}! - 1 \}$ to all possible permutations of $S$.
394
+ \end{lemma}
395
+ Let $S$ be the sequence of all transactions accepted in round $\rn$, ordered on increasing instance. The replicas uniformly pick $h = \Hash{S} \bmod (k! - 1)$, in which $\Hash{S}$ is a \emph{strong cryptographic hash function} that maps an arbitrary value $v$ to a numeric digest value in a bounded range such that it is practically impossible to find another value $S'$, $S \neq S'$, with $\Hash{S} = \Hash{S'}$. When at least one primary is non-malicious ($\m > \f$), the final value $h$ is only known after completion of round $\rn$ and it is practically impossible to predictably influence this value. After selecting $h$, all replicas execute the transactions in $S$ in the order given by $f_{S}(h)$.
396
+
397
+ To deal with primaries that throttle their instances, non-faulty replicas will detect failure of those instances that lag behind other instances. In specific, if an instance $\Instance{i}$, $1 \leq i \leq \m$, is $\sigma$ rounds behind any other instances (for some system-dependent constant $\sigma$), then $\Replica$ detects failure of $\Primary{i}$.
398
+
399
+ Finally, we notice that concurrent consensus and \MultiBFT{}---by design---provides \emph{load balancing} with respect to the tasks of the primary, this by spreading the total workload of the system over many primaries. As such, \MultiBFT{} not only improves performance when bounded by the primary bandwidth, but also when performance is bounded by computational power (e.g., due to costly cryptographic primitives), or by message delays. Furthermore, this \emph{load balancing} reduces the load on any single primary to propose and process a given amount of transactions, dampening the effects of any targeted attacks against the resources of a single primary.
400
+ \section{Evaluation of the Performance of \MultiBFT{}}
401
+ \label{sec:eval}
402
+ In the previous sections, we proposed concurrent consensus and presented the design of \MultiBFT{}, our concurrent consensus paradigm. To show that concurrent consensus not only provides benefits in theory, we study the performance of \MultiBFT{} and the effects of concurrent consensus in a practical setting. To do so, we measure the performance of \MultiBFT{} in \RDB{}---our high-performance resilient blockchain fabric---and compare \MultiBFT{} with the well-known primary-backup consensus protocols \PBFT{}, \ZZ{}, \SBFT{}, and \HS{}. With this study, we aim to answer the following questions:
403
+ \begin{enumerate}
404
+ \renewcommand{\theenumi}{Q\arabic{enumi}}
405
+ \item\label{q:1} What is the performance of \MultiBFT{}: does \MultiBFT{} deliver on the promises of concurrent consensus and provide more throughput than any primary-backup consensus protocol can provide?
406
+ \item\label{q:2} What is the scalability of \MultiBFT{}: does \MultiBFT{} deliver on the promises of concurrent consensus and provide better scalability than primary-backup consensus protocols?
407
+ \item\label{q:3} Does \MultiBFT{} provide sufficient load balancing of primary tasks to improve performance of consensus by offsetting any high costs incurred by the primary?
408
+ \item\label{q:4} How does \MultiBFT{} fare under failures?
409
+ \item\label{q:5} What is the impact of batching client transactions on the performance of \MultiBFT{}?
410
+ \end{enumerate}
411
+ First, in Section~\ref{ss:es}, we describe the experimental setup. Then, in Section~\ref{ss:rdb}, we provide a high-level overview of \RDB{} and of its general performance characteristics. Next, in Section~\ref{ss:cons}, we provide details on the consensus protocols we use in this evaluation. Then, in Section~\ref{ss:meas}, we present the experiments we performed and the measurements obtained. Finally, in Section~\ref{ss:discuss}, we interpret these measurements and answer the above research questions.
412
+ \subsection{Experimental Setup}
413
+ \label{ss:es}
414
+ To be able to study the practical performance of \MultiBFT{} and other consensus protocols, we choose to study these protocols in a full resilient database system. To do so, we implemented \MultiBFT{} in \RDB{}. To generate a workload for the protocols, we used the \emph{Yahoo Cloud Serving Benchmark}~\cite{ycsb} provided by the Blockbench macro benchmarks~\cite{blockbench}. In the generated workload, each client transaction queries a YCSB table with half a million active records and $90\%$ of the transactions write and modify records. Prior to the experiments, each replica is initialized with an identical copy of the YCSB table. We perform all experiments in the Google Cloud. In specific, each replica is deployed on a \texttt{c2}-machine with a $16$-core Intel Xeon Cascade Lake CPU running at $\SI{3.8}{\giga\hertz}$ and with $\SI{32}{\giga\byte}$ memory. We use up to $\SI{320}{\kilo{}}$ clients, deployed on $16$ machines.
415
+ \subsection{The \RDB{} Blochchain Fabric}
416
+ \label{ss:rdb}
417
+ The \RDB{} fabric incorporates secure permissioned blockchain technologies to provide resilient data processing. A detailed description of how \RDB{} achieves high-throughput consensus in a practical settings can be found in Gupta et al.~\cite{icdcs,resilientdb-demo,tut-middleware19,tut-debs20,tut-vldb20}. The architecture of \RDB{} is optimized for maximizing throughput via \emph{multi-threading} and \emph{pipelining}. To further maximize throughput and minimize the overhead of any consensus protocol, \RDB{} has built-in support for \emph{batching} of client transactions.
418
+
419
+ We typically group $\SI{100}{\txn\per\batch}$. In this case, the size of a proposal is $\SI{5400}{\byte}$ and of a client reply (for 100 transactions) is $\SI{1748}{\byte}$. The other messages exchanged between replicas during the Byzantine commit algorithm have a size of $\SI{250}{\byte}$. \RDB{} supports \emph{out-of-order processing} of transactions in which primaries can propose future transactions before current transactions are executed. This allows \RDB{} to maximize throughput of any primary-backup protocol that supports out-of-order processing (e.g., \PBFT{}, \ZZ{}, and \SBFT{}) by maximizing bandwidth utilization at the primary.
420
+
421
+ In \RDB{}, each replica maintains a \emph{blockchain ledger} (a journal) that holds an ordered copy of all executed transactions. The ledger not only stores all transactions, but also proofs of their acceptance by a consensus protocols. As these proofs are built using strong cryptographic primitives, the ledger is \emph{immutable} and, hence, can be used to provide \emph{strong data provenance}.
422
+
423
+ In our experiments replicas not only perform consensus, but also communicate with clients and execute transactions. In this practical setting, performance is not fully determined by bandwidth usage due to consensus (as outlined in Section~\ref{ss:limit}), but also by the cost of \emph{communicating with clients}, of sequential \emph{execution} of all transactions, of \emph{cryptography}, and of other steps involved in processing messages and transactions, and by the available memory limitations. To illustrate this, we have measured the effects of \emph{client communication}, \emph{execution}, and \emph{cryptography} on our deployment of \RDB{}.
424
+
425
+ \begin{figure}
426
+ \centering
427
+ \setlength{\tabcolsep}{1pt}
428
+ \begin{tabular}{c@{\quad}c}
429
+ \systemgraph{\dataTPUTfnEXEC}{\axistput}{ne,e}{Reply,Full}{3.4cm}\systemgraph{\dataLATfnEXEC}{\axislat}{ne,e}{Reply,Full}{3.4cm}&
430
+ \systemgraph{\dataTPUTfnSIGNS}{\axistput}{ns,ed,cmac}{None,PK,MAC}{4.95cm}\systemgraph{\dataLATfnSIGNS}{\axislat}{ns,ed,cmac}{None,PK,MAC}{4.95cm}
431
+ \end{tabular}
432
+ \caption{Characteristics of \RDB{} deployed on the Google Cloud. \emph{Left}, the maximum performance of a single replica that receives clients transactions, optionally executes them (Full), and sends replies. \emph{Right}, the performance of \PBFT{} with $\n = 16$ replicas that uses no cryptography (None), uses ED25519 public-key cryptography (PK), or CMAC-AES message authentication codes (MAC) to authenticate messages.}\label{fig:multibft_system}
433
+ \end{figure}
434
+
435
+ In Figure~\ref{fig:multibft_system}, \emph{left}, we present the maximum performance of a single replica that receives clients transactions, optionally executes them (\emph{Full}), and sends replies (without any consensus steps). In this figure, we count the total number of client transactions that are completed during the experiment. As one can see, the system can receive and respond to up-to-$\SI{551}{\kilo\txn\per\sec}$, but can only execute up-to-$\SI{217}{\kilo\txn\per\sec}$.
436
+
437
+ In Figure~\ref{fig:multibft_system}, \emph{right}, we present the maximum performance of \PBFT{} running on $\n=16$ replicas as a function of the cryptographic primitives used to provide \emph{authenticated communication}. In specific, \PBFT{} can either use digital signatures or message authentication codes. For this comparison, we compare \PBFT{} using: (1) a baseline that does not use any message authentication (\emph{None}); (2) ED25519 digital signatures for all messages (\emph{DS}); and (3) CMAC+AES message authentication codes for all messages exchanged between messages and ED25519 digital signatures for client transactions. As can be seen from the results, the costs associated with digital signatures are huge, as their usage reduces performance by $86\%$, whereas message authentication codes only reduce performance by $33\%$.
438
+ \subsection{The Consensus Protocols}
439
+ \label{ss:cons}
440
+ We evaluate the performance of \MultiBFT{} by comparing it with a representative sample of efficient practical primary-backup consensus protocols:
441
+ \paragraph*{\PBFT{}~\cite{pbftj}} We use a heavily optimized out-of-order implementation that uses message authentication codes.
442
+ \paragraph*{\MultiBFT{}} Our \MultiBFT{} implementation follows the design outlined in this paper. We have chosen to turn \PBFT{} into a concurrent consensus protocol. We test with three variants: \MultiBFT{}$_{\n}$ runs $\n$ concurrent instances, \MultiBFT{}$_{\f+1}$ runs $\f+1$ concurrent instances (the minimum to provide the benefits outlined in Section~\ref{sec:improve}), and \MultiBFT{}$_3$ runs $3$ concurrent instances.
443
+ \paragraph*{\ZZ{}~\cite{zyzzyvaj}} As described in Section~\ref{ss:limit}, \ZZ{} has a optimal-case path due to which the performance of \ZZ{} provides an upper-bound for any primary-backup protocol (when no failures occur). Unfortunately, the failure-handling of \ZZ{} is costly, making \ZZ{} unable to deal with any failures efficiently.
444
+ \paragraph*{\SBFT{}~\cite{sbft}} This protocol uses threshold signatures to minimize communication during the state exchange that is part of its Byzantine commit algorithm. Threshold signatures do not reduce the communication costs for the primary to propose client transactions, which have a major influence on performance in practice (See Section~\ref{ss:limit}), but can potentially greatly reduce all other communication costs.
445
+ \paragraph*{\HS{}~\cite{hotstuff}} As \SBFT{}, \HS{} uses threshold signatures to minimize communication. The state-exchange of \HS{} has an extra phase compared to \PBFT{}. This additional phase simplifies changing views in \HS{}, and enables \HS{} to regularly switch primaries (which limits the influence of any faulty replicas). Due to this design, \HS{} does not support out-of-order processing (see Section~\ref{ss:limit}). As a consequence, \HS{} is more affected by message delays than by bandwidth. In our implementation, we have used the efficient single-phase event-based variant of \HS{}.
446
+
447
+ \begin{figure*}
448
+ \centering
449
+ \scalebox{0.5}{\ref{mainlegend}}\\[5pt]
450
+ \setlength{\tabcolsep}{1pt}
451
+ \begin{tabular}{cc@{\quad}cc}
452
+ \resultgraph{\dataTputNodesFF}{(a) Scalability (No Failures)}{\axisnodes}{\axistput}{\axisticksnodes}{legend to name={mainlegend},legend columns=-1,legend entries={\MultiBFT{}$_{\n}$,\MultiBFT{}$_{\f+1}$,\MultiBFT{}$_3$,\PBFT{},\ZZ{},\SBFT{},\HS{}}}&
453
+ \resultgraph{\dataLatNodesFF}{(b) Scalability (No Failures)}{\axisnodes}{\axislat}{\axisticksnodes}{}&
454
+ \resultgraph{\dataTputNodes}{~~~~(c) Scalability (Single Failure)}{\axisnodes}{\axistput}{\axisticksnodes}{}&
455
+ \resultgraph{\dataLatNodes}{(d) Scalability (Single Failure)}{\axisnodes}{\axislat}{\axisticksnodes}{}\\
456
+ \\
457
+ \resultgraph{\dataTputBatch}{(e) Batching (Single Failure)}{\axisbatches}{\axistput}{\axisticksbatches}{}&
458
+ \resultgraph{\dataLatBatch}{(f) Batching (Single Failure)}{\axisbatches}{\axislat}{\axisticksbatches}{}&
459
+ \resultgraph{\dataTputNodesChain}{(g) Out-of-ordering disabled}{\axisnodes}{\axistput}{\axisticksnodes}{}&
460
+ \resultgraph{\dataLatNodesChain}{(h) Out-of-ordering disabled}{\axisnodes}{\axislat}{\axisticksnodes}{}
461
+ \end{tabular}
462
+ \vspace{-3mm}
463
+ \caption{Evaluating system throughput and average latency incurred by \MultiBFT{} and other consensus protocols.}\label{fig:multibft_plots}
464
+ \vspace{-3mm}
465
+ \end{figure*}
466
+ \subsection{The Experiments}
467
+ \label{ss:meas}
468
+
469
+ To be able to answer Question~\ref{q:1}--\ref{q:5}, we perform four experiments in which we measure the performance of \MultiBFT{}. In each experiment, we measure the \emph{throughput} as the number of transactions that are executed per second, and we measure the \emph{latency} as the time from when a client sends a transaction to the time where that client receives a response. We run each experiment for $\SI{180}{\second}$: the first $\SI{60}{\second}$ are warm-up, and measurement results are collected over the next $\SI{120}{\second}$. We average our results over three runs. The results of all four experiments can be found in Figure~\ref{fig:multibft_plots}.
470
+
471
+ In the first experiment, we measure the \emph{best-case performance} of the consensus protocols as a function of the number of replicas when all replicas are non-faulty. We vary the number of replicas between $\n=4$ and $\n=91$ and we use a batch size of $\SI{100}{\txn\per\batch}$. The results can be found in Figure~\ref{fig:multibft_plots}, (a) and (b).
472
+
473
+ In the second experiment, we measure the performance of the consensus protocols as a function of the number of replicas during failure of a single replica. Again, we vary the number of replicas between $\n=4$ and $\n=91$ and we use a batch size of $\SI{100}{\txn\per\batch}$. The results can be found in Figure~\ref{fig:multibft_plots}, (c) and (d).
474
+
475
+ In the third experiment, we measure the performance of the consensus protocols as a function of the number of replicas during failure of a single replica while varying the batch size between $\SI{10}{\txn\per\batch}$ and $\SI{400}{\txn\per\batch}$. We use $\n = 32$ replicas. The results can be found in Figure~\ref{fig:multibft_plots}, (e) and (f).
476
+
477
+ In the fourth and final experiment, we measure the performance of the consensus protocols when outgoing primary bandwidth is not the limiting factor. We do so by disabling \emph{out-of-order processing} in all protocols that support out-of-order processing. This makes the performance of these protocols inherently bounded by the message delay and not by network bandwidth. We study this case by varying the number of replicas between $\n=4$ and $\n=91$ and we use a batch size of $\SI{100}{\txn\per\batch}$. The results can be found in Figure~\ref{fig:multibft_plots}, (g) and (h).
478
+ \subsection{Discussion}
479
+ \label{ss:discuss}
480
+ From the experiments, a few obvious patterns emerge. First, we see that increasing the batch size ((e) and (f)) increases performance of all consensus protocols (\ref{q:5}). This is in line with what one can expect (See Section~\ref{ss:limit} and Section~\ref{sec:propose}). As the gains beyond $\SI{100}{\txn\per\batch}$ are small, we have chosen to use $\SI{100}{\txn\per\batch}$ in all other experiments.
481
+
482
+ Second, we see that the three versions of \MultiBFT{} outperform all other protocols, and the performance of \MultiBFT{} with or without failures is comparable ((a)--(d)). Furthermore, we see that adding concurrency by adding more instances improves performance, as \MultiBFT{}$_{3}$ is outperformed by the other \MultiBFT{} versions. On small deployments with $\n=4, \dots, 16$ replicas, the strength of \MultiBFT{} is most evident, as our \MultiBFT{} implementations approach the maximum rate at which \RDB{} can execute transactions (see Section~\ref{ss:rdb}).
483
+
484
+ Third, we see that \MultiBFT{} easily outperforms \ZZ{}, even in the best-case scenario of no failures ((a) and (b)). We also see that \ZZ{} is---indeed---the fastest primary-backup consensus protocol when no failures happen. This underlines the ability of \MultiBFT{}, and of concurrent consensus in general, to reach throughputs no primary-backup consensus protocol can reach. We also notice that \ZZ{} fails to deal with failures ((c) and (d)), in which case its performance plummets, a case that the other protocols have no issues dealing with.
485
+
486
+ Finally, due to the lack of out-of-order processing capabilities in \HS{}, \HS{} is uncompetitive to out-of-order protocols. When we disable out-of-order processing for all other protocols ((g) and (h)), the strength of the simple design of \HS{} shows: its event-based single-phase design outperforms all other primary-backup consensus protocols. Due to the concurrent design of \MultiBFT{}, a non-out-of-order-\MultiBFT{} is still able to greatly outperform \HS{}, however, as the non-out-of-order variants of \MultiBFT{} balance the entire workload over many primaries. Furthermore, as the throughput is not bound by any replica resources in this case (and only by network delays), the non-out-of-order variants \MultiBFT{}$_{\f+1}$ and \MultiBFT$_\n$ benefit from increasing the number of replicas, as this also increases the amount of concurrent processing (due to increasing the number of instances).
487
+
488
+ \paragraph*{Summary} \MultiBFT{} implementations achieve up to $2.77\times$, $1.53\times$, $38\times$, and $82\times$ higher throughput than
489
+ \SBFT{}, \PBFT{}, \HS{}, and \ZZ{} in single failure experiments.
490
+ \MultiBFT{} implementations achieve up to $2\times$, $1.83\times$, $33\times$, and $1.45\times$ higher throughput than
491
+ \SBFT{}, \PBFT{}, \HS{}, and \ZZ{} in no failure experiments, respectively.
492
+
493
+ Based on these observations, we conclude that \MultiBFT{} delivers on the promises of concurrent consensus. \MultiBFT{} provides more throughput than any primary-backup consensus protocol can provide (\ref{q:1}). Moreover, \MultiBFT{} provides great scalability if throughput is only bounded by the primaries: as the non-out-of-order results show, the load-balancing capabilities of \MultiBFT{} can even offset inefficiencies in other parts of the consensus protocol (\ref{q:2}, \ref{q:3}). Finally, we conclude that \MultiBFT{} can efficiently deal with failures (\ref{q:4}). Hence, \MultiBFT{} meets the design goals~\ref{goal:consensus}--\ref{goal:recover} that we set out in Section~\ref{sec:design}.
494
+ \subsection{Analyzing \MultiBFT{} as a Paradigm}
495
+ Finally, we experimentally illustrate the ability of \MultiBFT{} to act as a paradigm. To do so, we apply \MultiBFT{} to not only \PBFT{}, but also to \ZZ{} and \SBFT{}. In Figure~\ref{fig:rcc-paradigm}, we plot the performance of these three variants of \MultiBFT{}: \MultiP{} (\MultiBFT{}+\PBFT), \MultiZ{} (\MultiBFT{}+\ZZ), and \MultiS{} (\MultiBFT{}+\SBFT). To evaluate the scalability of these protocols, we perform experiments in the optimistic setting with no failures and $\m= \n$ concurrent instances.
496
+
497
+ It is evident from these plots that all \MultiBFT{} variants achieve extremely high throughput. As \SBFT{} and \ZZ{} only require linear communication in the optimistic case, \MultiS{} and \MultiZ{} are able achieve up to $3.33\times$ and $2.78\times$ higher throughputs than \MultiP{}, respectively.
498
+
499
+ Notice that \MultiS{} consistently attains equal or higher throughput than \MultiZ{}, even though \ZZ{} scales better than \SBFT{}. This phenomena is caused by the way \MultiZ{} interacts with clients. In specific, like \ZZ{}, \MultiZ{} requires its clients to wait for responses of all $\n$ replicas. Hence, clients have to wait longer to place new transactions, and consequently \MultiZ{} requires more clients than \MultiS{} to attain maximum performance. Even if we ran \MultiZ{} with $5$ million clients, the largest amount at our disposal, we would not see maximum performance. Due to the low single-primary performance of \ZZ{}, this phenomena does not prevent \ZZ{} to already reach its maximum performance.
500
+
501
+
502
+ \begin{figure}[t]
503
+ \centering
504
+ \scalebox{0.4}{\ref{paralegend}}\\[5pt]
505
+ \vspace{-2mm}
506
+ \setlength{\tabcolsep}{0.2pt}
507
+ \begin{tabular}{cc}
508
+ \paradigmgraph{\dataRCCParadigm}{\axisnodes}{\axistput}{\axisticksnodes}{legend to name={paralegend},legend columns=-1,legend entries={\MultiP{},\MultiZ{},\MultiS{}}}&
509
+ \paradigmgraph{\dataRCCParadigmLat}{\axisnodes}{\axislat}{\axisticksnodes}{}
510
+ \end{tabular}
511
+ \caption{Evaluating system throughput and latency attained by three \MultiBFT{} variants: \MultiP{}, \MultiZ{} and \MultiS{} when there are no failures.}
512
+ \label{fig:rcc-paradigm}
513
+ \end{figure}
514
+ \section{Related Work}
515
+ In Section~\ref{ss:limit}, we already discussed well-known primary-backup consensus protocols such as \PBFT{}, \ZZ{}, and \HS{} and why these protocols are underutilizing resources. Furthermore, there is abundant literature on consensus and on primary-backup consensus in specific (e.g.,~\cite{wild,scaling,untangle,encybd}). Next, we shall focus on the few works that deal with either \emph{improving throughput and scalability} or with \emph{improving resilience}, the two strengths of \MultiBFT{}
516
+
517
+ \paragraph*{Parallelizing consensus}
518
+ Several recent consensus designs propose to run several primaries concurrently, e.g.,~\cite{rbft,mirbft,omada,sarek}. None of these proposals satisfy all design goals of \MultiBFT{}, however. In specific, these proposals all fall short with respect to maximizing potential throughput in all cases, as none of these proposals satisfy the \emph{wait-free} design goals~\ref{goal:always} and~\ref{goal:recover} of \MultiBFT{}.
519
+
520
+ \begin{example}
521
+ The \MirBFT{} protocol proposes to run concurrent instances of \PBFT{}, this in a similar fashion as \MultiBFT{}. The key difference is how \MirBFT{} deals with failures: \MirBFT{} operates in global \emph{epochs} in which a \emph{super-primary} decides which instances are enabled. During any failure, \MirBFT{} will switch to a new epoch via a view-change protocol that temporarily shuts-down all instances and subsequently reduces throughput to zero. This is in sharp contrast to the wait-free design of \MultiBFT{}, in which failures are handled on a per-instance level. In Figure~\ref{fig:mirbft}, we illustrated these differences in the failure recovery of \MultiBFT{} and \MirBFT{}.
522
+
523
+ As is clear from the figure, the fully-coordinated approach of \MirBFT{} results in substantial performance degradation during failure recovery. Hence, \MirBFT{} does not meet design goals~\ref{goal:always} and~\ref{goal:recover}, which is sharply limits the throughput of \MirBFT{} when compared to \MultiBFT{}.
524
+ \end{example}
525
+
526
+
527
+ \begin{figure}
528
+ \begin{tikzpicture}[plot]
529
+ \begin{axis}[ylabel={Throughput (\si{\txn\per\second})},xlabel={Time (\si{\second})},mark size=0pt,width=500pt,legend pos=south east,cycle list name=mycyclelistex,xmin=-5,xmax=145,clip=false]
530
+ \addplot table[x={t},y={multibft}] {\dataExampleMirBFT};
531
+ \addplot table[x={t},y={mirbft}] {\dataExampleMirBFT};
532
+ \addplot table[x={t},y={multibft}] {\dataExampleMirBFT};
533
+
534
+ \draw[dashed,blue,thick] ({axis cs:20,0}|-{rel axis cs:0,0}) -- ({axis cs:20,0}|-{rel axis cs:0,1})
535
+ ({axis cs:40,0}|-{rel axis cs:0,0}) -- ({axis cs:40,0}|-{rel axis cs:0,1})
536
+ ({axis cs:60,0}|-{rel axis cs:0,0}) -- ({axis cs:60,0}|-{rel axis cs:0,1})
537
+ ({axis cs:80,0}|-{rel axis cs:0,0}) -- ({axis cs:80,0}|-{rel axis cs:0,1})
538
+ ({axis cs:100,0}|-{rel axis cs:0,0}) -- ({axis cs:100,0}|-{rel axis cs:0,1})
539
+ ({axis cs:120,0}|-{rel axis cs:0,0}) -- ({axis cs:120,0}|-{rel axis cs:0,1});
540
+
541
+ \node[above] at ({axis cs:20,0}|-{rel axis cs:0,1}) {a};
542
+ \node[above] at ({axis cs:40,0}|-{rel axis cs:0,1}) {b};
543
+ \node[above] at ({axis cs:60,0}|-{rel axis cs:0,1}) {c};
544
+ \node[above] at ({axis cs:80,0}|-{rel axis cs:0,1}) {d};
545
+ \node[above] at ({axis cs:100,0}|-{rel axis cs:0,1}) {e};
546
+ \node[above] at ({axis cs:120,0}|-{rel axis cs:0,1}) {f};
547
+ \legend{\MultiBFT{},\MirBFT{}};
548
+ \end{axis}
549
+ \end{tikzpicture}
550
+ \caption{Throughput of \MultiBFT{} versus \MirBFT{} during instance failures with $\m = 11$ instances. At (a), primary $\Primary{1}$ fails. In \MultiBFT{}, all other instances are unaffected, whereas in \MirBFT{} all replicas need to coordinate recovery. At (b), recovery is finished. In \MultiBFT{}, all instances can resume work, whereas \MirBFT{} halts an instance due to recovery. At (c) primaries $\Primary{1}$ and $\Primary{2}$ fail. In \MultiBFT{}, $\Primary{2}$ will be recovered at (d) and $\Primary{1}$ at (e) (as $\Primary{1}$ failed twice, its recovery in \MultiBFT{} takes twice as long). In \MirBFT{}, recovery is finished at (d), after which \MirBFT{} operates with only $\m = 9$ instances. At (e) and (f), \MirBFT{} decides that the system is sufficiently reliable, and \MirBFT{} enables the remaining instances one at a time.}\label{fig:mirbft}
551
+ \end{figure}
552
+
553
+ \paragraph*{Reducing malicious behavior}
554
+ Several works have observed that traditional consensus protocols only address a narrow set of malicious behavior, namely behavior that prevents any progress~\cite{rbft,spin,prime,aardvark}. Hence, several designs have been proposed to also address behavior that impedes performance without completely preventing progress. One such design is \RBFT{}, which uses concurrent primaries \emph{not} to improve performance---as we propose---but only to mitigate throttling attacks in a way similar to what we described in Section~\ref{sec:improve}. In practice, the design of \RBFT{} results in poor performance at high costs.
555
+
556
+ \HS{}~\cite{hotstuff}, \Name{Spinning}~\cite{spin}, and \Name{Prime}~\cite{prime} all proposes to minimize the influence of malicious primaries by replacing the primary every round. This would not incur the costs of \RBFT{}, while still reducing---but not eliminating---the impact of faulty replicas to severely reduce throughput. Unfortunately, these protocols follow the design of primary-backup consensus protocols and, as discussed in Section~\ref{sec:propose}, these designs are unable to achieve throughputs close to those reached by a concurrent consensus such as \MultiBFT{}.
557
+
558
+
559
+ \paragraph*{Concurrent consensus via sharding}
560
+ Several recent works have proposed to speed up consensus-based systems by incorporating sharding, this either at the data level (e.g.,~\cite{caper,blockchaindb,cerberus,sharper,ahl}) or at the consensus level (e.g.,~\cite{geobft}). In these approaches only a small subset of all replicas, those in a single shard, participate in the consensus on any given transaction, thereby reducing the costs to replicate this transaction and enabling concurrent transaction processing in independent shards. As such, sharded designs can promise huge scalability benefits for easily-sharded workloads. To do so, sharded designs utilize a weaker failure model than the fully-replicated model \MultiBFT{} uses, however. Consider, e.g., a sharded system with $z$ shards of $\n = 3\f+1$ replicas each. In this setting, the system can only tolerate failure of up to $\f$ replicas in a single shard, whereas a fully-replicated system using $z$ replicas could tolerate the failure of any choice of $\lfloor\dsfrac{(z\n-1)}{3}\rfloor$ replicas. Furthermore, sharded designs typically operate consensus protocols such as \PBFT{} in each shard to order local transactions, which opens the opportunity of concurrent consensus and \MultiBFT{} to achieve even higher performance in these designs.
561
+ \section{Conclusion}
562
+ In this paper, we proposed \emph{concurrent consensus} as a major step toward enabling high-throughput and more scalable consensus-based database systems. We have shown that concurrent consensus is in theory able to achieve throughputs that primary-backup consensus systems are unable to achieve. To put the idea of concurrent consensus in practice, we proposed the \MultiBFT{} paradigm that can be used to make normal primary-backup consensus protocols \emph{concurrent}. Furthermore, we showed that \MultiBFT{} is capable of making consensus-based systems more resilient to failures by sharply reducing the impact of faulty replicas on the throughput and operations of the system. We have also put the design of the \MultiBFT{} paradigm to the test by implementing it in \RDB{}, our high-performance resilient blockchain fabric, and comparing it with state-of-the-art primary-backup consensus protocols. Our experiments show that \MultiBFT{} is able to fulfill the promises of concurrent consensus, as it significantly outperforms other consensus protocols and provides better scalability. As such, we believe that \MultiBFT{} opens the door to the development of new high-throughput resilient database and federated transaction processing systems.
563
+
564
+ \paragraph*{Acknowledgements}
565
+ We would like to acknowledge Sajjad Rahnama and Patrick J.\ Liao for their help during the initial stages of this work.
566
+
567
+
568
+ \balance
569
+ \bibliographystyle{IEEEtran}
570
+ \bibliography{bibliography}