ZHANGYUXUAN-zR commited on
Commit
8f4d7a8
·
verified ·
1 Parent(s): ced1d80

Add files using upload-large-folder tool

Browse files
parse/train/BkgBvsC9FQ/BkgBvsC9FQ.md ADDED
@@ -0,0 +1,275 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DIALOGWAE: MULTIMODAL RESPONSE GENERATION WITH CONDITIONAL WASSERSTEIN AUTO-ENCODER
2
+
3
+ Xiaodong $\mathbf { G u } ^ { 1 , 3 }$ , Kyunghyun $\mathbf { C h 0 ^ { 2 , 4 } }$ , Jung-Woo $\mathbf { H } \mathbf { a } ^ { 3 }$ , Sunghun $\mathbf { K i m ^ { 1 , 3 } }$
4
+ 1Hong Kong University of Science and Technology,
5
+ 2New York Universidy, 3Clova AI Research, NAVER, 4CIFAR Azrieli Global Scholar
6
+ 1guxiaodong1987@126.com, hunkim@cse.ust.hk
7
+ 2kyunghyun.cho@nyu.edu, 3jungwoo.ha@navercorp.com
8
+
9
+ # ABSTRACT
10
+
11
+ Variational autoencoders (VAEs) have shown a promise in data-driven conversation modeling. However, most VAE conversation models match the approximate posterior distribution over the latent variables to a simple prior such as standard normal distribution, thereby restricting the generated responses to a relatively simple (e.g., unimodal) scope. In this paper, we propose DialogWAE, a conditional Wasserstein autoencoder (WAE) specially designed for dialogue modeling. Unlike VAEs that impose a simple distribution over the latent variables, DialogWAE models the distribution of data by training a GAN within the latent variable space. Specifically, our model samples from the prior and posterior distributions over the latent variables by transforming context-dependent random noise using neural networks and minimizes the Wasserstein distance between the two distributions. We further develop a Gaussian mixture prior network to enrich the latent space. Experiments on two popular datasets show that DialogWAE outperforms the state-of-the-art approaches in generating more coherent, informative and diverse responses.
12
+
13
+ # 1 INTRODUCTION
14
+
15
+ Neural response generation has been a long interest of natural language research. Most of the recent approaches to data-driven conversation modeling primarily build upon sequence-to-sequence learning (Cho et al., 2014; Sutskever et al., 2014). Previous research has demonstrated that sequenceto-sequence conversation models often suffer from the safe response problem and fail to generate meaningful, diverse on-topic responses (Li et al., 2015; Sato et al., 2017). Conditional variational autoencoders (CVAE) have shown promising results in addressing the safe response issue (Zhao et al., 2017; Shen et al., 2018). CVAE generates the response conditioned on a latent variable - representing topics, tones and situations of the response - and approximate the posterior distribution over latent variables using a neural network. The latent variable captures variabilities in the dialogue and thus generates more diverse responses. However, previous studies have shown that VAE models tend to suffer from the posterior collapse problem, where the decoder learns to ignore the latent variable and degrades to a vanilla RNN (Shen et al., 2018; Park et al., 2018; Bowman et al., 2015). Furthermore, they match the approximate posterior distribution over the latent variables to a simple prior such as standard normal distribution, thereby restricting the generated responses to a relatively simple (e.g., unimodal) scope (Goyal et al., 2017).
16
+
17
+ A number of studies have sought GAN-based approaches (Goodfellow et al., 2014; Li et al., 2017a; Xu et al., 2017) which directly model the distribution of the responses. However, adversarial training over discrete tokens has been known to be difficult due to the non-differentiability. Li et al. (2017a) proposed a hybrid model of GAN and reinforcement learning (RL) where the score predicted by a discriminator is used as a reward to train the generator. However, training with REINFORCE has been observed to be unstable due to the high variance of the gradient estimate (Shen et al., 2017). Xu et al. (2017) make the GAN model differentiable with an approximate word embedding layer. However, their model only injects variability at the word level, thus limited to represent high-level response variabilities such as topics and situations.
18
+
19
+ In this paper, we propose DialogWAE, a novel variant of GAN for neural conversation modeling. Unlike VAE conversation models that impose a simple distribution over latent variables, DialogWAE models the data distribution by training a GAN within the latent variable space. Specifically, it samples from the prior and posterior distributions over the latent variables by transforming contextdependent random noise with neural networks, and minimizes the Wasserstein distance (Arjovsky et al., 2017) between the prior and the approximate posterior distributions. Furthermore, our model takes into account a multimodal1 nature of responses by using a Gaussian mixture prior network. Adversarial training with the Gaussian mixture prior network enables DialogWAE to capture a richer latent space, yielding more coherent, informative and diverse responses.
20
+
21
+ Our main contributions are two-fold: (1) A novel GAN-based model for neural dialogue modeling, which employs GAN to generate samples of latent variables. (2) A Gaussian mixture prior network to sample random noise from a multimodal prior distribution. To the best of our knowledge, the proposed DialogWAE is the first GAN conversation model that exploits multimodal latent structures.
22
+
23
+ We evaluate our model on two benchmark datasets, SwitchBoard (Godfrey and Holliman, 1997) and DailyDialog (Li et al., 2017b). The results demonstrate that our model substantially outperforms the state-of-the-art methods in terms of BLEU, word embedding similarity, and distinct. Furthermore, we highlight how the GAN architecture with a Gaussian mixture prior network facilitates the generation of more diverse and informative responses.
24
+
25
+ # 2 RELATED WORK
26
+
27
+ Encoder-decoder variants To address the “safe response” problem of the naive encoder-decoder conversation model, a number of variants have been proposed. Li et al. (2015) proposed a diversitypromoting objective function to encourage more various responses. Sato et al. (2017) propose to incorporate various types of situations behind conversations when encoding utterances and decoding their responses, respectively. Xing et al. (2017) incorporate topic information into the sequence-tosequence framework to generate informative and interesting responses. Our work is different from the aforementioned studies, as it does not rely on extra information such as situations and topics.
28
+
29
+ VAE conversation models The variational autoencoder (VAE) (Kingma and Welling, 2014) is among the most popular frameworks for dialogue modeling (Zhao et al., 2017; Shen et al., 2018; Park et al., 2018). Serban et al. (2017) propose VHRED, a hierarchical latent variable sequenceto-sequence model that explicitly models multiple levels of variability in the responses. A main challenge for the VAE conversation models is the so-called “posterior collapse”. To alleviate the problem, Zhao et al. (2017) introduce an auxiliary bag-of-words loss to the decoder. They further incorporate extra dialogue information such as dialogue acts and speaker profiles. Shen et al. (2018) propose a collaborative CVAE model which samples the latent variable by transforming a Gaussian noise using neural networks and matches the prior and posterior distributions of the Gaussian noise with KL divergence. Park et al. (2018) propose a variational hierarchical conversation RNN (VHCR) which incorporates a hierarchical structure to latent variables. DialogWAE addresses the limitation of VAE conversation models by using a GAN architecture in the latent space.
30
+
31
+ GAN conversation models Although GAN/CGAN has shown great success in image generation, adapting it to natural dialog generators is a non-trivial task. This is due to the non-differentiable nature of natural language tokens (Shen et al., 2017; Xu et al., 2017). Li et al. (2017a) address this problem by combining GAN with Reinforcement Learning (RL) where the discriminator predicts a reward to optimize the generator. However, training with REINFORCE can be unstable due to the high variance of the sampled gradient (Shen et al., 2017). Xu et al. (2017) make the sequenceto-sequence GAN differentiable by directly multiplying the word probabilities obtained from the decoder to the corresponding word vectors, yielding an approximately vectorized representation of the target sequence. However, their approach injects diversity in the word level rather than the level of the whole responses. DialogWAE differs from exiting GAN conversation models in that it shapes the distribution of responses in a high level latent space rather than direct tokens and does not rely on RL where the gradient variances are large.
32
+
33
+ # 3 PROPOSED APPROACH
34
+
35
+ # 3.1 PROBLEM STATEMENT
36
+
37
+ Let $d { = } [ u _ { 1 } , . . . , u _ { k } ]$ denote a dialogue of $k$ utterances where $u _ { i } { = } [ w _ { 1 } , . . . , w _ { | u _ { i } | } ]$ represents an utterance and $w _ { n }$ denotes the $n$ -th word in $u _ { i }$ . Let $c { = } [ u _ { 1 } , . . . , u _ { k - 1 } ]$ denote a dialogue context, the $k$ -1 historical utterances, and $x { = } u _ { k }$ be a response which means the next utterance. Our goal is to estimate the conditional distribution $p _ { \theta } ( x | c )$ .
38
+
39
+ As $x$ and $c$ are sequences of discrete tokens, it is non-trivial to find a direct coupling between them. Instead, we introduce a continuous latent variable $z$ that represents the high-level representation of the response. The response generation can be viewed as a two-step procedure, where a latent variable $z$ is sampled from a distribution $p _ { \theta } ( z | c )$ on a latent space $\mathcal { Z }$ , and then the response $x$ is decoded from $z$ with $p _ { \theta } ( x | z , c )$ . Under this model, the likelihood of a response is
40
+
41
+ $$
42
+ p _ { \theta } ( x | c ) = \int _ { z } p ( x | c , z ) p ( z | c ) d _ { z } .
43
+ $$
44
+
45
+ The exact log-probability is difficult to compute since it is intractable to marginalize out $z$ . Therefore, we approximate the posterior distribution of $z$ as $q _ { \phi } ( z | x , c )$ which can be computed by a neural network named recognition network. Using this approximate posterior, we can instead compute the evidence lower bound (ELBO):
46
+
47
+ $$
48
+ \begin{array} { r l } & { \log p _ { \theta } ( x \vert c ) = \log \displaystyle \int _ { z } p ( x \vert c , z ) p ( z \vert c ) d z } \\ & { \quad \ge \ell ( x , c ) = { \mathbf E } _ { z \sim q _ { \phi } ( z \vert x , c ) } [ \log p _ { \psi } ( x \vert c , z ) ] - { \mathrm { K L } } ( q _ { \phi } ( z \vert x , c ) \vert \vert p ( z \vert c ) ) , } \end{array}
49
+ $$
50
+
51
+ where $p ( z | c )$ represents the prior distribution of $z$ given $c$ and can be modeled with a neural network named prior network.
52
+
53
+ # 3.2 CONDITIONAL WASSERSTEIN AUTO-ENCODERS FOR DIALOGUE MODELING
54
+
55
+ The conventional VAE conversation models assume that the latent variable $z$ follows a simple prior distribution such as the normal distribution. However, the latent space of real responses is more complicated and difficult to be estimated with such a simple distribution. This often leads to the posterior collapse problem (Shen et al., 2018).
56
+
57
+ Inspired by GAN and the adversarial auto-encoder (AAE) (Makhzani et al., 2015; Tolstikhin et al., 2017; Zhao et al., 2018), we model the distribution of $z$ by training a GAN within the latent space. We sample from the prior and posterior over the latent variables by transforming random noise $\epsilon$ using neural networks. Specifically, the prior sample $\tilde { z } \sim p _ { \theta } ( z | c )$ is generated by a generator $G$ from context-dependent random noise $\tilde { \epsilon }$ , while the approximate posterior sample $z \sim q _ { \phi } ( z | c , x )$ is generated by a generator $Q$ from context-dependent random noise $\epsilon$ . Both ˜ and $\epsilon$ are drawn from a normal distribution whose mean and covariance matrix (assumed diagonal) are computed from $c$ with feed-forward neural networks, prior network and recognition network, respectively:
58
+
59
+ $$
60
+ \tilde { z } = G _ { \theta } ( \tilde { \epsilon } ) , ~ \tilde { \epsilon } \sim \mathcal { N } ( \epsilon ; \tilde { \mu } , \tilde { \sigma } ^ { 2 } I ) , ~ \left[ \operatorname* { l i p } _ { \log \tilde { \sigma } ^ { 2 } } \right] = \tilde { W } f _ { \theta } ( c ) + \tilde { b }
61
+ $$
62
+
63
+ $$
64
+ z = Q _ { \phi } ( \epsilon ) , \epsilon \sim \mathcal { N } ( \epsilon ; \mu , \sigma ^ { 2 } I ) , \left[ \underset { \log \sigma ^ { 2 } } { \mu } \right] = W g _ { \phi } ( \left[ \underset { c } { x } \right] ) + b ,
65
+ $$
66
+
67
+ where $f _ { \theta } ( \cdot )$ and $g _ { \phi } ( \cdot )$ are feed-forward neural networks. Our goal is to minimize the divergence between $p _ { \theta } ( z | c )$ and $\scriptstyle q _ { \phi } ( z | x , c )$ while maximizing the log-probability of a reconstructed response from $z$ . We thus solve the following problem:
68
+
69
+ $$
70
+ \operatorname* { m i n } _ { \theta , \phi , \psi } - E _ { q _ { \phi } ( z | x , c ) } \log p _ { \psi } ( x | z , c ) + W ( q _ { \phi } ( z | x , c ) | | p _ { \theta } ( z | c ) ) ,
71
+ $$
72
+
73
+ where $p _ { \theta } ( z | c )$ and $q _ { \phi } ( z | x , c )$ are neural networks implementing Equations 3 and 4, respectively. $p _ { \psi } ( x | z , c )$ is a decoder. $\mathbf { W } ( \cdot | | \cdot )$ represents the Wasserstein distance between these two distributions (Arjovsky et al., 2017). We choose the Wasserstein distance as the divergence since the WGAN has been shown to produce good results in text generation (Zhao et al., 2018).
74
+
75
+ ![](images/4fb66034806b2cbe66f2cd7927adc2ee539bf63d96c6f57df759244e4e91bd99.jpg)
76
+ Figure 1: Architecture of DialogWAE
77
+
78
+ Figure 1 illustrates an overview of our model. The utterance encoder (RNN) transforms each utterance (including the response $x$ ) in the dialogue into a real-valued vector. For the $i$ -th utterance in the context, the context encoder (RNN) takes as input the concatenation of its encoding vector and the conversation floor (1 if the utterance is from the speaker of the response, otherwise 0) and computes its hidden state ${ h _ { i } ^ { c t x } }$ . The final hidden state of the context encoder is used as the context representation.
79
+
80
+ At generation time, the model draws a random noise ˜ from the prior network (PriNet) which transforms $c$ through a feed-forward network followed by two matrix multiplications which result in the mean and diagonal covariance, respectively. Then, the generator G generates a sample of latent variable $\tilde { z }$ from the noise through a feed-forward network. The decoder RNN decodes the generated $\tilde { z }$ into a response.
81
+
82
+ At training time, the model infers the posterior distribution of the latent variable conditioned on the context $c$ and the response $x$ . The recognition network (RecNet) takes as input the concatenation of both $x$ and $c$ and transforms them through a feed-forward network followed by two matrix multiplications which define the normal mean and diagonal covariance, respectively. A Gaussian noise $\epsilon$ is drawn from the recognition network with the re-parametrization trick. Then, the generator $\mathrm { Q }$ transforms the Gaussian noise $\epsilon$ into a sample of latent variable $z$ through a feed-forward network. The response decoder (RNN) computes the reconstruction loss:
83
+
84
+ $$
85
+ \mathcal { L } _ { r e c } = - E _ { z = Q ( \epsilon ) , \epsilon \sim \mathrm { R e c N e t } ( x , c ) } \log p _ { \psi } ( x | c , z )
86
+ $$
87
+
88
+ We match the approximate posterior with the prior distributions of $z$ by introducing an adversarial discriminator $\mathbf { D }$ which tells apart the prior samples from posterior samples. D is implemented as a feed-forward neural network which takes as input the concatenation of $z$ and $c$ and outputs a real value. We train $\mathbf { D }$ by minimizing the discriminator loss:
89
+
90
+ $$
91
+ \mathcal { L } _ { d i s c } = E _ { \epsilon \sim \mathrm { R e c N e t } ( x , c ) } [ D ( Q ( \epsilon ) , c ) ] - E _ { \tilde { \epsilon } \sim \mathrm { P r i N e t } ( c ) } [ D ( G ( \tilde { \epsilon } ) , c ) ]
92
+ $$
93
+
94
+ 3.3 MULTIMODAL RESPONSE GENERATION WITH A GAUSSIAN MIXTURE PRIOR NETWORK
95
+
96
+ It is a usual practice for the prior distribution in the AAE architecture to be a normal distribution. However, responses often have a multimodal nature reflecting many equally possible situations (Sato et al., 2017), topics and sentiments. A random noise with normal distribution could restrict the generator to output a latent space with a single dominant mode due to the unimodal nature of Gaussian distribution. Consequently, the generated responses could follow simple prototypes.
97
+
98
+ To capture multiple modes in the probability distribution over the latent variable, we further propose to use a distribution that explicitly defines more than one mode. Each time, the noise to generate the latent variable is selected from one of the modes. To achieve so, we make the prior network to capture a mixture of Gaussian distributions, namely, $\mathrm { G M M } ( \{ \pi _ { k } , \mu _ { k } , \sigma _ { k } ^ { 2 } I \} _ { k = 1 } ^ { K } )$ , where $\pi _ { k } , \mu _ { k }$ and $\sigma _ { k }$ are parameters of the -th component. This allows it to learn a multimodal manifold in the latent variable space in a two-step generation process – first choosing a component $k$ with $\pi _ { k }$ , and then sampling Gaussian noise within the selected component:
99
+
100
+ $$
101
+ p ( \epsilon | c ) = \sum _ { k = 1 } ^ { K } v _ { k } \mathcal { N } ( \epsilon ; \mu _ { k } , \sigma _ { k } ^ { 2 } I ) ,
102
+ $$
103
+
104
+ <table><tr><td></td><td>Algorithm 1: DialogWAE Training (UEnc: utterance encoder; CEnc: context encoder; RecNet: recognition network; PriNet: prior network; Dec: decoder) K=3, ncritic=5 in all experiments</td></tr><tr><td></td><td>Initialize {0UEnc,0CEnc,0PriNet,RecNet,0Q,0G,0D,0Dec}</td></tr><tr><td></td><td>2 while not convergence do</td></tr><tr><td>3</td><td>Initialize D</td></tr><tr><td>4</td><td>while D has unsampled batches do</td></tr><tr><td>5</td><td> Sample a mini-batch of N instances {(xn,Cn)}N=1 from D</td></tr><tr><td>6</td><td>Get the representations of context and response xn=UEnc(xn), Cn=CEnc(Cn)</td></tr><tr><td>7</td><td>Sample ∈n from RecNet(xn,Cn) according to Equation 4</td></tr><tr><td>8</td><td>Sample én from PriNet(Cn,K) according to Equation 8-10</td></tr><tr><td>9</td><td>Generate zn=Q(∈n), ≥n=G(én)</td></tr><tr><td>10</td><td>Update {0Q,0G,0PriNet, 0RecNet} by gradient ascent on discriminator loss</td></tr><tr><td>11</td><td></td></tr><tr><td>12 13</td><td>for i∈ {1,.. ,ncritic} do Repeat 5-9</td></tr><tr><td>14</td><td>Update θD by gradient descent on the discriminator loss Ldisc with gradient penalty</td></tr><tr><td>15</td><td>end</td></tr><tr><td>16</td><td>Update {0UEnc,0cEnc, 0RecNet, 0Q,0Dec} by gradient descent on the reconstruction loss</td></tr><tr><td>17</td><td></td></tr><tr><td>18</td><td>end</td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td>19 end</td><td></td></tr></table>
105
+
106
+ where $v _ { k } \in \Delta ^ { K - 1 }$ is a component indicator with class probabilities $\pi _ { 1 } , \cdots , \pi _ { K }$ ; $\pi _ { k }$ is the mixture coefficient of the $k$ -th component of the GMM. They are computed as
107
+
108
+ $$
109
+ \pi _ { k } = { \frac { \exp ( e _ { k } ) } { \sum _ { i = 1 } ^ { K } \exp ( e _ { i } ) } } , { \mathrm { ~ w h e r e ~ } } \left[ \begin{array} { c } { { e _ { k } } } \\ { { \mu _ { k } } } \\ { { \log \sigma _ { k } ^ { 2 } } } \end{array} \right] = W _ { k } f _ { \theta } ( c ) + b _ { k }
110
+ $$
111
+
112
+ Instead of exact sampling, we use Gumbel-Softmax re-parametrization (Kusner and Hernandez- ´ Lobato, 2016) to sample an instance of $v$ :
113
+
114
+ $$
115
+ v _ { k } = \frac { \exp ( ( e _ { k } + g _ { k } ) / \tau ) } { \sum _ { i = 1 } ^ { K } \exp ( ( e _ { i } + g _ { i } ) / \tau ) } ,
116
+ $$
117
+
118
+ where $g _ { i }$ is a Gumbel noise computed as
119
+
120
+ $$
121
+ g _ { i } = - \mathrm { l o g } ( - \mathrm { l o g } ( u _ { i } ) ) , u _ { i } \sim U ( 0 , 1 )
122
+ $$
123
+
124
+ and $\tau { \in } [ 0 , 1 ]$ is the softmax temperature which is set to 0.1 in all experiments.
125
+
126
+ We refer to this framework as DialogWAE-GMP. A comparison of performance with different numbers of prior components will be shown in Section 5.1.
127
+
128
+ # 3.4 TRAINING
129
+
130
+ Our model is trained epochwise until a convergence is reached. In each epoch, we train the model iteratively by alternating two phases − an AE phase during which the reconstruction loss of decoded responses is minimized, and a GAN phase which minimizes the Wasserstein distance between the prior and approximate posterior distributions over the latent variables. The detailed procedures are presented in Algorithm 1
131
+
132
+ # 4 EXPERIMENTAL SETUP
133
+
134
+ Datasets We evaluate our model on two dialogue datasets, Dailydialog (Li et al., 2017b) and Switchboard (Godfrey and Holliman, 1997), which have been widely used in recent studies (Shen et al., 2018; Zhao et al., 2017). Dailydialog has 13,118 daily conversations for a English learner in a daily life. Switchboard contains 2,400 two-way telephone conversations under 70 specified topics. The datasets are separated into training, validation, and test sets with the same ratios as in the baseline papers, that is, 2316:60:62 for Switchboard (Zhao et al., 2017) and 10:1:1 for Dailydialog (Shen et al., 2018), respectively.
135
+
136
+ Metrics To measure the performance of DialogWAE, we adopted several standard metrics widely used in existing studies: BLEU (Papineni et al., 2002), BOW Embedding (Liu et al., 2016) and distinct (Li et al., 2015). In particular, BLEU measures how much a generated response contains $n$ -gram overlaps with the reference. We compute BLEU scores for $\mathrm { n } { < } 4$ using smoothing techniques (smoothing $7 ) ^ { \frac { 1 } { 2 } }$ (Chen and Cherry, 2014). For each test context, we sample 10 responses from the models and compute their BLEU scores. We define $n$ -gram precision and $n$ -gram recall as the average and the maximum score respectively (Zhao et al., 2017).
137
+
138
+ BOW embedding metric is the cosine similarity of bag-of-words embeddings between the hypothesis and the reference. We use three metrics to compute the word embedding similarity: 1. Greedy: greedily matching words in two utterances based on the cosine similarities between their embeddings, and to average the obtained scores (Rus and Lintean, 2012). 2. Average: cosine similarity between the averaged word embeddings in the two utterances (Mitchell and Lapata, 2008). 3. Extrema: cosine similarity between the largest extreme values among the word embeddings in the two utterances (Forgues et al., 2014). We use Glove vectors (Pennington et al., 2014) as the embeddings which will be discussed later in this section. For each test context, we report the maximum BOW embedding score among the 10 sampled responses.
139
+
140
+ Distinct computes the diversity of the generated responses. dist- $n$ is defined as the ratio of unique $n$ -grams $_ { ( \mathrm { n } = 1 , 2 ) }$ over all $n$ -grams in the generated responses. As we sample multiple responses for each test context, we evaluate diversities for both within and among the sampled responses. We define intra-dist as the average of distinct values within each sampled response and inter-dist as the distinct value among all sampled responses.
141
+
142
+ Baselines We compare the performance of DialogWAE with seven recently-proposed baselines for dialogue modeling: (i) HRED: a generalized sequence-to-sequence model with hierarchical RNN encoder (Serban et al., 2016), (ii) SeqGAN: a GAN based model for sequence generation (Li et al., 2017a), (iii) CVAE: a conditional VAE model with KL-annealing (Zhao et al., 2017), (iv) CVAEBOW: a conditional VAE model with a BOW loss (Zhao et al., 2017), (v) CVAE-CO: a collaborative conditional VAE model (Shen et al., 2018), (vi) VHRED: a hierarchical VAE model (Serban et al., 2017), and (vii) VHCR: a hierarchical VAE model with conversation modeling (Park et al., 2018).
143
+
144
+ Training and Evaluation Details We use the gated recurrent units (GRU) (Cho et al., 2014) for the RNN encoders and decoders. The utterance encoder is a bidirectional GRU with 300 hidden units in each direction. The context encoder and decoder are both GRUs with 300 hidden units. The prior and the recognition networks are both 2-layer feed-forward networks of size 200 with tanh non-linearity. The generators $Q$ and $G$ as well as the discriminator $D$ are 3-layer feed-forward networks with ReLU non-linearity (Nair and Hinton, 2010) and hidden sizes of 200, 200 and 400, respectively. The dimension of a latent variable $z$ is set to 200. The initial weights for all fully connected layers are sampled from a uniform distribution [-0.02, 0.02]. The gradient penalty is used when training $D$ (Gulrajani et al., 2017) and its hyper-parameter $\lambda$ is set to 10. We set the vocabulary size to 10,000 and define all the out-of-vocabulary words to a special token <unk>. The word embedding size is 200 and initialized with Glove vectors pre-trained on Twitter (Pennington et al., 2014). The size of context window is set to 10 with a maximum utterance length of 40. We sample responses with greedy decoding so that the randomness entirely come from the latent variables. The baselines were implemented with the same set of hyper-parameters. All the models are implemented with Pytorch $0 . 4 . { \dot { 0 } } ^ { 3 }$ , and fine-tuned with NAVER Smart Machine Learning (NSML) platform (Sung et al., 2017; Kim et al., 2018).
145
+
146
+ The models are trained with mini-batches containing 32 examples each in an end-to-end manner. In the AE phase, the models are trained by SGD with an initial learning rate of 1.0 and gradient clipping at 1 (Pascanu et al., 2013). We decay the learning rate by $40 \%$ every 10th epoch. In the GAN phase, the models are updated using RMSprop (Tieleman and Hinton) with fixed learning rates of $5 \times 1 0 ^ { - 5 }$ and $1 \times 1 0 ^ { - 5 }$ for the generator and the discriminator, respectively. We tune the hyper-parameters on the validation set and measure the performance on the test set.
147
+
148
+ Table 1: Performance comparison on the SwitchBoard dataset (P: n-gram precision, R: n-gram recall, A: Average, E: Extrema, G: Greedy, L: average length)
149
+
150
+ <table><tr><td rowspan="2">Model</td><td colspan="2">BLEU</td><td colspan="2">BOWEmbedding</td><td colspan="2">intra-dist</td><td rowspan="2">L</td></tr><tr><td>R P</td><td>F1</td><td>A E</td><td>G</td><td>dist-1 dist-2</td><td>inter-dist dist-1 dist-2</td></tr><tr><td>HRED</td><td>0.262 0.262</td><td>0.262</td><td>0.820 0.537 0.832</td><td></td><td>0.813 0.452</td><td>0.081 0.045</td><td>12.1</td></tr><tr><td>SeqGAN</td><td>0.282 0.282</td><td>0.282</td><td>0.817 0.515</td><td>0.748</td><td>0.705 0.521</td><td>0.070 0.052</td><td>17.2</td></tr><tr><td>CVAE</td><td>0.295 0.258</td><td>0.275</td><td>0.836 0.572</td><td>0.846</td><td>0.803 0.415</td><td>0.112 0.102</td><td>12.4</td></tr><tr><td>CVAE-BOW</td><td>0.298 0.272</td><td>0.284</td><td>0.828 0.555</td><td>0.840</td><td>0.819 0.493</td><td>0.107 0.099</td><td>12.5</td></tr><tr><td>CVAE-CO</td><td>0.299 0.269</td><td>0.283</td><td>0.839 0.557</td><td>0.855</td><td>0.863 0.581</td><td>0.111 0.110</td><td>10.3</td></tr><tr><td>VHRED</td><td>0.253 0.231</td><td>0.242</td><td>0.810 0.531</td><td>0.844</td><td>0.881 0.522</td><td>0.110 0.092</td><td>8.74</td></tr><tr><td>VHCR</td><td>0.276 0.234</td><td>0.254</td><td>0.826 0.546</td><td>0.851</td><td>0.877 0.536</td><td>0.130 0.131</td><td>9.29</td></tr><tr><td>DialogWAE</td><td>0.394 0.254</td><td>0.309</td><td>0.897 0.627</td><td>0.887</td><td>0.713 0.651</td><td>0.245 0.413</td><td>15.5</td></tr><tr><td>DialogWAE-GMP</td><td>0.420 0.258</td><td>0.319</td><td>0.9250.661</td><td>0.894</td><td>0.713 0.671</td><td>0.333 0.555</td><td>15.2</td></tr></table>
151
+
152
+ Table 2: Performance comparison on the DailyDialog dataset (P: n-gram precision, R: n-gram recall, A: Average, E: Extrema, G: Greedy, L: average response length)
153
+
154
+ <table><tr><td rowspan="2">Model</td><td colspan="2">BLEU</td><td colspan="2">BOW Embedding</td><td colspan="2">intra-dist</td><td rowspan="2">L</td></tr><tr><td>R P</td><td>F1 A</td><td>E G</td><td>dist-1 dist-2</td><td>inter-dist dist-1</td><td>dist-2</td></tr><tr><td>HRED</td><td>0.232 0.232</td><td>0.232</td><td>0.915 0.511</td><td>0.798</td><td>0.935 0.969</td><td>0.093 0.097</td><td>10.1</td></tr><tr><td>SeqGAN</td><td>0.270 0.270</td><td>0.270</td><td>0.907 0.495</td><td>0.774</td><td>0.747 0.806</td><td>0.075 0.081</td><td>15.1</td></tr><tr><td>CVAE</td><td>0.265 0.222</td><td>0.242 0.923</td><td>0.543</td><td>0.811</td><td>0.938 0.973</td><td>0.177 0.222</td><td>10.0</td></tr><tr><td>CVAE-BOW</td><td>0.256 0.224</td><td>0.239</td><td>0.923 0.540</td><td>0.812</td><td>0.947 0.976</td><td>0.165 0.206</td><td>9.8</td></tr><tr><td>CVAE-CO</td><td>0.259 0.244</td><td>0.251</td><td>0.914 0.530</td><td>0.818</td><td>0.821 0.911</td><td>0.106 0.126</td><td>11.2</td></tr><tr><td>VHRED</td><td>0.271 0.260</td><td>0.265</td><td>0.892 0.507</td><td>0.786</td><td>0.633 0.771</td><td>0.071 0.089</td><td>12.7</td></tr><tr><td>VHCR</td><td>0.289 0.266</td><td>0.277</td><td>0.925 0.525</td><td>0.798</td><td>0.768 0.814</td><td>0.105 0.129</td><td>16.9</td></tr><tr><td>DialogWAE</td><td>0.341 0.278</td><td>0.306</td><td>0.948 0.578</td><td>0.846</td><td>0.830 0.940</td><td>0.327 0.583</td><td>18.5</td></tr><tr><td>DialogWAE-GMP</td><td>0.372 0.286 0.323</td><td></td><td>0.952 0.591 0.853</td><td></td><td>0.754 0.892</td><td>0.313 0.597</td><td>24.1</td></tr></table>
155
+
156
+ # 5 EXPERIMENTAL RESULTS
157
+
158
+ # 5.1 QUANTITATIVE ANALYSIS
159
+
160
+ Tables 1 and 2 show the performance of DialogWAE and baselines on the two datasets. DialogWAE outperforms the baselines in the majority of the experiments. In terms of BLEU scores, DialogWAE (with a Gaussian mixture prior network) generates more relevant responses, with the average recall of $4 2 . 0 \%$ and $3 7 . 2 \%$ on both of the datasets. These are significantly higher than those of the CVAE baselines ( $2 9 . 9 \%$ and $2 6 . 5 \%$ ). We observe a similar trend to the BOW embedding metrics.
161
+
162
+ DialogWAE generates more diverse responses than the baselines do. The inter-dist scores are significantly higher than those of the baseline models. This indicates the sampled responses contain more distinct $n$ -grams. DialogWAE does not show better intra-distinct scores. We conjecture that this is due to the relatively long responses generated by the DialogWAE as shown in the last columns of both tables. It is highly unlikely for there to be many repeated $n$ -grams in a short response.
163
+
164
+ We further investigate the effects of the number of prior components $( K )$ . Figure 2 shows the performance of DialogWAE-GMP with respect to the number of prior components $K$ . We vary $K$ from 1 to 9. As shown in the results, in most cases, the performance increases with $K$ and decreases once $K$ reaches a certain threshold, for example, three. The optimal $K$ on both of the datasets was around 3. We attribute this degradation to training difficulty of a mixture density network and the lack of appropriate regularization, which is left for future investigation.
165
+
166
+ # 5.2 QUALITATIVE ANALYSIS
167
+
168
+ Table 3 presents examples of responses generated by the models on the DailyDialog dataset. Due to the space limitation, we report the results of CVAE-CO and DialogWAE-GMP, which are the representative models among the baselines and the proposed models. For each context in the test set, we show three samples of generated responses from each model. As we expected, DialogWAE generates more coherent and diverse responses that cover multiple plausible aspects. Furthermore, we notice that the generated response is long and exhibits informative content. By contrast, the responses generated by the baseline model exhibit relatively limited variations. Although the responses show some variants in contents, most of them share a similar prefix such as “how much”.
169
+
170
+ ![](images/1f89235d673c841fb2611566db116173d9318ab96369d951b19f5a4158862a2f.jpg)
171
+ Figure 2: Performance with respect to the number of prior components
172
+
173
+ Table 3: Examples of context-response pairs for the neural network models. eou indicates a change of turn. ‘Eg.i’ means the $_ { i }$ -th example.
174
+
175
+ <table><tr><td rowspan=2 colspan=2>Context</td><td rowspan=1 colspan=4>Examples of Generated Responses</td></tr><tr><td rowspan=1 colspan=3>CVAE-CO</td><td rowspan=1 colspan=1>DialogWAE-GMP</td></tr><tr><td rowspan=1 colspan=2>thank your for callingworld airline.what canI do for you?_eou_</td><td rowspan=1 colspan=3>Eg.1: i&#x27;m afraid i can&#x27;t find it.Eg.2:what&#x27;s the matter?Eg.3:hi, this is my first time.</td><td rowspan=1 colspan=1>Eg.1: i&#x27;d like to make a reservation for you, pleaseEg.2: do you know where i can get to get?Eg.3:can you tell me the way to the station?</td></tr><tr><td rowspan=1 colspan=2>how much is the rent?_eou_ the rent is$1500 per month.</td><td rowspan=1 colspan=3>Eg.1: how much is the rent?Eg.2: how much is the rent?Eg.3:what is the difference?</td><td rowspan=1 colspan=1>Eg.1: no problem. i&#x27;ll take it.Eg.2: this one is $1.50.50,000 yuan per month.Eg.3: that sounds like a good idea.</td></tr><tr><td rowspan=2 colspan=2>guess who i saw just now?_eou_who?_eou_john smith._eou_ thatbad egg who took the lowroad since he was a boy.</td><td rowspan=2 colspan=3>Eg.1: yes, he is.Eg.2: yes,he isEg.3:yes, he is.</td><td rowspan=2 colspan=1>Eg.1: it is my favorite.Eg.2: no, but i didn&#x27;t think he was able toget married. i had no idea to get her.Eg.3: this is not, but it&#x27;s not that bad.it&#x27;s just a litte bit,but it&#x27;s not too bad.</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2>Eg.2:</td></tr></table>
176
+
177
+ We further investigate the interpretability of Gaussian components in the prior network, that is, what each Gaussian model has captured before generation. We pick a dialogue context “I’d like to invite you to dinner tonight, do you have time?” which is also used in (Shen et al., 2018) for analysis and generate five responses for each Gaussian component. As shown in Table 4, different
178
+
179
+ Table 4: Examples of generated responses for each Gaussian component. ‘Eg.i’ means the $_ { i }$ -th example.
180
+
181
+ <table><tr><td rowspan=1 colspan=1>Context</td><td rowspan=1 colspan=3>I would like to invite you to dinner tonight, do you have time?</td></tr><tr><td rowspan=2 colspan=1>Replies</td><td rowspan=1 colspan=1>Component 1</td><td rowspan=1 colspan=1>Component 2</td><td rowspan=1 colspan=1>Component 3</td></tr><tr><td rowspan=1 colspan=1>Eg.1:Yes,I&#x27;d like to go withyou.Eg.2: My pleasure.Eg.3:OK, thanks.Eg.4: I don&#x27;t know what to doEg.5: Sure. I&#x27;d like to go out</td><td rowspan=1 colspan=1>Eg.1:I&#x27;m not sure.Eg.2: I&#x27;m not sure. What’s theproblem?Eg.3: I&#x27;m sorry to hear that.What&#x27;s the problem?Eg.4: It&#x27;s very kind of you, too.Eg.5: I have no idea. You have to</td><td rowspan=1 colspan=1>Eg.1: Of course I&#x27;m not sure.What&#x27;s the problem?Eg.2: No,I don’t want to go.Eg.3: I want to go to bed, butI&#x27;m not sure.Eg.4: Of course not. you.Eg.5: Do you want to go?</td></tr></table>
182
+
183
+ Gaussian models generate different types of responses: component 1 expresses a strong will, while component 2 expresses some uncertainty, and component 3 generates strong negative responses. The overlap between components is marginal (around 1/5). The results indicate that the Gaussian mixture prior network can successfully capture the multimodal distribution of the responses.
184
+
185
+ To validate the previous results, we further conduct a human evaluation with Amazon Mechanical Turk. We randomly selected 50 dialogues from the test set of DailyDialog. For each dialogue context, we generated 10 responses from each of the four models. Responses for each context were inspected by 5 participants who were asked to choose the model which performs the best in regarding to coherence, diversity and informative while being blind to the underlying algorithms. The average percentages that each model was selected as the best to a specific criterion are shown in Table 5.
186
+
187
+ Table 5: Human judgments for models trained on the Dailydialog dataset
188
+
189
+ <table><tr><td>Model</td><td>Coherence</td><td>Diversity</td><td>Informative</td></tr><tr><td>CVAE-CO</td><td>14.4%</td><td>19.2%</td><td>24.8%</td></tr><tr><td>VHCR</td><td>26.8%</td><td>22.4%</td><td>20.4%</td></tr><tr><td>DialogWAE</td><td>27.6%</td><td>29.2%</td><td>25.6%</td></tr><tr><td>DialogWAE-GMP</td><td>31.6%</td><td>29.2%</td><td>29.6%</td></tr></table>
190
+
191
+ The proposed approach clearly outperforms the current state of the art, CVAE-CO and VHCR, by a large margin in terms of all three metrics. This improvement is especially clear when the Gaussian mixture prior was used.
192
+
193
+ # 6 CONCLUSION
194
+
195
+ In this paper, we introduced a new approach, named DialogWAE, for dialogue modeling. Different from existing VAE models which impose a simple prior distribution over the latent variables, DialogWAE samples the prior and posterior samples of latent variables by transforming contextdependent Gaussian noise using neural networks, and minimizes the Wasserstein distance between the prior and posterior distributions. Furthermore, we enhance the model with a Gaussian mixture prior network to enrich the latent space. Experiments on two widely used datasets show that our model outperforms state-of-the-art VAE models and generates more coherent, informative and diverse responses.
196
+
197
+ # ACKNOWLEDGMENTS
198
+
199
+ This work was supported by the Creative Industrial Technology Development Program (10053249) funded by the Ministry of Trade, Industry and Energy (MOTIE, Korea).
200
+
201
+ # REFERENCES
202
+
203
+ Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein GAN. ´ arXiv preprint arXiv:1701.07875, 2017.
204
+
205
+ Samuel R Bowman, Gabor Angeli, Christopher Potts, and Christopher D Manning. A large annotated corpus for learning natural language inference. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pages 632–642, 2015.
206
+
207
+ Boxing Chen and Colin Cherry. A systematic comparison of smoothing techniques for sentencelevel BLEU. In Proceedings of the Ninth Workshop on Statistical Machine Translation, pages 362–367, 2014.
208
+
209
+ Kyunghyun Cho, Bart Van Merrienboer, C¸ alar G ¨ ulc¸ehre, Dzmitry Bahdanau, Fethi Bougares, Hol- ¨ ger Schwenk, and Yoshua Bengio. Learning phrase representations using RNN Encoder–Decoder for statistical machine translation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1724–1734, Doha, Qatar, October 2014. Association for Computational Linguistics.
210
+
211
+ Gabriel Forgues, Joelle Pineau, Jean-Marie Larcheveque, and R ˆ eal Tremblay. Bootstrapping dia- ´ log systems with word embeddings. In NIPS, modern machine learning and natural language processing workshop, volume 2, 2014.
212
+
213
+ John J Godfrey and Edward Holliman. Switchboard-1 release 2. Linguistic Data Consortium, Philadelphia, 926:927, 1997.
214
+
215
+ Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in neural information processing systems, pages 2672–2680, 2014.
216
+
217
+ Prasoon Goyal, Zhiting Hu, Xiaodan Liang, Chenyu Wang, and Eric P Xing. Nonparametric variational auto-encoders for hierarchical representation learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5094–5102, 2017.
218
+
219
+ Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron C Courville. Improved training of wasserstein GANs. In Advances in Neural Information Processing Systems, pages 5769–5779, 2017.
220
+
221
+ Hanjoo Kim, Minkyu Kim, Dongjoo Seo, Jinwoong Kim, Heungseok Park, Soeun Park, Hyunwoo Jo, KyungHyun Kim, Youngil Yang, Youngkwan Kim, et al. Nsml: Meet the mlaas platform with a real-world case study. arXiv preprint arXiv:1810.09957, 2018.
222
+
223
+ Diederik P Kingma and Max Welling. Auto-encoding variational bayes. In International Conference Learning Representations (ICLR), 2014.
224
+
225
+ Matt J Kusner and Jose Miguel Hern ´ andez-Lobato. GANs for sequences of discrete elements with´ the gumbel-softmax distribution. arXiv preprint arXiv:1611.04051, 2016.
226
+
227
+ Jiwei Li, Michel Galley, Chris Brockett, Jianfeng Gao, and Bill Dolan. A diversity-promoting objective function for neural conversation models. arXiv preprint arXiv:1510.03055, 2015.
228
+
229
+ Jiwei Li, Will Monroe, Tianlin Shi, Alan Ritter, and Dan Jurafsky. Adversarial learning for neural dialogue generation. arXiv preprint arXiv:1701.06547, 2017.
230
+
231
+ Yanran Li, Hui Su, Xiaoyu Shen, Wenjie Li, Ziqiang Cao, and Shuzi Niu. DailyDialog: A manually labelled multi-turn dialogue dataset. In Proceedings of the Eighth International Joint Conference on Natural Language Processing (Volume 1: Long Papers), volume 1, pages 986–995, 2017.
232
+
233
+ Chia-Wei Liu, Ryan Lowe, Iulian V Serban, Michael Noseworthy, Laurent Charlin, and Joelle Pineau. How not to evaluate your dialogue system: An empirical study of unsupervised evaluation metrics for dialogue response generation. arXiv preprint arXiv:1603.08023, 2016.
234
+
235
+ Alireza Makhzani, Jonathon Shlens, Navdeep Jaitly, Ian Goodfellow, and Brendan Frey. Adversarial autoencoders. arXiv preprint arXiv:1511.05644, 2015.
236
+
237
+ Jeff Mitchell and Mirella Lapata. Vector-based models of semantic composition. proceedings of ACL-08: HLT, pages 236–244, 2008.
238
+
239
+ Vinod Nair and Geoffrey E Hinton. Rectified linear units improve restricted boltzmann machines. In Proceedings of the 27th international conference on machine learning (ICML-10), pages 807– 814, 2010.
240
+
241
+ Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. BLEU: a method for automatic evaluation of machine translation. In Proceedings of the 40th annual meeting on association for computational linguistics, pages 311–318. Association for Computational Linguistics, 2002.
242
+
243
+ Yookoon Park, Jaemin Cho, and Gunhee Kim. A hierarchical latent structure for variational conversation modeling. arXiv preprint arXiv:1804.03424, 2018.
244
+
245
+ Razvan Pascanu, Tomas Mikolov, and Yoshua Bengio. On the difficulty of training recurrent neural networks. In International Conference on Machine Learning, pages 1310–1318, 2013.
246
+
247
+ Jeffrey Pennington, Richard Socher, and Christopher Manning. Glove: Global vectors for word representation. In Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), pages 1532–1543, 2014.
248
+
249
+ Vasile Rus and Mihai Lintean. A comparison of greedy and optimal assessment of natural language student input using word-to-word similarity metrics. In Proceedings of the Seventh Workshop on Building Educational Applications Using NLP, pages 157–162. Association for Computational Linguistics, 2012.
250
+
251
+ Shoetsu Sato, Naoki Yoshinaga, Masashi Toyoda, and Masaru Kitsuregawa. Modeling situations in neural chat bots. In Proceedings of ACL 2017, Student Research Workshop, pages 120–127, 2017.
252
+
253
+ Iulian Vlad Serban, Alessandro Sordoni, Yoshua Bengio, Aaron C Courville, and Joelle Pineau. Building end-to-end dialogue systems using generative hierarchical neural network models. In AAAI, volume 16, pages 3776–3784, 2016.
254
+
255
+ Iulian Vlad Serban, Alessandro Sordoni, Ryan Lowe, Laurent Charlin, Joelle Pineau, Aaron C Courville, and Yoshua Bengio. A hierarchical latent variable encoder-decoder model for generating dialogues. In AAAI, pages 3295–3301, 2017.
256
+
257
+ Tianxiao Shen, Tao Lei, Regina Barzilay, and Tommi Jaakkola. Style transfer from non-parallel text by cross-alignment. In Advances in Neural Information Processing Systems, pages 6833–6844, 2017.
258
+
259
+ Xiaoyu Shen, Hui Su, Shuzi Niu, and Vera Demberg. Improving variational encoder-decoders in dialogue generation. arXiv preprint arXiv:1802.02032, 2018.
260
+
261
+ Nako Sung, Minkyu Kim, Hyunwoo Jo, Youngil Yang, Jingwoong Kim, Leonard Lausen, Youngkwan Kim, Gayoung Lee, Donghyun Kwak, Jung-Woo Ha, et al. Nsml: A machine learning platform that enables you to focus on your models. arXiv preprint arXiv:1712.05902, 2017.
262
+
263
+ Ilya Sutskever, Oriol Vinyals, and Quoc VV Le. Sequence to sequence learning with neural networks. In Advances in neural information processing systems, pages 3104–3112, 2014.
264
+
265
+ T Tieleman and G Hinton. Divide the gradient by a running average of its recent magnitude. COURSERA: Neural networks for machine learning. Technical report, Technical Report. Available online: https://zh. coursera. org/learn/neuralnetworks/lecture/YQHki/rmsprop-divide-thegradient-by-a-running-average-of-its-recent-magnitude (accessed on 21 April 2017).
266
+
267
+ Ilya Tolstikhin, Olivier Bousquet, Sylvain Gelly, and Bernhard Schoelkopf. Wasserstein autoencoders. arXiv preprint arXiv:1711.01558, 2017.
268
+
269
+ Chen Xing, Wei Wu, Yu Wu, Jie Liu, Yalou Huang, Ming Zhou, and Wei-Ying Ma. Topic aware neural response generation. In AAAI, volume 17, pages 3351–3357, 2017.
270
+
271
+ Zhen Xu, Bingquan Liu, Baoxun Wang, SUN Chengjie, Xiaolong Wang, Zhuoran Wang, and Chao Qi. Neural response generation via GAN with an approximate embedding layer. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 617–626, 2017.
272
+
273
+ Tiancheng Zhao, Ran Zhao, and Maxine Eskenazi. Learning discourse-level diversity for neural dialog models using conditional variational autoencoders. arXiv preprint arXiv:1703.10960, 2017.
274
+
275
+ Junbo Zhao, Yoon Kim, Kelly Zhang, Alexander M. Rush, and Yann LeCun. Adversarially regularized autoencoders. In Proceedings of the Thirty-fifth International Conference on Machine Learning, ICML 2018, 2018.
parse/train/BkgBvsC9FQ/BkgBvsC9FQ_content_list.json ADDED
@@ -0,0 +1,1417 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "DIALOGWAE: MULTIMODAL RESPONSE GENERATION WITH CONDITIONAL WASSERSTEIN AUTO-ENCODER ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 176,
8
+ 98,
9
+ 820,
10
+ 146
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Xiaodong $\\mathbf { G u } ^ { 1 , 3 }$ , Kyunghyun $\\mathbf { C h 0 ^ { 2 , 4 } }$ , Jung-Woo $\\mathbf { H } \\mathbf { a } ^ { 3 }$ , Sunghun $\\mathbf { K i m ^ { 1 , 3 } }$ \n1Hong Kong University of Science and Technology, \n2New York Universidy, 3Clova AI Research, NAVER, 4CIFAR Azrieli Global Scholar \n1guxiaodong1987@126.com, hunkim@cse.ust.hk \n2kyunghyun.cho@nyu.edu, 3jungwoo.ha@navercorp.com ",
17
+ "bbox": [
18
+ 184,
19
+ 169,
20
+ 748,
21
+ 242
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "ABSTRACT ",
28
+ "text_level": 1,
29
+ "bbox": [
30
+ 454,
31
+ 279,
32
+ 544,
33
+ 294
34
+ ],
35
+ "page_idx": 0
36
+ },
37
+ {
38
+ "type": "text",
39
+ "text": "Variational autoencoders (VAEs) have shown a promise in data-driven conversation modeling. However, most VAE conversation models match the approximate posterior distribution over the latent variables to a simple prior such as standard normal distribution, thereby restricting the generated responses to a relatively simple (e.g., unimodal) scope. In this paper, we propose DialogWAE, a conditional Wasserstein autoencoder (WAE) specially designed for dialogue modeling. Unlike VAEs that impose a simple distribution over the latent variables, DialogWAE models the distribution of data by training a GAN within the latent variable space. Specifically, our model samples from the prior and posterior distributions over the latent variables by transforming context-dependent random noise using neural networks and minimizes the Wasserstein distance between the two distributions. We further develop a Gaussian mixture prior network to enrich the latent space. Experiments on two popular datasets show that DialogWAE outperforms the state-of-the-art approaches in generating more coherent, informative and diverse responses. ",
40
+ "bbox": [
41
+ 233,
42
+ 311,
43
+ 764,
44
+ 518
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "1 INTRODUCTION ",
51
+ "text_level": 1,
52
+ "bbox": [
53
+ 176,
54
+ 550,
55
+ 336,
56
+ 566
57
+ ],
58
+ "page_idx": 0
59
+ },
60
+ {
61
+ "type": "text",
62
+ "text": "Neural response generation has been a long interest of natural language research. Most of the recent approaches to data-driven conversation modeling primarily build upon sequence-to-sequence learning (Cho et al., 2014; Sutskever et al., 2014). Previous research has demonstrated that sequenceto-sequence conversation models often suffer from the safe response problem and fail to generate meaningful, diverse on-topic responses (Li et al., 2015; Sato et al., 2017). Conditional variational autoencoders (CVAE) have shown promising results in addressing the safe response issue (Zhao et al., 2017; Shen et al., 2018). CVAE generates the response conditioned on a latent variable - representing topics, tones and situations of the response - and approximate the posterior distribution over latent variables using a neural network. The latent variable captures variabilities in the dialogue and thus generates more diverse responses. However, previous studies have shown that VAE models tend to suffer from the posterior collapse problem, where the decoder learns to ignore the latent variable and degrades to a vanilla RNN (Shen et al., 2018; Park et al., 2018; Bowman et al., 2015). Furthermore, they match the approximate posterior distribution over the latent variables to a simple prior such as standard normal distribution, thereby restricting the generated responses to a relatively simple (e.g., unimodal) scope (Goyal et al., 2017). ",
63
+ "bbox": [
64
+ 173,
65
+ 584,
66
+ 825,
67
+ 791
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "A number of studies have sought GAN-based approaches (Goodfellow et al., 2014; Li et al., 2017a; Xu et al., 2017) which directly model the distribution of the responses. However, adversarial training over discrete tokens has been known to be difficult due to the non-differentiability. Li et al. (2017a) proposed a hybrid model of GAN and reinforcement learning (RL) where the score predicted by a discriminator is used as a reward to train the generator. However, training with REINFORCE has been observed to be unstable due to the high variance of the gradient estimate (Shen et al., 2017). Xu et al. (2017) make the GAN model differentiable with an approximate word embedding layer. However, their model only injects variability at the word level, thus limited to represent high-level response variabilities such as topics and situations. ",
74
+ "bbox": [
75
+ 174,
76
+ 799,
77
+ 825,
78
+ 924
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "In this paper, we propose DialogWAE, a novel variant of GAN for neural conversation modeling. Unlike VAE conversation models that impose a simple distribution over latent variables, DialogWAE models the data distribution by training a GAN within the latent variable space. Specifically, it samples from the prior and posterior distributions over the latent variables by transforming contextdependent random noise with neural networks, and minimizes the Wasserstein distance (Arjovsky et al., 2017) between the prior and the approximate posterior distributions. Furthermore, our model takes into account a multimodal1 nature of responses by using a Gaussian mixture prior network. Adversarial training with the Gaussian mixture prior network enables DialogWAE to capture a richer latent space, yielding more coherent, informative and diverse responses. ",
85
+ "bbox": [
86
+ 174,
87
+ 103,
88
+ 825,
89
+ 229
90
+ ],
91
+ "page_idx": 1
92
+ },
93
+ {
94
+ "type": "text",
95
+ "text": "Our main contributions are two-fold: (1) A novel GAN-based model for neural dialogue modeling, which employs GAN to generate samples of latent variables. (2) A Gaussian mixture prior network to sample random noise from a multimodal prior distribution. To the best of our knowledge, the proposed DialogWAE is the first GAN conversation model that exploits multimodal latent structures. ",
96
+ "bbox": [
97
+ 176,
98
+ 236,
99
+ 823,
100
+ 291
101
+ ],
102
+ "page_idx": 1
103
+ },
104
+ {
105
+ "type": "text",
106
+ "text": "We evaluate our model on two benchmark datasets, SwitchBoard (Godfrey and Holliman, 1997) and DailyDialog (Li et al., 2017b). The results demonstrate that our model substantially outperforms the state-of-the-art methods in terms of BLEU, word embedding similarity, and distinct. Furthermore, we highlight how the GAN architecture with a Gaussian mixture prior network facilitates the generation of more diverse and informative responses. ",
107
+ "bbox": [
108
+ 174,
109
+ 299,
110
+ 825,
111
+ 368
112
+ ],
113
+ "page_idx": 1
114
+ },
115
+ {
116
+ "type": "text",
117
+ "text": "2 RELATED WORK ",
118
+ "text_level": 1,
119
+ "bbox": [
120
+ 176,
121
+ 392,
122
+ 344,
123
+ 407
124
+ ],
125
+ "page_idx": 1
126
+ },
127
+ {
128
+ "type": "text",
129
+ "text": "Encoder-decoder variants To address the “safe response” problem of the naive encoder-decoder conversation model, a number of variants have been proposed. Li et al. (2015) proposed a diversitypromoting objective function to encourage more various responses. Sato et al. (2017) propose to incorporate various types of situations behind conversations when encoding utterances and decoding their responses, respectively. Xing et al. (2017) incorporate topic information into the sequence-tosequence framework to generate informative and interesting responses. Our work is different from the aforementioned studies, as it does not rely on extra information such as situations and topics. ",
130
+ "bbox": [
131
+ 174,
132
+ 431,
133
+ 825,
134
+ 529
135
+ ],
136
+ "page_idx": 1
137
+ },
138
+ {
139
+ "type": "text",
140
+ "text": "VAE conversation models The variational autoencoder (VAE) (Kingma and Welling, 2014) is among the most popular frameworks for dialogue modeling (Zhao et al., 2017; Shen et al., 2018; Park et al., 2018). Serban et al. (2017) propose VHRED, a hierarchical latent variable sequenceto-sequence model that explicitly models multiple levels of variability in the responses. A main challenge for the VAE conversation models is the so-called “posterior collapse”. To alleviate the problem, Zhao et al. (2017) introduce an auxiliary bag-of-words loss to the decoder. They further incorporate extra dialogue information such as dialogue acts and speaker profiles. Shen et al. (2018) propose a collaborative CVAE model which samples the latent variable by transforming a Gaussian noise using neural networks and matches the prior and posterior distributions of the Gaussian noise with KL divergence. Park et al. (2018) propose a variational hierarchical conversation RNN (VHCR) which incorporates a hierarchical structure to latent variables. DialogWAE addresses the limitation of VAE conversation models by using a GAN architecture in the latent space. ",
141
+ "bbox": [
142
+ 174,
143
+ 536,
144
+ 825,
145
+ 702
146
+ ],
147
+ "page_idx": 1
148
+ },
149
+ {
150
+ "type": "text",
151
+ "text": "GAN conversation models Although GAN/CGAN has shown great success in image generation, adapting it to natural dialog generators is a non-trivial task. This is due to the non-differentiable nature of natural language tokens (Shen et al., 2017; Xu et al., 2017). Li et al. (2017a) address this problem by combining GAN with Reinforcement Learning (RL) where the discriminator predicts a reward to optimize the generator. However, training with REINFORCE can be unstable due to the high variance of the sampled gradient (Shen et al., 2017). Xu et al. (2017) make the sequenceto-sequence GAN differentiable by directly multiplying the word probabilities obtained from the decoder to the corresponding word vectors, yielding an approximately vectorized representation of the target sequence. However, their approach injects diversity in the word level rather than the level of the whole responses. DialogWAE differs from exiting GAN conversation models in that it shapes the distribution of responses in a high level latent space rather than direct tokens and does not rely on RL where the gradient variances are large. ",
152
+ "bbox": [
153
+ 174,
154
+ 709,
155
+ 825,
156
+ 876
157
+ ],
158
+ "page_idx": 1
159
+ },
160
+ {
161
+ "type": "text",
162
+ "text": "3 PROPOSED APPROACH",
163
+ "text_level": 1,
164
+ "bbox": [
165
+ 176,
166
+ 102,
167
+ 392,
168
+ 118
169
+ ],
170
+ "page_idx": 2
171
+ },
172
+ {
173
+ "type": "text",
174
+ "text": "3.1 PROBLEM STATEMENT ",
175
+ "text_level": 1,
176
+ "bbox": [
177
+ 176,
178
+ 133,
179
+ 370,
180
+ 148
181
+ ],
182
+ "page_idx": 2
183
+ },
184
+ {
185
+ "type": "text",
186
+ "text": "Let $d { = } [ u _ { 1 } , . . . , u _ { k } ]$ denote a dialogue of $k$ utterances where $u _ { i } { = } [ w _ { 1 } , . . . , w _ { | u _ { i } | } ]$ represents an utterance and $w _ { n }$ denotes the $n$ -th word in $u _ { i }$ . Let $c { = } [ u _ { 1 } , . . . , u _ { k - 1 } ]$ denote a dialogue context, the $k$ -1 historical utterances, and $x { = } u _ { k }$ be a response which means the next utterance. Our goal is to estimate the conditional distribution $p _ { \\theta } ( x | c )$ . ",
187
+ "bbox": [
188
+ 173,
189
+ 159,
190
+ 825,
191
+ 217
192
+ ],
193
+ "page_idx": 2
194
+ },
195
+ {
196
+ "type": "text",
197
+ "text": "As $x$ and $c$ are sequences of discrete tokens, it is non-trivial to find a direct coupling between them. Instead, we introduce a continuous latent variable $z$ that represents the high-level representation of the response. The response generation can be viewed as a two-step procedure, where a latent variable $z$ is sampled from a distribution $p _ { \\theta } ( z | c )$ on a latent space $\\mathcal { Z }$ , and then the response $x$ is decoded from $z$ with $p _ { \\theta } ( x | z , c )$ . Under this model, the likelihood of a response is ",
198
+ "bbox": [
199
+ 173,
200
+ 222,
201
+ 825,
202
+ 292
203
+ ],
204
+ "page_idx": 2
205
+ },
206
+ {
207
+ "type": "equation",
208
+ "img_path": "images/ff7da56460560643f773c5de13c31445d72661f22f502fec2341c4d7aee2feda.jpg",
209
+ "text": "$$\np _ { \\theta } ( x | c ) = \\int _ { z } p ( x | c , z ) p ( z | c ) d _ { z } .\n$$",
210
+ "text_format": "latex",
211
+ "bbox": [
212
+ 392,
213
+ 299,
214
+ 606,
215
+ 333
216
+ ],
217
+ "page_idx": 2
218
+ },
219
+ {
220
+ "type": "text",
221
+ "text": "The exact log-probability is difficult to compute since it is intractable to marginalize out $z$ . Therefore, we approximate the posterior distribution of $z$ as $q _ { \\phi } ( z | x , c )$ which can be computed by a neural network named recognition network. Using this approximate posterior, we can instead compute the evidence lower bound (ELBO): ",
222
+ "bbox": [
223
+ 174,
224
+ 338,
225
+ 825,
226
+ 395
227
+ ],
228
+ "page_idx": 2
229
+ },
230
+ {
231
+ "type": "equation",
232
+ "img_path": "images/360f1c5d465858d5397225665ec1567b500f8c527416826482524c49f82fb96b.jpg",
233
+ "text": "$$\n\\begin{array} { r l } & { \\log p _ { \\theta } ( x \\vert c ) = \\log \\displaystyle \\int _ { z } p ( x \\vert c , z ) p ( z \\vert c ) d z } \\\\ & { \\quad \\ge \\ell ( x , c ) = { \\mathbf E } _ { z \\sim q _ { \\phi } ( z \\vert x , c ) } [ \\log p _ { \\psi } ( x \\vert c , z ) ] - { \\mathrm { K L } } ( q _ { \\phi } ( z \\vert x , c ) \\vert \\vert p ( z \\vert c ) ) , } \\end{array}\n$$",
234
+ "text_format": "latex",
235
+ "bbox": [
236
+ 267,
237
+ 401,
238
+ 727,
239
+ 455
240
+ ],
241
+ "page_idx": 2
242
+ },
243
+ {
244
+ "type": "text",
245
+ "text": "where $p ( z | c )$ represents the prior distribution of $z$ given $c$ and can be modeled with a neural network named prior network. ",
246
+ "bbox": [
247
+ 174,
248
+ 460,
249
+ 825,
250
+ 489
251
+ ],
252
+ "page_idx": 2
253
+ },
254
+ {
255
+ "type": "text",
256
+ "text": "3.2 CONDITIONAL WASSERSTEIN AUTO-ENCODERS FOR DIALOGUE MODELING",
257
+ "text_level": 1,
258
+ "bbox": [
259
+ 176,
260
+ 506,
261
+ 743,
262
+ 521
263
+ ],
264
+ "page_idx": 2
265
+ },
266
+ {
267
+ "type": "text",
268
+ "text": "The conventional VAE conversation models assume that the latent variable $z$ follows a simple prior distribution such as the normal distribution. However, the latent space of real responses is more complicated and difficult to be estimated with such a simple distribution. This often leads to the posterior collapse problem (Shen et al., 2018). ",
269
+ "bbox": [
270
+ 174,
271
+ 531,
272
+ 825,
273
+ 588
274
+ ],
275
+ "page_idx": 2
276
+ },
277
+ {
278
+ "type": "text",
279
+ "text": "Inspired by GAN and the adversarial auto-encoder (AAE) (Makhzani et al., 2015; Tolstikhin et al., 2017; Zhao et al., 2018), we model the distribution of $z$ by training a GAN within the latent space. We sample from the prior and posterior over the latent variables by transforming random noise $\\epsilon$ using neural networks. Specifically, the prior sample $\\tilde { z } \\sim p _ { \\theta } ( z | c )$ is generated by a generator $G$ from context-dependent random noise $\\tilde { \\epsilon }$ , while the approximate posterior sample $z \\sim q _ { \\phi } ( z | c , x )$ is generated by a generator $Q$ from context-dependent random noise $\\epsilon$ . Both \u000f˜ and $\\epsilon$ are drawn from a normal distribution whose mean and covariance matrix (assumed diagonal) are computed from $c$ with feed-forward neural networks, prior network and recognition network, respectively: ",
280
+ "bbox": [
281
+ 173,
282
+ 594,
283
+ 826,
284
+ 708
285
+ ],
286
+ "page_idx": 2
287
+ },
288
+ {
289
+ "type": "equation",
290
+ "img_path": "images/1dbe8ed8d815d051d2e39a3104b9ba29747c0b6ab367513aa5b48fc138fda4eb.jpg",
291
+ "text": "$$\n\\tilde { z } = G _ { \\theta } ( \\tilde { \\epsilon } ) , ~ \\tilde { \\epsilon } \\sim \\mathcal { N } ( \\epsilon ; \\tilde { \\mu } , \\tilde { \\sigma } ^ { 2 } I ) , ~ \\left[ \\operatorname* { l i p } _ { \\log \\tilde { \\sigma } ^ { 2 } } \\right] = \\tilde { W } f _ { \\theta } ( c ) + \\tilde { b }\n$$",
292
+ "text_format": "latex",
293
+ "bbox": [
294
+ 320,
295
+ 713,
296
+ 678,
297
+ 746
298
+ ],
299
+ "page_idx": 2
300
+ },
301
+ {
302
+ "type": "equation",
303
+ "img_path": "images/1785a083b1c18934eb648d157be5d416df20e835afda85daf87381477015e7d8.jpg",
304
+ "text": "$$\nz = Q _ { \\phi } ( \\epsilon ) , \\epsilon \\sim \\mathcal { N } ( \\epsilon ; \\mu , \\sigma ^ { 2 } I ) , \\left[ \\underset { \\log \\sigma ^ { 2 } } { \\mu } \\right] = W g _ { \\phi } ( \\left[ \\underset { c } { x } \\right] ) + b ,\n$$",
305
+ "text_format": "latex",
306
+ "bbox": [
307
+ 315,
308
+ 751,
309
+ 697,
310
+ 784
311
+ ],
312
+ "page_idx": 2
313
+ },
314
+ {
315
+ "type": "text",
316
+ "text": "where $f _ { \\theta } ( \\cdot )$ and $g _ { \\phi } ( \\cdot )$ are feed-forward neural networks. Our goal is to minimize the divergence between $p _ { \\theta } ( z | c )$ and $\\scriptstyle q _ { \\phi } ( z | x , c )$ while maximizing the log-probability of a reconstructed response from $z$ . We thus solve the following problem: ",
317
+ "bbox": [
318
+ 174,
319
+ 786,
320
+ 823,
321
+ 829
322
+ ],
323
+ "page_idx": 2
324
+ },
325
+ {
326
+ "type": "equation",
327
+ "img_path": "images/8fec31df25c9084bd3080830a4254bc27a4c296bf7c393e785dbbfa04d879698.jpg",
328
+ "text": "$$\n\\operatorname* { m i n } _ { \\theta , \\phi , \\psi } - E _ { q _ { \\phi } ( z | x , c ) } \\log p _ { \\psi } ( x | z , c ) + W ( q _ { \\phi } ( z | x , c ) | | p _ { \\theta } ( z | c ) ) ,\n$$",
329
+ "text_format": "latex",
330
+ "bbox": [
331
+ 307,
332
+ 835,
333
+ 692,
334
+ 859
335
+ ],
336
+ "page_idx": 2
337
+ },
338
+ {
339
+ "type": "text",
340
+ "text": "where $p _ { \\theta } ( z | c )$ and $q _ { \\phi } ( z | x , c )$ are neural networks implementing Equations 3 and 4, respectively. $p _ { \\psi } ( x | z , c )$ is a decoder. $\\mathbf { W } ( \\cdot | | \\cdot )$ represents the Wasserstein distance between these two distributions (Arjovsky et al., 2017). We choose the Wasserstein distance as the divergence since the WGAN has been shown to produce good results in text generation (Zhao et al., 2018). ",
341
+ "bbox": [
342
+ 174,
343
+ 867,
344
+ 823,
345
+ 924
346
+ ],
347
+ "page_idx": 2
348
+ },
349
+ {
350
+ "type": "image",
351
+ "img_path": "images/4fb66034806b2cbe66f2cd7927adc2ee539bf63d96c6f57df759244e4e91bd99.jpg",
352
+ "image_caption": [
353
+ "Figure 1: Architecture of DialogWAE "
354
+ ],
355
+ "image_footnote": [],
356
+ "bbox": [
357
+ 176,
358
+ 99,
359
+ 820,
360
+ 219
361
+ ],
362
+ "page_idx": 3
363
+ },
364
+ {
365
+ "type": "text",
366
+ "text": "Figure 1 illustrates an overview of our model. The utterance encoder (RNN) transforms each utterance (including the response $x$ ) in the dialogue into a real-valued vector. For the $i$ -th utterance in the context, the context encoder (RNN) takes as input the concatenation of its encoding vector and the conversation floor (1 if the utterance is from the speaker of the response, otherwise 0) and computes its hidden state ${ h _ { i } ^ { c t x } }$ . The final hidden state of the context encoder is used as the context representation. ",
367
+ "bbox": [
368
+ 173,
369
+ 252,
370
+ 825,
371
+ 337
372
+ ],
373
+ "page_idx": 3
374
+ },
375
+ {
376
+ "type": "text",
377
+ "text": "At generation time, the model draws a random noise \u000f˜ from the prior network (PriNet) which transforms $c$ through a feed-forward network followed by two matrix multiplications which result in the mean and diagonal covariance, respectively. Then, the generator G generates a sample of latent variable $\\tilde { z }$ from the noise through a feed-forward network. The decoder RNN decodes the generated $\\tilde { z }$ into a response. ",
378
+ "bbox": [
379
+ 174,
380
+ 344,
381
+ 825,
382
+ 414
383
+ ],
384
+ "page_idx": 3
385
+ },
386
+ {
387
+ "type": "text",
388
+ "text": "At training time, the model infers the posterior distribution of the latent variable conditioned on the context $c$ and the response $x$ . The recognition network (RecNet) takes as input the concatenation of both $x$ and $c$ and transforms them through a feed-forward network followed by two matrix multiplications which define the normal mean and diagonal covariance, respectively. A Gaussian noise $\\epsilon$ is drawn from the recognition network with the re-parametrization trick. Then, the generator $\\mathrm { Q }$ transforms the Gaussian noise $\\epsilon$ into a sample of latent variable $z$ through a feed-forward network. The response decoder (RNN) computes the reconstruction loss: ",
389
+ "bbox": [
390
+ 173,
391
+ 420,
392
+ 825,
393
+ 518
394
+ ],
395
+ "page_idx": 3
396
+ },
397
+ {
398
+ "type": "equation",
399
+ "img_path": "images/19cb5aa291dfec70ef83e37910608abe605b04f388a1b176497c233bce260878.jpg",
400
+ "text": "$$\n\\mathcal { L } _ { r e c } = - E _ { z = Q ( \\epsilon ) , \\epsilon \\sim \\mathrm { R e c N e t } ( x , c ) } \\log p _ { \\psi } ( x | c , z )\n$$",
401
+ "text_format": "latex",
402
+ "bbox": [
403
+ 343,
404
+ 532,
405
+ 653,
406
+ 550
407
+ ],
408
+ "page_idx": 3
409
+ },
410
+ {
411
+ "type": "text",
412
+ "text": "We match the approximate posterior with the prior distributions of $z$ by introducing an adversarial discriminator $\\mathbf { D }$ which tells apart the prior samples from posterior samples. D is implemented as a feed-forward neural network which takes as input the concatenation of $z$ and $c$ and outputs a real value. We train $\\mathbf { D }$ by minimizing the discriminator loss: ",
413
+ "bbox": [
414
+ 174,
415
+ 563,
416
+ 825,
417
+ 618
418
+ ],
419
+ "page_idx": 3
420
+ },
421
+ {
422
+ "type": "equation",
423
+ "img_path": "images/5c73dd2e3e9874e83fec33b24b8c4609f3da52d902c35d6af949de3f5eb3f96f.jpg",
424
+ "text": "$$\n\\mathcal { L } _ { d i s c } = E _ { \\epsilon \\sim \\mathrm { R e c N e t } ( x , c ) } [ D ( Q ( \\epsilon ) , c ) ] - E _ { \\tilde { \\epsilon } \\sim \\mathrm { P r i N e t } ( c ) } [ D ( G ( \\tilde { \\epsilon } ) , c ) ]\n$$",
425
+ "text_format": "latex",
426
+ "bbox": [
427
+ 285,
428
+ 631,
429
+ 712,
430
+ 650
431
+ ],
432
+ "page_idx": 3
433
+ },
434
+ {
435
+ "type": "text",
436
+ "text": "3.3 MULTIMODAL RESPONSE GENERATION WITH A GAUSSIAN MIXTURE PRIOR NETWORK ",
437
+ "bbox": [
438
+ 173,
439
+ 671,
440
+ 818,
441
+ 686
442
+ ],
443
+ "page_idx": 3
444
+ },
445
+ {
446
+ "type": "text",
447
+ "text": "It is a usual practice for the prior distribution in the AAE architecture to be a normal distribution. However, responses often have a multimodal nature reflecting many equally possible situations (Sato et al., 2017), topics and sentiments. A random noise with normal distribution could restrict the generator to output a latent space with a single dominant mode due to the unimodal nature of Gaussian distribution. Consequently, the generated responses could follow simple prototypes. ",
448
+ "bbox": [
449
+ 173,
450
+ 700,
451
+ 825,
452
+ 771
453
+ ],
454
+ "page_idx": 3
455
+ },
456
+ {
457
+ "type": "text",
458
+ "text": "To capture multiple modes in the probability distribution over the latent variable, we further propose to use a distribution that explicitly defines more than one mode. Each time, the noise to generate the latent variable is selected from one of the modes. To achieve so, we make the prior network to capture a mixture of Gaussian distributions, namely, $\\mathrm { G M M } ( \\{ \\pi _ { k } , \\mu _ { k } , \\sigma _ { k } ^ { 2 } I \\} _ { k = 1 } ^ { K } )$ , where $\\pi _ { k } , \\mu _ { k }$ and $\\sigma _ { k }$ are parameters of the -th component. This allows it to learn a multimodal manifold in the latent variable space in a two-step generation process – first choosing a component $k$ with $\\pi _ { k }$ , and then sampling Gaussian noise within the selected component: ",
459
+ "bbox": [
460
+ 173,
461
+ 777,
462
+ 825,
463
+ 876
464
+ ],
465
+ "page_idx": 3
466
+ },
467
+ {
468
+ "type": "equation",
469
+ "img_path": "images/6d07c3e0a1520e29b5f5cb6a9220e4c15a8a07ba5834b3a16389a67dbfe03116.jpg",
470
+ "text": "$$\np ( \\epsilon | c ) = \\sum _ { k = 1 } ^ { K } v _ { k } \\mathcal { N } ( \\epsilon ; \\mu _ { k } , \\sigma _ { k } ^ { 2 } I ) ,\n$$",
471
+ "text_format": "latex",
472
+ "bbox": [
473
+ 403,
474
+ 888,
475
+ 593,
476
+ 928
477
+ ],
478
+ "page_idx": 3
479
+ },
480
+ {
481
+ "type": "table",
482
+ "img_path": "images/2fbf3246d1f222dcf629886970cdb9d5be928861ed49636ec5fe63515e9d9ca2.jpg",
483
+ "table_caption": [],
484
+ "table_footnote": [],
485
+ "table_body": "<table><tr><td></td><td>Algorithm 1: DialogWAE Training (UEnc: utterance encoder; CEnc: context encoder; RecNet: recognition network; PriNet: prior network; Dec: decoder) K=3, ncritic=5 in all experiments</td></tr><tr><td></td><td>Initialize {0UEnc,0CEnc,0PriNet,RecNet,0Q,0G,0D,0Dec}</td></tr><tr><td></td><td>2 while not convergence do</td></tr><tr><td>3</td><td>Initialize D</td></tr><tr><td>4</td><td>while D has unsampled batches do</td></tr><tr><td>5</td><td> Sample a mini-batch of N instances {(xn,Cn)}N=1 from D</td></tr><tr><td>6</td><td>Get the representations of context and response xn=UEnc(xn), Cn=CEnc(Cn)</td></tr><tr><td>7</td><td>Sample ∈n from RecNet(xn,Cn) according to Equation 4</td></tr><tr><td>8</td><td>Sample én from PriNet(Cn,K) according to Equation 8-10</td></tr><tr><td>9</td><td>Generate zn=Q(∈n), ≥n=G(én)</td></tr><tr><td>10</td><td>Update {0Q,0G,0PriNet, 0RecNet} by gradient ascent on discriminator loss</td></tr><tr><td>11</td><td></td></tr><tr><td>12 13</td><td>for i∈ {1,.. ,ncritic} do Repeat 5-9</td></tr><tr><td>14</td><td>Update θD by gradient descent on the discriminator loss Ldisc with gradient penalty</td></tr><tr><td>15</td><td>end</td></tr><tr><td>16</td><td>Update {0UEnc,0cEnc, 0RecNet, 0Q,0Dec} by gradient descent on the reconstruction loss</td></tr><tr><td>17</td><td></td></tr><tr><td>18</td><td>end</td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td>19 end</td><td></td></tr></table>",
486
+ "bbox": [
487
+ 155,
488
+ 106,
489
+ 825,
490
+ 436
491
+ ],
492
+ "page_idx": 4
493
+ },
494
+ {
495
+ "type": "text",
496
+ "text": "where $v _ { k } \\in \\Delta ^ { K - 1 }$ is a component indicator with class probabilities $\\pi _ { 1 } , \\cdots , \\pi _ { K }$ ; $\\pi _ { k }$ is the mixture coefficient of the $k$ -th component of the GMM. They are computed as ",
497
+ "bbox": [
498
+ 171,
499
+ 467,
500
+ 823,
501
+ 497
502
+ ],
503
+ "page_idx": 4
504
+ },
505
+ {
506
+ "type": "equation",
507
+ "img_path": "images/0e566274d64fbb8358f7ed3a1664deb6e09b1154b517e9d3fad48fb9a52dea96.jpg",
508
+ "text": "$$\n\\pi _ { k } = { \\frac { \\exp ( e _ { k } ) } { \\sum _ { i = 1 } ^ { K } \\exp ( e _ { i } ) } } , { \\mathrm { ~ w h e r e ~ } } \\left[ \\begin{array} { c } { { e _ { k } } } \\\\ { { \\mu _ { k } } } \\\\ { { \\log \\sigma _ { k } ^ { 2 } } } \\end{array} \\right] = W _ { k } f _ { \\theta } ( c ) + b _ { k }\n$$",
509
+ "text_format": "latex",
510
+ "bbox": [
511
+ 325,
512
+ 502,
513
+ 671,
514
+ 547
515
+ ],
516
+ "page_idx": 4
517
+ },
518
+ {
519
+ "type": "text",
520
+ "text": "Instead of exact sampling, we use Gumbel-Softmax re-parametrization (Kusner and Hernandez- ´ Lobato, 2016) to sample an instance of $v$ : ",
521
+ "bbox": [
522
+ 171,
523
+ 551,
524
+ 821,
525
+ 580
526
+ ],
527
+ "page_idx": 4
528
+ },
529
+ {
530
+ "type": "equation",
531
+ "img_path": "images/7cf032d1995bfefea9a1414f35fc3eebcae48775a3b3300a6f4dbe07eebb5959.jpg",
532
+ "text": "$$\nv _ { k } = \\frac { \\exp ( ( e _ { k } + g _ { k } ) / \\tau ) } { \\sum _ { i = 1 } ^ { K } \\exp ( ( e _ { i } + g _ { i } ) / \\tau ) } ,\n$$",
533
+ "text_format": "latex",
534
+ "bbox": [
535
+ 403,
536
+ 585,
537
+ 593,
538
+ 619
539
+ ],
540
+ "page_idx": 4
541
+ },
542
+ {
543
+ "type": "text",
544
+ "text": "where $g _ { i }$ is a Gumbel noise computed as ",
545
+ "bbox": [
546
+ 174,
547
+ 625,
548
+ 441,
549
+ 640
550
+ ],
551
+ "page_idx": 4
552
+ },
553
+ {
554
+ "type": "equation",
555
+ "img_path": "images/6d1966cc10954741619ad998d030cbb75ebec2a9aa80fa70270b31e61fbb9b7a.jpg",
556
+ "text": "$$\ng _ { i } = - \\mathrm { l o g } ( - \\mathrm { l o g } ( u _ { i } ) ) , u _ { i } \\sim U ( 0 , 1 )\n$$",
557
+ "text_format": "latex",
558
+ "bbox": [
559
+ 379,
560
+ 645,
561
+ 619,
562
+ 662
563
+ ],
564
+ "page_idx": 4
565
+ },
566
+ {
567
+ "type": "text",
568
+ "text": "and $\\tau { \\in } [ 0 , 1 ]$ is the softmax temperature which is set to 0.1 in all experiments. ",
569
+ "bbox": [
570
+ 173,
571
+ 667,
572
+ 679,
573
+ 683
574
+ ],
575
+ "page_idx": 4
576
+ },
577
+ {
578
+ "type": "text",
579
+ "text": "We refer to this framework as DialogWAE-GMP. A comparison of performance with different numbers of prior components will be shown in Section 5.1. ",
580
+ "bbox": [
581
+ 174,
582
+ 689,
583
+ 823,
584
+ 717
585
+ ],
586
+ "page_idx": 4
587
+ },
588
+ {
589
+ "type": "text",
590
+ "text": "3.4 TRAINING ",
591
+ "text_level": 1,
592
+ "bbox": [
593
+ 174,
594
+ 734,
595
+ 287,
596
+ 748
597
+ ],
598
+ "page_idx": 4
599
+ },
600
+ {
601
+ "type": "text",
602
+ "text": "Our model is trained epochwise until a convergence is reached. In each epoch, we train the model iteratively by alternating two phases − an AE phase during which the reconstruction loss of decoded responses is minimized, and a GAN phase which minimizes the Wasserstein distance between the prior and approximate posterior distributions over the latent variables. The detailed procedures are presented in Algorithm 1 ",
603
+ "bbox": [
604
+ 174,
605
+ 760,
606
+ 825,
607
+ 830
608
+ ],
609
+ "page_idx": 4
610
+ },
611
+ {
612
+ "type": "text",
613
+ "text": "4 EXPERIMENTAL SETUP ",
614
+ "text_level": 1,
615
+ "bbox": [
616
+ 176,
617
+ 849,
618
+ 398,
619
+ 866
620
+ ],
621
+ "page_idx": 4
622
+ },
623
+ {
624
+ "type": "text",
625
+ "text": "Datasets We evaluate our model on two dialogue datasets, Dailydialog (Li et al., 2017b) and Switchboard (Godfrey and Holliman, 1997), which have been widely used in recent studies (Shen et al., 2018; Zhao et al., 2017). Dailydialog has 13,118 daily conversations for a English learner in a daily life. Switchboard contains 2,400 two-way telephone conversations under 70 specified topics. The datasets are separated into training, validation, and test sets with the same ratios as in the baseline papers, that is, 2316:60:62 for Switchboard (Zhao et al., 2017) and 10:1:1 for Dailydialog (Shen et al., 2018), respectively. ",
626
+ "bbox": [
627
+ 174,
628
+ 882,
629
+ 825,
630
+ 924
631
+ ],
632
+ "page_idx": 4
633
+ },
634
+ {
635
+ "type": "text",
636
+ "text": "",
637
+ "bbox": [
638
+ 174,
639
+ 103,
640
+ 823,
641
+ 160
642
+ ],
643
+ "page_idx": 5
644
+ },
645
+ {
646
+ "type": "text",
647
+ "text": "Metrics To measure the performance of DialogWAE, we adopted several standard metrics widely used in existing studies: BLEU (Papineni et al., 2002), BOW Embedding (Liu et al., 2016) and distinct (Li et al., 2015). In particular, BLEU measures how much a generated response contains $n$ -gram overlaps with the reference. We compute BLEU scores for $\\mathrm { n } { < } 4$ using smoothing techniques (smoothing $7 ) ^ { \\frac { 1 } { 2 } }$ (Chen and Cherry, 2014). For each test context, we sample 10 responses from the models and compute their BLEU scores. We define $n$ -gram precision and $n$ -gram recall as the average and the maximum score respectively (Zhao et al., 2017). ",
648
+ "bbox": [
649
+ 174,
650
+ 166,
651
+ 825,
652
+ 263
653
+ ],
654
+ "page_idx": 5
655
+ },
656
+ {
657
+ "type": "text",
658
+ "text": "BOW embedding metric is the cosine similarity of bag-of-words embeddings between the hypothesis and the reference. We use three metrics to compute the word embedding similarity: 1. Greedy: greedily matching words in two utterances based on the cosine similarities between their embeddings, and to average the obtained scores (Rus and Lintean, 2012). 2. Average: cosine similarity between the averaged word embeddings in the two utterances (Mitchell and Lapata, 2008). 3. Extrema: cosine similarity between the largest extreme values among the word embeddings in the two utterances (Forgues et al., 2014). We use Glove vectors (Pennington et al., 2014) as the embeddings which will be discussed later in this section. For each test context, we report the maximum BOW embedding score among the 10 sampled responses. ",
659
+ "bbox": [
660
+ 173,
661
+ 270,
662
+ 825,
663
+ 396
664
+ ],
665
+ "page_idx": 5
666
+ },
667
+ {
668
+ "type": "text",
669
+ "text": "Distinct computes the diversity of the generated responses. dist- $n$ is defined as the ratio of unique $n$ -grams $_ { ( \\mathrm { n } = 1 , 2 ) }$ over all $n$ -grams in the generated responses. As we sample multiple responses for each test context, we evaluate diversities for both within and among the sampled responses. We define intra-dist as the average of distinct values within each sampled response and inter-dist as the distinct value among all sampled responses. ",
670
+ "bbox": [
671
+ 174,
672
+ 404,
673
+ 825,
674
+ 472
675
+ ],
676
+ "page_idx": 5
677
+ },
678
+ {
679
+ "type": "text",
680
+ "text": "Baselines We compare the performance of DialogWAE with seven recently-proposed baselines for dialogue modeling: (i) HRED: a generalized sequence-to-sequence model with hierarchical RNN encoder (Serban et al., 2016), (ii) SeqGAN: a GAN based model for sequence generation (Li et al., 2017a), (iii) CVAE: a conditional VAE model with KL-annealing (Zhao et al., 2017), (iv) CVAEBOW: a conditional VAE model with a BOW loss (Zhao et al., 2017), (v) CVAE-CO: a collaborative conditional VAE model (Shen et al., 2018), (vi) VHRED: a hierarchical VAE model (Serban et al., 2017), and (vii) VHCR: a hierarchical VAE model with conversation modeling (Park et al., 2018). ",
681
+ "bbox": [
682
+ 173,
683
+ 479,
684
+ 825,
685
+ 577
686
+ ],
687
+ "page_idx": 5
688
+ },
689
+ {
690
+ "type": "text",
691
+ "text": "Training and Evaluation Details We use the gated recurrent units (GRU) (Cho et al., 2014) for the RNN encoders and decoders. The utterance encoder is a bidirectional GRU with 300 hidden units in each direction. The context encoder and decoder are both GRUs with 300 hidden units. The prior and the recognition networks are both 2-layer feed-forward networks of size 200 with tanh non-linearity. The generators $Q$ and $G$ as well as the discriminator $D$ are 3-layer feed-forward networks with ReLU non-linearity (Nair and Hinton, 2010) and hidden sizes of 200, 200 and 400, respectively. The dimension of a latent variable $z$ is set to 200. The initial weights for all fully connected layers are sampled from a uniform distribution [-0.02, 0.02]. The gradient penalty is used when training $D$ (Gulrajani et al., 2017) and its hyper-parameter $\\lambda$ is set to 10. We set the vocabulary size to 10,000 and define all the out-of-vocabulary words to a special token <unk>. The word embedding size is 200 and initialized with Glove vectors pre-trained on Twitter (Pennington et al., 2014). The size of context window is set to 10 with a maximum utterance length of 40. We sample responses with greedy decoding so that the randomness entirely come from the latent variables. The baselines were implemented with the same set of hyper-parameters. All the models are implemented with Pytorch $0 . 4 . { \\dot { 0 } } ^ { 3 }$ , and fine-tuned with NAVER Smart Machine Learning (NSML) platform (Sung et al., 2017; Kim et al., 2018). ",
692
+ "bbox": [
693
+ 174,
694
+ 584,
695
+ 825,
696
+ 806
697
+ ],
698
+ "page_idx": 5
699
+ },
700
+ {
701
+ "type": "text",
702
+ "text": "The models are trained with mini-batches containing 32 examples each in an end-to-end manner. In the AE phase, the models are trained by SGD with an initial learning rate of 1.0 and gradient clipping at 1 (Pascanu et al., 2013). We decay the learning rate by $40 \\%$ every 10th epoch. In the GAN phase, the models are updated using RMSprop (Tieleman and Hinton) with fixed learning rates of $5 \\times 1 0 ^ { - 5 }$ and $1 \\times 1 0 ^ { - 5 }$ for the generator and the discriminator, respectively. We tune the hyper-parameters on the validation set and measure the performance on the test set. ",
703
+ "bbox": [
704
+ 174,
705
+ 813,
706
+ 825,
707
+ 869
708
+ ],
709
+ "page_idx": 5
710
+ },
711
+ {
712
+ "type": "table",
713
+ "img_path": "images/975a60fe0240c0d826731fc448d1d55fe68560134a186a8635f1c3d9c99efbff.jpg",
714
+ "table_caption": [
715
+ "Table 1: Performance comparison on the SwitchBoard dataset (P: n-gram precision, R: n-gram recall, A: Average, E: Extrema, G: Greedy, L: average length) "
716
+ ],
717
+ "table_footnote": [],
718
+ "table_body": "<table><tr><td rowspan=\"2\">Model</td><td colspan=\"2\">BLEU</td><td colspan=\"2\">BOWEmbedding</td><td colspan=\"2\">intra-dist</td><td rowspan=\"2\">L</td></tr><tr><td>R P</td><td>F1</td><td>A E</td><td>G</td><td>dist-1 dist-2</td><td>inter-dist dist-1 dist-2</td></tr><tr><td>HRED</td><td>0.262 0.262</td><td>0.262</td><td>0.820 0.537 0.832</td><td></td><td>0.813 0.452</td><td>0.081 0.045</td><td>12.1</td></tr><tr><td>SeqGAN</td><td>0.282 0.282</td><td>0.282</td><td>0.817 0.515</td><td>0.748</td><td>0.705 0.521</td><td>0.070 0.052</td><td>17.2</td></tr><tr><td>CVAE</td><td>0.295 0.258</td><td>0.275</td><td>0.836 0.572</td><td>0.846</td><td>0.803 0.415</td><td>0.112 0.102</td><td>12.4</td></tr><tr><td>CVAE-BOW</td><td>0.298 0.272</td><td>0.284</td><td>0.828 0.555</td><td>0.840</td><td>0.819 0.493</td><td>0.107 0.099</td><td>12.5</td></tr><tr><td>CVAE-CO</td><td>0.299 0.269</td><td>0.283</td><td>0.839 0.557</td><td>0.855</td><td>0.863 0.581</td><td>0.111 0.110</td><td>10.3</td></tr><tr><td>VHRED</td><td>0.253 0.231</td><td>0.242</td><td>0.810 0.531</td><td>0.844</td><td>0.881 0.522</td><td>0.110 0.092</td><td>8.74</td></tr><tr><td>VHCR</td><td>0.276 0.234</td><td>0.254</td><td>0.826 0.546</td><td>0.851</td><td>0.877 0.536</td><td>0.130 0.131</td><td>9.29</td></tr><tr><td>DialogWAE</td><td>0.394 0.254</td><td>0.309</td><td>0.897 0.627</td><td>0.887</td><td>0.713 0.651</td><td>0.245 0.413</td><td>15.5</td></tr><tr><td>DialogWAE-GMP</td><td>0.420 0.258</td><td>0.319</td><td>0.9250.661</td><td>0.894</td><td>0.713 0.671</td><td>0.333 0.555</td><td>15.2</td></tr></table>",
719
+ "bbox": [
720
+ 179,
721
+ 128,
722
+ 813,
723
+ 275
724
+ ],
725
+ "page_idx": 6
726
+ },
727
+ {
728
+ "type": "table",
729
+ "img_path": "images/6877b5a0f1ae96d92752d1b54a7e1b21e354a642b5144b3ab7a4c31c9a17572b.jpg",
730
+ "table_caption": [
731
+ "Table 2: Performance comparison on the DailyDialog dataset (P: n-gram precision, R: n-gram recall, A: Average, E: Extrema, G: Greedy, L: average response length) "
732
+ ],
733
+ "table_footnote": [],
734
+ "table_body": "<table><tr><td rowspan=\"2\">Model</td><td colspan=\"2\">BLEU</td><td colspan=\"2\">BOW Embedding</td><td colspan=\"2\">intra-dist</td><td rowspan=\"2\">L</td></tr><tr><td>R P</td><td>F1 A</td><td>E G</td><td>dist-1 dist-2</td><td>inter-dist dist-1</td><td>dist-2</td></tr><tr><td>HRED</td><td>0.232 0.232</td><td>0.232</td><td>0.915 0.511</td><td>0.798</td><td>0.935 0.969</td><td>0.093 0.097</td><td>10.1</td></tr><tr><td>SeqGAN</td><td>0.270 0.270</td><td>0.270</td><td>0.907 0.495</td><td>0.774</td><td>0.747 0.806</td><td>0.075 0.081</td><td>15.1</td></tr><tr><td>CVAE</td><td>0.265 0.222</td><td>0.242 0.923</td><td>0.543</td><td>0.811</td><td>0.938 0.973</td><td>0.177 0.222</td><td>10.0</td></tr><tr><td>CVAE-BOW</td><td>0.256 0.224</td><td>0.239</td><td>0.923 0.540</td><td>0.812</td><td>0.947 0.976</td><td>0.165 0.206</td><td>9.8</td></tr><tr><td>CVAE-CO</td><td>0.259 0.244</td><td>0.251</td><td>0.914 0.530</td><td>0.818</td><td>0.821 0.911</td><td>0.106 0.126</td><td>11.2</td></tr><tr><td>VHRED</td><td>0.271 0.260</td><td>0.265</td><td>0.892 0.507</td><td>0.786</td><td>0.633 0.771</td><td>0.071 0.089</td><td>12.7</td></tr><tr><td>VHCR</td><td>0.289 0.266</td><td>0.277</td><td>0.925 0.525</td><td>0.798</td><td>0.768 0.814</td><td>0.105 0.129</td><td>16.9</td></tr><tr><td>DialogWAE</td><td>0.341 0.278</td><td>0.306</td><td>0.948 0.578</td><td>0.846</td><td>0.830 0.940</td><td>0.327 0.583</td><td>18.5</td></tr><tr><td>DialogWAE-GMP</td><td>0.372 0.286 0.323</td><td></td><td>0.952 0.591 0.853</td><td></td><td>0.754 0.892</td><td>0.313 0.597</td><td>24.1</td></tr></table>",
735
+ "bbox": [
736
+ 176,
737
+ 315,
738
+ 818,
739
+ 463
740
+ ],
741
+ "page_idx": 6
742
+ },
743
+ {
744
+ "type": "text",
745
+ "text": "",
746
+ "bbox": [
747
+ 176,
748
+ 477,
749
+ 823,
750
+ 505
751
+ ],
752
+ "page_idx": 6
753
+ },
754
+ {
755
+ "type": "text",
756
+ "text": "5 EXPERIMENTAL RESULTS ",
757
+ "text_level": 1,
758
+ "bbox": [
759
+ 176,
760
+ 515,
761
+ 419,
762
+ 531
763
+ ],
764
+ "page_idx": 6
765
+ },
766
+ {
767
+ "type": "text",
768
+ "text": "5.1 QUANTITATIVE ANALYSIS ",
769
+ "text_level": 1,
770
+ "bbox": [
771
+ 176,
772
+ 546,
773
+ 397,
774
+ 561
775
+ ],
776
+ "page_idx": 6
777
+ },
778
+ {
779
+ "type": "text",
780
+ "text": "Tables 1 and 2 show the performance of DialogWAE and baselines on the two datasets. DialogWAE outperforms the baselines in the majority of the experiments. In terms of BLEU scores, DialogWAE (with a Gaussian mixture prior network) generates more relevant responses, with the average recall of $4 2 . 0 \\%$ and $3 7 . 2 \\%$ on both of the datasets. These are significantly higher than those of the CVAE baselines ( $2 9 . 9 \\%$ and $2 6 . 5 \\%$ ). We observe a similar trend to the BOW embedding metrics. ",
781
+ "bbox": [
782
+ 174,
783
+ 573,
784
+ 825,
785
+ 642
786
+ ],
787
+ "page_idx": 6
788
+ },
789
+ {
790
+ "type": "text",
791
+ "text": "DialogWAE generates more diverse responses than the baselines do. The inter-dist scores are significantly higher than those of the baseline models. This indicates the sampled responses contain more distinct $n$ -grams. DialogWAE does not show better intra-distinct scores. We conjecture that this is due to the relatively long responses generated by the DialogWAE as shown in the last columns of both tables. It is highly unlikely for there to be many repeated $n$ -grams in a short response. ",
792
+ "bbox": [
793
+ 174,
794
+ 650,
795
+ 825,
796
+ 719
797
+ ],
798
+ "page_idx": 6
799
+ },
800
+ {
801
+ "type": "text",
802
+ "text": "We further investigate the effects of the number of prior components $( K )$ . Figure 2 shows the performance of DialogWAE-GMP with respect to the number of prior components $K$ . We vary $K$ from 1 to 9. As shown in the results, in most cases, the performance increases with $K$ and decreases once $K$ reaches a certain threshold, for example, three. The optimal $K$ on both of the datasets was around 3. We attribute this degradation to training difficulty of a mixture density network and the lack of appropriate regularization, which is left for future investigation. ",
803
+ "bbox": [
804
+ 174,
805
+ 727,
806
+ 825,
807
+ 810
808
+ ],
809
+ "page_idx": 6
810
+ },
811
+ {
812
+ "type": "text",
813
+ "text": "5.2 QUALITATIVE ANALYSIS ",
814
+ "text_level": 1,
815
+ "bbox": [
816
+ 174,
817
+ 828,
818
+ 387,
819
+ 842
820
+ ],
821
+ "page_idx": 6
822
+ },
823
+ {
824
+ "type": "text",
825
+ "text": "Table 3 presents examples of responses generated by the models on the DailyDialog dataset. Due to the space limitation, we report the results of CVAE-CO and DialogWAE-GMP, which are the representative models among the baselines and the proposed models. For each context in the test set, we show three samples of generated responses from each model. As we expected, DialogWAE generates more coherent and diverse responses that cover multiple plausible aspects. Furthermore, we notice that the generated response is long and exhibits informative content. By contrast, the responses generated by the baseline model exhibit relatively limited variations. Although the responses show some variants in contents, most of them share a similar prefix such as “how much”. ",
826
+ "bbox": [
827
+ 174,
828
+ 854,
829
+ 825,
830
+ 924
831
+ ],
832
+ "page_idx": 6
833
+ },
834
+ {
835
+ "type": "image",
836
+ "img_path": "images/1f89235d673c841fb2611566db116173d9318ab96369d951b19f5a4158862a2f.jpg",
837
+ "image_caption": [
838
+ "Figure 2: Performance with respect to the number of prior components "
839
+ ],
840
+ "image_footnote": [],
841
+ "bbox": [
842
+ 235,
843
+ 99,
844
+ 761,
845
+ 356
846
+ ],
847
+ "page_idx": 7
848
+ },
849
+ {
850
+ "type": "table",
851
+ "img_path": "images/3f1a99f4770cb270e5da5e718f69d81970dbeef9b5f60cb5898096c0aa80f0dc.jpg",
852
+ "table_caption": [
853
+ "Table 3: Examples of context-response pairs for the neural network models. eou indicates a change of turn. ‘Eg.i’ means the $_ { i }$ -th example. "
854
+ ],
855
+ "table_footnote": [],
856
+ "table_body": "<table><tr><td rowspan=2 colspan=2>Context</td><td rowspan=1 colspan=4>Examples of Generated Responses</td></tr><tr><td rowspan=1 colspan=3>CVAE-CO</td><td rowspan=1 colspan=1>DialogWAE-GMP</td></tr><tr><td rowspan=1 colspan=2>thank your for callingworld airline.what canI do for you?_eou_</td><td rowspan=1 colspan=3>Eg.1: i&#x27;m afraid i can&#x27;t find it.Eg.2:what&#x27;s the matter?Eg.3:hi, this is my first time.</td><td rowspan=1 colspan=1>Eg.1: i&#x27;d like to make a reservation for you, pleaseEg.2: do you know where i can get to get?Eg.3:can you tell me the way to the station?</td></tr><tr><td rowspan=1 colspan=2>how much is the rent?_eou_ the rent is$1500 per month.</td><td rowspan=1 colspan=3>Eg.1: how much is the rent?Eg.2: how much is the rent?Eg.3:what is the difference?</td><td rowspan=1 colspan=1>Eg.1: no problem. i&#x27;ll take it.Eg.2: this one is $1.50.50,000 yuan per month.Eg.3: that sounds like a good idea.</td></tr><tr><td rowspan=2 colspan=2>guess who i saw just now?_eou_who?_eou_john smith._eou_ thatbad egg who took the lowroad since he was a boy.</td><td rowspan=2 colspan=3>Eg.1: yes, he is.Eg.2: yes,he isEg.3:yes, he is.</td><td rowspan=2 colspan=1>Eg.1: it is my favorite.Eg.2: no, but i didn&#x27;t think he was able toget married. i had no idea to get her.Eg.3: this is not, but it&#x27;s not that bad.it&#x27;s just a litte bit,but it&#x27;s not too bad.</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2>Eg.2:</td></tr></table>",
857
+ "bbox": [
858
+ 173,
859
+ 401,
860
+ 821,
861
+ 574
862
+ ],
863
+ "page_idx": 7
864
+ },
865
+ {
866
+ "type": "text",
867
+ "text": "",
868
+ "bbox": [
869
+ 176,
870
+ 590,
871
+ 823,
872
+ 632
873
+ ],
874
+ "page_idx": 7
875
+ },
876
+ {
877
+ "type": "text",
878
+ "text": "We further investigate the interpretability of Gaussian components in the prior network, that is, what each Gaussian model has captured before generation. We pick a dialogue context “I’d like to invite you to dinner tonight, do you have time?” which is also used in (Shen et al., 2018) for analysis and generate five responses for each Gaussian component. As shown in Table 4, different ",
879
+ "bbox": [
880
+ 174,
881
+ 638,
882
+ 825,
883
+ 695
884
+ ],
885
+ "page_idx": 7
886
+ },
887
+ {
888
+ "type": "table",
889
+ "img_path": "images/edc766c51a3be6460eac7998351269f6837990f536ac13598e7a66833f1efe73.jpg",
890
+ "table_caption": [
891
+ "Table 4: Examples of generated responses for each Gaussian component. ‘Eg.i’ means the $_ { i }$ -th example. "
892
+ ],
893
+ "table_footnote": [],
894
+ "table_body": "<table><tr><td rowspan=1 colspan=1>Context</td><td rowspan=1 colspan=3>I would like to invite you to dinner tonight, do you have time?</td></tr><tr><td rowspan=2 colspan=1>Replies</td><td rowspan=1 colspan=1>Component 1</td><td rowspan=1 colspan=1>Component 2</td><td rowspan=1 colspan=1>Component 3</td></tr><tr><td rowspan=1 colspan=1>Eg.1:Yes,I&#x27;d like to go withyou.Eg.2: My pleasure.Eg.3:OK, thanks.Eg.4: I don&#x27;t know what to doEg.5: Sure. I&#x27;d like to go out</td><td rowspan=1 colspan=1>Eg.1:I&#x27;m not sure.Eg.2: I&#x27;m not sure. What’s theproblem?Eg.3: I&#x27;m sorry to hear that.What&#x27;s the problem?Eg.4: It&#x27;s very kind of you, too.Eg.5: I have no idea. You have to</td><td rowspan=1 colspan=1>Eg.1: Of course I&#x27;m not sure.What&#x27;s the problem?Eg.2: No,I don’t want to go.Eg.3: I want to go to bed, butI&#x27;m not sure.Eg.4: Of course not. you.Eg.5: Do you want to go?</td></tr></table>",
895
+ "bbox": [
896
+ 184,
897
+ 727,
898
+ 812,
899
+ 849
900
+ ],
901
+ "page_idx": 7
902
+ },
903
+ {
904
+ "type": "text",
905
+ "text": "Gaussian models generate different types of responses: component 1 expresses a strong will, while component 2 expresses some uncertainty, and component 3 generates strong negative responses. The overlap between components is marginal (around 1/5). The results indicate that the Gaussian mixture prior network can successfully capture the multimodal distribution of the responses. ",
906
+ "bbox": [
907
+ 174,
908
+ 867,
909
+ 825,
910
+ 924
911
+ ],
912
+ "page_idx": 7
913
+ },
914
+ {
915
+ "type": "text",
916
+ "text": "To validate the previous results, we further conduct a human evaluation with Amazon Mechanical Turk. We randomly selected 50 dialogues from the test set of DailyDialog. For each dialogue context, we generated 10 responses from each of the four models. Responses for each context were inspected by 5 participants who were asked to choose the model which performs the best in regarding to coherence, diversity and informative while being blind to the underlying algorithms. The average percentages that each model was selected as the best to a specific criterion are shown in Table 5. ",
917
+ "bbox": [
918
+ 174,
919
+ 103,
920
+ 825,
921
+ 188
922
+ ],
923
+ "page_idx": 8
924
+ },
925
+ {
926
+ "type": "table",
927
+ "img_path": "images/e0736c75101893fcd255e3cbb238ddcf06a08a0a659cf947316eedf08e001613.jpg",
928
+ "table_caption": [
929
+ "Table 5: Human judgments for models trained on the Dailydialog dataset "
930
+ ],
931
+ "table_footnote": [],
932
+ "table_body": "<table><tr><td>Model</td><td>Coherence</td><td>Diversity</td><td>Informative</td></tr><tr><td>CVAE-CO</td><td>14.4%</td><td>19.2%</td><td>24.8%</td></tr><tr><td>VHCR</td><td>26.8%</td><td>22.4%</td><td>20.4%</td></tr><tr><td>DialogWAE</td><td>27.6%</td><td>29.2%</td><td>25.6%</td></tr><tr><td>DialogWAE-GMP</td><td>31.6%</td><td>29.2%</td><td>29.6%</td></tr></table>",
933
+ "bbox": [
934
+ 287,
935
+ 208,
936
+ 705,
937
+ 286
938
+ ],
939
+ "page_idx": 8
940
+ },
941
+ {
942
+ "type": "text",
943
+ "text": "The proposed approach clearly outperforms the current state of the art, CVAE-CO and VHCR, by a large margin in terms of all three metrics. This improvement is especially clear when the Gaussian mixture prior was used. ",
944
+ "bbox": [
945
+ 178,
946
+ 301,
947
+ 823,
948
+ 342
949
+ ],
950
+ "page_idx": 8
951
+ },
952
+ {
953
+ "type": "text",
954
+ "text": "6 CONCLUSION ",
955
+ "text_level": 1,
956
+ "bbox": [
957
+ 174,
958
+ 363,
959
+ 318,
960
+ 378
961
+ ],
962
+ "page_idx": 8
963
+ },
964
+ {
965
+ "type": "text",
966
+ "text": "In this paper, we introduced a new approach, named DialogWAE, for dialogue modeling. Different from existing VAE models which impose a simple prior distribution over the latent variables, DialogWAE samples the prior and posterior samples of latent variables by transforming contextdependent Gaussian noise using neural networks, and minimizes the Wasserstein distance between the prior and posterior distributions. Furthermore, we enhance the model with a Gaussian mixture prior network to enrich the latent space. Experiments on two widely used datasets show that our model outperforms state-of-the-art VAE models and generates more coherent, informative and diverse responses. ",
967
+ "bbox": [
968
+ 174,
969
+ 393,
970
+ 825,
971
+ 506
972
+ ],
973
+ "page_idx": 8
974
+ },
975
+ {
976
+ "type": "text",
977
+ "text": "ACKNOWLEDGMENTS ",
978
+ "text_level": 1,
979
+ "bbox": [
980
+ 176,
981
+ 523,
982
+ 326,
983
+ 537
984
+ ],
985
+ "page_idx": 8
986
+ },
987
+ {
988
+ "type": "text",
989
+ "text": "This work was supported by the Creative Industrial Technology Development Program (10053249) funded by the Ministry of Trade, Industry and Energy (MOTIE, Korea). ",
990
+ "bbox": [
991
+ 176,
992
+ 549,
993
+ 821,
994
+ 578
995
+ ],
996
+ "page_idx": 8
997
+ },
998
+ {
999
+ "type": "text",
1000
+ "text": "REFERENCES ",
1001
+ "text_level": 1,
1002
+ "bbox": [
1003
+ 176,
1004
+ 598,
1005
+ 285,
1006
+ 613
1007
+ ],
1008
+ "page_idx": 8
1009
+ },
1010
+ {
1011
+ "type": "text",
1012
+ "text": "Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein GAN. ´ arXiv preprint arXiv:1701.07875, 2017. ",
1013
+ "bbox": [
1014
+ 173,
1015
+ 622,
1016
+ 823,
1017
+ 650
1018
+ ],
1019
+ "page_idx": 8
1020
+ },
1021
+ {
1022
+ "type": "text",
1023
+ "text": "Samuel R Bowman, Gabor Angeli, Christopher Potts, and Christopher D Manning. A large annotated corpus for learning natural language inference. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pages 632–642, 2015. ",
1024
+ "bbox": [
1025
+ 174,
1026
+ 659,
1027
+ 825,
1028
+ 703
1029
+ ],
1030
+ "page_idx": 8
1031
+ },
1032
+ {
1033
+ "type": "text",
1034
+ "text": "Boxing Chen and Colin Cherry. A systematic comparison of smoothing techniques for sentencelevel BLEU. In Proceedings of the Ninth Workshop on Statistical Machine Translation, pages 362–367, 2014. ",
1035
+ "bbox": [
1036
+ 174,
1037
+ 712,
1038
+ 825,
1039
+ 753
1040
+ ],
1041
+ "page_idx": 8
1042
+ },
1043
+ {
1044
+ "type": "text",
1045
+ "text": "Kyunghyun Cho, Bart Van Merrienboer, C¸ alar G ¨ ulc¸ehre, Dzmitry Bahdanau, Fethi Bougares, Hol- ¨ ger Schwenk, and Yoshua Bengio. Learning phrase representations using RNN Encoder–Decoder for statistical machine translation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1724–1734, Doha, Qatar, October 2014. Association for Computational Linguistics. ",
1046
+ "bbox": [
1047
+ 174,
1048
+ 763,
1049
+ 825,
1050
+ 833
1051
+ ],
1052
+ "page_idx": 8
1053
+ },
1054
+ {
1055
+ "type": "text",
1056
+ "text": "Gabriel Forgues, Joelle Pineau, Jean-Marie Larcheveque, and R ˆ eal Tremblay. Bootstrapping dia- ´ log systems with word embeddings. In NIPS, modern machine learning and natural language processing workshop, volume 2, 2014. ",
1057
+ "bbox": [
1058
+ 173,
1059
+ 843,
1060
+ 823,
1061
+ 886
1062
+ ],
1063
+ "page_idx": 8
1064
+ },
1065
+ {
1066
+ "type": "text",
1067
+ "text": "John J Godfrey and Edward Holliman. Switchboard-1 release 2. Linguistic Data Consortium, Philadelphia, 926:927, 1997. ",
1068
+ "bbox": [
1069
+ 173,
1070
+ 895,
1071
+ 820,
1072
+ 922
1073
+ ],
1074
+ "page_idx": 8
1075
+ },
1076
+ {
1077
+ "type": "text",
1078
+ "text": "Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in neural information processing systems, pages 2672–2680, 2014. ",
1079
+ "bbox": [
1080
+ 174,
1081
+ 103,
1082
+ 823,
1083
+ 146
1084
+ ],
1085
+ "page_idx": 9
1086
+ },
1087
+ {
1088
+ "type": "text",
1089
+ "text": "Prasoon Goyal, Zhiting Hu, Xiaodan Liang, Chenyu Wang, and Eric P Xing. Nonparametric variational auto-encoders for hierarchical representation learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5094–5102, 2017. ",
1090
+ "bbox": [
1091
+ 174,
1092
+ 154,
1093
+ 820,
1094
+ 198
1095
+ ],
1096
+ "page_idx": 9
1097
+ },
1098
+ {
1099
+ "type": "text",
1100
+ "text": "Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron C Courville. Improved training of wasserstein GANs. In Advances in Neural Information Processing Systems, pages 5769–5779, 2017. ",
1101
+ "bbox": [
1102
+ 174,
1103
+ 205,
1104
+ 823,
1105
+ 248
1106
+ ],
1107
+ "page_idx": 9
1108
+ },
1109
+ {
1110
+ "type": "text",
1111
+ "text": "Hanjoo Kim, Minkyu Kim, Dongjoo Seo, Jinwoong Kim, Heungseok Park, Soeun Park, Hyunwoo Jo, KyungHyun Kim, Youngil Yang, Youngkwan Kim, et al. Nsml: Meet the mlaas platform with a real-world case study. arXiv preprint arXiv:1810.09957, 2018. ",
1112
+ "bbox": [
1113
+ 173,
1114
+ 257,
1115
+ 825,
1116
+ 301
1117
+ ],
1118
+ "page_idx": 9
1119
+ },
1120
+ {
1121
+ "type": "text",
1122
+ "text": "Diederik P Kingma and Max Welling. Auto-encoding variational bayes. In International Conference Learning Representations (ICLR), 2014. ",
1123
+ "bbox": [
1124
+ 173,
1125
+ 309,
1126
+ 821,
1127
+ 338
1128
+ ],
1129
+ "page_idx": 9
1130
+ },
1131
+ {
1132
+ "type": "text",
1133
+ "text": "Matt J Kusner and Jose Miguel Hern ´ andez-Lobato. GANs for sequences of discrete elements with´ the gumbel-softmax distribution. arXiv preprint arXiv:1611.04051, 2016. ",
1134
+ "bbox": [
1135
+ 171,
1136
+ 347,
1137
+ 823,
1138
+ 376
1139
+ ],
1140
+ "page_idx": 9
1141
+ },
1142
+ {
1143
+ "type": "text",
1144
+ "text": "Jiwei Li, Michel Galley, Chris Brockett, Jianfeng Gao, and Bill Dolan. A diversity-promoting objective function for neural conversation models. arXiv preprint arXiv:1510.03055, 2015. ",
1145
+ "bbox": [
1146
+ 173,
1147
+ 383,
1148
+ 823,
1149
+ 414
1150
+ ],
1151
+ "page_idx": 9
1152
+ },
1153
+ {
1154
+ "type": "text",
1155
+ "text": "Jiwei Li, Will Monroe, Tianlin Shi, Alan Ritter, and Dan Jurafsky. Adversarial learning for neural dialogue generation. arXiv preprint arXiv:1701.06547, 2017. ",
1156
+ "bbox": [
1157
+ 173,
1158
+ 421,
1159
+ 825,
1160
+ 452
1161
+ ],
1162
+ "page_idx": 9
1163
+ },
1164
+ {
1165
+ "type": "text",
1166
+ "text": "Yanran Li, Hui Su, Xiaoyu Shen, Wenjie Li, Ziqiang Cao, and Shuzi Niu. DailyDialog: A manually labelled multi-turn dialogue dataset. In Proceedings of the Eighth International Joint Conference on Natural Language Processing (Volume 1: Long Papers), volume 1, pages 986–995, 2017. ",
1167
+ "bbox": [
1168
+ 174,
1169
+ 458,
1170
+ 825,
1171
+ 503
1172
+ ],
1173
+ "page_idx": 9
1174
+ },
1175
+ {
1176
+ "type": "text",
1177
+ "text": "Chia-Wei Liu, Ryan Lowe, Iulian V Serban, Michael Noseworthy, Laurent Charlin, and Joelle Pineau. How not to evaluate your dialogue system: An empirical study of unsupervised evaluation metrics for dialogue response generation. arXiv preprint arXiv:1603.08023, 2016. ",
1178
+ "bbox": [
1179
+ 174,
1180
+ 511,
1181
+ 826,
1182
+ 554
1183
+ ],
1184
+ "page_idx": 9
1185
+ },
1186
+ {
1187
+ "type": "text",
1188
+ "text": "Alireza Makhzani, Jonathon Shlens, Navdeep Jaitly, Ian Goodfellow, and Brendan Frey. Adversarial autoencoders. arXiv preprint arXiv:1511.05644, 2015. ",
1189
+ "bbox": [
1190
+ 173,
1191
+ 563,
1192
+ 823,
1193
+ 592
1194
+ ],
1195
+ "page_idx": 9
1196
+ },
1197
+ {
1198
+ "type": "text",
1199
+ "text": "Jeff Mitchell and Mirella Lapata. Vector-based models of semantic composition. proceedings of ACL-08: HLT, pages 236–244, 2008. ",
1200
+ "bbox": [
1201
+ 173,
1202
+ 599,
1203
+ 825,
1204
+ 630
1205
+ ],
1206
+ "page_idx": 9
1207
+ },
1208
+ {
1209
+ "type": "text",
1210
+ "text": "Vinod Nair and Geoffrey E Hinton. Rectified linear units improve restricted boltzmann machines. In Proceedings of the 27th international conference on machine learning (ICML-10), pages 807– 814, 2010. ",
1211
+ "bbox": [
1212
+ 173,
1213
+ 637,
1214
+ 823,
1215
+ 680
1216
+ ],
1217
+ "page_idx": 9
1218
+ },
1219
+ {
1220
+ "type": "text",
1221
+ "text": "Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. BLEU: a method for automatic evaluation of machine translation. In Proceedings of the 40th annual meeting on association for computational linguistics, pages 311–318. Association for Computational Linguistics, 2002. ",
1222
+ "bbox": [
1223
+ 174,
1224
+ 689,
1225
+ 823,
1226
+ 733
1227
+ ],
1228
+ "page_idx": 9
1229
+ },
1230
+ {
1231
+ "type": "text",
1232
+ "text": "Yookoon Park, Jaemin Cho, and Gunhee Kim. A hierarchical latent structure for variational conversation modeling. arXiv preprint arXiv:1804.03424, 2018. ",
1233
+ "bbox": [
1234
+ 168,
1235
+ 739,
1236
+ 823,
1237
+ 770
1238
+ ],
1239
+ "page_idx": 9
1240
+ },
1241
+ {
1242
+ "type": "text",
1243
+ "text": "Razvan Pascanu, Tomas Mikolov, and Yoshua Bengio. On the difficulty of training recurrent neural networks. In International Conference on Machine Learning, pages 1310–1318, 2013. ",
1244
+ "bbox": [
1245
+ 169,
1246
+ 777,
1247
+ 823,
1248
+ 808
1249
+ ],
1250
+ "page_idx": 9
1251
+ },
1252
+ {
1253
+ "type": "text",
1254
+ "text": "Jeffrey Pennington, Richard Socher, and Christopher Manning. Glove: Global vectors for word representation. In Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), pages 1532–1543, 2014. ",
1255
+ "bbox": [
1256
+ 173,
1257
+ 815,
1258
+ 825,
1259
+ 859
1260
+ ],
1261
+ "page_idx": 9
1262
+ },
1263
+ {
1264
+ "type": "text",
1265
+ "text": "Vasile Rus and Mihai Lintean. A comparison of greedy and optimal assessment of natural language student input using word-to-word similarity metrics. In Proceedings of the Seventh Workshop on Building Educational Applications Using NLP, pages 157–162. Association for Computational Linguistics, 2012. ",
1266
+ "bbox": [
1267
+ 174,
1268
+ 867,
1269
+ 825,
1270
+ 924
1271
+ ],
1272
+ "page_idx": 9
1273
+ },
1274
+ {
1275
+ "type": "text",
1276
+ "text": "Shoetsu Sato, Naoki Yoshinaga, Masashi Toyoda, and Masaru Kitsuregawa. Modeling situations in neural chat bots. In Proceedings of ACL 2017, Student Research Workshop, pages 120–127, 2017. ",
1277
+ "bbox": [
1278
+ 171,
1279
+ 103,
1280
+ 823,
1281
+ 133
1282
+ ],
1283
+ "page_idx": 10
1284
+ },
1285
+ {
1286
+ "type": "text",
1287
+ "text": "Iulian Vlad Serban, Alessandro Sordoni, Yoshua Bengio, Aaron C Courville, and Joelle Pineau. Building end-to-end dialogue systems using generative hierarchical neural network models. In AAAI, volume 16, pages 3776–3784, 2016. ",
1288
+ "bbox": [
1289
+ 176,
1290
+ 140,
1291
+ 823,
1292
+ 184
1293
+ ],
1294
+ "page_idx": 10
1295
+ },
1296
+ {
1297
+ "type": "text",
1298
+ "text": "Iulian Vlad Serban, Alessandro Sordoni, Ryan Lowe, Laurent Charlin, Joelle Pineau, Aaron C Courville, and Yoshua Bengio. A hierarchical latent variable encoder-decoder model for generating dialogues. In AAAI, pages 3295–3301, 2017. ",
1299
+ "bbox": [
1300
+ 176,
1301
+ 193,
1302
+ 821,
1303
+ 236
1304
+ ],
1305
+ "page_idx": 10
1306
+ },
1307
+ {
1308
+ "type": "text",
1309
+ "text": "Tianxiao Shen, Tao Lei, Regina Barzilay, and Tommi Jaakkola. Style transfer from non-parallel text by cross-alignment. In Advances in Neural Information Processing Systems, pages 6833–6844, 2017. ",
1310
+ "bbox": [
1311
+ 174,
1312
+ 244,
1313
+ 823,
1314
+ 286
1315
+ ],
1316
+ "page_idx": 10
1317
+ },
1318
+ {
1319
+ "type": "text",
1320
+ "text": "Xiaoyu Shen, Hui Su, Shuzi Niu, and Vera Demberg. Improving variational encoder-decoders in dialogue generation. arXiv preprint arXiv:1802.02032, 2018. ",
1321
+ "bbox": [
1322
+ 173,
1323
+ 295,
1324
+ 821,
1325
+ 325
1326
+ ],
1327
+ "page_idx": 10
1328
+ },
1329
+ {
1330
+ "type": "text",
1331
+ "text": "Nako Sung, Minkyu Kim, Hyunwoo Jo, Youngil Yang, Jingwoong Kim, Leonard Lausen, Youngkwan Kim, Gayoung Lee, Donghyun Kwak, Jung-Woo Ha, et al. Nsml: A machine learning platform that enables you to focus on your models. arXiv preprint arXiv:1712.05902, 2017. ",
1332
+ "bbox": [
1333
+ 174,
1334
+ 333,
1335
+ 825,
1336
+ 376
1337
+ ],
1338
+ "page_idx": 10
1339
+ },
1340
+ {
1341
+ "type": "text",
1342
+ "text": "Ilya Sutskever, Oriol Vinyals, and Quoc VV Le. Sequence to sequence learning with neural networks. In Advances in neural information processing systems, pages 3104–3112, 2014. ",
1343
+ "bbox": [
1344
+ 173,
1345
+ 385,
1346
+ 821,
1347
+ 414
1348
+ ],
1349
+ "page_idx": 10
1350
+ },
1351
+ {
1352
+ "type": "text",
1353
+ "text": "T Tieleman and G Hinton. Divide the gradient by a running average of its recent magnitude. COURSERA: Neural networks for machine learning. Technical report, Technical Report. Available online: https://zh. coursera. org/learn/neuralnetworks/lecture/YQHki/rmsprop-divide-thegradient-by-a-running-average-of-its-recent-magnitude (accessed on 21 April 2017). ",
1354
+ "bbox": [
1355
+ 174,
1356
+ 422,
1357
+ 825,
1358
+ 479
1359
+ ],
1360
+ "page_idx": 10
1361
+ },
1362
+ {
1363
+ "type": "text",
1364
+ "text": "Ilya Tolstikhin, Olivier Bousquet, Sylvain Gelly, and Bernhard Schoelkopf. Wasserstein autoencoders. arXiv preprint arXiv:1711.01558, 2017. ",
1365
+ "bbox": [
1366
+ 176,
1367
+ 488,
1368
+ 823,
1369
+ 517
1370
+ ],
1371
+ "page_idx": 10
1372
+ },
1373
+ {
1374
+ "type": "text",
1375
+ "text": "Chen Xing, Wei Wu, Yu Wu, Jie Liu, Yalou Huang, Ming Zhou, and Wei-Ying Ma. Topic aware neural response generation. In AAAI, volume 17, pages 3351–3357, 2017. ",
1376
+ "bbox": [
1377
+ 174,
1378
+ 525,
1379
+ 823,
1380
+ 555
1381
+ ],
1382
+ "page_idx": 10
1383
+ },
1384
+ {
1385
+ "type": "text",
1386
+ "text": "Zhen Xu, Bingquan Liu, Baoxun Wang, SUN Chengjie, Xiaolong Wang, Zhuoran Wang, and Chao Qi. Neural response generation via GAN with an approximate embedding layer. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 617–626, 2017. ",
1387
+ "bbox": [
1388
+ 174,
1389
+ 563,
1390
+ 825,
1391
+ 619
1392
+ ],
1393
+ "page_idx": 10
1394
+ },
1395
+ {
1396
+ "type": "text",
1397
+ "text": "Tiancheng Zhao, Ran Zhao, and Maxine Eskenazi. Learning discourse-level diversity for neural dialog models using conditional variational autoencoders. arXiv preprint arXiv:1703.10960, 2017. ",
1398
+ "bbox": [
1399
+ 171,
1400
+ 628,
1401
+ 823,
1402
+ 659
1403
+ ],
1404
+ "page_idx": 10
1405
+ },
1406
+ {
1407
+ "type": "text",
1408
+ "text": "Junbo Zhao, Yoon Kim, Kelly Zhang, Alexander M. Rush, and Yann LeCun. Adversarially regularized autoencoders. In Proceedings of the Thirty-fifth International Conference on Machine Learning, ICML 2018, 2018. ",
1409
+ "bbox": [
1410
+ 174,
1411
+ 666,
1412
+ 823,
1413
+ 710
1414
+ ],
1415
+ "page_idx": 10
1416
+ }
1417
+ ]
parse/train/BkgBvsC9FQ/BkgBvsC9FQ_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/BkgBvsC9FQ/BkgBvsC9FQ_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/QgX15Mdi1E_/QgX15Mdi1E_.md ADDED
@@ -0,0 +1,322 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Space-time Mixing Attention for Video Transformer
2
+
3
+ Adrian Bulat Samsung AI Cambridge adrian@adrianbulat.com
4
+
5
+ Juan-Manuel Perez-Rua Samsung AI Cambridge j.perez-rua@samsung.com
6
+
7
+ Swathikiran SudhakaranSamsung AI Cambridgeswathikir.s@samsung.com
8
+
9
+ Brais Martinez Samsung AI Cambridge brais.a@samsung.com
10
+
11
+ Georgios Tzimiropoulos Samsung AI Cambridge
12
+ Queen Mary University of London
13
+ g.tzimiropoulos@qmul.ac.uk
14
+
15
+ # Abstract
16
+
17
+ This paper is on video recognition using Transformers. Very recent attempts in this area have demonstrated promising results in terms of recognition accuracy, yet they have been also shown to induce, in many cases, significant computational overheads due to the additional modelling of the temporal information. In this work, we propose a Video Transformer model the complexity of which scales linearly with the number of frames in the video sequence and hence induces no overhead compared to an image-based Transformer model. To achieve this, our model makes two approximations to the full space-time attention used in Video Transformers: (a) It restricts time attention to a local temporal window and capitalizes on the Transformer’s depth to obtain full temporal coverage of the video sequence. (b) It uses efficient space-time mixing to attend jointly spatial and temporal locations without inducing any additional cost on top of a spatial-only attention model. We also show how to integrate 2 very lightweight mechanisms for global temporal-only attention which provide additional accuracy improvements at minimal computational cost. We demonstrate that our model produces very high recognition accuracy on the most popular video recognition datasets while at the same time being significantly more efficient than other Video Transformer models. Code for our method is made available here.
18
+
19
+ # 1 Introduction
20
+
21
+ Video recognition – in analogy to image recognition – refers to the problem of recognizing events of interest in video sequences such as human activities. Following the tremendous success of Transformers in sequential data, specifically in Natural Language Processing (NLP) [39, 5], Vision Transformers were very recently shown to outperform CNNs for image recognition too [48, 13, 35], signaling a paradigm shift on how visual understanding models should be constructed. In light of this, in this paper, we propose a Video Transformer model as an appealing and promising solution for improving the accuracy of video recognition models.
22
+
23
+ A direct, natural extension of Vision Transformers to the spatio-temporal domain is to perform the self-attention jointly across all $S$ spatial locations and $T$ temporal locations. Full space-time attention though has complexity ${ \cal O } ( T ^ { 2 } S ^ { 2 } )$ making such a model computationally heavy and, hence, impractical even when compared with the 3D-based convolutional models. As such, our aim is to exploit the temporal information present in video streams while minimizing the computational burden within the Transformer framework for efficient video recognition.
24
+
25
+ ![](images/38d7921c4c4fff3fb53fbfab94c9e54bd48c7ecb8a73bcab412285f4b727ec5c.jpg)
26
+ Figure 1: Different approaches to space-time self-attention for video recognition. In all cases, the key locations that the query vector, located at the center of the grid in red, attends are shown in orange. Unlike prior work, our key vector is constructed by mixing information from tokens located at the same spatial location within a local temporal window. Our method then performs self-attention with these tokens. Note that our mechanism allows for an efficient approximation of local space-time attention at no extra cost.
27
+
28
+ A baseline solution to this problem is to consider spatial-only attention followed by temporal averaging, which has complexity ${ \cal O } ( T S ^ { 2 } )$ . Similar attempts to reduce the cost of full space-time attention have been recently proposed in [3, 1]. These methods have demonstrated promising results in terms of video recognition accuracy, yet they have been also shown to induce, in most of the cases, significant computational overheads compared to the baseline (spatial-only) method due to the additional modelling of the temporal information.
29
+
30
+ Our main contribution in this paper is a Video Transformer model that has complexity $O ( T S ^ { 2 } )$ and, hence, is as efficient as the baseline model, yet, as our results show, it outperforms recently/concurrently proposed work [3, 1] in terms of efficiency (i.e. accuracy/FLOP) by significant margins. To achieve this our model makes two approximations to the full space-time attention used in Video Transformers: (a) It restricts time attention to a local temporal window and capitalizes on the Transformer’s depth to obtain full temporal coverage of the video sequence. (b) It uses efficient space-time mixing to attend jointly spatial and temporal locations without inducing any additional cost on top of a spatial-only attention model. Fig. 1 shows the proposed approximation to space-time attention. We also show how to integrate two very lightweight mechanisms for global temporal-only attention, which provide additional accuracy improvements at minimal computational cost. We demonstrate that our model is surprisingly effective in terms of capturing long-term dependencies and producing very high recognition accuracy on the most popular video recognition datasets, including Something-Something-v2 [17], Kinetics [4] and Epic Kitchens [9], while at the same time being significantly more efficient than other Video Transformer models.
31
+
32
+ # 2 Related work
33
+
34
+ Video recognition: Standard solutions are based on CNNs and can be broadly classified into two categories: 2D- and 3D-based approaches. 2D-based approaches process each frame independently to extract frame-based features which are then aggregated temporally with some sort of temporal modeling (e.g. temporal averaging) performed at the end of the network [42, 26, 27]. The works of [26, 27] use the “shift trick” [45] to have some temporal modeling at a layer level. 3D-based approaches [4, 16, 36] are considered the current state-of-the-art as they can typically learn stronger temporal models via 3D convolutions. However, they also incur higher computational and memory costs. To alleviate this, a large body of works attempt to improve their efficiency via spatial and/or temporal factorization [38, 37, 15].
35
+
36
+ CNN vs ViT: Historically, video recognition approaches tend to mimic the architectures used for image classification (e.g. from AlexNet [23] to [20] or from ResNet [18] and ResNeXt [47] to [16]). After revolutionizing NLP [39, 32], very recently, Transformer-based architectures showed promising results on large scale image classification too [13]. While self-attention and attention were previously used in conjunction with CNNs at a layer or block level [6, 50, 33], the Vision Transformer (ViT)
37
+
38
+ of Dosovitskiy et al. [13] is the first convolution-free, Transformer-based architecture that achieves state-of-the-art on ImageNet [11].
39
+
40
+ Video Transformer: Recently/concurrently with our work, vision transformer architectures, derived from [13], were used for video recognition [3, 1], too. Because performing full space-time attention is computationally prohibitive (i.e. $\bar { O } ( T ^ { 2 } S ^ { 2 } ) )$ , their main focus is on reducing this via temporal and spatial factorization. In TimeSformer [3], the authors propose applying spatial and temporal attention in an alternating manner reducing the complexity to $\bar { O } ( \bar { T ^ { 2 } } S + \bar { T } \bar { S ^ { 2 } } )$ . In a similar fashion, ViViT [1] explores several avenues for space-time factorization. In addition, they also proposed to adapt the patch embedding process from [13] to 3D (i.e. video) data. Our work proposes a completely different approximation to full space-time attention that is also efficient. To this end, we firstly restrict full space-time attention to a local temporal window which is reminiscent of [2] but applied here to space-time attention and video recognition 1. Secondly, we define a local joint space-time attention which we show that can be implemented efficiently via the “shift trick” [45].
41
+
42
+ # 3 Method
43
+
44
+ Video Transformer: We are given a video clip $\mathbf { X } \in \mathbb { R } ^ { T \times H \times W \times C }$ $C = 3$ ). Following ViT [13], each frame is divided into $K \times K$ non-overlapping patches which are then mapped into visual tokens using a linear embedding layer $\mathbf { E } \in \mathbb { R } ^ { 3 K ^ { 2 } \times d }$ . Since self-attention is permutation invariant, in order to preserve the information regarding the location of each patch within space and time we also learn two positional embeddings, one for space: $\mathbf { p } _ { s } \in \mathbb { R } ^ { 1 \times S \times d }$ and one for time: $\mathbf { p } _ { t } \in \mathbb { R } ^ { T \times 1 \times d }$ . These are then added to the initial visual tokens. Finally, the token sequence is processed by $L$ Transformer layers.
45
+
46
+ The visual token at layer $l$ , spatial location $s$ and temporal location $t$ is denoted as:
47
+
48
+ $$
49
+ \begin{array} { r } { \mathbf { z } _ { s , t } ^ { l } \in \mathbb { R } ^ { d } , l = 0 , \ldots , L - 1 , s = 0 , \ldots , S - 1 , t = 0 , \ldots , T - 1 . } \end{array}
50
+ $$
51
+
52
+ In addition to the $S T$ visual tokens extracted from the video, a special classification token $\mathbf { z } _ { c l s } ^ { l } \in \mathbb { R } ^ { d }$ is prepended to the token sequence [12]. The $l -$ th Transformer layer processes the visual tokens $\mathbf { Z } ^ { l ^ { - } } \in \mathsf { \bar { R } } ^ { ( S T + 1 ) \times d }$ of the previous layer using a series of Multi-head Self-Attention (MSA), Layer Normalization (LN), and MLP $\mathbb { R } ^ { d } \overset { \cdot } { \to } \mathbb { R } ^ { 4 d } \overset { \cdot } { \to } \mathbb { R } ^ { d }$ ) layers as follows:
53
+
54
+ $$
55
+ \begin{array} { r c l } { { \mathbf { Y } ^ { l } } } & { { = } } & { { { \mathrm { \bf ~ M S A } } ( { \mathrm { \bf ~ L N } } ( { \mathbf { Z } } ^ { l - 1 } ) ) + { \mathbf { Z } } ^ { l - 1 } , } } \\ { { \mathbf { Z } ^ { l } } } & { { = } } & { { { \mathrm { \bf ~ M L P } } ( { \mathrm { \bf ~ L N } } ( { \mathbf { Y } } ^ { l } ) ) + { \mathbf { Y } } ^ { l } . } } \end{array}
56
+ $$
57
+
58
+ The main computation of a single full space-time Self-Attention (SA) head boils down to calculating:
59
+
60
+ $$
61
+ \mathbf { y } _ { s , t } ^ { l } = \sum _ { t ^ { \prime } = 0 } ^ { T - 1 } \sum _ { s ^ { \prime } = 0 } ^ { S - 1 } \mathrm { S o f t m a x } \{ ( \mathbf { q } _ { s , t } ^ { l } \cdot \mathbf { k } _ { s ^ { \prime } , t ^ { \prime } } ^ { l } ) / \sqrt { d _ { h } } \} \mathbf { v } _ { s ^ { \prime } , t ^ { \prime } } ^ { l } , \ \left\{ \begin{array} { l l } { s = 0 , \dots , S - 1 } \\ { t = 0 , \dots , T - 1 } \end{array} \right\}
62
+ $$
63
+
64
+ where $\mathbf { q } _ { s , t } ^ { l } , \mathbf { k } _ { s , t } ^ { l } , \mathbf { v } _ { s , t } ^ { l } \in \mathbb { R } ^ { d _ { h } }$ are the query, key, and value vectors computed from $\mathbf { z } _ { s , t } ^ { l }$ (after LN) using embedding matrices $\mathbf { W _ { q } } , \mathbf { W _ { k } } , \mathbf { W _ { v } } \in \mathbb { R } ^ { d \times d _ { h } }$ . Finally, the output of the $h$ heads is concatenated and projected using embedding matrix Wh ∈ Rhdh×d.
65
+
66
+ The complexity of the full model is: $O ( 3 h T S d d _ { h } )$ $( q k v$ projections) $+ O ( 2 h T ^ { 2 } S ^ { 2 } d _ { h } )$ (MSA for $h$ attention heads) $+ O ( T S ( h d _ { h } ) d )$ (multi-head projection) $+ \hat { O } ( 4 T S d ^ { 2 } )$ (MLP) 2. From these terms, our goal is to reduce the cost $\tilde { O ( 2 T ^ { 2 } S ^ { 2 } d _ { h } ) }$ (for a single attention head) of the full space-time attention which is the dominant term 3. For clarity, from now on, we will drop constant terms and $d _ { h }$ to report complexity unless necessary. Hence, the complexity of the full space-time attention is $O ( T ^ { 2 } S ^ { 2 } )$ .
67
+
68
+ Our baseline is a model that performs a simple approximation to the full space-time attention by applying, at each Transformer layer, spatial-only attention:
69
+
70
+ $$
71
+ \mathbf { y } _ { s , t } ^ { l } = \sum _ { s ^ { \prime } = 0 } ^ { S - 1 } \mathrm { S o f t m a x } \{ ( \mathbf { q } _ { s , t } ^ { l } \cdot \mathbf { k } _ { s ^ { \prime } , t } ^ { l } ) / \sqrt { d _ { h } } \} \mathbf { v } _ { s ^ { \prime } , t } ^ { l } , \ \left\{ \begin{array} { l l } { s = 0 , \dots , S - 1 } \\ { t = 0 , \dots , T - 1 } \end{array} \right\}
72
+ $$
73
+
74
+ the complexity of which is ${ \cal O } ( T S ^ { 2 } )$ . Notably, the complexity of the proposed space-time mixing attention is also ${ \cal O } ( T S ^ { 2 } )$ . Following spatial-only attention, simple temporal averaging is performed on the class tokens $\begin{array} { r } { { \bf z } _ { f i n a l } = \frac { 1 } { T } \sum _ { t } { \bf z } _ { t , c l s } ^ { L - 1 } } \end{array}$ to obtain a single feature that is fed to the linear classifier.
75
+
76
+ Recent work by [3, 1] has focused on reducing the cost ${ \cal O } ( T ^ { 2 } S ^ { 2 } )$ of the full space-time attention of Eq. 4. Bertasius et al. [3] proposed the factorised attention:
77
+
78
+ $$
79
+ \begin{array} { r l r } & { \tilde { \mathbf { y } } _ { s , t } ^ { l } = \displaystyle \sum _ { t ^ { \prime } = 0 } ^ { T - 1 } \mathrm { S o f t m a x } \{ ( \mathbf { q } _ { s , t } ^ { l } \cdot \mathbf { k } _ { s , t ^ { \prime } } ^ { l } ) / \sqrt { d _ { h } } \} \mathbf { v } _ { s , t ^ { \prime } } ^ { l } , } & \\ & { \mathbf { y } _ { s , t } ^ { l } = \displaystyle \sum _ { s ^ { \prime } = 0 } ^ { S - 1 } \mathrm { S o f t m a x } \{ \tilde { \mathbf { q } } _ { s , t } ^ { l } \cdot \tilde { \mathbf { k } } _ { s ^ { \prime } , t } ^ { l } ) / \sqrt { d _ { h } } \} \tilde { \mathbf { v } } _ { s ^ { \prime } , t } ^ { l } , } & \end{array} \quad \begin{array} { r l } & { \left\{ s = 0 , \dots , S - 1 \right\} , } \\ & { \left\{ t = 0 , \dots , T - 1 \right\} , } \\ & \left\{ \begin{array} { r l } & { s = 0 , \dots , T - 1 \} \\ & { s ^ { \prime } = 0 } \end{array} \right\} , } \end{array}
80
+ $$
81
+
82
+ where $\tilde { \mathbf { q } } _ { s , t } ^ { l } , \tilde { \mathbf { k } } _ { s ^ { \prime } , t } ^ { l } \tilde { \mathbf { v } } _ { s ^ { \prime } , t } ^ { l }$ are new query, key and value vectors calculated from $\tilde { \mathbf { y } } _ { s , t } ^ { l }$ 4. The above model reduces complexity to $O ( T ^ { 2 } S + T S ^ { 2 } )$ . However, temporal attention is performed for a fixed spatial location which is ineffective when there is camera or object motion and there is spatial misalignment between frames.
83
+
84
+ The work of [1] is concurrent to ours and proposes the following approximation: $L _ { s }$ Transformer layers perform spatial-only attention as in Eq. 5 (each with complexity $O ( S ^ { 2 } ) _ { \ l }$ ). Following this, there are $L _ { t }$ Transformer layers performing temporal-only attention on the class tokens $\mathbf { z } _ { t } ^ { L _ { s } }$ . The complexity of the temporal-only attention is, in general, $\overset { \cdot } { O ( T ^ { 2 } ) }$ .
85
+
86
+ Our model aims to better approximate the full space-time self-attention (SA) of Eq. 4 while keeping complexity to ${ \cal O } ( T S ^ { 2 } )$ , i.e. inducing no further complexity to a spatial-only model.
87
+
88
+ To achieve this, we make a first approximation to perform full space-time attention but restricted to a local temporal window $[ - t _ { w } , t _ { w } ]$ :
89
+
90
+ $$
91
+ \mathbf { y } _ { s , t } ^ { l } = \sum _ { t ^ { \prime } = t - t _ { w } } ^ { t + t _ { w } } \sum _ { s ^ { \prime } = 0 } ^ { S - 1 } \mathrm { S o f t m a x } \{ ( \mathbf { q } _ { s , t } ^ { l } \cdot \mathbf { k } _ { s ^ { \prime } , t ^ { \prime } } ^ { l } ) / \sqrt { d _ { h } } \} \mathbf { v } _ { s ^ { \prime } , t ^ { \prime } } ^ { l } = \sum _ { t ^ { \prime } = t - t _ { w } } ^ { t + t _ { w } } \mathbf { V } _ { t ^ { \prime } } ^ { l } \mathbf { a } _ { t ^ { \prime } } ^ { l } , \{ \mathbf { \phi } _ { t = 0 , \dots , T - 1 } ^ { s = 0 , \dots , S - 1 } \}
92
+ $$
93
+
94
+ where ${ \bf V } _ { t ^ { \prime } } ^ { l } = [ { \bf v } _ { 0 , t ^ { \prime } } ^ { l } ; { \bf v } _ { 1 , t ^ { \prime } } ^ { l } ; \ldots ; { \bf v } _ { S - 1 , t ^ { \prime } } ^ { l } ] \in \mathbb { R } ^ { d _ { h } \times S }$ and $\mathbf { a } _ { t ^ { \prime } } ^ { l } = [ a _ { 0 , t ^ { \prime } } ^ { l } , a _ { 1 , t ^ { \prime } } ^ { l } , \ldots , a _ { S = 1 , t ^ { \prime } } ^ { l } ] \in \mathbb { R } ^ { S }$ is the vector with the corresponding attention weights. Eq. 7 shows that, for a single Transformer layer, $\mathbf { y } _ { s , t } ^ { l }$ is a spatio-temporal combination of the visual tokens in the local window $[ - t _ { w } , t _ { w } ]$ . It follows that, after k Transformer layers, yl+ks,t will be a spatio-temporal combination of the visual tokens in the local window $[ - k t _ { w } , k t _ { w } ]$ which in turn conveniently allows to perform spatio-temporal attention over the whole clip. For example, for $t _ { w } = 1$ and $k = 4$ , the local window becomes $[ - 4 , 4 ]$ which spans the whole video clip for the typical case $T = 8$ .
95
+
96
+ The complexity of the local self-attention of Eq. 7 is $O ( T ( 2 t _ { w } + 1 ) ^ { 2 } S ^ { 2 } )$ . To reduce this even further, we make a second approximation on top of the first one as follows: the attention between spatial locations $s$ and $s ^ { \prime }$ according to the model of Eq. 7 is:
97
+
98
+ $$
99
+ \sum _ { t ^ { \prime } = t - t _ { w } } ^ { t + t _ { w } } \mathrm { S o f t m a x } \{ ( { \bf q } _ { s , t } ^ { l } \cdot { \bf k } _ { s ^ { \prime } , t ^ { \prime } } ^ { l } ) / \sqrt { d _ { h } } \} { \bf v } _ { s ^ { \prime } , t ^ { \prime } } ^ { l } ,
100
+ $$
101
+
102
+ i.e. it requires the calculation of $2 t _ { w } + 1$ attentions, one per temporal location over $[ - t _ { w } , t _ { w } ]$ . Instead, we propose to calculate a single attention over $[ - t _ { w } , t _ { w } ]$ which can be achieved by $\mathbf { q } _ { s , t } ^ { l }$ attending $\mathbf { k } _ { s ^ { \prime } , - t _ { w } : t _ { w } } ^ { l } \triangleq [ \mathbf { k } _ { s ^ { \prime } , t - t _ { w } } ^ { l } ; \hdots ; \mathbf { k } _ { s ^ { \prime } , t + t _ { w } } ^ { l } ] \in \mathbb { R } ^ { ( 2 t _ { w } + 1 ) d _ { h } }$ . Note that to match the dimensions of $\mathbf { q } _ { s , t } ^ { l }$ and $\mathbf { k } _ { s ^ { \prime } , - t _ { w } : t _ { w } } ^ { l }$ a further projection of $\mathbf { k } _ { s ^ { \prime } , - t _ { w } : t _ { w } } ^ { l }$ to $\mathbb { R } ^ { d _ { h } }$ is normally required which has complexity $O ( ( 2 t _ { w } + 1 ) d _ { h } ^ { 2 } )$ and hence compromises the goal of an efficient implementation. To alleviate this we use the “shift trick” [45, 26] which allows to perform both zero-cost dimensionality reduction, spacetime mixing and attention (between $\mathbf { q } _ { s , t } ^ { l }$ and $\mathbf { \Delta } \mathbf { \bar { k } } _ { s ^ { \prime } , - t _ { w } : t _ { w } } ^ { l } )$ in $O ( d _ { h } )$ . In particular, each $t ^ { \prime } \in [ - t _ { w } , t _ { w } ]$ is assigned $d _ { h } ^ { t ^ { \prime } }$ channels from $d _ { h }$ (i.e. $\textstyle \sum _ { t ^ { \prime } } d _ { h } ^ { t ^ { \prime } } = d _ { h } )$ ). Let $\mathbf { k } _ { s ^ { \prime } , t ^ { \prime } } ^ { l } ( d _ { h } ^ { t ^ { \prime } } ) \in \mathbb { R } ^ { d _ { h } ^ { t ^ { \prime } } }$ denote the operator for indexing the $d _ { h } ^ { t ^ { \prime } }$ channels from $\mathbf { k } _ { s ^ { \prime } , t ^ { \prime } } ^ { l }$ . Then, a new key vector is constructed as:
103
+
104
+ ![](images/63cef11d328b8095ee03e385a56bcb5d9159d6945fdd59840585c039b2779efb.jpg)
105
+
106
+ Figure 2: Detailed self-attention computation graph for (a) full space-time attention and (b) the proposed space-time mixing approximation. Notice that in our case only S tokens participate instead of ST. The temporal information is aggregated by indexing channels from adjacent frames. Tokens of identical colors share the same temporal index.
107
+
108
+ ![](images/a2c2350bce86ce0a8efabb3aa9599b79f38fcf9a123c46ad3f611af0c40e49ce.jpg)
109
+ (b) Proposed space-time mixing attention.
110
+
111
+ $$
112
+ \begin{array} { r } { \tilde { \mathbf { k } } _ { s ^ { \prime } , - t _ { w } : t _ { w } } ^ { l } \triangleq [ \mathbf { k } _ { s ^ { \prime } , t - t _ { w } } ^ { l } ( d _ { h } ^ { t - t _ { w } } ) , \hdots , \mathbf { k } _ { s ^ { \prime } , t + t _ { w } } ^ { l } ( d _ { h } ^ { t + t _ { w } } ) ] \in \mathbb { R } ^ { d _ { h } } . } \end{array}
113
+ $$
114
+
115
+ Fig. 2 shows how the key vector $\tilde { \mathbf { k } } _ { s ^ { \prime } , - t w : t _ { w } } ^ { l }$ is constructed. In a similar way, we also construct a new value vector $\tilde { \mathbf { v } } _ { s ^ { \prime } , - t _ { w } : t _ { w } } ^ { l }$ . Finally, the proposed approximation to the full space-time attention is given by:
116
+
117
+ $$
118
+ \mathbf { y } _ { s , t } ^ { l _ { s } } = \sum _ { s ^ { \prime } = 0 } ^ { S - 1 } \mathrm { S o f t m a x } \{ ( \mathbf { q } _ { s , t } ^ { l _ { s } } \cdot \tilde { \mathbf { k } } _ { s ^ { \prime } , - t _ { w } : t _ { w } } ^ { l } / \sqrt { d _ { h } } \} \tilde { \mathbf { v } } _ { s ^ { \prime } , - t _ { w } : t _ { w } } ^ { l } , \ \left\{ \begin{array} { l l } { s = 0 , \dots , S - 1 } \\ { t = 0 , \dots , T - 1 } \end{array} \right\} .
119
+ $$
120
+
121
+ This has the complexity of a spatial-only attention $( O ( T S ^ { 2 } ) )$ and hence it is more efficient than previously proposed video transformers [3, 1]. Our model also provides a better approximation to the full space-time attention and as shown by our results it significantly outperforms [3, 1].
122
+
123
+ Temporal Attention aggregation: The final set of the class tokens $\mathbf { z } _ { t , c l s } ^ { L - 1 } , 0 \leq t \leq L - 1$ are used to generate the predictions. To this end, we propose to consider the following options: (a) simple temporal averaging $\begin{array} { r } { \mathbf { z } _ { f i n a l } = \frac { 1 } { T } \sum _ { t } \mathbf { z } _ { t , c l s } ^ { L - 1 } } \end{array}$ as in the case of our baseline. (b) An obvious limitation of temporal averaging is that the output is treated purely as an ensemble of per-frame features and, hence, completely ignores the temporal ordering between them. To address this, we propose to use a lightweight Temporal Attention (TA) mechanism that will attend to the $T$ classification tokens. In particular a $\mathbf { z } _ { f i n a l }$ token attends the sequence $[ \mathbf { z } _ { 0 , c l s } ^ { L - 1 } , \ldots , \mathbf { z } _ { T - 1 , c l s } ^ { L - 1 } ]$ using a temporal Transformer layer and then fed as input to the classifier. This is akin to the (concurrent) work of [1] with the difference being that in our model we found that a single TA layer suffices whereas [1] uses $L _ { t }$ . A consequence of this is that the complexity of our layer is $O ( T )$ vs $O ( 2 ( L _ { t } - 1 ) T ^ { 2 } + \bar { T } )$ of [1].
124
+
125
+ Summary token: As an alternative to TA, herein, we also propose a simple lightweight mechanism for information exchange between different frames at intermediate layers of the network. Given the set of tokens for each frame $t$ , $\mathbf { Z } _ { t } ^ { l - 1 } \in \mathbb { R } ^ { ( S + 1 ) \times d _ { h } }$ (constructed by concatenating all tokens $\mathbf { z } _ { s , t } ^ { l - 1 } , s = 0 , \ldots , S )$ , we compute a new set of $R$ tokens $\mathbf { Z } _ { r , t } ^ { l } = \phi ( \mathbf { Z } _ { \underline { { t } } } ^ { l - 1 } ) \in \mathbb { R } ^ { R \times d _ { h } }$ which summarize the frame information and hence are named “Summary” tokens. These are then, appended to the visual tokens of all frames to calculate the keys and values so that the query vectors attend the original keys plus the Summary tokens. Herein, we explore the case that $\phi ( . )$ performs simple spatial averaging $\begin{array} { r } { \mathbf { \tilde { z } } _ { 0 , t } ^ { l } = \frac { 1 } { S } \sum _ { s } \mathbf { z } _ { s , t } ^ { l } } \end{array}$ over the tokens of each frame ( $R = 1$ for this case). Note that, for $R = 1$ , the extra cost that the Summary token induces is $O ( T S )$ .
126
+
127
+ X-ViT: We call the Video Transformer based on the proposed (a) space-time mixing attention and (b) lightweight global temporal attention (or summary token) as $\mathbf { X }$ -ViT.
128
+
129
+ # 4 Results
130
+
131
+ # 4.1 Experimental setup
132
+
133
+ Datasets: We train and evaluate the proposed models on the following datasets (all datasets are publicly available for research purposes):
134
+
135
+ Kinetics-400 and 600: The Kinetics [21] dataset consists of short clips (typically 10 sec long sampled from YouTube) labeled using 400 and 600 classes, respectively. Due to the removal of some videos from YouTube, the version of the dataset used in this paper consists of approximately 261K clips for Kinetics-400. Note, that these amounts are lower than the original version of the datasets and thus might represent a negative performance bias when compared with prior works.
136
+
137
+ Something-Something- $\cdot \nu 2$ $( S S \nu 2 )$ : The SSv2 [17] dataset consists of 220,487 short videos (of duration between 2 and 6 sec) that depict humans performing pre-defined basic actions with everyday objects. Because the objects and backgrounds in the videos are consistent across different action classes, this dataset tends to require stronger temporal modeling. Due to this, we conducted most of our ablation studies on SSv2 to better analyze the importance of the proposed components.
138
+
139
+ Epic Kitchens-100 (Epic-100): is an egocentric large scale action recognition dataset consisting of more than 90,000 action segments spanning 100 hours of recordings in home environments, capturing daily activities [10]. The dataset is labeled using 97 verb classes and 300 noun classes. The evaluation results are reported using the standard action recognition protocol: the network predicts the “verb” and the “noun” using two heads. The predictions are then merged to construct an “action” which is used to report the accuracy.
140
+
141
+ Training details: All models, unless otherwise stated, were trained using the following scheduler and training procedure: specifically, our models were trained using SGD with momentum (0.9) and a cosine scheduler [28] (with linear warmup) for 35 epochs on SSv2, 50 on Epic-100 and 30 on Kinetics. The base learning rate, set at a batch size of 128, was 0.05 (0.03 for Kinetics). To prevent over-fitting we made use of the following augmentation techniques: random scaling $( 0 . 9 \times$ to $1 . 3 \times$ ) and cropping, random flipping (with probability of 0.5; not for SSv2) and autoaugment [8]. In addition, for SSv2 and Epic-100, we also applied random erasing (probability $= 0 . 5$ , min. area $_ { = 0 . 0 2 }$ , max. area $_ { = 1 / 3 }$ , min. aspec $\scriptstyle \mathrm { \ t = 0 . 3 }$ ) [52] and label smoothing $\lambda = 0 . 3 )$ ) [34] while, for Kinetics, we used mixup [51] $\langle \alpha = 0 . 4 \rangle$ ).
142
+
143
+ Table 1: Effect of local window size. To isolate its effect from that of temporal aggregation, the models were trained using temporal averaging. Note, that $( B o . )$ indicates that only features from the boundaries of the local window were used, ignoring the intermediate ones.
144
+
145
+ <table><tr><td>Variant</td><td>Top-1</td><td>Top-5</td></tr><tr><td>tw=0</td><td>45.2</td><td>71.4</td></tr><tr><td>tw=1</td><td>62.5</td><td>87.8</td></tr><tr><td>tw=2</td><td>60.5</td><td>86.4</td></tr><tr><td>tw =2(Bo.)</td><td>60.4</td><td>86.2</td></tr></table>
146
+
147
+ The backbone models follow closely the ViT architecture of Dosovitskiy et al. [13]. Most experiments were performed using the ViT-B/16 variant $L = 1 2$ , $h = 1 2$ , $d = 7 6 8$ , $K = 1 6$ ), where $L$ represents the number of transformer layers, $h$ the number of heads, $d$ the embedding dimension and $K$ the patch size. We initialized our models from a pretrained ImageNet-21k [11] ViT model. The spatial positional encoding $\mathbf { p } _ { s }$ was initialized from the pretrained 2D model and the temporal one, $\mathbf { p } _ { t }$ , with zeros so that it does not have a great impact on the tokens early on during training. The models were trained on 8 V100 GPUs using PyTorch [30].
148
+
149
+ Testing details: Unless otherwise stated, we used ViT-B/16 and $T = 8$ frames. We mostly used Temporal Attention (TA) for temporal aggregation. We report accuracy results for $1 \times 3$ views (1 temporal clip and 3 spatial crops) departing from the common approach of using up to $1 0 \times 3$ views [26, 16]. The $1 \times 3$ views setting was also used in Bertasius et al. [3]. To measure the variation between runs, we trained one of the 8–frame models 5 times. The results varied by $\pm 0 . 4 \%$ .
150
+
151
+ # 4.2 Ablation studies
152
+
153
+ Throughout this section, we study the effect of varying certain design choices and different components of our method. Because SSv2 tends to require a more fine-grained temporal modeling, unless otherwise specified, all results reported, in this section, are on the SSv2.
154
+
155
+ Table 2: Effect of: (a) proposed SA position, (b) temporal aggregation and number of Temporal Attention (TA) layers, (c) space-time mixing qkv vectors and (d) amount of mixed channels on SSv2.
156
+ (a) Effect of applying the proposed SA to certain layers.
157
+
158
+ <table><tr><td>Transform. layers</td><td>Top-1 Top-5</td></tr><tr><td>1st half</td><td>61.7 86.5</td></tr><tr><td>2nd half</td><td>61.6 86.3</td></tr><tr><td>Half (odd. pos)</td><td>61.2 86.4</td></tr><tr><td>All</td><td>62.6 87.8</td></tr></table>
159
+
160
+ (c) Effect of space-time mixing. x denotes the input token before $q k v$ projection. Query produces equivalent results with key and thus omitted.
161
+ (d) Effect of amount of mixed channels. \* uses temp. avg. aggregation.
162
+
163
+ <table><tr><td>X</td><td>key</td><td>value</td><td>Top-1</td><td>Top-5</td></tr><tr><td>x&gt;xxx</td><td>X</td><td>X</td><td>56.6</td><td>83.5</td></tr><tr><td></td><td>X</td><td>X</td><td>63.1</td><td>88.8</td></tr><tr><td></td><td>√</td><td>×</td><td>63.1</td><td>88.8</td></tr><tr><td></td><td></td><td>√</td><td>62.5</td><td>88.6</td></tr><tr><td></td><td>×</td><td>√</td><td>64.4</td><td>89.3</td></tr></table>
164
+
165
+ (b) Effect of number of TA layers. 0 corresponds to temporal averaging.
166
+
167
+ <table><tr><td>#. TA layers</td><td>Top-1</td><td>Top-5</td></tr><tr><td>0 (temp. avg.)</td><td>62.4</td><td>87.8</td></tr><tr><td>1</td><td>64.4</td><td>89.3</td></tr><tr><td>2</td><td>64.5</td><td>89.3</td></tr><tr><td>3</td><td>64.5</td><td>89.3</td></tr></table>
168
+
169
+ <table><tr><td>0%*</td><td>0%</td><td>25%</td><td>50%</td><td>100%</td></tr><tr><td>45.2</td><td>56.6</td><td>64.3</td><td>64.4</td><td>62.5</td></tr></table>
170
+
171
+ Effect of local window size: Table 1 shows the accuracy of our model by varying the local window size $[ - t _ { w } , t _ { w } ]$ used in the proposed space-time mixing attention. Firstly, we observe that the proposed model is significantly superior to our baseline ${ { t } _ { w } } = 0$ ) which uses spatial-only attention. Secondly, a window of $t _ { w } = 1$ produces the best results. This shows that more gradual increase of the effective window size that is attended is more beneficial compared to more aggressive ones, i.e. the case where $t _ { w } = 2$ . A performance degradation for the case $t _ { w } = 2$ could be attributed to boundary effects (handled by filling with zeros) which are aggravated as $t _ { w }$ increases. Based on these results, we chose to use $t _ { w } = 1$ for the models reported hereafter. For short to medium long videos, it seems that $t _ { w } = 1$ suffices as the temporal receptive field size increases as we advance in depth in the model allowing it to capture a larger effective temporal window. For the datasets used, as explained earlier, after a few transformer layers the whole clip is effectively covered. However, for significantly longer video sequences, larger window sizes may perform better.
172
+
173
+ Effect of SA position: We explored which layers should the proposed space-time mixing attention be applied to within the network. Specifically, we explored the following variants: Applying it to the first $L / 2$ layers, to the last $L / 2$ layers, to every odd indexed layer and, finally, to all layers. As the results from Table 2a show, the exact layers within the network that self-attention is applied to do not matter; what matters is the number of layers it is applied to. We attribute this result to the increased temporal receptive field and cross-frame interactions.
174
+
175
+ Effect of temporal aggregation: Herein, we compare the two methods used for temporal aggregation: simple temporal averaging [41] and the proposed Temporal Attention (TA) mechanism. Given that our model already incorporates temporal information through the proposed space-time attention, we also explored how many TA layers are needed. As shown in Table 2b, replacing temporal averaging with one TA layer improves the Top-1 accuracy from $6 2 . 5 \%$ to $6 4 . 4 \%$ . Increasing the number of layers further yields no additional benefits. In Table 2d, we also report the accuracy of spatial-only attention $0 \%$ mixing) plus TA aggregation. In the absence of the proposed space-time mixing attention, the TA layer alone is unable to compensate, scoring only $5 6 . 6 \%$ . In the same table, $4 5 . 2 \%$ is the accuracy of a model trained without the proposed local attention and TA layer (i.e. using a temporal pooling for aggregation). Overall, the results highlight the need of having both components in our final model. For the next two ablation studies, we used 1 TA layer.
176
+
177
+ Table 3: Effect of number of tokens on SSv2.
178
+
179
+ <table><tr><td>Variant</td><td>Top-1</td><td>Top-5</td></tr><tr><td>XViT-T/16</td><td>54.7</td><td>82.8</td></tr><tr><td>XViT-S/32</td><td>57.0</td><td>84.6</td></tr><tr><td>XViT-S/16</td><td>61.1</td><td>88.0</td></tr><tr><td>XViT-B/32</td><td>60.5</td><td>87.4</td></tr><tr><td>XViT-L/32</td><td>61.8</td><td>88.3</td></tr><tr><td>XViT-B/16</td><td>64.4</td><td>89.3</td></tr></table>
180
+
181
+ Effect of space-time mixing qkv vectors: Paramount to our work is the proposed space-time mixing attention of Eq. 10 which is implemented by constructing $\tilde { \mathbf { k } } _ { s ^ { \prime } , - t _ { w } : t _ { w } } ^ { l }$ w and v˜ ls0,−tw :tw efficiently via channel indexing (see Eq. 9). Space-time mixing though can be applied in several different ways in the model. For completeness, herein, we study the effect of applying space-time mixing to various combinations for the key, value and to the input token prior to qkv projection. As shown in Table 2c, the combination corresponding to our model (i.e. space-time mixing applied to the key and value) significantly outperforms all other variants by up to $2 \%$ . This result is important as it confirms that our model, derived from the proposed approximation to the local space-time attention, gives the best results when compared to other non-well motivated variants.
182
+
183
+ Table 4: Comparison between TA and Summary token on SSv2 (left) and Kinetics-400 (right).
184
+
185
+ <table><tr><td>Summary</td><td>TA</td><td>Top-1</td><td>Top-5</td></tr><tr><td>X</td><td>X</td><td>62.4</td><td>87.8</td></tr><tr><td>√</td><td>×</td><td>63.7</td><td>88.9</td></tr><tr><td>√</td><td></td><td>63.4</td><td>88.9</td></tr><tr><td>X</td><td>交</td><td>64.4</td><td>89.3</td></tr></table>
186
+
187
+ <table><tr><td> Summary</td><td>TA</td><td>Top-1</td><td>Top-5</td></tr><tr><td>X</td><td>×</td><td>77.8</td><td>93.7</td></tr><tr><td>√</td><td>x&gt;&gt;</td><td>78.7</td><td>93.7</td></tr><tr><td>√</td><td></td><td>78.0</td><td>93.2</td></tr><tr><td>X</td><td></td><td>78.5</td><td>93.7</td></tr></table>
188
+
189
+ Table 5: Comparison with state-of-the-art on the Kinetics-400.
190
+
191
+ <table><tr><td>Method</td><td>Top-1</td><td>Top-5</td><td>#Frames</td><td>Views</td><td>Params</td><td>FLOPs (×109)</td></tr><tr><td>bLVNet [14]</td><td>73.5</td><td>91.2</td><td>24×2</td><td>3×3</td><td>25M</td><td>840</td></tr><tr><td>STM[19]</td><td>73.7</td><td>91.6</td><td>16</td><td>1</td><td>24M</td><td>1</td></tr><tr><td>TEA [25]</td><td>76.1</td><td>92.5</td><td>16</td><td>10×3</td><td>25.6M</td><td>2,100</td></tr><tr><td>TSM R50 [26]</td><td>74.7</td><td>=</td><td>16</td><td>10×3</td><td>25.6M</td><td>650</td></tr><tr><td>I3D NL [44]</td><td>77.7</td><td>93.3</td><td>128</td><td>10×3</td><td>1</td><td>10,800</td></tr><tr><td>CorrNet-101 [40]</td><td>79.2</td><td>-</td><td>32</td><td>10×3</td><td>=</td><td>6,700</td></tr><tr><td>ip-CSN-152[38]</td><td>79.2</td><td>93.8</td><td>8</td><td>10×3</td><td></td><td>3,270</td></tr><tr><td>LGD-3D R101 [31]</td><td>79.4</td><td>94.4</td><td>16</td><td>1</td><td>=</td><td>1</td></tr><tr><td>SlowFast 8×8 R101+NL [16]</td><td>78.7</td><td>93.5</td><td>8</td><td>10×3</td><td></td><td>3,480</td></tr><tr><td>SlowFast 16×8 R101+NL [16]</td><td>79.8</td><td>93.9</td><td>16</td><td>10×3</td><td>=</td><td>7,020</td></tr><tr><td>X3D-XXL [15]</td><td>80.4</td><td>94.6</td><td>1</td><td>10×3</td><td>20.3M</td><td>5,823</td></tr><tr><td>TimeSformer-L [3]</td><td>80.7</td><td>94.7</td><td>96</td><td>1×3</td><td>121M</td><td>7,140</td></tr><tr><td>ViViT-L/16x2[1]</td><td>80.6</td><td>94.7</td><td>32</td><td>4×3</td><td>312M</td><td>17,352</td></tr><tr><td>X-ViT (Ours)</td><td>78.5</td><td>93.7</td><td>8</td><td>1×3</td><td>92M</td><td>425</td></tr><tr><td>X-ViT (Ours)</td><td>79.4</td><td>93.9</td><td>8</td><td>2×3</td><td>92M</td><td>850</td></tr><tr><td>X-ViT (Ours)</td><td>80.2</td><td>94.7</td><td>16</td><td>1×3</td><td>92M</td><td>850</td></tr><tr><td>X-ViT (Ours)</td><td>80.7</td><td>94.7</td><td>16</td><td>2×3</td><td>92M</td><td>1700</td></tr></table>
192
+
193
+ Effect of amount of space-time mixing: We definefrom the adjacent frames in the local temporal window $\rho d _ { h }$ ming when $\begin{array} { r } { - t _ { w } , t _ { w } ] \left( i . e . \sum _ { t ^ { \prime } = - t _ { w } , t \neq 0 } ^ { t _ { w } } d _ { h } ^ { t ^ { \prime } } = \rho d _ { h } \right) } \end{array}$ constructing $\tilde { \mathbf { k } } _ { s ^ { \prime } , - t _ { w } : t _ { w } } ^ { l }$ (see Section 3). Herein, we study the effect of $\rho$ on the model’s accuracy. As the results from Table 2d show, the optimal $\rho$ is between $2 5 \%$ and $50 \%$ . Increasing $\rho$ to $100 \%$ (i.e. all channels are coming from adjacent frames) unsurprisingly degrades the performance as it excludes the case $t ^ { \prime } = t$ when performing the self-attention.
194
+
195
+ Effect of Summary token: Herein, we compare Temporal Attention with Summary token on SSv2 and Kinetics-400. We used both datasets for this case as they require different type of understanding: fine-grained temporal (SSv2) and spatial content (Kinetics-400). From Table 4, we conclude that the Summary token compares favorable on Kinetics-400 but not on SSv2 showing that it is more useful in terms of capturing spatial information. Since the improvement is small, we conclude that 1 TA layer is the best global attention-based mechanism for improving the accuracy of our method adding also negligible computational cost.
196
+
197
+ Effect of number of input frames: Herein we evaluate the impact of increasing the number of input frames $T$ from 8 to 16 and 32. We note that, for our method, this change results in a linear increase in complexity. As the results from Table 7 show, increasing the number of frames from 8 to 16 offers a $1 . 8 \%$ boost in Top-1 accuracy on SSv2. Moreover, increasing the number of frames to 32 improves the performance by a further $0 . 2 \%$ , offering diminishing returns. Similar behavior can be observed on Kinetics and Epic-100 in Tables 5 and 8.
198
+
199
+ Table 6: Comparison with state-of-the-art on the Kinetics-600 dataset. $T \times$ is the number of frames used by our method.
200
+
201
+ <table><tr><td>Method</td><td>Top-1</td><td>Top-5</td><td>Views</td><td>FLOPs (×109)</td></tr><tr><td>AttentionNAS [43]</td><td>79.8</td><td>94.4</td><td>=</td><td>1,034</td></tr><tr><td>LGD-3D R101 [31]</td><td>81.5</td><td>95.6</td><td>10×3</td><td>1</td></tr><tr><td>SlowFast R101+NL [16]</td><td>81.8</td><td>95.1</td><td>10×3</td><td>3,480</td></tr><tr><td>X3D-XL [15]</td><td>81.9</td><td>95.5</td><td>10×3</td><td>1,452</td></tr><tr><td>TimeSformer-HR [3]</td><td>82.4</td><td>96.0</td><td>1×3</td><td>5,110</td></tr><tr><td>ViViT-L/16x2[1]</td><td>82.5</td><td>95.6</td><td>4×3</td><td>17,352</td></tr><tr><td>X-ViT (8x) (Ours)</td><td>82.5</td><td>95.4</td><td>1×3</td><td>425</td></tr><tr><td>X-ViT (16×) (Ours)</td><td>84.5</td><td>96.3</td><td>1×3</td><td>850</td></tr></table>
202
+
203
+ Effect of number of tokens and different model sizes: Herein, we vary the number of input tokens by changing the patch size $K$ . As the results from Table 3 show, even when the number of tokens decreases significantly (e.g. ViT-B/32 or ViT-S/32) our approach is still able to produce results of satisfactory accuracy. The benefit of that is having a model which is significantly more efficient. Similar concusions can be observed when the model size (in terms of parameters and FLOPs) is varied. Our approach provides consistent results in all cases, showcasing its ability to scale well from tiny (XViT-T) to large (XViT-L) models.
204
+
205
+ Latency and throughput considerations: While the channel shifting operation used by the proposed space-time mixing attention is zero-FLOP, there is still a small cost associated with memory movement operations. In order to ascertain that the induced cost does not introduce noticeable performance degradation, we benchmarked a Vit-B/16 ( $8 \times$ frames) model using spatial-only attention and the proposed space-time mixing attention on 8 V100 GPUs and a batch size of 128. A model with spatial-only attention has a throughput of 312 fps while our model has 304 fps.
206
+
207
+ Table 7: Comparison with state-of-the-art on SSv2. \* - pretrained on Kinetics 600
208
+
209
+ <table><tr><td>Method</td><td>Top-1</td><td>Top-5</td><td>#Frames</td><td>Views</td><td>FLOPs (×109)</td></tr><tr><td>TRN [53]</td><td>48.8</td><td>77.6</td><td>8</td><td></td><td></td></tr><tr><td>SlowFast+multigrid [46]</td><td>61.7</td><td>1</td><td>1</td><td>1×3</td><td></td></tr><tr><td>TimeSformer-L [3]</td><td>62.4</td><td>1</td><td>96</td><td>1×3</td><td>7,140</td></tr><tr><td>TSMR50 [26]</td><td>63.3</td><td>88.5</td><td>16</td><td>2×3</td><td>-</td></tr><tr><td>STM[19]</td><td>64.2</td><td>89.8</td><td>16</td><td>-</td><td>-</td></tr><tr><td>MSNet [24]</td><td>64.7</td><td>89.4</td><td>16</td><td>=</td><td>-</td></tr><tr><td>TEA [25]</td><td>65.1</td><td>89.9</td><td>16</td><td></td><td></td></tr><tr><td>ViViT-L/16x2 [3]</td><td>65.4</td><td>89.8</td><td>32</td><td>4×3</td><td>11,892</td></tr><tr><td>X-ViT (Ours)</td><td>64.4</td><td>89.3</td><td>8</td><td>1×3</td><td>425</td></tr><tr><td>X-ViT (Ours)</td><td>66.2</td><td>90.6</td><td>16</td><td>1×3</td><td>850</td></tr><tr><td>X-ViT* (Ours)</td><td>67.2</td><td>90.8</td><td>16</td><td>1×3</td><td>850</td></tr><tr><td>X-ViT (Ours)</td><td>66.4</td><td>90.7</td><td>32</td><td>1×3</td><td>1,270</td></tr></table>
210
+
211
+ # 4.3 Comparison to state-of-the-art
212
+
213
+ Our best model uses the proposed space-time mixing attention in all the Transformer layers and performs temporal aggregation using a single lightweight temporal transformer layer as described in Section 3. Unless otherwise specified, we report the results using the $1 \times 3$ configuration for the views (1 temporal and 3 spatial) for all datasets. Regarding related work on transformer-based video recognition [1, 3], we included their very best models trained on the same data as our models. For TimeSformer, this is typically the TimeSformer-L version. For ViVit, we used the 16x2 configuration, with factorized-encoding for Epic-100 and SS-v2 (as reported in Tables 6d and 6e in [1]) and the full version for Kinetics (as reported in Table 6a in [1]).
214
+
215
+ On Kinetics-400, we match the current state-of-the-art while having significantly lower computational complexity than the next two best recently proposed methods that also use Transformer-based architectures: $2 0 \times$ fewer FLOPs than ViVit [1] and $8 \times$ fewer than TimeSformer-L [3]. Note that both models from [1, 3] and ours were initialized from a ViT model pretrained on ImageNet-21k [11] and take as input frames at a resolution of $2 2 4 \times 2 2 4 \mathrm { p x }$ . Similar conclusions can be drawn from Table 6 which reports our results on Kinetics-600.
216
+
217
+ On SSv2, we match and surpass the current state-of-the-art, especially in terms of Top-5 accuracy (ours: $9 0 . 7 \%$ vs ViViT: $8 9 . 8 \%$ [1]) using models that are $1 4 \times$ (16 frames) and $9 \times$ (32 frames) faster.
218
+
219
+ Finally, we observe similar outcomes on Epic-100 where we set a new state-of-the-art, showing large improvements especially for “Verb” accuracy, while again being more efficient.
220
+
221
+ # 5 Ethical considerations and broader impact
222
+
223
+ Current high-performing video recognition models tend to have high computational demands for both training and testing and, by extension, significant environmental costs. This is especially true for the transformer-based architectures. Our research introduces a novel approach that matches and surpasses the current state-ofthe-art while being significantly more efficient thanks to the linear scaling of the complexity with respect to the number of frames. We hope such models will offer noticeable reduction in power consumption while setting at the same time a solid base for future research. We will release code and models to facilitate this. Moreover, and similarly to most data-driven systems,
224
+
225
+ Table 8: Comparison with state-of-the-art on Epic100. $T \times$ is the #frames used by our method. Results for other methods are taken from [1].
226
+
227
+ <table><tr><td>Method</td><td>Action</td><td>Verb</td><td>Noun</td></tr><tr><td>TSN [41] TRN [53]</td><td>33.2 35.3</td><td>60.2 65.9</td><td>46.0 45.4</td></tr><tr><td>TBN [22] TSM[22] SlowFast [16]</td><td>36.7 38.3 38.5</td><td>66.0 67.9 65.6</td><td>47.2 49.0 50.0</td></tr><tr><td>ViViT-L/16x2[1] X-ViT (8×) (Ours) X-ViT(16×) (Ours)</td><td>44.0 41.5</td><td>66.4 66.7</td><td>56.8 53.3</td></tr></table>
228
+
229
+ bias from the training data can potentially affect the fairness of the model. As such, we suggest to take this aspect into consideration when deploying the models into real-world scenarios.
230
+
231
+ # 6 Conclusions
232
+
233
+ We presented a novel approximation to the full space-time attention that is amenable to an efficient implementation and applied it to video recognition. Our approximation has the same computational cost as spatial-only attention yet the resulting video Transformer model was shown to be significantly more efficient than recently proposed Video Transformers [3, 1]. By no means this paper proposes a complete solution to video recognition using video Transformers. Future efforts could include combining our approaches with other architectures than the standard ViT, removing the dependency on pre-trained models and applying the model to other video-related tasks like detection and segmentation. Finally, further research is required for deploying our models on low power/resource devices.
234
+
235
+ References
236
+ [1] Anurag Arnab, Mostafa Dehghani, Georg Heigold, Chen Sun, Mario Luciˇ c, and Cordelia Schmid. Vivit: A ´ video vision transformer. arXiv preprint arXiv:2103.15691, 2021.
237
+ [2] Iz Beltagy, Matthew E Peters, and Arman Cohan. Longformer: The long-document transformer. arXiv preprint arXiv:2004.05150, 2020.
238
+ [3] Gedas Bertasius, Heng Wang, and Lorenzo Torresani. Is space-time attention all you need for video understanding? arXiv preprint arXiv:2102.05095, 2021.
239
+ [4] Joao Carreira and Andrew Zisserman. Quo vadis, action recognition? a new model and the kinetics dataset. In proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6299–6308, 2017.
240
+ [5] Mia Xu Chen, Orhan Firat, Ankur Bapna, Melvin Johnson, Wolfgang Macherey, George Foster, Llion Jones, Niki Parmar, Mike Schuster, Zhifeng Chen, et al. The best of both worlds: Combining recent advances in neural machine translation. arXiv preprint arXiv:1804.09849, 2018.
241
+ [6] Yunpeng Chen, Yannis Kalantidis, Jianshu Li, Shuicheng Yan, and Jiashi Feng. A2-nets: Double attention networks. arXiv preprint arXiv:1810.11579, 2018.
242
+ [7] Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers. arXiv preprint arXiv:1904.10509, 2019.
243
+ [8] Ekin D Cubuk, Barret Zoph, Dandelion Mane, Vijay Vasudevan, and Quoc V Le. Autoaugment: Learning augmentation policies from data. arXiv preprint arXiv:1805.09501, 2018.
244
+ [9] Dima Damen, Hazel Doughty, Giovanni Maria Farinella, Sanja Fidler, Antonino Furnari, Evangelos Kazakos, Davide Moltisanti, Jonathan Munro, Toby Perrett, Will Price, et al. Scaling egocentric vision: The epic-kitchens dataset. In ECCV, 2018.
245
+ [10] Dima Damen, Hazel Doughty, Giovanni Maria Farinella, Antonino Furnari, Evangelos Kazakos, Jian Ma, Davide Moltisanti, Jonathan Munro, Toby Perrett, Will Price, et al. Rescaling egocentric vision. arXiv preprint arXiv:2006.13256, 2020.
246
+ [11] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pages 248–255. Ieee, 2009.
247
+ [12] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
248
+ [13] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020.
249
+ [14] Quanfu Fan, Chun-Fu Chen, Hilde Kuehne, Marco Pistoia, and David Cox. More is less: Learning efficient video representations by big-little network and depthwise temporal aggregation. arXiv preprint arXiv:1912.00869, 2019.
250
+ [15] Christoph Feichtenhofer. X3d: Expanding architectures for efficient video recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 203–213, 2020.
251
+ [16] Christoph Feichtenhofer, Haoqi Fan, Jitendra Malik, and Kaiming He. Slowfast networks for video recognition. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 6202–6211, 2019.
252
+ [17] Raghav Goyal, Samira Ebrahimi Kahou, Vincent Michalski, Joanna Materzynska, Susanne Westphal, Heuna Kim, Valentin Haenel, Ingo Fruend, Peter Yianilos, Moritz Mueller-Freitag, et al. The" something something" video database for learning and evaluating visual common sense. In Proceedings of the IEEE International Conference on Computer Vision, pages 5842–5850, 2017.
253
+ [18] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016.
254
+ [19] Boyuan Jiang, MengMeng Wang, Weihao Gan, Wei Wu, and Junjie Yan. Stm: Spatiotemporal and motion encoding for action recognition. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 2000–2009, 2019.
255
+ [20] Andrej Karpathy, George Toderici, Sanketh Shetty, Thomas Leung, Rahul Sukthankar, and Li Fei-Fei. Large-scale video classification with convolutional neural networks. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, pages 1725–1732, 2014.
256
+ [21] Will Kay, Joao Carreira, Karen Simonyan, Brian Zhang, Chloe Hillier, Sudheendra Vijayanarasimhan, Fabio Viola, Tim Green, Trevor Back, Paul Natsev, et al. The kinetics human action video dataset. arXiv preprint arXiv:1705.06950, 2017.
257
+ [22] Evangelos Kazakos, Arsha Nagrani, Andrew Zisserman, and Dima Damen. Epic-fusion: Audio-visual temporal binding for egocentric action recognition. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 5492–5501, 2019.
258
+ [23] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. Advances in neural information processing systems, 25:1097–1105, 2012.
259
+ [24] Heeseung Kwon, Manjin Kim, Suha Kwak, and Minsu Cho. Motionsqueeze: Neural motion feature learning for video understanding. In European Conference on Computer Vision, pages 345–362. Springer, 2020.
260
+ [25] Yan Li, Bin Ji, Xintian Shi, Jianguo Zhang, Bin Kang, and Limin Wang. Tea: Temporal excitation and aggregation for action recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 909–918, 2020.
261
+ [26] Ji Lin, Chuang Gan, and Song Han. Tsm: Temporal shift module for efficient video understanding. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 7083–7093, 2019.
262
+ [27] Zhaoyang Liu, Limin Wang, Wayne Wu, Chen Qian, and Tong Lu. Tam: Temporal adaptive module for video recognition. arXiv preprint arXiv:2005.06803, 2020.
263
+ [28] Ilya Loshchilov and Frank Hutter. Sgdr: Stochastic gradient descent with warm restarts. arXiv preprint arXiv:1608.03983, 2016.
264
+ [29] Niki Parmar, Ashish Vaswani, Jakob Uszkoreit, Lukasz Kaiser, Noam Shazeer, Alexander Ku, and Dustin Tran. Image transformer. In International Conference on Machine Learning, pages 4055–4064. PMLR, 2018.
265
+ [30] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperative style, high-performance deep learning library. arXiv preprint arXiv:1912.01703, 2019.
266
+ [31] Zhaofan Qiu, Ting Yao, Chong-Wah Ngo, Xinmei Tian, and Tao Mei. Learning spatio-temporal representation with local and global diffusion. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 12056–12065, 2019.
267
+ [32] Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. arXiv preprint arXiv:1910.10683, 2019.
268
+ [33] Aravind Srinivas, Tsung-Yi Lin, Niki Parmar, Jonathon Shlens, Pieter Abbeel, and Ashish Vaswani. Bottleneck transformers for visual recognition. arXiv preprint arXiv:2101.11605, 2021.
269
+ [34] Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2818–2826, 2016.
270
+ [35] Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé Jégou. Training data-efficient image transformers & distillation through attention. arXiv preprint arXiv:2012.12877, 2020.
271
+ [36] Du Tran, Lubomir Bourdev, Rob Fergus, Lorenzo Torresani, and Manohar Paluri. Learning spatiotemporal features with 3d convolutional networks. In Proceedings of the IEEE international conference on computer vision, pages 4489–4497, 2015.
272
+ [37] Du Tran, Heng Wang, Lorenzo Torresani, Jamie Ray, Yann LeCun, and Manohar Paluri. A closer look at spatiotemporal convolutions for action recognition. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, pages 6450–6459, 2018.
273
+ [38] Du Tran, Heng Wang, Lorenzo Torresani, and Matt Feiszli. Video classification with channel-separated convolutional networks. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 5552–5561, 2019.
274
+ [39] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. arXiv preprint arXiv:1706.03762, 2017.
275
+ [40] Heng Wang, Du Tran, Lorenzo Torresani, and Matt Feiszli. Video modeling with correlation networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 352–361, 2020.
276
+ [41] Limin Wang, Yuanjun Xiong, Zhe Wang, Yu Qiao, Dahua Lin, Xiaoou Tang, and Luc Van Gool. Temporal segment networks: Towards good practices for deep action recognition. In European conference on computer vision, pages 20–36. Springer, 2016.
277
+ [42] Limin Wang, Yuanjun Xiong, Zhe Wang, Yu Qiao, Dahua Lin, Xiaoou Tang, and Luc Van Gool. Temporal segment networks for action recognition in videos. IEEE transactions on pattern analysis and machine intelligence, 41(11):2740–2755, 2018.
278
+ [43] Xiaofang Wang, Xuehan Xiong, Maxim Neumann, AJ Piergiovanni, Michael S Ryoo, Anelia Angelova, Kris M Kitani, and Wei Hua. Attentionnas: Spatiotemporal attention cell search for video classification. In European Conference on Computer Vision, pages 449–465. Springer, 2020.
279
+ [44] Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He. Non-local neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7794–7803, 2018.
280
+ [45] Bichen Wu, Alvin Wan, Xiangyu Yue, Peter Jin, Sicheng Zhao, Noah Golmant, Amir Gholaminejad, Joseph Gonzalez, and Kurt Keutzer. Shift: A zero flop, zero parameter alternative to spatial convolutions. In CVPR, 2018.
281
+ [46] Chao-Yuan Wu, Ross Girshick, Kaiming He, Christoph Feichtenhofer, and Philipp Krahenbuhl. A multigrid method for efficiently training video models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 153–162, 2020.
282
+ [47] Saining Xie, Ross Girshick, Piotr Dollár, Zhuowen Tu, and Kaiming He. Aggregated residual transformations for deep neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1492–1500, 2017.
283
+ [48] Li Yuan, Yunpeng Chen, Tao Wang, Weihao Yu, Yujun Shi, Francis EH Tay, Jiashi Feng, and Shuicheng Yan. Tokens-to-token vit: Training vision transformers from scratch on imagenet. arXiv preprint arXiv:2101.11986, 2021.
284
+ [49] Manzil Zaheer, Guru Guruganesh, Kumar Avinava Dubey, Joshua Ainslie, Chris Alberti, Santiago Ontanon, Philip Pham, Anirudh Ravula, Qifan Wang, Li Yang, et al. Big bird: Transformers for longer sequences. In NeurIPS, 2020.
285
+ [50] Han Zhang, Ian Goodfellow, Dimitris Metaxas, and Augustus Odena. Self-attention generative adversarial networks. In International conference on machine learning, pages 7354–7363. PMLR, 2019.
286
+ [51] Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412, 2017.
287
+ [52] Zhun Zhong, Liang Zheng, Guoliang Kang, Shaozi Li, and Yi Yang. Random erasing data augmentation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 13001–13008, 2020.
288
+ [53] Bolei Zhou, Alex Andonian, Aude Oliva, and Antonio Torralba. Temporal relational reasoning in videos. In Proceedings of the European Conference on Computer Vision (ECCV), pages 803–818, 2018.
289
+
290
+ # Checklist
291
+
292
+ 1. For all authors...
293
+
294
+ (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
295
+ (b) Did you describe the limitations of your work? [Yes] See Section 6
296
+ (c) Did you discuss any potential negative societal impacts of your work? [Yes] See Section 5
297
+ (d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
298
+
299
+ 2. If you are including theoretical results...
300
+
301
+ (a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
302
+
303
+ 3. If you ran experiments...
304
+
305
+ (a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [No] We include however all implementation details required to reproduce our work. We will make the code and the models available. The datasets used are already publicly available.
306
+ (b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Section 4.1
307
+ (c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] Due to prohibitive costs, we reported the variations between multiple training runs for a single 8 frames model in Section 4.1. This should be representative for the rest of the trained models.
308
+ (d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Section 4.1
309
+
310
+ 4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
311
+
312
+ (a) If your work uses existing assets, did you cite the creators? [Yes]
313
+ (b) Did you mention the license of the assets? [Yes] See Section 4.1
314
+ (c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
315
+ (d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A] No data was collected, publicly available datasets were used
316
+ (e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [Yes] To our knowledge the datasets used do not contain such info
317
+
318
+ 5. If you used crowdsourcing or conducted research with human subjects...
319
+
320
+ (a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
321
+ (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
322
+ (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
parse/train/QgX15Mdi1E_/QgX15Mdi1E__content_list.json ADDED
@@ -0,0 +1,1324 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "Space-time Mixing Attention for Video Transformer ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 183,
8
+ 122,
9
+ 813,
10
+ 147
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Adrian Bulat Samsung AI Cambridge adrian@adrianbulat.com ",
17
+ "bbox": [
18
+ 258,
19
+ 200,
20
+ 450,
21
+ 242
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "Juan-Manuel Perez-Rua Samsung AI Cambridge j.perez-rua@samsung.com ",
28
+ "bbox": [
29
+ 539,
30
+ 200,
31
+ 740,
32
+ 243
33
+ ],
34
+ "page_idx": 0
35
+ },
36
+ {
37
+ "type": "text",
38
+ "text": "Swathikiran SudhakaranSamsung AI Cambridgeswathikir.s@samsung.com",
39
+ "bbox": [
40
+ 186,
41
+ 265,
42
+ 383,
43
+ 305
44
+ ],
45
+ "page_idx": 0
46
+ },
47
+ {
48
+ "type": "text",
49
+ "text": "Brais Martinez Samsung AI Cambridge brais.a@samsung.com ",
50
+ "bbox": [
51
+ 401,
52
+ 263,
53
+ 565,
54
+ 305
55
+ ],
56
+ "page_idx": 0
57
+ },
58
+ {
59
+ "type": "text",
60
+ "text": "Georgios Tzimiropoulos Samsung AI Cambridge \nQueen Mary University of London \ng.tzimiropoulos@qmul.ac.uk ",
61
+ "bbox": [
62
+ 583,
63
+ 265,
64
+ 813,
65
+ 320
66
+ ],
67
+ "page_idx": 0
68
+ },
69
+ {
70
+ "type": "text",
71
+ "text": "Abstract ",
72
+ "text_level": 1,
73
+ "bbox": [
74
+ 462,
75
+ 356,
76
+ 535,
77
+ 372
78
+ ],
79
+ "page_idx": 0
80
+ },
81
+ {
82
+ "type": "text",
83
+ "text": "This paper is on video recognition using Transformers. Very recent attempts in this area have demonstrated promising results in terms of recognition accuracy, yet they have been also shown to induce, in many cases, significant computational overheads due to the additional modelling of the temporal information. In this work, we propose a Video Transformer model the complexity of which scales linearly with the number of frames in the video sequence and hence induces no overhead compared to an image-based Transformer model. To achieve this, our model makes two approximations to the full space-time attention used in Video Transformers: (a) It restricts time attention to a local temporal window and capitalizes on the Transformer’s depth to obtain full temporal coverage of the video sequence. (b) It uses efficient space-time mixing to attend jointly spatial and temporal locations without inducing any additional cost on top of a spatial-only attention model. We also show how to integrate 2 very lightweight mechanisms for global temporal-only attention which provide additional accuracy improvements at minimal computational cost. We demonstrate that our model produces very high recognition accuracy on the most popular video recognition datasets while at the same time being significantly more efficient than other Video Transformer models. Code for our method is made available here. ",
84
+ "bbox": [
85
+ 233,
86
+ 390,
87
+ 766,
88
+ 638
89
+ ],
90
+ "page_idx": 0
91
+ },
92
+ {
93
+ "type": "text",
94
+ "text": "1 Introduction ",
95
+ "text_level": 1,
96
+ "bbox": [
97
+ 174,
98
+ 674,
99
+ 310,
100
+ 691
101
+ ],
102
+ "page_idx": 0
103
+ },
104
+ {
105
+ "type": "text",
106
+ "text": "Video recognition – in analogy to image recognition – refers to the problem of recognizing events of interest in video sequences such as human activities. Following the tremendous success of Transformers in sequential data, specifically in Natural Language Processing (NLP) [39, 5], Vision Transformers were very recently shown to outperform CNNs for image recognition too [48, 13, 35], signaling a paradigm shift on how visual understanding models should be constructed. In light of this, in this paper, we propose a Video Transformer model as an appealing and promising solution for improving the accuracy of video recognition models. ",
107
+ "bbox": [
108
+ 174,
109
+ 709,
110
+ 825,
111
+ 806
112
+ ],
113
+ "page_idx": 0
114
+ },
115
+ {
116
+ "type": "text",
117
+ "text": "A direct, natural extension of Vision Transformers to the spatio-temporal domain is to perform the self-attention jointly across all $S$ spatial locations and $T$ temporal locations. Full space-time attention though has complexity ${ \\cal O } ( T ^ { 2 } S ^ { 2 } )$ making such a model computationally heavy and, hence, impractical even when compared with the 3D-based convolutional models. As such, our aim is to exploit the temporal information present in video streams while minimizing the computational burden within the Transformer framework for efficient video recognition. ",
118
+ "bbox": [
119
+ 174,
120
+ 813,
121
+ 825,
122
+ 895
123
+ ],
124
+ "page_idx": 0
125
+ },
126
+ {
127
+ "type": "image",
128
+ "img_path": "images/38d7921c4c4fff3fb53fbfab94c9e54bd48c7ecb8a73bcab412285f4b727ec5c.jpg",
129
+ "image_caption": [
130
+ "Figure 1: Different approaches to space-time self-attention for video recognition. In all cases, the key locations that the query vector, located at the center of the grid in red, attends are shown in orange. Unlike prior work, our key vector is constructed by mixing information from tokens located at the same spatial location within a local temporal window. Our method then performs self-attention with these tokens. Note that our mechanism allows for an efficient approximation of local space-time attention at no extra cost. "
131
+ ],
132
+ "image_footnote": [],
133
+ "bbox": [
134
+ 181,
135
+ 89,
136
+ 816,
137
+ 250
138
+ ],
139
+ "page_idx": 1
140
+ },
141
+ {
142
+ "type": "text",
143
+ "text": "A baseline solution to this problem is to consider spatial-only attention followed by temporal averaging, which has complexity ${ \\cal O } ( T S ^ { 2 } )$ . Similar attempts to reduce the cost of full space-time attention have been recently proposed in [3, 1]. These methods have demonstrated promising results in terms of video recognition accuracy, yet they have been also shown to induce, in most of the cases, significant computational overheads compared to the baseline (spatial-only) method due to the additional modelling of the temporal information. ",
144
+ "bbox": [
145
+ 174,
146
+ 362,
147
+ 825,
148
+ 445
149
+ ],
150
+ "page_idx": 1
151
+ },
152
+ {
153
+ "type": "text",
154
+ "text": "Our main contribution in this paper is a Video Transformer model that has complexity $O ( T S ^ { 2 } )$ and, hence, is as efficient as the baseline model, yet, as our results show, it outperforms recently/concurrently proposed work [3, 1] in terms of efficiency (i.e. accuracy/FLOP) by significant margins. To achieve this our model makes two approximations to the full space-time attention used in Video Transformers: (a) It restricts time attention to a local temporal window and capitalizes on the Transformer’s depth to obtain full temporal coverage of the video sequence. (b) It uses efficient space-time mixing to attend jointly spatial and temporal locations without inducing any additional cost on top of a spatial-only attention model. Fig. 1 shows the proposed approximation to space-time attention. We also show how to integrate two very lightweight mechanisms for global temporal-only attention, which provide additional accuracy improvements at minimal computational cost. We demonstrate that our model is surprisingly effective in terms of capturing long-term dependencies and producing very high recognition accuracy on the most popular video recognition datasets, including Something-Something-v2 [17], Kinetics [4] and Epic Kitchens [9], while at the same time being significantly more efficient than other Video Transformer models. ",
155
+ "bbox": [
156
+ 174,
157
+ 452,
158
+ 825,
159
+ 645
160
+ ],
161
+ "page_idx": 1
162
+ },
163
+ {
164
+ "type": "text",
165
+ "text": "2 Related work ",
166
+ "text_level": 1,
167
+ "bbox": [
168
+ 174,
169
+ 674,
170
+ 316,
171
+ 690
172
+ ],
173
+ "page_idx": 1
174
+ },
175
+ {
176
+ "type": "text",
177
+ "text": "Video recognition: Standard solutions are based on CNNs and can be broadly classified into two categories: 2D- and 3D-based approaches. 2D-based approaches process each frame independently to extract frame-based features which are then aggregated temporally with some sort of temporal modeling (e.g. temporal averaging) performed at the end of the network [42, 26, 27]. The works of [26, 27] use the “shift trick” [45] to have some temporal modeling at a layer level. 3D-based approaches [4, 16, 36] are considered the current state-of-the-art as they can typically learn stronger temporal models via 3D convolutions. However, they also incur higher computational and memory costs. To alleviate this, a large body of works attempt to improve their efficiency via spatial and/or temporal factorization [38, 37, 15]. ",
178
+ "bbox": [
179
+ 174,
180
+ 710,
181
+ 825,
182
+ 835
183
+ ],
184
+ "page_idx": 1
185
+ },
186
+ {
187
+ "type": "text",
188
+ "text": "CNN vs ViT: Historically, video recognition approaches tend to mimic the architectures used for image classification (e.g. from AlexNet [23] to [20] or from ResNet [18] and ResNeXt [47] to [16]). After revolutionizing NLP [39, 32], very recently, Transformer-based architectures showed promising results on large scale image classification too [13]. While self-attention and attention were previously used in conjunction with CNNs at a layer or block level [6, 50, 33], the Vision Transformer (ViT) ",
189
+ "bbox": [
190
+ 174,
191
+ 842,
192
+ 825,
193
+ 911
194
+ ],
195
+ "page_idx": 1
196
+ },
197
+ {
198
+ "type": "text",
199
+ "text": "of Dosovitskiy et al. [13] is the first convolution-free, Transformer-based architecture that achieves state-of-the-art on ImageNet [11]. ",
200
+ "bbox": [
201
+ 173,
202
+ 90,
203
+ 823,
204
+ 119
205
+ ],
206
+ "page_idx": 2
207
+ },
208
+ {
209
+ "type": "text",
210
+ "text": "Video Transformer: Recently/concurrently with our work, vision transformer architectures, derived from [13], were used for video recognition [3, 1], too. Because performing full space-time attention is computationally prohibitive (i.e. $\\bar { O } ( T ^ { 2 } S ^ { 2 } ) )$ , their main focus is on reducing this via temporal and spatial factorization. In TimeSformer [3], the authors propose applying spatial and temporal attention in an alternating manner reducing the complexity to $\\bar { O } ( \\bar { T ^ { 2 } } S + \\bar { T } \\bar { S ^ { 2 } } )$ . In a similar fashion, ViViT [1] explores several avenues for space-time factorization. In addition, they also proposed to adapt the patch embedding process from [13] to 3D (i.e. video) data. Our work proposes a completely different approximation to full space-time attention that is also efficient. To this end, we firstly restrict full space-time attention to a local temporal window which is reminiscent of [2] but applied here to space-time attention and video recognition 1. Secondly, we define a local joint space-time attention which we show that can be implemented efficiently via the “shift trick” [45]. ",
211
+ "bbox": [
212
+ 173,
213
+ 126,
214
+ 825,
215
+ 279
216
+ ],
217
+ "page_idx": 2
218
+ },
219
+ {
220
+ "type": "text",
221
+ "text": "3 Method ",
222
+ "text_level": 1,
223
+ "bbox": [
224
+ 174,
225
+ 296,
226
+ 271,
227
+ 313
228
+ ],
229
+ "page_idx": 2
230
+ },
231
+ {
232
+ "type": "text",
233
+ "text": "Video Transformer: We are given a video clip $\\mathbf { X } \\in \\mathbb { R } ^ { T \\times H \\times W \\times C }$ $C = 3$ ). Following ViT [13], each frame is divided into $K \\times K$ non-overlapping patches which are then mapped into visual tokens using a linear embedding layer $\\mathbf { E } \\in \\mathbb { R } ^ { 3 K ^ { 2 } \\times d }$ . Since self-attention is permutation invariant, in order to preserve the information regarding the location of each patch within space and time we also learn two positional embeddings, one for space: $\\mathbf { p } _ { s } \\in \\mathbb { R } ^ { 1 \\times S \\times d }$ and one for time: $\\mathbf { p } _ { t } \\in \\mathbb { R } ^ { T \\times 1 \\times d }$ . These are then added to the initial visual tokens. Finally, the token sequence is processed by $L$ Transformer layers. ",
234
+ "bbox": [
235
+ 173,
236
+ 324,
237
+ 825,
238
+ 426
239
+ ],
240
+ "page_idx": 2
241
+ },
242
+ {
243
+ "type": "text",
244
+ "text": "The visual token at layer $l$ , spatial location $s$ and temporal location $t$ is denoted as: ",
245
+ "bbox": [
246
+ 178,
247
+ 431,
248
+ 717,
249
+ 446
250
+ ],
251
+ "page_idx": 2
252
+ },
253
+ {
254
+ "type": "equation",
255
+ "img_path": "images/374a344120b95e482ebed3e125cbc98f98d6f263db1de3615cb36f8147af2778.jpg",
256
+ "text": "$$\n\\begin{array} { r } { \\mathbf { z } _ { s , t } ^ { l } \\in \\mathbb { R } ^ { d } , l = 0 , \\ldots , L - 1 , s = 0 , \\ldots , S - 1 , t = 0 , \\ldots , T - 1 . } \\end{array}\n$$",
257
+ "text_format": "latex",
258
+ "bbox": [
259
+ 267,
260
+ 449,
261
+ 728,
262
+ 467
263
+ ],
264
+ "page_idx": 2
265
+ },
266
+ {
267
+ "type": "text",
268
+ "text": "In addition to the $S T$ visual tokens extracted from the video, a special classification token $\\mathbf { z } _ { c l s } ^ { l } \\in \\mathbb { R } ^ { d }$ is prepended to the token sequence [12]. The $l -$ th Transformer layer processes the visual tokens $\\mathbf { Z } ^ { l ^ { - } } \\in \\mathsf { \\bar { R } } ^ { ( S T + 1 ) \\times d }$ of the previous layer using a series of Multi-head Self-Attention (MSA), Layer Normalization (LN), and MLP $\\mathbb { R } ^ { d } \\overset { \\cdot } { \\to } \\mathbb { R } ^ { 4 d } \\overset { \\cdot } { \\to } \\mathbb { R } ^ { d }$ ) layers as follows: ",
269
+ "bbox": [
270
+ 173,
271
+ 469,
272
+ 825,
273
+ 527
274
+ ],
275
+ "page_idx": 2
276
+ },
277
+ {
278
+ "type": "equation",
279
+ "img_path": "images/d78c18022c34b0549f625ffb716d0b3918c43d51abaaa98bc54762848b8edc36.jpg",
280
+ "text": "$$\n\\begin{array} { r c l } { { \\mathbf { Y } ^ { l } } } & { { = } } & { { { \\mathrm { \\bf ~ M S A } } ( { \\mathrm { \\bf ~ L N } } ( { \\mathbf { Z } } ^ { l - 1 } ) ) + { \\mathbf { Z } } ^ { l - 1 } , } } \\\\ { { \\mathbf { Z } ^ { l } } } & { { = } } & { { { \\mathrm { \\bf ~ M L P } } ( { \\mathrm { \\bf ~ L N } } ( { \\mathbf { Y } } ^ { l } ) ) + { \\mathbf { Y } } ^ { l } . } } \\end{array}\n$$",
281
+ "text_format": "latex",
282
+ "bbox": [
283
+ 375,
284
+ 529,
285
+ 617,
286
+ 569
287
+ ],
288
+ "page_idx": 2
289
+ },
290
+ {
291
+ "type": "text",
292
+ "text": "The main computation of a single full space-time Self-Attention (SA) head boils down to calculating: ",
293
+ "bbox": [
294
+ 176,
295
+ 574,
296
+ 828,
297
+ 590
298
+ ],
299
+ "page_idx": 2
300
+ },
301
+ {
302
+ "type": "equation",
303
+ "img_path": "images/be930794a7cf3e1709d430cce1815c5a18924854c6fc7093bf5d752935c44b9a.jpg",
304
+ "text": "$$\n\\mathbf { y } _ { s , t } ^ { l } = \\sum _ { t ^ { \\prime } = 0 } ^ { T - 1 } \\sum _ { s ^ { \\prime } = 0 } ^ { S - 1 } \\mathrm { S o f t m a x } \\{ ( \\mathbf { q } _ { s , t } ^ { l } \\cdot \\mathbf { k } _ { s ^ { \\prime } , t ^ { \\prime } } ^ { l } ) / \\sqrt { d _ { h } } \\} \\mathbf { v } _ { s ^ { \\prime } , t ^ { \\prime } } ^ { l } , \\ \\left\\{ \\begin{array} { l l } { s = 0 , \\dots , S - 1 } \\\\ { t = 0 , \\dots , T - 1 } \\end{array} \\right\\}\n$$",
305
+ "text_format": "latex",
306
+ "bbox": [
307
+ 274,
308
+ 590,
309
+ 722,
310
+ 633
311
+ ],
312
+ "page_idx": 2
313
+ },
314
+ {
315
+ "type": "text",
316
+ "text": "where $\\mathbf { q } _ { s , t } ^ { l } , \\mathbf { k } _ { s , t } ^ { l } , \\mathbf { v } _ { s , t } ^ { l } \\in \\mathbb { R } ^ { d _ { h } }$ are the query, key, and value vectors computed from $\\mathbf { z } _ { s , t } ^ { l }$ (after LN) using embedding matrices $\\mathbf { W _ { q } } , \\mathbf { W _ { k } } , \\mathbf { W _ { v } } \\in \\mathbb { R } ^ { d \\times d _ { h } }$ . Finally, the output of the $h$ heads is concatenated and projected using embedding matrix Wh ∈ Rhdh×d. ",
317
+ "bbox": [
318
+ 174,
319
+ 636,
320
+ 825,
321
+ 683
322
+ ],
323
+ "page_idx": 2
324
+ },
325
+ {
326
+ "type": "text",
327
+ "text": "The complexity of the full model is: $O ( 3 h T S d d _ { h } )$ $( q k v$ projections) $+ O ( 2 h T ^ { 2 } S ^ { 2 } d _ { h } )$ (MSA for $h$ attention heads) $+ O ( T S ( h d _ { h } ) d )$ (multi-head projection) $+ \\hat { O } ( 4 T S d ^ { 2 } )$ (MLP) 2. From these terms, our goal is to reduce the cost $\\tilde { O ( 2 T ^ { 2 } S ^ { 2 } d _ { h } ) }$ (for a single attention head) of the full space-time attention which is the dominant term 3. For clarity, from now on, we will drop constant terms and $d _ { h }$ to report complexity unless necessary. Hence, the complexity of the full space-time attention is $O ( T ^ { 2 } S ^ { 2 } )$ . ",
328
+ "bbox": [
329
+ 173,
330
+ 689,
331
+ 825,
332
+ 760
333
+ ],
334
+ "page_idx": 2
335
+ },
336
+ {
337
+ "type": "text",
338
+ "text": "Our baseline is a model that performs a simple approximation to the full space-time attention by applying, at each Transformer layer, spatial-only attention: ",
339
+ "bbox": [
340
+ 173,
341
+ 765,
342
+ 823,
343
+ 794
344
+ ],
345
+ "page_idx": 2
346
+ },
347
+ {
348
+ "type": "equation",
349
+ "img_path": "images/98b281c209c58e2154dc0791686b92428cba83f3e207ee83e8862116cadc841e.jpg",
350
+ "text": "$$\n\\mathbf { y } _ { s , t } ^ { l } = \\sum _ { s ^ { \\prime } = 0 } ^ { S - 1 } \\mathrm { S o f t m a x } \\{ ( \\mathbf { q } _ { s , t } ^ { l } \\cdot \\mathbf { k } _ { s ^ { \\prime } , t } ^ { l } ) / \\sqrt { d _ { h } } \\} \\mathbf { v } _ { s ^ { \\prime } , t } ^ { l } , \\ \\left\\{ \\begin{array} { l l } { s = 0 , \\dots , S - 1 } \\\\ { t = 0 , \\dots , T - 1 } \\end{array} \\right\\}\n$$",
351
+ "text_format": "latex",
352
+ "bbox": [
353
+ 294,
354
+ 794,
355
+ 702,
356
+ 838
357
+ ],
358
+ "page_idx": 2
359
+ },
360
+ {
361
+ "type": "text",
362
+ "text": "the complexity of which is ${ \\cal O } ( T S ^ { 2 } )$ . Notably, the complexity of the proposed space-time mixing attention is also ${ \\cal O } ( T S ^ { 2 } )$ . Following spatial-only attention, simple temporal averaging is performed on the class tokens $\\begin{array} { r } { { \\bf z } _ { f i n a l } = \\frac { 1 } { T } \\sum _ { t } { \\bf z } _ { t , c l s } ^ { L - 1 } } \\end{array}$ to obtain a single feature that is fed to the linear classifier. ",
363
+ "bbox": [
364
+ 173,
365
+ 90,
366
+ 826,
367
+ 143
368
+ ],
369
+ "page_idx": 3
370
+ },
371
+ {
372
+ "type": "text",
373
+ "text": "Recent work by [3, 1] has focused on reducing the cost ${ \\cal O } ( T ^ { 2 } S ^ { 2 } )$ of the full space-time attention of Eq. 4. Bertasius et al. [3] proposed the factorised attention: ",
374
+ "bbox": [
375
+ 171,
376
+ 150,
377
+ 825,
378
+ 180
379
+ ],
380
+ "page_idx": 3
381
+ },
382
+ {
383
+ "type": "equation",
384
+ "img_path": "images/d191f1ba83edeee2879ac4269f91a15af236f823a94b4e59b4be8552f1d419ec.jpg",
385
+ "text": "$$\n\\begin{array} { r l r } & { \\tilde { \\mathbf { y } } _ { s , t } ^ { l } = \\displaystyle \\sum _ { t ^ { \\prime } = 0 } ^ { T - 1 } \\mathrm { S o f t m a x } \\{ ( \\mathbf { q } _ { s , t } ^ { l } \\cdot \\mathbf { k } _ { s , t ^ { \\prime } } ^ { l } ) / \\sqrt { d _ { h } } \\} \\mathbf { v } _ { s , t ^ { \\prime } } ^ { l } , } & \\\\ & { \\mathbf { y } _ { s , t } ^ { l } = \\displaystyle \\sum _ { s ^ { \\prime } = 0 } ^ { S - 1 } \\mathrm { S o f t m a x } \\{ \\tilde { \\mathbf { q } } _ { s , t } ^ { l } \\cdot \\tilde { \\mathbf { k } } _ { s ^ { \\prime } , t } ^ { l } ) / \\sqrt { d _ { h } } \\} \\tilde { \\mathbf { v } } _ { s ^ { \\prime } , t } ^ { l } , } & \\end{array} \\quad \\begin{array} { r l } & { \\left\\{ s = 0 , \\dots , S - 1 \\right\\} , } \\\\ & { \\left\\{ t = 0 , \\dots , T - 1 \\right\\} , } \\\\ & \\left\\{ \\begin{array} { r l } & { s = 0 , \\dots , T - 1 \\} \\\\ & { s ^ { \\prime } = 0 } \\end{array} \\right\\} , } \\end{array}\n$$",
386
+ "text_format": "latex",
387
+ "bbox": [
388
+ 261,
389
+ 185,
390
+ 735,
391
+ 275
392
+ ],
393
+ "page_idx": 3
394
+ },
395
+ {
396
+ "type": "text",
397
+ "text": "where $\\tilde { \\mathbf { q } } _ { s , t } ^ { l } , \\tilde { \\mathbf { k } } _ { s ^ { \\prime } , t } ^ { l } \\tilde { \\mathbf { v } } _ { s ^ { \\prime } , t } ^ { l }$ are new query, key and value vectors calculated from $\\tilde { \\mathbf { y } } _ { s , t } ^ { l }$ 4. The above model reduces complexity to $O ( T ^ { 2 } S + T S ^ { 2 } )$ . However, temporal attention is performed for a fixed spatial location which is ineffective when there is camera or object motion and there is spatial misalignment between frames. ",
398
+ "bbox": [
399
+ 176,
400
+ 280,
401
+ 823,
402
+ 340
403
+ ],
404
+ "page_idx": 3
405
+ },
406
+ {
407
+ "type": "text",
408
+ "text": "The work of [1] is concurrent to ours and proposes the following approximation: $L _ { s }$ Transformer layers perform spatial-only attention as in Eq. 5 (each with complexity $O ( S ^ { 2 } ) _ { \\ l }$ ). Following this, there are $L _ { t }$ Transformer layers performing temporal-only attention on the class tokens $\\mathbf { z } _ { t } ^ { L _ { s } }$ . The complexity of the temporal-only attention is, in general, $\\overset { \\cdot } { O ( T ^ { 2 } ) }$ . ",
409
+ "bbox": [
410
+ 173,
411
+ 347,
412
+ 826,
413
+ 405
414
+ ],
415
+ "page_idx": 3
416
+ },
417
+ {
418
+ "type": "text",
419
+ "text": "Our model aims to better approximate the full space-time self-attention (SA) of Eq. 4 while keeping complexity to ${ \\cal O } ( T S ^ { 2 } )$ , i.e. inducing no further complexity to a spatial-only model. ",
420
+ "bbox": [
421
+ 174,
422
+ 410,
423
+ 823,
424
+ 439
425
+ ],
426
+ "page_idx": 3
427
+ },
428
+ {
429
+ "type": "text",
430
+ "text": "To achieve this, we make a first approximation to perform full space-time attention but restricted to a local temporal window $[ - t _ { w } , t _ { w } ]$ : ",
431
+ "bbox": [
432
+ 176,
433
+ 445,
434
+ 823,
435
+ 474
436
+ ],
437
+ "page_idx": 3
438
+ },
439
+ {
440
+ "type": "equation",
441
+ "img_path": "images/f60bef640e7b85eb3bb003fcee3f39daf92cea0ee9cba96cc996a29b4bcd01f6.jpg",
442
+ "text": "$$\n\\mathbf { y } _ { s , t } ^ { l } = \\sum _ { t ^ { \\prime } = t - t _ { w } } ^ { t + t _ { w } } \\sum _ { s ^ { \\prime } = 0 } ^ { S - 1 } \\mathrm { S o f t m a x } \\{ ( \\mathbf { q } _ { s , t } ^ { l } \\cdot \\mathbf { k } _ { s ^ { \\prime } , t ^ { \\prime } } ^ { l } ) / \\sqrt { d _ { h } } \\} \\mathbf { v } _ { s ^ { \\prime } , t ^ { \\prime } } ^ { l } = \\sum _ { t ^ { \\prime } = t - t _ { w } } ^ { t + t _ { w } } \\mathbf { V } _ { t ^ { \\prime } } ^ { l } \\mathbf { a } _ { t ^ { \\prime } } ^ { l } , \\{ \\mathbf { \\phi } _ { t = 0 , \\dots , T - 1 } ^ { s = 0 , \\dots , S - 1 } \\}\n$$",
443
+ "text_format": "latex",
444
+ "bbox": [
445
+ 194,
446
+ 479,
447
+ 781,
448
+ 525
449
+ ],
450
+ "page_idx": 3
451
+ },
452
+ {
453
+ "type": "text",
454
+ "text": "where ${ \\bf V } _ { t ^ { \\prime } } ^ { l } = [ { \\bf v } _ { 0 , t ^ { \\prime } } ^ { l } ; { \\bf v } _ { 1 , t ^ { \\prime } } ^ { l } ; \\ldots ; { \\bf v } _ { S - 1 , t ^ { \\prime } } ^ { l } ] \\in \\mathbb { R } ^ { d _ { h } \\times S }$ and $\\mathbf { a } _ { t ^ { \\prime } } ^ { l } = [ a _ { 0 , t ^ { \\prime } } ^ { l } , a _ { 1 , t ^ { \\prime } } ^ { l } , \\ldots , a _ { S = 1 , t ^ { \\prime } } ^ { l } ] \\in \\mathbb { R } ^ { S }$ is the vector with the corresponding attention weights. Eq. 7 shows that, for a single Transformer layer, $\\mathbf { y } _ { s , t } ^ { l }$ is a spatio-temporal combination of the visual tokens in the local window $[ - t _ { w } , t _ { w } ]$ . It follows that, after k Transformer layers, yl+ks,t will be a spatio-temporal combination of the visual tokens in the local window $[ - k t _ { w } , k t _ { w } ]$ which in turn conveniently allows to perform spatio-temporal attention over the whole clip. For example, for $t _ { w } = 1$ and $k = 4$ , the local window becomes $[ - 4 , 4 ]$ which spans the whole video clip for the typical case $T = 8$ . ",
455
+ "bbox": [
456
+ 173,
457
+ 530,
458
+ 826,
459
+ 636
460
+ ],
461
+ "page_idx": 3
462
+ },
463
+ {
464
+ "type": "text",
465
+ "text": "The complexity of the local self-attention of Eq. 7 is $O ( T ( 2 t _ { w } + 1 ) ^ { 2 } S ^ { 2 } )$ . To reduce this even further, we make a second approximation on top of the first one as follows: the attention between spatial locations $s$ and $s ^ { \\prime }$ according to the model of Eq. 7 is: ",
466
+ "bbox": [
467
+ 173,
468
+ 640,
469
+ 823,
470
+ 684
471
+ ],
472
+ "page_idx": 3
473
+ },
474
+ {
475
+ "type": "equation",
476
+ "img_path": "images/790e69c49d0fb4cbd9f9feb1bc88225e661f05b29c099d38f428048151017af5.jpg",
477
+ "text": "$$\n\\sum _ { t ^ { \\prime } = t - t _ { w } } ^ { t + t _ { w } } \\mathrm { S o f t m a x } \\{ ( { \\bf q } _ { s , t } ^ { l } \\cdot { \\bf k } _ { s ^ { \\prime } , t ^ { \\prime } } ^ { l } ) / \\sqrt { d _ { h } } \\} { \\bf v } _ { s ^ { \\prime } , t ^ { \\prime } } ^ { l } ,\n$$",
478
+ "text_format": "latex",
479
+ "bbox": [
480
+ 352,
481
+ 689,
482
+ 645,
483
+ 733
484
+ ],
485
+ "page_idx": 3
486
+ },
487
+ {
488
+ "type": "text",
489
+ "text": "i.e. it requires the calculation of $2 t _ { w } + 1$ attentions, one per temporal location over $[ - t _ { w } , t _ { w } ]$ . Instead, we propose to calculate a single attention over $[ - t _ { w } , t _ { w } ]$ which can be achieved by $\\mathbf { q } _ { s , t } ^ { l }$ attending $\\mathbf { k } _ { s ^ { \\prime } , - t _ { w } : t _ { w } } ^ { l } \\triangleq [ \\mathbf { k } _ { s ^ { \\prime } , t - t _ { w } } ^ { l } ; \\hdots ; \\mathbf { k } _ { s ^ { \\prime } , t + t _ { w } } ^ { l } ] \\in \\mathbb { R } ^ { ( 2 t _ { w } + 1 ) d _ { h } }$ . Note that to match the dimensions of $\\mathbf { q } _ { s , t } ^ { l }$ and $\\mathbf { k } _ { s ^ { \\prime } , - t _ { w } : t _ { w } } ^ { l }$ a further projection of $\\mathbf { k } _ { s ^ { \\prime } , - t _ { w } : t _ { w } } ^ { l }$ to $\\mathbb { R } ^ { d _ { h } }$ is normally required which has complexity $O ( ( 2 t _ { w } + 1 ) d _ { h } ^ { 2 } )$ and hence compromises the goal of an efficient implementation. To alleviate this we use the “shift trick” [45, 26] which allows to perform both zero-cost dimensionality reduction, spacetime mixing and attention (between $\\mathbf { q } _ { s , t } ^ { l }$ and $\\mathbf { \\Delta } \\mathbf { \\bar { k } } _ { s ^ { \\prime } , - t _ { w } : t _ { w } } ^ { l } )$ in $O ( d _ { h } )$ . In particular, each $t ^ { \\prime } \\in [ - t _ { w } , t _ { w } ]$ is assigned $d _ { h } ^ { t ^ { \\prime } }$ channels from $d _ { h }$ (i.e. $\\textstyle \\sum _ { t ^ { \\prime } } d _ { h } ^ { t ^ { \\prime } } = d _ { h } )$ ). Let $\\mathbf { k } _ { s ^ { \\prime } , t ^ { \\prime } } ^ { l } ( d _ { h } ^ { t ^ { \\prime } } ) \\in \\mathbb { R } ^ { d _ { h } ^ { t ^ { \\prime } } }$ denote the operator for indexing the $d _ { h } ^ { t ^ { \\prime } }$ channels from $\\mathbf { k } _ { s ^ { \\prime } , t ^ { \\prime } } ^ { l }$ . Then, a new key vector is constructed as: ",
490
+ "bbox": [
491
+ 171,
492
+ 738,
493
+ 826,
494
+ 872
495
+ ],
496
+ "page_idx": 3
497
+ },
498
+ {
499
+ "type": "image",
500
+ "img_path": "images/63cef11d328b8095ee03e385a56bcb5d9159d6945fdd59840585c039b2779efb.jpg",
501
+ "image_caption": [
502
+ "",
503
+ "Figure 2: Detailed self-attention computation graph for (a) full space-time attention and (b) the proposed space-time mixing approximation. Notice that in our case only S tokens participate instead of ST. The temporal information is aggregated by indexing channels from adjacent frames. Tokens of identical colors share the same temporal index. "
504
+ ],
505
+ "image_footnote": [],
506
+ "bbox": [
507
+ 178,
508
+ 87,
509
+ 436,
510
+ 318
511
+ ],
512
+ "page_idx": 4
513
+ },
514
+ {
515
+ "type": "image",
516
+ "img_path": "images/a2c2350bce86ce0a8efabb3aa9599b79f38fcf9a123c46ad3f611af0c40e49ce.jpg",
517
+ "image_caption": [
518
+ "(b) Proposed space-time mixing attention. "
519
+ ],
520
+ "image_footnote": [],
521
+ "bbox": [
522
+ 522,
523
+ 89,
524
+ 776,
525
+ 304
526
+ ],
527
+ "page_idx": 4
528
+ },
529
+ {
530
+ "type": "text",
531
+ "text": "",
532
+ "bbox": [
533
+ 173,
534
+ 393,
535
+ 692,
536
+ 411
537
+ ],
538
+ "page_idx": 4
539
+ },
540
+ {
541
+ "type": "equation",
542
+ "img_path": "images/875960b15b613f75d1a94859ee1b1402fe3169d538d1a1b353f13854d631050b.jpg",
543
+ "text": "$$\n\\begin{array} { r } { \\tilde { \\mathbf { k } } _ { s ^ { \\prime } , - t _ { w } : t _ { w } } ^ { l } \\triangleq [ \\mathbf { k } _ { s ^ { \\prime } , t - t _ { w } } ^ { l } ( d _ { h } ^ { t - t _ { w } } ) , \\hdots , \\mathbf { k } _ { s ^ { \\prime } , t + t _ { w } } ^ { l } ( d _ { h } ^ { t + t _ { w } } ) ] \\in \\mathbb { R } ^ { d _ { h } } . } \\end{array}\n$$",
544
+ "text_format": "latex",
545
+ "bbox": [
546
+ 297,
547
+ 419,
548
+ 699,
549
+ 440
550
+ ],
551
+ "page_idx": 4
552
+ },
553
+ {
554
+ "type": "text",
555
+ "text": "Fig. 2 shows how the key vector $\\tilde { \\mathbf { k } } _ { s ^ { \\prime } , - t w : t _ { w } } ^ { l }$ is constructed. In a similar way, we also construct a new value vector $\\tilde { \\mathbf { v } } _ { s ^ { \\prime } , - t _ { w } : t _ { w } } ^ { l }$ . Finally, the proposed approximation to the full space-time attention is given by: ",
556
+ "bbox": [
557
+ 173,
558
+ 449,
559
+ 825,
560
+ 496
561
+ ],
562
+ "page_idx": 4
563
+ },
564
+ {
565
+ "type": "equation",
566
+ "img_path": "images/62165f8bfbb98268ae50287d7c8d48fc2655d365e40e0c44b4b95d1f27bf9fb3.jpg",
567
+ "text": "$$\n\\mathbf { y } _ { s , t } ^ { l _ { s } } = \\sum _ { s ^ { \\prime } = 0 } ^ { S - 1 } \\mathrm { S o f t m a x } \\{ ( \\mathbf { q } _ { s , t } ^ { l _ { s } } \\cdot \\tilde { \\mathbf { k } } _ { s ^ { \\prime } , - t _ { w } : t _ { w } } ^ { l } / \\sqrt { d _ { h } } \\} \\tilde { \\mathbf { v } } _ { s ^ { \\prime } , - t _ { w } : t _ { w } } ^ { l } , \\ \\left\\{ \\begin{array} { l l } { s = 0 , \\dots , S - 1 } \\\\ { t = 0 , \\dots , T - 1 } \\end{array} \\right\\} .\n$$",
568
+ "text_format": "latex",
569
+ "bbox": [
570
+ 258,
571
+ 493,
572
+ 738,
573
+ 539
574
+ ],
575
+ "page_idx": 4
576
+ },
577
+ {
578
+ "type": "text",
579
+ "text": "This has the complexity of a spatial-only attention $( O ( T S ^ { 2 } ) )$ and hence it is more efficient than previously proposed video transformers [3, 1]. Our model also provides a better approximation to the full space-time attention and as shown by our results it significantly outperforms [3, 1]. ",
580
+ "bbox": [
581
+ 174,
582
+ 542,
583
+ 825,
584
+ 585
585
+ ],
586
+ "page_idx": 4
587
+ },
588
+ {
589
+ "type": "text",
590
+ "text": "Temporal Attention aggregation: The final set of the class tokens $\\mathbf { z } _ { t , c l s } ^ { L - 1 } , 0 \\leq t \\leq L - 1$ are used to generate the predictions. To this end, we propose to consider the following options: (a) simple temporal averaging $\\begin{array} { r } { \\mathbf { z } _ { f i n a l } = \\frac { 1 } { T } \\sum _ { t } \\mathbf { z } _ { t , c l s } ^ { L - 1 } } \\end{array}$ as in the case of our baseline. (b) An obvious limitation of temporal averaging is that the output is treated purely as an ensemble of per-frame features and, hence, completely ignores the temporal ordering between them. To address this, we propose to use a lightweight Temporal Attention (TA) mechanism that will attend to the $T$ classification tokens. In particular a $\\mathbf { z } _ { f i n a l }$ token attends the sequence $[ \\mathbf { z } _ { 0 , c l s } ^ { L - 1 } , \\ldots , \\mathbf { z } _ { T - 1 , c l s } ^ { L - 1 } ]$ using a temporal Transformer layer and then fed as input to the classifier. This is akin to the (concurrent) work of [1] with the difference being that in our model we found that a single TA layer suffices whereas [1] uses $L _ { t }$ . A consequence of this is that the complexity of our layer is $O ( T )$ vs $O ( 2 ( L _ { t } - 1 ) T ^ { 2 } + \\bar { T } )$ of [1]. ",
591
+ "bbox": [
592
+ 173,
593
+ 592,
594
+ 825,
595
+ 739
596
+ ],
597
+ "page_idx": 4
598
+ },
599
+ {
600
+ "type": "text",
601
+ "text": "Summary token: As an alternative to TA, herein, we also propose a simple lightweight mechanism for information exchange between different frames at intermediate layers of the network. Given the set of tokens for each frame $t$ , $\\mathbf { Z } _ { t } ^ { l - 1 } \\in \\mathbb { R } ^ { ( S + 1 ) \\times d _ { h } }$ (constructed by concatenating all tokens $\\mathbf { z } _ { s , t } ^ { l - 1 } , s = 0 , \\ldots , S )$ , we compute a new set of $R$ tokens $\\mathbf { Z } _ { r , t } ^ { l } = \\phi ( \\mathbf { Z } _ { \\underline { { t } } } ^ { l - 1 } ) \\in \\mathbb { R } ^ { R \\times d _ { h } }$ which summarize the frame information and hence are named “Summary” tokens. These are then, appended to the visual tokens of all frames to calculate the keys and values so that the query vectors attend the original keys plus the Summary tokens. Herein, we explore the case that $\\phi ( . )$ performs simple spatial averaging $\\begin{array} { r } { \\mathbf { \\tilde { z } } _ { 0 , t } ^ { l } = \\frac { 1 } { S } \\sum _ { s } \\mathbf { z } _ { s , t } ^ { l } } \\end{array}$ over the tokens of each frame ( $R = 1$ for this case). Note that, for $R = 1$ , the extra cost that the Summary token induces is $O ( T S )$ . ",
602
+ "bbox": [
603
+ 173,
604
+ 744,
605
+ 826,
606
+ 877
607
+ ],
608
+ "page_idx": 4
609
+ },
610
+ {
611
+ "type": "text",
612
+ "text": "X-ViT: We call the Video Transformer based on the proposed (a) space-time mixing attention and (b) lightweight global temporal attention (or summary token) as $\\mathbf { X }$ -ViT. ",
613
+ "bbox": [
614
+ 173,
615
+ 882,
616
+ 821,
617
+ 911
618
+ ],
619
+ "page_idx": 4
620
+ },
621
+ {
622
+ "type": "text",
623
+ "text": "4 Results ",
624
+ "text_level": 1,
625
+ "bbox": [
626
+ 174,
627
+ 89,
628
+ 266,
629
+ 106
630
+ ],
631
+ "page_idx": 5
632
+ },
633
+ {
634
+ "type": "text",
635
+ "text": "4.1 Experimental setup ",
636
+ "text_level": 1,
637
+ "bbox": [
638
+ 176,
639
+ 125,
640
+ 348,
641
+ 140
642
+ ],
643
+ "page_idx": 5
644
+ },
645
+ {
646
+ "type": "text",
647
+ "text": "Datasets: We train and evaluate the proposed models on the following datasets (all datasets are publicly available for research purposes): ",
648
+ "bbox": [
649
+ 173,
650
+ 154,
651
+ 823,
652
+ 183
653
+ ],
654
+ "page_idx": 5
655
+ },
656
+ {
657
+ "type": "text",
658
+ "text": "Kinetics-400 and 600: The Kinetics [21] dataset consists of short clips (typically 10 sec long sampled from YouTube) labeled using 400 and 600 classes, respectively. Due to the removal of some videos from YouTube, the version of the dataset used in this paper consists of approximately 261K clips for Kinetics-400. Note, that these amounts are lower than the original version of the datasets and thus might represent a negative performance bias when compared with prior works. ",
659
+ "bbox": [
660
+ 174,
661
+ 188,
662
+ 825,
663
+ 258
664
+ ],
665
+ "page_idx": 5
666
+ },
667
+ {
668
+ "type": "text",
669
+ "text": "Something-Something- $\\cdot \\nu 2$ $( S S \\nu 2 )$ : The SSv2 [17] dataset consists of 220,487 short videos (of duration between 2 and 6 sec) that depict humans performing pre-defined basic actions with everyday objects. Because the objects and backgrounds in the videos are consistent across different action classes, this dataset tends to require stronger temporal modeling. Due to this, we conducted most of our ablation studies on SSv2 to better analyze the importance of the proposed components. ",
670
+ "bbox": [
671
+ 174,
672
+ 263,
673
+ 825,
674
+ 333
675
+ ],
676
+ "page_idx": 5
677
+ },
678
+ {
679
+ "type": "text",
680
+ "text": "Epic Kitchens-100 (Epic-100): is an egocentric large scale action recognition dataset consisting of more than 90,000 action segments spanning 100 hours of recordings in home environments, capturing daily activities [10]. The dataset is labeled using 97 verb classes and 300 noun classes. The evaluation results are reported using the standard action recognition protocol: the network predicts the “verb” and the “noun” using two heads. The predictions are then merged to construct an “action” which is used to report the accuracy. ",
681
+ "bbox": [
682
+ 173,
683
+ 340,
684
+ 825,
685
+ 422
686
+ ],
687
+ "page_idx": 5
688
+ },
689
+ {
690
+ "type": "text",
691
+ "text": "Training details: All models, unless otherwise stated, were trained using the following scheduler and training procedure: specifically, our models were trained using SGD with momentum (0.9) and a cosine scheduler [28] (with linear warmup) for 35 epochs on SSv2, 50 on Epic-100 and 30 on Kinetics. The base learning rate, set at a batch size of 128, was 0.05 (0.03 for Kinetics). To prevent over-fitting we made use of the following augmentation techniques: random scaling $( 0 . 9 \\times$ to $1 . 3 \\times$ ) and cropping, random flipping (with probability of 0.5; not for SSv2) and autoaugment [8]. In addition, for SSv2 and Epic-100, we also applied random erasing (probability $= 0 . 5$ , min. area $_ { = 0 . 0 2 }$ , max. area $_ { = 1 / 3 }$ , min. aspec $\\scriptstyle \\mathrm { \\ t = 0 . 3 }$ ) [52] and label smoothing $\\lambda = 0 . 3 )$ ) [34] while, for Kinetics, we used mixup [51] $\\langle \\alpha = 0 . 4 \\rangle$ ). ",
692
+ "bbox": [
693
+ 174,
694
+ 430,
695
+ 553,
696
+ 636
697
+ ],
698
+ "page_idx": 5
699
+ },
700
+ {
701
+ "type": "text",
702
+ "text": "Table 1: Effect of local window size. To isolate its effect from that of temporal aggregation, the models were trained using temporal averaging. Note, that $( B o . )$ indicates that only features from the boundaries of the local window were used, ignoring the intermediate ones. ",
703
+ "bbox": [
704
+ 566,
705
+ 433,
706
+ 823,
707
+ 529
708
+ ],
709
+ "page_idx": 5
710
+ },
711
+ {
712
+ "type": "table",
713
+ "img_path": "images/adaafea3103fa55b90d1e9899382fbeac715b4dc9c97cca30107a90ef7c2386d.jpg",
714
+ "table_caption": [],
715
+ "table_footnote": [],
716
+ "table_body": "<table><tr><td>Variant</td><td>Top-1</td><td>Top-5</td></tr><tr><td>tw=0</td><td>45.2</td><td>71.4</td></tr><tr><td>tw=1</td><td>62.5</td><td>87.8</td></tr><tr><td>tw=2</td><td>60.5</td><td>86.4</td></tr><tr><td>tw =2(Bo.)</td><td>60.4</td><td>86.2</td></tr></table>",
717
+ "bbox": [
718
+ 583,
719
+ 531,
720
+ 807,
721
+ 618
722
+ ],
723
+ "page_idx": 5
724
+ },
725
+ {
726
+ "type": "text",
727
+ "text": "The backbone models follow closely the ViT architecture of Dosovitskiy et al. [13]. Most experiments were performed using the ViT-B/16 variant $L = 1 2$ , $h = 1 2$ , $d = 7 6 8$ , $K = 1 6$ ), where $L$ represents the number of transformer layers, $h$ the number of heads, $d$ the embedding dimension and $K$ the patch size. We initialized our models from a pretrained ImageNet-21k [11] ViT model. The spatial positional encoding $\\mathbf { p } _ { s }$ was initialized from the pretrained 2D model and the temporal one, $\\mathbf { p } _ { t }$ , with zeros so that it does not have a great impact on the tokens early on during training. The models were trained on 8 V100 GPUs using PyTorch [30]. ",
728
+ "bbox": [
729
+ 173,
730
+ 642,
731
+ 825,
732
+ 741
733
+ ],
734
+ "page_idx": 5
735
+ },
736
+ {
737
+ "type": "text",
738
+ "text": "Testing details: Unless otherwise stated, we used ViT-B/16 and $T = 8$ frames. We mostly used Temporal Attention (TA) for temporal aggregation. We report accuracy results for $1 \\times 3$ views (1 temporal clip and 3 spatial crops) departing from the common approach of using up to $1 0 \\times 3$ views [26, 16]. The $1 \\times 3$ views setting was also used in Bertasius et al. [3]. To measure the variation between runs, we trained one of the 8–frame models 5 times. The results varied by $\\pm 0 . 4 \\%$ . ",
739
+ "bbox": [
740
+ 174,
741
+ 746,
742
+ 825,
743
+ 815
744
+ ],
745
+ "page_idx": 5
746
+ },
747
+ {
748
+ "type": "text",
749
+ "text": "4.2 Ablation studies ",
750
+ "text_level": 1,
751
+ "bbox": [
752
+ 174,
753
+ 840,
754
+ 325,
755
+ 856
756
+ ],
757
+ "page_idx": 5
758
+ },
759
+ {
760
+ "type": "text",
761
+ "text": "Throughout this section, we study the effect of varying certain design choices and different components of our method. Because SSv2 tends to require a more fine-grained temporal modeling, unless otherwise specified, all results reported, in this section, are on the SSv2. ",
762
+ "bbox": [
763
+ 174,
764
+ 869,
765
+ 825,
766
+ 911
767
+ ],
768
+ "page_idx": 5
769
+ },
770
+ {
771
+ "type": "table",
772
+ "img_path": "images/354f2873ff2f92e755d26f3a6cf5c7b86d43221d59d7a2dd27ce8618090fafc4.jpg",
773
+ "table_caption": [
774
+ "Table 2: Effect of: (a) proposed SA position, (b) temporal aggregation and number of Temporal Attention (TA) layers, (c) space-time mixing qkv vectors and (d) amount of mixed channels on SSv2. ",
775
+ "(a) Effect of applying the proposed SA to certain layers. "
776
+ ],
777
+ "table_footnote": [],
778
+ "table_body": "<table><tr><td>Transform. layers</td><td>Top-1 Top-5</td></tr><tr><td>1st half</td><td>61.7 86.5</td></tr><tr><td>2nd half</td><td>61.6 86.3</td></tr><tr><td>Half (odd. pos)</td><td>61.2 86.4</td></tr><tr><td>All</td><td>62.6 87.8</td></tr></table>",
779
+ "bbox": [
780
+ 209,
781
+ 156,
782
+ 465,
783
+ 243
784
+ ],
785
+ "page_idx": 6
786
+ },
787
+ {
788
+ "type": "table",
789
+ "img_path": "images/d4ec940ba35fcd05be3023487d445d5a51f585991b9c6790dfbffb7328cceb4d.jpg",
790
+ "table_caption": [
791
+ "(c) Effect of space-time mixing. x denotes the input token before $q k v$ projection. Query produces equivalent results with key and thus omitted. ",
792
+ "(d) Effect of amount of mixed channels. \\* uses temp. avg. aggregation. "
793
+ ],
794
+ "table_footnote": [],
795
+ "table_body": "<table><tr><td>X</td><td>key</td><td>value</td><td>Top-1</td><td>Top-5</td></tr><tr><td>x&gt;xxx</td><td>X</td><td>X</td><td>56.6</td><td>83.5</td></tr><tr><td></td><td>X</td><td>X</td><td>63.1</td><td>88.8</td></tr><tr><td></td><td>√</td><td>×</td><td>63.1</td><td>88.8</td></tr><tr><td></td><td></td><td>√</td><td>62.5</td><td>88.6</td></tr><tr><td></td><td>×</td><td>√</td><td>64.4</td><td>89.3</td></tr></table>",
796
+ "bbox": [
797
+ 524,
798
+ 183,
799
+ 820,
800
+ 282
801
+ ],
802
+ "page_idx": 6
803
+ },
804
+ {
805
+ "type": "table",
806
+ "img_path": "images/a2f94a938588fe0c660c0c705a64a9b5b6334e5b7060050505cfe9a995a0eed0.jpg",
807
+ "table_caption": [
808
+ "(b) Effect of number of TA layers. 0 corresponds to temporal averaging. "
809
+ ],
810
+ "table_footnote": [],
811
+ "table_body": "<table><tr><td>#. TA layers</td><td>Top-1</td><td>Top-5</td></tr><tr><td>0 (temp. avg.)</td><td>62.4</td><td>87.8</td></tr><tr><td>1</td><td>64.4</td><td>89.3</td></tr><tr><td>2</td><td>64.5</td><td>89.3</td></tr><tr><td>3</td><td>64.5</td><td>89.3</td></tr></table>",
812
+ "bbox": [
813
+ 220,
814
+ 284,
815
+ 452,
816
+ 369
817
+ ],
818
+ "page_idx": 6
819
+ },
820
+ {
821
+ "type": "table",
822
+ "img_path": "images/4869abaff98252b3ae49b8aff92bd62847789e8f1e89c09661f7196f8b0c3274.jpg",
823
+ "table_caption": [],
824
+ "table_footnote": [],
825
+ "table_body": "<table><tr><td>0%*</td><td>0%</td><td>25%</td><td>50%</td><td>100%</td></tr><tr><td>45.2</td><td>56.6</td><td>64.3</td><td>64.4</td><td>62.5</td></tr></table>",
826
+ "bbox": [
827
+ 526,
828
+ 323,
829
+ 820,
830
+ 367
831
+ ],
832
+ "page_idx": 6
833
+ },
834
+ {
835
+ "type": "text",
836
+ "text": "Effect of local window size: Table 1 shows the accuracy of our model by varying the local window size $[ - t _ { w } , t _ { w } ]$ used in the proposed space-time mixing attention. Firstly, we observe that the proposed model is significantly superior to our baseline ${ { t } _ { w } } = 0$ ) which uses spatial-only attention. Secondly, a window of $t _ { w } = 1$ produces the best results. This shows that more gradual increase of the effective window size that is attended is more beneficial compared to more aggressive ones, i.e. the case where $t _ { w } = 2$ . A performance degradation for the case $t _ { w } = 2$ could be attributed to boundary effects (handled by filling with zeros) which are aggravated as $t _ { w }$ increases. Based on these results, we chose to use $t _ { w } = 1$ for the models reported hereafter. For short to medium long videos, it seems that $t _ { w } = 1$ suffices as the temporal receptive field size increases as we advance in depth in the model allowing it to capture a larger effective temporal window. For the datasets used, as explained earlier, after a few transformer layers the whole clip is effectively covered. However, for significantly longer video sequences, larger window sizes may perform better. ",
837
+ "bbox": [
838
+ 173,
839
+ 391,
840
+ 826,
841
+ 558
842
+ ],
843
+ "page_idx": 6
844
+ },
845
+ {
846
+ "type": "text",
847
+ "text": "Effect of SA position: We explored which layers should the proposed space-time mixing attention be applied to within the network. Specifically, we explored the following variants: Applying it to the first $L / 2$ layers, to the last $L / 2$ layers, to every odd indexed layer and, finally, to all layers. As the results from Table 2a show, the exact layers within the network that self-attention is applied to do not matter; what matters is the number of layers it is applied to. We attribute this result to the increased temporal receptive field and cross-frame interactions. ",
848
+ "bbox": [
849
+ 173,
850
+ 564,
851
+ 825,
852
+ 647
853
+ ],
854
+ "page_idx": 6
855
+ },
856
+ {
857
+ "type": "text",
858
+ "text": "Effect of temporal aggregation: Herein, we compare the two methods used for temporal aggregation: simple temporal averaging [41] and the proposed Temporal Attention (TA) mechanism. Given that our model already incorporates temporal information through the proposed space-time attention, we also explored how many TA layers are needed. As shown in Table 2b, replacing temporal averaging with one TA layer improves the Top-1 accuracy from $6 2 . 5 \\%$ to $6 4 . 4 \\%$ . Increasing the number of layers further yields no additional benefits. In Table 2d, we also report the accuracy of spatial-only attention $0 \\%$ mixing) plus TA aggregation. In the absence of the proposed space-time mixing attention, the TA layer alone is unable to compensate, scoring only $5 6 . 6 \\%$ . In the same table, $4 5 . 2 \\%$ is the accuracy of a model trained without the proposed local attention and TA layer (i.e. using a temporal pooling for aggregation). Overall, the results highlight the need of having both components in our final model. For the next two ablation studies, we used 1 TA layer. ",
859
+ "bbox": [
860
+ 174,
861
+ 654,
862
+ 578,
863
+ 806
864
+ ],
865
+ "page_idx": 6
866
+ },
867
+ {
868
+ "type": "table",
869
+ "img_path": "images/19d2585b18a110a26fb313e84e283b962eeeaa43a9a39462a29a5e361c2d7600.jpg",
870
+ "table_caption": [
871
+ "Table 3: Effect of number of tokens on SSv2. "
872
+ ],
873
+ "table_footnote": [],
874
+ "table_body": "<table><tr><td>Variant</td><td>Top-1</td><td>Top-5</td></tr><tr><td>XViT-T/16</td><td>54.7</td><td>82.8</td></tr><tr><td>XViT-S/32</td><td>57.0</td><td>84.6</td></tr><tr><td>XViT-S/16</td><td>61.1</td><td>88.0</td></tr><tr><td>XViT-B/32</td><td>60.5</td><td>87.4</td></tr><tr><td>XViT-L/32</td><td>61.8</td><td>88.3</td></tr><tr><td>XViT-B/16</td><td>64.4</td><td>89.3</td></tr></table>",
875
+ "bbox": [
876
+ 599,
877
+ 686,
878
+ 813,
879
+ 801
880
+ ],
881
+ "page_idx": 6
882
+ },
883
+ {
884
+ "type": "text",
885
+ "text": "",
886
+ "bbox": [
887
+ 174,
888
+ 806,
889
+ 826,
890
+ 861
891
+ ],
892
+ "page_idx": 6
893
+ },
894
+ {
895
+ "type": "text",
896
+ "text": "Effect of space-time mixing qkv vectors: Paramount to our work is the proposed space-time mixing attention of Eq. 10 which is implemented by constructing $\\tilde { \\mathbf { k } } _ { s ^ { \\prime } , - t _ { w } : t _ { w } } ^ { l }$ w and v˜ ls0,−tw :tw efficiently via channel indexing (see Eq. 9). Space-time mixing though can be applied in several different ways in the model. For completeness, herein, we study the effect of applying space-time mixing to various combinations for the key, value and to the input token prior to qkv projection. As shown in Table 2c, the combination corresponding to our model (i.e. space-time mixing applied to the key and value) significantly outperforms all other variants by up to $2 \\%$ . This result is important as it confirms that our model, derived from the proposed approximation to the local space-time attention, gives the best results when compared to other non-well motivated variants. ",
897
+ "bbox": [
898
+ 174,
899
+ 867,
900
+ 825,
901
+ 911
902
+ ],
903
+ "page_idx": 6
904
+ },
905
+ {
906
+ "type": "table",
907
+ "img_path": "images/76310ea23ff9f8dea3bc92cb08f09cb0d6e95e02e5b28fb32a2d465f1fc38d91.jpg",
908
+ "table_caption": [
909
+ "Table 4: Comparison between TA and Summary token on SSv2 (left) and Kinetics-400 (right). "
910
+ ],
911
+ "table_footnote": [],
912
+ "table_body": "<table><tr><td>Summary</td><td>TA</td><td>Top-1</td><td>Top-5</td></tr><tr><td>X</td><td>X</td><td>62.4</td><td>87.8</td></tr><tr><td>√</td><td>×</td><td>63.7</td><td>88.9</td></tr><tr><td>√</td><td></td><td>63.4</td><td>88.9</td></tr><tr><td>X</td><td>交</td><td>64.4</td><td>89.3</td></tr></table>",
913
+ "bbox": [
914
+ 205,
915
+ 114,
916
+ 449,
917
+ 200
918
+ ],
919
+ "page_idx": 7
920
+ },
921
+ {
922
+ "type": "table",
923
+ "img_path": "images/055d11a623a07424fd5d50c655a5845f8d981aa998b876342cc03e0feabfb783.jpg",
924
+ "table_caption": [],
925
+ "table_footnote": [],
926
+ "table_body": "<table><tr><td> Summary</td><td>TA</td><td>Top-1</td><td>Top-5</td></tr><tr><td>X</td><td>×</td><td>77.8</td><td>93.7</td></tr><tr><td>√</td><td>x&gt;&gt;</td><td>78.7</td><td>93.7</td></tr><tr><td>√</td><td></td><td>78.0</td><td>93.2</td></tr><tr><td>X</td><td></td><td>78.5</td><td>93.7</td></tr></table>",
927
+ "bbox": [
928
+ 544,
929
+ 114,
930
+ 787,
931
+ 200
932
+ ],
933
+ "page_idx": 7
934
+ },
935
+ {
936
+ "type": "table",
937
+ "img_path": "images/e7e83abeaf5fdae43bfafe03c00eca712a3b0f59716281da3e0863b972731d7b.jpg",
938
+ "table_caption": [
939
+ "Table 5: Comparison with state-of-the-art on the Kinetics-400. "
940
+ ],
941
+ "table_footnote": [],
942
+ "table_body": "<table><tr><td>Method</td><td>Top-1</td><td>Top-5</td><td>#Frames</td><td>Views</td><td>Params</td><td>FLOPs (×109)</td></tr><tr><td>bLVNet [14]</td><td>73.5</td><td>91.2</td><td>24×2</td><td>3×3</td><td>25M</td><td>840</td></tr><tr><td>STM[19]</td><td>73.7</td><td>91.6</td><td>16</td><td>1</td><td>24M</td><td>1</td></tr><tr><td>TEA [25]</td><td>76.1</td><td>92.5</td><td>16</td><td>10×3</td><td>25.6M</td><td>2,100</td></tr><tr><td>TSM R50 [26]</td><td>74.7</td><td>=</td><td>16</td><td>10×3</td><td>25.6M</td><td>650</td></tr><tr><td>I3D NL [44]</td><td>77.7</td><td>93.3</td><td>128</td><td>10×3</td><td>1</td><td>10,800</td></tr><tr><td>CorrNet-101 [40]</td><td>79.2</td><td>-</td><td>32</td><td>10×3</td><td>=</td><td>6,700</td></tr><tr><td>ip-CSN-152[38]</td><td>79.2</td><td>93.8</td><td>8</td><td>10×3</td><td></td><td>3,270</td></tr><tr><td>LGD-3D R101 [31]</td><td>79.4</td><td>94.4</td><td>16</td><td>1</td><td>=</td><td>1</td></tr><tr><td>SlowFast 8×8 R101+NL [16]</td><td>78.7</td><td>93.5</td><td>8</td><td>10×3</td><td></td><td>3,480</td></tr><tr><td>SlowFast 16×8 R101+NL [16]</td><td>79.8</td><td>93.9</td><td>16</td><td>10×3</td><td>=</td><td>7,020</td></tr><tr><td>X3D-XXL [15]</td><td>80.4</td><td>94.6</td><td>1</td><td>10×3</td><td>20.3M</td><td>5,823</td></tr><tr><td>TimeSformer-L [3]</td><td>80.7</td><td>94.7</td><td>96</td><td>1×3</td><td>121M</td><td>7,140</td></tr><tr><td>ViViT-L/16x2[1]</td><td>80.6</td><td>94.7</td><td>32</td><td>4×3</td><td>312M</td><td>17,352</td></tr><tr><td>X-ViT (Ours)</td><td>78.5</td><td>93.7</td><td>8</td><td>1×3</td><td>92M</td><td>425</td></tr><tr><td>X-ViT (Ours)</td><td>79.4</td><td>93.9</td><td>8</td><td>2×3</td><td>92M</td><td>850</td></tr><tr><td>X-ViT (Ours)</td><td>80.2</td><td>94.7</td><td>16</td><td>1×3</td><td>92M</td><td>850</td></tr><tr><td>X-ViT (Ours)</td><td>80.7</td><td>94.7</td><td>16</td><td>2×3</td><td>92M</td><td>1700</td></tr></table>",
943
+ "bbox": [
944
+ 174,
945
+ 233,
946
+ 843,
947
+ 505
948
+ ],
949
+ "page_idx": 7
950
+ },
951
+ {
952
+ "type": "text",
953
+ "text": "",
954
+ "bbox": [
955
+ 173,
956
+ 537,
957
+ 826,
958
+ 622
959
+ ],
960
+ "page_idx": 7
961
+ },
962
+ {
963
+ "type": "text",
964
+ "text": "Effect of amount of space-time mixing: We definefrom the adjacent frames in the local temporal window $\\rho d _ { h }$ ming when $\\begin{array} { r } { - t _ { w } , t _ { w } ] \\left( i . e . \\sum _ { t ^ { \\prime } = - t _ { w } , t \\neq 0 } ^ { t _ { w } } d _ { h } ^ { t ^ { \\prime } } = \\rho d _ { h } \\right) } \\end{array}$ constructing $\\tilde { \\mathbf { k } } _ { s ^ { \\prime } , - t _ { w } : t _ { w } } ^ { l }$ (see Section 3). Herein, we study the effect of $\\rho$ on the model’s accuracy. As the results from Table 2d show, the optimal $\\rho$ is between $2 5 \\%$ and $50 \\%$ . Increasing $\\rho$ to $100 \\%$ (i.e. all channels are coming from adjacent frames) unsurprisingly degrades the performance as it excludes the case $t ^ { \\prime } = t$ when performing the self-attention. ",
965
+ "bbox": [
966
+ 174,
967
+ 627,
968
+ 825,
969
+ 718
970
+ ],
971
+ "page_idx": 7
972
+ },
973
+ {
974
+ "type": "text",
975
+ "text": "Effect of Summary token: Herein, we compare Temporal Attention with Summary token on SSv2 and Kinetics-400. We used both datasets for this case as they require different type of understanding: fine-grained temporal (SSv2) and spatial content (Kinetics-400). From Table 4, we conclude that the Summary token compares favorable on Kinetics-400 but not on SSv2 showing that it is more useful in terms of capturing spatial information. Since the improvement is small, we conclude that 1 TA layer is the best global attention-based mechanism for improving the accuracy of our method adding also negligible computational cost. ",
976
+ "bbox": [
977
+ 173,
978
+ 724,
979
+ 825,
980
+ 821
981
+ ],
982
+ "page_idx": 7
983
+ },
984
+ {
985
+ "type": "text",
986
+ "text": "Effect of number of input frames: Herein we evaluate the impact of increasing the number of input frames $T$ from 8 to 16 and 32. We note that, for our method, this change results in a linear increase in complexity. As the results from Table 7 show, increasing the number of frames from 8 to 16 offers a $1 . 8 \\%$ boost in Top-1 accuracy on SSv2. Moreover, increasing the number of frames to 32 improves the performance by a further $0 . 2 \\%$ , offering diminishing returns. Similar behavior can be observed on Kinetics and Epic-100 in Tables 5 and 8. ",
987
+ "bbox": [
988
+ 174,
989
+ 828,
990
+ 825,
991
+ 911
992
+ ],
993
+ "page_idx": 7
994
+ },
995
+ {
996
+ "type": "table",
997
+ "img_path": "images/fae9dd4ec48dbdb78541887a753acbaa2b22ee65859600f85dbe2558b602cb0e.jpg",
998
+ "table_caption": [
999
+ "Table 6: Comparison with state-of-the-art on the Kinetics-600 dataset. $T \\times$ is the number of frames used by our method. "
1000
+ ],
1001
+ "table_footnote": [],
1002
+ "table_body": "<table><tr><td>Method</td><td>Top-1</td><td>Top-5</td><td>Views</td><td>FLOPs (×109)</td></tr><tr><td>AttentionNAS [43]</td><td>79.8</td><td>94.4</td><td>=</td><td>1,034</td></tr><tr><td>LGD-3D R101 [31]</td><td>81.5</td><td>95.6</td><td>10×3</td><td>1</td></tr><tr><td>SlowFast R101+NL [16]</td><td>81.8</td><td>95.1</td><td>10×3</td><td>3,480</td></tr><tr><td>X3D-XL [15]</td><td>81.9</td><td>95.5</td><td>10×3</td><td>1,452</td></tr><tr><td>TimeSformer-HR [3]</td><td>82.4</td><td>96.0</td><td>1×3</td><td>5,110</td></tr><tr><td>ViViT-L/16x2[1]</td><td>82.5</td><td>95.6</td><td>4×3</td><td>17,352</td></tr><tr><td>X-ViT (8x) (Ours)</td><td>82.5</td><td>95.4</td><td>1×3</td><td>425</td></tr><tr><td>X-ViT (16×) (Ours)</td><td>84.5</td><td>96.3</td><td>1×3</td><td>850</td></tr></table>",
1003
+ "bbox": [
1004
+ 256,
1005
+ 128,
1006
+ 740,
1007
+ 276
1008
+ ],
1009
+ "page_idx": 8
1010
+ },
1011
+ {
1012
+ "type": "text",
1013
+ "text": "Effect of number of tokens and different model sizes: Herein, we vary the number of input tokens by changing the patch size $K$ . As the results from Table 3 show, even when the number of tokens decreases significantly (e.g. ViT-B/32 or ViT-S/32) our approach is still able to produce results of satisfactory accuracy. The benefit of that is having a model which is significantly more efficient. Similar concusions can be observed when the model size (in terms of parameters and FLOPs) is varied. Our approach provides consistent results in all cases, showcasing its ability to scale well from tiny (XViT-T) to large (XViT-L) models. ",
1014
+ "bbox": [
1015
+ 173,
1016
+ 306,
1017
+ 825,
1018
+ 404
1019
+ ],
1020
+ "page_idx": 8
1021
+ },
1022
+ {
1023
+ "type": "text",
1024
+ "text": "Latency and throughput considerations: While the channel shifting operation used by the proposed space-time mixing attention is zero-FLOP, there is still a small cost associated with memory movement operations. In order to ascertain that the induced cost does not introduce noticeable performance degradation, we benchmarked a Vit-B/16 ( $8 \\times$ frames) model using spatial-only attention and the proposed space-time mixing attention on 8 V100 GPUs and a batch size of 128. A model with spatial-only attention has a throughput of 312 fps while our model has 304 fps. ",
1025
+ "bbox": [
1026
+ 174,
1027
+ 410,
1028
+ 825,
1029
+ 493
1030
+ ],
1031
+ "page_idx": 8
1032
+ },
1033
+ {
1034
+ "type": "table",
1035
+ "img_path": "images/c33549730eaff8b9939260363a77f808914d07b535c923e8170f92e878fb9c60.jpg",
1036
+ "table_caption": [
1037
+ "Table 7: Comparison with state-of-the-art on SSv2. \\* - pretrained on Kinetics 600 "
1038
+ ],
1039
+ "table_footnote": [],
1040
+ "table_body": "<table><tr><td>Method</td><td>Top-1</td><td>Top-5</td><td>#Frames</td><td>Views</td><td>FLOPs (×109)</td></tr><tr><td>TRN [53]</td><td>48.8</td><td>77.6</td><td>8</td><td></td><td></td></tr><tr><td>SlowFast+multigrid [46]</td><td>61.7</td><td>1</td><td>1</td><td>1×3</td><td></td></tr><tr><td>TimeSformer-L [3]</td><td>62.4</td><td>1</td><td>96</td><td>1×3</td><td>7,140</td></tr><tr><td>TSMR50 [26]</td><td>63.3</td><td>88.5</td><td>16</td><td>2×3</td><td>-</td></tr><tr><td>STM[19]</td><td>64.2</td><td>89.8</td><td>16</td><td>-</td><td>-</td></tr><tr><td>MSNet [24]</td><td>64.7</td><td>89.4</td><td>16</td><td>=</td><td>-</td></tr><tr><td>TEA [25]</td><td>65.1</td><td>89.9</td><td>16</td><td></td><td></td></tr><tr><td>ViViT-L/16x2 [3]</td><td>65.4</td><td>89.8</td><td>32</td><td>4×3</td><td>11,892</td></tr><tr><td>X-ViT (Ours)</td><td>64.4</td><td>89.3</td><td>8</td><td>1×3</td><td>425</td></tr><tr><td>X-ViT (Ours)</td><td>66.2</td><td>90.6</td><td>16</td><td>1×3</td><td>850</td></tr><tr><td>X-ViT* (Ours)</td><td>67.2</td><td>90.8</td><td>16</td><td>1×3</td><td>850</td></tr><tr><td>X-ViT (Ours)</td><td>66.4</td><td>90.7</td><td>32</td><td>1×3</td><td>1,270</td></tr></table>",
1041
+ "bbox": [
1042
+ 220,
1043
+ 536,
1044
+ 777,
1045
+ 739
1046
+ ],
1047
+ "page_idx": 8
1048
+ },
1049
+ {
1050
+ "type": "text",
1051
+ "text": "4.3 Comparison to state-of-the-art ",
1052
+ "text_level": 1,
1053
+ "bbox": [
1054
+ 174,
1055
+ 772,
1056
+ 426,
1057
+ 787
1058
+ ],
1059
+ "page_idx": 8
1060
+ },
1061
+ {
1062
+ "type": "text",
1063
+ "text": "Our best model uses the proposed space-time mixing attention in all the Transformer layers and performs temporal aggregation using a single lightweight temporal transformer layer as described in Section 3. Unless otherwise specified, we report the results using the $1 \\times 3$ configuration for the views (1 temporal and 3 spatial) for all datasets. Regarding related work on transformer-based video recognition [1, 3], we included their very best models trained on the same data as our models. For TimeSformer, this is typically the TimeSformer-L version. For ViVit, we used the 16x2 configuration, with factorized-encoding for Epic-100 and SS-v2 (as reported in Tables 6d and 6e in [1]) and the full version for Kinetics (as reported in Table 6a in [1]). ",
1064
+ "bbox": [
1065
+ 173,
1066
+ 800,
1067
+ 826,
1068
+ 912
1069
+ ],
1070
+ "page_idx": 8
1071
+ },
1072
+ {
1073
+ "type": "text",
1074
+ "text": "On Kinetics-400, we match the current state-of-the-art while having significantly lower computational complexity than the next two best recently proposed methods that also use Transformer-based architectures: $2 0 \\times$ fewer FLOPs than ViVit [1] and $8 \\times$ fewer than TimeSformer-L [3]. Note that both models from [1, 3] and ours were initialized from a ViT model pretrained on ImageNet-21k [11] and take as input frames at a resolution of $2 2 4 \\times 2 2 4 \\mathrm { p x }$ . Similar conclusions can be drawn from Table 6 which reports our results on Kinetics-600. ",
1075
+ "bbox": [
1076
+ 174,
1077
+ 92,
1078
+ 825,
1079
+ 174
1080
+ ],
1081
+ "page_idx": 9
1082
+ },
1083
+ {
1084
+ "type": "text",
1085
+ "text": "On SSv2, we match and surpass the current state-of-the-art, especially in terms of Top-5 accuracy (ours: $9 0 . 7 \\%$ vs ViViT: $8 9 . 8 \\%$ [1]) using models that are $1 4 \\times$ (16 frames) and $9 \\times$ (32 frames) faster. ",
1086
+ "bbox": [
1087
+ 173,
1088
+ 181,
1089
+ 823,
1090
+ 209
1091
+ ],
1092
+ "page_idx": 9
1093
+ },
1094
+ {
1095
+ "type": "text",
1096
+ "text": "Finally, we observe similar outcomes on Epic-100 where we set a new state-of-the-art, showing large improvements especially for “Verb” accuracy, while again being more efficient. ",
1097
+ "bbox": [
1098
+ 171,
1099
+ 215,
1100
+ 821,
1101
+ 243
1102
+ ],
1103
+ "page_idx": 9
1104
+ },
1105
+ {
1106
+ "type": "text",
1107
+ "text": "5 Ethical considerations and broader impact ",
1108
+ "text_level": 1,
1109
+ "bbox": [
1110
+ 173,
1111
+ 262,
1112
+ 562,
1113
+ 280
1114
+ ],
1115
+ "page_idx": 9
1116
+ },
1117
+ {
1118
+ "type": "text",
1119
+ "text": "Current high-performing video recognition models tend to have high computational demands for both training and testing and, by extension, significant environmental costs. This is especially true for the transformer-based architectures. Our research introduces a novel approach that matches and surpasses the current state-ofthe-art while being significantly more efficient thanks to the linear scaling of the complexity with respect to the number of frames. We hope such models will offer noticeable reduction in power consumption while setting at the same time a solid base for future research. We will release code and models to facilitate this. Moreover, and similarly to most data-driven systems, ",
1120
+ "bbox": [
1121
+ 174,
1122
+ 294,
1123
+ 485,
1124
+ 500
1125
+ ],
1126
+ "page_idx": 9
1127
+ },
1128
+ {
1129
+ "type": "table",
1130
+ "img_path": "images/c7b1717fc0602e1dc8a0070123efdf7d5b080072338ab380d1082ae584969de7.jpg",
1131
+ "table_caption": [
1132
+ "Table 8: Comparison with state-of-the-art on Epic100. $T \\times$ is the #frames used by our method. Results for other methods are taken from [1]. "
1133
+ ],
1134
+ "table_footnote": [
1135
+ "bias from the training data can potentially affect the fairness of the model. As such, we suggest to take this aspect into consideration when deploying the models into real-world scenarios. "
1136
+ ],
1137
+ "table_body": "<table><tr><td>Method</td><td>Action</td><td>Verb</td><td>Noun</td></tr><tr><td>TSN [41] TRN [53]</td><td>33.2 35.3</td><td>60.2 65.9</td><td>46.0 45.4</td></tr><tr><td>TBN [22] TSM[22] SlowFast [16]</td><td>36.7 38.3 38.5</td><td>66.0 67.9 65.6</td><td>47.2 49.0 50.0</td></tr><tr><td>ViViT-L/16x2[1] X-ViT (8×) (Ours) X-ViT(16×) (Ours)</td><td>44.0 41.5</td><td>66.4 66.7</td><td>56.8 53.3</td></tr></table>",
1138
+ "bbox": [
1139
+ 498,
1140
+ 338,
1141
+ 823,
1142
+ 484
1143
+ ],
1144
+ "page_idx": 9
1145
+ },
1146
+ {
1147
+ "type": "text",
1148
+ "text": "6 Conclusions ",
1149
+ "text_level": 1,
1150
+ "bbox": [
1151
+ 174,
1152
+ 547,
1153
+ 305,
1154
+ 565
1155
+ ],
1156
+ "page_idx": 9
1157
+ },
1158
+ {
1159
+ "type": "text",
1160
+ "text": "We presented a novel approximation to the full space-time attention that is amenable to an efficient implementation and applied it to video recognition. Our approximation has the same computational cost as spatial-only attention yet the resulting video Transformer model was shown to be significantly more efficient than recently proposed Video Transformers [3, 1]. By no means this paper proposes a complete solution to video recognition using video Transformers. Future efforts could include combining our approaches with other architectures than the standard ViT, removing the dependency on pre-trained models and applying the model to other video-related tasks like detection and segmentation. Finally, further research is required for deploying our models on low power/resource devices. ",
1161
+ "bbox": [
1162
+ 174,
1163
+ 579,
1164
+ 825,
1165
+ 704
1166
+ ],
1167
+ "page_idx": 9
1168
+ },
1169
+ {
1170
+ "type": "text",
1171
+ "text": "References \n[1] Anurag Arnab, Mostafa Dehghani, Georg Heigold, Chen Sun, Mario Luciˇ c, and Cordelia Schmid. Vivit: A ´ video vision transformer. arXiv preprint arXiv:2103.15691, 2021. \n[2] Iz Beltagy, Matthew E Peters, and Arman Cohan. Longformer: The long-document transformer. arXiv preprint arXiv:2004.05150, 2020. \n[3] Gedas Bertasius, Heng Wang, and Lorenzo Torresani. Is space-time attention all you need for video understanding? arXiv preprint arXiv:2102.05095, 2021. \n[4] Joao Carreira and Andrew Zisserman. Quo vadis, action recognition? a new model and the kinetics dataset. In proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6299–6308, 2017. \n[5] Mia Xu Chen, Orhan Firat, Ankur Bapna, Melvin Johnson, Wolfgang Macherey, George Foster, Llion Jones, Niki Parmar, Mike Schuster, Zhifeng Chen, et al. The best of both worlds: Combining recent advances in neural machine translation. arXiv preprint arXiv:1804.09849, 2018. \n[6] Yunpeng Chen, Yannis Kalantidis, Jianshu Li, Shuicheng Yan, and Jiashi Feng. A2-nets: Double attention networks. arXiv preprint arXiv:1810.11579, 2018. \n[7] Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers. arXiv preprint arXiv:1904.10509, 2019. \n[8] Ekin D Cubuk, Barret Zoph, Dandelion Mane, Vijay Vasudevan, and Quoc V Le. Autoaugment: Learning augmentation policies from data. arXiv preprint arXiv:1805.09501, 2018. \n[9] Dima Damen, Hazel Doughty, Giovanni Maria Farinella, Sanja Fidler, Antonino Furnari, Evangelos Kazakos, Davide Moltisanti, Jonathan Munro, Toby Perrett, Will Price, et al. Scaling egocentric vision: The epic-kitchens dataset. In ECCV, 2018. \n[10] Dima Damen, Hazel Doughty, Giovanni Maria Farinella, Antonino Furnari, Evangelos Kazakos, Jian Ma, Davide Moltisanti, Jonathan Munro, Toby Perrett, Will Price, et al. Rescaling egocentric vision. arXiv preprint arXiv:2006.13256, 2020. \n[11] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pages 248–255. Ieee, 2009. \n[12] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018. \n[13] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020. \n[14] Quanfu Fan, Chun-Fu Chen, Hilde Kuehne, Marco Pistoia, and David Cox. More is less: Learning efficient video representations by big-little network and depthwise temporal aggregation. arXiv preprint arXiv:1912.00869, 2019. \n[15] Christoph Feichtenhofer. X3d: Expanding architectures for efficient video recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 203–213, 2020. \n[16] Christoph Feichtenhofer, Haoqi Fan, Jitendra Malik, and Kaiming He. Slowfast networks for video recognition. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 6202–6211, 2019. \n[17] Raghav Goyal, Samira Ebrahimi Kahou, Vincent Michalski, Joanna Materzynska, Susanne Westphal, Heuna Kim, Valentin Haenel, Ingo Fruend, Peter Yianilos, Moritz Mueller-Freitag, et al. The\" something something\" video database for learning and evaluating visual common sense. In Proceedings of the IEEE International Conference on Computer Vision, pages 5842–5850, 2017. \n[18] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016. \n[19] Boyuan Jiang, MengMeng Wang, Weihao Gan, Wei Wu, and Junjie Yan. Stm: Spatiotemporal and motion encoding for action recognition. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 2000–2009, 2019. \n[20] Andrej Karpathy, George Toderici, Sanketh Shetty, Thomas Leung, Rahul Sukthankar, and Li Fei-Fei. Large-scale video classification with convolutional neural networks. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, pages 1725–1732, 2014. \n[21] Will Kay, Joao Carreira, Karen Simonyan, Brian Zhang, Chloe Hillier, Sudheendra Vijayanarasimhan, Fabio Viola, Tim Green, Trevor Back, Paul Natsev, et al. The kinetics human action video dataset. arXiv preprint arXiv:1705.06950, 2017. \n[22] Evangelos Kazakos, Arsha Nagrani, Andrew Zisserman, and Dima Damen. Epic-fusion: Audio-visual temporal binding for egocentric action recognition. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 5492–5501, 2019. \n[23] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. Advances in neural information processing systems, 25:1097–1105, 2012. \n[24] Heeseung Kwon, Manjin Kim, Suha Kwak, and Minsu Cho. Motionsqueeze: Neural motion feature learning for video understanding. In European Conference on Computer Vision, pages 345–362. Springer, 2020. \n[25] Yan Li, Bin Ji, Xintian Shi, Jianguo Zhang, Bin Kang, and Limin Wang. Tea: Temporal excitation and aggregation for action recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 909–918, 2020. \n[26] Ji Lin, Chuang Gan, and Song Han. Tsm: Temporal shift module for efficient video understanding. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 7083–7093, 2019. \n[27] Zhaoyang Liu, Limin Wang, Wayne Wu, Chen Qian, and Tong Lu. Tam: Temporal adaptive module for video recognition. arXiv preprint arXiv:2005.06803, 2020. \n[28] Ilya Loshchilov and Frank Hutter. Sgdr: Stochastic gradient descent with warm restarts. arXiv preprint arXiv:1608.03983, 2016. \n[29] Niki Parmar, Ashish Vaswani, Jakob Uszkoreit, Lukasz Kaiser, Noam Shazeer, Alexander Ku, and Dustin Tran. Image transformer. In International Conference on Machine Learning, pages 4055–4064. PMLR, 2018. \n[30] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperative style, high-performance deep learning library. arXiv preprint arXiv:1912.01703, 2019. \n[31] Zhaofan Qiu, Ting Yao, Chong-Wah Ngo, Xinmei Tian, and Tao Mei. Learning spatio-temporal representation with local and global diffusion. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 12056–12065, 2019. \n[32] Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. arXiv preprint arXiv:1910.10683, 2019. \n[33] Aravind Srinivas, Tsung-Yi Lin, Niki Parmar, Jonathon Shlens, Pieter Abbeel, and Ashish Vaswani. Bottleneck transformers for visual recognition. arXiv preprint arXiv:2101.11605, 2021. \n[34] Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2818–2826, 2016. \n[35] Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé Jégou. Training data-efficient image transformers & distillation through attention. arXiv preprint arXiv:2012.12877, 2020. \n[36] Du Tran, Lubomir Bourdev, Rob Fergus, Lorenzo Torresani, and Manohar Paluri. Learning spatiotemporal features with 3d convolutional networks. In Proceedings of the IEEE international conference on computer vision, pages 4489–4497, 2015. \n[37] Du Tran, Heng Wang, Lorenzo Torresani, Jamie Ray, Yann LeCun, and Manohar Paluri. A closer look at spatiotemporal convolutions for action recognition. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, pages 6450–6459, 2018. \n[38] Du Tran, Heng Wang, Lorenzo Torresani, and Matt Feiszli. Video classification with channel-separated convolutional networks. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 5552–5561, 2019. \n[39] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. arXiv preprint arXiv:1706.03762, 2017. \n[40] Heng Wang, Du Tran, Lorenzo Torresani, and Matt Feiszli. Video modeling with correlation networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 352–361, 2020. \n[41] Limin Wang, Yuanjun Xiong, Zhe Wang, Yu Qiao, Dahua Lin, Xiaoou Tang, and Luc Van Gool. Temporal segment networks: Towards good practices for deep action recognition. In European conference on computer vision, pages 20–36. Springer, 2016. \n[42] Limin Wang, Yuanjun Xiong, Zhe Wang, Yu Qiao, Dahua Lin, Xiaoou Tang, and Luc Van Gool. Temporal segment networks for action recognition in videos. IEEE transactions on pattern analysis and machine intelligence, 41(11):2740–2755, 2018. \n[43] Xiaofang Wang, Xuehan Xiong, Maxim Neumann, AJ Piergiovanni, Michael S Ryoo, Anelia Angelova, Kris M Kitani, and Wei Hua. Attentionnas: Spatiotemporal attention cell search for video classification. In European Conference on Computer Vision, pages 449–465. Springer, 2020. \n[44] Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He. Non-local neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7794–7803, 2018. \n[45] Bichen Wu, Alvin Wan, Xiangyu Yue, Peter Jin, Sicheng Zhao, Noah Golmant, Amir Gholaminejad, Joseph Gonzalez, and Kurt Keutzer. Shift: A zero flop, zero parameter alternative to spatial convolutions. In CVPR, 2018. \n[46] Chao-Yuan Wu, Ross Girshick, Kaiming He, Christoph Feichtenhofer, and Philipp Krahenbuhl. A multigrid method for efficiently training video models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 153–162, 2020. \n[47] Saining Xie, Ross Girshick, Piotr Dollár, Zhuowen Tu, and Kaiming He. Aggregated residual transformations for deep neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1492–1500, 2017. \n[48] Li Yuan, Yunpeng Chen, Tao Wang, Weihao Yu, Yujun Shi, Francis EH Tay, Jiashi Feng, and Shuicheng Yan. Tokens-to-token vit: Training vision transformers from scratch on imagenet. arXiv preprint arXiv:2101.11986, 2021. \n[49] Manzil Zaheer, Guru Guruganesh, Kumar Avinava Dubey, Joshua Ainslie, Chris Alberti, Santiago Ontanon, Philip Pham, Anirudh Ravula, Qifan Wang, Li Yang, et al. Big bird: Transformers for longer sequences. In NeurIPS, 2020. \n[50] Han Zhang, Ian Goodfellow, Dimitris Metaxas, and Augustus Odena. Self-attention generative adversarial networks. In International conference on machine learning, pages 7354–7363. PMLR, 2019. \n[51] Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412, 2017. \n[52] Zhun Zhong, Liang Zheng, Guoliang Kang, Shaozi Li, and Yi Yang. Random erasing data augmentation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 13001–13008, 2020. \n[53] Bolei Zhou, Alex Andonian, Aude Oliva, and Antonio Torralba. Temporal relational reasoning in videos. In Proceedings of the European Conference on Computer Vision (ECCV), pages 803–818, 2018. ",
1172
+ "bbox": [
1173
+ 171,
1174
+ 82,
1175
+ 828,
1176
+ 915
1177
+ ],
1178
+ "page_idx": 10
1179
+ },
1180
+ {
1181
+ "type": "text",
1182
+ "text": "",
1183
+ "bbox": [
1184
+ 171,
1185
+ 51,
1186
+ 828,
1187
+ 919
1188
+ ],
1189
+ "page_idx": 11
1190
+ },
1191
+ {
1192
+ "type": "text",
1193
+ "text": "",
1194
+ "bbox": [
1195
+ 171,
1196
+ 92,
1197
+ 828,
1198
+ 723
1199
+ ],
1200
+ "page_idx": 12
1201
+ },
1202
+ {
1203
+ "type": "text",
1204
+ "text": "Checklist ",
1205
+ "text_level": 1,
1206
+ "bbox": [
1207
+ 174,
1208
+ 743,
1209
+ 254,
1210
+ 760
1211
+ ],
1212
+ "page_idx": 12
1213
+ },
1214
+ {
1215
+ "type": "text",
1216
+ "text": "1. For all authors... ",
1217
+ "bbox": [
1218
+ 214,
1219
+ 770,
1220
+ 339,
1221
+ 784
1222
+ ],
1223
+ "page_idx": 12
1224
+ },
1225
+ {
1226
+ "type": "text",
1227
+ "text": "(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] \n(b) Did you describe the limitations of your work? [Yes] See Section 6 \n(c) Did you discuss any potential negative societal impacts of your work? [Yes] See Section 5 \n(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] ",
1228
+ "bbox": [
1229
+ 238,
1230
+ 789,
1231
+ 825,
1232
+ 893
1233
+ ],
1234
+ "page_idx": 12
1235
+ },
1236
+ {
1237
+ "type": "text",
1238
+ "text": "2. If you are including theoretical results... ",
1239
+ "bbox": [
1240
+ 214,
1241
+ 897,
1242
+ 493,
1243
+ 911
1244
+ ],
1245
+ "page_idx": 12
1246
+ },
1247
+ {
1248
+ "type": "text",
1249
+ "text": "(a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A] ",
1250
+ "bbox": [
1251
+ 236,
1252
+ 90,
1253
+ 738,
1254
+ 122
1255
+ ],
1256
+ "page_idx": 13
1257
+ },
1258
+ {
1259
+ "type": "text",
1260
+ "text": "3. If you ran experiments... ",
1261
+ "bbox": [
1262
+ 214,
1263
+ 127,
1264
+ 393,
1265
+ 141
1266
+ ],
1267
+ "page_idx": 13
1268
+ },
1269
+ {
1270
+ "type": "text",
1271
+ "text": "(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [No] We include however all implementation details required to reproduce our work. We will make the code and the models available. The datasets used are already publicly available. \n(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Section 4.1 \n(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] Due to prohibitive costs, we reported the variations between multiple training runs for a single 8 frames model in Section 4.1. This should be representative for the rest of the trained models. \n(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Section 4.1 ",
1272
+ "bbox": [
1273
+ 238,
1274
+ 146,
1275
+ 825,
1276
+ 318
1277
+ ],
1278
+ "page_idx": 13
1279
+ },
1280
+ {
1281
+ "type": "text",
1282
+ "text": "4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... ",
1283
+ "bbox": [
1284
+ 215,
1285
+ 323,
1286
+ 823,
1287
+ 338
1288
+ ],
1289
+ "page_idx": 13
1290
+ },
1291
+ {
1292
+ "type": "text",
1293
+ "text": "(a) If your work uses existing assets, did you cite the creators? [Yes] \n(b) Did you mention the license of the assets? [Yes] See Section 4.1 \n(c) Did you include any new assets either in the supplemental material or as a URL? [N/A] \n(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A] No data was collected, publicly available datasets were used \n(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [Yes] To our knowledge the datasets used do not contain such info ",
1294
+ "bbox": [
1295
+ 236,
1296
+ 342,
1297
+ 825,
1298
+ 477
1299
+ ],
1300
+ "page_idx": 13
1301
+ },
1302
+ {
1303
+ "type": "text",
1304
+ "text": "5. If you used crowdsourcing or conducted research with human subjects... ",
1305
+ "bbox": [
1306
+ 214,
1307
+ 481,
1308
+ 705,
1309
+ 496
1310
+ ],
1311
+ "page_idx": 13
1312
+ },
1313
+ {
1314
+ "type": "text",
1315
+ "text": "(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] \n(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] \n(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] ",
1316
+ "bbox": [
1317
+ 238,
1318
+ 500,
1319
+ 825,
1320
+ 589
1321
+ ],
1322
+ "page_idx": 13
1323
+ }
1324
+ ]
parse/train/QgX15Mdi1E_/QgX15Mdi1E__middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/QgX15Mdi1E_/QgX15Mdi1E__model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/RLRXCV6DbEJ/RLRXCV6DbEJ.md ADDED
@@ -0,0 +1,307 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # VERY DEEP VAES GENERALIZE AUTOREGRESSIVE MODELS AND CAN OUTPERFORM THEM ON IMAGES
2
+
3
+ Rewon Child
4
+ OpenAI
5
+ San Francisco, CA
6
+ rewon@openai.com
7
+
8
+ # ABSTRACT
9
+
10
+ We present a hierarchical VAE that, for the first time, generates samples quickly and outperforms the PixelCNN in log-likelihood on all natural image benchmarks. We begin by observing that, in theory, VAEs can actually represent autoregressive models, as well as faster, better models if they exist, when made sufficiently deep. Despite this, autoregressive models have historically outperformed VAEs in loglikelihood. We test if insufficient depth explains why by scaling a VAE to greater stochastic depth than previously explored and evaluating it CIFAR-10, ImageNet, and FFHQ. In comparison to the PixelCNN, these very deep VAEs achieve higher likelihoods, use fewer parameters, generate samples thousands of times faster, and are more easily applied to high-resolution images. Qualitative studies suggest this is because the VAE learns efficient hierarchical visual representations. We release our source code and models at https://github.com/openai/vdvae.
11
+
12
+ ![](images/f4a4d7c8e2a8203753893d6d638e3c16523969ec955ce7f35f7ebdbe3a24ffc9.jpg)
13
+ Figure 1: Selected samples from our very deep VAE on FFHQ-256, and a demonstration of the learned generative process. VAEs can learn to first generate global features at low resolution, then fill in local details in parallel at higher resolutions. When made sufficiently deep, this learned, parallel, multiscale generative procedure attains a higher log-likelihood than the PixelCNN.
14
+
15
+ # 1 INTRODUCTION
16
+
17
+ One potential path to increased data-efficiency, generalization, and robustness of machine learning methods is to train generative models. These models can learn useful representations without human supervision by learning to create examples of the data itself. Many types of generative models have flourished in recent years, including likelihood-based generative models, which include autoregressive models (Uria et al., 2013), variational autoencoders (VAEs) (Kingma & Welling, 2014; Rezende et al., 2014), and invertible flows (Dinh et al., 2014; 2016). Their objective, the negative log-likelihood, is equivalent to the KL divergence between the data distribution and the model distribution. A wide variety of models can be compared and assessed along this criteria, which corresponds to how well they fit the data in an information-theoretic sense.
18
+
19
+ Starting with the PixelCNN (Van den Oord et al., 2016), autoregressive models have long achieved the highest log-likelihoods across many modalities, despite counterintuitive modeling assumptions. For example, although natural images are observations of latent scenes, autoregressive models learn dependencies solely between observed variables. That process can require complex function approximators that integrate long-range dependencies (Oord et al., 2016; Child et al., 2019). In contrast, VAEs and invertible flows incorporate latent variables and can thus, in principle, learn a simpler model that mirrors how images are actually generated. Despite this theoretical advantage, on the landmark ImageNet density estimation benchmark, the Gated PixelCNN still achieves higher likelihoods than all flows and VAEs, corresponding to a better fit with the data.
20
+
21
+ Is the autoregressive modeling assumption actually a better inductive bias for images, or can VAEs, sufficiently improved, outperform autoregressive models? The answer has significant practical stakes, because large, compute-intensive autoregressive models (Strubell et al., 2019) are increasingly used for a variety of applications (Oord et al., 2016; Brown et al., 2020; Dhariwal et al., 2020; Chen et al., 2020). Unlike autoregressive models, latent variable models only need to learn dependencies between latent and observed variables; such models can not only support faster synthesis and higher-dimensional data, but may also do so using smaller, less powerful architectures.
22
+
23
+ We start this work with a simple but (to the best of our knowledge) unstated observation: hierarchical VAEs should be able to at least match autoregressive models, because autoregressive models are equivalent to VAEs with a powerful prior and restricted approximate posterior (which merely outputs observed variables). In the worst case, VAEs should be able to replicate the functionality of autoregressive models; in the best case, they should be able to learn better latent representations, possibly with much fewer layers, if such representations exist.
24
+
25
+ We formalize this observation in Section 3, showing it is only true for VAEs with more stochastic layers than previous work has explored. Then we experimentally test it on competitive natural image benchmarks. Our contributions are the following:
26
+
27
+ • We provide theoretical justification for why greater depth (up to the data dimension $D$ , but also as low as some value $K \ll D$ ) could improve VAE performance (Section 3)
28
+ • We introduce an architecture capable of scaling past 70 layers, when previous work explored at most 30 (Section 4)
29
+ • We verify that depth, independent of model capacity, improves log-likelihood, and allows VAEs to outperform the PixelCNN on all benchmarks (Section 5.1)
30
+ • Compared to the PixelCNN, we show the model also uses fewer parameters, generates samples thousands of times more quickly, and can be scaled to larger images. We show evidence these qualities may emerge from the model learning an efficient hierarchical representation of images (Section 5.2)
31
+ • We release code and models at https://github.com/openai/vdvae.
32
+
33
+ # 2 PRELIMINARIES
34
+
35
+ We review prior work and introduce some of the basic terminology used in the field.
36
+
37
+ ![](images/978d91e9b0b2d07410b3d5f4bded50810f4b93ca26757aed16b0b6bc538deed2.jpg)
38
+ Figure 2: Different possible learned generative models in a VAE. Left: A hierarchical VAE can learn an autoregressive model by using the deterministic identity function as an encoder, and learning the autoregression in the prior. Right: Learning the encoder can lead to efficient hierarchies of latent variables (black). If the bottom group of three latent variables is conditionally independent given the first, they can be generated in parallel within a single layer, potentially leading to faster sampling.
39
+
40
+ ![](images/0caf4b37d9530a7ef2103ac7b494241f024ed07235e80cfe215e3028a8aa1b77.jpg)
41
+
42
+ # 2.1 VARIATIONAL AUTOENCODERS
43
+
44
+ Variational autoencoders (Kingma & Welling, 2014; Rezende et al., 2014) consist of a generator $p _ { \theta } ( { \pmb x } | { \pmb z } )$ , a prior $p _ { \theta } ( z )$ , and an approximate posterior $q _ { \phi } ( \mathbf { z } | \mathbf { x } )$ . Neural networks $\phi$ and $\theta$ are trained end-to-end with backpropagation and the reparameterization trick in order to maximize the evidence lower bound (ELBO):
45
+
46
+ $$
47
+ \begin{array} { r } { \log p _ { \theta } ( \mathbf { x } ) \geq E _ { \mathbf { z } \sim q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \log p _ { \theta } ( \mathbf { x } | \mathbf { z } ) - D _ { K L } [ q _ { \phi } ( \mathbf { z } | \mathbf { x } ) | | p _ { \theta } ( \mathbf { z } ) ] } \end{array}
48
+ $$
49
+
50
+ See Kingma & Welling (2019) for an in-depth introduction. There are many choices for what networks are used for $p _ { \theta } ( { \pmb x } | { \pmb z } )$ , $q _ { \phi } ( \pmb { z } | \pmb { x } )$ , and whether $p _ { \theta } ( z )$ is also learned or set to a simple distribution.
51
+
52
+ We study VAEs with independent $p _ { \theta } ( { \pmb x } | { \pmb z } )$ – that is, where each observed $x _ { i }$ is output without conditioning on any other $x _ { j }$ . This ensures generation time does not increase linearly with the dimensionality of the data, and requires that these VAEs learn to incorporate the complexity of the data into a rich distribution over latent variables $_ { z }$ . It is possible to have autoregressive $p _ { \theta } ( { \pmb x } | { \pmb z } )$ (Gulrajani et al., 2016), but generation is slow for these models. They also sometimes ignore latent variables entirely, becoming equivalent to normal autoregressive models (Chen et al. (2016)).
53
+
54
+ # 2.2 HIERARCHICAL VARIATIONAL AUTOENCODERS
55
+
56
+ Much of the early work on VAEs incorporate fully-factorized Gaussian $q _ { \phi } ( \pmb { z } | \pmb { x } )$ and $p _ { \theta } ( z )$ . This can lead to poor outcomes if the latent variables required for good generation take on a more complex distribution, as is common with independent $p _ { \theta } ( \pmb { x } | \pmb { z } )$ . One of the simplest methods of gaining greater expressivity in both distributions is to use a hierarchical VAE, which has several stochastic layers of latent variables. These variables are emitted in groups $z _ { 0 } , z _ { 1 } , . . . , z _ { N }$ , which are conditionally dependent upon each other in some way. For images, latent variables are typically output in feature maps of varying resolutions, with $z _ { \mathrm { 0 } }$ corresponding to a small number of latent variables at low resolution at the “top” of the network, and $z _ { N }$ corresponding to a larger number of latent variables at high resolution at the “bottom”.
57
+
58
+ One particularly elegant conditioning structure is the top-down $V A E$ , introduced in Sønderby et al. (2016). In this model, both the prior and the approximate posterior generate latent variables in the same order:
59
+
60
+ $$
61
+ \begin{array} { c } { { p _ { \theta } ( z ) = p _ { \theta } ( z _ { 0 } ) p _ { \theta } ( z _ { 1 } | z _ { 0 } ) . . . p _ { \theta } ( z _ { N } | z _ { < N } ) } } \\ { { q _ { \phi } ( z | x ) = q _ { \phi } ( z _ { 0 } | x ) q _ { \phi } ( z _ { 1 } | z _ { 0 } , x ) . . . q _ { \phi } ( z _ { N } | z _ { < N } , x ) } } \end{array}
62
+ $$
63
+
64
+ A diagram of this process appears in Figure 3. A typical implementation of this model has $\phi$ first perform a deterministic “bottom-up” pass on the data to generate features, then processes the groups of latent variables from top to bottom, using feedforward networks to generate features which are shared between the approximate posterior, prior, and reconstruction network $p _ { \theta } ( { \pmb x } | { \pmb z } )$ . We adopt this base architecture as it is simple, empirically effective, and has been postulated to resemble biological processes of perception (Dayan et al., 1995).
65
+
66
+ ![](images/9bafeb21f3d1caf08b8236dd3e4bff05f41587b63c3862486162cb94cc0390cf.jpg)
67
+ Figure 3: A diagram of our top-down VAE architecture. Residual blocks are similar to bottleneck ResNet blocks (He et al., 2016). Each convolution is preceded by the GELU nonlinearity (Hendrycks & Gimpel, 2016). $q _ { \phi } ( . )$ and $p _ { \theta } ( . )$ are diagonal Gaussian distributions. $\mathbf { z }$ is sampled from $\dot { q } _ { \phi } ( . )$ during training, and $p _ { \theta } ( . )$ when sampling. We use average pooling and nearest-neighbor upsampling for pool and unpool layers.
68
+
69
+ # 3 WHY DEPTH MATTERS FOR HIERARCHICAL VAES
70
+
71
+ We find that hierarchical VAEs with sufficient depth can not only learn arbitrary orderings over observed variables, but also learn more effective latent variable distributions, if such distributions exist. We present these results below.
72
+
73
+ Definition ( $N$ -layer VAE). A deep hierarchical VAE with $N$ stochastic layers, independent $p ( { \pmb x } | z )$ , and the top-down factorization of the prior and approximate posterior in Equations 2-3.
74
+
75
+ Proposition 1. N-layer VAEs generalize autoregressive models when N is the data dimension
76
+
77
+ Proposition 2. $N$ -layer VAEs are universal approximators of $N$ -dimensional latent densities
78
+
79
+ Proposition 1 (proof in Appendix, also visualized in Figure 2, left) leads to a possible explanation of why autoregressive models to date have outperformed VAEs: they are deeper, in the sense of statistical dependence. A VAE must be as deep as the data dimension $D$ (3072 layers in the case of $3 2 \mathrm { x } 3 2$ images) if the images truly require $D$ steps to generate.
80
+
81
+ Luckily, however, Proposition 2 (proof and further technical requirements in Appendix) suggests that shorter procedures, if they exist, are also learnable. $N = D$ is an extreme case, where the most effective latent variables $z \in \mathbb { R } ^ { D }$ may simply be copies of the observed variables. But if for some $K < D$ there exist latent variables $z \in \mathbb { R } ^ { K }$ that the generator can use to more efficiently compress the data, Proposition 2 states a $K$ -layer VAE can learn the posterior and prior distribution over those variables.
82
+
83
+ Such shorter generative paths could emerge in two ways. First, as depicted in Figure 2 (right), if the model discovers that certain variables are conditionally independent given others, the model can generate them in parallel inside a single layer, where $\begin{array} { r } { q _ { \phi } ( z _ { N } \vert z _ { < N } , \pmb { x } ) = \prod _ { d } q _ { \phi } ( z _ { N } ^ { ( d ) } \vert z _ { < N } , \pmb { x } ) } \end{array}$ . We hypothesize these efficient hierarchies should emerge in images, as they contain many spatially independent textures, and study this in Section 5.2. Second, the model could learn a low-dimensional representation of the data. Dai & Wipf (2019) recently showed that when a VAE is trained on data distributed on a $K$ -dimensional manifold embedded in $\mathbb { R } ^ { D }$ , a VAE will only activate $K$ dimensions in its latent space, meaning that the VAE will require fewer layers unless the manifold dimension is $D$ , which is unlikely to be the case for images.
84
+
85
+ It is difficult to ascertain the lowest possible value of $K$ for a given dataset, but it may be deeper than most hierarchical VAEs to date. Images have many thousands of observed variables, but early hierarchical VAEs did not exceed 3 layers, until Maaløe et al. (2019) investigated a Gaussian VAE with 15 layers and found it displayed impressive performance along a variety of measures. Kingma et al. (2016) and Vahdat & Kautz (2020) additionally explored networks up to 12 and 30 layers. (These additionally incorporated additional statistical dependencies in the approximate posterior through the usage of inverse autoregressive flow (Kingma et al., 2016), an alternative approach which we contrast with our approach in Section A.4). Nevertheless, given these results we hypothesize that greater depth may improve the performance of VAEs. In the next section, we introduce an architecture capable of scaling to a greater number of stochastic layers. In Section 5.1 we show depth indeed improves performance.
86
+
87
+ # 4 AN ARCHITECTURE FOR VERY DEEP VAES
88
+
89
+ We consider a “very deep” VAE to simply be one with greater depth than has previously been explored (and do not define it to be a specific number of layers). As existing implementations of VAEs did not support many more stochastic layers than they were trained on, we reimplemented a minimal VAE with the sole aim of increasing the number of stochastic layers. This VAE consists only of convolutions, nonlinearities, and Gaussian stochastic layers. It does not exhibit posterior collapse even for large numbers of stochastic layers. We describe key architectural choices here and refer readers to our source code for more details.
90
+
91
+ # 4.1 ARCHITECTURAL COMPONENTS AND INITIALIZATION
92
+
93
+ A diagram of our network appears in Figure 3. It resembles the ResNet VAE in Kingma et al. (2016), but with bottleneck residual blocks. For each stochastic layer, the prior and posterior are diagonal Gaussian distributions, as used in prior work (Maaløe et al., 2019).
94
+
95
+ As an alternative to weight normalization and data-dependent initialization (Salimans & Kingma, 2016), we adopt the default PyTorch weight intialization. The one exception is the final convolutional layer in each residual bottleneck block, which we scale by $\scriptstyle { \frac { 1 } { \sqrt { N } } }$ , where $_ \mathrm { N }$ is the depth (similar to Radford et al. (2019); Child et al. (2019); Zhang et al. (2019)). This residual scaling improves stability and performance with many layers, as we show in the Appendix (Table 3).
96
+
97
+ Additionally, we use nearest-neighbor upsampling for our “unpool” layer, which when paired with our ResNet architecture, allows us to completely remove the “free bits” and KL “warming up” terms that appear in related work. As we detail in the Appendix (Figure 5), when upsampling is done through transposed convolutional layer, the network may ignore layers at low resolution (for instance, 1x1 or 4x4 layers). We found no evidence of posterior collapse in any networks trained with nearest neighbor interpolation.
98
+
99
+ # 4.2 STABILIZING TRAINING WITH GRADIENT SKIPPING
100
+
101
+ VAEs have notorious “optimization difficulties,” which are not frequently discussed in the literature but nevertheless well-known by practitioners. These manifest as extremely high reconstruction or KL losses and corresponding large gradient norms (up to 1e15). We address this by skipping updates with a gradient norm above a certain threshold, set by hyperparameter. Though we select high thresholds that affect fewer than $0 . 0 1 \%$ of updates, this technique almost entirely eliminates divergence, and allows networks to train smoothly. We plot the evolution of grad norms and the values we select in (Figure 6). An alternative approach to stabilizing networks may be the spectral regularization method introduced in Vahdat & Kautz (2020).
102
+
103
+ Table 1: Loss by network with different configurations of stochastic layers on ImageNet-32 (similar trends appear on CIFAR-10). Left: Networks with equal number of layers, but with lower stochastic depth as described in Section 5.1. Increasing depth up to 48 layers still shows gains, which is farther than previous work has explored. Right: Networks with 48 layers, but distributed at different resolutions. We find higher resolutions benefit more from layers.
104
+
105
+ <table><tr><td>Depth</td><td>Params</td><td>Test Loss</td><td colspan="5">Distribution of 48 layers</td><td rowspan="2">Test Loss</td></tr><tr><td>3</td><td>41M</td><td>4.30</td><td>32x32</td><td>2 16x16</td><td>8x8</td><td>4x4</td><td>1x1</td></tr><tr><td>6</td><td>41M</td><td>4.18</td><td>10</td><td>10</td><td>10</td><td>10</td><td>8</td><td>3.98</td></tr><tr><td>12</td><td>41M</td><td>4.06</td><td>12</td><td>12</td><td>10</td><td>8</td><td>6</td><td>3.97</td></tr><tr><td>24</td><td>41M</td><td>3.98</td><td>14</td><td>14</td><td>10</td><td>6</td><td>4</td><td>3.96</td></tr><tr><td>48</td><td>41M</td><td>3.95</td><td>16</td><td>16</td><td>10</td><td>4</td><td>2</td><td>3.95</td></tr></table>
106
+
107
+ # 5 EXPERIMENTS
108
+
109
+ We trained very deep VAEs on challenging natural image datasets. All hyperparameters for experiments are available in the Appendix and in our source code.
110
+
111
+ # 5.1 STATISTICAL DEPTH, INDEPENDENT OF CAPACITY, IMPROVES PERFORMANCE
112
+
113
+ We first tested whether greater statistical depth, independent of other factors, can result in improved performance. We trained a network with 48 layers for 600k steps on ImageNet-32, grouping layers to output variables independently instead of conditioning on each other. If the input for the ith topdown block is $x _ { i }$ , we can make $K$ consecutive blocks independent by setting $x _ { i + 1 } , . . . , x _ { i + K }$ all equal to $x _ { i }$ . (Normally, $x _ { i + 1 } = x _ { i } + f ( \mathrm { b l o c k } ( x _ { i } ) ) )$ . This technique reduces the stochastic depth without affecting parameter count. Stochastic depth shows a clear correlation with performance, even up to 48 layers, which is past what previous work has explored (Table 1, left).
114
+
115
+ We then tested our hypothesis at scale. We trained networks on CIFAR-10, ImageNet-32, and ImageNet-64 with greater numbers of stochastic layers, but with fewer parameters than related work (see Table 2). On CIFAR-10, we trained a model with 45 stochastic layers and only 39M parameters, and found it achieved a test log-likelihood of 2.87 bits per dim (average of 4 seeds). On ImageNet32 and ImageNet-64, we trained networks with 78 and 75 stochastic layers and only approximately 120M parameters, and achieved likelihoods of 3.80 and 3.52.
116
+
117
+ On all tasks, these results outperform all GatedPixelCNN/PixelCNN $^ { + + }$ models, and all nonautoregressive models, while using similar or fewer parameters. These results support our hypothesis that stochastic depth, as opposed to other factors, explains the gap between VAEs and autoregressive models.
118
+
119
+ # 5.2 VERY DEEP VAES LEARN AN EFFICIENT HIERARCHICAL ORDERING
120
+
121
+ One question that emerges from the analysis in Section 3 is whether VAEs need to be as deep as autoregressive models, or whether they can learn a latent hierarchy of conditionally independent variables which are able to be synthesized in parallel. We qualitatively show this is true in Figure 4. For FFHQ-256 images, the first several layers at low resolution almost wholly determine the global features of the image, even though they only account for less than $1 \%$ of the latent variables. The rest of the high-resolution variables appear to be spatially independent, meaning they can be emitted in parallel in a number of layers much lower than the dimensionality of the image. This efficient hierarchical representation may underlie the VAE’s ability to achieve better log-likelihoods than the PixelCNN while simultaneously sampling thousands of times faster. This can be viewed as a learned parallel multiscale generation method, unlike the handcrafted approaches of Kolesnikov & Lampert (2017); Menick & Kalchbrenner (2018); Reed et al. (2017).
122
+
123
+ ![](images/dca6cb513c7699bcfea1e81769ad770540f18bec0843d20878e2d88cee72da6a.jpg)
124
+ Figure 4: Cumulative percentage of latent variables at a given resolution, and reconstructions of samples on FFHQ-256. We sample latent variables from the approximate posterior until the given resolution, and sample the rest from the prior at low temperature. This shows what images are likely given a subset of latent variables. Low-resolution latents comprise a small fraction of the total latents, but encode significant portions of the global structure. This suggests deep VAEs learn efficient, hierarchical representations of the data.
125
+
126
+ Additionally, we found that on all datasets we tested, very deep VAEs used roughly $30 \%$ fewer parameters than the PixelCNN (Table 2). One possible explanation is that the learned hierarchical generation procedure involves fewer long-range dependencies, or may otherwise be simpler to learn.
127
+
128
+ We found that networks in general benefited from more layers at higher resolutions (Table 1, right). This suggests that global features may account for a smaller fraction of information than local details and textures, and that it is important to have many latent variables at high resolution.
129
+
130
+ # 5.2.1 VERY DEEP VAES ARE EASILY SCALED TO HIGH DIMENSIONAL DATA
131
+
132
+ Scaling autoregressive models to higher resolutions presents several challenges. First, the sampling time and memory requirements of autoregressive models increase linearly with resolution. This scaling makes datasets like FFHQ-256 and FFHQ-1024 intractable for naive approaches. Although clever factorization techniques have been adopted for $2 5 6 \mathrm { x } 2 5 6$ images (Menick & Kalchbrenner, 2018), such factorizations may not be as effective for alternate datasets or higher-resolution images.
133
+
134
+ Our VAE, in contrast, readily scales to higher resolutions. The same network used for $3 2 \mathrm { x } 3 2 $ images can be applied to 1024x1024 images by introducing a greater number of upsampling layers throughout the network. We found we could train an equal number of steps (1.5M) using a similar number of training resources (32 GPUs for 2.5 weeks) on both $3 2 \mathrm { x } 3 2 $ and 1024x1024 images with few hyperparameter changes (see Appendix for hyperparameters). Samples from both models (displayed in Appendix) require a single forward pass of the model to generate, with only minor differences in runtime. An autoregressive model, on the other hand, would require a thousand times more network evaluations to sample 1024x1024 images and likely require a custom training procedure.
135
+
136
+ # 6 RELATED WORK AND DISCUSSION
137
+
138
+ Our work is inspired by previous and concurrent work in hierarchical VAEs (Sønderby et al., 2016; Maaløe et al., 2019; Vahdat & Kautz, 2020). Relative to these works, we provide some justification for why deeper networks may perform better, introduce a new architecture, and empirically demonstrate gains in log-likelihood. Many aspects of prior work are complementary with ours and could be combined. Maaløe et al. (2019), for instance, incorporates a “bottom-up” stochastic path that doubles the depth of the approximate posterior, and Vahdat & Kautz (2020) introduces a number of powerful architecture components and improved training techniques. We seek here not to introduce a significantly better method than these alternatives, but to demonstrate that depth is a key overlooked factor in most prior approaches to VAEs.
139
+
140
+ Table 2: Our main results on standard benchmark datasets. Very deep VAEs outperform PixelCNN-based autoregressive models with fewer parameters while maintaining fast sampling. “Depth” refers to the number of stochastic layers for hierarchical VAEs (although BIVA and IAFbased networks have additional statistical dependencies). Sampling refers to the number of network evaluations per sample, and $D$ designates the dimensionality of the data. An asterisk $( ^ { * } )$ denotes our estimate of parameters. Samples for ImageNet and CIFAR-10 are in the Appendix.
141
+
142
+ <table><tr><td></td><td>Model type</td><td>Params</td><td>Depth</td><td>Sampling</td><td>NLL</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>CIFAR-10 PixelCNN++ (Salimans et al., 2017)</td><td>AR</td><td>53M*</td><td></td><td>D</td><td>2.92</td></tr><tr><td>PixelSNAIL (Chen et al., 2017)</td><td>AR</td><td></td><td></td><td>D</td><td>2.85</td></tr><tr><td>Sparse Transformer (Child et al.,2019)</td><td>AR</td><td>59M</td><td></td><td>D</td><td>2.80</td></tr><tr><td></td><td>VAE</td><td></td><td></td><td></td><td></td></tr><tr><td>VLAE (Chen et al., 2016)</td><td>VAE</td><td></td><td>12</td><td>D</td><td>≤2.95</td></tr><tr><td>IAF-VAE (Kingma et al., 2016) Flow++ (Ho et al.,2019)</td><td>Flow</td><td>31M</td><td></td><td>1</td><td>≤3.11</td></tr><tr><td>BIVA (Maalpe et al.,2019)</td><td>VAE</td><td>103M</td><td>15</td><td>1</td><td>≤3.08</td></tr><tr><td></td><td></td><td></td><td></td><td>1</td><td>≤3.08</td></tr><tr><td>NVAE (Vahdat &amp; Kautz, 2020) Very Deep VAE (ours)</td><td>VAE VAE</td><td>131M 39M</td><td>30 45</td><td>1 1</td><td>≤ 2.91 ≤ 2.87</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>ImageNet-32 Gated PixelCNN</td><td>AR</td><td>177M*</td><td>10</td><td></td><td></td></tr><tr><td>Image Transformer (Parmar et al., 2018)</td><td>AR</td><td></td><td></td><td>D</td><td>3.83</td></tr><tr><td>BIVA</td><td>VAE</td><td>103M*</td><td>15</td><td>D</td><td>3.77</td></tr><tr><td>NVAE</td><td></td><td>268M</td><td>28</td><td>1</td><td>≤3.96</td></tr><tr><td>Flow++</td><td>VAE</td><td>169M</td><td></td><td>1</td><td>≤3.92</td></tr><tr><td>Very Deep VAE (ours)</td><td>Flow VAE</td><td>119M</td><td>78</td><td>1 1</td><td>≤3.86 ≤3.80</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>ImageNet-64 Gated PixelCNN</td><td></td><td>177M*</td><td></td><td></td><td></td></tr><tr><td>SPN (Menick &amp; Kalchbrenner, 2018)</td><td>AR AR</td><td>150M</td><td></td><td>D</td><td>3.57</td></tr><tr><td>Sparse Transformer</td><td>AR</td><td>152M</td><td></td><td>D</td><td>3.52</td></tr><tr><td>Glow (Kingma &amp; Dhariwal, 2018)</td><td>Flow</td><td></td><td></td><td>D</td><td>3.44</td></tr><tr><td>Flow++</td><td></td><td>73M</td><td></td><td>1</td><td>3.81</td></tr><tr><td>Very Deep VAE (ours)</td><td>Flow VAE</td><td>125M</td><td>75</td><td>1</td><td>≤3.69</td></tr><tr><td></td><td></td><td></td><td></td><td>1</td><td>≤3.52</td></tr><tr><td>FFHQ-256 (5 bit)</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>NVAE</td><td>VAE</td><td></td><td>36</td><td>1</td><td>≤0.68</td></tr><tr><td>Very Deep VAE (ours)</td><td>VAE</td><td>115M</td><td>62</td><td>1</td><td>≤0.61</td></tr><tr><td>FFHQ-1024 (8 bit)</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Very Deep VAE (ours)</td><td>VAE</td><td>115M</td><td>72</td><td>1</td><td>≤ 2.42</td></tr></table>
143
+
144
+ Diffusion models can be seen as deep VAEs that, like autoregressive models, have a specific analytical posterior. Ho et al. (2020) showed that such models achieve impressive sample quality with great depth, which is in line with our observations that greater depth is helpful for VAEs. One benefit of the VAEs we outline in this work over diffusion models is that our VAEs generate samples with a single network evaluation, whereas diffusion models currently require a large number of network evaluations per sample.
145
+
146
+ Inverse autoregressive flows (IAF) are also closely related, and we discuss the differences with hierarchical models in Section A.4. The work of Zhao et al. (2017) may also appear to contradict our findings, and we discuss that work in Section A.5.
147
+
148
+ # 7 CONCLUSION
149
+
150
+ We argue deeper VAEs should perform better, introduce a deeper architecture, and show it outperforms all PixelCNN-based autoregressive models in likelihood while being more efficient. We hope this encourages work in further improving VAEs and latent variable models.
151
+
152
+ # ACKNOWLEDGMENTS
153
+
154
+ We thank Aditya Ramesh, Pranav Shyam, Johannes Otterbach, Heewoo Jun, Mark Chen, Prafulla Dhariwal, Alec Radford, Yura Burda, Bowen Baker, Raul Puri, and Ilya Sutskever for helpful discussions. We also thank the anonymous reviewers for helping improve our work.
155
+
156
+ # REFERENCES
157
+
158
+ Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020.
159
+
160
+ Mark Chen, Alec Radford, Rewon Child, Jeff Wu, Heewoo Jun, Prafulla Dhariwal, David Luan, and Ilya Sutskever. Generative pretraining from pixels. In Proceedings of the 37th International Conference on Machine Learning, 2020.
161
+
162
+ Xi Chen, Diederik P Kingma, Tim Salimans, Yan Duan, Prafulla Dhariwal, John Schulman, Ilya Sutskever, and Pieter Abbeel. Variational lossy autoencoder. arXiv preprint arXiv:1611.02731, 2016.
163
+
164
+ Xi Chen, Nikhil Mishra, Mostafa Rohaninejad, and Pieter Abbeel. Pixelsnail: An improved autoregressive generative model. arXiv preprint arXiv:1712.09763, 2017.
165
+
166
+ Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers. arXiv preprint arXiv:1904.10509, 2019.
167
+
168
+ Bin Dai and David Wipf. Diagnosing and enhancing vae models. arXiv preprint arXiv:1903.05789, 2019.
169
+
170
+ Peter Dayan, Geoffrey E Hinton, Radford M Neal, and Richard S Zemel. The helmholtz machine. Neural computation, 7(5):889–904, 1995.
171
+
172
+ Prafulla Dhariwal, Heewoo Jun, Christine Payne, Jong Wook Kim, Alec Radford, and Ilya Sutskever. Jukebox: A generative model for music. arXiv preprint arXiv:2005.00341, 2020.
173
+
174
+ Laurent Dinh, David Krueger, and Yoshua Bengio. Nice: Non-linear independent components estimation. arXiv preprint arXiv:1410.8516, 2014.
175
+
176
+ Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using real nvp. arXiv preprint arXiv:1605.08803, 2016.
177
+
178
+ Ishaan Gulrajani, Kundan Kumar, Faruk Ahmed, Adrien Ali Taiga, Francesco Visin, David Vazquez, and Aaron Courville. Pixelvae: A latent variable model for natural images. arXiv preprint arXiv:1611.05013, 2016.
179
+
180
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016.
181
+
182
+ Dan Hendrycks and Kevin Gimpel. Gaussian error linear units (gelus). arXiv preprint arXiv:1606.08415, 2016.
183
+
184
+ Jonathan Ho, Xi Chen, Aravind Srinivas, Yan Duan, and Pieter Abbeel. Flow $^ { + + }$ : Improving flowbased generative models with variational dequantization and architecture design. arXiv preprint arXiv:1902.00275, 2019.
185
+
186
+ Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. arXiv preprint arxiv:2006.11239, 2020.
187
+
188
+ Chin-Wei Huang, Ahmed Touati, Laurent Dinh, Michal Drozdzal, Mohammad Havaei, Laurent Charlin, and Aaron Courville. Learnable explicit density for continuous latent space and variational inference. arXiv preprint arXiv:1710.02248, 2017.
189
+
190
+ Chin-Wei Huang, David Krueger, Alexandre Lacoste, and Aaron Courville. Neural autoregressive flows. arXiv preprint arXiv:1804.00779, 2018.
191
+
192
+ Diederik P Kingma and Max Welling. Stochastic gradient vb and the variational auto-encoder. In Second International Conference on Learning Representations, ICLR, volume 19, 2014.
193
+
194
+ Diederik P Kingma and Max Welling. An introduction to variational autoencoders. arXiv preprint arXiv:1906.02691, 2019.
195
+
196
+ Durk P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. In Advances in Neural Information Processing Systems, pp. 10215–10224, 2018.
197
+
198
+ Durk P Kingma, Tim Salimans, Rafal Jozefowicz, Xi Chen, Ilya Sutskever, and Max Welling. Improved variational inference with inverse autoregressive flow. In Advances in neural information processing systems, pp. 4743–4751, 2016.
199
+
200
+ Alexander Kolesnikov and Christoph H Lampert. Pixelcnn models with auxiliary variables for natural image modeling. In International Conference on Machine Learning, pp. 1905–1914. PMLR, 2017.
201
+
202
+ Lars Maaløe, Marco Fraccaro, Valentin Lievin, and Ole Winther. Biva: A very deep hierarchy of ´ latent variables for generative modeling. In Advances in neural information processing systems, pp. 6548–6558, 2019.
203
+
204
+ Jacob Menick and Nal Kalchbrenner. Generating high fidelity images with subscale pixel networks and multidimensional upscaling. arXiv preprint arXiv:1812.01608, 2018.
205
+
206
+ Aaron van den Oord, Sander Dieleman, Heiga Zen, Karen Simonyan, Oriol Vinyals, Alex Graves, Nal Kalchbrenner, Andrew Senior, and Koray Kavukcuoglu. Wavenet: A generative model for raw audio. arXiv preprint arXiv:1609.03499, 2016.
207
+
208
+ George Papamakarios, Eric Nalisnick, Danilo Jimenez Rezende, Shakir Mohamed, and Balaji Lakshminarayanan. Normalizing flows for probabilistic modeling and inference. arXiv preprint arXiv:1912.02762, 2019.
209
+
210
+ Niki Parmar, Ashish Vaswani, Jakob Uszkoreit, Łukasz Kaiser, Noam Shazeer, Alexander Ku, and Dustin Tran. Image transformer. arXiv preprint arXiv:1802.05751, 2018.
211
+
212
+ Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. OpenAI Blog, 1(8):9, 2019.
213
+
214
+ Scott Reed, Aaron van den Oord, Nal Kalchbrenner, Sergio G ¨ omez Colmenarejo, Ziyu Wang, Dan ´ Belov, and Nando De Freitas. Parallel multiscale autoregressive density estimation. arXiv preprint arXiv:1703.03664, 2017.
215
+
216
+ Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. arXiv preprint arXiv:1401.4082, 2014.
217
+
218
+ Tim Salimans and Durk P Kingma. Weight normalization: A simple reparameterization to accelerate training of deep neural networks. In Advances in neural information processing systems, pp. 901– 909, 2016.
219
+
220
+ Tim Salimans, Andrej Karpathy, Xi Chen, and Diederik P Kingma. Pixelcnn $^ { + + }$ : Improving the pixelcnn with discretized logistic mixture likelihood and other modifications. arXiv preprint arXiv:1701.05517, 2017.
221
+
222
+ Table 3: Effects of scaling residual initialization on very deep VAEs. We trained networks with varying depths for $8 0 \mathrm { k }$ iterations. Scaling the last layer in the residual block by $\scriptstyle { \frac { 1 } { \sqrt { N } } }$ results in higher losses for shallower networks, but lower losses and greater stability for deeper networks. The number of updates which are skipped because the gradient norm would destabilize the network is significantly reduced with scaling.
223
+
224
+ <table><tr><td>Depth</td><td>Without scaling Loss</td><td>Skipped Updates</td><td>With scaling Loss</td><td>Skipped Updates</td></tr><tr><td>15</td><td>2.50</td><td>13</td><td>2.51</td><td>0</td></tr><tr><td>30</td><td>2.36</td><td>41</td><td>2.38</td><td>1</td></tr><tr><td>45</td><td>2.31</td><td>48</td><td>2.30</td><td>0</td></tr><tr><td>60</td><td>2.30</td><td>76</td><td>2.29</td><td>1</td></tr><tr><td>75</td><td>Diverged</td><td>1</td><td>2.28</td><td>0</td></tr></table>
225
+
226
+ Casper Kaae Sønderby, Tapani Raiko, Lars Maaløe, Søren Kaae Sønderby, and Ole Winther. Ladder variational autoencoders. In Advances in neural information processing systems, pp. 3738–3746, 2016.
227
+
228
+ Emma Strubell, Ananya Ganesh, and Andrew McCallum. Energy and policy considerations for deep learning in nlp. arXiv preprint arXiv:1906.02243, 2019.
229
+
230
+ Benigno Uria, Iain Murray, and Hugo Larochelle. Rnade: The real-valued neural autoregressive density-estimator. In Advances in Neural Information Processing Systems, pp. 2175–2183, 2013.
231
+
232
+ Arash Vahdat and Jan Kautz. Nvae: A deep hierarchical variational autoencoder. arXiv preprint arXiv:2007.03898, 2020.
233
+
234
+ Aaron Van den Oord, Nal Kalchbrenner, Lasse Espeholt, Oriol Vinyals, Alex Graves, et al. Conditional image generation with pixelcnn decoders. In Advances in neural information processing systems, pp. 4790–4798, 2016.
235
+
236
+ Hongyi Zhang, Yann N Dauphin, and Tengyu Ma. Fixup initialization: Residual learning without normalization. arXiv preprint arXiv:1901.09321, 2019.
237
+
238
+ Shengjia Zhao, Jiaming Song, and Stefano Ermon. Learning hierarchical features from generative models. arXiv preprint arXiv:1702.08396, 2017.
239
+
240
+ # A APPENDIX
241
+
242
+ # A.1 ABLATIONS OF ARCHITECTURAL COMPONENTS
243
+
244
+ First, we visualize data that suggests upsampling layers and residual connections have an impact on posterior collapse (Figure 5). Architectural differences may explain why our VAEs do not need “free bits” or KL warmups to avoid posterior collapse.
245
+
246
+ In Table 3, we show residual initialization leads to smoother and better training of very deep VAEs. Without residual initialization, very deep VAEs encounter a high number of unstable updates and have higher losses.
247
+
248
+ In Figure 6, we show the max gradient norms experienced throughout training, and show that our skipping criterion avoids a small number of updates that would destabilize the network.
249
+
250
+ A.2 PROPOSITION 1: N-LAYER VAES GENERALIZE AUTOREGRESSIVE MODELS WHEN N IS THE DATA DIMENSION
251
+
252
+ Proposition 1 shows that an autoregressive model with an arbitrary ordering over observed variables in $\dot { \boldsymbol { x } } \in \mathbb { R } ^ { N }$ is equivalent to an $N$ -layer VAE with an approximate posterior that simply outputs the observed variables in the given order, and a generator that performs the identity function (see Figure 2).
253
+
254
+ ![](images/429b97e84b158c54e3a5b77206a9ed1bec8360e363a3a2fcb44b1bd8ede0f83b.jpg)
255
+ Figure 5: Relationship between architecture and posterior collapse. We visualize the cumulative KL divergence (or “rate”, in bits per dimension) for several different architectures across a 73 layer network on ImageNet-32. When residual connections are removed from the “res block” in the topdown path (Figure 3), the model encodes no information in the first 45 layers of the network and the loss is highest (”FFN”). When a learned convolutional upsampler is used as the “unpool” layer, the first 13 layers of the network encode no information. When nearest-neighbor upsampling is used, the first layers all encode information, and the loss is the lowest.
256
+
257
+ Without loss of generality, we simplify notation by assuming each vector-valued latent variable $z _ { i }$ only has one element, which we write as $z _ { i } \in \mathbb { R }$ . We assume a prior and approximate posterior distribution following Equation 2 and 3.
258
+
259
+ Proof. Let $q ( z _ { i } ~ = ~ x _ { i } | \boldsymbol { z } _ { < i } , \pmb { x } ) ~ = ~ 1$ , and $p ( x _ { i } ~ = ~ z _ { i } | z ) ~ = ~ 1$ . Then $p ( z | \mathbf { x } ) ~ = ~ q ( z | \mathbf { x } ) .$ , which is well-known to imply equality in the evidence lower bound (ELBO) of Eq. 1. Since $\log q ( z | \pmb { x } ) = \log p ( \pmb { x } | z ) = 0$ , the ELBO becomes $\begin{array} { r } { \log p _ { \theta } ( { \pmb x } ) = \log p _ { \theta } ( { \pmb z } ) = \sum _ { i = 1 } ^ { N } \log p _ { \theta } ( z _ { i } | z _ { < i } ) = } \end{array}$ $\textstyle \sum _ { i = 1 } ^ { N } \log p _ { \theta } ( x _ { i } | \boldsymbol { x } _ { < i } )$ , which is equivalent to an autoregressive model over the observed variables. □
260
+
261
+ # A.3 PROPOSITION 2: $N$ -LAYER VAES ARE UNIVERSAL APPROXIMATORS OF $N$ -DIMENSIONAL LATENT DENSITIES
262
+
263
+ Proposition 2 shows that hierarchical VAEs learn depthwise autoregressive flows, and under certain conditions (described in Huang et al. (2017)) can express any density over latent variables of $N$ dimensions, given enough capacity.
264
+
265
+ Proof. We omit full proof, and refer readers to Huang et al. (2017); Papamakarios et al. (2019), where universality is established for autoregressive flows. Here we only note that the prior and approximate posterior in an $N$ -layer VAE are autoregressive flows: Let $p _ { \theta } ( z )$ be the prior distribution. $p _ { \theta } ( z )$ can be written using the reparameterization trick as a deterministic function of noise $\epsilon$ drawn from a known base density $p _ { N }$ $\begin{array} { r } { \mathrm { : ~ } p _ { \theta } ( z ) = p _ { N } ( \epsilon ) \left| \operatorname* { d e t } \frac { \partial f ( \epsilon , \theta ) } { \partial \epsilon } \right| } \end{array}$ where $f$ is a neural network that implements the factorization in Eq. 2. Since $f$ is autoregressive and its Jacobian is lower triangular, $p _ { \theta } ( z )$ can approximate any $p ( z )$ that fits the criteria in Huang et al. (2017). The same logic applies to $q _ { \phi } ( \pmb { z } | \pmb { x } )$ and $p ( \boldsymbol { z } | \boldsymbol { x } )$ . It should be noted that this result depends on $f$ being able to implement the inverse CDF of an arbitrary probability density, and so using Gaussian distributions will restrict the densities the VAE can express in practice. This is a limitation of our architecture that we nevertheless adopt since we hypothesize depth, not the elementwise density, is the more important factor. More discussion on this subject, and options for removing this restriction, are described in Huang et al. (2017) and Huang et al. (2018), and we defer studying more expressive elementwise densities to future work. □
266
+
267
+ ![](images/7e09dae6c8b26c33413af8909cae34d8460058d3cb0d90a69da5245a88f01b73.jpg)
268
+ Figure 6: Effect of gradient skipping. We plot the max gradient norm encountered per 500 updates for our best models across datasets. The dashed black line indicates the “skip threshold”, or value above which the update is skipped. We choose a high threshold that affects fewer than 0.01 percent of training updates. Without this skip heuristic, networks will diverge when extreme updates are encountered. These updates can have norm as high as 1e15.
269
+
270
+ # A.4 A NOTE ON INVERSE AUTOREGRESSIVE FLOW
271
+
272
+ Inverse autoregressive flows (IAF, Kingma et al. (2016)) and are similar to very deep VAEs in that they are universal approximators of posterior distributions in VAEs, even with just a single layer and sufficiently expressive univariate density (Huang et al., 2018).
273
+
274
+ There are several practical differences between IAFs and deep hierarchical VAEs, however, which can result in qualitatively very different behavior. First, the masked autoregressive components in IAF build statistical dependencies spatially, whereas a very deep hierarchical VAE builds dependencies depthwise, and these inductive biases may better suit different domains. Additionally, IAFs spend an equal amount of computation and parameters on each variable. In contrast, a deep VAE can specify a structure, like a hierarchy of global-to-local variables, which have different computational and modeling capacities for each stage. For images, these differences may result in qualitatively different behavior, and it is not clear whether a single layer IAF can readily learn the sort of rich hierarchical decomposition of images that appear with very deep VAEs.
275
+
276
+ ![](images/9a2cf2514fc5f4994244e694282330e4fe87e41db4dfd76ac18c2226c431f90c.jpg)
277
+ Figure 7: Non-cherrypicked, temperature 1.0 samples on FFHQ-256. Cover images were each cherrypicked from a batch of 16 (unadjusted temperature) samples. Here we show a random batch of 16 images for comparison.
278
+
279
+ Nevertheless, the two techniques are complementary – IAF was introduced in a deep hierarchical VAE (Kingma et al., 2016), in fact, and it is likely that introducing IAF into our architecture (as in Vahdat & Kautz (2020)) would improve performance.
280
+
281
+ # A.5 A NOTE ON LEARNING HIERARCHICAL FEATURES
282
+
283
+ The work of Zhao et al. (2017) may appear to contradict our work, by suggesting that additional layers in hierarchical VAEs do not lead to additional expressivity, based off their finding that Gibbs sampling from the last stochastic layer is sufficient to recover the data. For high dimensional data like images, however, the last stochastic layer may have many thousands of variables, and Gibbs sampling may take unacceptably long to converge. A hierarchy of latent variables as in our model allows efficient and tractable sampling from this distribution. Additionally, assumptions regarding global maximization of the ELBO may not apply in practice. Nevertheless, we think further clarifying these contradictory statements would be useful future work.
284
+
285
+ # A.6 BROADER IMPACT
286
+
287
+ Broadly speaking, any generative model will reflect the biases of the datasets they are trained on. If deployed without careful consideration, generative models (including but not limited to VAEs) trained on research datasets like ImageNet, CIFAR-10, and FFHQ may inadvertently cause harm by propagating or otherwise reinforcing harmful biases in the dataset. Further work is required to improve and debias research benchmark datasets to mitigate this source of negative impact.
288
+
289
+ ![](images/88521efcffa76ca2cb163809b5378e9cb553c64feb9b95f38a726f99ed6eb01b.jpg)
290
+ Figure 8: Non-cherrypicked, temperature 0.85 samples on FFHQ-256. Lower temperature samples result in greater regularity in images.
291
+
292
+ Some VAEs are distinguished from other generative models by their fast synthesis of new data examples. Generative models with fast synthesis can allow for realtime synthesis of high dimensional data, such as music, speech, and video. These models could be used to augment human creativity and lead to a number of helpful applications in real-time media applications. Such models could also be used for compression, which could assist in delivering content to bandwidth-constrained regions of the world. They can also be used for spreading disinformation, generally making it less possible to distinguish real from generated data. An additional potential harm is that fast, high quality synthesis of data could end up economically displacing individuals who rely upon creative work, such as musicians, visual artists, and more.
293
+
294
+ VAEs also are distinguished by their usage of latent variables. Generative models with useful latent variables could have positive impacts in scientific domains, where density estimation could lead to novel insights about chemical, physical, or biological data. Latent variable representations of data could also be helpful in efforts to debias, interpret, or otherwise increase understandibility of models and their representations.
295
+
296
+ ![](images/9eb4b982051136045c3af64822d2096c2a1af01024e354f3f45176ef7fc9d793.jpg)
297
+ Figure 9: Non-cherrypicked, temperature 0.60 samples on FFHQ-256. We visualize temperature 0.60 samples for comparison with Vahdat & Kautz (2020)
298
+
299
+ Table 4: Key hyperparameters for experiments. We detail here the main hyperparameters used in training. FFHQ-1024 has reduced hidden size for higher resolutions; see code for details.
300
+
301
+ <table><tr><td>Parameter</td><td>CIFAR-10</td><td>ImageNet-32</td><td>ImageNet-64</td><td>FFHQ-256</td><td>FFHQ-1024</td></tr><tr><td>Num layers</td><td>45</td><td>78</td><td>75</td><td>62</td><td>72</td></tr><tr><td>Hidden size</td><td>384</td><td>512</td><td>512</td><td>512</td><td>Varies</td></tr><tr><td>Bottleneck size</td><td>96</td><td>128</td><td>128</td><td>128</td><td>Varies</td></tr><tr><td>Latent dim per layer</td><td>16</td><td>16</td><td>16</td><td>16</td><td>16</td></tr><tr><td>Batch size</td><td>32</td><td>256</td><td>128</td><td>32</td><td>32</td></tr><tr><td>Learning rate</td><td>0.0002</td><td>0.00015</td><td>0.00015</td><td>0.00015</td><td>0.00007</td></tr><tr><td>Optimizer</td><td>Adam</td><td>Adam</td><td>Adam</td><td>Adam</td><td>Adam</td></tr><tr><td>Skip threshold</td><td>400</td><td>300</td><td>380</td><td>180</td><td>500</td></tr><tr><td>Weight Decay</td><td>0.01</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td></tr><tr><td>EMA rate</td><td>0.0002</td><td>0.00015</td><td>0.00015</td><td>0.00015</td><td>0.00015</td></tr><tr><td>Training iterations</td><td>1.1M</td><td>1.7M</td><td>1.6M</td><td>1.7M</td><td>1.7M</td></tr><tr><td>GPUs</td><td>2 x V100</td><td>32 x V100</td><td>32 x V100</td><td>32 x V100</td><td>32 x V100</td></tr><tr><td>Training time</td><td>6 days</td><td>2.5 weeks</td><td>2.5 weeks</td><td>2.5 weeks</td><td>2.5 weeks</td></tr><tr><td>Parameters</td><td>39M</td><td>119M</td><td>125M</td><td>115M</td><td>115M</td></tr></table>
302
+
303
+ ![](images/51b68fcc859fd881f1bcdd2613b83b57d93e169c7975c42e686579766f63ad6d.jpg)
304
+ Figure 10: ImageNet-32 (left) and ImageNet-64 (right) reconstructions and samples. Reconstructions of validation images from various stages in the latent hierarchy (top), and unconditional samples from the model at temperature 1.0 (bottom).
305
+
306
+ ![](images/ab424ead9485c63b4e2df355415d15d4f27effcf34f691ff8f7155a58b5aeaee.jpg)
307
+ Figure 11: FFHQ-1024 samples. These are generated with reduced temperature (top) and temperature 1.0 (bottom). The model we train has similar capacity to smaller ones we use on $3 2 \mathrm { x } 3 2 $ , 64x64, and $2 5 6 \times 2 5 6$ images, and so fails to capture the intricacies of this more complex distribution well. A larger model, trained for longer, may achieve better sample quality.
parse/train/RLRXCV6DbEJ/RLRXCV6DbEJ_content_list.json ADDED
@@ -0,0 +1,1656 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "VERY DEEP VAES GENERALIZE AUTOREGRESSIVE MODELS AND CAN OUTPERFORM THEM ON IMAGES ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 176,
8
+ 98,
9
+ 823,
10
+ 147
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Rewon Child \nOpenAI \nSan Francisco, CA \nrewon@openai.com ",
17
+ "bbox": [
18
+ 184,
19
+ 170,
20
+ 343,
21
+ 226
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "ABSTRACT ",
28
+ "text_level": 1,
29
+ "bbox": [
30
+ 454,
31
+ 262,
32
+ 544,
33
+ 277
34
+ ],
35
+ "page_idx": 0
36
+ },
37
+ {
38
+ "type": "text",
39
+ "text": "We present a hierarchical VAE that, for the first time, generates samples quickly and outperforms the PixelCNN in log-likelihood on all natural image benchmarks. We begin by observing that, in theory, VAEs can actually represent autoregressive models, as well as faster, better models if they exist, when made sufficiently deep. Despite this, autoregressive models have historically outperformed VAEs in loglikelihood. We test if insufficient depth explains why by scaling a VAE to greater stochastic depth than previously explored and evaluating it CIFAR-10, ImageNet, and FFHQ. In comparison to the PixelCNN, these very deep VAEs achieve higher likelihoods, use fewer parameters, generate samples thousands of times faster, and are more easily applied to high-resolution images. Qualitative studies suggest this is because the VAE learns efficient hierarchical visual representations. We release our source code and models at https://github.com/openai/vdvae. ",
40
+ "bbox": [
41
+ 233,
42
+ 300,
43
+ 764,
44
+ 468
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "image",
50
+ "img_path": "images/f4a4d7c8e2a8203753893d6d638e3c16523969ec955ce7f35f7ebdbe3a24ffc9.jpg",
51
+ "image_caption": [
52
+ "Figure 1: Selected samples from our very deep VAE on FFHQ-256, and a demonstration of the learned generative process. VAEs can learn to first generate global features at low resolution, then fill in local details in parallel at higher resolutions. When made sufficiently deep, this learned, parallel, multiscale generative procedure attains a higher log-likelihood than the PixelCNN. "
53
+ ],
54
+ "image_footnote": [],
55
+ "bbox": [
56
+ 207,
57
+ 507,
58
+ 790,
59
+ 834
60
+ ],
61
+ "page_idx": 0
62
+ },
63
+ {
64
+ "type": "text",
65
+ "text": "1 INTRODUCTION ",
66
+ "text_level": 1,
67
+ "bbox": [
68
+ 176,
69
+ 102,
70
+ 336,
71
+ 117
72
+ ],
73
+ "page_idx": 1
74
+ },
75
+ {
76
+ "type": "text",
77
+ "text": "One potential path to increased data-efficiency, generalization, and robustness of machine learning methods is to train generative models. These models can learn useful representations without human supervision by learning to create examples of the data itself. Many types of generative models have flourished in recent years, including likelihood-based generative models, which include autoregressive models (Uria et al., 2013), variational autoencoders (VAEs) (Kingma & Welling, 2014; Rezende et al., 2014), and invertible flows (Dinh et al., 2014; 2016). Their objective, the negative log-likelihood, is equivalent to the KL divergence between the data distribution and the model distribution. A wide variety of models can be compared and assessed along this criteria, which corresponds to how well they fit the data in an information-theoretic sense. ",
78
+ "bbox": [
79
+ 174,
80
+ 136,
81
+ 825,
82
+ 261
83
+ ],
84
+ "page_idx": 1
85
+ },
86
+ {
87
+ "type": "text",
88
+ "text": "Starting with the PixelCNN (Van den Oord et al., 2016), autoregressive models have long achieved the highest log-likelihoods across many modalities, despite counterintuitive modeling assumptions. For example, although natural images are observations of latent scenes, autoregressive models learn dependencies solely between observed variables. That process can require complex function approximators that integrate long-range dependencies (Oord et al., 2016; Child et al., 2019). In contrast, VAEs and invertible flows incorporate latent variables and can thus, in principle, learn a simpler model that mirrors how images are actually generated. Despite this theoretical advantage, on the landmark ImageNet density estimation benchmark, the Gated PixelCNN still achieves higher likelihoods than all flows and VAEs, corresponding to a better fit with the data. ",
89
+ "bbox": [
90
+ 173,
91
+ 267,
92
+ 825,
93
+ 393
94
+ ],
95
+ "page_idx": 1
96
+ },
97
+ {
98
+ "type": "text",
99
+ "text": "Is the autoregressive modeling assumption actually a better inductive bias for images, or can VAEs, sufficiently improved, outperform autoregressive models? The answer has significant practical stakes, because large, compute-intensive autoregressive models (Strubell et al., 2019) are increasingly used for a variety of applications (Oord et al., 2016; Brown et al., 2020; Dhariwal et al., 2020; Chen et al., 2020). Unlike autoregressive models, latent variable models only need to learn dependencies between latent and observed variables; such models can not only support faster synthesis and higher-dimensional data, but may also do so using smaller, less powerful architectures. ",
100
+ "bbox": [
101
+ 173,
102
+ 400,
103
+ 825,
104
+ 497
105
+ ],
106
+ "page_idx": 1
107
+ },
108
+ {
109
+ "type": "text",
110
+ "text": "We start this work with a simple but (to the best of our knowledge) unstated observation: hierarchical VAEs should be able to at least match autoregressive models, because autoregressive models are equivalent to VAEs with a powerful prior and restricted approximate posterior (which merely outputs observed variables). In the worst case, VAEs should be able to replicate the functionality of autoregressive models; in the best case, they should be able to learn better latent representations, possibly with much fewer layers, if such representations exist. ",
111
+ "bbox": [
112
+ 174,
113
+ 505,
114
+ 823,
115
+ 588
116
+ ],
117
+ "page_idx": 1
118
+ },
119
+ {
120
+ "type": "text",
121
+ "text": "We formalize this observation in Section 3, showing it is only true for VAEs with more stochastic layers than previous work has explored. Then we experimentally test it on competitive natural image benchmarks. Our contributions are the following: ",
122
+ "bbox": [
123
+ 176,
124
+ 594,
125
+ 825,
126
+ 637
127
+ ],
128
+ "page_idx": 1
129
+ },
130
+ {
131
+ "type": "text",
132
+ "text": "• We provide theoretical justification for why greater depth (up to the data dimension $D$ , but also as low as some value $K \\ll D$ ) could improve VAE performance (Section 3) \n• We introduce an architecture capable of scaling past 70 layers, when previous work explored at most 30 (Section 4) \n• We verify that depth, independent of model capacity, improves log-likelihood, and allows VAEs to outperform the PixelCNN on all benchmarks (Section 5.1) \n• Compared to the PixelCNN, we show the model also uses fewer parameters, generates samples thousands of times more quickly, and can be scaled to larger images. We show evidence these qualities may emerge from the model learning an efficient hierarchical representation of images (Section 5.2) \n• We release code and models at https://github.com/openai/vdvae. ",
133
+ "bbox": [
134
+ 217,
135
+ 654,
136
+ 825,
137
+ 843
138
+ ],
139
+ "page_idx": 1
140
+ },
141
+ {
142
+ "type": "text",
143
+ "text": "2 PRELIMINARIES ",
144
+ "text_level": 1,
145
+ "bbox": [
146
+ 174,
147
+ 875,
148
+ 339,
149
+ 891
150
+ ],
151
+ "page_idx": 1
152
+ },
153
+ {
154
+ "type": "text",
155
+ "text": "We review prior work and introduce some of the basic terminology used in the field. ",
156
+ "bbox": [
157
+ 173,
158
+ 909,
159
+ 723,
160
+ 924
161
+ ],
162
+ "page_idx": 1
163
+ },
164
+ {
165
+ "type": "image",
166
+ "img_path": "images/978d91e9b0b2d07410b3d5f4bded50810f4b93ca26757aed16b0b6bc538deed2.jpg",
167
+ "image_caption": [
168
+ "Figure 2: Different possible learned generative models in a VAE. Left: A hierarchical VAE can learn an autoregressive model by using the deterministic identity function as an encoder, and learning the autoregression in the prior. Right: Learning the encoder can lead to efficient hierarchies of latent variables (black). If the bottom group of three latent variables is conditionally independent given the first, they can be generated in parallel within a single layer, potentially leading to faster sampling. "
169
+ ],
170
+ "image_footnote": [],
171
+ "bbox": [
172
+ 174,
173
+ 116,
174
+ 450,
175
+ 233
176
+ ],
177
+ "page_idx": 2
178
+ },
179
+ {
180
+ "type": "image",
181
+ "img_path": "images/0caf4b37d9530a7ef2103ac7b494241f024ed07235e80cfe215e3028a8aa1b77.jpg",
182
+ "image_caption": [],
183
+ "image_footnote": [],
184
+ "bbox": [
185
+ 588,
186
+ 118,
187
+ 802,
188
+ 234
189
+ ],
190
+ "page_idx": 2
191
+ },
192
+ {
193
+ "type": "text",
194
+ "text": "2.1 VARIATIONAL AUTOENCODERS ",
195
+ "text_level": 1,
196
+ "bbox": [
197
+ 176,
198
+ 348,
199
+ 431,
200
+ 362
201
+ ],
202
+ "page_idx": 2
203
+ },
204
+ {
205
+ "type": "text",
206
+ "text": "Variational autoencoders (Kingma & Welling, 2014; Rezende et al., 2014) consist of a generator $p _ { \\theta } ( { \\pmb x } | { \\pmb z } )$ , a prior $p _ { \\theta } ( z )$ , and an approximate posterior $q _ { \\phi } ( \\mathbf { z } | \\mathbf { x } )$ . Neural networks $\\phi$ and $\\theta$ are trained end-to-end with backpropagation and the reparameterization trick in order to maximize the evidence lower bound (ELBO): ",
207
+ "bbox": [
208
+ 173,
209
+ 372,
210
+ 825,
211
+ 430
212
+ ],
213
+ "page_idx": 2
214
+ },
215
+ {
216
+ "type": "equation",
217
+ "img_path": "images/d50c425394d1fd52f47d6b7d2fb0e652a2a89da8480b4c0d5442cec3aafb4b87.jpg",
218
+ "text": "$$\n\\begin{array} { r } { \\log p _ { \\theta } ( \\mathbf { x } ) \\geq E _ { \\mathbf { z } \\sim q _ { \\phi } ( \\mathbf { z } | \\mathbf { x } ) } \\log p _ { \\theta } ( \\mathbf { x } | \\mathbf { z } ) - D _ { K L } [ q _ { \\phi } ( \\mathbf { z } | \\mathbf { x } ) | | p _ { \\theta } ( \\mathbf { z } ) ] } \\end{array}\n$$",
219
+ "text_format": "latex",
220
+ "bbox": [
221
+ 300,
222
+ 449,
223
+ 699,
224
+ 468
225
+ ],
226
+ "page_idx": 2
227
+ },
228
+ {
229
+ "type": "text",
230
+ "text": "See Kingma & Welling (2019) for an in-depth introduction. There are many choices for what networks are used for $p _ { \\theta } ( { \\pmb x } | { \\pmb z } )$ , $q _ { \\phi } ( \\pmb { z } | \\pmb { x } )$ , and whether $p _ { \\theta } ( z )$ is also learned or set to a simple distribution. ",
231
+ "bbox": [
232
+ 178,
233
+ 477,
234
+ 820,
235
+ 520
236
+ ],
237
+ "page_idx": 2
238
+ },
239
+ {
240
+ "type": "text",
241
+ "text": "We study VAEs with independent $p _ { \\theta } ( { \\pmb x } | { \\pmb z } )$ – that is, where each observed $x _ { i }$ is output without conditioning on any other $x _ { j }$ . This ensures generation time does not increase linearly with the dimensionality of the data, and requires that these VAEs learn to incorporate the complexity of the data into a rich distribution over latent variables $_ { z }$ . It is possible to have autoregressive $p _ { \\theta } ( { \\pmb x } | { \\pmb z } )$ (Gulrajani et al., 2016), but generation is slow for these models. They also sometimes ignore latent variables entirely, becoming equivalent to normal autoregressive models (Chen et al. (2016)). ",
242
+ "bbox": [
243
+ 173,
244
+ 526,
245
+ 825,
246
+ 611
247
+ ],
248
+ "page_idx": 2
249
+ },
250
+ {
251
+ "type": "text",
252
+ "text": "2.2 HIERARCHICAL VARIATIONAL AUTOENCODERS ",
253
+ "text_level": 1,
254
+ "bbox": [
255
+ 174,
256
+ 627,
257
+ 545,
258
+ 642
259
+ ],
260
+ "page_idx": 2
261
+ },
262
+ {
263
+ "type": "text",
264
+ "text": "Much of the early work on VAEs incorporate fully-factorized Gaussian $q _ { \\phi } ( \\pmb { z } | \\pmb { x } )$ and $p _ { \\theta } ( z )$ . This can lead to poor outcomes if the latent variables required for good generation take on a more complex distribution, as is common with independent $p _ { \\theta } ( \\pmb { x } | \\pmb { z } )$ . One of the simplest methods of gaining greater expressivity in both distributions is to use a hierarchical VAE, which has several stochastic layers of latent variables. These variables are emitted in groups $z _ { 0 } , z _ { 1 } , . . . , z _ { N }$ , which are conditionally dependent upon each other in some way. For images, latent variables are typically output in feature maps of varying resolutions, with $z _ { \\mathrm { 0 } }$ corresponding to a small number of latent variables at low resolution at the “top” of the network, and $z _ { N }$ corresponding to a larger number of latent variables at high resolution at the “bottom”. ",
265
+ "bbox": [
266
+ 173,
267
+ 652,
268
+ 825,
269
+ 780
270
+ ],
271
+ "page_idx": 2
272
+ },
273
+ {
274
+ "type": "text",
275
+ "text": "One particularly elegant conditioning structure is the top-down $V A E$ , introduced in Sønderby et al. (2016). In this model, both the prior and the approximate posterior generate latent variables in the same order: ",
276
+ "bbox": [
277
+ 176,
278
+ 785,
279
+ 823,
280
+ 828
281
+ ],
282
+ "page_idx": 2
283
+ },
284
+ {
285
+ "type": "equation",
286
+ "img_path": "images/1383cbc638f3671885dcb578f0c17ad57ba286945313d824f2268f7a27c40c21.jpg",
287
+ "text": "$$\n\\begin{array} { c } { { p _ { \\theta } ( z ) = p _ { \\theta } ( z _ { 0 } ) p _ { \\theta } ( z _ { 1 } | z _ { 0 } ) . . . p _ { \\theta } ( z _ { N } | z _ { < N } ) } } \\\\ { { q _ { \\phi } ( z | x ) = q _ { \\phi } ( z _ { 0 } | x ) q _ { \\phi } ( z _ { 1 } | z _ { 0 } , x ) . . . q _ { \\phi } ( z _ { N } | z _ { < N } , x ) } } \\end{array}\n$$",
288
+ "text_format": "latex",
289
+ "bbox": [
290
+ 328,
291
+ 845,
292
+ 671,
293
+ 888
294
+ ],
295
+ "page_idx": 2
296
+ },
297
+ {
298
+ "type": "text",
299
+ "text": "A diagram of this process appears in Figure 3. A typical implementation of this model has $\\phi$ first perform a deterministic “bottom-up” pass on the data to generate features, then processes the groups of latent variables from top to bottom, using feedforward networks to generate features which are shared between the approximate posterior, prior, and reconstruction network $p _ { \\theta } ( { \\pmb x } | { \\pmb z } )$ . We adopt this base architecture as it is simple, empirically effective, and has been postulated to resemble biological processes of perception (Dayan et al., 1995). ",
300
+ "bbox": [
301
+ 173,
302
+ 895,
303
+ 823,
304
+ 924
305
+ ],
306
+ "page_idx": 2
307
+ },
308
+ {
309
+ "type": "image",
310
+ "img_path": "images/9bafeb21f3d1caf08b8236dd3e4bff05f41587b63c3862486162cb94cc0390cf.jpg",
311
+ "image_caption": [
312
+ "Figure 3: A diagram of our top-down VAE architecture. Residual blocks are similar to bottleneck ResNet blocks (He et al., 2016). Each convolution is preceded by the GELU nonlinearity (Hendrycks & Gimpel, 2016). $q _ { \\phi } ( . )$ and $p _ { \\theta } ( . )$ are diagonal Gaussian distributions. $\\mathbf { z }$ is sampled from $\\dot { q } _ { \\phi } ( . )$ during training, and $p _ { \\theta } ( . )$ when sampling. We use average pooling and nearest-neighbor upsampling for pool and unpool layers. "
313
+ ],
314
+ "image_footnote": [],
315
+ "bbox": [
316
+ 178,
317
+ 99,
318
+ 821,
319
+ 440
320
+ ],
321
+ "page_idx": 3
322
+ },
323
+ {
324
+ "type": "text",
325
+ "text": "",
326
+ "bbox": [
327
+ 174,
328
+ 549,
329
+ 825,
330
+ 604
331
+ ],
332
+ "page_idx": 3
333
+ },
334
+ {
335
+ "type": "text",
336
+ "text": "3 WHY DEPTH MATTERS FOR HIERARCHICAL VAES ",
337
+ "text_level": 1,
338
+ "bbox": [
339
+ 174,
340
+ 626,
341
+ 619,
342
+ 641
343
+ ],
344
+ "page_idx": 3
345
+ },
346
+ {
347
+ "type": "text",
348
+ "text": "We find that hierarchical VAEs with sufficient depth can not only learn arbitrary orderings over observed variables, but also learn more effective latent variable distributions, if such distributions exist. We present these results below. ",
349
+ "bbox": [
350
+ 176,
351
+ 655,
352
+ 823,
353
+ 698
354
+ ],
355
+ "page_idx": 3
356
+ },
357
+ {
358
+ "type": "text",
359
+ "text": "Definition ( $N$ -layer VAE). A deep hierarchical VAE with $N$ stochastic layers, independent $p ( { \\pmb x } | z )$ , and the top-down factorization of the prior and approximate posterior in Equations 2-3. ",
360
+ "bbox": [
361
+ 171,
362
+ 702,
363
+ 823,
364
+ 729
365
+ ],
366
+ "page_idx": 3
367
+ },
368
+ {
369
+ "type": "text",
370
+ "text": "Proposition 1. N-layer VAEs generalize autoregressive models when N is the data dimension ",
371
+ "bbox": [
372
+ 178,
373
+ 733,
374
+ 787,
375
+ 748
376
+ ],
377
+ "page_idx": 3
378
+ },
379
+ {
380
+ "type": "text",
381
+ "text": "Proposition 2. $N$ -layer VAEs are universal approximators of $N$ -dimensional latent densities ",
382
+ "bbox": [
383
+ 176,
384
+ 751,
385
+ 787,
386
+ 767
387
+ ],
388
+ "page_idx": 3
389
+ },
390
+ {
391
+ "type": "text",
392
+ "text": "Proposition 1 (proof in Appendix, also visualized in Figure 2, left) leads to a possible explanation of why autoregressive models to date have outperformed VAEs: they are deeper, in the sense of statistical dependence. A VAE must be as deep as the data dimension $D$ (3072 layers in the case of $3 2 \\mathrm { x } 3 2$ images) if the images truly require $D$ steps to generate. ",
393
+ "bbox": [
394
+ 174,
395
+ 776,
396
+ 825,
397
+ 833
398
+ ],
399
+ "page_idx": 3
400
+ },
401
+ {
402
+ "type": "text",
403
+ "text": "Luckily, however, Proposition 2 (proof and further technical requirements in Appendix) suggests that shorter procedures, if they exist, are also learnable. $N = D$ is an extreme case, where the most effective latent variables $z \\in \\mathbb { R } ^ { D }$ may simply be copies of the observed variables. But if for some $K < D$ there exist latent variables $z \\in \\mathbb { R } ^ { K }$ that the generator can use to more efficiently compress the data, Proposition 2 states a $K$ -layer VAE can learn the posterior and prior distribution over those variables. ",
404
+ "bbox": [
405
+ 173,
406
+ 840,
407
+ 825,
408
+ 922
409
+ ],
410
+ "page_idx": 3
411
+ },
412
+ {
413
+ "type": "text",
414
+ "text": "Such shorter generative paths could emerge in two ways. First, as depicted in Figure 2 (right), if the model discovers that certain variables are conditionally independent given others, the model can generate them in parallel inside a single layer, where $\\begin{array} { r } { q _ { \\phi } ( z _ { N } \\vert z _ { < N } , \\pmb { x } ) = \\prod _ { d } q _ { \\phi } ( z _ { N } ^ { ( d ) } \\vert z _ { < N } , \\pmb { x } ) } \\end{array}$ . We hypothesize these efficient hierarchies should emerge in images, as they contain many spatially independent textures, and study this in Section 5.2. Second, the model could learn a low-dimensional representation of the data. Dai & Wipf (2019) recently showed that when a VAE is trained on data distributed on a $K$ -dimensional manifold embedded in $\\mathbb { R } ^ { D }$ , a VAE will only activate $K$ dimensions in its latent space, meaning that the VAE will require fewer layers unless the manifold dimension is $D$ , which is unlikely to be the case for images. ",
415
+ "bbox": [
416
+ 174,
417
+ 103,
418
+ 825,
419
+ 232
420
+ ],
421
+ "page_idx": 4
422
+ },
423
+ {
424
+ "type": "text",
425
+ "text": "It is difficult to ascertain the lowest possible value of $K$ for a given dataset, but it may be deeper than most hierarchical VAEs to date. Images have many thousands of observed variables, but early hierarchical VAEs did not exceed 3 layers, until Maaløe et al. (2019) investigated a Gaussian VAE with 15 layers and found it displayed impressive performance along a variety of measures. Kingma et al. (2016) and Vahdat & Kautz (2020) additionally explored networks up to 12 and 30 layers. (These additionally incorporated additional statistical dependencies in the approximate posterior through the usage of inverse autoregressive flow (Kingma et al., 2016), an alternative approach which we contrast with our approach in Section A.4). Nevertheless, given these results we hypothesize that greater depth may improve the performance of VAEs. In the next section, we introduce an architecture capable of scaling to a greater number of stochastic layers. In Section 5.1 we show depth indeed improves performance. ",
426
+ "bbox": [
427
+ 173,
428
+ 239,
429
+ 825,
430
+ 391
431
+ ],
432
+ "page_idx": 4
433
+ },
434
+ {
435
+ "type": "text",
436
+ "text": "4 AN ARCHITECTURE FOR VERY DEEP VAES ",
437
+ "text_level": 1,
438
+ "bbox": [
439
+ 174,
440
+ 412,
441
+ 560,
442
+ 428
443
+ ],
444
+ "page_idx": 4
445
+ },
446
+ {
447
+ "type": "text",
448
+ "text": "We consider a “very deep” VAE to simply be one with greater depth than has previously been explored (and do not define it to be a specific number of layers). As existing implementations of VAEs did not support many more stochastic layers than they were trained on, we reimplemented a minimal VAE with the sole aim of increasing the number of stochastic layers. This VAE consists only of convolutions, nonlinearities, and Gaussian stochastic layers. It does not exhibit posterior collapse even for large numbers of stochastic layers. We describe key architectural choices here and refer readers to our source code for more details. ",
449
+ "bbox": [
450
+ 174,
451
+ 444,
452
+ 825,
453
+ 541
454
+ ],
455
+ "page_idx": 4
456
+ },
457
+ {
458
+ "type": "text",
459
+ "text": "4.1 ARCHITECTURAL COMPONENTS AND INITIALIZATION ",
460
+ "text_level": 1,
461
+ "bbox": [
462
+ 174,
463
+ 559,
464
+ 584,
465
+ 573
466
+ ],
467
+ "page_idx": 4
468
+ },
469
+ {
470
+ "type": "text",
471
+ "text": "A diagram of our network appears in Figure 3. It resembles the ResNet VAE in Kingma et al. (2016), but with bottleneck residual blocks. For each stochastic layer, the prior and posterior are diagonal Gaussian distributions, as used in prior work (Maaløe et al., 2019). ",
472
+ "bbox": [
473
+ 174,
474
+ 584,
475
+ 825,
476
+ 626
477
+ ],
478
+ "page_idx": 4
479
+ },
480
+ {
481
+ "type": "text",
482
+ "text": "As an alternative to weight normalization and data-dependent initialization (Salimans & Kingma, 2016), we adopt the default PyTorch weight intialization. The one exception is the final convolutional layer in each residual bottleneck block, which we scale by $\\scriptstyle { \\frac { 1 } { \\sqrt { N } } }$ , where $_ \\mathrm { N }$ is the depth (similar to Radford et al. (2019); Child et al. (2019); Zhang et al. (2019)). This residual scaling improves stability and performance with many layers, as we show in the Appendix (Table 3). ",
483
+ "bbox": [
484
+ 174,
485
+ 633,
486
+ 823,
487
+ 707
488
+ ],
489
+ "page_idx": 4
490
+ },
491
+ {
492
+ "type": "text",
493
+ "text": "Additionally, we use nearest-neighbor upsampling for our “unpool” layer, which when paired with our ResNet architecture, allows us to completely remove the “free bits” and KL “warming up” terms that appear in related work. As we detail in the Appendix (Figure 5), when upsampling is done through transposed convolutional layer, the network may ignore layers at low resolution (for instance, 1x1 or 4x4 layers). We found no evidence of posterior collapse in any networks trained with nearest neighbor interpolation. ",
494
+ "bbox": [
495
+ 174,
496
+ 713,
497
+ 825,
498
+ 796
499
+ ],
500
+ "page_idx": 4
501
+ },
502
+ {
503
+ "type": "text",
504
+ "text": "4.2 STABILIZING TRAINING WITH GRADIENT SKIPPING ",
505
+ "text_level": 1,
506
+ "bbox": [
507
+ 174,
508
+ 815,
509
+ 566,
510
+ 828
511
+ ],
512
+ "page_idx": 4
513
+ },
514
+ {
515
+ "type": "text",
516
+ "text": "VAEs have notorious “optimization difficulties,” which are not frequently discussed in the literature but nevertheless well-known by practitioners. These manifest as extremely high reconstruction or KL losses and corresponding large gradient norms (up to 1e15). We address this by skipping updates with a gradient norm above a certain threshold, set by hyperparameter. Though we select high thresholds that affect fewer than $0 . 0 1 \\%$ of updates, this technique almost entirely eliminates divergence, and allows networks to train smoothly. We plot the evolution of grad norms and the values we select in (Figure 6). An alternative approach to stabilizing networks may be the spectral regularization method introduced in Vahdat & Kautz (2020). ",
517
+ "bbox": [
518
+ 174,
519
+ 839,
520
+ 823,
521
+ 922
522
+ ],
523
+ "page_idx": 4
524
+ },
525
+ {
526
+ "type": "table",
527
+ "img_path": "images/a3a24d8f559f8087b24fe077bd8dd960946838ecfca4bb27ea1288d46def7c6f.jpg",
528
+ "table_caption": [
529
+ "Table 1: Loss by network with different configurations of stochastic layers on ImageNet-32 (similar trends appear on CIFAR-10). Left: Networks with equal number of layers, but with lower stochastic depth as described in Section 5.1. Increasing depth up to 48 layers still shows gains, which is farther than previous work has explored. Right: Networks with 48 layers, but distributed at different resolutions. We find higher resolutions benefit more from layers. "
530
+ ],
531
+ "table_footnote": [],
532
+ "table_body": "<table><tr><td>Depth</td><td>Params</td><td>Test Loss</td><td colspan=\"5\">Distribution of 48 layers</td><td rowspan=\"2\">Test Loss</td></tr><tr><td>3</td><td>41M</td><td>4.30</td><td>32x32</td><td>2 16x16</td><td>8x8</td><td>4x4</td><td>1x1</td></tr><tr><td>6</td><td>41M</td><td>4.18</td><td>10</td><td>10</td><td>10</td><td>10</td><td>8</td><td>3.98</td></tr><tr><td>12</td><td>41M</td><td>4.06</td><td>12</td><td>12</td><td>10</td><td>8</td><td>6</td><td>3.97</td></tr><tr><td>24</td><td>41M</td><td>3.98</td><td>14</td><td>14</td><td>10</td><td>6</td><td>4</td><td>3.96</td></tr><tr><td>48</td><td>41M</td><td>3.95</td><td>16</td><td>16</td><td>10</td><td>4</td><td>2</td><td>3.95</td></tr></table>",
533
+ "bbox": [
534
+ 196,
535
+ 181,
536
+ 799,
537
+ 270
538
+ ],
539
+ "page_idx": 5
540
+ },
541
+ {
542
+ "type": "text",
543
+ "text": "",
544
+ "bbox": [
545
+ 174,
546
+ 299,
547
+ 823,
548
+ 328
549
+ ],
550
+ "page_idx": 5
551
+ },
552
+ {
553
+ "type": "text",
554
+ "text": "5 EXPERIMENTS ",
555
+ "text_level": 1,
556
+ "bbox": [
557
+ 176,
558
+ 353,
559
+ 326,
560
+ 369
561
+ ],
562
+ "page_idx": 5
563
+ },
564
+ {
565
+ "type": "text",
566
+ "text": "We trained very deep VAEs on challenging natural image datasets. All hyperparameters for experiments are available in the Appendix and in our source code. ",
567
+ "bbox": [
568
+ 173,
569
+ 388,
570
+ 823,
571
+ 416
572
+ ],
573
+ "page_idx": 5
574
+ },
575
+ {
576
+ "type": "text",
577
+ "text": "5.1 STATISTICAL DEPTH, INDEPENDENT OF CAPACITY, IMPROVES PERFORMANCE ",
578
+ "text_level": 1,
579
+ "bbox": [
580
+ 176,
581
+ 441,
582
+ 745,
583
+ 455
584
+ ],
585
+ "page_idx": 5
586
+ },
587
+ {
588
+ "type": "text",
589
+ "text": "We first tested whether greater statistical depth, independent of other factors, can result in improved performance. We trained a network with 48 layers for 600k steps on ImageNet-32, grouping layers to output variables independently instead of conditioning on each other. If the input for the ith topdown block is $x _ { i }$ , we can make $K$ consecutive blocks independent by setting $x _ { i + 1 } , . . . , x _ { i + K }$ all equal to $x _ { i }$ . (Normally, $x _ { i + 1 } = x _ { i } + f ( \\mathrm { b l o c k } ( x _ { i } ) ) )$ . This technique reduces the stochastic depth without affecting parameter count. Stochastic depth shows a clear correlation with performance, even up to 48 layers, which is past what previous work has explored (Table 1, left). ",
590
+ "bbox": [
591
+ 174,
592
+ 468,
593
+ 825,
594
+ 566
595
+ ],
596
+ "page_idx": 5
597
+ },
598
+ {
599
+ "type": "text",
600
+ "text": "We then tested our hypothesis at scale. We trained networks on CIFAR-10, ImageNet-32, and ImageNet-64 with greater numbers of stochastic layers, but with fewer parameters than related work (see Table 2). On CIFAR-10, we trained a model with 45 stochastic layers and only 39M parameters, and found it achieved a test log-likelihood of 2.87 bits per dim (average of 4 seeds). On ImageNet32 and ImageNet-64, we trained networks with 78 and 75 stochastic layers and only approximately 120M parameters, and achieved likelihoods of 3.80 and 3.52. ",
601
+ "bbox": [
602
+ 174,
603
+ 573,
604
+ 825,
605
+ 656
606
+ ],
607
+ "page_idx": 5
608
+ },
609
+ {
610
+ "type": "text",
611
+ "text": "On all tasks, these results outperform all GatedPixelCNN/PixelCNN $^ { + + }$ models, and all nonautoregressive models, while using similar or fewer parameters. These results support our hypothesis that stochastic depth, as opposed to other factors, explains the gap between VAEs and autoregressive models. ",
612
+ "bbox": [
613
+ 176,
614
+ 664,
615
+ 823,
616
+ 719
617
+ ],
618
+ "page_idx": 5
619
+ },
620
+ {
621
+ "type": "text",
622
+ "text": "5.2 VERY DEEP VAES LEARN AN EFFICIENT HIERARCHICAL ORDERING ",
623
+ "text_level": 1,
624
+ "bbox": [
625
+ 176,
626
+ 743,
627
+ 679,
628
+ 757
629
+ ],
630
+ "page_idx": 5
631
+ },
632
+ {
633
+ "type": "text",
634
+ "text": "One question that emerges from the analysis in Section 3 is whether VAEs need to be as deep as autoregressive models, or whether they can learn a latent hierarchy of conditionally independent variables which are able to be synthesized in parallel. We qualitatively show this is true in Figure 4. For FFHQ-256 images, the first several layers at low resolution almost wholly determine the global features of the image, even though they only account for less than $1 \\%$ of the latent variables. The rest of the high-resolution variables appear to be spatially independent, meaning they can be emitted in parallel in a number of layers much lower than the dimensionality of the image. This efficient hierarchical representation may underlie the VAE’s ability to achieve better log-likelihoods than the PixelCNN while simultaneously sampling thousands of times faster. This can be viewed as a learned parallel multiscale generation method, unlike the handcrafted approaches of Kolesnikov & Lampert (2017); Menick & Kalchbrenner (2018); Reed et al. (2017). ",
635
+ "bbox": [
636
+ 174,
637
+ 770,
638
+ 825,
639
+ 924
640
+ ],
641
+ "page_idx": 5
642
+ },
643
+ {
644
+ "type": "image",
645
+ "img_path": "images/dca6cb513c7699bcfea1e81769ad770540f18bec0843d20878e2d88cee72da6a.jpg",
646
+ "image_caption": [
647
+ "Figure 4: Cumulative percentage of latent variables at a given resolution, and reconstructions of samples on FFHQ-256. We sample latent variables from the approximate posterior until the given resolution, and sample the rest from the prior at low temperature. This shows what images are likely given a subset of latent variables. Low-resolution latents comprise a small fraction of the total latents, but encode significant portions of the global structure. This suggests deep VAEs learn efficient, hierarchical representations of the data. "
648
+ ],
649
+ "image_footnote": [],
650
+ "bbox": [
651
+ 173,
652
+ 101,
653
+ 825,
654
+ 279
655
+ ],
656
+ "page_idx": 6
657
+ },
658
+ {
659
+ "type": "text",
660
+ "text": "Additionally, we found that on all datasets we tested, very deep VAEs used roughly $30 \\%$ fewer parameters than the PixelCNN (Table 2). One possible explanation is that the learned hierarchical generation procedure involves fewer long-range dependencies, or may otherwise be simpler to learn. ",
661
+ "bbox": [
662
+ 176,
663
+ 409,
664
+ 825,
665
+ 452
666
+ ],
667
+ "page_idx": 6
668
+ },
669
+ {
670
+ "type": "text",
671
+ "text": "We found that networks in general benefited from more layers at higher resolutions (Table 1, right). This suggests that global features may account for a smaller fraction of information than local details and textures, and that it is important to have many latent variables at high resolution. ",
672
+ "bbox": [
673
+ 176,
674
+ 458,
675
+ 825,
676
+ 501
677
+ ],
678
+ "page_idx": 6
679
+ },
680
+ {
681
+ "type": "text",
682
+ "text": "5.2.1 VERY DEEP VAES ARE EASILY SCALED TO HIGH DIMENSIONAL DATA ",
683
+ "text_level": 1,
684
+ "bbox": [
685
+ 174,
686
+ 522,
687
+ 705,
688
+ 536
689
+ ],
690
+ "page_idx": 6
691
+ },
692
+ {
693
+ "type": "text",
694
+ "text": "Scaling autoregressive models to higher resolutions presents several challenges. First, the sampling time and memory requirements of autoregressive models increase linearly with resolution. This scaling makes datasets like FFHQ-256 and FFHQ-1024 intractable for naive approaches. Although clever factorization techniques have been adopted for $2 5 6 \\mathrm { x } 2 5 6$ images (Menick & Kalchbrenner, 2018), such factorizations may not be as effective for alternate datasets or higher-resolution images. ",
695
+ "bbox": [
696
+ 174,
697
+ 549,
698
+ 825,
699
+ 618
700
+ ],
701
+ "page_idx": 6
702
+ },
703
+ {
704
+ "type": "text",
705
+ "text": "Our VAE, in contrast, readily scales to higher resolutions. The same network used for $3 2 \\mathrm { x } 3 2 $ images can be applied to 1024x1024 images by introducing a greater number of upsampling layers throughout the network. We found we could train an equal number of steps (1.5M) using a similar number of training resources (32 GPUs for 2.5 weeks) on both $3 2 \\mathrm { x } 3 2 $ and 1024x1024 images with few hyperparameter changes (see Appendix for hyperparameters). Samples from both models (displayed in Appendix) require a single forward pass of the model to generate, with only minor differences in runtime. An autoregressive model, on the other hand, would require a thousand times more network evaluations to sample 1024x1024 images and likely require a custom training procedure. ",
706
+ "bbox": [
707
+ 174,
708
+ 625,
709
+ 825,
710
+ 737
711
+ ],
712
+ "page_idx": 6
713
+ },
714
+ {
715
+ "type": "text",
716
+ "text": "6 RELATED WORK AND DISCUSSION ",
717
+ "text_level": 1,
718
+ "bbox": [
719
+ 174,
720
+ 763,
721
+ 490,
722
+ 779
723
+ ],
724
+ "page_idx": 6
725
+ },
726
+ {
727
+ "type": "text",
728
+ "text": "Our work is inspired by previous and concurrent work in hierarchical VAEs (Sønderby et al., 2016; Maaløe et al., 2019; Vahdat & Kautz, 2020). Relative to these works, we provide some justification for why deeper networks may perform better, introduce a new architecture, and empirically demonstrate gains in log-likelihood. Many aspects of prior work are complementary with ours and could be combined. Maaløe et al. (2019), for instance, incorporates a “bottom-up” stochastic path that doubles the depth of the approximate posterior, and Vahdat & Kautz (2020) introduces a number of powerful architecture components and improved training techniques. We seek here not to introduce a significantly better method than these alternatives, but to demonstrate that depth is a key overlooked factor in most prior approaches to VAEs. ",
729
+ "bbox": [
730
+ 174,
731
+ 797,
732
+ 825,
733
+ 924
734
+ ],
735
+ "page_idx": 6
736
+ },
737
+ {
738
+ "type": "text",
739
+ "text": "Table 2: Our main results on standard benchmark datasets. Very deep VAEs outperform PixelCNN-based autoregressive models with fewer parameters while maintaining fast sampling. “Depth” refers to the number of stochastic layers for hierarchical VAEs (although BIVA and IAFbased networks have additional statistical dependencies). Sampling refers to the number of network evaluations per sample, and $D$ designates the dimensionality of the data. An asterisk $( ^ { * } )$ denotes our estimate of parameters. Samples for ImageNet and CIFAR-10 are in the Appendix. ",
740
+ "bbox": [
741
+ 173,
742
+ 101,
743
+ 825,
744
+ 185
745
+ ],
746
+ "page_idx": 7
747
+ },
748
+ {
749
+ "type": "table",
750
+ "img_path": "images/1beb75946c96c9c4ef5684516023f4ebf89a00ada09dee2ec09590cd4ef1f8c8.jpg",
751
+ "table_caption": [],
752
+ "table_footnote": [],
753
+ "table_body": "<table><tr><td></td><td>Model type</td><td>Params</td><td>Depth</td><td>Sampling</td><td>NLL</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>CIFAR-10 PixelCNN++ (Salimans et al., 2017)</td><td>AR</td><td>53M*</td><td></td><td>D</td><td>2.92</td></tr><tr><td>PixelSNAIL (Chen et al., 2017)</td><td>AR</td><td></td><td></td><td>D</td><td>2.85</td></tr><tr><td>Sparse Transformer (Child et al.,2019)</td><td>AR</td><td>59M</td><td></td><td>D</td><td>2.80</td></tr><tr><td></td><td>VAE</td><td></td><td></td><td></td><td></td></tr><tr><td>VLAE (Chen et al., 2016)</td><td>VAE</td><td></td><td>12</td><td>D</td><td>≤2.95</td></tr><tr><td>IAF-VAE (Kingma et al., 2016) Flow++ (Ho et al.,2019)</td><td>Flow</td><td>31M</td><td></td><td>1</td><td>≤3.11</td></tr><tr><td>BIVA (Maalpe et al.,2019)</td><td>VAE</td><td>103M</td><td>15</td><td>1</td><td>≤3.08</td></tr><tr><td></td><td></td><td></td><td></td><td>1</td><td>≤3.08</td></tr><tr><td>NVAE (Vahdat &amp; Kautz, 2020) Very Deep VAE (ours)</td><td>VAE VAE</td><td>131M 39M</td><td>30 45</td><td>1 1</td><td>≤ 2.91 ≤ 2.87</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>ImageNet-32 Gated PixelCNN</td><td>AR</td><td>177M*</td><td>10</td><td></td><td></td></tr><tr><td>Image Transformer (Parmar et al., 2018)</td><td>AR</td><td></td><td></td><td>D</td><td>3.83</td></tr><tr><td>BIVA</td><td>VAE</td><td>103M*</td><td>15</td><td>D</td><td>3.77</td></tr><tr><td>NVAE</td><td></td><td>268M</td><td>28</td><td>1</td><td>≤3.96</td></tr><tr><td>Flow++</td><td>VAE</td><td>169M</td><td></td><td>1</td><td>≤3.92</td></tr><tr><td>Very Deep VAE (ours)</td><td>Flow VAE</td><td>119M</td><td>78</td><td>1 1</td><td>≤3.86 ≤3.80</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>ImageNet-64 Gated PixelCNN</td><td></td><td>177M*</td><td></td><td></td><td></td></tr><tr><td>SPN (Menick &amp; Kalchbrenner, 2018)</td><td>AR AR</td><td>150M</td><td></td><td>D</td><td>3.57</td></tr><tr><td>Sparse Transformer</td><td>AR</td><td>152M</td><td></td><td>D</td><td>3.52</td></tr><tr><td>Glow (Kingma &amp; Dhariwal, 2018)</td><td>Flow</td><td></td><td></td><td>D</td><td>3.44</td></tr><tr><td>Flow++</td><td></td><td>73M</td><td></td><td>1</td><td>3.81</td></tr><tr><td>Very Deep VAE (ours)</td><td>Flow VAE</td><td>125M</td><td>75</td><td>1</td><td>≤3.69</td></tr><tr><td></td><td></td><td></td><td></td><td>1</td><td>≤3.52</td></tr><tr><td>FFHQ-256 (5 bit)</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>NVAE</td><td>VAE</td><td></td><td>36</td><td>1</td><td>≤0.68</td></tr><tr><td>Very Deep VAE (ours)</td><td>VAE</td><td>115M</td><td>62</td><td>1</td><td>≤0.61</td></tr><tr><td>FFHQ-1024 (8 bit)</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Very Deep VAE (ours)</td><td>VAE</td><td>115M</td><td>72</td><td>1</td><td>≤ 2.42</td></tr></table>",
754
+ "bbox": [
755
+ 179,
756
+ 194,
757
+ 825,
758
+ 686
759
+ ],
760
+ "page_idx": 7
761
+ },
762
+ {
763
+ "type": "text",
764
+ "text": "Diffusion models can be seen as deep VAEs that, like autoregressive models, have a specific analytical posterior. Ho et al. (2020) showed that such models achieve impressive sample quality with great depth, which is in line with our observations that greater depth is helpful for VAEs. One benefit of the VAEs we outline in this work over diffusion models is that our VAEs generate samples with a single network evaluation, whereas diffusion models currently require a large number of network evaluations per sample. ",
765
+ "bbox": [
766
+ 173,
767
+ 790,
768
+ 825,
769
+ 875
770
+ ],
771
+ "page_idx": 7
772
+ },
773
+ {
774
+ "type": "text",
775
+ "text": "Inverse autoregressive flows (IAF) are also closely related, and we discuss the differences with hierarchical models in Section A.4. The work of Zhao et al. (2017) may also appear to contradict our findings, and we discuss that work in Section A.5. ",
776
+ "bbox": [
777
+ 176,
778
+ 882,
779
+ 823,
780
+ 924
781
+ ],
782
+ "page_idx": 7
783
+ },
784
+ {
785
+ "type": "text",
786
+ "text": "7 CONCLUSION ",
787
+ "text_level": 1,
788
+ "bbox": [
789
+ 176,
790
+ 102,
791
+ 318,
792
+ 118
793
+ ],
794
+ "page_idx": 8
795
+ },
796
+ {
797
+ "type": "text",
798
+ "text": "We argue deeper VAEs should perform better, introduce a deeper architecture, and show it outperforms all PixelCNN-based autoregressive models in likelihood while being more efficient. We hope this encourages work in further improving VAEs and latent variable models. ",
799
+ "bbox": [
800
+ 174,
801
+ 133,
802
+ 825,
803
+ 176
804
+ ],
805
+ "page_idx": 8
806
+ },
807
+ {
808
+ "type": "text",
809
+ "text": "ACKNOWLEDGMENTS ",
810
+ "text_level": 1,
811
+ "bbox": [
812
+ 176,
813
+ 193,
814
+ 326,
815
+ 207
816
+ ],
817
+ "page_idx": 8
818
+ },
819
+ {
820
+ "type": "text",
821
+ "text": "We thank Aditya Ramesh, Pranav Shyam, Johannes Otterbach, Heewoo Jun, Mark Chen, Prafulla Dhariwal, Alec Radford, Yura Burda, Bowen Baker, Raul Puri, and Ilya Sutskever for helpful discussions. We also thank the anonymous reviewers for helping improve our work. ",
822
+ "bbox": [
823
+ 174,
824
+ 217,
825
+ 823,
826
+ 258
827
+ ],
828
+ "page_idx": 8
829
+ },
830
+ {
831
+ "type": "text",
832
+ "text": "REFERENCES ",
833
+ "text_level": 1,
834
+ "bbox": [
835
+ 176,
836
+ 280,
837
+ 285,
838
+ 296
839
+ ],
840
+ "page_idx": 8
841
+ },
842
+ {
843
+ "type": "text",
844
+ "text": "Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020. ",
845
+ "bbox": [
846
+ 176,
847
+ 304,
848
+ 823,
849
+ 347
850
+ ],
851
+ "page_idx": 8
852
+ },
853
+ {
854
+ "type": "text",
855
+ "text": "Mark Chen, Alec Radford, Rewon Child, Jeff Wu, Heewoo Jun, Prafulla Dhariwal, David Luan, and Ilya Sutskever. Generative pretraining from pixels. In Proceedings of the 37th International Conference on Machine Learning, 2020. ",
856
+ "bbox": [
857
+ 176,
858
+ 356,
859
+ 821,
860
+ 400
861
+ ],
862
+ "page_idx": 8
863
+ },
864
+ {
865
+ "type": "text",
866
+ "text": "Xi Chen, Diederik P Kingma, Tim Salimans, Yan Duan, Prafulla Dhariwal, John Schulman, Ilya Sutskever, and Pieter Abbeel. Variational lossy autoencoder. arXiv preprint arXiv:1611.02731, 2016. ",
867
+ "bbox": [
868
+ 176,
869
+ 410,
870
+ 823,
871
+ 452
872
+ ],
873
+ "page_idx": 8
874
+ },
875
+ {
876
+ "type": "text",
877
+ "text": "Xi Chen, Nikhil Mishra, Mostafa Rohaninejad, and Pieter Abbeel. Pixelsnail: An improved autoregressive generative model. arXiv preprint arXiv:1712.09763, 2017. ",
878
+ "bbox": [
879
+ 173,
880
+ 462,
881
+ 823,
882
+ 492
883
+ ],
884
+ "page_idx": 8
885
+ },
886
+ {
887
+ "type": "text",
888
+ "text": "Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers. arXiv preprint arXiv:1904.10509, 2019. ",
889
+ "bbox": [
890
+ 174,
891
+ 501,
892
+ 823,
893
+ 531
894
+ ],
895
+ "page_idx": 8
896
+ },
897
+ {
898
+ "type": "text",
899
+ "text": "Bin Dai and David Wipf. Diagnosing and enhancing vae models. arXiv preprint arXiv:1903.05789, 2019. ",
900
+ "bbox": [
901
+ 171,
902
+ 540,
903
+ 823,
904
+ 569
905
+ ],
906
+ "page_idx": 8
907
+ },
908
+ {
909
+ "type": "text",
910
+ "text": "Peter Dayan, Geoffrey E Hinton, Radford M Neal, and Richard S Zemel. The helmholtz machine. Neural computation, 7(5):889–904, 1995. ",
911
+ "bbox": [
912
+ 171,
913
+ 579,
914
+ 823,
915
+ 608
916
+ ],
917
+ "page_idx": 8
918
+ },
919
+ {
920
+ "type": "text",
921
+ "text": "Prafulla Dhariwal, Heewoo Jun, Christine Payne, Jong Wook Kim, Alec Radford, and Ilya Sutskever. Jukebox: A generative model for music. arXiv preprint arXiv:2005.00341, 2020. ",
922
+ "bbox": [
923
+ 173,
924
+ 618,
925
+ 820,
926
+ 648
927
+ ],
928
+ "page_idx": 8
929
+ },
930
+ {
931
+ "type": "text",
932
+ "text": "Laurent Dinh, David Krueger, and Yoshua Bengio. Nice: Non-linear independent components estimation. arXiv preprint arXiv:1410.8516, 2014. ",
933
+ "bbox": [
934
+ 173,
935
+ 659,
936
+ 820,
937
+ 688
938
+ ],
939
+ "page_idx": 8
940
+ },
941
+ {
942
+ "type": "text",
943
+ "text": "Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using real nvp. arXiv preprint arXiv:1605.08803, 2016. ",
944
+ "bbox": [
945
+ 171,
946
+ 696,
947
+ 821,
948
+ 726
949
+ ],
950
+ "page_idx": 8
951
+ },
952
+ {
953
+ "type": "text",
954
+ "text": "Ishaan Gulrajani, Kundan Kumar, Faruk Ahmed, Adrien Ali Taiga, Francesco Visin, David Vazquez, and Aaron Courville. Pixelvae: A latent variable model for natural images. arXiv preprint arXiv:1611.05013, 2016. ",
955
+ "bbox": [
956
+ 171,
957
+ 736,
958
+ 825,
959
+ 779
960
+ ],
961
+ "page_idx": 8
962
+ },
963
+ {
964
+ "type": "text",
965
+ "text": "Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016. ",
966
+ "bbox": [
967
+ 173,
968
+ 789,
969
+ 823,
970
+ 832
971
+ ],
972
+ "page_idx": 8
973
+ },
974
+ {
975
+ "type": "text",
976
+ "text": "Dan Hendrycks and Kevin Gimpel. Gaussian error linear units (gelus). arXiv preprint arXiv:1606.08415, 2016. ",
977
+ "bbox": [
978
+ 168,
979
+ 842,
980
+ 825,
981
+ 871
982
+ ],
983
+ "page_idx": 8
984
+ },
985
+ {
986
+ "type": "text",
987
+ "text": "Jonathan Ho, Xi Chen, Aravind Srinivas, Yan Duan, and Pieter Abbeel. Flow $^ { + + }$ : Improving flowbased generative models with variational dequantization and architecture design. arXiv preprint arXiv:1902.00275, 2019. ",
988
+ "bbox": [
989
+ 174,
990
+ 881,
991
+ 823,
992
+ 922
993
+ ],
994
+ "page_idx": 8
995
+ },
996
+ {
997
+ "type": "text",
998
+ "text": "Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. arXiv preprint arxiv:2006.11239, 2020. ",
999
+ "bbox": [
1000
+ 169,
1001
+ 103,
1002
+ 823,
1003
+ 132
1004
+ ],
1005
+ "page_idx": 9
1006
+ },
1007
+ {
1008
+ "type": "text",
1009
+ "text": "Chin-Wei Huang, Ahmed Touati, Laurent Dinh, Michal Drozdzal, Mohammad Havaei, Laurent Charlin, and Aaron Courville. Learnable explicit density for continuous latent space and variational inference. arXiv preprint arXiv:1710.02248, 2017. ",
1010
+ "bbox": [
1011
+ 174,
1012
+ 142,
1013
+ 821,
1014
+ 185
1015
+ ],
1016
+ "page_idx": 9
1017
+ },
1018
+ {
1019
+ "type": "text",
1020
+ "text": "Chin-Wei Huang, David Krueger, Alexandre Lacoste, and Aaron Courville. Neural autoregressive flows. arXiv preprint arXiv:1804.00779, 2018. ",
1021
+ "bbox": [
1022
+ 173,
1023
+ 195,
1024
+ 821,
1025
+ 224
1026
+ ],
1027
+ "page_idx": 9
1028
+ },
1029
+ {
1030
+ "type": "text",
1031
+ "text": "Diederik P Kingma and Max Welling. Stochastic gradient vb and the variational auto-encoder. In Second International Conference on Learning Representations, ICLR, volume 19, 2014. ",
1032
+ "bbox": [
1033
+ 173,
1034
+ 234,
1035
+ 823,
1036
+ 263
1037
+ ],
1038
+ "page_idx": 9
1039
+ },
1040
+ {
1041
+ "type": "text",
1042
+ "text": "Diederik P Kingma and Max Welling. An introduction to variational autoencoders. arXiv preprint arXiv:1906.02691, 2019. ",
1043
+ "bbox": [
1044
+ 173,
1045
+ 273,
1046
+ 823,
1047
+ 303
1048
+ ],
1049
+ "page_idx": 9
1050
+ },
1051
+ {
1052
+ "type": "text",
1053
+ "text": "Durk P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. In Advances in Neural Information Processing Systems, pp. 10215–10224, 2018. ",
1054
+ "bbox": [
1055
+ 173,
1056
+ 313,
1057
+ 823,
1058
+ 343
1059
+ ],
1060
+ "page_idx": 9
1061
+ },
1062
+ {
1063
+ "type": "text",
1064
+ "text": "Durk P Kingma, Tim Salimans, Rafal Jozefowicz, Xi Chen, Ilya Sutskever, and Max Welling. Improved variational inference with inverse autoregressive flow. In Advances in neural information processing systems, pp. 4743–4751, 2016. ",
1065
+ "bbox": [
1066
+ 176,
1067
+ 352,
1068
+ 823,
1069
+ 395
1070
+ ],
1071
+ "page_idx": 9
1072
+ },
1073
+ {
1074
+ "type": "text",
1075
+ "text": "Alexander Kolesnikov and Christoph H Lampert. Pixelcnn models with auxiliary variables for natural image modeling. In International Conference on Machine Learning, pp. 1905–1914. PMLR, 2017. ",
1076
+ "bbox": [
1077
+ 174,
1078
+ 405,
1079
+ 823,
1080
+ 448
1081
+ ],
1082
+ "page_idx": 9
1083
+ },
1084
+ {
1085
+ "type": "text",
1086
+ "text": "Lars Maaløe, Marco Fraccaro, Valentin Lievin, and Ole Winther. Biva: A very deep hierarchy of ´ latent variables for generative modeling. In Advances in neural information processing systems, pp. 6548–6558, 2019. ",
1087
+ "bbox": [
1088
+ 173,
1089
+ 458,
1090
+ 825,
1091
+ 501
1092
+ ],
1093
+ "page_idx": 9
1094
+ },
1095
+ {
1096
+ "type": "text",
1097
+ "text": "Jacob Menick and Nal Kalchbrenner. Generating high fidelity images with subscale pixel networks and multidimensional upscaling. arXiv preprint arXiv:1812.01608, 2018. ",
1098
+ "bbox": [
1099
+ 173,
1100
+ 511,
1101
+ 823,
1102
+ 541
1103
+ ],
1104
+ "page_idx": 9
1105
+ },
1106
+ {
1107
+ "type": "text",
1108
+ "text": "Aaron van den Oord, Sander Dieleman, Heiga Zen, Karen Simonyan, Oriol Vinyals, Alex Graves, Nal Kalchbrenner, Andrew Senior, and Koray Kavukcuoglu. Wavenet: A generative model for raw audio. arXiv preprint arXiv:1609.03499, 2016. ",
1109
+ "bbox": [
1110
+ 176,
1111
+ 550,
1112
+ 823,
1113
+ 594
1114
+ ],
1115
+ "page_idx": 9
1116
+ },
1117
+ {
1118
+ "type": "text",
1119
+ "text": "George Papamakarios, Eric Nalisnick, Danilo Jimenez Rezende, Shakir Mohamed, and Balaji Lakshminarayanan. Normalizing flows for probabilistic modeling and inference. arXiv preprint arXiv:1912.02762, 2019. ",
1120
+ "bbox": [
1121
+ 174,
1122
+ 603,
1123
+ 823,
1124
+ 647
1125
+ ],
1126
+ "page_idx": 9
1127
+ },
1128
+ {
1129
+ "type": "text",
1130
+ "text": "Niki Parmar, Ashish Vaswani, Jakob Uszkoreit, Łukasz Kaiser, Noam Shazeer, Alexander Ku, and Dustin Tran. Image transformer. arXiv preprint arXiv:1802.05751, 2018. ",
1131
+ "bbox": [
1132
+ 174,
1133
+ 656,
1134
+ 823,
1135
+ 686
1136
+ ],
1137
+ "page_idx": 9
1138
+ },
1139
+ {
1140
+ "type": "text",
1141
+ "text": "Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. OpenAI Blog, 1(8):9, 2019. ",
1142
+ "bbox": [
1143
+ 173,
1144
+ 695,
1145
+ 823,
1146
+ 726
1147
+ ],
1148
+ "page_idx": 9
1149
+ },
1150
+ {
1151
+ "type": "text",
1152
+ "text": "Scott Reed, Aaron van den Oord, Nal Kalchbrenner, Sergio G ¨ omez Colmenarejo, Ziyu Wang, Dan ´ Belov, and Nando De Freitas. Parallel multiscale autoregressive density estimation. arXiv preprint arXiv:1703.03664, 2017. ",
1153
+ "bbox": [
1154
+ 174,
1155
+ 736,
1156
+ 825,
1157
+ 779
1158
+ ],
1159
+ "page_idx": 9
1160
+ },
1161
+ {
1162
+ "type": "text",
1163
+ "text": "Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. arXiv preprint arXiv:1401.4082, 2014. ",
1164
+ "bbox": [
1165
+ 171,
1166
+ 787,
1167
+ 823,
1168
+ 819
1169
+ ],
1170
+ "page_idx": 9
1171
+ },
1172
+ {
1173
+ "type": "text",
1174
+ "text": "Tim Salimans and Durk P Kingma. Weight normalization: A simple reparameterization to accelerate training of deep neural networks. In Advances in neural information processing systems, pp. 901– 909, 2016. ",
1175
+ "bbox": [
1176
+ 174,
1177
+ 828,
1178
+ 823,
1179
+ 871
1180
+ ],
1181
+ "page_idx": 9
1182
+ },
1183
+ {
1184
+ "type": "text",
1185
+ "text": "Tim Salimans, Andrej Karpathy, Xi Chen, and Diederik P Kingma. Pixelcnn $^ { + + }$ : Improving the pixelcnn with discretized logistic mixture likelihood and other modifications. arXiv preprint arXiv:1701.05517, 2017. ",
1186
+ "bbox": [
1187
+ 174,
1188
+ 881,
1189
+ 825,
1190
+ 924
1191
+ ],
1192
+ "page_idx": 9
1193
+ },
1194
+ {
1195
+ "type": "table",
1196
+ "img_path": "images/4be86e4e9fb62355f6379be9583bb6ac4fe7c666dcf9f6dfa075b70c1c59d3de.jpg",
1197
+ "table_caption": [
1198
+ "Table 3: Effects of scaling residual initialization on very deep VAEs. We trained networks with varying depths for $8 0 \\mathrm { k }$ iterations. Scaling the last layer in the residual block by $\\scriptstyle { \\frac { 1 } { \\sqrt { N } } }$ results in higher losses for shallower networks, but lower losses and greater stability for deeper networks. The number of updates which are skipped because the gradient norm would destabilize the network is significantly reduced with scaling. "
1199
+ ],
1200
+ "table_footnote": [],
1201
+ "table_body": "<table><tr><td>Depth</td><td>Without scaling Loss</td><td>Skipped Updates</td><td>With scaling Loss</td><td>Skipped Updates</td></tr><tr><td>15</td><td>2.50</td><td>13</td><td>2.51</td><td>0</td></tr><tr><td>30</td><td>2.36</td><td>41</td><td>2.38</td><td>1</td></tr><tr><td>45</td><td>2.31</td><td>48</td><td>2.30</td><td>0</td></tr><tr><td>60</td><td>2.30</td><td>76</td><td>2.29</td><td>1</td></tr><tr><td>75</td><td>Diverged</td><td>1</td><td>2.28</td><td>0</td></tr></table>",
1202
+ "bbox": [
1203
+ 217,
1204
+ 184,
1205
+ 779,
1206
+ 286
1207
+ ],
1208
+ "page_idx": 10
1209
+ },
1210
+ {
1211
+ "type": "text",
1212
+ "text": "Casper Kaae Sønderby, Tapani Raiko, Lars Maaløe, Søren Kaae Sønderby, and Ole Winther. Ladder variational autoencoders. In Advances in neural information processing systems, pp. 3738–3746, 2016. ",
1213
+ "bbox": [
1214
+ 174,
1215
+ 310,
1216
+ 825,
1217
+ 353
1218
+ ],
1219
+ "page_idx": 10
1220
+ },
1221
+ {
1222
+ "type": "text",
1223
+ "text": "Emma Strubell, Ananya Ganesh, and Andrew McCallum. Energy and policy considerations for deep learning in nlp. arXiv preprint arXiv:1906.02243, 2019. ",
1224
+ "bbox": [
1225
+ 173,
1226
+ 363,
1227
+ 825,
1228
+ 392
1229
+ ],
1230
+ "page_idx": 10
1231
+ },
1232
+ {
1233
+ "type": "text",
1234
+ "text": "Benigno Uria, Iain Murray, and Hugo Larochelle. Rnade: The real-valued neural autoregressive density-estimator. In Advances in Neural Information Processing Systems, pp. 2175–2183, 2013. ",
1235
+ "bbox": [
1236
+ 173,
1237
+ 401,
1238
+ 823,
1239
+ 431
1240
+ ],
1241
+ "page_idx": 10
1242
+ },
1243
+ {
1244
+ "type": "text",
1245
+ "text": "Arash Vahdat and Jan Kautz. Nvae: A deep hierarchical variational autoencoder. arXiv preprint arXiv:2007.03898, 2020. ",
1246
+ "bbox": [
1247
+ 173,
1248
+ 440,
1249
+ 823,
1250
+ 469
1251
+ ],
1252
+ "page_idx": 10
1253
+ },
1254
+ {
1255
+ "type": "text",
1256
+ "text": "Aaron Van den Oord, Nal Kalchbrenner, Lasse Espeholt, Oriol Vinyals, Alex Graves, et al. Conditional image generation with pixelcnn decoders. In Advances in neural information processing systems, pp. 4790–4798, 2016. ",
1257
+ "bbox": [
1258
+ 176,
1259
+ 478,
1260
+ 823,
1261
+ 521
1262
+ ],
1263
+ "page_idx": 10
1264
+ },
1265
+ {
1266
+ "type": "text",
1267
+ "text": "Hongyi Zhang, Yann N Dauphin, and Tengyu Ma. Fixup initialization: Residual learning without normalization. arXiv preprint arXiv:1901.09321, 2019. ",
1268
+ "bbox": [
1269
+ 169,
1270
+ 531,
1271
+ 823,
1272
+ 560
1273
+ ],
1274
+ "page_idx": 10
1275
+ },
1276
+ {
1277
+ "type": "text",
1278
+ "text": "Shengjia Zhao, Jiaming Song, and Stefano Ermon. Learning hierarchical features from generative models. arXiv preprint arXiv:1702.08396, 2017. ",
1279
+ "bbox": [
1280
+ 174,
1281
+ 569,
1282
+ 821,
1283
+ 598
1284
+ ],
1285
+ "page_idx": 10
1286
+ },
1287
+ {
1288
+ "type": "text",
1289
+ "text": "A APPENDIX ",
1290
+ "text_level": 1,
1291
+ "bbox": [
1292
+ 176,
1293
+ 626,
1294
+ 297,
1295
+ 642
1296
+ ],
1297
+ "page_idx": 10
1298
+ },
1299
+ {
1300
+ "type": "text",
1301
+ "text": "A.1 ABLATIONS OF ARCHITECTURAL COMPONENTS ",
1302
+ "text_level": 1,
1303
+ "bbox": [
1304
+ 174,
1305
+ 659,
1306
+ 547,
1307
+ 672
1308
+ ],
1309
+ "page_idx": 10
1310
+ },
1311
+ {
1312
+ "type": "text",
1313
+ "text": "First, we visualize data that suggests upsampling layers and residual connections have an impact on posterior collapse (Figure 5). Architectural differences may explain why our VAEs do not need “free bits” or KL warmups to avoid posterior collapse. ",
1314
+ "bbox": [
1315
+ 174,
1316
+ 684,
1317
+ 825,
1318
+ 726
1319
+ ],
1320
+ "page_idx": 10
1321
+ },
1322
+ {
1323
+ "type": "text",
1324
+ "text": "In Table 3, we show residual initialization leads to smoother and better training of very deep VAEs. Without residual initialization, very deep VAEs encounter a high number of unstable updates and have higher losses. ",
1325
+ "bbox": [
1326
+ 176,
1327
+ 732,
1328
+ 825,
1329
+ 775
1330
+ ],
1331
+ "page_idx": 10
1332
+ },
1333
+ {
1334
+ "type": "text",
1335
+ "text": "In Figure 6, we show the max gradient norms experienced throughout training, and show that our skipping criterion avoids a small number of updates that would destabilize the network. ",
1336
+ "bbox": [
1337
+ 174,
1338
+ 781,
1339
+ 821,
1340
+ 810
1341
+ ],
1342
+ "page_idx": 10
1343
+ },
1344
+ {
1345
+ "type": "text",
1346
+ "text": "A.2 PROPOSITION 1: N-LAYER VAES GENERALIZE AUTOREGRESSIVE MODELS WHEN N IS THE DATA DIMENSION ",
1347
+ "bbox": [
1348
+ 173,
1349
+ 828,
1350
+ 813,
1351
+ 856
1352
+ ],
1353
+ "page_idx": 10
1354
+ },
1355
+ {
1356
+ "type": "text",
1357
+ "text": "Proposition 1 shows that an autoregressive model with an arbitrary ordering over observed variables in $\\dot { \\boldsymbol { x } } \\in \\mathbb { R } ^ { N }$ is equivalent to an $N$ -layer VAE with an approximate posterior that simply outputs the observed variables in the given order, and a generator that performs the identity function (see Figure 2). ",
1358
+ "bbox": [
1359
+ 174,
1360
+ 867,
1361
+ 823,
1362
+ 924
1363
+ ],
1364
+ "page_idx": 10
1365
+ },
1366
+ {
1367
+ "type": "image",
1368
+ "img_path": "images/429b97e84b158c54e3a5b77206a9ed1bec8360e363a3a2fcb44b1bd8ede0f83b.jpg",
1369
+ "image_caption": [
1370
+ "Figure 5: Relationship between architecture and posterior collapse. We visualize the cumulative KL divergence (or “rate”, in bits per dimension) for several different architectures across a 73 layer network on ImageNet-32. When residual connections are removed from the “res block” in the topdown path (Figure 3), the model encodes no information in the first 45 layers of the network and the loss is highest (”FFN”). When a learned convolutional upsampler is used as the “unpool” layer, the first 13 layers of the network encode no information. When nearest-neighbor upsampling is used, the first layers all encode information, and the loss is the lowest. "
1371
+ ],
1372
+ "image_footnote": [],
1373
+ "bbox": [
1374
+ 240,
1375
+ 104,
1376
+ 751,
1377
+ 316
1378
+ ],
1379
+ "page_idx": 11
1380
+ },
1381
+ {
1382
+ "type": "text",
1383
+ "text": "Without loss of generality, we simplify notation by assuming each vector-valued latent variable $z _ { i }$ only has one element, which we write as $z _ { i } \\in \\mathbb { R }$ . We assume a prior and approximate posterior distribution following Equation 2 and 3. ",
1384
+ "bbox": [
1385
+ 174,
1386
+ 457,
1387
+ 823,
1388
+ 500
1389
+ ],
1390
+ "page_idx": 11
1391
+ },
1392
+ {
1393
+ "type": "text",
1394
+ "text": "Proof. Let $q ( z _ { i } ~ = ~ x _ { i } | \\boldsymbol { z } _ { < i } , \\pmb { x } ) ~ = ~ 1$ , and $p ( x _ { i } ~ = ~ z _ { i } | z ) ~ = ~ 1$ . Then $p ( z | \\mathbf { x } ) ~ = ~ q ( z | \\mathbf { x } ) .$ , which is well-known to imply equality in the evidence lower bound (ELBO) of Eq. 1. Since $\\log q ( z | \\pmb { x } ) = \\log p ( \\pmb { x } | z ) = 0$ , the ELBO becomes $\\begin{array} { r } { \\log p _ { \\theta } ( { \\pmb x } ) = \\log p _ { \\theta } ( { \\pmb z } ) = \\sum _ { i = 1 } ^ { N } \\log p _ { \\theta } ( z _ { i } | z _ { < i } ) = } \\end{array}$ $\\textstyle \\sum _ { i = 1 } ^ { N } \\log p _ { \\theta } ( x _ { i } | \\boldsymbol { x } _ { < i } )$ , which is equivalent to an autoregressive model over the observed variables. □ ",
1395
+ "bbox": [
1396
+ 173,
1397
+ 520,
1398
+ 825,
1399
+ 597
1400
+ ],
1401
+ "page_idx": 11
1402
+ },
1403
+ {
1404
+ "type": "text",
1405
+ "text": "A.3 PROPOSITION 2: $N$ -LAYER VAES ARE UNIVERSAL APPROXIMATORS OF $N$ -DIMENSIONAL LATENT DENSITIES ",
1406
+ "text_level": 1,
1407
+ "bbox": [
1408
+ 176,
1409
+ 616,
1410
+ 710,
1411
+ 645
1412
+ ],
1413
+ "page_idx": 11
1414
+ },
1415
+ {
1416
+ "type": "text",
1417
+ "text": "Proposition 2 shows that hierarchical VAEs learn depthwise autoregressive flows, and under certain conditions (described in Huang et al. (2017)) can express any density over latent variables of $N$ dimensions, given enough capacity. ",
1418
+ "bbox": [
1419
+ 174,
1420
+ 656,
1421
+ 825,
1422
+ 699
1423
+ ],
1424
+ "page_idx": 11
1425
+ },
1426
+ {
1427
+ "type": "text",
1428
+ "text": "Proof. We omit full proof, and refer readers to Huang et al. (2017); Papamakarios et al. (2019), where universality is established for autoregressive flows. Here we only note that the prior and approximate posterior in an $N$ -layer VAE are autoregressive flows: Let $p _ { \\theta } ( z )$ be the prior distribution. $p _ { \\theta } ( z )$ can be written using the reparameterization trick as a deterministic function of noise $\\epsilon$ drawn from a known base density $p _ { N }$ $\\begin{array} { r } { \\mathrm { : ~ } p _ { \\theta } ( z ) = p _ { N } ( \\epsilon ) \\left| \\operatorname* { d e t } \\frac { \\partial f ( \\epsilon , \\theta ) } { \\partial \\epsilon } \\right| } \\end{array}$ where $f$ is a neural network that implements the factorization in Eq. 2. Since $f$ is autoregressive and its Jacobian is lower triangular, $p _ { \\theta } ( z )$ can approximate any $p ( z )$ that fits the criteria in Huang et al. (2017). The same logic applies to $q _ { \\phi } ( \\pmb { z } | \\pmb { x } )$ and $p ( \\boldsymbol { z } | \\boldsymbol { x } )$ . It should be noted that this result depends on $f$ being able to implement the inverse CDF of an arbitrary probability density, and so using Gaussian distributions will restrict the densities the VAE can express in practice. This is a limitation of our architecture that we nevertheless adopt since we hypothesize depth, not the elementwise density, is the more important factor. More discussion on this subject, and options for removing this restriction, are described in Huang et al. (2017) and Huang et al. (2018), and we defer studying more expressive elementwise densities to future work. □ ",
1429
+ "bbox": [
1430
+ 173,
1431
+ 719,
1432
+ 825,
1433
+ 924
1434
+ ],
1435
+ "page_idx": 11
1436
+ },
1437
+ {
1438
+ "type": "image",
1439
+ "img_path": "images/7e09dae6c8b26c33413af8909cae34d8460058d3cb0d90a69da5245a88f01b73.jpg",
1440
+ "image_caption": [
1441
+ "Figure 6: Effect of gradient skipping. We plot the max gradient norm encountered per 500 updates for our best models across datasets. The dashed black line indicates the “skip threshold”, or value above which the update is skipped. We choose a high threshold that affects fewer than 0.01 percent of training updates. Without this skip heuristic, networks will diverge when extreme updates are encountered. These updates can have norm as high as 1e15. "
1442
+ ],
1443
+ "image_footnote": [],
1444
+ "bbox": [
1445
+ 200,
1446
+ 119,
1447
+ 794,
1448
+ 582
1449
+ ],
1450
+ "page_idx": 12
1451
+ },
1452
+ {
1453
+ "type": "text",
1454
+ "text": "A.4 A NOTE ON INVERSE AUTOREGRESSIVE FLOW ",
1455
+ "text_level": 1,
1456
+ "bbox": [
1457
+ 174,
1458
+ 718,
1459
+ 540,
1460
+ 732
1461
+ ],
1462
+ "page_idx": 12
1463
+ },
1464
+ {
1465
+ "type": "text",
1466
+ "text": "Inverse autoregressive flows (IAF, Kingma et al. (2016)) and are similar to very deep VAEs in that they are universal approximators of posterior distributions in VAEs, even with just a single layer and sufficiently expressive univariate density (Huang et al., 2018). ",
1467
+ "bbox": [
1468
+ 174,
1469
+ 750,
1470
+ 825,
1471
+ 791
1472
+ ],
1473
+ "page_idx": 12
1474
+ },
1475
+ {
1476
+ "type": "text",
1477
+ "text": "There are several practical differences between IAFs and deep hierarchical VAEs, however, which can result in qualitatively very different behavior. First, the masked autoregressive components in IAF build statistical dependencies spatially, whereas a very deep hierarchical VAE builds dependencies depthwise, and these inductive biases may better suit different domains. Additionally, IAFs spend an equal amount of computation and parameters on each variable. In contrast, a deep VAE can specify a structure, like a hierarchy of global-to-local variables, which have different computational and modeling capacities for each stage. For images, these differences may result in qualitatively different behavior, and it is not clear whether a single layer IAF can readily learn the sort of rich hierarchical decomposition of images that appear with very deep VAEs. ",
1478
+ "bbox": [
1479
+ 174,
1480
+ 797,
1481
+ 825,
1482
+ 924
1483
+ ],
1484
+ "page_idx": 12
1485
+ },
1486
+ {
1487
+ "type": "image",
1488
+ "img_path": "images/9a2cf2514fc5f4994244e694282330e4fe87e41db4dfd76ac18c2226c431f90c.jpg",
1489
+ "image_caption": [
1490
+ "Figure 7: Non-cherrypicked, temperature 1.0 samples on FFHQ-256. Cover images were each cherrypicked from a batch of 16 (unadjusted temperature) samples. Here we show a random batch of 16 images for comparison. "
1491
+ ],
1492
+ "image_footnote": [],
1493
+ "bbox": [
1494
+ 238,
1495
+ 102,
1496
+ 758,
1497
+ 502
1498
+ ],
1499
+ "page_idx": 13
1500
+ },
1501
+ {
1502
+ "type": "text",
1503
+ "text": "Nevertheless, the two techniques are complementary – IAF was introduced in a deep hierarchical VAE (Kingma et al., 2016), in fact, and it is likely that introducing IAF into our architecture (as in Vahdat & Kautz (2020)) would improve performance. ",
1504
+ "bbox": [
1505
+ 176,
1506
+ 590,
1507
+ 823,
1508
+ 632
1509
+ ],
1510
+ "page_idx": 13
1511
+ },
1512
+ {
1513
+ "type": "text",
1514
+ "text": "A.5 A NOTE ON LEARNING HIERARCHICAL FEATURES ",
1515
+ "text_level": 1,
1516
+ "bbox": [
1517
+ 176,
1518
+ 659,
1519
+ 565,
1520
+ 672
1521
+ ],
1522
+ "page_idx": 13
1523
+ },
1524
+ {
1525
+ "type": "text",
1526
+ "text": "The work of Zhao et al. (2017) may appear to contradict our work, by suggesting that additional layers in hierarchical VAEs do not lead to additional expressivity, based off their finding that Gibbs sampling from the last stochastic layer is sufficient to recover the data. For high dimensional data like images, however, the last stochastic layer may have many thousands of variables, and Gibbs sampling may take unacceptably long to converge. A hierarchy of latent variables as in our model allows efficient and tractable sampling from this distribution. Additionally, assumptions regarding global maximization of the ELBO may not apply in practice. Nevertheless, we think further clarifying these contradictory statements would be useful future work. ",
1527
+ "bbox": [
1528
+ 174,
1529
+ 688,
1530
+ 825,
1531
+ 799
1532
+ ],
1533
+ "page_idx": 13
1534
+ },
1535
+ {
1536
+ "type": "text",
1537
+ "text": "A.6 BROADER IMPACT ",
1538
+ "text_level": 1,
1539
+ "bbox": [
1540
+ 176,
1541
+ 824,
1542
+ 344,
1543
+ 838
1544
+ ],
1545
+ "page_idx": 13
1546
+ },
1547
+ {
1548
+ "type": "text",
1549
+ "text": "Broadly speaking, any generative model will reflect the biases of the datasets they are trained on. If deployed without careful consideration, generative models (including but not limited to VAEs) trained on research datasets like ImageNet, CIFAR-10, and FFHQ may inadvertently cause harm by propagating or otherwise reinforcing harmful biases in the dataset. Further work is required to improve and debias research benchmark datasets to mitigate this source of negative impact. ",
1550
+ "bbox": [
1551
+ 176,
1552
+ 854,
1553
+ 823,
1554
+ 924
1555
+ ],
1556
+ "page_idx": 13
1557
+ },
1558
+ {
1559
+ "type": "image",
1560
+ "img_path": "images/88521efcffa76ca2cb163809b5378e9cb553c64feb9b95f38a726f99ed6eb01b.jpg",
1561
+ "image_caption": [
1562
+ "Figure 8: Non-cherrypicked, temperature 0.85 samples on FFHQ-256. Lower temperature samples result in greater regularity in images. "
1563
+ ],
1564
+ "image_footnote": [],
1565
+ "bbox": [
1566
+ 238,
1567
+ 102,
1568
+ 758,
1569
+ 502
1570
+ ],
1571
+ "page_idx": 14
1572
+ },
1573
+ {
1574
+ "type": "text",
1575
+ "text": "Some VAEs are distinguished from other generative models by their fast synthesis of new data examples. Generative models with fast synthesis can allow for realtime synthesis of high dimensional data, such as music, speech, and video. These models could be used to augment human creativity and lead to a number of helpful applications in real-time media applications. Such models could also be used for compression, which could assist in delivering content to bandwidth-constrained regions of the world. They can also be used for spreading disinformation, generally making it less possible to distinguish real from generated data. An additional potential harm is that fast, high quality synthesis of data could end up economically displacing individuals who rely upon creative work, such as musicians, visual artists, and more. ",
1576
+ "bbox": [
1577
+ 173,
1578
+ 569,
1579
+ 825,
1580
+ 694
1581
+ ],
1582
+ "page_idx": 14
1583
+ },
1584
+ {
1585
+ "type": "text",
1586
+ "text": "VAEs also are distinguished by their usage of latent variables. Generative models with useful latent variables could have positive impacts in scientific domains, where density estimation could lead to novel insights about chemical, physical, or biological data. Latent variable representations of data could also be helpful in efforts to debias, interpret, or otherwise increase understandibility of models and their representations. ",
1587
+ "bbox": [
1588
+ 174,
1589
+ 702,
1590
+ 825,
1591
+ 771
1592
+ ],
1593
+ "page_idx": 14
1594
+ },
1595
+ {
1596
+ "type": "image",
1597
+ "img_path": "images/9eb4b982051136045c3af64822d2096c2a1af01024e354f3f45176ef7fc9d793.jpg",
1598
+ "image_caption": [
1599
+ "Figure 9: Non-cherrypicked, temperature 0.60 samples on FFHQ-256. We visualize temperature 0.60 samples for comparison with Vahdat & Kautz (2020) "
1600
+ ],
1601
+ "image_footnote": [],
1602
+ "bbox": [
1603
+ 238,
1604
+ 132,
1605
+ 758,
1606
+ 532
1607
+ ],
1608
+ "page_idx": 15
1609
+ },
1610
+ {
1611
+ "type": "table",
1612
+ "img_path": "images/98a1135903882b416ac8440d76e9de0b3b328254391d31ddb1318e801ba80ed9.jpg",
1613
+ "table_caption": [
1614
+ "Table 4: Key hyperparameters for experiments. We detail here the main hyperparameters used in training. FFHQ-1024 has reduced hidden size for higher resolutions; see code for details. "
1615
+ ],
1616
+ "table_footnote": [],
1617
+ "table_body": "<table><tr><td>Parameter</td><td>CIFAR-10</td><td>ImageNet-32</td><td>ImageNet-64</td><td>FFHQ-256</td><td>FFHQ-1024</td></tr><tr><td>Num layers</td><td>45</td><td>78</td><td>75</td><td>62</td><td>72</td></tr><tr><td>Hidden size</td><td>384</td><td>512</td><td>512</td><td>512</td><td>Varies</td></tr><tr><td>Bottleneck size</td><td>96</td><td>128</td><td>128</td><td>128</td><td>Varies</td></tr><tr><td>Latent dim per layer</td><td>16</td><td>16</td><td>16</td><td>16</td><td>16</td></tr><tr><td>Batch size</td><td>32</td><td>256</td><td>128</td><td>32</td><td>32</td></tr><tr><td>Learning rate</td><td>0.0002</td><td>0.00015</td><td>0.00015</td><td>0.00015</td><td>0.00007</td></tr><tr><td>Optimizer</td><td>Adam</td><td>Adam</td><td>Adam</td><td>Adam</td><td>Adam</td></tr><tr><td>Skip threshold</td><td>400</td><td>300</td><td>380</td><td>180</td><td>500</td></tr><tr><td>Weight Decay</td><td>0.01</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td></tr><tr><td>EMA rate</td><td>0.0002</td><td>0.00015</td><td>0.00015</td><td>0.00015</td><td>0.00015</td></tr><tr><td>Training iterations</td><td>1.1M</td><td>1.7M</td><td>1.6M</td><td>1.7M</td><td>1.7M</td></tr><tr><td>GPUs</td><td>2 x V100</td><td>32 x V100</td><td>32 x V100</td><td>32 x V100</td><td>32 x V100</td></tr><tr><td>Training time</td><td>6 days</td><td>2.5 weeks</td><td>2.5 weeks</td><td>2.5 weeks</td><td>2.5 weeks</td></tr><tr><td>Parameters</td><td>39M</td><td>119M</td><td>125M</td><td>115M</td><td>115M</td></tr></table>",
1618
+ "bbox": [
1619
+ 179,
1620
+ 679,
1621
+ 820,
1622
+ 891
1623
+ ],
1624
+ "page_idx": 15
1625
+ },
1626
+ {
1627
+ "type": "image",
1628
+ "img_path": "images/51b68fcc859fd881f1bcdd2613b83b57d93e169c7975c42e686579766f63ad6d.jpg",
1629
+ "image_caption": [
1630
+ "Figure 10: ImageNet-32 (left) and ImageNet-64 (right) reconstructions and samples. Reconstructions of validation images from various stages in the latent hierarchy (top), and unconditional samples from the model at temperature 1.0 (bottom). "
1631
+ ],
1632
+ "image_footnote": [],
1633
+ "bbox": [
1634
+ 174,
1635
+ 121,
1636
+ 825,
1637
+ 467
1638
+ ],
1639
+ "page_idx": 16
1640
+ },
1641
+ {
1642
+ "type": "image",
1643
+ "img_path": "images/ab424ead9485c63b4e2df355415d15d4f27effcf34f691ff8f7155a58b5aeaee.jpg",
1644
+ "image_caption": [
1645
+ "Figure 11: FFHQ-1024 samples. These are generated with reduced temperature (top) and temperature 1.0 (bottom). The model we train has similar capacity to smaller ones we use on $3 2 \\mathrm { x } 3 2 $ , 64x64, and $2 5 6 \\times 2 5 6$ images, and so fails to capture the intricacies of this more complex distribution well. A larger model, trained for longer, may achieve better sample quality. "
1646
+ ],
1647
+ "image_footnote": [],
1648
+ "bbox": [
1649
+ 238,
1650
+ 565,
1651
+ 758,
1652
+ 833
1653
+ ],
1654
+ "page_idx": 16
1655
+ }
1656
+ ]
parse/train/RLRXCV6DbEJ/RLRXCV6DbEJ_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/RLRXCV6DbEJ/RLRXCV6DbEJ_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/d7KBjmI3GmQ/d7KBjmI3GmQ.md ADDED
@@ -0,0 +1,562 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # MEASURING MASSIVE MULTITASK LANGUAGE UNDERSTANDING
2
+
3
+ Dan Hendrycks UC Berkeley
4
+
5
+ Collin Burns Columbia University
6
+
7
+ Steven Basart UChicago
8
+
9
+ Andy Zou UC Berkeley
10
+
11
+ Mantas Mazeika UIUC
12
+
13
+ Dawn Song UC Berkeley
14
+
15
+ Jacob Steinhardt UC Berkeley
16
+
17
+ # ABSTRACT
18
+
19
+ We propose a new test to measure a text model’s multitask accuracy. The test covers 57 tasks including elementary mathematics, US history, computer science, law, and more. To attain high accuracy on this test, models must possess extensive world knowledge and problem solving ability. We find that while most recent models have near random-chance accuracy, the very largest GPT-3 model improves over random chance by almost 20 percentage points on average. However, on every one of the 57 tasks, the best models still need substantial improvements before they can reach expert-level accuracy. Models also have lopsided performance and frequently do not know when they are wrong. Worse, they still have nearrandom accuracy on some socially important subjects such as morality and law. By comprehensively evaluating the breadth and depth of a model’s academic and professional understanding, our test can be used to analyze models across many tasks and to identify important shortcomings.
20
+
21
+ # 1 INTRODUCTION
22
+
23
+ Natural Language Processing (NLP) models have achieved superhuman performance on a number of recently proposed benchmarks. However, these models are still well below human level performance for language understanding as a whole, suggesting a disconnect between our benchmarks and the actual capabilities of these models. The General Language Understanding Evaluation benchmark (GLUE) (Wang et al., 2018) was introduced in 2018 to evaluate performance on a wide range of NLP tasks, and top models achieved superhuman performance within a year. To address the shortcomings of GLUE, researchers designed the SuperGLUE benchmark with more difficult tasks (Wang et al., 2019). About a year since the release of SuperGLUE, performance is again essentially human-level (Raffel et al., 2019). While these benchmarks evaluate linguistic skills more than overall language understanding, an array of commonsense benchmarks have been proposed to measure basic reasoning and everyday knowledge (Zellers et al., 2019; Huang et al., 2019; Bisk et al., 2019). However, these recent benchmarks have similarly seen rapid progress (Khashabi et al., 2020). Overall, the near human-level performance on these benchmarks suggests that they are not capturing important facets of language understanding.
24
+
25
+ Transformer models have driven this recent progress by pretraining on massive text corpora, including all of Wikipedia, thousands of books, and numerous websites. These models consequently see extensive information about specialized topics, most of which is not assessed by existing NLP benchmarks. It consequently remains an open question just how capable current language models are at learning and applying knowledge from many domains.
26
+
27
+ To bridge the gap between the wide-ranging knowledge that models see during pretraining and the existing measures of success, we introduce a new benchmark for assessing models across a diverse set of subjects that humans learn. We design the benchmark to measure knowledge acquired during pretraining by evaluating models exclusively in zero-shot and few-shot settings. This makes the benchmark more challenging and more similar to how we evaluate humans. The benchmark covers 57 subjects across STEM, the humanities, the social sciences, and more. It ranges in difficulty from an elementary level to an advanced professional level, and it tests both world knowledge and problem solving ability. Subjects range from traditional areas, such as mathematics and history, to more
28
+
29
+ # Few Shot Prompt and Predicted Answer
30
+
31
+ The following are multiple choice questions about high school mathematics.
32
+
33
+ How many numbers are in the list 25, 26, ..., 100? (A) 75 (B) 76 (C) 22 (D) 23
34
+
35
+ Answer: B
36
+
37
+ Compute $i + i ^ { 2 } + i ^ { 3 } + \cdot \cdot \cdot + i ^ { 2 5 8 } + i ^ { 2 5 9 }$ . (A) -1 (B) 1 (C) i (D) -i Answer: A
38
+
39
+ If 4 daps $= 7$ yaps, and $5 \mathrm { y a p s } = 3$ baps, how many daps equal 42 baps? (A) 28 (B) 21 (C) 40 (D) 30 Answer: $\underline { { \mathbf { C } } }$
40
+
41
+ (a) An example of few-shot learning and inference using GPT-3. The blue underlined bold text is the autocompleted response from GPT-3, while the preceding text is the user-inputted prompt. In this 2-shot learning example, there are two instruction examples and one initially incomplete example. On average, GPT-3 has low accuracy on high school mathematics questions.
42
+
43
+ ![](images/34a6b47a6d525f5b7f965c4e739ea22ac4607b801cfbcabc6831220a07928853.jpg)
44
+
45
+ (b) Performance on a commonsense benchmark (HellaSwag), a linguistic understanding benchmark (SuperGLUE), and the massive multitask test. On previous benchmarks, smaller models start well above random chance levels and exhibit more continuous improvements with model size increases, but on our test, GPT-3 moves beyond random chance with the largest model.
46
+
47
+ specialized areas like law and ethics (Hendrycks et al., 2020). The granularity and breadth of the subjects makes the benchmark ideal for identifying a model’s blind spots.
48
+
49
+ We find that meaningful progress on our benchmark has only become possible in recent months. In particular, few-shot models up to 13 billion parameters (Brown et al., 2020) achieve random chance performance of $2 5 \%$ accuracy, but the 175 billion parameter GPT-3 model reaches a much higher $4 3 . 9 \%$ accuracy (see Figure 1b). On the other hand, unlike human professionals GPT-3 does not excel at any single subject. Instead, we find that performance is lopsided, with GPT-3 having almost $7 0 \%$ accuracy for its best subject but near-random performance for several other subjects.
50
+
51
+ Our results indicate that while recent advances have been impressive, state-of-the-art models still struggle at learning and applying knowledge from pretraining. The tasks with near-random accuracy include calculation-heavy subjects such as physics and mathematics and subjects related to human values such as law and morality. This second weakness is particularly concerning because it will be important for future models to have a strong understanding of what is legal and what is ethical. Worryingly, we also find that GPT-3 does not have an accurate sense of what it does or does not know since its average confidence can be up to $2 4 \%$ off from its actual accuracy. We comprehensively evaluate the breadth and depth of a model’s text understanding by covering numerous topics that humans are incentivized to learn. Since our test consists in 57 tasks, it can be used to analyze aggregate properties of models across tasks and to track important shortcomings. The test and code is available at github.com/hendrycks/test.
52
+
53
+ # 2 RELATED WORK
54
+
55
+ Pretraining. The dominant paradigm in NLP is to pretrain large models on massive text corpora including educational books and websites. In the process, these models are exposed to information about a wide range of topics. Petroni et al. (2019) found that recent models learn enough information from pretraining that they can serve as knowledge bases. However, no prior work has comprehensively measured the knowledge models have across many real-world domains.
56
+
57
+ Until recently, researchers primarily used fine-tuned models on downstream tasks (Devlin et al., 2019). However, larger pretrained models like GPT-3 (Brown et al., 2020) have made it possible to achieve competitive performance without fine-tuning by using few-shot learning, which removes the need for a large fine-tuning set. With the advent of strong zero-shot and few-shot learning, it is now possible to curate a diverse set of tasks for evaluation and remove the possibility of models on “spurious cues” (Geirhos et al., 2020; Hendrycks et al., 2019b) in a dataset to achieve high performance.
58
+
59
+ Benchmarks. Many recent benchmarks aim to assess a model’s general world knowledge and basic reasoning ability by testing its “commonsense.” A number of commonsense benchmarks have been
60
+
61
+ As Seller, an encyclopedia salesman, approached the grounds on which Hermit's house was situated, he saw a sign that said, "No salesmen. Trespassers will be prosecuted. Proceed at your own risk." Although Seller had not been invited to enter, he ignored the sign and drove up the driveway toward the house. As he rounded a curve, a powerful explosive charge buried in the driveway exploded, and Seller was injured. Can Seller recover damages from Hermit for his injuries?
62
+
63
+ (A) Yes, unless Hermit, when he planted the charge, intended only to deter, not harm, intruders.
64
+ (B) Yes, if Hermit was responsible for the explosive charge under the driveway.
65
+ (C) No, because Seller ignored the sign, which warned him against proceeding further.
66
+ (D) No, if Hermit reasonably feared that intruders would come and harm him or his family.
67
+
68
+ Figure 2: This task requires understanding detailed and dissonant scenarios, applying appropriate legal precedents, and choosing the correct explanation. The green checkmark is the ground truth.
69
+
70
+ proposed in the past year, but recent models are already nearing human-level performance on several of these, including HellaSwag (Zellers et al., 2019), Physical IQA (Bisk et al., 2019), and CosmosQA (Huang et al., 2019). By design, these datasets assess abilities that almost every child has. In contrast, we include harder specialized subjects that people must study to learn.
71
+
72
+ Some researchers have suggested that the future of NLP evaluation should focus on Natural Language Generation (NLG) (Zellers et al., 2020), an idea that reaches back to the Turing Test (Turing, 1950). However, NLG is notoriously difficult to evaluate and lacks a standard metric (Sai et al., 2020). Consequently, we instead create a simple-to-evaluate test that measures classification accuracy on multiple choice questions.
73
+
74
+ While several question answering benchmarks exist, they are comparatively limited in scope. Most either cover easy topics like grade school subjects for which models can already achieve strong performance (Clark et al., 2018; Khot et al., 2019; Mihaylov et al., 2018; Clark et al., 2019), or are focused on linguistic understanding in the form of reading comprehension (Lai et al., 2017; Richardson et al., 2013). In contrast, we include a wide range of difficult subjects that go far beyond linguistic understanding.
75
+
76
+ # 3 A MULTITASK TEST
77
+
78
+ We create a massive multitask test consisting of multiple-choice questions from various branches of knowledge. The test spans subjects in the humanities, social sciences, hard sciences, and other areas that are important for some people to learn. There are 57 tasks in total, which is also the number of Atari games (Bellemare et al., 2013), all of which are listed in Appendix B. The questions in the dataset were manually collected by graduate and undergraduate students from freely available sources online. These include practice questions for tests such as the Graduate Record Examination and the United States Medical Licensing Examination. It also includes questions designed for undergraduate courses and questions designed for readers of Oxford University Press books. Some tasks cover a subject, like psychology, but at a specific level of difficulty, such as “Elementary,” “High School,” “College,” or “Professional.” For example, the “Professional Psychology” task draws on questions from freely available practice questions for the Examination for Professional Practice in Psychology, while the “High School Psychology” task has questions like those from Advanced Placement Psychology examinations.
79
+
80
+ We collected 15908 questions in total, which we split into a few-shot development set, a validation set, and a test set. The few-shot development set has 5 questions per subject, the validation set may be used for selecting hyperparameters and is made of 1540 questions, and the test set has 14079 questions. Each subject contains 100 test examples at the minimum, which is longer than most exams designed to assess people.
81
+
82
+ Human-level accuracy on this test varies. Unspecialized humans from Amazon Mechanical Turk obtain $3 4 . 5 \%$ accuracy on this test. Meanwhile, expert-level performance can be far higher. For example, real-world test-taker human accuracy at the 95th percentile is around $8 7 \%$ for US Medical Licensing Examinations, and these questions make up our “Professional Medicine” task. If we take the 95th percentile human test-taker accuracy for exams that build up our test, and if we make an educated guess when such information is unavailable, we then estimate that expert-level accuracy is approximately $8 9 . 8 \%$ .
83
+
84
+ Since our test aggregates different subjects and several levels of difficulty, we measure more than straightforward commonsense or narrow linguistic understanding. Instead, we measure arbitrary
85
+
86
+ One of the reasons that the government discourages and regulates monopolies is that
87
+
88
+ (A) producer surplus is lost and consumer surplus is gained.
89
+ (B) monopoly prices ensure productive efficiency but cost society allocative efficiency.
90
+ (C) monopoly firms do not engage in significant research and development.
91
+ (D) consumer surplus is lost with higher prices and lower levels of output.
92
+
93
+ When you drop a ball from rest it accelerates downward at $9 . 8 \mathrm { m } / \mathrm { s } ^ { 2 }$ . If you instead throw it downward assuming no air resistance its acceleration immediately after leaving your hand is
94
+
95
+ (A) $9 . 8 \mathrm { m } / \mathrm { s } ^ { 2 }$
96
+ (B) more than $9 . 8 \mathrm { m } / \mathrm { s } ^ { 2 }$
97
+ (C) less than $9 . 8 ~ \mathrm { m } / \mathrm { s } ^ { 2 }$
98
+ (D) Cannot say unless the speed of throw is given.
99
+
100
+ In the complex $z$ -plane, the set of points satisfying the equation $z ^ { 2 } = | z | ^ { 2 }$ is a
101
+
102
+ (A) pair of points
103
+ (B) circle
104
+ (C) half-line
105
+ (D) line
106
+
107
+ Figure 4: Examples from the Conceptual Physics and College Mathematics STEM tasks.
108
+
109
+ real-world text understanding. Since models are pretrained on the Internet, this enables us to test how well they can extract useful knowledge from massive corpora. Future models that use this test could be single models or a mixture of experts model. To succeed at our test, future models should be well-rounded, possess extensive world knowledge, and develop expert-level problem solving ability. These properties make the test likely to be an enduring and informative goalpost.
110
+
111
+ # 3.1 HUMANITIES
112
+
113
+ The humanities is a group of disciplines that make use of qualitative analysis and analytic methods rather than scientific empirical methods. Branches of the humanities include law, philosophy, history, and so on (Appendix B). Mastering these subjects requires a variety of skills. For example, legal understanding requires knowledge of how to apply rules and standards to complex scenarios, and also provide answers with stipulations and explanations. We illustrate this in Figure 2. Legal understanding is also necessary for understanding and following rules and regulations, a necessary capability to constrain open-world machine learning models. For philosophy, our questions cover concepts like logical fallacies, formal logic, and famous philosophical arguments. It also covers moral scenarios, including questions from the ETHICS dataset (Hendrycks et al., 2020) that test a model’s understanding of normative statements through predicting widespread moral intuitions about diverse everyday scenarios. Finally, our history questions cover a wide range of time periods and geographical locations, including prehistory and other advanced subjects.
114
+
115
+ # 3.2 SOCIAL SCIENCE
116
+
117
+ Social science includes branches of knowledge that examine human behavior and society. Subject areas include economics, sociology, politics, geography, psychology, and so on. See Figure 3 for an example question. Our economics questions include microeconomics, macroeconomics, and econometrics, and cover different types of problems, including questions that require a mixture of world knowledge, qualitative reasoning, or quantitative reasoning. We also include important but more esoteric topics such as security studies in order to test the boundaries of what is experienced and learned during pretraining. Social science also includes psychology, a field that may be especially important for attaining a nuanced understanding of humans.
118
+
119
+ # 3.3 SCIENCE, TECHNOLOGY, ENGINEERING, AND MATHEMATICS (STEM)
120
+
121
+ STEM subjects include physics, computer science, mathematics, and more. Two examples are shown in Figure 4. Conceptual physics tests understanding of simple physics principles and may be thought
122
+
123
+ A 33-year-old man undergoes a radical thyroidectomy for thyroid cancer. During the operation, moderate hemorrhaging requires ligation of several vessels in the left side of the neck. Postoperatively, serum studies show a calcium concentration of $7 . 5 \ : \mathrm { m g / d L } ,$ , albumin concentration of $4 \ : \mathrm { g / d L }$ , and parathyroid hormone concentration of $2 0 0 \mathrm { p g / m L }$ . Damage to which of the following vessels caused the findings in this patient?
124
+
125
+ (A) Branch of the costocervical trunk (B) Branch of the external carotid artery (C) Branch of the thyrocervical trunk (D) Tributary of the internal jugular vein
126
+
127
+ of as a harder version of the physical commonsense benchmark Physical IQA (Bisk et al., 2019). We also test mathematical problem solving ability at various levels of difficulty, from the elementary to the college level. College mathematics questions, like those found on the GRE mathematics subject test, often require chains of reasoning and abstract knowledge. To encode mathematics expressions, we use LaTeX or symbols such as \* and ˆ for multiplication and exponentiation respectively. STEM subjects require knowledge of empirical methods, fluid intelligence, and procedural knowledge.
128
+
129
+ # 3.4 OTHER
130
+
131
+ There is a long tail of subjects that either do not neatly fit into any of the three preceding categories or for which there are not thousands of freely available questions. We put these subjects into Other. This section includes the Professional Medicine task, which has difficult questions that require humans many years of study to master. An example is depicted in Figure 5. This section also contains business topics like finance, accounting, and marketing, as well as knowledge of global facts. The latter includes statistics about poverty in different countries over time, which may be necessary for having an accurate model of the world internationally.
132
+
133
+ # 4 EXPERIMENTS
134
+
135
+ # 4.1 SETUP
136
+
137
+ Assessment and Models. To measure performance on our multitask test, we compute the classification accuracy across all examples and tasks. We evaluate GPT-3 (Brown et al., 2020) and UnifiedQA (Khashabi et al., 2020). For GPT-3 we use the OpenAI API, which provides access to four model variants, “Ada,” “Babbage,” “Curie,” and “Davinci,” which we refer to as “Small” (2.7 billion parameters), “Medium” (6.7 billion), “Large” (13 billion) and “X-Large” (175 billion). UnifiedQA uses the T5 (Raffel et al., 2019) text-to-text backbone and is fine-tuned on previously proposed question answering datasets (Lai et al., 2017), where the prediction is the class with the highest token overlap with UnifiedQA’s text output. Since UnifiedQA is fine-tuned on other datasets, we evaluate it without any further tuning to assess its transfer accuracy. We also fine-tune RoBERTa-base, ALBERT-xxlarge, and GPT-2 on UnifiedQA training data and our dev+val set. We primarily focus on UnifiedQA and GPT-3 in the rest of this document, but additional discussion of RoBERTa, ALBERT, and GPT-2 is in Appendix A.
138
+
139
+ <table><tr><td>Model</td><td>Humanities</td><td>Social Science</td><td>STEM</td><td>Other</td><td>Average</td></tr><tr><td>RandomBaseline</td><td>25.0</td><td>25.0</td><td>25.0</td><td>25.0</td><td>25.0</td></tr><tr><td>RoBERTa</td><td>27.9</td><td>28.8</td><td>27.0</td><td>27.7</td><td>27.9</td></tr><tr><td>ALBERT</td><td>27.2</td><td>25.7</td><td>27.7</td><td>27.9</td><td>27.1</td></tr><tr><td>GPT-2</td><td>32.8</td><td>33.3</td><td>30.2</td><td>33.1</td><td>32.4</td></tr><tr><td>UnifiedQA</td><td>45.6</td><td>56.6</td><td>40.2</td><td>54.6</td><td>48.9</td></tr><tr><td>GPT-3 Small (few-shot)</td><td>24.4</td><td>30.9</td><td>26.0</td><td>24.1</td><td>25.9</td></tr><tr><td>GPT-3 Medium (few-shot)</td><td>26.1</td><td>21.6</td><td>25.6</td><td>25.5</td><td>24.9</td></tr><tr><td>GPT-3 Large (few-shot)</td><td>27.1</td><td>25.6</td><td>24.3</td><td>26.5</td><td>26.0</td></tr><tr><td>GPT-3 X-Large (few-shot)</td><td>40.8</td><td>50.4</td><td>36.7</td><td>48.8</td><td>43.9</td></tr></table>
140
+
141
+ Table 1: Average weighted accuracy for each model on all four broad disciplines. All values are percentages. Some models proposed in the past few months can move several percent points beyond random chance. GPT-3 uses few-shot learning and UnifiedQA is tested under distribution shift.
142
+
143
+ Few-Shot Prompt. We feed GPT-3 prompts like that shown in Figure 1a. We begin each prompt with “The following are multiple choice questions (with answers) about [subject].” For zero-shot evaluation, we append the question to the prompt. For few-shot evaluation, we add up to 5 demonstration examples with answers to the prompt before appending the question. All prompts end with “Answer: ”. The model then produces probabilities for the tokens “A,” “B,” “C,” and “D,” and we treat the highest probability option as the prediction. For consistent evaluation, we create a dev set with 5 fixed few-shot examples for each subject.
144
+
145
+ # 4.2 RESULTS
146
+
147
+ Model Size and Accuracy. We compare the few-shot accuracy of each GPT-3 size in Table 1. We find that the three smaller GPT-3 models have near random accuracy (around $2 5 \%$ ). In contrast, we find that the X-Large 175 billion parameter GPT-3 model performs substantially better than random, with an accuracy of $4 3 . 9 \%$ . We also find qualitatively similar results in the zero-shot setting. While the smaller models have around $2 5 \%$ zero-shot accuracy, Figure 10 in Appendix A shows that the largest GPT-3 model has a much higher zero-shot accuracy of about $3 7 . 7 \%$ . Brown et al. (2020) also observe that larger GPT-3 models perform better, though progress tends to be steadier. In Figure 1b we show that non-random accuracy on the multitask test emerged with recent large few-shot models compared to datasets that assess commonsense and linguistic understanding.
148
+
149
+ To test the usefulness of fine-tuning instead of few-shot learning, we also evaluate UnifiedQA models. UnifiedQA has the advantage of being fine-tuned on other question answering datasets, unlike GPT-3. We assess UnifiedQA by evaluating its transfer performance without any additional fine-tuning. The largest UnifiedQA model we test has 11 billion parameters, which is slightly smaller than GPT-3 Large. Nevertheless, we show in Table 1 that it attains $4 8 . 9 \%$
150
+
151
+ ![](images/0fafbd66b658b2f581ade86190f1115600d0cbad7c7262a523ded5840455a1a5.jpg)
152
+ Figure 6: GPT-3 (few-shot) and UnifiedQA results.
153
+
154
+ accuracy. This performs better than the few-shot GPT-3 X-Large model, despite UnifiedQA have an order of magnitude fewer parameters. We also find that even the smallest UnifiedQA variant, with just 60 million parameters, has approximately $2 9 . 3 \%$ accuracy. These results suggest that while model size is a key component for achieving strong performance, fine-tuning also helps.
155
+
156
+ Comparing Disciplines. Using our test, we discover that GPT-3 and UnifiedQA have lopsided performance and several substantial knowledge gaps. Figure 6 shows the accuracy of GPT-3 (fewshot) and UnifiedQA for all 57 tasks. It shows the both models are below expert-level performance for all tasks, with GPT-3’s accuracy ranging from $6 9 \%$ for US Foreign Policy to $2 6 \%$ for College Chemistry. UnifiedQA does best on marketing, with an accuracy of $8 2 . 5 \%$ .
157
+
158
+ Overall, models do poorly on highly procedural problems. Figure 6 shows that calculation-heavy STEM subjects tend to have low accuracy compared to verbal subjects. For GPT-3, 9 out of the 10
159
+
160
+ # Declarative vs. Procedural Knowledge
161
+
162
+ Prompt and Completion: The order of operations or PEMDAS is Parentheses Exponents Multiplication Division Addition Subtraction
163
+
164
+ Prompt and Completion: $( 1 + 1 ) \times 2 = 3 .$
165
+
166
+ ![](images/ec2bf66cc68ad0b8b3e28707066ac4282820073d4e419043111358943d6aa7c7.jpg)
167
+ Figure 7: GPT-3’s completion for two prompts testing knowledge of the order of operations. The blue underlined bold text is the autocompleted response from GPT-3. While it knows about the order of operations, it sometimes does not know how to apply its knowledge.
168
+ Figure 8: GPT-3’s confidence is a poor estimator of its accuracy and can be off by up to $2 4 \%$ .
169
+
170
+ lowest-accuracy tasks are STEM subjects that emphasize mathematics or calculations. We speculate that is in part because GPT-3 acquires declarative knowledge more readily than procedural knowledge. For example, many questions in Elementary Mathematics require applying the order of operations for arithmetic, which is described by the acronym PEMDAS (Parentheses Exponents Multiplication Division Addition Subtraction). In Figure 7, we confirm that GPT-3 is aware of the acronym PEMDAS. However, it does not consistently apply PEMDAS to actual problems. On the other hand, procedural understanding is not its only weak point. We find that some verbal tasks such as Moral Scenarios from Hendrycks et al. (2020) and Professional Law also have especially low accuracy.
171
+
172
+ Our test also shows that GPT-3 acquires knowledge quite unlike humans. For example, GPT-3 learns about topics in a pedagogically unusual order. GPT-3 does better on College Medicine $( 4 7 . 4 \% )$ and College Mathematics $( 3 5 . 0 \% )$ than calculation-heavy Elementary Mathematics $( 2 9 . 9 \% )$ . GPT-3 demonstrates unusual breadth, but it does not master a single subject. Meanhwhile we suspect humans have mastery in several subjects but not as much breadth. In this way, our test shows that GPT-3 has many knowledge blindspots and has capabilities that are lopsided.
173
+
174
+ Calibration. We should not trust a model’s prediction unless the model is calibrated, meaning that its confidence is a good estimate of the actual probability the prediction is correct. However, large neural networks are often miscalibrated (Guo et al., 2017), especially under distribution shift (Ovadia et al., 2019). We evaluate the calibration of GPT-3 by testing how well its average confidence estimates its actual accuracy for each subject. We show the results in Figure 8, which demonstrates that GPT-3 is uncalibrated. In fact, its confidence is only weakly related to its actual accuracy in the zero-shot setting, with the difference between its accuracy and confidence reaching up to $\dot { 2 } 4 \%$ for some subjects. Another calibration measure is the Root Mean Squared (RMS) calibration error (Hendrycks et al., 2019a; Kumar et al., 2019). Many tasks have miscalibrated predictions, such as Elementary Mathematics which has a zero-shot RMS calibration error of $1 9 . 4 \%$ . Models are only somewhat more calibrated in the few-shot setting, as shown in Appendix A. These results suggest that model calibration has wide room for improvement.
175
+
176
+ # 5 DISCUSSION
177
+
178
+ Multimodal Understanding. While text is capable of conveying an enormous number of concepts about the world, many important concepts are conveyed mainly through other modalities, such as images, audio, and physical interaction (Bisk et al., 2020). Existing large-scale NLP models, such as GPT-3, do not incorporate multimodal information, so we design our benchmark to capture a diverse array of tasks in a text-only format. However, as models gain the ability to process multimodal inputs, benchmarks should be designed to reflect this change. One such benchmark could be a “Turk Test,” consisting of Amazon Mechanical Turk Human Intelligence Tasks. These are well-defined tasks that require models to interact with flexible formats and demonstrate multimodal understanding.
179
+
180
+ The Internet as a Training Set. A major distinction between our benchmark and previous multitask NLP benchmarks is that we do not require large training sets. Instead, we assume that models have acquired the requisite knowledge from reading vast quantities of diverse text from the Internet. This process is typically called pretraining, but it can be thought of as training in its own right, where the downstream evaluation is demonstrating whatever knowledge we would expect a human to pick up from reading the same text.
181
+
182
+ This motivates us to propose a methodological change so that models are trained more like how humans learn. While most previous machine learning benchmarks have models learn from a large question bank, humans primarily learn new subjects by reading books and listening to others talk about the topic. For specialized subjects such as Professional Law, massive legal corpora are available, such as the 164-volume legal encyclopedia Corpus Juris Secundum, but there are fewer than 5,000 multistate bar exam questions available. Learning the entire law exclusively through a small number of practice tests is implausible, so future models must learn more during pretraining.
183
+
184
+ For this reason we assess pretrained models in a zero-shot, few-shot, or transfer setting and we provide a dev, val, and test set for each task. The dev set is used for few-shot prompts, the val set could be used for hyperparameter tuning, and the test set is used to compute the final accuracy. Importantly, the format of our evaluation is not identical to the format in which information is acquired during pretraining. This has the benefit of obviating concerns about spurious training set annotation artifacts (Geirhos et al., 2020; Hendrycks et al., 2019b) and is in stark contrast to the previous paradigm of identically distributed training and test sets. This change also enables collecting a much more extensive and diverse set of tasks for evaluation. We anticipate our methodology becoming more widespread as models improve at extracting information from diverse online sources.
185
+
186
+ Model Limitations. We find that current large-scale Transformers have wide room for improvement. They are notably poor at modeling human (dis)approval, as evident by the low performance on the Professional Law and Moral Scenarios tasks. For future systems to be aligned with human values, high performance on these tasks is crucial (Hendrycks et al., 2020), so future research should especially aim to increase accuracy on these tasks. Models also have difficulty performing calculations, so much so that they exhibit poor performance on Elementary Mathematics and many other STEM subjects with “plug and chug” problems. Additionally, they do not match expert-level performance $( 9 0 \% )$ on any subject, so for all subjects it is subhuman. On average, models are only now starting to move beyond random-chance accuracy levels.
187
+
188
+ Addressing these shortcomings may be challenging. To illustrate this, we attempted to create a better Professional Law model by pretraining on specialized data but achieved only limited success. We collected approximately 2,000 additional Professional Law training examples. After fine-tuning a RoBERTa-base model (Liu et al., 2019) using this custom training set, our model attained $3 2 . 8 \%$ test accuracy. To test the impact of additional specialized training data, we also had RoBERTa continue pretraining on approximately 1.6 million legal case summaries using Harvard’s Law Library case law corpus case.law, but after fine-tuning it only attained $3 6 . 1 \%$ accuracy. This suggests that while additional pretraining on relevant high quality text can help, it may not be enough to substantially increase the performance of current models.
189
+
190
+ It is unclear whether simply scaling up existing language models will solve the test. Current understanding indicates that a $1 0 \times$ increase in model size must be accompanied by an approximate $5 \times$ increase in data (Kaplan et al., 2020). Aside from the tremendous expense in creating multi-trillion parameter language models, data may also become a bottleneck, as there is far less written about esoteric branches of knowledge than about everyday situations.
191
+
192
+ # 6 CONCLUSION
193
+
194
+ We introduced a new test that measures how well text models can learn and apply knowledge encountered during pretraining. By covering 57 subjects at varying levels of difficulty, the test assesses language understanding in greater breadth and depth than previous benchmarks. We found that it has recently become possible for models to make meaningful progress on the test, but that state-of-the-art models have lopsided performance and rarely excel at any individual task. We also showed that current models are uncalibrated and have difficulty with tasks that require calculations. Worryingly, models also perform especially poorly on socially relevant subjects including morality and law. Our expansive test can help researchers pinpoint important shortcomings of models, making it easier to gain a clearer picture of state-of-the-art capabilities.
195
+
196
+ # ACKNOWLEDGEMENTS
197
+
198
+ We would like to thank the following for their helpful comments: Oyvind Tafjord, Jan Leike, David Krueger, Alex Tamkin, Girish Sastry, and Henry Zhu. DH is supported by the NSF GRFP Fellowship and an Open Philanthropy Project Fellowship. This research was also supported by the NSF Frontier Award 1804794.
199
+
200
+ # REFERENCES
201
+
202
+ M. G. Bellemare, Y. Naddaf, J. Veness, and M. Bowling. The arcade learning environment: An evaluation platform for general agents (extended abstract). J. Artif. Intell. Res., 47:253–279, 2013.
203
+ Y. Bisk, R. Zellers, R. L. Bras, J. Gao, and Y. Choi. Piqa: Reasoning about physical commonsense in natural language, 2019.
204
+ Y. Bisk, A. Holtzman, J. Thomason, J. Andreas, Y. Bengio, J. Chai, M. Lapata, A. Lazaridou, J. May, A. Nisnevich, N. Pinto, and J. Turian. Experience grounds language, 2020.
205
+ T. B. Brown, B. Mann, N. Ryder, M. Subbiah, J. Kaplan, P. Dhariwal, A. Neelakantan, P. Shyam, G. Sastry, A. Askell, S. Agarwal, A. Herbert-Voss, G. Krueger, T. Henighan, R. Child, A. Ramesh, D. M. Ziegler, J. Wu, C. Winter, C. Hesse, M. Chen, E. Sigler, M. Litwin, S. Gray, B. Chess, J. Clark, C. Berner, S. McCandlish, A. Radford, I. Sutskever, and D. Amodei. Language models are few-shot learners, 2020.
206
+ P. Clark, I. Cowhey, O. Etzioni, T. Khot, A. Sabharwal, C. Schoenick, and O. Tafjord. Think you have solved question answering? try arc, the ai2 reasoning challenge. ArXiv, abs/1803.05457, 2018.
207
+ P. Clark, O. Etzioni, D. Khashabi, T. Khot, B. D. Mishra, K. Richardson, A. Sabharwal, C. Schoenick, O. Tafjord, N. Tandon, S. Bhakthavatsalam, D. Groeneveld, M. Guerquin, and M. Schmitz. From ’f’ to ’a’ on the n.y. regents science exams: An overview of the aristo project. ArXiv, abs/1909.01958, 2019.
208
+ J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. ArXiv, abs/1810.04805, 2019.
209
+ R. Geirhos, J.-H. Jacobsen, C. Michaelis, R. Zemel, W. Brendel, M. Bethge, and F. A. Wichmann. Shortcut learning in deep neural networks, 2020.
210
+ C. Guo, G. Pleiss, Y. Sun, and K. Q. Weinberger. On calibration of modern neural networks. ICML, 2017.
211
+ D. Hendrycks, M. Mazeika, and T. Dietterich. Deep anomaly detection with outlier exposure. ICLR, 2019a.
212
+ D. Hendrycks, K. Zhao, S. Basart, J. Steinhardt, and D. Song. Natural adversarial examples. ArXiv, abs/1907.07174, 2019b.
213
+ D. Hendrycks, C. Burns, S. Basart, A. Critch, J. Li, D. Song, and J. Steinhardt. Aligning ai with shared human values, 2020.
214
+ L. Huang, R. L. Bras, C. Bhagavatula, and Y. Choi. Cosmos qa: Machine reading comprehension with contextual commonsense reasoning, 2019.
215
+ J. Kaplan, S. McCandlish, T. Henighan, T. B. Brown, B. Chess, R. Child, S. Gray, A. Radford, J. Wu, and D. Amodei. Scaling laws for neural language models, 2020.
216
+ D. Khashabi, T. Khot, A. Sabharwal, O. Tafjord, P. Clark, and H. Hajishirzi. Unifiedqa: Crossing format boundaries with a single qa system, 2020.
217
+ T. Khot, P. Clark, M. Guerquin, P. Jansen, and A. Sabharwal. Qasc: A dataset for question answering via sentence composition, 2019.
218
+ A. Kumar, P. Liang, and T. Ma. Verified uncertainty calibration, 2019.
219
+
220
+ G. Lai, Q. Xie, H. Liu, Y. Yang, and E. Hovy. Race: Large-scale reading comprehension dataset from examinations, 2017.
221
+
222
+ Z. Lan, M. Chen, S. Goodman, K. Gimpel, P. Sharma, and R. Soricut. Albert: A lite bert for self-supervised learning of language representations. ArXiv, abs/1909.11942, 2020.
223
+
224
+ Y. Liu, M. Ott, N. Goyal, J. Du, M. Joshi, D. Chen, O. Levy, M. Lewis, L. Zettlemoyer, and V. Stoyanov. Roberta: A robustly optimized bert pretraining approach. ArXiv, abs/1907.11692, 2019.
225
+
226
+ T. Mihaylov, P. Clark, T. Khot, and A. Sabharwal. Can a suit of armor conduct electricity? a new dataset for open book question answering. In EMNLP, 2018.
227
+
228
+ Y. Ovadia, E. Fertig, J. Ren, Z. Nado, D. Sculley, S. Nowozin, J. V. Dillon, B. Lakshminarayanan, and J. Snoek. Can you trust your model’s uncertainty? Evaluating predictive uncertainty under dataset shift. NeurIPS, 2019.
229
+
230
+ F. Petroni, T. Rocktäschel, P. Lewis, A. Bakhtin, Y. Wu, A. H. Miller, and S. Riedel. Language models as knowledge bases?, 2019.
231
+
232
+ A. Radford, J. Wu, R. Child, D. Luan, D. Amodei, and I. Sutskever. Language models are unsupervised multitask learners. 2019.
233
+
234
+ C. Raffel, N. Shazeer, A. Roberts, K. Lee, S. Narang, M. Matena, Y. Zhou, W. Li, and P. J. Liu. Exploring the limits of transfer learning with a unified text-to-text transformer, 2019.
235
+
236
+ M. Richardson, C. J. Burges, and E. Renshaw. MCTest: A challenge dataset for the open-domain machine comprehension of text. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pages 193–203, Seattle, Washington, USA, Oct. 2013. Association for Computational Linguistics.
237
+
238
+ A. B. Sai, A. K. Mohankumar, and M. M. Khapra. A survey of evaluation metrics used for nlg systems. 2020.
239
+
240
+ A. Turing. Computing machinery and intelligence. 1950.
241
+
242
+ A. Wang, A. Singh, J. Michael, F. Hill, O. Levy, and S. R. Bowman. Glue: A multi-task benchmark and analysis platform for natural language understanding, 2018.
243
+
244
+ A. Wang, Y. Pruksachatkun, N. Nangia, A. Singh, J. Michael, F. Hill, O. Levy, and S. R. Bowman. Superglue: A stickier benchmark for general-purpose language understanding systems, 2019.
245
+
246
+ R. Zellers, A. Holtzman, Y. Bisk, A. Farhadi, and Y. Choi. Hellaswag: Can a machine really finish your sentence?, 2019.
247
+
248
+ R. Zellers, A. Holtzman, E. Clark, L. Qin, A. Farhadi, and Y. Choi. Evaluating machines by their real-world language use, 2020.
249
+
250
+ # A ADDITIONAL ANALYSIS
251
+
252
+ This appendix includes figures with sorted results (Figure 9), few-shot examples vs. accuracy (Figure 10), and few-shot calibration (Figure 11). It also includes sections on fine-tuning, error analysis, and format sensitivity.
253
+
254
+ ![](images/ccc60356a128161dfdd90fe032711edcc08a8daad745fefb4326739269d6488e.jpg)
255
+ Figure 9: On the left are GPT-3 few shot accuracies for all of the 57 tasks. On the right are UnifiedQA transfer accuracies for all of the 57 tasks. For both models, capabilities are lopsided.
256
+
257
+ # A.1 ANALYSIS WITH MORE FINE-TUNED MODELS
258
+
259
+ We primarily analyzed models with more than 10 billion parameters in the main body of the paper. For this section, we analyze smaller models including RoBERTa-base (125 million parameters) (Liu et al., 2019), ALBERT-xxlarge (223 million parameters) (Lan et al., 2020), and GPT-2 (1,558 million parameters) (Radford et al., 2019). Models are fine-tuned to predict one of four classes using the UnifiedQA MCQ questions and using our dev+val set. We test on our multitask test set.
260
+
261
+ We observe that these smaller models can attain better-than-random accuracy. RoBERTa-base attains an overall accuracy of $2 7 . 9 \%$ , with $2 7 . 9 \%$ accuracy for the humanities, $2 \dot { 8 } . 8 \%$ for social sciences, $2 7 . 0 \%$ for STEM, and $2 7 . 7 \%$ for other. ALBERT-xxlarge attains an accuracy of $2 7 . 1 \%$ , with $2 7 . 2 \%$ accuracy for the humanities, $2 5 . 7 \%$ for the social sciences, $2 7 . 7 \%$ for STEM, and $2 7 . 9 \%$ for other. GPT-2 attains an accuracy of $3 2 . 4 \%$ , with $3 2 . 8 \%$ accuracy for the humanities, $3 3 . 3 \%$ for the social sciences, $3 0 . 2 \%$ for STEM, and $3 3 . 1 \%$ for other.
262
+
263
+ Compare this to UnifiedQA’s smallest variant, which has just 60 million parameters and approximately $2 9 . 3 \%$ accuracy. It obtains higher accuracy than RoBERTa and ALBERT, even though it has fewer parameters. This suggests that its larger pretraining dataset enables higher accuracy. Likewise, UnifiedQA with 3 billion parameters attains $4 3 . 7 \%$ , while the similarly sized GPT-2 model with 1.5 billion parameters attains ${ \mathrm { 3 2 . 4 \% } }$ accuracy. This again suggests that T5’s larger pretraining dataset size (and therefore UnifiedQA’s pretraining dataset size) can increase accuracy.
264
+
265
+ # A.2 ERROR ANALYSIS
266
+
267
+ We qualitatively analyze when GPT-3 makes high confidence mistakes. We find that while many of these mistakes were clearly wrong, many were mistakes that a human might make. For example, one question it got wrong was “How many chromosomes do all human somatic cells contain?” The correct answer is 46, while few-shot GPT-3 predicted 23 with confidence $9 7 . 5 \%$ . This answer would have been correct if the question asked about the number of pairs of chromosomes. Similarly, many of its other high confidence mistakes were also correct answers to slightly different questions.
268
+
269
+ # A.3 FORMAT SENSITIVITY
270
+
271
+ While different question formatting choices often lead to similar GPT-3 accuracies, we find that UnifiedQA is more sensitive. UnifiedQA’s input format is of the form
272
+
273
+ QUESTION1 \\n (A) CHOICE1 (B) CHOICE2 (C) CHOICE3 (D) CHOICE $4 < / \mathrm { { s } } >$
274
+
275
+ where questions and choices are normalized and made lowercase. If we remove the $< / \varsigma >$ from the input, accuracy declines by several percentage points.
276
+
277
+ ![](images/a916262b3beea5f471a9f4eec528c6bafaedf5eced7cbbc46d5c8b14707a52ae.jpg)
278
+ Figure 10: As the number of few-shot instruction examples increases, the accuracy monotonically increases. Notably, zero-shot performance is only somewhat lower than 5-shot accuracy.
279
+
280
+ ![](images/73b33c8ef88b587b88e1958267e89b58a686d13cd2e726f04ddb9edaf302801c.jpg)
281
+ Figure 11: While models are more calibrated in a few-shot setting than a zero-shot setting, they are still miscalibrated, with gap between accuracy and confidence reaching up to $1 4 \%$ . Here the correlation between confidence and accuracy is $r = 0 . 8 1$ , compared to $r = 0 . 6 3$ in the zero-shot setting.
282
+
283
+ # B TEST DETAILS
284
+
285
+ # B.1 TASK DESCRIPTIONS AND EXAMPLES
286
+
287
+ We provide analysis of question length and difficulty in Figure 12. We list all tasks and the topics they test in Table 2. We also provide an example for each task starting with Figure 14.
288
+
289
+ ![](images/09e0c8acaa40029a0188bbc8536a88f38979a905c2ad6683efb3a2432db004c9.jpg)
290
+ Figure 12: Figures on the relation between question difficulty and question length. For questions longer than a tweet (280 characters), the correlation between question length and true label confidence is slightly positive. This shows that longer questions are not necessarily harder.
291
+
292
+ # B.2 EXACT QUESTION AND ANSWER CONTAMINATION
293
+
294
+ Since language models train on vast text corpora, there is some chance that they have seen the exact question and answer during pretraining. If they memorized the exact question and answer, then they would attain higher accuracy than their true ability. Likewise, a question’s entropy would be especially low if it were memorized. Memorized questions and answers should have low entropy and high accuracy. However, in Figure 13, we see that accuracy and question entropy are not positively correlated, suggesting that the test’s low-entropy questions do not correspond to memorized (and thereby correctly predicted) answers. This suggests that our exact questions were not memorized. However, during pretraining models encountered text related to our questions through processing Wikipedia. We also note that most of our questions came from PDFs or websites where questions and answers are on separate pages.
295
+
296
+ See Brown et al. (2020) for a previous discussion of contamination showing that the phenomena hardly affects performance. To reduce the probability that future models encounter exact questions during test-time, we will provide a list of question sources.
297
+
298
+ ![](images/338b8dc1cd186c3a09f99c2cc6ca109645f823bd7882b61418e5d811fdff9618.jpg)
299
+ Figure 13: The average log probability of the question (without answer) is not strongly positively correlated with accuracy, all else equal. Each point corresponds to a task. Higher log probability indicates higher compression, and especially high log probability would suggest memorization. In the zero-shot question prompt, the correlation between average log probability and accuracy is $r = - 0 . 4 3$ , and for the few-shot setting the correlation is $r = - 0 . 5 6$ .
300
+
301
+ Table 2: Summary of all 57 tasks.
302
+
303
+ <table><tr><td>TaSk Abstract Algebra</td><td>Groups,rings, fields, vector spaces,.</td><td>Supelcalegory STEM</td></tr><tr><td>Anatomy</td><td>Central nervous system, circulatory system.,..</td><td>STEM</td></tr><tr><td></td><td>Solar system, galaxies,asteroids,...</td><td>STEM</td></tr><tr><td>Astronomy</td><td></td><td></td></tr><tr><td>Business Ethics</td><td>Corporate responsibility,stakeholders,regulation.,.</td><td>Other</td></tr><tr><td>Clinical Knowledge</td><td>Spot diagnosis, joints,abdominal examination.,.</td><td>Other</td></tr><tr><td>College Biology</td><td>Cellular structure, molecular biology, ecology,..</td><td>STEM</td></tr><tr><td>College Chemistry</td><td>Analytical, organic,inorganic,physical,..</td><td>STEM</td></tr><tr><td>College Computer Science</td><td>Algorithms,systems,graphs,recursion,.</td><td>STEM</td></tr><tr><td>College Mathematics College Medicine</td><td>Differential equations, real analysis,combinatorics,.</td><td>STEM</td></tr><tr><td>College Physics</td><td>Introductory biochemistry, sociology,reasoning,..</td><td>Other</td></tr><tr><td>Computer Security</td><td>Electromagnetism, thermodynamics,special relativity,..</td><td>STEM</td></tr><tr><td>Conceptual Physics</td><td>Cryptography, malware, side channels, fuzzing,..</td><td>STEM</td></tr><tr><td>Econometrics</td><td>Newton&#x27;s laws,rotational motion, gravity, sound,..</td><td>STEM</td></tr><tr><td>Electrical Engineering</td><td>Volatility,long-run relationships,forecasting,.</td><td>Social Sciences</td></tr><tr><td>Elementary Mathematics</td><td>Circuits, power systems, electrical drives,..</td><td>STEM</td></tr><tr><td>Formal Logic</td><td>Word problems, multiplication, remainders, rounding,..</td><td>STEM</td></tr><tr><td>Global Facts</td><td>Propositions, predicate logic, first-order logic,..</td><td>Humanities</td></tr><tr><td>High School Biology</td><td>Extreme poverty, literacy rates,life expectancy,.</td><td>Other</td></tr><tr><td>High School Chemistry</td><td>Natural selection,heredity,cell cycle,Krebs cycle,.</td><td>STEM</td></tr><tr><td>High School Computer Science</td><td>Chemical reactions, ions,acids and bases,. Arrays,conditionals,iteration, inheritance...</td><td>STEM</td></tr><tr><td>High School European History</td><td>Renaissance,reformation, industrialization,.</td><td>STEM</td></tr><tr><td>High School Geography</td><td>Population migration, rural land-use,urban processes,.</td><td>Humanities</td></tr><tr><td>High School Gov&#x27;t and Politics</td><td>Branches of government, civil liberties, political ideologies,.</td><td>Social Sciences</td></tr><tr><td>High School Macroeconomics</td><td>Economic indicators,national income,international trade,.</td><td>Social Sciences</td></tr><tr><td>High School Mathematics</td><td>Pre-algebra, algebra, trigonometry, calculus,.</td><td>Social Sciences</td></tr><tr><td>High School Microeconomics</td><td></td><td>STEM</td></tr><tr><td>High School Physics</td><td>Supply and demand, imperfect competition,market failure.,.</td><td>Social Sciences</td></tr><tr><td>High School Psychology</td><td>Kinematics, energy, torque,fluid pressure.,..</td><td>STEM</td></tr><tr><td>High School Statistics</td><td>Behavior, personality, emotions,learning,. Random variables,sampling distributions,chi-square tests.,..</td><td>Social Sciences</td></tr><tr><td>High School US History</td><td>Civil War, the Great Depression, The Great Society,..</td><td>STEM</td></tr><tr><td>High School World History</td><td>Ottoman empire, economic imperialism, World War I,..</td><td>Humanities</td></tr><tr><td>Human Aging</td><td>Senescence, dementia, longevity, personality changes,..</td><td>Humanities</td></tr><tr><td>Human Sexuality</td><td>Pregnancy,sexual differentiation, sexual orientation,.</td><td>Other</td></tr><tr><td>International Law</td><td>Human rights, sovereignty, law of the sea,use of force,.</td><td>Social Sciences</td></tr><tr><td>Jurisprudence</td><td>Natural law,classical legal positivism,legal realism,.</td><td>Humanities</td></tr><tr><td>Logical Fallacies</td><td>No true Scotsman, base rate fallacy, composition fallacy,..</td><td>Humanities</td></tr><tr><td>Machine Learning</td><td></td><td>Humanities</td></tr><tr><td>Management</td><td>SVMs, VC dimension, deep learning architectures,.</td><td>STEM</td></tr><tr><td>Marketing</td><td>Organizing, communication, organizational structure.,..</td><td>Other</td></tr><tr><td>Medical Genetics</td><td>Segmentation, pricing,market research,. Genes and cancer,common chromosome disorders.,.</td><td>Other</td></tr><tr><td>Miscellaneous</td><td>Agriculture, Fermi estimation, pop culture.,.</td><td>Other</td></tr><tr><td>Moral Disputes</td><td>Freedom of speech, addiction, the death penalty,.</td><td>Other</td></tr><tr><td>Moral Scenarios</td><td>Detecting physical violence, stealing, externalities,.</td><td>Humanities</td></tr><tr><td>Nutrition</td><td>Metabolism,water-soluble vitamins,diabetes,..</td><td>Humanities Other</td></tr><tr><td>Philosophy</td><td>Skepticism, phronesis, skepticism, Singer&#x27;s Drowning Child,...</td><td>Humanities</td></tr><tr><td>Prehistory</td><td>Neanderthals, Mesoamerica, extinction, stone tools,..</td><td>Humanities</td></tr><tr><td>Professional Accounting</td><td>Auditing,reporting,regulation,valuation.,.</td><td>Other</td></tr><tr><td>Professional Law</td><td>Torts, criminal law, contracts, property, evidence..</td><td>Humanities</td></tr><tr><td>Professional Medicine</td><td>Diagnosis,pharmacotherapy, disease prevention,.</td><td>Other</td></tr><tr><td>Professional Psychology</td><td>Diagnosis,biology and behavior, lifespan development,.</td><td>Social Sciences</td></tr><tr><td>Public Relations</td><td></td><td></td></tr><tr><td>Security Studies</td><td>Media theory,crisis management, intelligence gathering,.</td><td>Social Sciences</td></tr><tr><td></td><td>Environmental security, terrorism,weapons of mass destruction,.</td><td>Social Sciences</td></tr><tr><td>Sociology</td><td>Socialization,cities and community, inequality and wealth.,..</td><td>Social Sciences</td></tr><tr><td>US Foreign Policy</td><td>Soft power, Cold War foreign policy, isolationism,.</td><td>Social Sciences</td></tr><tr><td>Virology</td><td>Epidemiology, coronaviruses,retroviruses, herpesviruses,.</td><td>Other</td></tr><tr><td>World Religions</td><td>Judaism, Christianity,Islam,Buddhism,Jainism.,..</td><td>Humanities</td></tr></table>
304
+
305
+ ![](images/3097ba5357528d67eb27225a91ac69dc00b8c898947a9dcc10486c38050f799c.jpg)
306
+ Figure 14: An Abstract Algebra example.
307
+
308
+ What is the embryological origin of the hyoid bone?
309
+
310
+ (A) The first pharyngeal arch (B) The first and second pharyngeal arches (C) The second pharyngeal arch (D) The second and third pharyngeal arches
311
+
312
+ ![](images/04835485ee72307b08f63af0288bd0b1395743a266a7e171e1f708ebcd0cb6da.jpg)
313
+ Figure 15: An Anatomy example.
314
+ Figure 16: An Astronomy example.
315
+
316
+ Three contrasting tactics that CSO’s can engage in to meet their aims are which typically involves research and communication, , which may involve physically attacking a company’s operations or , often involving some form of .
317
+
318
+ (A) Non-violent direct action, Violent direct action, Indirect action, Boycott (B) Indirect action, Instrumental action, Non-violent direct action, Information campaign (C) Indirect action, Violent direct action, Non-violent direct-action Boycott. (D) Non-violent direct action, Instrumental action, Indirect action, Information campaign
319
+
320
+ How many attempts should you make to cannulate a patient before passing the job on to a senior colleague?
321
+
322
+ ![](images/083f7d838c660da94841f394a2c75692742516937478a9ae2285f195a000ffa8.jpg)
323
+ Figure 17: A Business Ethics example.
324
+ Figure 18: A Clinical Knowledge example.
325
+
326
+ In a given population, 1 out of every 400 people has a cancer caused by a completely recessive allele, b. Assuming the population is in Hardy-Weinberg equilibrium, which of the following is the expected proportion of individuals who carry the b allele but are not expected to develop the cancer?
327
+
328
+ (A) 1/400 (B) 19/400 (C) 20/400 (D) 38/400
329
+
330
+ ![](images/7d0f5cd49ea6f5edf2c8439cdeeb37c79e01f23e138d1b3a4ddc627bcd364b12.jpg)
331
+ Figure 19: A College Biology example.
332
+ Figure 20: A College Chemistry example.
333
+
334
+ Consider a computer design in which multiple processors, each with a private cache memory, share global memory using a single bus. This bus is the critical system resource. Each processor can execute one instruction every 500 nanoseconds as long as memory references are satisfied by its local cache. When a cache miss occurs, the processor is delayed for an additional 2,000 nanoseconds. During half of this additional delay, the bus is dedicated to serving the cache miss. During the other half, the processor cannot continue, but the bus is free to service requests from other processors. On average, each instruction requires 2 memory references. On average, cache misses occur on 1 percent of references. What proportion of the capacity of the bus would a single processor consume, ignoring delays due to competition from other processors?
335
+
336
+ (A) 1/50 (B) 1/27 (C) 1/25 (D) 2/27
337
+
338
+ ![](images/8a9a52fe9f635db507d31c894560c4382f757970c39c8ff716958aa69f43f82a.jpg)
339
+ Figure 21: A College Computer Science example.
340
+ Figure 22: A College Mathematics example.
341
+
342
+ In a genetic test of a newborn, a rare genetic disorder is found that has X-linked recessive transmission. Which of the following statements is likely true regarding the pedigree of this disorder?
343
+
344
+ (A) All descendants on the maternal side will have the disorder.
345
+ (B) Females will be approximately twice as affected as males in this family.
346
+ (C) All daughters of an affected male will be affected.
347
+ (D) There will be equal distribution of males and females affected.
348
+
349
+ One end of a Nichrome wire of length 2L and cross-sectional area A is attached to an end of another Nichrome wire of length L and cross- sectional area 2A. If the free end of the longer wire is at an electric potential of 8.0 volts, and the free end of the shorter wire is at an electric potential of 1.0 volt, the potential at the junction of the two wires is most nearly equal to
350
+
351
+ ![](images/869e90cdbe6203349083b4f54b8b7286edb2dd5b24f4123edc5c8d3155362db9.jpg)
352
+ Figure 23: A College Medicine example.
353
+ Figure 24: A College Physics example.
354
+
355
+ ![](images/2018d0aac5f7a72d780aeac4acd9784d458ab5e9c20be1c58981705512310452.jpg)
356
+ Figure 25: A Computer Security example.
357
+ Figure 26: A Conceptual Physics example.
358
+
359
+ A model airplane flies slower when flying into the wind and faster with wind at its back. When launched at right angles to the wind, a cross wind, its groundspeed compared with flying in still air is
360
+
361
+ (A) the same (B) greater (C) less (D) either greater or less depending on wind speed
362
+
363
+ ![](images/720bb51804c66c67e2a287ed0f83e904834c687f96a78a9d8e228cbd52420a56.jpg)
364
+ Figure 27: An Econometrics example.
365
+
366
+ A point pole has a strength of $4 \pi \times 1 0 ^ { - 4 }$ weber. The force in newtons on a point pole of $4 \pi \times 1 . 5 \times 1 0 ^ { - 4 }$ weber placed at a distance of $1 0 \mathrm { c m }$ from it will be
367
+ (A) 15 N. (B) 20 N. (C) 7.5 N. (D) 3.75 N.
368
+
369
+ A total of 30 players will play basketball at a park. There will be exactly 5 players on each team. Which statement correctly explains how to find the number of teams needed?
370
+
371
+ (A) Add 5 to 30 to find 35 teams.
372
+ (B) Divide 30 by 5 to find 6 teams.
373
+ (C) Multiply 30 and 5 to find 150 teams.
374
+ (D) Subtract 5 from 30 to find 25 teams.
375
+
376
+ ![](images/41d1d9c42f9aa1ffeca158119ab042af32afe3a51d8e9df39bf8e1a534b8e61f.jpg)
377
+ Figure 28: An Electrical Engineering example.
378
+ Figure 29: An Elementary Mathematics example.
379
+ Figure 30: A Formal Logic example.
380
+
381
+ As of 2017, how many of the world’s 1-year-old children today have been vaccinated against some disease?
382
+
383
+ ![](images/484cfdc51bae1aa5ddfa3857d57bb526d1e1e20a77a8edce6398c445b36c7082.jpg)
384
+ Figure 31: A Global Facts example.
385
+
386
+ Homologous structures are often cited as evidence for the process of natural selection. All of the following are examples of homologous structures EXCEPT
387
+
388
+ ![](images/1fbc2ab52abc77b14ce01013a7f15d70efb01571e5c816221c74a2ad5a09229a.jpg)
389
+ Figure 32: A High School Biology example.
390
+
391
+ From the solubility rules, which of the following is true?
392
+
393
+ ![](images/682f359e80205ea8ff880d763947054f63baec00a23875b8230a5b50da685fbb.jpg)
394
+ Figure 33: A High School Chemistry example.
395
+
396
+ This question refers to the following information.
397
+ Albeit the king’s Majesty justly and rightfully is and ought to be the supreme head of the Church of England, and so is recognized by the clergy of this realm in their convocations, yet nevertheless, for corroboration and confirmation thereof, and for increase of virtue in Christ’s religion within this realm of England, and to repress and extirpate all errors, heresies, and other enormities and abuses heretofore used in the same, be it enacted, by authority of this present Parliament, that the king, our sovereign lord, his heirs and successors, kings of this realm, shall be taken, accepted, and reputed the only supreme head in earth of the Church of England, called Anglicans Ecclesia; and shall have and enjoy, annexed and united to the imperial crown of this realm, as well the title and style thereof, as all honors, dignities, preeminences, jurisdictions, privileges, authorities, immunities, profits, and commodities to the said dignity of the supreme head of the same Church belonging and appertaining; and that our said sovereign lord, his heirs and successors, kings of this realm, shall have full power and authority from time to time to visit, repress, redress, record, order, correct, restrain, and amend all such errors, heresies, abuses, offenses, contempts, and enormities, whatsoever they be, which by any manner of spiritual authority or jurisdiction ought or may lawfully be reformed, repressed, ordered, redressed, corrected, restrained, or amended, most to the pleasure of Almighty God, the increase of virtue in Christ’s religion, and for the conservation of the peace, unity, and tranquility of this realm; any usage, foreign land, foreign authority, prescription, or any other thing or things to the contrary hereof notwithstanding. English Parliament, Act of Supremacy, 1534
398
+ From the passage, one may infer that the English Parliament wished to argue that the Act of Supremacy would
399
+ (A) give the English king a new position of authority
400
+ (B) give the position of head of the Church of England to Henry VIII alone and exclude his heirs (C) establish Calvinism as the one true theology in England
401
+ (D) end various forms of corruption plaguing the Church in England During the third stage of the demographic transition model, which of the following is true? (A) Birth rates increase and population growth rate is less rapid.
402
+ (B) Birth rates decline and population growth rate is less rapid.
403
+ (C) Birth rates increase and population growth rate increases.
404
+ (D) Birth rates decrease and population growth rate increases. Which of the following best states an argument made by James Madison in The Federalist number 10?
405
+ (A) Honest politicians can prevent factions from developing.
406
+ (B) Factions are more likely to occur in large republics than in small ones.
407
+ (C) The negative effects of factionalism can be reduced by a republican government. (D) Free elections are the people’s best defense against factionalism.
408
+
409
+ ![](images/a199407c3a1364f10fd34ef6d79cb3324bfa38ff2eb65161660d765968487e3f.jpg)
410
+ Figure 34: A High School Computer Science example.
411
+ Figure 35: A High School European History example.
412
+ Figure 36: A High School Geography example.
413
+
414
+ ![](images/d0a2f3ca638941672b792a0e0eebdb59c5d910c14f492589114241149c8ae4d0.jpg)
415
+ Figure 37: A High School Government and Politics example.
416
+ Figure 38: A High School Macroeconomics example.
417
+
418
+ ![](images/f6107d35861aac485cf60154d154c0f0dd587c78332ab6ecaee0f43a240241f9.jpg)
419
+ Figure 39: A High School Mathematics example.
420
+
421
+ ![](images/3ce579e93ccc89449fb54d3007c7fea6fb71722e929db5ab3a73eafc97808145.jpg)
422
+ Figure 40: A High School Microeconomics example.
423
+
424
+ ![](images/4818c4ba833505441e629168f9b11bb1dbffa9d80ccaed6e4fb716e0ab45f581.jpg)
425
+ Figure 41: A High School Physics example.
426
+ Figure 42: A High School Psychology example.
427
+
428
+ While swimming in the ocean, Ivan is frightened by a dark shadow in the water even before he has the chance to identify what the shadow is. The synaptic connections taking place during this incident of fright are best described by which of the following?
429
+
430
+ (A) Messages are sent from the thalamus directly to the amygdala.
431
+ (B) Messages are sent from the thalamus to the “what” and “where” pathways.
432
+ (C) Messages are sent from the parasympathetic nervous system to the cerebral cortex.
433
+ (D) Messages are sent from the frontal lobes to the pituitary gland. This question refers to the following information.
434
+ “Society in every state is a blessing, but government even in its best state is but a necessary evil; in its worst state an intolerable one; for when we suffer, or are exposed to the same miseries by a government, which we might expect in a country without government, our calamity is heightened by reflecting that we furnish the means by which we suffer. Government, like dress, is the badge of lost innocence; the palaces of kings are built on the ruins of the bowers of paradise. For were the impulses of conscience clear, uniform, and irresistibly obeyed, man would need no other lawgiver; but that not being the case, he finds it necessary to surrender up a part of his property to furnish means for the protection of the rest; and this he is induced to do by the same prudence which in every other case advises him out of two evils to choose the least. Wherefore, security being the true design and end of government, it unanswerably follows that whatever form thereof appears most likely to ensure it to us, with the least expense and greatest benefit, is preferable to all others.”
435
+ Thomas Paine, Common Sense, 1776
436
+ Which of the following “miseries” alluded to above were most condemned by Anti-Federalists of the post-Revolutionary era?
437
+ (A) Organized response to Bacon’s Rebellion.
438
+ (B) Federal response to Shays’s Rebellion.
439
+ (C) Federal response to the Whiskey Rebellion.
440
+ (D) Federal response to Pontiac’s Rebellion. This question refers to the following information.
441
+ “The real grievance of the worker is the insecurity of his existence; he is not sure that he will always have work, he is not sure that he will always be healthy, and he foresees that he will one day be old and unfit to work. If he falls into poverty, even if only through a prolonged illness, he is then completely helpless, left to his own devices, and society does not currently recognize any real obligation towards him beyond the usual help for the poor, even if he has been working all the time ever so faithfully and diligently. The usual help for the poor, however, leaves a lot to be desired, especially in large cities, where it is very much worse than in the country.”
442
+ Otto von Bismarck, 1884
443
+ Otto von Bismarck likely made this speech in reaction to which of the following issues? (A) Social acceptance of child labor.
444
+ (B) Declining life expectancy in Germany.
445
+ (C) Criticisms of German trade tariffs.
446
+ (D) Negative effects attributed to industrial capitalism. Would a reservation to the definition of torture in the ICCPR be acceptable in contemporary practice?
447
+ (A) This is an acceptable reservation if the reserving country’s legislation employs a different definition
448
+ (B) This is an unacceptable reservation because it contravenes the object and purpose of the ICCPR
449
+ (C) This is an unacceptable reservation because the definition of torture in the ICCPR is consistent with customary international law
450
+ (D) This is an acceptable reservation because under general international law States have the right to enter reservations to treaties
451
+
452
+ ![](images/0aee6bf2e79a7228a5195da8f8593be81c73a45555bd6c8403c3faf3045356f2.jpg)
453
+ Figure 43: A High School Statistics example.
454
+
455
+ ![](images/053aafe93d77306b39c3b3684795dc4ea23308817882c1ef9abf83a20cb45b86.jpg)
456
+ Figure 44: A High School US History example.
457
+ Figure 45: A High School World History example.
458
+ Figure 46: A Human Aging example.
459
+
460
+ ![](images/b71c9b90e491d418ca542d4adcd3d6fc0b1d12e8845dc24af963ad2ba7f06b6f.jpg)
461
+ Figure 47: A Human Sexuality example.
462
+
463
+ Which position does Rawls claim is the least likely to be adopted by the POP (people in the original position)?
464
+
465
+ (A) The POP would choose equality above liberty. (B) The POP would opt for the ‘maximin’ strategy. (C) The POP would opt for the ‘difference principle.’ (D) The POP would reject the ‘system of natural liberty.’
466
+
467
+ ![](images/c0ad05c5ffce925d5a6c4ee66a918c11f6968165046725c3c57791f96e7a92b6.jpg)
468
+ Figure 48: An International Law example.
469
+ Figure 49: A Jurisprudence example.
470
+ Figure 50: A Logical Fallacies example.
471
+
472
+ ![](images/d783bc8070114afd8ffe64d1f6e984a7ec1122891b75db7d014b25d86fa4aefe.jpg)
473
+ Figure 51: A Machine Learning example.
474
+ Figure 52: A Management example.
475
+
476
+ According to Lewin, Lippet and White’s 1939 experiment, which form of leadership produced the most work from participants?
477
+
478
+ (A) Laissez-faire
479
+ (B) Democratic
480
+ (C) Authoritarian
481
+ (D) A mix of laissez-faire and democratic The single group within society that is most vulnerable to reference group influence is: (A) The older consumer who feels somewhat left out of things.
482
+ (B) The married women, many of whom feel a need for stability in their lives.
483
+ (C) New immigrants who really want to assimilate into their new culture.
484
+ (D) Children, who base most of their buying decisions on outside influences.
485
+
486
+ Which of the following conditions does not show multifactorial inheritance?
487
+
488
+ (A) Pyloric stenosis
489
+ (B) Schizophrenia
490
+ (C) Spina bifida (neural tube defects)
491
+ (D) Marfan syndrome
492
+
493
+ If each of the following meals provides the same number of calories, which meal requires the most land to produce the food?
494
+
495
+ (A) Red beans and rice (B) Steak and a baked potato (C) Corn tortilla and refried beans (D) Lentil soup and brown bread
496
+
497
+ In response to Sandel’s “social justice” argument, Kamm argues that
498
+ (A) even if we were able to enhance ourselves or others, we would not thereby be obligated to do so.
499
+ (B) there is a difference between (i) choosing that one have a certain trait and (ii) being responsible for bearing the costs of that choice.
500
+ (C) having the option to enhance will lead to fewer instances of people who require the assistance of others.
501
+ (D) all of the above
502
+
503
+ For which of these two scenarios does the main character (who uses I/me/my) do something clearly morally wrong?
504
+
505
+ Scenario 1 | I drive very fast when I’m on a racetrack.
506
+ Scenario 2 | I drive very fast when I’m in the suburbs.
507
+
508
+ (A) Wrong, Wrong (B) Wrong, Not wrong (C) Not wrong, Wrong (D) Not wrong, Not wrong
509
+
510
+ Which of the following is the most plausible explanation for the protective effect of dietary fibre against cancer of the colon?
511
+ (A) Propionic acid, formed during colonic fibre fermentation inhibits liver fatty acid synthesis (B) Butyric acid, formed during colonic fibre fermentation stimulates "silencing" of the SLC5A8 tumour suppressor gene
512
+ (C) Butyric acid, formed during colonic fibre fermentation stimulates anti-oxidant defences in the colon
513
+ (D) None of these options are correct Researchers now believe that the decline of the Maya was caused chiefly by: (A) a cataclysm of some kind, such as an earthquake, volcano, or tsunami.
514
+ (B) ecological degradation resulting from slash-and-burn farming techniques.
515
+ (C) endless wars between neighboring Mayan city-states.
516
+ (D) practices of interbreeding that led to a steep rise in congenital disorders.
517
+
518
+ ![](images/c0578f5199d9630fc8203c4d92151fdd446e9f670806ec71a633a436e0e2ef30.jpg)
519
+ Figure 59: A Philosophy example.
520
+
521
+ ![](images/ea3b9c469e97f8018fcc44afe199bcb3d65f8210ff694ef8464f331ab7bca94f.jpg)
522
+ Figure 60: A Prehistory example.
523
+ Figure 61: A Professional Accounting example.
524
+ Figure 62: A Professional Law example.
525
+
526
+ The night before his bar examination, the examinee’s next-door neighbor was having a party. The music from the neighbor’s home was so loud that the examinee couldn’t fall asleep. The examinee called the neighbor and asked her to please keep the noise down. The neighbor then abruptly hung up. Angered, the examinee went into his closet and got a gun. He went outside and fired a bullet through the neighbor’s living room window. Not intending to shoot anyone, the examinee fired his gun at such an angle that the bullet would hit the ceiling. He merely wanted to cause some damage to the neighbor’s home to relieve his angry rage. The bullet, however, ricocheted off the ceiling and struck a partygoer in the back, killing him. The jurisdiction makes it a misdemeanor to discharge a firearm in public. The examinee will most likely be found guilty for which of the following crimes in connection to the death of the partygoer?
527
+
528
+ (A) Murder.
529
+ (B) Involuntary manslaughter.
530
+ (C) Voluntary manslaughter.
531
+ (D) Discharge of a firearm in public.
532
+
533
+ A 63-year-old man is brought to the emergency department because of a 4-day history of increasingly severe left leg pain and swelling of his left calf. He also has a 1-month history of increasingly severe upper midthoracic back pain. During this time, he has had a $9 { \mathrm { - k g } }$ (20-lb) weight loss despite no change in appetite. He has no history of major medical illness. His only medication is ibuprofen. He is $1 8 0 ~ \mathrm { c m }$ (5 ft 11 in) tall and weighs $8 2 \mathrm { k g }$ (180 lb); BMI is 25 $\mathrm { k g } / \mathrm { m } 2$ . His vital signs are within normal limits. On examination, lower extremity pulses are palpable bilaterally. The remainder of the physical examination shows no abnormalities. An $\mathbf { X }$ -ray of the thoracic spine shows no abnormalities. A CT scan of the abdomen shows a 3-cm mass in the body of the pancreas; there are liver metastases and encasement of the superior mesenteric artery. Ultrasonography of the left lower extremity shows a femoropopliteal venous clot. Which of the following is the most likely cause of this patient’s symptoms?
534
+
535
+ (A) Carcinoid syndrome
536
+ (B) Hypercoagulability from advanced malignancy
537
+ (C) Multiple endocrine neoplasia
538
+ (D) Splenic artery aneurysm and embolic disease of the left lower extremity You work for a utility company that is building a biomass plant in the community. Your employer asks you to give a series of community talks about the plant and future operations. You visit the plant several hours before you are due to give a speech that has been prepared by your immediate supervisor. During the tour of the plant, you discover several claims in the speech are not true. What do you do?
539
+ (A) Write and deliver a new speech that you know is entirely correct.
540
+ (B) Cancel all speeches until you and your supervisor can get the information straight.
541
+ (C) Deliver the speech as prepared and discuss the inaccuracies with your supervisor afterward. (D) Address the inaccuracies with your supervisor immediately and make the necessary corrections before giving the speech. The Chemical Weapons Convention (CWC) prohibited the possession or deployment of chemical weapons; however it failed to implement stipulations that would require signatories to declare their existing stocks of chemical weapons, to identify facilities that were once involved in chemical production, or to announce when their existing stocks would be destroyed.
542
+ (A) The Chemical Weapons Convention (CWC) prohibited the possession or deployment of chemical weapons; however it failed to implement stipulations that would require signatories to declare their existing stocks of chemical weapons, to identify facilities that were once involved in chemical production, or to announce when their existing stocks would be destroyed.
543
+ (B) The CWC made some important developments regarding the use and possession of chemical weapons and the destruction of existing stockpiles. However, the treaty failed to establish an independent body empowered with the capacity to check treaty compliance. Lack of supra-state authority has undermined the ability to enforce those developments. Given the anarchical nature of international society it may be in the national security interest to retain stocks.
544
+ (C) Chemical weapons continue to exert a determining influence on international society. As early as the 1970s military strategists were convinced of the deterrence effects chemical weapons could have, comparable to the second strike survival logic of nuclear deterrence. The preferences of strategists resulted in continued manufacture and stockpiling of weapons creating an international crisis of stability.
545
+ (D) While the CWC has been ratified by the majority of international society, some nations with a large chemical capability at their disposal have yet to enter into the treaty. However, to some analysts the destructive military potential would be limited, having a moderate effect on a well-equipped army in conventional warfare. Chemical arsenal essentially falls under the category of the "poor mans" weaponry, being simplistic and inexpensive whilst having limited military utility. However, the concern remains of the prospective impact a terrorist chemical attack could have on civilian populations. An observational study in diabetics assesses the role of an increased plasma fibrinogen level on the risk of cardiac events. 130 diabetic patients are followed for 5 years to assess the development of acute coronary syndrome. In the group of 60 patients with a normal baseline plasma fibrinogen level, 20 develop acute coronary syndrome and 40 do not. In the group of 70 patients with a high baseline plasma fibrinogen level, 40 develop acute coronary syndrome and 30 do not. Which of the following is the best estimate of relative risk in patients with a high baseline plasma fibrinogen level compared to patients with a normal baseline plasma fibrinogen level?
546
+ (A) (40/30)/(20/40)
547
+ (B) $( 4 0 ^ { * } 4 0 ) / ( 2 0 ^ { * } 3 0 )$
548
+ (C) $( \mathbf { 4 0 ^ { * } 7 0 } ) / ( 2 \mathbf { 0 } ^ { * } \mathbf { 6 0 } )$
549
+ (D) (40/70)/(20/60)
550
+
551
+ ![](images/a98dcafa492f41b955b02e91b9fb34f148e172a9e27cae948d26d42a02a4ddaa.jpg)
552
+ Figure 63: A Professional Medicine example.
553
+ Figure 64: A Professional Psychology example.
554
+ Figure 65: A Public Relations example.
555
+
556
+ ![](images/b753857861072e5125ebb14d7eac2d4e0c3f1711a834691c9be74ddc7bfd4d7a.jpg)
557
+ Figure 66: A Security Studies example.
558
+ Figure 67: A Sociology example.
559
+
560
+ ![](images/f82d5ee1cd98378997a3257b72273349ed15b48d67373c79af68c55d2adfde5d.jpg)
561
+ Figure 68: A US Foreign Policy example.
562
+ Figure 69: A Virology example.
parse/train/d7KBjmI3GmQ/d7KBjmI3GmQ_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/d7KBjmI3GmQ/d7KBjmI3GmQ_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/d7KBjmI3GmQ/d7KBjmI3GmQ_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/rJedV3R5tm/rJedV3R5tm.md ADDED
@@ -0,0 +1,391 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # RELGAN: RELATIONAL GENERATIVE ADVERSARIAL NETWORKS FOR TEXT GENERATION
2
+
3
+ Weili Nie∗ Rice University wn8@rice.edu
4
+
5
+ Nina Narodytska
6
+ VMware Research
7
+ nnarodytska@vmware.com
8
+
9
+ Ankit B. Patel Rice University & Baylor College of Medicine abp4@rice.edu
10
+
11
+ # ABSTRACT
12
+
13
+ Generative adversarial networks (GANs) have achieved great success at generating realistic images. However, the text generation still remains a challenging task for modern GAN architectures. In this work, we propose RelGAN, a new GAN architecture for text generation, consisting of three main components: a relational memory based generator for the long-distance dependency modeling, the Gumbel-Softmax relaxation for training GANs on discrete data, and multiple embedded representations in the discriminator to provide a more informative signal for the generator updates. Our experiments show that RelGAN outperforms current state-of-the-art models in terms of sample quality and diversity, and we also reveal via ablation studies that each component of RelGAN contributes critically to its performance improvements. Moreover, a key advantage of our method, that distinguishes it from other GANs, is the ability to control the trade-off between sample quality and diversity via the use of a single adjustable parameter. Finally, RelGAN is the first architecture that makes GANs with Gumbel-Softmax relaxation succeed in generating realistic text.
14
+
15
+ # 1 INTRODUCTION
16
+
17
+ Generative adversarial networks (GANs) (Goodfellow et al., 2014) were originally designed to generate continuous data and have achieved a lot of success at generating continuous samples, such as images. Recently, GANs were extended to generate discrete data, in particular text sequences (Kusner & Hernandez-Lobato, 2016; Yu et al., 2017; Zhang et al., 2017; Lin et al., 2017; Guo et al., 2017; ´ Fedus et al., 2018). However, this extension is not straightforward. The main issue is that outputs of GANs for the discrete data generation are not differentiable and thus the standard gradient-based techniques cannot be applied directly in these settings. To overcome this, most state-of-the-art GANs have used the REINFORCE algorithm (Williams, 1992) and its variants that originate from the reinforcement learning (RL) community to train the generator while the discriminator is still a classifier to discriminate real and generated text and provides reward signals for the generator updates. A detailed description of the related work is deferred to Appendix 4.
18
+
19
+ Although these state-of-the-art GANs have shown some promising results in text generation as compared to the conventional maximum likelihood estimation (MLE) method, they also suffer from some fundamental issues, including training instability and mode collapse. First, their performance is quite sensitive to random parameter initializations and hyperparameter choices (Semeniuta et al., 2018). Moreover, many GANs heavily employ RL heuristics, such as Monte Carlo search (Yu et al., 2017) and hierarchical RL (Guo et al., 2017), making the already difficult-to-train GANs more complicated and thus the individual role of adversarial training unclear. The second issue is mode collapse as the generated text sentences tend to be less diverse (Semeniuta et al., 2018; Fedus et al., 2018) and it becomes more severe when generating longer sentences. The mode collapse issue can be caused either by a lack of expressive power in the generator (since it may not be capable of covering many more complex modes in data distribution), or by a less informative guiding signal in the discriminator (as it may constrain the generator updates to within certain modes).
20
+
21
+ In this work, we propose a new GAN architecture – Relational GAN (RelGAN), whose design is motivated by the issues identified above. The RelGAN architecture mainly consists of three parts: 1) a relational memory (Santoro et al., 2018) based generator, which promises more expressive power and better ability of modeling longer-range dependencies in text; 2) Gumbel-Softmax relaxation (Jang et al., 2016; Maddison et al., 2016) for training GANs on discrete data, which simplifies our model, enabling us to stay within a classical GAN framework without intensive RL heuristics; 3) multiple embedded representations in the discriminator, enabling a more diverse and informative signal for the generator updates. We experimentally demonstrate that RelGAN outperforms most current models in terms of sample quality and diversity. Furthermore, we show via ablation studies that each part of RelGAN plays an important role in its performance improvements. A key advantage of our method, that distinguishes it from other GANs, is the ability to control the trade-off between sample quality and diversity, via the use of a single adjustable parameter. Finally, to the best of our knowledge, RelGAN is the first architecture to demonstrate that GANs with Gumbel-Softmax relaxation are capable of generating realistic text.
22
+
23
+ # 2 RELGAN
24
+
25
+ # 2.1 RELATIONAL MEMORY BASED GENERATOR
26
+
27
+ Current dominant GANs for text generation, such as Kusner & Hernandez-Lobato (2016); Yu et al. ´ (2017); Lin et al. (2017); Guo et al. (2017); Fedus et al. (2018) are built using LSTM (Hochreiter & Schmidhuber, 1997) as the generator architecture. However, the LSTM-based generator might be the bottleneck of GANs from the following experimental observations: 1) The discriminator’s loss value very quickly goes to near its minimum after few iterations of adversarial training. It means that the discriminator may be much more powerful than the generator and can easily distinguish between real and fake samples. 2) Mode collapse in current GANs (Fedus et al., 2018) may also partly indicate the incapacity of generator, as it may not be expressive enough to fit all the modes of data distribution. 3) Current GANs perform poorly at long sentence generation (Guo et al., 2017), and we know that LSTM packs all information about the previous text sequences into a common hidden vector, potentially limiting its ability of modeling the long-distance dependency.
28
+
29
+ Therefore, we propose to use the more powerful module – relational memory (Santoro et al., 2018) – as the generator architecture for text generation. The basic idea of relational memory is to consider a fixed set of memory slots (e.g. memory matrix) and allow for interactions between memory slots by using the self-attention mechanism (Vaswani et al., 2017). The empirical findings by Santoro et al. (2018) showed that relational memory performs better in the language modeling compared to LSTM. Intuitively, the use of multiple memory slots and the attention across these memories can increase the expressive power of generator and its ability of generating longer text sentences.
30
+
31
+ Formally, we assume each row of the memory $M _ { t }$ represents a memory slot and Figure 1 shows how self-attention updates $M _ { t }$ by incorporating new observation $x _ { t }$ at time $t$ . Given $H$ heads, we have $H$ sets of queries, keys and values via three linear transformations, respectively: For each head, we get query $\bar { Q } _ { t } ^ { ( h ) } = \dot { M } _ { t } W _ { q } ^ { ( h ) }$ , key $K _ { t } ^ { ( h ) } = [ M _ { t } ; x _ { t } ] W _ { k } ^ { ( h ) }$ and value $V _ { t } ^ { ( \dot { h } ) } = [ \dot { M _ { t } } ; x _ { t } ] W _ { v } ^ { ( h ) }$ where $[ ; ]$ denotes the row-wise concatenation. Thus, the updated memory $\tilde { M } _ { t + 1 }$ is given by
32
+
33
+ $$
34
+ \tilde { M } _ { t + 1 } = [ \tilde { M } _ { t + 1 } ^ { ( 1 ) } : \cdot \cdot \cdot : \tilde { M } _ { t + 1 } ^ { ( H ) } ] , \tilde { M } _ { t + 1 } ^ { ( h ) } = \sigma \left( \frac { M _ { t } W _ { q } ^ { ( h ) } ( [ M _ { t } ; x _ { t } ] W _ { k } ^ { ( h ) } ) ^ { T } } { \sqrt { d _ { k } } } \right) [ M _ { t } ; x _ { t } ] W _ { v } ^ { ( h ) }
35
+ $$
36
+
37
+ where $\sigma ( \cdot )$ denotes the softmax function which is performed on each row, $d _ { k }$ is the column dimension of the key $K _ { t } ^ { ( h ) }$ and $[ : ]$ denotes the column-wise concatenation.
38
+
39
+ By following the same idea of Santoro et al. (2018), the next memory $M _ { t + 1 }$ and output (logits) $o _ { t }$ of the generator at time $t$ are given by
40
+
41
+ $$
42
+ M _ { t + 1 } = f _ { \theta _ { 1 } } ( \tilde { M } _ { t + 1 } , M _ { t } ) , o _ { t } = f _ { \theta _ { 2 } } ( \tilde { M } _ { t + 1 } , M _ { t } )
43
+ $$
44
+
45
+ respectively, where the two parametrized functions $f _ { \theta _ { 1 } }$ and $f _ { \boldsymbol { \theta _ { 2 } } }$ are combinations of skip connections, multi-layer perceptron (MLP), gated operations and/or pre-softmax linear transformations.
46
+
47
+ ![](images/524dde62a0ed6567cdecdea7b7857166bd4115af9112caee5a7d33fae3ccfb2f.jpg)
48
+ Figure 1: The self-attention mechanism for updating the memory from $M _ { t }$ to $\tilde { M } _ { t + 1 }$ by incorporating new observation $x _ { t }$ , where each row of the memory matrix $M _ { t }$ is a memory slot, and ${ Q } _ { t } ^ { ( h ) }$ , $K _ { t } ^ { ( h ) }$ and $V _ { t } ^ { ( h ) }$ denote the queries, keys and values, respectively. Note that the softmax function is performed on each row, and $\otimes$ denotes the dot product. The concatenation (denoted by “concat”) of $M _ { t }$ and $x _ { t }$ is row-wise where the embedded input is first passed through a linear layer to make $x _ { t }$ match the row dimension of $M _ { t }$ .
49
+
50
+ # 2.2 TRAINING WITH DISCRETE DATA
51
+
52
+ # 2.2.1 GUMBEL-SOFTMAX RELAXATION
53
+
54
+ Before the introduction of Gumbel-Softmax relaxation, we first show why training GANs with discrete data is a critical issue. Assuming the vocabulary size is $V$ , for the output logits $o _ { t } \in \mathbb { R } ^ { V }$ of the generator in (2), the next generated one-hot token $\boldsymbol { y } _ { t + 1 } \in \mathbb { R } ^ { V }$ will be obtained by sampling:
55
+
56
+ $$
57
+ y _ { t + 1 } \sim \sigma ( o _ { t } )
58
+ $$
59
+
60
+ where similarly $\sigma ( \cdot )$ denotes the softmax function which is performed on $o _ { t }$ element-wisely and we use $\sigma ( o _ { t } )$ to represent the multinomial distribution on the set of all possible tokens. As we know, the sampling operations in (3) on the multinomial distribution of the generator output are not differentiable, which implies a step function at the end of the generator. Since the derivative of a step function is 0 almost everywhere, we have ∂yt+1∂θ = 0 a.e. for t = 0, · · · , T − 1 where θG denotes the generator parameters. By chain rule, the gradients of the generator loss $l _ { G }$ w.r.t. $\theta _ { G }$ will be
61
+
62
+ $$
63
+ \frac { \partial l _ { G } } { \partial \theta _ { G } } = \sum _ { i = 0 } ^ { T - 1 } \frac { \partial y _ { t + 1 } } { \partial \theta _ { G } } \frac { \partial l _ { G } } { \partial y _ { t + 1 } } = 0 \mathrm { ~ } a . e .
64
+ $$
65
+
66
+ So the gradients of the generator loss cannot pass back to the generator via the discriminator. This is the notorious “non-differentiability issue” of GANs in discrete data generation.
67
+
68
+ To deal with the non-differentiablity issue, we apply the Gumbel-Softmax relaxation technique which defines a continuous distribution over the simplex that can approximate samples from a categorical distribution (Jang et al., 2016; Maddison et al., 2016). Formally, the Gumbel-Softmax relaxation includes two parts: 1) The Gumbel-Max trick. According to Jang et al. (2016); Maddison et al. (2016), the sampling in (3) can be reparametrized as
69
+
70
+ $$
71
+ y _ { t + 1 } = \mathrm { o n e . h o t } ( \arg \operatorname* { m a x } _ { 1 \leq i \leq V } ( o _ { t } ^ { ( i ) } + g _ { t } ^ { ( i ) } ) )
72
+ $$
73
+
74
+ where $o _ { t } ^ { ( i ) }$ denotes the $i$ -th entry of $o _ { t }$ and $g _ { t } ^ { ( i ) }$ is from the i.i.d. standard Gumbel distribution, i.e. $g _ { t } ^ { ( i ) } = - \log ( - \log U _ { t } ^ { ( i ) } )$ with $U _ { t } ^ { ( i ) } \sim \mathrm { U n i f o r m } ( 0 , 1 )$ . 2) Relaxing the discreteness. As the arg max operation in (5) is still non-differentiable, we need further approximate the “one-hot with arg max” by softmax, which yields
75
+
76
+ $$
77
+ \hat { y } _ { t + 1 } = \sigma \big ( \beta \big ( o _ { t } + g _ { t } \big ) \big )
78
+ $$
79
+
80
+ where $\beta > 0$ is a tunable parameter called inverse temperature. As $\hat { y } _ { t + 1 }$ in (6) is differentiable with respect to $o _ { t }$ , we can use $\hat { y } _ { t + 1 }$ instead of the one-hot token $y _ { t + 1 }$ as the input of the discriminator. Also, note that the new observation $x _ { t + 1 }$ of the generator to be concatenated with $M _ { t + 1 }$ in next time $t + 1$ is given by $x _ { t + 1 } = f _ { \theta _ { 3 } } ( y _ { t + 1 } )$ , where the parametrized function $f _ { \theta _ { 3 } }$ is composed of an embedding layer that maps $y _ { t + 1 }$ to an embedded input and a linear layer that makes $x _ { t + 1 }$ match the row dimension of $M _ { t + 1 }$ (the embedded input and the linear layer are shown in Figure 1) .
81
+
82
+ ![](images/f7d0674eec7dbe2ffa7a9a58d3e8af99eec3fef634b69063a2f6457f40450d4b.jpg)
83
+ Figure 2: The proposed discriminator framework with multiple embedded representations. The input is either the real sentence $\left[ \boldsymbol { r } _ { 1 } : \cdots : \boldsymbol { r } _ { T } \right]$ where $r _ { t }$ denotes the $t$ -th one-hot token, or the generated (approximate) sentence embedde $[ \hat { y } _ { 1 } : \dots : \hat { y } _ { T } ]$ where ns, eac $\hat { y } _ { t }$ is from (6). Also, f which is passed t $S$ embedding matrices ough discriminator in $\{ W _ { e } ^ { ( s ) } \} _ { s = 1 } ^ { S }$ map each input into y to get the related lo $S$ Note that “D” is the CNN-based classifier $\bar { D ( \cdot ) } \in \mathbb { R }$ with weight-sharing and $\oplus$ denotes taking the average.
84
+
85
+ # 2.2.2 TEMPERATURE CONTROL
86
+
87
+ With the larger inverse temperature $\beta , \hat { y } _ { t + 1 }$ in (6) will become a better approximation of $y _ { t + 1 }$ in (3) and asymptotically as $\beta \to \infty$ , $\hat { y } _ { t + 1 } \to y _ { t + 1 }$ . However, the issue is that the variance of gradients will be very large as we have $\textstyle \operatorname { V a r } ( { \frac { \partial { \hat { y } } _ { t + 1 } } { \partial o _ { t } } } ) \propto \beta ^ { 2 }$ , and thus the parameter updates will become very sensitive to the input noise. Intuitively, this might cause poor sample quality. On the other hand, with the smaller inverse temperature $\beta$ , the generator will pay more attention to making a sharp distribution of entries in $\hat { y } _ { i + 1 }$ due to the larger (initial) approximation gap between $\hat { y } _ { t + 1 }$ and $y _ { t + 1 }$ , which implicitly discourages its possible “exploration”. Intuitively, this might be one factor that contributes to mode collapse of RelGAN on text generation.
88
+
89
+ Therefore, the larger $\beta$ encourages more exploration for better sample diversity while the smaller $\beta$ encourages more exploitation for better sample quality. We thus propose to increase the inverse temperature $\beta$ over iterations via an exponential policy: $\beta _ { n } = \beta _ { \mathrm { m a x } } ^ { n / N }$ , where $\beta _ { \mathrm { m a x } }$ denotes the maximum inverse temperature, $N$ is the maximum number of training iterations and $n$ denotes the current iteration. In the exponential policy, as the increase rate of inverse temperature depends on $\beta _ { \mathrm { m a x } }$ , $\beta _ { \mathrm { m a x } }$ will decide the transition time from the exploitation phase to the exploration phase. In such sense, RelGAN provides a flexibility of either generating more diverse samples with a large $\beta _ { \mathrm { m a x } }$ or generating better quality samples with a small $\beta _ { \mathrm { m a x } }$ while most current GANs cannot provide.
90
+
91
+ # 2.3 MULTIPLE REPRESENTATIONS IN DISCRIMINATOR
92
+
93
+ A commonly used discriminator for text generation is a CNN-based classifier (Kim, 2014) that employs a convolutional layer with multiple filters of different sizes to capture relations of various word lengths and a max-pooling layer over the entire input sentence for each feature map (Yu et al., 2017; Zhang et al., 2017; Lin et al., 2017; Guo et al., 2017). In this discriminator architecture, the input of the CNN-based classifier is a sentence of length $T$ represented by a single embedded matrix $\tilde { X } \in \mathbb { R } ^ { d \times T }$ where each column $\boldsymbol { \tilde { x } _ { t } } \in \mathbb { R } ^ { d }$ is a $d$ -dimensional embedded vector of each word.
94
+
95
+ In this work, we propose a new discriminator framework that applies multiple embedded representations for each sentence, with each representation independently passed through the above CNNbased classifier to get an individual score. The average of these individual scores will serve as the final guiding information to update the generator. Our hypothesis is that each embedded representation may capture a specific aspect of the input sentence and the discriminator which compares real and generated sentences from these different perspectives can provide more diverse and comprehensive guiding information for the generator updates. This idea resembles the use of multiple discriminators to improve GANs on image generation (Durugkar et al., 2016), but the difference is that we only use multiple different representations of the input while still keeping a single or weight-sharing CNN-based classifier, which presumably has much less computational cost.
96
+
97
+ Formally, we assume that $r _ { t }$ denotes the $t$ -th one-hot real token and $\hat { y } _ { t }$ from (6) denotes the $t$ - th softmax-like generated token, and Figure 2 shows the proposed discriminator framework with multiple embedded representations where either the real input $[ r _ { 1 } \ : \ \dots \ : \ r _ { T } ] \ \in \ \mathbb { R } ^ { V \times T }$ or the generated input $[ \hat { y } _ { 1 } : \dot { \dots } : \hat { y } _ { T } ] \in \mathbb { R } ^ { V \times T }$ will be mapped into $S$ embedded representations by $S$ distinct embedding matrices $\{ W _ { e } ^ { ( s ) } \} _ { s = 1 } ^ { S }$ 1 with W (s)e $W _ { e } ^ { ( s ) } \in \mathbb { R } ^ { d \times V }$ . Let $\tilde { X } _ { r } ^ { ( s ) }$ and $\tilde { X } _ { y } ^ { ( s ) }$ be the $s$ -th embedded representation of the real and generated input, respectively. Thus, we have
98
+
99
+ $$
100
+ \tilde { X } _ { r } ^ { ( s ) } = W _ { e } ^ { ( s ) } [ r _ { 1 } : \cdot \cdot \cdot : r _ { T } ] , \tilde { X } _ { y } ^ { ( s ) } = W _ { e } ^ { ( s ) } [ \hat { y } _ { 1 } : \cdot \cdot \cdot : \hat { y } _ { T } ]
101
+ $$
102
+
103
+ and the final discriminator loss is given by
104
+
105
+ $$
106
+ l _ { D } = \frac { 1 } { S } \sum _ { s = 1 } ^ { S } \mathbb { E } _ { r _ { 1 : T } \sim P _ { r } } f ( D ( \tilde { X } _ { r } ^ { ( s ) } ) , D ( \tilde { X } _ { y } ^ { ( s ) } ) )
107
+ $$
108
+
109
+ where the expectation is taken w.r.t. both real sentence distribution $P _ { r }$ and generated sentence distribution $P _ { \theta }$ , and the loss function $f$ is determined by the specific GAN loss, such as vanilla GAN (Goodfellow et al., 2014), $f$ -GAN (Nowozin et al., 2016) and WGAN (Arjovsky et al., 2017). Throughout this paper, the generator loss can be simply set to be $l _ { G } = - l _ { D }$ .
110
+
111
+ # 2.4 TRAINING TECHNIQUES
112
+
113
+ Choice of Loss Function. Empirically, we first compared three different standard GAN losses: standard GAN (the non-saturating version) (Goodfellow et al., 2014), hinge loss (Nowozin et al., 2016; Zhang et al., 2018) and Relativistic standard GAN (RSGAN) (Jolicoeur-Martineau, 2018) on the synthetic data (shown in next section) and then chose the best one – RSGAN for the rest of all experiments. Note that it does not mean RelGAN only works with the RSGAN loss and please see Appendix B for training curves of RelGAN with different loss functions. Formally, the function $f$ in (8) for RSGAN is $f ( a , b ) = \log { \mathrm { s i g m o i d } } ( a - b )$ for $a , b \in \mathbb { R }$ , and thus (8) becomes
114
+
115
+ $$
116
+ l _ { D } = \frac { 1 } { S } \sum _ { s = 1 } ^ { S } \mathbb { E } _ { r _ { 1 : T } \sim P _ { r } } \log \operatorname { s i g m o i d } ( D ( \tilde { X } _ { r } ^ { ( s ) } ) - D ( \tilde { X } _ { y } ^ { ( s ) } ) )
117
+ $$
118
+
119
+ Intuitively, the loss function in (9) is to directly estimate the average probability that real sentences are more realistic than generated sentences in terms of different embedded representations.
120
+
121
+ Generator Pre-training. Most current GANs for text generation need the pre-training for both generator and discriminator, such as SeqGAN (Yu et al., 2017), and some may further heavily rely on the exclusive pre-training techniques, such as TextGAN (Zhang et al., 2017), LeakGAN (Guo et al., 2017) and MaskGAN (Fedus et al., 2018). Instead, the proposed RelGAN only need to pre-train the generator simply via the standard MLE training for several epochs before starting the adversarial training. Experimentally, we find that a good initialization for generator provided by the MLE pre-training is necessary for a good convergence behavior of adversarial training.
122
+
123
+ # 3 EXPERIMENTS
124
+
125
+ We test RelGAN on both synthetic and real data, where the synthetic data are 10,000 discrete sequences generated by an oracle-LSTM with fixed parameters (Yu et al., 2017) and the real data include the COCO image captions (Chen et al., 2015) and EMNLP2017 WMT News, first used by Guo et al. (2017) for text generation. The experimental settings are given in Appendix A.
126
+
127
+ Evaluation Metrics. How to properly evaluate generative models remains an open research question (Theis et al., 2015; Semeniuta et al., 2018). The key issue plaging current evaluation metrics for GANs is that they cannot measure sample quality and sample diversity simultaneously. Therefore, we use two distinct metrics: for synthetic data, we use both negative log-likelihood (called ${ \mathrm { N L L } } _ { \mathrm { g e n } , }$ ) and its counterpart (called $\mathrm { N L L _ { o r a c l e } }$ ), defined as:
128
+
129
+ $$
130
+ \mathrm { N L } \mathbf { \mathrm { L } } _ { \mathrm { g e n } } = - \mathbb { E } _ { r _ { 1 } \sim r } { \sim } P _ { r } \log P _ { \theta } ( r _ { 1 } , \cdot \cdot \cdot , r _ { T } ) , \mathrm { N L } \mathbf { \mathrm { \mathrm { a r a c t e } } } = - \mathbb { E } _ { y _ { 1 } , \tau \sim P _ { \theta } } \log P _ { r } ( y _ { 1 } , \cdot \cdot \cdot , y _ { T } ) ,
131
+ $$
132
+
133
+ where the generated sentence distribution $P _ { \theta }$ and the real sentence distribution $P _ { r }$ are both known by evaluating the generator and oracle-LSTM, respectively. Generally, ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ measures sample diversity while $\mathrm { N L L } _ { \mathrm { o r a c l e } }$ is more sensitive to sample quality (Theis et al., 2015; Arjovsky $\&$ Bottou, 2017). For the real dataset, we also apply ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ to measure the sample diversity, similar to Lu et al. (2018). However, since NLLoracle cannot be evaluated without an oracle, we instead apply the commonly-used BLEU scores (Papineni et al., 2002) to measure the sample quality and compare with the MLE baseline, along with other start-of-the-art GANs, including SeqGAN (Yu et al., 2017), RankGAN (Lin et al., 2017) and LeakGAN (Guo et al., 2017). Note that for BLEU score evaluation, we follow the strategy in (Yu et al., 2017; Zhu et al., 2018) by using the test data as the reference.
134
+
135
+ # 3.1 SYNTHETIC DATA
136
+
137
+ We run the synthetic data experiments with sequence length 20 and 40, respectively. The $\mathrm { N L L } _ { \mathrm { o r a c l e } }$ results of RelGAN and other models are shown in Table 1 where we set $\beta _ { \mathrm { m a x } } = 1$ for length 20 and $\beta _ { \mathrm { m a x } } = 2$ for length 40. Note that “MLE” in Table 1 denotes the baseline model where LSTMs are trained with the teacher-forcing algorithm to maximize the likelihood (same with Table 2 and 3). We can see that RelGAN outperforms other models in both cases, and its lead in performance becomes larger with longer sequence length, demonstrating the log-distance dependency modeling ability of the proposed generator.
138
+
139
+ <table><tr><td>Length</td><td>MLE</td><td>SeqGAN</td><td>RankGAN</td><td>LeakGAN</td><td>RelGAN</td><td>Real</td></tr><tr><td>20</td><td>9.038</td><td>8.736</td><td>8.247</td><td>7.038</td><td>6.680± 0.343</td><td>5.750</td></tr><tr><td>40</td><td>10.411</td><td>10.310</td><td>9.958</td><td>7.191</td><td>6.765 ± 0.026</td><td>4.071</td></tr></table>
140
+
141
+ Table 1: The $\mathrm { N L L } _ { \mathrm { o r a c l e } }$ scores on synthetic data where $\beta _ { \operatorname* { m a x } } = 1$ for length 20 and $\beta _ { \mathrm { m a x } } = 2$ for length 40. RelGAN is run with 6 random seeds and the final score is obtained by taking the average of scores, and other scores are from their original papers and Guo et al. (2017). Note that “Real” denotes the real data generated by the oracle-LSTM. For the $\mathrm { N L L } _ { \mathrm { o r a c l e } }$ score, the lower the better.
142
+
143
+ We also evaluate the trade-off between sample quality and diversity as a function of the maximum inverse temperature $\beta _ { \mathrm { m a x } }$ and the results are shown in Figure 3. As $\beta _ { \mathrm { m a x } }$ increases, ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ decreases, which implies better sample diversity, but $\mathrm { N L L } _ { \mathrm { o r a c l e } }$ increases, which implies worse sample quality. Especially when $\beta _ { \mathrm { m a x } } \in \{ 1 0 , 1 0 0 \}$ , the best ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ score of 4.4 for RelGAN is very close to the best ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ score of 4.2 for MLE pre-training, implying that RelGAN with a sufficiently large inverse temperature suffers little mode collapse on synthetic data.
144
+
145
+ ![](images/398079f412b562ccd1b3a0c1deae7bf70b7b387734047437de6420899a58b3df.jpg)
146
+ Figure 3: The training curves of ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ scores (left) and $\mathrm { N L L } _ { \mathrm { o r a c l e } }$ scores (right) on synthetic data of length 20 with different values of maximum inverse temperature $\beta _ { \mathrm { m a x } } \in \{ 1 , 2 , 5 , 1 0 , 1 0 0 \}$ . The vertical dash line represents the end of pre-training. With the increase of $\beta _ { \mathrm { m a x } }$ , ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ becomes lower but $\mathrm { N L L _ { o r a c l e } }$ becomes higher. For both the ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ and $\mathrm { \Delta N L L _ { o r a c l e } }$ scores, the lower the better.
147
+
148
+ # 3.2 COCO IMAGE CAPTIONS DATASET
149
+
150
+ In order to test RelGAN on real-world data, we first run experiments on the COCO Image Captions dataset. By following the same data pre-processing as in Zhu et al. (2018), the dataset includes 4,682 unique words with the maximum sentence length 37. Both the training and test data contain 10,000 sentences.
151
+
152
+ The BLEU scores of RelGAN compared with previous models are shown in Table 2 where we set $\beta _ { \mathrm { m a x } } = 1 0 0$ and 1000, respectively. We can see that RelGAN is significantly and consistently better than other models in terms of all the BLEU scores, which means its ability of generating high-quality sentences of COCO Image Captions. Furthermore, the ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ scores of RelGAN and previous models are also shown in Table 2, where RelGAN also achieves the state-of-the-art results in terms of sample diversity. For example, we do not see obvious mode collapse with $\beta _ { \mathrm { m a x } } = 1 0 0 0$ by looking at the generated samples (see Appendix C.1 for more details).
153
+
154
+ Table 2: The BLEU and ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ scores on COCO Image Captions where $\beta _ { \mathrm { m a x } } = 1 0 0$ and 1000, respectively. RelGAN is run with 6 random seeds and the final score is obtained by taking the average of scores, and other scores are based on the same evaluation settings in Zhu et al. (2018). For BLEU scores, the higher the better.
155
+
156
+ <table><tr><td>Method</td><td>BLEU-2</td><td>BLEU-3</td><td>BLEU-4</td><td>BLEU-5</td><td>NLLgen</td></tr><tr><td>MLE</td><td>0.731</td><td>0.497</td><td>0.305</td><td>0.189</td><td>0.718</td></tr><tr><td>SeqGAN</td><td>0.745</td><td>0.498</td><td>0.294</td><td>0.180</td><td>1.082</td></tr><tr><td>RankGAN</td><td>0.743</td><td>0.467</td><td>0.264</td><td>0.156</td><td>1.344</td></tr><tr><td>LeakGAN</td><td>0.746</td><td>0.528</td><td>0.355</td><td>0.230</td><td>0.679</td></tr><tr><td>RelGAN (100)</td><td>0.849± 0.030</td><td>0.687 ± 0.047</td><td>0.502 ± 0.048</td><td>0.331 ± 0.044</td><td>0.756± 0.054</td></tr><tr><td>RelGAN (1000)</td><td>0.814 ± 0.012</td><td>0.634 ± 0.020</td><td>0.455 ± 0.023</td><td>0.303 ± 0.020</td><td>0.655 ± 0.048</td></tr></table>
157
+
158
+ # 3.3 EMNLP2017 WMT NEWS DATASET
159
+
160
+ The EMNLP2017 WMT News dataset consists of 5,255 unique words with the maximum sentence length 51 after applying the same data pre-processing as in Zhu et al. (2018). The training data contains abbout 270,000 sentences and test data contains 10,000 sentences.
161
+
162
+ Table 3: The BLEU and ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ scores on EMNLP2017 WMT News where $\beta _ { \mathrm { m a x } } = 1 0 0$ and 1000, respectively. Our model is run with 6 random seeds and the final score is obtained by taking the average of scores, and other scores are based on the same evaluation settings in Zhu et al. (2018).
163
+
164
+ <table><tr><td>Method</td><td>BLEU-2</td><td>BLEU-3</td><td>BLEU-4</td><td>BLEU-5</td><td>NLLgen</td></tr><tr><td>MLE</td><td>0.768</td><td>0.473</td><td>0.240</td><td>0.126</td><td>2.382</td></tr><tr><td>SeqGAN</td><td>0.777</td><td>0.491</td><td>0.261</td><td>0.138</td><td>2.773</td></tr><tr><td>RankGAN</td><td>0.727</td><td>0.435</td><td>0.209</td><td>0.101</td><td>3.345</td></tr><tr><td>LeakGAN</td><td>0.826</td><td>0.645</td><td>0.437</td><td>0.272</td><td>2.356</td></tr><tr><td>RelGAN (100)</td><td>0.881± 0.013</td><td>0.705± 0.019</td><td>0.501± 0.023</td><td>0.319± 0.018</td><td>2.482 ± 0.031</td></tr><tr><td>RelGAN (1000)</td><td>0.837 ± 0.012</td><td>0.654 ± 0.010</td><td>0.435 ± 0.011</td><td>0.265 ± 0.011</td><td>2.285 ± 0.025</td></tr></table>
165
+
166
+ The BLEU scores of RelGAN compared with previous models are shown in Table 3 where we set $\beta _ { \mathrm { m a x } } ~ = ~ 1 0 0$ and 1000, respectively. We can see that RelGAN also consistently outperforms previous models in terms of all the BLEU scores, demonstrating its ability of generating high-quality sentences on EMNLP2017 WMT News. Moreover, the sample diversity metric ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ scores of RelGAN and previous models are also shown in Table 3. Similarly, RelGAN achieves the stateof-the-art results in terms of sample diversity. Upon visually examining generated samples (See Appendix C.2 for more details), we do not observe obvious mode collapse for $\beta _ { \operatorname* { m a x } } \in \{ 1 0 \bar { 0 } , 1 0 0 0 \}$ .
167
+
168
+ Finally, from Tables 2 and 3, we can see that the sample quality and diversity trade-off with different values of maximum inverse temperature $\beta _ { \mathrm { m a x } }$ also exists on the real data. That is, RelGAN with $\beta _ { \mathrm { m a x } } = 1 0 0$ achieves better sample quality while RelGAN with $\beta _ { \mathrm { m a x } } = 1 0 0 0$ achieves better sample diversity. Depending on what the underlying applications of text generation via RelGAN are, we can adjust $\beta _ { \mathrm { m a x } }$ properly to get either better quality or better diversity.
169
+
170
+ To further evaluate the sample quality of RelGAN and other models on EMNLP2017 WMT News, we also perform the human evaluation by using Amazon Mechanical Turk. We randomly sampled 100 sentences for each model and the real dataset, and asked 10 different people to score each sentence on a scale of 1-5. Please see Appendix A.2 for more details of human evaluation.
171
+
172
+ <table><tr><td>Method</td><td>MLE</td><td>SeqGAN</td><td>RankGAN</td><td>LeakGAN</td></tr><tr><td>Human score</td><td>2.751 ±0.908</td><td>2.588 ±0.970</td><td>2.449 ±1.051</td><td>3.011 ± 0.908</td></tr><tr><td>Method</td><td>RelGAN(100)</td><td>RelGAN(1000)</td><td>Real</td><td rowspan="2"></td></tr><tr><td>Human score</td><td>3.407 ± 0.909</td><td>3.285 ±0.900</td><td>4.445 ± 0.679</td></tr></table>
173
+
174
+ Table 4: The means and standard deviations of human scores for RelGAN and other models on EMNLP2017 WMT News by using Amazon Mechanical Turk. Note that “Real” denotes the human score on the real dataset.
175
+
176
+ The human score results are provided in Table 4, where we can see that RelAGN generates better human-looking samples than other GANs and the MLE baseline model.
177
+
178
+ # 3.4 ABLATION STUDY
179
+
180
+ # 3.4.1 IMPACT OF RELATIONAL MEMORY
181
+
182
+ To show the impact of relational memory in RelGAN, we propose to replace relational memory by LSTM-32 and LSTM-512 as the generator architecture, respectively, and see how the performance differs. Here LSTM- $k$ represents the LSTM with hidden dimension being $k$ . We choose $k = 3 2$ because most previous GANs (Yu et al., 2017; Guo et al., 2017) have used this architecture for text generation, and also choose $k = 5 1 2$ because for more fair comparison, we want to keep the total memory size of LSTM to be the same with the relational memory we have used.
183
+
184
+ The results on the COCO Image Captions dataset are shown in Figure 4 (Left), where we provide the BLEU-4 score (See Appendix D.1 for all the BLEU scores). We can see that the BLEU scores of relational memory are consistently better than those of LSTM-32 and LSTM-512, which demonstrates the advantages of using relational memory as generator in RelGAN.
185
+
186
+ ![](images/61f8fce3d03201bee6e4d4517cd1de856a0a71dfd5da5745383b70b5259df38c.jpg)
187
+ Figure 4: (Left) Training curves of the BLEU-4 score on COCO Image Captions with different generator architectures – relational memory (RM), LSTM-32 and LSTM-512. (Right) Training curves of the BLEU-2 score on COCO Image Captions with Gumbel-Softmax relaxation and the vanilla REINFORCE method. All the results are obtained by taking the average of 6 runs with different random seeds.
188
+
189
+ # 3.4.2 IMPACT OF GUMBEL-SOFTMAX RELAXATION
190
+
191
+ To show the impact of Gumbel-Softmax relaxation in RelGAN, we can instead apply the vanilla REINFORCE method to deal with the non-differentiable issue of RelGAN on text generation. In this experiment, we keep all other hyperparameters in RelGAN fixed and compare the performance of Gumbel-Softmax relaxation and the vanilla REINFORCE method.
192
+
193
+ The results are shown in Figure 4 (Right), where the BLEU-2 score is provided (See Appendix D.2 for all the BLEU scores). We can see that under the proposed RelGAN framework, Gumbel-Softmax relaxation performs much better than the vanilla REINFORCE method. During experiments, we find that the variance of generator gradients in the vanilla REINFORCE method is too large to provide any useful update for generator, which may explain why the performance of vanilla REINFORCE does not improve after the pre-training, as observed in Figure 4 (Right). The exploration of various variance reduction techniques for the REINFORCE method in RelGAN is out of scope of this paper.
194
+
195
+ # 3.4.3 IMPACT OF MULTIPLE REPRESENTATIONS IN DISCRIMINATOR
196
+
197
+ To show the impact of multiple embedded representations in discriminator while keeping the expressive power of discriminator the same for fair comparison, we propose to apply $S$ embedded presentations with each embedded vector of length $\begin{array} { r } { d = \frac { d _ { \mathrm { m a x } } } { S } } \end{array}$ where $d _ { \mathrm { m a x } }$ denotes the total length of representations. In this experiment, we set $d _ { \operatorname* { m a x } } = 6 4$ , and thus for instance, if $S = 1$ then $d = 6 4$ for each embedded vector, and if $S = 2$ then $d = 3 2$ for each embedded vector, and so on.
198
+
199
+ We first test RelGAN on the synthetic data with $S \in \{ 1 , 2 , 4 , 8 , 1 6 , 3 2 , 6 4 \}$ and the results are shown in Figure 5 (Left). We can see that as the number of embedded representations $S$ increases, the best NLLoracle score tends to keep decreasing, yielding better sample quality. Furthermore, we test RelGAN on COCO Image Captions with $S \in \{ 1 , 6 4 \}$ and the BLEU-3 score is shown in Figure 5 (Right). Still, we can see that the BLEU scores of RelGAN with $S = 6 4$ are consistently better than those of RelGAN with $S = 1$ (see Appendix D.3 for all the BLEU scores). Note that in both experiments, we do not see an obvious sign of mode collapse with varying number of representations. For example, the ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ score on the synthetic data stays around 4.4 for different values of $S$ (close to the best $\mathrm { N L L _ { g e n } } ~ 4 . \overset { \cdot } { 2 }$ for MLE shown in Figure 3 (Left)). Thus, these experiments demonstrate the advantages of using multiple embedded representations for discriminator in RelGAN.
200
+
201
+ ![](images/dc54968bfd7713916dd05bea87c39d6d5ca4a52d9a13208466ea30023927e844.jpg)
202
+ Figure 5: (Left) The best $\mathrm { N L L _ { o r a c l e } }$ score on the synthetic data varies with different number of embedded presentations $S = \{ 1 , 2 , 4 , 8 , 1 6 , 3 2 , 6 4 \}$ where $\beta _ { \mathrm { m a x } } = 1 0$ . (Right) The training curves of BLEU-3 score on COCO Image Captions with the number of embedded representations $S = 1$ and $S = 6 4$ , respectively, where $\beta _ { \mathrm { m a x } } = 1 0 0 0$ . All results are obtained by taking the average of 6 runs with different random seeds.
203
+
204
+ # 4 RELATED WORK
205
+
206
+ Since GANs are originally proposed for continuous data, extending GAN training to discrete data generation has been an active research topic. Current works focus on dealing with the nondiferentiable issue brought by the discrete data nature either by considering the RL methods or by reformulating the problem in continuous space.
207
+
208
+ A large class of GANs for text generation relies on the RL algorithm. SeqGAN ((Yu et al., 2017)) models the text generation as a sequential decision making process and trains the generator with policy gradient methods (Sutton et al., 2000). MaliGAN (Che et al., 2017) proposes the co-training with a maximum-likelihood objective to reduce the gradient variance. RankGAN (Lin et al., 2017) proposes a ranking model to replace the original binary classifier as the discriminator. LeakGAN (Guo et al., 2017) designs a mechanism to provide intermediate information about text generation for generator, where the discriminator can leak its features through a manager module. MaskGAN (Fedus et al., 2018) introduces an actor-critic conditional GAN that fills in missing text conditioned on the surrounding context by resorting to a seq2seq model.
209
+
210
+ Other GANs without RL methods either approximate the discrete data or work in the continuous latent space. TextGAN (Zhang et al., 2017) provides a feature matching mechanism that matches the latent features of real and generated sentences via a kernelized discrepancy metric to alleviate the mode collapse. FM-GAN (Chen et al., 2018) proposes to match the latent feature distributions of real and synthetic sentences using the feature-movers distance. Similar to our work, both textGAN and FM-GAN apply an annealed softmax to approximate the argmax in the generator. However, they do not rely on the Gumbel-Max trick to reparametrize the sampling operations, which is the major difference with us in dealing with the non-differentiable issue. ARAE (Zhao et al., 2018) applies an additional autoencoder to embed the discrete data into a continuous latent space in which GANs can be trained properly. As for approximating the categorical distribution with GumbelSoftmax relaxation, Gu et al. (2017) has used it to improve the generation quality in neural machine translation. More similarly, Kusner & Hernandez-Lobato (2016) provides some initial experiments ´ of training GANs with Gumbel-Softmax relaxation on a synthetic task, but scaling them to work on real text dataset remains a challenging open problem.
211
+
212
+ Attention mechanisms, in particular self-attention (Vaswani et al., 2017), have gradually become a building block of many novel neural network architectures (Vaswani et al., 2017; Parmar et al., 2018; Santoro et al., 2018) due to its ability of capturing long or global dependencies and reducing computational cost via parallelization. In the context of GANs, self-attention have not been fully explored. SAGAN (Zhang et al., 2018) applies self-attention in GANs to model long range dependencies in images and get the state-of-the-art results on conditional image generation. In contrast, we employ self-attention in GANs for text generation by using relational memory as generator.
213
+
214
+ # 5 CONCLUSIONS
215
+
216
+ We proposed a new GAN architecture called RelGAN for text generation, that outperforms most current models in terms of sample quality and diversity on both synthetic and real data. Furthermore, the trade-off between the generated sample diversity and quality can be adjusted properly in RelGAN by controlling the inverse temperature. In RelGAN, we used the relational memory based generator to improve its ability of modeling long distance dependencies and also applied multiple embedded representations in discriminator such that it can provide more diverse and informative guiding signal for generator. By applying Gumbel-Softmax relaxation to deal with the non-differentiable issue, our architecture is simple to implement without employing intensive RL heuristics. For the future directions, since we have demonstrated that GANs with Gumbel-Softmax relaxation is very promising for text generation, we would like to explore further in this direction. For example, it is interesting to make RelGAN work better without any pre-training. Also, extending RelGAN to a conditional model for many text generation related applications is another interesting direction.
217
+
218
+ # ACKNOWLEDGEMENT
219
+
220
+ We would like to thank all the reviewers for their helpful comments. WN and ABP were supported by IARPA via DoI/IBC contract D16PC00003 and NSF NeuroNex grant DBI-1707400.
221
+
222
+ # REFERENCES
223
+
224
+ Martin Arjovsky and Leon Bottou. Towards principled methods for training generative adversarial ´ networks. arXiv preprint arXiv:1701.04862, 2017.
225
+ Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein gan. ´ arXiv preprint arXiv:1701.07875, 2017.
226
+ Tong Che, Yanran Li, Ruixiang Zhang, R Devon Hjelm, Wenjie Li, Yangqiu Song, and Yoshua Bengio. Maximum-likelihood augmented discrete generative adversarial networks. arXiv preprint arXiv:1702.07983, 2017.
227
+ Liqun Chen, Shuyang Dai, Chenyang Tao, Dinghan Shen, Zhe Gan, Haichao Zhang, Yizhe Zhang, and Lawrence Carin. Adversarial text generation via feature-mover’s distance. In NIPS, 2018.
228
+ Xinlei Chen, Hao Fang, Tsung-Yi Lin, Ramakrishna Vedantam, Saurabh Gupta, Piotr Dollar, and ´ C Lawrence Zitnick. Microsoft coco captions: Data collection and evaluation server. arXiv preprint arXiv:1504.00325, 2015.
229
+ Ishan Durugkar, Ian Gemp, and Sridhar Mahadevan. Generative multi-adversarial networks. arXiv preprint arXiv:1611.01673, 2016.
230
+ William Fedus, Ian Goodfellow, and Andrew M Dai. Maskgan: Better text generation via filling in the . arXiv preprint arXiv:1801.07736, 2018.
231
+ Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in Neural Information Processing Systems, 2014.
232
+ Jiatao Gu, Daniel Jiwoong Im, and Victor OK Li. Neural machine translation with gumbel-greedy decoding. arXiv preprint arXiv:1706.07518, 2017.
233
+ Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron C Courville. Improved training of wasserstein gans. In Advances in Neural Information Processing Systems, pp. 5767–5777, 2017.
234
+ Jiaxian Guo, Sidi Lu, Han Cai, Weinan Zhang, Yong Yu, and Jun Wang. Long text generation via adversarial training with leaked information. arXiv preprint arXiv:1709.08624, 2017.
235
+ Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
236
+ Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. arXiv preprint arXiv:1611.01144, 2016.
237
+ Alexia Jolicoeur-Martineau. The relativistic discriminator: a key element missing from standard gan. arXiv preprint arXiv:1807.00734, 2018.
238
+ Yoon Kim. Convolutional neural networks for sentence classification. arXiv preprint arXiv:1408.5882, 2014.
239
+ Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
240
+ Matt J Kusner and Jose Miguel Hern ´ andez-Lobato. Gans for sequences of discrete elements with ´ the gumbel-softmax distribution. arXiv preprint arXiv:1611.04051, 2016.
241
+ Kevin Lin, Dianqi Li, Xiaodong He, Zhengyou Zhang, and Ming-Ting Sun. Adversarial ranking for language generation. In Advances in Neural Information Processing Systems, 2017.
242
+ Sidi Lu, Lantao Yu, Weinan Zhang, and Yong Yu. Cot: Cooperative training for generative modeling. arXiv preprint arXiv:1804.03782, 2018.
243
+ Chris J Maddison, Andriy Mnih, and Yee Whye Teh. The concrete distribution: A continuous relaxation of discrete random variables. arXiv preprint arXiv:1611.00712, 2016.
244
+ Sebastian Nowozin, Botond Cseke, and Ryota Tomioka. f-gan: Training generative neural samplers using variational divergence minimization. In Advances in Neural Information Processing Systems, 2016.
245
+ Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. Bleu: a method for automatic evaluation of machine translation. In Proceedings of the 40th annual meeting on association for computational linguistics, 2002.
246
+ Niki Parmar, Ashish Vaswani, Jakob Uszkoreit, Łukasz Kaiser, Noam Shazeer, and Alexander Ku. Image transformer. arXiv preprint arXiv:1802.05751, 2018.
247
+ Adam Santoro, Ryan Faulkner, David Raposo, Jack Rae, Mike Chrzanowski, Theophane Weber, Daan Wierstra, Oriol Vinyals, Razvan Pascanu, and Timothy Lillicrap. Relational recurrent neural networks. arXiv preprint arXiv:1806.01822, 2018.
248
+ Stanislau Semeniuta, Aliaksei Severyn, and Sylvain Gelly. On accurate evaluation of gans for language generation. arXiv preprint arXiv:1806.04936, 2018.
249
+ Richard S Sutton, David A McAllester, Satinder P Singh, and Yishay Mansour. Policy gradient methods for reinforcement learning with function approximation. In Advances in neural information processing systems, 2000.
250
+ Lucas Theis, Aaron van den Oord, and Matthias Bethge. A note on the evaluation of generative ¨ models. arXiv preprint arXiv:1511.01844, 2015.
251
+ Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, 2017.
252
+ Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992.
253
+ Lantao Yu, Weinan Zhang, Jun Wang, and Yong Yu. Seqgan: Sequence generative adversarial nets with policy gradient. In AAAI, 2017.
254
+ Han Zhang, Ian Goodfellow, Dimitris Metaxas, and Augustus Odena. Self-attention generative adversarial networks. arXiv preprint arXiv:1805.08318, 2018.
255
+
256
+ Yizhe Zhang, Zhe Gan, Kai Fan, Zhi Chen, Ricardo Henao, Dinghan Shen, and Lawrence Carin. Adversarial feature matching for text generation. In International Conference on Machine Learning, 2017.
257
+
258
+ Junbo Zhao, Yoon Kim, Kelly Zhang, Alexander Rush, and Yann LeCun. Adversarially regularized autoencoders. In International Conference on Machine Learning, 2018.
259
+
260
+ Yaoming Zhu, Sidi Lu, Lei Zheng, Jiaxian Guo, Weinan Zhang, Jun Wang, and Yong Yu. Texygen: A benchmarking platform for text generation models. arXiv preprint arXiv:1802.01886, 2018.
261
+
262
+ # A EXPERIMENTAL SETTINGS
263
+
264
+ # A.1 TRAINING DETAILS
265
+
266
+ Unless stated otherwise, for the CNN-based discriminator architecture, we use filter windows of sizes $\{ 3 , 4 , 5 \}$ and 300 feature maps each. For relational memory, we set memory size to be 256, memory slots to be 1, number of heads to be 2. The batch size is set to be 64. For embedding dimensions, we set the embedding dimension of the input token for generator to be 32 and that for discriminator to be 1 with the number of embedded representations $S = 6 4$ . We use Adam (Kingma & Ba, 2014) with $\beta _ { 1 } = 0 . 9$ and $\beta _ { 2 } = 0 . 9 9 9$ and gradient clipping is applied if the norm of gradients exceeds 5. We first pre-train the generator via MLE with learning rate of 1e-2 for 150 epochs and then start adversarial training with learning rate of 1e-4 for both discriminator and generator. For adversarial training, we set the maximum number of iterations $N = 5 0 0 0$ and we perform 5 gradient descent steps on the discriminator for every step on the generator.
267
+
268
+ # A.2 HUMAN EVALUATION DETAILS
269
+
270
+ On Amazon Mechanical Turk, our instructions are given as follows:
271
+
272
+ The text quality evaluation is based on grammatical correctness and meaningfulness (i.e. if a sentence makes sense). Please ignore any text formatting problems (e.g., capitalization, punctuation, spelling errors, extra spaces between words and punctuations). Note: A very short sentence (less than 10 words) should be penalized with its score minus 1. Please see below for the detailed criteria.
273
+
274
+ Table 5: The human evaluation scale from 1 to 5 with corresponding criteria and example sentences.
275
+
276
+ <table><tr><td rowspan=1 colspan=1>Scale</td><td rowspan=1 colspan=1>Criterion&amp;Example</td></tr><tr><td rowspan=1 colspan=1>5 - Excellent</td><td rowspan=1 colspan=1>Its grammatically correct and makes sense.For example,“if England wins the World Cup next year,it will be the most significantresult the sport has seen in more than a decade .&quot;</td></tr><tr><td rowspan=1 colspan=1>4 - Good</td><td rowspan=1 colspan=1>It has some small grammatical errors and mostly makes sense.For example,“it is useful to have had a doctor who forced her to release him a coupleofdays before she was cleared &quot;</td></tr><tr><td rowspan=1 colspan=1>3-Fair</td><td rowspan=1 colspan=1>It has major grammatical errors but the whole still conveys some meanings.For example,“even then once again there’s a sign of that stuffis going on the way towork on christmas eve .&quot;</td></tr><tr><td rowspan=1 colspan=1>2 - Poor</td><td rowspan=1 colspan=1>It has severe grammatical errors and the whole doesn&#x27;t make sense, but some parts arestill locally meaningful.For example,“we go to work for the moment in life their eyes and,i have been adifferent race on to go .&quot;</td></tr><tr><td rowspan=1 colspan=1>1 - Unacceptable</td><td rowspan=1 colspan=1>It isbasically a random collection of words.For example,��i go com com com,i on on on play can go go.&quot;</td></tr></table>
277
+
278
+ ![](images/7fd0b03da0c6a8c72b3149e48fd8f7565e8236b07c35278ddfd4eb356fe67449.jpg)
279
+ Figure 6: Training curves of BLEU scores on COCO Image Captions with different loss functions: RSGAN (Jolicoeur-Martineau, 2018), standard GAN (the non-saturating version) (Goodfellow et al., 2014) and hinge loss (Nowozin et al., 2016; Zhang et al., 2018), where $\beta _ { \mathrm { m a x } } = 1 0 0 0$ and we use two different optimizers – (a) Adam and (b) RMSProp. All the results are obtained by taking the average of 6 runs with different random seeds. The vertical dash line represents the end of pre-training. We can see that RelGAN works well with different commonly-used loss functions of GANs and different optimization methods. In this scenario, the performance of RSGAN and standard GAN outperforms the hinge loss version.
280
+
281
+ # C GENERATED SAMPLES ON REAL DATASET
282
+
283
+ C.1 GENERATED SAMPLES ON COCO IMAGE CAPTIONS DATASET
284
+
285
+ a man is sitting on a bench next to a bicycle .
286
+ a man fixing a motor cycle in a race .
287
+ a rectangle shaped wooden sitting on a lush green field .
288
+ a man standing in a picture of a kitchen with a dog watching him .
289
+ a man is carving some meat in a park .
290
+ a kitchen with a black window and a large white stove wall .
291
+ a cat is looking on a man in a bathroom .
292
+ a train is covered in the air in the city scene .
293
+ a bathroom has a toilet , and bathroom rug for a urinal or a urinal on the side .
294
+ a home kitchen with a double oven and table while a table and chairs .
295
+ a small airplane flying above an airport covered with wood .
296
+ a man in a kitchen preparing food on a table .
297
+ a large passenger jet flying in a clear blue sky .
298
+ a group of people riding motorcycles on a street .
299
+ a woman in a kitchen with her hands clasped . a smiling woman is sitting on a green bench .
300
+ people are hiding under colorful umbrellas on a rainy day .
301
+ a photo of a small restroom in a kitchen .
302
+ many sheep graze are shown in front of a group of people .
303
+ a plane is parked next to an airplane on a runway near a control tower with two back .
304
+ a woman walking past a straw shower holding a corner .
305
+ an office desk with a row of books in the kitchen .
306
+ a cat sitting on top of a kitchen counter .
307
+ a person riding a bike through a lush green park .
308
+ a bathroom with a sink , toilet and toilet paper dispenser .
309
+ a man is on a motorcycle with a woman on the back of it .
310
+ two giraffes in a wild , lightly wooded field .
311
+ a metal tin pan filled with two different kitchen appliances .
312
+ a white airplane flying in the sky over a runway .
313
+ a car driving on a busy street at night from an airport .
314
+
315
+ # C.2 GENERATED SAMPLES ON EMNLP2017 WMT NEWS DATASET
316
+
317
+ he is also watching closely on staying in the plan , but sometimes i still don ’ t think that ’ s going to happen on saturday .
318
+ and so , they didn ’ t want to be in their position , and that was something they would do to my wife . i would like to assess whether you should be able to take that into that issue than you did on a sunday . “ he ’ s a young lady , so i don ’ t want to show up for them , ” she said .
319
+ that ’ s not yet about what you want to say about reality , but probably don ’ t think about that would just make me comfortable in my life .
320
+ officials have been also a member of nato against the us , and for the first time that so many other countries are on the rise , and that will be the only way to stay here .
321
+ he has always vowed to give him a little more on for him , and i think he is very willing for the division . we ’ ve had to try and get into the coming down to the today ’ s end .
322
+ i don ’ t think that ’ s why we did not have to score the last two .
323
+ meanwhile , it was never been in the past , but it was not known until the coalition was given the support of the rebels on the terms of the claims .
324
+ he said : “ i don ’ t think we should be better at what we would do to the good .
325
+ “ we had to get on with that , ” she said at a news conference .
326
+ by contrast , but this is a turning point at her age .
327
+ but i will do that , which i have to do with the city , and my new hopes is from all over the world . “ this is a very bad , and it ’ s not clear that this is a danger of this , ” he said . at a detroit press with reporters on the flight , gave informed operators time to interview mr . cox that he was struggling with all of his treatments .
328
+ “ in the past five days , we ’ re going to enjoy maybe that and after that , you ’ re going to stay to dinner with friends and family , ” he said .
329
+ the union has indicated that there are no restrictions on the long - standing alliance in any key areas .
330
+ i never thought i could put over the line but i couldn ’ t quite lose my job .
331
+ since then , while the number of people stood by the wall street banks fell by 2 percent over the past 10 years , there ’ s no need to say that .
332
+ “ they had to fly in the field , ” he said , adding that it didn ’ t miss it .
333
+ “ trump ’ s voice will be a positive one for mr . trump ’ s transition team , ” he said .
334
+ he was still working on a training camp friday with a small into a new manager .
335
+ the 15 - year - old man has been reported missing by a falling from the city centre .
336
+ “ it ’ s a process that can take a little while , ” one resident said .
337
+ a well - meaning - predicted or very public policy , seeking to work with us .
338
+ “ i ’ m not to have made me a bit more than anything , but i ’ ve never done that , ” he said .
339
+ they were waiting to see how many changes could come from us and that ’ s why it has made it leave facing .
340
+ she initially noted that some of the other victims began to come from being more than prepared to stand for .
341
+ “ i ’ ve never heard of the abuse , because we need to work with him , ” he added .
342
+
343
+ # D MORE RESULTS ON ABLATION STUDY
344
+
345
+ # D.1 IMPACT OF RELATIONAL MEMORY
346
+
347
+ ![](images/87465a23a0a434ffd21122421237a0ea21916550bb1fdea8cd7dfe3b88273a61.jpg)
348
+ Figure 7: Training curves of BLEU scores on COCO Image Captions with different generator architectures – relational memory (RM), LSTM-32 and LSTM-512, where $\beta _ { \mathrm { m a x } } = 1 0 0 0$ . We can see that the BLEU scores of relational memory are consistently better than those of LSTM-32 and LSTM-512, which demonstrates the advantages of using relational memory as generator in RelGAN.
349
+
350
+ ![](images/3b1c68ebdf534b04a855eaad99de3ec7fe95f37983c831125d3d1d4d105fc218.jpg)
351
+ D.2 IMPACT OF GUMBEL-SOFTMAX RELAXATION
352
+ Figure 8: Training curves of BLEU scores on COCO Image Captions with different gradient relaxations for GANs on discrete data – Gumbel-Softmax relaxation and REINFORCE method. We can see that the BLEU scores of Gumbel-Softmax relaxation are consistently better than those of REINFORCE method, which demonstrates the advantages of using Gumbel-Softmax relaxation to deal with non-differentiable issues in RelGAN.
353
+
354
+ ![](images/516375f27df355fd42f1f8a84af093af26a7511e597562713973c025dcd84919.jpg)
355
+ Figure 9: Training curves of BLEU scores on COCO Image Captions with different number of embedded representations $S = 1$ and $S \ : = \ : 6 4$ , where $\beta _ { \mathrm { m a x } } ~ = ~ 1 0 0 0$ . We can see that the BLEU scores of $S \ : = \ : 6 4$ are consistently better than those of $S = 1$ , which demonstrates the advantages of using multiple embedded representations for discriminator in RelGAN.
356
+
357
+ # E DIVERSITY-QUALITY TRANSITION DURING TRAINING
358
+
359
+ As we can observe from Figures 7-9 in the above appendices, the BLEU scores of RelGAN (denoted by the blue curves in each subfigure) first increase over iterations and then keep decreasing after around 800 iterations. In other words, its sample quality first increases and then decreases during the adversarial training. To see what happens in the training dynamics of RelGAN, we also provide the training curve of the diversity metric $\mathrm { - N L L _ { \mathrm { g e n } } }$ in RelGAN as shown in Figure 10.
360
+
361
+ ![](images/547c152a008965d8229710e1918a0914e2f8c1fa06a5a04d315dc63036a62f5f.jpg)
362
+ Figure 10: The training curve of ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ in RelGAN on COCO Image Captions, where $\beta _ { \mathrm { m a x } } = 1 0 0 0$ . We can see that during the adversarial training, the ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ score first increases and then decreases after around 800 iterations. The turning point matches well with those in the training curves of BLEU scores.
363
+
364
+ Interestingly, Figure 10 shows that during the adversarial training, the sample diversity (measured by $\mathrm { N L L } _ { \mathrm { g e n } } )$ of RelGAN first decreases and then increases, and its turning point matches well with that of the sample quality (measured by BLEU scores) of RelGAN. These training dynamics illustrate a diversity-quality transition over iterations in RelGAN: Early on in training, it learns to aggressively improve sample quality while sacrificing diversity. Later on, it turns instead to maximizing sample diversity while gradually decreasing sample quality. Intuitively, it seems to be much easier for the generator to just produce realistic samples – regardless of their diversity – to fool the discriminator in the early stage of training. As the discriminator becomes better at distinguishing samples with less diversity over iterations, the generator has to focus more on producing more diverse samples to fool the discriminator.
365
+
366
+ # F RELGAN WITHOUT PRE-TRAINING
367
+
368
+ In this section, we want to test the performance of RelGAN without pre-training for different loss functions, including standard GAN (the non-satuarating version) (Goodfellow et al., 2014), WGANGP (Gulrajani et al., 2017), hinge loss (Nowozin et al., 2016; Zhang et al., 2018) and RSGAN (Jolicoeur-Martineau, 2018). The BLEU and ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ scores evaluated on COCO Image Captions are shown in Table 8.
369
+
370
+ Table 8: The BLEU and ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ scores of RelGAN without pre-training on COCO Image Captions where with a little hyperparameter tuning, we set $\beta _ { \mathrm { m a x } } = 1 0 0$ for the standard GAN loss and $\beta _ { \mathrm { m a x } } = 1 0 0 0$ for other losses. All the results are run with 6 random seeds and the final score is obtained by taking the average of scores. As a reference, we also provide the results of an untrained RelGAN which is marked as “random”. Note that for the hinge loss, we get no valid results as it suffers from the vanishing gradient issue.
371
+
372
+ <table><tr><td>Losses</td><td>BLEU-2</td><td>BLEU-3</td><td>BLEU-4</td><td>BLEU-5</td><td>NLLgen</td></tr><tr><td>Hinge</td><td>=</td><td>-</td><td>=</td><td>1</td><td>-</td></tr><tr><td>WGAN-GP</td><td>0.330 ± 0.024</td><td>0.111 ± 0.019</td><td>0.065 ± 0.017</td><td>0.045 ± 0.013</td><td>4.063 ± 0.623</td></tr><tr><td>RSGAN</td><td>0.460 ± 0.026</td><td>0.172 ± 0.025</td><td>0.085 ± 0.017</td><td>0.056 ± 0.013</td><td>3.065 ± 0.917</td></tr><tr><td>Standard</td><td>0.590 ± 0.019</td><td>0.280 ± 0.020</td><td>0.141 ± 0.018</td><td>0.094 ± 0.011</td><td>2.259 ± 0.263</td></tr><tr><td>Random</td><td>0.041</td><td>0.017</td><td>0.011</td><td>0.008</td><td>8.355</td></tr></table>
373
+
374
+ We can see that without pre-training, there is still a significant improvement for RelGAN compared with the random generation, in particular for the standard GAN loss, even though the improvement is inferior to the case with pre-training. In contrast, without pre-training, previous RL-based GANs for text generation, such as SeqGAN and RankGAN, always get stuck around their initialization points and are not able to improve their performance at all. This demonstrates that RelGAN may be a more promising GAN architecture to explore in order to completely get rid of the pre-training for GANs on text generation. Besides, Table 8 also shows that the evaluation results of RelGAN without pretraining vary with different loss functions and values of $\beta _ { \mathrm { m a x } }$ . We leave an extensive hyperparameter search to further improve the performance of RelGAN without pre-training for future work.
375
+
376
+ # G MORE EXPLORATION ON TUNABLE HYPERPARAMETER $\beta _ { \mathrm { m a x } }$
377
+
378
+ For real data experiments, we have showed the advantages of RelGAN over other models by setting the maximum inverse temperature $\beta _ { \mathrm { m a x } } \in \{ 1 0 0 , 1 0 0 0 \}$ , which are carefully chosen for a good tradeoff between sample quality and diversity. A natural question will be to explore the two extremes: what happens with the real data if $\beta _ { \mathrm { m a x } }$ is either too large or too small? Does it behave similarly to the synthetic data experiments in terms of the trade-off between sample diversity and quality?
379
+
380
+ To this end, we choose a broad range of $\beta _ { \mathrm { m a x } } \in \{ 1 , 1 0 , 1 0 ^ { 2 } , 1 0 ^ { 3 } , 1 0 ^ { 4 } , 1 0 ^ { 5 } , 1 0 ^ { 6 } , 1 0 ^ { 7 } \}$ and test its impact in RelGAN on the COCO Image Captions dataset. The BLEU and ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ scores are given in Table 9, where we can see that both BLEU and ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ scores increase with the decrease of $\beta _ { \mathrm { m a x } }$ , and the variance of each score also consistently becomes larger for a smaller $\beta _ { \mathrm { m a x } }$ . For better illustration, we also plot BLEU-4 and ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ scores with error bars in Figure 11.
381
+
382
+ It first confirms that similar to the synthetic data experiments, there also exists a consistent trade-off between sample quality and diversity in real data, controlled by the tunable hyperparameter $\beta _ { \mathrm { m a x } }$ . Besides, it reveals the failing cases at the two extremes: On the one hand, if $\beta _ { \mathrm { m a x } }$ is too small, i.e. $\beta _ { \operatorname* { m a x } } = 1$ , RelGAN suffers from severe mode collapse (denoted by the large ${ \mathrm { N L L } } _ { \mathrm { g e n . } }$ ) and training instability (denoted by high variances of scores) issues. On the other hand, if $\beta _ { \mathrm { m a x } }$ is too large, i.e. $\beta _ { \mathrm { m a x } } = \mathrm { \bar { 1 0 } ^ { 7 } }$ , the sample quality improvement of RelGAN becomes marginal (denoted by the low BLEU scores). Therefore, we have chosen the two intermediate values $\{ 1 0 0 , 1 0 0 0 \}$ of $\beta _ { \mathrm { m a x } }$ in the
383
+
384
+ <table><tr><td>βmax</td><td>BLEU-2</td><td>BLEU-3</td><td>BLEU-4</td><td>BLEU-5</td><td>NLLgen</td></tr><tr><td>1</td><td>0.890± 0.121</td><td>0.791± 0.209</td><td>0.659± 0.243</td><td>0.500± 0.230</td><td>1.454 ± 0.121</td></tr><tr><td>10</td><td>0.862 ± 0.038</td><td>0.741± 0.060</td><td>0.604 ± 0.060</td><td>0.445 ± 0.080</td><td>1.084 ± 0.061</td></tr><tr><td>10²</td><td>0.849 ± 0.030</td><td>0.687 ± 0.047</td><td>0.502 ± 0.048</td><td>0.331 ± 0.044</td><td>0.756 ± 0.054</td></tr><tr><td>103</td><td>0.814 ± 0.012</td><td>0.634 ± 0.020</td><td>0.455 ± 0.023</td><td>0.303 ± 0.020</td><td>0.655 ± 0.048</td></tr><tr><td>104</td><td>0.801 ± 0.006</td><td>0.609 ± 0.012</td><td>0.430 ± 0.019</td><td>0.288 ± 0.015</td><td>0.631 ± 0.045</td></tr><tr><td>105</td><td>0.796 ± 0.007</td><td>0.599 ± 0.012</td><td>0.417 ± 0.010</td><td>0.277 ± 0.012</td><td>0.588 ± 0.037</td></tr><tr><td>106</td><td>0.790 ± 0.009</td><td>0.588 ± 0.011</td><td>0.408 ± 0.013</td><td>0.272 ± 0.010</td><td>0.569± 0.039</td></tr><tr><td>107</td><td>0.775 ± 0.011</td><td>0.572 ± 0.020</td><td>0.390 ± 0.019</td><td>0.252 ± 0.016</td><td>0.547 ± 0.032</td></tr></table>
385
+
386
+ Table 9: The BLEU and ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ scores of RelGAN with various values of $\beta _ { \mathrm { m a x } }$ on COCO Image Captions. All the results are run with 6 random seeds and the final score is obtained by taking the average of scores. As we can see, both BLEU and ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ scores increase with the decrease of $\beta _ { \mathrm { m a x } }$ . Besides, the variance of each score also consistently becomes larger for a smaller $\beta _ { \mathrm { m a x } }$ .
387
+
388
+ ![](images/c138de5c8ce35c67317da279e683678aee020533e020b8b54f981af180c36523.jpg)
389
+ Figure 11: The BLEU-4 (Left) and ${ \mathrm { N L L } } _ { \mathrm { g e n } }$ (Right) scores with error bars in RelGAN on COCO Image Captions with varying maximum inverse temperature $\beta _ { \mathrm { m a x } }$ .
390
+
391
+ main text to show the advantages of RelGAN over other models while still demonstrating its ability to control the trade-off between sample quality and diversity.
parse/train/rJedV3R5tm/rJedV3R5tm_content_list.json ADDED
@@ -0,0 +1,1679 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "RELGAN: RELATIONAL GENERATIVE ADVERSARIAL NETWORKS FOR TEXT GENERATION ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 176,
8
+ 98,
9
+ 821,
10
+ 146
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Weili Nie∗ Rice University wn8@rice.edu ",
17
+ "bbox": [
18
+ 184,
19
+ 170,
20
+ 303,
21
+ 212
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "Nina Narodytska \nVMware Research \nnnarodytska@vmware.com ",
28
+ "bbox": [
29
+ 344,
30
+ 170,
31
+ 563,
32
+ 212
33
+ ],
34
+ "page_idx": 0
35
+ },
36
+ {
37
+ "type": "text",
38
+ "text": "Ankit B. Patel Rice University & Baylor College of Medicine abp4@rice.edu ",
39
+ "bbox": [
40
+ 604,
41
+ 170,
42
+ 789,
43
+ 227
44
+ ],
45
+ "page_idx": 0
46
+ },
47
+ {
48
+ "type": "text",
49
+ "text": "ABSTRACT ",
50
+ "text_level": 1,
51
+ "bbox": [
52
+ 454,
53
+ 262,
54
+ 544,
55
+ 277
56
+ ],
57
+ "page_idx": 0
58
+ },
59
+ {
60
+ "type": "text",
61
+ "text": "Generative adversarial networks (GANs) have achieved great success at generating realistic images. However, the text generation still remains a challenging task for modern GAN architectures. In this work, we propose RelGAN, a new GAN architecture for text generation, consisting of three main components: a relational memory based generator for the long-distance dependency modeling, the Gumbel-Softmax relaxation for training GANs on discrete data, and multiple embedded representations in the discriminator to provide a more informative signal for the generator updates. Our experiments show that RelGAN outperforms current state-of-the-art models in terms of sample quality and diversity, and we also reveal via ablation studies that each component of RelGAN contributes critically to its performance improvements. Moreover, a key advantage of our method, that distinguishes it from other GANs, is the ability to control the trade-off between sample quality and diversity via the use of a single adjustable parameter. Finally, RelGAN is the first architecture that makes GANs with Gumbel-Softmax relaxation succeed in generating realistic text. ",
62
+ "bbox": [
63
+ 233,
64
+ 295,
65
+ 764,
66
+ 502
67
+ ],
68
+ "page_idx": 0
69
+ },
70
+ {
71
+ "type": "text",
72
+ "text": "1 INTRODUCTION ",
73
+ "text_level": 1,
74
+ "bbox": [
75
+ 176,
76
+ 531,
77
+ 334,
78
+ 547
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "Generative adversarial networks (GANs) (Goodfellow et al., 2014) were originally designed to generate continuous data and have achieved a lot of success at generating continuous samples, such as images. Recently, GANs were extended to generate discrete data, in particular text sequences (Kusner & Hernandez-Lobato, 2016; Yu et al., 2017; Zhang et al., 2017; Lin et al., 2017; Guo et al., 2017; ´ Fedus et al., 2018). However, this extension is not straightforward. The main issue is that outputs of GANs for the discrete data generation are not differentiable and thus the standard gradient-based techniques cannot be applied directly in these settings. To overcome this, most state-of-the-art GANs have used the REINFORCE algorithm (Williams, 1992) and its variants that originate from the reinforcement learning (RL) community to train the generator while the discriminator is still a classifier to discriminate real and generated text and provides reward signals for the generator updates. A detailed description of the related work is deferred to Appendix 4. ",
85
+ "bbox": [
86
+ 174,
87
+ 559,
88
+ 825,
89
+ 713
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "text",
95
+ "text": "Although these state-of-the-art GANs have shown some promising results in text generation as compared to the conventional maximum likelihood estimation (MLE) method, they also suffer from some fundamental issues, including training instability and mode collapse. First, their performance is quite sensitive to random parameter initializations and hyperparameter choices (Semeniuta et al., 2018). Moreover, many GANs heavily employ RL heuristics, such as Monte Carlo search (Yu et al., 2017) and hierarchical RL (Guo et al., 2017), making the already difficult-to-train GANs more complicated and thus the individual role of adversarial training unclear. The second issue is mode collapse as the generated text sentences tend to be less diverse (Semeniuta et al., 2018; Fedus et al., 2018) and it becomes more severe when generating longer sentences. The mode collapse issue can be caused either by a lack of expressive power in the generator (since it may not be capable of covering many more complex modes in data distribution), or by a less informative guiding signal in the discriminator (as it may constrain the generator updates to within certain modes). ",
96
+ "bbox": [
97
+ 174,
98
+ 719,
99
+ 825,
100
+ 886
101
+ ],
102
+ "page_idx": 0
103
+ },
104
+ {
105
+ "type": "text",
106
+ "text": "In this work, we propose a new GAN architecture – Relational GAN (RelGAN), whose design is motivated by the issues identified above. The RelGAN architecture mainly consists of three parts: 1) a relational memory (Santoro et al., 2018) based generator, which promises more expressive power and better ability of modeling longer-range dependencies in text; 2) Gumbel-Softmax relaxation (Jang et al., 2016; Maddison et al., 2016) for training GANs on discrete data, which simplifies our model, enabling us to stay within a classical GAN framework without intensive RL heuristics; 3) multiple embedded representations in the discriminator, enabling a more diverse and informative signal for the generator updates. We experimentally demonstrate that RelGAN outperforms most current models in terms of sample quality and diversity. Furthermore, we show via ablation studies that each part of RelGAN plays an important role in its performance improvements. A key advantage of our method, that distinguishes it from other GANs, is the ability to control the trade-off between sample quality and diversity, via the use of a single adjustable parameter. Finally, to the best of our knowledge, RelGAN is the first architecture to demonstrate that GANs with Gumbel-Softmax relaxation are capable of generating realistic text. ",
107
+ "bbox": [
108
+ 174,
109
+ 103,
110
+ 825,
111
+ 297
112
+ ],
113
+ "page_idx": 1
114
+ },
115
+ {
116
+ "type": "text",
117
+ "text": "2 RELGAN ",
118
+ "text_level": 1,
119
+ "bbox": [
120
+ 174,
121
+ 319,
122
+ 285,
123
+ 335
124
+ ],
125
+ "page_idx": 1
126
+ },
127
+ {
128
+ "type": "text",
129
+ "text": "2.1 RELATIONAL MEMORY BASED GENERATOR ",
130
+ "text_level": 1,
131
+ "bbox": [
132
+ 174,
133
+ 348,
134
+ 516,
135
+ 362
136
+ ],
137
+ "page_idx": 1
138
+ },
139
+ {
140
+ "type": "text",
141
+ "text": "Current dominant GANs for text generation, such as Kusner & Hernandez-Lobato (2016); Yu et al. ´ (2017); Lin et al. (2017); Guo et al. (2017); Fedus et al. (2018) are built using LSTM (Hochreiter & Schmidhuber, 1997) as the generator architecture. However, the LSTM-based generator might be the bottleneck of GANs from the following experimental observations: 1) The discriminator’s loss value very quickly goes to near its minimum after few iterations of adversarial training. It means that the discriminator may be much more powerful than the generator and can easily distinguish between real and fake samples. 2) Mode collapse in current GANs (Fedus et al., 2018) may also partly indicate the incapacity of generator, as it may not be expressive enough to fit all the modes of data distribution. 3) Current GANs perform poorly at long sentence generation (Guo et al., 2017), and we know that LSTM packs all information about the previous text sequences into a common hidden vector, potentially limiting its ability of modeling the long-distance dependency. ",
142
+ "bbox": [
143
+ 174,
144
+ 373,
145
+ 825,
146
+ 526
147
+ ],
148
+ "page_idx": 1
149
+ },
150
+ {
151
+ "type": "text",
152
+ "text": "Therefore, we propose to use the more powerful module – relational memory (Santoro et al., 2018) – as the generator architecture for text generation. The basic idea of relational memory is to consider a fixed set of memory slots (e.g. memory matrix) and allow for interactions between memory slots by using the self-attention mechanism (Vaswani et al., 2017). The empirical findings by Santoro et al. (2018) showed that relational memory performs better in the language modeling compared to LSTM. Intuitively, the use of multiple memory slots and the attention across these memories can increase the expressive power of generator and its ability of generating longer text sentences. ",
153
+ "bbox": [
154
+ 173,
155
+ 534,
156
+ 825,
157
+ 632
158
+ ],
159
+ "page_idx": 1
160
+ },
161
+ {
162
+ "type": "text",
163
+ "text": "Formally, we assume each row of the memory $M _ { t }$ represents a memory slot and Figure 1 shows how self-attention updates $M _ { t }$ by incorporating new observation $x _ { t }$ at time $t$ . Given $H$ heads, we have $H$ sets of queries, keys and values via three linear transformations, respectively: For each head, we get query $\\bar { Q } _ { t } ^ { ( h ) } = \\dot { M } _ { t } W _ { q } ^ { ( h ) }$ , key $K _ { t } ^ { ( h ) } = [ M _ { t } ; x _ { t } ] W _ { k } ^ { ( h ) }$ and value $V _ { t } ^ { ( \\dot { h } ) } = [ \\dot { M _ { t } } ; x _ { t } ] W _ { v } ^ { ( h ) }$ where $[ ; ]$ denotes the row-wise concatenation. Thus, the updated memory $\\tilde { M } _ { t + 1 }$ is given by ",
164
+ "bbox": [
165
+ 174,
166
+ 637,
167
+ 825,
168
+ 714
169
+ ],
170
+ "page_idx": 1
171
+ },
172
+ {
173
+ "type": "equation",
174
+ "img_path": "images/e1780b72e153c2468db491deeb7c437e8ffae21e0d14b75cdb5d2cc0fff8c5a9.jpg",
175
+ "text": "$$\n\\tilde { M } _ { t + 1 } = [ \\tilde { M } _ { t + 1 } ^ { ( 1 ) } : \\cdot \\cdot \\cdot : \\tilde { M } _ { t + 1 } ^ { ( H ) } ] , \\tilde { M } _ { t + 1 } ^ { ( h ) } = \\sigma \\left( \\frac { M _ { t } W _ { q } ^ { ( h ) } ( [ M _ { t } ; x _ { t } ] W _ { k } ^ { ( h ) } ) ^ { T } } { \\sqrt { d _ { k } } } \\right) [ M _ { t } ; x _ { t } ] W _ { v } ^ { ( h ) }\n$$",
176
+ "text_format": "latex",
177
+ "bbox": [
178
+ 199,
179
+ 727,
180
+ 779,
181
+ 770
182
+ ],
183
+ "page_idx": 1
184
+ },
185
+ {
186
+ "type": "text",
187
+ "text": "where $\\sigma ( \\cdot )$ denotes the softmax function which is performed on each row, $d _ { k }$ is the column dimension of the key $K _ { t } ^ { ( h ) }$ and $[ : ]$ denotes the column-wise concatenation. ",
188
+ "bbox": [
189
+ 174,
190
+ 782,
191
+ 825,
192
+ 815
193
+ ],
194
+ "page_idx": 1
195
+ },
196
+ {
197
+ "type": "text",
198
+ "text": "By following the same idea of Santoro et al. (2018), the next memory $M _ { t + 1 }$ and output (logits) $o _ { t }$ of the generator at time $t$ are given by ",
199
+ "bbox": [
200
+ 174,
201
+ 820,
202
+ 823,
203
+ 852
204
+ ],
205
+ "page_idx": 1
206
+ },
207
+ {
208
+ "type": "equation",
209
+ "img_path": "images/00fc719e6159f08913519c815d239409a54f12cdfb5f7ef1a8f103f0757da022.jpg",
210
+ "text": "$$\nM _ { t + 1 } = f _ { \\theta _ { 1 } } ( \\tilde { M } _ { t + 1 } , M _ { t } ) , o _ { t } = f _ { \\theta _ { 2 } } ( \\tilde { M } _ { t + 1 } , M _ { t } )\n$$",
211
+ "text_format": "latex",
212
+ "bbox": [
213
+ 339,
214
+ 863,
215
+ 656,
216
+ 883
217
+ ],
218
+ "page_idx": 1
219
+ },
220
+ {
221
+ "type": "text",
222
+ "text": "respectively, where the two parametrized functions $f _ { \\theta _ { 1 } }$ and $f _ { \\boldsymbol { \\theta _ { 2 } } }$ are combinations of skip connections, multi-layer perceptron (MLP), gated operations and/or pre-softmax linear transformations. ",
223
+ "bbox": [
224
+ 171,
225
+ 896,
226
+ 826,
227
+ 926
228
+ ],
229
+ "page_idx": 1
230
+ },
231
+ {
232
+ "type": "image",
233
+ "img_path": "images/524dde62a0ed6567cdecdea7b7857166bd4115af9112caee5a7d33fae3ccfb2f.jpg",
234
+ "image_caption": [
235
+ "Figure 1: The self-attention mechanism for updating the memory from $M _ { t }$ to $\\tilde { M } _ { t + 1 }$ by incorporating new observation $x _ { t }$ , where each row of the memory matrix $M _ { t }$ is a memory slot, and ${ Q } _ { t } ^ { ( h ) }$ , $K _ { t } ^ { ( h ) }$ and $V _ { t } ^ { ( h ) }$ denote the queries, keys and values, respectively. Note that the softmax function is performed on each row, and $\\otimes$ denotes the dot product. The concatenation (denoted by “concat”) of $M _ { t }$ and $x _ { t }$ is row-wise where the embedded input is first passed through a linear layer to make $x _ { t }$ match the row dimension of $M _ { t }$ . "
236
+ ],
237
+ "image_footnote": [],
238
+ "bbox": [
239
+ 290,
240
+ 101,
241
+ 709,
242
+ 231
243
+ ],
244
+ "page_idx": 2
245
+ },
246
+ {
247
+ "type": "text",
248
+ "text": "2.2 TRAINING WITH DISCRETE DATA ",
249
+ "text_level": 1,
250
+ "bbox": [
251
+ 176,
252
+ 338,
253
+ 444,
254
+ 353
255
+ ],
256
+ "page_idx": 2
257
+ },
258
+ {
259
+ "type": "text",
260
+ "text": "2.2.1 GUMBEL-SOFTMAX RELAXATION ",
261
+ "text_level": 1,
262
+ "bbox": [
263
+ 176,
264
+ 361,
265
+ 464,
266
+ 376
267
+ ],
268
+ "page_idx": 2
269
+ },
270
+ {
271
+ "type": "text",
272
+ "text": "Before the introduction of Gumbel-Softmax relaxation, we first show why training GANs with discrete data is a critical issue. Assuming the vocabulary size is $V$ , for the output logits $o _ { t } \\in \\mathbb { R } ^ { V }$ of the generator in (2), the next generated one-hot token $\\boldsymbol { y } _ { t + 1 } \\in \\mathbb { R } ^ { V }$ will be obtained by sampling: ",
273
+ "bbox": [
274
+ 174,
275
+ 382,
276
+ 825,
277
+ 425
278
+ ],
279
+ "page_idx": 2
280
+ },
281
+ {
282
+ "type": "equation",
283
+ "img_path": "images/cf71824eb0ffb312af5bdd5c923aa31af0b06eac090cd4aefe26029f67ed15f1.jpg",
284
+ "text": "$$\ny _ { t + 1 } \\sim \\sigma ( o _ { t } )\n$$",
285
+ "text_format": "latex",
286
+ "bbox": [
287
+ 452,
288
+ 433,
289
+ 545,
290
+ 449
291
+ ],
292
+ "page_idx": 2
293
+ },
294
+ {
295
+ "type": "text",
296
+ "text": "where similarly $\\sigma ( \\cdot )$ denotes the softmax function which is performed on $o _ { t }$ element-wisely and we use $\\sigma ( o _ { t } )$ to represent the multinomial distribution on the set of all possible tokens. As we know, the sampling operations in (3) on the multinomial distribution of the generator output are not differentiable, which implies a step function at the end of the generator. Since the derivative of a step function is 0 almost everywhere, we have ∂yt+1∂θ = 0 a.e. for t = 0, · · · , T − 1 where θG denotes the generator parameters. By chain rule, the gradients of the generator loss $l _ { G }$ w.r.t. $\\theta _ { G }$ will be ",
297
+ "bbox": [
298
+ 173,
299
+ 457,
300
+ 825,
301
+ 546
302
+ ],
303
+ "page_idx": 2
304
+ },
305
+ {
306
+ "type": "equation",
307
+ "img_path": "images/19936dedad7c528ab11da35588897f820e3d4fea6226cdddf2d23bb6943affab.jpg",
308
+ "text": "$$\n\\frac { \\partial l _ { G } } { \\partial \\theta _ { G } } = \\sum _ { i = 0 } ^ { T - 1 } \\frac { \\partial y _ { t + 1 } } { \\partial \\theta _ { G } } \\frac { \\partial l _ { G } } { \\partial y _ { t + 1 } } = 0 \\mathrm { ~ } a . e .\n$$",
309
+ "text_format": "latex",
310
+ "bbox": [
311
+ 380,
312
+ 553,
313
+ 617,
314
+ 595
315
+ ],
316
+ "page_idx": 2
317
+ },
318
+ {
319
+ "type": "text",
320
+ "text": "So the gradients of the generator loss cannot pass back to the generator via the discriminator. This is the notorious “non-differentiability issue” of GANs in discrete data generation. ",
321
+ "bbox": [
322
+ 171,
323
+ 603,
324
+ 823,
325
+ 631
326
+ ],
327
+ "page_idx": 2
328
+ },
329
+ {
330
+ "type": "text",
331
+ "text": "To deal with the non-differentiablity issue, we apply the Gumbel-Softmax relaxation technique which defines a continuous distribution over the simplex that can approximate samples from a categorical distribution (Jang et al., 2016; Maddison et al., 2016). Formally, the Gumbel-Softmax relaxation includes two parts: 1) The Gumbel-Max trick. According to Jang et al. (2016); Maddison et al. (2016), the sampling in (3) can be reparametrized as ",
332
+ "bbox": [
333
+ 173,
334
+ 637,
335
+ 825,
336
+ 708
337
+ ],
338
+ "page_idx": 2
339
+ },
340
+ {
341
+ "type": "equation",
342
+ "img_path": "images/51932ac41db0ed859d5e6dbc8d7939b85e382688d5e50f890c2d673f42191df3.jpg",
343
+ "text": "$$\ny _ { t + 1 } = \\mathrm { o n e . h o t } ( \\arg \\operatorname* { m a x } _ { 1 \\leq i \\leq V } ( o _ { t } ^ { ( i ) } + g _ { t } ^ { ( i ) } ) )\n$$",
344
+ "text_format": "latex",
345
+ "bbox": [
346
+ 349,
347
+ 715,
348
+ 648,
349
+ 738
350
+ ],
351
+ "page_idx": 2
352
+ },
353
+ {
354
+ "type": "text",
355
+ "text": "where $o _ { t } ^ { ( i ) }$ denotes the $i$ -th entry of $o _ { t }$ and $g _ { t } ^ { ( i ) }$ is from the i.i.d. standard Gumbel distribution, i.e. $g _ { t } ^ { ( i ) } = - \\log ( - \\log U _ { t } ^ { ( i ) } )$ with $U _ { t } ^ { ( i ) } \\sim \\mathrm { U n i f o r m } ( 0 , 1 )$ . 2) Relaxing the discreteness. As the arg max operation in (5) is still non-differentiable, we need further approximate the “one-hot with arg max” by softmax, which yields ",
356
+ "bbox": [
357
+ 173,
358
+ 746,
359
+ 825,
360
+ 809
361
+ ],
362
+ "page_idx": 2
363
+ },
364
+ {
365
+ "type": "equation",
366
+ "img_path": "images/3a4be99451dfeee3d506f3113f45491ab72ce156f392b1325187c42d0d5f0ec6.jpg",
367
+ "text": "$$\n\\hat { y } _ { t + 1 } = \\sigma \\big ( \\beta \\big ( o _ { t } + g _ { t } \\big ) \\big )\n$$",
368
+ "text_format": "latex",
369
+ "bbox": [
370
+ 424,
371
+ 815,
372
+ 573,
373
+ 833
374
+ ],
375
+ "page_idx": 2
376
+ },
377
+ {
378
+ "type": "text",
379
+ "text": "where $\\beta > 0$ is a tunable parameter called inverse temperature. As $\\hat { y } _ { t + 1 }$ in (6) is differentiable with respect to $o _ { t }$ , we can use $\\hat { y } _ { t + 1 }$ instead of the one-hot token $y _ { t + 1 }$ as the input of the discriminator. Also, note that the new observation $x _ { t + 1 }$ of the generator to be concatenated with $M _ { t + 1 }$ in next time $t + 1$ is given by $x _ { t + 1 } = f _ { \\theta _ { 3 } } ( y _ { t + 1 } )$ , where the parametrized function $f _ { \\theta _ { 3 } }$ is composed of an embedding layer that maps $y _ { t + 1 }$ to an embedded input and a linear layer that makes $x _ { t + 1 }$ match the row dimension of $M _ { t + 1 }$ (the embedded input and the linear layer are shown in Figure 1) . ",
380
+ "bbox": [
381
+ 173,
382
+ 840,
383
+ 825,
384
+ 925
385
+ ],
386
+ "page_idx": 2
387
+ },
388
+ {
389
+ "type": "image",
390
+ "img_path": "images/f7d0674eec7dbe2ffa7a9a58d3e8af99eec3fef634b69063a2f6457f40450d4b.jpg",
391
+ "image_caption": [
392
+ "Figure 2: The proposed discriminator framework with multiple embedded representations. The input is either the real sentence $\\left[ \\boldsymbol { r } _ { 1 } : \\cdots : \\boldsymbol { r } _ { T } \\right]$ where $r _ { t }$ denotes the $t$ -th one-hot token, or the generated (approximate) sentence embedde $[ \\hat { y } _ { 1 } : \\dots : \\hat { y } _ { T } ]$ where ns, eac $\\hat { y } _ { t }$ is from (6). Also, f which is passed t $S$ embedding matrices ough discriminator in $\\{ W _ { e } ^ { ( s ) } \\} _ { s = 1 } ^ { S }$ map each input into y to get the related lo $S$ Note that “D” is the CNN-based classifier $\\bar { D ( \\cdot ) } \\in \\mathbb { R }$ with weight-sharing and $\\oplus$ denotes taking the average. "
393
+ ],
394
+ "image_footnote": [],
395
+ "bbox": [
396
+ 272,
397
+ 98,
398
+ 728,
399
+ 212
400
+ ],
401
+ "page_idx": 3
402
+ },
403
+ {
404
+ "type": "text",
405
+ "text": "2.2.2 TEMPERATURE CONTROL",
406
+ "text_level": 1,
407
+ "bbox": [
408
+ 176,
409
+ 319,
410
+ 405,
411
+ 334
412
+ ],
413
+ "page_idx": 3
414
+ },
415
+ {
416
+ "type": "text",
417
+ "text": "With the larger inverse temperature $\\beta , \\hat { y } _ { t + 1 }$ in (6) will become a better approximation of $y _ { t + 1 }$ in (3) and asymptotically as $\\beta \\to \\infty$ , $\\hat { y } _ { t + 1 } \\to y _ { t + 1 }$ . However, the issue is that the variance of gradients will be very large as we have $\\textstyle \\operatorname { V a r } ( { \\frac { \\partial { \\hat { y } } _ { t + 1 } } { \\partial o _ { t } } } ) \\propto \\beta ^ { 2 }$ , and thus the parameter updates will become very sensitive to the input noise. Intuitively, this might cause poor sample quality. On the other hand, with the smaller inverse temperature $\\beta$ , the generator will pay more attention to making a sharp distribution of entries in $\\hat { y } _ { i + 1 }$ due to the larger (initial) approximation gap between $\\hat { y } _ { t + 1 }$ and $y _ { t + 1 }$ , which implicitly discourages its possible “exploration”. Intuitively, this might be one factor that contributes to mode collapse of RelGAN on text generation. ",
418
+ "bbox": [
419
+ 174,
420
+ 340,
421
+ 825,
422
+ 457
423
+ ],
424
+ "page_idx": 3
425
+ },
426
+ {
427
+ "type": "text",
428
+ "text": "Therefore, the larger $\\beta$ encourages more exploration for better sample diversity while the smaller $\\beta$ encourages more exploitation for better sample quality. We thus propose to increase the inverse temperature $\\beta$ over iterations via an exponential policy: $\\beta _ { n } = \\beta _ { \\mathrm { m a x } } ^ { n / N }$ , where $\\beta _ { \\mathrm { m a x } }$ denotes the maximum inverse temperature, $N$ is the maximum number of training iterations and $n$ denotes the current iteration. In the exponential policy, as the increase rate of inverse temperature depends on $\\beta _ { \\mathrm { m a x } }$ , $\\beta _ { \\mathrm { m a x } }$ will decide the transition time from the exploitation phase to the exploration phase. In such sense, RelGAN provides a flexibility of either generating more diverse samples with a large $\\beta _ { \\mathrm { m a x } }$ or generating better quality samples with a small $\\beta _ { \\mathrm { m a x } }$ while most current GANs cannot provide. ",
429
+ "bbox": [
430
+ 174,
431
+ 460,
432
+ 825,
433
+ 575
434
+ ],
435
+ "page_idx": 3
436
+ },
437
+ {
438
+ "type": "text",
439
+ "text": "2.3 MULTIPLE REPRESENTATIONS IN DISCRIMINATOR ",
440
+ "text_level": 1,
441
+ "bbox": [
442
+ 174,
443
+ 589,
444
+ 565,
445
+ 603
446
+ ],
447
+ "page_idx": 3
448
+ },
449
+ {
450
+ "type": "text",
451
+ "text": "A commonly used discriminator for text generation is a CNN-based classifier (Kim, 2014) that employs a convolutional layer with multiple filters of different sizes to capture relations of various word lengths and a max-pooling layer over the entire input sentence for each feature map (Yu et al., 2017; Zhang et al., 2017; Lin et al., 2017; Guo et al., 2017). In this discriminator architecture, the input of the CNN-based classifier is a sentence of length $T$ represented by a single embedded matrix $\\tilde { X } \\in \\mathbb { R } ^ { d \\times T }$ where each column $\\boldsymbol { \\tilde { x } _ { t } } \\in \\mathbb { R } ^ { d }$ is a $d$ -dimensional embedded vector of each word. ",
452
+ "bbox": [
453
+ 174,
454
+ 612,
455
+ 825,
456
+ 696
457
+ ],
458
+ "page_idx": 3
459
+ },
460
+ {
461
+ "type": "text",
462
+ "text": "In this work, we propose a new discriminator framework that applies multiple embedded representations for each sentence, with each representation independently passed through the above CNNbased classifier to get an individual score. The average of these individual scores will serve as the final guiding information to update the generator. Our hypothesis is that each embedded representation may capture a specific aspect of the input sentence and the discriminator which compares real and generated sentences from these different perspectives can provide more diverse and comprehensive guiding information for the generator updates. This idea resembles the use of multiple discriminators to improve GANs on image generation (Durugkar et al., 2016), but the difference is that we only use multiple different representations of the input while still keeping a single or weight-sharing CNN-based classifier, which presumably has much less computational cost. ",
463
+ "bbox": [
464
+ 174,
465
+ 704,
466
+ 825,
467
+ 843
468
+ ],
469
+ "page_idx": 3
470
+ },
471
+ {
472
+ "type": "text",
473
+ "text": "Formally, we assume that $r _ { t }$ denotes the $t$ -th one-hot real token and $\\hat { y } _ { t }$ from (6) denotes the $t$ - th softmax-like generated token, and Figure 2 shows the proposed discriminator framework with multiple embedded representations where either the real input $[ r _ { 1 } \\ : \\ \\dots \\ : \\ r _ { T } ] \\ \\in \\ \\mathbb { R } ^ { V \\times T }$ or the generated input $[ \\hat { y } _ { 1 } : \\dot { \\dots } : \\hat { y } _ { T } ] \\in \\mathbb { R } ^ { V \\times T }$ will be mapped into $S$ embedded representations by $S$ distinct embedding matrices $\\{ W _ { e } ^ { ( s ) } \\} _ { s = 1 } ^ { S }$ 1 with W (s)e $W _ { e } ^ { ( s ) } \\in \\mathbb { R } ^ { d \\times V }$ . Let $\\tilde { X } _ { r } ^ { ( s ) }$ and $\\tilde { X } _ { y } ^ { ( s ) }$ be the $s$ -th embedded representation of the real and generated input, respectively. Thus, we have ",
474
+ "bbox": [
475
+ 174,
476
+ 849,
477
+ 823,
478
+ 924
479
+ ],
480
+ "page_idx": 3
481
+ },
482
+ {
483
+ "type": "text",
484
+ "text": "",
485
+ "bbox": [
486
+ 173,
487
+ 103,
488
+ 732,
489
+ 118
490
+ ],
491
+ "page_idx": 4
492
+ },
493
+ {
494
+ "type": "equation",
495
+ "img_path": "images/d03b80995dedf7c204e9da5cbeca5d30b446d48937890589b8e1a5f961ff3b9d.jpg",
496
+ "text": "$$\n\\tilde { X } _ { r } ^ { ( s ) } = W _ { e } ^ { ( s ) } [ r _ { 1 } : \\cdot \\cdot \\cdot : r _ { T } ] , \\tilde { X } _ { y } ^ { ( s ) } = W _ { e } ^ { ( s ) } [ \\hat { y } _ { 1 } : \\cdot \\cdot \\cdot : \\hat { y } _ { T } ]\n$$",
497
+ "text_format": "latex",
498
+ "bbox": [
499
+ 312,
500
+ 122,
501
+ 686,
502
+ 143
503
+ ],
504
+ "page_idx": 4
505
+ },
506
+ {
507
+ "type": "text",
508
+ "text": "and the final discriminator loss is given by ",
509
+ "bbox": [
510
+ 174,
511
+ 146,
512
+ 452,
513
+ 161
514
+ ],
515
+ "page_idx": 4
516
+ },
517
+ {
518
+ "type": "equation",
519
+ "img_path": "images/6b072e88d234491c9d8db5df3f7ac94dcf9142cd05b60e90a4c4414ea9fc5d55.jpg",
520
+ "text": "$$\nl _ { D } = \\frac { 1 } { S } \\sum _ { s = 1 } ^ { S } \\mathbb { E } _ { r _ { 1 : T } \\sim P _ { r } } f ( D ( \\tilde { X } _ { r } ^ { ( s ) } ) , D ( \\tilde { X } _ { y } ^ { ( s ) } ) )\n$$",
521
+ "text_format": "latex",
522
+ "bbox": [
523
+ 351,
524
+ 165,
525
+ 647,
526
+ 209
527
+ ],
528
+ "page_idx": 4
529
+ },
530
+ {
531
+ "type": "text",
532
+ "text": "where the expectation is taken w.r.t. both real sentence distribution $P _ { r }$ and generated sentence distribution $P _ { \\theta }$ , and the loss function $f$ is determined by the specific GAN loss, such as vanilla GAN (Goodfellow et al., 2014), $f$ -GAN (Nowozin et al., 2016) and WGAN (Arjovsky et al., 2017). Throughout this paper, the generator loss can be simply set to be $l _ { G } = - l _ { D }$ . ",
533
+ "bbox": [
534
+ 173,
535
+ 213,
536
+ 825,
537
+ 268
538
+ ],
539
+ "page_idx": 4
540
+ },
541
+ {
542
+ "type": "text",
543
+ "text": "2.4 TRAINING TECHNIQUES",
544
+ "text_level": 1,
545
+ "bbox": [
546
+ 174,
547
+ 281,
548
+ 382,
549
+ 295
550
+ ],
551
+ "page_idx": 4
552
+ },
553
+ {
554
+ "type": "text",
555
+ "text": "Choice of Loss Function. Empirically, we first compared three different standard GAN losses: standard GAN (the non-saturating version) (Goodfellow et al., 2014), hinge loss (Nowozin et al., 2016; Zhang et al., 2018) and Relativistic standard GAN (RSGAN) (Jolicoeur-Martineau, 2018) on the synthetic data (shown in next section) and then chose the best one – RSGAN for the rest of all experiments. Note that it does not mean RelGAN only works with the RSGAN loss and please see Appendix B for training curves of RelGAN with different loss functions. Formally, the function $f$ in (8) for RSGAN is $f ( a , b ) = \\log { \\mathrm { s i g m o i d } } ( a - b )$ for $a , b \\in \\mathbb { R }$ , and thus (8) becomes ",
556
+ "bbox": [
557
+ 173,
558
+ 303,
559
+ 825,
560
+ 402
561
+ ],
562
+ "page_idx": 4
563
+ },
564
+ {
565
+ "type": "equation",
566
+ "img_path": "images/43c0c9f515d325d55015a5e92eaae3f5e1965d3dc508787ef03e0e9a4e6265a1.jpg",
567
+ "text": "$$\nl _ { D } = \\frac { 1 } { S } \\sum _ { s = 1 } ^ { S } \\mathbb { E } _ { r _ { 1 : T } \\sim P _ { r } } \\log \\operatorname { s i g m o i d } ( D ( \\tilde { X } _ { r } ^ { ( s ) } ) - D ( \\tilde { X } _ { y } ^ { ( s ) } ) )\n$$",
568
+ "text_format": "latex",
569
+ "bbox": [
570
+ 310,
571
+ 406,
572
+ 686,
573
+ 449
574
+ ],
575
+ "page_idx": 4
576
+ },
577
+ {
578
+ "type": "text",
579
+ "text": "Intuitively, the loss function in (9) is to directly estimate the average probability that real sentences are more realistic than generated sentences in terms of different embedded representations. ",
580
+ "bbox": [
581
+ 173,
582
+ 453,
583
+ 821,
584
+ 482
585
+ ],
586
+ "page_idx": 4
587
+ },
588
+ {
589
+ "type": "text",
590
+ "text": "Generator Pre-training. Most current GANs for text generation need the pre-training for both generator and discriminator, such as SeqGAN (Yu et al., 2017), and some may further heavily rely on the exclusive pre-training techniques, such as TextGAN (Zhang et al., 2017), LeakGAN (Guo et al., 2017) and MaskGAN (Fedus et al., 2018). Instead, the proposed RelGAN only need to pre-train the generator simply via the standard MLE training for several epochs before starting the adversarial training. Experimentally, we find that a good initialization for generator provided by the MLE pre-training is necessary for a good convergence behavior of adversarial training. ",
591
+ "bbox": [
592
+ 173,
593
+ 491,
594
+ 825,
595
+ 590
596
+ ],
597
+ "page_idx": 4
598
+ },
599
+ {
600
+ "type": "text",
601
+ "text": "3 EXPERIMENTS ",
602
+ "text_level": 1,
603
+ "bbox": [
604
+ 176,
605
+ 604,
606
+ 326,
607
+ 621
608
+ ],
609
+ "page_idx": 4
610
+ },
611
+ {
612
+ "type": "text",
613
+ "text": "We test RelGAN on both synthetic and real data, where the synthetic data are 10,000 discrete sequences generated by an oracle-LSTM with fixed parameters (Yu et al., 2017) and the real data include the COCO image captions (Chen et al., 2015) and EMNLP2017 WMT News, first used by Guo et al. (2017) for text generation. The experimental settings are given in Appendix A. ",
614
+ "bbox": [
615
+ 174,
616
+ 632,
617
+ 825,
618
+ 689
619
+ ],
620
+ "page_idx": 4
621
+ },
622
+ {
623
+ "type": "text",
624
+ "text": "Evaluation Metrics. How to properly evaluate generative models remains an open research question (Theis et al., 2015; Semeniuta et al., 2018). The key issue plaging current evaluation metrics for GANs is that they cannot measure sample quality and sample diversity simultaneously. Therefore, we use two distinct metrics: for synthetic data, we use both negative log-likelihood (called ${ \\mathrm { N L L } } _ { \\mathrm { g e n } , }$ ) and its counterpart (called $\\mathrm { N L L _ { o r a c l e } }$ ), defined as: ",
625
+ "bbox": [
626
+ 173,
627
+ 702,
628
+ 825,
629
+ 773
630
+ ],
631
+ "page_idx": 4
632
+ },
633
+ {
634
+ "type": "equation",
635
+ "img_path": "images/9a04775a68c5f0eb899375640fc7c214f4704d4ebb40c21720347a70ab101e15.jpg",
636
+ "text": "$$\n\\mathrm { N L } \\mathbf { \\mathrm { L } } _ { \\mathrm { g e n } } = - \\mathbb { E } _ { r _ { 1 } \\sim r } { \\sim } P _ { r } \\log P _ { \\theta } ( r _ { 1 } , \\cdot \\cdot \\cdot , r _ { T } ) , \\mathrm { N L } \\mathbf { \\mathrm { \\mathrm { a r a c t e } } } = - \\mathbb { E } _ { y _ { 1 } , \\tau \\sim P _ { \\theta } } \\log P _ { r } ( y _ { 1 } , \\cdot \\cdot \\cdot , y _ { T } ) ,\n$$",
637
+ "text_format": "latex",
638
+ "bbox": [
639
+ 194,
640
+ 779,
641
+ 774,
642
+ 795
643
+ ],
644
+ "page_idx": 4
645
+ },
646
+ {
647
+ "type": "text",
648
+ "text": "where the generated sentence distribution $P _ { \\theta }$ and the real sentence distribution $P _ { r }$ are both known by evaluating the generator and oracle-LSTM, respectively. Generally, ${ \\mathrm { N L L } } _ { \\mathrm { g e n } }$ measures sample diversity while $\\mathrm { N L L } _ { \\mathrm { o r a c l e } }$ is more sensitive to sample quality (Theis et al., 2015; Arjovsky $\\&$ Bottou, 2017). For the real dataset, we also apply ${ \\mathrm { N L L } } _ { \\mathrm { g e n } }$ to measure the sample diversity, similar to Lu et al. (2018). However, since NLLoracle cannot be evaluated without an oracle, we instead apply the commonly-used BLEU scores (Papineni et al., 2002) to measure the sample quality and compare with the MLE baseline, along with other start-of-the-art GANs, including SeqGAN (Yu et al., 2017), RankGAN (Lin et al., 2017) and LeakGAN (Guo et al., 2017). Note that for BLEU score evaluation, we follow the strategy in (Yu et al., 2017; Zhu et al., 2018) by using the test data as the reference. ",
649
+ "bbox": [
650
+ 173,
651
+ 797,
652
+ 825,
653
+ 926
654
+ ],
655
+ "page_idx": 4
656
+ },
657
+ {
658
+ "type": "text",
659
+ "text": "3.1 SYNTHETIC DATA ",
660
+ "text_level": 1,
661
+ "bbox": [
662
+ 174,
663
+ 103,
664
+ 338,
665
+ 118
666
+ ],
667
+ "page_idx": 5
668
+ },
669
+ {
670
+ "type": "text",
671
+ "text": "We run the synthetic data experiments with sequence length 20 and 40, respectively. The $\\mathrm { N L L } _ { \\mathrm { o r a c l e } }$ results of RelGAN and other models are shown in Table 1 where we set $\\beta _ { \\mathrm { m a x } } = 1$ for length 20 and $\\beta _ { \\mathrm { m a x } } = 2$ for length 40. Note that “MLE” in Table 1 denotes the baseline model where LSTMs are trained with the teacher-forcing algorithm to maximize the likelihood (same with Table 2 and 3). We can see that RelGAN outperforms other models in both cases, and its lead in performance becomes larger with longer sequence length, demonstrating the log-distance dependency modeling ability of the proposed generator. ",
672
+ "bbox": [
673
+ 173,
674
+ 128,
675
+ 825,
676
+ 227
677
+ ],
678
+ "page_idx": 5
679
+ },
680
+ {
681
+ "type": "table",
682
+ "img_path": "images/8fecc85c3bcb97118ee513f23111a9d64eef3084f8d521c5e424ed55e114c5fe.jpg",
683
+ "table_caption": [],
684
+ "table_footnote": [],
685
+ "table_body": "<table><tr><td>Length</td><td>MLE</td><td>SeqGAN</td><td>RankGAN</td><td>LeakGAN</td><td>RelGAN</td><td>Real</td></tr><tr><td>20</td><td>9.038</td><td>8.736</td><td>8.247</td><td>7.038</td><td>6.680± 0.343</td><td>5.750</td></tr><tr><td>40</td><td>10.411</td><td>10.310</td><td>9.958</td><td>7.191</td><td>6.765 ± 0.026</td><td>4.071</td></tr></table>",
686
+ "bbox": [
687
+ 236,
688
+ 247,
689
+ 754,
690
+ 290
691
+ ],
692
+ "page_idx": 5
693
+ },
694
+ {
695
+ "type": "text",
696
+ "text": "Table 1: The $\\mathrm { N L L } _ { \\mathrm { o r a c l e } }$ scores on synthetic data where $\\beta _ { \\operatorname* { m a x } } = 1$ for length 20 and $\\beta _ { \\mathrm { m a x } } = 2$ for length 40. RelGAN is run with 6 random seeds and the final score is obtained by taking the average of scores, and other scores are from their original papers and Guo et al. (2017). Note that “Real” denotes the real data generated by the oracle-LSTM. For the $\\mathrm { N L L } _ { \\mathrm { o r a c l e } }$ score, the lower the better. ",
697
+ "bbox": [
698
+ 174,
699
+ 306,
700
+ 823,
701
+ 357
702
+ ],
703
+ "page_idx": 5
704
+ },
705
+ {
706
+ "type": "text",
707
+ "text": "We also evaluate the trade-off between sample quality and diversity as a function of the maximum inverse temperature $\\beta _ { \\mathrm { m a x } }$ and the results are shown in Figure 3. As $\\beta _ { \\mathrm { m a x } }$ increases, ${ \\mathrm { N L L } } _ { \\mathrm { g e n } }$ decreases, which implies better sample diversity, but $\\mathrm { N L L } _ { \\mathrm { o r a c l e } }$ increases, which implies worse sample quality. Especially when $\\beta _ { \\mathrm { m a x } } \\in \\{ 1 0 , 1 0 0 \\}$ , the best ${ \\mathrm { N L L } } _ { \\mathrm { g e n } }$ score of 4.4 for RelGAN is very close to the best ${ \\mathrm { N L L } } _ { \\mathrm { g e n } }$ score of 4.2 for MLE pre-training, implying that RelGAN with a sufficiently large inverse temperature suffers little mode collapse on synthetic data. ",
708
+ "bbox": [
709
+ 173,
710
+ 380,
711
+ 825,
712
+ 465
713
+ ],
714
+ "page_idx": 5
715
+ },
716
+ {
717
+ "type": "image",
718
+ "img_path": "images/398079f412b562ccd1b3a0c1deae7bf70b7b387734047437de6420899a58b3df.jpg",
719
+ "image_caption": [
720
+ "Figure 3: The training curves of ${ \\mathrm { N L L } } _ { \\mathrm { g e n } }$ scores (left) and $\\mathrm { N L L } _ { \\mathrm { o r a c l e } }$ scores (right) on synthetic data of length 20 with different values of maximum inverse temperature $\\beta _ { \\mathrm { m a x } } \\in \\{ 1 , 2 , 5 , 1 0 , 1 0 0 \\}$ . The vertical dash line represents the end of pre-training. With the increase of $\\beta _ { \\mathrm { m a x } }$ , ${ \\mathrm { N L L } } _ { \\mathrm { g e n } }$ becomes lower but $\\mathrm { N L L _ { o r a c l e } }$ becomes higher. For both the ${ \\mathrm { N L L } } _ { \\mathrm { g e n } }$ and $\\mathrm { \\Delta N L L _ { o r a c l e } }$ scores, the lower the better. "
721
+ ],
722
+ "image_footnote": [],
723
+ "bbox": [
724
+ 222,
725
+ 486,
726
+ 777,
727
+ 638
728
+ ],
729
+ "page_idx": 5
730
+ },
731
+ {
732
+ "type": "text",
733
+ "text": "3.2 COCO IMAGE CAPTIONS DATASET ",
734
+ "text_level": 1,
735
+ "bbox": [
736
+ 176,
737
+ 738,
738
+ 459,
739
+ 752
740
+ ],
741
+ "page_idx": 5
742
+ },
743
+ {
744
+ "type": "text",
745
+ "text": "In order to test RelGAN on real-world data, we first run experiments on the COCO Image Captions dataset. By following the same data pre-processing as in Zhu et al. (2018), the dataset includes 4,682 unique words with the maximum sentence length 37. Both the training and test data contain 10,000 sentences. ",
746
+ "bbox": [
747
+ 174,
748
+ 763,
749
+ 825,
750
+ 820
751
+ ],
752
+ "page_idx": 5
753
+ },
754
+ {
755
+ "type": "text",
756
+ "text": "The BLEU scores of RelGAN compared with previous models are shown in Table 2 where we set $\\beta _ { \\mathrm { m a x } } = 1 0 0$ and 1000, respectively. We can see that RelGAN is significantly and consistently better than other models in terms of all the BLEU scores, which means its ability of generating high-quality sentences of COCO Image Captions. Furthermore, the ${ \\mathrm { N L L } } _ { \\mathrm { g e n } }$ scores of RelGAN and previous models are also shown in Table 2, where RelGAN also achieves the state-of-the-art results in terms of sample diversity. For example, we do not see obvious mode collapse with $\\beta _ { \\mathrm { m a x } } = 1 0 0 0$ by looking at the generated samples (see Appendix C.1 for more details). ",
757
+ "bbox": [
758
+ 173,
759
+ 827,
760
+ 825,
761
+ 925
762
+ ],
763
+ "page_idx": 5
764
+ },
765
+ {
766
+ "type": "table",
767
+ "img_path": "images/55909a9f949b9158eb66f83c3f57ea3b5ead33444b3458bdd89b1dd80edcca42.jpg",
768
+ "table_caption": [
769
+ "Table 2: The BLEU and ${ \\mathrm { N L L } } _ { \\mathrm { g e n } }$ scores on COCO Image Captions where $\\beta _ { \\mathrm { m a x } } = 1 0 0$ and 1000, respectively. RelGAN is run with 6 random seeds and the final score is obtained by taking the average of scores, and other scores are based on the same evaluation settings in Zhu et al. (2018). For BLEU scores, the higher the better. "
770
+ ],
771
+ "table_footnote": [],
772
+ "table_body": "<table><tr><td>Method</td><td>BLEU-2</td><td>BLEU-3</td><td>BLEU-4</td><td>BLEU-5</td><td>NLLgen</td></tr><tr><td>MLE</td><td>0.731</td><td>0.497</td><td>0.305</td><td>0.189</td><td>0.718</td></tr><tr><td>SeqGAN</td><td>0.745</td><td>0.498</td><td>0.294</td><td>0.180</td><td>1.082</td></tr><tr><td>RankGAN</td><td>0.743</td><td>0.467</td><td>0.264</td><td>0.156</td><td>1.344</td></tr><tr><td>LeakGAN</td><td>0.746</td><td>0.528</td><td>0.355</td><td>0.230</td><td>0.679</td></tr><tr><td>RelGAN (100)</td><td>0.849± 0.030</td><td>0.687 ± 0.047</td><td>0.502 ± 0.048</td><td>0.331 ± 0.044</td><td>0.756± 0.054</td></tr><tr><td>RelGAN (1000)</td><td>0.814 ± 0.012</td><td>0.634 ± 0.020</td><td>0.455 ± 0.023</td><td>0.303 ± 0.020</td><td>0.655 ± 0.048</td></tr></table>",
773
+ "bbox": [
774
+ 178,
775
+ 99,
776
+ 820,
777
+ 194
778
+ ],
779
+ "page_idx": 6
780
+ },
781
+ {
782
+ "type": "text",
783
+ "text": "3.3 EMNLP2017 WMT NEWS DATASET ",
784
+ "text_level": 1,
785
+ "bbox": [
786
+ 176,
787
+ 273,
788
+ 470,
789
+ 289
790
+ ],
791
+ "page_idx": 6
792
+ },
793
+ {
794
+ "type": "text",
795
+ "text": "The EMNLP2017 WMT News dataset consists of 5,255 unique words with the maximum sentence length 51 after applying the same data pre-processing as in Zhu et al. (2018). The training data contains abbout 270,000 sentences and test data contains 10,000 sentences. ",
796
+ "bbox": [
797
+ 174,
798
+ 297,
799
+ 825,
800
+ 340
801
+ ],
802
+ "page_idx": 6
803
+ },
804
+ {
805
+ "type": "table",
806
+ "img_path": "images/0f36ea7259718dd49c12ffbb9b84259e9b16e2f7804796574be56511753bc1a9.jpg",
807
+ "table_caption": [
808
+ "Table 3: The BLEU and ${ \\mathrm { N L L } } _ { \\mathrm { g e n } }$ scores on EMNLP2017 WMT News where $\\beta _ { \\mathrm { m a x } } = 1 0 0$ and 1000, respectively. Our model is run with 6 random seeds and the final score is obtained by taking the average of scores, and other scores are based on the same evaluation settings in Zhu et al. (2018). "
809
+ ],
810
+ "table_footnote": [],
811
+ "table_body": "<table><tr><td>Method</td><td>BLEU-2</td><td>BLEU-3</td><td>BLEU-4</td><td>BLEU-5</td><td>NLLgen</td></tr><tr><td>MLE</td><td>0.768</td><td>0.473</td><td>0.240</td><td>0.126</td><td>2.382</td></tr><tr><td>SeqGAN</td><td>0.777</td><td>0.491</td><td>0.261</td><td>0.138</td><td>2.773</td></tr><tr><td>RankGAN</td><td>0.727</td><td>0.435</td><td>0.209</td><td>0.101</td><td>3.345</td></tr><tr><td>LeakGAN</td><td>0.826</td><td>0.645</td><td>0.437</td><td>0.272</td><td>2.356</td></tr><tr><td>RelGAN (100)</td><td>0.881± 0.013</td><td>0.705± 0.019</td><td>0.501± 0.023</td><td>0.319± 0.018</td><td>2.482 ± 0.031</td></tr><tr><td>RelGAN (1000)</td><td>0.837 ± 0.012</td><td>0.654 ± 0.010</td><td>0.435 ± 0.011</td><td>0.265 ± 0.011</td><td>2.285 ± 0.025</td></tr></table>",
812
+ "bbox": [
813
+ 178,
814
+ 356,
815
+ 820,
816
+ 450
817
+ ],
818
+ "page_idx": 6
819
+ },
820
+ {
821
+ "type": "text",
822
+ "text": "The BLEU scores of RelGAN compared with previous models are shown in Table 3 where we set $\\beta _ { \\mathrm { m a x } } ~ = ~ 1 0 0$ and 1000, respectively. We can see that RelGAN also consistently outperforms previous models in terms of all the BLEU scores, demonstrating its ability of generating high-quality sentences on EMNLP2017 WMT News. Moreover, the sample diversity metric ${ \\mathrm { N L L } } _ { \\mathrm { g e n } }$ scores of RelGAN and previous models are also shown in Table 3. Similarly, RelGAN achieves the stateof-the-art results in terms of sample diversity. Upon visually examining generated samples (See Appendix C.2 for more details), we do not observe obvious mode collapse for $\\beta _ { \\operatorname* { m a x } } \\in \\{ 1 0 \\bar { 0 } , 1 0 0 0 \\}$ . ",
823
+ "bbox": [
824
+ 173,
825
+ 520,
826
+ 825,
827
+ 617
828
+ ],
829
+ "page_idx": 6
830
+ },
831
+ {
832
+ "type": "text",
833
+ "text": "Finally, from Tables 2 and 3, we can see that the sample quality and diversity trade-off with different values of maximum inverse temperature $\\beta _ { \\mathrm { m a x } }$ also exists on the real data. That is, RelGAN with $\\beta _ { \\mathrm { m a x } } = 1 0 0$ achieves better sample quality while RelGAN with $\\beta _ { \\mathrm { m a x } } = 1 0 0 0$ achieves better sample diversity. Depending on what the underlying applications of text generation via RelGAN are, we can adjust $\\beta _ { \\mathrm { m a x } }$ properly to get either better quality or better diversity. ",
834
+ "bbox": [
835
+ 174,
836
+ 623,
837
+ 825,
838
+ 694
839
+ ],
840
+ "page_idx": 6
841
+ },
842
+ {
843
+ "type": "text",
844
+ "text": "To further evaluate the sample quality of RelGAN and other models on EMNLP2017 WMT News, we also perform the human evaluation by using Amazon Mechanical Turk. We randomly sampled 100 sentences for each model and the real dataset, and asked 10 different people to score each sentence on a scale of 1-5. Please see Appendix A.2 for more details of human evaluation. ",
845
+ "bbox": [
846
+ 176,
847
+ 700,
848
+ 823,
849
+ 757
850
+ ],
851
+ "page_idx": 6
852
+ },
853
+ {
854
+ "type": "table",
855
+ "img_path": "images/6a64540d4be743f9e40b860a14fd378ae5fccf4a82757405e47605f08299da5a.jpg",
856
+ "table_caption": [],
857
+ "table_footnote": [],
858
+ "table_body": "<table><tr><td>Method</td><td>MLE</td><td>SeqGAN</td><td>RankGAN</td><td>LeakGAN</td></tr><tr><td>Human score</td><td>2.751 ±0.908</td><td>2.588 ±0.970</td><td>2.449 ±1.051</td><td>3.011 ± 0.908</td></tr><tr><td>Method</td><td>RelGAN(100)</td><td>RelGAN(1000)</td><td>Real</td><td rowspan=\"2\"></td></tr><tr><td>Human score</td><td>3.407 ± 0.909</td><td>3.285 ±0.900</td><td>4.445 ± 0.679</td></tr></table>",
859
+ "bbox": [
860
+ 230,
861
+ 773,
862
+ 759,
863
+ 832
864
+ ],
865
+ "page_idx": 6
866
+ },
867
+ {
868
+ "type": "text",
869
+ "text": "Table 4: The means and standard deviations of human scores for RelGAN and other models on EMNLP2017 WMT News by using Amazon Mechanical Turk. Note that “Real” denotes the human score on the real dataset. ",
870
+ "bbox": [
871
+ 174,
872
+ 849,
873
+ 825,
874
+ 876
875
+ ],
876
+ "page_idx": 6
877
+ },
878
+ {
879
+ "type": "text",
880
+ "text": "The human score results are provided in Table 4, where we can see that RelAGN generates better human-looking samples than other GANs and the MLE baseline model. ",
881
+ "bbox": [
882
+ 174,
883
+ 895,
884
+ 821,
885
+ 924
886
+ ],
887
+ "page_idx": 6
888
+ },
889
+ {
890
+ "type": "text",
891
+ "text": "3.4 ABLATION STUDY ",
892
+ "text_level": 1,
893
+ "bbox": [
894
+ 176,
895
+ 103,
896
+ 341,
897
+ 117
898
+ ],
899
+ "page_idx": 7
900
+ },
901
+ {
902
+ "type": "text",
903
+ "text": "3.4.1 IMPACT OF RELATIONAL MEMORY ",
904
+ "text_level": 1,
905
+ "bbox": [
906
+ 176,
907
+ 130,
908
+ 467,
909
+ 143
910
+ ],
911
+ "page_idx": 7
912
+ },
913
+ {
914
+ "type": "text",
915
+ "text": "To show the impact of relational memory in RelGAN, we propose to replace relational memory by LSTM-32 and LSTM-512 as the generator architecture, respectively, and see how the performance differs. Here LSTM- $k$ represents the LSTM with hidden dimension being $k$ . We choose $k = 3 2$ because most previous GANs (Yu et al., 2017; Guo et al., 2017) have used this architecture for text generation, and also choose $k = 5 1 2$ because for more fair comparison, we want to keep the total memory size of LSTM to be the same with the relational memory we have used. ",
916
+ "bbox": [
917
+ 174,
918
+ 154,
919
+ 825,
920
+ 238
921
+ ],
922
+ "page_idx": 7
923
+ },
924
+ {
925
+ "type": "text",
926
+ "text": "The results on the COCO Image Captions dataset are shown in Figure 4 (Left), where we provide the BLEU-4 score (See Appendix D.1 for all the BLEU scores). We can see that the BLEU scores of relational memory are consistently better than those of LSTM-32 and LSTM-512, which demonstrates the advantages of using relational memory as generator in RelGAN. ",
927
+ "bbox": [
928
+ 174,
929
+ 244,
930
+ 825,
931
+ 301
932
+ ],
933
+ "page_idx": 7
934
+ },
935
+ {
936
+ "type": "image",
937
+ "img_path": "images/61f8fce3d03201bee6e4d4517cd1de856a0a71dfd5da5745383b70b5259df38c.jpg",
938
+ "image_caption": [
939
+ "Figure 4: (Left) Training curves of the BLEU-4 score on COCO Image Captions with different generator architectures – relational memory (RM), LSTM-32 and LSTM-512. (Right) Training curves of the BLEU-2 score on COCO Image Captions with Gumbel-Softmax relaxation and the vanilla REINFORCE method. All the results are obtained by taking the average of 6 runs with different random seeds. "
940
+ ],
941
+ "image_footnote": [],
942
+ "bbox": [
943
+ 222,
944
+ 315,
945
+ 776,
946
+ 467
947
+ ],
948
+ "page_idx": 7
949
+ },
950
+ {
951
+ "type": "text",
952
+ "text": "3.4.2 IMPACT OF GUMBEL-SOFTMAX RELAXATION ",
953
+ "text_level": 1,
954
+ "bbox": [
955
+ 174,
956
+ 551,
957
+ 544,
958
+ 565
959
+ ],
960
+ "page_idx": 7
961
+ },
962
+ {
963
+ "type": "text",
964
+ "text": "To show the impact of Gumbel-Softmax relaxation in RelGAN, we can instead apply the vanilla REINFORCE method to deal with the non-differentiable issue of RelGAN on text generation. In this experiment, we keep all other hyperparameters in RelGAN fixed and compare the performance of Gumbel-Softmax relaxation and the vanilla REINFORCE method. ",
965
+ "bbox": [
966
+ 174,
967
+ 571,
968
+ 825,
969
+ 627
970
+ ],
971
+ "page_idx": 7
972
+ },
973
+ {
974
+ "type": "text",
975
+ "text": "The results are shown in Figure 4 (Right), where the BLEU-2 score is provided (See Appendix D.2 for all the BLEU scores). We can see that under the proposed RelGAN framework, Gumbel-Softmax relaxation performs much better than the vanilla REINFORCE method. During experiments, we find that the variance of generator gradients in the vanilla REINFORCE method is too large to provide any useful update for generator, which may explain why the performance of vanilla REINFORCE does not improve after the pre-training, as observed in Figure 4 (Right). The exploration of various variance reduction techniques for the REINFORCE method in RelGAN is out of scope of this paper. ",
976
+ "bbox": [
977
+ 174,
978
+ 635,
979
+ 825,
980
+ 732
981
+ ],
982
+ "page_idx": 7
983
+ },
984
+ {
985
+ "type": "text",
986
+ "text": "3.4.3 IMPACT OF MULTIPLE REPRESENTATIONS IN DISCRIMINATOR ",
987
+ "text_level": 1,
988
+ "bbox": [
989
+ 174,
990
+ 744,
991
+ 655,
992
+ 758
993
+ ],
994
+ "page_idx": 7
995
+ },
996
+ {
997
+ "type": "text",
998
+ "text": "To show the impact of multiple embedded representations in discriminator while keeping the expressive power of discriminator the same for fair comparison, we propose to apply $S$ embedded presentations with each embedded vector of length $\\begin{array} { r } { d = \\frac { d _ { \\mathrm { m a x } } } { S } } \\end{array}$ where $d _ { \\mathrm { m a x } }$ denotes the total length of representations. In this experiment, we set $d _ { \\operatorname* { m a x } } = 6 4$ , and thus for instance, if $S = 1$ then $d = 6 4$ for each embedded vector, and if $S = 2$ then $d = 3 2$ for each embedded vector, and so on. ",
999
+ "bbox": [
1000
+ 174,
1001
+ 765,
1002
+ 825,
1003
+ 837
1004
+ ],
1005
+ "page_idx": 7
1006
+ },
1007
+ {
1008
+ "type": "text",
1009
+ "text": "We first test RelGAN on the synthetic data with $S \\in \\{ 1 , 2 , 4 , 8 , 1 6 , 3 2 , 6 4 \\}$ and the results are shown in Figure 5 (Left). We can see that as the number of embedded representations $S$ increases, the best NLLoracle score tends to keep decreasing, yielding better sample quality. Furthermore, we test RelGAN on COCO Image Captions with $S \\in \\{ 1 , 6 4 \\}$ and the BLEU-3 score is shown in Figure 5 (Right). Still, we can see that the BLEU scores of RelGAN with $S = 6 4$ are consistently better than those of RelGAN with $S = 1$ (see Appendix D.3 for all the BLEU scores). Note that in both experiments, we do not see an obvious sign of mode collapse with varying number of representations. For example, the ${ \\mathrm { N L L } } _ { \\mathrm { g e n } }$ score on the synthetic data stays around 4.4 for different values of $S$ (close to the best $\\mathrm { N L L _ { g e n } } ~ 4 . \\overset { \\cdot } { 2 }$ for MLE shown in Figure 3 (Left)). Thus, these experiments demonstrate the advantages of using multiple embedded representations for discriminator in RelGAN. ",
1010
+ "bbox": [
1011
+ 174,
1012
+ 839,
1013
+ 825,
1014
+ 924
1015
+ ],
1016
+ "page_idx": 7
1017
+ },
1018
+ {
1019
+ "type": "image",
1020
+ "img_path": "images/dc54968bfd7713916dd05bea87c39d6d5ca4a52d9a13208466ea30023927e844.jpg",
1021
+ "image_caption": [
1022
+ "Figure 5: (Left) The best $\\mathrm { N L L _ { o r a c l e } }$ score on the synthetic data varies with different number of embedded presentations $S = \\{ 1 , 2 , 4 , 8 , 1 6 , 3 2 , 6 4 \\}$ where $\\beta _ { \\mathrm { m a x } } = 1 0$ . (Right) The training curves of BLEU-3 score on COCO Image Captions with the number of embedded representations $S = 1$ and $S = 6 4$ , respectively, where $\\beta _ { \\mathrm { m a x } } = 1 0 0 0$ . All results are obtained by taking the average of 6 runs with different random seeds. "
1023
+ ],
1024
+ "image_footnote": [],
1025
+ "bbox": [
1026
+ 222,
1027
+ 99,
1028
+ 777,
1029
+ 253
1030
+ ],
1031
+ "page_idx": 8
1032
+ },
1033
+ {
1034
+ "type": "text",
1035
+ "text": "",
1036
+ "bbox": [
1037
+ 174,
1038
+ 345,
1039
+ 825,
1040
+ 401
1041
+ ],
1042
+ "page_idx": 8
1043
+ },
1044
+ {
1045
+ "type": "text",
1046
+ "text": "4 RELATED WORK ",
1047
+ "text_level": 1,
1048
+ "bbox": [
1049
+ 176,
1050
+ 424,
1051
+ 344,
1052
+ 440
1053
+ ],
1054
+ "page_idx": 8
1055
+ },
1056
+ {
1057
+ "type": "text",
1058
+ "text": "Since GANs are originally proposed for continuous data, extending GAN training to discrete data generation has been an active research topic. Current works focus on dealing with the nondiferentiable issue brought by the discrete data nature either by considering the RL methods or by reformulating the problem in continuous space. ",
1059
+ "bbox": [
1060
+ 174,
1061
+ 457,
1062
+ 823,
1063
+ 513
1064
+ ],
1065
+ "page_idx": 8
1066
+ },
1067
+ {
1068
+ "type": "text",
1069
+ "text": "A large class of GANs for text generation relies on the RL algorithm. SeqGAN ((Yu et al., 2017)) models the text generation as a sequential decision making process and trains the generator with policy gradient methods (Sutton et al., 2000). MaliGAN (Che et al., 2017) proposes the co-training with a maximum-likelihood objective to reduce the gradient variance. RankGAN (Lin et al., 2017) proposes a ranking model to replace the original binary classifier as the discriminator. LeakGAN (Guo et al., 2017) designs a mechanism to provide intermediate information about text generation for generator, where the discriminator can leak its features through a manager module. MaskGAN (Fedus et al., 2018) introduces an actor-critic conditional GAN that fills in missing text conditioned on the surrounding context by resorting to a seq2seq model. ",
1070
+ "bbox": [
1071
+ 174,
1072
+ 520,
1073
+ 825,
1074
+ 646
1075
+ ],
1076
+ "page_idx": 8
1077
+ },
1078
+ {
1079
+ "type": "text",
1080
+ "text": "Other GANs without RL methods either approximate the discrete data or work in the continuous latent space. TextGAN (Zhang et al., 2017) provides a feature matching mechanism that matches the latent features of real and generated sentences via a kernelized discrepancy metric to alleviate the mode collapse. FM-GAN (Chen et al., 2018) proposes to match the latent feature distributions of real and synthetic sentences using the feature-movers distance. Similar to our work, both textGAN and FM-GAN apply an annealed softmax to approximate the argmax in the generator. However, they do not rely on the Gumbel-Max trick to reparametrize the sampling operations, which is the major difference with us in dealing with the non-differentiable issue. ARAE (Zhao et al., 2018) applies an additional autoencoder to embed the discrete data into a continuous latent space in which GANs can be trained properly. As for approximating the categorical distribution with GumbelSoftmax relaxation, Gu et al. (2017) has used it to improve the generation quality in neural machine translation. More similarly, Kusner & Hernandez-Lobato (2016) provides some initial experiments ´ of training GANs with Gumbel-Softmax relaxation on a synthetic task, but scaling them to work on real text dataset remains a challenging open problem. ",
1081
+ "bbox": [
1082
+ 174,
1083
+ 652,
1084
+ 825,
1085
+ 848
1086
+ ],
1087
+ "page_idx": 8
1088
+ },
1089
+ {
1090
+ "type": "text",
1091
+ "text": "Attention mechanisms, in particular self-attention (Vaswani et al., 2017), have gradually become a building block of many novel neural network architectures (Vaswani et al., 2017; Parmar et al., 2018; Santoro et al., 2018) due to its ability of capturing long or global dependencies and reducing computational cost via parallelization. In the context of GANs, self-attention have not been fully explored. SAGAN (Zhang et al., 2018) applies self-attention in GANs to model long range dependencies in images and get the state-of-the-art results on conditional image generation. In contrast, we employ self-attention in GANs for text generation by using relational memory as generator. ",
1092
+ "bbox": [
1093
+ 174,
1094
+ 854,
1095
+ 823,
1096
+ 924
1097
+ ],
1098
+ "page_idx": 8
1099
+ },
1100
+ {
1101
+ "type": "text",
1102
+ "text": "",
1103
+ "bbox": [
1104
+ 171,
1105
+ 103,
1106
+ 823,
1107
+ 132
1108
+ ],
1109
+ "page_idx": 9
1110
+ },
1111
+ {
1112
+ "type": "text",
1113
+ "text": "5 CONCLUSIONS ",
1114
+ "text_level": 1,
1115
+ "bbox": [
1116
+ 176,
1117
+ 148,
1118
+ 328,
1119
+ 165
1120
+ ],
1121
+ "page_idx": 9
1122
+ },
1123
+ {
1124
+ "type": "text",
1125
+ "text": "We proposed a new GAN architecture called RelGAN for text generation, that outperforms most current models in terms of sample quality and diversity on both synthetic and real data. Furthermore, the trade-off between the generated sample diversity and quality can be adjusted properly in RelGAN by controlling the inverse temperature. In RelGAN, we used the relational memory based generator to improve its ability of modeling long distance dependencies and also applied multiple embedded representations in discriminator such that it can provide more diverse and informative guiding signal for generator. By applying Gumbel-Softmax relaxation to deal with the non-differentiable issue, our architecture is simple to implement without employing intensive RL heuristics. For the future directions, since we have demonstrated that GANs with Gumbel-Softmax relaxation is very promising for text generation, we would like to explore further in this direction. For example, it is interesting to make RelGAN work better without any pre-training. Also, extending RelGAN to a conditional model for many text generation related applications is another interesting direction. ",
1126
+ "bbox": [
1127
+ 174,
1128
+ 176,
1129
+ 825,
1130
+ 343
1131
+ ],
1132
+ "page_idx": 9
1133
+ },
1134
+ {
1135
+ "type": "text",
1136
+ "text": "ACKNOWLEDGEMENT ",
1137
+ "text_level": 1,
1138
+ "bbox": [
1139
+ 176,
1140
+ 361,
1141
+ 357,
1142
+ 376
1143
+ ],
1144
+ "page_idx": 9
1145
+ },
1146
+ {
1147
+ "type": "text",
1148
+ "text": "We would like to thank all the reviewers for their helpful comments. WN and ABP were supported by IARPA via DoI/IBC contract D16PC00003 and NSF NeuroNex grant DBI-1707400. ",
1149
+ "bbox": [
1150
+ 174,
1151
+ 388,
1152
+ 823,
1153
+ 415
1154
+ ],
1155
+ "page_idx": 9
1156
+ },
1157
+ {
1158
+ "type": "text",
1159
+ "text": "REFERENCES ",
1160
+ "text_level": 1,
1161
+ "bbox": [
1162
+ 176,
1163
+ 438,
1164
+ 285,
1165
+ 452
1166
+ ],
1167
+ "page_idx": 9
1168
+ },
1169
+ {
1170
+ "type": "text",
1171
+ "text": "Martin Arjovsky and Leon Bottou. Towards principled methods for training generative adversarial ´ networks. arXiv preprint arXiv:1701.04862, 2017. \nMartin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein gan. ´ arXiv preprint arXiv:1701.07875, 2017. \nTong Che, Yanran Li, Ruixiang Zhang, R Devon Hjelm, Wenjie Li, Yangqiu Song, and Yoshua Bengio. Maximum-likelihood augmented discrete generative adversarial networks. arXiv preprint arXiv:1702.07983, 2017. \nLiqun Chen, Shuyang Dai, Chenyang Tao, Dinghan Shen, Zhe Gan, Haichao Zhang, Yizhe Zhang, and Lawrence Carin. Adversarial text generation via feature-mover’s distance. In NIPS, 2018. \nXinlei Chen, Hao Fang, Tsung-Yi Lin, Ramakrishna Vedantam, Saurabh Gupta, Piotr Dollar, and ´ C Lawrence Zitnick. Microsoft coco captions: Data collection and evaluation server. arXiv preprint arXiv:1504.00325, 2015. \nIshan Durugkar, Ian Gemp, and Sridhar Mahadevan. Generative multi-adversarial networks. arXiv preprint arXiv:1611.01673, 2016. \nWilliam Fedus, Ian Goodfellow, and Andrew M Dai. Maskgan: Better text generation via filling in the . arXiv preprint arXiv:1801.07736, 2018. \nIan Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in Neural Information Processing Systems, 2014. \nJiatao Gu, Daniel Jiwoong Im, and Victor OK Li. Neural machine translation with gumbel-greedy decoding. arXiv preprint arXiv:1706.07518, 2017. \nIshaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron C Courville. Improved training of wasserstein gans. In Advances in Neural Information Processing Systems, pp. 5767–5777, 2017. \nJiaxian Guo, Sidi Lu, Han Cai, Weinan Zhang, Yong Yu, and Jun Wang. Long text generation via adversarial training with leaked information. arXiv preprint arXiv:1709.08624, 2017. \nSepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997. \nEric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. arXiv preprint arXiv:1611.01144, 2016. \nAlexia Jolicoeur-Martineau. The relativistic discriminator: a key element missing from standard gan. arXiv preprint arXiv:1807.00734, 2018. \nYoon Kim. Convolutional neural networks for sentence classification. arXiv preprint arXiv:1408.5882, 2014. \nDiederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. \nMatt J Kusner and Jose Miguel Hern ´ andez-Lobato. Gans for sequences of discrete elements with ´ the gumbel-softmax distribution. arXiv preprint arXiv:1611.04051, 2016. \nKevin Lin, Dianqi Li, Xiaodong He, Zhengyou Zhang, and Ming-Ting Sun. Adversarial ranking for language generation. In Advances in Neural Information Processing Systems, 2017. \nSidi Lu, Lantao Yu, Weinan Zhang, and Yong Yu. Cot: Cooperative training for generative modeling. arXiv preprint arXiv:1804.03782, 2018. \nChris J Maddison, Andriy Mnih, and Yee Whye Teh. The concrete distribution: A continuous relaxation of discrete random variables. arXiv preprint arXiv:1611.00712, 2016. \nSebastian Nowozin, Botond Cseke, and Ryota Tomioka. f-gan: Training generative neural samplers using variational divergence minimization. In Advances in Neural Information Processing Systems, 2016. \nKishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. Bleu: a method for automatic evaluation of machine translation. In Proceedings of the 40th annual meeting on association for computational linguistics, 2002. \nNiki Parmar, Ashish Vaswani, Jakob Uszkoreit, Łukasz Kaiser, Noam Shazeer, and Alexander Ku. Image transformer. arXiv preprint arXiv:1802.05751, 2018. \nAdam Santoro, Ryan Faulkner, David Raposo, Jack Rae, Mike Chrzanowski, Theophane Weber, Daan Wierstra, Oriol Vinyals, Razvan Pascanu, and Timothy Lillicrap. Relational recurrent neural networks. arXiv preprint arXiv:1806.01822, 2018. \nStanislau Semeniuta, Aliaksei Severyn, and Sylvain Gelly. On accurate evaluation of gans for language generation. arXiv preprint arXiv:1806.04936, 2018. \nRichard S Sutton, David A McAllester, Satinder P Singh, and Yishay Mansour. Policy gradient methods for reinforcement learning with function approximation. In Advances in neural information processing systems, 2000. \nLucas Theis, Aaron van den Oord, and Matthias Bethge. A note on the evaluation of generative ¨ models. arXiv preprint arXiv:1511.01844, 2015. \nAshish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, 2017. \nRonald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992. \nLantao Yu, Weinan Zhang, Jun Wang, and Yong Yu. Seqgan: Sequence generative adversarial nets with policy gradient. In AAAI, 2017. \nHan Zhang, Ian Goodfellow, Dimitris Metaxas, and Augustus Odena. Self-attention generative adversarial networks. arXiv preprint arXiv:1805.08318, 2018. ",
1172
+ "bbox": [
1173
+ 169,
1174
+ 455,
1175
+ 828,
1176
+ 926
1177
+ ],
1178
+ "page_idx": 9
1179
+ },
1180
+ {
1181
+ "type": "text",
1182
+ "text": "",
1183
+ "bbox": [
1184
+ 169,
1185
+ 59,
1186
+ 826,
1187
+ 929
1188
+ ],
1189
+ "page_idx": 10
1190
+ },
1191
+ {
1192
+ "type": "text",
1193
+ "text": "Yizhe Zhang, Zhe Gan, Kai Fan, Zhi Chen, Ricardo Henao, Dinghan Shen, and Lawrence Carin. Adversarial feature matching for text generation. In International Conference on Machine Learning, 2017. ",
1194
+ "bbox": [
1195
+ 176,
1196
+ 103,
1197
+ 823,
1198
+ 145
1199
+ ],
1200
+ "page_idx": 11
1201
+ },
1202
+ {
1203
+ "type": "text",
1204
+ "text": "Junbo Zhao, Yoon Kim, Kelly Zhang, Alexander Rush, and Yann LeCun. Adversarially regularized autoencoders. In International Conference on Machine Learning, 2018. ",
1205
+ "bbox": [
1206
+ 173,
1207
+ 155,
1208
+ 823,
1209
+ 184
1210
+ ],
1211
+ "page_idx": 11
1212
+ },
1213
+ {
1214
+ "type": "text",
1215
+ "text": "Yaoming Zhu, Sidi Lu, Lei Zheng, Jiaxian Guo, Weinan Zhang, Jun Wang, and Yong Yu. Texygen: A benchmarking platform for text generation models. arXiv preprint arXiv:1802.01886, 2018. ",
1216
+ "bbox": [
1217
+ 176,
1218
+ 193,
1219
+ 823,
1220
+ 222
1221
+ ],
1222
+ "page_idx": 11
1223
+ },
1224
+ {
1225
+ "type": "text",
1226
+ "text": "A EXPERIMENTAL SETTINGS ",
1227
+ "text_level": 1,
1228
+ "bbox": [
1229
+ 178,
1230
+ 102,
1231
+ 431,
1232
+ 118
1233
+ ],
1234
+ "page_idx": 12
1235
+ },
1236
+ {
1237
+ "type": "text",
1238
+ "text": "A.1 TRAINING DETAILS ",
1239
+ "text_level": 1,
1240
+ "bbox": [
1241
+ 176,
1242
+ 133,
1243
+ 354,
1244
+ 148
1245
+ ],
1246
+ "page_idx": 12
1247
+ },
1248
+ {
1249
+ "type": "text",
1250
+ "text": "Unless stated otherwise, for the CNN-based discriminator architecture, we use filter windows of sizes $\\{ 3 , 4 , 5 \\}$ and 300 feature maps each. For relational memory, we set memory size to be 256, memory slots to be 1, number of heads to be 2. The batch size is set to be 64. For embedding dimensions, we set the embedding dimension of the input token for generator to be 32 and that for discriminator to be 1 with the number of embedded representations $S = 6 4$ . We use Adam (Kingma & Ba, 2014) with $\\beta _ { 1 } = 0 . 9$ and $\\beta _ { 2 } = 0 . 9 9 9$ and gradient clipping is applied if the norm of gradients exceeds 5. We first pre-train the generator via MLE with learning rate of 1e-2 for 150 epochs and then start adversarial training with learning rate of 1e-4 for both discriminator and generator. For adversarial training, we set the maximum number of iterations $N = 5 0 0 0$ and we perform 5 gradient descent steps on the discriminator for every step on the generator. ",
1251
+ "bbox": [
1252
+ 173,
1253
+ 160,
1254
+ 825,
1255
+ 299
1256
+ ],
1257
+ "page_idx": 12
1258
+ },
1259
+ {
1260
+ "type": "text",
1261
+ "text": "A.2 HUMAN EVALUATION DETAILS ",
1262
+ "text_level": 1,
1263
+ "bbox": [
1264
+ 176,
1265
+ 315,
1266
+ 434,
1267
+ 330
1268
+ ],
1269
+ "page_idx": 12
1270
+ },
1271
+ {
1272
+ "type": "text",
1273
+ "text": "On Amazon Mechanical Turk, our instructions are given as follows: ",
1274
+ "bbox": [
1275
+ 173,
1276
+ 340,
1277
+ 617,
1278
+ 356
1279
+ ],
1280
+ "page_idx": 12
1281
+ },
1282
+ {
1283
+ "type": "text",
1284
+ "text": "The text quality evaluation is based on grammatical correctness and meaningfulness (i.e. if a sentence makes sense). Please ignore any text formatting problems (e.g., capitalization, punctuation, spelling errors, extra spaces between words and punctuations). Note: A very short sentence (less than 10 words) should be penalized with its score minus 1. Please see below for the detailed criteria. ",
1285
+ "bbox": [
1286
+ 174,
1287
+ 363,
1288
+ 825,
1289
+ 419
1290
+ ],
1291
+ "page_idx": 12
1292
+ },
1293
+ {
1294
+ "type": "table",
1295
+ "img_path": "images/622e097ffe23d4f22054d84e3792a524444ebe91ae7b411cdba0625cde233d71.jpg",
1296
+ "table_caption": [
1297
+ "Table 5: The human evaluation scale from 1 to 5 with corresponding criteria and example sentences. "
1298
+ ],
1299
+ "table_footnote": [],
1300
+ "table_body": "<table><tr><td rowspan=1 colspan=1>Scale</td><td rowspan=1 colspan=1>Criterion&amp;Example</td></tr><tr><td rowspan=1 colspan=1>5 - Excellent</td><td rowspan=1 colspan=1>Its grammatically correct and makes sense.For example,“if England wins the World Cup next year,it will be the most significantresult the sport has seen in more than a decade .&quot;</td></tr><tr><td rowspan=1 colspan=1>4 - Good</td><td rowspan=1 colspan=1>It has some small grammatical errors and mostly makes sense.For example,“it is useful to have had a doctor who forced her to release him a coupleofdays before she was cleared &quot;</td></tr><tr><td rowspan=1 colspan=1>3-Fair</td><td rowspan=1 colspan=1>It has major grammatical errors but the whole still conveys some meanings.For example,“even then once again there’s a sign of that stuffis going on the way towork on christmas eve .&quot;</td></tr><tr><td rowspan=1 colspan=1>2 - Poor</td><td rowspan=1 colspan=1>It has severe grammatical errors and the whole doesn&#x27;t make sense, but some parts arestill locally meaningful.For example,“we go to work for the moment in life their eyes and,i have been adifferent race on to go .&quot;</td></tr><tr><td rowspan=1 colspan=1>1 - Unacceptable</td><td rowspan=1 colspan=1>It isbasically a random collection of words.For example,“i go com com com,i on on on play can go go.&quot;</td></tr></table>",
1301
+ "bbox": [
1302
+ 174,
1303
+ 433,
1304
+ 823,
1305
+ 640
1306
+ ],
1307
+ "page_idx": 12
1308
+ },
1309
+ {
1310
+ "type": "image",
1311
+ "img_path": "images/7fd0b03da0c6a8c72b3149e48fd8f7565e8236b07c35278ddfd4eb356fe67449.jpg",
1312
+ "image_caption": [
1313
+ "Figure 6: Training curves of BLEU scores on COCO Image Captions with different loss functions: RSGAN (Jolicoeur-Martineau, 2018), standard GAN (the non-saturating version) (Goodfellow et al., 2014) and hinge loss (Nowozin et al., 2016; Zhang et al., 2018), where $\\beta _ { \\mathrm { m a x } } = 1 0 0 0$ and we use two different optimizers – (a) Adam and (b) RMSProp. All the results are obtained by taking the average of 6 runs with different random seeds. The vertical dash line represents the end of pre-training. We can see that RelGAN works well with different commonly-used loss functions of GANs and different optimization methods. In this scenario, the performance of RSGAN and standard GAN outperforms the hinge loss version. "
1314
+ ],
1315
+ "image_footnote": [],
1316
+ "bbox": [
1317
+ 230,
1318
+ 151,
1319
+ 766,
1320
+ 799
1321
+ ],
1322
+ "page_idx": 13
1323
+ },
1324
+ {
1325
+ "type": "text",
1326
+ "text": "C GENERATED SAMPLES ON REAL DATASET ",
1327
+ "text_level": 1,
1328
+ "bbox": [
1329
+ 173,
1330
+ 102,
1331
+ 562,
1332
+ 118
1333
+ ],
1334
+ "page_idx": 14
1335
+ },
1336
+ {
1337
+ "type": "text",
1338
+ "text": "C.1 GENERATED SAMPLES ON COCO IMAGE CAPTIONS DATASET ",
1339
+ "bbox": [
1340
+ 176,
1341
+ 133,
1342
+ 647,
1343
+ 148
1344
+ ],
1345
+ "page_idx": 14
1346
+ },
1347
+ {
1348
+ "type": "text",
1349
+ "text": "a man is sitting on a bench next to a bicycle . \na man fixing a motor cycle in a race . \na rectangle shaped wooden sitting on a lush green field . \na man standing in a picture of a kitchen with a dog watching him . \na man is carving some meat in a park . \na kitchen with a black window and a large white stove wall . \na cat is looking on a man in a bathroom . \na train is covered in the air in the city scene . \na bathroom has a toilet , and bathroom rug for a urinal or a urinal on the side . \na home kitchen with a double oven and table while a table and chairs . \na small airplane flying above an airport covered with wood . \na man in a kitchen preparing food on a table . \na large passenger jet flying in a clear blue sky . \na group of people riding motorcycles on a street . \na woman in a kitchen with her hands clasped . a smiling woman is sitting on a green bench . \npeople are hiding under colorful umbrellas on a rainy day . \na photo of a small restroom in a kitchen . \nmany sheep graze are shown in front of a group of people . \na plane is parked next to an airplane on a runway near a control tower with two back . \na woman walking past a straw shower holding a corner . \nan office desk with a row of books in the kitchen . \na cat sitting on top of a kitchen counter . \na person riding a bike through a lush green park . \na bathroom with a sink , toilet and toilet paper dispenser . \na man is on a motorcycle with a woman on the back of it . \ntwo giraffes in a wild , lightly wooded field . \na metal tin pan filled with two different kitchen appliances . \na white airplane flying in the sky over a runway . \na car driving on a busy street at night from an airport . ",
1350
+ "bbox": [
1351
+ 240,
1352
+ 172,
1353
+ 704,
1354
+ 469
1355
+ ],
1356
+ "page_idx": 14
1357
+ },
1358
+ {
1359
+ "type": "text",
1360
+ "text": "",
1361
+ "bbox": [
1362
+ 241,
1363
+ 483,
1364
+ 753,
1365
+ 780
1366
+ ],
1367
+ "page_idx": 14
1368
+ },
1369
+ {
1370
+ "type": "text",
1371
+ "text": "C.2 GENERATED SAMPLES ON EMNLP2017 WMT NEWS DATASET ",
1372
+ "text_level": 1,
1373
+ "bbox": [
1374
+ 174,
1375
+ 103,
1376
+ 660,
1377
+ 118
1378
+ ],
1379
+ "page_idx": 15
1380
+ },
1381
+ {
1382
+ "type": "text",
1383
+ "text": "he is also watching closely on staying in the plan , but sometimes i still don ’ t think that ’ s going to happen on saturday . \nand so , they didn ’ t want to be in their position , and that was something they would do to my wife . i would like to assess whether you should be able to take that into that issue than you did on a sunday . “ he ’ s a young lady , so i don ’ t want to show up for them , ” she said . \nthat ’ s not yet about what you want to say about reality , but probably don ’ t think about that would just make me comfortable in my life . \nofficials have been also a member of nato against the us , and for the first time that so many other countries are on the rise , and that will be the only way to stay here . \nhe has always vowed to give him a little more on for him , and i think he is very willing for the division . we ’ ve had to try and get into the coming down to the today ’ s end . \ni don ’ t think that ’ s why we did not have to score the last two . \nmeanwhile , it was never been in the past , but it was not known until the coalition was given the support of the rebels on the terms of the claims . \nhe said : “ i don ’ t think we should be better at what we would do to the good . \n“ we had to get on with that , ” she said at a news conference . \nby contrast , but this is a turning point at her age . \nbut i will do that , which i have to do with the city , and my new hopes is from all over the world . “ this is a very bad , and it ’ s not clear that this is a danger of this , ” he said . at a detroit press with reporters on the flight , gave informed operators time to interview mr . cox that he was struggling with all of his treatments . \n“ in the past five days , we ’ re going to enjoy maybe that and after that , you ’ re going to stay to dinner with friends and family , ” he said . \nthe union has indicated that there are no restrictions on the long - standing alliance in any key areas . \ni never thought i could put over the line but i couldn ’ t quite lose my job . \nsince then , while the number of people stood by the wall street banks fell by 2 percent over the past 10 years , there ’ s no need to say that . \n“ they had to fly in the field , ” he said , adding that it didn ’ t miss it . \n“ trump ’ s voice will be a positive one for mr . trump ’ s transition team , ” he said . \nhe was still working on a training camp friday with a small into a new manager . \nthe 15 - year - old man has been reported missing by a falling from the city centre . \n“ it ’ s a process that can take a little while , ” one resident said . \na well - meaning - predicted or very public policy , seeking to work with us . \n“ i ’ m not to have made me a bit more than anything , but i ’ ve never done that , ” he said . \nthey were waiting to see how many changes could come from us and that ’ s why it has made it leave facing . \nshe initially noted that some of the other victims began to come from being more than prepared to stand for . \n“ i ’ ve never heard of the abuse , because we need to work with him , ” he added . ",
1384
+ "bbox": [
1385
+ 179,
1386
+ 145,
1387
+ 802,
1388
+ 489
1389
+ ],
1390
+ "page_idx": 15
1391
+ },
1392
+ {
1393
+ "type": "text",
1394
+ "text": "",
1395
+ "bbox": [
1396
+ 179,
1397
+ 502,
1398
+ 831,
1399
+ 838
1400
+ ],
1401
+ "page_idx": 15
1402
+ },
1403
+ {
1404
+ "type": "text",
1405
+ "text": "D MORE RESULTS ON ABLATION STUDY ",
1406
+ "text_level": 1,
1407
+ "bbox": [
1408
+ 173,
1409
+ 102,
1410
+ 527,
1411
+ 118
1412
+ ],
1413
+ "page_idx": 16
1414
+ },
1415
+ {
1416
+ "type": "text",
1417
+ "text": "D.1 IMPACT OF RELATIONAL MEMORY ",
1418
+ "text_level": 1,
1419
+ "bbox": [
1420
+ 174,
1421
+ 133,
1422
+ 459,
1423
+ 148
1424
+ ],
1425
+ "page_idx": 16
1426
+ },
1427
+ {
1428
+ "type": "image",
1429
+ "img_path": "images/87465a23a0a434ffd21122421237a0ea21916550bb1fdea8cd7dfe3b88273a61.jpg",
1430
+ "image_caption": [
1431
+ "Figure 7: Training curves of BLEU scores on COCO Image Captions with different generator architectures – relational memory (RM), LSTM-32 and LSTM-512, where $\\beta _ { \\mathrm { m a x } } = 1 0 0 0$ . We can see that the BLEU scores of relational memory are consistently better than those of LSTM-32 and LSTM-512, which demonstrates the advantages of using relational memory as generator in RelGAN. "
1432
+ ],
1433
+ "image_footnote": [],
1434
+ "bbox": [
1435
+ 238,
1436
+ 159,
1437
+ 758,
1438
+ 450
1439
+ ],
1440
+ "page_idx": 16
1441
+ },
1442
+ {
1443
+ "type": "image",
1444
+ "img_path": "images/3b1c68ebdf534b04a855eaad99de3ec7fe95f37983c831125d3d1d4d105fc218.jpg",
1445
+ "image_caption": [
1446
+ "D.2 IMPACT OF GUMBEL-SOFTMAX RELAXATION ",
1447
+ "Figure 8: Training curves of BLEU scores on COCO Image Captions with different gradient relaxations for GANs on discrete data – Gumbel-Softmax relaxation and REINFORCE method. We can see that the BLEU scores of Gumbel-Softmax relaxation are consistently better than those of REINFORCE method, which demonstrates the advantages of using Gumbel-Softmax relaxation to deal with non-differentiable issues in RelGAN. "
1448
+ ],
1449
+ "image_footnote": [],
1450
+ "bbox": [
1451
+ 238,
1452
+ 559,
1453
+ 758,
1454
+ 847
1455
+ ],
1456
+ "page_idx": 16
1457
+ },
1458
+ {
1459
+ "type": "image",
1460
+ "img_path": "images/516375f27df355fd42f1f8a84af093af26a7511e597562713973c025dcd84919.jpg",
1461
+ "image_caption": [
1462
+ "Figure 9: Training curves of BLEU scores on COCO Image Captions with different number of embedded representations $S = 1$ and $S \\ : = \\ : 6 4$ , where $\\beta _ { \\mathrm { m a x } } ~ = ~ 1 0 0 0$ . We can see that the BLEU scores of $S \\ : = \\ : 6 4$ are consistently better than those of $S = 1$ , which demonstrates the advantages of using multiple embedded representations for discriminator in RelGAN. "
1463
+ ],
1464
+ "image_footnote": [],
1465
+ "bbox": [
1466
+ 225,
1467
+ 130,
1468
+ 769,
1469
+ 433
1470
+ ],
1471
+ "page_idx": 17
1472
+ },
1473
+ {
1474
+ "type": "text",
1475
+ "text": "E DIVERSITY-QUALITY TRANSITION DURING TRAINING ",
1476
+ "text_level": 1,
1477
+ "bbox": [
1478
+ 176,
1479
+ 525,
1480
+ 661,
1481
+ 542
1482
+ ],
1483
+ "page_idx": 17
1484
+ },
1485
+ {
1486
+ "type": "text",
1487
+ "text": "As we can observe from Figures 7-9 in the above appendices, the BLEU scores of RelGAN (denoted by the blue curves in each subfigure) first increase over iterations and then keep decreasing after around 800 iterations. In other words, its sample quality first increases and then decreases during the adversarial training. To see what happens in the training dynamics of RelGAN, we also provide the training curve of the diversity metric $\\mathrm { - N L L _ { \\mathrm { g e n } } }$ in RelGAN as shown in Figure 10. ",
1488
+ "bbox": [
1489
+ 173,
1490
+ 556,
1491
+ 825,
1492
+ 627
1493
+ ],
1494
+ "page_idx": 17
1495
+ },
1496
+ {
1497
+ "type": "image",
1498
+ "img_path": "images/547c152a008965d8229710e1918a0914e2f8c1fa06a5a04d315dc63036a62f5f.jpg",
1499
+ "image_caption": [
1500
+ "Figure 10: The training curve of ${ \\mathrm { N L L } } _ { \\mathrm { g e n } }$ in RelGAN on COCO Image Captions, where $\\beta _ { \\mathrm { m a x } } = 1 0 0 0$ . We can see that during the adversarial training, the ${ \\mathrm { N L L } } _ { \\mathrm { g e n } }$ score first increases and then decreases after around 800 iterations. The turning point matches well with those in the training curves of BLEU scores. "
1501
+ ],
1502
+ "image_footnote": [],
1503
+ "bbox": [
1504
+ 367,
1505
+ 641,
1506
+ 627,
1507
+ 790
1508
+ ],
1509
+ "page_idx": 17
1510
+ },
1511
+ {
1512
+ "type": "text",
1513
+ "text": "Interestingly, Figure 10 shows that during the adversarial training, the sample diversity (measured by $\\mathrm { N L L } _ { \\mathrm { g e n } } )$ of RelGAN first decreases and then increases, and its turning point matches well with that of the sample quality (measured by BLEU scores) of RelGAN. These training dynamics illustrate a diversity-quality transition over iterations in RelGAN: Early on in training, it learns to aggressively improve sample quality while sacrificing diversity. Later on, it turns instead to maximizing sample diversity while gradually decreasing sample quality. Intuitively, it seems to be much easier for the generator to just produce realistic samples – regardless of their diversity – to fool the discriminator in the early stage of training. As the discriminator becomes better at distinguishing samples with less diversity over iterations, the generator has to focus more on producing more diverse samples to fool the discriminator. ",
1514
+ "bbox": [
1515
+ 174,
1516
+ 853,
1517
+ 825,
1518
+ 924
1519
+ ],
1520
+ "page_idx": 17
1521
+ },
1522
+ {
1523
+ "type": "text",
1524
+ "text": "",
1525
+ "bbox": [
1526
+ 174,
1527
+ 103,
1528
+ 825,
1529
+ 174
1530
+ ],
1531
+ "page_idx": 18
1532
+ },
1533
+ {
1534
+ "type": "text",
1535
+ "text": "F RELGAN WITHOUT PRE-TRAINING ",
1536
+ "text_level": 1,
1537
+ "bbox": [
1538
+ 174,
1539
+ 196,
1540
+ 501,
1541
+ 213
1542
+ ],
1543
+ "page_idx": 18
1544
+ },
1545
+ {
1546
+ "type": "text",
1547
+ "text": "In this section, we want to test the performance of RelGAN without pre-training for different loss functions, including standard GAN (the non-satuarating version) (Goodfellow et al., 2014), WGANGP (Gulrajani et al., 2017), hinge loss (Nowozin et al., 2016; Zhang et al., 2018) and RSGAN (Jolicoeur-Martineau, 2018). The BLEU and ${ \\mathrm { N L L } } _ { \\mathrm { g e n } }$ scores evaluated on COCO Image Captions are shown in Table 8. ",
1548
+ "bbox": [
1549
+ 174,
1550
+ 231,
1551
+ 825,
1552
+ 301
1553
+ ],
1554
+ "page_idx": 18
1555
+ },
1556
+ {
1557
+ "type": "table",
1558
+ "img_path": "images/9c1431433d44451b90f641ef4905866fa98da7af6b8d89a3698ad960e4422cdd.jpg",
1559
+ "table_caption": [
1560
+ "Table 8: The BLEU and ${ \\mathrm { N L L } } _ { \\mathrm { g e n } }$ scores of RelGAN without pre-training on COCO Image Captions where with a little hyperparameter tuning, we set $\\beta _ { \\mathrm { m a x } } = 1 0 0$ for the standard GAN loss and $\\beta _ { \\mathrm { m a x } } = 1 0 0 0$ for other losses. All the results are run with 6 random seeds and the final score is obtained by taking the average of scores. As a reference, we also provide the results of an untrained RelGAN which is marked as “random”. Note that for the hinge loss, we get no valid results as it suffers from the vanishing gradient issue. "
1561
+ ],
1562
+ "table_footnote": [],
1563
+ "table_body": "<table><tr><td>Losses</td><td>BLEU-2</td><td>BLEU-3</td><td>BLEU-4</td><td>BLEU-5</td><td>NLLgen</td></tr><tr><td>Hinge</td><td>=</td><td>-</td><td>=</td><td>1</td><td>-</td></tr><tr><td>WGAN-GP</td><td>0.330 ± 0.024</td><td>0.111 ± 0.019</td><td>0.065 ± 0.017</td><td>0.045 ± 0.013</td><td>4.063 ± 0.623</td></tr><tr><td>RSGAN</td><td>0.460 ± 0.026</td><td>0.172 ± 0.025</td><td>0.085 ± 0.017</td><td>0.056 ± 0.013</td><td>3.065 ± 0.917</td></tr><tr><td>Standard</td><td>0.590 ± 0.019</td><td>0.280 ± 0.020</td><td>0.141 ± 0.018</td><td>0.094 ± 0.011</td><td>2.259 ± 0.263</td></tr><tr><td>Random</td><td>0.041</td><td>0.017</td><td>0.011</td><td>0.008</td><td>8.355</td></tr></table>",
1564
+ "bbox": [
1565
+ 189,
1566
+ 314,
1567
+ 808,
1568
+ 395
1569
+ ],
1570
+ "page_idx": 18
1571
+ },
1572
+ {
1573
+ "type": "text",
1574
+ "text": "We can see that without pre-training, there is still a significant improvement for RelGAN compared with the random generation, in particular for the standard GAN loss, even though the improvement is inferior to the case with pre-training. In contrast, without pre-training, previous RL-based GANs for text generation, such as SeqGAN and RankGAN, always get stuck around their initialization points and are not able to improve their performance at all. This demonstrates that RelGAN may be a more promising GAN architecture to explore in order to completely get rid of the pre-training for GANs on text generation. Besides, Table 8 also shows that the evaluation results of RelGAN without pretraining vary with different loss functions and values of $\\beta _ { \\mathrm { m a x } }$ . We leave an extensive hyperparameter search to further improve the performance of RelGAN without pre-training for future work. ",
1575
+ "bbox": [
1576
+ 174,
1577
+ 489,
1578
+ 825,
1579
+ 614
1580
+ ],
1581
+ "page_idx": 18
1582
+ },
1583
+ {
1584
+ "type": "text",
1585
+ "text": "G MORE EXPLORATION ON TUNABLE HYPERPARAMETER $\\beta _ { \\mathrm { m a x } }$ ",
1586
+ "text_level": 1,
1587
+ "bbox": [
1588
+ 176,
1589
+ 638,
1590
+ 710,
1591
+ 656
1592
+ ],
1593
+ "page_idx": 18
1594
+ },
1595
+ {
1596
+ "type": "text",
1597
+ "text": "For real data experiments, we have showed the advantages of RelGAN over other models by setting the maximum inverse temperature $\\beta _ { \\mathrm { m a x } } \\in \\{ 1 0 0 , 1 0 0 0 \\}$ , which are carefully chosen for a good tradeoff between sample quality and diversity. A natural question will be to explore the two extremes: what happens with the real data if $\\beta _ { \\mathrm { m a x } }$ is either too large or too small? Does it behave similarly to the synthetic data experiments in terms of the trade-off between sample diversity and quality? ",
1598
+ "bbox": [
1599
+ 174,
1600
+ 672,
1601
+ 825,
1602
+ 742
1603
+ ],
1604
+ "page_idx": 18
1605
+ },
1606
+ {
1607
+ "type": "text",
1608
+ "text": "To this end, we choose a broad range of $\\beta _ { \\mathrm { m a x } } \\in \\{ 1 , 1 0 , 1 0 ^ { 2 } , 1 0 ^ { 3 } , 1 0 ^ { 4 } , 1 0 ^ { 5 } , 1 0 ^ { 6 } , 1 0 ^ { 7 } \\}$ and test its impact in RelGAN on the COCO Image Captions dataset. The BLEU and ${ \\mathrm { N L L } } _ { \\mathrm { g e n } }$ scores are given in Table 9, where we can see that both BLEU and ${ \\mathrm { N L L } } _ { \\mathrm { g e n } }$ scores increase with the decrease of $\\beta _ { \\mathrm { m a x } }$ , and the variance of each score also consistently becomes larger for a smaller $\\beta _ { \\mathrm { m a x } }$ . For better illustration, we also plot BLEU-4 and ${ \\mathrm { N L L } } _ { \\mathrm { g e n } }$ scores with error bars in Figure 11. ",
1609
+ "bbox": [
1610
+ 174,
1611
+ 748,
1612
+ 825,
1613
+ 820
1614
+ ],
1615
+ "page_idx": 18
1616
+ },
1617
+ {
1618
+ "type": "text",
1619
+ "text": "It first confirms that similar to the synthetic data experiments, there also exists a consistent trade-off between sample quality and diversity in real data, controlled by the tunable hyperparameter $\\beta _ { \\mathrm { m a x } }$ . Besides, it reveals the failing cases at the two extremes: On the one hand, if $\\beta _ { \\mathrm { m a x } }$ is too small, i.e. $\\beta _ { \\operatorname* { m a x } } = 1$ , RelGAN suffers from severe mode collapse (denoted by the large ${ \\mathrm { N L L } } _ { \\mathrm { g e n . } }$ ) and training instability (denoted by high variances of scores) issues. On the other hand, if $\\beta _ { \\mathrm { m a x } }$ is too large, i.e. $\\beta _ { \\mathrm { m a x } } = \\mathrm { \\bar { 1 0 } ^ { 7 } }$ , the sample quality improvement of RelGAN becomes marginal (denoted by the low BLEU scores). Therefore, we have chosen the two intermediate values $\\{ 1 0 0 , 1 0 0 0 \\}$ of $\\beta _ { \\mathrm { m a x } }$ in the ",
1620
+ "bbox": [
1621
+ 174,
1622
+ 825,
1623
+ 825,
1624
+ 924
1625
+ ],
1626
+ "page_idx": 18
1627
+ },
1628
+ {
1629
+ "type": "table",
1630
+ "img_path": "images/9d499764b52c68965ce2d9a49c27d70ee0d0afd4703eb8101c8e6203c87df2fd.jpg",
1631
+ "table_caption": [],
1632
+ "table_footnote": [],
1633
+ "table_body": "<table><tr><td>βmax</td><td>BLEU-2</td><td>BLEU-3</td><td>BLEU-4</td><td>BLEU-5</td><td>NLLgen</td></tr><tr><td>1</td><td>0.890± 0.121</td><td>0.791± 0.209</td><td>0.659± 0.243</td><td>0.500± 0.230</td><td>1.454 ± 0.121</td></tr><tr><td>10</td><td>0.862 ± 0.038</td><td>0.741± 0.060</td><td>0.604 ± 0.060</td><td>0.445 ± 0.080</td><td>1.084 ± 0.061</td></tr><tr><td>10²</td><td>0.849 ± 0.030</td><td>0.687 ± 0.047</td><td>0.502 ± 0.048</td><td>0.331 ± 0.044</td><td>0.756 ± 0.054</td></tr><tr><td>103</td><td>0.814 ± 0.012</td><td>0.634 ± 0.020</td><td>0.455 ± 0.023</td><td>0.303 ± 0.020</td><td>0.655 ± 0.048</td></tr><tr><td>104</td><td>0.801 ± 0.006</td><td>0.609 ± 0.012</td><td>0.430 ± 0.019</td><td>0.288 ± 0.015</td><td>0.631 ± 0.045</td></tr><tr><td>105</td><td>0.796 ± 0.007</td><td>0.599 ± 0.012</td><td>0.417 ± 0.010</td><td>0.277 ± 0.012</td><td>0.588 ± 0.037</td></tr><tr><td>106</td><td>0.790 ± 0.009</td><td>0.588 ± 0.011</td><td>0.408 ± 0.013</td><td>0.272 ± 0.010</td><td>0.569± 0.039</td></tr><tr><td>107</td><td>0.775 ± 0.011</td><td>0.572 ± 0.020</td><td>0.390 ± 0.019</td><td>0.252 ± 0.016</td><td>0.547 ± 0.032</td></tr></table>",
1634
+ "bbox": [
1635
+ 210,
1636
+ 101,
1637
+ 787,
1638
+ 223
1639
+ ],
1640
+ "page_idx": 19
1641
+ },
1642
+ {
1643
+ "type": "text",
1644
+ "text": "Table 9: The BLEU and ${ \\mathrm { N L L } } _ { \\mathrm { g e n } }$ scores of RelGAN with various values of $\\beta _ { \\mathrm { m a x } }$ on COCO Image Captions. All the results are run with 6 random seeds and the final score is obtained by taking the average of scores. As we can see, both BLEU and ${ \\mathrm { N L L } } _ { \\mathrm { g e n } }$ scores increase with the decrease of $\\beta _ { \\mathrm { m a x } }$ . Besides, the variance of each score also consistently becomes larger for a smaller $\\beta _ { \\mathrm { m a x } }$ . ",
1645
+ "bbox": [
1646
+ 173,
1647
+ 233,
1648
+ 825,
1649
+ 285
1650
+ ],
1651
+ "page_idx": 19
1652
+ },
1653
+ {
1654
+ "type": "image",
1655
+ "img_path": "images/c138de5c8ce35c67317da279e683678aee020533e020b8b54f981af180c36523.jpg",
1656
+ "image_caption": [
1657
+ "Figure 11: The BLEU-4 (Left) and ${ \\mathrm { N L L } } _ { \\mathrm { g e n } }$ (Right) scores with error bars in RelGAN on COCO Image Captions with varying maximum inverse temperature $\\beta _ { \\mathrm { m a x } }$ . "
1658
+ ],
1659
+ "image_footnote": [],
1660
+ "bbox": [
1661
+ 220,
1662
+ 299,
1663
+ 777,
1664
+ 453
1665
+ ],
1666
+ "page_idx": 19
1667
+ },
1668
+ {
1669
+ "type": "text",
1670
+ "text": "main text to show the advantages of RelGAN over other models while still demonstrating its ability to control the trade-off between sample quality and diversity. ",
1671
+ "bbox": [
1672
+ 173,
1673
+ 515,
1674
+ 823,
1675
+ 545
1676
+ ],
1677
+ "page_idx": 19
1678
+ }
1679
+ ]
parse/train/rJedV3R5tm/rJedV3R5tm_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/rJedV3R5tm/rJedV3R5tm_model.json ADDED
The diff for this file is too large to render. See raw diff