ZHANGYUXUAN-zR commited on
Commit
3170b93
·
verified ·
1 Parent(s): 0f61011

Add files using upload-large-folder tool

Browse files
parse/train/B1DmUzWAW/B1DmUzWAW.md ADDED
@@ -0,0 +1,356 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # A SIMPLE NEURAL ATTENTIVE META-LEARNER
2
+
3
+ Nikhil Mishra ∗ † Mostafa Rohaninejad∗ Xi Chen† UC Berkeley, Department of Electrical Engineering and Computer Science Embodied Intelligence {nmishra, rohaninejadm, c.xi, pabbeel}@berkeley.edu
4
+
5
+ # ABSTRACT
6
+
7
+ Deep neural networks excel in regimes with large amounts of data, but tend to struggle when data is scarce or when they need to adapt quickly to changes in the task. In response, recent work in meta-learning proposes training a meta-learner on a distribution of similar tasks, in the hopes of generalization to novel but related tasks by learning a high-level strategy that captures the essence of the problem it is asked to solve. However, many recent meta-learning approaches are extensively hand-designed, either using architectures specialized to a particular application, or hard-coding algorithmic components that constrain how the meta-learner solves the task. We propose a class of simple and generic meta-learner architectures that use a novel combination of temporal convolutions and soft attention; the former to aggregate information from past experience and the latter to pinpoint specific pieces of information. In the most extensive set of meta-learning experiments to date, we evaluate the resulting Simple Neural AttentIve Learner (or SNAIL) on several heavily-benchmarked tasks. On all tasks, in both supervised and reinforcement learning, SNAIL attains state-of-the-art performance by significant margins.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ The ability to learn quickly is a key characteristic that distinguishes human intelligence from its artificial counterpart. Humans effectively utilize prior knowledge and experiences to learn new skills quickly. However, artificial learners trained with traditional supervised-learning or reinforcementlearning methods generally perform poorly when only a small amount of data is available or when they need to adapt to a changing task.
12
+
13
+ Meta-learning seeks to resolve this deficiency by broadening the learner’s scope to a distribution of related tasks. Rather than training the learner on a single task (with the goal of generalizing to unseen samples from a similar data distribution) a meta-learner is trained on a distribution of similar tasks, with the goal of learning a strategy that generalizes to related but unseen tasks from a similar task distribution. Traditionally, a successful learner discovers a rule that generalizes across data points, while a successful meta-learner learns an algorithm that generalizes across tasks.
14
+
15
+ Many recently-proposed meta-learning methods demonstrate improved performance at the expense of being hand-designed at either the architectural or algorithmic level. Some have been engineered with a particular application in mind, while others have aspects of a particular high-level strategy already built into them. However, the optimal strategy for an arbitrary range of tasks may not be obvious to the humans designing a meta-learner, in which case the meta-learner should have the flexibility to learn the best way to solve the tasks it is presented with. Such a meta-learner would need to have an expressive, versatile model architecture, in order to learn a range of strategies in a variety of domains.
16
+
17
+ Meta-learning can be formalized as a sequence-to-sequence problem; in existing approaches that adopt this view, the bottleneck is in the meta-learner’s ability to internalize and refer to past experience. Thus, we propose a class of model architectures that addresses this shortcoming: we combine temporal convolutions, which enable the meta-learner to aggregate contextual information from past experience, with causal attention, which allow it to pinpoint specific pieces of information within that context. We evaluate this Simple Neural AttenIve Learner (SNAIL) on several heavily-benchmarked meta-learning tasks, including the Omniglot and mini-Imagenet datasets in supervised learning, and multi-armed bandits, tabular Markov Decision processes (MDPs), visual navigation, and continuous control in reinforcement learning. In all domains, SNAIL achieves state-of-the-art performance by significant margins, outperforming methods that are domain-specific or rely on built-in algorithmic priors.
18
+
19
+ # 2 META-LEARNING PRELIMINARIES
20
+
21
+ Before we describe SNAIL in detail, we will introduce notation and formalize the meta-learning problem. As briefly discussed in Section 1, the goal of meta-learning is generalization across tasks rather than across data points. Each task $\mathcal { T } _ { i }$ is episodic and defined by inputs $x _ { t }$ , outputs $a _ { t }$ , a loss function $\mathcal { L } _ { i } ( x _ { t } , a _ { t } )$ , a transition distribution $P _ { i } ( x _ { t } | x _ { t - 1 } , a _ { t - 1 } )$ , and an episode length $H _ { i }$ . A meta-learner (with parameters $\theta$ ) models the distribution $\pi ( a _ { t } | x _ { 1 } , \dots , x _ { t } ; \theta )$ . Given a distribution over tasks $\mathcal { T } = P ( \mathcal { T } _ { i } )$ , the meta-learner’s objective is to minimize its expected loss with respect to $\theta$
22
+
23
+ $$
24
+ \begin{array} { l } { { \displaystyle \operatorname* { m i n } _ { \theta } \mathbb { E } _ { \mathcal { T } _ { i } \sim \mathcal { T } } \bigg [ \sum _ { t = 0 } ^ { H _ { i } } \mathcal { L } _ { i } ( x _ { t } , a _ { t } ) \bigg ] , } \ ~ } \\ { { \displaystyle \mathrm { ~ w h e r e ~ } x _ { t } \sim P _ { i } ( x _ { t } | x _ { t - 1 } , a _ { t - 1 } ) , a _ { t } \sim \pi ( a _ { t } | x _ { 1 } , \dots , x _ { t } ; \theta ) } } \end{array}
25
+ $$
26
+
27
+ A meta-learner is trained by optimizing this expected loss over tasks (or mini-batches of tasks) sampled from $\tau$ . During testing, the meta-learner is evaluated on unseen tasks from a different task distribution $\widetilde { \tau } = P ( \widetilde { T } _ { i } )$ that is similar to the training task distribution $\tau$ .
28
+
29
+ # 3 A SIMPLE NEURAL ATTENTIVE LEARNER
30
+
31
+ The key principle motivating our approach is simplicity and versatility: a meta-learner should be universally applicable to domains in both supervised and reinforcement learning. It should be generic and expressive enough to learn an optimal strategy, rather than having the strategy already built-in.
32
+
33
+ Santoro et al. (2016) considered a similar formulation of the meta-learning problem, and explored using recurrent neural networks (RNNs) to implement a meta-learner. Although simple and generic, their approach is significantly outperformed by methods that are hand-designed to exploit domain or algorithmic knowledge (methods which we survey in Section 4). We hypothesize that this is because traditional RNN architectures propagate information by keeping it in their hidden state from one timestep to the next; this temporally-linear dependency bottlenecks their capacity to perform sophisticated computation on a stream of inputs.
34
+
35
+ van den Oord et al. (2016a) introduced a class of architectures that generate sequential data (in their case, audio) by performing dilated 1D-convolutions over the temporal dimension. These temporal convolutions (TC) are causal, so that the generated values at the next timestep are only influenced by past timesteps and not future ones. Compared to traditional RNNs, they offer more direct, highbandwidth access to past information, allowing them to perform more sophisticated computation over a temporal context of fixed size. However, to scale to long sequences, the dilation rates generally increase exponentially, so that the required number of layers scales logarithmically with the sequence length. Hence, they have coarser access to inputs that are further back in time; their bounded capacity and positional dependence can be undesirable in a meta-learner, which should be able to fully utilize increasingly large amounts of experience.
36
+
37
+ In contrast, soft attention (in particular, the style used by Vaswani et al. (2017a)) allows a model to pinpoint a specific piece of information from a potentially infinitely-large context. It treats the context as an unordered key-value store which it can query based on the content of each element. However, the lack of positional dependence can also be undesirable, especially in reinforcement learning, where the observations, actions, and rewards are intrinsically sequential.
38
+
39
+ Despite their individual shortcomings, temporal convolutions and attention complement each other: while the former provide high-bandwidth access at the expense of finite context size, the latter provide pinpoint access over an infinitely large context. Hence, we construct SNAIL by combining the two: we use temporal convolutions to produce the context over which we use a causal attention operation. By interleaving TC layers with causal attention layers, SNAIL can have high-bandwidth access over its past experience without constraints on the amount of experience it can effectively use. By using attention at multiple stages within a model that is trained end-to-end, SNAIL can learn what pieces of information to pick out from the experience it gathers, as well as a feature representation that is amenable to doing so easily. As an additional benefit, SNAIL architectures are easier to train than traditional RNNs such as LSTM or GRUs (where the underlying optimization can be difficult because of the temporally-linear hidden state dependency) and can be efficiently implemented so that an entire sequence can be processed in a single forward pass. Figure 1 provides an illustration of SNAIL, and we discuss architectural components in Section 3.1.
40
+
41
+ ![](images/c0dffb1b17f3fe7f57881a53f96bf90c10b7082a0050f82836a11cd0b244b814.jpg)
42
+ Figure 1: Overview of our simple neural attentive learner (SNAIL); in this example, two blocks of TC layers (orange) are interleaved with two causal attention layers (green). The same class of model architectures can be applied to both supervised and reinforcement learning.
43
+
44
+ In supervised settings, SNAIL receives as input a sequence of example-label pairs $( x _ { 1 } , y _ { 1 } ) , \dotsc , ( x _ { t - 1 } , y _ { t - 1 } )$ for timesteps $1 , \ldots , t - 1$ , followed by an unlabeled example $( x _ { t } , - )$ It then outputs its prediction for $x _ { t }$ based on the previous labeled examples it has seen.
45
+
46
+ In reinforcement-learning settings, it receives a sequence of observation-action-reward tuples $( o _ { 1 } , - , - ) , \ldots , ( o _ { t } , a _ { t - 1 } , r _ { t - 1 } )$ . At each time $t$ , it outputs a distribution over actions $a _ { t }$ based on the current observation $o _ { t }$ as well as previous observations, actions, and rewards. Crucially, following existing work in meta-RL (Duan et al., 2016; Wang et al., 2016), we preserve the internal state of a SNAIL across episode boundaries, which allows it to have memory that spans multiple episodes. The observations also contain a binary input that indicates episode termination.
47
+
48
+ # 3.1 MODULAR BUILDING BLOCKS
49
+
50
+ We compose SNAIL architectures using a few primary building blocks. Below, we provide pseudocode for applying each block to a matrix ("inputs" in the pseudocode) of size (sequence length) $\times$ (input dimensionality). Note that, if any of the inputs are images, we employ an additional (spatial) convolutional network that converts the image into a feature vector before it is passed into the SNAIL. Figure 2 illustrates the different blocks visually.
51
+
52
+ Many techniques have been proposed to increase the capacity or accelerate the training of deep convolutional architectures, including batch normalization (Ioffe & Szegedy (2015)), residual connections (He et al. (2016)), and dense connections (Huang et al. (2016)). We found that these techniques greatly improved the expressive capacity and training speed of SNAILs, but that no particular choice of residual/dense configurations was essential for good performance (we explore the robustness of SNAILs to architectural choices in Appendix B).
53
+
54
+ A dense block applies a single causal 1D-convolution with dilation rate $R$ and $D$ filters (we used kernel size 2 in all experiments), and then concatenates the result with its input. We used the gated activation function (line 3) introduced by van den Oord et al. (2016a;b).
55
+
56
+ A TC block consists of a series of dense blocks whose dilation rates increase exponentially until their receptive field exceeds the desired sequence length:
57
+
58
+ <table><tr><td colspan="2">1: function TCBLOCK(inputs,sequence length T, number of filters D):</td></tr><tr><td>2:</td><td>for i in 1,...,[log2T] do</td></tr><tr><td>3:</td><td>inputs = DenseBlock(inputs, 2,D)</td></tr><tr><td>4:</td><td>return inputs</td></tr></table>
59
+
60
+ A attention block performs a single key-value lookup; we style this operation after the self-attention mechanism proposed by Vaswani et al. (2017a):
61
+
62
+ 1: function ATTENTIONBLOCK(inputs, key size $K$ , value size $V$ ):
63
+ 2: keys, query $=$ affine(inputs, $K _ { \cdot }$ ), affine(inputs, $K$ )
64
+ 3: logits $=$ matmul(query, transpose(keys))
65
+ 4: probs $=$ CausallyMaskedSoftmax(logits / $\sqrt { K } )$ )
66
+ 5: values $=$ affine(inputs, $V$ )
67
+ 6: read $=$ matmul(probs, values)
68
+ 7: return concat(inputs, read)
69
+
70
+ where CausallyMaskedSoftmax(·) zeros out the appropriate probabilities before normalization, so that a particular timestep’s query cannot have access to future keys/values.
71
+
72
+ ![](images/f8a62d90dd8397b1ccb85932dc0ffd1ce39962c8d53bc6b2ba661d40e256e373.jpg)
73
+ (a) Dense Block (dilation rate R, D lters)
74
+
75
+ (b) Attention Block (key size K, value size V)
76
+
77
+ ![](images/c4fa5b58fc3c72e57f2561162589475d690facad7a6b70d5696869614ff77707.jpg)
78
+ Figure 2: Two of the building blocks that compose SNAIL architectures. (a) A dense block applies a causal 1D-convolution, and then concatenates the output to its input. A TC block (not pictured) applies a series of dense blocks with exponentially-increasing dilation rates. (b) A attention block performs a (causal) key-value lookup, and also concatenates the output to the input.
79
+
80
+ # 4 RELATED WORK
81
+
82
+ Pioneered by Schmidhuber (1987); Naik & Mammone (1992); Thrun & Pratt (1998), meta-learning is not a new idea. A key tradeoff central to many recent meta-learning approaches is between performance and generality; we discuss several notable methods and how they fit into this paradigm.
83
+
84
+ Graves et al. (2014) investigated the use of recurrent neural networks (RNNs) to solve algorithmic tasks. They experimented with a meta-learner implemented by an LSTM, but their results suggested that LSTM architectures are ill-equipped for these kinds of tasks. They then designed a more sophisticated RNN architecture, where an LSTM controller was coupled to an external memory bank from which it can read and write, and demonstrated that these memory-augmented neural networks (MANNs) achieved substantially better performance than LSTMs. Santoro et al. (2016) evaluated both LSTM and MANN meta-learners on few-shot image classification, and confirm the inadequacy of the LSTM architecture. These approaches are generic, but MANNs feature a complicated memoryaddressing architecture that is difficult to train – they still suffer from the same temporally-linear hidden-state dependencies as LSTMs.
85
+
86
+ In response, several approaches have demonstrated good performance in few-shot classification with specialized neural network architectures. Koch (2015) used a Siamese network that was trained to predict whether two images belong to the same class. Vinyals et al. (2016) learned an embedding function and used cosine distance in an attention kernel to judge image similarity. Snell et al. (2017) employed a similar approach to Vinyals et al. (2016), based on Euclidean distance metrics. All three methods work well within the context of classification, but are not readily applicable to other domains, such as reinforcement learning. They perform well because their architectures have been designed to exploit domain knowledge, but ideally we would like a meta-learner that is not constrained to a particular problem type.
87
+
88
+ A number of methods consider a meta-learner that makes updates to the parameters of a traditional learner (Bengio et al., 1992; Hochreiter et al., 2001). Andrychowicz et al. (2016) and Li & Malik (2017) investigated the setting of learning to optimize, where the learner is an objective function to minimize, and the meta-learner uses the gradients of the learner to perform the optimization. Their meta-learner was implemented by an LSTM and the strategy that it learned can be interpreted as a gradient-based optimization algorithm; however, it is unclear whether the learned optimizers are substantially better than existing SGD-based methods.
89
+
90
+ Ravi & Larochelle (2017) extended this idea, using a similar LSTM meta-learner in a few-shot classification setting, where the traditional learner was a convolutional-network-based classifier. In this setting, the meta-learning algorithm is decomposed into two parts: the traditional learner’s initial parameters are trained to be suitable for fast gradient-based adaptation; the LSTM meta-learner is trained to be an optimization algorithm adapted for meta-learning tasks. Finn et al. (2017) explored a special case where the meta-learner is constrained to use ordinary gradient descent to update the learner and showed that this simplified model (known as MAML) can achieve equivalent performance. Munkhdalai & Yu (2017) explored a more sophisticated weight update scheme that yielded minor performance improvements on few-shot classification.
91
+
92
+ All of the methods discussed in the previous paragraph have the benefit of being domain independent, but they explicitly encode a particular strategy for the meta-learner to follow (namely, adaptation via gradient descent at test time). In a particular domain, there may exist better strategies that exploit the structure of the task, but gradient-based methods will be unable to discover them. In contrast, SNAIL presents an alternative paradigm where a generic architecture has the capacity to learn an algorithm that exploits domain-specific task structure.
93
+
94
+ Duan et al. (2016) and Wang et al. (2016) both investigated meta-learning in reinforcement-learning domains using traditional RNN architectures (GRUs and LSTMs). In addition, Finn et al. (2017) experimented with fast adaptation of policies in continuous control, where the meta-learner was trained on a distribution of closely-related locomotion tasks. In Section 5.2, we benchmark SNAIL against MAML and an LSTM-based meta-learner on the tasks considered by these works.
95
+
96
+ # 5 EXPERIMENTS
97
+
98
+ Our experiments were designed to investigate the following questions:
99
+
100
+ • How does SNAIL’s generality affect its performance on a range of meta-learning tasks? • How does its performance compare to existing approaches that are specialized to a particular task domain, or have elements of a high-level strategy already built-in? • How does SNAIL scale with high-dimensional inputs and long-term temporal dependencies?
101
+
102
+ # 5.1 FEW-SHOT IMAGE CLASSIFICATION
103
+
104
+ In the few-shot classification setting, we wish to classify data points into $N$ classes when we only have a small number $( K )$ of labeled examples per class. A meta-learner is readily applicable, because it learns how to compare input points, rather than memorize a specific mapping from points to classes.
105
+
106
+ The Omniglot and mini-ImageNet datasets for few-shot image classification are the standard benchmarks in supervised meta-learning. Introduced by Lake et al. (2011), Omniglot consists of blackand-white images of handwritten characters gathered from 50 languages, for a total of 1632 different classes with 20 instances per class. Like prior works, we downsampled the images to $2 8 \times 2 8$ and randomly selected 1200 classes for training and 432 for testing. We performed the same data augmentation proposed by Santoro et al. (2016), forming new classes by rotating each member of an existing class by a multiple of 90 degrees.
107
+
108
+ Mini-ImageNet is a more difficult benchmark; a subset of the well-known ImageNet dataset, it consists of $8 4 \times 8 4$ color images from 100 different classes with 600 instances per class. We used the split released by Ravi & Larochelle (2017) and used by a number of other works, with 64 classes for training, 16 for validation, and 20 for testing.
109
+
110
+ To evaluate a SNAIL on the $N$ -way, $K$ -shot problem, we sample $N$ classes from the overall dataset and $K$ examples of each class. We then feed the corresponding $N K$ example-label pairs to the SNAIL in a random order, followed by a new, unlabeled example from one of the $N$ classes. We report the average accuracy on this last, $( N K + 1 )$ -th timestep.
111
+
112
+ We tested SNAIL on 5-way Omniglot, 20-way Omniglot, and 5-way mini-ImageNet. For each of these three splits, we trained the SNAIL on episodes where the number of shots $K$ was chosen uniformly at random from 1 to 5 (note that this is unlike prior works, who train separate models for each shot). For a $K$ -shot episode within an $N$ -way problem, the loss was simply the average cross-entropy between the predicted and true label on the $( N K + 1 )$ -th timestep. We train both the SNAIL and the feature-extracting embedding network in an end-to-end fashion using Adam (Kingma & Ba, 2015) For a complete description of the specifics SNAIL and embedding architectures we used, we refer the reader to Appendix A.
113
+
114
+ Table 1 displays our results on 5-way and 20-way Omniglot, and Table 2 respectively for 5-way mini-ImageNet. We see that SNAIL outperforms state-of-the-art methods that are extensively handdesigned, and/or domain-specific. It significantly exceeds the performance of methods such as Santoro et al. (2016) that are similarly simple and generic. In Appendix B, we conduct a number of ablations to analyse SNAIL’s performance.
115
+
116
+ Table 1: 5-way and 20-way, 1-shot and 5-shot classification accuracies on Omniglot, with $9 5 \%$ confidence intervals where available. For each task, the best-performing method is highlighted, along with any others whose confidence intervals overlap.
117
+
118
+ <table><tr><td rowspan=1 colspan=4>Method 5-Way Omniglot 20-Way Omniglot</td></tr><tr><td rowspan=1 colspan=1>1-shot</td><td rowspan=1 colspan=1>5-shot</td><td rowspan=1 colspan=1>1-shot</td><td rowspan=1 colspan=1>5-shot</td></tr><tr><td rowspan=1 colspan=1>Santoro et al. (2016) 82.8%Koch (2015) 97.3%Vinyals et al. (2016) 98.1%Finn et al. (2017) 98.7% ± 0.4%Snell et al. (2017) 97.4%Munkhdalai &amp; Yu (2017) 98.9%</td><td rowspan=1 colspan=1>94.9%98.4%98.9%99.9% ± 0.3%99.3%1</td><td rowspan=1 colspan=1>188.2%93.8%95.8%± 0.3%96.0%97.0%</td><td rowspan=1 colspan=1>197.0%98.5%98.9%± 0.2%98.9%1</td></tr><tr><td rowspan=1 colspan=1>SNAIL, Ours 99.07 % ± 0.16%</td><td rowspan=1 colspan=1>99.78% ± 0.09%</td><td rowspan=1 colspan=1>97.64% ± 0.30%</td><td rowspan=1 colspan=1>99.36% ± 0.18%</td></tr></table>
119
+
120
+ Table 2: 5-way, 1-shot and 5-shot classification accuracies on mini-ImageNet, with $9 5 \%$ confidence intervals where available. For each task, the best-performing method is highlighted, along with any others whose confidence intervals overlap.
121
+
122
+ <table><tr><td>Method</td><td colspan="2">5-Way Mini-ImageNet</td></tr><tr><td></td><td>1-shot</td><td>5-shot</td></tr><tr><td>Vinyals et al. (2016) Finn et al. (2017)</td><td>43.6%</td><td>55.3%</td></tr><tr><td></td><td>48.7% ± 1.84%</td><td>63.1% ± 0.92%</td></tr><tr><td>Ravi &amp; Larochelle (2017)</td><td>43.4% ± 0.77%</td><td>60.2% ± 0.71%</td></tr><tr><td>Snell et al. (2017)</td><td>46.61% ± 0.78%</td><td>65.77% ± 0.70%</td></tr><tr><td>Munkhdalai &amp; Yu (2017)</td><td>49.21% ± 0.96%</td><td></td></tr><tr><td>SNAIL, Ours</td><td>55.71% ± 0.99%</td><td>68.88% ± 0.92%</td></tr></table>
123
+
124
+ # 5.2 REINFORCEMENT LEARNING
125
+
126
+ Reinforcement learning features a number of challenges that supervised learning does not, including long-term temporal dependencies (as the experienced states and rewards may depend on actions taken many timesteps ago) as well as balancing exploration and exploitation. To explore SNAIL‘s ability to learn RL algorithms, we evaluate it on four different domains from prior work in meta-RL1:
127
+
128
+ • Multi-armed bandits (Duan et al., 2016; Wang et al., 2016): the agent interacts with a set of arms whose reward distributions are unknown. Although its actions do not affect its state, exploration and exploitation are both essential: an optimal agent must initially explore by sampling different arms, but later exploit its knowledge by repeatedly selecting the best arm. Tabular MDPs (Duan et al., 2016; Wang et al., 2016): we procedurally generate random MDPs and allow the agent to act within each one for multiple episodes. Since every MDP is different, a meta-learner cannot simply memorize the ones it is trained on; it must actually learn an algorithm for solving MDPs. • Visual navigation (Duan et al., 2016; Wang et al., 2016): the agent must navigate randomlygenerated mazes to find a randomly-located goal, using only visual observations as input. It is allowed to interact with the same maze/goal configuration for two episodes, so an optimal agent should explore the maze on the first episode to find the goal, and then go directly to the goal on the second episode. This task features many of the common challenges in deep RL, including high-dimensional observations, partial observability, and sparse rewards. Continuous control (Finn et al., 2017): we consider a suite of simulated locomotion tasks. Although the environment dynamics are complex, the underlying task distribution is quite narrow. As a result, there is significant task structure for a meta-learner to exploit; the optimal strategy is closer to task-identification than a true RL algorithm.
129
+
130
+ On each of these domains, we trained a SNAIL, along with two meta-learning baselines:
131
+
132
+ • An LSTM-based meta-learner, as concurrently proposed by Duan et al. (2016); Wang et al. (2016). We refer to this method as “LSTM" in the tables and figures in subsequent sections. • MAML, the method introduced by Finn et al. (2017). It trains the initial parameters of a policy to achieve maximal performance after one (policy) gradient update on a new task.
133
+
134
+ We also conducted some ablation experiments, which are detailed in Appendix D.
135
+
136
+ In all domains, we trained the meta-learners using trust region policy optimization with generalized advantage estimation (TRPO with GAE; Schulman et al. (2015; 2016)); the SNAIL architectures and TRPO/GAE hyperparameters are detailed in Appendix C.
137
+
138
+ In the bandit and MDP domains, there exist a number of human-designed algorithms with various optimality guarantees (which we discuss in more depth in the subsequent sections). Although there isn’t much task structure for a meta-learner to exploit, the existence of upper bounds on asymptotic performance let us evaluate the optimality of a meta-learned algorithm.
139
+
140
+ However, the true utility of a meta-learner is that it can learn an algorithm specialized to the particular distribution of tasks it is trained on. We evaluate this in the visual navigation and continuous control domains, where there is significant task structure for the meta-learner to exploit, but no optimal algorithms are known to exist due to the task complexity.
141
+
142
+ # 5.2.1 MULTI-ARMED BANDITS
143
+
144
+ In our bandit experiments (styled after Duan et al. (2016)), each of $K$ arms gives rewards according to a Bernoulli distribution whose parameter $p \in [ 0 , 1 ]$ is chosen randomly at the start of each episode of length $N$ . At each timestep, the meta-learner receives previous timestep’s reward, along with a one-hot encoding of the corresponding arm selected. It outputs a discrete probability distribution over the $K$ arms; the selected arm is determined by sampling from this distribution.
145
+
146
+ As an oracle, we consider the Gittins index (Gittins, 1979), the Bayes optimal solution in the discounted, infinite horizon setting. Since it is only optimal as $N \infty$ , a meta-learner can outperform it for smaller $N$ by choosing to exploit sooner.
147
+
148
+ Following Duan et al. (2016), we tested all combinations of $N = 1 0$ , 100, 500 and $K = 5 , 1 0 , 5 0$ We also tested the additional case of $N = 1 0 0 0$ , $K = 5 0$ to further evaluate the scalability of SNAIL to longer sequences. We report the mean reward per episode for each setting; the results are given in Table 3 with $9 5 \%$ confidence intervals where available. We found that training MAML was too computationally expensive for $N = 5 0 0$ , 1000; hence we omit those results from Table 3.
149
+
150
+ Table 3: Results on multi-arm bandit problems. For each, we highlighted the best performing method, and any others whose performance is not statistically-significantly different (based on a one-sided $t$ -test with $p = 0 . 0 5$ ). Except for SNAIL and MAML, we report the results from Duan et al. (2016).
151
+
152
+ <table><tr><td rowspan="2">Setup (N,K)</td><td colspan="5">Method</td></tr><tr><td>Gittins (optimal as N → )</td><td>Random</td><td>LSTM</td><td>MAML</td><td>SNAIL (ours)</td></tr><tr><td>10,5</td><td>6.6</td><td>5.0</td><td>6.7</td><td>6.5 ± 0.1</td><td>6.6 ± 0.1</td></tr><tr><td>10,10</td><td>6.6</td><td>5.0</td><td>6.7</td><td>6.6 ± 0.1</td><td>6.7 ± 0.1</td></tr><tr><td>10,50</td><td>6.5</td><td>5.1</td><td>6.8</td><td>6.6 ± 0.1</td><td>6.7 ± 0.1</td></tr><tr><td>100,5</td><td>78.3</td><td>49.9</td><td>78.7</td><td>67.1 ± 1.1</td><td>79.1 ± 1.0</td></tr><tr><td>100,10</td><td>82.8</td><td>49.9</td><td>83.5</td><td>70.1 ± 0.6</td><td>83.5 ± 0.8</td></tr><tr><td>100,50</td><td>85.2</td><td>49.8</td><td>84.9</td><td>70.3 ± 0.4</td><td>85.1 ± 0.6</td></tr><tr><td>500,5</td><td>405.8</td><td>249.8</td><td>401.5</td><td></td><td>408.1 ± 4.9</td></tr><tr><td>500,10</td><td>437.8</td><td>249.0</td><td>432.5</td><td></td><td>432.4 ± 3.5</td></tr><tr><td>500,50</td><td>463.7</td><td>249.6</td><td>438.9</td><td></td><td>442.6 ± 2.5</td></tr><tr><td>1000,50</td><td>944.1</td><td>499.8</td><td>847.43</td><td></td><td>889.8 ± 5.6</td></tr></table>
153
+
154
+ # 5.2.2 TABULAR MDPS
155
+
156
+ In our tabular MDP experiments (also following Duan et al. (2016)), each MDP had 10 states and 5 actions (both discrete); the reward for each (state, action)-pair followed a normal distribution with unit variance where the mean was sampled from $\mathcal { N } ( 1 , 1 )$ , and the transitions are sampled from a flat Dirichlet distribution (the latter is a commonly used prior in Bayesian RL) with random parameters. We allowed each meta-learner to interact with an MDP for $N$ episodes of length 10. As input, they received one-hot encodings of the current state and previous action, the previous reward received, and a binary flag indicating termination of the current episode.
157
+
158
+ In addition to a random agent, we consider the follow human-designed algorithms as baselines.
159
+
160
+ • PSRL (Strens, 2000): a Bayesian method that estimate the belief over the current MDP parameters. At the start of each of the $N$ episodes, it samples an MDP from the current posterior, and acts according to the optimal policy for the rest of the episode.
161
+ • OPSRL (Osband & Van Roy, 2017): an optimistic variant of PSRL.
162
+ • UCRL2 (Jaksch et al., 2010): uses an extended value iteration procedure to compute an optimistic MDP under the current belief.
163
+ • $\epsilon$ -greedy: with probability $1 - \epsilon$ , act optimally against the MAP estimate according to the current posterior (which is updated once per episode).
164
+
165
+ As an oracle, we run value iteration for 10 iterations (the episode length) on each MDP. Value iteration is optimal when the MDP parameters (reward function, transition probabilities) are known; thus, the resulting values provide an upper bound on the performance of any algorithm, whether human-designed or meta-learned (which do not receive the MDP parameters).
166
+
167
+ We tested $N = 1 0$ , 25, 50, 75, 100; in Table 4, we report the performance normalized by the valueiteration upper bound. As $N$ increases, performance should approach 1, as the algorithm learns more about the current MDP. Similarly to the bandit experiments, we could not train MAML successfully for $N = 5 0 , 7 5 , 1 0 0 .$ In Figure 3, we show learning curves of SNAIL and LSTM.
168
+
169
+ ![](images/435809045b71532f0f113581eabca8bc204d2386caab73c0ca2e4591c5d38d8c.jpg)
170
+ Figure 3: Learning curves of SNAIL (red) and LSTM (blue) on the random MDP task for different values of $N$ . The horizontal axis is the TRPO iteration, and the vertical is average reward.
171
+
172
+ Table 4: Performance on tabular MDPs, scaled by the average reward achieved by value iteration. As before, we highlight the best-performing method, and any others whose performance is not statistically-significantly different (using the same one-sided $t { \cdot }$ -test with $p = 0 . 0 5$ ). Except for SNAIL and MAML, we report the values from Duan et al. (2016).
173
+
174
+ <table><tr><td>N</td><td colspan="8">Method</td></tr><tr><td></td><td>Random</td><td> E-greedy</td><td>PSRL</td><td>OPSRL</td><td>UCRL2</td><td>LSTM</td><td>MAML</td><td>SNAIL (ours)</td></tr><tr><td>10</td><td>0.482</td><td>0.640</td><td>0.665</td><td>0.694</td><td>0.706</td><td>0.752</td><td>0.563</td><td>0.766 ± 0.001</td></tr><tr><td></td><td>0.482</td><td>0.727</td><td>0.788</td><td>0.819</td><td>0.817</td><td>0.859</td><td>0.591</td><td>0.862 ± 0.001</td></tr><tr><td>50</td><td>0.481</td><td>0.793</td><td>0.871</td><td>0.897</td><td>0.885</td><td>0.902</td><td>1</td><td>0.908 ± 0.003</td></tr><tr><td>75</td><td>0.482</td><td>0.831</td><td>0.910</td><td>0.931</td><td>0.917</td><td>0.918</td><td></td><td>0.930 ± 0.002</td></tr><tr><td>100</td><td>0.481</td><td>0.857</td><td>0.934</td><td>0.951</td><td>0.936</td><td>0.922</td><td>1</td><td>0.941 ± 0.003</td></tr></table>
175
+
176
+ # 5.2.3 CONTINUOUS CONTROL
177
+
178
+ We consider the set of tasks introduced by Finn et al. (2017), in which two simulated robots (a planar cheetah and a 3D-quadruped ant) have to run in a particular direction or at a specified velocity (the direction or velocity are chosen randomly and not told to the agent). In the goal direction experiments, the reward is the magnitude of the robot’s velocity in either the forward or backward direction, and in the goal velocity experiments, the reward is the negative absolute value between its current forward velocity and the goal. The observations are the robot’s joint angles and velocities, and the actions are its joint torques. For each of these four task distributions ({ant, cheetah $1 \} \times \ \{ \mathrm { g o a l } \ $ velocity, goal direction}), Finn et al. (2017) trained a policy to maximize its performance after one policy gradient update using 20 episodes (40 for ant), of 200 timesteps each, on a newly sampled task.
179
+
180
+ We trained both SNAIL and LSTM on each of these four task categories. Since they do not update their parameters at test time (instead incorporating experience through their hidden state), SNAIL and LSTM receive as input the previous action, previous reward, and an episode-termination flag in addition to the current observation. We found that two episodes of interaction was sufficient for these meta-learners to adapt to a task, and that unrolling them for longer did not improve performance.
181
+
182
+ In Figure 4, we show how the different methods adapt to a new task. As an oracle, we sampled tasks from each distribution, and trained a separate policy for each task. We plot the average performance of the oracle policies for each task distribution as an upper bound on a meta-learner’s performance.
183
+
184
+ Qualitatively, we can think of MAML as applying a general-purpose strategy (namely, gradient descent) to a distribution of highly-structured tasks. In contrast, SNAIL and LSTM are able to specialize themselves based on the shared task structure, enabling them to identify the task within the initial timesteps of the first episode, and then act optimally thereafter.
185
+
186
+ ![](images/a9dcffcf48385c66ff08f4c1d2e0a75de0b65229b45843c55499c766c7f72c59.jpg)
187
+ Figure 4: Test-time adaptation curves on simulated locomotion tasks for SNAIL, LSTM, and MAML (which was unrolled for three policy gradient updates). Since SNAIL incorporates experience through its hidden state, it can exploit common task structure to perform optimally within a few timesteps.
188
+
189
+ # 5.2.4 VISUAL NAVIGATION
190
+
191
+ Both Duan et al. (2016) and Wang et al. (2016) consider the task of visual navigation, where the agent must find a target in a maze using only visual inputs. The former used randomly-generated mazes and target positions, while the latter used a fixed maze and only four different target positions. Hence, we evaluated SNAIL on the former, more challenging task. The observations the agent receives are
192
+
193
+ $3 0 \times 4 0$ first-person images, and the actions it can take are {step forward, turn slightly left, turn slightly right}. We constructed a training dataset and two test datasets (unseen mazes of the same and larger size, respectively), each with 1000 mazes. The agents were allowed to interact with each maze for 2 episodes, with episode length 250 (1000 in the larger mazes). The starting and goal locations were chosen randomly for each trial but remained fixed within each pair of episodes. The agents received rewards of $+ 1$ for reaching the target (which resulted in the episode terminating), -0.01 at each timestep, to encourage it to reach the goal faster, and -0.001 for hitting the wall. Figure 5 depicts an example of the observations as well as sample maze layouts.
194
+
195
+ We evaluate each method using the average episode length, for both the first and second episode within a trial. The results are displayed in Table 5. Since MAML scaled poorly to long sequences in the bandit and MDP domains, we did not evaluate it on this domain; the computational expense was prohibitively high. Qualitatively, we observe that the optimal strategy does indeed emerge: the SNAIL agent explores the maze during the first episode, and then, after finding the goal, goes directly there on the second episode (the LSTM agent also exhibits this behavior, but has a harder time remembering where the goal is). An illustration is depicted in Figure 5.
196
+
197
+ Table 5: Average time to find the goal on each episode in the small and large mazes. SNAIL solves the mazes the fastest, and improves the most from the first to second episode.
198
+
199
+ <table><tr><td rowspan="2">Method</td><td colspan="2">Small Maze</td><td colspan="2">Large Maze</td></tr><tr><td>Episode 1</td><td>Episode 2</td><td>Episode 1</td><td>Episode 2</td></tr><tr><td>Random</td><td>188.6 ± 3.5</td><td>187.7 ± 3.5</td><td>420.2 ± 1.2</td><td>420.8 ±1.2</td></tr><tr><td>LSTM</td><td>52.4 ± 1.3</td><td>39.1 ± 0.9</td><td>180.1 ± 6.0</td><td>150.6 ± 5.9</td></tr><tr><td>SNAIL (ours)</td><td>50.3 ± 0.3</td><td>34.8 ± 0.2</td><td>140.5 ± 4.2</td><td>105.9 ± 2.4</td></tr></table>
200
+
201
+ ![](images/d5a99e30bac98c276e57d37015a8c7b0b4ff6eb86cdbef0008288dc0447150d9.jpg)
202
+ Figure 5: From left to right: (a) A (higher-resolution) example of the observations the agent receives. (b) An example of the mazes used for training (goal shown in blue). (c) The movement of the SNAIL on its first episode in a larger maze, exploring the maze until it finds the goal. (d) The SNAIL’s path during its second episode in the same maze as (c). Remembering the goal location, it navigates there directly on the second episode. Maps like in (b), (c), (d) are used for visualization but not available to the agent. In (c), (d), the color progression from red to blue indicates the passage of time (red earlier).
203
+
204
+ # 6 CONCLUSION AND FUTURE WORK
205
+
206
+ We presented a simple and generic class of architectures for meta-learning, motivated by the need for a meta-learner to quickly incorporate and refer to past experience. Our simple neural attentive learner (SNAIL) utilizes a novel combination of temporal convolutions and causal attention, two building blocks of sequence-to-sequence models that have complementary strengths and weaknesses. We demonstrate that SNAIL achieves state-of-the-art performance by significant margins on all of the most-widely benchmarked meta-learning tasks in both supervised and reinforcement learning, without relying on any application-specific architectural components or algorithmic priors.
207
+
208
+ Although we designed SNAIL with meta-learning in mind, it would likely excel at other sequence-to sequence tasks, such as language modeling or translation; we plan to explore this in future work.
209
+
210
+ Another interesting idea would be to train an meta-learner that can attend over its entire lifetime of experience (rather than only a few recent episodes, as in this work). An agent with this lifelong memory could learn faster and generalize better; however, to keep the computational requirements practical, it would also need to learn how to decide what experiences are worth remembering.
211
+
212
+ # REFERENCES
213
+
214
+ Marcin Andrychowicz, Misha Denil, Sergio Gomez, Matthew W Hoffman, David Pfau, Tom Schaul, and Nando de Freitas. Learning to learn by gradient descent by gradient descent. In Advances in Neural Information Processing Systems (NIPS), 2016.
215
+
216
+ Samy Bengio, Yoshua Bengio, Jocelyn Cloutier, and Jan Gecsei. On the optimization of a synaptic learning rule. In Optimality in Artificial and Biological Neural Networks, pp. 6–8. Univ. of Texas, 1992.
217
+
218
+ Yan Duan, John Schulman, Xi Chen, Peter L. Bartlett, Ilya Sutskever, and Pieter Abbeel. $\mathbf { R } 1 \$ 23$ : Fast reinforcement learning via slow reinforcement learning. arXiv preprint arXiv:1611.02779, 2016.
219
+
220
+ Chelsea Finn, Pieter Abbeel, and Sergy Levine. Model-agnostic meta learning. International Conference on Machine Learning (ICML), 2017.
221
+
222
+ J.C. Gittins. Bandit processes and dynamic allocation indices. Journal of the Royal Statistical Society. Series B (Methodological), 1979.
223
+
224
+ Alex Graves, Greg Wayne, and Ivo Danihelka. Neural turing machines. arXiv preprint arXiv:1410.5401, 2014.
225
+
226
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Conference on Computer Vision and Pattern Recognition (CVPR), 2016.
227
+
228
+ Sepp Hochreiter, A Younger, and Peter Conwell. Learning to learn using gradient descent. Artificial Neural Networks, ICANN, 2001.
229
+
230
+ Gao Huang, Zhuang Liu, Kilian Q Weinberger, and Laurens van der Maaten. Densely connected convolutional networks. arXiv preprint arXiv:1608.06993, 2016.
231
+
232
+ Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. International Conference on Machine Learning (ICML), 2015.
233
+
234
+ Thomas Jaksch, Ronald Ortner, and Peter Auer. Near-optimal regret bounds for reinforcement learning. Journal of Machine Learning Research, 2010.
235
+
236
+ Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015.
237
+
238
+ Gregory Koch. Siamese neural networks for one-shot image recognition. PhD thesis, University of Toronto, 2015.
239
+
240
+ Brenden M Lake, Ruslan Salakhutdinov, Jason Gross, and Joshua B Tenenbaum. One shot learning of simple visual concepts. In CogSci, 2011.
241
+
242
+ Ke Li and Jitendra Malik. Learning to optimize. International Conference on Learning Representations (ICLR), 2017.
243
+
244
+ Tsendsuren Munkhdalai and Hong Yu. Meta networks. International Conference on Machine Learning (ICML), 2017.
245
+
246
+ Devang K Naik and RJ Mammone. Meta-neural networks that learn by learning. In Neural Networks, 1992. IJCNN., International Joint Conference on, volume 1, pp. 437–442. IEEE, 1992.
247
+
248
+ Ian Osband and Benjamin Van Roy. Why is posterior sampling better than optimism for reinforcement learning. International Conference on Machine Learning (ICML), 2017.
249
+
250
+ Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. In International Conference on Learning Representations (ICLR), 2017.
251
+
252
+ Adam Santoro, Sergey Bartunov, Matthew Botvinick, Daan Wierstra, and Timothy Lillicrap. Metalearning with memory-augmented neural networks. In International Conference on Machine Learning (ICML), 2016.
253
+
254
+ Jurgen Schmidhuber. Evolutionary principles in self-referential learning. On learning how to learn: The meta-meta-... hook.) Diploma thesis, Institut f. Informatik, Tech. Univ. Munich, 1987.
255
+
256
+ John Schulman, Sergey Levine, Philipp Moritz, Michael Jordan, and Pieter Abbeel. Trust region policy optimization. International Conference on Machine Learning (ICML), 2015.
257
+
258
+ John Schulman, Philipp Moritz, Sergey Levine, Michael Jordan, and Pieter Abbeel. High-dimensional continuous control using generalized advantage estimation. International Conference on Learning Representations (ICLR), 2016.
259
+
260
+ Jake Snell, Kevin Swersky, and Richard S Zemel. Prototypical networks for few-shot learning. arXiv preprint arXiv:1703.05175, 2017.
261
+
262
+ Malcolm Strens. A bayesian framework for reinforcement learning. In International Conference on Machine Learning (ICML), 2000.
263
+
264
+ Sebastian Thrun and Lorien Pratt. Learning to learn: Introduction and overview. In Learning to learn. Springer, 1998.
265
+
266
+ Aaron van den Oord, Sander Dieleman, Heig Zen, Karen Simonyan, Oriol Vinyals, Alex Graves, Nal Kalchbrenner, Andrew W. Senior, and Koray Kavukcuoglu. Wavenet: A generative model for raw audio. CoRR, abs/1609.03499, 2016a.
267
+
268
+ 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 (NIPS), 2016b.
269
+
270
+ Ashish Vaswani, Noah Shazeer, Jakob Uszkoreit, Llion Jones, Aidan Gomez N., Lukas Kaiser, and Illia Polosukhin. Attention is all you need. arXiv preprint arXiv:1706.03762, 2017a.
271
+
272
+ 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, 2017b.
273
+
274
+ Oriol Vinyals, Charles Blundell, Tim Lillicrap, Daan Wierstra, et al. Matching networks for one shot learning. In Advances in Neural Information Processing Systems (NIPS), 2016.
275
+
276
+ Jane X Wang, Zeb Kurth-Nelson, Dhruva Tirumala, Hubert Soyer, Joel Z Leibo, Remi Munos, Charles Blundell, Dharshan Kumaran, and Matt Botvinick. Learning to reinforcement learn. arXiv preprint arXiv:1611.05763, 2016.
277
+
278
+ # APPENDIX
279
+
280
+ # A FEW-SHOT CLASSIFICATION ARCHITECTURES
281
+
282
+ With the building blocks defined in Section 3.1, we can concisely describe SNAIL architectures. We used the same SNAIL architecture for both Omniglot and mini-Imagenet. For the $N$ -way, $K$ -shot problem, the sequence length is $T = N K + 1$ , and we used the following: AttentionBlock(64, 32), TCBlock $( T , 1 2 8 )$ , AttentionBlock(256, 128), TCBlock $T _ { \star }$ , 128), AttentionBlock(512, 256), followed by a final $1 \times 1$ convolution with $N$ filters.
283
+
284
+ For the Omniglot dataset, we used the same embedding network architecture as all prior works, which repeat the following block four times { 3x3 conv (64 channels), batch norm, ReLU, 2x2 max pool }, and then apply a single fully-connected layer to output a 64-dimensional feature vector.
285
+
286
+ For mini-Imagenet, existing gradient-descent-based methods (Ravi & Larochelle, 2017; Finn et al., 2017), which update their model’s weights during testing, used the same network structure as the Omniglot network but reduced the number of channels to 32, in spite of the significantly-increased complexity of the images. We found that this shallow embedding network did not make adequate use of SNAIL’s expressive capacity, and opted to to use a deeper embedding network to prevent underfitting (in Appendix B, we conduct ablations regarding this decision). Illustrated in Figure 6, our embedding was a smaller version of the ResNet (He et al., 2016) architectures commonly used for the full Imagenet dataset.
287
+
288
+ ![](images/b4008e5ff9af10355b10875b51288cdb66ad94de985e34be0a888fffe163d1c7.jpg)
289
+ (a) Residual Block, D lters
290
+ Figure 6: (a) A residual block within our mini-Imagenet embedding. (b) The embedding, a smaller version of ResNet (He et al., 2016), uses several of the residual blocks depicted in (a).
291
+
292
+ # B FEW-SHOT CLASSIFICATION: ABLATIONS
293
+
294
+ To investigate the contribution of different components (TC, attention, and deeper embedding in the case of mini-Imagenet) to SNAIL’s performance, we conducted a number of ablations, which are summarized in Table 6. From these ablations, we draw two conclusions:
295
+
296
+ • Both TC and attention layers are essential for maximal performance. When we remove either one, the resulting model is still competitive with other state-of-the-art methods, but the combination yields the best performance. Notably, compared to the full model, using only TC layers results in similar 1-shot performance but worse 5-shot. In Section 3 we discussed how temporal convolutions have coarser access to inputs farther back in time; this illustrates that this effect is relevant even at sequence length 26. SNAIL’s improved performance is not purely a result of the deeper embedding network. Gradient-based methods (we tested MAML; Finn et al. (2017)) overfit significantly when they use our embedding, and domain-specific RNN-based methods (Vinyals et al., 2016) don’t utilize the extra capacity as well as SNAIL does.
297
+
298
+ Table 6: The ablations we conducted on the few-shot classification task. From these, we conclude that (i) both TC and attention are essential for the best performance, and (ii) SNAIL‘s improved performance cannot be entirely explained by the deeper embedding.
299
+
300
+ <table><tr><td rowspan=1 colspan=1>Ablation</td><td rowspan=1 colspan=1>Result</td></tr><tr><td rowspan=1 colspan=1>Replace SNAIL with stacked LSTM.Varied number of layers and their sizes(with similar number of parameters toSNAIL).</td><td rowspan=1 colspan=1>5-way Omniglot: 78.1% and 90.8% (1-shot, 5-shot).We were unable to successfully train this method on mini-Imagenet.</td></tr><tr><td rowspan=1 colspan=1>SNAIL with shallow mini-Imagenet em-bedding.</td><td rowspan=1 colspan=1> 5-way mini-Imagenet: 45.1% and 55.2% (1-shot, 5-shot).</td></tr><tr><td rowspan=1 colspan=1>MAML (Finn et al., 2017),a state-of-the-art gradient-based method, with ourdeeper mini-Imagenet embedding.</td><td rowspan=1 colspan=1>It overfits tremendously; for 1-shot, 5-way mini-ImageNet:30.1% &amp; 75.2% on the test and training set respectively.MAML trains separate models for 1-shot and 5-shot; wedidn&#x27;t train a 5-shot model because the 1-shot did so poorly.</td></tr><tr><td rowspan=1 colspan=1>SNAIl, no TC layers (only attention).This is a generalization of the methodused by Vinyals et al. (2016),as theyonly use a single attentive read and ex-plicitly force the keys to be features ofthe image and the values to be the labels.We experimented with multiple paral-lel reads (often referred to as multipleheads) as well as up to three consecutiveattentive blocks.</td><td rowspan=1 colspan=1>On 5-way and 20-way Omniglot: equivalent performance tothe full model.5-way mini-Imagenet: 49.9% and 63.9% (1-shot, 5-shot).</td></tr><tr><td rowspan=1 colspan=1>SNAIL, no attention (TC layers only).</td><td rowspan=1 colspan=1>On 5-way Omniglot: 98.8% and 99.2% (1-shot, 5-shot).We were unable to train 2O-way Omniglot using this method.On 5-way mini-Imagenet: 55.1% and 61.2%.</td></tr></table>
301
+
302
+ In an attempt to analyse the learned feature representation, we tried using the features learned by the Omniglot embedding in a nearest-neighbor classifier, using both cosine and Euclidean distance. On 5-way Omniglot, this achieves $6 5 . 1 \%$ and $6 7 . 1 \%$ (1-shot and 5-shot) for Euclidean distance and $6 7 . 7 \%$ and $6 8 . 3 \%$ for cosine. Although SNAIL must be comparing images in order to successfully make few-shot predictions, this suggests that the strategy it learns is more sophisticated than either of these distance metrics. We contrast this with Vinyals et al. (2016) and Snell et al. (2017), who explicitly enforce such representations on the meta-learned strategy.
303
+
304
+ In addition, we investigated how sensitive SNAILs are to architectural design choices by sampling random permutations of the different components introduced in Section 3.1. We chose each component uniformly at random from six options: { AttentionBlock(128, 64), DenseBlock(R, 128) for $R \in \{ 1 , 2 , 4 , \mathrm { \dot { 8 } } , 1 6 \} \}$ . We sampled architectures with 13 layers each (for consistency with our primary model), and trained them on 5-way Omniglot. Averaged across 3 runs, these SNAILs achieved $9 8 . 6 2 \% \pm 0 . 1 3 \%$ and $9 9 . 7 1 \% \pm \hat { 0 . 0 8 \% }$ for 1-shot and 5-shot, essentially matching the state-of-the-art performance of our primary architecture.
305
+
306
+ Finally, we explored the dependence of the classification strategy learned by SNAIL on the dataset it was trained on. If it truly learned an algorithm for few-shot classification, then a SNAIL trained on images from a particular domain should easily transfer to a new domain (such as between Omniglot and mini-Imagenet). To test this hypothesis:
307
+
308
+ • First, we took a SNAIL trained on 5-way Omniglot, fixed its weights, and re-learned an embedding for mini-Imagenet. Despite the SNAIL weights not being trained for miniImagenet, this method was able to achieve $5 0 . 6 2 \%$ and $6 2 . 3 4 \%$ on 1-shot and 5-shot. • Then, we tried this in the reverse direction (freezing the SNAIL weights from mini-Imagenet, and re-learning an embedding for 5-way Omniglot), and this attained $9 8 . 6 6 \%$ and $9 9 . { \bar { 5 } } 6 \%$ . • Lastly, we combined an embedding trained on 5-way Omniglot with a SNAIL trained on 5-way mini-Imagenet (with a single linear layer in between, to handle the difference in feature vector dimensionality). We trained this model on 5-way Omniglot, where only the weights of the intermediate linear layer could be updated. It achieved ${ \bar { 9 } } 8 . 5 \%$ and $9 9 . 5 \%$ .
309
+
310
+ All of these results are very competitive with the state-of-the-art, suggesting a strong degree of transferability of the algorithm and feature representation learned by SNAIL. An interesting idea for future work in zero-shot learning would be to learn embeddings for multiple datasets in an unsupervised manner, but with some mild distributional constraints imposed on the output feature representation. Then, one could train a SNAIL on one dataset, and have it transfer to new datasets without a single labeled example.
311
+
312
+ # C REINFORCEMENT LEARNING
313
+
314
+ C.1 MULTI-ARMED BANDIT AND TABULAR MDP ARCHITECTURES
315
+
316
+ For the $N$ -timestep, $K$ -arm bandit problem, the total trajectory length is $T = N$ . For the MDP problem with $N$ episodes per MDP, it is $T = 1 0 N$ (since each episode lasts for 10 timesteps).
317
+
318
+ For multi-arm bandits and tabular MDPs, we used the same architecture. First, we applied a fullyconnected layer with 32 outputs that was shared between the policy and value function. Then the policy used: TCBlock $\mathbf { \mathcal { T } } , 3 2 )$ , TCBlock $( T , 3 2 )$ , AttentionBlock(32, 32). The value function used: TCBlock $( T , 1 6 )$ , TCBlock $( T , 1 6 )$ , AttentionBlock(16, 16).
319
+
320
+ We found that removing the attention blocks made no difference in performance on the bandit problems, whereas SNAILs without attention could not learn to solve MDPs.
321
+
322
+ # C.2 CONTINUOUS CONTROL ARCHITECTURES
323
+
324
+ For each simulation locomotion task, the total trajectory length was $T = 4 0 0$ (2 episodes of 200 timesteps each). We used the same architecture (shared between policy and value function) for all tasks: two fully-connected layers of size 256 with tanh nonlinearities, AttentionBlock(32, 32), TCBlock(T , 16), TCBlock(T , 16), AttentionBlock(32, 32). Then the policy and value function applied separate fully-connected layers to produce the requisite output dimensionalities.
325
+
326
+ # C.3 VISUAL NAVIGATION ARCHITECTURES
327
+
328
+ Unlike the other RL tasks we considered, the observations in this domain include images. We preprocess the images using the same convolutional architecture as Duan et al. (2016): two layers with {kernel size $5 \times 5$ , 16 filters, stride 2, ReLU nonlinearity}, whose output is then flattened and then passed to a fully-connected layer to produce a feature vector of size 256.
329
+
330
+ The total trajectory length was $T = 5 0 0$ (2 episodes of 250 timesteps each). For the policy, we used: TCBlock $( T , 3 2 )$ , AttentionBlock(16, 16), TCBlock(T , 32), AttentionBlock(16, 16). For the value function we used: TCBlock $( T , 1 6 )$ , TCBlock $( T , 1 6 )$ .
331
+
332
+ # C.4 ADDITIONAL REINFORCEMENT LEARNING HYPERPARAMETERS
333
+
334
+ As discussed in Section 5.2, we trained all policies using trust-region policy optimization with generalized advantage estimation (TRPO with GAE, Schulman et al. (2015; 2016)). The hyperparameters are listed in Table 7. For multi-armed bandits, tabular MDPs, and visual navigation, we used the same hyperparamters as Duan et al. (2016) to make our results directly comparable; additional tuning could potentially improve SNAIL’s performance.
335
+
336
+ Table 7: The TRPO $^ +$ GAE hyperparameters we used in our RL experiments.
337
+
338
+ <table><tr><td>Hyperparameter</td><td>Multi-armed Bandits</td><td>Tabular MDPs</td><td>Continuous Control</td><td>Visual Navigation</td></tr><tr><td>Batch Size (timesteps)</td><td>250K</td><td>250K</td><td>50K</td><td>50K</td></tr><tr><td>Discount</td><td>0.99</td><td>0.99</td><td>0.99</td><td>0.99</td></tr><tr><td>GAE 入</td><td>0.3</td><td>0.3</td><td>0.97</td><td>0.99</td></tr><tr><td>Mean KL</td><td>0.01</td><td>0.01</td><td>0.01</td><td>0.01</td></tr></table>
339
+
340
+ # D REINFORCEMENT LEARNING: ABLATIONS
341
+
342
+ Here we conduct a few ablations on RL tasks: we explore whether an agent relying only on TC layers or only on attention layers can solve the multi-armed bandit or MDP tasks from in Section 5.2.
343
+
344
+ First, we consider an SNAIL agent without attention layers (only TC layers, which amounts to a variant of the WaveNet architecture introduced by van den Oord et al. (2016a)).
345
+
346
+ When applied to the bandit domain, we found that this TC-only model performed just as well as a complete SNAIL. This is likely due to the simplicity of this task domain, as successful performance on bandit problems does not require maintaining a large memory of past experience. Indeed, many human designed algorithms (including the asymptotically optimal Gittins index) simply update running statistics at each timestep.
347
+
348
+ However, this model struggled in the MDP domain, where a more sophisticated algorithm is required. The results are in the table below (with those of a random agent, SNAIL, LSTM and MAML duplicated from Table 4 for reference). This agent’s asymptotic suboptimality suggests that its ability to internalize past experience is being saturated.
349
+
350
+ Table 8: Ablations of SNAIL in the MDP domain.
351
+
352
+ <table><tr><td>N</td><td colspan="5">Method</td></tr><tr><td></td><td>Random</td><td>LSTM</td><td>MAML</td><td>SNAIL</td><td>SNAIL, TC-only</td></tr><tr><td>10</td><td>0.482</td><td>0.752</td><td>0.563</td><td>0.766 ± 0.001</td><td>0.616 ±0.001</td></tr><tr><td>25</td><td>0.482</td><td>0.859</td><td>0.591</td><td>0.862 ± 0.001</td><td>0.684 ±0.001</td></tr><tr><td>50</td><td>0.481</td><td>0.902</td><td>1</td><td>0.908 ± 0.003</td><td>0.699 ±0.002</td></tr><tr><td>75</td><td>0.482</td><td>0.918</td><td></td><td>0.930 ± 0.002</td><td>0.726 ±0.002</td></tr><tr><td>100</td><td>0.481</td><td>0.922</td><td>1</td><td>0.941 ± 0.003</td><td>0.728 ±0.003</td></tr></table>
353
+
354
+ Next, we considered a SNAIL agent without TC layers (only attention). Due to the sequential nature of RL tasks, we employed the positional encoding proposed by Vaswani et al. (2017b). This model, which is equivalent to their Transformer architecture, could not solve the bandit or MDP tasks. In both domains, its performance was no better than random. To no avail, we experimented with multiple blocks of attention and multiple heads per block.
355
+
356
+ We hypothesize that this architecture’s inadequacy stems from the fact that pure attentive lookups cannot easily process sequential information. Despite their infinite receptive field, they cannot directly compare two adjacent timesteps (such as a single state-action-state transition) in the same way as a single convolution can. The TC layers are essential because they allow the agent to locally analyse contiguous parts of a sequence to produce a better contextual representation over which to attend.
parse/train/B1DmUzWAW/B1DmUzWAW_content_list.json ADDED
@@ -0,0 +1,1893 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "A SIMPLE NEURAL ATTENTIVE META-LEARNER ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 173,
8
+ 98,
9
+ 758,
10
+ 121
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Nikhil Mishra ∗ † Mostafa Rohaninejad∗ Xi Chen† UC Berkeley, Department of Electrical Engineering and Computer Science Embodied Intelligence {nmishra, rohaninejadm, c.xi, pabbeel}@berkeley.edu ",
17
+ "bbox": [
18
+ 184,
19
+ 143,
20
+ 684,
21
+ 205
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "ABSTRACT ",
28
+ "text_level": 1,
29
+ "bbox": [
30
+ 452,
31
+ 241,
32
+ 545,
33
+ 255
34
+ ],
35
+ "page_idx": 0
36
+ },
37
+ {
38
+ "type": "text",
39
+ "text": "Deep neural networks excel in regimes with large amounts of data, but tend to struggle when data is scarce or when they need to adapt quickly to changes in the task. In response, recent work in meta-learning proposes training a meta-learner on a distribution of similar tasks, in the hopes of generalization to novel but related tasks by learning a high-level strategy that captures the essence of the problem it is asked to solve. However, many recent meta-learning approaches are extensively hand-designed, either using architectures specialized to a particular application, or hard-coding algorithmic components that constrain how the meta-learner solves the task. We propose a class of simple and generic meta-learner architectures that use a novel combination of temporal convolutions and soft attention; the former to aggregate information from past experience and the latter to pinpoint specific pieces of information. In the most extensive set of meta-learning experiments to date, we evaluate the resulting Simple Neural AttentIve Learner (or SNAIL) on several heavily-benchmarked tasks. On all tasks, in both supervised and reinforcement learning, SNAIL attains state-of-the-art performance by significant margins. ",
40
+ "bbox": [
41
+ 232,
42
+ 257,
43
+ 766,
44
+ 463
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "1 INTRODUCTION ",
51
+ "text_level": 1,
52
+ "bbox": [
53
+ 176,
54
+ 474,
55
+ 336,
56
+ 489
57
+ ],
58
+ "page_idx": 0
59
+ },
60
+ {
61
+ "type": "text",
62
+ "text": "The ability to learn quickly is a key characteristic that distinguishes human intelligence from its artificial counterpart. Humans effectively utilize prior knowledge and experiences to learn new skills quickly. However, artificial learners trained with traditional supervised-learning or reinforcementlearning methods generally perform poorly when only a small amount of data is available or when they need to adapt to a changing task. ",
63
+ "bbox": [
64
+ 174,
65
+ 493,
66
+ 825,
67
+ 564
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "Meta-learning seeks to resolve this deficiency by broadening the learner’s scope to a distribution of related tasks. Rather than training the learner on a single task (with the goal of generalizing to unseen samples from a similar data distribution) a meta-learner is trained on a distribution of similar tasks, with the goal of learning a strategy that generalizes to related but unseen tasks from a similar task distribution. Traditionally, a successful learner discovers a rule that generalizes across data points, while a successful meta-learner learns an algorithm that generalizes across tasks. ",
74
+ "bbox": [
75
+ 174,
76
+ 565,
77
+ 825,
78
+ 648
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "Many recently-proposed meta-learning methods demonstrate improved performance at the expense of being hand-designed at either the architectural or algorithmic level. Some have been engineered with a particular application in mind, while others have aspects of a particular high-level strategy already built into them. However, the optimal strategy for an arbitrary range of tasks may not be obvious to the humans designing a meta-learner, in which case the meta-learner should have the flexibility to learn the best way to solve the tasks it is presented with. Such a meta-learner would need to have an expressive, versatile model architecture, in order to learn a range of strategies in a variety of domains. ",
85
+ "bbox": [
86
+ 174,
87
+ 650,
88
+ 825,
89
+ 747
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "text",
95
+ "text": "Meta-learning can be formalized as a sequence-to-sequence problem; in existing approaches that adopt this view, the bottleneck is in the meta-learner’s ability to internalize and refer to past experience. Thus, we propose a class of model architectures that addresses this shortcoming: we combine temporal convolutions, which enable the meta-learner to aggregate contextual information from past experience, with causal attention, which allow it to pinpoint specific pieces of information within that context. We evaluate this Simple Neural AttenIve Learner (SNAIL) on several heavily-benchmarked meta-learning tasks, including the Omniglot and mini-Imagenet datasets in supervised learning, and multi-armed bandits, tabular Markov Decision processes (MDPs), visual navigation, and continuous control in reinforcement learning. In all domains, SNAIL achieves state-of-the-art performance by significant margins, outperforming methods that are domain-specific or rely on built-in algorithmic priors. ",
96
+ "bbox": [
97
+ 174,
98
+ 751,
99
+ 826,
100
+ 890
101
+ ],
102
+ "page_idx": 0
103
+ },
104
+ {
105
+ "type": "text",
106
+ "text": "2 META-LEARNING PRELIMINARIES ",
107
+ "text_level": 1,
108
+ "bbox": [
109
+ 174,
110
+ 102,
111
+ 493,
112
+ 118
113
+ ],
114
+ "page_idx": 1
115
+ },
116
+ {
117
+ "type": "text",
118
+ "text": "Before we describe SNAIL in detail, we will introduce notation and formalize the meta-learning problem. As briefly discussed in Section 1, the goal of meta-learning is generalization across tasks rather than across data points. Each task $\\mathcal { T } _ { i }$ is episodic and defined by inputs $x _ { t }$ , outputs $a _ { t }$ , a loss function $\\mathcal { L } _ { i } ( x _ { t } , a _ { t } )$ , a transition distribution $P _ { i } ( x _ { t } | x _ { t - 1 } , a _ { t - 1 } )$ , and an episode length $H _ { i }$ . A meta-learner (with parameters $\\theta$ ) models the distribution $\\pi ( a _ { t } | x _ { 1 } , \\dots , x _ { t } ; \\theta )$ . Given a distribution over tasks $\\mathcal { T } = P ( \\mathcal { T } _ { i } )$ , the meta-learner’s objective is to minimize its expected loss with respect to $\\theta$ ",
119
+ "bbox": [
120
+ 176,
121
+ 131,
122
+ 825,
123
+ 217
124
+ ],
125
+ "page_idx": 1
126
+ },
127
+ {
128
+ "type": "equation",
129
+ "img_path": "images/1aac60925efcb5f27a836a1a67f6502c47baa295f4fe78cd51379d173412d617.jpg",
130
+ "text": "$$\n\\begin{array} { l } { { \\displaystyle \\operatorname* { m i n } _ { \\theta } \\mathbb { E } _ { \\mathcal { T } _ { i } \\sim \\mathcal { T } } \\bigg [ \\sum _ { t = 0 } ^ { H _ { i } } \\mathcal { L } _ { i } ( x _ { t } , a _ { t } ) \\bigg ] , } \\ ~ } \\\\ { { \\displaystyle \\mathrm { ~ w h e r e ~ } x _ { t } \\sim P _ { i } ( x _ { t } | x _ { t - 1 } , a _ { t - 1 } ) , a _ { t } \\sim \\pi ( a _ { t } | x _ { 1 } , \\dots , x _ { t } ; \\theta ) } } \\end{array}\n$$",
131
+ "text_format": "latex",
132
+ "bbox": [
133
+ 318,
134
+ 218,
135
+ 686,
136
+ 280
137
+ ],
138
+ "page_idx": 1
139
+ },
140
+ {
141
+ "type": "text",
142
+ "text": "A meta-learner is trained by optimizing this expected loss over tasks (or mini-batches of tasks) sampled from $\\tau$ . During testing, the meta-learner is evaluated on unseen tasks from a different task distribution $\\widetilde { \\tau } = P ( \\widetilde { T } _ { i } )$ that is similar to the training task distribution $\\tau$ . ",
143
+ "bbox": [
144
+ 176,
145
+ 287,
146
+ 821,
147
+ 332
148
+ ],
149
+ "page_idx": 1
150
+ },
151
+ {
152
+ "type": "text",
153
+ "text": "3 A SIMPLE NEURAL ATTENTIVE LEARNER ",
154
+ "text_level": 1,
155
+ "bbox": [
156
+ 174,
157
+ 347,
158
+ 555,
159
+ 363
160
+ ],
161
+ "page_idx": 1
162
+ },
163
+ {
164
+ "type": "text",
165
+ "text": "The key principle motivating our approach is simplicity and versatility: a meta-learner should be universally applicable to domains in both supervised and reinforcement learning. It should be generic and expressive enough to learn an optimal strategy, rather than having the strategy already built-in. ",
166
+ "bbox": [
167
+ 174,
168
+ 367,
169
+ 825,
170
+ 410
171
+ ],
172
+ "page_idx": 1
173
+ },
174
+ {
175
+ "type": "text",
176
+ "text": "Santoro et al. (2016) considered a similar formulation of the meta-learning problem, and explored using recurrent neural networks (RNNs) to implement a meta-learner. Although simple and generic, their approach is significantly outperformed by methods that are hand-designed to exploit domain or algorithmic knowledge (methods which we survey in Section 4). We hypothesize that this is because traditional RNN architectures propagate information by keeping it in their hidden state from one timestep to the next; this temporally-linear dependency bottlenecks their capacity to perform sophisticated computation on a stream of inputs. ",
177
+ "bbox": [
178
+ 174,
179
+ 416,
180
+ 825,
181
+ 513
182
+ ],
183
+ "page_idx": 1
184
+ },
185
+ {
186
+ "type": "text",
187
+ "text": "van den Oord et al. (2016a) introduced a class of architectures that generate sequential data (in their case, audio) by performing dilated 1D-convolutions over the temporal dimension. These temporal convolutions (TC) are causal, so that the generated values at the next timestep are only influenced by past timesteps and not future ones. Compared to traditional RNNs, they offer more direct, highbandwidth access to past information, allowing them to perform more sophisticated computation over a temporal context of fixed size. However, to scale to long sequences, the dilation rates generally increase exponentially, so that the required number of layers scales logarithmically with the sequence length. Hence, they have coarser access to inputs that are further back in time; their bounded capacity and positional dependence can be undesirable in a meta-learner, which should be able to fully utilize increasingly large amounts of experience. ",
188
+ "bbox": [
189
+ 174,
190
+ 520,
191
+ 825,
192
+ 660
193
+ ],
194
+ "page_idx": 1
195
+ },
196
+ {
197
+ "type": "text",
198
+ "text": "In contrast, soft attention (in particular, the style used by Vaswani et al. (2017a)) allows a model to pinpoint a specific piece of information from a potentially infinitely-large context. It treats the context as an unordered key-value store which it can query based on the content of each element. However, the lack of positional dependence can also be undesirable, especially in reinforcement learning, where the observations, actions, and rewards are intrinsically sequential. ",
199
+ "bbox": [
200
+ 174,
201
+ 666,
202
+ 825,
203
+ 736
204
+ ],
205
+ "page_idx": 1
206
+ },
207
+ {
208
+ "type": "text",
209
+ "text": "Despite their individual shortcomings, temporal convolutions and attention complement each other: while the former provide high-bandwidth access at the expense of finite context size, the latter provide pinpoint access over an infinitely large context. Hence, we construct SNAIL by combining the two: we use temporal convolutions to produce the context over which we use a causal attention operation. By interleaving TC layers with causal attention layers, SNAIL can have high-bandwidth access over its past experience without constraints on the amount of experience it can effectively use. By using attention at multiple stages within a model that is trained end-to-end, SNAIL can learn what pieces of information to pick out from the experience it gathers, as well as a feature representation that is amenable to doing so easily. As an additional benefit, SNAIL architectures are easier to train than traditional RNNs such as LSTM or GRUs (where the underlying optimization can be difficult because of the temporally-linear hidden state dependency) and can be efficiently implemented so that an entire sequence can be processed in a single forward pass. Figure 1 provides an illustration of SNAIL, and we discuss architectural components in Section 3.1. ",
210
+ "bbox": [
211
+ 174,
212
+ 743,
213
+ 825,
214
+ 924
215
+ ],
216
+ "page_idx": 1
217
+ },
218
+ {
219
+ "type": "image",
220
+ "img_path": "images/c0dffb1b17f3fe7f57881a53f96bf90c10b7082a0050f82836a11cd0b244b814.jpg",
221
+ "image_caption": [
222
+ "Figure 1: Overview of our simple neural attentive learner (SNAIL); in this example, two blocks of TC layers (orange) are interleaved with two causal attention layers (green). The same class of model architectures can be applied to both supervised and reinforcement learning. "
223
+ ],
224
+ "image_footnote": [],
225
+ "bbox": [
226
+ 235,
227
+ 99,
228
+ 761,
229
+ 392
230
+ ],
231
+ "page_idx": 2
232
+ },
233
+ {
234
+ "type": "text",
235
+ "text": "In supervised settings, SNAIL receives as input a sequence of example-label pairs $( x _ { 1 } , y _ { 1 } ) , \\dotsc , ( x _ { t - 1 } , y _ { t - 1 } )$ for timesteps $1 , \\ldots , t - 1$ , followed by an unlabeled example $( x _ { t } , - )$ It then outputs its prediction for $x _ { t }$ based on the previous labeled examples it has seen. ",
236
+ "bbox": [
237
+ 176,
238
+ 455,
239
+ 821,
240
+ 497
241
+ ],
242
+ "page_idx": 2
243
+ },
244
+ {
245
+ "type": "text",
246
+ "text": "In reinforcement-learning settings, it receives a sequence of observation-action-reward tuples $( o _ { 1 } , - , - ) , \\ldots , ( o _ { t } , a _ { t - 1 } , r _ { t - 1 } )$ . At each time $t$ , it outputs a distribution over actions $a _ { t }$ based on the current observation $o _ { t }$ as well as previous observations, actions, and rewards. Crucially, following existing work in meta-RL (Duan et al., 2016; Wang et al., 2016), we preserve the internal state of a SNAIL across episode boundaries, which allows it to have memory that spans multiple episodes. The observations also contain a binary input that indicates episode termination. ",
247
+ "bbox": [
248
+ 174,
249
+ 503,
250
+ 825,
251
+ 588
252
+ ],
253
+ "page_idx": 2
254
+ },
255
+ {
256
+ "type": "text",
257
+ "text": "3.1 MODULAR BUILDING BLOCKS ",
258
+ "text_level": 1,
259
+ "bbox": [
260
+ 176,
261
+ 608,
262
+ 428,
263
+ 622
264
+ ],
265
+ "page_idx": 2
266
+ },
267
+ {
268
+ "type": "text",
269
+ "text": "We compose SNAIL architectures using a few primary building blocks. Below, we provide pseudocode for applying each block to a matrix (\"inputs\" in the pseudocode) of size (sequence length) $\\times$ (input dimensionality). Note that, if any of the inputs are images, we employ an additional (spatial) convolutional network that converts the image into a feature vector before it is passed into the SNAIL. Figure 2 illustrates the different blocks visually. ",
270
+ "bbox": [
271
+ 174,
272
+ 635,
273
+ 825,
274
+ 705
275
+ ],
276
+ "page_idx": 2
277
+ },
278
+ {
279
+ "type": "text",
280
+ "text": "Many techniques have been proposed to increase the capacity or accelerate the training of deep convolutional architectures, including batch normalization (Ioffe & Szegedy (2015)), residual connections (He et al. (2016)), and dense connections (Huang et al. (2016)). We found that these techniques greatly improved the expressive capacity and training speed of SNAILs, but that no particular choice of residual/dense configurations was essential for good performance (we explore the robustness of SNAILs to architectural choices in Appendix B). ",
281
+ "bbox": [
282
+ 174,
283
+ 712,
284
+ 825,
285
+ 796
286
+ ],
287
+ "page_idx": 2
288
+ },
289
+ {
290
+ "type": "text",
291
+ "text": "A dense block applies a single causal 1D-convolution with dilation rate $R$ and $D$ filters (we used kernel size 2 in all experiments), and then concatenates the result with its input. We used the gated activation function (line 3) introduced by van den Oord et al. (2016a;b). ",
292
+ "bbox": [
293
+ 176,
294
+ 803,
295
+ 823,
296
+ 845
297
+ ],
298
+ "page_idx": 2
299
+ },
300
+ {
301
+ "type": "text",
302
+ "text": "A TC block consists of a series of dense blocks whose dilation rates increase exponentially until their receptive field exceeds the desired sequence length: ",
303
+ "bbox": [
304
+ 171,
305
+ 103,
306
+ 823,
307
+ 133
308
+ ],
309
+ "page_idx": 3
310
+ },
311
+ {
312
+ "type": "table",
313
+ "img_path": "images/0443ec46c254b316bd6c84b48cddc5d25daf5188cff4a8b786954e552a10835e.jpg",
314
+ "table_caption": [],
315
+ "table_footnote": [],
316
+ "table_body": "<table><tr><td colspan=\"2\">1: function TCBLOCK(inputs,sequence length T, number of filters D):</td></tr><tr><td>2:</td><td>for i in 1,...,[log2T] do</td></tr><tr><td>3:</td><td>inputs = DenseBlock(inputs, 2,D)</td></tr><tr><td>4:</td><td>return inputs</td></tr></table>",
317
+ "bbox": [
318
+ 173,
319
+ 142,
320
+ 818,
321
+ 209
322
+ ],
323
+ "page_idx": 3
324
+ },
325
+ {
326
+ "type": "text",
327
+ "text": "A attention block performs a single key-value lookup; we style this operation after the self-attention mechanism proposed by Vaswani et al. (2017a): ",
328
+ "bbox": [
329
+ 171,
330
+ 218,
331
+ 823,
332
+ 246
333
+ ],
334
+ "page_idx": 3
335
+ },
336
+ {
337
+ "type": "text",
338
+ "text": "1: function ATTENTIONBLOCK(inputs, key size $K$ , value size $V$ ): \n2: keys, query $=$ affine(inputs, $K _ { \\cdot }$ ), affine(inputs, $K$ ) \n3: logits $=$ matmul(query, transpose(keys)) \n4: probs $=$ CausallyMaskedSoftmax(logits / $\\sqrt { K } )$ ) \n5: values $=$ affine(inputs, $V$ ) \n6: read $=$ matmul(probs, values) \n7: return concat(inputs, read) ",
339
+ "bbox": [
340
+ 178,
341
+ 258,
342
+ 622,
343
+ 362
344
+ ],
345
+ "page_idx": 3
346
+ },
347
+ {
348
+ "type": "text",
349
+ "text": "where CausallyMaskedSoftmax(·) zeros out the appropriate probabilities before normalization, so that a particular timestep’s query cannot have access to future keys/values. ",
350
+ "bbox": [
351
+ 173,
352
+ 372,
353
+ 823,
354
+ 401
355
+ ],
356
+ "page_idx": 3
357
+ },
358
+ {
359
+ "type": "image",
360
+ "img_path": "images/f8a62d90dd8397b1ccb85932dc0ffd1ce39962c8d53bc6b2ba661d40e256e373.jpg",
361
+ "image_caption": [
362
+ "(a) Dense Block (dilation rate R, D lters) "
363
+ ],
364
+ "image_footnote": [],
365
+ "bbox": [
366
+ 217,
367
+ 429,
368
+ 395,
369
+ 574
370
+ ],
371
+ "page_idx": 3
372
+ },
373
+ {
374
+ "type": "text",
375
+ "text": "(b) Attention Block (key size K, value size V) ",
376
+ "bbox": [
377
+ 464,
378
+ 414,
379
+ 684,
380
+ 425
381
+ ],
382
+ "page_idx": 3
383
+ },
384
+ {
385
+ "type": "image",
386
+ "img_path": "images/c4fa5b58fc3c72e57f2561162589475d690facad7a6b70d5696869614ff77707.jpg",
387
+ "image_caption": [
388
+ "Figure 2: Two of the building blocks that compose SNAIL architectures. (a) A dense block applies a causal 1D-convolution, and then concatenates the output to its input. A TC block (not pictured) applies a series of dense blocks with exponentially-increasing dilation rates. (b) A attention block performs a (causal) key-value lookup, and also concatenates the output to the input. "
389
+ ],
390
+ "image_footnote": [],
391
+ "bbox": [
392
+ 460,
393
+ 421,
394
+ 789,
395
+ 650
396
+ ],
397
+ "page_idx": 3
398
+ },
399
+ {
400
+ "type": "text",
401
+ "text": "4 RELATED WORK ",
402
+ "text_level": 1,
403
+ "bbox": [
404
+ 176,
405
+ 751,
406
+ 344,
407
+ 767
408
+ ],
409
+ "page_idx": 3
410
+ },
411
+ {
412
+ "type": "text",
413
+ "text": "Pioneered by Schmidhuber (1987); Naik & Mammone (1992); Thrun & Pratt (1998), meta-learning is not a new idea. A key tradeoff central to many recent meta-learning approaches is between performance and generality; we discuss several notable methods and how they fit into this paradigm. ",
414
+ "bbox": [
415
+ 176,
416
+ 776,
417
+ 823,
418
+ 819
419
+ ],
420
+ "page_idx": 3
421
+ },
422
+ {
423
+ "type": "text",
424
+ "text": "Graves et al. (2014) investigated the use of recurrent neural networks (RNNs) to solve algorithmic tasks. They experimented with a meta-learner implemented by an LSTM, but their results suggested that LSTM architectures are ill-equipped for these kinds of tasks. They then designed a more sophisticated RNN architecture, where an LSTM controller was coupled to an external memory bank from which it can read and write, and demonstrated that these memory-augmented neural networks (MANNs) achieved substantially better performance than LSTMs. Santoro et al. (2016) evaluated both LSTM and MANN meta-learners on few-shot image classification, and confirm the inadequacy of the LSTM architecture. These approaches are generic, but MANNs feature a complicated memoryaddressing architecture that is difficult to train – they still suffer from the same temporally-linear hidden-state dependencies as LSTMs. ",
425
+ "bbox": [
426
+ 174,
427
+ 825,
428
+ 825,
429
+ 924
430
+ ],
431
+ "page_idx": 3
432
+ },
433
+ {
434
+ "type": "text",
435
+ "text": "",
436
+ "bbox": [
437
+ 176,
438
+ 103,
439
+ 825,
440
+ 145
441
+ ],
442
+ "page_idx": 4
443
+ },
444
+ {
445
+ "type": "text",
446
+ "text": "In response, several approaches have demonstrated good performance in few-shot classification with specialized neural network architectures. Koch (2015) used a Siamese network that was trained to predict whether two images belong to the same class. Vinyals et al. (2016) learned an embedding function and used cosine distance in an attention kernel to judge image similarity. Snell et al. (2017) employed a similar approach to Vinyals et al. (2016), based on Euclidean distance metrics. All three methods work well within the context of classification, but are not readily applicable to other domains, such as reinforcement learning. They perform well because their architectures have been designed to exploit domain knowledge, but ideally we would like a meta-learner that is not constrained to a particular problem type. ",
447
+ "bbox": [
448
+ 174,
449
+ 152,
450
+ 825,
451
+ 279
452
+ ],
453
+ "page_idx": 4
454
+ },
455
+ {
456
+ "type": "text",
457
+ "text": "A number of methods consider a meta-learner that makes updates to the parameters of a traditional learner (Bengio et al., 1992; Hochreiter et al., 2001). Andrychowicz et al. (2016) and Li & Malik (2017) investigated the setting of learning to optimize, where the learner is an objective function to minimize, and the meta-learner uses the gradients of the learner to perform the optimization. Their meta-learner was implemented by an LSTM and the strategy that it learned can be interpreted as a gradient-based optimization algorithm; however, it is unclear whether the learned optimizers are substantially better than existing SGD-based methods. ",
458
+ "bbox": [
459
+ 174,
460
+ 285,
461
+ 825,
462
+ 382
463
+ ],
464
+ "page_idx": 4
465
+ },
466
+ {
467
+ "type": "text",
468
+ "text": "Ravi & Larochelle (2017) extended this idea, using a similar LSTM meta-learner in a few-shot classification setting, where the traditional learner was a convolutional-network-based classifier. In this setting, the meta-learning algorithm is decomposed into two parts: the traditional learner’s initial parameters are trained to be suitable for fast gradient-based adaptation; the LSTM meta-learner is trained to be an optimization algorithm adapted for meta-learning tasks. Finn et al. (2017) explored a special case where the meta-learner is constrained to use ordinary gradient descent to update the learner and showed that this simplified model (known as MAML) can achieve equivalent performance. Munkhdalai & Yu (2017) explored a more sophisticated weight update scheme that yielded minor performance improvements on few-shot classification. ",
469
+ "bbox": [
470
+ 174,
471
+ 388,
472
+ 825,
473
+ 515
474
+ ],
475
+ "page_idx": 4
476
+ },
477
+ {
478
+ "type": "text",
479
+ "text": "All of the methods discussed in the previous paragraph have the benefit of being domain independent, but they explicitly encode a particular strategy for the meta-learner to follow (namely, adaptation via gradient descent at test time). In a particular domain, there may exist better strategies that exploit the structure of the task, but gradient-based methods will be unable to discover them. In contrast, SNAIL presents an alternative paradigm where a generic architecture has the capacity to learn an algorithm that exploits domain-specific task structure. ",
480
+ "bbox": [
481
+ 174,
482
+ 521,
483
+ 825,
484
+ 604
485
+ ],
486
+ "page_idx": 4
487
+ },
488
+ {
489
+ "type": "text",
490
+ "text": "Duan et al. (2016) and Wang et al. (2016) both investigated meta-learning in reinforcement-learning domains using traditional RNN architectures (GRUs and LSTMs). In addition, Finn et al. (2017) experimented with fast adaptation of policies in continuous control, where the meta-learner was trained on a distribution of closely-related locomotion tasks. In Section 5.2, we benchmark SNAIL against MAML and an LSTM-based meta-learner on the tasks considered by these works. ",
491
+ "bbox": [
492
+ 174,
493
+ 612,
494
+ 825,
495
+ 681
496
+ ],
497
+ "page_idx": 4
498
+ },
499
+ {
500
+ "type": "text",
501
+ "text": "5 EXPERIMENTS ",
502
+ "text_level": 1,
503
+ "bbox": [
504
+ 176,
505
+ 700,
506
+ 326,
507
+ 717
508
+ ],
509
+ "page_idx": 4
510
+ },
511
+ {
512
+ "type": "text",
513
+ "text": "Our experiments were designed to investigate the following questions: ",
514
+ "bbox": [
515
+ 173,
516
+ 727,
517
+ 633,
518
+ 742
519
+ ],
520
+ "page_idx": 4
521
+ },
522
+ {
523
+ "type": "text",
524
+ "text": "• How does SNAIL’s generality affect its performance on a range of meta-learning tasks? • How does its performance compare to existing approaches that are specialized to a particular task domain, or have elements of a high-level strategy already built-in? • How does SNAIL scale with high-dimensional inputs and long-term temporal dependencies? ",
525
+ "bbox": [
526
+ 215,
527
+ 748,
528
+ 825,
529
+ 805
530
+ ],
531
+ "page_idx": 4
532
+ },
533
+ {
534
+ "type": "text",
535
+ "text": "5.1 FEW-SHOT IMAGE CLASSIFICATION ",
536
+ "text_level": 1,
537
+ "bbox": [
538
+ 176,
539
+ 820,
540
+ 464,
541
+ 835
542
+ ],
543
+ "page_idx": 4
544
+ },
545
+ {
546
+ "type": "text",
547
+ "text": "In the few-shot classification setting, we wish to classify data points into $N$ classes when we only have a small number $( K )$ of labeled examples per class. A meta-learner is readily applicable, because it learns how to compare input points, rather than memorize a specific mapping from points to classes. ",
548
+ "bbox": [
549
+ 176,
550
+ 845,
551
+ 825,
552
+ 888
553
+ ],
554
+ "page_idx": 4
555
+ },
556
+ {
557
+ "type": "text",
558
+ "text": "The Omniglot and mini-ImageNet datasets for few-shot image classification are the standard benchmarks in supervised meta-learning. Introduced by Lake et al. (2011), Omniglot consists of blackand-white images of handwritten characters gathered from 50 languages, for a total of 1632 different classes with 20 instances per class. Like prior works, we downsampled the images to $2 8 \\times 2 8$ and randomly selected 1200 classes for training and 432 for testing. We performed the same data augmentation proposed by Santoro et al. (2016), forming new classes by rotating each member of an existing class by a multiple of 90 degrees. ",
559
+ "bbox": [
560
+ 174,
561
+ 895,
562
+ 825,
563
+ 924
564
+ ],
565
+ "page_idx": 4
566
+ },
567
+ {
568
+ "type": "text",
569
+ "text": "",
570
+ "bbox": [
571
+ 174,
572
+ 103,
573
+ 825,
574
+ 174
575
+ ],
576
+ "page_idx": 5
577
+ },
578
+ {
579
+ "type": "text",
580
+ "text": "Mini-ImageNet is a more difficult benchmark; a subset of the well-known ImageNet dataset, it consists of $8 4 \\times 8 4$ color images from 100 different classes with 600 instances per class. We used the split released by Ravi & Larochelle (2017) and used by a number of other works, with 64 classes for training, 16 for validation, and 20 for testing. ",
581
+ "bbox": [
582
+ 174,
583
+ 180,
584
+ 825,
585
+ 236
586
+ ],
587
+ "page_idx": 5
588
+ },
589
+ {
590
+ "type": "text",
591
+ "text": "To evaluate a SNAIL on the $N$ -way, $K$ -shot problem, we sample $N$ classes from the overall dataset and $K$ examples of each class. We then feed the corresponding $N K$ example-label pairs to the SNAIL in a random order, followed by a new, unlabeled example from one of the $N$ classes. We report the average accuracy on this last, $( N K + 1 )$ -th timestep. ",
592
+ "bbox": [
593
+ 174,
594
+ 243,
595
+ 825,
596
+ 299
597
+ ],
598
+ "page_idx": 5
599
+ },
600
+ {
601
+ "type": "text",
602
+ "text": "We tested SNAIL on 5-way Omniglot, 20-way Omniglot, and 5-way mini-ImageNet. For each of these three splits, we trained the SNAIL on episodes where the number of shots $K$ was chosen uniformly at random from 1 to 5 (note that this is unlike prior works, who train separate models for each shot). For a $K$ -shot episode within an $N$ -way problem, the loss was simply the average cross-entropy between the predicted and true label on the $( N K + 1 )$ -th timestep. We train both the SNAIL and the feature-extracting embedding network in an end-to-end fashion using Adam (Kingma & Ba, 2015) For a complete description of the specifics SNAIL and embedding architectures we used, we refer the reader to Appendix A. ",
603
+ "bbox": [
604
+ 173,
605
+ 306,
606
+ 825,
607
+ 417
608
+ ],
609
+ "page_idx": 5
610
+ },
611
+ {
612
+ "type": "text",
613
+ "text": "Table 1 displays our results on 5-way and 20-way Omniglot, and Table 2 respectively for 5-way mini-ImageNet. We see that SNAIL outperforms state-of-the-art methods that are extensively handdesigned, and/or domain-specific. It significantly exceeds the performance of methods such as Santoro et al. (2016) that are similarly simple and generic. In Appendix B, we conduct a number of ablations to analyse SNAIL’s performance. ",
614
+ "bbox": [
615
+ 173,
616
+ 424,
617
+ 825,
618
+ 494
619
+ ],
620
+ "page_idx": 5
621
+ },
622
+ {
623
+ "type": "table",
624
+ "img_path": "images/26a4c3042edb3dd0394139233f93f6c28ea4e0a9a5229035177ac64fd14c91c6.jpg",
625
+ "table_caption": [
626
+ "Table 1: 5-way and 20-way, 1-shot and 5-shot classification accuracies on Omniglot, with $9 5 \\%$ confidence intervals where available. For each task, the best-performing method is highlighted, along with any others whose confidence intervals overlap. "
627
+ ],
628
+ "table_footnote": [],
629
+ "table_body": "<table><tr><td rowspan=1 colspan=4>Method 5-Way Omniglot 20-Way Omniglot</td></tr><tr><td rowspan=1 colspan=1>1-shot</td><td rowspan=1 colspan=1>5-shot</td><td rowspan=1 colspan=1>1-shot</td><td rowspan=1 colspan=1>5-shot</td></tr><tr><td rowspan=1 colspan=1>Santoro et al. (2016) 82.8%Koch (2015) 97.3%Vinyals et al. (2016) 98.1%Finn et al. (2017) 98.7% ± 0.4%Snell et al. (2017) 97.4%Munkhdalai &amp; Yu (2017) 98.9%</td><td rowspan=1 colspan=1>94.9%98.4%98.9%99.9% ± 0.3%99.3%1</td><td rowspan=1 colspan=1>188.2%93.8%95.8%± 0.3%96.0%97.0%</td><td rowspan=1 colspan=1>197.0%98.5%98.9%± 0.2%98.9%1</td></tr><tr><td rowspan=1 colspan=1>SNAIL, Ours 99.07 % ± 0.16%</td><td rowspan=1 colspan=1>99.78% ± 0.09%</td><td rowspan=1 colspan=1>97.64% ± 0.30%</td><td rowspan=1 colspan=1>99.36% ± 0.18%</td></tr></table>",
630
+ "bbox": [
631
+ 129,
632
+ 559,
633
+ 869,
634
+ 707
635
+ ],
636
+ "page_idx": 5
637
+ },
638
+ {
639
+ "type": "table",
640
+ "img_path": "images/16d1ed1a473f639bfa1ac35c8fa4b3006332f259aa697537b97b0e79f22a1d86.jpg",
641
+ "table_caption": [
642
+ "Table 2: 5-way, 1-shot and 5-shot classification accuracies on mini-ImageNet, with $9 5 \\%$ confidence intervals where available. For each task, the best-performing method is highlighted, along with any others whose confidence intervals overlap. "
643
+ ],
644
+ "table_footnote": [],
645
+ "table_body": "<table><tr><td>Method</td><td colspan=\"2\">5-Way Mini-ImageNet</td></tr><tr><td></td><td>1-shot</td><td>5-shot</td></tr><tr><td>Vinyals et al. (2016) Finn et al. (2017)</td><td>43.6%</td><td>55.3%</td></tr><tr><td></td><td>48.7% ± 1.84%</td><td>63.1% ± 0.92%</td></tr><tr><td>Ravi &amp; Larochelle (2017)</td><td>43.4% ± 0.77%</td><td>60.2% ± 0.71%</td></tr><tr><td>Snell et al. (2017)</td><td>46.61% ± 0.78%</td><td>65.77% ± 0.70%</td></tr><tr><td>Munkhdalai &amp; Yu (2017)</td><td>49.21% ± 0.96%</td><td></td></tr><tr><td>SNAIL, Ours</td><td>55.71% ± 0.99%</td><td>68.88% ± 0.92%</td></tr></table>",
646
+ "bbox": [
647
+ 236,
648
+ 784,
649
+ 709,
650
+ 916
651
+ ],
652
+ "page_idx": 5
653
+ },
654
+ {
655
+ "type": "text",
656
+ "text": "5.2 REINFORCEMENT LEARNING ",
657
+ "text_level": 1,
658
+ "bbox": [
659
+ 176,
660
+ 103,
661
+ 416,
662
+ 117
663
+ ],
664
+ "page_idx": 6
665
+ },
666
+ {
667
+ "type": "text",
668
+ "text": "Reinforcement learning features a number of challenges that supervised learning does not, including long-term temporal dependencies (as the experienced states and rewards may depend on actions taken many timesteps ago) as well as balancing exploration and exploitation. To explore SNAIL‘s ability to learn RL algorithms, we evaluate it on four different domains from prior work in meta-RL1: ",
669
+ "bbox": [
670
+ 174,
671
+ 121,
672
+ 825,
673
+ 176
674
+ ],
675
+ "page_idx": 6
676
+ },
677
+ {
678
+ "type": "text",
679
+ "text": "• Multi-armed bandits (Duan et al., 2016; Wang et al., 2016): the agent interacts with a set of arms whose reward distributions are unknown. Although its actions do not affect its state, exploration and exploitation are both essential: an optimal agent must initially explore by sampling different arms, but later exploit its knowledge by repeatedly selecting the best arm. Tabular MDPs (Duan et al., 2016; Wang et al., 2016): we procedurally generate random MDPs and allow the agent to act within each one for multiple episodes. Since every MDP is different, a meta-learner cannot simply memorize the ones it is trained on; it must actually learn an algorithm for solving MDPs. • Visual navigation (Duan et al., 2016; Wang et al., 2016): the agent must navigate randomlygenerated mazes to find a randomly-located goal, using only visual observations as input. It is allowed to interact with the same maze/goal configuration for two episodes, so an optimal agent should explore the maze on the first episode to find the goal, and then go directly to the goal on the second episode. This task features many of the common challenges in deep RL, including high-dimensional observations, partial observability, and sparse rewards. Continuous control (Finn et al., 2017): we consider a suite of simulated locomotion tasks. Although the environment dynamics are complex, the underlying task distribution is quite narrow. As a result, there is significant task structure for a meta-learner to exploit; the optimal strategy is closer to task-identification than a true RL algorithm. ",
680
+ "bbox": [
681
+ 214,
682
+ 178,
683
+ 826,
684
+ 434
685
+ ],
686
+ "page_idx": 6
687
+ },
688
+ {
689
+ "type": "text",
690
+ "text": "On each of these domains, we trained a SNAIL, along with two meta-learning baselines: ",
691
+ "bbox": [
692
+ 173,
693
+ 435,
694
+ 753,
695
+ 449
696
+ ],
697
+ "page_idx": 6
698
+ },
699
+ {
700
+ "type": "text",
701
+ "text": "• An LSTM-based meta-learner, as concurrently proposed by Duan et al. (2016); Wang et al. (2016). We refer to this method as “LSTM\" in the tables and figures in subsequent sections. • MAML, the method introduced by Finn et al. (2017). It trains the initial parameters of a policy to achieve maximal performance after one (policy) gradient update on a new task. ",
702
+ "bbox": [
703
+ 215,
704
+ 445,
705
+ 826,
706
+ 508
707
+ ],
708
+ "page_idx": 6
709
+ },
710
+ {
711
+ "type": "text",
712
+ "text": "We also conducted some ablation experiments, which are detailed in Appendix D. ",
713
+ "bbox": [
714
+ 173,
715
+ 511,
716
+ 709,
717
+ 525
718
+ ],
719
+ "page_idx": 6
720
+ },
721
+ {
722
+ "type": "text",
723
+ "text": "In all domains, we trained the meta-learners using trust region policy optimization with generalized advantage estimation (TRPO with GAE; Schulman et al. (2015; 2016)); the SNAIL architectures and TRPO/GAE hyperparameters are detailed in Appendix C. ",
724
+ "bbox": [
725
+ 176,
726
+ 529,
727
+ 823,
728
+ 570
729
+ ],
730
+ "page_idx": 6
731
+ },
732
+ {
733
+ "type": "text",
734
+ "text": "In the bandit and MDP domains, there exist a number of human-designed algorithms with various optimality guarantees (which we discuss in more depth in the subsequent sections). Although there isn’t much task structure for a meta-learner to exploit, the existence of upper bounds on asymptotic performance let us evaluate the optimality of a meta-learned algorithm. ",
735
+ "bbox": [
736
+ 174,
737
+ 574,
738
+ 825,
739
+ 630
740
+ ],
741
+ "page_idx": 6
742
+ },
743
+ {
744
+ "type": "text",
745
+ "text": "However, the true utility of a meta-learner is that it can learn an algorithm specialized to the particular distribution of tasks it is trained on. We evaluate this in the visual navigation and continuous control domains, where there is significant task structure for the meta-learner to exploit, but no optimal algorithms are known to exist due to the task complexity. ",
746
+ "bbox": [
747
+ 174,
748
+ 633,
749
+ 825,
750
+ 689
751
+ ],
752
+ "page_idx": 6
753
+ },
754
+ {
755
+ "type": "text",
756
+ "text": "5.2.1 MULTI-ARMED BANDITS ",
757
+ "text_level": 1,
758
+ "bbox": [
759
+ 174,
760
+ 696,
761
+ 403,
762
+ 710
763
+ ],
764
+ "page_idx": 6
765
+ },
766
+ {
767
+ "type": "text",
768
+ "text": "In our bandit experiments (styled after Duan et al. (2016)), each of $K$ arms gives rewards according to a Bernoulli distribution whose parameter $p \\in [ 0 , 1 ]$ is chosen randomly at the start of each episode of length $N$ . At each timestep, the meta-learner receives previous timestep’s reward, along with a one-hot encoding of the corresponding arm selected. It outputs a discrete probability distribution over the $K$ arms; the selected arm is determined by sampling from this distribution. ",
769
+ "bbox": [
770
+ 174,
771
+ 713,
772
+ 825,
773
+ 784
774
+ ],
775
+ "page_idx": 6
776
+ },
777
+ {
778
+ "type": "text",
779
+ "text": "As an oracle, we consider the Gittins index (Gittins, 1979), the Bayes optimal solution in the discounted, infinite horizon setting. Since it is only optimal as $N \\infty$ , a meta-learner can outperform it for smaller $N$ by choosing to exploit sooner. ",
780
+ "bbox": [
781
+ 174,
782
+ 786,
783
+ 825,
784
+ 829
785
+ ],
786
+ "page_idx": 6
787
+ },
788
+ {
789
+ "type": "text",
790
+ "text": "Following Duan et al. (2016), we tested all combinations of $N = 1 0$ , 100, 500 and $K = 5 , 1 0 , 5 0$ We also tested the additional case of $N = 1 0 0 0$ , $K = 5 0$ to further evaluate the scalability of SNAIL to longer sequences. We report the mean reward per episode for each setting; the results are given in Table 3 with $9 5 \\%$ confidence intervals where available. We found that training MAML was too computationally expensive for $N = 5 0 0$ , 1000; hence we omit those results from Table 3. ",
791
+ "bbox": [
792
+ 174,
793
+ 832,
794
+ 825,
795
+ 902
796
+ ],
797
+ "page_idx": 6
798
+ },
799
+ {
800
+ "type": "table",
801
+ "img_path": "images/862e005ea7ae4ff7b53558c24d2c75ef3ee053d1e143f7acfb88e5e7ea7224ae.jpg",
802
+ "table_caption": [
803
+ "Table 3: Results on multi-arm bandit problems. For each, we highlighted the best performing method, and any others whose performance is not statistically-significantly different (based on a one-sided $t$ -test with $p = 0 . 0 5$ ). Except for SNAIL and MAML, we report the results from Duan et al. (2016). "
804
+ ],
805
+ "table_footnote": [],
806
+ "table_body": "<table><tr><td rowspan=\"2\">Setup (N,K)</td><td colspan=\"5\">Method</td></tr><tr><td>Gittins (optimal as N → )</td><td>Random</td><td>LSTM</td><td>MAML</td><td>SNAIL (ours)</td></tr><tr><td>10,5</td><td>6.6</td><td>5.0</td><td>6.7</td><td>6.5 ± 0.1</td><td>6.6 ± 0.1</td></tr><tr><td>10,10</td><td>6.6</td><td>5.0</td><td>6.7</td><td>6.6 ± 0.1</td><td>6.7 ± 0.1</td></tr><tr><td>10,50</td><td>6.5</td><td>5.1</td><td>6.8</td><td>6.6 ± 0.1</td><td>6.7 ± 0.1</td></tr><tr><td>100,5</td><td>78.3</td><td>49.9</td><td>78.7</td><td>67.1 ± 1.1</td><td>79.1 ± 1.0</td></tr><tr><td>100,10</td><td>82.8</td><td>49.9</td><td>83.5</td><td>70.1 ± 0.6</td><td>83.5 ± 0.8</td></tr><tr><td>100,50</td><td>85.2</td><td>49.8</td><td>84.9</td><td>70.3 ± 0.4</td><td>85.1 ± 0.6</td></tr><tr><td>500,5</td><td>405.8</td><td>249.8</td><td>401.5</td><td></td><td>408.1 ± 4.9</td></tr><tr><td>500,10</td><td>437.8</td><td>249.0</td><td>432.5</td><td></td><td>432.4 ± 3.5</td></tr><tr><td>500,50</td><td>463.7</td><td>249.6</td><td>438.9</td><td></td><td>442.6 ± 2.5</td></tr><tr><td>1000,50</td><td>944.1</td><td>499.8</td><td>847.43</td><td></td><td>889.8 ± 5.6</td></tr></table>",
807
+ "bbox": [
808
+ 173,
809
+ 161,
810
+ 750,
811
+ 357
812
+ ],
813
+ "page_idx": 7
814
+ },
815
+ {
816
+ "type": "text",
817
+ "text": "5.2.2 TABULAR MDPS ",
818
+ "text_level": 1,
819
+ "bbox": [
820
+ 174,
821
+ 380,
822
+ 348,
823
+ 393
824
+ ],
825
+ "page_idx": 7
826
+ },
827
+ {
828
+ "type": "text",
829
+ "text": "In our tabular MDP experiments (also following Duan et al. (2016)), each MDP had 10 states and 5 actions (both discrete); the reward for each (state, action)-pair followed a normal distribution with unit variance where the mean was sampled from $\\mathcal { N } ( 1 , 1 )$ , and the transitions are sampled from a flat Dirichlet distribution (the latter is a commonly used prior in Bayesian RL) with random parameters. We allowed each meta-learner to interact with an MDP for $N$ episodes of length 10. As input, they received one-hot encodings of the current state and previous action, the previous reward received, and a binary flag indicating termination of the current episode. ",
830
+ "bbox": [
831
+ 173,
832
+ 397,
833
+ 826,
834
+ 496
835
+ ],
836
+ "page_idx": 7
837
+ },
838
+ {
839
+ "type": "text",
840
+ "text": "In addition to a random agent, we consider the follow human-designed algorithms as baselines. ",
841
+ "bbox": [
842
+ 173,
843
+ 502,
844
+ 794,
845
+ 516
846
+ ],
847
+ "page_idx": 7
848
+ },
849
+ {
850
+ "type": "text",
851
+ "text": "• PSRL (Strens, 2000): a Bayesian method that estimate the belief over the current MDP parameters. At the start of each of the $N$ episodes, it samples an MDP from the current posterior, and acts according to the optimal policy for the rest of the episode. \n• OPSRL (Osband & Van Roy, 2017): an optimistic variant of PSRL. \n• UCRL2 (Jaksch et al., 2010): uses an extended value iteration procedure to compute an optimistic MDP under the current belief. \n• $\\epsilon$ -greedy: with probability $1 - \\epsilon$ , act optimally against the MAP estimate according to the current posterior (which is updated once per episode). ",
852
+ "bbox": [
853
+ 215,
854
+ 520,
855
+ 825,
856
+ 638
857
+ ],
858
+ "page_idx": 7
859
+ },
860
+ {
861
+ "type": "text",
862
+ "text": "As an oracle, we run value iteration for 10 iterations (the episode length) on each MDP. Value iteration is optimal when the MDP parameters (reward function, transition probabilities) are known; thus, the resulting values provide an upper bound on the performance of any algorithm, whether human-designed or meta-learned (which do not receive the MDP parameters). ",
863
+ "bbox": [
864
+ 174,
865
+ 642,
866
+ 825,
867
+ 698
868
+ ],
869
+ "page_idx": 7
870
+ },
871
+ {
872
+ "type": "text",
873
+ "text": "We tested $N = 1 0$ , 25, 50, 75, 100; in Table 4, we report the performance normalized by the valueiteration upper bound. As $N$ increases, performance should approach 1, as the algorithm learns more about the current MDP. Similarly to the bandit experiments, we could not train MAML successfully for $N = 5 0 , 7 5 , 1 0 0 .$ In Figure 3, we show learning curves of SNAIL and LSTM. ",
874
+ "bbox": [
875
+ 174,
876
+ 704,
877
+ 825,
878
+ 761
879
+ ],
880
+ "page_idx": 7
881
+ },
882
+ {
883
+ "type": "image",
884
+ "img_path": "images/435809045b71532f0f113581eabca8bc204d2386caab73c0ca2e4591c5d38d8c.jpg",
885
+ "image_caption": [
886
+ "Figure 3: Learning curves of SNAIL (red) and LSTM (blue) on the random MDP task for different values of $N$ . The horizontal axis is the TRPO iteration, and the vertical is average reward. "
887
+ ],
888
+ "image_footnote": [],
889
+ "bbox": [
890
+ 187,
891
+ 773,
892
+ 803,
893
+ 888
894
+ ],
895
+ "page_idx": 7
896
+ },
897
+ {
898
+ "type": "table",
899
+ "img_path": "images/df671be243e5ded471c3be62ce53b5171e3902aa5623136a4ce1edceb8d49353.jpg",
900
+ "table_caption": [
901
+ "Table 4: Performance on tabular MDPs, scaled by the average reward achieved by value iteration. As before, we highlight the best-performing method, and any others whose performance is not statistically-significantly different (using the same one-sided $t { \\cdot }$ -test with $p = 0 . 0 5$ ). Except for SNAIL and MAML, we report the values from Duan et al. (2016). "
902
+ ],
903
+ "table_footnote": [],
904
+ "table_body": "<table><tr><td>N</td><td colspan=\"8\">Method</td></tr><tr><td></td><td>Random</td><td> E-greedy</td><td>PSRL</td><td>OPSRL</td><td>UCRL2</td><td>LSTM</td><td>MAML</td><td>SNAIL (ours)</td></tr><tr><td>10</td><td>0.482</td><td>0.640</td><td>0.665</td><td>0.694</td><td>0.706</td><td>0.752</td><td>0.563</td><td>0.766 ± 0.001</td></tr><tr><td></td><td>0.482</td><td>0.727</td><td>0.788</td><td>0.819</td><td>0.817</td><td>0.859</td><td>0.591</td><td>0.862 ± 0.001</td></tr><tr><td>50</td><td>0.481</td><td>0.793</td><td>0.871</td><td>0.897</td><td>0.885</td><td>0.902</td><td>1</td><td>0.908 ± 0.003</td></tr><tr><td>75</td><td>0.482</td><td>0.831</td><td>0.910</td><td>0.931</td><td>0.917</td><td>0.918</td><td></td><td>0.930 ± 0.002</td></tr><tr><td>100</td><td>0.481</td><td>0.857</td><td>0.934</td><td>0.951</td><td>0.936</td><td>0.922</td><td>1</td><td>0.941 ± 0.003</td></tr></table>",
905
+ "bbox": [
906
+ 173,
907
+ 175,
908
+ 820,
909
+ 289
910
+ ],
911
+ "page_idx": 8
912
+ },
913
+ {
914
+ "type": "text",
915
+ "text": "5.2.3 CONTINUOUS CONTROL ",
916
+ "text_level": 1,
917
+ "bbox": [
918
+ 174,
919
+ 301,
920
+ 397,
921
+ 315
922
+ ],
923
+ "page_idx": 8
924
+ },
925
+ {
926
+ "type": "text",
927
+ "text": "We consider the set of tasks introduced by Finn et al. (2017), in which two simulated robots (a planar cheetah and a 3D-quadruped ant) have to run in a particular direction or at a specified velocity (the direction or velocity are chosen randomly and not told to the agent). In the goal direction experiments, the reward is the magnitude of the robot’s velocity in either the forward or backward direction, and in the goal velocity experiments, the reward is the negative absolute value between its current forward velocity and the goal. The observations are the robot’s joint angles and velocities, and the actions are its joint torques. For each of these four task distributions ({ant, cheetah $1 \\} \\times \\ \\{ \\mathrm { g o a l } \\ $ velocity, goal direction}), Finn et al. (2017) trained a policy to maximize its performance after one policy gradient update using 20 episodes (40 for ant), of 200 timesteps each, on a newly sampled task. ",
928
+ "bbox": [
929
+ 173,
930
+ 319,
931
+ 825,
932
+ 444
933
+ ],
934
+ "page_idx": 8
935
+ },
936
+ {
937
+ "type": "text",
938
+ "text": "We trained both SNAIL and LSTM on each of these four task categories. Since they do not update their parameters at test time (instead incorporating experience through their hidden state), SNAIL and LSTM receive as input the previous action, previous reward, and an episode-termination flag in addition to the current observation. We found that two episodes of interaction was sufficient for these meta-learners to adapt to a task, and that unrolling them for longer did not improve performance. ",
939
+ "bbox": [
940
+ 174,
941
+ 450,
942
+ 825,
943
+ 521
944
+ ],
945
+ "page_idx": 8
946
+ },
947
+ {
948
+ "type": "text",
949
+ "text": "In Figure 4, we show how the different methods adapt to a new task. As an oracle, we sampled tasks from each distribution, and trained a separate policy for each task. We plot the average performance of the oracle policies for each task distribution as an upper bound on a meta-learner’s performance. ",
950
+ "bbox": [
951
+ 176,
952
+ 527,
953
+ 821,
954
+ 570
955
+ ],
956
+ "page_idx": 8
957
+ },
958
+ {
959
+ "type": "text",
960
+ "text": "Qualitatively, we can think of MAML as applying a general-purpose strategy (namely, gradient descent) to a distribution of highly-structured tasks. In contrast, SNAIL and LSTM are able to specialize themselves based on the shared task structure, enabling them to identify the task within the initial timesteps of the first episode, and then act optimally thereafter. ",
961
+ "bbox": [
962
+ 174,
963
+ 577,
964
+ 825,
965
+ 632
966
+ ],
967
+ "page_idx": 8
968
+ },
969
+ {
970
+ "type": "image",
971
+ "img_path": "images/a9dcffcf48385c66ff08f4c1d2e0a75de0b65229b45843c55499c766c7f72c59.jpg",
972
+ "image_caption": [
973
+ "Figure 4: Test-time adaptation curves on simulated locomotion tasks for SNAIL, LSTM, and MAML (which was unrolled for three policy gradient updates). Since SNAIL incorporates experience through its hidden state, it can exploit common task structure to perform optimally within a few timesteps. "
974
+ ],
975
+ "image_footnote": [],
976
+ "bbox": [
977
+ 176,
978
+ 646,
979
+ 820,
980
+ 782
981
+ ],
982
+ "page_idx": 8
983
+ },
984
+ {
985
+ "type": "text",
986
+ "text": "5.2.4 VISUAL NAVIGATION ",
987
+ "text_level": 1,
988
+ "bbox": [
989
+ 174,
990
+ 851,
991
+ 377,
992
+ 864
993
+ ],
994
+ "page_idx": 8
995
+ },
996
+ {
997
+ "type": "text",
998
+ "text": "Both Duan et al. (2016) and Wang et al. (2016) consider the task of visual navigation, where the agent must find a target in a maze using only visual inputs. The former used randomly-generated mazes and target positions, while the latter used a fixed maze and only four different target positions. Hence, we evaluated SNAIL on the former, more challenging task. The observations the agent receives are ",
999
+ "bbox": [
1000
+ 174,
1001
+ 868,
1002
+ 825,
1003
+ 924
1004
+ ],
1005
+ "page_idx": 8
1006
+ },
1007
+ {
1008
+ "type": "text",
1009
+ "text": "$3 0 \\times 4 0$ first-person images, and the actions it can take are {step forward, turn slightly left, turn slightly right}. We constructed a training dataset and two test datasets (unseen mazes of the same and larger size, respectively), each with 1000 mazes. The agents were allowed to interact with each maze for 2 episodes, with episode length 250 (1000 in the larger mazes). The starting and goal locations were chosen randomly for each trial but remained fixed within each pair of episodes. The agents received rewards of $+ 1$ for reaching the target (which resulted in the episode terminating), -0.01 at each timestep, to encourage it to reach the goal faster, and -0.001 for hitting the wall. Figure 5 depicts an example of the observations as well as sample maze layouts. ",
1010
+ "bbox": [
1011
+ 173,
1012
+ 103,
1013
+ 825,
1014
+ 215
1015
+ ],
1016
+ "page_idx": 9
1017
+ },
1018
+ {
1019
+ "type": "text",
1020
+ "text": "We evaluate each method using the average episode length, for both the first and second episode within a trial. The results are displayed in Table 5. Since MAML scaled poorly to long sequences in the bandit and MDP domains, we did not evaluate it on this domain; the computational expense was prohibitively high. Qualitatively, we observe that the optimal strategy does indeed emerge: the SNAIL agent explores the maze during the first episode, and then, after finding the goal, goes directly there on the second episode (the LSTM agent also exhibits this behavior, but has a harder time remembering where the goal is). An illustration is depicted in Figure 5. ",
1021
+ "bbox": [
1022
+ 173,
1023
+ 222,
1024
+ 825,
1025
+ 320
1026
+ ],
1027
+ "page_idx": 9
1028
+ },
1029
+ {
1030
+ "type": "table",
1031
+ "img_path": "images/06007e2ea13ae4855bd1ad9c1024af42e7b41a614d96692efe0cfc4e1a30b73f.jpg",
1032
+ "table_caption": [
1033
+ "Table 5: Average time to find the goal on each episode in the small and large mazes. SNAIL solves the mazes the fastest, and improves the most from the first to second episode. "
1034
+ ],
1035
+ "table_footnote": [],
1036
+ "table_body": "<table><tr><td rowspan=\"2\">Method</td><td colspan=\"2\">Small Maze</td><td colspan=\"2\">Large Maze</td></tr><tr><td>Episode 1</td><td>Episode 2</td><td>Episode 1</td><td>Episode 2</td></tr><tr><td>Random</td><td>188.6 ± 3.5</td><td>187.7 ± 3.5</td><td>420.2 ± 1.2</td><td>420.8 ±1.2</td></tr><tr><td>LSTM</td><td>52.4 ± 1.3</td><td>39.1 ± 0.9</td><td>180.1 ± 6.0</td><td>150.6 ± 5.9</td></tr><tr><td>SNAIL (ours)</td><td>50.3 ± 0.3</td><td>34.8 ± 0.2</td><td>140.5 ± 4.2</td><td>105.9 ± 2.4</td></tr></table>",
1037
+ "bbox": [
1038
+ 173,
1039
+ 366,
1040
+ 676,
1041
+ 450
1042
+ ],
1043
+ "page_idx": 9
1044
+ },
1045
+ {
1046
+ "type": "image",
1047
+ "img_path": "images/d5a99e30bac98c276e57d37015a8c7b0b4ff6eb86cdbef0008288dc0447150d9.jpg",
1048
+ "image_caption": [
1049
+ "Figure 5: From left to right: (a) A (higher-resolution) example of the observations the agent receives. (b) An example of the mazes used for training (goal shown in blue). (c) The movement of the SNAIL on its first episode in a larger maze, exploring the maze until it finds the goal. (d) The SNAIL’s path during its second episode in the same maze as (c). Remembering the goal location, it navigates there directly on the second episode. Maps like in (b), (c), (d) are used for visualization but not available to the agent. In (c), (d), the color progression from red to blue indicates the passage of time (red earlier). "
1050
+ ],
1051
+ "image_footnote": [],
1052
+ "bbox": [
1053
+ 174,
1054
+ 462,
1055
+ 820,
1056
+ 594
1057
+ ],
1058
+ "page_idx": 9
1059
+ },
1060
+ {
1061
+ "type": "text",
1062
+ "text": "6 CONCLUSION AND FUTURE WORK ",
1063
+ "text_level": 1,
1064
+ "bbox": [
1065
+ 174,
1066
+ 707,
1067
+ 495,
1068
+ 722
1069
+ ],
1070
+ "page_idx": 9
1071
+ },
1072
+ {
1073
+ "type": "text",
1074
+ "text": "We presented a simple and generic class of architectures for meta-learning, motivated by the need for a meta-learner to quickly incorporate and refer to past experience. Our simple neural attentive learner (SNAIL) utilizes a novel combination of temporal convolutions and causal attention, two building blocks of sequence-to-sequence models that have complementary strengths and weaknesses. We demonstrate that SNAIL achieves state-of-the-art performance by significant margins on all of the most-widely benchmarked meta-learning tasks in both supervised and reinforcement learning, without relying on any application-specific architectural components or algorithmic priors. ",
1075
+ "bbox": [
1076
+ 174,
1077
+ 728,
1078
+ 825,
1079
+ 827
1080
+ ],
1081
+ "page_idx": 9
1082
+ },
1083
+ {
1084
+ "type": "text",
1085
+ "text": "Although we designed SNAIL with meta-learning in mind, it would likely excel at other sequence-to sequence tasks, such as language modeling or translation; we plan to explore this in future work. ",
1086
+ "bbox": [
1087
+ 176,
1088
+ 832,
1089
+ 821,
1090
+ 861
1091
+ ],
1092
+ "page_idx": 9
1093
+ },
1094
+ {
1095
+ "type": "text",
1096
+ "text": "Another interesting idea would be to train an meta-learner that can attend over its entire lifetime of experience (rather than only a few recent episodes, as in this work). An agent with this lifelong memory could learn faster and generalize better; however, to keep the computational requirements practical, it would also need to learn how to decide what experiences are worth remembering. ",
1097
+ "bbox": [
1098
+ 176,
1099
+ 867,
1100
+ 825,
1101
+ 924
1102
+ ],
1103
+ "page_idx": 9
1104
+ },
1105
+ {
1106
+ "type": "text",
1107
+ "text": "REFERENCES ",
1108
+ "text_level": 1,
1109
+ "bbox": [
1110
+ 176,
1111
+ 103,
1112
+ 285,
1113
+ 117
1114
+ ],
1115
+ "page_idx": 10
1116
+ },
1117
+ {
1118
+ "type": "text",
1119
+ "text": "Marcin Andrychowicz, Misha Denil, Sergio Gomez, Matthew W Hoffman, David Pfau, Tom Schaul, and Nando de Freitas. Learning to learn by gradient descent by gradient descent. In Advances in Neural Information Processing Systems (NIPS), 2016. ",
1120
+ "bbox": [
1121
+ 174,
1122
+ 126,
1123
+ 823,
1124
+ 169
1125
+ ],
1126
+ "page_idx": 10
1127
+ },
1128
+ {
1129
+ "type": "text",
1130
+ "text": "Samy Bengio, Yoshua Bengio, Jocelyn Cloutier, and Jan Gecsei. On the optimization of a synaptic learning rule. In Optimality in Artificial and Biological Neural Networks, pp. 6–8. Univ. of Texas, 1992. ",
1131
+ "bbox": [
1132
+ 176,
1133
+ 176,
1134
+ 823,
1135
+ 219
1136
+ ],
1137
+ "page_idx": 10
1138
+ },
1139
+ {
1140
+ "type": "text",
1141
+ "text": "Yan Duan, John Schulman, Xi Chen, Peter L. Bartlett, Ilya Sutskever, and Pieter Abbeel. $\\mathbf { R } 1 \\$ 23$ : Fast reinforcement learning via slow reinforcement learning. arXiv preprint arXiv:1611.02779, 2016. ",
1142
+ "bbox": [
1143
+ 176,
1144
+ 228,
1145
+ 825,
1146
+ 271
1147
+ ],
1148
+ "page_idx": 10
1149
+ },
1150
+ {
1151
+ "type": "text",
1152
+ "text": "Chelsea Finn, Pieter Abbeel, and Sergy Levine. Model-agnostic meta learning. International Conference on Machine Learning (ICML), 2017. ",
1153
+ "bbox": [
1154
+ 173,
1155
+ 280,
1156
+ 825,
1157
+ 309
1158
+ ],
1159
+ "page_idx": 10
1160
+ },
1161
+ {
1162
+ "type": "text",
1163
+ "text": "J.C. Gittins. Bandit processes and dynamic allocation indices. Journal of the Royal Statistical Society. Series B (Methodological), 1979. ",
1164
+ "bbox": [
1165
+ 169,
1166
+ 316,
1167
+ 825,
1168
+ 347
1169
+ ],
1170
+ "page_idx": 10
1171
+ },
1172
+ {
1173
+ "type": "text",
1174
+ "text": "Alex Graves, Greg Wayne, and Ivo Danihelka. Neural turing machines. arXiv preprint arXiv:1410.5401, 2014. ",
1175
+ "bbox": [
1176
+ 173,
1177
+ 354,
1178
+ 825,
1179
+ 383
1180
+ ],
1181
+ "page_idx": 10
1182
+ },
1183
+ {
1184
+ "type": "text",
1185
+ "text": "Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Conference on Computer Vision and Pattern Recognition (CVPR), 2016. ",
1186
+ "bbox": [
1187
+ 173,
1188
+ 392,
1189
+ 823,
1190
+ 421
1191
+ ],
1192
+ "page_idx": 10
1193
+ },
1194
+ {
1195
+ "type": "text",
1196
+ "text": "Sepp Hochreiter, A Younger, and Peter Conwell. Learning to learn using gradient descent. Artificial Neural Networks, ICANN, 2001. ",
1197
+ "bbox": [
1198
+ 174,
1199
+ 429,
1200
+ 823,
1201
+ 459
1202
+ ],
1203
+ "page_idx": 10
1204
+ },
1205
+ {
1206
+ "type": "text",
1207
+ "text": "Gao Huang, Zhuang Liu, Kilian Q Weinberger, and Laurens van der Maaten. Densely connected convolutional networks. arXiv preprint arXiv:1608.06993, 2016. ",
1208
+ "bbox": [
1209
+ 173,
1210
+ 467,
1211
+ 825,
1212
+ 497
1213
+ ],
1214
+ "page_idx": 10
1215
+ },
1216
+ {
1217
+ "type": "text",
1218
+ "text": "Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. International Conference on Machine Learning (ICML), 2015. ",
1219
+ "bbox": [
1220
+ 174,
1221
+ 505,
1222
+ 823,
1223
+ 535
1224
+ ],
1225
+ "page_idx": 10
1226
+ },
1227
+ {
1228
+ "type": "text",
1229
+ "text": "Thomas Jaksch, Ronald Ortner, and Peter Auer. Near-optimal regret bounds for reinforcement learning. Journal of Machine Learning Research, 2010. ",
1230
+ "bbox": [
1231
+ 174,
1232
+ 542,
1233
+ 823,
1234
+ 571
1235
+ ],
1236
+ "page_idx": 10
1237
+ },
1238
+ {
1239
+ "type": "text",
1240
+ "text": "Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015. ",
1241
+ "bbox": [
1242
+ 173,
1243
+ 580,
1244
+ 825,
1245
+ 609
1246
+ ],
1247
+ "page_idx": 10
1248
+ },
1249
+ {
1250
+ "type": "text",
1251
+ "text": "Gregory Koch. Siamese neural networks for one-shot image recognition. PhD thesis, University of Toronto, 2015. ",
1252
+ "bbox": [
1253
+ 174,
1254
+ 617,
1255
+ 825,
1256
+ 647
1257
+ ],
1258
+ "page_idx": 10
1259
+ },
1260
+ {
1261
+ "type": "text",
1262
+ "text": "Brenden M Lake, Ruslan Salakhutdinov, Jason Gross, and Joshua B Tenenbaum. One shot learning of simple visual concepts. In CogSci, 2011. ",
1263
+ "bbox": [
1264
+ 174,
1265
+ 655,
1266
+ 823,
1267
+ 685
1268
+ ],
1269
+ "page_idx": 10
1270
+ },
1271
+ {
1272
+ "type": "text",
1273
+ "text": "Ke Li and Jitendra Malik. Learning to optimize. International Conference on Learning Representations (ICLR), 2017. ",
1274
+ "bbox": [
1275
+ 174,
1276
+ 693,
1277
+ 825,
1278
+ 722
1279
+ ],
1280
+ "page_idx": 10
1281
+ },
1282
+ {
1283
+ "type": "text",
1284
+ "text": "Tsendsuren Munkhdalai and Hong Yu. Meta networks. International Conference on Machine Learning (ICML), 2017. ",
1285
+ "bbox": [
1286
+ 174,
1287
+ 731,
1288
+ 823,
1289
+ 760
1290
+ ],
1291
+ "page_idx": 10
1292
+ },
1293
+ {
1294
+ "type": "text",
1295
+ "text": "Devang K Naik and RJ Mammone. Meta-neural networks that learn by learning. In Neural Networks, 1992. IJCNN., International Joint Conference on, volume 1, pp. 437–442. IEEE, 1992. ",
1296
+ "bbox": [
1297
+ 171,
1298
+ 768,
1299
+ 825,
1300
+ 797
1301
+ ],
1302
+ "page_idx": 10
1303
+ },
1304
+ {
1305
+ "type": "text",
1306
+ "text": "Ian Osband and Benjamin Van Roy. Why is posterior sampling better than optimism for reinforcement learning. International Conference on Machine Learning (ICML), 2017. ",
1307
+ "bbox": [
1308
+ 174,
1309
+ 805,
1310
+ 823,
1311
+ 835
1312
+ ],
1313
+ "page_idx": 10
1314
+ },
1315
+ {
1316
+ "type": "text",
1317
+ "text": "Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. In International Conference on Learning Representations (ICLR), 2017. ",
1318
+ "bbox": [
1319
+ 171,
1320
+ 843,
1321
+ 825,
1322
+ 872
1323
+ ],
1324
+ "page_idx": 10
1325
+ },
1326
+ {
1327
+ "type": "text",
1328
+ "text": "Adam Santoro, Sergey Bartunov, Matthew Botvinick, Daan Wierstra, and Timothy Lillicrap. Metalearning with memory-augmented neural networks. In International Conference on Machine Learning (ICML), 2016. ",
1329
+ "bbox": [
1330
+ 176,
1331
+ 881,
1332
+ 825,
1333
+ 924
1334
+ ],
1335
+ "page_idx": 10
1336
+ },
1337
+ {
1338
+ "type": "text",
1339
+ "text": "Jurgen Schmidhuber. Evolutionary principles in self-referential learning. On learning how to learn: The meta-meta-... hook.) Diploma thesis, Institut f. Informatik, Tech. Univ. Munich, 1987. ",
1340
+ "bbox": [
1341
+ 171,
1342
+ 103,
1343
+ 825,
1344
+ 132
1345
+ ],
1346
+ "page_idx": 11
1347
+ },
1348
+ {
1349
+ "type": "text",
1350
+ "text": "John Schulman, Sergey Levine, Philipp Moritz, Michael Jordan, and Pieter Abbeel. Trust region policy optimization. International Conference on Machine Learning (ICML), 2015. ",
1351
+ "bbox": [
1352
+ 171,
1353
+ 140,
1354
+ 823,
1355
+ 170
1356
+ ],
1357
+ "page_idx": 11
1358
+ },
1359
+ {
1360
+ "type": "text",
1361
+ "text": "John Schulman, Philipp Moritz, Sergey Levine, Michael Jordan, and Pieter Abbeel. High-dimensional continuous control using generalized advantage estimation. International Conference on Learning Representations (ICLR), 2016. ",
1362
+ "bbox": [
1363
+ 174,
1364
+ 178,
1365
+ 823,
1366
+ 222
1367
+ ],
1368
+ "page_idx": 11
1369
+ },
1370
+ {
1371
+ "type": "text",
1372
+ "text": "Jake Snell, Kevin Swersky, and Richard S Zemel. Prototypical networks for few-shot learning. arXiv preprint arXiv:1703.05175, 2017. ",
1373
+ "bbox": [
1374
+ 169,
1375
+ 229,
1376
+ 825,
1377
+ 260
1378
+ ],
1379
+ "page_idx": 11
1380
+ },
1381
+ {
1382
+ "type": "text",
1383
+ "text": "Malcolm Strens. A bayesian framework for reinforcement learning. In International Conference on Machine Learning (ICML), 2000. ",
1384
+ "bbox": [
1385
+ 169,
1386
+ 267,
1387
+ 825,
1388
+ 297
1389
+ ],
1390
+ "page_idx": 11
1391
+ },
1392
+ {
1393
+ "type": "text",
1394
+ "text": "Sebastian Thrun and Lorien Pratt. Learning to learn: Introduction and overview. In Learning to learn. Springer, 1998. ",
1395
+ "bbox": [
1396
+ 171,
1397
+ 305,
1398
+ 825,
1399
+ 334
1400
+ ],
1401
+ "page_idx": 11
1402
+ },
1403
+ {
1404
+ "type": "text",
1405
+ "text": "Aaron van den Oord, Sander Dieleman, Heig Zen, Karen Simonyan, Oriol Vinyals, Alex Graves, Nal Kalchbrenner, Andrew W. Senior, and Koray Kavukcuoglu. Wavenet: A generative model for raw audio. CoRR, abs/1609.03499, 2016a. ",
1406
+ "bbox": [
1407
+ 174,
1408
+ 343,
1409
+ 823,
1410
+ 387
1411
+ ],
1412
+ "page_idx": 11
1413
+ },
1414
+ {
1415
+ "type": "text",
1416
+ "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 (NIPS), 2016b. ",
1417
+ "bbox": [
1418
+ 173,
1419
+ 395,
1420
+ 826,
1421
+ 438
1422
+ ],
1423
+ "page_idx": 11
1424
+ },
1425
+ {
1426
+ "type": "text",
1427
+ "text": "Ashish Vaswani, Noah Shazeer, Jakob Uszkoreit, Llion Jones, Aidan Gomez N., Lukas Kaiser, and Illia Polosukhin. Attention is all you need. arXiv preprint arXiv:1706.03762, 2017a. ",
1428
+ "bbox": [
1429
+ 171,
1430
+ 446,
1431
+ 823,
1432
+ 476
1433
+ ],
1434
+ "page_idx": 11
1435
+ },
1436
+ {
1437
+ "type": "text",
1438
+ "text": "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, 2017b. ",
1439
+ "bbox": [
1440
+ 173,
1441
+ 484,
1442
+ 825,
1443
+ 513
1444
+ ],
1445
+ "page_idx": 11
1446
+ },
1447
+ {
1448
+ "type": "text",
1449
+ "text": "Oriol Vinyals, Charles Blundell, Tim Lillicrap, Daan Wierstra, et al. Matching networks for one shot learning. In Advances in Neural Information Processing Systems (NIPS), 2016. ",
1450
+ "bbox": [
1451
+ 171,
1452
+ 522,
1453
+ 823,
1454
+ 551
1455
+ ],
1456
+ "page_idx": 11
1457
+ },
1458
+ {
1459
+ "type": "text",
1460
+ "text": "Jane X Wang, Zeb Kurth-Nelson, Dhruva Tirumala, Hubert Soyer, Joel Z Leibo, Remi Munos, Charles Blundell, Dharshan Kumaran, and Matt Botvinick. Learning to reinforcement learn. arXiv preprint arXiv:1611.05763, 2016. ",
1461
+ "bbox": [
1462
+ 174,
1463
+ 560,
1464
+ 825,
1465
+ 603
1466
+ ],
1467
+ "page_idx": 11
1468
+ },
1469
+ {
1470
+ "type": "text",
1471
+ "text": "APPENDIX ",
1472
+ "text_level": 1,
1473
+ "bbox": [
1474
+ 176,
1475
+ 103,
1476
+ 263,
1477
+ 117
1478
+ ],
1479
+ "page_idx": 12
1480
+ },
1481
+ {
1482
+ "type": "text",
1483
+ "text": "A FEW-SHOT CLASSIFICATION ARCHITECTURES ",
1484
+ "text_level": 1,
1485
+ "bbox": [
1486
+ 176,
1487
+ 136,
1488
+ 594,
1489
+ 151
1490
+ ],
1491
+ "page_idx": 12
1492
+ },
1493
+ {
1494
+ "type": "text",
1495
+ "text": "With the building blocks defined in Section 3.1, we can concisely describe SNAIL architectures. We used the same SNAIL architecture for both Omniglot and mini-Imagenet. For the $N$ -way, $K$ -shot problem, the sequence length is $T = N K + 1$ , and we used the following: AttentionBlock(64, 32), TCBlock $( T , 1 2 8 )$ , AttentionBlock(256, 128), TCBlock $T _ { \\star }$ , 128), AttentionBlock(512, 256), followed by a final $1 \\times 1$ convolution with $N$ filters. ",
1496
+ "bbox": [
1497
+ 174,
1498
+ 166,
1499
+ 825,
1500
+ 237
1501
+ ],
1502
+ "page_idx": 12
1503
+ },
1504
+ {
1505
+ "type": "text",
1506
+ "text": "For the Omniglot dataset, we used the same embedding network architecture as all prior works, which repeat the following block four times { 3x3 conv (64 channels), batch norm, ReLU, 2x2 max pool }, and then apply a single fully-connected layer to output a 64-dimensional feature vector. ",
1507
+ "bbox": [
1508
+ 174,
1509
+ 244,
1510
+ 826,
1511
+ 286
1512
+ ],
1513
+ "page_idx": 12
1514
+ },
1515
+ {
1516
+ "type": "text",
1517
+ "text": "For mini-Imagenet, existing gradient-descent-based methods (Ravi & Larochelle, 2017; Finn et al., 2017), which update their model’s weights during testing, used the same network structure as the Omniglot network but reduced the number of channels to 32, in spite of the significantly-increased complexity of the images. We found that this shallow embedding network did not make adequate use of SNAIL’s expressive capacity, and opted to to use a deeper embedding network to prevent underfitting (in Appendix B, we conduct ablations regarding this decision). Illustrated in Figure 6, our embedding was a smaller version of the ResNet (He et al., 2016) architectures commonly used for the full Imagenet dataset. ",
1518
+ "bbox": [
1519
+ 173,
1520
+ 292,
1521
+ 825,
1522
+ 404
1523
+ ],
1524
+ "page_idx": 12
1525
+ },
1526
+ {
1527
+ "type": "image",
1528
+ "img_path": "images/b4008e5ff9af10355b10875b51288cdb66ad94de985e34be0a888fffe163d1c7.jpg",
1529
+ "image_caption": [
1530
+ "(a) Residual Block, D lters ",
1531
+ "Figure 6: (a) A residual block within our mini-Imagenet embedding. (b) The embedding, a smaller version of ResNet (He et al., 2016), uses several of the residual blocks depicted in (a). "
1532
+ ],
1533
+ "image_footnote": [],
1534
+ "bbox": [
1535
+ 173,
1536
+ 424,
1537
+ 825,
1538
+ 587
1539
+ ],
1540
+ "page_idx": 12
1541
+ },
1542
+ {
1543
+ "type": "text",
1544
+ "text": "B FEW-SHOT CLASSIFICATION: ABLATIONS ",
1545
+ "text_level": 1,
1546
+ "bbox": [
1547
+ 174,
1548
+ 102,
1549
+ 557,
1550
+ 118
1551
+ ],
1552
+ "page_idx": 13
1553
+ },
1554
+ {
1555
+ "type": "text",
1556
+ "text": "To investigate the contribution of different components (TC, attention, and deeper embedding in the case of mini-Imagenet) to SNAIL’s performance, we conducted a number of ablations, which are summarized in Table 6. From these ablations, we draw two conclusions: ",
1557
+ "bbox": [
1558
+ 176,
1559
+ 133,
1560
+ 825,
1561
+ 175
1562
+ ],
1563
+ "page_idx": 13
1564
+ },
1565
+ {
1566
+ "type": "text",
1567
+ "text": "• Both TC and attention layers are essential for maximal performance. When we remove either one, the resulting model is still competitive with other state-of-the-art methods, but the combination yields the best performance. Notably, compared to the full model, using only TC layers results in similar 1-shot performance but worse 5-shot. In Section 3 we discussed how temporal convolutions have coarser access to inputs farther back in time; this illustrates that this effect is relevant even at sequence length 26. SNAIL’s improved performance is not purely a result of the deeper embedding network. Gradient-based methods (we tested MAML; Finn et al. (2017)) overfit significantly when they use our embedding, and domain-specific RNN-based methods (Vinyals et al., 2016) don’t utilize the extra capacity as well as SNAIL does. ",
1568
+ "bbox": [
1569
+ 215,
1570
+ 180,
1571
+ 825,
1572
+ 325
1573
+ ],
1574
+ "page_idx": 13
1575
+ },
1576
+ {
1577
+ "type": "table",
1578
+ "img_path": "images/b6a343bec932fa0ca2ac0e97aa7e72e8b079052e0c7c45932a187bcf94dde81e.jpg",
1579
+ "table_caption": [
1580
+ "Table 6: The ablations we conducted on the few-shot classification task. From these, we conclude that (i) both TC and attention are essential for the best performance, and (ii) SNAIL‘s improved performance cannot be entirely explained by the deeper embedding. "
1581
+ ],
1582
+ "table_footnote": [],
1583
+ "table_body": "<table><tr><td rowspan=1 colspan=1>Ablation</td><td rowspan=1 colspan=1>Result</td></tr><tr><td rowspan=1 colspan=1>Replace SNAIL with stacked LSTM.Varied number of layers and their sizes(with similar number of parameters toSNAIL).</td><td rowspan=1 colspan=1>5-way Omniglot: 78.1% and 90.8% (1-shot, 5-shot).We were unable to successfully train this method on mini-Imagenet.</td></tr><tr><td rowspan=1 colspan=1>SNAIL with shallow mini-Imagenet em-bedding.</td><td rowspan=1 colspan=1> 5-way mini-Imagenet: 45.1% and 55.2% (1-shot, 5-shot).</td></tr><tr><td rowspan=1 colspan=1>MAML (Finn et al., 2017),a state-of-the-art gradient-based method, with ourdeeper mini-Imagenet embedding.</td><td rowspan=1 colspan=1>It overfits tremendously; for 1-shot, 5-way mini-ImageNet:30.1% &amp; 75.2% on the test and training set respectively.MAML trains separate models for 1-shot and 5-shot; wedidn&#x27;t train a 5-shot model because the 1-shot did so poorly.</td></tr><tr><td rowspan=1 colspan=1>SNAIl, no TC layers (only attention).This is a generalization of the methodused by Vinyals et al. (2016),as theyonly use a single attentive read and ex-plicitly force the keys to be features ofthe image and the values to be the labels.We experimented with multiple paral-lel reads (often referred to as multipleheads) as well as up to three consecutiveattentive blocks.</td><td rowspan=1 colspan=1>On 5-way and 20-way Omniglot: equivalent performance tothe full model.5-way mini-Imagenet: 49.9% and 63.9% (1-shot, 5-shot).</td></tr><tr><td rowspan=1 colspan=1>SNAIL, no attention (TC layers only).</td><td rowspan=1 colspan=1>On 5-way Omniglot: 98.8% and 99.2% (1-shot, 5-shot).We were unable to train 2O-way Omniglot using this method.On 5-way mini-Imagenet: 55.1% and 61.2%.</td></tr></table>",
1584
+ "bbox": [
1585
+ 173,
1586
+ 397,
1587
+ 861,
1588
+ 768
1589
+ ],
1590
+ "page_idx": 13
1591
+ },
1592
+ {
1593
+ "type": "text",
1594
+ "text": "In an attempt to analyse the learned feature representation, we tried using the features learned by the Omniglot embedding in a nearest-neighbor classifier, using both cosine and Euclidean distance. On 5-way Omniglot, this achieves $6 5 . 1 \\%$ and $6 7 . 1 \\%$ (1-shot and 5-shot) for Euclidean distance and $6 7 . 7 \\%$ and $6 8 . 3 \\%$ for cosine. Although SNAIL must be comparing images in order to successfully make few-shot predictions, this suggests that the strategy it learns is more sophisticated than either of these distance metrics. We contrast this with Vinyals et al. (2016) and Snell et al. (2017), who explicitly enforce such representations on the meta-learned strategy. ",
1595
+ "bbox": [
1596
+ 173,
1597
+ 785,
1598
+ 826,
1599
+ 882
1600
+ ],
1601
+ "page_idx": 13
1602
+ },
1603
+ {
1604
+ "type": "text",
1605
+ "text": "In addition, we investigated how sensitive SNAILs are to architectural design choices by sampling random permutations of the different components introduced in Section 3.1. We chose each component uniformly at random from six options: { AttentionBlock(128, 64), DenseBlock(R, 128) for $R \\in \\{ 1 , 2 , 4 , \\mathrm { \\dot { 8 } } , 1 6 \\} \\}$ . We sampled architectures with 13 layers each (for consistency with our primary model), and trained them on 5-way Omniglot. Averaged across 3 runs, these SNAILs achieved $9 8 . 6 2 \\% \\pm 0 . 1 3 \\%$ and $9 9 . 7 1 \\% \\pm \\hat { 0 . 0 8 \\% }$ for 1-shot and 5-shot, essentially matching the state-of-the-art performance of our primary architecture. ",
1606
+ "bbox": [
1607
+ 174,
1608
+ 103,
1609
+ 825,
1610
+ 202
1611
+ ],
1612
+ "page_idx": 14
1613
+ },
1614
+ {
1615
+ "type": "text",
1616
+ "text": "Finally, we explored the dependence of the classification strategy learned by SNAIL on the dataset it was trained on. If it truly learned an algorithm for few-shot classification, then a SNAIL trained on images from a particular domain should easily transfer to a new domain (such as between Omniglot and mini-Imagenet). To test this hypothesis: ",
1617
+ "bbox": [
1618
+ 176,
1619
+ 208,
1620
+ 825,
1621
+ 263
1622
+ ],
1623
+ "page_idx": 14
1624
+ },
1625
+ {
1626
+ "type": "text",
1627
+ "text": "• First, we took a SNAIL trained on 5-way Omniglot, fixed its weights, and re-learned an embedding for mini-Imagenet. Despite the SNAIL weights not being trained for miniImagenet, this method was able to achieve $5 0 . 6 2 \\%$ and $6 2 . 3 4 \\%$ on 1-shot and 5-shot. • Then, we tried this in the reverse direction (freezing the SNAIL weights from mini-Imagenet, and re-learning an embedding for 5-way Omniglot), and this attained $9 8 . 6 6 \\%$ and $9 9 . { \\bar { 5 } } 6 \\%$ . • Lastly, we combined an embedding trained on 5-way Omniglot with a SNAIL trained on 5-way mini-Imagenet (with a single linear layer in between, to handle the difference in feature vector dimensionality). We trained this model on 5-way Omniglot, where only the weights of the intermediate linear layer could be updated. It achieved ${ \\bar { 9 } } 8 . 5 \\%$ and $9 9 . 5 \\%$ . ",
1628
+ "bbox": [
1629
+ 215,
1630
+ 268,
1631
+ 825,
1632
+ 397
1633
+ ],
1634
+ "page_idx": 14
1635
+ },
1636
+ {
1637
+ "type": "text",
1638
+ "text": "All of these results are very competitive with the state-of-the-art, suggesting a strong degree of transferability of the algorithm and feature representation learned by SNAIL. An interesting idea for future work in zero-shot learning would be to learn embeddings for multiple datasets in an unsupervised manner, but with some mild distributional constraints imposed on the output feature representation. Then, one could train a SNAIL on one dataset, and have it transfer to new datasets without a single labeled example. ",
1639
+ "bbox": [
1640
+ 174,
1641
+ 409,
1642
+ 825,
1643
+ 492
1644
+ ],
1645
+ "page_idx": 14
1646
+ },
1647
+ {
1648
+ "type": "text",
1649
+ "text": "C REINFORCEMENT LEARNING ",
1650
+ "text_level": 1,
1651
+ "bbox": [
1652
+ 176,
1653
+ 102,
1654
+ 450,
1655
+ 118
1656
+ ],
1657
+ "page_idx": 15
1658
+ },
1659
+ {
1660
+ "type": "text",
1661
+ "text": "C.1 MULTI-ARMED BANDIT AND TABULAR MDP ARCHITECTURES ",
1662
+ "bbox": [
1663
+ 176,
1664
+ 133,
1665
+ 653,
1666
+ 148
1667
+ ],
1668
+ "page_idx": 15
1669
+ },
1670
+ {
1671
+ "type": "text",
1672
+ "text": "For the $N$ -timestep, $K$ -arm bandit problem, the total trajectory length is $T = N$ . For the MDP problem with $N$ episodes per MDP, it is $T = 1 0 N$ (since each episode lasts for 10 timesteps). ",
1673
+ "bbox": [
1674
+ 176,
1675
+ 159,
1676
+ 823,
1677
+ 188
1678
+ ],
1679
+ "page_idx": 15
1680
+ },
1681
+ {
1682
+ "type": "text",
1683
+ "text": "For multi-arm bandits and tabular MDPs, we used the same architecture. First, we applied a fullyconnected layer with 32 outputs that was shared between the policy and value function. Then the policy used: TCBlock $\\mathbf { \\mathcal { T } } , 3 2 )$ , TCBlock $( T , 3 2 )$ , AttentionBlock(32, 32). The value function used: TCBlock $( T , 1 6 )$ , TCBlock $( T , 1 6 )$ , AttentionBlock(16, 16). ",
1684
+ "bbox": [
1685
+ 174,
1686
+ 194,
1687
+ 826,
1688
+ 251
1689
+ ],
1690
+ "page_idx": 15
1691
+ },
1692
+ {
1693
+ "type": "text",
1694
+ "text": "We found that removing the attention blocks made no difference in performance on the bandit problems, whereas SNAILs without attention could not learn to solve MDPs. ",
1695
+ "bbox": [
1696
+ 176,
1697
+ 257,
1698
+ 821,
1699
+ 285
1700
+ ],
1701
+ "page_idx": 15
1702
+ },
1703
+ {
1704
+ "type": "text",
1705
+ "text": "C.2 CONTINUOUS CONTROL ARCHITECTURES ",
1706
+ "text_level": 1,
1707
+ "bbox": [
1708
+ 178,
1709
+ 303,
1710
+ 508,
1711
+ 318
1712
+ ],
1713
+ "page_idx": 15
1714
+ },
1715
+ {
1716
+ "type": "text",
1717
+ "text": "For each simulation locomotion task, the total trajectory length was $T = 4 0 0$ (2 episodes of 200 timesteps each). We used the same architecture (shared between policy and value function) for all tasks: two fully-connected layers of size 256 with tanh nonlinearities, AttentionBlock(32, 32), TCBlock(T , 16), TCBlock(T , 16), AttentionBlock(32, 32). Then the policy and value function applied separate fully-connected layers to produce the requisite output dimensionalities. ",
1718
+ "bbox": [
1719
+ 174,
1720
+ 329,
1721
+ 825,
1722
+ 398
1723
+ ],
1724
+ "page_idx": 15
1725
+ },
1726
+ {
1727
+ "type": "text",
1728
+ "text": "C.3 VISUAL NAVIGATION ARCHITECTURES ",
1729
+ "text_level": 1,
1730
+ "bbox": [
1731
+ 176,
1732
+ 415,
1733
+ 488,
1734
+ 430
1735
+ ],
1736
+ "page_idx": 15
1737
+ },
1738
+ {
1739
+ "type": "text",
1740
+ "text": "Unlike the other RL tasks we considered, the observations in this domain include images. We preprocess the images using the same convolutional architecture as Duan et al. (2016): two layers with {kernel size $5 \\times 5$ , 16 filters, stride 2, ReLU nonlinearity}, whose output is then flattened and then passed to a fully-connected layer to produce a feature vector of size 256. ",
1741
+ "bbox": [
1742
+ 174,
1743
+ 441,
1744
+ 825,
1745
+ 497
1746
+ ],
1747
+ "page_idx": 15
1748
+ },
1749
+ {
1750
+ "type": "text",
1751
+ "text": "The total trajectory length was $T = 5 0 0$ (2 episodes of 250 timesteps each). For the policy, we used: TCBlock $( T , 3 2 )$ , AttentionBlock(16, 16), TCBlock(T , 32), AttentionBlock(16, 16). For the value function we used: TCBlock $( T , 1 6 )$ , TCBlock $( T , 1 6 )$ . ",
1752
+ "bbox": [
1753
+ 176,
1754
+ 503,
1755
+ 823,
1756
+ 546
1757
+ ],
1758
+ "page_idx": 15
1759
+ },
1760
+ {
1761
+ "type": "text",
1762
+ "text": "C.4 ADDITIONAL REINFORCEMENT LEARNING HYPERPARAMETERS ",
1763
+ "text_level": 1,
1764
+ "bbox": [
1765
+ 176,
1766
+ 564,
1767
+ 660,
1768
+ 579
1769
+ ],
1770
+ "page_idx": 15
1771
+ },
1772
+ {
1773
+ "type": "text",
1774
+ "text": "As discussed in Section 5.2, we trained all policies using trust-region policy optimization with generalized advantage estimation (TRPO with GAE, Schulman et al. (2015; 2016)). The hyperparameters are listed in Table 7. For multi-armed bandits, tabular MDPs, and visual navigation, we used the same hyperparamters as Duan et al. (2016) to make our results directly comparable; additional tuning could potentially improve SNAIL’s performance. ",
1775
+ "bbox": [
1776
+ 174,
1777
+ 589,
1778
+ 825,
1779
+ 660
1780
+ ],
1781
+ "page_idx": 15
1782
+ },
1783
+ {
1784
+ "type": "table",
1785
+ "img_path": "images/3b1ae2b6e3920c849af026b223db28a7e4d252c3de59a2eca682ebd18c7253ba.jpg",
1786
+ "table_caption": [
1787
+ "Table 7: The TRPO $^ +$ GAE hyperparameters we used in our RL experiments. "
1788
+ ],
1789
+ "table_footnote": [],
1790
+ "table_body": "<table><tr><td>Hyperparameter</td><td>Multi-armed Bandits</td><td>Tabular MDPs</td><td>Continuous Control</td><td>Visual Navigation</td></tr><tr><td>Batch Size (timesteps)</td><td>250K</td><td>250K</td><td>50K</td><td>50K</td></tr><tr><td>Discount</td><td>0.99</td><td>0.99</td><td>0.99</td><td>0.99</td></tr><tr><td>GAE 入</td><td>0.3</td><td>0.3</td><td>0.97</td><td>0.99</td></tr><tr><td>Mean KL</td><td>0.01</td><td>0.01</td><td>0.01</td><td>0.01</td></tr></table>",
1791
+ "bbox": [
1792
+ 174,
1793
+ 704,
1794
+ 897,
1795
+ 791
1796
+ ],
1797
+ "page_idx": 15
1798
+ },
1799
+ {
1800
+ "type": "text",
1801
+ "text": "D REINFORCEMENT LEARNING: ABLATIONS ",
1802
+ "text_level": 1,
1803
+ "bbox": [
1804
+ 173,
1805
+ 102,
1806
+ 563,
1807
+ 118
1808
+ ],
1809
+ "page_idx": 16
1810
+ },
1811
+ {
1812
+ "type": "text",
1813
+ "text": "Here we conduct a few ablations on RL tasks: we explore whether an agent relying only on TC layers or only on attention layers can solve the multi-armed bandit or MDP tasks from in Section 5.2. ",
1814
+ "bbox": [
1815
+ 176,
1816
+ 133,
1817
+ 825,
1818
+ 161
1819
+ ],
1820
+ "page_idx": 16
1821
+ },
1822
+ {
1823
+ "type": "text",
1824
+ "text": "First, we consider an SNAIL agent without attention layers (only TC layers, which amounts to a variant of the WaveNet architecture introduced by van den Oord et al. (2016a)). ",
1825
+ "bbox": [
1826
+ 173,
1827
+ 167,
1828
+ 823,
1829
+ 196
1830
+ ],
1831
+ "page_idx": 16
1832
+ },
1833
+ {
1834
+ "type": "text",
1835
+ "text": "When applied to the bandit domain, we found that this TC-only model performed just as well as a complete SNAIL. This is likely due to the simplicity of this task domain, as successful performance on bandit problems does not require maintaining a large memory of past experience. Indeed, many human designed algorithms (including the asymptotically optimal Gittins index) simply update running statistics at each timestep. ",
1836
+ "bbox": [
1837
+ 174,
1838
+ 204,
1839
+ 825,
1840
+ 275
1841
+ ],
1842
+ "page_idx": 16
1843
+ },
1844
+ {
1845
+ "type": "text",
1846
+ "text": "However, this model struggled in the MDP domain, where a more sophisticated algorithm is required. The results are in the table below (with those of a random agent, SNAIL, LSTM and MAML duplicated from Table 4 for reference). This agent’s asymptotic suboptimality suggests that its ability to internalize past experience is being saturated. ",
1847
+ "bbox": [
1848
+ 174,
1849
+ 280,
1850
+ 825,
1851
+ 337
1852
+ ],
1853
+ "page_idx": 16
1854
+ },
1855
+ {
1856
+ "type": "table",
1857
+ "img_path": "images/3ba1251132f153367c99e16e95b6f87819d212baceab63904ef927b3f1501a21.jpg",
1858
+ "table_caption": [
1859
+ "Table 8: Ablations of SNAIL in the MDP domain. "
1860
+ ],
1861
+ "table_footnote": [],
1862
+ "table_body": "<table><tr><td>N</td><td colspan=\"5\">Method</td></tr><tr><td></td><td>Random</td><td>LSTM</td><td>MAML</td><td>SNAIL</td><td>SNAIL, TC-only</td></tr><tr><td>10</td><td>0.482</td><td>0.752</td><td>0.563</td><td>0.766 ± 0.001</td><td>0.616 ±0.001</td></tr><tr><td>25</td><td>0.482</td><td>0.859</td><td>0.591</td><td>0.862 ± 0.001</td><td>0.684 ±0.001</td></tr><tr><td>50</td><td>0.481</td><td>0.902</td><td>1</td><td>0.908 ± 0.003</td><td>0.699 ±0.002</td></tr><tr><td>75</td><td>0.482</td><td>0.918</td><td></td><td>0.930 ± 0.002</td><td>0.726 ±0.002</td></tr><tr><td>100</td><td>0.481</td><td>0.922</td><td>1</td><td>0.941 ± 0.003</td><td>0.728 ±0.003</td></tr></table>",
1863
+ "bbox": [
1864
+ 174,
1865
+ 380,
1866
+ 673,
1867
+ 492
1868
+ ],
1869
+ "page_idx": 16
1870
+ },
1871
+ {
1872
+ "type": "text",
1873
+ "text": "Next, we considered a SNAIL agent without TC layers (only attention). Due to the sequential nature of RL tasks, we employed the positional encoding proposed by Vaswani et al. (2017b). This model, which is equivalent to their Transformer architecture, could not solve the bandit or MDP tasks. In both domains, its performance was no better than random. To no avail, we experimented with multiple blocks of attention and multiple heads per block. ",
1874
+ "bbox": [
1875
+ 173,
1876
+ 507,
1877
+ 825,
1878
+ 577
1879
+ ],
1880
+ "page_idx": 16
1881
+ },
1882
+ {
1883
+ "type": "text",
1884
+ "text": "We hypothesize that this architecture’s inadequacy stems from the fact that pure attentive lookups cannot easily process sequential information. Despite their infinite receptive field, they cannot directly compare two adjacent timesteps (such as a single state-action-state transition) in the same way as a single convolution can. The TC layers are essential because they allow the agent to locally analyse contiguous parts of a sequence to produce a better contextual representation over which to attend. ",
1885
+ "bbox": [
1886
+ 174,
1887
+ 584,
1888
+ 825,
1889
+ 654
1890
+ ],
1891
+ "page_idx": 16
1892
+ }
1893
+ ]
parse/train/B1DmUzWAW/B1DmUzWAW_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/B1DmUzWAW/B1DmUzWAW_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/LmUJqB1Cz8/LmUJqB1Cz8.md ADDED
@@ -0,0 +1,365 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # WINNING THE L2RPN CHALLENGE: POWER GRID MANAGEMENT VIA SEMI-MARKOV AFTERSTATE ACTOR-CRITIC
2
+
3
+ Deunsol $\mathbf { V o o n } ^ { * 1 }$ , Sunghoon $\mathbf { H o n g ^ { * 1 } }$ , Byung-Jun Lee2,3, Kee-Eung $\mathbf { K i m } ^ { 1 , 2 }$
4
+
5
+ 1Graduate School of AI, KAIST, Daejeon, Republic of Korea
6
+ 2School of Computing, KAIST, Daejeon, Republic of Korea
7
+ 3Gauss Labs Inc., Seoul, Republic of Korea
8
+ {dsyoon,shhong,bjlee}@ai.kaist.ac.kr, kekim@kaist.ac.kr
9
+
10
+ # ABSTRACT
11
+
12
+ Safe and reliable electricity transmission in power grids is crucial for modern society. It is thus quite natural that there has been a growing interest in the automatic management of power grids, exemplified by the Learning to Run a Power Network Challenge (L2RPN), modeling the problem as a reinforcement learning (RL) task. However, it is highly challenging to manage a real-world scale power grid, mostly due to the massive scale of its state and action space. In this paper, we present an off-policy actor-critic approach that effectively tackles the unique challenges in power grid management by RL, adopting the hierarchical policy together with the afterstate representation. Our agent ranked first in the latest challenge (L2RPN WCCI 2020), being able to avoid disastrous situations while maintaining the highest level of operational efficiency in every test scenario. This paper provides a formal description of the algorithmic aspect of our approach, as well as further experimental studies on diverse power grids.
13
+
14
+ # 1 INTRODUCTION
15
+
16
+ The power grid, an interconnected network for delivering electricity from producers to consumers, has become an essential component of modern society. For a safe and reliable transmission of electricity, it is constantly monitored and managed by human experts in the control room. Therefore, there has been growing interest in automatically controlling and managing the power grid. As we make the transition to sustainable power sources such as solar, wind, and hydro (Rolnick et al., 2019), power grid management is becoming a very complex task beyond human expertise, calling for data-driven optimization.
17
+
18
+ Yet, automatic control of a large-scale power grid is a challenging task since it requires complex yet reliable decision-making. While most approaches have focused on controlling the generation or the load of electricity (Venkat et al., 2008; Zhao et al., 2014; Huang et al., 2020), managing the power grid through the topology control (changing the connection of power lines and bus assignments in substations) would be the ultimate goal. By reconfiguring the topology of the power grid, it can reroute the flow of electricity, which enables the transmission of electricity from the producers to consumers efficiently and thus prevent surplus production. There are preliminary studies of the grid topology control in the power systems literature (Fisher et al., 2008; Khodaei & Shahidehpour, 2010), but due to its large, combinatorial, and non-linear nature, these methods do not provide a practical solution to be deployed to the real-world.
19
+
20
+ On the other hand, deep Reinforcement Learning (RL) has shown significant progress in complex sequential decision-making tasks, such as Go (Silver et al., 2016) and arcade video games (Mnih et al., 2015), purely from data. RL is also perceived as a promising candidate to address the challenges of power grid management (Ernst et al., 2004; Dimeas & Hatziargyriou, 2010; Duan et al., 2020; Zhang et al., 2020; Hua et al., 2019). In this regard, we present Semi-Markov
21
+
22
+ ![](images/fedd3ad78603d4e3081df9bb13eae6e26da3c2eb402b12bebf2fd862027c55d0.jpg)
23
+ Figure 1: An example of a power grid with 4 substations, 2 generators, 2 loads, and 5 lines. Starting from the left, a bus assignment action $a _ { t }$ reconfigures the grid and then the next state $s _ { t + 1 }$ is determined by exogenous event $e _ { t + 1 }$ , such as the change of power demands in loads. The diagonal line was experiencing overflow, but the action $a _ { t }$ is shown to revert the overflow. The power loss also reduced from 15 to 13.
24
+
25
+ Afterstate Actor-Critic (SMAAC), an RL algorithm that effectively tackles the challenges in power grid management.
26
+
27
+ One of the main challenges in RL for the real-world scale power grid management lies in its massive state and action space. We address the problem by adopting a goal-conditioned hierarchical policy with the afterstate representation. First, we represent state-action pairs as afterstates (Sutton & Barto, 2018), the state after the agent has made its decision but before the environment has responded, to efficiently cover the large state-action space. The afterstate representation can be much more succinct than the state-action pair representation when multiple state-action pairs are leading to an identical afterstate. For example, in the case of controlling the topology of the power grid, a pair of a current topology and an action of topology modification can be represented as a reconfigured topology, since the topology is deterministically reconfigured by the action. Then the next state is determined by random external factors, such as the change of power demands in load. Second, we extend this idea to a hierarchical framework, where the high-level policy produces a desirable topology under the current situation, and the low-level policy takes care of figuring out an appropriate sequence of primitive topology changes. Combined together, our hierarchical policy architecture with afterstates facilitates effective exploration for good topology during training.
28
+
29
+ Our algorithm ranked first in the latest international competition on training RL agents to manage power grids, Learning To Run a Power Network (L2RPN) WCCI 2020. In this paper, we further evaluate our approach using Grid2Op, the open-source power grid simulation platform used in the competition, by training and testing the agent in 3 different sizes of power grids. We show that the agent significantly outperforms all of the baselines in all grids except for the small grid where the task was easy for all algorithms.
30
+
31
+ # 2 BACKGROUND
32
+
33
+ # 2.1 GRID2OP ENVIRONMENT
34
+
35
+ We briefly overview Grid2Op, the open-source simulation platform for power grid operation used in the L2RPN WCCI 2020 challenge. Grid2Op models realistic concepts found in realworld operations used to test advanced control algorithms, which follow real-world power system operational constraints and distributions (Kelly et al., 2020).
36
+
37
+ The power grid is essentially a graph composed of nodes corresponding to substations that are connected to loads, generators, and power lines. The generator produces electricity, the load consumes electricity, and the power line transmits electricity between substations. The substation can be regarded as a router in the network, which determines where to transmit electricity. Grid2Op considers 2 conductors per substation, known as the double busbar system. This means that the elements connected to a substation, i.e. loads, generators, and power lines, can be assigned to one of the two busbars, and the power travels only over the elements on the same busbar. Thus, each substation can be regarded as being split into two nodes.
38
+
39
+ The state of the power grid consists of various features such as a topology configuration (the connectivity of each power line and the bus assignment in each substation), as well as the amount of power provided by each generator, required by each load, transmitted in each line, and so on. The power supplied by generators and demanded by loads changes over time, and the power transmitted in lines also changes according to the current topology configuration together with supply and demand. In addition, each line has its own capacity to transmit electricity and can be automatically disconnected when there is an overflow of electricity.
40
+
41
+ The agent can apply actions on substations and lines to managing the power grid. The action on a substation, called bus assignment, assigns the elements in the substation to a busbar. The action on a line, called line switch, disconnects (both ends of the line is assigned to neither bus) a line or reconnects a disconnected line. The agent is allowed to perform one line switch or one bus assignment action per step, and cannot successively perform actions on the same line or substation.
42
+
43
+ The power grid is simulated for a given period, typically for several days at a 5-minute interval. The simulation can terminate prematurely when the agent fails to manage the grid, i.e. (1) the amount of power required by loads are not delivered, which can happen if there are too many disconnected lines, or (2) a disconnected subgraph is formed as a result of applying an action. This is reflected in the failure penalty when measuring the performance of the agent, given by the number of remaining simulation time steps upon termination. Another important performance metric is the power loss penalty, given by the amount of power that disappeared during transmitting due to resistive loss. Thus, the goal of the agent is to operate the power grid both safely and efficiently by minimizing the failure penalty and the power loss penalty.
44
+
45
+ Figure 1 illustrates how the actions affect the state of the power grid using the bus assignment action as an example. The simulator provides 3 different sizes of power grids, (1) IEEE-5 is the power grid with 5 substations, (2) IEEE-14 is the power grid with 14 substations, and (3) L2RPN WCCI 2020 is the power grid with 36 substations. See Appendix A.1 for more details on the environment.
46
+
47
+ # 2.2 AFTERSTATES IN RL
48
+
49
+ Grid2Op provides a natural framework to use RL for operating power grids: we assume a Markov decision process (MDP) defined by $( S , \mathcal { A } , p , r , \gamma )$ to represent the RL task, where $S$ is the state space, $\mathcal { A }$ is the action space, and $p ( s _ { t + 1 } | s _ { t } , a _ { t } )$ is the (unknown) state transition probability, $r _ { t } = $ $r ( s _ { t } , a _ { t } ) \in \mathbb { R }$ is the immediate reward, and $\gamma \in ( 0 , 1 )$ is the discount factor. We assume learning a stochastic policy $\pi ( \boldsymbol { a } _ { t } | \boldsymbol { s } _ { t } )$ , which is a probability distribution over actions conditioned on states. The state and action value functions under $\pi$ are $\begin{array} { r } { \dot { V ^ { \pi } } ( s ) = \mathbb { E } _ { \pi } [ \sum _ { l \geq 0 } \gamma ^ { l } r _ { t + l } | s _ { t } = s ] } \end{array}$ and $Q ^ { \pi } ( s , a ) =$ $\begin{array} { r } { \mathbb { E } _ { \pi } [ \sum _ { l \ge 0 } \gamma ^ { l } r _ { t + l } | s _ { t } = s , a _ { t } = a ] } \end{array}$ respectively.
50
+
51
+ As shown in Figure 1 in the previous section, the transition in Grid2Op comprises two steps: the topological change that results directly from the action, and then the rest of the state changes that arise from exogenous events. This motivates the use of the afterstate (Sutton & Barto, 2018), also known as the post-decision state in Approximate Dynamic Programming (ADP) (Powell, 2007), which refers to the state after the agent has made its decision but before the arrival of new information.
52
+
53
+ Let us define the state $S$ as $( \mathcal { T } , X )$ where $\tau$ is the part of the state that is deterministically changed by an action, and $X$ as independent or affected indirectly from an action. Following the modeling in (Powell, 2007), the transition is decomposed into two parts using $f ^ { A }$ and $f ^ { E }$ :
54
+
55
+ $$
56
+ s _ { t + 1 } = [ \tau _ { t + 1 } , x _ { t + 1 } ] = f ^ { E } \left( [ \tau _ { t + 1 } , x _ { t } ] , e _ { t + 1 } \right) , \quad s _ { t } ^ { a _ { t } } = [ \tau _ { t + 1 } , x _ { t } ] = f ^ { A } \left( [ \tau _ { t } , x _ { t } ] , a _ { t } \right) ,
57
+ $$
58
+
59
+ where $\tau _ { t + 1 }$ , the deterministic part of $s _ { t + 1 }$ , is given by the the function $f ^ { A } ( s _ { t } , a _ { t } )$ , and $x _ { t + 1 }$ , the stochastic part, is given by the function $f ^ { E } ( s _ { t } ^ { a } , e _ { t + 1 } )$ where $e _ { t + 1 }$ is the source of the randomness in the transition sampled from some unknown distribution $p ^ { E }$ . Note that $e _ { t + 1 }$ itself can be included as a part in $x _ { t + 1 }$ .
60
+
61
+ Using the afterstate has a number of advantages. For example, if the state and the action spaces are very large but the set of unique afterstates is relatively small, learning the value function of afterstates would be much more efficient. The value of an afterstate $s ^ { a }$ under policy $\pi$ is defined as $\begin{array} { r } { V ^ { \pi } ( s ^ { a } ) = \mathbb { E } _ { \pi } [ \sum _ { l \ge 0 } \gamma ^ { l } r _ { t + l } | s ^ { a } = f ^ { A } ( s _ { t } , a _ { t } ) ] } \end{array}$ and its recursive form can be written as :
62
+
63
+ $$
64
+ V ^ { \pi } ( s _ { t } ^ { a _ { t } } ) = \mathbb { E } _ { e _ { t + 1 } \sim p ^ { E } , a _ { t + 1 } \sim \pi } \left[ r ( s _ { t } , a _ { t } ) + \gamma V ^ { \pi } ( f ^ { A } \left( s _ { t + 1 } , a _ { t + 1 } \right) ) | s _ { t + 1 } = f ^ { E } ( s _ { t } ^ { a _ { t } } , e _ { t + 1 } ) \right]
65
+ $$
66
+
67
+ The optimal afterstate value function and the optimal policy can be obtained by iteratively alternating between the policy evaluation by Eq. (2) and policy improvement :
68
+
69
+ $$
70
+ \pi _ { n e w } ( s _ { t } ) = \underset { a _ { t } } { \arg \operatorname* { m a x } } \left[ V ^ { \pi _ { o l d } } \left( f ^ { A } ( s _ { t } , a _ { t } ) \right) \right]
71
+ $$
72
+
73
+ Note that we cannot gain much from the afterstate representation when using the individual power grid operations as actions since they result in unique changes in the grid topology. However, we shall see that the afterstate becomes very powerful when we consider the sequences of grid operations as the action space, where their permutations result in identical changes in the final topology.
74
+
75
+ # 3 APPROACH
76
+
77
+ We first present the state space, the action space, and the reward function modeled in our approach. Then we briefly explain the unique challenge in Grid2Op and describe our approach to tackle the challenge. Finally, we will describe the overall architecture of the RL agent.
78
+
79
+ # 3.1 MODELING STATES, ACTIONS AND REWARDS
80
+
81
+ State We also define the state $S$ in the Grid2Op environment as $( \mathcal T , X )$ where $\tau$ is set of topology configuration (deterministically changed by action) and $X$ as various features as power demands and supplies (independent of the action), power being transmitted in each line (affected indirectly from the action) and so on. The detail about the features of states used in this work is provided in Appendix A.1.
82
+
83
+ Action We only consider bus assignment actions in our agent: we assume that it is desirable to have as many lines connected as possible since the overflow is less likely to occur when there are many routes for the power delivery. Thus, for line switch actions, we simply follow the rule of always reconnecting the power lines whenever they get disconnected due to the overflow.
84
+
85
+ Let us define the number of the substation as $N _ { s u b }$ and elements in ith substation as $S u b ( i )$ . Each total number of actions is and perform a bus assignm end of lines, generators, and loads in the substation can be assigned to one of two busbars, so the $\begin{array} { r } { | \mathcal { A } | = \sum _ { i = 0 } ^ { N _ { s u b } } 2 ^ { S u b ( i ) } } \end{array}$ (i.e. each action chooses one of the substations the approach taken by the winner of the previous challenge L2RPN 2019 (Lan et al., 2019), we made our agent act (i.e. intervene) only in hazardous situations. The condition for being hazardous is determined by the existence of a line in which the power flow is larger than the threshold hyperparameter. This naturally yields a semi-MDP setting for RL (Sutton et al., 1999).
86
+
87
+ Reward We define the reward in intermediate time steps to be the efficiency of the power grid, defined by the ratio of the total load to the total production, i.e. loadt . Note that if the ratio becomes greater than 1, the episode terminates with a large penalty for the failure since the production does not meet the demand.
88
+
89
+ # 3.2 ACTOR-CRITIC ALGORITHM WITH AFTERSTATES
90
+
91
+ The main challenge of the Grid2Op environment is the large state and action spaces. For the power grid with 36 substations used in the L2RPN WCCI 2020 competition, there are about 70,000 actions that yield unique changes to the topology. We address this problem by adopting the actor-critic architecture, where the policy and the value function are represented by function approximators. In addition, we use the afterstate representation to capture many state-action pairs being led to an identical afterstate by leveraging the transition structure, shown in Figure 1. For notational simplicity, all the derivations assume MDP in this section, which shall be extended to the semiMDP setting in the next section.
92
+
93
+ We use function approximators for the afterstate value function $V _ { \psi } ( s _ { t } ^ { a _ { t } } )$ and policy $\pi _ { \boldsymbol { \theta } } \big ( a _ { t } | \boldsymbol { s } _ { t } \big )$ parameterized by $\psi$ and $\theta$ respectively. The actor is trained to maximize $J _ { \pi }$ and the critic to minimize $L _ { V }$ :
94
+
95
+ $$
96
+ J _ { \pi } ( \theta ) = \mathbb { E } _ { s _ { t } \sim D , a _ { t } \sim \pi _ { \theta } ( \cdot | s _ { t } ) } \left[ V _ { \psi } ( f ^ { A } ( s _ { t } , a _ { t } ) ) \right]
97
+ $$
98
+
99
+ $$
100
+ \begin{array} { r } { L _ { V } ( \psi ) = \mathbb { E } _ { ( s _ { t } ^ { a _ { t } } , s _ { t + 1 } ) \sim D } \left[ \left( V _ { \psi } ( s _ { t } ^ { a _ { t } } ) - r ( s _ { t } , a _ { t } ) - \gamma \mathbb { E } _ { a _ { t + 1 } \sim \pi _ { \theta } ( \cdot | s _ { t + 1 } ) } \left[ V _ { \psi } ( f ^ { A } ( s _ { t + 1 } , a _ { t + 1 } ) ) \right] \right) ^ { 2 } \right] } \end{array}
101
+ $$
102
+
103
+ where the replay buffer $D$ stores the transition tuple $\left[ s _ { t } , s _ { t } ^ { a _ { t } } , r \bigl ( s _ { t } , a _ { t } \bigr ) , s _ { t + 1 } \right]$ for off-policy learning. The actor and the critic are trained using Soft Actor-Critic (SAC) (Haarnoja et al., 2018). Note that it learns a value function over an afterstate with a reconfigured topology, rather than a state-action pair, which is more succinct. Although the above equation defines a state-value critic, we can still train off-policy since it is essentially an action-value critic (i.e. an afterstate is defined by a state and an action).
104
+
105
+ Furthermore, we aim to apply the gradient estimator through a reparameterization trick similar to Haarnoja et al. (2018), since it is known to have lower variance than the likelihood ratio gradient estimator, resulting in stable learning. In order to update the actor via reparameterization trick, the transition $f ^ { A }$ must be differentiable, but it is not straightforward to define $f ^ { A }$ , which maps from the bus assignment actions to the topology configurations, as a differentiable formula. In the next section, we will mitigate the problem by re-defining the action space.
106
+
107
+ # 3.3 EXTENSION TO GOAL-CONDITIONED HIERARCHICAL FRAMEWORK
108
+
109
+ It is very challenging to take exploratory actions in the Grid2Op environment: if the agent takes random actions, the power grid would fail in a few time steps. For example, the agent with the random policy would mostly fail in less than 10 time steps, whereas the agent with the noop policy (naively maintaining the initial grid topology throughout time steps) would survive approximately 500 time steps on average. Thus, it is very difficult for the agent to explore diverse grid topology configurations that are significantly different from the initial ones, and thereby the random exploration policy (e.g. $\epsilon$ -greedy) would be often stuck at bad local optima that executes only one or two actions. Therefore, a more structured exploration is a key to successful training.
110
+
111
+ To this end, we extend the afterstate actor-critic algorithm to a two-level hierarchical decision model
112
+ by defining the goal topology colevel actions as the goal topolo guration as theconfiguration $g \in \{ 0 , 1 \} ^ { n }$ ction. Swhere $\begin{array} { r } { n = \sum _ { i = 0 } ^ { \tilde { N } _ { s u b } } S u b ( i ) } \end{array}$ e the high-, which is $\pi ^ { h }$
113
+ given by $s _ { t } ^ { g _ { t } } = \bar { [ } \tau _ { t + d } = \bar { g _ { t } } , \bar { x _ { t } } ] = f ^ { A } ( [ \tau _ { t } , x _ { t } ] , g _ { t } )$ where $t$ denotes the time a hazard occurs and $d$ denotes the time interval next hazard occurs. Note that we can now take full advantage of the afterstate representation since the equivalence of many different sequences of primitive actions (i.e.
114
+ individual bus assignment actions) that lead to the identical topology are now captured by the goal topology configuration.
115
+
116
+ In addition, exploration with goal topology is more effective than with primitive actions since the policy only needs to focus on where to $g o$ , i.e. the desirable topology under the current situation, without needing to care about how to get there, i.e. figuring out a suitable primitive action sequence that would yield the goal topology, with the help from an appropriate low-level policy. Finally, we can now use the reparameterization trick for the actor update in a straightforward manner since the result of $f ^ { A }$ is merely a copy of the action $g _ { t }$ .
117
+
118
+ The replay buffer $D$ stores the transition tuple, $[ s _ { t } , g _ { t } , r _ { t : t + d } , s _ { t + d } ]$ where $\begin{array} { r } { r _ { t : t + d } = \sum _ { t ^ { \prime } = t } ^ { t + d } \gamma ^ { t ^ { \prime } - t } r _ { t ^ { \prime } } } \end{array}$ as:
119
+
120
+ $$
121
+ \begin{array} { c } { { J _ { \pi } ( \theta ) = \mathbb { E } _ { g _ { t } \sim \pi _ { \theta } ^ { h } } \left[ V _ { \psi } \left( \left[ g _ { t } , x _ { t } \right] \right) \right] } } \\ { { J _ { V } ( \psi ) = \mathbb { E } _ { D } \left[ \left( V _ { \psi } ( s _ { t } ^ { g _ { t } } ) - r _ { t : t + d } - \gamma ^ { d } \mathbb { E } _ { g _ { t + d } \sim \pi _ { \theta } ^ { h } } \left[ V _ { \psi } \left( \left[ g _ { t + d } , x _ { t + d } \right] \right) \right] \right) ^ { 2 } \right] } } \end{array}
122
+ $$
123
+
124
+ As for the low-level policy, it is relatively simple to find the action sequence that changes the current topology into the goal topology: we just need to identify the set of substations that requires changes in the bus assignment and make appropriate reassignments therein. Thus, we take a rulebased approach for the low-level policy, $a _ { t } = \pi _ { r u l e } ^ { l } ( s _ { t } , g _ { t } )$ where the rule determines the order of substations to execute bus assignment actions. For example, we could impose a priority on substations such that the substations with the least room in the capacity make their bus reassignment first because they are the ones requiring the most urgent interventions. In the experiments section, we compare the results using various rules including a learning-based approach.
125
+
126
+ ![](images/575bcce0bc84f0692721d3319f5bf16bf78786fa81802926378fbc0036bebd41.jpg)
127
+ Figure 2: Overview of our model. The shared layer encodes $x _ { t }$ , the actor layer outputs the desirable topology $g _ { t }$ given the current state $s _ { t } = [ \tau _ { t } , x _ { t } ]$ , and the critic layer outputs the afterstate value given the afterstate $s _ { t } ^ { g _ { t } } = [ g _ { t } , x _ { t } ]$ .
128
+
129
+ # 3.4 IMPLEMENTATION
130
+
131
+ In order to leverage the interconnection structure of the power grid, we apply graph neural networks (GNN) (Scarselli et al., 2008). As illustrated in Figure 2, given the power grid with $n$ substations, we reshape $x _ { t }$ in the state $s _ { t } ~ = ~ [ \tau _ { t } , x _ { t } ]$ , given as a flat vector in Grid2Op, into $( M , \tilde { x } _ { t } )$ , where $M \in \{ 0 , 1 \} ^ { n \times n }$ is the adjacency matrix, and $\tilde { { \boldsymbol { x } } } _ { t } \in \mathbb { R } ^ { n \times k }$ is the node matrix with $k$ features. We adopted the transformer (Vaswani et al., 2017) as the GNN block, where the adjacency matrix $M$ is used for masking out the attention weights of nodes, following the architecture proposed by Parisotto et al. (2020). The actor and the critic share the lower layers, consisting of GNN blocks and linear layers. Additionally, we add an entropy of policy to the objective function of the actor and the critic, following the SAC formulation. Details of the architecture are provided in Appendix A.2.
132
+
133
+ # 4 RELATED WORKS
134
+
135
+ The topology control of the power grid through line switch has been previously studied in the power systems literature. Previous works, Fisher et al. (2008) and Khodaei & Shahidehpour (2010), solve the optimal transmission switching problem by mixed-integer programming. Since then, several heuristics have been introduced to tackle the computational cost (Fuller et al., 2012; Dehghanian et al., 2015; Alhazmi et al., 2019). Recently, Marot et al. (2018) explores bus assignment, more complex than the line switch, and presents an algorithm based on expert knowledge, which shows the utility of bus assignment. Their algorithm can find remedial bus assignment action that can revert overflow with a high probability of success and acceptable computational time. Han (2020) explores bus and line separation to solve the problem of short circuit current reduction in power systems through RL. Marot et al. (2020) models the power grid management through line switch and bus assignment as a RL task and releases an open-source simulation called Grid2Op for power grid management in multi-step time horizons. Additionally, they held the international power grid management competition, L2RPN 2019 challenge, where IEEE-14 is chosen for the competition environment, and Subramanian et al. (2020) present a simple deep RL approach for IEEE-14.
136
+
137
+ The winner of the L2RPN 2019 challenge (Lan et al., 2019) tackles the problem through pretraining and guided exploration. They collect massive data sets from the simulator which can restore particular states, and pre-train an agent to generate a good initial policy. For exploration in the large action space, they use guided exploration instead of random exploration, where the agent simulates the top few actions with high action values before performs its action to the environment at every time step. They also design the agent to act only in hazardous situations, and they train it using dueling Deep Q-Networks (DQN) (Wang et al., 2016) and prioritized replay buffer (Schaul et al., 2016).
138
+
139
+ <table><tr><td>Grid</td><td>Nsub</td><td>Nline</td><td>Ngen</td><td>Ntoad</td><td>[S</td><td>[A</td><td>n</td></tr><tr><td>IEEE-5</td><td>5</td><td>8</td><td>2</td><td>3</td><td>74</td><td>58</td><td>21</td></tr><tr><td>IEEE-14</td><td>14</td><td>20</td><td>6</td><td>11</td><td>194</td><td>160</td><td>57</td></tr><tr><td>L2RPNWCCI2020</td><td>36</td><td>59</td><td>22</td><td>37</td><td>590</td><td>66810</td><td>177</td></tr></table>
140
+
141
+ Table 1: Characteristics of the grids. $N _ { s u b }$ , $N _ { l i n e }$ , $N _ { g e n }$ , $N _ { l o a d }$ is the total number of substations, lines, generators, and loads. $| S |$ is the dimension of state, $| { \cal A } |$ is the number of unitary bus assignment actions, $n$ is the dimension of topology configuration.
142
+
143
+ The afterstate representation has been applied to address the resource allocation problems and dynamic routing problems. Singh & Bertsekas (1996) formulate the dynamic channel allocation problem in the cellular network as a dynamic programming problem using the afterstate value function. More recently, there has been research on utilizing the afterstate representation combined with ADP in a dynamic vehicle routing problem (Agussurja et al., 2019; Ulmer et al., 2019). Shah et al. (2020) also apply an afterstate-based deep RL method in a ride-pool matching problem. The hierarchical framework has long held the promise to tackle complex RL tasks (Dayan & Hinton, 1992; Parr & Russell, 1998; Barto & Mahadevan, 2003), and especially one of the prevailing approaches, the goal-conditioned hierarchical framework has recently achieved significant success in various tasks, such as simulated and real-world quadrupedal manipulation (Nachum et al., 2018a; 2020) and complex navigation (Levy et al., 2019; Zhang et al., 2020). However, to the best of our knowledge, none of the works combines the afterstate representation with a hierarchical framework.
144
+
145
+ GNN has been widely used in deep RL to directly tackle graph-structured problems or to represent the interaction between entities in a state. You et al. (2018) formulates goal-directed graph generation as MDP and solves designing a molecular structure with specific desired properties problem through an RL algorithm. Wang et al. (2018) apply GNN for continuous control by modeling controllable joints as nodes for a graph, and the physical dependencies between joints as edges to capture underlying graph structure. Zambaldi et al. (2019) adopt GNN for a navigation and planning task where complex relational reasoning is required to represent pairwise interactions between objects in a state, and Jiang et al. (2020) adopt it for learning cooperation in multi-agent environments by modeling agents as nodes in a graph where they communicate through GNN.
146
+
147
+ # 5 EXPERIMENTS
148
+
149
+ # 5.1 EXPERIMENTAL SETUP
150
+
151
+ Our experiments are conducted on the 3 power grids, IEEE-5 (smallest), IEEE-14, and L2RPN WCCI 2020 (largest, used in the challenge), provided by Grid2Op. Details of each grid are provided in Table 1. Each grid has a set of scenarios, and each scenario specifies the variations in the simulation such as the power supplies and demands at each time step. The length of each scenario is 864 time steps, which corresponds to 3 days at 5 minute time-resolution.
152
+
153
+ Since Grid2Op is relatively new to the research community, there are few RL methods applied to the grid topology control. Therefore we implement 3 baselines for performance comparison to verify the effectiveness of our method: (1) DDQN (Dueling DQN) has similar architecture as the last winner of the challenge, which learns the action-value function with the primitive action space (2) SAC is similar to DDQN but utilizes maximum entropy exploration following SAC algorithm. (3) SMAAC\AS is SMAAC without the afterstate representation, where we use action-value critic $Q ^ { \pi } ( s , g )$ . Thus, DDQN and SAC assume the MDP setting with primitive actions, SMAAC\AS assumes the goal-conditioned semi-MDP setting but without the afterstate representation. We additionally compare our approach with the 3rd placed participant in the L2RPN WCCI 2020 grid,1 (4) YZM, the only agent with publicly available code. This agent heuristically selects 596 actions among the primitive actions in prior and trains the agent with the reduced action space using Asynchronous Advantage Actor-Critic (Mnih et al., 2016). YZM additionally trains a backup agent
154
+
155
+ ![](images/bb5ecf15a07c1bd45ecd99a7dc0d2754377ccc986244415ddddce4b65fe575d2.jpg)
156
+ Figure 3: Training curves on 3 grids. Evaluation rollouts are performed every 1000 steps, and the shaded area represents the standard error.
157
+
158
+ <table><tr><td></td><td>IEEE-5</td><td>IEEE-14</td><td>L2RPNWCCI 2020</td></tr><tr><td>SMAAC</td><td>98.18± 0.31</td><td>69.66± 10.62</td><td>55.26 ± 5.82</td></tr><tr><td>DDQN</td><td>97.66 ± 1.04</td><td>29.11 ± 16.00</td><td>26.22 ± 7.39</td></tr><tr><td>SAC</td><td>98.26 ± 0.06</td><td>43.93 ± 0.02</td><td>39.1 ± 2.94</td></tr><tr><td>SMAAC\AS</td><td>93.79 ± 0.58</td><td>14.91: ±14.08</td><td>11.58 ± 2.74</td></tr><tr><td>YZM</td><td></td><td>1</td><td>28.34 ± 4.31</td></tr></table>
159
+
160
+ Table 2: Performance measured by the scaled score on the 10 test scenarios averaged over 3 instances with standard error. Each the best policy is obtained from the one with the highest performance in the validation scenarios during training.
161
+
162
+ with another set of actions and invokes the backup agent when the base agent can lead to overflow or termination by using the simulation function.2
163
+
164
+ For a fair comparison, all baselines except for YZM encode the input state through the same GNN architecture, and the agents get activated only in hazardous situations. The detail of implementation is provided in Appendix A.3 and the code is provided in https://github.com/sunghoonhong/SMAAC.
165
+
166
+ # 5.2 RESULTS
167
+
168
+ Figure 3 shows the total average scaled score of evaluation rollouts on the 10 validation scenario set during training: the scores are scaled in the range [-100,100], with the return of the no-op agent scaled and translated to 0, indicating how better the agent manages the power grid than the no-op agent in terms of safety and power efficiency. Each algorithm was trained and evaluated for 3 runs for averaging the scores.
169
+
170
+ As shown in Figure 3, all algorithms easily solve the smallest grid (IEEE-5). In the medium (IEEE14) and the large (L2RPN WCCI 2020) grids, both DDQN and SAC perform poorly. DDQN performs slightly better than the no-op agent in the medium grid and worse than the no-op agent in the largest grid. Exploring with primitive actions is extremely difficult since most actions can lead to disastrous termination, and thereby it cannot find grids other than the initial one. This yields the DDQN to be stuck at bad local optima, not much better than the no-op agent. SAC performs slightly better than DDQN in the larger grids. This is due to the sophisticated optimization scheme in SAC that is shown to affect a number of other RL benchmark tasks. However, in Grid2Op, the performance was barely better than the no-op agent due to the same challenge faced by DDQN.
171
+
172
+ Perhaps surprisingly, the performance of SMAAC\AS is no better than using primitive actions, although the hierarchical decision encourages deviating from the initial topology. Without the afterstate representation, the critic was not able to learn a good action-value function due to the massive state and action spaces. YZM uniquely leverages the simulation function and can show good performance from the beginning. However, exploring primitive actions is still hard even with the reduced set of actions, and it can be observed that YZM struggles to improve its performance. The performance on the test scenarios is provided in Table 2. We provide a qualitative analysis of how each agent behaves differently and how SMAAC remedies the hazardous power grid with a detailed example in Appendix A.4.
173
+
174
+ <table><tr><td></td><td>1 (ours)</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td><td>7</td></tr><tr><td>Scaled score CPU time (sec)</td><td>75.72 812.49</td><td>66.21 1406.45</td><td>48.62 1233.08</td><td>26.60 1322.02</td><td>17.98 116.43</td><td>4.31 96.56</td><td>0.07 118.58</td></tr></table>
175
+
176
+ Table 3: The top 7 leaderboard of the L2RPN WCCI 2020 Challenge among 50 participants.
177
+
178
+ On the contrary, our method learns significantly fast and outperforms all the baselines, effectively combining the benefits of the hierarchical decision model and the afterstate representation. Finally, Table 3 shows the leaderboard in the L2RPN WCCI 2020 challenge.
179
+
180
+ # 5.3 LOW-LEVEL RULE DESIGN
181
+
182
+ In this section, we examine how the low-level policy affects the overall performance. (1) FIXED gives priority to substations randomly that are predefined and fixed during training. We implement this low-level agent to find out whether our highlevel agent can manage the power network on the poor lowlevel agent. (2) CAPA gives high priority to substations with lines under high utilization of their capacity, which applies an action to substations that require urgent care. (3) DESC imposes a priority on large substations, i.e. many connected elements. A change to a large substation can be seen as making a large change in the overall topology with a single action. (4) OPTI optimizes execution order by training, making the actor additionally output $N _ { s u b }$ values that represents the priority of substations. All rules achieve similar performance with overlapped confidence intervals except for FIXED.
183
+
184
+ ![](images/192cd451605402843e6ea84fc695f81a8cb88d9dd6f5af968ccc111383a17925.jpg)
185
+ Figure 4: Comparison of 4 rules.
186
+
187
+ As shown in Figure 4, especially, CAPA converges fast compared to OPTI and DESC, hence we use this low-level agent in Section 5.2. We assume that most of the rules could achieve similar final performances since SMAAC is resilient to suboptimal low-level rules. By generating subgoals that include a subset of intended topology reconfiguration, the high-level policy can adapt to suboptimal low-level rules to form an optimal policy overall. However, as the result of FIXED suggests, a very poorly designed low-level policy can lead to instability and degrade the performance.
188
+
189
+ # 6 CONCLUSION
190
+
191
+ In this paper, we presented SMAAC, a deep RL approach demonstrated to be very effective for power grid management. SMAAC is an actor-critic algorithm that combines the afterstate representation with a hierarchical decision model. This is very important for power grid management modeled by Grid2Op, where actions are too primitive for effective exploration and many permutations of action sequences lead to identical changes in the power grid topology. Besides, naive explorations with primitive actions are subject to immediate failure due to the unique nature of power grid management. We empirically demonstrated that the presented method significantly outperforms several baselines in the real-world scale power grids, and ranked first in the latest international competition, L2RPN WCCI 2020 challenge. Our work shows the possibility of an intelligent agent that automatically operates the power grid for several days without expert help.
192
+
193
+ # ACKNOWLEDGMENTS
194
+
195
+ This work was supported by the National Research Foundation (NRF) of Korea (NRF2019M3F2A1072238 and NRF-2019R1A2C1087634), and the Ministry of Science and Information communication Technology (MSIT) of Korea (IITP No. 2019-0-00075, IITP No. 2020-0-00940 and IITP No. 2017-0-01779 XAI).
196
+
197
+ # REFERENCES
198
+
199
+ Lucas Agussurja, Shih-Fen Cheng, and Hoong Chuin Lau. A state aggregation approach for stochastic multiperiod last-mile ride-sharing problems. Transp. Sci., 53(1):148–166, 2019. doi: 10.1287/trsc.2018.0840. URL https://doi.org/10.1287/trsc.2018.0840.
200
+
201
+ M. Alhazmi, P. Dehghanian, S. Wang, and B. Shinde. Power grid optimal topology control considering correlations of system uncertainties. In 2019 IEEE/IAS 55th Industrial and Commercial Power Systems Technical Conference (I CPS), pp. 1–7, 2019.
202
+
203
+ Andrew G. Barto and Sridhar Mahadevan. Recent advances in hierarchical reinforcement learning. Discrete Event Dynamic Systems, 13(1–2):41–77, January 2003. ISSN 0924-6703. doi: 10.1023/ A:1022140919877. URL https://doi.org/10.1023/A:1022140919877.
204
+
205
+ Peter Dayan and Geoffrey E. Hinton. Feudal reinforcement learning. In Advances in Neural Information Processing Systems 5, [NIPS Conference], pp. 271–278, San Francisco, CA, USA, 1992. Morgan Kaufmann Publishers Inc. ISBN 1558602747.
206
+
207
+ Payman Dehghanian, Yaping Wang, Gurunath Gurrala, Erick Moreno-Centeno, and Mladen Kezunovic. Flexible implementation of power system corrective topology control. Electric Power Systems Research, 128:79–89, 11 2015.
208
+
209
+ A. L. Dimeas and N. D. Hatziargyriou. Multi-agent reinforcement learning for microgrids. In IEEE PES General Meeting, pp. 1–8, 2010. doi: 10.1109/PES.2010.5589633.
210
+
211
+ J. Duan, D. Shi, R. Diao, H. Li, Z. Wang, B. Zhang, D. Bian, and Z. Yi. Deep-reinforcementlearning-based autonomous voltage control for power grid operations. IEEE Transactions on Power Systems, 35(1):814–817, 2020. doi: 10.1109/TPWRS.2019.2941134.
212
+
213
+ D. Ernst, M. Glavic, and L. Wehenkel. Power systems stability control: reinforcement learning framework. IEEE Transactions on Power Systems, 19(1):427–435, 2004. doi: 10.1109/TPWRS. 2003.821457.
214
+
215
+ E. B. Fisher, R. P. O’Neill, and M. C. Ferris. Optimal transmission switching. IEEE Transactions on Power Systems, 23(3):1346–1355, 2008.
216
+
217
+ J. D. Fuller, R. Ramasra, and A. Cha. Fast heuristics for transmission-line switching. IEEE Transactions on Power Systems, 27(3):1377–1386, 2012.
218
+
219
+ Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 1861–1870, Stockholmsmässan, Stockholm Sweden, 10–15 Jul 2018. PMLR.
220
+
221
+ Sangwook Han. Control Method of Buses and Lines Using Reinforcement Learning for Short Circuit Current Reduction. Sustainability, 12(22):1–18, November 2020. URL https://ideas. repec.org/a/gam/jsusta/v12y2020i22p9333-d442736.html.
222
+
223
+ Haochen Hua, Yuchao Qin, Chuantong Hao, and Junwei Cao. Optimal energy management strategies for energy Internet via deep reinforcement learning approach. Applied Energy, 239 (C):598–609, 2019. doi: 10.1016/j.apenergy.2019.0. URL https://ideas.repec.org/ a/eee/appene/v239y2019icp598-609.html.
224
+
225
+ Q. Huang, R. Huang, W. Hao, J. Tan, R. Fan, and Z. Huang. Adaptive power system emergency control using deep reinforcement learning. IEEE Transactions on Smart Grid, 11(2):1171–1182, 2020. doi: 10.1109/TSG.2019.2933191.
226
+
227
+ Jiechuan Jiang, Chen Dun, Tiejun Huang, and Zongqing Lu. Graph convolutional reinforcement learning. In International Conference on Learning Representations, 2020. URL https:// openreview.net/forum?id $=$ HkxdQkSYDB.
228
+
229
+ Adrian Kelly, Aidan O’Sullivan, Patrick de Mars, and Antoine Marot. Reinforcement learning for electricity network operation. ArXiv, abs/2003.07339, 2020.
230
+
231
+ A. Khodaei and M. Shahidehpour. Transmission switching in security-constrained unit commitment. IEEE Transactions on Power Systems, 25(4):1937–1945, 2010.
232
+
233
+ Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Yoshua Bengio and Yann LeCun (eds.), International Conference on Learning Representations, 2015.
234
+
235
+ Tu Lan, Jiajun Duan, Bei Zhang, Di Shi, Zhiwei Wang, Ruisheng Diao, and Xiaohu Zhang. Aibased autonomous line flow control via topology adjustment for maximizing time-series atcs. arXiv preprint arXiv:1911.04263, 2019.
236
+
237
+ Andrew Levy, Robert Platt, and Kate Saenko. Hierarchical reinforcement learning with hindsight. In International Conference on Learning Representations, 2019. URL https://openreview. net/forum?id $=$ ryzECoAcY7.
238
+
239
+ A. Marot, B. Donnot, S. Tazi, and P. Panciatici. Expert system for topological remedial action discovery in smart grids. IET Conference Proceedings, pp. 43 (6 pp.)–43 (6 pp.)(1), January 2018. URL https://digital-library.theiet.org/content/conferences/ 10.1049/cp.2018.1875.
240
+
241
+ Antoine Marot, Benjamin Donnot, Camilo Romero, Luca Veyrin-Forrer, Marvin Lerousseau, Balthazar Donon, and Isabelle Guyon. Learning to run a power network challenge for training topology controllers. The Power Systems Computation Conference, 2020.
242
+
243
+ Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A. Rusu, Joel Veness, Marc G. Bellemare, Alex Graves, Martin Riedmiller, Andreas K. Fidjeland, Georg Ostrovski, Stig Petersen, Charles Beattie, Amir Sadik, Ioannis Antonoglou, Helen King, Dharshan Kumaran, Daan Wierstra, Shane Legg, and Demis Hassabis. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, 2015.
244
+
245
+ Volodymyr Mnih, Adria Puigdomenech Badia, Mehdi Mirza, Alex Graves, Timothy Lillicrap, Tim Harley, David Silver, and Koray Kavukcuoglu. Asynchronous methods for deep reinforcement learning. In Maria Florina Balcan and Kilian Q. Weinberger (eds.), Proceedings of The 33th International Conference on Machine Learning, pp. 1928–1937, 2016.
246
+
247
+ Ofir Nachum, Shixiang Gu, Honglak Lee, and Sergey Levine. Data-efficient hierarchical reinforcement learning. In Proceedings of the 32nd International Conference on Neural Information Processing Systems, NIPS’18, pp. 3307–3317, Red Hook, NY, USA, 2018a. Curran Associates Inc.
248
+
249
+ Ofir Nachum, Shixiang (Shane) Gu, Honglak Lee, and Sergey Levine. Data-efficient hierarchical reinforcement learning. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (eds.), Advances in Neural Information Processing Systems 31, pp. 3303–3313. 2018b.
250
+
251
+ Ofir Nachum, Michael Ahn, Hugo Ponte, Shixiang (Shane) Gu, and Vikash Kumar. Multi-agent manipulation via locomotion using hierarchical sim2real. In Leslie Pack Kaelbling, Danica Kragic, and Komei Sugiura (eds.), Proceedings of the Conference on Robot Learning, volume 100 of Proceedings of Machine Learning Research, pp. 110–121. PMLR, 30 Oct–01 Nov 2020. URL http://proceedings.mlr.press/v100/nachum20a.html.
252
+
253
+ Emilio Parisotto, H Francis Song, Jack W Rae, Razvan Pascanu, Caglar Gulcehre, Siddhant M Jayakumar, Max Jaderberg, Raphael Lopez Kaufman, Aidan Clark, Seb Noury, et al. Stabilizing transformers for reinforcement learning. In Proceedings of The 37th International Conference on Machine Learning, 2020.
254
+
255
+ Ronald Parr and Stuart Russell. Reinforcement learning with hierarchies of machines. In Proceedings of the 1997 Conference on Advances in Neural Information Processing Systems 10, NIPS ’97, pp. 1043–1049, Cambridge, MA, USA, 1998. MIT Press. ISBN 0262100762.
256
+
257
+ Warren B. Powell. Approximate Dynamic Programming: Solving the Curses of Dimensionality (Wiley Series in Probability and Statistics). Wiley-Interscience, USA, 2007.
258
+
259
+ David Rolnick, Priya L. Donti, Lynn H. Kaack, Kelly Kochanski, Alexandre Lacoste, Kris Sankaran, Andrew Slavin Ross, Nikola Milojevic-Dupont, Natasha Jaques, Anna WaldmanBrown, Alexandra Luccioni, Tegan Maharaj, Evan D. Sherwin, S. Karthik Mukkavilli, Konrad P. Körding, Carla Gomes, Andrew Y. Ng, Demis Hassabis, John C. Platt, Felix Creutzig, Jennifer Chayes, and Yoshua Bengio. Tackling climate change with machine learning. CoRR, abs/1906.05433, 2019. URL http://arxiv.org/abs/1906.05433.
260
+
261
+ Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. The graph neural network model. IEEE Transactions on Neural Networks, 20(1):61–80, 2008.
262
+
263
+ Tom Schaul, John Quan, Ioannis Antonoglou, and David Silver. Prioritized experience replay. In International Conference on Learning Representations, 2016.
264
+
265
+ Sanket Shah, Meghna Lowalekar, and Pradeep Varakantham. Neural approximate dynamic programming for on-demand ride-pooling. In The Thirty-Fourth AAAI Conference on Artificial Intelligence, AAAI 2020, The Thirty-Second Innovative Applications of Artificial Intelligence Conference, IAAI 2020, The Tenth AAAI Symposium on Educational Advances in Artificial Intelligence, EAAI 2020, New York, NY, USA, February 7-12, 2020, pp. 507–515. AAAI Press, 2020. URL https://aaai.org/ojs/index.php/AAAI/article/view/5388.
266
+
267
+ David Silver, Aja Huang, Chris J. Maddison, Arthur Guez, Laurent Sifre, George van den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershelvam, Marc Lanctot, Sander Dieleman, Dominik Grewe, John Nham, Nal Kalchbrenner, Ilya Sutskever, Timothy Lillicrap, Madeleine Leach, Koray Kavukcuoglu, Thore Graepel, and Demis Hassabis. Mastering the game of Go with deep neural networks and tree search. Nature, 529(7587):484–489, 2016.
268
+
269
+ Satinder Singh and Dimitri Bertsekas. Reinforcement learning for dynamic channel allocation in cellular telephone systems. In Proceedings of the 9th International Conference on Neural Information Processing Systems, NIPS’96, pp. 974–980, Cambridge, MA, USA, 1996. MIT Press.
270
+
271
+ Medha Subramanian, Jan Viebahn, Simon Tindemans, Benjamin Donnot, and Antoine Marot. Exploring grid topology reconfiguration using a simple deep reinforcement learning approach. CoRR, abs/2011.13465, 2020. URL https://arxiv.org/abs/2011.13465.
272
+
273
+ Richard S. Sutton and Andrew G. Barto. Reinforcement Learning: An Introduction. A Bradford Book, Cambridge, MA, USA, 2018.
274
+
275
+ Richard S. Sutton, Doina Precup, and Satinder Singh. Between mdps and semi-mdps: A framework for temporal abstraction in reinforcement learning. Artificial Intelligence, 112(1–2):181–211, 1999.
276
+
277
+ Marlin W. Ulmer, Barrett W. Thomas, and Dirk C. Mattfeld. Preemptive depot returns for dynamic same-day delivery. EURO Journal on Transportation and Logistics, 8(4):327 – 361, 2019. ISSN 2192-4376. doi: https://doi.org/10.1007/s13676-018-0124-0. URL http://www. sciencedirect.com/science/article/pii/S2192437620300479.
278
+
279
+ 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 30, pp. 5998–6008, 2017.
280
+
281
+ A. N. Venkat, I. A. Hiskens, J. B. Rawlings, and S. J. Wright. Distributed mpc strategies with application to power system automatic generation control. IEEE Transactions on Control Systems Technology, 16(6):1192–1206, 2008.
282
+
283
+ Tingwu Wang, Renjie Liao, Jimmy Ba, and Sanja Fidler. Nervenet: Learning structured policy with graph neural networks. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net, 2018. URL https://openreview.net/forum?id $=$ S1sqHMZCb.
284
+
285
+ Ziyu Wang, Tom Schaul, Matteo Hessel, Hado Van Hasselt, Marc Lanctot, and Nando De Freitas. Dueling network architectures for deep reinforcement learning. In Proceedings of the 33th International Conference on Machine Learning, pp. 1995–2003, 2016.
286
+
287
+ Jiaxuan You, Bowen Liu, Zhitao Ying, Vijay Pande, and Jure Leskovec. Graph convolutional policy network for goal-directed molecular graph generation. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (eds.), Advances in Neural Information Processing Systems, volume 31, pp. 6410–6421. Curran Associates, Inc., 2018. URL https://proceedings.neurips.cc/paper/2018/ file/d60678e8f2ba9c540798ebbde31177e8-Paper.pdf.
288
+
289
+ Vinícius Flores Zambaldi, David Raposo, Adam Santoro, Victor Bapst, Yujia Li, Igor Babuschkin, Karl Tuyls, David P. Reichert, Timothy P. Lillicrap, Edward Lockhart, Murray Shanahan, Victoria Langston, Razvan Pascanu, Matthew Botvinick, Oriol Vinyals, and Peter W. Battaglia. Deep reinforcement learning with relational inductive biases. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019. URL https://openreview.net/forum?id ${ . } = { }$ HkxaFoC9KQ.
290
+
291
+ Tianren Zhang, Shangqi Guo, Tian Tan, Xiaolin Hu, and Feng Chen. Generating adjacencyconstrained subgoals in hierarchical reinforcement learning. NeurIPS 2020, 2020.
292
+
293
+ Z. Zhang, D. Zhang, and R. C. Qiu. Deep reinforcement learning for power system applications: An overview. CSEE Journal of Power and Energy Systems, 6(1):213–225, 2020.
294
+
295
+ C. Zhao, U. Topcu, N. Li, and S. Low. Design and stability of load-side primary frequency control in power systems. IEEE Transactions on Automatic Control, 59(5):1177–1189, 2014.
296
+
297
+ # A APPENDIX
298
+
299
+ # A.1 ENVIRONMENT DETAIL
300
+
301
+ Grid2Op provides a simulation for power grid operation in real-time over several days at a 5-minute time-resolution. There are 3 power grids, IEEE-5, IEEE-14, and L2RPN WCCI 2020 (a subgraph of IEEE-118), where each has different size.
302
+
303
+ State Space The state of the power grid consists of 12 features presented in Table 4. We use 5 features provided by the environment and 1 feature defined by us, which we consider enough to represent the current state of the grid; Active power, rho, topology configuration, time step overflow, maintenance, hazard. The maintenance is a boolean vector representing whether a line is in maintenance, and the hazard represent is also a boolean vector representing whether electricity flows of a line is larger than a predefined threshold $\delta _ { h }$ . We use 0.9 for the threshold, and this threshold is same as the one we used for the hazardous state. Further details are provided in grid2op.readthedocs.io/en/latest/observation.html
304
+
305
+ Action Space The agent can apply actions on substations and lines to manage the power grid. The action on a substation, called bus assignment, assigns the elements in the substation to a busbar. The action on a line, called line switch, disconnects (both ends of line is assigned to neither bus) a line or reconnects a disconnected line. Let us define the number of lines in the power grid as $N _ { l i n e }$ , the number of substations as $N _ { s u b }$ , and the number of elements in ith substation as $S u b ( i )$ . Then at each time step the agent selects an action $a _ { t }$ from the action space $\mathcal { A }$ where $| \mathcal { A } | = N _ { l i n e } + 2 ^ { 2 } \times$ $\begin{array} { r } { N _ { l i n e } + \sum _ { i = 0 } ^ { N _ { s u b } } 2 ^ { S u b ( i ) } } \end{array}$ . 3
306
+
307
+ Rule There are some rules that make the task more realistic and challenging in Grid2Op. Lines can be automatically disconnected due to overflow of current, i.e. if more current flows than a line can hold for 3 time steps, a line is automatically disconnected. There is cooldown time for each component, i.e. the agent cannot apply its action to the same component successively and it is reactivated after 3 time steps later. There is a stochastic event called maintenance that happens intermittently. During maintenance, a line is disconnected by force and it cannot be reconnected.
308
+
309
+ Score The performance of an agent can be evaluated by a score which consists of power loss penalty, failure penalty, and redispatching penalty. It is defined as :
310
+
311
+ $$
312
+ S c o r e = \sum _ { t = 0 } ^ { t _ { o v e r } } ( p r o d _ { t } - l o a d _ { t } ) + \sum _ { t = t _ { o v e r } } ^ { t _ { e n d } } p e n a l t y + \sum _ { t = 0 } ^ { t _ { o v e r } } r e d i s p a t c h _ { t }
313
+ $$
314
+
315
+ where $t _ { o v e r }$ is the time game over occurs, $p r o d _ { t }$ is total amount of power supply by all generators, $l o a d _ { t }$ is total amount of power demand by loads. $p r o d _ { t } { - } l o a d _ { t }$ stands for total amount of power loss. The failure penalty is given by the sum over the large constant penalty for the remaining simulation time steps upon termination. The redispatching penalty is incurred when the agent do redispatching action, which controls generators to produce more or less electricity. Since redispatching action always incurs the additional penalty, we do not consider this action, so the redispatching penalty is always 0 in our case. Therefore, the goal of the agent is to operate the power grid both safely and efficiently by minimizing the failure penalty and the power loss penalty.
316
+
317
+ # A.2 MODEL ARCHITECTURE
318
+
319
+ Given the state $s = [ \tau , x ]$ , we reshape $x$ into $( M , \tilde { x } )$ , where $M \in \left\{ 0 , 1 \right\} ^ { n \times n }$ is the adjacency matrix, and $\tilde { x } \in \mathbb { R } ^ { n \times k }$ is the node matrix with $k$ features. The shared layers consisted of $L _ { s }$ GNN blocks that computes the node embedding of an input graph through transformer layers at their beginning. Given input nodes matrix $\tilde { x }$ , a linear layer with ReLU activation increases input dimension $k$ to embedding dimension $k _ { s }$ , which maps $\bar { \boldsymbol { x } } \in \mathbb { R } ^ { n \times d }$ to $H ^ { 0 } ~ \in ~ \mathbb { R } ^ { n \times k _ { s } }$ . After the linear layer, $L _ { s }$ transformer layers follow. The input of the transformer block at the $l ^ { t h }$ block is an embedding from the previous layer $H ^ { l - 1 }$ and the adjacency matrix $\mathcal { A }$ $\mathsf { l } , H ^ { l } = T r a n s f o r m e r ( H ^ { l - 1 } , A ) .$
320
+
321
+ Table 4: Details of features in the state
322
+
323
+ <table><tr><td>Name</td><td>Type</td><td>Size</td><td>Description</td></tr><tr><td>Date</td><td>int</td><td>6</td><td>The current year, month, day, hour of day, minute of hour, day of week.</td></tr><tr><td>Active power</td><td>float</td><td>Ngen+Ntoad +2 × Nline</td><td>Active power magnitude.</td></tr><tr><td>Reactive power</td><td>float</td><td>Ngen+ Nload +2 × Nline</td><td>Reactive power magnitude.</td></tr><tr><td>Voltage</td><td>float</td><td>Ngen + Nload +2 × Nline</td><td>Voltage magnitude.</td></tr><tr><td>Rho</td><td>float</td><td>Nline</td><td>The capacity of each power line,which is defined as ratio between current flow and thermal limit.</td></tr><tr><td>Topology Configuration</td><td>int</td><td>Ngen+Ntoad +2 × Nline</td><td>For each element (load, generator, ends of a line),it gives on which bus these elements is connected in its substation.</td></tr><tr><td>Line status</td><td>bool</td><td>Nline</td><td>The status of each line,whether it is connected or disconnected.</td></tr><tr><td>Time step overflow</td><td>int</td><td>Nline</td><td>The number of time steps each line is overflowed.</td></tr><tr><td>Timebefore cooldown line</td><td>int</td><td>Nline</td><td>How much cooldown time for each line is left. An agent cannot perform its action on lines with cooldown.</td></tr><tr><td>Timebefore cooldown sub</td><td>int</td><td>Nsub</td><td>Howmuch cooldown time for each substation is left. An agent cannot perform its action on substations with cooldown.</td></tr><tr><td>Time next maintenance</td><td>int</td><td>Nline</td><td>The time of the planned maintenance. An agent cannot act on the lines with</td></tr><tr><td>Duration next maintenance</td><td>int</td><td>Nline</td><td>maintenance. The number of time steps that the maintenance will last.</td></tr></table>
324
+
325
+ The actor’s head consists of $L _ { a }$ transformer blocks and 2 linear layers. Given the final node embedding $H ^ { L _ { e } }$ from the shared layers, the transformer layers in actor’s head takes it as the input and outputs node embedding $H ^ { L _ { a } } \in \mathbb { R } ^ { \dot { n } \times k _ { a } }$ . The first linear layer transforms 2D node embedding $H ^ { L _ { a } }$ to a vector node embedding $\mathbb { R } ^ { n }$ by reducing the embedding dimension $k _ { a }$ to 1, which is then concatenated with the current topology $\tau$ to form the state $s$ and the next linear layers outputs mean and standard deviation of the normal distribution. We sample continuous values $g ^ { \prime } \in \mathbb { R } ^ { n }$ from the normal distribution followed by tanh non-linearity and the desirable topology $g \in \{ 0 , 1 \} ^ { n }$ is constructed by assigning 1 to values in $g ^ { \prime }$ larger than predefined topology threshold $\delta _ { \tau }$ and 0 otherwise. We empirically find out that an agent without the threshold has difficulty learning in the large grid. However, an appropriate threshold helps stable learning and fast convergence.
326
+
327
+ The critic’s head has a similar structure except for linear layers. There are $L _ { c }$ GNN blocks in the critic that also takes $H ^ { L _ { e } }$ and outputs $H ^ { L _ { c } } ~ \in ~ \mathbb { R } ^ { n \times k _ { c } }$ . After transforming it into a vector node embedding $\mathbb { R } ^ { n }$ by a linear layer, $g ^ { \prime }$ is concatenated to $H ^ { L _ { c } }$ , and the following two linear layers take it as the input and outputs a scalar value. The overall architecture is shown in the Figure 2.
328
+
329
+ Although the agent observes all substations, we reduce the goal dimension $n$ to $\tilde { n }$ by restricting controllable substation. As we mentioned in subsection 3.1, we do not consider disconnection or reconnection. Therefore, the agent only controls substations that have more than 2 elements since there are only two possible cases, elements on a same bus (connection) or elements on a different bus (disconnection). For L2RPN WCCI 2020 grid, the agent acts on substations that have more than 5 elements in order for fast convergence. As a result, the goal dimension is reduced from 21 to 16 in IEEE-5, from 57 to 42 in IEEE-14, and from 177 to 79 in L2RPN WCCI 2020.
330
+
331
+ ![](images/c1a1c52c809d5f00edeb4ee88f2236d24eb3e784bcd14a0621ee5f7150919d2c.jpg)
332
+ Figure 5: Deviation from the initial grid. We measure L1 distance between the initial topology and the current topology during rollout in 2 test scenarios for each grids.
333
+
334
+ # A.3 IMPLEMENTATION DETAILS
335
+
336
+ For all models, we use 6 state features, active power, rho, topology configuration, time step overflow, maintenance, and hazard, where $\delta _ { h } = 0 . 9$ . All the agent acts only when there is a rho of a line, ratio between current flow and thermal limit that is capacity of a line, is larger than the $\delta _ { h } = 0 . 9$ . Additionally the last 6 states of a history are stacked to represent the input state, since the difference between the state at time step $t$ and $t + 1$ is not significantly different in Grid2Op. Since the first decimal place of reward does not change significantly $( \frac { l o a d _ { t } } { p r o d _ { t } }$ varies from 0.85 to 0.99 most of time), we transform it as $( \frac { l o a d _ { t } } { p r o d _ { t } } \times 1 0 - 9 ) \times 0 . 1$ to use the second decimal place. Adam optimizer (Kingma & Ba, 2015) is used for training with $5 e - 5$ learning rate and 128 batch size. We perform grid search to find the best hyperparameters for each model.
337
+
338
+ SMAAC SMAAC is our proposed model, which learns the afterstate value function on the goal space, namely topology configuration space. We use $L _ { s } ~ = ~ 6$ GNN blocks with embedding dimension $k _ { s } = 6 4 / 1 2 8$ for shared layers. For actor’s head, we use $L _ { a } ~ = ~ 3$ GNN blocks with embedding dimension $k _ { a } = 6 4 / 1 2 8$ . For critic’s head, we use $L _ { c } = 1$ GNN block with embedding dimension In practice $k _ { c } = 6 4 / 1 2 8$ followed by linear layers with or the high-level policy in Equ $\frac { k _ { c } + \tilde { n } } { 4 }$ hidden units. We us 6 is not discounted, $\delta _ { \tau } = 0 / 0 . 1 / 0 . 1 5$ $\begin{array} { r } { r _ { t : t + d } = \sum _ { t ^ { \prime } = t } ^ { t + d } r _ { t ^ { \prime } } } \end{array}$ and $\gamma$ is used instead of $\gamma ^ { d }$ following Nachum et al. (2018b). For the competition, we use $k _ { s } = 1 2 8$ , $k _ { c } = 1 2 8$ , $k _ { a } = 1 2 8$ , $\delta _ { \tau } = 0 . 3 5$ , and $\tau$ is used as an extra input feature for the shared layers.
339
+
340
+ SMAAC\AS SMAAC\AS is a baseline, which learns the action-value function of desired relative change in hierarchical framework. The overall architecture is similar to SMAAC, but the critic takes both desired relative change and topology configuration to learn on state-action pairs. We use $\delta _ { \tau } = 0 / 0 . 1 / 0 . 1 5$ .
341
+
342
+ SAC SAC is a baseline, which learns the action-value function on the primitive bus assignment action space. We use $L _ { s } = 6$ GNN blocks with embedding dimension $\mathit { \bar { k } } _ { s } = 6 4 / 1 2 8$ for shared layers. For actor’s head, we use $L _ { a } = 3$ GNN blocks with embedding dimension $k _ { a } \overset { \cdot } { = } 6 4 / 1 2 8$ . And, we use softmax to output categorical distribution while utilize relaxed categorical distribution in training. For critic’s head, we use $L _ { c } = 1$ GNN block with embedding dimension $k _ { c } = 3 2 / 6 4 / 1 2 8$ followed by concatenation with one-hot encoded action and one linear layer.
343
+
344
+ DDQN DDQN is a baseline, which learns the action-value function on the primitive bus assignment action space. It does not have separate actor but critic outputs $| { \cal A } |$ action-values. We use $L _ { s } = 6$ GNN blocks with embedding dimension $k _ { s } = 6 4 / 1 2 8$ for embedding layers. Following it, the critic has $L _ { c } = 1$ GNN blocks with embedding dimension $k _ { s } = 6 4 / 1 2 8$ . Then, it utilizes the technique used by dueling DQN, namely we compute action-values through both value network and advantage network.
345
+
346
+ ![](images/38176934d2f30ad299fa15ba34979e865b250a1f31ec845403a647160a3ba66a.jpg)
347
+ Figure 6: Illustration of a part of IEEE-14 managed by our agent. Large circle refers to a substation, small circle with $\mathbf { G }$ or L refers to a generator or load, and dots in green or yellow on a substation refers 2 busbars. The numbers beside lines are line usage ratio of current to line capacity and the darker color of the line means large ratio.
348
+
349
+ <table><tr><td>Threshold δh</td><td>Average scaled score</td></tr><tr><td>1.1</td><td>46.67 ± 5.92</td></tr><tr><td>1.0</td><td>52.11 ± 6.91</td></tr><tr><td>0.9</td><td>55.26 ± 5.82</td></tr><tr><td>0.8</td><td>36.08± 16.53</td></tr></table>
350
+
351
+ Table 5: Performance measured by the scaled score on the 10 test scenarios of L2RPN WCCI 2020 averaged over 3 instances with standard error. Each the best policy is obtained from the one with the highest performance in the validation scenarios during training.
352
+
353
+ # A.4 QUALITATIVE ANALYSIS
354
+
355
+ In this section, we present qualitative analysis based on example behaviors of agents. Figure 5 indirectly shows how each agent behaves in 2 grids. In the medium grid, after our agent reaches to the certain grid, it keeps staying in that grid. We speculate that the agent finds the optimal grid during training where electricity could distribute evenly all the time so no further actions required. It is reasonable in Grid2Op where a single action can potentially destroy the grid. On the other hand, it shows different behavior in the large grid. It changes the topology configuration diversely to revert the hazardous situations since the agent cannot find the grid such as the one in the medium grid.
356
+
357
+ SAC, which shows the best performance among the baselines, only changes a few of the topology configuration by executing only one or two actions in both grids, since the initial topology is strong local optima in Grid2Op. DDQN also shows similar behavior, but it shows worse performance than the SAC, since it changes the initial grid more. Likewise, SMAAC\AS that changes the topology the most shows the worst performance. It is extremely difficult to find the better topology than the initial one in Grid2Op without the effective exploration. The efficient learning together with the effective exploration is the key to successful management.
358
+
359
+ We further examine how SMAAC learned to revert a hazardous state back to the safe state. As shown in Figure 6, the line 4-5 (between substation 4 and 5) in $t$ is in the hazardous situation. At time step $t + 1$ , our agent makes bus assignment change in the substation 12 by assigning line 12-13 to yellow busbar. As a result, some amount of electricity that flows in the line 4-5 moves to line 4-3 to meet the load demand in the substation 13 where electricity is supplied only from the line 8-13 due to the action in $t + 1$ . Then the last action at $t + 2$ that changes the substation 3 further disperses electricity from the substation 4. In the end, a more balanced distribution is achieved.
360
+
361
+ # A.5 ACTIVATION OF THE AGENT
362
+
363
+ As we mentioned in subsection 3.1, the agent acts only in hazardous situations, i.e. there is a line of which usage rate (ratio between current flow and thermal limit) is larger than the threshold hyperparameter $\delta _ { h }$ . Note that the usage rate larger than 1.0 implies that a line is overflowed.
364
+
365
+ Table 5 shows how the final performance changes according to $\delta _ { h }$ in the test scenarios. If $\delta _ { h }$ is too high, e.g. $\delta _ { h } = 1 . 1$ , the agent may not be able to recover from the hazardous situation, and show relatively worse performance. On the other hand, the agent with $\delta _ { h } = 0 . 8$ faces more diverse situations, requiring far more samples to reach the performance of the other agents with higher $\delta _ { h }$ .
parse/train/LmUJqB1Cz8/LmUJqB1Cz8_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/LmUJqB1Cz8/LmUJqB1Cz8_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/LmUJqB1Cz8/LmUJqB1Cz8_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/S1l2IyrYPr/S1l2IyrYPr.md ADDED
@@ -0,0 +1,348 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # REDUCING SENTIMENT BIAS IN LANGUAGE MODELS VIA COUNTERFACTUAL EVALUATION
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ Recent improvements in large-scale language models have driven progress on automatic generation of syntactically and semantically consistent text for many real-world applications. Many of these advances leverage the availability of large corpora. While training on such corpora encourages the model to understand longrange dependencies in text, it can also result in the models internalizing the social biases present in the corpora. This paper aims to quantify and reduce biases exhibited by language models. Given a conditioning context (e.g. a writing prompt) and a language model, we analyze if (and how) the sentiment of the generated text is affected by changes in values of sensitive attributes (e.g. country names, occupations, genders, etc.) in the conditioning context, a.k.a. counterfactual evaluation. We quantify these biases by adapting individual and group fairness metrics from the fair machine learning literature. Extensive evaluation on two different corpora (news articles and Wikipedia) shows that state-of-the-art Transformer-based language models exhibit biases learned from data. We propose embedding-similarity and sentiment-similarity regularization methods that improve both individual and group fairness metrics without sacrificing perplexity and semantic similarity—a positive step toward development and deployment of fairer language models for real-world applications.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Text representation learning methods (word and sentence encoders) trained on large unlabeled corpora are widely used in the development of natural language processing systems (Mikolov et al., 2013; Pennington et al., 2014; Peters et al., 2018; Devlin et al., 2018). Progress in this area has led to consistent improvements of model performances on many downstream tasks. However, recent studies have found that both context-free and context-dependent word embedding models contain human-like semantic biases, including gender and race (Bolukbasi et al., 2016; Caliskan et al., 2017; Zhao et al., 2019). Zhao et al. (2018a) provide an insight into this phenomenon by showing that web corpora contain biases (e.g., gender) which are inherited by models trained on these datasets.
12
+
13
+ In this work, we focus on language models which have been shown to exhibit systematic biases (Lu et al., 2018; Bordia & Bowman, 2019; Qian et al., 2019). We train a Transformer-based language model (Vaswani et al., 2017; Radford et al., 2019; Dai et al., 2019) on two large corpora: Wikipedia articles from Wikitext-103 (Merity et al., 2016) and news articles from the English-language news corpus from WMT-19.1 We analyze systematic variations in sentiment scores of the text generated by the language model given a conditioning context, under different instantiations of control variables (e.g. country names, occupations, and person names) in the context. In a counterfactual experiment, we find that sentiment scores for the text generated by this language model vary substantially as we change the control variables in the context.
14
+
15
+ We propose two approaches to reduce counterfactual sentiment biases based on the concept of embedding similarity or sentiment similarity. In the first method, we encourage hidden states of the conditioning context to be similar irrespective of the instantiations of the control variables in the context. In the second method, we regularize the difference between sentiment scores of various instantiations of the control variables. Experiments with counterfactual conditioning demonstrate that both of these methods reduce sentiment biases while retaining the generation capability of the language model, as measured by perplexity and semantic similarity.
16
+
17
+ While specifying optimal model fairness behavior is difficult, our method provides a framework to address various fairness specifications and an important step toward the deployment of fairer language models. Our main contributions in this paper are:
18
+
19
+ • We demonstrate systematic counterfactual sentiment biases in large-scale language models.
20
+ • We present methods to quantify these biases by adopting individual and group fairness metrics from the fair machine learning literature. We propose embedding and sentiment similarity-based methods for training language models to be invariant to certain transformations of their inputs.
21
+ • We empirically demonstrate the efficacy of these methods to reduce counterfactual sentiment biases of language models.
22
+
23
+ We use a sentiment classifier as a proxy to measure biases in this paper. We note that the classifier itself is not perfect and might exhibit some biases. We leave investigations of an unbiased evaluator to future work.
24
+
25
+ # 2 BACKGROUND & RELATED WORK
26
+
27
+ Language models. Given an article $_ { \textbf { \em x } }$ composed of $n$ tokens $( x _ { 1 } , \cdots , x _ { n } )$ , a language model estimates the probability $p ( { \pmb x } )$ of $_ { \textbf { \em x } }$ occurring in natural language under the assumption that the joint probability factorizes over the tokens as follows:
28
+
29
+ $$
30
+ p ( \pmb { x } ) = \prod _ { i = 1 } ^ { n } p ( x _ { i } | x _ { 1 } , \cdots , x _ { i - 1 } ) = \prod _ { i = 1 } ^ { n } p ( x _ { i } | \pmb { x } _ { 1 : i - 1 } )
31
+ $$
32
+
33
+ where the prefix $\pmb { x } _ { 1 : i - 1 } : = ( x _ { 1 } , \cdot \cdot \cdot , x _ { i - 1 } )$ for convenience. Once a language model is learned, the model can be used to generate sequences that capture long-range dependencies (Graves, 2013). By using the conditional probability $p ( x _ { i } | \mathbf { x } _ { 1 : i - 1 } )$ , we sample the next token $x _ { i }$ given a prefix (or conditioning inputs) $\pmb { x } _ { 1 : i - 1 }$ . Then we can iteratively use the generated token $x _ { i }$ along with the previous prompt as the conditioning inputs to generate the next token $x _ { i + 1 }$ using $p ( x _ { i + 1 } | \pmb { x } _ { 1 : i } )$ . We use Transformer-based models (Vaswani et al., 2017) to learn the probability $p ( x _ { i } | \mathbf { x } _ { 1 : i - 1 } )$ , which has been demonstrated to scale to large self-supervised models with outstanding performance in generation quality and representation learning, including BERT (Devlin et al., 2018), GPT-2 (Radford et al., 2019), MT-DNN (Liu et al., 2019), XLNet (Yang et al., 2019) and many others.
34
+
35
+ Bias in Natural Language Processing Systems. Besides learning to favor language of the authors’ demographic group (Hovy & Søgaard, 2015), NLP models pick up on a variety of cultural associations and undesirable social biases (Caliskan et al., 2017). Systematic imbalances were observed across NLP tasks, e.g. as gender bias in coreference resolution (Zhao et al., 2018a; Rudinger et al., 2018), visual semantic role labeling (Zhao et al., 2017), image captioning (Hendricks et al., 2018), or in text classification (Dixon et al., 2018; Garg et al., 2019). Concretely in sentiment analysis, Kiritchenko & Mohammad (2018) found systematic biases with respect to race and gender across more than 200 systems.
36
+
37
+ For word embeddings, occupational gender bias has been identified and addressed by measuring projections onto linear gender-related subspaces of word representations (Bolukbasi et al., 2016; Lemoine et al., 2018; Zhao et al., 2018b; Bordia & Bowman, 2019). Gonen & Goldberg (2019) however pointed out limitations to this approach: bias in word embeddings appear indirectly in other ways, even after minimizing linear projections onto gender-related subspaces.
38
+
39
+ Bias in Language Modeling. Rather than debiasing word embeddings, Lu et al. (2018) proposed counterfactual data augmentation as a remedy to occupation-specific gender biases, and found that it can much better retain model performance than debiasing word embeddings, especially in language modeling. Qian et al. (2019) on the other hand regularize a generative language model to predict similar log-probabilities for either option of a gendered word pair. Zhao et al. (2019) and Basta et al.
40
+
41
+ (2019) demonstrate gender bias in pretrained language modeling representations (ELMo), which translates into downstream tasks, but do not consider language generated by the ELMo language model.
42
+
43
+ In contrast to these prior works on debiasing language models, we probe language models’ generated output using a sentiment analysis system. We do not rely on gendered word pairs for data augmentation or for approximating linear gender subspaces. Furthermore, prior work mostly considers only comparatively small language modeling training sets. In contrast, we investigate bias in Transformer-based models with a similar number of parameters to GPT-2. Our models are trained on English news articles from the WMT-19 news translation challenge, which contains 40GB of text, as well as WikiText-103, with more than 100 million tokens.
44
+
45
+ Fairness. A fundamental group fairness definition is “equality of odds”, which requires false positive and false negative prediction rates to be equal across demographic subgroups (Hardt et al., 2016). However, this definition of group fairness can be superficially satisfied through postprocessing methods at a potential cost on individual fairness, which requires similar individuals to be treated similarly (Dwork et al., 2012), as well as other statistical fairness metrics. Furthermore, ignoring the data generating causal graph of the problem may lead to “corrective discrimination”, that is, discrimination caused by the very procedure to enforce statistical fairness criteria.
46
+
47
+ Hence causal inference tools are leveraged in fairness research to deal with these problems that may occur in satisfying statistical fairness criteria. Similar to individual fairness, counterfactual fairness requires same model predictions before and after intervention on sensitive attributes in data generating causal graphs (Kusner et al., 2017; Kilbertus et al., 2017). In our problem setting, we consider the counterfactual fairness goal using a causal graph representing the text generation model with input features, latent features, model outputs and predictions as nodes of the graph. We aim towards counterfactual fairness by de-biasing the learned representation of inputs in the latent space of the text generative model, contributing to a family of methods to learn fair representations (Beutel et al., 2017; Zemel et al., 2013; Creager et al., 2019; Edwards & Storkey, 2016; Louizos et al., 2016) and enforcing independence between sensitive attributes and prediction outputs (Calders et al., 2009; Lemoine et al., 2018; Jiang et al., 2019).
48
+
49
+ # 3 COUNTERFACTUAL EVALUATION OF SENTIMENT BIASES
50
+
51
+ Motivating Examples. To illustrate the problem of biased sentiment, we condition a large-scale language model (for model details see Section 5) with the prefix “You are a/an <occupation>, and you”, with the same random seeds using “accountant” and “designer” as occupation. We sample 1,000 sentences with both prefixes and measure the sentiment scores of the generated sentences. In Fig. 1, we observe systematic sentiment differences in the generated output. In Table 1, we present some generated examples with large sentiment difference. The systematic difference in the sentiment distribution, further exemplified in these particular generated sentences, demonstrates that there exists a bias in sentiment with respect to a counterfactual change of occupation in the given context. To further quantify this problem and reduce the biases, we illustrate the problem formulation and our proposed approaches below.
52
+
53
+ Fairness Specification. Given a predefined specification on a set of sensitive attribute variables $\mathcal { C }$ (e.g., occupations, genders, or countries), we would like to reduce their counterfactual sentiment biases in language models for every sensitive attribute variable $A \in { \mathcal { C } }$ . We let $\mathcal { A }$ be the set of possible values of the variable $A$ , and use $a$ to denote a particular value of $A$ (e.g. $\mathcal { A } = \{ \mathrm { f e m a l e } , \mathrm { m a l e } \}$ , $a =$ female). For each input sequence $_ { \textbf { \em x } }$ containing sensitive tokens $\phi ( a )$ (such as $\phi ( a ) = \{ \mathrm { h e }$ , his, him, husband, $\mathrm { P a u l } \}$ for $a = { \mathrm { m a l e } } )$ , we generate a counterfactual input $\tilde { \pmb x }$ to $_ { \textbf { \em x } }$ by replacing all occurrences of each sensitive token in $\phi ( a )$ with the corresponding token in $\phi ( \tilde { a } )$ , where $\tilde { a }$ is another sensitive attribute randomly chosen from the set ${ \mathcal { A } } \setminus \{ { \bar { a } } \}$ , and leaving all other non-sensitive tokens of $_ { \textbf { \em x } }$ unchanged. Given a fixed/pre-defined sentiment classifier $f _ { s }$ and a pretrained language model $L M$ , so that the random variable $L M ( { \pmb x } )$ is a sentence sampled from the language model conditioned on $_ { \textbf { \em x } }$ , define the random variable $S ( { \pmb x } ) = f _ { s } ( L M ( { \pmb x } ) )$ to be the generated sentence sentiment score in $[ 0 , 1 ]$ , and denote its distribution by $P _ { S } ( { \pmb x } )$ . For binary sentiment classification, typically we compute prediction $\hat { y } = S > \tau$ given a decision threshold $\tau$ .
54
+
55
+ ![](images/d62897551bcf1199d432fbe3a6b91f8b1da7bce2f1c8d21da043d078d128aacd.jpg)
56
+ Figure 1: Sentiment score histogram using “You are a/an $<$ Occupation $>$ , and you” as an input to a baseline language model.
57
+
58
+ ![](images/7a0bed406dc9494a927e8a8a4e83e08d0d264847627d119e7f39126557d2f228.jpg)
59
+ Figure 2: Sentiment score histogram using “You are a/an <Occupation>, and you” as an input to a language model trained with our proposed method.
60
+
61
+ Table 1: Generated samples with counterfactual inputs using a baseline language model.
62
+
63
+ <table><tr><td>Sent.</td><td>Occupation</td><td>Sample From Generated Text</td></tr><tr><td>0.05</td><td>accountant</td><td>“often cannot fit on a lorry to escape the clutches of prying eyes.”</td></tr><tr><td>0.65</td><td>accountant</td><td>“have a job 7O percent where you are a supervisor. .</td></tr><tr><td>0.36</td><td>designer</td><td>“re doing incredibly wellin the commercial industry. Too much of the fashion industry is chasing his toned disappointments and getting rid of big dishes.&quot;</td></tr><tr><td>0.65</td><td>designer</td><td>“bought your prints just before the designer was named the new executive chairman of V John Fusco in February,</td></tr></table>
64
+
65
+ One fundamental fairness concept is “demographic parity”, which requires equal positive classification rates across subgroups, i.e. $p ( \hat { y } \mid A = a ) = p ( \hat { y } \mid A = a ^ { \prime } )$ for any sensitive attributes $a , a ^ { \prime }$ . We also measure deviation from it, “demographic disparity”, by differences between the subgroup positive rates $| p ( { \hat { y } } \mid A = a ) - p ( { \hat { y } } \mid A = a ^ { \prime } ) |$ (Prop. 3.1 in (Dwork et al., 2012)). Applying this concept to measuring fairness between counterfactual pairs, demographic disparity is the difference between positive sentiment rates of $S ( { \pmb x } )$ and $S ( \tilde { { \boldsymbol { x } } } )$ , $| \bar { p ( S ( } x ) > \tau \bar { ) - p ( S ( } \tilde { x } \bar { ) > } \tau \bar { ) } |$ .
66
+
67
+ However, often we do not want our fairness goal to be dependent on a predetermined decision threshold $\tau$ , since $\tau$ may be user-defined or simply not known at training time. We require the raw output distributions $P _ { S } ( { \pmb x } )$ and $P _ { S } ( \tilde { \pmb { x } } )$ to match – instead of the binary prediction $\hat { y }$ , which is called “Strong Demographic Parity” (Jiang et al., 2019). We also extend the deviation measurement by computing statistical disparity averaged over uniformly random choices of $\tau \in [ 0 , 1 ]$ , that is, $\bar { \mathbb { E } } _ { \tau \sim \mathcal { U } [ 0 , 1 ] } \ | \ \bar { p ( S ( \pmb { x } ) > \tau ) } - \bar { p ( S ( \tilde { \pmb { x } } ) > \tau ) } \ |$ where $\mathcal { U }$ denotes the random uniform distribution. This quantity is equal to the Wasserstein-1 distance between distributions $P _ { S } ( { \pmb x } )$ and $P _ { S } ( \tilde { \pmb { x } } )$ (Jiang et al., 2019),
68
+
69
+ $$
70
+ \begin{array} { r } { \mathcal { W } _ { 1 } ( P _ { S } ( \pmb { x } ) , P _ { S } ( \pmb { \tilde { x } } ) ) = \mathbb { E } _ { \tau \sim \mathcal { U } [ 0 , 1 ] } \mid p ( S ( \pmb { x } ) > \tau ) - p ( S ( \pmb { \tilde { x } } ) > \tau ) \mid . } \end{array}
71
+ $$
72
+
73
+ Sentiment bias by counterfactual evaluation is then the Wasserstein-1 distance between output sentiment distributions $P _ { S }$ of the original input $\mathbf { x }$ and its counterfactual $\tilde { \mathbf { x } }$ . Thus our counterfactual fairness specification for sentiment biases, i.e. counterfactual sentiment bias, is
74
+
75
+ $$
76
+ \begin{array} { r } { \mathcal { W } _ { 1 } ( P _ { S } ( { \pmb x } ) , P _ { S } ( { \pmb x } ) ) < \epsilon , } \end{array}
77
+ $$
78
+
79
+ for any sensitive attribute $a \in { \mathcal { A } }$ and a chosen threshold $\epsilon > 0$ . This fairness formulation also expresses individual fairness which requires similar individuals to be treated similarly (Dwork et al., 2012), provided that similarity is defined by having the same non-sensitive tokens. Note that this specification addresses the output distribution of a generative model, in which it differs from prior work on specifications in NLP models which concern individual predictions of discriminative models (Huang et al., 2019; Jia et al., 2019).
80
+
81
+ Fairness Evaluation. For each sensitive variable $A \in { \mathcal { C } }$ , we measure the individual fairness and group fairness metrics from distributions of sentiment scores $P _ { S }$ on the evaluation set in the following way.
82
+
83
+ Individual Fairness Metric. Based on the fairness property of the Wasserstein-1 distance (Eq. 1), we compute Average Individual Fairness by averaging Wasserstein-1 distance between the sentiment score distribution of every evaluation sentence $P _ { S } ( { \pmb x } )$ and each of its counterfactual sentence $P _ { S } ( \tilde { \pmb { x } } )$ across all $M$ templates2 for sensitive variable $A$ . Formally, this is
84
+
85
+ $$
86
+ \frac { 2 } { M | \mathcal { A } | ( | \mathcal { A } | - 1 ) } \sum _ { m = 1 } ^ { M } \sum _ { a , \tilde { a } \in \mathcal { A } } \mathcal { W } _ { 1 } \big ( P _ { S } ( \pmb { x } ^ { m } ) , P _ { S } ( \widetilde { \pmb { x } ^ { m } } ) \big )
87
+ $$
88
+
89
+ where the inner sum is over all |A|(|A|−1) unordered pairs of distinct $a , \tilde { a }$ in $\mathcal { A } , a , \tilde { a }$ are the sensitive attributes of ${ \pmb x } ^ { m } , \widetilde { { \pmb x } ^ { m } }$ respectively.
90
+
91
+ Group Fairness Metric. The evaluation sentences are separated into $| { \mathcal { A } } | \ = \ K$ disjoint subgroups, assigning a sentence to group $a$ if it contains sensitive tokens from $\phi ( a )$ . For example, when sensitive variable $A \ =$ gender, we have $K \ = \ 2$ for $A \ = \ \{ \mathrm { m a l e , f e m a l e } \}$ and $\mathbf { \bar { \phi } } ( \mathrm { m a l e } ) = \{ \mathrm { h e , h i s , h i m }$ , husband, $\mathrm { P a u l } , \ldots \}$ .
92
+
93
+ For each subgroup $a \in { \mathcal { A } }$ , we measure the Wasserstein-1 distance between the sentiment distribution of all generated sentences of inputs from this subgroup, denoted $P _ { S } ^ { a }$ , and that over the entire evaluation set, denoted $P _ { S } ^ { * }$ . Then we report the sum of all subgroup Wasserstein-1 distances as the Total Group Fairness metric, i.e.,
94
+
95
+ $$
96
+ \sum _ { a \in \mathcal { A } } W _ { 1 } ( P _ { S } ^ { a } , P _ { S } ^ { * } ) .
97
+ $$
98
+
99
+ # 4 LANGUAGE MODELS WITH FAIR SENTIMENT DISTRIBUTION
100
+
101
+ Given an input prefix $\pmb { x } _ { 1 : i }$ with $i$ tokens, $\pmb { x } _ { 1 : i } = \left( x _ { 1 } , \cdots , x _ { i } \right)$ , where the token $x _ { i } \in \phi ( a )$ is associated with a group $a$ of a sensitive attribute (e.g., countries, names, occupations), we construct a perturbed prefix by replacing $x _ { i }$ with a token $\tilde { x } _ { i } \in \phi ( \tilde { { a } } )$ from a different group $\tilde { a }$ , where fairness between the two groups should be maintained. We obtain a perturbed prefix $\tilde { { \pmb { x } } } _ { 1 : i } = ( { \pmb { x } } _ { 1 : i - 1 } , \tilde { { \ b { x } } } _ { i } )$ .
102
+
103
+ To train the language model towards reducing counterfactual sentiment bias, we want to ensure that the language model produces similar sentiment distributions for the two prefixes. Specifically, we would like the Wasserstein-1 distance between the sentiment distributions of generated sentences, $P _ { S } ( \pmb { x } _ { 1 : i } )$ and $P _ { S } ( \tilde { \mathbf { x } } _ { 1 : i } )$ , to be small, as shown in Eq. 2. In practice, it is prohibitively expensive to sample a distribution of generated sequences for every $\pmb { x } _ { 1 : i }$ and $\tilde { { \mathbf { x } } } _ { 1 : i }$ Instead, we use hidden features from the language model as a proxy to represent the distribution of future generated sequences, since $p ( x _ { i + 1 } , x _ { i + 2 } , \cdot \cdot \cdot | { \pmb x } _ { 1 : i } )$ and $p ( x _ { i + 1 } , x _ { i + 2 } , \cdot \cdot \cdot | \tilde { { \pmb x } } _ { 1 : i } )$ depend on the hidden states of the language model conditioned on $\pmb { x } _ { 1 : i }$ and $\tilde { \mathbf { x } } _ { 1 : i }$ , respectively.
104
+
105
+ We explore two approaches: Fairness through embedding similarity and Fairness through sentiment similarity by exploiting the hidden states of the language model. Given an $L$ -layer transformer based language model with an input $\pmb { x } _ { 1 : i }$ , we let $h ( \pmb { x } _ { 1 : i } ) \overset { - } { = } \big ( \bar { h } ^ { ( 1 ) } ( \pmb { x } _ { 1 : i } ) , \cdots , h ^ { ( L ) } ( \pmb { x } _ { 1 : i } ) \big )$ denote the hidden features (or contextual embeddings) obtained by its hidden layers.
106
+
107
+ Fairness through embedding similarity. In this approach, we want to make sure the embedding $h ^ { ( j ) } ( \pmb { x } _ { 1 : i } )$ and $h ^ { ( j ) } ( \tilde { \pmb { x } } _ { 1 : i } )$ are close enough, since the joint probabilities $p ( x _ { i + 1 } , x _ { i + 2 } , \cdot \cdot \cdot | { \pmb x } _ { 1 : i } )$ and $p ( x _ { i + 1 } , x _ { i + 2 } , \cdot \cdot \cdot | \tilde { { \pmb x } } _ { 1 : i } )$ are determined by the embedding. We call it the “embedding similarity” approach. We define the fairness loss as a distance between the embeddings, denoted as $d ( h ( \pmb { x } _ { 1 : i } ) , h ( \tilde { \pmb { x } } _ { 1 : i } )$ . We consider using the cosine distance:
108
+
109
+ $$
110
+ d ( h ( \pmb { x } _ { 1 : i } ) , h ( \tilde { \pmb { x } } _ { 1 : i } ) ) : = 1 - \frac { \bar { h } ( \pmb { x } _ { 1 : i } ) ^ { T } \bar { h } ( \tilde { \pmb { x } } _ { 1 : i } ) } { \| \bar { h } ( \pmb { x } _ { 1 : i } ) \| \| \bar { h } ( \tilde { \pmb { x } } _ { 1 : i } ) \| }
111
+ $$
112
+
113
+ where $\begin{array} { r } { \bar { h } ( { \pmb x } ) = \sum _ { j = L _ { s } } ^ { L } \alpha _ { j } h ^ { ( j ) } ( { \pmb x } ) , 1 \le L _ { s } \le L } \end{array}$ is a “summary” of embedding layer features, and $\alpha _ { j }$ is the weight of $h ^ { ( j ) } ( { \pmb x } )$ . Typically, the embedding in earlier layers captures word-level information and embedding in later layers represents more high-level semantics (Tenney et al., 2019). In our case, since we want to capture high-level semantics (e.g., sentiments), we use the average over the last 2 layers’ embedding as the extracted features $\bar { h } ( { \bf x } )$ $( L _ { s } = L - 2 , \alpha _ { L - 1 } = 0 . 5 , \alpha _ { L } = 0 . 5 )$ ). We find that averaging too many layers can make the difference between $\bar { h } ( { \pmb x } )$ and $h ( \tilde { \pmb { x } } _ { 1 : i } ) _ { , }$ ) very small, reducing the effectiveness of regularization.
114
+
115
+ ![](images/58a733ea4b74d8b0e887c441817b82b92c4df9fa0170fd0e090bf85d29bec840.jpg)
116
+ Figure 3: Proposed language model debiasing pipeline (the third step in curriculum training).
117
+
118
+ The main drawback of enforcing embedding similarity is that this regularization can be too strong, as we require the hidden representations (and thus the joint probabilities) to be as close as possible: in the worst case, the model can learn to ignore individual members and generate the same texts for all of them. Despite being completely fair in this extreme case, model performance may suffer since the generated text should contextually depend on $x _ { i }$ or $\tilde { x } _ { i }$ .
119
+
120
+ Fairness through sentiment similarity. To overcome the above-mentioned drawback, we propose an alternative method for eliminating sentiment biases using sentiment classifiers. Instead of measuring $d ( h ( \pmb { x } _ { 1 : i } ) , h ( \tilde { \pmb { x } } _ { 1 : i } ) )$ directly, we first apply the same sentiment classifier $f _ { s }$ to both $h ( \pmb { x } _ { 1 : i } )$ and $h ( \tilde { \mathbf { x } } _ { 1 : i } )$ , and measure $d ( f _ { s } ( h ( \pmb { x } _ { 1 : i } ) ) , f _ { s } ( h ( \tilde { \pmb { x } } _ { 1 : i } ) ) )$ instead. Note that the output of $f _ { s }$ can be multi-dimensional (e.g., a hidden layer in the sentiment classifier), and we can measure the distance via cosine similarity. The classifier $f _ { s }$ can be seen as a projection from $h ( { \pmb x } )$ to a subspace that ideally only contains sentiment related information. If such a perfect projection exists, we can regularize the sentiment difference between the two inputs without affecting the model’s perplexity. The detailed implementation of $f _ { s }$ is introduced in Section 5.1.
121
+
122
+ On one hand, this classifier-based sentiment similarity approach avoids the strong regularization in enforcing embedding similarity and can potentially produce better language models with lower perplexity on test sets. On the other hand, the effectiveness of this method is correlated with the quality of the sentiment classifier (or sentiment “projection”).
123
+
124
+ Implementation - Three-Step Curriculum Training. We use a three-step curriculum training scheme to implement the proposed embedding similarity, sentiment similarity approaches. First, we train a language model using regular cross-entropy loss for predicting the next token given all the previous tokens, as done in typical language training setting; a good validation perplexity ensures a relatively good hidden feature space has been learned. Second, using this language model, we train a sentiment classifier $f _ { s }$ (e.g., a simple multilayer perceptron (MLP)) using the extracted features from the language model; since sentiment labels are generally unavailable for large-scale corpus, we label a subset of training data with Google Cloud sentiment analysis API.3 Third, we continue language model training with the addition of fairness loss $\mathcal { L } _ { \mathrm { f a i r n e s s } }$ based on “embedding similarity” or “sentiment similarity” with a regularization parameter $\lambda$ , and in the meanwhile the language model is still trained on regular negative log-likelihood (NLL) or cross-entropy loss $( \mathcal { L } _ { \mathrm { L M } } )$ on predicting the next token of unperturbed input $_ { \textbf { \em x } }$ . The loss function for an input sequence $_ { \textbf { \em x } }$ is:
125
+
126
+ $$
127
+ \begin{array} { r } { \mathcal { L } ( \pmb { x } ) = \mathcal { L } _ { \mathrm { L M } } ( \pmb { x } ) + \lambda \mathcal { L } _ { \mathrm { f a i r n e s s } } ( h ( \pmb { x } _ { 1 : i } ) , h ( \tilde { \pmb { x } } _ { 1 : i } ) ) } \end{array}
128
+ $$
129
+
130
+ We refer the third step as “debiasing step”, which is illustrated in Figure 3. The second and third steps may be repeated if desired.
131
+
132
+ # 5 EXPERIMENTS
133
+
134
+ # 5.1 DATASETS AND TRAINING DETAILS
135
+
136
+ To reflect recent advancements in language modeling, we train two TransformerXL (Dai et al., 2019) language models similar in scale to GPT-2 (Radford et al., 2019) on a medium-scale corpus of Wikipedia articles, WikiText-103, and a large-scale corpus of English new articles, from the WMT-19 document-level translation task, which we will refer to as WMT-19.4 We do not use the pre-trained GPT-2 models themselves, for which the training data is not publicly available. The wikitext103 dataset (Merity et al., 2016) consists of 28,591 articles and over 100 million tokens extracted from high quality Wikipedia articles. We use 28,471 articles for training, 60 articles for validation and 60 articles for tests. WMT-19 consists of 14,635,198 English news articles; we take the last 10,000 for evaluation with 1,000 for validation and the final 9,000 articles as a test set.
137
+
138
+ On the WikiText-103 dataset, we train a TransformerXL language model composed of 18-layer transformers with an embedding size of 1024, 8 attention heads, and 257M parameters. The model achieved 17.06 perplexity on the validation set. On the WMT-19 dataset, we train a language model composed of 48 layer transformers with an embedding size of 1024, comprising 2,125 million parameters. The model achieved 17.46 perplexity on the validation set.
139
+
140
+ For both models, we train a 3-layer MLP network with hidden layer size 128 as the sentiment classifier $f _ { s }$ for sentiment feature projection. Labels for sentence sentiment are generated using the Google Cloud sentiment analysis API. As it does not generate perfect labels we only keep sentences with relatively high sentiment scores (normalized scores close to 0 or 1) to reduce noise in label generation. The sentiment classifier achieves over $98 \%$ test accuracy on both datasets.
141
+
142
+ # 5.2 EVALUATION SETUP
143
+
144
+ Sensitive groups and attributes. To measure the counterfactual sentiment biases in language models, we examine three categories of sensitive attributes: Country, Occupation, and Name. Country contains 10 representative countries and Occupation contains 29 common occupations; for Country or Occupation, sensitive tokens $\phi ( a )$ are always a singleton containing either the country name or the occupation. For Name, we consider gender as the sensitive attribute and sensitive tokens for both subgroups $\phi ( A = { \mathrm { m a l e } } )$ and $\phi ( A =$ female) contain 17 different common names. All attributes are detailed in Appendix A.
145
+
146
+ Sentence templates. For each category of sensitive attributes, we design a set of $M = 1 0$ templates to evaluate the counterfactual sentiment biases. Each template is a sentence prefix with length $i _ { m } , m \in [ M ]$ containing a placeholder that will be replaced by a sensitive token in $\phi ( a )$ for each sensitive attribute value $a \in { \mathcal { A } }$ . In other words, for each template we complete it by inputting the appropriate sensitive token for every $a \in { \mathcal { A } }$ , forming a prefix ${ \boldsymbol { x } } _ { 1 : i _ { m } }$ which is used as a conditioned input to the language model. We apply an external sentiment classifier $f _ { s }$ on the generated sentences and sample 1000 sentences conditioned on each input prefix. All templates are described in Appendix A.
147
+
148
+ Sentiment analysis and fairness metrics. Since it is impractical to evaluate each generated sentence manually, we evaluate the generated sentences using both Google Cloud sentiment API and a simpler, counting-based sentiment classifier. We design the counting-based sentiment classifier by simply counting the number of positive opinion words $p$ and the number of negative opinion words $n$ (Hu & Liu, 2004) and define the sentiment scores as $p / ( p + n )$ and 0.5 if no opinion words exist. The counting-based sentiment classifier is introduced because the sentiment API is a blackbox model and may itself contain bias, as researchers have discovered in many existing automatic sentiment analysis systems (Kiritchenko & Mohammad, 2018). The simple counting-based method, while being less accurate, is less prone to giving biased judgments as it does not contain sensitive attributes and only contains opinion words. Furthermore, since we use the same sentiment API to create the sentiment label of the training data for creating the sentiment projection, it is better to use a different metric to gauge sentiment and avoid overfitting a specific sentiment analysis system.
149
+
150
+ As mentioned in Section 3, we report average individual fairness (Eq. 3), and total group fairness (Eq. 4) for Country, Occupation and Name detailed above.
151
+
152
+ Trade-off between relevance and fairness. We found that the model could generate irrelevant sentences if trained using a very large debiasing regularization parameter. In this case, the model is “fair” in the sense that it completely ignores the sensitive attributes. However this deteriorates the original language model’s performance, and we expect the model to ideally capture semantics given by these attributes. Thus, it is important to evaluate the trade-off between generation quality and fairness. We use three metrics for this purpose. First, we report the perplexity on the whole test set and the perplexity on a subset of the test set that includes articles with at least one sensitive attribute. The perplexity on a whole test set reflects the language model performance overall. Given the sensitive attributes only exist in a small fraction of test data, we report perplexity over a subset of test set specifically to examine the language model performance related to the sensitive attributes. Second, we measure the semantic similarity using an universal sentence encoder (Cer et al., 2018). We calculate the cosine similarity between the embedding of the attribute word and the generated sentences. We define a generated sentence to be similar if the cosine similarity is above a given threshold (set to 0.2 empirically). We report semantic similarity ratio as a proxy on whether the generated sentences capture the original semantics. Note we empirically find it is helpful to measure whether models generate irrelevant sentences when there is a large semantic similarity ratio drop (e.g. $> 2 0 \%$ ) compared to baseline language models. Smaller semantic similarity ratio difference might not reflect obvious semantic changes in generation quality.
153
+
154
+ Model Selection. We train language models using both embedding-similarity and semanticsimilarity losses with different regularization strengths. Based on the losses in the validation set, we report $\lambda = \{ 1 0 , 1 0 0 \}$ for embedding-similarity and $\lambda = \{ 1 0 0 , 1 0 0 0 \}$ for sentiment-similarity on WMT-19. On WikiText-103, we report $\lambda = \{ 1 , 1 0 \}$ for embedding-similarity and $\lambda = \{ 1 0 , 1 0 0 \}$ for sentiment-similarity. Note that it is unlikely that our models overfit the templates – during the training process (see Figure 3), we do not add these templates explicitly to the dataset.
155
+
156
+ # 5.3 EVALUATION RESULTS
157
+
158
+ In Tables 2 and 3, we report the performance on WMT-19 and WikiText-103 dataset, respectively. Each fairness metric is evaluated twice using the sentiment API and counting-based sentiment scores. We can observe that the proposed approaches achieve reduced bias in both individual fairness and group fairness metrics.
159
+
160
+ For each method, we report the performance of two models with two different regularization parameters for the fairness loss. A larger regularization produces a model with less bias; however the semantic similarity scores also reduces slightly. We can balance the trade-off between model performance by choosing different regularization parameters. A very strong regularization (not shown in Tables 2 and 3) will produce a model that generates almost identical texts (under the same random seed) given different countries, names or occupations in the prefix. We give an example of generated text in this situation in Appendix C.
161
+
162
+ We observe that our proposed methods can retain a similar level of perplexity on the subset of test set containing sensitive attributes (PPLs). Since we do not further train our baseline model on this subset, with the additional epochs of the debiasing step, subset perplexity $( \mathrm { P P L } ^ { s } )$ can sometimes improve a little bit, while reducing counterfactual sentiment biases under individual fairness and group fairness measure. Note the perplexity on the full test set (PPL) is almost unaffected by our proposed methods, which can be potentially related to the use of a small learning rate during the debiasing step and the use of small regularization parameters.
163
+
164
+ In most settings, we found that the sentiment-similarity method performs slightly better - when semantic similarities are similar, models trained using sentiment-similarity regularization achieve better fairness metrics (e.g. Emb. Sim. $\lambda = 1 0 0$ versus Sent. Sim $\lambda = 1 0 0 0$ in Country of Table 2). When fairness scores are similar, sentiment-similarity regularization achieves better semantic similarity (e.g., Emb. Sim. $\lambda = 1 0$ versus Sent. Sim. $\lambda = 1 0 0 0$ in Occupation of Table 2; Emb. Sim. $\lambda = 1 0 0$ versus Sent. Sim. $\lambda = 1 0 0 0$ in Name of Table 2.)
165
+
166
+ Table 2: Performance for language models trained on WMT-19, where “PPL” and “PPLs” represent the perplexity at the BPE level on the full test set and the subset of the test set that contains the sensitive attributes, respectively. “Semantic Sim.” lists sentence similarity ratios, and “I. F.” and “G. F.” indicate average individual fairness and total group fairness, respectively. Metrics with superscript c are based on the counting-based sentiment classifier; otherwise they use sentence sentiments from the sentiment API. Note that except for “Semantic Sim.”, lower numbers are better.
167
+
168
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=7>Country</td></tr><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>PPL</td><td rowspan=1 colspan=1>PPLS</td><td rowspan=1 colspan=1>Semantic Sim.</td><td rowspan=1 colspan=1>I.F.</td><td rowspan=1 colspan=1>G.F.</td><td rowspan=1 colspan=1>L.F.C</td><td rowspan=1 colspan=1>G.F.C</td></tr><tr><td rowspan=1 colspan=1>Baseline</td><td rowspan=1 colspan=1>17.9</td><td rowspan=1 colspan=1>18.7</td><td rowspan=1 colspan=1>55.2</td><td rowspan=1 colspan=1>0.0210</td><td rowspan=1 colspan=1>0.142</td><td rowspan=1 colspan=1>0.0440</td><td rowspan=1 colspan=1>0.307</td></tr><tr><td rowspan=1 colspan=1>Emb.Sim.入=10</td><td rowspan=1 colspan=1>18.1</td><td rowspan=1 colspan=1>18.8</td><td rowspan=1 colspan=1>51.7</td><td rowspan=1 colspan=1>0.0145</td><td rowspan=1 colspan=1>0.090</td><td rowspan=1 colspan=1>0.0291</td><td rowspan=1 colspan=1>0.174</td></tr><tr><td rowspan=1 colspan=1>Emb.Sim.入=100</td><td rowspan=1 colspan=1>18.1</td><td rowspan=1 colspan=1>18.9</td><td rowspan=1 colspan=1>49.3</td><td rowspan=1 colspan=1>0.0114</td><td rowspan=1 colspan=1>0.062</td><td rowspan=1 colspan=1>0.0226</td><td rowspan=1 colspan=1>0.133</td></tr><tr><td rowspan=1 colspan=1>Sent.Sim.=100</td><td rowspan=1 colspan=1>18.0</td><td rowspan=1 colspan=1>18.8</td><td rowspan=1 colspan=1>55.8</td><td rowspan=1 colspan=1>0.0158</td><td rowspan=1 colspan=1>0.102</td><td rowspan=1 colspan=1>0.0316</td><td rowspan=1 colspan=1>0.209</td></tr><tr><td rowspan=1 colspan=1>Sent.Sim.入=1000</td><td rowspan=1 colspan=1>18.1</td><td rowspan=1 colspan=1>18.9</td><td rowspan=1 colspan=1>49.3</td><td rowspan=1 colspan=1>0.0102</td><td rowspan=1 colspan=1>0.048</td><td rowspan=1 colspan=1>0.0196</td><td rowspan=1 colspan=1>0.101</td></tr></table>
169
+
170
+ Occupation
171
+
172
+ <table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>PPL</td><td rowspan=1 colspan=1>PPL8</td><td rowspan=1 colspan=1>Semantic Sim.</td><td rowspan=1 colspan=1>IF</td><td rowspan=1 colspan=1>G.F.</td><td rowspan=1 colspan=1>I.FC</td><td rowspan=1 colspan=1>G.F.C</td></tr><tr><td rowspan=1 colspan=1>Baseline</td><td rowspan=1 colspan=1>17.9</td><td rowspan=1 colspan=1>18.0</td><td rowspan=1 colspan=1>49.4</td><td rowspan=1 colspan=1>0.0196</td><td rowspan=1 colspan=1>0.327</td><td rowspan=1 colspan=1>0.0309</td><td rowspan=1 colspan=1>0.482</td></tr><tr><td rowspan=1 colspan=1>Emb. Sim.入=10</td><td rowspan=1 colspan=1>17.8</td><td rowspan=1 colspan=1>17.9</td><td rowspan=1 colspan=1>30.9</td><td rowspan=1 colspan=1>0.0111</td><td rowspan=1 colspan=1>0.160</td><td rowspan=1 colspan=1>0.0188</td><td rowspan=1 colspan=1>0.251</td></tr><tr><td rowspan=1 colspan=1>Emb.Sim.入=100</td><td rowspan=1 colspan=1>18.5</td><td rowspan=1 colspan=1>18.5</td><td rowspan=1 colspan=1>28.6</td><td rowspan=1 colspan=1>0.0098</td><td rowspan=1 colspan=1>0.127</td><td rowspan=1 colspan=1>0.0160</td><td rowspan=1 colspan=1>0.181</td></tr><tr><td rowspan=1 colspan=1>Sent.Sim.=100</td><td rowspan=1 colspan=1>17.7</td><td rowspan=1 colspan=1>17.7</td><td rowspan=1 colspan=1>38.9</td><td rowspan=1 colspan=1>0.0130</td><td rowspan=1 colspan=1>0.196</td><td rowspan=1 colspan=1>0.0210</td><td rowspan=1 colspan=1>0.289</td></tr><tr><td rowspan=1 colspan=1>Sent. Sim.入=1000</td><td rowspan=1 colspan=1>17.9</td><td rowspan=1 colspan=1>17.9</td><td rowspan=1 colspan=1>32.0</td><td rowspan=1 colspan=1>0.0107</td><td rowspan=1 colspan=1>0.144</td><td rowspan=1 colspan=1>0.0160</td><td rowspan=1 colspan=1>0.174</td></tr></table>
173
+
174
+ Name
175
+
176
+ <table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>PPL</td><td rowspan=1 colspan=1>PPLs</td><td rowspan=1 colspan=1>Semantic Sim.</td><td rowspan=1 colspan=1>I.F.</td><td rowspan=1 colspan=1>G.F.</td><td rowspan=1 colspan=1>I.F.C</td><td rowspan=1 colspan=1>G.F.C</td></tr><tr><td rowspan=1 colspan=1>Baseline</td><td rowspan=1 colspan=1>17.9</td><td rowspan=1 colspan=1>18.0</td><td rowspan=1 colspan=1>42.4</td><td rowspan=1 colspan=1>0.0161</td><td rowspan=1 colspan=1>0.0090</td><td rowspan=1 colspan=1>0.0259</td><td rowspan=1 colspan=1>0.0095</td></tr><tr><td rowspan=1 colspan=1>Emb. Sim.入=10</td><td rowspan=1 colspan=1>17.8</td><td rowspan=1 colspan=1>17.8</td><td rowspan=1 colspan=1>36.6</td><td rowspan=1 colspan=1>0.0126</td><td rowspan=1 colspan=1>0.0067</td><td rowspan=1 colspan=1>0.0201</td><td rowspan=1 colspan=1>0.0025</td></tr><tr><td rowspan=1 colspan=1>Emb. Sim.入=100</td><td rowspan=1 colspan=1>18.1</td><td rowspan=1 colspan=1>18.1</td><td rowspan=1 colspan=1>28.0</td><td rowspan=1 colspan=1>0.0100</td><td rowspan=1 colspan=1>0.0055</td><td rowspan=1 colspan=1>0.0151</td><td rowspan=1 colspan=1>0.0019</td></tr><tr><td rowspan=1 colspan=1>Sent. Sim.入=100</td><td rowspan=1 colspan=1>17.8</td><td rowspan=1 colspan=1>17.8</td><td rowspan=1 colspan=1>40.7</td><td rowspan=1 colspan=1>0.0134</td><td rowspan=1 colspan=1>0.0086</td><td rowspan=1 colspan=1>0.0203</td><td rowspan=1 colspan=1>0.0039</td></tr><tr><td rowspan=1 colspan=1>Sent. Sim.入=1000</td><td rowspan=1 colspan=1>17.9</td><td rowspan=1 colspan=1>17.9</td><td rowspan=1 colspan=1>32.1</td><td rowspan=1 colspan=1>0.0106</td><td rowspan=1 colspan=1>0.0058</td><td rowspan=1 colspan=1>0.0162</td><td rowspan=1 colspan=1>0.0015</td></tr></table>
177
+
178
+ Table 3: Performance for language models trained on WikiText-103, where “PPL” and “PPLs” represent the perplexity at the word level on the full test set and the subset of the test set that contains the sensitive attributes, respectively. “Semantic Sim.” lists sentence similarity ratios, and “I. F.” and “G. F.” indicate average individual fairness and total group fairness, respectively. Metrics with superscript c are based on the counting-based sentiment classifier; otherwise they use sentence sentiments from the sentiment API. Note that except for “Semantic Sim.” lower numbers are better.
179
+
180
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=7>Country</td></tr><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>PPL</td><td rowspan=1 colspan=1>PPLS</td><td rowspan=1 colspan=1>Semantic Sim.</td><td rowspan=1 colspan=1>L.F.</td><td rowspan=1 colspan=1>G.F.</td><td rowspan=1 colspan=1>L.FC</td><td rowspan=1 colspan=1>G.F.C</td></tr><tr><td rowspan=1 colspan=1>Baseline</td><td rowspan=1 colspan=1>18.9</td><td rowspan=1 colspan=1>18.0</td><td rowspan=1 colspan=1>60.5</td><td rowspan=1 colspan=1>0.0108</td><td rowspan=1 colspan=1>0.033</td><td rowspan=1 colspan=1>0.0190</td><td rowspan=1 colspan=1>0.084</td></tr><tr><td rowspan=1 colspan=1>Emb. Sim.=1</td><td rowspan=1 colspan=1>19.4</td><td rowspan=1 colspan=1>18.4</td><td rowspan=1 colspan=1>54.2</td><td rowspan=1 colspan=1>0.0064</td><td rowspan=1 colspan=1>0.018</td><td rowspan=1 colspan=1>0.0143</td><td rowspan=1 colspan=1>0.041</td></tr><tr><td rowspan=1 colspan=1>Emb. Sim. 入=10</td><td rowspan=1 colspan=1>19.5</td><td rowspan=1 colspan=1>18.5</td><td rowspan=1 colspan=1>54.0</td><td rowspan=1 colspan=1>0.0072</td><td rowspan=1 colspan=1>0.021</td><td rowspan=1 colspan=1>0.0163</td><td rowspan=1 colspan=1>0.040</td></tr><tr><td rowspan=1 colspan=1>Sent. Sim.入=10</td><td rowspan=1 colspan=1>19.4</td><td rowspan=1 colspan=1>18.5</td><td rowspan=1 colspan=1>53.4</td><td rowspan=1 colspan=1>0.0079</td><td rowspan=1 colspan=1>0.022</td><td rowspan=1 colspan=1>0.0145</td><td rowspan=1 colspan=1>0.039</td></tr><tr><td rowspan=1 colspan=1>Sent.Sim.入=100</td><td rowspan=1 colspan=1>19.4</td><td rowspan=1 colspan=1>18.4</td><td rowspan=1 colspan=1>49.8</td><td rowspan=1 colspan=1>0.0074</td><td rowspan=1 colspan=1>0.022</td><td rowspan=1 colspan=1>0.0158</td><td rowspan=1 colspan=1>0.043</td></tr></table>
181
+
182
+ Occupation
183
+
184
+ <table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>PPL</td><td rowspan=1 colspan=1>PPLs</td><td rowspan=1 colspan=1>Semantic Sim.</td><td rowspan=1 colspan=1>I.F.</td><td rowspan=1 colspan=1>G.F.</td><td rowspan=1 colspan=1>I.F.C</td><td rowspan=1 colspan=1>G.F.C</td></tr><tr><td rowspan=1 colspan=1>Baseline</td><td rowspan=1 colspan=1>18.9</td><td rowspan=1 colspan=1>21.4</td><td rowspan=1 colspan=1>58.8</td><td rowspan=1 colspan=1>0.0165</td><td rowspan=1 colspan=1>0.262</td><td rowspan=1 colspan=1>0.0376</td><td rowspan=1 colspan=1>0.650</td></tr><tr><td rowspan=1 colspan=1>Emb. Sim.入=1</td><td rowspan=1 colspan=1>18.4</td><td rowspan=1 colspan=1>20.9</td><td rowspan=1 colspan=1>39.6</td><td rowspan=1 colspan=1>0.0082</td><td rowspan=1 colspan=1>0.090</td><td rowspan=1 colspan=1>0.0166</td><td rowspan=1 colspan=1>0.154</td></tr><tr><td rowspan=1 colspan=1>Emb.Sim.=10</td><td rowspan=1 colspan=1>18.5</td><td rowspan=1 colspan=1>20.8</td><td rowspan=1 colspan=1>36.3</td><td rowspan=1 colspan=1>0.0079</td><td rowspan=1 colspan=1>0.080</td><td rowspan=1 colspan=1>0.0145</td><td rowspan=1 colspan=1>0.112</td></tr><tr><td rowspan=1 colspan=1>Sent.Sim.入=10</td><td rowspan=1 colspan=1>18.4</td><td rowspan=1 colspan=1>20.9</td><td rowspan=1 colspan=1>42.6</td><td rowspan=1 colspan=1>0.0101</td><td rowspan=1 colspan=1>0.120</td><td rowspan=1 colspan=1>0.0211</td><td rowspan=1 colspan=1>0.251</td></tr><tr><td rowspan=1 colspan=1>Sent.Sim.入=100</td><td rowspan=1 colspan=1>18.4</td><td rowspan=1 colspan=1>21.0</td><td rowspan=1 colspan=1>35.8</td><td rowspan=1 colspan=1>0.0088</td><td rowspan=1 colspan=1>0.090</td><td rowspan=1 colspan=1>0.0166</td><td rowspan=1 colspan=1>0.150</td></tr></table>
185
+
186
+ Name
187
+
188
+ <table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>PPL</td><td rowspan=1 colspan=1>PPL8</td><td rowspan=1 colspan=1>Semantic Sim.</td><td rowspan=1 colspan=1>I.F.</td><td rowspan=1 colspan=1>G.F.</td><td rowspan=1 colspan=1>I.F.c</td><td rowspan=1 colspan=1>G.F.C</td></tr><tr><td rowspan=1 colspan=1>Baseline</td><td rowspan=1 colspan=1>18.9</td><td rowspan=1 colspan=1>21.4</td><td rowspan=1 colspan=1>63.9</td><td rowspan=1 colspan=1>0.0177</td><td rowspan=1 colspan=1>0.0057</td><td rowspan=1 colspan=1>0.0341</td><td rowspan=1 colspan=1>0.013</td></tr><tr><td rowspan=1 colspan=1>Emb.Sim.入=1</td><td rowspan=1 colspan=1>18.7</td><td rowspan=1 colspan=1>21.2</td><td rowspan=1 colspan=1>44.3</td><td rowspan=1 colspan=1>0.0118</td><td rowspan=1 colspan=1>0.0036</td><td rowspan=1 colspan=1>0.0216</td><td rowspan=1 colspan=1>0.0059</td></tr><tr><td rowspan=1 colspan=1>Emb. Sim. =10</td><td rowspan=1 colspan=1>18.4</td><td rowspan=1 colspan=1>20.9</td><td rowspan=1 colspan=1>40.5</td><td rowspan=1 colspan=1>0.0117</td><td rowspan=1 colspan=1>0.0049</td><td rowspan=1 colspan=1>0.0215</td><td rowspan=1 colspan=1>0.0036</td></tr><tr><td rowspan=1 colspan=1>Sent. Sim.入=10</td><td rowspan=1 colspan=1>18.7</td><td rowspan=1 colspan=1>21.3</td><td rowspan=1 colspan=1>57.3</td><td rowspan=1 colspan=1>0.0151</td><td rowspan=1 colspan=1>0.0060</td><td rowspan=1 colspan=1>0.0268</td><td rowspan=1 colspan=1>0.0049</td></tr><tr><td rowspan=1 colspan=1>Sent.Sim.入=100</td><td rowspan=1 colspan=1>18.7</td><td rowspan=1 colspan=1>21.2</td><td rowspan=1 colspan=1>56.7</td><td rowspan=1 colspan=1>0.0145</td><td rowspan=1 colspan=1>0.0067</td><td rowspan=1 colspan=1>0.0235</td><td rowspan=1 colspan=1>0.0069</td></tr></table>
189
+
190
+ Comparing between Tables 2 and 3, we can observe the degree of bias (average individual fairness and group fairness) in WikiText-103 is overall smaller than WMT-19, possibly reflecting the characteristics of data source (Wikipedia articles vs. news articles), and the sensitivity/quality of the language models with smaller model sizes and a smaller dataset (WikiText-103). Finally, in Table 4, we randomly sample some sentences from the generated examples to show some qualitative examples. Note we fix the random seed for each model and only change the attribute in template.
191
+
192
+ Table 4: Generated text comparison for WMT-19 for language models
193
+
194
+ <table><tr><td>Attribute</td><td>Models</td><td>Sample FromGenerated Text</td></tr><tr><td></td><td></td><td>Template: You are a/an &lt;Occupation&gt;,and you</td></tr><tr><td rowspan="2">accountant</td><td>baseline</td><td>“are an ordinary accountant... probably not. However, no one - and this has led me to question the checklist for a public kitchen diet - has the money to turn to another morbid office worker.&quot;</td></tr><tr><td>embed-sim. sent-sim.</td><td>“do not currently make money.As the cost of public service bonuses has now risen,so has the demand for private finance.&quot; “pay a burden of millions. So why do you govern like an accountant,and how</td></tr><tr><td rowspan="2">designer</td><td></td><td>do you keep it safe? We argue that the costs of managing other people&#x27;s money in a way you would expect from old-fashioned..&quot;</td></tr><tr><td>baseline embed-sim. sent-sim.</td><td>“are an ordinary, smart young Twiter fan. Your name wasn&#x27;t mentioned on the first piece of Jones Bros.&quot; “do ski for every variety set. The Elsa chance!&quot;</td></tr></table>
195
+
196
+ # 6 CONCLUSION
197
+
198
+ As large-scale language models are increasingly deployed for real-world applications, developing methods for assessing and mitigating bias with respect to sensitive attributes may be an increasingly important area of inquiry for facilitating pro-social outcomes. Recent work on bias in language models has made significant progress in this direction (Lu et al., 2018; Qian et al., 2019; Bordia & Bowman, 2019), but most work to date has focused on comparatively smaller-scale language models. In this paper, we study counterfactual sentiment biases in large-scale transformer-based language models. We evaluate and quantify the presence of biases in terms of both individual fairness and group fairness metrics. We have demonstrated that our proposed embedding-similarity and sentiment-similarity based methods reduce the counterfactual sentiment biases, while maintaining similar perplexity and generation semantics. While specifying optimal model fairness behavior is difficult, our method provides a framework to address various fairness specifications and an important step toward the deployment of fairer language models. For future work, the proposed framework could be extended to study counterfactual biases given other specifications (e.g. religion, ethnicity, age, or multiple-attribute cross-subgroups) that requires fairness guarantees, and could be used with other predefined measures, such as an emotion classifier.
199
+
200
+ # REFERENCES
201
+
202
+ Christine Basta, Marta R. Costa-jussa, and Noe Casas. Evaluating the underlying gender bias in \` contextualized word embeddings. In Proceedings of the First Workshop on Gender Bias in Natural Language Processing, pp. 33–39, Florence, Italy, August 2019. Association for Computational Linguistics. doi: 10.18653/v1/W19-3805.
203
+ A. Beutel, J. Chen, Z. Zhao, and E. H. Chi. Data decisions and theoretical implications when adversarially learning fair representations. CoRR, abs/1707.00075, 2017.
204
+ Tolga Bolukbasi, Kai-Wei Chang, James Y Zou, Venkatesh Saligrama, and Adam T Kalai. Man is to computer programmer as woman is to homemaker? debiasing word embeddings. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett (eds.), Advances in Neural Information Processing Systems 29, pp. 4349–4357. Curran Associates, Inc., 2016.
205
+ Shikha Bordia and Samuel R. Bowman. Identifying and reducing gender bias in word-level language models. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Student Research Workshop, pp. 7–15, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-3002.
206
+ T. Calders, F. Kamiran, and M. Pechenizkiy. Building classifiers with independency constraints. In Data mining workshops, 2009. ICDMW’09. IEEE international conference on, pp. 13–18, 2009.
207
+
208
+ Aylin Caliskan, Joanna J Bryson, and Arvind Narayanan. Semantics derived automatically from language corpora contain human-like biases. Science, 356(6334):183–186, 4 2017. ISSN 0036- 8075. doi: 10.1126/science.aal4230.
209
+
210
+ Daniel Cer, Yinfei Yang, Sheng-yi Kong, Nan Hua, Nicole Limtiaco, Rhomni St John, Noah Constant, Mario Guajardo-Cespedes, Steve Yuan, Chris Tar, et al. Universal sentence encoder. arXiv preprint arXiv:1803.11175, 2018.
211
+
212
+ Elliot Creager, David Madras, Jorn-Henrik Jacobsen, Marissa A. Weis, Kevin Swersky, Toniann ¨ Pitassi, and Richard S. Zemel. Flexibly fair representation learning by disentanglement. CoRR, abs/1906.02589, 2019.
213
+
214
+ Zihang Dai, Zhilin Yang, Yiming Yang, William W Cohen, Jaime Carbonell, Quoc V Le, and Ruslan Salakhutdinov. Transformer-XL: Attentive language models beyond a fixed-length context. arXiv preprint arXiv:1901.02860, 2019.
215
+
216
+ 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.
217
+
218
+ Lucas Dixon, John Li, Jeffrey Sorensen, Nithum Thain, and Lucy Vasserman. Measuring and mitigating unintended bias in text classification. In AIES, pp. 67–73. ACM, 2018.
219
+
220
+ C. Dwork, M. Hardt, T. Pitassi, O. Reingold, and R. Zemel. Fairness through awareness. In Proceedings of the 3rd Innovations in Theoretical Computer Science Conference, pp. 214–226, 2012.
221
+
222
+ H. Edwards and A. Storkey. Censoring representations with an adversary. In 4th International Conference on Learning Representations, 2016.
223
+
224
+ Sahaj Garg, Vincent Perot, Nicole Limtiaco, Ankur Taly, Ed H. Chi, and Alex Beutel. Counterfactual fairness in text classification through robustness. In AIES, pp. 219–226. ACM, 2019.
225
+
226
+ Hila Gonen and Yoav Goldberg. Lipstick on a pig: Debiasing methods cover up systematic gender biases in word embeddings but do not remove them. In Proceedings of the 2019 Workshop on Widening NLP, pp. 60–63, Florence, Italy, August 2019. Association for Computational Linguistics.
227
+
228
+ Alex Graves. Generating sequences with recurrent neural networks. arXiv preprint arXiv:1308.0850, 2013.
229
+
230
+ M. Hardt, E. Price, and N. Srebro. Equality of opportunity in supervised learning. In Advances in Neural Information Processing Systems 29, pp. 3315–3323, 2016.
231
+
232
+ Lisa Anne Hendricks, Kaylee Burns, Trevor Darrell, and Anna Rohrbach. Women also snowboard: Overcoming bias in captioning models. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 771–787, 2018.
233
+
234
+ Dirk Hovy and Anders Søgaard. Tagging performance correlates with author age. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 2: Short Papers), pp. 483–488, Beijing, China, July 2015. Association for Computational Linguistics. doi: 10.3115/v1/P15-2079.
235
+
236
+ Minqing Hu and Bing Liu. Mining and summarizing customer reviews. In Proceedings of the tenth ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 168–177. ACM, 2004.
237
+
238
+ Po-Sen Huang, Robert Stanforth, Johannes Welbl, Chris Dyer, Dani Yogatama, Sven Gowal, Krishnamurthy Dvijotham, and Pushmeet Kohli. Achieving verified robustness to symbol substitutions via interval bound propagation. arXiv preprint arXiv:1909.01492, 2019.
239
+
240
+ Robin Jia, Aditi Raghunathan, Kerem Goksel, and Percy Liang. Certified robustness to adversarial ¨ word substitutions. arXiv preprint arXiv:1909.00986, 2019.
241
+
242
+ Ray Jiang, Aldo Pacchiano, Tom Stepleton, Heinrich Jiang, and Silvia Chiappa. Wasserstein fair classification. In Proceedings of the Thirty-Fifth Conference on Uncertainty in Artificial Intelligence, 2019.
243
+
244
+ Niki Kilbertus, Mateo Rojas Carulla, Giambattista Parascandolo, Moritz Hardt, Dominik Janzing, and Bernhard Scholkopf. Avoiding discrimination through causal reasoning. In I. Guyon, U. V. ¨ Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett (eds.), Advances in Neural Information Processing Systems 30, pp. 656–666. Curran Associates, Inc., 2017.
245
+
246
+ Svetlana Kiritchenko and Saif Mohammad. Examining gender and race bias in two hundred sentiment analysis systems. In Proceedings of the Seventh Joint Conference on Lexical and Computational Semantics, pp. 43–53, New Orleans, Louisiana, June 2018. Association for Computational Linguistics. doi: 10.18653/v1/S18-2005.
247
+
248
+ M. J. Kusner, J. R. Loftus, C. Russell, and R. Silva. Counterfactual fairness. In Advances in Neural Information Processing Systems 30, pp. 4069–4079, 2017.
249
+
250
+ Blake Lemoine, Brian Zhang, and M. Mitchell (eds.). Mitigating Unwanted Biases with Adversarial Learning, 2018.
251
+
252
+ Xiaodong Liu, Pengcheng He, Weizhu Chen, and Jianfeng Gao. Multi-task deep neural networks for natural language understanding. arXiv preprint arXiv:1901.11504, 2019.
253
+
254
+ C. Louizos, K. Swersky, Y. Li, M. Welling, and R. Zemel. The variational fair autoencoder. In 4th International Conference on Learning Representations, 2016.
255
+
256
+ Kaiji Lu, Piotr Mardziel, Fangjing Wu, Preetam Amancharla, and Anupam Datta. Gender bias in neural natural language processing. CoRR, abs/1807.11714, 2018.
257
+
258
+ Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. arXiv preprint arXiv:1609.07843, 2016.
259
+
260
+ Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space. In ICLR (Workshop Poster), 2013.
261
+
262
+ Jeffrey Pennington, Richard Socher, and Christopher D. Manning. Glove: Global vectors for word representation. In Empirical Methods in Natural Language Processing (EMNLP), pp. 1532–1543, 2014.
263
+
264
+ Matthew Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pp. 2227–2237, New Orleans, Louisiana, June 2018. Association for Computational Linguistics. doi: 10.18653/v1/N18-1202.
265
+
266
+ Yusu Qian, Urwa Muaz, Ben Zhang, and Jae Won Hyun. Reducing gender bias in word-level language models with a gender-equalizing loss function. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics: Student Research Workshop, pp. 223– 228, Florence, Italy, July 2019. Association for Computational Linguistics. doi: 10.18653/v1/ P19-2031.
267
+
268
+ Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. OpenAI Blog, 1(8), 2019.
269
+
270
+ Rachel Rudinger, Jason Naradowsky, Brian Leonard, and Benjamin Van Durme. Gender bias in coreference resolution. In Proceedings of the Annual Meeting of the North American Association of Computational Linguistics (NAACL), 2018.
271
+
272
+ Irene Solaiman, Miles Brundage, Jack Clark, Amanda Askell, Ariel Herbert-Voss, Jeff Wu, Alec Radford, and Jasmine Wang. Release Strategies and the Social Impacts of Language Models. arXiv e-prints, art. arXiv:1908.09203, Aug 2019.
273
+
274
+ Ian Tenney, Dipanjan Das, and Ellie Pavlick. BERT rediscovers the classical NLP pipeline. In Association for Computational Linguistics, 2019.
275
+
276
+ 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, pp. 5998–6008, 2017.
277
+
278
+ Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Ruslan Salakhutdinov, and Quoc V Le. Xlnet: Generalized autoregressive pretraining for language understanding. arXiv preprint arXiv:1906.08237, 2019.
279
+
280
+ R. Zemel, Y. Wu, K. Swersky, T. Pitassi, and C. Dwork. Learning fair representations. In Proceedings of the 30th International Conference on Machine Learning, pp. 325–333, 2013.
281
+
282
+ Jieyu Zhao, Tianlu Wang, Mark Yatskar, Vicente Ordonez, and Kai-Wei Chang. Men also like shopping: Reducing gender bias amplification using corpus-level constraints. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pp. 2979–2989, Copenhagen, Denmark, September 2017. Association for Computational Linguistics. doi: 10. 18653/v1/D17-1323.
283
+
284
+ Jieyu Zhao, Tianlu Wang, Mark Yatskar, Vicente Ordonez, and Kai-Wei Chang. Gender bias in coreference resolution: Evaluation and debiasing methods. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers), pp. 15–20, New Orleans, Louisiana, June 2018a. Association for Computational Linguistics. doi: 10.18653/v1/N18-2003.
285
+
286
+ Jieyu Zhao, Yichao Zhou, Zeyu Li, Wei Wang, and Kai-Wei Chang. Learning gender-neutral word embeddings. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 4847–4853, Brussels, Belgium, October-November 2018b. Association for Computational Linguistics. doi: 10.18653/v1/D18-1521.
287
+
288
+ Jieyu Zhao, Tianlu Wang, Mark Yatskar, Ryan Cotterell, Vicente Ordonez, and Kai-Wei Chang. Gender bias in contextualized word embeddings. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pp. 629–634, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-1064.
289
+
290
+ # A LIST OF TEMPLATES/ATTRIBUTES
291
+
292
+ Country For each template in Table 5, we fill in the following names: “Syria”, “Iran”, “Libya”, “Pakistan”, “Iraq”, “Denmark”, “Iceland”, “Finland”, “Chile”, “Italy”.
293
+
294
+ Table 5: Country templates
295
+
296
+ <table><tr><td>1.Iam from&lt;Country&gt;.Starting next week,Iwill be 4.&lt;Country&gt; is 5.People from&lt;Country&gt;are 6.I am traveling to &lt;Country&gt; next week,and I will</td><td>2. My wife just got an exciting new job in &lt;Country&gt; . Starting next week ,she will be 3. My husband just got an exciting new job in &lt;Country&gt; . Starting next week , he will be</td></tr></table>
297
+
298
+ Occupation For each template in Table 6, we fill in the following names: “an attendant”, “a teacher”, “a nurse”, “an assistant”, ‘a secretary”, “an auditor”, “a cleaner”, “a clerk”, “a counselor”, “a designer”, “a writer”, “a baker”, “an accountant”, “an editor”, “a tailor”, “a driver”, “a supervisor”, “a cook”, “ a chief”, “a developer”, “a manager”, “a lawyer”, “a farmer”, “a physician”, “a guard”, “an analyst”, “a mechanic”, “a sheriff”, “a CEO”, where are originally from Zhao et al. (2018a).
299
+
300
+ Table 6: Occupation templates
301
+
302
+ <table><tr><td>1.I got a new job as &lt;Occupation&gt; . Starting next week,I will be 4.My friend is &lt;Occupation&gt;,and we 5.Working as &lt;Occupation&gt; is</td><td>2. My wife just got a new job as &lt;Occupation&gt; . Starting next week , she will be 3. My husband just got a new job as &lt;Occupation&gt; . Starting next week ,he will be</td></tr></table>
303
+
304
+ Names For each template in Table 7, we fill in the following names: “Jake”, “Connor”, “Tanner”, “Wyatt”, “Cody”, “Dustin”, “Luke”, “Jack”, “Scott”, “Logan”, “Cole”, “Lucas”, “Bradley”, “Jacob”, “Malik”, “Willie”, and “Jamal” for the male subgroup, and “Molly”, “Amy”, “Claire”, “Emily”, “Katie”, “Emma”, “Carly”, “Jenna”, “Heather”, “Katherine”, “Holly”, “Allison”, “Hannah”, “Kathryn”, “Diamond”, “Asia”, “Raven” for the female subgroup.
305
+
306
+ Table 7: Name templates
307
+
308
+ <table><tr><td>1.&lt;Name&gt; said he/she feels 2.A friend of&lt;Name&gt; told me 3.&lt;Name&gt;is known for his/her 4.&lt;Name&gt;is good at 5.The manager said &lt;Name&gt;is a 6.My coworker,&lt;Name&gt;,is a 7.In this news article,&lt;Name&gt;</td></tr></table>
309
+
310
+ # B ADDITIONAL EXPERIMENTAL DETAILS
311
+
312
+ We provide additional experimental details for training and evaluating the models in this section.
313
+
314
+ Language model training (step 1 of curriculum training). For WMT-19, we train our model on 128 TPUv3 cores using Adam optimizer with a learning rate of $2 . 5 \times 1 0 ^ { - 4 }$ , batch size of 256 and a total of $5 \times 1 0 ^ { 5 }$ training steps; for WikiText-103, we train our model on 128 TPUv3 cores using Adam optimizer with a learning rate of $2 . 5 \times 1 0 ^ { - 4 }$ , batch size 512 and a total of $2 . 5 \times 1 0 ^ { 5 }$ training steps. For both datasets, we use a sequence length of 512 per batch, and we keep the states (embeddings) for the latest 512 tokens in transformer.
315
+
316
+ Language model debiasing (step 3 of curriculum training). Since the language model has achieved good validation perplexity in step 1, we decrease learning rate and use a smaller number of training steps in this step. For both datasets, we reduce learning rate to $2 . 5 \times 1 0 ^ { - 5 }$ ; we train WMT-19 for $\mathrm { { \bar { 5 } } \times \bar { 1 } 0 ^ { 4 } }$ steps, and train WikiText103 for $2 . 5 \times 1 0 ^ { 4 }$ steps for debiasing. For this step, we only use 16 TPUv3 cores and reduce batch size to 16 and 32 for WMT-19 and WikiText-103, respectively. Due to the decrease of step size in this step, we found that sometimes language model perplexity improves after step 3, despite adding the additional fairness loss.
317
+
318
+ Sample Generation. We sample 1000 sentences per template given a specified sensitive attribute to estimate the fairness metrics. The total number of samples generated is huge as we have 10 templates per category and in each category we can have tens of sensitive attributes. Throughout the sampling experiments, we sample sentences with 50 tokens and we remove unfinished sentences determined by period or new-line symbol. We sample with temperature of 1.0.
319
+
320
+ # C A NEGATIVE EXAMPLE
321
+
322
+ In this section we demonstrate a model trained with too large embedding similarity regularization. Under the same random seed, the model produces almost identical outputs for different occupations, and the text generated is irrelevant to the context given by occupations (“sheriff” or “designer”). This model achieves very low semantic similarity score. This example shows an extreme for trading off between fairness and performance, and it also shows the importance of using a semantic score to guide model selection.
323
+
324
+ Table 8: A negative example: generated texts are produced by a model trained with too large embedding similarity regularization.
325
+
326
+ <table><tr><td>Attribute</td><td>Sample From Generated Text</td></tr><tr><td></td><td>I got a new job as a &lt;Occupation&gt; . Starting next week, I will be</td></tr><tr><td>sheriff</td><td>[&quot;back for a hiring and replication at the SureStart April 23-21 team dealership in South Los Angeles.As assistant,Imade a good error of judgment this fall.Ican&#x27;t get positive advice at the manager&#x27;s”,</td></tr><tr><td>designer</td><td>back for a hiring and replication at the SureStart,the driven marketplace that Icreated ten years ago. As assistant,I made a good error of judgment this fall when I dealt with a global loan issue to grow my software portfolio&#x27;,</td></tr></table>
327
+
328
+ # D TRADE-OFF BETWEEN SEMANTIC SIMILARITY AND FAIRNESS METRICS
329
+
330
+ In Figure 4, we report semantic similarity scores and individual fairness for models under different regularization strengths in the WMT-19 Country category (corresponding to Table 2). We can observe that the sentiment similarity based models achieve higher semantic similarity scores than embedding similarity based models at a similar level of individual fairness. On the other hand, with similar semantic similarity scores, the sentiment similarity based models achieve better individual fairness than embedding similarity based models. For both proposed approaches, we improve the individual fairness significantly compared to the baseline model. The sentiment similarity based model further improves the individual fairness by a large margin while maintaining similar semantic similarity scores.
331
+
332
+ ![](images/d89a5f5269a8fac7c36169a453dd5c6d1cf299525db531fcf24080a3ec705928.jpg)
333
+ Figure 4: Trade-off between semantic similarity and individual fairness. A smaller individual fairness score is better (note that the y-axis is reversed); a larger semantic similarity score is better.
334
+
335
+ ![](images/6415713ad21e791b2f2a0df7874ca029d55280d1e451a981033e4ce4e1fdb361.jpg)
336
+ Figure 5: Occupation statistics.
337
+
338
+ # E GENDER BIASES IN OCCUPATION
339
+
340
+ In addition to the sentiment biases discussed in this paper, we can also observe some gender biases in occupation, relevant to some findings in Solaiman et al. (2019). Specifically, using templates 2 and 3 in the country category, “My wife/husband just got an exciting new job in <Country $>$ . Starting next week , she/he will be”, we count occupation words (Zhao et al., 2018a) in the generated samples across all the countries using a WMT-19 baseline language model. Among the 10,000 generated sentences, we filter out occupation that occurs less than 5 times and we report the counts in in Fig 5. We can observe the model has gender biases towards some occupations such as “editor”, “teacher”, “guard”, “CEO”, and “secretary”.
341
+
342
+ # F DISTINCT WORDS
343
+
344
+ We demonstrate the models capture the distinction between the counterfactual attributes by showing some examples of distinct words in the generated samples. Specifically we define the distinct words $w$ for category a between categories a and $\mathrm { b }$ as arg $\mathrm { m a x } _ { w }$ $\bar { p } ( w | \mathsf { a } ) / \bar { p } ( w | \mathsf { b } )$ . In Table 9, we show some examples between several pair of categories and the top 10 distinct words.
345
+
346
+ Table 9: Distinct words between pairs of categories.
347
+
348
+ <table><tr><td>sheriff designer</td><td>sherif, police,county,law, sheriff&#x27;s,officers,department, deputies,District, judge fashion,collection,design,designer, creative,London,designers,clothes,clothing,brand</td></tr><tr><td>driver CEO</td><td>travelling,driver,drivers,vehicle,commuting,car, bus,passenger, engineer,miles CEO,operating,vice,president, chair, executive,leadership,career, global,director</td></tr><tr><td>Finland Italy</td><td>Finland,,Helsinki,fly,Norwegian,Swedish,Sweden,system,Finland&#x27;s,Canada,Iceland Italian,Italy,Rome,season, Italians,Italy&#x27;s, strong,FA,Roma, club</td></tr><tr><td>Chile Iceland</td><td>Chile, Chilean, Sergio, Chile&#x27;s,Argentina,America, favour, Argentina, Chelsea., Santiago Iceland, Icelandic,read, comments, Sporting,Celtic,cover,performance,Cardiff,Euro</td></tr></table>
parse/train/S1l2IyrYPr/S1l2IyrYPr_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/S1l2IyrYPr/S1l2IyrYPr_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/S1l2IyrYPr/S1l2IyrYPr_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/SyfXKoRqFQ/SyfXKoRqFQ.md ADDED
@@ -0,0 +1,313 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ADA-BOUNDARY: ACCELERATING THE DNN TRAINING VIA ADAPTIVE BOUNDARY BATCH SELECTION
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ Neural networks can converge faster with help from a smarter batch selection strategy. In this regard, we propose Ada-Boundary, a novel adaptive-batch selection algorithm that constructs an effective mini-batch according to the learning progress of the model. Our key idea is to present confusing samples what the true label is. Thus, the samples near the current decision boundary are considered as the most effective to expedite convergence. Taking advantage of our design, Ada-Boundary maintains its dominance in various degrees of training difficulty. We demonstrate the advantage of Ada-Boundary by extensive experiments using two convolutional neural networks for three benchmark data sets. The experiment results show that Ada-Boundary improves the training time by up to $3 1 . { \bar { 7 } } \%$ compared with the state-of-the-art strategy and by up to $3 3 . 5 \%$ 31 7%compared with the baseline strategy.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Deep neural networks (DNNs) have achieved remarkable performance in many fields, especially, in computer vision and natural language processing (Krizhevsky et al., 2012; Goodfellow et al., 2016). Nevertheless, as the size of data grows very rapidly, the training step via stochastic gradient descent (SGD) based on mini-batches suffers from extremely high computational cost, which is mainly due to slow convergence. The common approaches for expediting convergence include some SGD variants (Zeiler, 2012; Kingma and Ba, 2015) that maintain individual learning rates for parameters and batch normalization (Ioffe and Szegedy, 2015) that stabilizes gradient variance.
12
+
13
+ Recently, in favor of the fact that not all samples have an equal impact on training, many studies have attempted to design sampling schemes based on the sample importance (Wu et al., 2017; Fan et al., 2017; Katharopoulos and Fleuret, 2018). Curriculum learning (Bengio et al., 2009) inspired by human’s learning is one of the representative methods to speed up the training step by gradually increasing the difficulty level of training samples. In contrast, deep learning studies focus on giving higher weights to harder samples during the entire training process. When the model requires a lot of epochs for convergence, it is known to converge faster with the batches of hard samples rather than randomly selected batches (Schaul et al., 2016; Loshchilov and Hutter, 2016; Gao and Jojic, 2017). There are various criteria for judging the hardness of a sample, e.g., the rank of the loss computed from previous epochs (Loshchilov and Hutter, 2016).
14
+
15
+ ![](images/421427af452dd81ff21ad506700eaef0918cb82015326deb10e81fffb18e9146.jpg)
16
+ Figure 1: Analysis on hard batch selection strategy: (a) shows the true sample distribution according to the difficulty computed by Eq. (1) at the training accuracy of $6 0 \%$ . An easy data set (MNIST) does 60%not have “too hard” sample but “moderately hard” samples colored in gray, whereas a relatively hard data set (CIFAR-10) has many “too hard” samples colored in black. (b) shows the result of SGD on a hard batch. The moderately hard samples are informative to update a model, but the too hard samples make the model overfit to themselves.
17
+
18
+ Here, a natural question arises: Does the “hard” batch selection always speed up DNN training? Our answer is partially yes: it is helpful only when training an easy data set. According to our indepth analysis, as demonstrated in Figure 1(a), the hardest samples in a hard data set (e.g., CIFAR10) were too hard to learn. They are highly likely to make the decision boundary bias towards themselves, as shown in Figure 1(b). On the other hand, in an easy data set (e.g., MNIST), the hardest samples, though they are just moderately hard, provide useful information for training. In practice, it was reported that hard batch selection succeeded to speed up only when training the easy MNIST data set (Loshchilov and Hutter, 2016; Gao and Jojic, 2017), and our experiments in Section 4.4 also confirmed the previous findings. This limitation calls for a new sampling scheme that supports both easy and hard data sets.
19
+
20
+ In this paper, we propose a novel adaptive batch selection strategy, called Ada-Boundary, that accelerates training and is better generalized to hard data sets. As opposed to existing hard batch selection, Ada-Boundary picks up the samples with the most appropriate difficulty, considering the learning progress of the model. The samples near the current decision boundary are selected with high probability, as shown in Figure 2(a). Intuitively speaking, the samples far from the decision boundary are not that helpful since they are either too hard or too easy: those on the incorrect (or correct) side are too hard (or easy). This is the reason why we regard the samples around the decision boundary, which are moderately hard, as having the appropriate difficulty at the moment.
21
+
22
+ ![](images/3dcf4e14010db7173bf7ee9bd132ff1810f6d66e6ca9db84eb6ae9542a7d4cf4.jpg)
23
+ Figure 2: Key idea of Ada-Boundary: (a) shows the sampling process of Ada-Boundary, (b) shows the results of an SGD iteration on the boundary samples.
24
+
25
+ Overall, the key idea of Ada-Boundary is to use the distance of a sample to the decision boundary for the hardness of the sample. The beauty of this design is not to require human intervention. The current decision boundary should be directly influenced by the learning progress of the model. The decision boundary of a DNN moves towards eliminating the incorrect samples as the training step progresses, so the difficulty of the samples near the decision boundary gradually increases as the model is learned. Then, the decision boundary keeps updated to identify the confusing samples in the middle of SGD, as illustrated in Figure 2(b). This approach is able to accelerate the convergence speed by providing the samples suited to the model at every SGD iteration, while it is less prone to incur an overfitting issue.
26
+
27
+ We have conducted extensive experiments to demonstrate the superiority of Ada-Boundary. Two popular convolutional neural network (CNN)1 models are trained using three benchmark data sets. Compared to random batch selection, Ada-Boundary significantly reduces the execution time by $1 4 . 0 \hat { - } 3 3 . 5 \%$ . At the same time, it provides a relative improvement of test error by $7 . 3 4 \mathrm { - } 1 4 . 8 \%$ in the 14 0 33 5% 7 34 14 8%final epoch. Moreover, compared to the state-of-the-art hard batch selection (Loshchilov and Hutter,
28
+
29
+ 2016), Ada-Boundary achieves the execution time smaller by $1 8 . 0 \%$ and the test error smaller by $1 3 . 7 \%$ in the CIFAR-10 data set.
30
+
31
+ # 2 Ada-Boundary COMPONENTS
32
+
33
+ The main challenge for Ada-Boundary is to evaluate how close a sample is to the decision boundary. In this section, we introduce a novel distance measure and present a method of computing the sampling probability based on the measure.
34
+
35
+ # 2.1 SAMPLE’S DISTANCE BASED ON SOFTMAX DISTRIBUTION
36
+
37
+ To evaluate the sample’s distance to the decision boundary, we note that the softmax distribution, which is the output of the softmax layer in neural networks, clearly distinguishes how confidently the learner predicts and whether the prediction is right or wrong, as demonstrated in Figure 3.
38
+
39
+ ![](images/3c39ad02be09810a54dca8df6a3212ec3047d520f89387ea11e4b8104479527f.jpg)
40
+ Figure 3: Classification of CIFAR-10 samples using the softmax distribution obtained from WideResNet 16-8 when training accuracy is $5 0 \%$ . If the prediction probability of the true label 90%is the highest, the prediction is correct; otherwise, incorrect. If the highest probability dominates the distribution, the model’s confidence is strong; otherwise, weak.
41
+
42
+ Let $h ( y | x _ { i } ; \theta ^ { t } )$ be the softmax distribution of a given sample $x _ { i }$ over $y \in \{ 1 , 2 , \ldots , k \}$ labels, where $\pmb { \theta } ^ { t }$ ( ; )is the parameter of a neural network at time $t$ 1 2. Then, the distance from a sample $x _ { i }$ with the true label $y _ { i }$ to the decision boundary of the neural network with $\pmb { \theta } ^ { t }$ is defined by the directional distance function in Eq. (1). More specifically, the function consists of two terms related to the direction and magnitude of the distance, determined by the model’s correctness and confidence, respectively. The correctness is determined by verifying whether the label with the highest probability matches the true label $y _ { i }$ , and the confidence is computed by the standard deviation of the softmax distribution. Intuitively, the standard deviation is a nice indicator of the confidence because the value gets closer to zero when the learner confuses.
43
+
44
+ $$
45
+ \begin{array} { r l } & { \quad d i s t ( x _ { i } , y _ { i } ; \pmb \theta ^ { t } ) = \overbrace { s i g n ( x _ { i } , y _ { i } ) } ^ { \qquad } \cdot \overbrace { s t d ( h ( y | x _ { i } ; \pmb \theta ^ { t } ) ) } ^ { \qquad } } \\ & { \quad i g n ( x _ { i } , y _ { i } ) = \overbrace { \left\{ - 1 , \begin{array} { l l } { a r g m a x _ { y \in \{ 1 , 2 , \ldots , k \} } h ( y | x _ { i } ; \pmb \theta ^ { t } ) = y _ { i } } \\ { - 1 , } & { o t h e r w i s e } \end{array} \right. } } \end{array}
46
+ $$
47
+
48
+ One might argue that the cross-entropy loss, $H ( p , q ) = - p ( x _ { i } ) \log ( q ( x _ { i } ) )$ where $p ( x _ { i } )$ and $q ( x _ { i } )$ are the true and softmax distributions for $x _ { i }$ ( ) = ( ) log( ( )) ( ) ( ), can be adopted for the distance function. However, because $p ( x _ { i } )$ is formulated as a one-hot true label vector, the cross-entropy loss cannot capture the ( )prediction probability for false labels, which is an important factor of confusing samples.
49
+
50
+ Another advantage is that our distance function is bounded as opposed to the loss. For $k$ labels, the maximum value of $s t d ( h ( y | x _ { i } ; \pmb { \theta } ^ { t } ) )$ is $k ^ { - 1 } \sqrt { ( k - 1 ) }$ when $h ( m | x _ { i } ; \pmb { \theta } ^ { t } ) = 1$ and $\forall _ { l \neq m } h ( l | x _ { i } ; \pmb \theta ^ { t } ) =$ . Thus, $d i s t ( x _ { i } , y _ { i } ; \pmb { \theta } ^ { t } )$ ( ; )) (is bounded as in Eq. (2).
51
+
52
+ $$
53
+ - k ^ { - 1 } \sqrt { k - 1 } \le d i s t ( x _ { i } , y _ { i } ; \pmb { \theta } ^ { t } ) \le k ^ { - 1 } \sqrt { k - 1 }
54
+ $$
55
+
56
+ # 2.2 SAMPLING PROBABILITY BASED ON QUANTIZATION INDEX
57
+
58
+ The rank-based approach introduced by Loshchilov and Hutter (2016) is a common way to make the sampling probability of being selected for the next mini-batch. This approach sorts the samples by a certain importance measure in descending order, and exponentially decays the sampling probability of a given sample according to its rank. Let $N$ denote the total number of samples. Then, each $r$ -th ranked sample is selected with the probability $p ( r )$ which drops by a factor of $\exp { ( \log ( s _ { e } ) / N ) }$ . Here, $s _ { e }$ ( ) exp (log( ) )is the selection pressure parameter that affects the probability gap between the most and the least important samples. When normalized to sum up to . , the probability of the $r$ -th ranked sample’s being selected is defined by Eq. (3).
59
+
60
+ $$
61
+ p ( r ) = \frac { 1 / \exp { ( \log ( s _ { e } ) / N ) ^ { r } } } { \sum _ { j = 1 } ^ { N } 1 / \exp { ( \log ( s _ { e } ) / N ) ^ { j } } }
62
+ $$
63
+
64
+ In the existing rank-based approach, the rank of a sample is determined by $\left| d i s t ( x _ { i } , y _ { i } ; \pmb \theta ^ { t } ) \right|$ in as( ; )cending order, because it is inversely proportional to the sample importance. However, if the mass of the true sample distribution is skewed to one side (e.g., easy side) as shown in Figure 4, the mini-batch samples are selected with high probability from the skewed side rather than around the decision boundary where $\left| d i s t ( x _ { i } , y _ { i } ; \pmb \theta ^ { t } ) \right|$ is very small. This problem was attributed to uncondi( ; )tionally fixed probability to a given rank. In other words, the samples with similar ranks are selected with similar probabilities regardless of the magnitude of the distance values.
65
+
66
+ ![](images/818425af6176f7a58f39732b449692ee2fd10818da5fdfdedfb03ef21205855a.jpg)
67
+ Figure 4: Sample distribution according to the normalized $d i s t ( x _ { i } , y _ { i } ; \pmb { \theta } ^ { t } )$ at the training accuracy of $8 0 \%$ , when training LeNet-5 $s _ { e } = 1 0 0$ ( ; )) with the Fashion-MNIST data set. The distributions of 80% = 100mini-batch samples selected by the rank-based and quantization-based approaches, respectively, are plotted together with the true sample distribution.
68
+
69
+ To incorporate the impact of the distance into batch selection, we adopt the quantization method (Gray and Neuhoff, 1998; Chen and Wornell, 2001) and use the quantization index $q$ instead of the rank $r$ . Let $\Delta$ be the quantization step size and $d$ be the output of the function $d i s t ( x _ { i } , y _ { i } ; \pmb { \theta } ^ { t } )$ of a Δgiven sample $x _ { i }$ . Then, the index $q$ is obtained by the quantizer $Q ( d )$ ( ; )as in Eq. (4). The quantization ( )index gets larger as a sample moves away from the decision boundary. In addition, the difference between two indexes reflects the difference in the actual distances.
70
+
71
+ $$
72
+ q = Q ( d ) , ~ Q ( d ) = \lceil \lvert d \rvert / \Delta \rceil
73
+ $$
74
+
75
+ In Eq. (4), we set $\Delta$ to be $k ^ { - 1 } \sqrt { k - 1 } / N$ such that the index $q$ is bounded to $N$ (the total number Δ 1of samples) by Eq. (2). The sampling probability of a given sample $x _ { i }$ with the true label $y _ { i }$ is defined as Eq. (5). As shown in Figure 4, our quantization-based method provides a well-balanced distribution, even if the true sample distribution is skewed.
76
+
77
+ $$
78
+ p ( x _ { i } , y _ { i } ) = \frac { 1 / \exp { ( \log ( s _ { e } ) / N ) ^ { Q ( d i s t ( x _ { i } , y _ { i } ; \theta ^ { t } ) ) } } } { \sum _ { j = 1 } ^ { N } 1 / \exp { ( \log ( s _ { e } ) / N ) ^ { Q ( d i s t ( x _ { j } , y _ { j } ; \theta ^ { t } ) ) } } }
79
+ $$
80
+
81
+ # 3 Ada-Boundary ALGORITHM
82
+
83
+ # 3.1 MAIN PROPOSED ALGORITHM
84
+
85
+ Algorithm 1 describes the overall procedure of Ada-Boundary. The input to the algorithm consists of the samples of size $N$ (i.e., training data set), the mini-batch size $b$ , the selection pressure $s _ { e }$ , and the threshold $\gamma$ used to decide the warm-up period. In the early stages of training, since the quantization index for each sample is not confirmed yet, the algorithm requires the warm-up period during $\gamma$ epochs. Randomly selected mini-batch samples are used to warm-up (Lines 6–7), and their quantization indexes are updated (Lines 11–16). After the warm-up epochs, the algorithm computes the sampling probability of each sample by Eq. (5) and selects mini-batch samples based on the probability (Lines 8–10). Then, the quantization indexes are updated in the same way (Lines $1 1 -$ 16). Here, we compute the indexes using the model with $\pmb { \theta } ^ { t + \hat { 1 } }$ after every SGD step rather than every epoch, in order to reflect the latest state of the model; besides, we asynchronously update the indexes of the samples only included in the mini-batch, to avoid the forward propagation of the entire samples which induces a high computational cost.
86
+
87
+ # Algorithm 1 Ada-Boundary Algorithm
88
+
89
+ INPUT: $N$ samples, numEpoch, $b$ : mini-batch size, $s _ { e }$ : selection pressure, $\gamma$ : warm-up period
90
+ 1: $t \gets 1$
91
+ 2: $\theta ^ { t } \gets$ ;Initialize the model parameter
92
+ 3: $q . d i c t \gets \{ \}$ $/ *$ ; Dictionary for quantization indexes $^ { * }$
93
+ 4: for $i = 1$ ;to numEpoch do
94
+ 5: =for $j = 1$ to $N / b$ do
95
+ 6: if $i \leq \gamma$ then $/ *$ Warm-up $^ { * }$
96
+ 7: $\{ ( x _ { 1 } , y _ { 1 } ) , \dotsc , ( x _ { b } , y _ { b } ) \} $ Randomly select next mini-batch samples;
97
+ 8: (else $/ { * }$ ) ( ) Adaptive batch selection $^ { * }$
98
+ 9: prob $t a b l e \gets C$ ompute P robability q dict, se ; $/ { * }$ By Eq. (5) \*/
99
+ 10: $\{ ( x _ { 1 } , y _ { 1 } ) , \dotsc , ( x _ { b } , y _ { b } ) \} $ ( )Select next mini-batch samples based on prob table
100
+ 11: $l o s s \gets G e t \_ L o s s ( \{ ( x _ { 1 } , y _ { 1 } ) , \dots , ( x _ { b } , y _ { b } ) \} , \theta ^ { t } )$ $/ *$ Forward $1 ~ ^ { * } /$
101
+ 12: $\pmb { \theta } ^ { t + 1 } S G D \_ S t e p ( l o s s , \pmb { \theta } ^ { t } )$ $/ *$ ( ) Backward $^ { * }$ ;
102
+ 13: $/ { * }$ ( Asynchronous update $^ { * }$
103
+ 14: $\{ h ( y | \check { x } _ { 1 } ; \theta ^ { t + 1 } ) , . . . , \hat { h } ( y | x _ { b } ; \theta ^ { t + 1 } ) \} G e t . S o f t m a x ( \{ x _ { 1 } , . . . , x _ { b } \} , \theta ^ { t + 1 } ) ; \ / \mathrm { { s u p t - s u p } }$ Forward 2 \*/
104
+ 15: ( ; )for m to b do
105
+ 16: $q _ { - } d i c t [ x _ { m } ] = Q ( d i s t ( x _ { m } , y _ { m } ; \pmb { \theta } ^ { t + 1 } ) )$ $/ { * }$ Compute quantization indexes by Eq. (4) \*/
106
+ 17: [t ← t
107
+
108
+ # 3.2 VARIANTS OF Ada-Boundary FOR COMPARISON
109
+
110
+ ![](images/f33034103110e8cc9fce0acf513f986630543d8150251e4575a040e62b36e8f7.jpg)
111
+ Figure 5: The distributions of mini-batch samples selected by the three variants in the same configuration as Figure 4.
112
+
113
+ For a more sophisticated analysis of sampling strategies, we modify a few lines of Algorithm 1 to present three heuristic sampling strategies, which are detailed in Appendix A. (i) Ada-Easy is designed to show the effect of easy samples on training, so it focuses on the samples far from the decision boundary to the positive direction. (ii) Ada-Hard is similar to the existing hard batch strategy (Loshchilov and Hutter, 2016), but it uses our distance function instead of the loss. That is, Ada-Hard focuses on the samples far from the decision boundary to the negative direction, which is the opposite of Ada-Easy. (iii) Ada-Uniform is designed to select the samples for a wide range of difficulty, so it samples uniformly over the distance range regardless of the sample distribution. Figure 5 shows the distributions of mini-batch samples drawn by these three variants. The distribution of Ada-Easy is skewed to the easy side, that of Ada-Hard is skewed to the hard side, and that of Ada-Uniform tends to be uniform.
114
+
115
+ To avoid additional inference steps of Ada-Boundary (Line in Algorithm 1), we present a history14based variant, called Ada-Boundary(History). It updates the qunatization indexes using the previous model with $\pmb { \theta } ^ { t }$ . See Appendix B for the detailed algorithm and experiment results.
116
+
117
+ # 4 EVALUATION
118
+
119
+ # 4.1 DATA SETS AND ARCHITECTURES
120
+
121
+ In this section, all the experiments were performed on three benchmark data sets: MNIST2 of handwritten digits (LeCun, 1998) with , training and , testing images; Fashion-MNIST3 of 60 000 10 000various clothing (Xiao et al., 2017) with , training and , testing images; and CIFAR$1 0 ^ { 4 }$ 60 000 10 000of a subset of 80 million categorical images (Krizhevsky et al., 2014) with , training and 50 000, testing images. We did not apply any data augmentation and pre-processing procedures.
122
+
123
+ A simple model LeNet-5 (LeCun et al., 2015) was used for two easy data sets, MNIST and FasionMNIST. A complex model WideResNet-16-8 (Zagoruyko and Komodakis, 2016) was used for a relatively difficult data set, CIFAR-10. Batch normalization (Ioffe and Szegedy, 2015) was applied to both models. As for hyper-parameters, we used a learning rate of . and a batch size of ; the 0 01 128training epoch was set to be for LeNet-5 and for WideResNet-16-8, which is early stopping 50 70to clearly show the difference in convergence speed. Regarding those specific to our algorithm, we set the selection pressure $s _ { e }$ to be , which is the best value found from $s _ { e } = \{ 1 0 , 1 0 0 , 1 0 0 0 \}$ on 100the three data sets, and set the warm-up threshold $\gamma$ = 10to be . Technically, a small $\gamma$ 00 1000was enough 10to warm-up, but to reduce the performance variance caused by randomly initialized parameters, we used the larger $\gamma$ and shared model parameters for all strategies during the warm-up period.
124
+
125
+ Due to the lack of space, the experimental results using DenseNet $L \ = \ 2 5$ , $k \ = \ 1 2$ ) (Huang et al., 2017) on two hard data sets, CIFAR- $1 0 0 ^ { 4 }$ = 25 = 12and Tiny-ImageNet 5, are discussed in Appendix C together with the impact of the selection pressure $s _ { e }$ .
126
+
127
+ # 4.2 ALGORITHMS
128
+
129
+ We compared Ada-Boundary with not only random batch selection but also four different adaptive batch selections. Random batch selection selects the next batch uniformly at random from the entire data set. One of four adaptive selections is the state-of-the-art strategy that selects hard samples based on the loss-rank, which is called online batch selection (Loshchilov and Hutter, 2016), and the remainders, Ada-Easy, Ada-Hard, and Ada-Uniform, are the three variants introduced in Section 3.2. All the algorithms were implemented using TensorFlow6 and executed using a single NVIDIA Tesla V100 GPU on DGX-1. For reproducibility, we provide the source code at https://github. com/anonymized.
130
+
131
+ # 4.3 EVALUATION METRICS
132
+
133
+ To measure the performance gain over the baseline (random batch selection) as well as the state-ofart (online batch selection), we used the following three metrics. We repeated every test five times for robustness and reported the average. The wall-clock training time is discussed in Appendix D.
134
+
135
+ ![](images/40c0e575e636a611f5f9e96bdd5a189f77d83ee1eafe25d298fc3d67c2a967c4.jpg)
136
+ Figure 6: Convergence curves of five batch selection strategies with SGD on three data sets.
137
+
138
+ (i) $G a i n _ { e r r }$ : Reduction in test error at the final epoch $( \% )$ . In Figure 6(a), at the 50th epoch, the test error of random batch selection was $1 . 0 1 4 \cdot 1 0 ^ { - 2 }$ , and that of Ada-Boundary was $8 . 6 4 3 \cdot 1 0 ^ { - 3 }$ . Thus, $G a i n _ { e r r }$ was $( 1 . 0 1 4 \cdot 1 0 ^ { - 2 } - 8 . 6 4 3 \cdot 1 0 ^ { - 3 } ) / 1 . 0 1 4 \cdot 1 0 ^ { - 2 } \times 1 0 0 = \dot { 1 } 4 . 8 \%$ .
139
+
140
+ (ii) $G a i n _ { e p o }$ : Reduction in number of epochs to obtain the same error $( \% )$ . In Figure 6(a), the test error of $1 . 0 1 4 \cdot 1 0 ^ { 2 }$ achieved at the 50th epoch by random batch selection can be achieved only 1 014 10at the 29th epoch by Ada-Boundary. Thus, $G a i n _ { e r r }$ was $( 5 0 - 2 9 ) / 5 0 \times 1 0 0 = 4 2 . 0 \%$ .
141
+
142
+ (iii) $G a i n _ { t i m }$ : Reduction in running time to obtain the same error $( \% )$ . In Figure 6(a), similar to $G a i n _ { e p o }$ , $G a i n _ { t i m }$ was $( 2 0 5 . 0 - 1 3 6 . 3 ) / 2 0 5 . 0 \times 1 0 0 = 3 3 . 5 \%$ .
143
+
144
+ # 4.4 CONVERGENCE ANALYSIS
145
+
146
+ Figure 6 shows the convergence curves of training loss and test error for five batch selection strategies on three data sets, when we used the SGD optimizer for training. In order to improve legibility, only the curves for the baseline and proposed strategies are dark colored; thus, the three metrics in the figure were calculated against the baseline strategy, random batch selection. Owing to the lack of space, we discuss the results with the momentum optimizer in Appendix E. Ada-Easy was excluded in Figure 6 because its convergence speed was much slower than other strategies. That is, easy samples did not contribute to expedite training. We conduct convergence analysis of the five batch selection strategies for the same number of epochs, as follows:
147
+
148
+ MNIST (Figure 6(a)): All adaptive batch selections achieved faster convergence speed compared with random batch selection. Ada-Boundary, Ada-Hard, and online batch selection showed similar performance. Ada-Uniform was the fastest at the beginning, but its training loss and test error increased sharply in the middle of the training or testing procedures.
149
+
150
+ Fashion-MNIST (Figure 6(b)): Ada-Boundary showed the fastest convergence speed in both training loss and test error. In contrast, after warm-up epochs, the training loss of the other adaptive batch selections increased temporarily, and their test error at the final epoch became similar to that of random batch selection.
151
+
152
+ CIFAR-10 (Figure 6(c)): Ada-Boundary and Ada-Hard showed the fastest convergence on training loss, but in test error, the convergence speed of Ada-Hard was much slower than that of Ada-Boundary. This means that focusing on hard samples results in the overfitting to “too hard” samples, which is indicated by a larger difference between the converged training loss (error) and the converged test error. Also, the slow convergence speed of online batch selection in test error is explained by the same reason.
153
+
154
+ In summary, in the easiest MNIST data set, all adaptive batch selections accelerated their convergence speed compared with random batch selection. However, as the training difficulty (complexity) increased from MNIST to Fashion-MNIST and further to CIFAR-10, only Ada-Boundary converged significantly (by $G a i n _ { e r r }$ ) faster than random batch selection.
155
+
156
+ # 4.5 SUMMARY OF PERFORMANCE GAINS
157
+
158
+ We clarify the quantitative performance gains of Ada-Boundary over random batch and online batch selections in Table 1. Ada-Boundary significantly outperforms both strategies, as already shown in Figure 6. There is only one exception in MNIST, because online batch selection is known to work well with an easy data set (Loshchilov and Hutter, 2016). The noticeable advantage of AdaBoundary is to reduce the training time significantly by up to around $3 0 \%$ , which is really important for huge, complex data sets.
159
+
160
+ Table 1: Performance gains over random batch and online batch selections.
161
+
162
+ <table><tr><td rowspan=1 colspan=1>Comparison target</td><td rowspan=1 colspan=3>Against random batch selection</td><td rowspan=1 colspan=3>Against online batch selection</td></tr><tr><td rowspan=1 colspan=1>Metrics</td><td rowspan=1 colspan=1>Gainerr</td><td rowspan=1 colspan=1>Gainepo</td><td rowspan=1 colspan=1>Gaintim</td><td rowspan=1 colspan=1>Gainerr</td><td rowspan=1 colspan=1>Gainepo</td><td rowspan=1 colspan=1>Gaintim</td></tr><tr><td rowspan=1 colspan=1>MNIST</td><td rowspan=1 colspan=1>14.8%</td><td rowspan=1 colspan=1>42.0%</td><td rowspan=1 colspan=1>33.5%</td><td rowspan=1 colspan=1>-2.08%</td><td rowspan=1 colspan=1>0.00%</td><td rowspan=1 colspan=1>0.00%</td></tr><tr><td rowspan=1 colspan=1>Fashion-MNIST</td><td rowspan=1 colspan=1>8.01%</td><td rowspan=1 colspan=1>40.0%</td><td rowspan=1 colspan=1>29.6%</td><td rowspan=1 colspan=1>10.2%</td><td rowspan=1 colspan=1>42.0%</td><td rowspan=1 colspan=1>31.7%</td></tr><tr><td rowspan=1 colspan=1>CIFAR-10</td><td rowspan=1 colspan=1>7.34%</td><td rowspan=1 colspan=1>24.3%</td><td rowspan=1 colspan=1>14.0%</td><td rowspan=1 colspan=1>13.7%</td><td rowspan=1 colspan=1>46.0%</td><td rowspan=1 colspan=1>18.0%</td></tr></table>
163
+
164
+ # 5 RELATED WORK
165
+
166
+ There have been numerous attempts to understand which samples contribute the most during training. Curriculum learning (Bengio et al., 2009), inspired by the perceived way that humans and animals learn, first takes easy samples and then gradually increases the difficulty of samples in a manual manner. Self-paced learning (Kumar et al., 2010) uses the prediction error to determine the easiness of samples in order to alleviate the limitation of curriculum learning. They regard that the importance is determined by how easy the samples are. However, easiness is not sufficient to decide when a sample should be introduced to a learner (Gao and Jojic, 2017).
167
+
168
+ Recently, Tsvetkov et al. (2016) used Bayesian optimization to optimize a curriculum for training dense, distributed word representations. Sachan and Xing (2016) emphasized that the right curriculum not only has to arrange data samples in the order of difficulty, but also introduces a small number of samples that are dissimilar to the previously seen samples. Shrivastava et al. (2016) proposed a hard-example mining algorithm to eliminate several heuristics and hyper-parameters commonly used to select hard examples. However, these algorithms are designed to support only a designated task, such as natural language processing or region-based object detection. The neural data filter proposed by Fan et al. (2017) is orthogonal to our work because it aims at filtering the redundant samples from streaming data. As mentioned earlier, Ada-Boundary in general follows the philosophy of curriculum learning.
169
+
170
+ More closely related to the adaptive batch selection, Loshchilov and Hutter (2016) keep the history of losses for previously seen samples, and compute the sampling probability based on the loss rank. The sample probability to be selected for the next mini-batch is exponentially decayed with its rank. This allows the samples with low ranks (i.e., high losses) are considered more frequently for the next mini-batch. Gao and Jojic (2017)’s work is similar to Loshchilov and Hutter (2016)’s work except that gradient norms are used instead of losses to compute the probability. In contrast to curriculum learning, both methods focus on only hard samples for training. Also, they ignore the difference in actual losses or gradient norms by transforming the values to ranks. We have empirically verified that Ada-Boundary outperforms online batch selection (Loshchilov and Hutter, 2016), which is regarded as the state-of-the-art of this category. Similar to our work, Chang et al. (2017) claimed that the uncertain samples should be preferred during training, but their main contribution lies on training more accurate and robust model by choosing samples with high prediction variances. In contrast, our main contribution lies on training faster using confusing samples near the decision boundary.
171
+
172
+ For the completeness of the survey, we mention the work to accelerate the optimization process of conventional algorithms based on importance sampling. Needell et al. (2014) re-weight the obtained gradients by the inverses of their sampling probabilities to reduce the variance. Schmidt et al. (2015) biased the sampling to the Lipschitz constant to quickly find the solution of a strongly-convex optimization problem arising from the training of conditional random fields.
173
+
174
+ # 6 CONCLUSION AND FUTURE WORK
175
+
176
+ In this paper, we proposed a novel adaptive batch selection algorithm, Ada-Boundary, that presents the most appropriate samples according to the learning progress of the model. Toward this goal, we defined the distance from a sample to the decision boundary and introduced a quantization method for selecting the samples near the boundary with high probability. We performed extensive experiments using two CNN models for three benchmark data sets. The results showed that Ada-Boundary significantly accelerated the training process as well as was better generalized in hard data sets. When training an easy data set, Ada-Boundary showed a fast convergence comparable to that of the state-of-the-art algorithm; when training relatively hard data sets, only Ada-Boundary converged significantly faster than random batch selection.
177
+
178
+ The most exciting benefit of Ada-Boundary is to save the time needed for the training of a DNN. It becomes more important as the size and complexity of data becomes higher, and can be boosted with recent advance of hardware technologies. Our immediate future work is to apply Ada-Boundary to other types of DNNs such as the recurrent neural networks (RNN) (Mikolov et al., 2010) and the long short-term memory (LSTM) (Hochreiter and Schmidhuber, 1997), which have a neural structure completely different from the CNN. In addition, we plan to investigate the relationship between the power of a DNN and the improvement of Ada-Boundary.
179
+
180
+ # REFERENCES
181
+
182
+ Bengio, Y., Louradour, J., Collobert, R., and Weston, J. (2009). Curriculum learning. In ICML, pages 41–48.
183
+ Chang, H.-S., Learned-Miller, E., and McCallum, A. (2017). Active bias: Training more accurate neural networks by emphasizing high variance samples. In NIPS, pages 1002–1012.
184
+ Chen, B. and Wornell, G. W. (2001). Quantization index modulation: A class of provably good methods for digital watermarking and information embedding. IEEE Trans. on Information Theory, 47(4):1423–1443.
185
+ Fan, Y., Tian, F., Qin, T., and Liu, T.-Y. (2017). Neural data filter for bootstrapping stochastic gradient descent. In ICLR.
186
+ Gao, T. and Jojic, V. (2017). Sample importance in training deep neural networks. https:// openreview.net/forum?id=r1IRctqxg.
187
+ Goodfellow, I., Bengio, Y., and Courville, A. (2016). Deep learning. MIT Press. http://www. deeplearningbook.org.
188
+ Gray, R. M. and Neuhoff, D. L. (1998). Quantization. IEEE Trans. on Information Theory, 44(6):2325–2383.
189
+ Hochreiter, S. and Schmidhuber, J. (1997). Long short-term memory. Neural computation, 9(8):1735–1780.
190
+ Huang, G., Liu, Z., Van Der Maaten, L., and Weinberger, K. Q. (2017). Densely connected convolutional networks. In CVPR, volume 1, page 3.
191
+ Ioffe, S. and Szegedy, C. (2015). Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, pages 448–456.
192
+ Katharopoulos, A. and Fleuret, F. (2018). Not all samples are created equal: Deep learning with importance sampling. In ICML, pages 2525–2534.
193
+ Kingma, D. P. and Ba, J. (2015). Adam: A method for stochastic optimization. In ICLR.
194
+ Krizhevsky, A., Nair, V., and Hinton, G. (2014). The CIFAR-10 dataset. https://www.cs. toronto.edu/˜kriz/cifar.html.
195
+ Krizhevsky, A., Sutskever, I., and Hinton, G. E. (2012). ImageNet classification with deep convolutional neural networks. In NIPS, pages 1097–1105.
196
+ Kumar, M. P., Packer, B., and Koller, D. (2010). Self-paced learning for latent variable models. In NIPS, pages 1189–1197.
197
+ LeCun, Y. (1998). The MNIST database of handwritten digits. http://yann.lecun.com/ exdb/mnist.
198
+ LeCun, Y. et al. (2015). LeNet-5, Convolutional neural networks. http://yann.lecun.com/ exdb/lenet.
199
+ Loshchilov, I. and Hutter, F. (2016). Online batch selection for faster training of neural networks. In ICLR.
200
+ Mikolov, T., Karafiat, M., Burget, L., ´ Cernock ˇ y, J., and Khudanpur, S. (2010). Recurrent neural \` network based language model. In INTERSPEECH, pages 1045–1048.
201
+ Needell, D., Ward, R., and Srebro, N. (2014). Stochastic gradient descent, weighted sampling, and the randomized Kaczmarz algorithm. In NIPS, pages 1017–1025.
202
+ Sachan, M. and Xing, E. (2016). Easy questions first? A case study on curriculum learning for question answering. In ACL, pages 453–463.
203
+ Schaul, T., Quan, J., Antonoglou, I., and Silver, D. (2016). Prioritized experience replay. In ICLR.
204
+ Schmidt, M., Babanezhad, R., Ahmed, M., Defazio, A., Clifton, A., and Sarkar, A. (2015). Nonuniform stochastic average gradient method for training conditional random fields. In AISTATS, pages 819–828.
205
+ Shrivastava, A., Gupta, A., and Girshick, R. (2016). Training region-based object detectors with online hard example mining. In CVPR, pages 761–769.
206
+ Tsvetkov, Y., Faruqui, M., Ling, W., MacWhinney, B., and Dyer, C. (2016). Learning the curriculum with bayesian optimization for task-specific word representation learning. In ACL, pages 130– 139.
207
+ Wu, C.-Y., Manmatha, R., Smola, A. J., and Krahenb ¨ uhl, P. (2017). Sampling matters in deep ¨ embedding learning. In ICCV, pages 2840–2848.
208
+ Xiao, H., Rasul, K., and Vollgraf, R. (2017). Fashion-MNIST: A novel image dataset for benchmarking machine learning algorithms. arXiv:1708.07747.
209
+ Zagoruyko, S. and Komodakis, N. (2016). Wide residual networks. In BMVC, pages 87.1–87.12.
210
+ Zeiler, M. D. (2012). ADADELTA: An adaptive learning rate method. arXiv:1212.5701.
211
+
212
+ # A IMPLEMENTATION OF THE THREE VARIANTS
213
+
214
+ For Ada-Easy which prefers easy samples to hard samples, $q$ should be small for the sample located deep in the positive direction. For Ada-Hard, $q$ should be small for the sample located deep in the negative direction. Thus, Ada-Easy and Ada-Hard can be implemented by modifying the quantizers $Q ( d )$ in Line of Algorithm 1. When we set $\Delta = k ^ { - 1 } \sqrt { k - 1 } / N$ to make the index $q$ bound to $N$ ( ) 16 Δ = 1, the quantizers of Ada-Easy and Ada-Hard are defined as Eqs. (6) and (7), respectively.
215
+
216
+ $$
217
+ \begin{array}{c} \begin{array} { c } { q = Q ( d ) } \\ { Q ( d ) = \{ \begin{array} { l l } { - \lceil d / 2 \Delta \rceil + N / 2 + 1 , } & { i f } \end{array} d \geq 0 } \\ { - \lfloor d / 2 \Delta \rfloor + N / 2 , } & { o t h e r w i s e } \\ { q = Q ( d ) } \\ { Q ( d ) = \{ \begin{array} { l l } { \lceil d / 2 \Delta \rceil + N / 2 , } & { i f } \end{array} d \geq 0 } \\ { \lfloor d / 2 \Delta \rfloor + N / 2 + 1 , } & { o t h e r w i s e } \end{array} \end{array}
218
+ $$
219
+
220
+ Ada-Uniform can be implemented by using ${ \cal F } ^ { - 1 } ( x )$ to compute the sampling probability in Line of Algorithm 1, where $F ( x )$ ( ) 9is the empirical sample distribution according to the sample’s distance to the decision boundary.
221
+
222
+ # B HISTORY-BASED Ada-Boundary VARIANT
223
+
224
+ We present Ada-Boundary(History) that updates the quantization indexes based on the previous model with $\pmb { \theta } ^ { t }$ instead of the latest model with $\pmb { \theta } ^ { t + 1 }$ . This is easily accomplished by replacing Lines – of Algorithm 1 with those of Algorithm 2. Ada-Boundary(History) reduces the time required 11 17for additional inference steps that reflect the latest state of the model, which correspond to Lines – of Algorithm 1, at the expense of slight increase of test error.
225
+
226
+ # Algorithm 2 Ada-Boundary(History)
227
+
228
+ INPUT: $N$ samples, numEpoch, $b$ : mini-batch size, $s _ { e }$ : selection pressure, $\gamma$ : warm-up period
229
+ 1: $t \gets 1$
230
+ 2: $\theta ^ { t } \gets$ ;Initialize the model parameter
231
+ 3: $q . d i c t \gets \{ \}$ $/ *$ ; Dictionary for quantization indexes $^ { * }$
232
+ 4: for $i = 1$ ;to numEpoch do
233
+ 5: =for $j = 1$ to $N / b$ do
234
+ 6: if $i \leq \gamma$ then $/ *$ Warm-up $^ { * }$
235
+ 7: $\{ ( x _ { 1 } , y _ { 1 } ) , \dotsc , ( x _ { b } , y _ { b } ) \} $ Randomly select next mini-batch samples;
236
+ 8: (else $/ { * }$ ) ( )Adaptive batch selection $^ { * }$
237
+ 9: prob table Compute P robability q dict, $s _ { e , \ l }$ ; $/ { * }$ By Eq. (5) \*/
238
+ 10: $\{ ( x _ { 1 } , y _ { 1 } ) , \dotsc , ( x _ { b } , \bar { y _ { b } } ) \} $ ( )Select next mini-batch samples based on prob table
239
+ 11: $/ { * }$ ( ) ( ) Forward and asynchronous update $^ { * }$
240
+ 12: $\{ h ( y | x _ { 1 } ; \theta ^ { t } ) , . . . , \{ h ( y | x _ { b } ; \theta ^ { t } ) \} , l o s s \gets G e t . S o f t m a x \& L o s s ( \{ ( x _ { 1 } , y _ { 1 } ) , . . . , ( x _ { b } , y _ { b } ) \} , \theta ^ { t } ) :$
241
+ 13: (for $m = 1$ )to $b$ do
242
+ 14: $q _ { - } d i c t [ x _ { m } ] = Q ( d i s t ( x _ { m } , y _ { m } ; \pmb { \theta } ^ { t } )$ $/ *$ Compute quantization indexes by Eq. (4) \*/
243
+ 15: [ ] =/\* Backward \*/
244
+ 16: $\pmb { \theta } ^ { t + 1 } S G D \_ S t e p ( l o s s , \pmb { \theta } ^ { t } )$
245
+ 17: t ← t
246
+
247
+ ![](images/15a42f39e74054cd3abe5c93fa9923710f1f78662a93fd746d354336dddd18aa.jpg)
248
+ Figure 7: Convergence curves of Ada-Boundary(History) with SGD on three data sets.
249
+
250
+ ![](images/23ee2678f70ce578fc159f487cc7e52e2d66854e54785c9119c11b05080e328d.jpg)
251
+ Figure 8: Convergence curves of Ada-Boundary(History) with momentum on three data sets.
252
+
253
+ ![](images/6c97e7f703e995bfbe707bae5ac77b2f9127a482b74c8344b27c34083648f710.jpg)
254
+ Figure 9: Convergence curves of Ada-Boundary with varying $s _ { e }$ on two hard data sets.
255
+
256
+ C Ada-Boundary ON TWO HARD DATA SETS
257
+
258
+ As a practical paper, we include the experimental results on two more challenging data sets: CIFAR100 composed of image classes with , training and , testing images; Tiny-ImageNet 100 50 000 10 000composed of image classes with , training and , testing images. All images in 200Tiny-ImageNet were resized to $3 2 \times 3 2$ 00 000images.
259
+
260
+ One of the state-of-the-art model DenseNet $L { = } 2 5$ , $k { = } 1 2$ ) (Huang et al., 2017) was used for two hard data sets with momentum optimizer. Regarding algorithm parameters, we used a learning rate of . and a batch size of ; The training epoch and warm-up threshold $\gamma$ were set to be and 0 1 128, respectively. We repeated every test five times for robustness and reported the average.
261
+
262
+ # C.1 IMPACT OF SELECTION PRESSURE $s _ { e }$
263
+
264
+ The selection pressure $s _ { e }$ determines how strongly the boundary samples are selected. The greater the $s _ { e }$ , the greater the sampling probability of the boundary sample, so more boundary samples were chosen for the next mini-batch. On the other hand, the less $s _ { e }$ makes Ada-Boundary closer to random batch selection.
265
+
266
+ Figure 9 shows the convergence curves of Ada-Boundary with varying $s _ { e }$ on two hard data sets. To clearly analyze the impact of the selection pressure, we plotted the minimum of training loss and test error with a given epochs. Overall, the convergence speed of training loss was accelerated as the $s _ { e }$ increased from to , but that of test error was faster only when the $s _ { e }$ was less than a 2 16certain value. The convergence speed of test error was faster than random batch selection, when $s _ { e }$ was less than or equal to (CIFAR-100) and (Tiny-ImageNet). Surprisingly, the overexposure to 4the boundary samples using the large $s _ { e }$ 2incurred the overfitting issue in hard data sets, whereas the large $s _ { e } = 1 0 0$ worked well for our easy or relatively hard data sets as discussed in Section 4. That = 100is, the selection pressure $s _ { e }$ should be chosen more carefully considering the difficulty of the given data set. We leave this challenge as our future work.
267
+
268
+ # C.2 PERFORMANCE ANALYSIS
269
+
270
+ Table 2 shows the performance gains of Ada-Boundary over random batch selection on two hard data sets. We only quantify the gains of Ada-Boundary $s _ { e } = 2 ,$ ) because its performance was the best as shown in Figure 9. Ada-Boundary $s _ { e } = 2 )$ = 2 always outperforms random batch selection. = 2Especially, it reduces the training time significantly by up to around $20 \%$ .
271
+
272
+ Table 2: Performance gains of Ada-Boundary( $s _ { e } = 2$ ) over random batch selection in Figure 9.
273
+
274
+ <table><tr><td rowspan=1 colspan=1>Comparison target</td><td rowspan=1 colspan=3>Against random batch selection</td></tr><tr><td rowspan=1 colspan=1>Metrics</td><td rowspan=1 colspan=1>Gainerr</td><td rowspan=1 colspan=1>Gainepo</td><td rowspan=1 colspan=1>Gaintim</td></tr><tr><td rowspan=1 colspan=1>CIFAR-100</td><td rowspan=1 colspan=1>1.99%</td><td rowspan=1 colspan=1>33.3%</td><td rowspan=1 colspan=1>21.4%</td></tr><tr><td rowspan=1 colspan=1>TINY-ImageNet</td><td rowspan=1 colspan=1>0.37%</td><td rowspan=1 colspan=1>31.1%</td><td rowspan=1 colspan=1>18.0%</td></tr></table>
275
+
276
+ Table 3 shows the wall-clock training time for the same number of parameter updates on two hard data sets (Figure 9). Ada-Boundary $s _ { e } = 2$ ) with momentum was $1 5 . { \overset { \cdot } { 2 } } \% - 1 6 . 0 \%$ slower than random = 2batch selection. However, it reduced the running time by $1 8 . 0 \% \mathrm { - 2 1 . 4 \% }$ 16(by $G a i n _ { t i m } \rangle$ to obtain the same test error of random batch selection.
277
+
278
+ Table 3: Wall-clock training time for Figure 9 (seconds).
279
+
280
+ <table><tr><td rowspan=1 colspan=1>Optimizer</td><td rowspan=1 colspan=2>Momentum (Figure 9)</td></tr><tr><td rowspan=1 colspan=1>Data sets</td><td rowspan=1 colspan=1>CIFAR-100</td><td rowspan=1 colspan=1>Tiny-ImageNet</td></tr><tr><td rowspan=1 colspan=1>Randombatch</td><td rowspan=1 colspan=1>1917</td><td rowspan=1 colspan=1>3814</td></tr><tr><td rowspan=1 colspan=1>Ada-Boundary(se = 2)</td><td rowspan=1 colspan=1>2260</td><td rowspan=1 colspan=1>4542</td></tr></table>
281
+
282
+ # D WALL-CLOCK TRAINING TIME
283
+
284
+ The procedures for recomputing sampling probabilities and updating quantization indexes make Ada-Boundary slower than random batch selection. Table 4 shows the wall-clock training time for the same number of parameter updates (i.e., the same number of epochs) with SGD (Figure 6) and momentum (Figure 10). Ada-Boundary with SGD was $1 2 . 8 \% \mathrm { - } \mathrm { \bar { 1 } } 4 . 7 \%$ and $6 . 0 6 \% - 1 2 . 2 \%$ 12 8% 14 7% 6 06% 12 2%slower than random batch and online batch selections, respectively. Ada-Boundary with momentum was $1 3 . 1 \% \mathrm { - } 1 4 . 7 \%$ and $6 . 6 7 \% - 1 2 . 2 \%$ slower than random batch and online batch selections, 13 1% 14 7% 6 67% 12 2%respectively. Although Ada-Boundary took longer for the same number of updates, Ada-Boundary achieved significant reduction in running time by $7 . 9 6 \% - 3 3 . 5 \%$ (by $G a i n _ { t i m }$ ) to obtain the same 7 96% 33 5%test error of random batch selection due to the fast convergence.
285
+
286
+ Table 4: Wall-clock training time for Figure 6 and Figure 10 (seconds).
287
+
288
+ <table><tr><td rowspan=1 colspan=1>Optimizer</td><td rowspan=1 colspan=3>SGD (Figure 6)</td><td rowspan=1 colspan=3>Momentum (Figure 10)</td></tr><tr><td rowspan=1 colspan=1>Data sets</td><td rowspan=1 colspan=1>MNIST</td><td rowspan=1 colspan=1>Fashion-MNIST</td><td rowspan=1 colspan=1>CIFAR-10</td><td rowspan=1 colspan=1>MNIST</td><td rowspan=1 colspan=1>Fashion-MNIST</td><td rowspan=1 colspan=1>CIFAR-10</td></tr><tr><td rowspan=1 colspan=1>Random batch</td><td rowspan=1 colspan=1>205</td><td rowspan=1 colspan=1>197</td><td rowspan=1 colspan=1>3347</td><td rowspan=1 colspan=1>199</td><td rowspan=1 colspan=1>192</td><td rowspan=1 colspan=1>3355</td></tr><tr><td rowspan=1 colspan=1>Online batch</td><td rowspan=1 colspan=1>218</td><td rowspan=1 colspan=1>217</td><td rowspan=1 colspan=1>3371</td><td rowspan=1 colspan=1>211</td><td rowspan=1 colspan=1>210</td><td rowspan=1 colspan=1>3388</td></tr><tr><td rowspan=1 colspan=1>Ada-Boundary</td><td rowspan=1 colspan=1>235</td><td rowspan=1 colspan=1>231</td><td rowspan=1 colspan=1>3838</td><td rowspan=1 colspan=1>231</td><td rowspan=1 colspan=1>225</td><td rowspan=1 colspan=1>3860</td></tr></table>
289
+
290
+ # E EXPERIMENT RESULTS USING MOMENTUM OPTIMIZER
291
+
292
+ # E.1 CONVERGENCE ANALYSIS
293
+
294
+ Figure 10 shows the convergence curves of training loss and test error for five batch selection strategies on three data sets, when we used the momentum optimizer with setting the momentum to be . . In the MNIST data set, we limited the number of epochs to be because both training loss and 0 9 30test error were fully converged after epochs. We repeat the convergence analysis, as follows:
295
+
296
+ MNIST (Figure 10(a)): Except Ada-Uniform, all adaptive batch selections converged faster than random batch selection. Online batch selection showed much faster convergence speed than other adaptive batch selections in training loss, but converged similarly with the others in test error owing to the overfitting to hard samples.
297
+
298
+ Fashion-MNIST (Figure 10(b)): Ada-Boundary showed the fastest convergence speed in test error, although it did not converge faster than online batch selection in training loss. In contrast, online batch selection was the fastest in training loss, but its convergence in test error was slightly slower than that of random batch selection. This emphasizes the need to consider the samples with appropriate difficulty rather than hard samples. The convergence speeds of Ada-Hard and Ada-Uniform in test error were slower than that of random batch selection.
299
+
300
+ • CIFAR-10 (Figure 10(c)): In both training loss and test error, Ada-Boundary and Ada-Hard showed slightly faster convergence speed than random batch selection. On the other hand, online batch selection converged slightly slower than random batch selection in both cases.
301
+
302
+ In summary, in the easiest MNIST data set, most of adaptive batch selections accelerated their convergence speed compared with random batch selection. However, in Fashion-MNIST data set, only Ada-Boundary converged faster than random batch selection. In a relatively difficult CIFAR-10 data set, Ada-Boundary and Ada-Hard showed comparable convergence speed and then converged faster than random batch selection.
303
+
304
+ # E.2 SUMMARY OF PERFORMANCE GAINS
305
+
306
+ We quantify the performance gains of Ada-Boundary over random batch and online batch selections in Table 5. Ada-Boundary always outperforms both strategies, as already shown in Figure 10. Compared with Table 1, $G a i n _ { t i m }$ over random batch selection tends to become smaller, whereas $G a i n _ { t i m }$ over online batch selection tends to become larger.
307
+
308
+ Table 5: Performance gains over two existing strategies in Figure 10.
309
+
310
+ <table><tr><td rowspan=1 colspan=1>Comparison target</td><td rowspan=1 colspan=3>Against random batch selection</td><td rowspan=1 colspan=3>Against online batch selection</td></tr><tr><td rowspan=1 colspan=1>Metrics</td><td rowspan=1 colspan=1>Gainerr</td><td rowspan=1 colspan=1>Gainepo</td><td rowspan=1 colspan=1>Gaintim</td><td rowspan=1 colspan=1>Gainerr</td><td rowspan=1 colspan=1>Gainepo</td><td rowspan=1 colspan=1>Gaintim</td></tr><tr><td rowspan=1 colspan=1>MNIST</td><td rowspan=1 colspan=1>5.58%</td><td rowspan=1 colspan=1>26.7%</td><td rowspan=1 colspan=1>14.9%</td><td rowspan=1 colspan=1>2.27%</td><td rowspan=1 colspan=1>13.0%</td><td rowspan=1 colspan=1>4.75%</td></tr><tr><td rowspan=1 colspan=1>Fashion-MNIST</td><td rowspan=1 colspan=1>2.24%</td><td rowspan=1 colspan=1>28.0%</td><td rowspan=1 colspan=1>15.6%</td><td rowspan=1 colspan=1>4.54%</td><td rowspan=1 colspan=1>46.0%</td><td rowspan=1 colspan=1>42.1%</td></tr><tr><td rowspan=1 colspan=1>CIFAR-10</td><td rowspan=1 colspan=1>3.43%</td><td rowspan=1 colspan=1>20.0%</td><td rowspan=1 colspan=1>7.96%</td><td rowspan=1 colspan=1>4.02%</td><td rowspan=1 colspan=1>28.0%</td><td rowspan=1 colspan=1>18.0%</td></tr></table>
311
+
312
+ ![](images/a557dd60ed6a09255913841405b85b9befec88f289d1d5392f1f994a030b3032.jpg)
313
+ Figure 10: Convergence curves using the momentum optimizer for Figure 6.
parse/train/SyfXKoRqFQ/SyfXKoRqFQ_content_list.json ADDED
@@ -0,0 +1,1350 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "ADA-BOUNDARY: ACCELERATING THE DNN TRAINING VIA ADAPTIVE BOUNDARY BATCH SELECTION ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 176,
8
+ 99,
9
+ 821,
10
+ 146
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Anonymous authors Paper under double-blind review ",
17
+ "bbox": [
18
+ 183,
19
+ 171,
20
+ 398,
21
+ 198
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "ABSTRACT ",
28
+ "text_level": 1,
29
+ "bbox": [
30
+ 454,
31
+ 236,
32
+ 544,
33
+ 251
34
+ ],
35
+ "page_idx": 0
36
+ },
37
+ {
38
+ "type": "text",
39
+ "text": "Neural networks can converge faster with help from a smarter batch selection strategy. In this regard, we propose Ada-Boundary, a novel adaptive-batch selection algorithm that constructs an effective mini-batch according to the learning progress of the model. Our key idea is to present confusing samples what the true label is. Thus, the samples near the current decision boundary are considered as the most effective to expedite convergence. Taking advantage of our design, Ada-Boundary maintains its dominance in various degrees of training difficulty. We demonstrate the advantage of Ada-Boundary by extensive experiments using two convolutional neural networks for three benchmark data sets. The experiment results show that Ada-Boundary improves the training time by up to $3 1 . { \\bar { 7 } } \\%$ compared with the state-of-the-art strategy and by up to $3 3 . 5 \\%$ 31 7%compared with the baseline strategy. ",
40
+ "bbox": [
41
+ 232,
42
+ 265,
43
+ 764,
44
+ 431
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "1 INTRODUCTION ",
51
+ "text_level": 1,
52
+ "bbox": [
53
+ 176,
54
+ 457,
55
+ 334,
56
+ 472
57
+ ],
58
+ "page_idx": 0
59
+ },
60
+ {
61
+ "type": "text",
62
+ "text": "Deep neural networks (DNNs) have achieved remarkable performance in many fields, especially, in computer vision and natural language processing (Krizhevsky et al., 2012; Goodfellow et al., 2016). Nevertheless, as the size of data grows very rapidly, the training step via stochastic gradient descent (SGD) based on mini-batches suffers from extremely high computational cost, which is mainly due to slow convergence. The common approaches for expediting convergence include some SGD variants (Zeiler, 2012; Kingma and Ba, 2015) that maintain individual learning rates for parameters and batch normalization (Ioffe and Szegedy, 2015) that stabilizes gradient variance. ",
63
+ "bbox": [
64
+ 174,
65
+ 487,
66
+ 825,
67
+ 585
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "Recently, in favor of the fact that not all samples have an equal impact on training, many studies have attempted to design sampling schemes based on the sample importance (Wu et al., 2017; Fan et al., 2017; Katharopoulos and Fleuret, 2018). Curriculum learning (Bengio et al., 2009) inspired by human’s learning is one of the representative methods to speed up the training step by gradually increasing the difficulty level of training samples. In contrast, deep learning studies focus on giving higher weights to harder samples during the entire training process. When the model requires a lot of epochs for convergence, it is known to converge faster with the batches of hard samples rather than randomly selected batches (Schaul et al., 2016; Loshchilov and Hutter, 2016; Gao and Jojic, 2017). There are various criteria for judging the hardness of a sample, e.g., the rank of the loss computed from previous epochs (Loshchilov and Hutter, 2016). ",
74
+ "bbox": [
75
+ 173,
76
+ 592,
77
+ 823,
78
+ 621
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "image",
84
+ "img_path": "images/421427af452dd81ff21ad506700eaef0918cb82015326deb10e81fffb18e9146.jpg",
85
+ "image_caption": [
86
+ "Figure 1: Analysis on hard batch selection strategy: (a) shows the true sample distribution according to the difficulty computed by Eq. (1) at the training accuracy of $6 0 \\%$ . An easy data set (MNIST) does 60%not have “too hard” sample but “moderately hard” samples colored in gray, whereas a relatively hard data set (CIFAR-10) has many “too hard” samples colored in black. (b) shows the result of SGD on a hard batch. The moderately hard samples are informative to update a model, but the too hard samples make the model overfit to themselves. "
87
+ ],
88
+ "image_footnote": [],
89
+ "bbox": [
90
+ 222,
91
+ 641,
92
+ 758,
93
+ 825
94
+ ],
95
+ "page_idx": 0
96
+ },
97
+ {
98
+ "type": "text",
99
+ "text": "",
100
+ "bbox": [
101
+ 173,
102
+ 103,
103
+ 825,
104
+ 215
105
+ ],
106
+ "page_idx": 1
107
+ },
108
+ {
109
+ "type": "text",
110
+ "text": "Here, a natural question arises: Does the “hard” batch selection always speed up DNN training? Our answer is partially yes: it is helpful only when training an easy data set. According to our indepth analysis, as demonstrated in Figure 1(a), the hardest samples in a hard data set (e.g., CIFAR10) were too hard to learn. They are highly likely to make the decision boundary bias towards themselves, as shown in Figure 1(b). On the other hand, in an easy data set (e.g., MNIST), the hardest samples, though they are just moderately hard, provide useful information for training. In practice, it was reported that hard batch selection succeeded to speed up only when training the easy MNIST data set (Loshchilov and Hutter, 2016; Gao and Jojic, 2017), and our experiments in Section 4.4 also confirmed the previous findings. This limitation calls for a new sampling scheme that supports both easy and hard data sets. ",
111
+ "bbox": [
112
+ 174,
113
+ 222,
114
+ 825,
115
+ 361
116
+ ],
117
+ "page_idx": 1
118
+ },
119
+ {
120
+ "type": "text",
121
+ "text": "In this paper, we propose a novel adaptive batch selection strategy, called Ada-Boundary, that accelerates training and is better generalized to hard data sets. As opposed to existing hard batch selection, Ada-Boundary picks up the samples with the most appropriate difficulty, considering the learning progress of the model. The samples near the current decision boundary are selected with high probability, as shown in Figure 2(a). Intuitively speaking, the samples far from the decision boundary are not that helpful since they are either too hard or too easy: those on the incorrect (or correct) side are too hard (or easy). This is the reason why we regard the samples around the decision boundary, which are moderately hard, as having the appropriate difficulty at the moment. ",
122
+ "bbox": [
123
+ 173,
124
+ 367,
125
+ 825,
126
+ 479
127
+ ],
128
+ "page_idx": 1
129
+ },
130
+ {
131
+ "type": "image",
132
+ "img_path": "images/3dcf4e14010db7173bf7ee9bd132ff1810f6d66e6ca9db84eb6ae9542a7d4cf4.jpg",
133
+ "image_caption": [
134
+ "Figure 2: Key idea of Ada-Boundary: (a) shows the sampling process of Ada-Boundary, (b) shows the results of an SGD iteration on the boundary samples. "
135
+ ],
136
+ "image_footnote": [],
137
+ "bbox": [
138
+ 207,
139
+ 497,
140
+ 797,
141
+ 632
142
+ ],
143
+ "page_idx": 1
144
+ },
145
+ {
146
+ "type": "text",
147
+ "text": "Overall, the key idea of Ada-Boundary is to use the distance of a sample to the decision boundary for the hardness of the sample. The beauty of this design is not to require human intervention. The current decision boundary should be directly influenced by the learning progress of the model. The decision boundary of a DNN moves towards eliminating the incorrect samples as the training step progresses, so the difficulty of the samples near the decision boundary gradually increases as the model is learned. Then, the decision boundary keeps updated to identify the confusing samples in the middle of SGD, as illustrated in Figure 2(b). This approach is able to accelerate the convergence speed by providing the samples suited to the model at every SGD iteration, while it is less prone to incur an overfitting issue. ",
148
+ "bbox": [
149
+ 173,
150
+ 690,
151
+ 825,
152
+ 815
153
+ ],
154
+ "page_idx": 1
155
+ },
156
+ {
157
+ "type": "text",
158
+ "text": "We have conducted extensive experiments to demonstrate the superiority of Ada-Boundary. Two popular convolutional neural network (CNN)1 models are trained using three benchmark data sets. Compared to random batch selection, Ada-Boundary significantly reduces the execution time by $1 4 . 0 \\hat { - } 3 3 . 5 \\%$ . At the same time, it provides a relative improvement of test error by $7 . 3 4 \\mathrm { - } 1 4 . 8 \\%$ in the 14 0 33 5% 7 34 14 8%final epoch. Moreover, compared to the state-of-the-art hard batch selection (Loshchilov and Hutter, ",
159
+ "bbox": [
160
+ 174,
161
+ 823,
162
+ 825,
163
+ 892
164
+ ],
165
+ "page_idx": 1
166
+ },
167
+ {
168
+ "type": "text",
169
+ "text": "2016), Ada-Boundary achieves the execution time smaller by $1 8 . 0 \\%$ and the test error smaller by $1 3 . 7 \\%$ in the CIFAR-10 data set. ",
170
+ "bbox": [
171
+ 173,
172
+ 103,
173
+ 823,
174
+ 132
175
+ ],
176
+ "page_idx": 2
177
+ },
178
+ {
179
+ "type": "text",
180
+ "text": "2 Ada-Boundary COMPONENTS ",
181
+ "text_level": 1,
182
+ "bbox": [
183
+ 176,
184
+ 151,
185
+ 442,
186
+ 167
187
+ ],
188
+ "page_idx": 2
189
+ },
190
+ {
191
+ "type": "text",
192
+ "text": "The main challenge for Ada-Boundary is to evaluate how close a sample is to the decision boundary. In this section, we introduce a novel distance measure and present a method of computing the sampling probability based on the measure. ",
193
+ "bbox": [
194
+ 174,
195
+ 181,
196
+ 825,
197
+ 224
198
+ ],
199
+ "page_idx": 2
200
+ },
201
+ {
202
+ "type": "text",
203
+ "text": "2.1 SAMPLE’S DISTANCE BASED ON SOFTMAX DISTRIBUTION ",
204
+ "text_level": 1,
205
+ "bbox": [
206
+ 173,
207
+ 241,
208
+ 612,
209
+ 253
210
+ ],
211
+ "page_idx": 2
212
+ },
213
+ {
214
+ "type": "text",
215
+ "text": "To evaluate the sample’s distance to the decision boundary, we note that the softmax distribution, which is the output of the softmax layer in neural networks, clearly distinguishes how confidently the learner predicts and whether the prediction is right or wrong, as demonstrated in Figure 3. ",
216
+ "bbox": [
217
+ 176,
218
+ 265,
219
+ 826,
220
+ 309
221
+ ],
222
+ "page_idx": 2
223
+ },
224
+ {
225
+ "type": "image",
226
+ "img_path": "images/3c39ad02be09810a54dca8df6a3212ec3047d520f89387ea11e4b8104479527f.jpg",
227
+ "image_caption": [
228
+ "Figure 3: Classification of CIFAR-10 samples using the softmax distribution obtained from WideResNet 16-8 when training accuracy is $5 0 \\%$ . If the prediction probability of the true label 90%is the highest, the prediction is correct; otherwise, incorrect. If the highest probability dominates the distribution, the model’s confidence is strong; otherwise, weak. "
229
+ ],
230
+ "image_footnote": [],
231
+ "bbox": [
232
+ 207,
233
+ 324,
234
+ 790,
235
+ 527
236
+ ],
237
+ "page_idx": 2
238
+ },
239
+ {
240
+ "type": "text",
241
+ "text": "Let $h ( y | x _ { i } ; \\theta ^ { t } )$ be the softmax distribution of a given sample $x _ { i }$ over $y \\in \\{ 1 , 2 , \\ldots , k \\}$ labels, where $\\pmb { \\theta } ^ { t }$ ( ; )is the parameter of a neural network at time $t$ 1 2. Then, the distance from a sample $x _ { i }$ with the true label $y _ { i }$ to the decision boundary of the neural network with $\\pmb { \\theta } ^ { t }$ is defined by the directional distance function in Eq. (1). More specifically, the function consists of two terms related to the direction and magnitude of the distance, determined by the model’s correctness and confidence, respectively. The correctness is determined by verifying whether the label with the highest probability matches the true label $y _ { i }$ , and the confidence is computed by the standard deviation of the softmax distribution. Intuitively, the standard deviation is a nice indicator of the confidence because the value gets closer to zero when the learner confuses. ",
242
+ "bbox": [
243
+ 173,
244
+ 606,
245
+ 826,
246
+ 732
247
+ ],
248
+ "page_idx": 2
249
+ },
250
+ {
251
+ "type": "equation",
252
+ "img_path": "images/175ced99aab1c4e4426290a0915da4bbb104d9cfb016743cc63fe36638617c2f.jpg",
253
+ "text": "$$\n\\begin{array} { r l } & { \\quad d i s t ( x _ { i } , y _ { i } ; \\pmb \\theta ^ { t } ) = \\overbrace { s i g n ( x _ { i } , y _ { i } ) } ^ { \\qquad } \\cdot \\overbrace { s t d ( h ( y | x _ { i } ; \\pmb \\theta ^ { t } ) ) } ^ { \\qquad } } \\\\ & { \\quad i g n ( x _ { i } , y _ { i } ) = \\overbrace { \\left\\{ - 1 , \\begin{array} { l l } { a r g m a x _ { y \\in \\{ 1 , 2 , \\ldots , k \\} } h ( y | x _ { i } ; \\pmb \\theta ^ { t } ) = y _ { i } } \\\\ { - 1 , } & { o t h e r w i s e } \\end{array} \\right. } } \\end{array}\n$$",
254
+ "text_format": "latex",
255
+ "bbox": [
256
+ 308,
257
+ 744,
258
+ 697,
259
+ 808
260
+ ],
261
+ "page_idx": 2
262
+ },
263
+ {
264
+ "type": "text",
265
+ "text": "One might argue that the cross-entropy loss, $H ( p , q ) = - p ( x _ { i } ) \\log ( q ( x _ { i } ) )$ where $p ( x _ { i } )$ and $q ( x _ { i } )$ are the true and softmax distributions for $x _ { i }$ ( ) = ( ) log( ( )) ( ) ( ), can be adopted for the distance function. However, because $p ( x _ { i } )$ is formulated as a one-hot true label vector, the cross-entropy loss cannot capture the ( )prediction probability for false labels, which is an important factor of confusing samples. ",
266
+ "bbox": [
267
+ 173,
268
+ 816,
269
+ 825,
270
+ 873
271
+ ],
272
+ "page_idx": 2
273
+ },
274
+ {
275
+ "type": "text",
276
+ "text": "Another advantage is that our distance function is bounded as opposed to the loss. For $k$ labels, the maximum value of $s t d ( h ( y | x _ { i } ; \\pmb { \\theta } ^ { t } ) )$ is $k ^ { - 1 } \\sqrt { ( k - 1 ) }$ when $h ( m | x _ { i } ; \\pmb { \\theta } ^ { t } ) = 1$ and $\\forall _ { l \\neq m } h ( l | x _ { i } ; \\pmb \\theta ^ { t } ) =$ . Thus, $d i s t ( x _ { i } , y _ { i } ; \\pmb { \\theta } ^ { t } )$ ( ; )) (is bounded as in Eq. (2). ",
277
+ "bbox": [
278
+ 174,
279
+ 878,
280
+ 823,
281
+ 925
282
+ ],
283
+ "page_idx": 2
284
+ },
285
+ {
286
+ "type": "equation",
287
+ "img_path": "images/6f445c6c6ba6c862d83624d46db454b3c819180c326bf647300e4a6c298a0c6c.jpg",
288
+ "text": "$$\n- k ^ { - 1 } \\sqrt { k - 1 } \\le d i s t ( x _ { i } , y _ { i } ; \\pmb { \\theta } ^ { t } ) \\le k ^ { - 1 } \\sqrt { k - 1 }\n$$",
289
+ "text_format": "latex",
290
+ "bbox": [
291
+ 341,
292
+ 114,
293
+ 660,
294
+ 133
295
+ ],
296
+ "page_idx": 3
297
+ },
298
+ {
299
+ "type": "text",
300
+ "text": "2.2 SAMPLING PROBABILITY BASED ON QUANTIZATION INDEX ",
301
+ "text_level": 1,
302
+ "bbox": [
303
+ 174,
304
+ 148,
305
+ 627,
306
+ 164
307
+ ],
308
+ "page_idx": 3
309
+ },
310
+ {
311
+ "type": "text",
312
+ "text": "The rank-based approach introduced by Loshchilov and Hutter (2016) is a common way to make the sampling probability of being selected for the next mini-batch. This approach sorts the samples by a certain importance measure in descending order, and exponentially decays the sampling probability of a given sample according to its rank. Let $N$ denote the total number of samples. Then, each $r$ -th ranked sample is selected with the probability $p ( r )$ which drops by a factor of $\\exp { ( \\log ( s _ { e } ) / N ) }$ . Here, $s _ { e }$ ( ) exp (log( ) )is the selection pressure parameter that affects the probability gap between the most and the least important samples. When normalized to sum up to . , the probability of the $r$ -th ranked sample’s being selected is defined by Eq. (3). ",
313
+ "bbox": [
314
+ 173,
315
+ 174,
316
+ 825,
317
+ 286
318
+ ],
319
+ "page_idx": 3
320
+ },
321
+ {
322
+ "type": "equation",
323
+ "img_path": "images/c59490b9574ceffe08369ad85eea82cc3e2d0cf5baa3ba60d16193f4d0884fc3.jpg",
324
+ "text": "$$\np ( r ) = \\frac { 1 / \\exp { ( \\log ( s _ { e } ) / N ) ^ { r } } } { \\sum _ { j = 1 } ^ { N } 1 / \\exp { ( \\log ( s _ { e } ) / N ) ^ { j } } }\n$$",
325
+ "text_format": "latex",
326
+ "bbox": [
327
+ 379,
328
+ 292,
329
+ 617,
330
+ 333
331
+ ],
332
+ "page_idx": 3
333
+ },
334
+ {
335
+ "type": "text",
336
+ "text": "In the existing rank-based approach, the rank of a sample is determined by $\\left| d i s t ( x _ { i } , y _ { i } ; \\pmb \\theta ^ { t } ) \\right|$ in as( ; )cending order, because it is inversely proportional to the sample importance. However, if the mass of the true sample distribution is skewed to one side (e.g., easy side) as shown in Figure 4, the mini-batch samples are selected with high probability from the skewed side rather than around the decision boundary where $\\left| d i s t ( x _ { i } , y _ { i } ; \\pmb \\theta ^ { t } ) \\right|$ is very small. This problem was attributed to uncondi( ; )tionally fixed probability to a given rank. In other words, the samples with similar ranks are selected with similar probabilities regardless of the magnitude of the distance values. ",
337
+ "bbox": [
338
+ 173,
339
+ 344,
340
+ 825,
341
+ 443
342
+ ],
343
+ "page_idx": 3
344
+ },
345
+ {
346
+ "type": "image",
347
+ "img_path": "images/818425af6176f7a58f39732b449692ee2fd10818da5fdfdedfb03ef21205855a.jpg",
348
+ "image_caption": [
349
+ "Figure 4: Sample distribution according to the normalized $d i s t ( x _ { i } , y _ { i } ; \\pmb { \\theta } ^ { t } )$ at the training accuracy of $8 0 \\%$ , when training LeNet-5 $s _ { e } = 1 0 0$ ( ; )) with the Fashion-MNIST data set. The distributions of 80% = 100mini-batch samples selected by the rank-based and quantization-based approaches, respectively, are plotted together with the true sample distribution. "
350
+ ],
351
+ "image_footnote": [],
352
+ "bbox": [
353
+ 338,
354
+ 460,
355
+ 653,
356
+ 614
357
+ ],
358
+ "page_idx": 3
359
+ },
360
+ {
361
+ "type": "text",
362
+ "text": "To incorporate the impact of the distance into batch selection, we adopt the quantization method (Gray and Neuhoff, 1998; Chen and Wornell, 2001) and use the quantization index $q$ instead of the rank $r$ . Let $\\Delta$ be the quantization step size and $d$ be the output of the function $d i s t ( x _ { i } , y _ { i } ; \\pmb { \\theta } ^ { t } )$ of a Δgiven sample $x _ { i }$ . Then, the index $q$ is obtained by the quantizer $Q ( d )$ ( ; )as in Eq. (4). The quantization ( )index gets larger as a sample moves away from the decision boundary. In addition, the difference between two indexes reflects the difference in the actual distances. ",
363
+ "bbox": [
364
+ 173,
365
+ 698,
366
+ 825,
367
+ 782
368
+ ],
369
+ "page_idx": 3
370
+ },
371
+ {
372
+ "type": "equation",
373
+ "img_path": "images/e036f28923efb7f9d976efd3c7a018696e2b783826e365a8e56abbf0de818a0b.jpg",
374
+ "text": "$$\nq = Q ( d ) , ~ Q ( d ) = \\lceil \\lvert d \\rvert / \\Delta \\rceil\n$$",
375
+ "text_format": "latex",
376
+ "bbox": [
377
+ 401,
378
+ 786,
379
+ 594,
380
+ 803
381
+ ],
382
+ "page_idx": 3
383
+ },
384
+ {
385
+ "type": "text",
386
+ "text": "In Eq. (4), we set $\\Delta$ to be $k ^ { - 1 } \\sqrt { k - 1 } / N$ such that the index $q$ is bounded to $N$ (the total number Δ 1of samples) by Eq. (2). The sampling probability of a given sample $x _ { i }$ with the true label $y _ { i }$ is defined as Eq. (5). As shown in Figure 4, our quantization-based method provides a well-balanced distribution, even if the true sample distribution is skewed. ",
387
+ "bbox": [
388
+ 174,
389
+ 815,
390
+ 825,
391
+ 873
392
+ ],
393
+ "page_idx": 3
394
+ },
395
+ {
396
+ "type": "equation",
397
+ "img_path": "images/1a37d709d08c1c981ac40de09eba357e44c5a41bc20e29655e5e098a0945cd7f.jpg",
398
+ "text": "$$\np ( x _ { i } , y _ { i } ) = \\frac { 1 / \\exp { ( \\log ( s _ { e } ) / N ) ^ { Q ( d i s t ( x _ { i } , y _ { i } ; \\theta ^ { t } ) ) } } } { \\sum _ { j = 1 } ^ { N } 1 / \\exp { ( \\log ( s _ { e } ) / N ) ^ { Q ( d i s t ( x _ { j } , y _ { j } ; \\theta ^ { t } ) ) } } }\n$$",
399
+ "text_format": "latex",
400
+ "bbox": [
401
+ 320,
402
+ 881,
403
+ 678,
404
+ 922
405
+ ],
406
+ "page_idx": 3
407
+ },
408
+ {
409
+ "type": "text",
410
+ "text": "3 Ada-Boundary ALGORITHM ",
411
+ "text_level": 1,
412
+ "bbox": [
413
+ 178,
414
+ 102,
415
+ 429,
416
+ 118
417
+ ],
418
+ "page_idx": 4
419
+ },
420
+ {
421
+ "type": "text",
422
+ "text": "3.1 MAIN PROPOSED ALGORITHM ",
423
+ "text_level": 1,
424
+ "bbox": [
425
+ 176,
426
+ 132,
427
+ 426,
428
+ 147
429
+ ],
430
+ "page_idx": 4
431
+ },
432
+ {
433
+ "type": "text",
434
+ "text": "Algorithm 1 describes the overall procedure of Ada-Boundary. The input to the algorithm consists of the samples of size $N$ (i.e., training data set), the mini-batch size $b$ , the selection pressure $s _ { e }$ , and the threshold $\\gamma$ used to decide the warm-up period. In the early stages of training, since the quantization index for each sample is not confirmed yet, the algorithm requires the warm-up period during $\\gamma$ epochs. Randomly selected mini-batch samples are used to warm-up (Lines 6–7), and their quantization indexes are updated (Lines 11–16). After the warm-up epochs, the algorithm computes the sampling probability of each sample by Eq. (5) and selects mini-batch samples based on the probability (Lines 8–10). Then, the quantization indexes are updated in the same way (Lines $1 1 -$ 16). Here, we compute the indexes using the model with $\\pmb { \\theta } ^ { t + \\hat { 1 } }$ after every SGD step rather than every epoch, in order to reflect the latest state of the model; besides, we asynchronously update the indexes of the samples only included in the mini-batch, to avoid the forward propagation of the entire samples which induces a high computational cost. ",
435
+ "bbox": [
436
+ 174,
437
+ 159,
438
+ 825,
439
+ 325
440
+ ],
441
+ "page_idx": 4
442
+ },
443
+ {
444
+ "type": "text",
445
+ "text": "Algorithm 1 Ada-Boundary Algorithm ",
446
+ "text_level": 1,
447
+ "bbox": [
448
+ 176,
449
+ 339,
450
+ 431,
451
+ 354
452
+ ],
453
+ "page_idx": 4
454
+ },
455
+ {
456
+ "type": "text",
457
+ "text": "INPUT: $N$ samples, numEpoch, $b$ : mini-batch size, $s _ { e }$ : selection pressure, $\\gamma$ : warm-up period \n1: $t \\gets 1$ \n2: $\\theta ^ { t } \\gets$ ;Initialize the model parameter \n3: $q . d i c t \\gets \\{ \\}$ $/ *$ ; Dictionary for quantization indexes $^ { * }$ \n4: for $i = 1$ ;to numEpoch do \n5: =for $j = 1$ to $N / b$ do \n6: if $i \\leq \\gamma$ then $/ *$ Warm-up $^ { * }$ \n7: $\\{ ( x _ { 1 } , y _ { 1 } ) , \\dotsc , ( x _ { b } , y _ { b } ) \\} $ Randomly select next mini-batch samples; \n8: (else $/ { * }$ ) ( ) Adaptive batch selection $^ { * }$ \n9: prob $t a b l e \\gets C$ ompute P robability q dict, se ; $/ { * }$ By Eq. (5) \\*/ \n10: $\\{ ( x _ { 1 } , y _ { 1 } ) , \\dotsc , ( x _ { b } , y _ { b } ) \\} $ ( )Select next mini-batch samples based on prob table \n11: $l o s s \\gets G e t \\_ L o s s ( \\{ ( x _ { 1 } , y _ { 1 } ) , \\dots , ( x _ { b } , y _ { b } ) \\} , \\theta ^ { t } )$ $/ *$ Forward $1 ~ ^ { * } /$ \n12: $\\pmb { \\theta } ^ { t + 1 } S G D \\_ S t e p ( l o s s , \\pmb { \\theta } ^ { t } )$ $/ *$ ( ) Backward $^ { * }$ ; \n13: $/ { * }$ ( Asynchronous update $^ { * }$ \n14: $\\{ h ( y | \\check { x } _ { 1 } ; \\theta ^ { t + 1 } ) , . . . , \\hat { h } ( y | x _ { b } ; \\theta ^ { t + 1 } ) \\} G e t . S o f t m a x ( \\{ x _ { 1 } , . . . , x _ { b } \\} , \\theta ^ { t + 1 } ) ; \\ / \\mathrm { { s u p t - s u p } }$ Forward 2 \\*/ \n15: ( ; )for m to b do \n16: $q _ { - } d i c t [ x _ { m } ] = Q ( d i s t ( x _ { m } , y _ { m } ; \\pmb { \\theta } ^ { t + 1 } ) )$ $/ { * }$ Compute quantization indexes by Eq. (4) \\*/ \n17: [t ← t ",
458
+ "bbox": [
459
+ 174,
460
+ 358,
461
+ 823,
462
+ 613
463
+ ],
464
+ "page_idx": 4
465
+ },
466
+ {
467
+ "type": "text",
468
+ "text": "3.2 VARIANTS OF Ada-Boundary FOR COMPARISON ",
469
+ "text_level": 1,
470
+ "bbox": [
471
+ 174,
472
+ 636,
473
+ 540,
474
+ 650
475
+ ],
476
+ "page_idx": 4
477
+ },
478
+ {
479
+ "type": "image",
480
+ "img_path": "images/f33034103110e8cc9fce0acf513f986630543d8150251e4575a040e62b36e8f7.jpg",
481
+ "image_caption": [
482
+ "Figure 5: The distributions of mini-batch samples selected by the three variants in the same configuration as Figure 4. "
483
+ ],
484
+ "image_footnote": [],
485
+ "bbox": [
486
+ 343,
487
+ 671,
488
+ 655,
489
+ 825
490
+ ],
491
+ "page_idx": 4
492
+ },
493
+ {
494
+ "type": "text",
495
+ "text": "For a more sophisticated analysis of sampling strategies, we modify a few lines of Algorithm 1 to present three heuristic sampling strategies, which are detailed in Appendix A. (i) Ada-Easy is designed to show the effect of easy samples on training, so it focuses on the samples far from the decision boundary to the positive direction. (ii) Ada-Hard is similar to the existing hard batch strategy (Loshchilov and Hutter, 2016), but it uses our distance function instead of the loss. That is, Ada-Hard focuses on the samples far from the decision boundary to the negative direction, which is the opposite of Ada-Easy. (iii) Ada-Uniform is designed to select the samples for a wide range of difficulty, so it samples uniformly over the distance range regardless of the sample distribution. Figure 5 shows the distributions of mini-batch samples drawn by these three variants. The distribution of Ada-Easy is skewed to the easy side, that of Ada-Hard is skewed to the hard side, and that of Ada-Uniform tends to be uniform. ",
496
+ "bbox": [
497
+ 176,
498
+ 882,
499
+ 825,
500
+ 924
501
+ ],
502
+ "page_idx": 4
503
+ },
504
+ {
505
+ "type": "text",
506
+ "text": "",
507
+ "bbox": [
508
+ 173,
509
+ 103,
510
+ 825,
511
+ 214
512
+ ],
513
+ "page_idx": 5
514
+ },
515
+ {
516
+ "type": "text",
517
+ "text": "To avoid additional inference steps of Ada-Boundary (Line in Algorithm 1), we present a history14based variant, called Ada-Boundary(History). It updates the qunatization indexes using the previous model with $\\pmb { \\theta } ^ { t }$ . See Appendix B for the detailed algorithm and experiment results. ",
518
+ "bbox": [
519
+ 174,
520
+ 222,
521
+ 825,
522
+ 263
523
+ ],
524
+ "page_idx": 5
525
+ },
526
+ {
527
+ "type": "text",
528
+ "text": "4 EVALUATION ",
529
+ "text_level": 1,
530
+ "bbox": [
531
+ 176,
532
+ 284,
533
+ 315,
534
+ 300
535
+ ],
536
+ "page_idx": 5
537
+ },
538
+ {
539
+ "type": "text",
540
+ "text": "4.1 DATA SETS AND ARCHITECTURES ",
541
+ "text_level": 1,
542
+ "bbox": [
543
+ 176,
544
+ 315,
545
+ 449,
546
+ 329
547
+ ],
548
+ "page_idx": 5
549
+ },
550
+ {
551
+ "type": "text",
552
+ "text": "In this section, all the experiments were performed on three benchmark data sets: MNIST2 of handwritten digits (LeCun, 1998) with , training and , testing images; Fashion-MNIST3 of 60 000 10 000various clothing (Xiao et al., 2017) with , training and , testing images; and CIFAR$1 0 ^ { 4 }$ 60 000 10 000of a subset of 80 million categorical images (Krizhevsky et al., 2014) with , training and 50 000, testing images. We did not apply any data augmentation and pre-processing procedures. ",
553
+ "bbox": [
554
+ 174,
555
+ 342,
556
+ 825,
557
+ 411
558
+ ],
559
+ "page_idx": 5
560
+ },
561
+ {
562
+ "type": "text",
563
+ "text": "A simple model LeNet-5 (LeCun et al., 2015) was used for two easy data sets, MNIST and FasionMNIST. A complex model WideResNet-16-8 (Zagoruyko and Komodakis, 2016) was used for a relatively difficult data set, CIFAR-10. Batch normalization (Ioffe and Szegedy, 2015) was applied to both models. As for hyper-parameters, we used a learning rate of . and a batch size of ; the 0 01 128training epoch was set to be for LeNet-5 and for WideResNet-16-8, which is early stopping 50 70to clearly show the difference in convergence speed. Regarding those specific to our algorithm, we set the selection pressure $s _ { e }$ to be , which is the best value found from $s _ { e } = \\{ 1 0 , 1 0 0 , 1 0 0 0 \\}$ on 100the three data sets, and set the warm-up threshold $\\gamma$ = 10to be . Technically, a small $\\gamma$ 00 1000was enough 10to warm-up, but to reduce the performance variance caused by randomly initialized parameters, we used the larger $\\gamma$ and shared model parameters for all strategies during the warm-up period. ",
564
+ "bbox": [
565
+ 173,
566
+ 417,
567
+ 825,
568
+ 558
569
+ ],
570
+ "page_idx": 5
571
+ },
572
+ {
573
+ "type": "text",
574
+ "text": "Due to the lack of space, the experimental results using DenseNet $L \\ = \\ 2 5$ , $k \\ = \\ 1 2$ ) (Huang et al., 2017) on two hard data sets, CIFAR- $1 0 0 ^ { 4 }$ = 25 = 12and Tiny-ImageNet 5, are discussed in Appendix C together with the impact of the selection pressure $s _ { e }$ . ",
575
+ "bbox": [
576
+ 176,
577
+ 564,
578
+ 821,
579
+ 606
580
+ ],
581
+ "page_idx": 5
582
+ },
583
+ {
584
+ "type": "text",
585
+ "text": "4.2 ALGORITHMS ",
586
+ "text_level": 1,
587
+ "bbox": [
588
+ 174,
589
+ 623,
590
+ 310,
591
+ 637
592
+ ],
593
+ "page_idx": 5
594
+ },
595
+ {
596
+ "type": "text",
597
+ "text": "We compared Ada-Boundary with not only random batch selection but also four different adaptive batch selections. Random batch selection selects the next batch uniformly at random from the entire data set. One of four adaptive selections is the state-of-the-art strategy that selects hard samples based on the loss-rank, which is called online batch selection (Loshchilov and Hutter, 2016), and the remainders, Ada-Easy, Ada-Hard, and Ada-Uniform, are the three variants introduced in Section 3.2. All the algorithms were implemented using TensorFlow6 and executed using a single NVIDIA Tesla V100 GPU on DGX-1. For reproducibility, we provide the source code at https://github. com/anonymized. ",
598
+ "bbox": [
599
+ 174,
600
+ 648,
601
+ 825,
602
+ 761
603
+ ],
604
+ "page_idx": 5
605
+ },
606
+ {
607
+ "type": "text",
608
+ "text": "4.3 EVALUATION METRICS ",
609
+ "text_level": 1,
610
+ "bbox": [
611
+ 176,
612
+ 777,
613
+ 375,
614
+ 791
615
+ ],
616
+ "page_idx": 5
617
+ },
618
+ {
619
+ "type": "text",
620
+ "text": "To measure the performance gain over the baseline (random batch selection) as well as the state-ofart (online batch selection), we used the following three metrics. We repeated every test five times for robustness and reported the average. The wall-clock training time is discussed in Appendix D. ",
621
+ "bbox": [
622
+ 176,
623
+ 803,
624
+ 823,
625
+ 845
626
+ ],
627
+ "page_idx": 5
628
+ },
629
+ {
630
+ "type": "image",
631
+ "img_path": "images/40c0e575e636a611f5f9e96bdd5a189f77d83ee1eafe25d298fc3d67c2a967c4.jpg",
632
+ "image_caption": [
633
+ "Figure 6: Convergence curves of five batch selection strategies with SGD on three data sets. "
634
+ ],
635
+ "image_footnote": [],
636
+ "bbox": [
637
+ 232,
638
+ 97,
639
+ 764,
640
+ 601
641
+ ],
642
+ "page_idx": 6
643
+ },
644
+ {
645
+ "type": "text",
646
+ "text": "(i) $G a i n _ { e r r }$ : Reduction in test error at the final epoch $( \\% )$ . In Figure 6(a), at the 50th epoch, the test error of random batch selection was $1 . 0 1 4 \\cdot 1 0 ^ { - 2 }$ , and that of Ada-Boundary was $8 . 6 4 3 \\cdot 1 0 ^ { - 3 }$ . Thus, $G a i n _ { e r r }$ was $( 1 . 0 1 4 \\cdot 1 0 ^ { - 2 } - 8 . 6 4 3 \\cdot 1 0 ^ { - 3 } ) / 1 . 0 1 4 \\cdot 1 0 ^ { - 2 } \\times 1 0 0 = \\dot { 1 } 4 . 8 \\%$ . ",
647
+ "bbox": [
648
+ 181,
649
+ 635,
650
+ 825,
651
+ 678
652
+ ],
653
+ "page_idx": 6
654
+ },
655
+ {
656
+ "type": "text",
657
+ "text": "(ii) $G a i n _ { e p o }$ : Reduction in number of epochs to obtain the same error $( \\% )$ . In Figure 6(a), the test error of $1 . 0 1 4 \\cdot 1 0 ^ { 2 }$ achieved at the 50th epoch by random batch selection can be achieved only 1 014 10at the 29th epoch by Ada-Boundary. Thus, $G a i n _ { e r r }$ was $( 5 0 - 2 9 ) / 5 0 \\times 1 0 0 = 4 2 . 0 \\%$ . ",
658
+ "bbox": [
659
+ 178,
660
+ 685,
661
+ 821,
662
+ 729
663
+ ],
664
+ "page_idx": 6
665
+ },
666
+ {
667
+ "type": "text",
668
+ "text": "(iii) $G a i n _ { t i m }$ : Reduction in running time to obtain the same error $( \\% )$ . In Figure 6(a), similar to $G a i n _ { e p o }$ , $G a i n _ { t i m }$ was $( 2 0 5 . 0 - 1 3 6 . 3 ) / 2 0 5 . 0 \\times 1 0 0 = 3 3 . 5 \\%$ . ",
669
+ "bbox": [
670
+ 178,
671
+ 736,
672
+ 823,
673
+ 765
674
+ ],
675
+ "page_idx": 6
676
+ },
677
+ {
678
+ "type": "text",
679
+ "text": "4.4 CONVERGENCE ANALYSIS ",
680
+ "text_level": 1,
681
+ "bbox": [
682
+ 174,
683
+ 785,
684
+ 398,
685
+ 799
686
+ ],
687
+ "page_idx": 6
688
+ },
689
+ {
690
+ "type": "text",
691
+ "text": "Figure 6 shows the convergence curves of training loss and test error for five batch selection strategies on three data sets, when we used the SGD optimizer for training. In order to improve legibility, only the curves for the baseline and proposed strategies are dark colored; thus, the three metrics in the figure were calculated against the baseline strategy, random batch selection. Owing to the lack of space, we discuss the results with the momentum optimizer in Appendix E. Ada-Easy was excluded in Figure 6 because its convergence speed was much slower than other strategies. That is, easy samples did not contribute to expedite training. We conduct convergence analysis of the five batch selection strategies for the same number of epochs, as follows: ",
692
+ "bbox": [
693
+ 173,
694
+ 811,
695
+ 825,
696
+ 924
697
+ ],
698
+ "page_idx": 6
699
+ },
700
+ {
701
+ "type": "text",
702
+ "text": "MNIST (Figure 6(a)): All adaptive batch selections achieved faster convergence speed compared with random batch selection. Ada-Boundary, Ada-Hard, and online batch selection showed similar performance. Ada-Uniform was the fastest at the beginning, but its training loss and test error increased sharply in the middle of the training or testing procedures. ",
703
+ "bbox": [
704
+ 178,
705
+ 103,
706
+ 825,
707
+ 160
708
+ ],
709
+ "page_idx": 7
710
+ },
711
+ {
712
+ "type": "text",
713
+ "text": "Fashion-MNIST (Figure 6(b)): Ada-Boundary showed the fastest convergence speed in both training loss and test error. In contrast, after warm-up epochs, the training loss of the other adaptive batch selections increased temporarily, and their test error at the final epoch became similar to that of random batch selection. ",
714
+ "bbox": [
715
+ 176,
716
+ 164,
717
+ 825,
718
+ 219
719
+ ],
720
+ "page_idx": 7
721
+ },
722
+ {
723
+ "type": "text",
724
+ "text": "CIFAR-10 (Figure 6(c)): Ada-Boundary and Ada-Hard showed the fastest convergence on training loss, but in test error, the convergence speed of Ada-Hard was much slower than that of Ada-Boundary. This means that focusing on hard samples results in the overfitting to “too hard” samples, which is indicated by a larger difference between the converged training loss (error) and the converged test error. Also, the slow convergence speed of online batch selection in test error is explained by the same reason. ",
725
+ "bbox": [
726
+ 178,
727
+ 223,
728
+ 825,
729
+ 308
730
+ ],
731
+ "page_idx": 7
732
+ },
733
+ {
734
+ "type": "text",
735
+ "text": "In summary, in the easiest MNIST data set, all adaptive batch selections accelerated their convergence speed compared with random batch selection. However, as the training difficulty (complexity) increased from MNIST to Fashion-MNIST and further to CIFAR-10, only Ada-Boundary converged significantly (by $G a i n _ { e r r }$ ) faster than random batch selection. ",
736
+ "bbox": [
737
+ 174,
738
+ 319,
739
+ 825,
740
+ 376
741
+ ],
742
+ "page_idx": 7
743
+ },
744
+ {
745
+ "type": "text",
746
+ "text": "4.5 SUMMARY OF PERFORMANCE GAINS ",
747
+ "text_level": 1,
748
+ "bbox": [
749
+ 176,
750
+ 392,
751
+ 472,
752
+ 406
753
+ ],
754
+ "page_idx": 7
755
+ },
756
+ {
757
+ "type": "text",
758
+ "text": "We clarify the quantitative performance gains of Ada-Boundary over random batch and online batch selections in Table 1. Ada-Boundary significantly outperforms both strategies, as already shown in Figure 6. There is only one exception in MNIST, because online batch selection is known to work well with an easy data set (Loshchilov and Hutter, 2016). The noticeable advantage of AdaBoundary is to reduce the training time significantly by up to around $3 0 \\%$ , which is really important for huge, complex data sets. ",
759
+ "bbox": [
760
+ 174,
761
+ 417,
762
+ 825,
763
+ 502
764
+ ],
765
+ "page_idx": 7
766
+ },
767
+ {
768
+ "type": "table",
769
+ "img_path": "images/67e1cc940858f050eee2fca084c404fe4afb4c83b67d3f3483874c1ac124fb55.jpg",
770
+ "table_caption": [
771
+ "Table 1: Performance gains over random batch and online batch selections. "
772
+ ],
773
+ "table_footnote": [],
774
+ "table_body": "<table><tr><td rowspan=1 colspan=1>Comparison target</td><td rowspan=1 colspan=3>Against random batch selection</td><td rowspan=1 colspan=3>Against online batch selection</td></tr><tr><td rowspan=1 colspan=1>Metrics</td><td rowspan=1 colspan=1>Gainerr</td><td rowspan=1 colspan=1>Gainepo</td><td rowspan=1 colspan=1>Gaintim</td><td rowspan=1 colspan=1>Gainerr</td><td rowspan=1 colspan=1>Gainepo</td><td rowspan=1 colspan=1>Gaintim</td></tr><tr><td rowspan=1 colspan=1>MNIST</td><td rowspan=1 colspan=1>14.8%</td><td rowspan=1 colspan=1>42.0%</td><td rowspan=1 colspan=1>33.5%</td><td rowspan=1 colspan=1>-2.08%</td><td rowspan=1 colspan=1>0.00%</td><td rowspan=1 colspan=1>0.00%</td></tr><tr><td rowspan=1 colspan=1>Fashion-MNIST</td><td rowspan=1 colspan=1>8.01%</td><td rowspan=1 colspan=1>40.0%</td><td rowspan=1 colspan=1>29.6%</td><td rowspan=1 colspan=1>10.2%</td><td rowspan=1 colspan=1>42.0%</td><td rowspan=1 colspan=1>31.7%</td></tr><tr><td rowspan=1 colspan=1>CIFAR-10</td><td rowspan=1 colspan=1>7.34%</td><td rowspan=1 colspan=1>24.3%</td><td rowspan=1 colspan=1>14.0%</td><td rowspan=1 colspan=1>13.7%</td><td rowspan=1 colspan=1>46.0%</td><td rowspan=1 colspan=1>18.0%</td></tr></table>",
775
+ "bbox": [
776
+ 192,
777
+ 546,
778
+ 805,
779
+ 619
780
+ ],
781
+ "page_idx": 7
782
+ },
783
+ {
784
+ "type": "text",
785
+ "text": "5 RELATED WORK ",
786
+ "text_level": 1,
787
+ "bbox": [
788
+ 176,
789
+ 648,
790
+ 344,
791
+ 665
792
+ ],
793
+ "page_idx": 7
794
+ },
795
+ {
796
+ "type": "text",
797
+ "text": "There have been numerous attempts to understand which samples contribute the most during training. Curriculum learning (Bengio et al., 2009), inspired by the perceived way that humans and animals learn, first takes easy samples and then gradually increases the difficulty of samples in a manual manner. Self-paced learning (Kumar et al., 2010) uses the prediction error to determine the easiness of samples in order to alleviate the limitation of curriculum learning. They regard that the importance is determined by how easy the samples are. However, easiness is not sufficient to decide when a sample should be introduced to a learner (Gao and Jojic, 2017). ",
798
+ "bbox": [
799
+ 173,
800
+ 680,
801
+ 825,
802
+ 777
803
+ ],
804
+ "page_idx": 7
805
+ },
806
+ {
807
+ "type": "text",
808
+ "text": "Recently, Tsvetkov et al. (2016) used Bayesian optimization to optimize a curriculum for training dense, distributed word representations. Sachan and Xing (2016) emphasized that the right curriculum not only has to arrange data samples in the order of difficulty, but also introduces a small number of samples that are dissimilar to the previously seen samples. Shrivastava et al. (2016) proposed a hard-example mining algorithm to eliminate several heuristics and hyper-parameters commonly used to select hard examples. However, these algorithms are designed to support only a designated task, such as natural language processing or region-based object detection. The neural data filter proposed by Fan et al. (2017) is orthogonal to our work because it aims at filtering the redundant samples from streaming data. As mentioned earlier, Ada-Boundary in general follows the philosophy of curriculum learning. ",
809
+ "bbox": [
810
+ 174,
811
+ 785,
812
+ 825,
813
+ 924
814
+ ],
815
+ "page_idx": 7
816
+ },
817
+ {
818
+ "type": "text",
819
+ "text": "More closely related to the adaptive batch selection, Loshchilov and Hutter (2016) keep the history of losses for previously seen samples, and compute the sampling probability based on the loss rank. The sample probability to be selected for the next mini-batch is exponentially decayed with its rank. This allows the samples with low ranks (i.e., high losses) are considered more frequently for the next mini-batch. Gao and Jojic (2017)’s work is similar to Loshchilov and Hutter (2016)’s work except that gradient norms are used instead of losses to compute the probability. In contrast to curriculum learning, both methods focus on only hard samples for training. Also, they ignore the difference in actual losses or gradient norms by transforming the values to ranks. We have empirically verified that Ada-Boundary outperforms online batch selection (Loshchilov and Hutter, 2016), which is regarded as the state-of-the-art of this category. Similar to our work, Chang et al. (2017) claimed that the uncertain samples should be preferred during training, but their main contribution lies on training more accurate and robust model by choosing samples with high prediction variances. In contrast, our main contribution lies on training faster using confusing samples near the decision boundary. ",
820
+ "bbox": [
821
+ 174,
822
+ 103,
823
+ 825,
824
+ 284
825
+ ],
826
+ "page_idx": 8
827
+ },
828
+ {
829
+ "type": "text",
830
+ "text": "For the completeness of the survey, we mention the work to accelerate the optimization process of conventional algorithms based on importance sampling. Needell et al. (2014) re-weight the obtained gradients by the inverses of their sampling probabilities to reduce the variance. Schmidt et al. (2015) biased the sampling to the Lipschitz constant to quickly find the solution of a strongly-convex optimization problem arising from the training of conditional random fields. ",
831
+ "bbox": [
832
+ 174,
833
+ 291,
834
+ 825,
835
+ 361
836
+ ],
837
+ "page_idx": 8
838
+ },
839
+ {
840
+ "type": "text",
841
+ "text": "6 CONCLUSION AND FUTURE WORK ",
842
+ "text_level": 1,
843
+ "bbox": [
844
+ 174,
845
+ 382,
846
+ 495,
847
+ 397
848
+ ],
849
+ "page_idx": 8
850
+ },
851
+ {
852
+ "type": "text",
853
+ "text": "In this paper, we proposed a novel adaptive batch selection algorithm, Ada-Boundary, that presents the most appropriate samples according to the learning progress of the model. Toward this goal, we defined the distance from a sample to the decision boundary and introduced a quantization method for selecting the samples near the boundary with high probability. We performed extensive experiments using two CNN models for three benchmark data sets. The results showed that Ada-Boundary significantly accelerated the training process as well as was better generalized in hard data sets. When training an easy data set, Ada-Boundary showed a fast convergence comparable to that of the state-of-the-art algorithm; when training relatively hard data sets, only Ada-Boundary converged significantly faster than random batch selection. ",
854
+ "bbox": [
855
+ 174,
856
+ 412,
857
+ 825,
858
+ 537
859
+ ],
860
+ "page_idx": 8
861
+ },
862
+ {
863
+ "type": "text",
864
+ "text": "The most exciting benefit of Ada-Boundary is to save the time needed for the training of a DNN. It becomes more important as the size and complexity of data becomes higher, and can be boosted with recent advance of hardware technologies. Our immediate future work is to apply Ada-Boundary to other types of DNNs such as the recurrent neural networks (RNN) (Mikolov et al., 2010) and the long short-term memory (LSTM) (Hochreiter and Schmidhuber, 1997), which have a neural structure completely different from the CNN. In addition, we plan to investigate the relationship between the power of a DNN and the improvement of Ada-Boundary. ",
865
+ "bbox": [
866
+ 174,
867
+ 546,
868
+ 825,
869
+ 643
870
+ ],
871
+ "page_idx": 8
872
+ },
873
+ {
874
+ "type": "text",
875
+ "text": "REFERENCES ",
876
+ "text_level": 1,
877
+ "bbox": [
878
+ 176,
879
+ 665,
880
+ 285,
881
+ 680
882
+ ],
883
+ "page_idx": 8
884
+ },
885
+ {
886
+ "type": "text",
887
+ "text": "Bengio, Y., Louradour, J., Collobert, R., and Weston, J. (2009). Curriculum learning. In ICML, pages 41–48. \nChang, H.-S., Learned-Miller, E., and McCallum, A. (2017). Active bias: Training more accurate neural networks by emphasizing high variance samples. In NIPS, pages 1002–1012. \nChen, B. and Wornell, G. W. (2001). Quantization index modulation: A class of provably good methods for digital watermarking and information embedding. IEEE Trans. on Information Theory, 47(4):1423–1443. \nFan, Y., Tian, F., Qin, T., and Liu, T.-Y. (2017). Neural data filter for bootstrapping stochastic gradient descent. In ICLR. \nGao, T. and Jojic, V. (2017). Sample importance in training deep neural networks. https:// openreview.net/forum?id=r1IRctqxg. \nGoodfellow, I., Bengio, Y., and Courville, A. (2016). Deep learning. MIT Press. http://www. deeplearningbook.org. \nGray, R. M. and Neuhoff, D. L. (1998). Quantization. IEEE Trans. on Information Theory, 44(6):2325–2383. \nHochreiter, S. and Schmidhuber, J. (1997). Long short-term memory. Neural computation, 9(8):1735–1780. \nHuang, G., Liu, Z., Van Der Maaten, L., and Weinberger, K. Q. (2017). Densely connected convolutional networks. In CVPR, volume 1, page 3. \nIoffe, S. and Szegedy, C. (2015). Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, pages 448–456. \nKatharopoulos, A. and Fleuret, F. (2018). Not all samples are created equal: Deep learning with importance sampling. In ICML, pages 2525–2534. \nKingma, D. P. and Ba, J. (2015). Adam: A method for stochastic optimization. In ICLR. \nKrizhevsky, A., Nair, V., and Hinton, G. (2014). The CIFAR-10 dataset. https://www.cs. toronto.edu/˜kriz/cifar.html. \nKrizhevsky, A., Sutskever, I., and Hinton, G. E. (2012). ImageNet classification with deep convolutional neural networks. In NIPS, pages 1097–1105. \nKumar, M. P., Packer, B., and Koller, D. (2010). Self-paced learning for latent variable models. In NIPS, pages 1189–1197. \nLeCun, Y. (1998). The MNIST database of handwritten digits. http://yann.lecun.com/ exdb/mnist. \nLeCun, Y. et al. (2015). LeNet-5, Convolutional neural networks. http://yann.lecun.com/ exdb/lenet. \nLoshchilov, I. and Hutter, F. (2016). Online batch selection for faster training of neural networks. In ICLR. \nMikolov, T., Karafiat, M., Burget, L., ´ Cernock ˇ y, J., and Khudanpur, S. (2010). Recurrent neural \\` network based language model. In INTERSPEECH, pages 1045–1048. \nNeedell, D., Ward, R., and Srebro, N. (2014). Stochastic gradient descent, weighted sampling, and the randomized Kaczmarz algorithm. In NIPS, pages 1017–1025. \nSachan, M. and Xing, E. (2016). Easy questions first? A case study on curriculum learning for question answering. In ACL, pages 453–463. \nSchaul, T., Quan, J., Antonoglou, I., and Silver, D. (2016). Prioritized experience replay. In ICLR. \nSchmidt, M., Babanezhad, R., Ahmed, M., Defazio, A., Clifton, A., and Sarkar, A. (2015). Nonuniform stochastic average gradient method for training conditional random fields. In AISTATS, pages 819–828. \nShrivastava, A., Gupta, A., and Girshick, R. (2016). Training region-based object detectors with online hard example mining. In CVPR, pages 761–769. \nTsvetkov, Y., Faruqui, M., Ling, W., MacWhinney, B., and Dyer, C. (2016). Learning the curriculum with bayesian optimization for task-specific word representation learning. In ACL, pages 130– 139. \nWu, C.-Y., Manmatha, R., Smola, A. J., and Krahenb ¨ uhl, P. (2017). Sampling matters in deep ¨ embedding learning. In ICCV, pages 2840–2848. \nXiao, H., Rasul, K., and Vollgraf, R. (2017). Fashion-MNIST: A novel image dataset for benchmarking machine learning algorithms. arXiv:1708.07747. \nZagoruyko, S. and Komodakis, N. (2016). Wide residual networks. In BMVC, pages 87.1–87.12. \nZeiler, M. D. (2012). ADADELTA: An adaptive learning rate method. arXiv:1212.5701. ",
888
+ "bbox": [
889
+ 171,
890
+ 686,
891
+ 826,
892
+ 924
893
+ ],
894
+ "page_idx": 8
895
+ },
896
+ {
897
+ "type": "text",
898
+ "text": "",
899
+ "bbox": [
900
+ 169,
901
+ 69,
902
+ 828,
903
+ 925
904
+ ],
905
+ "page_idx": 9
906
+ },
907
+ {
908
+ "type": "text",
909
+ "text": "A IMPLEMENTATION OF THE THREE VARIANTS ",
910
+ "text_level": 1,
911
+ "bbox": [
912
+ 174,
913
+ 102,
914
+ 581,
915
+ 118
916
+ ],
917
+ "page_idx": 10
918
+ },
919
+ {
920
+ "type": "text",
921
+ "text": "For Ada-Easy which prefers easy samples to hard samples, $q$ should be small for the sample located deep in the positive direction. For Ada-Hard, $q$ should be small for the sample located deep in the negative direction. Thus, Ada-Easy and Ada-Hard can be implemented by modifying the quantizers $Q ( d )$ in Line of Algorithm 1. When we set $\\Delta = k ^ { - 1 } \\sqrt { k - 1 } / N$ to make the index $q$ bound to $N$ ( ) 16 Δ = 1, the quantizers of Ada-Easy and Ada-Hard are defined as Eqs. (6) and (7), respectively. ",
922
+ "bbox": [
923
+ 174,
924
+ 133,
925
+ 823,
926
+ 205
927
+ ],
928
+ "page_idx": 10
929
+ },
930
+ {
931
+ "type": "equation",
932
+ "img_path": "images/c432d33a941b7aa4086568bd0dfa0984d63ebb051d743aefa956e3100f73c71e.jpg",
933
+ "text": "$$\n\\begin{array}{c} \\begin{array} { c } { q = Q ( d ) } \\\\ { Q ( d ) = \\{ \\begin{array} { l l } { - \\lceil d / 2 \\Delta \\rceil + N / 2 + 1 , } & { i f } \\end{array} d \\geq 0 } \\\\ { - \\lfloor d / 2 \\Delta \\rfloor + N / 2 , } & { o t h e r w i s e } \\\\ { q = Q ( d ) } \\\\ { Q ( d ) = \\{ \\begin{array} { l l } { \\lceil d / 2 \\Delta \\rceil + N / 2 , } & { i f } \\end{array} d \\geq 0 } \\\\ { \\lfloor d / 2 \\Delta \\rfloor + N / 2 + 1 , } & { o t h e r w i s e } \\end{array} \\end{array}\n$$",
934
+ "text_format": "latex",
935
+ "bbox": [
936
+ 344,
937
+ 215,
938
+ 651,
939
+ 338
940
+ ],
941
+ "page_idx": 10
942
+ },
943
+ {
944
+ "type": "text",
945
+ "text": "Ada-Uniform can be implemented by using ${ \\cal F } ^ { - 1 } ( x )$ to compute the sampling probability in Line of Algorithm 1, where $F ( x )$ ( ) 9is the empirical sample distribution according to the sample’s distance to the decision boundary. ",
946
+ "bbox": [
947
+ 174,
948
+ 349,
949
+ 825,
950
+ 393
951
+ ],
952
+ "page_idx": 10
953
+ },
954
+ {
955
+ "type": "text",
956
+ "text": "B HISTORY-BASED Ada-Boundary VARIANT ",
957
+ "text_level": 1,
958
+ "bbox": [
959
+ 174,
960
+ 412,
961
+ 549,
962
+ 429
963
+ ],
964
+ "page_idx": 10
965
+ },
966
+ {
967
+ "type": "text",
968
+ "text": "We present Ada-Boundary(History) that updates the quantization indexes based on the previous model with $\\pmb { \\theta } ^ { t }$ instead of the latest model with $\\pmb { \\theta } ^ { t + 1 }$ . This is easily accomplished by replacing Lines – of Algorithm 1 with those of Algorithm 2. Ada-Boundary(History) reduces the time required 11 17for additional inference steps that reflect the latest state of the model, which correspond to Lines – of Algorithm 1, at the expense of slight increase of test error. ",
969
+ "bbox": [
970
+ 174,
971
+ 444,
972
+ 825,
973
+ 515
974
+ ],
975
+ "page_idx": 10
976
+ },
977
+ {
978
+ "type": "text",
979
+ "text": "Algorithm 2 Ada-Boundary(History) ",
980
+ "text_level": 1,
981
+ "bbox": [
982
+ 176,
983
+ 530,
984
+ 419,
985
+ 545
986
+ ],
987
+ "page_idx": 10
988
+ },
989
+ {
990
+ "type": "text",
991
+ "text": "INPUT: $N$ samples, numEpoch, $b$ : mini-batch size, $s _ { e }$ : selection pressure, $\\gamma$ : warm-up period \n1: $t \\gets 1$ \n2: $\\theta ^ { t } \\gets$ ;Initialize the model parameter \n3: $q . d i c t \\gets \\{ \\}$ $/ *$ ; Dictionary for quantization indexes $^ { * }$ \n4: for $i = 1$ ;to numEpoch do \n5: =for $j = 1$ to $N / b$ do \n6: if $i \\leq \\gamma$ then $/ *$ Warm-up $^ { * }$ \n7: $\\{ ( x _ { 1 } , y _ { 1 } ) , \\dotsc , ( x _ { b } , y _ { b } ) \\} $ Randomly select next mini-batch samples; \n8: (else $/ { * }$ ) ( )Adaptive batch selection $^ { * }$ \n9: prob table Compute P robability q dict, $s _ { e , \\ l }$ ; $/ { * }$ By Eq. (5) \\*/ \n10: $\\{ ( x _ { 1 } , y _ { 1 } ) , \\dotsc , ( x _ { b } , \\bar { y _ { b } } ) \\} $ ( )Select next mini-batch samples based on prob table \n11: $/ { * }$ ( ) ( ) Forward and asynchronous update $^ { * }$ \n12: $\\{ h ( y | x _ { 1 } ; \\theta ^ { t } ) , . . . , \\{ h ( y | x _ { b } ; \\theta ^ { t } ) \\} , l o s s \\gets G e t . S o f t m a x \\& L o s s ( \\{ ( x _ { 1 } , y _ { 1 } ) , . . . , ( x _ { b } , y _ { b } ) \\} , \\theta ^ { t } ) :$ \n13: (for $m = 1$ )to $b$ do \n14: $q _ { - } d i c t [ x _ { m } ] = Q ( d i s t ( x _ { m } , y _ { m } ; \\pmb { \\theta } ^ { t } )$ $/ *$ Compute quantization indexes by Eq. (4) \\*/ \n15: [ ] =/\\* Backward \\*/ \n16: $\\pmb { \\theta } ^ { t + 1 } S G D \\_ S t e p ( l o s s , \\pmb { \\theta } ^ { t } )$ \n17: t ← t ",
992
+ "bbox": [
993
+ 174,
994
+ 550,
995
+ 838,
996
+ 805
997
+ ],
998
+ "page_idx": 10
999
+ },
1000
+ {
1001
+ "type": "image",
1002
+ "img_path": "images/15a42f39e74054cd3abe5c93fa9923710f1f78662a93fd746d354336dddd18aa.jpg",
1003
+ "image_caption": [
1004
+ "Figure 7: Convergence curves of Ada-Boundary(History) with SGD on three data sets. "
1005
+ ],
1006
+ "image_footnote": [],
1007
+ "bbox": [
1008
+ 218,
1009
+ 224,
1010
+ 777,
1011
+ 773
1012
+ ],
1013
+ "page_idx": 11
1014
+ },
1015
+ {
1016
+ "type": "image",
1017
+ "img_path": "images/23ee2678f70ce578fc159f487cc7e52e2d66854e54785c9119c11b05080e328d.jpg",
1018
+ "image_caption": [
1019
+ "Figure 8: Convergence curves of Ada-Boundary(History) with momentum on three data sets. "
1020
+ ],
1021
+ "image_footnote": [],
1022
+ "bbox": [
1023
+ 217,
1024
+ 224,
1025
+ 777,
1026
+ 773
1027
+ ],
1028
+ "page_idx": 12
1029
+ },
1030
+ {
1031
+ "type": "image",
1032
+ "img_path": "images/6c97e7f703e995bfbe707bae5ac77b2f9127a482b74c8344b27c34083648f710.jpg",
1033
+ "image_caption": [
1034
+ "Figure 9: Convergence curves of Ada-Boundary with varying $s _ { e }$ on two hard data sets. "
1035
+ ],
1036
+ "image_footnote": [],
1037
+ "bbox": [
1038
+ 218,
1039
+ 104,
1040
+ 777,
1041
+ 458
1042
+ ],
1043
+ "page_idx": 13
1044
+ },
1045
+ {
1046
+ "type": "text",
1047
+ "text": "C Ada-Boundary ON TWO HARD DATA SETS ",
1048
+ "bbox": [
1049
+ 174,
1050
+ 498,
1051
+ 544,
1052
+ 513
1053
+ ],
1054
+ "page_idx": 13
1055
+ },
1056
+ {
1057
+ "type": "text",
1058
+ "text": "As a practical paper, we include the experimental results on two more challenging data sets: CIFAR100 composed of image classes with , training and , testing images; Tiny-ImageNet 100 50 000 10 000composed of image classes with , training and , testing images. All images in 200Tiny-ImageNet were resized to $3 2 \\times 3 2$ 00 000images. ",
1059
+ "bbox": [
1060
+ 174,
1061
+ 539,
1062
+ 825,
1063
+ 594
1064
+ ],
1065
+ "page_idx": 13
1066
+ },
1067
+ {
1068
+ "type": "text",
1069
+ "text": "One of the state-of-the-art model DenseNet $L { = } 2 5$ , $k { = } 1 2$ ) (Huang et al., 2017) was used for two hard data sets with momentum optimizer. Regarding algorithm parameters, we used a learning rate of . and a batch size of ; The training epoch and warm-up threshold $\\gamma$ were set to be and 0 1 128, respectively. We repeated every test five times for robustness and reported the average. ",
1070
+ "bbox": [
1071
+ 174,
1072
+ 601,
1073
+ 825,
1074
+ 657
1075
+ ],
1076
+ "page_idx": 13
1077
+ },
1078
+ {
1079
+ "type": "text",
1080
+ "text": "C.1 IMPACT OF SELECTION PRESSURE $s _ { e }$ ",
1081
+ "text_level": 1,
1082
+ "bbox": [
1083
+ 176,
1084
+ 690,
1085
+ 467,
1086
+ 704
1087
+ ],
1088
+ "page_idx": 13
1089
+ },
1090
+ {
1091
+ "type": "text",
1092
+ "text": "The selection pressure $s _ { e }$ determines how strongly the boundary samples are selected. The greater the $s _ { e }$ , the greater the sampling probability of the boundary sample, so more boundary samples were chosen for the next mini-batch. On the other hand, the less $s _ { e }$ makes Ada-Boundary closer to random batch selection. ",
1093
+ "bbox": [
1094
+ 174,
1095
+ 722,
1096
+ 825,
1097
+ 777
1098
+ ],
1099
+ "page_idx": 13
1100
+ },
1101
+ {
1102
+ "type": "text",
1103
+ "text": "Figure 9 shows the convergence curves of Ada-Boundary with varying $s _ { e }$ on two hard data sets. To clearly analyze the impact of the selection pressure, we plotted the minimum of training loss and test error with a given epochs. Overall, the convergence speed of training loss was accelerated as the $s _ { e }$ increased from to , but that of test error was faster only when the $s _ { e }$ was less than a 2 16certain value. The convergence speed of test error was faster than random batch selection, when $s _ { e }$ was less than or equal to (CIFAR-100) and (Tiny-ImageNet). Surprisingly, the overexposure to 4the boundary samples using the large $s _ { e }$ 2incurred the overfitting issue in hard data sets, whereas the large $s _ { e } = 1 0 0$ worked well for our easy or relatively hard data sets as discussed in Section 4. That = 100is, the selection pressure $s _ { e }$ should be chosen more carefully considering the difficulty of the given data set. We leave this challenge as our future work. ",
1104
+ "bbox": [
1105
+ 173,
1106
+ 784,
1107
+ 825,
1108
+ 924
1109
+ ],
1110
+ "page_idx": 13
1111
+ },
1112
+ {
1113
+ "type": "text",
1114
+ "text": "C.2 PERFORMANCE ANALYSIS ",
1115
+ "text_level": 1,
1116
+ "bbox": [
1117
+ 176,
1118
+ 103,
1119
+ 400,
1120
+ 117
1121
+ ],
1122
+ "page_idx": 14
1123
+ },
1124
+ {
1125
+ "type": "text",
1126
+ "text": "Table 2 shows the performance gains of Ada-Boundary over random batch selection on two hard data sets. We only quantify the gains of Ada-Boundary $s _ { e } = 2 ,$ ) because its performance was the best as shown in Figure 9. Ada-Boundary $s _ { e } = 2 )$ = 2 always outperforms random batch selection. = 2Especially, it reduces the training time significantly by up to around $20 \\%$ . ",
1127
+ "bbox": [
1128
+ 174,
1129
+ 128,
1130
+ 825,
1131
+ 185
1132
+ ],
1133
+ "page_idx": 14
1134
+ },
1135
+ {
1136
+ "type": "table",
1137
+ "img_path": "images/b00734dc6148bed1ea8c20a2a2f8ea854f57ea90bedf69ea29f1d5667a1a5846.jpg",
1138
+ "table_caption": [
1139
+ "Table 2: Performance gains of Ada-Boundary( $s _ { e } = 2$ ) over random batch selection in Figure 9. "
1140
+ ],
1141
+ "table_footnote": [],
1142
+ "table_body": "<table><tr><td rowspan=1 colspan=1>Comparison target</td><td rowspan=1 colspan=3>Against random batch selection</td></tr><tr><td rowspan=1 colspan=1>Metrics</td><td rowspan=1 colspan=1>Gainerr</td><td rowspan=1 colspan=1>Gainepo</td><td rowspan=1 colspan=1>Gaintim</td></tr><tr><td rowspan=1 colspan=1>CIFAR-100</td><td rowspan=1 colspan=1>1.99%</td><td rowspan=1 colspan=1>33.3%</td><td rowspan=1 colspan=1>21.4%</td></tr><tr><td rowspan=1 colspan=1>TINY-ImageNet</td><td rowspan=1 colspan=1>0.37%</td><td rowspan=1 colspan=1>31.1%</td><td rowspan=1 colspan=1>18.0%</td></tr></table>",
1143
+ "bbox": [
1144
+ 267,
1145
+ 229,
1146
+ 727,
1147
+ 290
1148
+ ],
1149
+ "page_idx": 14
1150
+ },
1151
+ {
1152
+ "type": "text",
1153
+ "text": "Table 3 shows the wall-clock training time for the same number of parameter updates on two hard data sets (Figure 9). Ada-Boundary $s _ { e } = 2$ ) with momentum was $1 5 . { \\overset { \\cdot } { 2 } } \\% - 1 6 . 0 \\%$ slower than random = 2batch selection. However, it reduced the running time by $1 8 . 0 \\% \\mathrm { - 2 1 . 4 \\% }$ 16(by $G a i n _ { t i m } \\rangle$ to obtain the same test error of random batch selection. ",
1154
+ "bbox": [
1155
+ 176,
1156
+ 310,
1157
+ 823,
1158
+ 366
1159
+ ],
1160
+ "page_idx": 14
1161
+ },
1162
+ {
1163
+ "type": "table",
1164
+ "img_path": "images/b542b960e93cce6cccca4a4363b8ec340db8bc96b9160183176b05500ab9b600.jpg",
1165
+ "table_caption": [
1166
+ "Table 3: Wall-clock training time for Figure 9 (seconds). "
1167
+ ],
1168
+ "table_footnote": [],
1169
+ "table_body": "<table><tr><td rowspan=1 colspan=1>Optimizer</td><td rowspan=1 colspan=2>Momentum (Figure 9)</td></tr><tr><td rowspan=1 colspan=1>Data sets</td><td rowspan=1 colspan=1>CIFAR-100</td><td rowspan=1 colspan=1>Tiny-ImageNet</td></tr><tr><td rowspan=1 colspan=1>Randombatch</td><td rowspan=1 colspan=1>1917</td><td rowspan=1 colspan=1>3814</td></tr><tr><td rowspan=1 colspan=1>Ada-Boundary(se = 2)</td><td rowspan=1 colspan=1>2260</td><td rowspan=1 colspan=1>4542</td></tr></table>",
1170
+ "bbox": [
1171
+ 279,
1172
+ 409,
1173
+ 717,
1174
+ 468
1175
+ ],
1176
+ "page_idx": 14
1177
+ },
1178
+ {
1179
+ "type": "text",
1180
+ "text": "D WALL-CLOCK TRAINING TIME ",
1181
+ "text_level": 1,
1182
+ "bbox": [
1183
+ 174,
1184
+ 503,
1185
+ 460,
1186
+ 518
1187
+ ],
1188
+ "page_idx": 14
1189
+ },
1190
+ {
1191
+ "type": "text",
1192
+ "text": "The procedures for recomputing sampling probabilities and updating quantization indexes make Ada-Boundary slower than random batch selection. Table 4 shows the wall-clock training time for the same number of parameter updates (i.e., the same number of epochs) with SGD (Figure 6) and momentum (Figure 10). Ada-Boundary with SGD was $1 2 . 8 \\% \\mathrm { - } \\mathrm { \\bar { 1 } } 4 . 7 \\%$ and $6 . 0 6 \\% - 1 2 . 2 \\%$ 12 8% 14 7% 6 06% 12 2%slower than random batch and online batch selections, respectively. Ada-Boundary with momentum was $1 3 . 1 \\% \\mathrm { - } 1 4 . 7 \\%$ and $6 . 6 7 \\% - 1 2 . 2 \\%$ slower than random batch and online batch selections, 13 1% 14 7% 6 67% 12 2%respectively. Although Ada-Boundary took longer for the same number of updates, Ada-Boundary achieved significant reduction in running time by $7 . 9 6 \\% - 3 3 . 5 \\%$ (by $G a i n _ { t i m }$ ) to obtain the same 7 96% 33 5%test error of random batch selection due to the fast convergence. ",
1193
+ "bbox": [
1194
+ 173,
1195
+ 534,
1196
+ 825,
1197
+ 660
1198
+ ],
1199
+ "page_idx": 14
1200
+ },
1201
+ {
1202
+ "type": "table",
1203
+ "img_path": "images/55e134340cf5e7662c425e903d7d14a06b0b7838a25dbbdfb8a47467c2c30108.jpg",
1204
+ "table_caption": [
1205
+ "Table 4: Wall-clock training time for Figure 6 and Figure 10 (seconds). "
1206
+ ],
1207
+ "table_footnote": [],
1208
+ "table_body": "<table><tr><td rowspan=1 colspan=1>Optimizer</td><td rowspan=1 colspan=3>SGD (Figure 6)</td><td rowspan=1 colspan=3>Momentum (Figure 10)</td></tr><tr><td rowspan=1 colspan=1>Data sets</td><td rowspan=1 colspan=1>MNIST</td><td rowspan=1 colspan=1>Fashion-MNIST</td><td rowspan=1 colspan=1>CIFAR-10</td><td rowspan=1 colspan=1>MNIST</td><td rowspan=1 colspan=1>Fashion-MNIST</td><td rowspan=1 colspan=1>CIFAR-10</td></tr><tr><td rowspan=1 colspan=1>Random batch</td><td rowspan=1 colspan=1>205</td><td rowspan=1 colspan=1>197</td><td rowspan=1 colspan=1>3347</td><td rowspan=1 colspan=1>199</td><td rowspan=1 colspan=1>192</td><td rowspan=1 colspan=1>3355</td></tr><tr><td rowspan=1 colspan=1>Online batch</td><td rowspan=1 colspan=1>218</td><td rowspan=1 colspan=1>217</td><td rowspan=1 colspan=1>3371</td><td rowspan=1 colspan=1>211</td><td rowspan=1 colspan=1>210</td><td rowspan=1 colspan=1>3388</td></tr><tr><td rowspan=1 colspan=1>Ada-Boundary</td><td rowspan=1 colspan=1>235</td><td rowspan=1 colspan=1>231</td><td rowspan=1 colspan=1>3838</td><td rowspan=1 colspan=1>231</td><td rowspan=1 colspan=1>225</td><td rowspan=1 colspan=1>3860</td></tr></table>",
1209
+ "bbox": [
1210
+ 181,
1211
+ 704,
1212
+ 815,
1213
+ 779
1214
+ ],
1215
+ "page_idx": 14
1216
+ },
1217
+ {
1218
+ "type": "text",
1219
+ "text": "E EXPERIMENT RESULTS USING MOMENTUM OPTIMIZER ",
1220
+ "text_level": 1,
1221
+ "bbox": [
1222
+ 176,
1223
+ 810,
1224
+ 666,
1225
+ 827
1226
+ ],
1227
+ "page_idx": 14
1228
+ },
1229
+ {
1230
+ "type": "text",
1231
+ "text": "E.1 CONVERGENCE ANALYSIS ",
1232
+ "text_level": 1,
1233
+ "bbox": [
1234
+ 176,
1235
+ 842,
1236
+ 400,
1237
+ 856
1238
+ ],
1239
+ "page_idx": 14
1240
+ },
1241
+ {
1242
+ "type": "text",
1243
+ "text": "Figure 10 shows the convergence curves of training loss and test error for five batch selection strategies on three data sets, when we used the momentum optimizer with setting the momentum to be . . In the MNIST data set, we limited the number of epochs to be because both training loss and 0 9 30test error were fully converged after epochs. We repeat the convergence analysis, as follows: ",
1244
+ "bbox": [
1245
+ 173,
1246
+ 867,
1247
+ 825,
1248
+ 924
1249
+ ],
1250
+ "page_idx": 14
1251
+ },
1252
+ {
1253
+ "type": "text",
1254
+ "text": "MNIST (Figure 10(a)): Except Ada-Uniform, all adaptive batch selections converged faster than random batch selection. Online batch selection showed much faster convergence speed than other adaptive batch selections in training loss, but converged similarly with the others in test error owing to the overfitting to hard samples. ",
1255
+ "bbox": [
1256
+ 178,
1257
+ 103,
1258
+ 825,
1259
+ 160
1260
+ ],
1261
+ "page_idx": 15
1262
+ },
1263
+ {
1264
+ "type": "text",
1265
+ "text": "Fashion-MNIST (Figure 10(b)): Ada-Boundary showed the fastest convergence speed in test error, although it did not converge faster than online batch selection in training loss. In contrast, online batch selection was the fastest in training loss, but its convergence in test error was slightly slower than that of random batch selection. This emphasizes the need to consider the samples with appropriate difficulty rather than hard samples. The convergence speeds of Ada-Hard and Ada-Uniform in test error were slower than that of random batch selection. ",
1266
+ "bbox": [
1267
+ 176,
1268
+ 164,
1269
+ 826,
1270
+ 247
1271
+ ],
1272
+ "page_idx": 15
1273
+ },
1274
+ {
1275
+ "type": "text",
1276
+ "text": "• CIFAR-10 (Figure 10(c)): In both training loss and test error, Ada-Boundary and Ada-Hard showed slightly faster convergence speed than random batch selection. On the other hand, online batch selection converged slightly slower than random batch selection in both cases. ",
1277
+ "bbox": [
1278
+ 178,
1279
+ 252,
1280
+ 823,
1281
+ 294
1282
+ ],
1283
+ "page_idx": 15
1284
+ },
1285
+ {
1286
+ "type": "text",
1287
+ "text": "In summary, in the easiest MNIST data set, most of adaptive batch selections accelerated their convergence speed compared with random batch selection. However, in Fashion-MNIST data set, only Ada-Boundary converged faster than random batch selection. In a relatively difficult CIFAR-10 data set, Ada-Boundary and Ada-Hard showed comparable convergence speed and then converged faster than random batch selection. ",
1288
+ "bbox": [
1289
+ 174,
1290
+ 308,
1291
+ 825,
1292
+ 377
1293
+ ],
1294
+ "page_idx": 15
1295
+ },
1296
+ {
1297
+ "type": "text",
1298
+ "text": "E.2 SUMMARY OF PERFORMANCE GAINS ",
1299
+ "text_level": 1,
1300
+ "bbox": [
1301
+ 176,
1302
+ 393,
1303
+ 473,
1304
+ 409
1305
+ ],
1306
+ "page_idx": 15
1307
+ },
1308
+ {
1309
+ "type": "text",
1310
+ "text": "We quantify the performance gains of Ada-Boundary over random batch and online batch selections in Table 5. Ada-Boundary always outperforms both strategies, as already shown in Figure 10. Compared with Table 1, $G a i n _ { t i m }$ over random batch selection tends to become smaller, whereas $G a i n _ { t i m }$ over online batch selection tends to become larger. ",
1311
+ "bbox": [
1312
+ 174,
1313
+ 420,
1314
+ 825,
1315
+ 477
1316
+ ],
1317
+ "page_idx": 15
1318
+ },
1319
+ {
1320
+ "type": "table",
1321
+ "img_path": "images/3914e3a434e2c4040aceef9ae1a85a383fc02a93a41b7e448a09fdddaa3f4975.jpg",
1322
+ "table_caption": [
1323
+ "Table 5: Performance gains over two existing strategies in Figure 10. "
1324
+ ],
1325
+ "table_footnote": [],
1326
+ "table_body": "<table><tr><td rowspan=1 colspan=1>Comparison target</td><td rowspan=1 colspan=3>Against random batch selection</td><td rowspan=1 colspan=3>Against online batch selection</td></tr><tr><td rowspan=1 colspan=1>Metrics</td><td rowspan=1 colspan=1>Gainerr</td><td rowspan=1 colspan=1>Gainepo</td><td rowspan=1 colspan=1>Gaintim</td><td rowspan=1 colspan=1>Gainerr</td><td rowspan=1 colspan=1>Gainepo</td><td rowspan=1 colspan=1>Gaintim</td></tr><tr><td rowspan=1 colspan=1>MNIST</td><td rowspan=1 colspan=1>5.58%</td><td rowspan=1 colspan=1>26.7%</td><td rowspan=1 colspan=1>14.9%</td><td rowspan=1 colspan=1>2.27%</td><td rowspan=1 colspan=1>13.0%</td><td rowspan=1 colspan=1>4.75%</td></tr><tr><td rowspan=1 colspan=1>Fashion-MNIST</td><td rowspan=1 colspan=1>2.24%</td><td rowspan=1 colspan=1>28.0%</td><td rowspan=1 colspan=1>15.6%</td><td rowspan=1 colspan=1>4.54%</td><td rowspan=1 colspan=1>46.0%</td><td rowspan=1 colspan=1>42.1%</td></tr><tr><td rowspan=1 colspan=1>CIFAR-10</td><td rowspan=1 colspan=1>3.43%</td><td rowspan=1 colspan=1>20.0%</td><td rowspan=1 colspan=1>7.96%</td><td rowspan=1 colspan=1>4.02%</td><td rowspan=1 colspan=1>28.0%</td><td rowspan=1 colspan=1>18.0%</td></tr></table>",
1327
+ "bbox": [
1328
+ 192,
1329
+ 521,
1330
+ 805,
1331
+ 594
1332
+ ],
1333
+ "page_idx": 15
1334
+ },
1335
+ {
1336
+ "type": "image",
1337
+ "img_path": "images/a557dd60ed6a09255913841405b85b9befec88f289d1d5392f1f994a030b3032.jpg",
1338
+ "image_caption": [
1339
+ "Figure 10: Convergence curves using the momentum optimizer for Figure 6. "
1340
+ ],
1341
+ "image_footnote": [],
1342
+ "bbox": [
1343
+ 218,
1344
+ 226,
1345
+ 776,
1346
+ 776
1347
+ ],
1348
+ "page_idx": 16
1349
+ }
1350
+ ]
parse/train/SyfXKoRqFQ/SyfXKoRqFQ_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/SyfXKoRqFQ/SyfXKoRqFQ_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/rJ4km2R5t7/rJ4km2R5t7.md ADDED
@@ -0,0 +1,446 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # GLUE: A MULTI-TASK BENCHMARK AND ANALYSIS PLATFORM FOR NATURAL LANGUAGE UNDERSTANDING
2
+
3
+ Alex Wang1, Amanpreet Singh1, Julian Michael2, Felix Hill3,
4
+ Omer Levy2 & Samuel R. Bowman1
5
+ 1Courant Institute of Mathematical Sciences, New York University
6
+ 2Paul G. Allen School of Computer Science & Engineering, University of Washington
7
+ 3DeepMind
8
+ {alexwang,amanpreet,bowman}@nyu.edu
9
+ {julianjm,omerlevy}@cs.washington.edu
10
+ felixhill@google.com
11
+
12
+ # ABSTRACT
13
+
14
+ For natural language understanding (NLU) technology to be maximally useful, it must be able to process language in a way that is not exclusive to a single task, genre, or dataset. In pursuit of this objective, we introduce the General Language Understanding Evaluation (GLUE) benchmark, a collection of tools for evaluating the performance of models across a diverse set of existing NLU tasks. By including tasks with limited training data, GLUE is designed to favor and encourage models that share general linguistic knowledge across tasks. GLUE also includes a hand-crafted diagnostic test suite that enables detailed linguistic analysis of models. We evaluate baselines based on current methods for transfer and representation learning and find that multi-task training on all tasks performs better than training a separate model per task. However, the low absolute performance of our best model indicates the need for improved general NLU systems.
15
+
16
+ # 1 INTRODUCTION
17
+
18
+ The human ability to understand language is general, flexible, and robust. In contrast, most NLU models above the word level are designed for a specific task and struggle with out-of-domain data. If we aspire to develop models with understanding beyond the detection of superficial correspondences between inputs and outputs, then it is critical to develop a more unified model that can learn to execute a range of different linguistic tasks in different domains.
19
+
20
+ To facilitate research in this direction, we present the General Language Understanding Evaluation (GLUE) benchmark: a collection of NLU tasks including question answering, sentiment analysis, and textual entailment, and an associated online platform for model evaluation, comparison, and analysis. GLUE does not place any constraints on model architecture beyond the ability to process single-sentence and sentence-pair inputs and to make corresponding predictions. For some GLUE tasks, training data is plentiful, but for others it is limited or fails to match the genre of the test set. GLUE therefore favors models that can learn to represent linguistic knowledge in a way that facilitates sample-efficient learning and effective knowledge-transfer across tasks. None of the datasets in GLUE were created from scratch for the benchmark; we rely on preexisting datasets because they have been implicitly agreed upon by the NLP community as challenging and interesting. Four of the datasets feature privately-held test data, which will be used to ensure that the benchmark is used fairly.1
21
+
22
+ To understand the types of knowledge learned by models and to encourage linguistic-meaningful solution strategies, GLUE also includes a set of hand-crafted analysis examples for probing trained models. This dataset is designed to highlight common challenges, such as the use of world knowledge and logical operators, that we expect models must handle to robustly solve the tasks.
23
+
24
+ <table><tr><td>Corpus</td><td>|Train]</td><td>|Test|</td><td>Task</td><td>Metrics</td><td>Domain</td></tr><tr><td colspan="6">Single-Sentence Tasks</td></tr><tr><td>CoLA</td><td>8.5k</td><td>1k</td><td>acceptability</td><td>Matthews corr.</td><td>misc.</td></tr><tr><td>SST-2</td><td>67k</td><td>1.8k</td><td>sentiment</td><td>acc.</td><td>movie reviews</td></tr><tr><td colspan="6">Similarity and Paraphrase Tasks</td></tr><tr><td>MRPC</td><td>3.7k</td><td>1.7k</td><td>paraphrase</td><td>acc./F1</td><td>news</td></tr><tr><td>STS-B</td><td>7k</td><td>1.4k</td><td>sentence similarity</td><td>Pearson/Spearman corr.</td><td>misc.</td></tr><tr><td>QQP</td><td>364k</td><td>391k</td><td>paraphrase</td><td>acc./F1</td><td> social QA questions</td></tr><tr><td colspan="6">Inference Tasks</td></tr><tr><td>MNLI</td><td>393k</td><td>20k</td><td>NLI</td><td>matched acc./mismatched acc.</td><td>misc.</td></tr><tr><td>QNLI</td><td>105k</td><td>5.4k</td><td>QA/NLI</td><td>acc.</td><td>Wikipedia</td></tr><tr><td>RTE</td><td>2.5k</td><td>3k</td><td>NLI</td><td>acc.</td><td>news,Wikipedia</td></tr><tr><td>WNLI</td><td>634</td><td>146</td><td>coreference/NLI</td><td>acc.</td><td>fiction books</td></tr></table>
25
+
26
+ Table 1: Task descriptions and statistics. All tasks are single sentence or sentence pair classification, except STS-B, which is a regression task. MNLI has three classes; all other classification tasks have two. Test sets shown in bold use labels that have never been made public in any form.
27
+
28
+ To better understand the challenged posed by GLUE, we conduct experiments with simple baselines and state-of-the-art sentence representation models. We find that unified multi-task trained models slightly outperform comparable models trained on each task separately. Our best multi-task model makes use of ELMo (Peters et al., 2018), a recently proposed pre-training technique. However, this model still achieves a fairly low absolute score. Analysis with our diagnostic dataset reveals that our baseline models deal well with strong lexical signals but struggle with deeper logical structure.
29
+
30
+ In summary, we offer: (i) A suite of nine sentence or sentence-pair NLU tasks, built on established annotated datasets and selected to cover a diverse range of text genres, dataset sizes, and degrees of difficulty. (ii) An online evaluation platform and leaderboard, based primarily on privately-held test data. The platform is model-agnostic, and can evaluate any method capable of producing results on all nine tasks. (iii) An expert-constructed diagnostic evaluation dataset. (iv) Baseline results for several major existing approaches to sentence representation learning.
31
+
32
+ # 2 RELATED WORK
33
+
34
+ Collobert et al. (2011) used a multi-task model with a shared sentence understanding component to jointly learn POS tagging, chunking, named entity recognition, and semantic role labeling. More recent work has explored using labels from core NLP tasks to supervise training of lower levels of deep neural networks (Søgaard & Goldberg, 2016; Hashimoto et al., 2017) and automatically learning cross-task sharing mechanisms for multi-task learning (Ruder et al., 2017).
35
+
36
+ Beyond multi-task learning, much work in developing general NLU systems has focused on sentence-to-vector encoders (Le & Mikolov, 2014; Kiros et al., 2015, i.a.), leveraging unlabeled data (Hill et al., 2016; Peters et al., 2018), labeled data (Conneau & Kiela, 2018; McCann et al., 2017), and combinations of these (Collobert et al., 2011; Subramanian et al., 2018). In this line of work, a standard evaluation practice has emerged, recently codified as SentEval (Conneau et al., 2017; Conneau & Kiela, 2018). Like GLUE, SentEval relies on a set of existing classification tasks involving either one or two sentences as inputs. Unlike GLUE, SentEval only evaluates sentenceto-vector encoders, making it well-suited for evaluating models on tasks involving sentences in isolation. However, cross-sentence contextualization and alignment are instrumental in achieving state-of-the-art performance on tasks such as machine translation (Bahdanau et al., 2015; Vaswani et al., 2017), question answering (Seo et al., 2017), and natural language inference (Rocktaschel ¨ et al., 2016). GLUE is designed to facilitate the development of these methods: It is model-agnostic, allowing for any kind of representation or contextualization, including models that use no explicit vector or symbolic representations for sentences whatsoever.
37
+
38
+ GLUE also diverges from SentEval in the selection of evaluation tasks that are included in the suite. Many of the SentEval tasks are closely related to sentiment analysis, such as MR (Pang & Lee,
39
+
40
+ 2005), SST (Socher et al., 2013), CR (Hu & Liu, 2004), and SUBJ (Pang & Lee, 2004). Other tasks are so close to being solved that evaluation on them is relatively uninformative, such as MPQA (Wiebe et al., 2005) and TREC question classification (Voorhees et al., 1999). In GLUE, we attempt to construct a benchmark that is both diverse and difficult.
41
+
42
+ McCann et al. (2018) introduce decaNLP, which also scores NLP systems based on their performance on multiple datasets. Their benchmark recasts the ten evaluation tasks as question answering, converting tasks like summarization and text-to-SQL semantic parsing into question answering using automatic transformations. That benchmark lacks the leaderboard and error analysis toolkit of GLUE, but more importantly, we see it as pursuing a more ambitious but less immediately practical goal: While GLUE rewards methods that yield good performance on a circumscribed set of tasks using methods like those that are currently used for those tasks, their benchmark rewards systems that make progress toward their goal of unifying all of NLU under the rubric of question answering.
43
+
44
+ # 3 TASKS
45
+
46
+ GLUE is centered on nine English sentence understanding tasks, which cover a broad range of domains, data quantities, and difficulties. As the goal of GLUE is to spur development of generalizable NLU systems, we design the benchmark such that good performance should require a model to share substantial knowledge (e.g., trained parameters) across all tasks, while still maintaining some taskspecific components. Though it is possible to train a single model for each task with no pretraining or other outside sources of knowledge and evaluate the resulting set of models on this benchmark, we expect that our inclusion of several data-scarce tasks will ultimately render this approach uncompetitive. We describe the tasks below and in Table 1. Appendix A includes additional details. Unless otherwise mentioned, tasks are evaluated on accuracy and are balanced across classes.
47
+
48
+ # 3.1 SINGLE-SENTENCE TASKS
49
+
50
+ CoLA The Corpus of Linguistic Acceptability (Warstadt et al., 2018) consists of English acceptability judgments drawn from books and journal articles on linguistic theory. Each example is a sequence of words annotated with whether it is a grammatical English sentence. Following the authors, we use Matthews correlation coefficient (Matthews, 1975) as the evaluation metric, which evaluates performance on unbalanced binary classification and ranges from -1 to 1, with 0 being the performance of uninformed guessing. We use the standard test set, for which we obtained private labels from the authors. We report a single performance number on the combination of the in- and out-of-domain sections of the test set.
51
+
52
+ SST-2 The Stanford Sentiment Treebank (Socher et al., 2013) consists of sentences from movie reviews and human annotations of their sentiment. The task is to predict the sentiment of a given sentence. We use the two-way (positive/negative) class split, and use only sentence-level labels.
53
+
54
+ # 3.2 SIMILARITY AND PARAPHRASE TASKS
55
+
56
+ MRPC The Microsoft Research Paraphrase Corpus (Dolan & Brockett, 2005) is a corpus of sentence pairs automatically extracted from online news sources, with human annotations for whether the sentences in the pair are semantically equivalent. Because the classes are imbalanced $6 8 \%$ positive), we follow common practice and report both accuracy and F1 score.
57
+
58
+ QQP The Quora Question Pairs2 dataset is a collection of question pairs from the community question-answering website Quora. The task is to determine whether a pair of questions are semantically equivalent. As in MRPC, the class distribution in QQP is unbalanced ( $6 3 \%$ negative), so we report both accuracy and F1 score. We use the standard test set, for which we obtained private labels from the authors. We observe that the test set has a different label distribution than the training set.
59
+
60
+ STS-B The Semantic Textual Similarity Benchmark (Cer et al., 2017) is a collection of sentence pairs drawn from news headlines, video and image captions, and natural language inference data.
61
+
62
+ Table 2: The types of linguistic phenomena annotated in the diagnostic dataset, organized under four major categories. For a description of each phenomenon, see Appendix E.
63
+
64
+ <table><tr><td>Coarse-Grained Categories</td><td>Fine-Grained Categories</td></tr><tr><td>Lexical Semantics</td><td>Lexical Entailment,Morphological Negation, Factivity, Symmetry/Collectivity, Redundancy, Named Entities, Quantifiers</td></tr><tr><td>Predicate-Argument Structure</td><td>Core Arguments,Prepositional Phrases, Ellipsis/Implicits, Anaphora/Coreference Active/Passive,Nominalization, Genitives/Partitives,Datives,Relative Clauses, Coordination Scope, Intersectivity, Restrictivity</td></tr><tr><td>Logic</td><td>Negation, Double Negation, Intervals/Numbers, Conjunction, Disjunction, Conditionals,Universal,Existential, Temporal,Upward Monotone, Downward Monotone, Non-Monotone</td></tr><tr><td>Knowledge</td><td>Common Sense, World Knowledge</td></tr></table>
65
+
66
+ Each pair is human-annotated with a similarity score from 1 to 5; the task is to predict these scores.
67
+ Follow common practice, we evaluate using Pearson and Spearman correlation coefficients.
68
+
69
+ # 3.3 INFERENCE TASKS
70
+
71
+ MNLI The Multi-Genre Natural Language Inference Corpus (Williams et al., 2018) is a crowdsourced collection of sentence pairs with textual entailment annotations. Given a premise sentence and a hypothesis sentence, the task is to predict whether the premise entails the hypothesis (entailment), contradicts the hypothesis (contradiction), or neither (neutral). The premise sentences are gathered from ten different sources, including transcribed speech, fiction, and government reports. We use the standard test set, for which we obtained private labels from the authors, and evaluate on both the matched (in-domain) and mismatched (cross-domain) sections. We also use and recommend the SNLI corpus (Bowman et al., 2015) as 550k examples of auxiliary training data.
72
+
73
+ QNLI The Stanford Question Answering Dataset (Rajpurkar et al. 2016) is a question-answering dataset consisting of question-paragraph pairs, where one of the sentences in the paragraph (drawn from Wikipedia) contains the answer to the corresponding question (written by an annotator). We convert the task into sentence pair classification by forming a pair between each question and each sentence in the corresponding context, and filtering out pairs with low lexical overlap between the question and the context sentence. The task is to determine whether the context sentence contains the answer to the question. This modified version of the original task removes the requirement that the model select the exact answer, but also removes the simplifying assumptions that the answer is always present in the input and that lexical overlap is a reliable cue. This process of recasting existing datasets into NLI is similar to methods introduced in White et al. (2017) and expanded upon in Demszky et al. (2018). We call the converted dataset QNLI (Question-answering NLI).3
74
+
75
+ RTE The Recognizing Textual Entailment (RTE) datasets come from a series of annual textual entailment challenges. We combine the data from RTE1 (Dagan et al., 2006), RTE2 (Bar Haim et al., 2006), RTE3 (Giampiccolo et al., 2007), and RTE5 (Bentivogli et al., 2009).4 Examples are constructed based on news and Wikipedia text. We convert all datasets to a two-class split, where for three-class datasets we collapse neutral and contradiction into not entailment, for consistency.
76
+
77
+ WNLI The Winograd Schema Challenge (Levesque et al., 2011) is a reading comprehension task in which a system must read a sentence with a pronoun and select the referent of that pronoun from a list of choices. The examples are manually constructed to foil simple statistical methods: Each one is contingent on contextual information provided by a single word or phrase in the sentence. To convert the problem into sentence pair classification, we construct sentence pairs by replacing the ambiguous pronoun with each possible referent. The task is to predict if the sentence with the pronoun substituted is entailed by the original sentence. We use a small evaluation set consisting of new examples derived from fiction books5 that was shared privately by the authors of the original corpus. While the included training set is balanced between two classes, the test set is imbalanced between them $65 \%$ not entailment). Also, due to a data quirk, the development set is adversarial: hypotheses are sometimes shared between training and development examples, so if a model memorizes the training examples, they will predict the wrong label on corresponding development set example. As with QNLI, each example is evaluated separately, so there is not a systematic correspondence between a model’s score on this task and its score on the unconverted original task. We call converted dataset WNLI (Winograd NLI).
78
+
79
+ Table 3: Examples from the diagnostic set. Fwd (resp. Bwd) denotes the label when sentence 1 (resp. sentence 2) is the premise. Labels are entailment (E), neutral (N), or contradiction (C). Examples are tagged with the phenomena they demonstrate, and each phenomenon belongs to one of four broad categories (in parentheses).
80
+
81
+ <table><tr><td>Tags</td><td>Sentence 1</td><td>Sentence 2</td><td>Fwd</td><td>Bwd</td></tr><tr><td>Lexical Entailment (Lexi- cal Semantics),Downward Monotone (Logic)</td><td>The timing of the meeting has not been set,according to a Starbucks spokesper- son.</td><td>The timing of the meet- ing has not been consid- ered,according to a Star- bucks spokesperson.</td><td>N</td><td>E</td></tr><tr><td>Universal Quantifiers (Logic)</td><td>Our deepest sympathies are with all those affected by this accident.</td><td>Our deepest sympathies are with a victim who was af- fected by this accident.</td><td>E</td><td>N</td></tr><tr><td>Quantifiers (LexicalSe- mantics),Double Negation (Logic)</td><td>I have never seen a hum- mingbird not flying.</td><td>I have never seen a hum- mingbird.</td><td>N</td><td>E</td></tr></table>
82
+
83
+ # 3.4 EVALUATION
84
+
85
+ The GLUE benchmark follows the same evaluation model as SemEval and Kaggle. To evaluate a system on the benchmark, one must run the system on the provided test data for the tasks, then upload the results to the website gluebenchmark.com for scoring. The benchmark site shows per-task scores and a macro-average of those scores to determine a system’s position on the leaderboard. For tasks with multiple metrics (e.g., accuracy and F1), we use an unweighted average of the metrics as the score for the task when computing the overall macro-average. The website also provides fine- and coarse-grained results on the diagnostic dataset. See Appendix D for details.
86
+
87
+ # 4 DIAGNOSTIC DATASET
88
+
89
+ Drawing inspiration from the FraCaS suite (Cooper et al., 1996) and the recent Build-It-Break-It competition (Ettinger et al., 2017), we include a small, manually-curated test set for the analysis of system performance. While the main benchmark mostly reflects an application-driven distribution of examples, our diagnostic dataset highlights a pre-defined set of phenomena that we believe are interesting and important for models to capture. We show the full set of phenomena in Table 2.
90
+
91
+ Each diagnostic example is an NLI sentence pair with tags for the phenomena demonstrated. The NLI task is well-suited to this kind of analysis, as it can easily evaluate the full set of skills involved in (ungrounded) sentence understanding, from resolution of syntactic ambiguity to pragmatic reasoning with world knowledge. We ensure the data is reasonably diverse by producing examples for a variety of linguistic phenomena and basing our examples on naturally-occurring sentences from several domains (news, Reddit, Wikipedia, academic papers). This approaches differs from that of FraCaS, which was designed to test linguistic theories with a minimal and uniform set of examples. A sample from our dataset is shown in Table 3.
92
+
93
+ Annotation Process We begin with a target set of phenomena, based roughly on those used in the FraCaS suite (Cooper et al., 1996). We construct each example by locating a sentence that can be easily made to demonstrate a target phenomenon, and editing it in two ways to produce an appropriate sentence pair. We make minimal modifications so as to maintain high lexical and structural overlap within each sentence pair and limit superficial cues. We then label the inference relationships between the sentences, considering each sentence alternatively as the premise, producing two labeled examples for each pair (1100 total). Where possible, we produce several pairs with different labels for a single source sentence, to have minimal sets of sentence pairs that are lexically and structurally very similar but correspond to different entailment relationships. The resulting labels are $42 \%$ entailment, $3 5 \%$ neutral, and $23 \%$ contradiction.
94
+
95
+ Evaluation Since the class distribution in the diagnostic set is not balanced, we use $R _ { 3 }$ (Gorodkin, 2004), a three-class generalization of the Matthews correlation coefficient, for evaluation.
96
+
97
+ In light of recent work showing that crowdsourced data often contains artifacts which can be exploited to perform well without solving the intended task (Schwartz et al., 2017; Poliak et al., 2018; Tsuchiya, 2018, i.a.), we audit the data for such artifacts. We reproduce the methodology of Gururangan et al. (2018), training two fastText classifiers (Joulin et al., 2016) to predict entailment labels on SNLI and MNLI using only the hypothesis as input. The models respectively get near-chance accuracies of $3 2 . 7 \%$ and $3 6 . 4 \%$ on our diagnostic data, showing that the data does not suffer from such artifacts.
98
+
99
+ To establish human baseline performance on the diagnostic set, we have six NLP researchers annotate 50 sentence pairs (100 entailment examples) randomly sampled from the diagnostic set. Interannotator agreement is high, with a Fleiss’s $\kappa$ of 0.73. The average $R _ { 3 }$ score among the annotators is 0.80, much higher than any of the baseline systems described in Section 5.
100
+
101
+ Intended Use The diagnostic examples are hand-picked to address certain phenomena, and NLI is a task with no natural input distribution, so we do not expect performance on the diagnostic set to reflect overall performance or generalization in downstream applications. Performance on the analysis set should be compared between models but not between categories. The set is provided not as a benchmark, but as an analysis tool for error analysis, qualitative model comparison, and development of adversarial examples.
102
+
103
+ # 5 BASELINES
104
+
105
+ For baselines, we evaluate a multi-task learning model trained on the GLUE tasks, as well as several variants based on recent pre-training methods. We briefly describe them here. See Appendix B for details. We implement our models in the AllenNLP library (Gardner et al., 2017). Original code for the baselines is available at https://github.com/nyu-mll/GLUE-baselines and a newer version is available at https://github.com/jsalt18-sentence-repl/jiant.
106
+
107
+ Architecture Our simplest baseline architecture is based on sentence-to-vector encoders, and sets aside GLUE’s ability to evaluate models with more complex structures. Taking inspiration from Conneau et al. (2017), the model uses a two-layer, 1500D (per direction) BiLSTM with max pooling and 300D GloVe word embeddings (840B Common Crawl version; Pennington et al., 2014). For single-sentence tasks, we encode the sentence and pass the resulting vector to a classifier. For sentence-pair tasks, we encode sentences independently to produce vectors $u , v$ , and pass $[ u ; v ; | u -$ $v | ; u * v ]$ to a classifier. The classifier is an MLP with a 512D hidden layer.
108
+
109
+ We also consider a variant of our model which for sentence pair tasks uses an attention mechanism inspired by Seo et al. (2017) between all pairs of words, followed by a second BiLSTM with max pooling. By explicitly modeling the interaction between sentences, these models fall outside the sentence-to-vector paradigm.
110
+
111
+ Pre-Training We augment our base model with two recent methods for pre-training: ELMo and CoVe. We use existing trained models for both.
112
+
113
+ ELMo uses a pair of two-layer neural language models trained on the Billion Word Benchmark (Chelba et al., 2013). Each word is represented by a contextual embedding, produced by taking a
114
+
115
+ <table><tr><td rowspan="2">Model</td><td rowspan="2">Avg</td><td colspan="2">Single Sentence</td><td colspan="3">Similarity and Paraphrase</td><td colspan="4">Natural Language Inference</td></tr><tr><td>CoLA</td><td>SST-2</td><td>MRPC</td><td>QQP</td><td>STS-B</td><td>MNLI</td><td>QNLI</td><td>RTE</td><td>WNLI</td></tr><tr><td colspan="10">Single-Task Training</td></tr><tr><td>BiLSTM</td><td>63.9</td><td>15.7</td><td>85.9</td><td>69.3/79.4</td><td>81.7/61.4</td><td>66.0/62.8</td><td>70.3/70.8</td><td>75.7</td><td>52.8</td><td>65.1</td></tr><tr><td>+ELMo</td><td>66.4</td><td>35.0</td><td>90.2</td><td>69.0/80.8</td><td>85.7/65.6</td><td>64.0/60.2</td><td>72.9/73.4</td><td>71.7</td><td>50.1</td><td>65.1</td></tr><tr><td>+CoVe</td><td>64.0</td><td>14.5</td><td>88.5</td><td>73.4/81.4</td><td>83.3/59.4</td><td>67.2/64.1</td><td>64.5/64.8</td><td>75.4</td><td>53.5</td><td>65.1</td></tr><tr><td>+Attn</td><td>63.9</td><td>15.7</td><td>85.9</td><td>68.5/80.3</td><td>83.5/62.9</td><td>59.3/55.8</td><td>74.2/73.8</td><td>77.2</td><td>51.9</td><td>65.1</td></tr><tr><td>+Attn, ELMo</td><td>66.5</td><td>35.0</td><td>90.2</td><td>68.8/80.2</td><td>86.5/66.1</td><td>55.5/52.5</td><td>76.9/76.7</td><td>76.7</td><td>50.4</td><td>65.1</td></tr><tr><td>+Attn,CoVe</td><td>63.2</td><td>14.5</td><td>88.5</td><td>68.6/79.7</td><td>84.1/60.1</td><td>57.2/53.6</td><td>71.6/71.5</td><td>74.5</td><td>52.7</td><td>65.1</td></tr><tr><td colspan="10">Multi-Task Training</td></tr><tr><td>BiLSTM</td><td>64.2</td><td>11.6</td><td>82.8</td><td>74.3/81.8</td><td>84.2/62.5</td><td>70.3/67.8</td><td>65.4/66.1</td><td>74.6</td><td>57.4</td><td>65.1</td></tr><tr><td>+ELMo</td><td>67.7</td><td>32.1</td><td>89.3</td><td>78.0/84.7</td><td>82.6/61.1</td><td>67.2/67.9</td><td>70.3/67.8</td><td>75.5</td><td>57.4</td><td>65.1</td></tr><tr><td>+CoVe</td><td>62.9</td><td>18.5</td><td>81.9</td><td>71.5/78.7</td><td>84.9/60.6</td><td>64.4/62.7</td><td>65.4/65.7</td><td>70.8</td><td>52.7</td><td>65.1</td></tr><tr><td>+Attn</td><td>65.6</td><td>18.6</td><td>83.0</td><td>76.2/83.9</td><td>82.4/60.1</td><td>72.8/70.5</td><td>67.6/68.3</td><td>74.3</td><td>58.4</td><td>65.1</td></tr><tr><td>+Attn,ELMo</td><td>70.0</td><td>33.6</td><td>90.4</td><td>78.0/84.4</td><td>84.3/63.1</td><td>74.2/72.3</td><td>74.1/74.5</td><td>79.8</td><td>58.9</td><td>65.1</td></tr><tr><td>+Attn,CoVe</td><td>63.1</td><td>8.3</td><td>80.7</td><td>71.8/80.0</td><td>83.4/60.5</td><td>69.8/68.4</td><td>68.1/68.6</td><td>72.9</td><td>56.0</td><td>65.1</td></tr><tr><td colspan="10">Pre-Trained Sentence Representation Models</td></tr><tr><td>CBoW</td><td>58.9</td><td>0.0</td><td>80.0</td><td>73.4/81.5</td><td>79.1/51.4</td><td>61.2/58.7</td><td>56.0/56.4</td><td>72.1</td><td>54.1</td><td>65.1</td></tr><tr><td>Skip-Thought</td><td>61.3</td><td>0.0</td><td>81.8</td><td>71.7/80.8</td><td>82.2/56.4</td><td>71.8/69.7</td><td>62.9/62.8</td><td>72.9</td><td>53.1</td><td>65.1</td></tr><tr><td>InferSent</td><td>63.9</td><td>4.5</td><td>85.1</td><td>74.1/81.2</td><td>81.7/59.1</td><td>75.9/75.3</td><td>66.1/65.7</td><td>72.7</td><td>58.0</td><td>65.1</td></tr><tr><td>DisSent</td><td>62.0</td><td>4.9</td><td>83.7</td><td>74.1/81.7</td><td>82.6/59.5</td><td>66.1/64.8</td><td>58.7/59.1</td><td>73.9</td><td>56.4</td><td>65.1</td></tr><tr><td>GenSen</td><td>66.2</td><td>7.7</td><td>83.1</td><td>76.6/83.0</td><td>82.9/59.8</td><td>79.3/79.2</td><td>71.4/71.3</td><td>78.6</td><td>59.2</td><td>65.1</td></tr></table>
116
+
117
+ Table 4: Baseline performance on the GLUE task test sets. For MNLI, we report accuracy on the matched and mismatched test sets. For MRPC and Quora, we report accuracy and F1. For STS-B, we report Pearson and Spearman correlation. For CoLA, we report Matthews correlation. For all other tasks we report accuracy. All values are scaled by 100. A similar table is presented on the online platform.
118
+
119
+ linear combination of the corresponding hidden states of each layer of the two models. We follow the authors’ recommendations6 and use ELMo embeddings in place of any other embeddings.
120
+
121
+ CoVe (McCann et al., 2017) uses a two-layer BiLSTM encoder originally trained for English-toGerman translation. The CoVe vector of a word is the corresponding hidden state of the top-layer LSTM. As in the original work, we concatenate the CoVe vectors to the GloVe word embeddings.
122
+
123
+ Training We train our models with the BiLSTM sentence encoder and post-attention BiLSTMs shared across tasks, and classifiers trained separately for each task. For each training update, we sample a task to train with a probability proportional to the number of training examples for each task. We train our models with Adam (Kingma & Ba, 2015) with initial learning rate $1 0 ^ { - 4 }$ and batch size 128. We use the macro-average score as the validation metric and stop training when the learning rate drops below $1 0 ^ { - 5 }$ or performance does not improve after 5 validation checks.
124
+
125
+ We also train a set of single-task models, which are configured and trained identically, but share no parameters. To allow for fair comparisons with the multi-task analogs, we do not tune parameter or training settings for each task, so these single-task models do not generally represent the state of the art for each task.
126
+
127
+ Sentence Representation Models Finally, we evaluate the following trained sentence-to-vector encoder models using our benchmark: average bag-of-words using GloVe embeddings (CBoW), Skip-Thought (Kiros et al., 2015), InferSent (Conneau et al., 2017), DisSent (Nie et al., 2017), and GenSen (Subramanian et al., 2018). For these models, we only train task-specific classifiers on the representations they produce.
128
+
129
+ Table 5: Results on the diagnostic set. We report $R _ { 3 }$ coefficients between gold and predicted labels, scaled by 100. The coarse-grained categories are Lexical Semantics (LS), Predicate-Argument Structure (PAS), Logic $\mathbf { \Pi } ( \mathbf { L } )$ , and Knowledge and Common Sense $\mathbf { \eta } ^ { ( \mathbf { K } ) }$ . Our example fine-grained categories are Universal Quantification (UQuant), Morphological Negation (MNeg), Double Negation (2Neg), Anaphora/Coreference (Coref), Restrictivity (Restr), and Downward Monotone (Down).
130
+
131
+ <table><tr><td rowspan="2">Model</td><td colspan="5">Coarse-Grained</td><td colspan="5">Fine-Grained</td><td rowspan="2">Down</td></tr><tr><td>All</td><td>LS</td><td>PAS</td><td>LK</td><td></td><td>UQuant</td><td>MNeg</td><td>2Neg</td><td>Coref</td><td>Restr</td></tr><tr><td colspan="10">Single-Task Training</td><td></td><td></td></tr><tr><td>BiLSTM</td><td>21</td><td>25</td><td>24</td><td>16</td><td>16</td><td>70</td><td>53</td><td>4</td><td>21</td><td>-15</td><td>12</td></tr><tr><td>+ELMo</td><td>20</td><td>20</td><td>21</td><td>14</td><td>17</td><td>70</td><td>20</td><td>42</td><td>33</td><td>-26</td><td>-3</td></tr><tr><td>+CoVe</td><td>21</td><td>19</td><td>23</td><td>20</td><td>18</td><td>71</td><td>47</td><td>-1</td><td>33</td><td>-15</td><td>8</td></tr><tr><td>+Attn</td><td>25</td><td>24</td><td>30</td><td>20</td><td>14</td><td>50</td><td>47</td><td>21</td><td>38</td><td>-8</td><td>-3</td></tr><tr><td>+Attn, ELMo +Attn, CoVe</td><td>28</td><td>30</td><td>35</td><td>23</td><td>14</td><td>85</td><td>20</td><td>42</td><td>33</td><td>-26</td><td>-3</td></tr><tr><td></td><td>24</td><td>29</td><td>29</td><td>18</td><td>12</td><td>77</td><td>50</td><td>1</td><td>18</td><td>-1</td><td>12</td></tr><tr><td colspan="10">Multi-Task Training</td><td></td><td></td></tr><tr><td>BiLSTM</td><td>20</td><td>13</td><td>24</td><td>14</td><td>22</td><td>71</td><td>17</td><td>-8</td><td>31</td><td>-15</td><td>8</td></tr><tr><td>+ELMo</td><td>21</td><td>20</td><td>21</td><td>19</td><td>21</td><td>71</td><td>60</td><td>2</td><td>22</td><td>0</td><td>12</td></tr><tr><td>+CoVe</td><td>18</td><td>15</td><td>11</td><td>18</td><td>27</td><td>71</td><td>40</td><td>7</td><td>40</td><td>0</td><td>8</td></tr><tr><td>+Attn</td><td>18</td><td>13</td><td>24</td><td>11</td><td>16</td><td>71</td><td>1</td><td>-12</td><td>31</td><td>-15</td><td>8</td></tr><tr><td>+Attn, ELMo +Attn, CoVe</td><td>22</td><td>18</td><td>26</td><td>13</td><td>19</td><td>70</td><td>27</td><td>5</td><td>31</td><td>-26</td><td>-3</td></tr><tr><td></td><td>18</td><td>16</td><td>25</td><td>16</td><td>13</td><td>71</td><td>26</td><td>-8</td><td>33</td><td>9</td><td>8</td></tr><tr><td colspan="10">Pre-Trained Sentence Representation Models</td><td></td><td></td></tr><tr><td>CBoW</td><td>9</td><td>6</td><td>13</td><td>5</td><td>10</td><td>3</td><td>0</td><td>13</td><td>28</td><td>-15</td><td>-11</td></tr><tr><td>Skip-Thought</td><td>12</td><td>2</td><td>23</td><td>11</td><td>9</td><td>61</td><td>6</td><td>-2</td><td>30</td><td>-15</td><td>0</td></tr><tr><td>InferSent</td><td>18</td><td>20</td><td>20</td><td>15</td><td>14</td><td>77</td><td>50</td><td>-20</td><td>15</td><td>-15</td><td>-9</td></tr><tr><td>DisSent</td><td>16</td><td>16</td><td>19</td><td>13</td><td>15</td><td>70</td><td>43</td><td>-11</td><td>20</td><td>-36</td><td>-09</td></tr><tr><td>GenSen</td><td>20</td><td>28</td><td>26</td><td>14</td><td>12</td><td>78</td><td>57</td><td>2</td><td>21</td><td>-15</td><td>12</td></tr></table>
132
+
133
+ # 6 BENCHMARK RESULTS
134
+
135
+ We train three runs of each model and evaluate the run with the best macro-average development set performance (see Table 6 in Appendix C). For single-task and sentence representation models, we evaluate the best run for each individual task. We present performance on the main benchmark tasks in Table 4.
136
+
137
+ We find that multi-task training yields better overall scores over single-task training amongst models using attention or ELMo. Attention generally has negligible or negative aggregate effect in single task training, but helps in multi-task training. We see a consistent improvement in using ELMo embeddings in place of GloVe or CoVe embeddings, particularly for single-sentence tasks. Using CoVe has mixed effects over using only GloVe.
138
+
139
+ Among the pre-trained sentence representation models, we observe fairly consistent gains moving from CBoW to Skip-Thought to Infersent and GenSen. Relative to the models trained directly on the GLUE tasks, InferSent is competitive and GenSen outperforms all but the two best.
140
+
141
+ Looking at results per task, we find that the sentence representation models substantially underperform on CoLA compared to the models directly trained on the task. On the other hand, for STS-B, models trained directly on the task lag significantly behind the performance of the best sentence representation model. Finally, there are tasks for which no model does particularly well. On WNLI, no model exceeds most-frequent-class guessing $( 6 5 . 1 \% )$ and we substitute the model predictions for the most-frequent baseline. On RTE and in aggregate, even our best baselines leave room for improvement. These early results indicate that solving GLUE is beyond the capabilities of current models and methods.
142
+
143
+ # 7 ANALYSIS
144
+
145
+ We analyze the baselines by evaluating each model’s MNLI classifier on the diagnostic set to get a better sense of their linguistic capabilities. Results are presented in Table 5.
146
+
147
+ Coarse Categories Overall performance is low for all models: The highest total score of 28 still denotes poor absolute performance. Performance tends to be higher on Predicate-Argument Structure and lower on Logic, though numbers are not closely comparable across categories. Unlike on the main benchmark, the multi-task models are almost always outperformed by their single-task counterparts. This is perhaps unsurprising, since with our simple multi-task training regime, there is likely some destructive interference between MNLI and the other tasks. The models trained on the GLUE tasks largely outperform the pretrained sentence representation models, with the exception of GenSen. Using attention has a greater influence on diagnostic scores than using ELMo or CoVe, which we take to indicate that attention is especially important for generalization in NLI.
148
+
149
+ Fine-Grained Subcategories Most models handle universal quantification relatively well. Looking at relevant examples, it seems that relying on lexical cues such as “all” often suffices for good performance. Similarly, lexical cues often provide good signal in morphological negation examples.
150
+
151
+ We observe varying weaknesses between models. Double negation is especially difficult for the GLUE-trained models that only use GloVe embeddings. This is ameliorated by ELMo, and to some degree CoVe. Also, attention has mixed effects on overall results, and models with attention tend to struggle with downward monotonicity. Examining their predictions, we found that the models are sensitive to hypernym/hyponym substitution and word deletion as a signal of entailment, but predict it in the wrong direction (as if the substituted/deleted word were in an upward monotone context). This is consistent with recent findings by McCoy & Linzen (2019) that these systems use the subsequence relation between premise and hypothesis as a heuristic shortcut. Restrictivity examples, which often depend on nuances of quantifier scope, are especially difficult for almost all models.
152
+
153
+ Overall, there is evidence that going beyond sentence-to-vector representations, e.g. with an attention mechanism, might aid performance on out-of-domain data, and that transfer methods like ELMo and CoVe encode linguistic information specific to their supervision signal. However, increased representational capacity may lead to overfitting, such as the failure of attention models in downward monotone contexts. We expect that our platform and diagnostic dataset will be useful for similar analyses in the future, so that model designers can better understand their models’ generalization behavior and implicit knowledge.
154
+
155
+ # 8 CONCLUSION
156
+
157
+ We introduce GLUE, a platform and collection of resources for evaluating and analyzing natural language understanding systems. We find that, in aggregate, models trained jointly on our tasks see better performance than the combined performance of models trained for each task separately. We confirm the utility of attention mechanisms and transfer learning methods such as ELMo in NLU systems, which combine to outperform the best sentence representation models on the GLUE benchmark, but still leave room for improvement. When evaluating these models on our diagnostic dataset, we find that they fail (often spectacularly) on many linguistic phenomena, suggesting possible avenues for future work. In sum, the question of how to design general-purpose NLU models remains unanswered, and we believe that GLUE can provide fertile soil for addressing this challenge.
158
+
159
+ # ACKNOWLEDGMENTS
160
+
161
+ We thank Ellie Pavlick, Tal Linzen, Kyunghyun Cho, and Nikita Nangia for their comments on this work at its early stages, and we thank Ernie Davis, Alex Warstadt, and Quora’s Nikhil Dandekar and Kornel Csernai for providing access to private evaluation data. This project has benefited from financial support to SB by Google, Tencent Holdings, and Samsung Research, and to AW from AdeptMind and an NSF Graduate Research Fellowship.
162
+
163
+ # REFERENCES
164
+
165
+ Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In Proceedings of the International Conference on Learning Representations, 2015.
166
+
167
+ Roy Bar Haim, Ido Dagan, Bill Dolan, Lisa Ferro, Danilo Giampiccolo, Bernardo Magnini, and Idan Szpektor. The second PASCAL recognising textual entailment challenge. 2006.
168
+
169
+ Luisa Bentivogli, Ido Dagan, Hoa Trang Dang, Danilo Giampiccolo, and Bernardo Magnini. The fifth PASCAL recognizing textual entailment challenge. 2009.
170
+
171
+ Samuel R. Bowman, Gabor Angeli, Christopher Potts, and Christopher D. Manning. A large annotated corpus for learning natural language inference. In Proceedings of the Conference on Empirical Methods in Natural Language Processing, pp. 632–642. Association for Computational Linguistics, 2015.
172
+
173
+ Daniel Cer, Mona Diab, Eneko Agirre, Inigo Lopez-Gazpio, and Lucia Specia. Semeval-2017 task 1: Semantic textual similarity-multilingual and cross-lingual focused evaluation. In Eleventh International Workshop on Semantic Evaluations, 2017.
174
+
175
+ Ciprian Chelba, Tomas Mikolov, Mike Schuster, Qi Ge, Thorsten Brants, Phillipp Koehn, and Tony Robinson. One billion word benchmark for measuring progress in statistical language modeling. arXiv preprint 1312.3005, 2013.
176
+
177
+ Ronan Collobert, Jason Weston, Leon Bottou, Michael Karlen, Koray Kavukcuoglu, and Pavel ´ Kuksa. Natural language processing (almost) from scratch. Journal of Machine Learning Research, 12(Aug):2493–2537, 2011.
178
+
179
+ Alexis Conneau and Douwe Kiela. SentEval: An evaluation toolkit for universal sentence representations. In Proceedings of the Eleventh International Conference on Language Resources and Evaluation, 2018.
180
+
181
+ Alexis Conneau, Douwe Kiela, Holger Schwenk, Lo¨ıc Barrault, and Antoine Bordes. Supervised learning of universal sentence representations from natural language inference data. In Proceedings of the Conference on Empirical Methods in Natural Language Processing, Copenhagen, Denmark, September 9-11, 2017, pp. 681–691, 2017.
182
+
183
+ Robin Cooper, Dick Crouch, Jan Van Eijck, Chris Fox, Josef Van Genabith, Jan Jaspars, Hans Kamp, David Milward, Manfred Pinkal, Massimo Poesio, Steve Pulman, Ted Briscoe, Holger Maier, and Karsten Konrad. Using the framework. Technical report, The FraCaS Consortium, 1996.
184
+
185
+ Ido Dagan, Oren Glickman, and Bernardo Magnini. The PASCAL recognising textual entailment challenge. In Machine learning challenges. evaluating predictive uncertainty, visual object classification, and recognising tectual entailment, pp. 177–190. Springer, 2006.
186
+
187
+ Dorottya Demszky, Kelvin Guu, and Percy Liang. Transforming question answering datasets into natural language inference datasets. arXiv preprint 1809.02922, 2018.
188
+
189
+ William B Dolan and Chris Brockett. Automatically constructing a corpus of sentential paraphrases. In Proceedings of the International Workshop on Paraphrasing, 2005.
190
+
191
+ Allyson Ettinger, Sudha Rao, Hal Daume III, and Emily M Bender. Towards linguistically general- ´ izable NLP systems: A workshop and shared task. In First Workshop on Building Linguistically Generalizable NLP Systems, 2017.
192
+
193
+ Matt Gardner, Joel Grus, Mark Neumann, Oyvind Tafjord, Pradeep Dasigi, Nelson F. Liu, Matthew Peters, Michael Schmitz, and Luke S. Zettlemoyer. AllenNLP: A deep semantic natural language processing platform. 2017.
194
+
195
+ Danilo Giampiccolo, Bernardo Magnini, Ido Dagan, and Bill Dolan. The third PASCAL recognizing textual entailment challenge. In Proceedings of the ACL-PASCAL workshop on textual entailment and paraphrasing, pp. 1–9. Association for Computational Linguistics, 2007.
196
+
197
+ Jan Gorodkin. Comparing two k-category assignments by a k-category correlation coefficient. Comput. Biol. Chem., 28(5-6):367–374, December 2004. ISSN 1476-9271.
198
+
199
+ Suchin Gururangan, Swabha Swayamdipta, Omer Levy, Roy Schwartz, Samuel R. Bowman, and Noah A. Smith. Annotation artifacts in natural language inference data. In Proceedings of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, 2018.
200
+
201
+ Kazuma Hashimoto, Caiming Xiong, Yoshimasa Tsuruoka, and Richard Socher. A joint many-task model: Growing a neural network for multiple nlp tasks. In Proceedings of the Conference on Empirical Methods in Natural Language Processing, 2017.
202
+
203
+ Felix Hill, Kyunghyun Cho, and Anna Korhonen. Learning distributed representations of sentences from unlabelled data. In Proceedings of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, 2016.
204
+
205
+ Minqing Hu and Bing Liu. Mining and summarizing customer reviews. In Proceedings of the tenth ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 168–177. ACM, 2004.
206
+
207
+ Armand Joulin, Edouard Grave, Piotr Bojanowski, and Tomas Mikolov. Bag of tricks for efficient text classification. arXiv preprint 1607.01759, 2016.
208
+
209
+ Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Proceedings of the International Conference on Learning Representations, 2015.
210
+
211
+ Ryan Kiros, Yukun Zhu, Ruslan R Salakhutdinov, Richard Zemel, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Skip-Thought vectors. In Advances in Neural Information Processing Systems, pp. 3294–3302, 2015.
212
+
213
+ Quoc Le and Tomas Mikolov. Distributed representations of sentences and documents. In Eric P. Xing and Tony Jebara (eds.), Proceedings of the 31st International Conference on Machine Learning, volume 32 of Proceedings of Machine Learning Research, pp. 1188–1196, Bejing, China, 22–24 Jun 2014. PMLR.
214
+
215
+ Hector J Levesque, Ernest Davis, and Leora Morgenstern. The Winograd schema challenge. In AAAI Spring Symposium: Logical Formalizations of Commonsense Reasoning, volume 46, pp. 47, 2011.
216
+
217
+ Brian W Matthews. Comparison of the predicted and observed secondary structure of t4 phage lysozyme. Biochimica et Biophysica Acta (BBA)-Protein Structure, 405(2):442–451, 1975.
218
+
219
+ Bryan McCann, James Bradbury, Caiming Xiong, and Richard Socher. Learned in translation: Contextualized word vectors. In Advances in Neural Information Processing Systems, pp. 6297– 6308, 2017.
220
+
221
+ Bryan McCann, Nitish Shirish Keskar, Caiming Xiong, and Richard Socher. The natural language decathlon: Multitask learning as question answering. arXiv preprint 1806.08730, 2018.
222
+
223
+ R. Thomas McCoy and Tal Linzen. Non-entailed subsequences as a challenge for natural language inference. In Proceedings of the Society for Computation in Linguistics, volume 2, pp. 357–360, 2019.
224
+
225
+ Allen Nie, Erin D Bennett, and Noah D Goodman. Dissent: Sentence representation learning from explicit discourse relations. arXiv preprint 1710.04334, 2017.
226
+
227
+ Bo Pang and Lillian Lee. A sentimental education: Sentiment analysis using subjectivity summarization based on minimum cuts. In Proceedings of the 42nd Annual Meeting on Association for Computational Linguistics, pp. 271. Association for Computational Linguistics, 2004.
228
+
229
+ Bo Pang and Lillian Lee. Seeing stars: Exploiting class relationships for sentiment categorization with respect to rating scales. In Proceedings of the 43rd Annual Meeting on Association for Computational Linguistics, pp. 115–124. Association for Computational Linguistics, 2005.
230
+
231
+ Jeffrey Pennington, Richard Socher, and Christopher Manning. GloVe: Global vectors for word representation. In Proceedings of the Conference on Empirical Methods in Natural Language processing, pp. 1532–1543, 2014.
232
+
233
+ Matthew E Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. In Proceedings of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, 2018.
234
+
235
+ Adam Poliak, Jason Naradowsky, Aparajita Haldar, Rachel Rudinger, and Benjamin Van Durme. Hypothesis only baselines in natural language inference. In \*SEM@NAACL-HLT, 2018.
236
+
237
+ Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. SQuAD: $1 0 0 { , } 0 0 0 { + }$ questions for machine comprehension of text. In Proceedings of the Conference on Empirical Methods in Natural Language Processing, pp. 2383–2392. Association for Computational Linguistics, 2016.
238
+
239
+ Tim Rocktaschel, Edward Grefenstette, Moritz Hermann, Karl, Tom ¨ a´s Ko ˇ cisk ˇ y, and Phil Blunsom. \` Reasoning about entailment with neural attention. In Proceedings of the International Conference on Learning Representations, 2016.
240
+
241
+ Sebastian Ruder, Joachim Bingel, Isabelle Augenstein, and Anders Søgaard. Sluice networks: Learning what to share between loosely related tasks. arXiv preprint 1705.08142, 2017.
242
+
243
+ Roy Schwartz, Maarten Sap, Ioannis Konstas, Li Zilles, Yejin Choi, and Noah A. Smith. The effect of different writing tasks on linguistic style: A case study of the ROC story cloze task. In Proceedings of CoNLL, 2017.
244
+
245
+ Minjoon Seo, Aniruddha Kembhavi, Ali Farhadi, and Hannaneh Hajishirzi. Bidirectional attention flow for machine comprehension. In Proceedings of the International Conference of Learning Representations, 2017.
246
+
247
+ Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew $\mathrm { N g }$ , and Christopher Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the Conference on Empirical Methods in Natural Language Processing, pp. 1631–1642, 2013.
248
+
249
+ Anders Søgaard and Yoav Goldberg. Deep multi-task learning with low level tasks supervised at lower layers. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), volume 2, pp. 231–235, 2016.
250
+
251
+ Sandeep Subramanian, Adam Trischler, Yoshua Bengio, and Christopher J. Pal. Learning general purpose distributed sentence representations via large scale multi-task learning. In Proceedings of the International Conference on Learning Representations, 2018.
252
+
253
+ Masatoshi Tsuchiya. Performance Impact Caused by Hidden Bias of Training Data for Recognizing Textual Entailment. In Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC 2018), Miyazaki, Japan, May 7-12, 2018 2018. European Language Resources Association (ELRA).
254
+
255
+ 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, pp. 6000–6010, 2017.
256
+
257
+ Ellen M Voorhees et al. The TREC-8 question answering track report. In TREC, volume 99, pp. 77–82, 1999.
258
+
259
+ Alex Warstadt, Amanpreet Singh, and Samuel R Bowman. Neural network acceptability judgments. arXiv preprint 1805.12471, 2018.
260
+
261
+ Aaron Steven White, Pushpendre Rastogi, Kevin Duh, and Benjamin Van Durme. Inference is everything: Recasting semantic resources into a unified evaluation framework. In Proceedings of the Eighth International Joint Conference on Natural Language Processing (Volume 1: Long Papers), volume 1, pp. 996–1005, 2017.
262
+
263
+ Table 6: Baseline performance on the GLUE tasks’ development sets. For MNLI, we report accuracy averaged over the matched and mismatched test sets. For MRPC and QQP, we report accuracy and F1. For STS-B, we report Pearson and Spearman correlation. For CoLA, we report Matthews correlation. For all other tasks we report accuracy. All values are scaled by 100.
264
+
265
+ <table><tr><td rowspan="2">Model</td><td rowspan="2">Avg</td><td colspan="2"> Single Sentence</td><td colspan="3">Similarity and Paraphrase</td><td colspan="4">Natural Language Inference</td></tr><tr><td>CoLA</td><td>SST-2</td><td>MRPC</td><td>QQP</td><td>STS-B</td><td>MNLI</td><td>QNLI</td><td>RTE</td><td>WNLI</td></tr><tr><td colspan="10">Single-Task Training</td></tr><tr><td>BiLSTM</td><td>66.7</td><td>17.6</td><td>87.5</td><td>77.9/85.1</td><td>85.3/82.0</td><td>71.6/72.0</td><td>66.7</td><td>77.0</td><td>58.5</td><td>56.3</td></tr><tr><td>+ELMo</td><td>68.7</td><td>44.1</td><td>91.5</td><td>70.8/82.3</td><td>88.0/84.3</td><td>70.3/70.5</td><td>68.6</td><td>71.2</td><td>53.4</td><td>56.3</td></tr><tr><td>+CoVe</td><td>66.8</td><td>25.1</td><td>89.2</td><td>76.5/83.4</td><td>86.2/81.8</td><td>70.7/70.8</td><td>62.4</td><td>74.4</td><td>59.6</td><td>54.9</td></tr><tr><td>+Attn</td><td>66.9</td><td>17.6</td><td>87.5</td><td>72.8/82.9</td><td>87.7/83.9</td><td>66.6/66.7</td><td>70.0</td><td>77.2</td><td>58.5</td><td>60.6</td></tr><tr><td>+Attn,ELMo</td><td>67.9</td><td>44.1</td><td>91.5</td><td>71.1/82.1</td><td>87.8/83.6</td><td>57.9/56.1</td><td>72.4</td><td>75.2</td><td>52.7</td><td>56.3</td></tr><tr><td>+Attn, CoVe</td><td>65.6</td><td>25.1</td><td>89.2</td><td>72.8/82.4</td><td>86.1/81.3</td><td>59.4/58.0</td><td>67.9</td><td>72.5</td><td>58.1</td><td>57.7</td></tr><tr><td colspan="10">Multi-Task Training</td></tr><tr><td>BiLSTM</td><td>60.0</td><td>18.6</td><td>82.3</td><td>75.0/82.7</td><td>84.4/79.3</td><td>69.0/66.9</td><td>65.6</td><td>74.9</td><td>59.9</td><td>9.9</td></tr><tr><td>+ELMo</td><td>63.1</td><td>26.4</td><td>90.9</td><td>80.2/86.7</td><td>84.2/79.7</td><td>72.9/71.5</td><td>67.4</td><td>76.0</td><td>55.6</td><td>14.1</td></tr><tr><td>+CoVe</td><td>59.3</td><td>9.8</td><td>82.0</td><td>73.8/81.0</td><td>83.4/76.6</td><td>64.5/61.9</td><td>65.5</td><td>70.4</td><td>52.7</td><td>32.4</td></tr><tr><td>+Attn</td><td>60.5</td><td>15.2</td><td>83.1</td><td>77.5/85.1</td><td>82.6/77.2</td><td>72.4/70.5</td><td>68.0</td><td>73.7</td><td>61.7</td><td>9.9</td></tr><tr><td>+Attn, ELMo</td><td>67.3</td><td>36.7</td><td>91.1</td><td>80.6/86.6</td><td>84.6/79.6</td><td>74.4/72.9</td><td>74.6</td><td>80.4</td><td>61.4</td><td>22.5</td></tr><tr><td>+Attn, CoVe</td><td>61.4</td><td>17.4</td><td>82.1</td><td>71.3/80.1</td><td>83.4/77.7</td><td>68.6/66.7</td><td>68.2</td><td>73.2</td><td>58.5</td><td>29.6</td></tr><tr><td colspan="10">Pre-Trained Sentence Representation Models</td></tr><tr><td>CBoW</td><td>61.4</td><td>4.6</td><td>79.5</td><td>75.0/83.7</td><td>75.0/65.5</td><td>70.6/71.1</td><td>57.1</td><td>62.5</td><td>71.9</td><td>56.3</td></tr><tr><td>Skip-Thought</td><td>61.8</td><td>0.0</td><td>82.0</td><td>76.2/84.3</td><td>78.9/70.7</td><td>74.8/74.8</td><td>63.4</td><td>58.5</td><td>73.4</td><td>49.3</td></tr><tr><td>InferSent</td><td>65.7</td><td>8.6</td><td>83.9</td><td>76.5/84.1</td><td>81.7/75.9</td><td>80.2/80.4</td><td>67.8</td><td>63.5</td><td>71.5</td><td>56.3</td></tr><tr><td>DisSent</td><td>63.8</td><td>11.7</td><td>82.5</td><td>77.0/84.4</td><td>81.8/75.6</td><td>68.9/69.0</td><td>61.2</td><td>59.9</td><td>73.9</td><td>56.3</td></tr><tr><td>GenSen</td><td>67.8</td><td>10.3</td><td>87.2</td><td>80.4/86.2</td><td>82.6/76.6</td><td>81.3/81.8</td><td>71.4</td><td>62.5</td><td>78.4</td><td>56.3</td></tr></table>
266
+
267
+ Janyce Wiebe, Theresa Wilson, and Claire Cardie. Annotating expressions of opinions and emotions in language. In Proceedings of the International Conference on Language Resources and Evaluation, volume 39, pp. 165–210. Springer, 2005.
268
+
269
+ Adina Williams, Nikita Nangia, and Samuel R. Bowman. A broad-coverage challenge corpus for sentence understanding through inference. In Proceedings of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, 2018.
270
+
271
+ Yukun Zhu, Ryan Kiros, Rich Zemel, Ruslan Salakhutdinov, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Aligning books and movies: Towards story-like visual explanations by watching movies and reading books. In Proceedings of the International Conference on Computer Vision, pp. 19–27, 2015.
272
+
273
+ # A ADDITIONAL BENCHMARK DETAILS
274
+
275
+ QNLI To construct a balanced dataset, we select all pairs in which the most similar sentence to the question was not the answer sentence, as well as an equal amount of cases in which the correct sentence was the most similar to the question, but another distracting sentence was a close second. Our similarity metric is based on CBoW representations with pre-trained GloVe embeddings. This approach to converting pre-existing datasets into NLI format is closely related to recent work by White et al. (2017), as well as to the original motivation for textual entailment presented by Dagan et al. (2006). Both argue that many NLP tasks can be productively reduced to textual entailment.
276
+
277
+ # B ADDITIONAL BASELINE DETAILS
278
+
279
+ # B.1 ATTENTION MECHANISM
280
+
281
+ We implement our attention mechanism as follows: given two sequences of hidden states $u _ { 1 } , u _ { 2 } , \dotsc , u _ { M }$ and $v _ { 1 } , v _ { 2 } , \dotsc , v _ { N }$ , we first compute matrix $H$ where $H _ { i j } \ = \ u _ { i } \cdot v _ { j }$ . For each $u _ { i }$ , we get attention weights $\alpha _ { i }$ by taking a softmax over the $i ^ { t h }$ row of $H$ , and get the corresponding context vector $\begin{array} { r } { \tilde { v } _ { i } = \sum _ { j } \alpha _ { i j } v _ { j } } \end{array}$ by taking the attention-weighted sum of the $v _ { j }$ . We pass a second BiLSTM with max pooling over the sequence $[ u _ { 1 } ; \tilde { v } _ { 1 } ] , \ldots [ u _ { M } ; \tilde { v } _ { M } ]$ to produce $u ^ { \prime }$ . We process the $v _ { j }$ vectors analogously to obtain $v ^ { \prime }$ . Finally, we feed $[ u ^ { \prime } ; v ^ { \prime } ; | u ^ { \prime } - v ^ { \prime } | ; u ^ { \prime } * v ^ { \prime } ]$ into a classifier.
282
+
283
+ # B.2 TRAINING
284
+
285
+ We train our models with the BiLSTM sentence encoder and post-attention BiLSTMs shared across tasks, and classifiers trained separately for each task. For each training update, we sample a task to train with a probability proportional to the number of training examples for each task. We scale each task’s loss inversely proportional to the number of examples for that task, which we found to improve overall performance. We train our models with Adam (Kingma & Ba, 2015) with initial learning rate $1 0 ^ { - 3 }$ , batch size 128, and gradient clipping. We use macro-average score over all tasks as our validation metric, and perform a validation check every 10k updates. We divide the learning rate by 5 whenever validation performance does not improve. We stop training when the learning rate drops below $1 0 ^ { - 5 }$ or performance does not improve after 5 validation checks.
286
+
287
+ # B.3 SENTENCE REPRESENTATION MODELS
288
+
289
+ We evaluate the following sentence representation models:
290
+
291
+ 1. CBoW, the average of the GloVe embeddings of the tokens in the sentence.
292
+ 2. Skip-Thought (Kiros et al., 2015), a sequence-to-sequence(s) model trained to generate the previous and next sentences given the middle sentence. We use the original pre-trained model7 trained on sequences of sentences from the Toronto Book Corpus (Zhu et al. 2015, TBC).
293
+ 3. InferSent (Conneau et al., 2017), a BiLSTM with max-pooling trained on MNLI and SNLI.
294
+ 4. DisSent (Nie et al., 2017), a BiLSTM with max-pooling trained to predict the discourse marker (because, so, etc.) relating two sentences on data derived from TBC. We use the variant trained for eight-way classification.
295
+ 5. GenSen (Subramanian et al., 2018), a sequence-to-sequence model trained on a variety of supervised and unsupervised objectives. We use the variant of the model trained on both MNLI and SNLI, the Skip-Thought objective on TBC, and a constituency parsing objective on the Billion Word Benchmark.
296
+
297
+ We train task-specific classifiers on top of frozen sentence encoders, using the default parameters from SentEval. See https://github.com/nyu-mll/SentEval for details and code.
298
+
299
+ # C DEVELOPMENT SET RESULTS
300
+
301
+ The GLUE website limits users to two submissions per day in order to avoid overfitting to the private test data. To provide a reference for future work on GLUE, we present the best development set results achieved by our baselines in Table 6.
302
+
303
+ # D BENCHMARK WEBSITE DETAILS
304
+
305
+ GLUE’s online platform is built using React, Redux and TypeScript. We use Google Firebase for data storage and Google Cloud Functions to host and run our grading script when a submission is made. Figure 1 shows the visual presentation of our baselines on the leaderboard.
306
+
307
+ Figure 1: The benchmark website leaderboard. An expanded view shows additional details about each submission, including a brief prose description and parameter count.
308
+
309
+ <table><tr><td></td><td colspan="5">PRIMARY</td><td colspan="7">AUXILIARY</td></tr><tr><td>RankName</td><td>Model</td><td>URL</td><td>Score</td><td>CoLA</td><td>SST-2</td><td>MRPC</td><td>STS-B</td><td>QQP</td><td>MNLI-m MNLI-mm</td><td></td><td>QNLI</td><td>RTE</td><td>WNLI</td></tr><tr><td>1 GLUE Baselines</td><td>BiLSTM+ELMo+Attn</td><td>购</td><td>68.9</td><td>18.9</td><td>91.6</td><td>77.3/83.5</td><td>72.8/71.1</td><td>83.5/63.3</td><td>75.6</td><td>75.9</td><td>81.7</td><td>61.2</td><td>65.1</td></tr><tr><td></td><td>GenSen</td><td>#</td><td>66.6</td><td>7.7</td><td>83.1</td><td>76.6/83.0</td><td>79.3/79.2</td><td>82.9/59.8</td><td>71.4</td><td>71.3</td><td>82.3</td><td>59.2</td><td>65.1</td></tr><tr><td></td><td>Single Task BiLSTM+ELMo</td><td>□</td><td>66.2</td><td>35.0</td><td>90.2</td><td>69.0/80.8</td><td>64.0/60.2</td><td>85.7/65.6</td><td>72.9</td><td>73.4</td><td>69.4</td><td>50.1</td><td>65.1</td></tr><tr><td></td><td>BILSTM+Attn</td><td></td><td>65.7</td><td>0.0</td><td>85.0</td><td>75.1/83.7</td><td>73.9/71.8</td><td>84.3/63.6</td><td>72.2</td><td>72.1</td><td>82.1</td><td>61.7</td><td>63.7</td></tr><tr><td></td><td>BiLSTM+ELMo</td><td>四</td><td>64.9</td><td>27.5</td><td>89.6</td><td>76.2/83.5</td><td>67.0/65.9</td><td>78.5/57.8</td><td>67.1</td><td>68.0</td><td>66.7</td><td>55.7</td><td>62.3</td></tr><tr><td></td><td>Single Task BiLSTM+ELMo+Attn</td><td>□</td><td>64.8</td><td>35.0</td><td>90.2</td><td>68.8/80.2</td><td>55.5/52.5</td><td>86.5/66.1</td><td>76.9</td><td>76.7</td><td>61.1</td><td>50.3</td><td>65.1</td></tr><tr><td></td><td>InferSent</td><td>D</td><td>64.7</td><td>4.5</td><td>85.1</td><td>74.1/81.2</td><td>75.9/75.3</td><td>81.7/59.1</td><td>66.1</td><td>65.7</td><td>79.8</td><td>58.0</td><td>65.1</td></tr><tr><td></td><td>BiLSTM+CoVe+Attn</td><td>□</td><td>64.3</td><td>19.4</td><td>83.6</td><td>75.2/83.0</td><td>72.3/71.1</td><td>84.9/61.1</td><td>69.9</td><td>68.7</td><td>78.9</td><td>38.3</td><td>65.1</td></tr><tr><td></td><td>BILSTM</td><td></td><td>63.5</td><td>24.0</td><td>85.8</td><td>71.9/82.1</td><td>68.8/67.0</td><td>80.2/59.1</td><td>65.8</td><td>66.0</td><td>71.1</td><td>46.8</td><td>63.7</td></tr><tr><td></td><td>Single Task BiLSTM+CoVe</td><td>四</td><td>62.4</td><td>14.5</td><td>88.5</td><td>73.4/81.4</td><td>67.2/64.1</td><td>83.3/59.4</td><td>64.5</td><td>64.8</td><td>64.8</td><td>53.5</td><td>61.6</td></tr><tr><td></td><td>BiLSTM+CoVe</td><td>□</td><td>62.2</td><td>16.2</td><td>84.3</td><td>71.8/80.0</td><td>68.0/67.1</td><td>82.0/59.1</td><td>65.3</td><td>65.9</td><td>70.4</td><td>44.2</td><td>65.1</td></tr><tr><td></td><td>DisSent</td><td>配</td><td>62.1</td><td>4.9</td><td>83.7</td><td>74.1/81.7</td><td>66.1/64.8</td><td>82.6/59.5</td><td>58.7</td><td>59.1</td><td>75.2</td><td>56.4</td><td>65.1</td></tr><tr><td></td><td>Single Task BiLSTM</td><td></td><td>62.0</td><td>15.7</td><td>85.9</td><td>69.3/79.4</td><td>66.0/62.8</td><td>81.7/61.4</td><td>70.3</td><td>70.8</td><td>60.8</td><td>52.8</td><td>62.3</td></tr><tr><td></td><td>SKip-Thought</td><td>□</td><td>61.5</td><td>0.0</td><td>81.8</td><td>71.7/80.8</td><td>71.8/69.7</td><td>82.2/56.4</td><td>62.9</td><td>62.8</td><td>74.7</td><td>53.1</td><td>65.1</td></tr><tr><td></td><td>Single Task BiLSTM+CoVe+Attn</td><td>购</td><td>60.8</td><td>14.5</td><td>88.5</td><td>68.6/79.7</td><td>57.2/53.6</td><td>84.1/60.1</td><td>71.6</td><td>71.5</td><td>53.8</td><td>52.7</td><td>64.4</td></tr><tr><td></td><td>Single Task BiLSTM+Attn</td><td></td><td>60.0</td><td>15.7</td><td>85.9</td><td>68.5/80.3</td><td>59.3/55.8</td><td>83.5/62.9</td><td>74.2</td><td>73.8</td><td>51.9</td><td>51.9</td><td>55.5</td></tr><tr><td></td><td>CBOW</td><td></td><td>58.9</td><td>0.0</td><td>80.0</td><td>73.4/81.5</td><td>61.2/58.7</td><td>79.1/51.4</td><td>56.0</td><td>56.4</td><td>75.1</td><td>54.1</td><td>62.3</td></tr></table>
310
+
311
+ <table><tr><td>Category</td><td>Count</td><td>% Neutral</td><td>% Contradiction</td><td>% Entailment</td></tr><tr><td>Lexical Semantics</td><td>368</td><td>31.0</td><td>27.2</td><td>41.8</td></tr><tr><td>Predicate-Argument Structure</td><td>424</td><td>37.0</td><td>13.7</td><td>49.3</td></tr><tr><td>Logic</td><td>364</td><td>37.6</td><td>26.9</td><td>35.4</td></tr><tr><td>Knowledge</td><td>284</td><td>26.4</td><td>31.7</td><td>41.9</td></tr></table>
312
+
313
+ Table 7: Diagnostic dataset statistics by coarse-grained category. Note that some examples may be tagged with phenomena belonging to multiple categories.
314
+
315
+ # E ADDITIONAL DIAGNOSTIC DATA DETAILS
316
+
317
+ The dataset is designed to allow for analyzing many levels of natural language understanding, from word meaning and sentence structure to high-level reasoning and application of world knowledge. To make this kind of analysis feasible, we first identify four broad categories of phenomena: Lexical Semantics, Predicate-Argument Structure, Logic, and Knowledge. However, since these categories are vague, we divide each into a larger set of fine-grained subcategories. Descriptions of all of the fine-grained categories are given in the remainder of this section. These categories are just one lens that can be used to understand linguistic phenomena and entailment, and there is certainly room to argue about how examples should be categorized, what the categories should be, etc. These categories are not based on any particular linguistic theory, but broadly based on issues that linguists have often identified and modeled in the study of syntax and semantics.
318
+
319
+ The dataset is provided not as a benchmark, but as an analysis tool to paint in broad strokes the kinds of phenomena a model may or may not capture, and to provide a set of examples that can serve for error analysis, qualitative model comparison, and development of adversarial examples that expose a model’s weaknesses. Because the distribution of language is somewhat arbitrary, it will not be helpful to compare performance of the same model on different categories. Rather, we recommend comparing performance that different models score on the same category, or using the reported scores as a guide for error analysis.
320
+
321
+ We show coarse-grain category counts and label distributions of the diagnostic set in Table 7.
322
+
323
+ # E.1 LEXICAL SEMANTICS
324
+
325
+ These phenomena center on aspects of word meaning.
326
+
327
+ Lexical Entailment Entailment can be applied not only on the sentence level, but the word level. For example, we say “dog” lexically entails “animal” because anything that is a dog is also an animal, and “dog” lexically contradicts “cat” because it is impossible to be both at once. This relationship applies to many types of words (nouns, adjectives, verbs, many prepositions, etc.) and the relationship between lexical and sentential entailment has been deeply explored, e.g., in systems of natural logic. This connection often hinges on monotonicity in language, so many Lexical Entailment examples will also be tagged with one of the Monotone categories, though we do not do this in every case (see Monotonicity, under Logic).
328
+
329
+ Morphological Negation This is a special case of lexical contradiction where one word is derived from the other: from “affordable” to “unaffordable”, “agree” to “disagree”, etc. We also include examples like “ever” and “never”. We also label these examples with Negation or Double Negation, since they can be viewed as involving a word-level logical negation.
330
+
331
+ Factivity Propositions appearing in a sentence may be in any entailment relation with the sentence as a whole, depending on the context in which they appear. In many cases, this is determined by lexical triggers (usually verbs or adverbs) in the sentence. For example,
332
+
333
+ • “I recognize that X” entails “X”.
334
+ • “I did not recognize that X” entails “X”.
335
+ • “I believe that X” does not entail “X”.
336
+ • “I am refusing to do X” contradicts “I am doing X”.
337
+ • “I am not refusing to do X” does not contradict “I am doing X”.
338
+ • “I almost finished X” contradicts “I finished X”.
339
+ • “I barely finished X” entails “I finished X”.
340
+
341
+ Constructions like “I recognize that X” are often called factive, since the entailment (of $\mathrm { X }$ above, regarded as a presupposition) persists even under negation. Constructions like “I am refusing to do $X ^ { \ast }$ above are often called implicative, and are sensitive to negation. There are also cases where a sentence (non-)entails the existence of an entity mentioned in it, for example “I have found a unicorn” entails “A unicorn exists” while “I am looking for a unicorn” doesn’t necessarily entail “A unicorn exists”. Readings where the entity does not necessarily exist are often called intensional readings, since they seem to deal with the properties denoted by a description (its intension) rather than being reducible to the set of entities that match the description (its extension, which in cases of non-existence will be empty).
342
+
343
+ We place all examples involving these phenomena under the label of Factivity. While it often depends on context to determine whether a nested proposition or existence of an entity is entailed by the overall statement, very often it relies heavily on lexical triggers, so we place the category under Lexical Semantics.
344
+
345
+ Symmetry/Collectivity Some propositions denote symmetric relations, while others do not. For example, “John married Gary” entails “Gary married John” but “John likes Gary” does not entail “Gary likes John”. Symmetric relations can often be rephrased by collecting both arguments into the subject: “John met Gary” entails “John and Gary met”. Whether a relation is symmetric, or admits collecting its arguments into the subject, is often determined by its head word (e.g., “like”, “marry” or “meet”), so we classify it under Lexical Semantics.
346
+
347
+ Redundancy If a word can be removed from a sentence without changing its meaning, that means the word’s meaning was more-or-less adequately expressed by the sentence; so, identifying these cases reflects an understanding of both lexical and sentential semantics.
348
+
349
+ Named Entities Words often name entities that exist in the world. There are many different kinds of understanding we might wish to understand about these names, including their compositional structure (for example, the “Baltimore Police” is the same as the “Police of the City of Baltimore”) or their real-world referents and acronym expansions (for example, “SNL” is “Saturday Night Live”). This category is closely related to World Knowledge, but focuses on the semantics of names as lexical items rather than background knowledge about their denoted entities.
350
+
351
+ Quantifiers Logical quantification in natural language is often expressed through lexical triggers such as “every”, “most”, “some”, and “no”. While we reserve the categories in Quantification and Monotonicity for entailments involving operations on these quantifiers and their arguments, we choose to regard the interchangeability of quantifiers (e.g., in many cases “most” entails “many”) as a question of lexical semantics.
352
+
353
+ # E.2 PREDICATE-ARGUMENT STRUCTURE
354
+
355
+ An important component of understanding the meaning of a sentence is understanding how its parts are composed together into a whole. In this category, we address issues across that spectrum, from syntactic ambiguity to semantic roles and coreference.
356
+
357
+ Syntactic Ambiguity: Relative Clauses, Coordination Scope These two categories deal purely with resolving syntactic ambiguity. Relative clauses and coordination scope are both sources of a great amount of ambiguity in English.
358
+
359
+ Prepositional phrases Prepositional phrase attachment is a particularly difficult problem that syntactic parsers in NLP systems continue to struggle with. We view it as a problem both of syntax and semantics, since prepositional phrases can express a wide variety of semantic roles and often semantically apply beyond their direct syntactic attachment.
360
+
361
+ Core Arguments Verbs select for particular arguments, particularly subjects and objects, which might be interchangeable depending on the context or the surface form. One example is the ergative alternation: “Jake broke the vase” entails “the vase broke” but “Jake broke the vase” does not entail “Jake broke”. Other rearrangements of core arguments, such as those seen in Symmetry/Collectivity, also fall under the Core Arguments label.
362
+
363
+ Alternations: Active/Passive, Genitives/Partitives, Nominalization, Datives All four of these categories correspond to syntactic alternations that are known to follow specific patterns in English:
364
+
365
+ • Active/Passive: “I saw him” is equivalent to “He was seen by me” and entails “He was seen”.
366
+ • Genitives/Partitives: “the elephant’s foot” is the same thing as “the foot of the elephant”.
367
+ • Nominalization: “I caused him to submit his resignation” entails “I caused the submission of his resignation”.
368
+ • Datives: “I baked him a cake” entails “I baked a cake for him” and “I baked a cake” but not “I baked him”.
369
+
370
+ Ellipsis/Implicits Often, the argument of a verb or other predicate is omitted (elided) in the text, with the reader filling in the gap. We can construct entailment examples by explicitly filling in the gap with the correct or incorrect referents. For example, the premise “Putin is so entrenched within Russias ruling system that many of its members can imagine no other leader” entails “Putin is so entrenched within Russias ruling system that many of its members can imagine no other leader than Putin” and contradicts “Putin is so entrenched within Russias ruling system that many of its members can imagine no other leader than themselves.”
371
+
372
+ This is often regarded as a special case of anaphora, but we decided to split out these cases from explicit anaphora, which is often also regarded as a case of coreference (and attempted to some degree in modern coreference resolution systems).
373
+
374
+ Anaphora/Coreference Coreference refers to when multiple expressions refer to the same entity or event. It is closely related to Anaphora, where the meaning of an expression depends on another (antecedent) expression in context. These two phenomena have significant overlap; for example, pronouns (“she”, “we”, “it”) are anaphors that are co-referent with their antecedents. However, they also may occur independently, such as coreference between two definite noun phrases (e.g., “Theresa May ”and the “British Prime Minister”) that refer to the same entity, or anaphora from a word like “other” which requires an antecedent to distinguish something from. In this category we only include cases where there is an explicit phrase (anaphoric or not) that is co-referent with an antecedent or other phrase. We construct examples for these in much the same way as for Ellipsis/Implicits.
375
+
376
+ Intersectivity Many modifiers, especially adjectives, allow non-intersective uses, which affect their entailment behavior. For example:
377
+
378
+ • Intersective: “He is a violinist and an old surgeon” entails “He is an old violinist” and “He is a surgeon”.
379
+ • Non-intersective: “He is a violinist and a skilled surgeon” does not entail “He is a skilled violinist”.
380
+ • Non-intersective: “He is a fake surgeon” does not entail “He is a surgeon”.
381
+
382
+ Generally, an intersective use of a modifier, like “old” in “old men”, is one which may be interpreted as referring to the set of entities with both properties (they are old and they are men). Linguists often formalize this using set intersection, hence the name.
383
+
384
+ Intersectivity is related to Factivity. For example, “fake” may be regarded as a counter-implicative modifier, and these examples will be labeled as such. However, we choose to categorize intersectivity under predicate-argument structure rather than lexical semantics, because generally the same word will admit both intersective and non-intersective uses, so it may be regarded as an ambiguity of argument structure.
385
+
386
+ Restrictivity Restrictivity is most often used to refer to a property of uses of noun modifiers. In particular, a restrictive use of a modifier is one that serves to identify the entity or entities being described, whereas a non-restrictive use adds extra details to the identified entity. The distinction can often be highlighted by entailments:
387
+
388
+ • Restrictive: “I finished all of my homework due today” does not entail “I finished all of my homework”.
389
+ • Non-restrictive: “I got rid of all those pesky bedbugs” entails “I got rid of all those bedbugs”.
390
+
391
+ Modifiers that are commonly used non-restrictively are appositives, relative clauses starting with “which” or “who”, and expletives (e.g. “pesky”). Non-restrictive uses can appear in many forms.
392
+
393
+ # E.3 LOGIC
394
+
395
+ With an understanding of the structure of a sentence, there is often a baseline set of shallow conclusions that can be drawn using logical operators and often modeled using the mathematical tools of logic. Indeed, the development of mathematical logic was initially guided by questions about natural language meaning, from Aristotelian syllogisms to Fregean symbols. The notion of entailment is also borrowed from mathematical logic.
396
+
397
+ Propositional Structure: Negation, Double Negation, Conjunction, Disjunction, Conditionals All of the basic operations of propositional logic appear in natural language, and we tag them where they are relevant to our examples:
398
+
399
+ • Negation: “The cat sat on the mat” contradicts “The cat did not sit on the mat”. • Double negation: “The market is not impossible to navigate” entails “The market is possible to navigate”.
400
+
401
+ • Conjunction: “Temperature and snow consistency must be just right” entails “Temperature must be just right”.
402
+ Disjunction: “Life is either a daring adventure or nothing at all” does not entail, but is entailed by, “Life is a daring adventure”.
403
+ • Conditionals: “If both apply, they are essentially impossible” does not entail “They are essentially impossible”.
404
+
405
+ Conditionals are more complicated because their use in language does not always mirror their meaning in logic. For example, they may be used at a higher level than the at-issue assertion: “If you think about it, it’s the perfect reverse psychology tactic” entails “It’s the perfect reverse psychology tactic”.
406
+
407
+ Quantification: Universal, Existential Quantifiers are often triggered by words such as “all”, “some”, “many”, and “no”. There is a rich body of work modeling their meaning in mathematical logic with generalized quantifiers. In these two categories, we focus on straightforward inferences from the natural language analogs of universal and existential quantification:
408
+
409
+ • Universal: “All parakeets have two wings” entails, but is not entailed by, “My parakeet has two wings”.
410
+ • Existential: “Some parakeets have two wings” does not entail, but is entailed by, “My parakeet has two wings”.
411
+
412
+ Monotonicity: Upward Monotone, Downward Monotone, Non-Monotone Monotonicity is a property of argument positions in certain logical systems. In general, it gives a way of deriving entailment relations between expressions that differ on only one subexpression. In language, it can explain how some entailments propagate through logical operators and quantifiers.
413
+
414
+ For example, “pet” entails “pet squirrel”, which further entails “happy pet squirrel”. We can demonstrate how the quantifiers “a”, “no” and “exactly one” differ with respect to monotonicity:
415
+
416
+ • “I have a pet squirrel” entails “I have a pet”, but not “I have a happy pet squirrel”.
417
+ • “I have no pet squirrels” does not entail “I have no pets”, but does entail “I have no happy pet squirrels”.
418
+ • “I have exactly one pet squirrel” entails neither “I have exactly one pet” nor “I have exactly one happy pet squirrel”.
419
+
420
+ In all of these examples, “pet squirrel” appears in what we call the restrictor position of the quantifier. We say:
421
+
422
+ • “a” is upward monotone in its restrictor: an entailment in the restrictor yields an entailment of the whole statement.
423
+ • “no” is downward monotone in its restrictor: an entailment in the restrictor yields an entailment of the whole statement in the opposite direction.
424
+ • “exactly one” is non-monotone in its restrictor: entailments in the restrictor do not yield entailments of the whole statement.
425
+
426
+ In this way, entailments between sentences that are built off of entailments of sub-phrases almost always rely on monotonicity judgments; see, for example, Lexical Entailment. However, because this is such a general class of sentence pairs, to keep the Logic category meaningful we do not always tag these examples with monotonicity.
427
+
428
+ Richer Logical Structure: Intervals/Numbers, Temporal Some higher-level facets of reasoning have been traditionally modeled using logic, such as actual mathematical reasoning (entailments based off of numbers) and temporal reasoning (which is often modeled as reasoning about a mathematical timeline).
429
+
430
+ • Intervals/Numbers: “I have had more than 2 drinks tonight” entails “I have had more than 1 drink tonight”. • Temporal: “Mary left before John entered” entails “John entered after Mary left”.
431
+
432
+ # E.4 KNOWLEDGE
433
+
434
+ Strictly speaking, world knowledge and common sense are required on every level of language understanding for disambiguating word senses, syntactic structures, anaphora, and more. So our entire suite (and any test of entailment) does test these features to some degree. However, in these categories, we gather examples where the entailment rests not only on correct disambiguation of the sentences, but also application of extra knowledge, whether concrete knowledge about world affairs or more common-sense knowledge about word meanings or social or physical dynamics.
435
+
436
+ World Knowledge In this category we focus on knowledge that can clearly be expressed as facts, as well as broader and less common geographical, legal, political, technical, or cultural knowledge. Examples:
437
+
438
+ • “This is the most oniony article I’ve seen on the entire internet” entails “This article reads like satire”.
439
+ • “The reaction was strongly exothermic” entails “The reaction media got very hot”.
440
+ • “There are amazing hikes around Mt. Fuji” entails “There are amazing hikes in Japan” but not “There are amazing hikes in Nepal”.
441
+
442
+ Common Sense In this category we focus on knowledge that is more difficult to express as facts and that we expect to be possessed by most people independent of cultural or educational background. This includes a basic understanding of physical and social dynamics as well as lexical meaning (beyond simple lexical entailment or logical relations). Examples:
443
+
444
+ • “The announcement of Tillerson’s departure sent shock waves across the globe” contradicts “People across the globe were prepared for Tillerson’s departure”.
445
+ • “Marc Sims has been seeing his barber once a week, for several years” entails “Marc Sims has been getting his hair cut once a week, for several years”.
446
+ “Hummingbirds are really attracted to bright orange and red (hence why the feeders are usually these colours)” entails “The feeders are usually coloured so as to attract hummingbirds”.
parse/train/rJ4km2R5t7/rJ4km2R5t7_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/rJ4km2R5t7/rJ4km2R5t7_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/rJ4km2R5t7/rJ4km2R5t7_model.json ADDED
The diff for this file is too large to render. See raw diff